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
bc01f0ad
Commit
bc01f0ad
authored
Sep 03, 2021
by
mqf_0707
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
助力模块配置提取
parent
a8c10d18
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
102 additions
and
112 deletions
+102
-112
default.js
c_client/config/default.js
+1
-1
DoHelpModal.jsx
...ient/src/components/_tb_modal/DoHelpModal/DoHelpModal.jsx
+7
-33
help.config.js
c_client/src/config/help.config.js
+38
-0
const.js
c_client/src/const.js
+0
-11
useLogin.js
c_client/src/hooks/useLogin.js
+1
-1
index.jsx
c_client/src/pages/index/index.jsx
+4
-62
preComp.jsx
c_client/src/pages/preComp/preComp.jsx
+50
-2
loginInfo.js
c_client/src/store/loginInfo.js
+1
-2
No files found.
c_client/config/default.js
View file @
bc01f0ad
export
default
{
export
default
{
hasCanvas
:
tru
e
,
// 是否开启游戏模块自动注入dist
hasCanvas
:
fals
e
,
// 是否开启游戏模块自动注入dist
defaultPlugins
:
[
defaultPlugins
:
[
[
[
'@pluve/taro-plugin-mars'
,
// taro暂时未支持阿里小程序自定义插件 需要引用插件的页面需配置
'@pluve/taro-plugin-mars'
,
// taro暂时未支持阿里小程序自定义插件 需要引用插件的页面需配置
...
...
c_client/src/components/_tb_modal/DoHelpModal/DoHelpModal.jsx
View file @
bc01f0ad
...
@@ -7,34 +7,8 @@ import API from '@/api'
...
@@ -7,34 +7,8 @@ import API from '@/api'
import
{
useLoginInfoModel
,
useActivityInfoModel
}
from
'@/store'
import
{
useLoginInfoModel
,
useActivityInfoModel
}
from
'@/store'
import
{
checkIsMember
}
from
'tbcc-sdk-ts/lib/utils'
import
{
checkIsMember
}
from
'tbcc-sdk-ts/lib/utils'
import
{
commonToast
}
from
'tbcc-sdk-ts/lib/core/tb'
import
{
commonToast
}
from
'tbcc-sdk-ts/lib/core/tb'
import
{
HELP_MODAL_TYPE
}
from
'@/const
'
import
{
HELP_MODAL_TYPE
,
HELP_CONFIG
}
from
'@/config/help.config
'
const
helpConfig
=
{
1
:
{
width
:
639
,
height
:
730
,
bg
:
'//yun.dui88.com/taobaomini/pike_call/m_help_bg.png'
,
btnTxt
:
'//yun.dui88.com/taobaomini/pike_call/m_help_btn_01.png'
,
title
:
'您的好友正在参与XXXX
\
n快来一起参与吧~'
,
marginBottom
:
80
},
2
:
{
width
:
639
,
height
:
701
,
bg
:
'//yun.dui88.com/taobaomini/pike_call/m_help_bg_02.png'
,
btnTxt
:
'//yun.dui88.com/taobaomini/pike_call/m_help_btn_02.png'
,
title
:
'您已是会员'
,
marginBottom
:
80
},
3
:
{
width
:
639
,
height
:
800
,
bg
:
'//yun.dui88.com/taobaomini/pike_call/m_help_bg_03.png'
,
btnTxt
:
'//yun.dui88.com/taobaomini/pike_call/m_help_btn_02.png'
,
title
:
''
,
marginBottom
:
120
}
}
export
default
function
RuleModal
(
props
)
{
export
default
function
RuleModal
(
props
)
{
const
{
activityInfo
}
=
useActivityInfoModel
()
const
{
activityInfo
}
=
useActivityInfoModel
()
const
{
type
=
HELP_MODAL_TYPE
.
HELP
,
onClose
=
()
=>
{},
newVip
=
true
,
helpInfo
=
{}
}
=
props
const
{
type
=
HELP_MODAL_TYPE
.
HELP
,
onClose
=
()
=>
{},
newVip
=
true
,
helpInfo
=
{}
}
=
props
...
@@ -104,16 +78,16 @@ export default function RuleModal(props) {
...
@@ -104,16 +78,16 @@ export default function RuleModal(props) {
<
View
>
<
View
>
<
Modal
hideCloseButton=
{
false
}
onClose=
{
onCloseModal
}
top=
{
'50%'
}
closePos=
{
{
right
:
0
,
top
:
0
}
}
>
<
Modal
hideCloseButton=
{
false
}
onClose=
{
onCloseModal
}
top=
{
'50%'
}
closePos=
{
{
right
:
0
,
top
:
0
}
}
>
<
View
className=
{
styles
.
container
}
style=
{
<
View
className=
{
styles
.
container
}
style=
{
{
width
:
helpConfig
[
type
].
width
/
100
+
'rem'
,
{
width
:
HELP_CONFIG
[
type
].
width
/
100
+
'rem'
,
height
:
helpConfig
[
type
].
height
/
100
+
'rem'
,
height
:
HELP_CONFIG
[
type
].
height
/
100
+
'rem'
,
backgroundImage
:
`url(${
helpConfig
[type].bg})`
backgroundImage
:
`url(${
HELP_CONFIG
[type].bg})`
}
}
>
}
}
>
<
Text
className=
{
styles
[
'help-title'
]
}
>
{
<
Text
className=
{
styles
[
'help-title'
]
}
>
{
type
!==
HELP_MODAL_TYPE
.
REWARDS
?
helpConfig
[
type
].
title
:
type
!==
HELP_MODAL_TYPE
.
REWARDS
?
HELP_CONFIG
[
type
].
title
:
`恭喜你成功邀请${helpInfo.inviteCount}名好友\n获得XXX奖励`
}
`恭喜你成功邀请${helpInfo.inviteCount}名好友\n获得XXX奖励`
}
</
Text
>
</
Text
>
<
Image
src=
{
helpConfig
[
type
].
btnTxt
}
<
Image
src=
{
HELP_CONFIG
[
type
].
btnTxt
}
style=
{
{
marginBottom
:
helpConfig
[
type
].
marginBottom
/
100
+
'rem'
}
}
style=
{
{
marginBottom
:
HELP_CONFIG
[
type
].
marginBottom
/
100
+
'rem'
}
}
className=
{
styles
[
'help-btn'
]
}
onClick=
{
()
=>
onHandleHelp
()
}
/>
className=
{
styles
[
'help-btn'
]
}
onClick=
{
()
=>
onHandleHelp
()
}
/>
</
View
>
</
View
>
</
Modal
>
</
Modal
>
...
...
c_client/src/config/help.config.js
0 → 100644
View file @
bc01f0ad
// 助力弹窗类型
export
const
HELP_MODAL_TYPE
=
{
HELP
:
1
,
// 邀请助力
FAIL
:
2
,
// 助力失败
REWARDS
:
3
,
// 助力信息展示
}
// 助力弹窗是否已弹
export
const
HELP_MODAL_SHOW
=
{
SHOW
:
1
,
// 已弹
NOT_SHOW
:
2
,
// 未弹
}
// 助力配置
export
const
HELP_CONFIG
=
{
1
:
{
width
:
639
,
height
:
730
,
bg
:
'//yun.dui88.com/taobaomini/pike_call/m_help_bg.png'
,
btnTxt
:
'//yun.dui88.com/taobaomini/pike_call/m_help_btn_01.png'
,
title
:
'您的好友正在参与XXXX
\
n快来一起参与吧~'
,
marginBottom
:
80
},
2
:
{
width
:
639
,
height
:
701
,
bg
:
'//yun.dui88.com/taobaomini/pike_call/m_help_bg_02.png'
,
btnTxt
:
'//yun.dui88.com/taobaomini/pike_call/m_help_btn_02.png'
,
title
:
'您已是会员'
,
marginBottom
:
80
},
3
:
{
width
:
639
,
height
:
800
,
bg
:
'//yun.dui88.com/taobaomini/pike_call/m_help_bg_03.png'
,
btnTxt
:
'//yun.dui88.com/taobaomini/pike_call/m_help_btn_02.png'
,
title
:
''
,
marginBottom
:
120
}
}
\ No newline at end of file
c_client/src/const.js
View file @
bc01f0ad
...
@@ -14,17 +14,6 @@ export const ACTIVITY_STATUS = {
...
@@ -14,17 +14,6 @@ export const ACTIVITY_STATUS = {
// 店铺ID
// 店铺ID
export
const
SHOP_ID
=
'60014226'
export
const
SHOP_ID
=
'60014226'
// 助力弹窗类型
export
const
HELP_MODAL_TYPE
=
{
HELP
:
1
,
// 邀请助力
FAIL
:
2
,
// 助力失败
REWARDS
:
3
,
// 助力信息展示
}
// 助力弹窗是否已弹
export
const
HELP_MODAL_SHOW
=
{
SHOW
:
1
,
// 已弹
NOT_SHOW
:
2
,
// 未弹
}
/* 背景音乐 应用:牧场消消乐有效,其他应用需要重新上传文件 */
/* 背景音乐 应用:牧场消消乐有效,其他应用需要重新上传文件 */
export
const
BGMUSIC_URL
=
{
export
const
BGMUSIC_URL
=
{
MUSIC
:
'cloud://FBE3C154661ACEEBA164E8B70B4D71E2/yoga bgm.mp3'
MUSIC
:
'cloud://FBE3C154661ACEEBA164E8B70B4D71E2/yoga bgm.mp3'
...
...
c_client/src/hooks/useLogin.js
View file @
bc01f0ad
import
{
useEffect
,
useState
}
from
'react'
import
{
useEffect
,
useState
,
useReducer
}
from
'react'
import
{
useRouter
}
from
'@tarojs/taro'
import
{
useRouter
}
from
'@tarojs/taro'
import
{
useLoginInfoModel
}
from
'../store/loginInfo'
import
{
useLoginInfoModel
}
from
'../store/loginInfo'
import
API
from
'../api'
import
API
from
'../api'
...
...
c_client/src/pages/index/index.jsx
View file @
bc01f0ad
...
@@ -2,7 +2,8 @@ import React, { useRef, useState } from 'react'
...
@@ -2,7 +2,8 @@ import React, { useRef, useState } from 'react'
import
{
View
,
Image
}
from
'@tarojs/components'
import
{
View
,
Image
}
from
'@tarojs/components'
import
Taro
,
{
useShareAppMessage
,
useDidShow
,
getApp
}
from
'@tarojs/taro'
import
Taro
,
{
useShareAppMessage
,
useDidShow
,
getApp
}
from
'@tarojs/taro'
import
classnames
from
'classnames'
import
classnames
from
'classnames'
import
{
SHARE_CONFIG
,
HELP_MODAL_TYPE
,
HELP_MODAL_SHOW
}
from
'@/const.js'
import
{
SHARE_CONFIG
}
from
'@/const.js'
import
{
HELP_MODAL_TYPE
}
from
'@/config/help.config'
import
{
useLogin
,
useLoginFromShare
}
from
'@/hooks/useLogin'
import
{
useLogin
,
useLoginFromShare
}
from
'@/hooks/useLogin'
import
{
useActivityInfoModel
,
useLoginInfoModel
}
from
'@/store'
import
{
useActivityInfoModel
,
useLoginInfoModel
}
from
'@/store'
import
API
from
'@/api'
import
API
from
'@/api'
...
@@ -19,12 +20,6 @@ const { getImgShareUrl, checkIsMember, validateActivityStatus } = tbcc.utils
...
@@ -19,12 +20,6 @@ const { getImgShareUrl, checkIsMember, validateActivityStatus } = tbcc.utils
import
{
useAudio
}
from
'@/hooks/useAudio'
import
{
useAudio
}
from
'@/hooks/useAudio'
import
{
CLOUD_OBJ
,
BGMUSIC_URL
}
from
'@/const'
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'
const
INDEX_CONFIG
=
{
const
INDEX_CONFIG
=
{
bg
:
''
,
// 背景 cloud://C4015B7CEC23CF013A78247E2852524F//火箭待机小球抖动.json
bg
:
''
,
// 背景 cloud://C4015B7CEC23CF013A78247E2852524F//火箭待机小球抖动.json
ruleButton
:
''
,
// 规则按钮
ruleButton
:
''
,
// 规则按钮
...
@@ -33,51 +28,6 @@ const INDEX_CONFIG = {
...
@@ -33,51 +28,6 @@ const INDEX_CONFIG = {
taskButton
:
''
// 任务按钮
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
:
true
,
vertical
:
false
,
duration
:
1000
,
interval
:
1500
,
disableTouch
:
false
,
swiperGroup
:{
width
:
300
,
height
:
400
},
swiperContent
:{
width
:
300
,
height
:
400
},
imgContent
:{
width
:
200
,
height
:
200
},
textContent
:{
width
:
300
,
height
:
60
}
}
function
Index
()
{
function
Index
()
{
const
app
=
getApp
()
const
app
=
getApp
()
const
{
activityInfo
,
setActivityInfoAndStatus
}
=
useActivityInfoModel
()
const
{
activityInfo
,
setActivityInfoAndStatus
}
=
useActivityInfoModel
()
...
@@ -127,6 +77,8 @@ function Index() {
...
@@ -127,6 +77,8 @@ function Index() {
},[])
},[])
// 授权登录完成
// 授权登录完成
useLogin
(
async
(
info
)
=>
{
useLogin
(
async
(
info
)
=>
{
console
.
warn
(
info
)
console
.
warn
(
loginInfo
)
handleVisibleModal
(
info
)
handleVisibleModal
(
info
)
// setUpdateFlag(1)
// setUpdateFlag(1)
})
})
...
@@ -207,16 +159,6 @@ function Index() {
...
@@ -207,16 +159,6 @@ function Index() {
<
View
className=
{
styles
.
bemember
}
onTap=
{
()
=>
setMemberVisible
(
true
)
}
>
入会
</
View
>
<
View
className=
{
styles
.
bemember
}
onTap=
{
()
=>
setMemberVisible
(
true
)
}
>
入会
</
View
>
{
/* 奖品查看左右滑动 */
}
{
/* <ScrollXView {...SCROLLXVIEW_CONFIG} prizeList={prizeList} /> */
}
{
/* swiper左右滑动 */
}
{
/* <SwiperView {...swiper_config} swiperList={prizeList} /> */
}
{
/* 大转盘 */
}
<
RotateWheel
{
...
rotateConfig
}
callback=
{
()
=>
{}
}
/>
<
View
className=
'view'
onTap=
{
playCurrentAudio
}
>
play audio
</
View
>
<
View
className=
'view'
onTap=
{
playCurrentAudio
}
>
play audio
</
View
>
{
{
...
...
c_client/src/pages/preComp/preComp.jsx
View file @
bc01f0ad
...
@@ -9,6 +9,7 @@ import { prizeList } from '@/mock'
...
@@ -9,6 +9,7 @@ import { prizeList } from '@/mock'
import
styles
from
'./preComp.module.less'
import
styles
from
'./preComp.module.less'
import
{
useAudio
}
from
'@/hooks/useAudio'
import
{
useAudio
}
from
'@/hooks/useAudio'
import
{
CLOUD_OBJ
,
BGMUSIC_URL
}
from
'@/const'
import
{
CLOUD_OBJ
,
BGMUSIC_URL
}
from
'@/const'
import
ContainerFit
from
'@/components/_base/ContainerFit/ContainerFit'
import
ContainerFit
from
'@/components/_base/ContainerFit/ContainerFit'
...
@@ -23,6 +24,51 @@ import RankTitle from '@/components/_tb_comps/Rank/RankTitle/RankTitle'
...
@@ -23,6 +24,51 @@ import RankTitle from '@/components/_tb_comps/Rank/RankTitle/RankTitle'
import
RankList
from
'@/components/_tb_comps/Rank/RankList/RankList'
import
RankList
from
'@/components/_tb_comps/Rank/RankList/RankList'
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
:
true
,
vertical
:
false
,
duration
:
1000
,
interval
:
1500
,
disableTouch
:
false
,
swiperGroup
:{
width
:
300
,
height
:
400
},
swiperContent
:{
width
:
300
,
height
:
400
},
imgContent
:{
width
:
200
,
height
:
200
},
textContent
:{
width
:
300
,
height
:
60
}
}
export
default
function
PreComp
(
props
)
{
export
default
function
PreComp
(
props
)
{
return
(
return
(
<
ContainerFit
hasFitPsd=
{
true
}
>
<
ContainerFit
hasFitPsd=
{
true
}
>
...
@@ -30,11 +76,13 @@ export default function PreComp(props) {
...
@@ -30,11 +76,13 @@ export default function PreComp(props) {
<
ScrollXView
prizeList=
{
prizeList
}
/>
<
ScrollXView
prizeList=
{
prizeList
}
/>
</
View
>
</
View
>
<
View
className=
{
styles
[
'comp-view'
]
}
>
<
View
className=
{
styles
[
'comp-view'
]
}
>
{
/* 大转盘 */
}
<
RotateWheel
/>
<
RotateWheel
/>
</
View
>
</
View
>
{
/* <View className={styles['comp-view']}>
<
View
className=
{
styles
[
'comp-view'
]
}
>
{
/* swiper左右滑动 */
}
<
SwiperView
swiperList=
{
prizeList
}
/>
<
SwiperView
swiperList=
{
prizeList
}
/>
</View>
*/
}
</
View
>
</
ContainerFit
>
</
ContainerFit
>
)
)
}
}
\ No newline at end of file
c_client/src/store/loginInfo.js
View file @
bc01f0ad
import
{
useState
}
from
'react'
import
{
useState
,
useReducer
}
from
'react'
import
{
createModel
}
from
'hox'
import
{
createModel
}
from
'hox'
function
useLoginInfo
()
{
function
useLoginInfo
()
{
...
@@ -10,7 +10,6 @@ function useLoginInfo() {
...
@@ -10,7 +10,6 @@ function useLoginInfo() {
avatar
:
''
,
avatar
:
''
,
inviteId
:
''
inviteId
:
''
})
})
return
{
return
{
loginInfo
,
loginInfo
,
setLoginInfo
setLoginInfo
...
...
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