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
7f1d3377
Commit
7f1d3377
authored
May 19, 2021
by
管新明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 收藏商品成功后更新收藏列表
parent
555c0714
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22671 additions
and
6 deletions
+22671
-6
package-lock.json
c_client/package-lock.json
+22656
-0
config.js
c_client/src/config.js
+2
-2
collectGoods.jsx
c_client/src/pages/collectGoods/collectGoods.jsx
+13
-4
No files found.
c_client/package-lock.json
0 → 100644
View file @
7f1d3377
This source diff could not be displayed because it is too large. You can
view the blob
instead.
c_client/src/config.js
View file @
7f1d3377
export
default
{
env
:
'test'
,
// 云函数环境 test 测试环境 online 线上环境
requestType
:
'
tornadoAPI
'
,
// cloud: 云函数, yapi: yapi 接口, ams: ams接口,tornadoAPI: 风驰台接口
cloudName
:
'
luolai
'
,
// 主云函数项目名 CommonToC
requestType
:
'
yapi
'
,
// cloud: 云函数, yapi: yapi 接口, ams: ams接口,tornadoAPI: 风驰台接口
cloudName
:
'
CommonToC
'
,
// 主云函数项目名 CommonToC
sellerId
:
'2207644377875'
,
tornadoAPI
:
'https://tornado.duibadev.com.cn/tbServer/api?db=db3000000038851072&proxyIp=172.16.130.158'
,
// 新增:当requestType: 'tornadoAPI'时,找服务端提供地址
defaultActivityId
:
'60642aafc752d118247c2a2d'
// 默认活动id
...
...
c_client/src/pages/collectGoods/collectGoods.jsx
View file @
7f1d3377
import
React
from
'react'
import
React
,
{
useState
,
useEffect
}
from
'react'
import
{
View
}
from
'@tarojs/components'
import
GoodsPage
from
'@/components/GoodsPage/GoodsPage'
import
{
useRequest
}
from
'@/hooks/useRequest'
import
{
useRouter
}
from
'@tarojs/taro'
import
tbccTs
from
'tbcc-sdk-ts'
import
API
from
'@/api'
...
...
@@ -25,19 +24,29 @@ const browseConfig = {
function
CollectGoodsPage
()
{
const
router
=
useRouter
()
const
[
goodsList
,
setGoodsList
]
=
useState
([])
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
{
success
}
=
await
API
.
doCompleteTask
({
taskType
,
itemId
})
if
(
success
)
{
getGoodsList
()
commonToast
(
'收藏成功'
)
}
})
return
(
<
View
>
<
GoodsPage
goodsList=
{
data
?.
list
||
[]
}
task=
{
browseConfig
}
onCompleteTask=
{
()
=>
onCompleteTask
}
/>
<
GoodsPage
goodsList=
{
goodsList
}
task=
{
browseConfig
}
onCompleteTask=
{
()
=>
onCompleteTask
}
/>
</
View
>
)
}
...
...
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