Commit bc01f0ad authored by mqf_0707's avatar mqf_0707

助力模块配置提取

parent a8c10d18
export default {
hasCanvas: true, // 是否开启游戏模块自动注入dist
hasCanvas: false, // 是否开启游戏模块自动注入dist
defaultPlugins: [
[
'@pluve/taro-plugin-mars', // taro暂时未支持阿里小程序自定义插件 需要引用插件的页面需配置
......
......@@ -7,34 +7,8 @@ import API from '@/api'
import { useLoginInfoModel, useActivityInfoModel } from '@/store'
import { checkIsMember } from 'tbcc-sdk-ts/lib/utils'
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) {
const { activityInfo } = useActivityInfoModel()
const { type = HELP_MODAL_TYPE.HELP, onClose = () => {}, newVip = true, helpInfo = {} } = props
......@@ -104,16 +78,16 @@ export default function RuleModal(props) {
<View>
<Modal hideCloseButton={false} onClose={onCloseModal} top={'50%'} closePos={{ right: 0, top: 0 }}>
<View className={styles.container} style={
{ width: helpConfig[type].width / 100 + 'rem',
height: helpConfig[type].height / 100 + 'rem',
backgroundImage: `url(${helpConfig[type].bg})`
{ width: HELP_CONFIG[type].width / 100 + 'rem',
height: HELP_CONFIG[type].height / 100 + 'rem',
backgroundImage: `url(${HELP_CONFIG[type].bg})`
}}>
<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奖励` }
</Text>
<Image src={helpConfig[type].btnTxt}
style={{ marginBottom: helpConfig[type].marginBottom / 100 + 'rem' }}
<Image src={HELP_CONFIG[type].btnTxt}
style={{ marginBottom: HELP_CONFIG[type].marginBottom / 100 + 'rem' }}
className={styles['help-btn']} onClick={() => onHandleHelp()} />
</View>
</Modal>
......
// 助力弹窗类型
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
......@@ -14,17 +14,6 @@ export const ACTIVITY_STATUS = {
// 店铺ID
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 = {
MUSIC:'cloud://FBE3C154661ACEEBA164E8B70B4D71E2/yoga bgm.mp3'
......
import { useEffect, useState } from 'react'
import { useEffect, useState, useReducer } from 'react'
import { useRouter } from '@tarojs/taro'
import { useLoginInfoModel } from '../store/loginInfo'
import API from '../api'
......
......@@ -2,7 +2,8 @@ import React, { useRef, useState } from 'react'
import { View, Image } from '@tarojs/components'
import Taro, { useShareAppMessage, useDidShow, getApp } from '@tarojs/taro'
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 { useActivityInfoModel, useLoginInfoModel } from '@/store'
import API from '@/api'
......@@ -19,12 +20,6 @@ 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'
const INDEX_CONFIG = {
bg: '', // 背景 cloud://C4015B7CEC23CF013A78247E2852524F//火箭待机小球抖动.json
ruleButton: '', // 规则按钮
......@@ -33,51 +28,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: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() {
const app = getApp()
const { activityInfo, setActivityInfoAndStatus } = useActivityInfoModel()
......@@ -127,6 +77,8 @@ function Index() {
},[])
// 授权登录完成
useLogin(async (info) => {
console.warn(info)
console.warn(loginInfo)
handleVisibleModal(info)
// setUpdateFlag(1)
})
......@@ -207,16 +159,6 @@ function Index() {
<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>
{
......
......@@ -9,6 +9,7 @@ import { prizeList } from '@/mock'
import styles from './preComp.module.less'
import {useAudio} from '@/hooks/useAudio'
import {CLOUD_OBJ, BGMUSIC_URL} from '@/const'
import ContainerFit from '@/components/_base/ContainerFit/ContainerFit'
......@@ -23,6 +24,51 @@ import RankTitle from '@/components/_tb_comps/Rank/RankTitle/RankTitle'
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) {
return(
<ContainerFit hasFitPsd={true}>
......@@ -30,11 +76,13 @@ export default function PreComp(props) {
<ScrollXView prizeList={prizeList} />
</View>
<View className={styles['comp-view']}>
{/* 大转盘 */}
<RotateWheel />
</View>
{/* <View className={styles['comp-view']}>
<View className={styles['comp-view']}>
{/* swiper左右滑动 */}
<SwiperView swiperList={prizeList} />
</View> */}
</View>
</ContainerFit>
)
}
\ No newline at end of file
import { useState } from 'react'
import { useState, useReducer } from 'react'
import { createModel } from 'hox'
function useLoginInfo() {
......@@ -10,7 +10,6 @@ function useLoginInfo() {
avatar: '',
inviteId: ''
})
return {
loginInfo,
setLoginInfo
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment