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
352ed039
Commit
352ed039
authored
Sep 08, 2021
by
王能飞
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'c_client_taro-pack' into 'c_client_taro'
我的奖品增加专属商品奖品处理逻辑 See merge request
!41
parents
50543a16
e64e572b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
10 deletions
+30
-10
myPrize.config.js
c_client/src/config/myPrize.config.js
+2
-1
comsTest.jsx
c_client/src/pages/packageComs/comsTest/comsTest.jsx
+0
-1
myPrize.jsx
c_client/src/pages/packagePrize/myPrize/myPrize.jsx
+28
-8
No files found.
c_client/src/config/myPrize.config.js
View file @
352ed039
...
...
@@ -62,5 +62,6 @@ export const PRIZE_CONFIG = {
contentTop
:
'208rpx'
,
blankTxt
:
'暂无奖品'
,
hasLogistic
:
false
,
// 是否展示物流信息
isShowPirzeId
:
false
// 是否显示奖品编号
isShowPirzeId
:
false
,
// 是否显示奖品编号
hasGoodPrize
:
false
,
// 是否含有专属商品
}
\ No newline at end of file
c_client/src/pages/packageComs/comsTest/comsTest.jsx
View file @
352ed039
...
...
@@ -95,7 +95,6 @@ export default function ComsTest(props) {
/* 背景音乐 */
const
{
playAudio
,
musicUrl
,
setOpenStatus
,
openStatus
}
=
useAudio
(
BGMUSIC_URL
.
MUSIC
,
true
)
const
[
endTime
,
setEndTime
]
=
useState
(
''
)
const
[
prizeModalVisible
,
setPrizeModalVisible
]
=
useState
(
false
)
...
...
c_client/src/pages/packagePrize/myPrize/myPrize.jsx
View file @
352ed039
import
React
,
{
useState
,
useEffect
}
from
'react'
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
import
{
Image
,
ScrollView
,
View
}
from
'@tarojs/components'
import
API
from
'@/api'
import
DeliveryModal
from
'@/components/_tb_modal/DeliveryModal/DeliveryModal'
...
...
@@ -8,15 +8,15 @@ import tbccTs from 'tbcc-sdk-ts'
import
{
useThrottle
}
from
'@/hooks/useThrottle'
import
{
dateFormatter
}
from
'@/utils/date'
import
styles
from
'./myPrize.module.less'
import
{
useDidHide
,
getApp
}
from
'@tarojs/taro'
import
{
useDidHide
,
useDidShow
,
getApp
}
from
'@tarojs/taro'
import
useReceive
from
'@/hooks/useReceive'
import
{
PRIZE_CONFIG
,
DRAW_STATUS
,
PRIZE_TYPE
}
from
'@/config/myPrize.config'
const
{
objectStatus
:
_objectStatus
,
enameStatus
:
_enameStatus
,
orderStatus
,
commonStatus
}
=
PRIZE_CONFIG
const
{
objectStatus
:
_objectStatus
,
enameStatus
:
_enameStatus
,
orderStatus
,
commonStatus
,
hasGoodPrize
}
=
PRIZE_CONFIG
const
objectStatus
=
{
...
_objectStatus
,
...
commonStatus
}
const
enameStatus
=
{
...
_enameStatus
,
...
commonStatus
}
const
{
commonToast
,
navigateToOutside
,
setClipboard
}
=
tbccTs
.
tb
const
{
commonToast
,
navigateToOutside
,
setClipboard
,
openDetail
}
=
tbccTs
.
tb
function
Empty
(
blankTxt
)
{
return
<
View
className=
{
styles
[
'my-prize-item__empty'
]
}
>
{
blankTxt
}
</
View
>
...
...
@@ -30,6 +30,7 @@ function MyPrizeList() {
const
[
currentPrize
,
setCurrentPrize
]
=
useState
({})
const
[
memberVisible
,
setMemberVisible
]
=
useState
(
false
)
const
[
deliveryModalVisible
,
setDeliveryModalVisible
]
=
useState
(
false
)
const
flashList
=
useRef
(
false
)
useEffect
(()
=>
{
fetchMyPriceList
()
...
...
@@ -44,6 +45,13 @@ function MyPrizeList() {
setExpiredTime
(
dateFormatter
(
res
?.
data
?.
expiredTime
,
'yyyy/MM/dd hh:mm:ss'
))
}
}
// 页面显示
useDidShow
(()
=>
{
if
(
flashList
.
current
)
{
flashList
.
current
=
false
fetchMyPriceList
()
}
})
// 复制编码
const
handleCopyId
=
async
(
text
)
=>
{
await
setClipboard
(
text
)
...
...
@@ -68,6 +76,12 @@ function MyPrizeList() {
if
(
!
(
drawStatus
===
DRAW_STATUS
.
RETRY
||
drawStatus
===
DRAW_STATUS
.
WAITAWARD
))
{
return
}
// 含有专属商品
if
(
hasGoodPrize
&&
itemId
)
{
flashList
.
current
=
true
await
openDetail
(
String
(
itemId
))
}
// 执行奖品领取
receivePrize
(
item
,{
vipCallback
:()
=>
{
...
...
@@ -91,6 +105,15 @@ function MyPrizeList() {
setMemberVisible
(
false
)
}
// 获取btn img
const
getItmImg
=
(
itm
)
=>
{
const
{
type
,
itemId
,
drawStatus
,
useUrl
=
''
}
=
itm
if
(
itemId
&&
hasGoodPrize
)
return
orderStatus
[
drawStatus
]
if
(
type
===
PRIZE_TYPE
.
OBJECT
)
return
objectStatus
[
drawStatus
]
if
(
type
===
PRIZE_TYPE
.
ENAME
&&
drawStatus
===
DRAW_STATUS
.
SUCCESS
&&
!
useUrl
)
return
PRIZE_CONFIG
.
receiveBtn
if
(
type
===
PRIZE_TYPE
.
ENAME
)
return
enameStatus
[
drawStatus
]
}
return
(
<>
<
ContainerFit
bg=
{
PRIZE_CONFIG
.
bg
}
>
...
...
@@ -121,11 +144,8 @@ function MyPrizeList() {
{
item
.
drawStatus
===
DRAW_STATUS
.
EXPIRED
&&
<
View
className=
{
styles
[
'my-prize-item__tip'
]
}
>
奖品已过期失效
</
View
>
}
</
View
>
<
View
className=
{
styles
[
'prize-item__status'
]
}
style=
{
PRIZE_CONFIG
.
btnStyle
}
>
{
item
.
type
===
PRIZE_TYPE
.
OBJECT
?
<
Image
onTap=
{
()
=>
handleClick
(
item
)
}
src=
{
objectStatus
[
item
.
drawStatus
]
}
mode=
'widthFix'
/>
:
<
Image
onTap=
{
()
=>
handleClick
(
item
)
}
src=
{
(
item
.
drawStatus
===
3
&&
!
item
.
useUrl
)
?
PRIZE_CONFIG
.
receiveBtn
:
enameStatus
[
item
.
drawStatus
]
}
mode=
'widthFix'
/>
}
<
Image
onTap=
{
()
=>
handleClick
(
item
)
}
src=
{
getItmImg
(
item
)
}
mode=
'widthFix'
/>
</
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