Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kww_dayDayGetCredits_250512
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
kww_dayDayGetCredits_250512
Commits
135780b9
Commit
135780b9
authored
May 16, 2025
by
徐士卿
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify
parent
6b25127f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
25 deletions
+45
-25
challenge.ts
mock/challenge.ts
+14
-7
Check.tsx
src/pages/HomePage/Check/Check.tsx
+30
-18
store.ts
src/store/store.ts
+1
-0
No files found.
mock/challenge.ts
View file @
135780b9
...
...
@@ -57,7 +57,8 @@ export default [
"title"
:
"签到"
,
"completedSize"
:
0
,
"intervalLimitSize"
:
1
,
"intervalType"
:
-
18649400.705077305
"intervalType"
:
-
18649400.705077305
,
"jumUrl"
:
''
,
},
{
"code"
:
"xhqg_{200}"
,
...
...
@@ -66,7 +67,8 @@ export default [
"title"
:
"消耗200青果"
,
"completedSize"
:
0
,
"intervalLimitSize"
:
1
,
"intervalType"
:
69737947.09434697
"intervalType"
:
69737947.09434697
,
"jumUrl"
:
''
,
},
{
"code"
:
"xhjf_{300}"
,
...
...
@@ -75,7 +77,8 @@ export default [
"title"
:
"消耗300积分"
,
"completedSize"
:
0
,
"intervalLimitSize"
:
1
,
"intervalType"
:
15800400.399293274
"intervalType"
:
15800400.399293274
,
"jumUrl"
:
''
,
},
{
"code"
:
"yqzl"
,
...
...
@@ -84,7 +87,8 @@ export default [
"title"
:
"邀请助力"
,
"completedSize"
:
3
,
"intervalLimitSize"
:
6
,
"intervalType"
:
-
54395962.26549375
"intervalType"
:
-
54395962.26549375
,
"jumUrl"
:
''
,
},
{
"code"
:
"yqzl_new"
,
...
...
@@ -93,7 +97,8 @@ export default [
"title"
:
"邀请新用户"
,
"completedSize"
:
3
,
"intervalLimitSize"
:
6
,
"intervalType"
:
-
54395962.26549375
"intervalType"
:
-
54395962.26549375
,
"jumUrl"
:
''
,
},
{
"code"
:
"scan"
,
...
...
@@ -102,7 +107,8 @@ export default [
"title"
:
"扫码"
,
"completedSize"
:
3
,
"intervalLimitSize"
:
6
,
"intervalType"
:
-
54395962.26549375
"intervalType"
:
-
54395962.26549375
,
"jumUrl"
:
''
,
},
{
"code"
:
"browse_{x}"
,
...
...
@@ -111,7 +117,8 @@ export default [
"title"
:
"浏览"
,
"completedSize"
:
3
,
"intervalLimitSize"
:
6
,
"intervalType"
:
-
54395962.26549375
"intervalType"
:
-
54395962.26549375
,
"jumUrl"
:
''
,
},
],
"boolNeedChallengeCompletePop"
:
false
,
...
...
src/pages/HomePage/Check/Check.tsx
View file @
135780b9
...
...
@@ -11,6 +11,7 @@ import Finish_task from '../../../components/finish_task/finish_task';
import
Consume_qg
from
'../../../components/consume_qg/consume_qg'
;
import
Consume_credits
from
'../../../components/consume_credits/consume_credits'
;
import
Renewmodule
from
'../../../components/renewmodule/renewmodule'
;
import
{
unwatchPageVisibility
,
watchPageVisibility
}
from
'@/core/page-visibility-notify'
;
@
observer
class
Check
extends
React
.
Component
<
any
,
any
>
{
...
...
@@ -22,10 +23,24 @@ class Check extends React.Component<any, any> {
componentDidMount
()
{
store
.
getTaskInfo
()
store
.
getBaseIndex
()
watchPageVisibility
(
this
.
onPageVisibilityChange
)
}
componentWillUnmount
()
{
unwatchPageVisibility
(
this
.
onPageVisibilityChange
);
}
/** 页面显隐行 */
onPageVisibilityChange
=
(
visible
)
=>
{
console
.
log
(
'页面'
+
visible
?
'可见'
:
'不可见'
)
if
(
visible
)
{
store
.
getTaskInfo
();
//跳转回来,刷接口
}
}
// 按钮
handlegofinish
=
async
(
type
,
n
,
code
,
title
)
=>
{
handlegofinish
=
async
(
type
,
n
,
code
,
title
,
jumpUrl
)
=>
{
const
{
jfNum
=
0
,
qgNum
=
0
}
=
store
?.
baseInfo
||
{};
if
(
type
===
"xhqg"
)
{
if
(
n
<=
qgNum
)
{
...
...
@@ -44,14 +59,11 @@ class Check extends React.Component<any, any> {
}
else
if
(
type
===
"yqzl_new"
)
{
// todo
}
else
if
(
type
===
"scan"
)
{
// todo
// todo
wx
.
miniProgram
.
switchTab
({
url
:
jumpUrl
});
}
else
if
(
type
===
"browse"
)
{
// wx.miniProgram.switchTab({ url: jumpUrl })
const
{
success
}
=
await
API
.
getChallenegeComplate
({
taskCode
:
code
});
if
(
success
)
{
ModalCtrl
.
showModal
(
Finish_task
,
{
title
});
}
store
.
getTaskInfo
();
await
API
.
getChallenegeComplate
({
taskCode
:
code
});
window
.
location
.
href
=
jumpUrl
;
}
};
...
...
@@ -141,7 +153,7 @@ class Check extends React.Component<any, any> {
{
Array
.
isArray
(
taskInfoList
)
&&
taskInfoList
.
length
>
0
&&
taskInfoList
?.
map
((
v
,
i
)
=>
{
const
{
title
,
subTitle
,
icon
,
code
,
completedSize
,
intervalLimitSize
}
=
v
||
{};
const
{
title
,
subTitle
,
icon
,
code
,
completedSize
,
intervalLimitSize
,
jumpUrl
}
=
v
||
{};
// 获取按钮状态
const
renderActionButton
=
(
code
,
completedSize
,
intervalLimitSize
)
=>
{
...
...
@@ -157,7 +169,7 @@ class Check extends React.Component<any, any> {
return
(
<
Button
className=
"gofinish"
onClick=
{
()
=>
this
.
handlegofinish
(
"xhqg"
,
n
,
code
,
title
)
}
onClick=
{
()
=>
this
.
handlegofinish
(
"xhqg"
,
n
,
code
,
title
,
''
)
}
/>
);
}
...
...
@@ -168,7 +180,7 @@ class Check extends React.Component<any, any> {
return
(
<
Button
className=
"gofinish"
onClick=
{
()
=>
this
.
handlegofinish
(
"xhjf"
,
n
,
code
,
title
)
}
onClick=
{
()
=>
this
.
handlegofinish
(
"xhjf"
,
n
,
code
,
title
,
''
)
}
/>
);
}
...
...
@@ -177,7 +189,7 @@ class Check extends React.Component<any, any> {
return
(
<
Button
className=
"gofinish"
onClick=
{
()
=>
this
.
handlegofinish
(
"yqzl"
,
''
,
code
,
title
)
}
onClick=
{
()
=>
this
.
handlegofinish
(
"yqzl"
,
''
,
code
,
title
,
''
)
}
/>
)
}
...
...
@@ -186,27 +198,27 @@ class Check extends React.Component<any, any> {
return
(
<
Button
className=
"gofinish"
onClick=
{
()
=>
this
.
handlegofinish
(
"yqzl_new"
,
''
,
code
,
title
)
}
onClick=
{
()
=>
this
.
handlegofinish
(
"yqzl_new"
,
''
,
code
,
title
,
''
)
}
/>
)
}
// 扫码
case
code
.
startsWith
(
"scan"
):
{
const
number
=
(
code
.
split
(
"_"
)[
1
]);
const
n
=
parseInt
(
number
.
replace
(
/
[
{}
]
/g
,
''
),
10
);
//
const number = (code.split("_")[1]);
//
const n = parseInt(number.replace(/[
{}]
/
g
,
''
),
10
);
return
(
<
Button
className=
"gofinish"
onClick=
{
()
=>
this
.
handlegofinish
(
"scan"
,
''
,
code
,
title
)
}
onClick=
{
()
=>
this
.
handlegofinish
(
"scan"
,
''
,
code
,
title
,
jumpUrl
)
}
/>
);
}
// 浏览
case
code
.
startsWith
(
"browse
_
"
):
{
case
code
.
startsWith
(
"browse"
):
{
return
(
<
Button
className=
"gofinish"
onClick=
{
()
=>
this
.
handlegofinish
(
"browse"
,
''
,
code
,
title
)
}
onClick=
{
()
=>
this
.
handlegofinish
(
"browse"
,
''
,
code
,
title
,
jumpUrl
)
}
/>
);
}
...
...
src/store/store.ts
View file @
135780b9
...
...
@@ -173,6 +173,7 @@ class Store {
completedSize
:
number
;
intervalLimitSize
:
number
;
intervalType
:
number
;
jumpUrl
?:
string
;
}
>
;
boolNeedChallengeCompletePop
?:
boolean
;
latestChallengeSuccessTime
?:
number
;
...
...
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