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
53e12dca
Commit
53e12dca
authored
Sep 09, 2021
by
王能飞
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'c_client_taro-pack' into 'c_client_taro'
优化任务类型等 See merge request
!42
parents
352ed039
ea5c1696
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
51 additions
and
43 deletions
+51
-43
Barrage.jsx
...omponents/_tb_comps/Barrage/HorizontalBarrage/Barrage.jsx
+1
-1
GoodsList.jsx
c_client/src/components/_tb_comps/GoodsList/GoodsList.jsx
+7
-7
index.jsx
...src/components/_tb_comps/_Progress/ProgressNode/index.jsx
+1
-1
index.jsx
c_client/src/components/_tb_comps/_Progress/index.jsx
+1
-1
browse.config.js
c_client/src/config/browse.config.js
+1
-1
cart.config.js
c_client/src/config/cart.config.js
+3
-2
collect.config.js
c_client/src/config/collect.config.js
+3
-2
help.config.js
c_client/src/config/help.config.js
+1
-1
order.config.js
c_client/src/config/order.config.js
+1
-1
task.config.js
c_client/src/config/task.config.js
+12
-12
useTasks.js
c_client/src/hooks/useTasks.js
+9
-5
cartGoods.jsx
c_client/src/pages/packageGood/cartGoods/cartGoods.jsx
+3
-2
collectGoods.jsx
c_client/src/pages/packageGood/collectGoods/collectGoods.jsx
+7
-6
orderGoods.jsx
c_client/src/pages/packageGood/orderGoods/orderGoods.jsx
+1
-1
No files found.
c_client/src/components/_tb_comps/Barrage/HorizontalBarrage/Barrage.jsx
View file @
53e12dca
...
@@ -67,7 +67,7 @@ const Barrage = props => {
...
@@ -67,7 +67,7 @@ const Barrage = props => {
useEffect
(()
=>
{
useEffect
(()
=>
{
createData
()
createData
()
return
()
=>
{}
return
()
=>
{}
},
[])
},
[
dataList
])
return
(
return
(
<
View
id=
'barrage_wrap'
style=
{
`width:${width / 100}rem`
}
className=
{
styles
[
'barrage-wrap'
]
}
>
<
View
id=
'barrage_wrap'
style=
{
`width:${width / 100}rem`
}
className=
{
styles
[
'barrage-wrap'
]
}
>
...
...
c_client/src/components/_tb_comps/GoodsList/GoodsList.jsx
View file @
53e12dca
...
@@ -10,7 +10,7 @@ function GoodsList(props) {
...
@@ -10,7 +10,7 @@ function GoodsList(props) {
goodsList
=
[],
goodsList
=
[],
task
=
{
task
=
{
itemId
:
'617724147979,617724563528,617300295119'
,
itemId
:
'617724147979,617724563528,617300295119'
,
taskType
:
'browse
Goods
'
,
taskType
:
'browse'
,
image
:
{
image
:
{
collect
:
'//yun.dui88.com/taobaomini/clientCTest/goods_collection@2x.png'
,
collect
:
'//yun.dui88.com/taobaomini/clientCTest/goods_collection@2x.png'
,
no_collect
:
'//yun.dui88.com/taobaomini/clientCTest/collection_no_collect@2x.png'
,
no_collect
:
'//yun.dui88.com/taobaomini/clientCTest/collection_no_collect@2x.png'
,
...
@@ -25,7 +25,7 @@ function GoodsList(props) {
...
@@ -25,7 +25,7 @@ function GoodsList(props) {
const
goToGoodsDetail
=
async
(
item
)
=>
{
const
goToGoodsDetail
=
async
(
item
)
=>
{
const
{
taskType
}
=
task
const
{
taskType
}
=
task
const
{
itemId
}
=
item
const
{
itemId
}
=
item
if
(
taskType
===
'browse
Goods
'
)
{
if
(
taskType
===
'browse'
)
{
onOpenDetail
&&
onOpenDetail
(
itemId
)
onOpenDetail
&&
onOpenDetail
(
itemId
)
}
}
...
@@ -36,10 +36,10 @@ function GoodsList(props) {
...
@@ -36,10 +36,10 @@ function GoodsList(props) {
const
{
itemId
,
collected
}
=
item
const
{
itemId
,
collected
}
=
item
onCompleteTask
&&
onCompleteTask
(
itemId
,
collected
)
onCompleteTask
&&
onCompleteTask
(
itemId
,
collected
)
}
}
// 收藏按钮
// 收藏按钮
const
getCollectStyle
=
(
collected
)
=>
{
const
getCollectStyle
=
(
collected
)
=>
{
return
classnames
(
styles
[
'item__price-collect'
],{
return
classnames
(
styles
[
'item__price-
no-
collect'
],{
[
`
${
styles
[
'item__price-
no-
collect'
]}
`
]:
collected
[
`
${
styles
[
'item__price-collect'
]}
`
]:
collected
})
})
}
}
return
(
return
(
...
@@ -56,10 +56,10 @@ function GoodsList(props) {
...
@@ -56,10 +56,10 @@ function GoodsList(props) {
<
View
className=
{
styles
[
'item__price'
]
}
>
<
View
className=
{
styles
[
'item__price'
]
}
>
<
View
className=
{
styles
[
'item__price-num'
]
}
><
text
>
¥
</
text
>
{
item
.
price
}
</
View
>
<
View
className=
{
styles
[
'item__price-num'
]
}
><
text
>
¥
</
text
>
{
item
.
price
}
</
View
>
{
{
task
.
taskType
===
'collectGoods'
&&
task
?.
hasCollectIcon
&&
<
View
<
View
onClick=
{
()
=>
goToCollectGoods
(
item
)
}
onClick=
{
()
=>
goToCollectGoods
(
item
)
}
className=
{
()
=>
getCollectStyle
(
item
.
collected
)
}
className=
{
getCollectStyle
(
item
.
collected
)
}
>
>
<
Image
mode=
'scaleToFill'
src=
{
item
.
collected
?
task
.
image
.
collect
:
task
.
image
.
no_collect
}
/>
<
Image
mode=
'scaleToFill'
src=
{
item
.
collected
?
task
.
image
.
collect
:
task
.
image
.
no_collect
}
/>
</
View
>
</
View
>
...
...
c_client/src/components/_tb_comps/_Progress/ProgressNode/index.jsx
View file @
53e12dca
...
@@ -21,7 +21,7 @@ const ProgressNode = memo(props => {
...
@@ -21,7 +21,7 @@ const ProgressNode = memo(props => {
const
{
maxLevel
,
nodeClassName
}
=
useMemo
(
const
{
maxLevel
,
nodeClassName
}
=
useMemo
(
()
=>
useContext
(
ProgressContext
),
()
=>
useContext
(
ProgressContext
),
ProgressContext
[
ProgressContext
]
)
)
const
getNodeStyle
=
classnames
(
styles
[
'defualt-progress-node'
],
{
const
getNodeStyle
=
classnames
(
styles
[
'defualt-progress-node'
],
{
...
...
c_client/src/components/_tb_comps/_Progress/index.jsx
View file @
53e12dca
...
@@ -22,7 +22,7 @@ const Progress = memo(props => {
...
@@ -22,7 +22,7 @@ const Progress = memo(props => {
const
LevelList
=
useMemo
(()
=>
{
const
LevelList
=
useMemo
(()
=>
{
return
levelList
return
levelList
},
levelList
)
},
[
levelList
]
)
// 合并全局配置
// 合并全局配置
const
mergeConfigToDefault
=
useCallback
(
config
=>
{
const
mergeConfigToDefault
=
useCallback
(
config
=>
{
...
...
c_client/src/config/browse.config.js
View file @
53e12dca
export
const
BROWSE_CONFIG
=
{
export
const
BROWSE_CONFIG
=
{
taskType
:
'browse
Goods
'
,
taskType
:
'browse'
,
type
:
'01'
,
type
:
'01'
,
bg
:
'//yun.dui88.com/taobaomini/clientCTest/goods_bg@2x.png'
,
bg
:
'//yun.dui88.com/taobaomini/clientCTest/goods_bg@2x.png'
,
head
:
{
head
:
{
...
...
c_client/src/config/cart.config.js
View file @
53e12dca
export
const
CART_CONFIG
=
{
export
const
CART_CONFIG
=
{
taskType
:
'
cartGoods
'
,
taskType
:
'
addCart
'
,
type
:
1
,
// 1 单个商品可重复完成 2 单个商品只可完成一次
type
:
1
,
// 1 单个商品可重复完成 2 单个商品只可完成一次
bg
:
'//yun.dui88.com/taobaomini/clientCTest/goods_bg@2x.png'
,
bg
:
'//yun.dui88.com/taobaomini/clientCTest/goods_bg@2x.png'
,
head
:
{
head
:
{
...
@@ -11,7 +11,8 @@ export const CART_CONFIG = {
...
@@ -11,7 +11,8 @@ export const CART_CONFIG = {
collect
:
'//yun.duiba.com.cn/taobaomini/clientCTest/goods_collection@2x.png'
,
collect
:
'//yun.duiba.com.cn/taobaomini/clientCTest/goods_collection@2x.png'
,
no_collect
:
'//yun.duiba.com.cn/taobaomini/clientCTest/collection_no_collect@2x.png'
,
no_collect
:
'//yun.duiba.com.cn/taobaomini/clientCTest/collection_no_collect@2x.png'
,
},
},
color
:
'#181818'
color
:
'#181818'
,
hasCollectIcon
:
true
//是否展示收藏icon
}
}
// 任务完成类型
// 任务完成类型
export
const
CART_TYPE
=
{
export
const
CART_TYPE
=
{
...
...
c_client/src/config/collect.config.js
View file @
53e12dca
export
default
{
export
default
{
taskType
:
'collect
Goods
'
,
taskType
:
'collect'
,
type
:
'01'
,
type
:
'01'
,
bg
:
'//yun.dui88.com/taobaomini/clientCTest/goods_bg@2x.png'
,
bg
:
'//yun.dui88.com/taobaomini/clientCTest/goods_bg@2x.png'
,
head
:
{
head
:
{
...
@@ -11,5 +11,6 @@ export default {
...
@@ -11,5 +11,6 @@ export default {
collect
:
'//yun.duiba.com.cn/taobaomini/clientCTest/goods_collection@2x.png'
,
collect
:
'//yun.duiba.com.cn/taobaomini/clientCTest/goods_collection@2x.png'
,
no_collect
:
'//yun.duiba.com.cn/taobaomini/clientCTest/collection_no_collect@2x.png'
no_collect
:
'//yun.duiba.com.cn/taobaomini/clientCTest/collection_no_collect@2x.png'
},
},
color
:
'#181818'
color
:
'#181818'
,
hasCollectIcon
:
true
//是否展示收藏icon
}
}
\ No newline at end of file
c_client/src/config/help.config.js
View file @
53e12dca
...
@@ -11,7 +11,7 @@ export const HELP_MODAL_SHOW = {
...
@@ -11,7 +11,7 @@ export const HELP_MODAL_SHOW = {
}
}
// 助力配置
// 助力配置
export
const
HELP_CONFIG
=
{
export
const
HELP_CONFIG
=
{
KEY
:
'invite
s
'
,
KEY
:
'invite'
,
HELP
:
{
HELP
:
{
width
:
639
,
width
:
639
,
height
:
730
,
height
:
730
,
...
...
c_client/src/config/order.config.js
View file @
53e12dca
export
default
{
export
default
{
taskType
:
'order
Goods
'
,
taskType
:
'order'
,
type
:
'01'
,
type
:
'01'
,
bg
:
'//yun.dui88.com/taobaomini/clientCTest/goods_bg@2x.png'
,
bg
:
'//yun.dui88.com/taobaomini/clientCTest/goods_bg@2x.png'
,
head
:
{
head
:
{
...
...
c_client/src/config/task.config.js
View file @
53e12dca
...
@@ -30,13 +30,13 @@ export const TASK_CONFIG = {
...
@@ -30,13 +30,13 @@ export const TASK_CONFIG = {
icons
:
{
// 任务图标
icons
:
{
// 任务图标
follow
:
'//yun.duiba.com.cn/baicaoweiFarmer/follow.png'
,
follow
:
'//yun.duiba.com.cn/baicaoweiFarmer/follow.png'
,
member
:
'//yun.duiba.com.cn/baicaoweiFarmer/memberStar1.png'
,
member
:
'//yun.duiba.com.cn/baicaoweiFarmer/memberStar1.png'
,
invite
s
:
'//yun.duiba.com.cn/baicaoweiFarmer/invites.png'
,
invite
:
'//yun.duiba.com.cn/baicaoweiFarmer/invites.png'
,
jump
Link
:
'//yun.duiba.com.cn/baicaoweiFarmer/browseGoodsLink.png'
,
jump
:
'//yun.duiba.com.cn/baicaoweiFarmer/browseGoodsLink.png'
,
browse
Goods
:
'//yun.duiba.com.cn/baicaoweiFarmer/browseGoods.png'
,
browse
:
'//yun.duiba.com.cn/baicaoweiFarmer/browseGoods.png'
,
order
Goods
:
'//yun.duiba.com.cn/baicaoweiFarmer/orderGoods.png'
,
order
:
'//yun.duiba.com.cn/baicaoweiFarmer/orderGoods.png'
,
collect
Goods
:
'//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
Credits
:
'//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'
},
},
commonTxt
:
{
commonTxt
:
{
...
@@ -46,18 +46,18 @@ export const TASK_CONFIG = {
...
@@ -46,18 +46,18 @@ export const TASK_CONFIG = {
},
},
doTxt
:
{
doTxt
:
{
follow
:
'立即关注'
,
follow
:
'立即关注'
,
invite
s
:
'去邀请'
,
invite
:
'去邀请'
,
member
:
'1秒入会'
,
member
:
'1秒入会'
,
sign
:
'立即签到'
,
sign
:
'立即签到'
,
jump
Link
:
'去完成'
,
jump
:
'去完成'
,
browse
Goods
:
'去完成'
,
browse
:
'去完成'
,
order
Goods
:
'去完成'
,
order
:
'去完成'
,
collect
Goods
:
'去完成'
collect
:
'去完成'
},
},
successMsg
:
'领取成功,奖励值+'
,
successMsg
:
'领取成功,奖励值+'
,
rewardMsg
:
'抽盒次数+'
,
rewardMsg
:
'抽盒次数+'
,
rewardsKey
:
'totalHotValue'
,
rewardsKey
:
'totalHotValue'
,
browseGoodType
:
'browse
Goods
'
,
// 临时使用 browse | browseGoods
browseGoodType
:
'browse'
,
// 临时使用 browse | browseGoods
isMock
:
false
,
// 是否使用mock数据
isMock
:
false
,
// 是否使用mock数据
jumpType
:
1
,
// 1 跳转浏览15s 才算完成 2 跳转即算完成
jumpType
:
1
,
// 1 跳转浏览15s 才算完成 2 跳转即算完成
browseTime
:
15
,
// 浏览时间
browseTime
:
15
,
// 浏览时间
...
...
c_client/src/hooks/useTasks.js
View file @
53e12dca
...
@@ -90,7 +90,7 @@ export function useTasks(props) {
...
@@ -90,7 +90,7 @@ export function useTasks(props) {
}
}
doCompleteTaskHandle
(
key
,
isVip
)
doCompleteTaskHandle
(
key
,
isVip
)
},
},
invite
s
:
()
=>
showSharePanel
(),
invite
:
()
=>
showSharePanel
(),
follow
:
async
()
=>
{
follow
:
async
()
=>
{
// 已关注店铺直接完成任务
// 已关注店铺直接完成任务
const
isFollow
=
await
checkShopFavoredStatus
(
config
.
sellerId
)
const
isFollow
=
await
checkShopFavoredStatus
(
config
.
sellerId
)
...
@@ -106,7 +106,7 @@ export function useTasks(props) {
...
@@ -106,7 +106,7 @@ export function useTasks(props) {
}
}
},
},
// 跳转任务 https://www.feizhu.com
// 跳转任务 https://www.feizhu.com
jump
Link
:
async
()
=>
{
jump
:
async
()
=>
{
navigateToOutside
(
url
)
navigateToOutside
(
url
)
if
(
jumpType
===
2
)
{
if
(
jumpType
===
2
)
{
doCompleteTaskHandle
(
key
)
doCompleteTaskHandle
(
key
)
...
@@ -116,12 +116,12 @@ export function useTasks(props) {
...
@@ -116,12 +116,12 @@ export function useTasks(props) {
}
}
// await API.addStat({ type: 'BROWSE_LIVE'})
// await API.addStat({ type: 'BROWSE_LIVE'})
},
},
browse
Goods
:
async
()
=>
{
browse
:
async
()
=>
{
app
.
isFlashTask
=
true
app
.
isFlashTask
=
true
if
(
browseType
===
BROSE_GOOD_TYPE
.
PAGE
)
preBrowseTime
.
current
=
Date
.
now
()
if
(
browseType
===
BROSE_GOOD_TYPE
.
PAGE
)
preBrowseTime
.
current
=
Date
.
now
()
navigateTo
(
`/pages/packageGood/browseGoods/browseGoods?itemIds=
${
itemIds
}
&keepTime=
${
keepTime
}
`
)
navigateTo
(
`/pages/packageGood/browseGoods/browseGoods?itemIds=
${
itemIds
}
&keepTime=
${
keepTime
}
`
)
},
},
order
Goods
:
async
()
=>
{
order
:
async
()
=>
{
app
.
isFlashTask
=
true
app
.
isFlashTask
=
true
if
(
orderType
===
ORDER_GOOD_TYPE
.
PAGE
)
{
if
(
orderType
===
ORDER_GOOD_TYPE
.
PAGE
)
{
navigateTo
(
`/pages/packageGood/orderGoods/orderGoods?itemIds=
${
itemIds
}
`
)
navigateTo
(
`/pages/packageGood/orderGoods/orderGoods?itemIds=
${
itemIds
}
`
)
...
@@ -129,10 +129,14 @@ export function useTasks(props) {
...
@@ -129,10 +129,14 @@ export function useTasks(props) {
await
navigateToTaobaoPage
(
SHOP_ID
)
await
navigateToTaobaoPage
(
SHOP_ID
)
}
}
},
},
collect
Goods
:
async
()
=>
{
collect
:
async
()
=>
{
app
.
isFlashTask
=
true
app
.
isFlashTask
=
true
navigateTo
(
`/pages/packageGood/collectGoods/collectGoods?itemIds=
${
itemIds
}
`
)
navigateTo
(
`/pages/packageGood/collectGoods/collectGoods?itemIds=
${
itemIds
}
`
)
},
},
addCart
:
async
()
=>
{
app
.
isFlashTask
=
true
navigateTo
(
`/pages/packageGood/cartGoods/cartGoods?itemIds=
${
itemIds
}
`
)
},
sign
:
()
=>
doCompleteTaskHandle
(
key
),
sign
:
()
=>
doCompleteTaskHandle
(
key
),
share
:
()
=>
{
share
:
()
=>
{
showSharePanel
();
showSharePanel
();
...
...
c_client/src/pages/packageGood/cartGoods/cartGoods.jsx
View file @
53e12dca
...
@@ -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
{
GOOD_LIST
}
from
'@/mock'
const
{
commonToast
,
showSkuModal
}
=
tbccTs
.
tb
const
{
commonToast
,
showSkuModal
}
=
tbccTs
.
tb
...
@@ -25,7 +26,7 @@ function CartGoodsPage() {
...
@@ -25,7 +26,7 @@ function CartGoodsPage() {
const
getGoodsList
=
async
()
=>
{
const
getGoodsList
=
async
()
=>
{
const
{
data
}
=
await
API
.
getCollectGoods
({
key
:
CART_CONFIG
.
taskType
,
itemIds
})
const
{
data
}
=
await
API
.
getCollectGoods
({
key
:
CART_CONFIG
.
taskType
,
itemIds
})
setGoodsList
(
data
?.
list
||
[])
data
?.
list
&&
setGoodsList
(
data
?.
list
||
[])
}
}
// 加入购物车 // 对应itemId为 574141925233 skuId为4018047819826 数量为4
// 加入购物车 // 对应itemId为 574141925233 skuId为4018047819826 数量为4
const
onCompleteTask
=
useThrottle
(
async
(
itemId
,
collected
)
=>
{
const
onCompleteTask
=
useThrottle
(
async
(
itemId
,
collected
)
=>
{
...
@@ -54,7 +55,7 @@ function CartGoodsPage() {
...
@@ -54,7 +55,7 @@ function CartGoodsPage() {
<
TitleImg
config=
{
CART_CONFIG
.
head
}
/>
<
TitleImg
config=
{
CART_CONFIG
.
head
}
/>
</
View
>
</
View
>
<
View
className=
{
styles
[
'page-content__list'
]
}
>
<
View
className=
{
styles
[
'page-content__list'
]
}
>
<
GoodsList
goodsList=
{
goodsList
}
task=
{
CART_CONFIG
}
on
OpenDetail
=
{
(
itemId
,
collected
)
=>
onCompleteTask
(
itemId
,
collected
)
}
/>
<
GoodsList
goodsList=
{
goodsList
}
task=
{
CART_CONFIG
}
on
CompleteTask
=
{
(
itemId
,
collected
)
=>
onCompleteTask
(
itemId
,
collected
)
}
/>
</
View
>
</
View
>
</
ContainerFit
>
</
ContainerFit
>
)
)
...
...
c_client/src/pages/packageGood/collectGoods/collectGoods.jsx
View file @
53e12dca
...
@@ -7,9 +7,10 @@ import { useRouter } from '@tarojs/taro'
...
@@ -7,9 +7,10 @@ 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'
import
{
useThrottle
}
from
'@/hooks/useThrottle'
import
{
useThrottle
}
from
'@/hooks/useThrottle'
const
{
commonToast
}
=
tbccTs
.
tb
const
{
commonToast
,
checkGoodsCollectedStatus
,
collectGoods
}
=
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
{
GOOD_LIST
}
from
'@/mock'
function
CollectGoodsPage
()
{
function
CollectGoodsPage
()
{
const
router
=
useRouter
()
const
router
=
useRouter
()
...
@@ -24,12 +25,12 @@ function CollectGoodsPage() {
...
@@ -24,12 +25,12 @@ function CollectGoodsPage() {
const
getGoodsList
=
async
()
=>
{
const
getGoodsList
=
async
()
=>
{
const
{
data
}
=
await
API
.
getCollectGoods
({
key
:
COLLECT_CONFIG
.
taskType
,
itemIds
})
const
{
data
}
=
await
API
.
getCollectGoods
({
key
:
COLLECT_CONFIG
.
taskType
,
itemIds
})
setGoodsList
(
data
?.
list
||
[])
data
?.
list
&&
setGoodsList
(
data
?.
list
||
[])
}
}
const
onCompleteTask
=
useThrottle
(
async
(
itemId
,
collected
)
=>
{
const
onCompleteTask
=
useThrottle
(
async
(
itemId
,
collected
)
=>
{
const
collectFn
=
async
()
=>
{
const
collectFn
=
async
()
=>
{
const
{
success
}
=
await
API
.
completeTask
({
key
:
taskType
,
itemId
})
const
{
success
}
=
await
API
.
completeTask
({
key
:
COLLECT_CONFIG
.
taskType
,
itemId
})
if
(
success
)
{
if
(
success
)
{
collectFlag
.
current
=
true
collectFlag
.
current
=
true
getGoodsList
()
getGoodsList
()
...
@@ -47,12 +48,12 @@ function CollectGoodsPage() {
...
@@ -47,12 +48,12 @@ function CollectGoodsPage() {
}
}
// 判断是否活动外已收藏商品
// 判断是否活动外已收藏商品
const
isCollected
=
await
checkGoodsCollectedStatus
(
+
itemId
)
const
isCollected
=
await
checkGoodsCollectedStatus
(
+
itemId
)
if
(
isCollected
)
{
if
(
String
(
isCollected
)
===
'true'
)
{
collectFn
()
collectFn
()
return
;
return
;
}
}
const
result
=
await
collectGoods
(
+
itemId
)
const
result
=
await
collectGoods
(
+
itemId
)
if
(
result
)
{
if
(
result
&&
result
?.
success
)
{
collectFn
()
collectFn
()
return
;
return
;
}
}
...
@@ -64,7 +65,7 @@ function CollectGoodsPage() {
...
@@ -64,7 +65,7 @@ function CollectGoodsPage() {
<
TitleImg
config=
{
COLLECT_CONFIG
.
head
}
/>
<
TitleImg
config=
{
COLLECT_CONFIG
.
head
}
/>
</
View
>
</
View
>
<
View
className=
{
styles
[
'page-content__list'
]
}
>
<
View
className=
{
styles
[
'page-content__list'
]
}
>
<
GoodsList
goodsList=
{
goodsList
}
task=
{
COLLECT_CONFIG
}
on
OpenDetail
=
{
(
itemId
,
collected
)
=>
onCompleteTask
(
itemId
,
collected
)
}
/>
<
GoodsList
goodsList=
{
goodsList
}
task=
{
COLLECT_CONFIG
}
on
CompleteTask
=
{
(
itemId
,
collected
)
=>
onCompleteTask
(
itemId
,
collected
)
}
/>
</
View
>
</
View
>
</
ContainerFit
>
</
ContainerFit
>
)
)
...
...
c_client/src/pages/packageGood/orderGoods/orderGoods.jsx
View file @
53e12dca
...
@@ -20,7 +20,7 @@ function OrderGoodsPage() {
...
@@ -20,7 +20,7 @@ function OrderGoodsPage() {
<
TitleImg
config=
{
ORDER_CONFIG
.
head
}
/>
<
TitleImg
config=
{
ORDER_CONFIG
.
head
}
/>
</
View
>
</
View
>
<
View
className=
{
styles
[
'page-content__list'
]
}
>
<
View
className=
{
styles
[
'page-content__list'
]
}
>
<
GoodsList
goodsList=
{
data
?.
list
||
[]
}
task=
{
ORDER_CONFIG
}
onOpenDetail=
{
(
itemId
,
isBrowsed
)
=>
onOpenDetail
(
itemId
,
isBrowsed
)
}
/>
<
GoodsList
goodsList=
{
data
?.
list
||
[]
}
task=
{
ORDER_CONFIG
}
/>
</
View
>
</
View
>
</
ContainerFit
>
</
ContainerFit
>
...
...
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