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
675b3a91
Commit
675b3a91
authored
Mar 09, 2021
by
qinhaitao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:formate
parent
c8973039
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
32 deletions
+18
-32
collectGoods.config.js
c_client/src/pages/collectGoods/collectGoods.config.js
+1
-1
collectGoods.jsx
c_client/src/pages/collectGoods/collectGoods.jsx
+12
-18
orderGoods.config.js
c_client/src/pages/orderGoods/orderGoods.config.js
+1
-1
orderGoods.jsx
c_client/src/pages/orderGoods/orderGoods.jsx
+4
-12
No files found.
c_client/src/pages/collectGoods/collectGoods.config.js
View file @
675b3a91
export
default
{
export
default
{
navigationBarTitleText
:
'
我的奖
品'
,
navigationBarTitleText
:
'
收藏商
品'
,
enableSkia
:
'true'
,
enableSkia
:
'true'
,
allowsBounceVertical
:
'NO'
,
allowsBounceVertical
:
'NO'
,
enableShareAppMessage
:
true
enableShareAppMessage
:
true
...
...
c_client/src/pages/collectGoods/collectGoods.jsx
View file @
675b3a91
import
React
,
{
useEffect
,
useState
}
from
'react'
import
React
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
{
useRequest
}
from
'@/hooks/useRequest'
import
{
use
DidShow
,
use
Router
}
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'
const
{
throttleHandle
}
=
tbccTs
.
utils
;
import
{
useThrottle
}
from
'@/hooks/useThrottle'
const
{
commonToast
,
favorShop
,
navigateTo
,
navigateToOutside
,
showSharePanel
}
=
tbccTs
.
tb
;
const
{
commonToast
}
=
tbccTs
.
tb
const
browseConfig
=
{
const
browseConfig
=
{
taskType
:
'collectGoods'
,
taskType
:
'collectGoods'
,
...
@@ -17,33 +18,26 @@ const browseConfig = {
...
@@ -17,33 +18,26 @@ const browseConfig = {
title
:
'//yun.duiba.com.cn/taobaomini/clientCTest/goods_title@2x.png'
,
title
:
'//yun.duiba.com.cn/taobaomini/clientCTest/goods_title@2x.png'
,
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'
,
img
:
'//yun.duiba.com.cn/taobaomini/clientCTest/goods_img@2x.png'
,
img
:
'//yun.duiba.com.cn/taobaomini/clientCTest/goods_img@2x.png'
},
},
color
:
'#181818'
color
:
'#181818'
}
}
function
CollectGoodsPage
()
{
function
CollectGoodsPage
()
{
const
[
goodsList
,
setGoodsList
]
=
useState
([])
const
router
=
useRouter
()
const
router
=
useRouter
()
const
{
itemIds
}
=
router
?.
params
const
{
itemIds
}
=
router
?.
params
const
{
data
,
success
}
=
useRequest
(
API
.
getCollectGoodsList
,{
itemIds
})
const
{
data
}
=
useRequest
(
API
.
getCollectGoodsList
,
{
itemIds
})
useEffect
(()
=>
{
success
&&
setGoodsList
(
data
?.
list
)
},[
success
])
const
onCompleteTask
=
async
(
taskType
,
itemId
)
=>
{
const
onCompleteTask
=
useThrottle
(
async
(
taskType
,
itemId
)
=>
{
let
{
success
,
data
}
=
await
API
.
doCompleteTask
({
taskType
,
itemId
}).
catch
(
res
=>
{
const
{
success
}
=
await
API
.
doCompleteTask
({
taskType
,
itemId
})
res
&&
commonToast
(
res
.
message
)
if
(
success
)
{
})
||
{}
if
(
success
)
{
commonToast
(
'收藏成功'
)
commonToast
(
'收藏成功'
)
}
}
}
}
)
return
(
return
(
<
View
>
<
View
>
<
GoodsPage
goodsList=
{
goodsList
}
task=
{
browseConfig
}
onCompleteTask=
{
()
=>
onCompleteTask
}
/>
<
GoodsPage
goodsList=
{
data
?.
list
||
[]
}
task=
{
browseConfig
}
onCompleteTask=
{
()
=>
onCompleteTask
}
/>
</
View
>
</
View
>
)
)
}
}
...
...
c_client/src/pages/orderGoods/orderGoods.config.js
View file @
675b3a91
export
default
{
export
default
{
navigationBarTitleText
:
'
我的奖
品'
,
navigationBarTitleText
:
'
下单商
品'
,
enableSkia
:
'true'
,
enableSkia
:
'true'
,
allowsBounceVertical
:
'NO'
,
allowsBounceVertical
:
'NO'
,
enableShareAppMessage
:
true
enableShareAppMessage
:
true
...
...
c_client/src/pages/orderGoods/orderGoods.jsx
View file @
675b3a91
...
@@ -2,11 +2,8 @@ import React, { useEffect, useState } from 'react'
...
@@ -2,11 +2,8 @@ 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
{
useRequest
}
from
'@/hooks/useRequest'
import
{
useRequest
}
from
'@/hooks/useRequest'
import
{
useDidShow
,
useRouter
}
from
'@tarojs/taro'
import
{
useRouter
}
from
'@tarojs/taro'
import
tbccTs
from
'@/tbcc-sdk-ts'
import
API
from
'@/api'
import
API
from
'@/api'
const
{
throttleHandle
}
=
tbccTs
.
utils
;
const
{
commonToast
,
favorShop
,
navigateTo
,
navigateToOutside
,
showSharePanel
}
=
tbccTs
.
tb
;
const
browseConfig
=
{
const
browseConfig
=
{
taskType
:
'orderGoods'
,
taskType
:
'orderGoods'
,
...
@@ -17,24 +14,19 @@ const browseConfig = {
...
@@ -17,24 +14,19 @@ const browseConfig = {
title
:
'//yun.duiba.com.cn/taobaomini/clientCTest/goods_title@2x.png'
,
title
:
'//yun.duiba.com.cn/taobaomini/clientCTest/goods_title@2x.png'
,
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'
,
img
:
'//yun.duiba.com.cn/taobaomini/clientCTest/goods_img@2x.png'
,
img
:
'//yun.duiba.com.cn/taobaomini/clientCTest/goods_img@2x.png'
},
},
color
:
'#181818'
color
:
'#181818'
}
}
function
OrderGoodsPage
()
{
function
OrderGoodsPage
()
{
const
[
goodsList
,
setGoodsList
]
=
useState
([])
const
router
=
useRouter
()
const
router
=
useRouter
()
const
{
itemIds
}
=
router
?.
params
const
{
itemIds
}
=
router
?.
params
const
{
data
,
success
}
=
useRequest
(
API
.
getItemListByItemIds
,{
itemIds
})
const
{
data
}
=
useRequest
(
API
.
getItemListByItemIds
,
{
itemIds
})
useEffect
(()
=>
{
success
&&
setGoodsList
(
data
?.
list
)
},[
success
])
return
(
return
(
<
View
>
<
View
>
<
GoodsPage
goodsList=
{
goodsList
}
task=
{
browseConfig
}
/>
<
GoodsPage
goodsList=
{
data
?.
list
||
[]
}
task=
{
browseConfig
}
/>
</
View
>
</
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