Commit ba0dc3df authored by 汪欢's avatar 汪欢

share

parent 4bfca2ee
...@@ -6,8 +6,8 @@ cloud.init({ ...@@ -6,8 +6,8 @@ cloud.init({
}); });
App({ App({
// requestType: 'cloud', // yapi,cloud: 云函数 requestType: 'cloud', // yapi,cloud: 云函数
requestType: 'yapi', // yapi,cloud: 云函数 // requestType: 'yapi', // yapi,cloud: 云函数
cloudName: 'floor', // 主云函数项目名 base clientTemplate2C cloudName: 'floor', // 主云函数项目名 base clientTemplate2C
cloud, cloud,
tbcc, tbcc,
...@@ -27,4 +27,5 @@ App({ ...@@ -27,4 +27,5 @@ App({
// this.activityId = activityId || '5f505873738989c8b356e284'; // this.activityId = activityId || '5f505873738989c8b356e284';
this.activityId = activityId || '5f5759b2114fbb8f6d91245c';//商家创建的测试环境活 this.activityId = activityId || '5f5759b2114fbb8f6d91245c';//商家创建的测试环境活
} }
}); });
<view class="gong_xi_huo_jiang"> <view class="gong_xi_huo_jiang">
<image class="cha_cha000" src={{resList['b8bc26de-51ac-457f-bd3f-348e7df0af34'].url}} /> <image class="cha_cha000" onTap="handleClose" src={{resList['b8bc26de-51ac-457f-bd3f-348e7df0af34'].url}} />
<image class="zu139394" src={{resList['b0315ae3-2e86-4260-ae04-8e2cb2c70b99'].url}} /> <image class="zu139394" src={{resList['b0315ae3-2e86-4260-ae04-8e2cb2c70b99'].url}} />
<image class="zu8" src={{resList['44e9bb99-836b-4612-afd1-c2eb400d0eca'].url}} /> <image class="zu8" src={{resList['44e9bb99-836b-4612-afd1-c2eb400d0eca'].url}} />
<label class="mai_dao_zhong_jiang_lou_ceng_huo_de_yi_xia_jiang_pin">买到中奖楼层 获得以下奖品</label> <label class="mai_dao_zhong_jiang_lou_ceng_huo_de_yi_xia_jiang_pin">买到中奖楼层 获得以下奖品</label>
<label class="ke_yi_zai_wo_de_jiang_pin_ye_mian_cha_kan_jiang_pin">可以在「我的奖品」页面查看奖品</label> <label class="ke_yi_zai_wo_de_jiang_pin_ye_mian_cha_kan_jiang_pin">可以在「我的奖品」页面查看奖品</label>
<image class="ju_xing88726" src={{resList['d9283186-3e0a-4875-bd28-e296e22d1139'].url}} /> <image class="ju_xing88726" src={{resList['d9283186-3e0a-4875-bd28-e296e22d1139'].url}} />
<image class="an_niu_kao_bei3" src={{resList['38aa87d7-c85e-497c-85a2-f5a980bc742f'].url}} /> <image class="ju_xing88726" src={{myPrize.image}} />
<image class="an_niu_kao_bei3" onTap="gotoPrizePage" src={{resList['38aa87d7-c85e-497c-85a2-f5a980bc742f'].url}} />
</view> </view>
\ No newline at end of file
...@@ -6,12 +6,32 @@ Component({ ...@@ -6,12 +6,32 @@ Component({
data: { data: {
resList: resList resList: resList
}, },
methods: {}, methods: {
handleClose() {
const { onPrizeModalClose } = this.props;
onPrizeModalClose && onPrizeModalClose();
},
gotoPrizePage() {
my.navigateTo({
url: '/pages/myprize/myprize',
success: () => {
},
fail: () => {
},
complete: () => {
}
});
}
},
onInit(props) { onInit(props) {
// this.setData({ // this.setData({
// resList: resList // resList: resList
// }); // });
} },
}); });
\ No newline at end of file
<view class="hen_yi_han23"> <view class="hen_yi_han23">
<image class="cha_cha0" onTap="" src={{resList['b8bc26de-51ac-457f-bd3f-348e7df0af34'].url}} /> <image class="cha_cha0" onTap="handleNoprizeClose" src={{resList['b8bc26de-51ac-457f-bd3f-348e7df0af34'].url}} />
<image class="zu142" src={{resList['d473d55e-e93b-4473-ae6f-065e3ba2e853'].url}} /> <image class="zu142" src={{resList['d473d55e-e93b-4473-ae6f-065e3ba2e853'].url}} />
<image class="zu9" src={{resList['519cfe3c-5920-4f09-906e-53c44890ead3'].url}} /> <image class="zu9" src={{resList['519cfe3c-5920-4f09-906e-53c44890ead3'].url}} />
<image class="ju_xing88724" src={{resList['7ec9f5ea-9e4e-4ba9-bd1d-4ad6a7e03a4e'].url}} /> <image class="ju_xing88724" src={{resList['7ec9f5ea-9e4e-4ba9-bd1d-4ad6a7e03a4e'].url}} />
<image class="wei_man100_ceng" src={{resList['ef34aaa7-7fd4-4d52-9ddc-c78432a86938'].url}} /> <!-- 未满100层 -->
<image class="xia_ci_zai_lai" src={{resList['90ff7278-1912-4d62-a34d-1b84cb99bcee'].url}} /> <view a:if="{{openPrizeStatus==OPEN_PRIZE_STATUS.NOT_OPEN}}">
<image class="wei_mai_dao_tu_ceng" src={{resList['79ecfd4f-f4dd-47cd-9f04-fac24d652c94'].url}} /> <image class="wei_man100_ceng" src={{resList['ef34aaa7-7fd4-4d52-9ddc-c78432a86938'].url}} />
<view class="zu77127"> <image class="xia_ci_zai_lai" src={{resList['90ff7278-1912-4d62-a34d-1b84cb99bcee'].url}} />
<image class="ca_jian_er_guo" src={{resList['bbeaaf95-4954-46ad-b1aa-e8ae55c9e2b1'].url}} /> </view>
</view> <!-- 未中奖 -->
<image class="an_niu30" src={{resList['92e51b4c-be5e-4459-8379-6a2bc1f2a3b2'].url}} /> <view a:if="{{openPrizeStatus!=OPEN_PRIZE_STATUS.NOT_OPEN}}">
<text a:if="{{openPrizeStatus==OPEN_PRIZE_STATUS.NOT_OPEN}}">不开奖</text> <image class="wei_mai_dao_tu_ceng" src={{resList['79ecfd4f-f4dd-47cd-9f04-fac24d652c94'].url}} />
<text a:if="{{openPrizeStatus!=OPEN_PRIZE_STATUS.NOT_OPEN}}">未中奖</text> <view class="zu77127">
</view> <image class="ca_jian_er_guo" src={{resList['bbeaaf95-4954-46ad-b1aa-e8ae55c9e2b1'].url}} />
\ No newline at end of file </view>
</view>
<image class="an_niu30" onTap="handleNoprizeClose" src={{resList['92e51b4c-be5e-4459-8379-6a2bc1f2a3b2'].url}} />
<!--<text a:if="{{openPrizeStatus==OPEN_PRIZE_STATUS.NOT_OPEN}}">不开奖</text><text a:if="{{openPrizeStatus!=OPEN_PRIZE_STATUS.NOT_OPEN}}">未中奖</text> -->
</view>
\ No newline at end of file
...@@ -7,7 +7,12 @@ Component({ ...@@ -7,7 +7,12 @@ Component({
resList: resList, resList: resList,
OPEN_PRIZE_STATUS:OPEN_PRIZE_STATUS OPEN_PRIZE_STATUS:OPEN_PRIZE_STATUS
}, },
methods: {}, methods: {
handleNoprizeClose(){
let {onHandleNoPrizeClose} = this.props;
onHandleNoPrizeClose && onHandleNoPrizeClose();
}
},
didMount(props) { didMount(props) {
......
...@@ -5,6 +5,8 @@ import resList from '../../resconfig/resList'; ...@@ -5,6 +5,8 @@ import resList from '../../resconfig/resList';
import API from '../../api'; import API from '../../api';
const { commonToast, getAuthUserInfo, navigateToOutside } = tbcc.tb; const { commonToast, getAuthUserInfo, navigateToOutside } = tbcc.tb;
Page({ Page({
data: { data: {
title: '', title: '',
...@@ -38,8 +40,11 @@ Page({ ...@@ -38,8 +40,11 @@ Page({
my.redirectTo({ url: '/pages/pageshou_ye/pageshou_ye' }); my.redirectTo({ url: '/pages/pageshou_ye/pageshou_ye' });
} }
}, },
onReady() { async onReady() {
// 页面加载完成 // 页面加载完成
//取图片链接
const result1 = await getApp().cloud.file.getTempFileURL({ fileId: 'cloud://2291129AC27E68610B8DFDA7F139E34A//D2B4599F-878D-402A-8101-5465AE571FB9.png' });
if (result1[0]) SHARE_CONFIG.imageUrl = result1[0].url
}, },
onShow() { onShow() {
// 页面显示 // 页面显示
...@@ -172,6 +177,8 @@ Page({ ...@@ -172,6 +177,8 @@ Page({
// imageUrl: '', // 分享图片URL // imageUrl: '', // 分享图片URL
// path: 'pages/index/index' // path: 'pages/index/index'
// }; // };
// my.alert({content:JSON.stringify(SHARE_CONFIG)})
// console.log(SHARE_CONFIG)
return SHARE_CONFIG; return SHARE_CONFIG;
}, },
}); });
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
import resList from '../../resconfig/resList'; import resList from '../../resconfig/resList';
import API from '../../api'; import API from '../../api';
import { SHARE_CONFIG } from '/tbcc-sdk/lib/constants';
const app = getApp(); const app = getApp();
const { tbcc } = app; const { tbcc } = app;
const { commonToast, getAuthUserInfo, navigateToOutside } = tbcc.tb; const { commonToast, getAuthUserInfo, navigateToOutside } = tbcc.tb;
...@@ -43,6 +44,7 @@ Page({ ...@@ -43,6 +44,7 @@ Page({
totalFloor: '', totalFloor: '',
// 单人最多购买楼层 // 单人最多购买楼层
eachBuyMostFloor: '', eachBuyMostFloor: '',
userTotalFloor:'',
countDown: '', countDown: '',
ruleModalVisible: false, ruleModalVisible: false,
...@@ -58,7 +60,7 @@ Page({ ...@@ -58,7 +60,7 @@ Page({
// }); // });
this.getBaseInfo(); this.getBaseInfo();
this.getRuleSource(); // this.getRuleSource();
this.getUserCredits(); this.getUserCredits();
this.getOrderList(); this.getOrderList();
...@@ -129,7 +131,7 @@ Page({ ...@@ -129,7 +131,7 @@ Page({
async buyFloors() { async buyFloors() {
// 购买楼层数 // 购买楼层数
let { canBuyFloor, end } = this.data; let { canBuyFloor, end, userTotalFloor,eachBuyMostFloor } = this.data;
let { data: { isVip, grade, gradeName, gradeCredits } } = await API.getVipInfo() || {}; let { data: { isVip, grade, gradeName, gradeCredits } } = await API.getVipInfo() || {};
// 判断会员等级 // 判断会员等级
...@@ -141,6 +143,29 @@ Page({ ...@@ -141,6 +143,29 @@ Page({
gradeName gradeName
} }
}) })
// 判断活动时间
let currentTime = new Date().getTime();
// 当前时间 < 结束时间 显示弹窗
let reduced = eachBuyMostFloor - userTotalFloor;
if (currentTime < end) {
if(reduced <= 0){
commonToast('已购买的楼层达到最大值');
}
if(canBuyFloor <= reduced){
// 可以买
// 显示
this.setData({
orderNowModalVisible: true
})
} else{
commonToast('当前最多可购买'+ reduced +'层');
}
} else {
commonToast('无法购买')
}
// if(success){ // if(success){
// this.setData({ // this.setData({
// vipCredits:{ // vipCredits:{
...@@ -163,17 +188,6 @@ Page({ ...@@ -163,17 +188,6 @@ Page({
// }) // })
// }) // })
// 判断活动时间
let currentTime = new Date().getTime();
// 当前时间 < 结束时间 显示弹窗
if (currentTime < end) {
// 显示
this.setData({
orderNowModalVisible: true
})
} else {
commonToast('无法购买')
}
}, },
...@@ -229,6 +243,8 @@ Page({ ...@@ -229,6 +243,8 @@ Page({
let end = data.endTime; let end = data.endTime;
let start = data.startTime; let start = data.startTime;
let eachBuyMostFloor = data.eachBuyMostFloor; let eachBuyMostFloor = data.eachBuyMostFloor;
let ruleData = data.rule;
let userTotalFloor = data.userTotalFloor;
for (let i = 0; i < list.length; i++) { for (let i = 0; i < list.length; i++) {
let listStyle = { let listStyle = {
...@@ -247,7 +263,9 @@ Page({ ...@@ -247,7 +263,9 @@ Page({
start: start, start: start,
end: end, end: end,
totalFloor, totalFloor,
eachBuyMostFloor eachBuyMostFloor,
ruleData,
userTotalFloor
}) })
console.log('zhixingcount'); console.log('zhixingcount');
this.countDowning(end); this.countDowning(end);
...@@ -413,16 +431,28 @@ Page({ ...@@ -413,16 +431,28 @@ Page({
}, },
// 获取规则接口 // 获取规则接口
async getRuleSource() { // async getRuleSource() {
API.getActivityBaseInfoById().then((res) => { // API.getActivityBaseInfoById().then((res) => {
if (res.success) { // if (res.success) {
this.setData({ // this.setData({
ruleData: res.data.rule // ruleData: res.data.rule
}) // })
} // }
}) // })
} // }
onShareAppMessage() {
// 返回自定义分享信息
// export const SHARE_CONFIG = {
// title: '分享测试标题',
// desc: '分享测试描述',
// imageUrl: '', // 分享图片URL
// path: 'pages/index/index'
// };
// my.alert({content:JSON.stringify(SHARE_CONFIG)})
// console.log(SHARE_CONFIG)
return SHARE_CONFIG;
},
}); });
\ No newline at end of file
...@@ -19,37 +19,6 @@ ...@@ -19,37 +19,6 @@
<view class="zhong_jiang_zhuang_tai"> <view class="zhong_jiang_zhuang_tai">
<!-- 已中奖名单列表 --> <!-- 已中奖名单列表 -->
<view class="yi_zhong_jiang"> <view class="yi_zhong_jiang">
<!-- <label class="dixxx_ceng68">第XXX层</label>
<label class="dixxx_ceng67">第XXX层</label>
<label class="dixxx_ceng66">第XXX层</label>
<label class="ba_la65">巴***拉</label>
<label class="ba_la64">巴***拉</label>
<label class="ba_la63">巴***拉</label>
<image class="ju_xing728_kao_bei2" src={{resList['05f105eb-e5c5-4f5e-8d6a-fbc0ad0718c4'].url}} />
<image class="ju_xing728_kao_bei" src={{resList['05f105eb-e5c5-4f5e-8d6a-fbc0ad0718c4'].url}} />
<image class="ju_xing728_kao_bei3" src={{resList['05f105eb-e5c5-4f5e-8d6a-fbc0ad0718c4'].url}} />
<label class="tu_ceng62">?</label>
<label class="tu_ceng61">?</label>
<label class="tu_ceng60">?</label>
<image class="jiang_pin59" src={{resList['1a79bcc9-300c-4f4f-b2dd-fc93fd050188'].url}} />
<label class="dixxx_ceng58">第XXX层</label>
<label class="ba_la57">巴***拉</label>
<image class="ju_xing728_kao_bei4" src={{resList['05f105eb-e5c5-4f5e-8d6a-fbc0ad0718c4'].url}} />
<label class="kao_bei">?</label>
<label class="dixxx_ceng_kao_bei">第XXX层</label>
<label class="ba_la_kao_bei">巴***拉</label>
<image class="ju_xing728_kao_bei5" src={{resList['05f105eb-e5c5-4f5e-8d6a-fbc0ad0718c4'].url}} />
<label class="kao_bei2">?</label>
<label class="dixxx_ceng_kao_bei2">第XXX层</label>
<label class="ba_la_kao_bei2">巴***拉</label>
<image class="ju_xing728_kao_bei6" src={{resList['05f105eb-e5c5-4f5e-8d6a-fbc0ad0718c4'].url}} />
<label class="kao_bei3">?</label>
<label class="dixxx_ceng_kao_bei3">第XXX层</label>
<label class="ba_la_kao_bei3">巴***拉</label>
<image class="ju_xing728_kao_bei7" src={{resList['05f105eb-e5c5-4f5e-8d6a-fbc0ad0718c4'].url}} />
<label class="kao_bei4">?</label>
<label class="dixxx_ceng_kao_bei4">第XXX层</label>
<label class="ba_la_kao_bei4">巴***拉</label> -->
<!-- 有中奖用户 --> <!-- 有中奖用户 -->
<view style="position:absolute" a:if="{{prizeMenu != null}}" a:for="{{prizeMenu}}" a:key="idx" a:for-item="prizeItem" > <view style="position:absolute" a:if="{{prizeMenu != null}}" a:for="{{prizeMenu}}" a:key="idx" a:for-item="prizeItem" >
...@@ -60,7 +29,7 @@ ...@@ -60,7 +29,7 @@
</view> </view>
</view> </view>
<view class="no_prize">无中奖名单</view> <!-- <view class="no_prize" a:else>无中奖名单</view> -->
</view> </view>
<!-- <view class="wei_zhong_jiang"> <!-- <view class="wei_zhong_jiang">
...@@ -100,7 +69,7 @@ ...@@ -100,7 +69,7 @@
</view> </view>
</view> </view>
</view> </view>
<prize-modal a:if="{{prizeVisible}}" ></prize-modal> <prize-modal a:if="{{prizeVisible}}" onPrizeModalClose="onPrizeModalClose" myPrize="{{myPrize}}" ></prize-modal>
<noprize-modal a:if="{{noprizeVisible}}" openPrizeStatus="{{openPrizeStatus}}" ></noprize-modal> <noprize-modal a:if="{{noprizeVisible}}" openPrizeStatus="{{openPrizeStatus}}" onHandleNoPrizeClose="onHandleNoPrizeClose" myPrize="{{myPrize}}" ></noprize-modal>
<rule-modal a:if="{{ruleModalVisible}}" onModalClose="ruleModalClose"><text>{{ruleData}}</text></rule-modal> <rule-modal a:if="{{ruleModalVisible}}" onModalClose="ruleModalClose"><text>{{ruleData}}</text></rule-modal>
\ No newline at end of file
...@@ -17,20 +17,30 @@ Page({ ...@@ -17,20 +17,30 @@ Page({
ruleModalVisible: false, ruleModalVisible: false,
// myPrizeBtnVisible: false, // myPrizeBtnVisible: false,
ruleData:'' ruleData:'',
myPrize:''
}, },
onLoad(props) { onLoad(props) {
console.log('fuck', JSON.parse(props.data)); console.log('fuck', JSON.parse(props.data));
const { prize, openPrizeStatus, isShowPrize } = JSON.parse(props.data); const { prize, openPrizeStatus, isShowPrize } = JSON.parse(props.data);
// isShowPrize只展示一次
if (isShowPrize) { if (isShowPrize) {
// 有奖品
if (prize) { if (prize) {
this.setData({ prizeVisible: true }) this.setData({
prizeVisible: true,
myPrize:prize
})
} else { } else {
// 没有奖品 未中奖 楼层不足100层
this.setData({ this.setData({
noprizeVisible: true, noprizeVisible: true,
openPrizeStatus: openPrizeStatus openPrizeStatus: openPrizeStatus,
myPrize:prize
}) })
} }
} }
...@@ -75,46 +85,54 @@ Page({ ...@@ -75,46 +85,54 @@ Page({
let { data } = await API.getBuyFloorList() || {}; let { data } = await API.getBuyFloorList() || {};
console.log('buy', data); console.log('buy', data);
// 购买时间 // 购买时间
if (data.length !== 0) {
for (let item of data) {
let createTime = item.createTime;
console.log(createTime, 'create')
for (let item of data) { // let formatCreateTime = new Date(parseInt(createTime)).toLocaleDateString();
let createTime = item.createTime; let month = new Date(parseInt(createTime)).getMonth() + 1;
console.log(createTime, 'create') let date = new Date(parseInt(createTime)).getDate();
item.monthDate = month + '月' + date + '日';
// let formatCreateTime = new Date(parseInt(createTime)).toLocaleDateString(); console.log(item.monthDate, 'time')
let month = new Date(parseInt(createTime)).getMonth() + 1; }
let date = new Date(parseInt(createTime)).getDate();
item.monthDate = month + '月' + date + '日';
console.log(item.monthDate, 'time')
}
let lens = data.length; let lens = data.length;
for (let i = 0; i < lens; i++) { for (let i = lens -1; i >= 0; i--) {
let orderStyle = { let orderStyle = {
orderDay: { orderDay: {
left: 0, left: 0,
top: 40 * i + 'rpx', top: 40 * (lens-i) + 'rpx',
position: 'absolute', position: 'absolute',
color: 'white' color: 'white'
}, },
orderFloor: { orderFloor: {
left: 200 + 'rpx', left: 200 + 'rpx',
top: 40 * i + 'rpx', top: 40 * (lens-i) + 'rpx',
position: 'absolute', position: 'absolute',
color: 'white' color: 'white'
}, },
orderCredits: { orderCredits: {
left: 400 + 'rpx', left: 400 + 'rpx',
top: 40 * i + 'rpx', top: 40 * (lens-i) + 'rpx',
position: 'absolute', position: 'absolute',
color: 'white' color: 'white'
}
} }
data[i].order = orderStyle;
} }
data[i].order = orderStyle; this.setData({
orderList: data,
// orderStyle:orderStyleArr
})
} else {
// 购买记录为空
console.log('购买记录为空');
this.setData({
orderList: null
})
} }
this.setData({
orderList: data,
// orderStyle:orderStyleArr
})
}, },
async getPrizeMenu(){ async getPrizeMenu(){
...@@ -152,7 +170,8 @@ Page({ ...@@ -152,7 +170,8 @@ Page({
left: 200 + 'rpx', left: 200 + 'rpx',
top: 40 * i + 'rpx', top: 40 * i + 'rpx',
position: 'absolute', position: 'absolute',
color: 'white' color: 'white',
width: 100 + 'rpx'
}, },
prizeimage: { prizeimage: {
left: 400 + 'rpx', left: 400 + 'rpx',
...@@ -188,6 +207,17 @@ Page({ ...@@ -188,6 +207,17 @@ Page({
}) })
} }
}) })
},
onPrizeModalClose(){
this.setData({
prizeVisible: true
})
},
onHandleNoPrizeClose(){
this.setData({
noprizeVisible: false
})
} }
}); });
\ No newline at end of file
...@@ -14,10 +14,10 @@ Page({ ...@@ -14,10 +14,10 @@ Page({
startBtnVisible: false, startBtnVisible: false,
ruleModalBtnVisible: false, ruleModalBtnVisible: false,
ruleData:'', ruleData: '',
joinCount:'', joinCount: '',
endTime:'', endTime: '',
startTime:'' startTime: ''
}, },
onLoad(query) { onLoad(query) {
...@@ -31,23 +31,27 @@ Page({ ...@@ -31,23 +31,27 @@ Page({
}, },
gotoVipPage() { gotoVipPage() {
let {endTime,startTime} = this.data let { endTime, startTime } = this.data
API.getVipInfo().then(res => { API.getVipInfo().then(res => {
// res.data.isVip=true; // res.data.isVip=true;
// 判断活动时间 // 判断活动时间
let currentTime = new Date().getTime(); let currentTime = new Date().getTime();
if(currentTime < startTime){ if (currentTime < startTime) {
commonToast('活动未开始'); commonToast('活动未开始');
} }
if(currentTime > endTime){ if (currentTime > endTime) {
commonToast('活动已结束'); commonToast('活动已结束');
} }
if (!res.data.isVip) if (!res.data.isVip) {
navigateToOutside(res.data.url) commonToast('立即加入会员,即可开始盖楼')
setTimeout(() => {
navigateToOutside(res.data.url)
}, 1000);
}
else else
my.redirectTo({ url: '/pages/pagehuo_dong_ye/pagehuo_dong_ye' }); my.redirectTo({ url: '/pages/pagehuo_dong_ye/pagehuo_dong_ye' });
// my.redirectTo({ url: '/pages/pagehuo_dong_ye/pagehuo_dong_ye?data=' + JSON.stringify({endTime}) }); // my.redirectTo({ url: '/pages/pagehuo_dong_ye/pagehuo_dong_ye?data=' + JSON.stringify({endTime}) });
}) })
}, },
...@@ -74,7 +78,7 @@ Page({ ...@@ -74,7 +78,7 @@ Page({
}) })
}, },
async init() { async init() {
const [{ data: { isUserJoin,startTime, endTime, openPrizeStatus, prize, isShowPrize, rule, joinCount } }, vipInfo] = await Promise.all([ const [{ data: { isUserJoin, startTime, endTime, openPrizeStatus, prize, isShowPrize, rule, joinCount } }, vipInfo] = await Promise.all([
API.getActivityBaseInfoById(), API.getActivityBaseInfoById(),
API.getVipInfo(), API.getVipInfo(),
]); ]);
...@@ -86,29 +90,39 @@ Page({ ...@@ -86,29 +90,39 @@ Page({
console.log('fuck'); console.log('fuck');
// vipInfo..data.isVip = true; let currentTime = new Date().getTime();
if (vipInfo.data.isVip && isUserJoin) { if (currentTime < startTime) {
if (isEnd(endTime) && commonToast('活动未开始');
(openPrizeStatus == OPEN_PRIZE_STATUS.SUCCESS || openPrizeStatus == OPEN_PRIZE_STATUS.NOT_OPEN)) {//活动结束,开奖成功or不开奖 }
my.redirectTo({ url: '/pages/pagejie_shu_ye/pagejie_shu_ye?data=' + JSON.stringify({ prize, openPrizeStatus, isShowPrize }) }); if (currentTime > endTime) {
commonToast('活动已结束');
} else
if (vipInfo.data.isVip && isUserJoin) {
// vipInfo..data.isVip = true;
if (isEnd(endTime) &&
(openPrizeStatus == OPEN_PRIZE_STATUS.SUCCESS || openPrizeStatus == OPEN_PRIZE_STATUS.NOT_OPEN)) {//活动结束,开奖成功or不开奖
my.redirectTo({ url: '/pages/pagejie_shu_ye/pagejie_shu_ye?data=' + JSON.stringify({ prize, openPrizeStatus, isShowPrize }) });
} else {
my.redirectTo({ url: '/pages/pagehuo_dong_ye/pagehuo_dong_ye' });
// my.redirectTo({ url: '/pages/pagehuo_dong_ye/pagehuo_dong_ye?data=' + JSON.stringify({endTime}) });
}
} else { } else {
// my.redirectTo({ url: '/pages/pagehuo_dong_ye/pagehuo_dong_ye' }); //设置状态
my.redirectTo({ url: '/pages/pagehuo_dong_ye/pagehuo_dong_ye?data=' + JSON.stringify({endTime}) }); this.setData({
} myPrizeBtnVisible: true,
} else { startBtnVisible: true,
//设置状态 ruleModalBtnVisible: true
this.setData({ })
myPrizeBtnVisible: true, };
startBtnVisible: true,
ruleModalBtnVisible: true
})
};
this.setData({ this.setData({
ruleData:rule, ruleData: rule,
joinCount:joinCount joinCount: joinCount
}) })
}, },
/** /**
* 登录接口 * 登录接口
......
// 分享配置 // 分享配置
export const SHARE_CONFIG = { export const SHARE_CONFIG = {
title: '分享测试标题', title: '爱斐楼上请',
desc: '分享测试描述', desc: '积分盖楼赢锦鲤 享一年新衣',
imageUrl: '', // 分享图片URL imageUrl: 'https://isv.alibabausercontent.com/00000000/imgextra/i2/676606897/O1CN01eNrwLl20osHoB4Y7d_!!676606897-2-isvtu-00000000.png', // 分享图片URL
path: 'pages/index/index' path: 'pages/index/index'
}; };
......
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