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
10bc6224
Commit
10bc6224
authored
May 26, 2021
by
mqf_0707
Browse files
Options
Browse Files
Download
Plain Diff
wnf
parents
4ebb440a
0396bc04
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
32 additions
and
24478 deletions
+32
-24478
default.js
c_client/config/default.js
+1
-1
package-lock.json
c_client/package-lock.json
+0
-24444
package.json
c_client/package.json
+0
-1
TasksModal.jsx
c_client/src/components/TasksModal/TasksModal.jsx
+1
-1
lottieAnimation.js
...omponents/_miniprogram/lottieAnimation/lottieAnimation.js
+3
-1
const.js
c_client/src/const.js
+3
-2
browseGoods.jsx
c_client/src/pages/browseGoods/browseGoods.jsx
+11
-6
collectGoods.jsx
c_client/src/pages/collectGoods/collectGoods.jsx
+13
-4
yarn.lock
c_client/yarn.lock
+0
-18
No files found.
c_client/config/default.js
View file @
10bc6224
export
default
{
export
default
{
hasGameModule
:
false
,
// 是否开启游戏模块自动注入dist
hasGameModule
:
false
,
// 是否开启游戏模块自动注入dist
hasLottieAnimation
:
tru
e
,
// 使用Lottie动画
hasLottieAnimation
:
fals
e
,
// 使用Lottie动画
defaultPlugins
:
[
defaultPlugins
:
[
[
[
'@pluve/taro-plugin-mars'
,
// taro暂时未支持阿里小程序自定义插件 需要引用插件的页面需配置
'@pluve/taro-plugin-mars'
,
// taro暂时未支持阿里小程序自定义插件 需要引用插件的页面需配置
...
...
c_client/package-lock.json
deleted
100644 → 0
View file @
4ebb440a
This diff is collapsed.
Click to expand it.
c_client/package.json
View file @
10bc6224
...
@@ -45,7 +45,6 @@
...
@@ -45,7 +45,6 @@
"@tarojs/taro"
:
"v3.2.0-canary.9"
,
"@tarojs/taro"
:
"v3.2.0-canary.9"
,
"@tbmp/mp-cloud-sdk"
:
"^1.4.2"
,
"@tbmp/mp-cloud-sdk"
:
"^1.4.2"
,
"classnames"
:
"^2.2.6"
,
"classnames"
:
"^2.2.6"
,
"fyge"
:
"*"
,
"hox"
:
"^1.1.2"
,
"hox"
:
"^1.1.2"
,
"lodash"
:
"4.17.15"
,
"lodash"
:
"4.17.15"
,
"react"
:
"^16.10.0"
,
"react"
:
"^16.10.0"
,
...
...
c_client/src/components/TasksModal/TasksModal.jsx
View file @
10bc6224
...
@@ -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/components/_miniprogram/lottieAnimation/lottieAnimation.js
View file @
10bc6224
...
@@ -7,7 +7,9 @@ Component({
...
@@ -7,7 +7,9 @@ Component({
props
:
{
props
:
{
type
:
1
type
:
1
},
},
didMount
()
{},
didMount
()
{
},
didUpdate
()
{},
didUpdate
()
{},
didUnmount
()
{
didUnmount
()
{
//舞台销毁
//舞台销毁
...
...
c_client/src/const.js
View file @
10bc6224
...
@@ -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 @
10bc6224
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,17 +35,22 @@ function BrowseGoodsPage() {
...
@@ -35,17 +35,22 @@ function BrowseGoodsPage() {
useEffect
(()
=>
{
useEffect
(()
=>
{
listSuccess
&&
list
.
length
&&
browseGoodsTimes
()
listSuccess
&&
list
.
length
&&
browseGoodsTimes
()
return
()
=>
clearInterval
(
this
.
t
imer
)
return
()
=>
clearInterval
(
browserT
imer
)
},
[
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
)
{
...
@@ -55,10 +60,10 @@ function BrowseGoodsPage() {
...
@@ -55,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
)
...
...
c_client/src/pages/collectGoods/collectGoods.jsx
View file @
10bc6224
import
React
from
'react'
import
React
,
{
useState
,
useEffect
}
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
{
useRequest
}
from
'@/hooks/useRequest'
import
{
useRouter
}
from
'@tarojs/taro'
import
{
useRouter
}
from
'@tarojs/taro'
import
tbccTs
from
'tbcc-sdk-ts'
import
tbccTs
from
'tbcc-sdk-ts'
import
API
from
'@/api'
import
API
from
'@/api'
...
@@ -25,19 +24,29 @@ const browseConfig = {
...
@@ -25,19 +24,29 @@ const browseConfig = {
function
CollectGoodsPage
()
{
function
CollectGoodsPage
()
{
const
router
=
useRouter
()
const
router
=
useRouter
()
const
[
goodsList
,
setGoodsList
]
=
useState
([])
const
{
itemIds
}
=
router
?.
params
const
{
itemIds
}
=
router
?.
params
const
{
data
}
=
useRequest
(
API
.
getCollectGoodsList
,
{
itemIds
})
useEffect
(()
=>
{
getGoodsList
()
},
[])
const
getGoodsList
=
async
()
=>
{
const
{
data
}
=
await
API
.
getCollectGoodsList
({
itemIds
})
setGoodsList
(
data
?.
list
||
[])
}
const
onCompleteTask
=
useThrottle
(
async
(
taskType
,
itemId
)
=>
{
const
onCompleteTask
=
useThrottle
(
async
(
taskType
,
itemId
)
=>
{
const
{
success
}
=
await
API
.
doCompleteTask
({
taskType
,
itemId
})
const
{
success
}
=
await
API
.
doCompleteTask
({
taskType
,
itemId
})
if
(
success
)
{
if
(
success
)
{
getGoodsList
()
commonToast
(
'收藏成功'
)
commonToast
(
'收藏成功'
)
}
}
})
})
return
(
return
(
<
View
>
<
View
>
<
GoodsPage
goodsList=
{
data
?.
list
||
[]
}
task=
{
browseConfig
}
onCompleteTask=
{
()
=>
onCompleteTask
}
/>
<
GoodsPage
goodsList=
{
goodsList
}
task=
{
browseConfig
}
onCompleteTask=
{
()
=>
onCompleteTask
}
/>
</
View
>
</
View
>
)
)
}
}
...
...
c_client/yarn.lock
View file @
10bc6224
...
@@ -5631,11 +5631,6 @@ download@^7.1.0:
...
@@ -5631,11 +5631,6 @@ download@^7.1.0:
p-event "^2.1.0"
p-event "^2.1.0"
pify "^3.0.0"
pify "^3.0.0"
duiba-utils@^1.0.0:
version "1.0.9"
resolved "http://npm.dui88.com:80/duiba-utils/-/duiba-utils-1.0.9.tgz#7a1e09e08a8754a1563b18aa6b117cb270f76877"
integrity sha512-3YB5w05gNruS4yyN0cx2Qktr0vG0AXYOumfV6WYlzlMx3kGX3AihBLT2/PouERtkLfFk2q4cIikSkgwramHTmg==
duplexer3@^0.1.4:
duplexer3@^0.1.4:
version "0.1.4"
version "0.1.4"
resolved "http://npm.dui88.com:80/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2"
resolved "http://npm.dui88.com:80/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2"
...
@@ -7246,14 +7241,6 @@ functional-red-black-tree@^1.0.1:
...
@@ -7246,14 +7241,6 @@ functional-red-black-tree@^1.0.1:
resolved "http://npm.dui88.com:80/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327"
resolved "http://npm.dui88.com:80/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327"
integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=
integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=
fyge@*:
version "2.0.23"
resolved "http://npm.dui88.com:80/fyge/-/fyge-2.0.23.tgz#36550f93d9578cd3b02ae9772f93aa94730abd25"
integrity sha512-nNUD5HAPyknIMKdxxa50HzriLuBFmk4XLnZw5CgiX3mH7ROJzsh/ToRMTKXcxwH3r3ICid95cgEo0iCPIHSIsQ==
dependencies:
duiba-utils "^1.0.0"
tslib "^2.1.0"
gauge@~2.7.3:
gauge@~2.7.3:
version "2.7.4"
version "2.7.4"
resolved "http://npm.dui88.com:80/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7"
resolved "http://npm.dui88.com:80/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7"
...
@@ -14599,11 +14586,6 @@ tslib@^1.10.0, tslib@^1.8.1, tslib@^1.9.0:
...
@@ -14599,11 +14586,6 @@ tslib@^1.10.0, tslib@^1.8.1, tslib@^1.9.0:
resolved "http://npm.dui88.com:80/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00"
resolved "http://npm.dui88.com:80/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00"
integrity sha1-zy04vcNKE0vK8QkcQfZhni9nLQA=
integrity sha1-zy04vcNKE0vK8QkcQfZhni9nLQA=
tslib@^2.1.0:
version "2.2.0"
resolved "http://npm.dui88.com:80/tslib/-/tslib-2.2.0.tgz#fb2c475977e35e241311ede2693cee1ec6698f5c"
integrity sha1-+yxHWXfjXiQTEe3iaTzuHsZpj1w=
tsutils@^3.17.1:
tsutils@^3.17.1:
version "3.20.0"
version "3.20.0"
resolved "http://npm.dui88.com:80/tsutils/-/tsutils-3.20.0.tgz#ea03ea45462e146b53d70ce0893de453ff24f698"
resolved "http://npm.dui88.com:80/tsutils/-/tsutils-3.20.0.tgz#ea03ea45462e146b53d70ce0893de453ff24f698"
...
...
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