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
2dc09458
Commit
2dc09458
authored
Sep 06, 2021
by
mqf_0707
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wnf
parent
1663c492
Changes
21
Show whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
249 additions
and
431 deletions
+249
-431
package-lock.json
c_client/package-lock.json
+0
-83
api.js
c_client/src/api.js
+14
-22
ContainerFit.md
c_client/src/components/_base/ContainerFit/ContainerFit.md
+18
-0
Modal.jsx
c_client/src/components/_base/Modal/Modal.jsx
+2
-0
SwiperView.jsx
c_client/src/components/_tb_comps/SwiperView/SwiperView.jsx
+44
-17
SwiperView.less
c_client/src/components/_tb_comps/SwiperView/SwiperView.less
+123
-119
DoHelpModal.jsx
...ient/src/components/_tb_modal/DoHelpModal/DoHelpModal.jsx
+9
-9
DoHelpModal.module.less
.../components/_tb_modal/DoHelpModal/DoHelpModal.module.less
+3
-1
browse.config.js
c_client/src/config/browse.config.js
+2
-1
help.config.js
c_client/src/config/help.config.js
+7
-6
useAuth.js
c_client/src/hooks/useAuth.js
+2
-0
index.jsx
c_client/src/pages/index/index.jsx
+4
-54
browseGoods.jsx
c_client/src/pages/packageGood/browseGoods/browseGoods.jsx
+7
-5
cartGoods.jsx
c_client/src/pages/packageGood/cartGoods/cartGoods.jsx
+1
-1
collectGoods.jsx
c_client/src/pages/packageGood/collectGoods/collectGoods.jsx
+1
-1
orderGoods.jsx
c_client/src/pages/packageGood/orderGoods/orderGoods.jsx
+1
-1
myPrize.jsx
c_client/src/pages/packagePrize/myPrize/myPrize.jsx
+6
-7
preComp.jsx
c_client/src/pages/preComp/preComp.jsx
+4
-4
audio.js
c_client/src/utils/audio.js
+0
-2
date.js
c_client/src/utils/date.js
+0
-1
util.js
c_client/src/utils/util.js
+1
-97
No files found.
c_client/package-lock.json
View file @
2dc09458
...
...
@@ -20735,89 +20735,6 @@
"prop-types"
:
"^15.7.2"
}
},
"tbcc-sdk-ts"
:
{
"version"
:
"1.0.6"
,
"resolved"
:
"https://registry.npmjs.org/tbcc-sdk-ts/-/tbcc-sdk-ts-1.0.6.tgz"
,
"integrity"
:
"sha512-CR4XHPHIof6krOBS2BKWpfQUUWIIuPVqMQ1cisllz4rkOSYYzwllbCY/MoPpRiPvMFRu4UdnxAIEGp7TJeDN2Q=="
,
"requires"
:
{
"@types/lodash"
:
"^4.14.160"
,
"@types/node"
:
"^14.6.0"
,
"@typescript-eslint/eslint-plugin"
:
"^3.9.1"
,
"@typescript-eslint/parser"
:
"^3.9.1"
,
"eslint"
:
"^7.7.0"
,
"eslint-config-prettier"
:
"^6.11.0"
,
"eslint-plugin-prettier"
:
"^3.1.4"
,
"prettier"
:
"^2.0.5"
},
"dependencies"
:
{
"@typescript-eslint/experimental-utils"
:
{
"version"
:
"3.10.1"
,
"resolved"
:
"https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-3.10.1.tgz"
,
"integrity"
:
"sha512-DewqIgscDzmAfd5nOGe4zm6Bl7PKtMG2Ad0KG8CUZAHlXfAKTF9Ol5PXhiMh39yRL2ChRH1cuuUGOcVyyrhQIw=="
,
"optional"
:
true
,
"requires"
:
{
"@types/json-schema"
:
"^7.0.3"
,
"@typescript-eslint/types"
:
"3.10.1"
,
"@typescript-eslint/typescript-estree"
:
"3.10.1"
,
"eslint-scope"
:
"^5.0.0"
,
"eslint-utils"
:
"^2.0.0"
}
},
"@typescript-eslint/parser"
:
{
"version"
:
"3.10.1"
,
"resolved"
:
"https://registry.npmjs.org/@typescript-eslint/parser/-/parser-3.10.1.tgz"
,
"integrity"
:
"sha512-Ug1RcWcrJP02hmtaXVS3axPPTTPnZjupqhgj+NnZ6BCkwSImWk/283347+x9wN+lqOdK9Eo3vsyiyDHgsmiEJw=="
,
"optional"
:
true
,
"requires"
:
{
"@types/eslint-visitor-keys"
:
"^1.0.0"
,
"@typescript-eslint/experimental-utils"
:
"3.10.1"
,
"@typescript-eslint/types"
:
"3.10.1"
,
"@typescript-eslint/typescript-estree"
:
"3.10.1"
,
"eslint-visitor-keys"
:
"^1.1.0"
}
},
"@typescript-eslint/typescript-estree"
:
{
"version"
:
"3.10.1"
,
"resolved"
:
"https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-3.10.1.tgz"
,
"integrity"
:
"sha512-QbcXOuq6WYvnB3XPsZpIwztBoquEYLXh2MtwVU+kO8jgYCiv4G5xrSP/1wg4tkvrEE+esZVquIPX/dxPlePk1w=="
,
"optional"
:
true
,
"requires"
:
{
"@typescript-eslint/types"
:
"3.10.1"
,
"@typescript-eslint/visitor-keys"
:
"3.10.1"
,
"debug"
:
"^4.1.1"
,
"glob"
:
"^7.1.6"
,
"is-glob"
:
"^4.0.1"
,
"lodash"
:
"^4.17.15"
,
"semver"
:
"^7.3.2"
,
"tsutils"
:
"^3.17.1"
}
},
"lru-cache"
:
{
"version"
:
"6.0.0"
,
"resolved"
:
"https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz"
,
"integrity"
:
"sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA=="
,
"optional"
:
true
,
"requires"
:
{
"yallist"
:
"^4.0.0"
}
},
"prettier"
:
{
"version"
:
"2.3.2"
,
"resolved"
:
"https://registry.npmjs.org/prettier/-/prettier-2.3.2.tgz"
,
"integrity"
:
"sha512-lnJzDfJ66zkMy58OL5/NY5zp70S7Nz6KqcKkXYzn2tMVrNxvbqaBpg7H3qHaLxCJ5lNMsGuM8+ohS7cZrthdLQ=="
,
"optional"
:
true
},
"semver"
:
{
"version"
:
"7.3.5"
,
"resolved"
:
"https://registry.npmjs.org/semver/-/semver-7.3.5.tgz"
,
"integrity"
:
"sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ=="
,
"optional"
:
true
,
"requires"
:
{
"lru-cache"
:
"^6.0.0"
}
}
}
},
"term-size"
:
{
"version"
:
"1.2.0"
,
"resolved"
:
"https://registry.npmjs.org/term-size/-/term-size-1.2.0.tgz"
,
...
...
c_client/src/api.js
View file @
2dc09458
...
...
@@ -20,40 +20,32 @@ const request = tbccRequest({
// api handle 列表
const
apiList
=
{
...
capi
,
getActivityBaseInfoById
:
{
handle
:
'getActivityBaseInfoById'
,
method
:
'GET'
,
isShowLoading
:
false
},
login
:
'login'
,
getTaskList
:
'getTaskList'
,
completeTask
:
'completeTask'
,
receiveTask
:
'receiveTask'
,
addStat
:
'addStat'
,
doHelp
:
'doHelp'
,
drawLotteryPrize
:
'drawLotteryPrize'
,
resetTest
:
'resetTest'
,
getShareInfo
:
'getShareInfo'
,
getVipInfo
:
'getVipInfo'
,
getCollectGoodsList
:
'getCollectGoodsList'
,
getItemListByItemIds
:
'getItemListByItemIds'
,
updateEnamePrizeReceived
:
'updateEnamePrizeReceived'
,
// 会员权益领取
getMyPrizeList
:
'getMyAwardsList'
,
receiveObjectPrize
:
{
handle
:
'rec
ie
veObjectPrize'
,
handle
:
'rec
ei
veObjectPrize'
,
method
:
'GET'
,
isShowLoading
:
false
,
toastError
:
false
},
receiveEnamePrize
:
{
handle
:
'rec
ie
veEnamePrize'
,
handle
:
'rec
ei
veEnamePrize'
,
method
:
'GET'
,
isShowLoading
:
false
,
toastError
:
false
},
getActivityBaseInfoById
:
{
handle
:
'getActivityBaseInfoById'
,
method
:
'GET'
,
isShowLoading
:
false
},
login
:
'login'
,
addStat
:
'addStat'
,
drawLottery
:
'drawLottery'
,
getShareInfo
:
'getShareInfo'
,
getCollectGoods
:
'getCollectGoods'
,
updateEnamePrizeReceived
:
'updateEnamePrizeReceived'
,
// 会员权益领取
getRotatePrizeListInfo
:
'getRotatePrizeListInfo'
,
//获取奖品列表接口,暂未实现
drawRotatePrize
:
'drawRotatePrize'
,
//大转盘抽奖接口,暂未实现
exchangePrize
:
'exchangePrize'
// 兑换奖品
}
// 生成API
...
...
c_client/src/components/_base/ContainerFit/ContainerFit.md
0 → 100644
View file @
2dc09458
### 设计稿适配方案
#### 入参
| 参数 | 描述 |
| --- | --- | --- |
|bg|背景图(1624px),非必填|
|hasFitPsd|内容块是否对标设计稿(750px
*
1624px),非必填|
#### 使用
```
jsx
import
ContainerFit
from
'@/components/_base/ContainerFit/ContainerFit'
<
ContainerFit
hasFitPsd
=
{
true
}
bg
=
{
''
}
>
<
/
ContainerFit
>
```
\ No newline at end of file
c_client/src/components/_base/Modal/Modal.jsx
View file @
2dc09458
import
{
View
}
from
'@tarojs/components'
import
React
,
{
useState
}
from
'react'
import
Overlay
from
'../Overlay/Overlay'
import
styles
from
'./modal.module.less'
import
classnames
from
'classnames'
export
default
function
Modal
(
props
)
{
const
{
closePostion
=
'top-right'
,
onClose
=
()
=>
{
},
top
=
'40%'
,
hideCloseButton
=
false
,
closeOnClickOverlay
=
false
,
closePos
=
{
right
:
0
,
top
:
-
30
}
}
=
props
...
...
c_client/src/components/_tb_comps/SwiperView/SwiperView.jsx
View file @
2dc09458
import
React
,
{
useState
,
useEffect
,
useRef
}
from
"react"
;
import
React
,
{
useState
,
useEffect
,
useRef
,
useMemo
,
useCallback
}
from
"react"
;
import
{
View
,
Image
,
Text
,
Swiper
,
SwiperItem
}
from
"@tarojs/components"
;
import
'./SwiperView.less'
import
Taro
,{
showToast
,
redirectTo
,
navigateTo
}
from
'@tarojs/taro'
// import {useCallbackState} from '@/hooks/useSyncState'
export
const
EASING_WAYS
=
{
'DEFAULT'
:
'default'
,
'LINEAR'
:
'linear'
,
...
...
@@ -17,15 +19,14 @@ const SwiperView = (props) => {
*/
const
{
swiperList
=
[],
isSpecial
=
true
,
easingFunction
=
`
${
EASING_WAYS
.
LINEAR
}
`
,
circular
=
true
,
autoplay
=
tru
e
,
autoplay
=
fals
e
,
vertical
=
false
,
duration
=
1000
,
interval
=
1500
,
disableTouch
=
false
,
swiperGroup
=
{
width
:
300
,
height
:
300
,
overflow
:
''
},
swiperGroup
=
{
width
:
300
,
height
:
300
,
overflow
:
'
visible
'
},
swiperContent
=
{
width
:
250
,
height
:
300
,
backgroundColor
:
'#fff'
,
backgroundImage
:
''
,
borderRadius
:
25
},
imgContent
=
{
width
:
200
,
height
:
200
},
textContent
=
{
width
:
200
,
height
:
60
},
...
...
@@ -34,27 +35,40 @@ const SwiperView = (props) => {
}
=
props
;
const
[
currentIndex
,
setCurrentIndex
]
=
useState
(
0
);
const
indexref
=
useRef
(
0
)
// const index = useMemo(()=>{
// return currentIndex;
// },currentIndex)
/**
* @description onchange事件
* @param {*} e
*/
const
swiperChange
=
e
=>
{
// console.log("e", e);
console
.
log
(
"e"
,
e
);
console
.
log
(
'swiperChange-----currentindex'
,
currentIndex
,
indexref
.
current
,
e
.
detail
.
current
);
setCurrentIndex
(
e
.
detail
.
current
);
};
const
onTransition
=
(
e
)
=>
{
// console.warn(e)
// setCurrentIndex(indexref.current);
}
/**
* @description 入场/出场动画
* @param {*} index 数组索引值
* @returns 返回类名
*/
const
useCustomAni
=
(
i
)
=>
{
const
useCustomAni
=
(
(
i
)
=>
{
return
`
${((
currentIndex
<
i
&&
((
i
!==
swiperList
.
length
-
1
)
||
currentIndex
!==
0
))
||
((
currentIndex
===
swiperList
.
length
-
1
)
&&
i
==
0
))
?
'item_right'
:
(((
currentIndex
>
i
&&
(
i
!==
0
||
currentIndex
!==
swiperList
.
length
-
1
))
||
(
currentIndex
!==
0
&&
i
!==
swiperList
.
length
-
1
))
?
'item_left'
:
'item_middle'
)
}
`
}
}
)
/**
* @description 获取当前卡片详情之类
...
...
@@ -74,19 +88,31 @@ const SwiperView = (props) => {
* @description
*/
const
turnRound
=
(
type
)
=>
{
const
turnRound
=
((
type
)
=>
{
const
motion
=
{
[
motionType
.
LEFT
]:()
=>
{
setCurrentIndex
(
currentIndex
==
0
?
swiperList
.
length
-
1
:
(
currentIndex
-
1
))
if
(
indexref
.
current
===
0
)
{
setCurrentIndex
(
swiperList
.
length
-
1
)
indexref
.
current
=
swiperList
.
length
-
1
return
;
}
setCurrentIndex
(
indexref
.
current
-
1
)
indexref
.
current
=
indexref
.
current
-
1
console
.
log
(
'left----'
,
currentIndex
,
indexref
.
current
);
},
[
motionType
.
RIGHT
]:()
=>
{
setCurrentIndex
(
currentIndex
==
swiperList
.
length
-
1
?
0
:
(
currentIndex
+
1
))
setTimeout
(()
=>
{
setCurrentIndex
((
indexref
.
current
==
(
swiperList
.
length
-
1
))
?
0
:
(
indexref
.
current
+
1
))
indexref
.
current
=
(
indexref
.
current
==
(
swiperList
.
length
-
1
))
?
0
:
(
indexref
.
current
+
1
)
console
.
log
(
'right----'
,
currentIndex
,
indexref
.
current
);
},
0
);
}
}
motion
[
type
]();
}
}
)
useEffect
(()
=>
{
console
.
log
(
'cur----'
,
currentIndex
);
...
...
@@ -100,12 +126,13 @@ const SwiperView = (props) => {
overflow
:
'hidden'
}
}
>
{
/* <View className='left_btn' onTap={()=>turnRound('LEFT')}><<</View> */
}
<
View
className=
'left_btn'
onTap=
{
()
=>
turnRound
(
'LEFT'
)
}
>
<<
</
View
>
<
Swiper
className=
"swiper_group"
current=
{
currentIndex
}
easingFunction=
{
easingFunction
}
onChange=
{
swiperChange
}
onTransition=
{
(
e
)
=>
onTransition
(
e
)
}
circular=
{
circular
}
vertical=
{
vertical
}
autoplay=
{
autoplay
}
...
...
@@ -122,7 +149,7 @@ const SwiperView = (props) => {
swiperList
.
map
((
item
,
i
)
=>
(
<
SwiperItem
>
<
View
className=
{
`scroll_item ${i === currentIndex
&& isSpecial
? "current_item" : ""} ${useCustomAni(i)}`
}
className=
{
`scroll_item ${i === currentIndex ? "current_item" : ""} ${useCustomAni(i)}`
}
style=
{
{
width
:
`${swiperContent.width/100}rem`
,
height
:
`${swiperContent.height/100}rem`
,
...
...
@@ -167,7 +194,7 @@ const SwiperView = (props) => {
))
}
</
Swiper
>
{
/* <View className='right_btn' onTap={()=>turnRound('RIGHT')}>>></View> */
}
<
View
className=
'right_btn'
onTap=
{
()
=>
turnRound
(
'RIGHT'
)
}
>
>>
</
View
>
</
View
>
);
};
...
...
c_client/src/components/_tb_comps/SwiperView/SwiperView.less
View file @
2dc09458
...
...
@@ -22,6 +22,9 @@
.image-property(cover, center center);
border: 1px solid cyan;
box-sizing: border-box;
}
.scroll_item {
// width: 300px;
...
...
@@ -65,6 +68,7 @@
}
}
&.current_item {
.item_img_content {
.img{}
.text_content{
...
...
@@ -94,52 +98,52 @@
}
@keyframes movein {
from {
from {
transform: perspective(1000px) translate3d(0,0,0) rotate3d(0, 1, 0, 25deg) scale(0.85);
transform-style: preserve-3d;
transform-origin: 45% center;
}
50%{
}
50%{
transform: perspective(1000px) translate3d(0,20px,0) rotate3d(0, 1, 0, 25deg) scale(0.85);
transform-style: preserve-3d;
transform-origin: 45% center;
}
to {
}
to {
transform: perspective(1100px) translate3d(0,0,0) rotate3d(0, 1, 0, 0deg) scale(1);
transform-origin: 45% center;
transform-style: preserve-3d;
}
}
}
}
@keyframes moveout{
from {
from {
transform: perspective(1000px) rotate3d(0, 1, 0, 0deg) scale(1);
transform-style: preserve-3d;
transform-origin: 45% center;
}
50%{
}
50%{
transform: perspective(1000px) rotate3d(0, 1, 0, 25deg) scale(1);
transform-style: preserve-3d;
transform-origin: 45% center;
}
to {
}
to {
transform: perspective(1200px) rotate3d(0, 1, 0, 25deg) scale(0.85);
transform-origin: 45% center;
transform-style: preserve-3d;
}
}
}
@keyframes scales {
from{
from{
transform: scale(1,1);
transform-origin: center;
}
50%{
}
50%{
transform: scale(1.1,1.1);
transform-origin: center;
}
to{
}
to{
transform: scale(1,1);
transform-origin: center;
}
}
}
\ No newline at end of file
c_client/src/components/_tb_modal/DoHelpModal/DoHelpModal.jsx
View file @
2dc09458
...
...
@@ -18,7 +18,7 @@ export default function DoHelpModal(props) {
const
onAuthSuccess
=
async
()
=>
{
const
isVip
=
await
checkIsMember
()
const
helpRes
=
await
API
.
doHelp
({
inviteId
,
isVip
})
const
helpRes
=
await
API
.
completeTask
({
key
:
HELP_CONFIG
.
KEY
,
inviteId
,
isVip
})
if
(
helpRes
?.
success
)
{
commonToast
(
'助力成功'
)
}
else
{
...
...
@@ -38,7 +38,7 @@ export default function DoHelpModal(props) {
[
HELP_MODAL_TYPE
.
HELP
]:
async
()
=>
{
// 条件不是需要新会员的情况下,直接助力
if
(
!
newVip
)
{
const
helpRes
=
await
API
.
doHelp
({
inviteId
,
isVip
})
const
helpRes
=
await
API
.
completeTask
({
key
:
HELP_CONFIG
.
KEY
,
inviteId
,
isVip
})
if
(
helpRes
?.
success
)
{
commonToast
(
'助力成功'
)
...
...
@@ -59,7 +59,7 @@ export default function DoHelpModal(props) {
},
[
HELP_MODAL_TYPE
.
FAIL
]:
async
()
=>
onClose
(
type
),
[
HELP_MODAL_TYPE
.
REWARDS
]:
async
()
=>
{
const
{
success
,
data
}
=
await
API
.
receiveTask
({
taskType
:
'invites'
})
const
{
success
,
data
}
=
await
API
.
receiveTask
({
key
:
HELP_CONFIG
.
KEY
})
if
(
success
&&
data
)
{
onClose
(
type
)
}
...
...
@@ -92,8 +92,8 @@ export default function DoHelpModal(props) {
</
View
>
</
Modal
>
{
memberModalVisible
&&
<
member
-
modal
expend=
{
memberModalVisible
}
onClose=
{
()
=>
closeMemberModal
()
}
onAuthFail=
{
onAuthFail
}
onAuthSuccess=
{
onAuthSuccess
}
...
...
c_client/src/components/_tb_modal/DoHelpModal/DoHelpModal.module.less
View file @
2dc09458
...
...
@@ -2,7 +2,9 @@
.wh(570px,398px);
position: relative;
.image-property();
.flex-col-bottom();
display: flex;
justify-content: flex-end;
flex-direction: column;
align-items: center;
}
.pos-row-center() {
...
...
c_client/src/config/browse.config.js
View file @
2dc09458
...
...
@@ -11,7 +11,8 @@ export const BROWSE_CONFIG = {
img
:
'//yun.duiba.com.cn/taobaomini/clientCTest/goods_img@2x.png'
},
color
:
'#181818'
,
countDown
:
''
countDown
:
''
,
isMock
:
false
,
// 是否使用mock数据
}
/*
浏览页倒计时标识
...
...
c_client/src/config/help.config.js
View file @
2dc09458
// 助力弹窗类型
export
const
HELP_MODAL_TYPE
=
{
HELP
:
1
,
// 邀请助力
FAIL
:
2
,
// 助力失败
REWARDS
:
3
,
// 助力信息展示
HELP
:
'HELP'
,
// 邀请助力
FAIL
:
'FAIL'
,
// 助力失败
REWARDS
:
'REWARDS'
,
// 助力信息展示
}
// 助力弹窗是否已弹
export
const
HELP_MODAL_SHOW
=
{
...
...
@@ -11,7 +11,8 @@ export const HELP_MODAL_SHOW = {
}
// 助力配置
export
const
HELP_CONFIG
=
{
1
:
{
KEY
:
'invites'
,
HELP
:
{
width
:
639
,
height
:
730
,
bg
:
'//yun.dui88.com/taobaomini/pike_call/m_help_bg.png'
,
...
...
@@ -19,7 +20,7 @@ export const HELP_CONFIG = {
title
:
'您的好友正在参与XXXX
\
n快来一起参与吧~'
,
marginBottom
:
80
},
2
:
{
FAIL
:
{
width
:
639
,
height
:
701
,
bg
:
'//yun.dui88.com/taobaomini/pike_call/m_help_bg_02.png'
,
...
...
@@ -27,7 +28,7 @@ export const HELP_CONFIG = {
title
:
'您已是会员'
,
marginBottom
:
80
},
3
:
{
REWARDS
:
{
width
:
639
,
height
:
800
,
bg
:
'//yun.dui88.com/taobaomini/pike_call/m_help_bg_03.png'
,
...
...
c_client/src/hooks/useAuth.js
View file @
2dc09458
import
{
getAuthUserInfo
}
from
'tbcc-sdk-ts/lib/core/tbFn'
import
{
useEffect
}
from
'react'
import
{
commonToast
}
from
'tbcc-sdk-ts/lib/core/tb'
// 授权
export
function
useAuth
(
callback
=
noopFn
)
{
const
authUserInfo
=
async
()
=>
{
const
info
=
await
getAuthUserInfo
().
catch
(
err
=>
{
console
.
log
(
'未授权成功'
,
err
)
commonToast
(
'点击右上角,打开授权开关,重进活动即可参与'
)
})
if
(
info
)
{
callback
(
info
)
...
...
c_client/src/pages/index/index.jsx
View file @
2dc09458
...
...
@@ -20,13 +20,7 @@ const { getImgShareUrl, checkIsMember, validateActivityStatus } = tbcc.utils
import
{
useAudio
}
from
'@/hooks/useAudio'
import
{
CLOUD_OBJ
,
BGMUSIC_URL
}
from
'@/const'
import
ScrollXView
from
'@/components/_tb_comps/ScrollXView/ScrollXView'
import
SwiperView
from
'@/components/_tb_comps/SwiperView/SwiperView'
import
RotateWheel
from
'@/components/_tb_comps/RotateWheel/RotateWheel'
import
{
prizeList
}
from
'@/const'
import
{
commonToast
}
from
'tbcc-sdk-ts/lib/core/tb'
const
INDEX_CONFIG
=
{
bg
:
''
,
// 背景 cloud://C4015B7CEC23CF013A78247E2852524F//火箭待机小球抖动.json
...
...
@@ -36,51 +30,6 @@ const INDEX_CONFIG = {
taskButton
:
''
// 任务按钮
}
const
rotateConfig
=
{
bg
:
'https://yun.duiba.com.cn/spark/assets/8b6e920ffd09fab8f9ac2de09f9154879f4d0607.png'
,
ratio
:
0.65
,
radius
:
300
,
circles
:
4
,
divideNum
:
8
,
duration
:
5000
,
timeFunction
:
'ease-in-out'
,
nodeInfo
:{
width
:
100
,
height
:
100
},
imgInfo
:{
width
:
80
,
height
:
80
},
showWay
:
'negative'
,
//positive/negative
isShowPrizeName
:
true
,
prizeNameWidthRatio
:
1.2
}
const
SCROLLXVIEW_CONFIG
=
{
prizeList
:
[],
containerWidth
:
200
,
containerHeight
:
200
,
imgWidth
:
120
,
imgHeight
:
120
,
isShowPrizeName
:
true
,
prizeInCenterNum
:
3
,
marginRight
:
26
,
backgroundColor
:
'#E7E7EF'
,
backgroundImage
:
''
}
const
swiper_config
=
{
easingFunction
:
`linear`
,
circular
:
true
,
autoplay
:
false
,
vertical
:
false
,
duration
:
1000
,
interval
:
1500
,
disableTouch
:
false
,
swiperGroup
:{
width
:
300
,
height
:
300
,
overflow
:
''
},
swiperContent
:{
width
:
250
,
height
:
300
,
backgroundColor
:
'#fff'
,
backgroundImage
:
''
,
borderRadius
:
25
},
imgContent
:{
width
:
200
,
height
:
200
},
textContent
:{
width
:
240
,
height
:
60
}
}
function
Index
()
{
const
app
=
getApp
()
const
{
activityInfo
,
setActivityInfoAndStatus
}
=
useActivityInfoModel
()
...
...
@@ -155,9 +104,10 @@ function Index() {
})
// 助力弹窗 -> 其他弹窗
const
handleVisibleModal
=
async
(
info
)
=>
{
const
{
inviteId
}
=
info
const
isVip
=
await
checkIsMember
()
// 是否为助力弹窗
if
(
app
.
inviteId
&&
!
showHelp
.
current
)
{
if
(
inviteId
&&
!
showHelp
.
current
)
{
setDoHelpModalVisible
(
true
)
setHelpType
(
isVip
?
HELP_MODAL_TYPE
.
FAIL
:
HELP_MODAL_TYPE
.
HELP
)
showHelp
.
current
=
true
...
...
@@ -246,7 +196,7 @@ function Index() {
width=
'500'
height=
'500'
top=
'45%'
newVip
newVip
=
{
false
}
onClose=
{
()
=>
setDoHelpModalVisible
(
false
)
}
/>
}
...
...
c_client/src/pages/packageGood/browseGoods/browseGoods.jsx
View file @
2dc09458
...
...
@@ -23,7 +23,7 @@ function BrowseGoodsPage() {
const
[
accumulateTime
,
setAccumulateTime
]
=
useState
(
+
keepTime
||
15
)
const
browserTimer
=
useRef
(
null
)
const
[
goodsList
,
setGoodsList
]
=
useState
(
GOOD_LIST
)
const
[
goodsList
,
setGoodsList
]
=
useState
(
BROWSE_CONFIG
.
isMock
?
GOOD_LIST
:[]
)
useEffect
(()
=>
{
getGoodsList
()
...
...
@@ -35,12 +35,14 @@ function BrowseGoodsPage() {
return
()
=>
browserTimer
.
current
&&
clearInterval
(
browserTimer
.
current
)
}
},[
goodsList
])
// 获取商品列表
const
getGoodsList
=
async
()
=>
{
const
{
data
}
=
await
API
.
getItemListByItemIds
({
itemIds
})
const
{
success
,
data
}
=
await
API
.
getCollectGoods
({
key
:
BROWSE_CONFIG
.
taskType
,
itemIds
})
if
(
success
&&
!
BROWSE_CONFIG
.
isMock
)
{
setGoodsList
(
data
?.
list
||
[])
}
}
// 页面显示
useDidShow
(()
=>
{
// 重新回到页面开启倒计时
if
(
browseType
===
BROSE_GOOD_TYPE
.
PAGE
&&
startTimer
&&
usePercent
.
current
<
+
browseTime
)
{
...
...
c_client/src/pages/packageGood/cartGoods/cartGoods.jsx
View file @
2dc09458
...
...
@@ -24,7 +24,7 @@ function CartGoodsPage() {
},
[])
const
getGoodsList
=
async
()
=>
{
const
{
data
}
=
await
API
.
getCollectGoods
List
({
itemIds
})
const
{
data
}
=
await
API
.
getCollectGoods
({
key
:
CART_CONFIG
.
taskType
,
itemIds
})
setGoodsList
(
data
?.
list
||
[])
}
// 加入购物车 // 对应itemId为 574141925233 skuId为4018047819826 数量为4
...
...
c_client/src/pages/packageGood/collectGoods/collectGoods.jsx
View file @
2dc09458
...
...
@@ -23,7 +23,7 @@ function CollectGoodsPage() {
},
[])
const
getGoodsList
=
async
()
=>
{
const
{
data
}
=
await
API
.
getCollectGoods
List
({
itemIds
})
const
{
data
}
=
await
API
.
getCollectGoods
({
key
:
COLLECT_CONFIG
.
taskType
,
itemIds
})
setGoodsList
(
data
?.
list
||
[])
}
...
...
c_client/src/pages/packageGood/orderGoods/orderGoods.jsx
View file @
2dc09458
...
...
@@ -12,7 +12,7 @@ import ORDER_CONFIG from '@/config/order.config'
function
OrderGoodsPage
()
{
const
router
=
useRouter
()
const
{
itemIds
}
=
router
?.
params
const
{
data
}
=
useRequest
(
API
.
get
ItemListByItemIds
,
{
itemIds
})
const
{
data
}
=
useRequest
(
API
.
get
CollectGoods
,
{
key
:
ORDER_CONFIG
.
taskType
,
itemIds
})
return
(
<
ContainerFit
bg=
{
ORDER_CONFIG
.
bg
}
>
...
...
c_client/src/pages/packagePrize/myPrize/myPrize.jsx
View file @
2dc09458
...
...
@@ -10,7 +10,7 @@ import { checkIsMember } from 'tbcc-sdk-ts/lib/utils'
import
{
dateFormatter
}
from
'@/utils/date'
import
styles
from
'./myPrize.module.less'
import
{
useDidHide
,
getApp
}
from
'@tarojs/taro'
import
{
receiveEnamePrize
,
receiveObjectPrize
,
receiveMemberEname
}
from
'
@/utils/util
'
import
{
receiveEnamePrize
,
receiveObjectPrize
,
receiveMemberEname
}
from
'
tbcc-sdk-ts/lib/request/capiFn
'
import
config
from
'@/config/config'
import
{
PRIZE_CONFIG
,
DRAW_STATUS
,
PRIZE_TYPE
,
BENEFIT_TYPE
}
from
'@/config/myPrize.config'
...
...
@@ -19,7 +19,6 @@ const objectStatus = { ..._objectStatus, ...commonStatus }
const
enameStatus
=
{
...
_enameStatus
,
...
commonStatus
}
const
{
commonToast
,
navigateToOutside
,
setClipboard
}
=
tbccTs
.
tb
const
{
getMyPrizeList
}
=
API
import
{
useAudio
}
from
'@/hooks/useAudio'
function
Empty
(
blankTxt
)
{
...
...
@@ -41,7 +40,7 @@ function MyPrizeList() {
},
[])
async
function
fetchMyPriceList
()
{
const
res
=
await
getMyPrize
List
()
const
res
=
await
API
.
getMyAwards
List
()
if
(
res
.
success
&&
res
?.
data
?.
list
?.
length
)
{
setMyPrizeList
(
res
?.
data
?.
list
)
}
...
...
@@ -86,16 +85,16 @@ function MyPrizeList() {
'update'
:
async
()
=>
fetchMyPriceList
(),
[
PRIZE_TYPE
.
ENAME
]:
async
()
=>
{
if
(
benefitType
===
BENEFIT_TYPE
.
MEMBER
)
{
await
receiveMemberEname
({
params
:
{
sellerId
:
config
.
sellerId
,
ename
,
id
},
successMsg
})
await
receiveMemberEname
(
API
.
updateEnamePrizeReceived
,
{
params
:
{
sellerId
:
config
.
sellerId
,
ename
,
id
},
successMsg
})
}
else
{
await
receiveEnamePrize
({
params
:
{
activityId
,
id
},
successMsg
})
await
receiveEnamePrize
(
API
.
receiveEnamePrize
,
{
params
:
{
activityId
,
id
},
successMsg
})
}
},
[
PRIZE_TYPE
.
OBJECT
]:
async
()
=>
{
await
receiveObjectPrize
({
params
:
{
activityId
,
id
},
successMsg
})
await
receiveObjectPrize
(
API
.
receiveObjectPrize
,
{
params
:
{
activityId
,
id
},
successMsg
})
},
[
PRIZE_TYPE
.
CREDITS
]:
async
()
=>
{
await
receiveEnamePrize
({
params
:
{
activityId
,
id
},
successMsg
})
await
receiveEnamePrize
(
API
.
receiveEnamePrize
,
{
params
:
{
activityId
,
id
},
successMsg
})
}
}
await
receiveFn
[
type
]()
...
...
c_client/src/pages/preComp/preComp.jsx
View file @
2dc09458
...
...
@@ -75,14 +75,14 @@ export default function PreComp(props) {
<
View
className=
{
styles
[
'scroll-view'
]
}
>
<
ScrollXView
prizeList=
{
prizeList
}
/>
</
View
>
<
View
className=
{
styles
[
'comp-view'
]
}
>
{
/* 大转盘 */
}
<
RotateWheel
/>
</
View
>
<
View
className=
{
styles
[
'comp-view'
]
}
>
{
/* swiper左右滑动 */
}
<
SwiperView
swiperList=
{
prizeList
}
/>
</
View
>
<
View
className=
{
styles
[
'comp-view'
]
}
>
{
/* 大转盘 */
}
<
RotateWheel
/>
</
View
>
</
ContainerFit
>
)
}
\ No newline at end of file
c_client/src/utils/audio.js
View file @
2dc09458
...
...
@@ -48,14 +48,12 @@ export const getSystemInfo = () => {
let
bgs
=
{
}
export
const
playBgMusic1
=
async
(
isOn
,
src
,
callbackFn
=
()
=>
{},
loop
=
false
)
=>
{
//待测试
for
(
let
k
in
bgs
)
{
if
(
bgs
[
k
].
isOn
)
{
bgs
[
k
].
stop
();
}
// bgs[k].isOn = false; /// TODO 自己记一个开关,因为淘宝的玩意stop之后虽然听不到,但还是在播放,会触发loop播放和onEnded事件
}
const
key
=
src
;
console
.
log
(
'---------->>>>>>>>>>>>>ison'
,
isOn
);
if
(
isOn
)
{
...
...
c_client/src/utils/date.js
View file @
2dc09458
...
...
@@ -6,7 +6,6 @@
*/
export
const
dateFormatter
=
(
date
,
format
=
'yyyy/MM/dd'
)
=>
{
if
(
!
date
)
return
'-'
date
=
new
Date
(
// eslint-disable-next-line no-restricted-globals
typeof
date
===
'string'
&&
isNaN
(
date
)
?
date
.
replace
(
/-/g
,
'/'
)
:
date
...
...
c_client/src/utils/util.js
View file @
2dc09458
...
...
@@ -137,99 +137,3 @@ export const addStat = async(activityId, type)=> {
resolve
(
false
)
})
}
\ No newline at end of file
export
const
createCanvas
=
async
(
canvasId
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
my
.
createCanvas
({
id
:
canvasId
,
success
:
(
ccc
)
=>
{
resolve
(
ccc
)
}
})
})
}
// 查询商家权益活动
export
const
getActivity
=
(
sellerId
)
=>
{
const
memberBenefitPlugin
=
requirePlugin
(
"memberBenefit"
)
if
(
!
memberBenefitPlugin
)
return
[]
return
new
Promise
(
async
(
resolve
,
reject
)
=>
{
memberBenefitPlugin
.
getActivity
({
data
:
{
sellerId
,
},
success
:
(
result
)
=>
{
resolve
(
result
)
},
fail
:
(
error
)
=>
{
console
.
log
(
'获取失败'
+
JSON
.
stringify
(
error
))
resolve
(
error
)
}
});
})
}
/**
* 获取系统信息
* @returns {object} 小程序系统信息
*/
export
const
getSystemInfo
=
()
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
my
.
getSystemInfo
({
success
:
res
=>
{
resolve
(
res
);
},
fail
:
err
=>
{
reject
(
err
);
}
});
});
};
// 查询商家会员等级
export
const
getGrade
=
(
sellerId
)
=>
{
const
memberBenefitPlugin
=
requirePlugin
(
"memberBenefit"
)
if
(
!
memberBenefitPlugin
)
return
[]
return
new
Promise
(
async
(
resolve
,
reject
)
=>
{
memberBenefitPlugin
.
getGrade
({
data
:
{
sellerId
},
success
:
(
result
)
=>
{
resolve
(
result
)
},
fail
:
(
error
)
=>
{
console
.
log
(
'查询商家会员等级失败'
+
JSON
.
stringify
(
error
))
resolve
(
error
)
}
});
})
}
// 查询商家会员等级
export
const
checkShopFavoredStatus
=
(
sellerId
)
=>
{
return
new
Promise
(
async
(
resolve
,
reject
)
=>
{
my
.
tb
.
checkShopFavoredStatus
({
id
:
sellerId
,
success
:
(
res
)
=>
{
console
.
warn
(
res
)
my
.
alert
({
content
:
JSON
.
stringify
(
res
)
})
resolve
(
res
.
isFavor
)
},
fail
:
(
res
)
=>
{
my
.
alert
({
content
:
JSON
.
stringify
(
res
)
})
}
})
})
}
// 查询商家会员等级
export
const
favorShop
=
(
sellerId
)
=>
{
return
new
Promise
(
async
(
resolve
,
reject
)
=>
{
my
.
tb
.
favorShop
({
id
:
+
sellerId
,
success
:
(
res
)
=>
{
console
.
warn
(
res
)
my
.
alert
({
content
:
JSON
.
stringify
(
res
)
})
resolve
(
res
)
},
fail
:
(
res
)
=>
{
my
.
alert
({
content
:
JSON
.
stringify
(
res
)
})
}
})
})
}
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