Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
taobao-mini-template
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
qinhaitao
taobao-mini-template
Commits
0396bc04
Commit
0396bc04
authored
May 24, 2021
by
王能飞
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'c_client_taro_bugfixed_20210519' into 'c_client_taro'
C client taro bugfixed 20210519 See merge request
!21
parents
7f1d3377
50d62206
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
8 deletions
+15
-8
TasksModal.jsx
c_client/src/components/TasksModal/TasksModal.jsx
+1
-1
const.js
c_client/src/const.js
+3
-2
browseGoods.jsx
c_client/src/pages/browseGoods/browseGoods.jsx
+11
-5
No files found.
c_client/src/components/TasksModal/TasksModal.jsx
View file @
0396bc04
...
...
@@ -68,7 +68,7 @@ export default function TasksModal(props) {
// 跳转任务 https://www.feizhu.com
jumpLink
:
async
()
=>
{
navigateToOutside
(
url
)
if
(
browseType
===
1
)
{
if
(
browseType
===
2
)
{
doCompleteTaskHandle
(
taskType
)
}
else
{
app
.
isFlashTask
=
true
...
...
c_client/src/const.js
View file @
0396bc04
...
...
@@ -95,6 +95,7 @@ export const TASK_CONFIG = {
orderGoods
:
'去完成'
,
collectGoods
:
'去完成'
},
browseType
:
1
,
// 1 跳转即算完成 2 跳转浏览15s 才算完成
browseTime
:
15
// 浏览时间
browseType
:
2
,
// 1 跳转浏览15s 才算完成 2 跳转即算完成
browseTime
:
15
,
// 浏览时间
jumpType
:
1
// 1 浏览15s 才算完成 2 点击就算完成任务
}
c_client/src/pages/browseGoods/browseGoods.jsx
View file @
0396bc04
import
React
,
{
useEffect
,
useState
}
from
'react'
import
{
View
}
from
'@tarojs/components'
import
GoodsPage
from
'@/components/GoodsPage/GoodsPage'
import
{
useDidShow
,
useRouter
}
from
'@tarojs/taro'
import
{
useDidShow
,
useRouter
,
useDidHide
}
from
'@tarojs/taro'
import
API
from
'@/api'
import
{
TASK_CONFIG
}
from
'@/const'
import
{
useRequest
}
from
'@/hooks/useRequest'
...
...
@@ -25,7 +25,7 @@ function BrowseGoodsPage() {
const
[
percent
,
setPercent
]
=
useState
(
0
)
const
[
isJumpLink
,
setIsJumpLink
]
=
useState
(
false
)
const
{
browse
Type
,
browseTime
}
=
TASK_CONFIG
const
{
jump
Type
,
browseTime
}
=
TASK_CONFIG
let
browserTimer
=
null
let
usePercent
=
0
...
...
@@ -35,16 +35,22 @@ function BrowseGoodsPage() {
useEffect
(()
=>
{
listSuccess
&&
list
.
length
&&
browseGoodsTimes
()
return
()
=>
clearInterval
(
browserTimer
)
},
[
list
])
useDidShow
(()
=>
{
// 重新回到页面开启倒计时
if
(
!
browserTimer
&&
browse
Type
===
1
&&
isJumpLink
)
{
if
(
!
browserTimer
&&
jump
Type
===
1
&&
isJumpLink
)
{
usePercent
=
percent
browseGoodsTimes
()
}
})
useDidHide
(()
=>
{
// 页面关闭清除定时器
clearInterval
(
browserTimer
)
})
const
onCompleteTask
=
async
(
itemId
)
=>
{
const
{
success
}
=
await
API
.
doCompleteTask
({
taskType
:
browseConfig
.
taskType
,
itemId
})
if
(
success
)
{
...
...
@@ -54,10 +60,10 @@ function BrowseGoodsPage() {
}
const
onOpenDetail
=
(
itemId
)
=>
{
if
(
browse
Type
===
1
)
{
if
(
jump
Type
===
1
)
{
setPercent
(
usePercent
)
setIsJumpLink
(
true
)
clearInterval
(
this
.
t
imer
)
clearInterval
(
browserT
imer
)
return
}
onCompleteTask
(
itemId
)
...
...
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