Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
华
华夏模拟理财_20250701
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
SparkProjects
华夏模拟理财_20250701
Commits
608d58e4
Commit
608d58e4
authored
Aug 04, 2025
by
俞嘉婷
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 红包雨开始结束逻辑重构
parent
0d3d42c4
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
34 additions
and
33 deletions
+34
-33
main.ts
mock/main.ts
+7
-20
HomePage.tsx
src/pages/HomePage/HomePage.tsx
+7
-7
index.jsx
src/panels/redPackCountPanel/index.jsx
+6
-0
redPackRainModal.tsx
src/panels/redPackRainModal/redPackRainModal.tsx
+1
-1
store.ts
src/store/store.ts
+13
-5
No files found.
mock/main.ts
View file @
608d58e4
...
...
@@ -49,25 +49,13 @@ export default [
message
:
""
,
timeStamp
:
Date
.
now
(),
data
:
{
"redRainConfig"
:
[
{
"channel"
:
"1"
,
"endTime"
:
"14:00:00"
,
"joinStatus"
:
true
,
"rainId"
:
"1"
,
"ruId"
:
null
,
"startTime"
:
"08:00:00"
"redRainConfig"
:
{
canJoin
:
false
,
// 是否可参与,true-可参与
haveNext
:
true
,
// 是否有下一场,true-是
nextRainBeginTime
:
Date
.
now
()
+
1
*
24
*
60
*
60
*
1000
,
// 下一场红包雨开始时间戳,haveNext返回true时才有值
redRainCountDownTime
:
10
,
// 红包雨倒计时长(单位:秒)
redRainId
:
'1'
,
// 红包雨id
},
{
"channel"
:
"1"
,
"endTime"
:
"23:00:00"
,
"joinStatus"
:
true
,
"rainId"
:
"2"
,
"ruId"
:
null
,
"startTime"
:
"20:01:30"
}
],
"redRainCountDownTime"
:
0
,
actStartTime
:
Date
.
now
()
-
1
*
24
*
60
*
60
*
1000
,
actEndTime
:
Date
.
now
()
+
3
*
24
*
60
*
60
*
1000
,
endPoint
:
Date
.
now
()
+
0.0001
*
24
*
60
*
60
*
1000
,
...
...
@@ -75,7 +63,6 @@ export default [
uid
:
'234234'
,
productEnd
:
false
,
taskWealth
:
3004044
,
todayPopFlag
:
true
,
ruleText
:
'rulerulerulerulerulerulerule'
,
"bigStartConfig"
:
new
Array
(
6
).
fill
(
1
).
map
((
_
,
index
)
=>
{
if
(
index
===
0
)
{
...
...
src/pages/HomePage/HomePage.tsx
View file @
608d58e4
...
...
@@ -16,14 +16,12 @@ import ResPage from '../ResPage/ResPage';
import
Countdown
from
'@/core/components/ComCountdown/index.jsx'
;
import
ProductListPage
from
'../productListPage/productListPage'
;
import
PrizePage
from
"@/pages/PrizePage/PrizePage.tsx"
;
import
RedPackRainModal
from
'@/panels/redPackRainModal/redPackRainModal'
;
import
{
NewbieModal
}
from
'@/panels/newbieModal/newbieModal'
;
import
SignCom
from
'@/panels/signCom/signCom.jsx'
;
import
{
SvgaPlayer
}
from
'@grace/svgaplayer'
;
import
mainPageTitle
from
'../../assets/svga/mainPageTitle.svga'
;
import
redFenwei
from
'../../assets/svga/redFenwei.svga'
;
import
RedPackCountPanel
from
'@/panels/redPackCountPanel/index.jsx'
;
import
FirstPop
from
'@/panels/firstPop/firstPop'
;
@
observer
class
HomePage
extends
React
.
Component
<
any
,
any
>
{
...
...
@@ -43,10 +41,6 @@ class HomePage extends React.Component<any, any> {
async
componentDidMount
()
{
await
store
.
judgeIsWhiteUser
();
store
.
judgeRedModal
();
if
(
store
.
indexData
?.
firstMoneyPop
)
{
ModalCtrl
.
showModal
(
FirstPop
,
store
.
indexData
?.
firstMoneyPop
);
}
const
{
bigStartConfig
,
virtualAssets
}
=
store
.
indexData
;
const
lockArr
=
(
bigStartConfig
||
[]).
filter
(
el
=>
{
...
...
@@ -72,7 +66,6 @@ class HomePage extends React.Component<any, any> {
backOrder
:
lockArr
.
length
-
2
,
})
this
.
updateIndex
();
// ModalCtrl.showModal(RedPackRainModal)
}
// 更新红包轮播索引
timer
=
null
;
...
...
@@ -203,11 +196,14 @@ class HomePage extends React.Component<any, any> {
componentWillUnmount
():
void
{
clearTimeout
(
this
.
timer
);
/*
clearTimeout(store.leftOpenId);
store.leftOpenId = null;
store.leftOpenTime = 0;
*/
}
/*
getRedCountDown(redRainConfig) {
const now = new Date().getTime();
const today = dateFormatter(new Date(), 'yyyy-MM-dd');
...
...
@@ -238,10 +234,14 @@ class HomePage extends React.Component<any, any> {
}
}
}
*/
render
()
{
const
{
curTab
}
=
this
.
state
;
const
{
bigStartConfig
,
virtualAssets
,
checkIn
,
recommendProductConfig
,
productEnd
,
endPoint
,
currentTime
,
redRainConfig
,
giftPop
}
=
store
.
indexData
/*
const redDownTime = this.getRedCountDown(redRainConfig || []);
*/
const
redDownTime
=
redRainConfig
?.
haveNext
?
redRainConfig
?.
nextRainBeginTime
-
currentTime
:
0
;
// 推荐产品
const
rProductList
=
recommendProductConfig
?.
filter
((
item
)
=>
+
item
.
status
===
0
)
// 我的持仓
...
...
src/panels/redPackCountPanel/index.jsx
View file @
608d58e4
...
...
@@ -20,6 +20,8 @@ class RedPackCountPanel extends React.Component {
close
=
()
=>
{
ModalCtrl
.
closeModal
()
}
/*
getRedCountDown(redRainConfig) {
const now = new Date().getTime();
const today = dateFormatter(new Date(), 'yyyy-MM-dd');
...
...
@@ -50,9 +52,13 @@ class RedPackCountPanel extends React.Component {
}
}
}
*/
render
()
{
const
{
redRainConfig
}
=
store
.
indexData
/*
const redDownTime = this.getRedCountDown(redRainConfig || []);
*/
const
redDownTime
=
redRainConfig
?.
haveNext
?
redRainConfig
?.
nextRainBeginTime
-
new
Date
().
getTime
()
:
0
;
return
(<>
<
div
className=
"redPackCountPanel modal_center"
>
<
span
className=
"bg"
></
span
>
...
...
src/panels/redPackRainModal/redPackRainModal.tsx
View file @
608d58e4
...
...
@@ -15,7 +15,7 @@ class RedPackRainModal extends Component<any, any> {
state
=
{
// 红包雨时间
gameDuration
:
store
?.
indexData
?.
redRainCo
untDownTime
,
gameDuration
:
store
?.
indexData
?.
redRainCo
nfig
?.
redRainCountDownTime
||
0
,
// 是否准备
showReady
:
true
,
showRed
:
true
,
...
...
src/store/store.ts
View file @
608d58e4
...
...
@@ -9,7 +9,7 @@ import { getDomain } from '@spark/dbdomain';
import
{
showShareGuide
}
from
'@spark/share'
;
import
Loginpop
from
'@/panels/loginpop/loginpop'
;
import
InvalidPop
from
'@/panels/invalidPop/invalidPop'
;
import
FirstPop
from
'@/panels/firstPop/firstPop'
;
import
Tipspop
from
'@/panels/tipspop/tipspop'
;
import
{
isWeiXin
,
queryAppFundDetail
}
from
'@/AppTools'
;
import
{
CHANNEL
}
from
'@/AppTools'
;
...
...
@@ -61,7 +61,6 @@ class Store {
}
indexData
:
{
redRainCountDownTime
?:
number
,
redRainConfig
?:
any
,
actStartTime
?:
number
,
actEndTime
?:
number
,
...
...
@@ -160,9 +159,10 @@ class Store {
}
homeRoot
=
null
;
/*
leftOpenTime = 0;
leftOpenId = null;
showGiftPop
:
boolean
=
false
;
*/
async
updateIndex
()
{
const
{
success
,
data
,
timeStamp
}
=
await
API
.
index
();
if
(
!
success
)
{
...
...
@@ -172,7 +172,7 @@ class Store {
resData
.
currentTime
=
timeStamp
;
this
.
indexData
=
resData
;
const
{
firstMoneyPop
,
endPop
,
checkIn
,
codeList
,
giftPop
,
redRainConfig
,
todayPopFlag
}
=
resData
const
{
firstMoneyPop
,
endPop
,
checkIn
,
codeList
,
giftPop
,
redRainConfig
}
=
resData
// 计算进度条百分比
if
(
checkIn
?.
checkInConfig
&&
checkIn
?.
totalCheckIn
!==
undefined
)
{
...
...
@@ -192,13 +192,20 @@ class Store {
}
if
(
giftPop
&&
giftPop
?.
todayPopFlag
)
{
// this.showGiftPop = true;
ModalCtrl
.
showModal
(
NewbieModal
,
{
type
:
giftPop
?.
type
,
actPrizeVO
:
giftPop
?.
actPrizeVO
})
}
if
(
redRainConfig
?.
canJoin
)
{
// 在时间段内,显示红包雨弹窗
ModalCtrl
.
showModal
(
RedPackRainModal
,
{
redRainId
:
redRainConfig
?.
redRainId
});
}
if
(
firstMoneyPop
)
{
ModalCtrl
.
showModal
(
FirstPop
,
firstMoneyPop
);
}
}
/*
judgeRedModal() {
const redRainConfig = this.indexData?.redRainConfig
// 红包雨时间段判断
...
...
@@ -241,6 +248,7 @@ class Store {
}
}
}
*/
/**
* 更新某些基金信息
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment