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
50d62206
Commit
50d62206
authored
May 24, 2021
by
管新明
Committed by
王能飞
May 24, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
C client taro bugfixed 20210519
parent
7f1d3377
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 @
50d62206
...
@@ -68,7 +68,7 @@ export default function TasksModal(props) {
...
@@ -68,7 +68,7 @@ export default function TasksModal(props) {
// 跳转任务 https://www.feizhu.com
// 跳转任务 https://www.feizhu.com
jumpLink
:
async
()
=>
{
jumpLink
:
async
()
=>
{
navigateToOutside
(
url
)
navigateToOutside
(
url
)
if
(
browseType
===
1
)
{
if
(
browseType
===
2
)
{
doCompleteTaskHandle
(
taskType
)
doCompleteTaskHandle
(
taskType
)
}
else
{
}
else
{
app
.
isFlashTask
=
true
app
.
isFlashTask
=
true
...
...
c_client/src/const.js
View file @
50d62206
...
@@ -95,6 +95,7 @@ export const TASK_CONFIG = {
...
@@ -95,6 +95,7 @@ export const TASK_CONFIG = {
orderGoods
:
'去完成'
,
orderGoods
:
'去完成'
,
collectGoods
:
'去完成'
collectGoods
:
'去完成'
},
},
browseType
:
1
,
// 1 跳转即算完成 2 跳转浏览15s 才算完成
browseType
:
2
,
// 1 跳转浏览15s 才算完成 2 跳转即算完成
browseTime
:
15
// 浏览时间
browseTime
:
15
,
// 浏览时间
jumpType
:
1
// 1 浏览15s 才算完成 2 点击就算完成任务
}
}
c_client/src/pages/browseGoods/browseGoods.jsx
View file @
50d62206
import
React
,
{
useEffect
,
useState
}
from
'react'
import
React
,
{
useEffect
,
useState
}
from
'react'
import
{
View
}
from
'@tarojs/components'
import
{
View
}
from
'@tarojs/components'
import
GoodsPage
from
'@/components/GoodsPage/GoodsPage'
import
GoodsPage
from
'@/components/GoodsPage/GoodsPage'
import
{
useDidShow
,
useRouter
}
from
'@tarojs/taro'
import
{
useDidShow
,
useRouter
,
useDidHide
}
from
'@tarojs/taro'
import
API
from
'@/api'
import
API
from
'@/api'
import
{
TASK_CONFIG
}
from
'@/const'
import
{
TASK_CONFIG
}
from
'@/const'
import
{
useRequest
}
from
'@/hooks/useRequest'
import
{
useRequest
}
from
'@/hooks/useRequest'
...
@@ -25,7 +25,7 @@ function BrowseGoodsPage() {
...
@@ -25,7 +25,7 @@ function BrowseGoodsPage() {
const
[
percent
,
setPercent
]
=
useState
(
0
)
const
[
percent
,
setPercent
]
=
useState
(
0
)
const
[
isJumpLink
,
setIsJumpLink
]
=
useState
(
false
)
const
[
isJumpLink
,
setIsJumpLink
]
=
useState
(
false
)
const
{
browse
Type
,
browseTime
}
=
TASK_CONFIG
const
{
jump
Type
,
browseTime
}
=
TASK_CONFIG
let
browserTimer
=
null
let
browserTimer
=
null
let
usePercent
=
0
let
usePercent
=
0
...
@@ -35,16 +35,22 @@ function BrowseGoodsPage() {
...
@@ -35,16 +35,22 @@ function BrowseGoodsPage() {
useEffect
(()
=>
{
useEffect
(()
=>
{
listSuccess
&&
list
.
length
&&
browseGoodsTimes
()
listSuccess
&&
list
.
length
&&
browseGoodsTimes
()
return
()
=>
clearInterval
(
browserTimer
)
},
[
list
])
},
[
list
])
useDidShow
(()
=>
{
useDidShow
(()
=>
{
// 重新回到页面开启倒计时
// 重新回到页面开启倒计时
if
(
!
browserTimer
&&
browse
Type
===
1
&&
isJumpLink
)
{
if
(
!
browserTimer
&&
jump
Type
===
1
&&
isJumpLink
)
{
usePercent
=
percent
usePercent
=
percent
browseGoodsTimes
()
browseGoodsTimes
()
}
}
})
})
useDidHide
(()
=>
{
// 页面关闭清除定时器
clearInterval
(
browserTimer
)
})
const
onCompleteTask
=
async
(
itemId
)
=>
{
const
onCompleteTask
=
async
(
itemId
)
=>
{
const
{
success
}
=
await
API
.
doCompleteTask
({
taskType
:
browseConfig
.
taskType
,
itemId
})
const
{
success
}
=
await
API
.
doCompleteTask
({
taskType
:
browseConfig
.
taskType
,
itemId
})
if
(
success
)
{
if
(
success
)
{
...
@@ -54,10 +60,10 @@ function BrowseGoodsPage() {
...
@@ -54,10 +60,10 @@ function BrowseGoodsPage() {
}
}
const
onOpenDetail
=
(
itemId
)
=>
{
const
onOpenDetail
=
(
itemId
)
=>
{
if
(
browse
Type
===
1
)
{
if
(
jump
Type
===
1
)
{
setPercent
(
usePercent
)
setPercent
(
usePercent
)
setIsJumpLink
(
true
)
setIsJumpLink
(
true
)
clearInterval
(
this
.
t
imer
)
clearInterval
(
browserT
imer
)
return
return
}
}
onCompleteTask
(
itemId
)
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