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
940d97d2
Commit
940d97d2
authored
Sep 15, 2021
by
王能飞
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'c_client_taro-pack' into 'c_client_taro'
集合页任务优化 See merge request
!45
parents
c18c539a
66cb3c56
Changes
21
Show whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
97 additions
and
72 deletions
+97
-72
package-lock.json
c_client/package-lock.json
+6
-6
package.json
c_client/package.json
+1
-1
app.js
c_client/src/app.js
+1
-0
ContainerFit.jsx
c_client/src/components/_base/ContainerFit/ContainerFit.jsx
+23
-8
ContainerFit.module.less
...rc/components/_base/ContainerFit/ContainerFit.module.less
+1
-9
TitleImg.jsx
c_client/src/components/_tb_comps/TitleImg/TitleImg.jsx
+8
-2
DeliveryModal.jsx
.../src/components/_tb_modal/DeliveryModal/DeliveryModal.jsx
+1
-1
DoHelpModal.jsx
...ient/src/components/_tb_modal/DoHelpModal/DoHelpModal.jsx
+4
-4
help.config.js
c_client/src/config/help.config.js
+2
-0
myPrize.config.js
c_client/src/config/myPrize.config.js
+1
-0
task.config.js
c_client/src/config/task.config.js
+2
-1
useReceive.js
c_client/src/hooks/useReceive.js
+5
-5
useTasks.js
c_client/src/hooks/useTasks.js
+5
-3
index.jsx
c_client/src/pages/index/index.jsx
+1
-0
browseGoods.jsx
c_client/src/pages/packageGood/browseGoods/browseGoods.jsx
+2
-2
cartGoods.jsx
c_client/src/pages/packageGood/cartGoods/cartGoods.jsx
+11
-10
collectGoods.jsx
c_client/src/pages/packageGood/collectGoods/collectGoods.jsx
+12
-11
orderGoods.jsx
c_client/src/pages/packageGood/orderGoods/orderGoods.jsx
+2
-2
myPrize.jsx
c_client/src/pages/packagePrize/myPrize/myPrize.jsx
+2
-2
myPrize.module.less
c_client/src/pages/packagePrize/myPrize/myPrize.module.less
+3
-1
yarn.lock
c_client/yarn.lock
+4
-4
No files found.
c_client/package-lock.json
View file @
940d97d2
...
@@ -441,9 +441,9 @@
...
@@ -441,9 +441,9 @@
"optional"
:
true
"optional"
:
true
},
},
"@types/node"
:
{
"@types/node"
:
{
"version"
:
"14.17.1
5
"
,
"version"
:
"14.17.1
6
"
,
"resolved"
:
"https://registry.npmjs.org/@types/node/-/node-14.17.1
5
.tgz"
,
"resolved"
:
"https://registry.npmjs.org/@types/node/-/node-14.17.1
6
.tgz"
,
"integrity"
:
"sha512-
D1sdW0EcSCmNdLKBGMYb38YsHUS6JcM7yQ6sLQ9KuZ35ck7LYCKE7kYFHOO59ayFOY3zobWVZxf4KXhYHcHYFA
=="
,
"integrity"
:
"sha512-
WiFf2izl01P1CpeY8WqFAeKWwByMueBEkND38EcN8N68qb0aDG3oIS1P5MhAX5kUdr469qRyqsY/MjanLjsFbQ
=="
,
"optional"
:
true
"optional"
:
true
},
},
"@types/prop-types"
:
{
"@types/prop-types"
:
{
...
@@ -5345,9 +5345,9 @@
...
@@ -5345,9 +5345,9 @@
}
}
},
},
"tbcc-sdk-ts"
:
{
"tbcc-sdk-ts"
:
{
"version"
:
"1.0.1
0
"
,
"version"
:
"1.0.1
3
"
,
"resolved"
:
"https://registry.npmjs.org/tbcc-sdk-ts/-/tbcc-sdk-ts-1.0.1
0
.tgz"
,
"resolved"
:
"https://registry.npmjs.org/tbcc-sdk-ts/-/tbcc-sdk-ts-1.0.1
3
.tgz"
,
"integrity"
:
"sha512-
z+6/SVclywLnlbIqndPzUDFuVj1NEbojFm9vQAqx1hiXvpJbBcf5Ioo9J7k0rjymXgk0+at+QsnjhwuWEq3o/g
=="
,
"integrity"
:
"sha512-
dupA8ug1zz1/tfVw2ifOoNBlI6te9EXbtSHlsxycNDQxrykCSMP8objFujLeWUajrqNXbUoJlmV2JqbwU626mQ
=="
,
"requires"
:
{
"requires"
:
{
"@types/lodash"
:
"^4.14.160"
,
"@types/lodash"
:
"^4.14.160"
,
"@types/node"
:
"^14.6.0"
,
"@types/node"
:
"^14.6.0"
,
...
...
c_client/package.json
View file @
940d97d2
...
@@ -51,7 +51,7 @@
...
@@ -51,7 +51,7 @@
"react"
:
"^17.0.0"
,
"react"
:
"^17.0.0"
,
"react-dom"
:
"^17.0.0"
,
"react-dom"
:
"^17.0.0"
,
"taro-ui"
:
"^3.0.0-alpha.3"
,
"taro-ui"
:
"^3.0.0-alpha.3"
,
"tbcc-sdk-ts"
:
"^1.0.1
0
"
"tbcc-sdk-ts"
:
"^1.0.1
3
"
},
},
"devDependencies"
:
{
"devDependencies"
:
{
"@babel/core"
:
"^7.8.0"
,
"@babel/core"
:
"^7.8.0"
,
...
...
c_client/src/app.js
View file @
940d97d2
...
@@ -19,6 +19,7 @@ class App extends Component {
...
@@ -19,6 +19,7 @@ class App extends Component {
app
.
cloud
=
cloud
app
.
cloud
=
cloud
app
.
tornadoAPI
=
tornadoAPI
app
.
tornadoAPI
=
tornadoAPI
app
.
activityId
=
activityId
||
defaultActivityId
app
.
activityId
=
activityId
||
defaultActivityId
app
.
isOnlineAct
=
!!
activityId
}
}
// 页面后台切前台
// 页面后台切前台
componentDidShow
()
{}
componentDidShow
()
{}
...
...
c_client/src/components/_base/ContainerFit/ContainerFit.jsx
View file @
940d97d2
import
{
View
}
from
'@tarojs/components'
import
{
View
}
from
'@tarojs/components'
import
React
from
'react'
import
{
useEffect
,
useState
}
from
'react'
import
styles
from
'./ContainerFit.module.less'
import
styles
from
'./ContainerFit.module.less'
import
{
getSystemInfo
}
from
'tbcc-sdk-ts/lib/core/tb'
export
default
function
ContainerFit
(
props
)
{
export
default
function
ContainerFit
(
props
)
{
const
{
bg
=
''
,
hasFitPsd
=
false
}
=
props
const
{
bg
=
''
,
hasFitPsd
=
false
,
fullScreenFit
=
false
}
=
props
const
[
system
,
setSystem
]
=
useState
(
false
)
const
[
statusBarHeight
,
setStatusBarHeight
]
=
useState
(
24
)
useEffect
(()
=>
{
fullScreenFit
&&
getSystemInfo
().
then
(
res
=>
{
const
{
system
,
statusBarHeight
}
=
res
setSystem
(
system
)
setStatusBarHeight
(
statusBarHeight
)
})
},
[])
const
FitContainerStyle
=
(
flag
)
=>
{
return
flag
?
{
background
:
`url(
${
bg
}
) no-repeat`
,
backgroundSize
:
'100% 100%'
,
paddingTop
:
(
system
===
'iOS'
&&
fullScreenFit
)
&&
(
statusBarHeight
/
100
+
'rem'
)
}
:
{}
}
return
(
return
(
<
View
className=
{
styles
[
'page-container'
]
}
>
<
View
className=
{
styles
[
'page-container'
]
}
style=
{
FitContainerStyle
(
!
hasFitPsd
)
}
>
<
View
className=
{
styles
[
'page-psd-container'
]
}
style=
{
{
background
:
`url(${bg}) no-repeat`
,
backgroundSize
:
'7.5rem 16.24rem'
}
}
>
{
hasFitPsd
&&
<
View
className=
{
styles
[
'page-psd-container'
]
}
style=
{
FitContainerStyle
(
hasFitPsd
)
}
>
{
!
hasFitPsd
&&
<
View
className=
{
styles
[
'page-content'
]
}
>
{
props
.
children
}
{
props
.
children
}
</
View
>
}
</
View
>
}
{
hasFitPsd
&&
props
.
children
}
{
!
hasFitPsd
&&
props
.
children
}
</
View
>
</
View
>
</
View
>
)
)
}
}
\ No newline at end of file
c_client/src/components/_base/ContainerFit/ContainerFit.module.less
View file @
940d97d2
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
width: 100vw;
width: 100vw;
height: 100vh;
height: 100vh;
min-height: 100vh;
min-height: 100vh;
box-sizing: border-box;
overflow: hidden;
overflow: hidden;
}
}
.page-psd-container {
.page-psd-container {
...
@@ -17,12 +18,3 @@
...
@@ -17,12 +18,3 @@
top: 50%;
top: 50%;
transform: translate(0,-50%);
transform: translate(0,-50%);
}
}
\ No newline at end of file
.page-content {
position: absolute;
width: 100vw;
height: 100vh;
left: 0;
right: 0;
top: 50%;
transform: translate(0,-50%);
}
\ No newline at end of file
c_client/src/components/_tb_comps/TitleImg/TitleImg.jsx
View file @
940d97d2
...
@@ -3,10 +3,16 @@ import { View, Image, ScrollView } from '@tarojs/components'
...
@@ -3,10 +3,16 @@ import { View, Image, ScrollView } from '@tarojs/components'
import
classnames
from
'classnames'
import
classnames
from
'classnames'
import
styles
from
'./TitleImg.module.less'
import
styles
from
'./TitleImg.module.less'
const
posConfig
=
{
bottom
:
'flex-end'
,
top
:
'flex-start'
,
center
:
'center'
}
function
TitleImg
(
props
)
{
function
TitleImg
(
props
)
{
const
{
config
}
=
props
const
{
config
,
position
=
'center'
}
=
props
return
(
return
(
<
View
className=
{
styles
[
'title-box'
]
}
>
<
View
className=
{
styles
[
'title-box'
]
}
style=
{
{
alignItems
:
posConfig
[
position
]
}
}
>
<
Image
src=
{
config
.
image
}
mode=
"widthFix"
style=
{
{
width
:
config
.
width
/
100
+
'rem'
,
height
:
config
.
height
/
100
+
'rem'
}
}
/>
<
Image
src=
{
config
.
image
}
mode=
"widthFix"
style=
{
{
width
:
config
.
width
/
100
+
'rem'
,
height
:
config
.
height
/
100
+
'rem'
}
}
/>
</
View
>
</
View
>
)
)
...
...
c_client/src/components/_tb_modal/DeliveryModal/DeliveryModal.jsx
View file @
940d97d2
...
@@ -24,7 +24,7 @@ export default function DeliveryModal(props) {
...
@@ -24,7 +24,7 @@ export default function DeliveryModal(props) {
<
View
className=
{
styles
[
'content-copy__img'
]
}
onTap=
'copyPrizeId'
/>
<
View
className=
{
styles
[
'content-copy__img'
]
}
onTap=
'copyPrizeId'
/>
</
View
>
</
View
>
<
View
className=
{
styles
[
'content-desc'
]
}
>
{
prizeItem
.
shipStatus
===
3
?
'发货状态:已发货'
:
'发货状态:未发货'
}
</
View
>
<
View
className=
{
styles
[
'content-desc'
]
}
>
{
prizeItem
.
shipStatus
===
3
?
'发货状态:已发货'
:
'发货状态:未发货'
}
</
View
>
{
prizeItem
.
shipStatus
===
2
&&
<
View
className=
{
styles
[
'content-desc'
]
}
>
温馨提示:奖品将在活动结束7天内陆续发出
</
View
>
}
{
prizeItem
.
shipStatus
===
2
&&
<
View
className=
{
styles
[
'content-desc'
]
}
>
{
task
.
shipDesc
}
</
View
>
}
{
{
prizeItem
.
shipStatus
!==
2
&&
prizeItem
.
shipStatus
!==
2
&&
<
View
className=
{
styles
[
'content-copy'
]
}
>
<
View
className=
{
styles
[
'content-copy'
]
}
>
...
...
c_client/src/components/_tb_modal/DoHelpModal/DoHelpModal.jsx
View file @
940d97d2
...
@@ -7,7 +7,7 @@ import API from '@/api'
...
@@ -7,7 +7,7 @@ import API from '@/api'
import
{
useLoginInfoModel
,
useActivityInfoModel
}
from
'@/store'
import
{
useLoginInfoModel
,
useActivityInfoModel
}
from
'@/store'
import
{
checkIsMember
}
from
'tbcc-sdk-ts/lib/utils'
import
{
checkIsMember
}
from
'tbcc-sdk-ts/lib/utils'
import
{
showToast
}
from
'@tarojs/taro'
import
{
showToast
}
from
'@tarojs/taro'
import
{
HELP_MODAL_TYPE
,
HELP_CONFIG
}
from
'@/config/help.config'
import
{
HELP_MODAL_TYPE
,
HELP_CONFIG
,
RECEIVE_REWARD
}
from
'@/config/help.config'
export
default
function
DoHelpModal
(
props
)
{
export
default
function
DoHelpModal
(
props
)
{
const
{
activityInfo
}
=
useActivityInfoModel
()
const
{
activityInfo
}
=
useActivityInfoModel
()
...
@@ -59,10 +59,10 @@ export default function DoHelpModal(props) {
...
@@ -59,10 +59,10 @@ export default function DoHelpModal(props) {
},
},
[
HELP_MODAL_TYPE
.
FAIL
]:
async
()
=>
onClose
(
type
),
[
HELP_MODAL_TYPE
.
FAIL
]:
async
()
=>
onClose
(
type
),
[
HELP_MODAL_TYPE
.
REWARDS
]:
async
()
=>
{
[
HELP_MODAL_TYPE
.
REWARDS
]:
async
()
=>
{
const
{
success
,
data
}
=
await
API
.
receiveTask
({
key
:
HELP_CONFIG
.
KEY
})
if
(
RECEIVE_REWARD
)
{
if
(
success
&&
data
)
{
await
API
.
receiveTask
({
key
:
HELP_CONFIG
.
KEY
,
taskType
:
HELP_MODAL_TYPE
.
KEY
})
onClose
(
type
)
}
}
onClose
&&
onClose
(
type
)
}
}
}
}
helpFn
[
type
]()
helpFn
[
type
]()
...
...
c_client/src/config/help.config.js
View file @
940d97d2
...
@@ -9,6 +9,8 @@ export const HELP_MODAL_SHOW = {
...
@@ -9,6 +9,8 @@ export const HELP_MODAL_SHOW = {
SHOW
:
1
,
// 已弹
SHOW
:
1
,
// 已弹
NOT_SHOW
:
2
,
// 未弹
NOT_SHOW
:
2
,
// 未弹
}
}
// 助力弹窗是否已弹
export
const
RECEIVE_REWARD
=
true
// true | 直接领取 false | 任务弹窗领取
// 助力配置
// 助力配置
export
const
HELP_CONFIG
=
{
export
const
HELP_CONFIG
=
{
KEY
:
'invite'
,
KEY
:
'invite'
,
...
...
c_client/src/config/myPrize.config.js
View file @
940d97d2
...
@@ -61,6 +61,7 @@ export const PRIZE_CONFIG = {
...
@@ -61,6 +61,7 @@ export const PRIZE_CONFIG = {
},
},
contentTop
:
'208rpx'
,
contentTop
:
'208rpx'
,
blankTxt
:
'暂无奖品'
,
blankTxt
:
'暂无奖品'
,
shipDesc
:
'温馨提示:奖品将在活动结束7天内陆续发出'
,
hasLogistic
:
false
,
// 是否展示物流信息
hasLogistic
:
false
,
// 是否展示物流信息
isShowPirzeId
:
false
,
// 是否显示奖品编号
isShowPirzeId
:
false
,
// 是否显示奖品编号
hasGoodPrize
:
false
,
// 是否含有专属商品
hasGoodPrize
:
false
,
// 是否含有专属商品
...
...
c_client/src/config/task.config.js
View file @
940d97d2
...
@@ -37,7 +37,8 @@ export const TASK_CONFIG = {
...
@@ -37,7 +37,8 @@ export const TASK_CONFIG = {
collect
:
'//yun.duiba.com.cn/baicaoweiFarmer/orderGoods.png'
,
collect
:
'//yun.duiba.com.cn/baicaoweiFarmer/orderGoods.png'
,
sign
:
'//yun.duiba.com.cn/baicaoweiFarmer/orderGoods.png'
,
sign
:
'//yun.duiba.com.cn/baicaoweiFarmer/orderGoods.png'
,
exchange
:
'//yun.duiba.com.cn/baicaoweiFarmer/orderGoods.png'
,
exchange
:
'//yun.duiba.com.cn/baicaoweiFarmer/orderGoods.png'
,
share
:
'//yun.duiba.com.cn/baicaoweiFarmer/orderGoods.png'
share
:
'//yun.duiba.com.cn/baicaoweiFarmer/orderGoods.png'
,
addCart
:
'//yun.duiba.com.cn/baicaoweiFarmer/orderGoods.png'
},
},
commonTxt
:
{
commonTxt
:
{
1
:
'去完成'
,
1
:
'去完成'
,
...
...
c_client/src/hooks/useReceive.js
View file @
940d97d2
...
@@ -3,7 +3,7 @@ import { checkIsMember } from 'tbcc-sdk-ts/lib/utils'
...
@@ -3,7 +3,7 @@ import { checkIsMember } from 'tbcc-sdk-ts/lib/utils'
import
{
showToast
}
from
'@tarojs/taro'
import
{
showToast
}
from
'@tarojs/taro'
import
API
from
'@/api'
import
API
from
'@/api'
import
{
receiveEnamePrize
,
receiveMemberEname
,
receiveObjectPrize
}
from
'tbcc-sdk-ts/lib/request/capiFn'
import
{
receiveEnamePrize
,
receiveMemberEname
,
receiveObjectPrize
}
from
'tbcc-sdk-ts/lib/request/capiFn'
import
{
PRIZE_TYPE
,
BENEFIT_TYPE
}
from
'@/config/myPrize.config'
import
{
PRIZE_TYPE
,
BENEFIT_TYPE
,
DRAW_STATUS
}
from
'@/config/myPrize.config'
import
config
from
'@/config/config'
import
config
from
'@/config/config'
const
useReceive
=
(
props
)
=>
{
const
useReceive
=
(
props
)
=>
{
...
@@ -23,16 +23,16 @@ const useReceive = (props) => {
...
@@ -23,16 +23,16 @@ const useReceive = (props) => {
const
receiveFn
=
{
const
receiveFn
=
{
[
PRIZE_TYPE
.
ENAME
]:
async
()
=>
{
[
PRIZE_TYPE
.
ENAME
]:
async
()
=>
{
if
(
benefitType
===
BENEFIT_TYPE
.
MEMBER
)
{
if
(
benefitType
===
BENEFIT_TYPE
.
MEMBER
)
{
await
receiveMemberEname
(
API
.
receiveMemberEname
,{
params
:
{
sellerId
:
config
.
sellerId
,
ename
,
id
},
successMsg
,
errorMsg
})
await
receiveMemberEname
(
API
.
receiveMemberEname
,{
params
:
{
sellerId
:
config
.
sellerId
,
ename
,
id
,
status
:
DRAW_STATUS
.
SUCCESS
},
successMsg
,
errorMsg
})
}
else
{
}
else
{
await
receiveEnamePrize
(
API
.
receiveEnamePrize
,
{
params
:
{
activityId
,
id
},
successMsg
,
errorMsg
})
await
receiveEnamePrize
(
API
.
receiveEnamePrize
,
{
params
:
{
id
},
successMsg
,
errorMsg
})
}
}
},
},
[
PRIZE_TYPE
.
OBJECT
]:
async
()
=>
{
[
PRIZE_TYPE
.
OBJECT
]:
async
()
=>
{
await
receiveObjectPrize
(
API
.
receiveObjectPrize
,
{
params
:
{
activityId
,
id
},
successMsg
,
errorMsg
})
await
receiveObjectPrize
(
API
.
receiveObjectPrize
,
{
params
:
{
id
},
successMsg
,
errorMsg
})
},
},
[
PRIZE_TYPE
.
CREDITS
]:
async
()
=>
{
[
PRIZE_TYPE
.
CREDITS
]:
async
()
=>
{
await
receiveEnamePrize
(
API
.
receiveEnamePrize
,
{
params
:
{
activityId
,
id
},
successMsg
,
errorMsg
})
await
receiveEnamePrize
(
API
.
receiveEnamePrize
,
{
params
:
{
id
},
successMsg
,
errorMsg
})
}
}
}
}
await
receiveFn
[
type
]()
await
receiveFn
[
type
]()
...
...
c_client/src/hooks/useTasks.js
View file @
940d97d2
...
@@ -79,7 +79,7 @@ export function useTasks(props) {
...
@@ -79,7 +79,7 @@ export function useTasks(props) {
})
})
// 完成任务处理
// 完成任务处理
const
completeTask
=
async
(
item
,
callbackFn
=
()
=>
{})
=>
{
const
completeTask
=
async
(
item
,
callbackFn
=
()
=>
{})
=>
{
const
{
key
,
url
,
itemIds
,
keepTime
}
=
item
const
{
key
,
url
,
itemIds
,
keepTime
,
todayCompleteTimes
,
rateType
,
times
,
completeTimes
}
=
item
setCurrentTaskType
(
key
)
setCurrentTaskType
(
key
)
const
completeFn
=
{
const
completeFn
=
{
member
:
async
()
=>
{
member
:
async
()
=>
{
...
@@ -131,11 +131,13 @@ export function useTasks(props) {
...
@@ -131,11 +131,13 @@ export function useTasks(props) {
},
},
collect
:
async
()
=>
{
collect
:
async
()
=>
{
app
.
isFlashTask
=
true
app
.
isFlashTask
=
true
navigateTo
(
`/pages/packageGood/collectGoods/collectGoods?itemIds=
${
itemIds
}
`
)
const
_itm
=
{
itemIds
,
todayCompleteTimes
,
rateType
,
times
,
completeTimes
}
navigateTo
(
`/pages/packageGood/collectGoods/collectGoods?item=
${
JSON
.
stringify
(
_itm
)}
`
)
},
},
addCart
:
async
()
=>
{
addCart
:
async
()
=>
{
app
.
isFlashTask
=
true
app
.
isFlashTask
=
true
navigateTo
(
`/pages/packageGood/cartGoods/cartGoods?itemIds=
${
itemIds
}
`
)
const
_itm
=
{
itemIds
,
todayCompleteTimes
,
rateType
,
times
,
completeTimes
}
navigateTo
(
`/pages/packageGood/cartGoods/cartGoods?item=
${
JSON
.
stringify
(
_itm
)}
`
)
},
},
sign
:
()
=>
doCompleteTaskHandle
(
key
),
sign
:
()
=>
doCompleteTaskHandle
(
key
),
share
:
()
=>
{
share
:
()
=>
{
...
...
c_client/src/pages/index/index.jsx
View file @
940d97d2
...
@@ -63,6 +63,7 @@ function Index() {
...
@@ -63,6 +63,7 @@ function Index() {
setActivityInfoAndStatus
({
setActivityInfoAndStatus
({
startTime
,
endTime
,
rule
startTime
,
endTime
,
rule
})
})
// 判断活动未开始 且 app.isOnlineAct = false
}
}
}
}
// 获取用户信息
// 获取用户信息
...
...
c_client/src/pages/packageGood/browseGoods/browseGoods.jsx
View file @
940d97d2
...
@@ -113,9 +113,9 @@ function BrowseGoodsPage() {
...
@@ -113,9 +113,9 @@ function BrowseGoodsPage() {
},
1000
)
},
1000
)
}
}
return
(
return
(
<
ContainerFit
bg=
{
BROWSE_CONFIG
.
bg
}
>
<
ContainerFit
bg=
{
BROWSE_CONFIG
.
bg
}
fullScreenFit
>
<
View
className=
{
styles
[
'page-content__title'
]
}
>
<
View
className=
{
styles
[
'page-content__title'
]
}
>
<
GoodsTitle
config=
{
BROWSE_CONFIG
.
head
}
/>
<
GoodsTitle
config=
{
BROWSE_CONFIG
.
head
}
position=
{
'bottom'
}
/>
</
View
>
</
View
>
<
View
className=
{
styles
[
'page-content__list'
]
}
>
<
View
className=
{
styles
[
'page-content__list'
]
}
>
<
GoodsList
goodsList=
{
goodsList
}
task=
{
BROWSE_CONFIG
}
onOpenDetail=
{
(
itemId
,
collected
)
=>
onOpenDetail
(
itemId
,
collected
)
}
/>
<
GoodsList
goodsList=
{
goodsList
}
task=
{
BROWSE_CONFIG
}
onOpenDetail=
{
(
itemId
,
collected
)
=>
onOpenDetail
(
itemId
,
collected
)
}
/>
...
...
c_client/src/pages/packageGood/cartGoods/cartGoods.jsx
View file @
940d97d2
...
@@ -9,6 +9,7 @@ import API from '@/api'
...
@@ -9,6 +9,7 @@ import API from '@/api'
import
{
useThrottle
}
from
'@/hooks/useThrottle'
import
{
useThrottle
}
from
'@/hooks/useThrottle'
import
styles
from
'./cartGoods.module.less'
import
styles
from
'./cartGoods.module.less'
import
{
CART_CONFIG
,
CART_TYPE
}
from
'@/config/cart.config'
import
{
CART_CONFIG
,
CART_TYPE
}
from
'@/config/cart.config'
import
{
TASK_RATE_TYPE
}
from
'@/config/task.config'
import
{
GOOD_LIST
}
from
'@/mock'
import
{
GOOD_LIST
}
from
'@/mock'
const
{
showSkuModal
}
=
tbccTs
.
tb
const
{
showSkuModal
}
=
tbccTs
.
tb
...
@@ -16,10 +17,10 @@ const { showSkuModal } = tbccTs.tb
...
@@ -16,10 +17,10 @@ const { showSkuModal } = tbccTs.tb
function
CartGoodsPage
()
{
function
CartGoodsPage
()
{
const
router
=
useRouter
()
const
router
=
useRouter
()
const
[
goodsList
,
setGoodsList
]
=
useState
([])
const
[
goodsList
,
setGoodsList
]
=
useState
([])
const
{
item
Ids
}
=
router
?.
params
const
{
item
}
=
router
?.
params
// 收藏状态
const
{
itemIds
,
todayCompleteTimes
=
0
,
rateType
,
times
,
completeTimes
=
0
}
=
JSON
.
parse
(
item
)
const
collectflag
=
useRef
(
false
)
// 加购状态
const
collectFlag
=
useRef
(
rateType
===
TASK_RATE_TYPE
.
EVERYDAY
?
+
todayCompleteTimes
:
+
completeTimes
)
useEffect
(()
=>
{
useEffect
(()
=>
{
getGoodsList
()
getGoodsList
()
},
[])
},
[])
...
@@ -30,29 +31,29 @@ function CartGoodsPage() {
...
@@ -30,29 +31,29 @@ function CartGoodsPage() {
}
}
// 加入购物车 // 对应itemId为 574141925233 skuId为4018047819826 数量为4
// 加入购物车 // 对应itemId为 574141925233 skuId为4018047819826 数量为4
const
onCompleteTask
=
useThrottle
(
async
(
itemId
,
collected
)
=>
{
const
onCompleteTask
=
useThrottle
(
async
(
itemId
,
collected
)
=>
{
console
.
log
(
itemId
)
if
(
collected
&&
CART_CONFIG
.
type
===
CART_TYPE
.
ONE
)
{
if
(
collected
&&
CART_CONFIG
.
type
===
CART_TYPE
.
ONE
)
{
showToast
({
title
:
'您已加购过该商品了'
})
showToast
({
title
:
'您已加购过该商品了'
})
return
;
return
;
}
}
if
(
collectflag
.
current
&&
CART_CONFIG
.
type
===
CART_TYPE
.
ONE
)
{
if
(
rateType
!==
TASK_RATE_TYPE
.
FOREVER
&&
collectFlag
.
current
>=
times
&&
CART_TYPE
.
ONE
)
{
showToast
({
title
:
'该任务今天已完成,明天再来吧~'
})
showToast
({
title
:
'该任务今天已完成,明天再来吧~'
})
return
;
}
}
const
{
status
,
quantity
}
=
await
showSkuModal
(
String
(
itemId
))
const
{
status
,
quantity
}
=
await
showSkuModal
(
String
(
itemId
))
if
(
status
==
"addCartSuccess"
)
{
if
(
status
==
"addCartSuccess"
)
{
const
{
success
}
=
await
API
.
completeTask
({
key
:
CART_CONFIG
.
taskType
,
taskType
:
CART_CONFIG
.
taskType
,
itemId
,
count
:
quantity
})
const
{
success
}
=
await
API
.
completeTask
({
key
:
CART_CONFIG
.
taskType
,
taskType
:
CART_CONFIG
.
taskType
,
itemId
,
count
:
quantity
})
if
(
success
)
{
if
(
success
)
{
collectflag
.
current
=
true
collectflag
.
current
+=
1
getGoodsList
()
getGoodsList
()
showToast
({
title
:
'加购成功'
})
//
showToast({ title: '加购成功'})
}
}
}
}
},
2000
);
},
2000
);
return
(
return
(
<
ContainerFit
bg=
{
CART_CONFIG
.
bg
}
>
<
ContainerFit
bg=
{
CART_CONFIG
.
bg
}
fullScreenFit
>
<
View
className=
{
styles
[
'page-content__title'
]
}
>
<
View
className=
{
styles
[
'page-content__title'
]
}
>
<
TitleImg
config=
{
CART_CONFIG
.
head
}
/>
<
TitleImg
config=
{
CART_CONFIG
.
head
}
position=
{
'bottom'
}
/>
</
View
>
</
View
>
<
View
className=
{
styles
[
'page-content__list'
]
}
>
<
View
className=
{
styles
[
'page-content__list'
]
}
>
<
GoodsList
goodsList=
{
goodsList
}
task=
{
CART_CONFIG
}
onCompleteTask=
{
(
itemId
,
collected
)
=>
onCompleteTask
(
itemId
,
collected
)
}
/>
<
GoodsList
goodsList=
{
goodsList
}
task=
{
CART_CONFIG
}
onCompleteTask=
{
(
itemId
,
collected
)
=>
onCompleteTask
(
itemId
,
collected
)
}
/>
...
...
c_client/src/pages/packageGood/collectGoods/collectGoods.jsx
View file @
940d97d2
...
@@ -7,22 +7,23 @@ import { useRouter, showToast } from '@tarojs/taro'
...
@@ -7,22 +7,23 @@ import { useRouter, showToast } from '@tarojs/taro'
import
tbccTs
from
'tbcc-sdk-ts'
import
tbccTs
from
'tbcc-sdk-ts'
import
API
from
'@/api'
import
API
from
'@/api'
import
{
useThrottle
}
from
'@/hooks/useThrottle'
import
{
useThrottle
}
from
'@/hooks/useThrottle'
const
{
checkGoodsCollectedStatus
,
collectGoods
}
=
tbccTs
.
tb
const
{
checkGoodsCollectedStatus
,
collectGoods
,
getSystemInfo
}
=
tbccTs
.
tb
import
styles
from
'./collectGoods.module.less'
import
styles
from
'./collectGoods.module.less'
import
COLLECT_CONFIG
from
'@/config/collect.config'
import
COLLECT_CONFIG
from
'@/config/collect.config'
import
{
TASK_RATE_TYPE
}
from
'@/config/task.config'
import
{
GOOD_LIST
}
from
'@/mock'
import
{
GOOD_LIST
}
from
'@/mock'
function
CollectGoodsPage
()
{
function
CollectGoodsPage
()
{
const
router
=
useRouter
()
const
router
=
useRouter
()
const
[
goodsList
,
setGoodsList
]
=
useState
([])
const
[
goodsList
,
setGoodsList
]
=
useState
(
GOOD_LIST
)
const
{
itemIds
}
=
router
?.
params
const
{
item
}
=
router
?.
params
// 收藏状态
const
{
itemIds
,
todayCompleteTimes
=
0
,
rateType
,
times
,
completeTimes
=
0
}
=
JSON
.
parse
(
item
)
const
collectFlag
=
useRef
(
false
)
// 加购状态
const
collectFlag
=
useRef
(
rateType
===
TASK_RATE_TYPE
.
EVERYDAY
?
+
todayCompleteTimes
:
+
completeTimes
)
useEffect
(()
=>
{
useEffect
(()
=>
{
getGoodsList
()
getGoodsList
()
},
[])
},
[])
const
getGoodsList
=
async
()
=>
{
const
getGoodsList
=
async
()
=>
{
const
{
data
}
=
await
API
.
getCollectGoods
({
key
:
COLLECT_CONFIG
.
taskType
,
itemIds
,
taskType
:
COLLECT_CONFIG
.
taskType
})
const
{
data
}
=
await
API
.
getCollectGoods
({
key
:
COLLECT_CONFIG
.
taskType
,
itemIds
,
taskType
:
COLLECT_CONFIG
.
taskType
})
data
?.
list
&&
setGoodsList
(
data
?.
list
||
[])
data
?.
list
&&
setGoodsList
(
data
?.
list
||
[])
...
@@ -32,13 +33,13 @@ function CollectGoodsPage() {
...
@@ -32,13 +33,13 @@ function CollectGoodsPage() {
const
collectFn
=
async
()
=>
{
const
collectFn
=
async
()
=>
{
const
{
success
}
=
await
API
.
completeTask
({
key
:
COLLECT_CONFIG
.
taskType
,
itemId
,
taskType
:
COLLECT_CONFIG
.
taskType
})
const
{
success
}
=
await
API
.
completeTask
({
key
:
COLLECT_CONFIG
.
taskType
,
itemId
,
taskType
:
COLLECT_CONFIG
.
taskType
})
if
(
success
)
{
if
(
success
)
{
collectFlag
.
current
=
true
collectFlag
.
current
+=
1
getGoodsList
()
getGoodsList
()
showToast
({
title
:
'收藏成功'
})
showToast
({
title
:
'收藏成功'
})
}
}
}
}
// 今日是否已收藏过
// 今日是否已收藏过
if
(
collectFlag
.
current
)
{
if
(
rateType
!==
TASK_RATE_TYPE
.
FOREVER
&&
collectFlag
.
current
>=
times
)
{
showToast
({
title
:
'任务已完成,请明日再来'
})
showToast
({
title
:
'任务已完成,请明日再来'
})
return
;
return
;
}
}
...
@@ -60,9 +61,9 @@ function CollectGoodsPage() {
...
@@ -60,9 +61,9 @@ function CollectGoodsPage() {
})
})
return
(
return
(
<
ContainerFit
bg=
{
COLLECT_CONFIG
.
bg
}
>
<
ContainerFit
bg=
{
COLLECT_CONFIG
.
bg
}
fullScreenFit
>
<
View
className=
{
styles
[
'page-content__title'
]
}
>
<
View
className=
{
styles
[
'page-content__title'
]
}
style=
{
{}
}
>
<
TitleImg
config=
{
COLLECT_CONFIG
.
head
}
/>
<
TitleImg
config=
{
COLLECT_CONFIG
.
head
}
position=
{
'bottom'
}
/>
</
View
>
</
View
>
<
View
className=
{
styles
[
'page-content__list'
]
}
>
<
View
className=
{
styles
[
'page-content__list'
]
}
>
<
GoodsList
goodsList=
{
goodsList
}
task=
{
COLLECT_CONFIG
}
onCompleteTask=
{
(
itemId
,
collected
)
=>
onCompleteTask
(
itemId
,
collected
)
}
/>
<
GoodsList
goodsList=
{
goodsList
}
task=
{
COLLECT_CONFIG
}
onCompleteTask=
{
(
itemId
,
collected
)
=>
onCompleteTask
(
itemId
,
collected
)
}
/>
...
...
c_client/src/pages/packageGood/orderGoods/orderGoods.jsx
View file @
940d97d2
...
@@ -15,9 +15,9 @@ function OrderGoodsPage() {
...
@@ -15,9 +15,9 @@ function OrderGoodsPage() {
const
{
data
}
=
useRequest
(
API
.
getCollectGoods
,
{
key
:
ORDER_CONFIG
.
taskType
,
itemIds
,
taskType
:
ORDER_CONFIG
.
taskType
})
const
{
data
}
=
useRequest
(
API
.
getCollectGoods
,
{
key
:
ORDER_CONFIG
.
taskType
,
itemIds
,
taskType
:
ORDER_CONFIG
.
taskType
})
return
(
return
(
<
ContainerFit
bg=
{
ORDER_CONFIG
.
bg
}
>
<
ContainerFit
bg=
{
ORDER_CONFIG
.
bg
}
fullScreenFit
>
<
View
className=
{
styles
[
'page-content__title'
]
}
>
<
View
className=
{
styles
[
'page-content__title'
]
}
>
<
TitleImg
config=
{
ORDER_CONFIG
.
head
}
/>
<
TitleImg
config=
{
ORDER_CONFIG
.
head
}
position=
{
'bottom'
}
/>
</
View
>
</
View
>
<
View
className=
{
styles
[
'page-content__list'
]
}
>
<
View
className=
{
styles
[
'page-content__list'
]
}
>
<
GoodsList
goodsList=
{
data
?.
list
||
[]
}
task=
{
ORDER_CONFIG
}
/>
<
GoodsList
goodsList=
{
data
?.
list
||
[]
}
task=
{
ORDER_CONFIG
}
/>
...
...
c_client/src/pages/packagePrize/myPrize/myPrize.jsx
View file @
940d97d2
...
@@ -116,9 +116,9 @@ function MyPrizeList() {
...
@@ -116,9 +116,9 @@ function MyPrizeList() {
return
(
return
(
<>
<>
<
ContainerFit
bg=
{
PRIZE_CONFIG
.
bg
}
>
<
ContainerFit
bg=
{
PRIZE_CONFIG
.
bg
}
fullScreenFit
>
<
View
className=
{
styles
[
'my-prize-label'
]
}
>
<
View
className=
{
styles
[
'my-prize-label'
]
}
>
<
TitleImg
config=
{
PRIZE_CONFIG
.
head
}
></
TitleImg
>
<
TitleImg
config=
{
PRIZE_CONFIG
.
head
}
position=
{
'bottom'
}
></
TitleImg
>
</
View
>
</
View
>
<
View
className=
{
styles
[
'my-prize-content'
]
}
style=
{
{
top
:
PRIZE_CONFIG
.
contentTop
}
}
>
<
View
className=
{
styles
[
'my-prize-content'
]
}
style=
{
{
top
:
PRIZE_CONFIG
.
contentTop
}
}
>
<
ScrollView
scrollY
className=
{
styles
[
'my-prize-content__scroll'
]
}
>
<
ScrollView
scrollY
className=
{
styles
[
'my-prize-content__scroll'
]
}
>
...
...
c_client/src/pages/packagePrize/myPrize/myPrize.module.less
View file @
940d97d2
...
@@ -8,11 +8,13 @@
...
@@ -8,11 +8,13 @@
top: 363px;
top: 363px;
bottom: 0;
bottom: 0;
width: 100%;
width: 100%;
padding: 40px 0;
box-sizing: border-box;
}
}
.my-prize-content__scroll {
.my-prize-content__scroll {
width: 100%;
width: 100%;
height: 100%;
height: 100%;
padding
-top: 30px;
margin
-top: 30px;
}
}
.my-prize-list {
.my-prize-list {
width: 100%;
width: 100%;
...
...
c_client/yarn.lock
View file @
940d97d2
...
@@ -13894,10 +13894,10 @@ taro-ui@^3.0.0-alpha.3:
...
@@ -13894,10 +13894,10 @@ taro-ui@^3.0.0-alpha.3:
lodash "^4.17.10"
lodash "^4.17.10"
prop-types "^15.7.2"
prop-types "^15.7.2"
tbcc-sdk-ts@^1.0.1
0
:
tbcc-sdk-ts@^1.0.1
3
:
version "1.0.1
0
"
version "1.0.1
3
"
resolved "https://registry.yarnpkg.com/tbcc-sdk-ts/-/tbcc-sdk-ts-1.0.1
0.tgz#8e1489176c843a43f95931aae3e04a5b6c1f8305
"
resolved "https://registry.yarnpkg.com/tbcc-sdk-ts/-/tbcc-sdk-ts-1.0.1
3.tgz#179c6c7f8529a4b146c73a651f529aa56345b6fa
"
integrity sha512-
z+6/SVclywLnlbIqndPzUDFuVj1NEbojFm9vQAqx1hiXvpJbBcf5Ioo9J7k0rjymXgk0+at+QsnjhwuWEq3o/g
==
integrity sha512-
dupA8ug1zz1/tfVw2ifOoNBlI6te9EXbtSHlsxycNDQxrykCSMP8objFujLeWUajrqNXbUoJlmV2JqbwU626mQ
==
optionalDependencies:
optionalDependencies:
"@types/lodash" "^4.14.160"
"@types/lodash" "^4.14.160"
"@types/node" "^14.6.0"
"@types/node" "^14.6.0"
...
...
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