Commit f42cbb5c authored by wildfirecode13's avatar wildfirecode13

1

parent 5805a483
...@@ -6,8 +6,8 @@ cloud.init({ ...@@ -6,8 +6,8 @@ cloud.init({
}); });
App({ App({
// requestType: 'yapi', // yapi,cloud: 云函数
requestType: 'cloud', // yapi,cloud: 云函数 requestType: 'cloud', // yapi,cloud: 云函数
requestType: 'yapi', // yapi,cloud: 云函数
cloudName: 'floor', // 主云函数项目名 base clientTemplate2C cloudName: 'floor', // 主云函数项目名 base clientTemplate2C
cloud, cloud,
tbcc, tbcc,
......
...@@ -6,6 +6,7 @@ Page({ ...@@ -6,6 +6,7 @@ Page({
data: {}, data: {},
onLoad(props) { onLoad(props) {
console.log('fuck',JSON.parse(props.prize))
this.setData({ this.setData({
resList: resList resList: resList
}); });
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
import resList from '../../resconfig/resList'; //import API from '../../api'; import resList from '../../resconfig/resList'; //import API from '../../api';
import API from '../../api'; import API from '../../api';
import isEnd from '/utils/isEnd';
import OPEN_PRIZE_STATUS from '/utils/OPEN_PRIZE_STATUS';
const app = getApp(); const app = getApp();
const { tbcc } = app; const { tbcc } = app;
const { commonToast, getAuthUserInfo, navigateToOutside } = tbcc.tb; const { commonToast, getAuthUserInfo, navigateToOutside } = tbcc.tb;
...@@ -53,13 +55,17 @@ Page({ ...@@ -53,13 +55,17 @@ Page({
}) })
}, },
async init() { async init() {
const [activity, vipInfo] = await Promise.all([ const [{ data: { isUserJoin, endTime, openPrizeStatus,prize } }, vipInfo] = await Promise.all([
API.getActivityBaseInfoById(), API.getActivityBaseInfoById(),
API.getVipInfo(), API.getVipInfo(),
]); ]);
// vipInfo.isVip = true; vipInfo.isVip = true;
if (vipInfo.isVip && activity.data.isUserJoin) { if (vipInfo.isVip && isUserJoin) {
my.redirectTo({ url: '/pages/pagehuo_dong_ye/pagehuo_dong_ye' }); if (isEnd(endTime) && openPrizeStatus == OPEN_PRIZE_STATUS.SUCCESS) {//活动结束,开奖成功
my.redirectTo({ url: '/pages/pagejie_shu_ye/pagejie_shu_ye?prize='+JSON.stringify(prize) });
} else {
my.redirectTo({ url: '/pages/pagehuo_dong_ye/pagehuo_dong_ye' });
}
} else { } else {
//设置状态 //设置状态
this.setData({ this.setData({
...@@ -68,7 +74,7 @@ Page({ ...@@ -68,7 +74,7 @@ Page({
ruleModalBtnVisible: true ruleModalBtnVisible: true
}) })
}; };
API.getFloorPrize API.getFloorPrize();
}, },
/** /**
* 登录接口 * 登录接口
......
...@@ -68,7 +68,7 @@ const request = ({ cloud, cloudName, requestType = 'cloud' }) => { ...@@ -68,7 +68,7 @@ const request = ({ cloud, cloudName, requestType = 'cloud' }) => {
dataType: 'json' dataType: 'json'
}).then(({ data: res }) => { }).then(({ data: res }) => {
hideMyLoading(); hideMyLoading();
console.log('mock res=>', JSON.stringify(res)) console.log(`mock res,${url}=>`, res)
if (res && res.success) { if (res && res.success) {
resolve(res); resolve(res);
} else { } else {
......
const isEnd = (endTime)=>{
const now = Date.now();
return now > endTime
}
export default isEnd
\ No newline at end of file
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