Commit 7ef34a85 authored by mqf_0707's avatar mqf_0707

常用模块拆分

parent 7c0fc16b
No preview for this file type
export default { export default {
hasCanvas: false, // 是否开启游戏模块自动注入dist hasCanvas: true, // 是否开启游戏模块自动注入dist
defaultPlugins: [ defaultPlugins: [
[ [
'@pluve/taro-plugin-mars', // taro暂时未支持阿里小程序自定义插件 需要引用插件的页面需配置 '@pluve/taro-plugin-mars', // taro暂时未支持阿里小程序自定义插件 需要引用插件的页面需配置
......
import cloud from '@tbmp/mp-cloud-sdk' import cloud from '@tbmp/mp-cloud-sdk'
import tbccTs from 'tbcc-sdk-ts' import tbccTs from 'tbcc-sdk-ts'
import conifg from './config/index' import conifg from './config/config'
const { utils: { generateAPI }, request: tbccRequest, capi, capiFn } = tbccTs const { utils: { generateAPI }, request: tbccRequest, capi, capiFn } = tbccTs
const { cloudName, requestType } = conifg const { cloudName, requestType } = conifg
...@@ -38,6 +38,19 @@ const apiList = { ...@@ -38,6 +38,19 @@ const apiList = {
getCollectGoodsList: 'getCollectGoodsList', getCollectGoodsList: 'getCollectGoodsList',
getItemListByItemIds: 'getItemListByItemIds', getItemListByItemIds: 'getItemListByItemIds',
updateEnamePrizeReceived: 'updateEnamePrizeReceived', // 会员权益领取 updateEnamePrizeReceived: 'updateEnamePrizeReceived', // 会员权益领取
getMyPrizeList: 'getMyAwardsList',
receiveObjectPrize: {
handle: 'recieveObjectPrize',
method: 'GET',
isShowLoading: false,
toastError: false
},
receiveEnamePrize: {
handle: 'recieveEnamePrize',
method: 'GET',
isShowLoading: false,
toastError: false
}
} }
// 生成API // 生成API
......
...@@ -33,7 +33,7 @@ export default { ...@@ -33,7 +33,7 @@ export default {
enableSkia: 'true', enableSkia: 'true',
allowsBounceVertical: 'NO', allowsBounceVertical: 'NO',
navigationBarTitleText: '活动名称', navigationBarTitleText: '活动名称',
navigationBarForceEnable: true navigationBarForceEnable: false
}, },
plugins: { plugins: {
cemMember: { cemMember: {
......
...@@ -4,7 +4,7 @@ import './app.less' ...@@ -4,7 +4,7 @@ import './app.less'
// 使用taro-ui 按需引入的组件样式 // 使用taro-ui 按需引入的组件样式
import './taro-ui.scss' import './taro-ui.scss'
import config from './config/index' import config from './config/config'
import './utils/mdProxy' import './utils/mdProxy'
const { env, tornadoAPI, defaultActivityId } = config const { env, tornadoAPI, defaultActivityId } = config
......
import { View } from '@tarojs/components'
import React from 'react'
import styles from './ContainerFit.module.less'
export default function ContainerFit(props) {
const { bg = ''} = props
return (
<View className={styles['page-container']}>
<View className={styles['page-psd-container']} style={{ background: `url(${bg}) no-repeat`, backgroundSize: '7.5rem 16.24rem' }}>
<View className={styles['page-content']}>
{props.children}
</View>
</View>
</View>
)
}
\ No newline at end of file
.page-container {
position: relative;
top: 0;
right: 0;
left: 0;
width: 100vw;
height: 100vh;
min-height: 100vh;
overflow: hidden;
}
.page-psd-container {
position: absolute;
width: 100vw;
height: 1624px;
left: 0;
right: 0;
top: 50%;
transform: translate(0,-50%);
}
.page-content {
position: absolute;
width: 100vw;
height: 100vh;
left: 0;
right: 0;
top: 50%;
transform: translate(0,-50%);
}
\ No newline at end of file
...@@ -5,28 +5,26 @@ import { Main } from './output'; ...@@ -5,28 +5,26 @@ import { Main } from './output';
const app = getApp() const app = getApp()
Component({ Component({
isUpdateFlag: true, isUpdateFlag: true,
data: { data: {},
needDataInCanvas: {} props: {
}, data: {}
didMount(query) {
}, },
didMount(query) {},
didUpdate(preProps,preData) { didUpdate(preProps,preData) {
// 实时监听数据更新 // 实时监听数据更新
const { updateFlag, netName, updateData } = this.props const { updateFlag, data } = this.props
if(updateFlag !== 1 && updateFlag !== preProps.updateFlag) { if(updateFlag !== 1 && updateFlag !== preProps.updateFlag) {
// this.postMessage(netName, updateData) this.postMessage(data.type, data)
console.warn('数据更新了')
} }
}, },
didUnMount() {
// 页面被关闭
this.main && this.main.destroy();
},
methods: { methods: {
onCanvasReady() { onCanvasReady() {
console.log("进canvas了") console.log("进canvas了")
// 创建Main,授权登录完后才创建 // 创建Main,授权登录完后才创建
this.createMain();
},
//创建引入的Main
createMain() {
const self = this; const self = this;
my.createCanvas({ my.createCanvas({
id: 'canvas', id: 'canvas',
...@@ -41,12 +39,10 @@ Component({ ...@@ -41,12 +39,10 @@ Component({
if (!this.main) { if (!this.main) {
try { try {
this.main = new Main(ccc) this.main = new Main(ccc)
//添加事件,为了和main里的通信 //添加事件,为了和main里的通信
this.main.addGlobalEvent("onMessage", self.onMessage, self) this.main.addGlobalEvent("onMessage", self.onMessage, self)
} catch (err) { } catch (err) {
console.error(err) console.error(err)
} }
} }
} }
...@@ -58,145 +54,28 @@ Component({ ...@@ -58,145 +54,28 @@ Component({
let netName = e.data.netName; let netName = e.data.netName;
//接口参数 //接口参数
let parameter = e.data.parameter; let parameter = e.data.parameter;
//暂时发现3个需要用户操作的接口 if(netName.indexOf("mine") == 0) {
//定制的授权 // 和游戏页面通信
if (netName == "mine.authorize") { this.props.onMessage({
this.getAuth() type: 'message',
} target: {
//获取地址 id: this.props.id
else if (netName == "mine.getUserAddress") {
this.getUserAddress(parameter.prizeId)
}
//关注店铺的操作
else if (netName == "mine.favorShop") {
this.doFavorShop()
}
//领养名字,有弹框的
else if (netName == "mine.getAdoptName") {
this.setData({ "adoptModalVisible": true, type: parameter.type })
}
//打开详情页,还有成功失败
else if (netName == "mine.openDetail") {
openDetail(parameter.itemId).then(
() => {
this.postMessage(netName, { success: true })
}, },
() => {
this.postMessage(netName, { success: false })
}
)
}
//前端同步接口
else if (netName.indexOf("mine") == 0) {
var data = { success: true }
switch (netName) {
case "mine.getAppData"://获取信息
data = {
success: true,
data: { data: {
activityId: app.activityId,//|| "5e7c40e98564b57d7fb95812", netName,
nickName: app.nickName, parameter
avatar: app.avatar,
openId: app.openId,
inviteId: this.inviteId,//判断是否要发助力用
isFollow: app.isFollow,
needDataInCanvas:app.needDataInCanvas,
activityInfo:this.activityInfo,
userInfo:this.userInfo,
newUser: this.newUser,
remainTimes: this.remainTimes,
firstLoginToday: this.firstLoginToday,
}
} }
break;
case "mine.navigateToOutside"://跳转小程序外的页面
my.call("navigateToOutside", {
url: parameter.url
}, (res) => {
// my.alert({ content: "success - " + JSON.stringify(res)})
}) })
console.log(parameter.url) }else {
break;
case "mine.navigateTo"://跳转小程序内的页面
my.navigateTo({
url: parameter.url
})
break;
case "mine.navigateBack"://返回页面
my.navigateBack({
delta: parameter.delta || 1
})
break;
case "mine.showSharePanel"://分享
//多一个参数
this.openId = parameter.openId;
my.showSharePanel()
break;
case "mine.reportAnalytics": ////淘宝自定义埋点
reportAnalytics(parameter.logkey);
break;
case "mine.openMusic": //音频
playBgMusic(parameter.isOn, this.musicUrl);
break;
case "mine.openTask": //打开任务
this.setData({ taskModalVisible: true });
break;
case "mine.openMember": //打开入会
this.setData({ expend: true, });
break;
}
this.postMessage(netName, data)
} else {
//获取后端接口
const { function: fc } = app.cloud;
//处理下带上activityId
if (!parameter) parameter = {};
parameter.activityId = app.activityId;
//netName得分割下
fc.invoke(netName.split(".")[0], parameter, netName.split(".")[1])
.then(res => {
// console.log("返回数据" + JSON.stringify(res));
//发送消息
this.postMessage(netName, res || { success: false })
}, (err) => {
//网络异常,返回失败
this.postMessage(netName, { success: false }) this.postMessage(netName, { success: false })
})
} }
}, },
//和main通信的方法,接收main的信息
onMessage2(e) {
// this.props.onPostMessage({
// type: 'postMessage',
// target: {
// id: this.props.id
// },
// data: e.data
// })
},
postMessage(netName, data) { postMessage(netName, data) {
// this.main.dispatchGlobalEvent(netName, data)
this.main && this.main.dispatchGlobalEvent({ type: netName }, data)//以防复用事件event串了,就用这种方式 this.main && this.main.dispatchGlobalEvent({ type: netName }, data)//以防复用事件event串了,就用这种方式
}, },
//鼠标事件 //鼠标事件
onMouseEvent(e) { onMouseEvent(e) {
if (this.main) this.main.stage.onMouseEvent(e) if (this.main) this.main.stage.onMouseEvent(e)
}, },
// 发送数据
onPostMessage() {
this.props.onPostMessage({
type: 'postMessage',
target: {
id: this.props.id
},
data: {
a: 222,
b: 33
}
})
}
} }
}); });
<member-shop-center expend="{{true}}" onClose="onMemberModalClose" onAuthFail="onAuthFail" onAuthSuccess="onAuthSuccess"/> <member-shop-center expend="{{expend}}" sellerId="{{sellerId}}" onClose="onMemberModalClose" onAuthFail="onAuthFail" onAuthSuccess="onAuthSuccess"/>
Component({ Component({
data: { data: {},
visible: true props: { expend: false, sellerId: '' },
}, didMount(){},
methods: { methods: {
onMemberModalClose() { onMemberModalClose() {
// console.log('this.props :>> ', this.props); // console.log('this.props :>> ', this.props);
......
.container__scroll { .container__scroll {
height: 100%; height: 100%;
} }
.container__content-list { .container__content-list {
width: 100%; width: 100%;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
} }
.content-item { .content-item {
width: 340px; width: 340px;
height: 510px; height: 510px;
background: #fff; background: #fff;
margin-bottom: 20px; margin-bottom: 20px;
} }
.content-item:nth-child(even) { .content-item:nth-child(even) {
margin-left: 20px; margin-left: 20px;
} }
.item__img { .item__img {
width: 340px; width: 340px;
height: 340px; height: 340px;
background: #e1e1e1; background: #e1e1e1;
} }
.item__img image { .item__img image {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.item__name { .item__name {
margin: 25px 0 31px 21px; margin: 25px 0 31px 21px;
width: 310px; width: 310px;
height: 60px; height: 60px;
...@@ -36,45 +36,45 @@ ...@@ -36,45 +36,45 @@
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
} }
.item__price { .item__price {
padding: 0 31px 0 24px; padding: 0 31px 0 24px;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
} }
.item__price-num { .item__price-num {
font-size: 32px; font-size: 32px;
font-family: PingFang SC; font-family: PingFang SC;
font-weight: 600; font-weight: 600;
color: rgba(255, 42, 0, 1); color: rgba(255, 42, 0, 1);
} }
.item__price-num text { .item__price-num text {
font-size: 24px; font-size: 24px;
margin-right: 2px; margin-right: 2px;
} }
.item__price-collect { .item__price-collect {
width: 118px; width: 118px;
height: 31px; height: 31px;
background-size: 100% 100%; background-size: 100% 100%;
} }
.item__price-collect image { .item__price-collect image {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.item__price-no-collect { .item__price-no-collect {
width: 30px; width: 30px;
height: 30px; height: 30px;
} }
.item__price-no-collect image { .item__price-no-collect image {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.goods-modal-timer { .goods-modal-timer {
width: 147px; width: 147px;
height: 223px; height: 223px;
position: absolute; position: absolute;
top: 502px; top: 502px;
right: 19px; right: 19px;
background: #eee; background: #eee;
} }
\ No newline at end of file
.goods-title {
.wh(100%,100%);
.flex-row-center();
.flex-row-middle();
}
\ No newline at end of file
import React, { useState } from 'react' import React, { useState } from 'react'
import { View, Image, ScrollView } from '@tarojs/components' import { View, Image, ScrollView } from '@tarojs/components'
import classnames from 'classnames' import classnames from 'classnames'
import styles from './GoodsTitle.module.less' import styles from './TitleImg.module.less'
function GoodsTitle(props) { function TitleImg(props) {
const { config } = props const { config } = props
return ( return (
<View className={styles['goods-title']}> <View className={styles['title-box']}>
<Image src={config.image} style={{width: config.width / 100 + 'rem', height: config.height / 100 + 'rem' }} /> <Image src={config.image} mode="widthFix" style={{width: config.width / 100 + 'rem', height: config.height / 100 + 'rem' }} />
</View> </View>
) )
} }
export default GoodsTitle export default TitleImg
\ No newline at end of file \ No newline at end of file
.title-box {
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
}
\ No newline at end of file
...@@ -3,7 +3,7 @@ import React, { useState } from 'react' ...@@ -3,7 +3,7 @@ import React, { useState } from 'react'
import Modal from '@/components/_base/Modal/Modal' import Modal from '@/components/_base/Modal/Modal'
import { useThrottle } from '@/hooks/useThrottle' import { useThrottle } from '@/hooks/useThrottle'
import styles from './PrizeModal.module.less' import styles from './PrizeModal.module.less'
import { BENEFIT_TYPE, PRIZE_TYPE } from '@/const' import { BENEFIT_TYPE, PRIZE_TYPE } from '@/config/myPrize.config'
import { checkIsMember } from 'tbcc-sdk-ts/lib/utils' import { checkIsMember } from 'tbcc-sdk-ts/lib/utils'
import { commonToast, navigateToOutside } from 'tbcc-sdk-ts/lib/core/tb' import { commonToast, navigateToOutside } from 'tbcc-sdk-ts/lib/core/tb'
import { receiveEnamePrize, receiveObjectPrize, receiveMemberEname } from '@/utils/util' import { receiveEnamePrize, receiveObjectPrize, receiveMemberEname } from '@/utils/util'
......
...@@ -3,14 +3,15 @@ import React, { useState, useEffect, useRef } from 'react' ...@@ -3,14 +3,15 @@ import React, { useState, useEffect, useRef } from 'react'
import { noopFn } from '@/utils/util' import { noopFn } from '@/utils/util'
import tbccTs from 'tbcc-sdk-ts' import tbccTs from 'tbcc-sdk-ts'
import API from '@/api' import API from '@/api'
import config from '@/config/index' import config from '@/config/config'
import { useThrottle } from '@/hooks/useThrottle' import { useThrottle } from '@/hooks/useThrottle'
import Popup from '@/components/_base/Popup/Popup' import Popup from '@/components/_base/Popup/Popup'
import { TASK_STATUS, TASK_CONFIG, SHOP_ID, BROSE_GOOD_TYPE, ORDER_GOOD_TYPE } from '@/const' import { SHOP_ID } from '@/const'
import styles from './TasksModal.module.less' import styles from './TasksModal.module.less'
import { useDidShow } from '@tarojs/taro' import { useDidShow } from '@tarojs/taro'
import { TASK_DATA } from '@/mock' import { TASK_DATA } from '@/mock'
import { checkIsMember } from 'tbcc-sdk-ts/lib/utils' import { checkIsMember } from 'tbcc-sdk-ts/lib/utils'
import { TASK_CONFIG, ORDER_GOOD_TYPE, BROSE_GOOD_TYPE, TASK_STATUS } from '@/config/task.config'
const { commonToast, favorShop, navigateTo, navigateToOutside, showSharePanel, navigateToTaobaoPage } = tbccTs.tb const { commonToast, favorShop, navigateTo, navigateToOutside, showSharePanel, navigateToTaobaoPage } = tbccTs.tb
...@@ -22,7 +23,7 @@ export default function TasksModal(props) { ...@@ -22,7 +23,7 @@ export default function TasksModal(props) {
const preBrowseTime = useRef(null) const preBrowseTime = useRef(null)
const [ taskList, setTaskList ] = useState(TASK_DATA) const [ taskList, setTaskList ] = useState(TASK_DATA)
const { taskIcon, commonTaskTxt, doTaskTxt, jumpLinkType, browseTime, showTaskType, browseGoodType, orderGoodType } = TASK_CONFIG const { icons, commonTxt, doTxt, jumpType, browseTime, showTaskType, browseType, orderType } = TASK_CONFIG
useDidShow(() => { useDidShow(() => {
if (app.isFlashTask) { if (app.isFlashTask) {
...@@ -41,7 +42,7 @@ export default function TasksModal(props) { ...@@ -41,7 +42,7 @@ export default function TasksModal(props) {
useEffect(() => { useEffect(() => {
if(showTaskType === 2 && taskFlag) { if(showTaskType === 2 && taskFlag) {
fetchTaskList() fetchTaskList()
}else { }else if(showTaskType === 1){
fetchTaskList() fetchTaskList()
} }
},[taskFlag]) },[taskFlag])
...@@ -51,7 +52,7 @@ export default function TasksModal(props) { ...@@ -51,7 +52,7 @@ export default function TasksModal(props) {
const { success, data } = await API.getTaskList({ isVip }) const { success, data } = await API.getTaskList({ isVip })
if(success && data) { if(success && data) {
const { list = [] } = data const { list = [] } = data
setTaskList(list) // setTaskList(list)
} }
} }
...@@ -88,7 +89,7 @@ export default function TasksModal(props) { ...@@ -88,7 +89,7 @@ export default function TasksModal(props) {
// 跳转任务 https://www.feizhu.com // 跳转任务 https://www.feizhu.com
jumpLink: async() => { jumpLink: async() => {
navigateToOutside(url) navigateToOutside(url)
if (jumpLinkType === 2) { if (jumpType === 2) {
doCompleteTaskHandle(taskType) doCompleteTaskHandle(taskType)
} else { } else {
app.isFlashTask = true app.isFlashTask = true
...@@ -98,12 +99,12 @@ export default function TasksModal(props) { ...@@ -98,12 +99,12 @@ export default function TasksModal(props) {
}, },
browseGoods: async() => { browseGoods: async() => {
app.isFlashTask = true app.isFlashTask = true
if(browseGoodType === BROSE_GOOD_TYPE.PAGE) preBrowseTime.current = Date.now() if(browseType === BROSE_GOOD_TYPE.PAGE) preBrowseTime.current = Date.now()
navigateTo(`/pages/packageGood/browseGoods/browseGoods?itemIds=${itemIds}&keepTime=${keepTime}`) navigateTo(`/pages/packageGood/browseGoods/browseGoods?itemIds=${itemIds}&keepTime=${keepTime}`)
}, },
orderGoods: async() => { orderGoods: async() => {
app.isFlashTask = true app.isFlashTask = true
if(orderGoodType === ORDER_GOOD_TYPE.PAGE) { if(orderType === ORDER_GOOD_TYPE.PAGE) {
navigateTo(`/pages/packageGood/orderGoods/orderGoods?itemIds=${itemIds}`) navigateTo(`/pages/packageGood/orderGoods/orderGoods?itemIds=${itemIds}`)
}else { }else {
await navigateToTaobaoPage(SHOP_ID) await navigateToTaobaoPage(SHOP_ID)
...@@ -158,7 +159,7 @@ export default function TasksModal(props) { ...@@ -158,7 +159,7 @@ export default function TasksModal(props) {
return ( return (
<View className={styles['item']} key={'task_I' + i}> <View className={styles['item']} key={'task_I' + i}>
<View className={styles['item__left']}> <View className={styles['item__left']}>
<Image src={taskIcon[item.taskType]} mode='widthFix' /> <Image src={icons[item.taskType]} mode='widthFix' />
</View> </View>
<View className={styles['item__left-label']}> <View className={styles['item__left-label']}>
<View className={styles['item__left-title']}>{item.title}</View> <View className={styles['item__left-title']}>{item.title}</View>
...@@ -166,7 +167,7 @@ export default function TasksModal(props) { ...@@ -166,7 +167,7 @@ export default function TasksModal(props) {
</View> </View>
<View className={`${styles['list-item__right']} ${styles['item__status-' + item.status]}`} onClick={() => handleTapItem(item)}> <View className={`${styles['list-item__right']} ${styles['item__status-' + item.status]}`} onClick={() => handleTapItem(item)}>
{ {
item.status === TASK_STATUS.WAIT_DO ? (doTaskTxt[item.taskType] || '去完成') : commonTaskTxt[item.status] item.status === TASK_STATUS.WAIT_DO ? (doTxt[item.taskType] || '去完成') : commonTxt[item.status]
} }
</View> </View>
</View> </View>
......
export default {
taskType: 'browseGoods',
type: '01',
bg: '//yun.dui88.com/taobaomini/clientCTest/goods_bg@2x.png',
head: {
image: '//yun.duiba.com.cn/taobaomini/clientCTest/goods_title@2x.png',
width: 750,// 头部banner/title 宽度
height: 120,// 头部banner/title 高度
},
image: {
img: '//yun.duiba.com.cn/taobaomini/clientCTest/goods_img@2x.png'
},
color: '#181818'
}
\ No newline at end of file
export const CART_CONFIG = {
taskType: 'cartGoods',
type: 1, // 1 单个商品可重复完成 2 单个商品只可完成一次
bg: '//yun.dui88.com/taobaomini/clientCTest/goods_bg@2x.png',
head: {
image: '//yun.duiba.com.cn/taobaomini/clientCTest/goods_title@2x.png',
width: 750,// 头部banner/title 宽度
height: 120,// 头部banner/title 高度
},
image: {
collect: '//yun.duiba.com.cn/taobaomini/clientCTest/goods_collection@2x.png',
no_collect: '//yun.duiba.com.cn/taobaomini/clientCTest/collection_no_collect@2x.png',
},
color: '#181818'
}
// 任务完成类型
export const CART_TYPE = {
ONE: 1, // 单个商品可重复完成
MORE: 2 // 单个商品只可完成一次
}
\ No newline at end of file
export default {
taskType: 'collectGoods',
type: '01',
bg: '//yun.dui88.com/taobaomini/clientCTest/goods_bg@2x.png',
head: {
image: '//yun.duiba.com.cn/taobaomini/clientCTest/goods_title@2x.png',
width: 750,// 头部banner/title 宽度
height: 120,// 头部banner/title 高度
},
image: {
collect: '//yun.duiba.com.cn/taobaomini/clientCTest/goods_collection@2x.png',
no_collect: '//yun.duiba.com.cn/taobaomini/clientCTest/collection_no_collect@2x.png'
},
color: '#181818'
}
\ No newline at end of file
export default {
env: 'test', // 云函数环境 test 测试环境 online 线上环境
requestType: 'cloud', // cloud: 云函数, yapi: yapi 接口, ams: ams接口,tornadoAPI: 风驰台接口
cloudName: 'pkrqdb', // 主云函数项目名 CommonToC
sellerId: '2207644377875',
tornadoAPI: 'https://tornado.duibadev.com.cn/tbServer/api?db=db3000000038851072&proxyIp=172.16.130.158', // 新增:当requestType: 'tornadoAPI'时,找服务端提供地址
defaultActivityId: '611cd5f78e6a08bf202eeb7e' // 默认活动id
}
\ No newline at end of file
export default { export default {
env: 'test', // 云函数环境 test 测试环境 online 线上环境
requestType: 'yapi', // cloud: 云函数, yapi: yapi 接口, ams: ams接口,tornadoAPI: 风驰台接口
cloudName: 'CommonToC', // 主云函数项目名 CommonToC
sellerId: '2207644377875',
tornadoAPI: 'https://tornado.duibadev.com.cn/tbServer/api?db=db3000000038851072&proxyIp=172.16.130.158', // 新增:当requestType: 'tornadoAPI'时,找服务端提供地址
defaultActivityId: '60642aafc752d118247c2a2d' // 默认活动id
} }
\ No newline at end of file
// 领取奖品状态
export const DRAW_STATUS = {
// 待领取
WAITAWARD: 1,
// 处理中
PROCESSING: 2,
// 领取成功
SUCCESS: 3,
// 领取失败
FAIL: 4,
// 已过期
EXPIRED: 5,
// 重新领取
RETRY: 6
}
// 奖品类型
export const PRIZE_TYPE = {
ENAME: 1,
CREDITS: 2,
OBJECT: 3,
THANKS: 5
}
// 权益类型
export const BENEFIT_TYPE = {
ENAME: 1,// 普通权益
MEMBER: 2 // 会员权益
}
// 我的奖品配置
export const PRIZE_CONFIG = {
bg: '//yun.duiba.com.cn/aurora/assets/e13fab3165d3a6bb4cbe8827e8f0fd41084b0091.png', // 背景图
head: {
image: '//yun.dui88.com/duiba-components-c-myprizeprize_title.png',// 标题
width: 208,// 头部banner/title 宽度
height: 36,// 头部banner/title 高度
},
copyIcon: '//yun.dui88.com/duiba-components-c-myprizemyprize_copy_code.png', // 复制
receiveBtn: '//yun.duiba.com.cn/bestoreBox/prize_received.png', // 已领取 权益类奖品未配置 uesUrl使用
objectStatus: {
1: '//yun.dui88.com/duiba-components-c-myprizeto_address.png', // 填写地址(实物奖品)
3: '//yun.dui88.com/duiba-components-c-myprizelogistics.png', // 查看物流
},
enameStatus: {
1: '//yun.dui88.com/duiba-components-c-myprizeget_now.png', // 立即领取(除实物奖品外)
3: '//yun.duiba.com.cn/bestoreBox/prize_received.png', // 去使用(除实物奖品外)
},
orderStatus: {
1: '//yun.dui88.com/duiba-components-c-myprizeget_now.png', // 去支付(除实物奖品外)
3: '//yun.duiba.com.cn/bestoreBox/prize_received.png', // 已领取
},
commonStatus: {
6: '//yun.dui88.com/duiba-components-c-myprizeget_again.png', // 重新领取
5: '//yun.duiba.com.cn/spark/assets/914ba8643c8abb8d710a3126ec312aecf6c4daf0.png', // 已失效
4: '//yun.duiba.com.cn/spark/assets/8267375232058a6d0140270b1594427fb08d6ae3.png' // 领取失败
},
logisticsImage: {
shipped: '//yun.dui88.com/duiba-components-c-myprizeprize_shipped.png', // 已发货物理弹窗
notShipped: '//yun.dui88.com/duiba-components-c-myprizenotshipped.png' // 待发货物流弹窗
},
btnStyle: {
width: '150rpx'
},
contentTop: '208rpx',
blankTxt: '暂无奖品',
hasLogistic: false, // 是否展示物流信息
isShowPirzeId: false // 是否显示奖品编号
}
\ No newline at end of file
export default {
taskType: 'orderGoods',
type: '01',
bg: '//yun.dui88.com/taobaomini/clientCTest/goods_bg@2x.png',
head: {
image: '//yun.duiba.com.cn/taobaomini/clientCTest/goods_title@2x.png',
width: 750,// 头部banner/title 宽度
height: 120,// 头部banner/title 高度
},
image: {
img: '//yun.duiba.com.cn/taobaomini/clientCTest/goods_img@2x.png'
},
color: '#181818'
}
\ No newline at end of file
// 任务状态
export const TASK_STATUS = {
WAIT_DO: 1, // 未完成
WAIT_RECEIVE: 2, // 待领取
DONE: 3 // 已完成
}
// 任务频率类型常量
export const TASK_RATE_TYPE = {
FOREVER: 1,
EVERYDAY: 2,
NOLIMIT: 3
}
// 浏览商品类型
export const BROSE_GOOD_TYPE = {
PAGE: 1, // 浏览集合页15s
CLICK: 2, // 点击就算完成任务
DETAIL: 3 // 浏览指定商品详情页15s
}
// 购买商品类型
export const ORDER_GOOD_TYPE = {
PAGE: 1, // 集合页下单
SHOP: 2, // 跳转店铺
}
export const TASK_CONFIG = {
icons: { // 任务图标
follow: '//yun.duiba.com.cn/baicaoweiFarmer/follow.png',
member: '//yun.duiba.com.cn/baicaoweiFarmer/memberStar1.png',
invites: '//yun.duiba.com.cn/baicaoweiFarmer/invites.png',
jumpLink: '//yun.duiba.com.cn/baicaoweiFarmer/browseGoodsLink.png',
browseGoods: '//yun.duiba.com.cn/baicaoweiFarmer/browseGoods.png',
orderGoods: '//yun.duiba.com.cn/baicaoweiFarmer/orderGoods.png',
collectGoods: '//yun.duiba.com.cn/baicaoweiFarmer/orderGoods.png',
sign: '//yun.duiba.com.cn/baicaoweiFarmer/orderGoods.png',
exchangeCredits: '//yun.duiba.com.cn/baicaoweiFarmer/orderGoods.png'
},
commonTxt: {
1: '去完成',
2: '待领取',
3: '已完成'
},
doTxt: {
follow: '立即关注',
invites: '去邀请',
member: '1秒入会',
sign: '立即签到',
jumpLink: '去完成',
browseGoods: '去完成',
orderGoods: '去完成',
collectGoods: '去完成'
},
jumpType: 1, // 1 跳转浏览15s 才算完成 2 跳转即算完成
browseTime: 15, // 浏览时间
browseType: 3, // 1 浏览15s 才算完成 2 点击就算完成任务 3 浏览指定商品详情页 15s
showTaskType: 1,// 1 弹窗 2 列表
orderType: 1, // 1 集合页下单 2 跳转店铺
}
\ No newline at end of file
...@@ -4,48 +4,6 @@ export const SHARE_CONFIG = { ...@@ -4,48 +4,6 @@ export const SHARE_CONFIG = {
desc: '分享测试描述', desc: '分享测试描述',
imageUrl: '' // 分享图片URL imageUrl: '' // 分享图片URL
} }
// 领取奖品状态
export const DRAW_STATUS = {
// 待领取
WAITAWARD: 1,
// 处理中
PROCESSING: 2,
// 领取成功
SUCCESS: 3,
// 领取失败
FAIL: 4,
// 已过期
EXPIRED: 5,
// 重新领取
RETRY: 6
}
// 奖品类型
export const PRIZE_TYPE = {
ENAME: 1,
CREDITS: 2,
OBJECT: 3,
THANKS: 5
}
// 我的奖品状态
export const PRIZE_DRAW_STATUS_MAP = {
RECEIVE: 1, // 待领取
DEALING: 2, // 处理中
SUCCESS: 3, // 领取成功
FAILURE: 4, // 领取失败
FINISHED: 5, // 已过期
REPEAT: 6 // 重新领取
}
// 奖品类型
export const PRIZE_TYPE_MAP = {
EQUITY: 1, // 权益
INTEGRATION: 2, // 积分
ENTITY: 3, // 实物
THANKS: 5 // 谢谢参与
}
// 活动状态 // 活动状态
export const ACTIVITY_STATUS = { export const ACTIVITY_STATUS = {
NO_EXIST: 0, // 不存在 NO_EXIST: 0, // 不存在
...@@ -53,70 +11,6 @@ export const ACTIVITY_STATUS = { ...@@ -53,70 +11,6 @@ export const ACTIVITY_STATUS = {
NO_START: 2, // 未开始 NO_START: 2, // 未开始
END: 3 // 已经结束 END: 3 // 已经结束
} }
// 任务频率类型常量
export const TASK_RATE_TYPE = {
FOREVER: 1,
EVERYDAY: 2,
NOLIMIT: 3
}
// 任务状态
export const TASK_STATUS = {
WAIT_DO: 1, // 未完成
WAIT_RECEIVE: 2, // 待领取
DONE: 3 // 已完成
}
export const TASK_CONFIG = {
taskIcon: { // 任务图标
follow: '//yun.duiba.com.cn/baicaoweiFarmer/follow.png',
member: '//yun.duiba.com.cn/baicaoweiFarmer/memberStar1.png',
invites: '//yun.duiba.com.cn/baicaoweiFarmer/invites.png',
jumpLink: '//yun.duiba.com.cn/baicaoweiFarmer/browseGoodsLink.png',
browseGoods: '//yun.duiba.com.cn/baicaoweiFarmer/browseGoods.png',
orderGoods: '//yun.duiba.com.cn/baicaoweiFarmer/orderGoods.png',
collectGoods: '//yun.duiba.com.cn/baicaoweiFarmer/orderGoods.png',
sign: '//yun.duiba.com.cn/baicaoweiFarmer/orderGoods.png',
exchangeCredits: '//yun.duiba.com.cn/baicaoweiFarmer/orderGoods.png'
},
commonTaskTxt: {
1: '去完成',
2: '待领取',
3: '已完成'
},
doTaskTxt: {
follow: '立即关注',
invites: '去邀请',
member: '1秒入会',
sign: '立即签到',
jumpLink: '去完成',
browseGoods: '去完成',
orderGoods: '去完成',
collectGoods: '去完成'
},
jumpLinkType: 1, // 1 跳转浏览15s 才算完成 2 跳转即算完成
browseTime: 15, // 浏览时间
browseGoodType: 3, // 1 浏览15s 才算完成 2 点击就算完成任务 3 浏览指定商品详情页 15s
showTaskType: 1,// 1 弹窗 2 列表
orderGoodType: 1, // 1 集合页下单 2 跳转店铺
}
// 权益类型
export const BENEFIT_TYPE = {
ENAME: 1,// 普通权益
MEMBER: 2 // 会员权益
}
// 浏览商品类型
export const BROSE_GOOD_TYPE = {
PAGE: 1, // 浏览集合页15s
CLICK: 2, // 点击就算完成任务
DETAIL: 3 // 浏览指定商品详情页15s
}
// 购买商品类型
export const ORDER_GOOD_TYPE = {
PAGE: 1, // 集合页下单
SHOP: 2, // 跳转店铺
}
// 店铺ID // 店铺ID
export const SHOP_ID = '60014226' export const SHOP_ID = '60014226'
......
...@@ -2,7 +2,7 @@ import { useEffect, useState } from 'react' ...@@ -2,7 +2,7 @@ import { useEffect, useState } 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'
import config from '@/config/index' import config from '@/config/config'
import { useAuth } from './useAuth' import { useAuth } from './useAuth'
import { noopFn } from '@/utils/util' import { noopFn } from '@/utils/util'
import { checkShopFavoredStatus } from 'tbcc-sdk-ts/lib/core/tb' import { checkShopFavoredStatus } from 'tbcc-sdk-ts/lib/core/tb'
......
import React, { useRef, useState } from 'react' import React, { useRef, useState } from 'react'
import { View, Image } from '@tarojs/components' import { View, Image } from '@tarojs/components'
import Taro, { useShareAppMessage, useDidShow } 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, HELP_MODAL_TYPE, HELP_MODAL_SHOW } from '@/const.js'
import { useLogin, useLoginFromShare } from '@/hooks/useLogin' import { useLogin, useLoginFromShare } from '@/hooks/useLogin'
...@@ -25,6 +25,7 @@ const INDEX_CONFIG = { ...@@ -25,6 +25,7 @@ const INDEX_CONFIG = {
} }
function Index() { function Index() {
const app = getApp()
const { activityInfo, setActivityInfoAndStatus } = useActivityInfoModel() const { activityInfo, setActivityInfoAndStatus } = useActivityInfoModel()
const { loginInfo } = useLoginInfoModel() const { loginInfo } = useLoginInfoModel()
...@@ -56,16 +57,14 @@ function Index() { ...@@ -56,16 +57,14 @@ function Index() {
} }
useEffect(() =>{ useEffect(() =>{
fetchActivityInfo() fetchActivityInfo()
getImgShareUrl('cloud://CEFE74AE67921906B5AF842150646D35/share.png').then(url => { // getImgShareUrl('cloud://CEFE74AE67921906B5AF842150646D35/share.png').then(url => {
SHARE_IMG.current = url // SHARE_IMG.current = url
}) // })
},[]) },[])
// 授权登录完成 // 授权登录完成
useLogin(async (info) => { useLogin(async (info) => {
handleVisibleModal(info) handleVisibleModal(info)
fetchUserInfo()
setUpdateFlag(1) setUpdateFlag(1)
getShareInfo()
}) })
// 查看是否有助力信息 // 查看是否有助力信息
const getShareInfo = async () => { const getShareInfo = async () => {
...@@ -111,16 +110,6 @@ function Index() { ...@@ -111,16 +110,6 @@ function Index() {
setMemberVisible(false) setMemberVisible(false)
} }
const homeStyle = classnames(styles.container,{
[`${styles['content_fixed']}`]: ruleModalVisible
})
const onHandleModal = (type) => {
const Fn = {
'visible': () => setModalVisible(true),
'close': () => setModalVisible(false)
}
Fn[type]()
}
const onHandleClose = () => { const onHandleClose = () => {
setDoHelpModalVisible(false) setDoHelpModalVisible(false)
if(loginInfo.newUser) { if(loginInfo.newUser) {
...@@ -146,7 +135,7 @@ function Index() { ...@@ -146,7 +135,7 @@ function Index() {
} }
return ( return (
<View className={homeStyle} style={{ backgroundImage: `url(${INDEX_CONFIG.bg})`}}> <View className={styles.container} style={{ backgroundImage: `url(${INDEX_CONFIG.bg})`}}>
<View className={styles.rule} style={{ backgroundImage: `url(${INDEX_CONFIG.ruleButton})` }} onClick={() => setRuleModalVisible(true)}>活动规则</View> <View className={styles.rule} style={{ backgroundImage: `url(${INDEX_CONFIG.ruleButton})` }} onClick={() => setRuleModalVisible(true)}>活动规则</View>
<View className={styles.my_prize} style={{ backgroundImage: `url(${INDEX_CONFIG.myPrizeButton})` }} onClick={() => onHandleIndex('prize')}>我的奖品</View> <View className={styles.my_prize} style={{ backgroundImage: `url(${INDEX_CONFIG.myPrizeButton})` }} onClick={() => onHandleIndex('prize')}>我的奖品</View>
<View className={styles.tasks} style={{ backgroundImage: `url(${INDEX_CONFIG.taskButton})` }} onClick={() => setTasksModalVisible(true)}>任务</View> <View className={styles.tasks} style={{ backgroundImage: `url(${INDEX_CONFIG.taskButton})` }} onClick={() => setTasksModalVisible(true)}>任务</View>
...@@ -183,7 +172,7 @@ function Index() { ...@@ -183,7 +172,7 @@ function Index() {
onClose={() => setDoHelpModalVisible(false)} onClose={() => setDoHelpModalVisible(false)}
/> />
} }
{memberVisible && <member-modal onClose={onClose} onAuthFail={onAuthFail} onAuthSuccess={onAuthSuccess} />} {<member-modal expend={memberVisible} sellerId={98563612} onClose={onClose} onAuthFail={onAuthFail} onAuthSuccess={onAuthSuccess} />}
</View> </View>
) )
} }
......
...@@ -9,9 +9,6 @@ ...@@ -9,9 +9,6 @@
right: 0; right: 0;
bottom: 0; bottom: 0;
} }
.content_fixed {
position: fixed;
}
.index_button() { .index_button() {
.wh(150px, 46px); .wh(150px, 46px);
.border(#000); .border(#000);
......
import React, { useEffect, useState, useRef } from 'react' import React, { useEffect, useState, useRef } from 'react'
import { View, Canvas } from '@tarojs/components' import { View } from '@tarojs/components'
import { useDidShow, useRouter, useDidHide } from '@tarojs/taro' import { useDidShow, useRouter, useDidHide, getApp } from '@tarojs/taro'
import API from '@/api' import API from '@/api'
import { TASK_CONFIG } from '@/const' import { TASK_CONFIG } from '@/const'
import { useLogin, useLoginFromShare } from '@/hooks/useLogin' import { useLogin, useLoginFromShare } from '@/hooks/useLogin'
...@@ -18,10 +18,12 @@ import { versionCompare, getImgShareUrl } from 'tbcc-sdk-ts/lib/utils' ...@@ -18,10 +18,12 @@ import { versionCompare, getImgShareUrl } from 'tbcc-sdk-ts/lib/utils'
import styles from './game.module.less' import styles from './game.module.less'
function GamePage(props) { function GamePage(props) {
const app = getApp()
const { activityInfo, setActivityInfoAndStatus } = useActivityInfoModel() const { activityInfo, setActivityInfoAndStatus } = useActivityInfoModel()
const { loginInfo } = useLoginInfoModel() const { loginInfo } = useLoginInfoModel()
const [canvasData,setCanvasData] = useState({}) const [canvasData,setCanvasData] = useState({})
const [ taskModalVisible, setTaskModalVisible] = useState(false) const [ taskModalVisible, setTaskModalVisible] = useState(false)
const [ canvasVisible, setCanvasVisible] = useState(false)
const [ memberVisible,setMemberVisible] = useState(false) const [ memberVisible,setMemberVisible] = useState(false)
const [updateFlag, setUpdateFlag] = useState(1) const [updateFlag, setUpdateFlag] = useState(1)
const compRef = useRef(null) const compRef = useRef(null)
...@@ -31,31 +33,24 @@ function GamePage(props) { ...@@ -31,31 +33,24 @@ function GamePage(props) {
// console.log(res) // console.log(res)
// }) // })
},[]) },[])
useDidShow(() =>{ useDidShow(() =>{})
// canvasMain.run(); useDidHide(() =>{})
})
useDidHide(() =>{
// canvasMain.pause();
})
//检查版本号 //检查版本号
const checkSystem = async () => { const checkSystem = async () => {
const { version } = await getSystemInfo(); const { version } = await getSystemInfo();
console.log('version', version); console.log('version', version);
return versionCompare(version, '9.10.0'); return versionCompare(version, '9.10.0');
} }
const getAuth = () => { // 授权后登录
console.log('getAuth') useLogin(res => {
} // 登录完成渲染cavans
const getUserAddress = () => { setCanvasVisible(true)
})
}
const doFavorShop = () => {
console.log('doFavorShop')
}
//和main通信的方法,接收main的信息 //和main通信的方法,接收main的信息
const onMessage = (e)=> { const onMessage = (e)=> {
// 接口名字 参数 // 接口名字 参数
const { netName, parameter } = e.mpEvent.data const { netName, parameter } = e.mpEvent.data
console.warn('netName:'+netName,parameter)
//定制的授权 //定制的授权
if (netName == "mine.authorize") { if (netName == "mine.authorize") {
this.getAuth() this.getAuth()
...@@ -78,27 +73,29 @@ function GamePage(props) { ...@@ -78,27 +73,29 @@ function GamePage(props) {
} }
//前端同步接口 //前端同步接口
else if (netName.indexOf("mine") == 0) { else if (netName.indexOf("mine") == 0) {
var data = { success: true } let data = { success: true, type: netName }
switch (netName) { switch (netName) {
case "mine.getAppData"://获取信息 case "mine.getAppData"://获取信息
const { userNick, avatar, openId, newUser, remainTimes, firstLoginToday } = loginInfo
data = { data = {
success: true, success: true,
type: netName,
data: { data: {
activityId: app.activityId,//|| "5e7c40e98564b57d7fb95812", activityId: app.activityId,//|| "5e7c40e98564b57d7fb95812",
nickName: app.nickName, nickName: userNick,
avatar: app.avatar, avatar,
openId: app.openId, openId,
inviteId: this.inviteId,//判断是否要发助力用 inviteId: app.inviteId,//判断是否要发助力用
isFollow: app.isFollow, isFollow: app.isFollow,
needDataInCanvas:app.needDataInCanvas, needDataInCanvas: {},
activityInfo:this.activityInfo, activityInfo: activityInfo,
userInfo:this.userInfo, userInfo: {},
newUser: newUser,
newUser: this.newUser, remainTimes: remainTimes,
remainTimes: this.remainTimes, firstLoginToday: firstLoginToday
firstLoginToday: this.firstLoginToday,
} }
} }
console.warn(data)
break; break;
case "mine.navigateToOutside"://跳转小程序外的页面 case "mine.navigateToOutside"://跳转小程序外的页面
navigateToOutside(parameter.url) navigateToOutside(parameter.url)
...@@ -128,6 +125,9 @@ function GamePage(props) { ...@@ -128,6 +125,9 @@ function GamePage(props) {
setMemberVisible(true) setMemberVisible(true)
break; break;
} }
// commonToast(JSON.stringify(data))
setUpdateFlag(Math.floor(Math.random() * 1000))
setCanvasData(data)
} else { } else {
//获取后端接口 //获取后端接口
const { function: fc } = app.cloud; const { function: fc } = app.cloud;
...@@ -146,16 +146,9 @@ function GamePage(props) { ...@@ -146,16 +146,9 @@ function GamePage(props) {
}) })
} }
} }
const postMessageEvent = () => {
console.log('222222')
}
const onClose = () => { const onClose = () => {
console.warn(1111)
setMemberVisible(false) setMemberVisible(false)
} }
const onAuthSuccess = () => { const onAuthSuccess = () => {
setMemberVisible(false) setMemberVisible(false)
} }
...@@ -164,10 +157,11 @@ function GamePage(props) { ...@@ -164,10 +157,11 @@ function GamePage(props) {
} }
const onTestHandle = () => { const onTestHandle = () => {
setMemberVisible(true) setMemberVisible(true)
// onMessage({mpEvent: { data: { netName: 'mine.getAppData' }}})
} }
return( return(
<View> <View>
{ true && <canvas-comp canvasData={canvasData} onPostMessage={onMessage} updateFlag={updateFlag} />} { canvasVisible && <canvas-comp data={canvasData} onMessage={onMessage} updateFlag={updateFlag} />}
<View className={styles['test-box']} onClick={(e) => onTestHandle(e)}>入会按钮</View> <View className={styles['test-box']} onClick={(e) => onTestHandle(e)}>入会按钮</View>
{memberVisible && <member-modal onClose={onClose} onAuthFail={onAuthFail} onAuthSuccess={onAuthSuccess} />} {memberVisible && <member-modal onClose={onClose} onAuthFail={onAuthFail} onAuthSuccess={onAuthSuccess} />}
</View> </View>
......
import React, { useEffect, useRef, useState } from 'react' import React, { useEffect, useRef, useState } from 'react'
import { View } from '@tarojs/components' import { View } from '@tarojs/components'
import GoodsTitle from '@/components/_tb_comps/GoodsTitle/GoodsTitle' import ContainerFit from '@/components/_base/ContainerFit/ContainerFit'
import GoodsTitle from '@/components/_tb_comps/TitleImg/TitleImg'
import GoodsList from '@/components/_tb_comps/GoodsList/GoodsList' import GoodsList from '@/components/_tb_comps/GoodsList/GoodsList'
import { useDidShow, useRouter, useDidHide } from '@tarojs/taro' import { useDidShow, useRouter, useDidHide } from '@tarojs/taro'
import API from '@/api' import API from '@/api'
import { TASK_CONFIG, BROSE_GOOD_TYPE } from '@/const'
import { commonToast } from 'tbcc-sdk-ts/lib/core/tb' import { commonToast } from 'tbcc-sdk-ts/lib/core/tb'
import styles from './browseGoods.module.less' import styles from './browseGoods.module.less'
import { TASK_CONFIG, BROSE_GOOD_TYPE } from '@/config/task.config'
const browseConfig = { import BROWSE_CONFIG from '@/config/browse.config'
taskType: 'browseGoods',
type: '01',
bg: '//yun.dui88.com/taobaomini/clientCTest/goods_bg@2x.png',
head: {
image: '//yun.duiba.com.cn/taobaomini/clientCTest/goods_title@2x.png',
width: 750,// 头部banner/title 宽度
height: 120,// 头部banner/title 高度
},
image: {
banner: '//yun.duiba.com.cn/taobaomini/clientCTest/goods_banner@2x.png',
title: '//yun.duiba.com.cn/taobaomini/clientCTest/goods_title@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',
img: '//yun.duiba.com.cn/taobaomini/clientCTest/goods_img@2x.png'
},
color: '#181818'
}
function BrowseGoodsPage() { function BrowseGoodsPage() {
const [ startTimer, setStartTimer ] = useState(false) const [ startTimer, setStartTimer ] = useState(false)
...@@ -80,7 +63,7 @@ function BrowseGoodsPage() { ...@@ -80,7 +63,7 @@ function BrowseGoodsPage() {
}) })
// 浏览记录 // 浏览记录
const onCompleteTask = async(itemId) => { const onCompleteTask = async(itemId) => {
const { success } = await API.doCompleteTask({ taskType: browseConfig.taskType, itemId: currentItemId.current }) const { success } = await API.doCompleteTask({ taskType: BROWSE_CONFIG.taskType, itemId: currentItemId.current })
if (success) { if (success) {
getGoodsList() getGoodsList()
commonToast('浏览成功') commonToast('浏览成功')
...@@ -123,18 +106,14 @@ function BrowseGoodsPage() { ...@@ -123,18 +106,14 @@ function BrowseGoodsPage() {
}, 1000) }, 1000)
} }
return ( return (
<View className={styles['page-container']}> <ContainerFit bg={BROWSE_CONFIG.bg}>
<View className={styles['page-psd-container']} style={{ background: `url(${browseConfig.bg}) no-repeat`, backgroundSize: '750rpx 1624rpx' }}>
<View className={styles['page-content']}>
<View className={styles['page-content__title']}> <View className={styles['page-content__title']}>
<GoodsTitle config={browseConfig.head}/> <GoodsTitle config={BROWSE_CONFIG.head}/>
</View> </View>
<View className={styles['page-content__list']}> <View className={styles['page-content__list']}>
<GoodsList goodsList={goodsList} task={browseConfig} onOpenDetail={(itemId,collected) => onOpenDetail(itemId,collected)} /> <GoodsList goodsList={goodsList} task={BROWSE_CONFIG} onOpenDetail={(itemId,collected) => onOpenDetail(itemId,collected)} />
</View>
</View>
</View>
</View> </View>
</ContainerFit>
) )
} }
......
.page-container {
.page-container();
}
.page-psd-container {
.page-container__1624();
}
.page-content {
.page-content();
}
.page-content__title { .page-content__title {
.wh(750px,140px); .wh(750px,208px);
} }
.page-content__list { .page-content__list {
position: absolute; position: absolute;
top: 140px; top: 208px;
left: 0; left: 0;
bottom: 0; bottom: 0;
padding: 41px 25px 0; padding: 41px 25px 0;
......
import React, { useState, useEffect, useRef } from 'react' import React, { useState, useEffect, useRef } from 'react'
import { View } from '@tarojs/components' import { View } from '@tarojs/components'
import GoodsTitle from '@/components/_tb_comps/GoodsTitle/GoodsTitle' import ContainerFit from '@/components/_base/ContainerFit/ContainerFit'
import TitleImg from '@/components/_tb_comps/TitleImg/TitleImg'
import GoodsList from '@/components/_tb_comps/GoodsList/GoodsList' import GoodsList from '@/components/_tb_comps/GoodsList/GoodsList'
import { useRouter } 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'
import { useThrottle } from '@/hooks/useThrottle' import { useThrottle } from '@/hooks/useThrottle'
import styles from './cartGoods.module.less' import styles from './cartGoods.module.less'
import { CART_CONFIG, CART_TYPE } from '@/config/cart.config'
const { commonToast, showSkuModal } = tbccTs.tb const { commonToast, showSkuModal } = tbccTs.tb
const cartConfig = {
taskType: 'cartGoods',
type: '01',
bg: '//yun.dui88.com/taobaomini/clientCTest/goods_bg@2x.png',
head: {
image: '//yun.duiba.com.cn/taobaomini/clientCTest/goods_title@2x.png',
width: 750,// 头部banner/title 宽度
height: 120,// 头部banner/title 高度
},
image: {
banner: '//yun.duiba.com.cn/taobaomini/clientCTest/goods_banner@2x.png',
title: '//yun.duiba.com.cn/taobaomini/clientCTest/goods_title@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',
img: '//yun.duiba.com.cn/taobaomini/clientCTest/goods_img@2x.png'
},
color: '#181818'
}
function CartGoodsPage() { function CartGoodsPage() {
const router = useRouter() const router = useRouter()
const [goodsList, setGoodsList] = useState([]) const [goodsList, setGoodsList] = useState([])
...@@ -47,38 +30,33 @@ function CartGoodsPage() { ...@@ -47,38 +30,33 @@ function CartGoodsPage() {
// 加入购物车 // 对应itemId为 574141925233 skuId为4018047819826 数量为4 // 加入购物车 // 对应itemId为 574141925233 skuId为4018047819826 数量为4
const onCompleteTask = useThrottle(async (itemId, collected) => { const onCompleteTask = useThrottle(async (itemId, collected) => {
console.log(itemId) console.log(itemId)
if (collected) { if (collected && CART_CONFIG.type === CART_TYPE.ONE) {
commonToast('您已加购过该商品了') commonToast('您已加购过该商品了')
return; return;
} }
if(!collectflag.current){ if(collectflag.current && CART_CONFIG.type === CART_TYPE.ONE) {
commonToast('该任务今天已完成,明天再来吧~')
}
const { status, quantity } = await showSkuModal(String(itemId)) const { status, quantity } = await showSkuModal(String(itemId))
if (status == "addCartSuccess") { if (status == "addCartSuccess") {
const { success } = await API.doCompleteTask({ taskType: cartConfig.taskType, itemId, count: quantity }) const { success } = await API.doCompleteTask({ taskType: CART_CONFIG.taskType, itemId, count: quantity })
if (success) { if (success) {
collectflag.current = true collectflag.current = true
getGoodsList() getGoodsList()
commonToast('加购成功') commonToast('加购成功')
} }
} }
} else {
commonToast('该任务今天已完成,明天再来吧~')
}
}, 2000); }, 2000);
return ( return (
<View className={styles['page-container']}> <ContainerFit bg={CART_CONFIG.bg}>
<View className={styles['page-psd-container']} style={{ background: `url(${cartConfig.bg}) no-repeat`, backgroundSize: '750rpx 1624rpx' }}>
<View className={styles['page-content']}>
<View className={styles['page-content__title']}> <View className={styles['page-content__title']}>
<GoodsTitle config={cartConfig.head}/> <TitleImg config={CART_CONFIG.head}/>
</View> </View>
<View className={styles['page-content__list']}> <View className={styles['page-content__list']}>
<GoodsList goodsList={goodsList} task={cartConfig} onOpenDetail={(itemId,collected) => onCompleteTask(itemId,collected)} /> <GoodsList goodsList={goodsList} task={CART_CONFIG} onOpenDetail={(itemId,collected) => onCompleteTask(itemId,collected)} />
</View>
</View>
</View>
</View> </View>
</ContainerFit>
) )
} }
......
.page-container {
.page-container();
}
.page-psd-container {
.page-container__1624();
}
.page-content {
.page-content();
}
.page-content__title { .page-content__title {
.wh(750px,140px); .wh(750px,208px);
} }
.page-content__list { .page-content__list {
position: absolute; position: absolute;
top: 140px; top: 208px;
left: 0; left: 0;
bottom: 0; bottom: 0;
padding: 41px 25px 0; padding: 41px 25px 0;
......
import React, { useState, useEffect, useRef } from 'react' import React, { useState, useEffect, useRef } from 'react'
import { View } from '@tarojs/components' import { View } from '@tarojs/components'
import GoodsTitle from '@/components/_tb_comps/GoodsTitle/GoodsTitle' import ContainerFit from '@/components/_base/ContainerFit/ContainerFit'
import TitleImg from '@/components/_tb_comps/TitleImg/TitleImg'
import GoodsList from '@/components/_tb_comps/GoodsList/GoodsList' import GoodsList from '@/components/_tb_comps/GoodsList/GoodsList'
import { useRouter } 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'
import { useThrottle } from '@/hooks/useThrottle' import { useThrottle } from '@/hooks/useThrottle'
const { commonToast } = tbccTs.tb const { commonToast } = tbccTs.tb
import styles from './collectGoods.module.less' import styles from './collectGoods.module.less'
import COLLECT_CONFIG from '@/config/collect.config'
const collectConfig = {
taskType: 'collectGoods',
type: '01',
bg: '//yun.dui88.com/taobaomini/clientCTest/goods_bg@2x.png',
head: {
image: '//yun.duiba.com.cn/taobaomini/clientCTest/goods_title@2x.png',
width: 750,// 头部banner/title 宽度
height: 120,// 头部banner/title 高度
},
image: {
banner: '//yun.duiba.com.cn/taobaomini/clientCTest/goods_banner@2x.png',
title: '//yun.duiba.com.cn/taobaomini/clientCTest/goods_title@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',
img: '//yun.duiba.com.cn/taobaomini/clientCTest/goods_img@2x.png'
},
color: '#181818'
}
function CollectGoodsPage() { function CollectGoodsPage() {
const router = useRouter() const router = useRouter()
...@@ -77,18 +59,14 @@ function CollectGoodsPage() { ...@@ -77,18 +59,14 @@ function CollectGoodsPage() {
}) })
return ( return (
<View className={styles['page-container']}> <ContainerFit bg={COLLECT_CONFIG.bg}>
<View className={styles['page-psd-container']} style={{ background: `url(${collectConfig.bg}) no-repeat`, backgroundSize: '750rpx 1624rpx' }}>
<View className={styles['page-content']}>
<View className={styles['page-content__title']}> <View className={styles['page-content__title']}>
<GoodsTitle config={collectConfig.head}/> <TitleImg config={COLLECT_CONFIG.head}/>
</View> </View>
<View className={styles['page-content__list']}> <View className={styles['page-content__list']}>
<GoodsList goodsList={goodsList} task={collectConfig} onOpenDetail={(itemId,collected) => onCompleteTask(itemId,collected)} /> <GoodsList goodsList={goodsList} task={COLLECT_CONFIG} onOpenDetail={(itemId,collected) => onCompleteTask(itemId,collected)} />
</View>
</View>
</View>
</View> </View>
</ContainerFit>
) )
} }
......
.page-container {
.page-container();
}
.page-psd-container {
.page-container__1624();
}
.page-content {
.page-content();
}
.page-content__title { .page-content__title {
.wh(750px,140px); .wh(750px,208px);
} }
.page-content__list { .page-content__list {
position: absolute; position: absolute;
top: 140px; top: 208px;
left: 0; left: 0;
bottom: 0; bottom: 0;
padding: 41px 25px 0; padding: 41px 25px 0;
......
import React, { useEffect, useState } from 'react' import React, { useEffect, useState } from 'react'
import { View } from '@tarojs/components' import { View } from '@tarojs/components'
import GoodsTitle from '@/components/_tb_comps/GoodsTitle/GoodsTitle' import ContainerFit from '@/components/_base/ContainerFit/ContainerFit'
import TitleImg from '@/components/_tb_comps/TitleImg/TitleImg'
import GoodsList from '@/components/_tb_comps/GoodsList/GoodsList' import GoodsList from '@/components/_tb_comps/GoodsList/GoodsList'
import { useRequest } from '@/hooks/useRequest' import { useRequest } from '@/hooks/useRequest'
import { useRouter } from '@tarojs/taro' import { useRouter } from '@tarojs/taro'
import API from '@/api' import API from '@/api'
import styles from './orderGoods.module.less' import styles from './orderGoods.module.less'
import ORDER_CONFIG from '@/config/order.config'
const orderConfig = {
taskType: 'orderGoods',
type: '01',
bg: '//yun.dui88.com/taobaomini/clientCTest/goods_bg@2x.png',
head: {
image: '//yun.duiba.com.cn/taobaomini/clientCTest/goods_title@2x.png',
width: 750,// 头部banner/title 宽度
height: 120,// 头部banner/title 高度
},
image: {
banner: '//yun.duiba.com.cn/taobaomini/clientCTest/goods_banner@2x.png',
title: '//yun.duiba.com.cn/taobaomini/clientCTest/goods_title@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',
img: '//yun.duiba.com.cn/taobaomini/clientCTest/goods_img@2x.png'
},
color: '#181818'
}
function OrderGoodsPage() { function OrderGoodsPage() {
const router = useRouter() const router = useRouter()
...@@ -32,18 +15,15 @@ function OrderGoodsPage() { ...@@ -32,18 +15,15 @@ function OrderGoodsPage() {
const { data } = useRequest(API.getItemListByItemIds, { itemIds }) const { data } = useRequest(API.getItemListByItemIds, { itemIds })
return ( return (
<View className={styles['page-container']}> <ContainerFit bg={ORDER_CONFIG.bg}>
<View className={styles['page-psd-container']} style={{ background: `url(${orderConfig.bg}) no-repeat`, backgroundSize: '750rpx 1624rpx' }}>
<View className={styles['page-content']}>
<View className={styles['page-content__title']}> <View className={styles['page-content__title']}>
<GoodsTitle config={orderConfig.head}/> <TitleImg config={ORDER_CONFIG.head}/>
</View> </View>
<View className={styles['page-content__list']}> <View className={styles['page-content__list']}>
<GoodsList goodsList={data?.list || []} task={orderConfig} onOpenDetail={(itemId,isBrowsed) => onOpenDetail(itemId,isBrowsed)} /> <GoodsList goodsList={data?.list || []} task={ORDER_CONFIG} onOpenDetail={(itemId,isBrowsed) => onOpenDetail(itemId,isBrowsed)} />
</View>
</View>
</View>
</View> </View>
</ContainerFit>
) )
} }
......
.page-container {
.page-container();
}
.page-psd-container {
.page-container__1624();
}
.page-content {
.page-content();
}
.page-content__title { .page-content__title {
.wh(750px,140px); .wh(750px,208px);
} }
.page-content__list { .page-content__list {
position: absolute; position: absolute;
top: 140px; top: 208px;
left: 0; left: 0;
bottom: 0; bottom: 0;
padding: 41px 25px 0; padding: 41px 25px 0;
......
import React, { useState, useEffect } from 'react' import React, { useState, useEffect } from 'react'
import { Image, ScrollView, View } from '@tarojs/components' import { Image, ScrollView, View } from '@tarojs/components'
import API from '@/api' import API from '@/api'
import { DRAW_STATUS, PRIZE_TYPE, BENEFIT_TYPE } from '@/const'
import DeliveryModal from '@/components/_tb_modal/DeliveryModal/DeliveryModal' import DeliveryModal from '@/components/_tb_modal/DeliveryModal/DeliveryModal'
import ContainerFit from '@/components/_base/ContainerFit/ContainerFit'
import TitleImg from '@/components/_tb_comps/TitleImg/TitleImg'
import tbccTs from 'tbcc-sdk-ts' import tbccTs from 'tbcc-sdk-ts'
import { useThrottle } from '@/hooks/useThrottle' import { useThrottle } from '@/hooks/useThrottle'
import { checkIsMember } from 'tbcc-sdk-ts/lib/utils' import { checkIsMember } from 'tbcc-sdk-ts/lib/utils'
...@@ -10,44 +11,15 @@ import { dateFormatter } from '@/utils/date' ...@@ -10,44 +11,15 @@ import { dateFormatter } from '@/utils/date'
import styles from './myPrize.module.less' import styles from './myPrize.module.less'
import { getApp } from '@tarojs/taro' import { getApp } from '@tarojs/taro'
import { receiveEnamePrize, receiveObjectPrize, receiveMemberEname } from '@/utils/util' import { receiveEnamePrize, receiveObjectPrize, receiveMemberEname } from '@/utils/util'
import config from '@/config/index' import config from '@/config/config'
import { PRIZE_CONFIG, DRAW_STATUS, PRIZE_TYPE, BENEFIT_TYPE } from '@/config/myPrize.config'
const { objectStatus: _objectStatus, enameStatus: _enameStatus, orderStatus, commonStatus } = PRIZE_CONFIG
const objectStatus = { ..._objectStatus, ...commonStatus }
const enameStatus = { ..._enameStatus, ...commonStatus }
const { commonToast, getUserAddress, navigateToOutside, setClipboard } = tbccTs.tb const { commonToast, navigateToOutside, setClipboard } = tbccTs.tb
const { getMyPrizeList } = API const { getMyPrizeList } = API
// 我的奖品配置项
const prizeConfig = {
bg: '//yun.duiba.com.cn/aurora/assets/e13fab3165d3a6bb4cbe8827e8f0fd41084b0091.png', // 背景图
title: '//yun.dui88.com/duiba-components-c-myprizeprize_title.png', // 标题
copyIcon: '//yun.dui88.com/duiba-components-c-myprizemyprize_copy_code.png', // 复制
receiveBtn: '//yun.duiba.com.cn/bestoreBox/prize_received.png', // 已领取 权益类奖品未配置 uesUrl使用
objectStatus: {
1: '//yun.dui88.com/duiba-components-c-myprizeto_address.png', // 填写地址(实物奖品)
3: '//yun.dui88.com/duiba-components-c-myprizelogistics.png', // 查看物流
6: '//yun.dui88.com/duiba-components-c-myprizeget_again.png', // 重新领取
5: '//yun.duiba.com.cn/spark/assets/914ba8643c8abb8d710a3126ec312aecf6c4daf0.png', // 已失效
4: '//yun.duiba.com.cn/spark/assets/8267375232058a6d0140270b1594427fb08d6ae3.png' // 领取失败
},
enameStatus: {
1: '//yun.dui88.com/duiba-components-c-myprizeget_now.png', // 立即领取(除实物奖品外)
3: '//yun.duiba.com.cn/bestoreBox/prize_received.png', // 去使用(除实物奖品外)
6: '//yun.dui88.com/duiba-components-c-myprizeget_again.png', // 重新领取
5: '//yun.duiba.com.cn/spark/assets/914ba8643c8abb8d710a3126ec312aecf6c4daf0.png', // 已失效
4: '//yun.duiba.com.cn/spark/assets/8267375232058a6d0140270b1594427fb08d6ae3.png' // 领取失败
},
logisticsImage: {
shipped: '//yun.dui88.com/duiba-components-c-myprizeprize_shipped.png', // 已发货物理弹窗
notShipped: '//yun.dui88.com/duiba-components-c-myprizenotshipped.png' // 待发货物流弹窗
},
btnStyle: {
width: '150rpx'
},
contentTop: '140rpx',
blankTxt: '暂无奖品',
hasLogistic: false, // 是否展示物流信息
isShowPirzeId: false // 是否显示奖品编号
}
function Empty(blankTxt) { function Empty(blankTxt) {
return <View className={styles['my-prize-item__empty']}>{blankTxt}</View> return <View className={styles['my-prize-item__empty']}>{blankTxt}</View>
} }
...@@ -77,13 +49,13 @@ function MyPrizeList() { ...@@ -77,13 +49,13 @@ function MyPrizeList() {
await setClipboard(text) await setClipboard(text)
commonToast('复制成功') commonToast('复制成功')
} }
// 新领取方式 // 领取奖品
const handleClick = useThrottle(async (item) => { const handleClick = useThrottle(async (item) => {
const { activityId } = app const { activityId } = app
const { type, drawStatus, useUrl = '', id, _id, ename = '', benefitType } = item const { type, drawStatus, useUrl = '', id, _id, ename = '', benefitType } = item
// 领取前验证 // 领取前验证
if (drawStatus === DRAW_STATUS.SUCCESS) { if (drawStatus === DRAW_STATUS.SUCCESS) {
if (type === PRIZE_TYPE.OBJECT && prizeConfig.hasLogistic) { if (type === PRIZE_TYPE.OBJECT && PRIZE_CONFIG.hasLogistic) {
setCurrentPrize(item) setCurrentPrize(item)
setDeliveryModalVisible(true) setDeliveryModalVisible(true)
return return
...@@ -106,22 +78,23 @@ function MyPrizeList() { ...@@ -106,22 +78,23 @@ function MyPrizeList() {
} }
} }
const receiveFn = { const receiveFn = {
'update': async () => fetchMyPriceList(),
[PRIZE_TYPE.ENAME]: async () => { [PRIZE_TYPE.ENAME]: async () => {
if(benefitType === BENEFIT_TYPE.MEMBER) { if(benefitType === BENEFIT_TYPE.MEMBER) {
return await receiveMemberEname({params: { sellerId: config.sellerId, ename, id }, successMsg }) await receiveMemberEname({params: { sellerId: config.sellerId, ename, id }, successMsg })
}else { }else {
return await receiveEnamePrize({params: { activityId, id }, successMsg }) await receiveEnamePrize({params: { activityId, id }, successMsg })
} }
}, },
[PRIZE_TYPE.OBJECT]: async () => { [PRIZE_TYPE.OBJECT]: async () => {
return await receiveObjectPrize({params: { activityId, id }, successMsg }) await receiveObjectPrize({params: { activityId, id }, successMsg })
}, },
[PRIZE_TYPE.CREDITS]: async () => { [PRIZE_TYPE.CREDITS]: async () => {
return await receiveEnamePrize({params: { activityId, id }, successMsg }) await receiveEnamePrize({params: { activityId, id }, successMsg })
} }
} }
const result = await receiveFn[type]() await receiveFn[type]()
result && fetchMyPriceList() receiveFn['update']()
},2000) },2000)
// 入会插件 // 入会插件
const onClose = () => { const onClose = () => {
...@@ -135,12 +108,12 @@ function MyPrizeList() { ...@@ -135,12 +108,12 @@ function MyPrizeList() {
} }
return ( return (
<View className={styles['page-container']}> <>
<View className={styles['my-prize-container']} style={{ background: `url(${prizeConfig.bg}) no-repeat center top/cover` }}> <ContainerFit bg={PRIZE_CONFIG.bg}>
<View className={styles['page-content']}> <View className={styles['my-prize-label']}>
<View className={styles['my-prize-label']} style={{ background: `url(${prizeConfig.title}) no-repeat`, backgroundSize: '100% 100%' }} /> <TitleImg config={PRIZE_CONFIG.head}></TitleImg>
</View>
<View className={styles['my-prize-content']} style={{ top: prizeConfig.contentTop }}> <View className={styles['my-prize-content']} style={{ top: PRIZE_CONFIG.contentTop }}>
<ScrollView scrollY className={styles['my-prize-content__scroll']}> <ScrollView scrollY className={styles['my-prize-content__scroll']}>
{myPrizeList.length > 0 && {myPrizeList.length > 0 &&
<View className={styles['my-prize-list']}> <View className={styles['my-prize-list']}>
...@@ -152,11 +125,11 @@ function MyPrizeList() { ...@@ -152,11 +125,11 @@ function MyPrizeList() {
<View className={styles['my-prize-item__content']}> <View className={styles['my-prize-item__content']}>
<View className={styles['my-prize-item__name']}>{item.name}</View> <View className={styles['my-prize-item__name']}>{item.name}</View>
{ {
prizeConfig.isShowPirzeId && PRIZE_CONFIG.isShowPirzeId &&
<View className={styles['my-prize-item__subtitle']}> <View className={styles['my-prize-item__subtitle']}>
<View className={styles['my-prize-item__code']}>奖品编码:{item.id || item._id}</View> <View className={styles['my-prize-item__code']}>奖品编码:{item.id || item._id}</View>
{/* <!-- 复制按钮 --> */} {/* <!-- 复制按钮 --> */}
<Image className={styles['my-prize-item__copy']} onTap={() => handleCopyId(item.id || item._id)} src={prizeConfig.copyIcon} /> <Image className={styles['my-prize-item__copy']} onTap={() => handleCopyId(item.id || item._id)} src={PRIZE_CONFIG.copyIcon} />
</View> </View>
} }
{item.drawStatus === DRAW_STATUS.FAIL && <View className={styles['my-prize-item__tip']}>{item.remark}</View>} {item.drawStatus === DRAW_STATUS.FAIL && <View className={styles['my-prize-item__tip']}>{item.remark}</View>}
...@@ -165,29 +138,24 @@ function MyPrizeList() { ...@@ -165,29 +138,24 @@ function MyPrizeList() {
</View> </View>
<View className={styles['prize-item__status']} style={prizeConfig.btnStyle}> <View className={styles['prize-item__status']} style={PRIZE_CONFIG.btnStyle}>
{item.type === PRIZE_TYPE.OBJECT {item.type === PRIZE_TYPE.OBJECT
? <Image onTap={() => handleClick(item)} src={objectStatus[item.drawStatus]} mode='widthFix' />
? <Image onTap={() => handleClick(item)} src={prizeConfig.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={(item.drawStatus === 3 && !item.useUrl) ? prizeConfig.receiveBtn : prizeConfig.enameStatus[item.drawStatus]} mode='widthFix' />}
</View> </View>
</View> </View>
) )
})} })}
</View>} </View>}
{ {
myPrizeList.length === 0 && Empty(prizeConfig.blankTxt) myPrizeList.length === 0 && Empty(PRIZE_CONFIG.blankTxt)
} }
</ScrollView> </ScrollView>
</View> </View>
</View> </ContainerFit>
</View> {deliveryModalVisible && <DeliveryModal prizeItem={currentPrize} task={PRIZE_CONFIG.logisticsImage} onClose={() => setDeliveryModalVisible(false)} />}
{deliveryModalVisible && <DeliveryModal prizeItem={currentPrize} task={prizeConfig.logisticsImage} onClose={() => setDeliveryModalVisible(false)} />}
{memberVisible && <member-modal onClose={onClose} onAuthFail={onAuthFail} onAuthSuccess={onAuthSuccess} />} {memberVisible && <member-modal onClose={onClose} onAuthFail={onAuthFail} onAuthSuccess={onAuthSuccess} />}
</View> </>
) )
} }
export default MyPrizeList export default MyPrizeList
\ No newline at end of file
.page-container { .my-prize-label {
.page-container(); width: 100%;
} height: 208px;
.my-prize-container {
.page-container__1624();
}
.page-content {
.page-content();
}
.my-prize-container .my-prize-label {
width: 208px;
height: 36px;
margin: 70px auto 40px;
background: url("//yun.duiba.com.cn/duiba-components-c-myprizeprize_title.png")
no-repeat;
background-size: 100% 100%;
} }
.my-prize-content { .my-prize-content {
position: absolute; position: absolute;
left: 0; left: 0;
...@@ -29,19 +14,16 @@ ...@@ -29,19 +14,16 @@
height: 100%; height: 100%;
padding-top: 30px; padding-top: 30px;
} }
.my-prize-list {
.my-prize-container .my-prize-list {
width: 100%; width: 100%;
height: auto; height: auto;
} }
.my-prize-item__empty {
.my-prize-container .my-prize-item__empty {
text-align: center; text-align: center;
color: #fff; color: #fff;
margin-top: 30px; margin-top: 30px;
} }
.my-prize-item {
.my-prize-list .my-prize-item {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
...@@ -56,13 +38,11 @@ ...@@ -56,13 +38,11 @@
border-radius: 10px; border-radius: 10px;
box-sizing: border-box; box-sizing: border-box;
} }
.my-prize-item__avatar {
.my-prize-list .my-prize-item .my-prize-item__avatar {
width: 120px; width: 120px;
height: 120px; height: 120px;
} }
.my-prize-item__content {
.my-prize-list .my-prize-item .my-prize-item__content {
flex: 1; flex: 1;
min-width: 0; min-width: 0;
padding: 0 20px; padding: 0 20px;
...@@ -72,28 +52,23 @@ ...@@ -72,28 +52,23 @@
align-items: flex-start; align-items: flex-start;
justify-content: center; justify-content: center;
} }
.my-prize-item__subtitle {
.my-prize-list .my-prize-item .my-prize-item__subtitle {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }
.my-prize-item__copy {
.my-prize-list .my-prize-item .my-prize-item__copy {
width: 20px; width: 20px;
height: 20px; height: 20px;
margin-left: 18px; margin-left: 18px;
} }
.prize-item__status {
.my-prize-list .my-prize-item .prize-item__status {
width: 150px; width: 150px;
} }
.prize-item__status > image { .prize-item__status > image {
width: 100%; width: 100%;
} }
.my-prize-item__name {
.my-prize-list .my-prize-item .my-prize-item__name {
width: 100%; width: 100%;
font-size: 28px; font-size: 28px;
color: #2d2d2d; color: #2d2d2d;
...@@ -102,16 +77,14 @@ ...@@ -102,16 +77,14 @@
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
} }
.my-prize-item__tip {
.my-prize-list .my-prize-item .my-prize-item__tip {
margin-top: 8px; margin-top: 8px;
font-size: 20px; font-size: 20px;
line-height: 20px; line-height: 20px;
letter-spacing: 0; letter-spacing: 0;
color: #8a8a8a; color: #8a8a8a;
} }
.my-prize-item__code {
.my-prize-list .my-prize-item .my-prize-item__code {
width: 290px; width: 290px;
font-family: PingFangSC-Regular; font-family: PingFangSC-Regular;
font-size: 20px; font-size: 20px;
......
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