Commit 1d28df64 authored by Edwise's avatar Edwise 🍷

1123

parent c5a01b98
......@@ -33,6 +33,8 @@ App({
const { activityId } = query;
// this.activityId = activityId || '5f8550a3964f97be3647a635';
this.activityId = activityId || '5f8831e67389891bfd6bb35f'; //赵然1
// this.activityId = activityId || '5f895d0f0cb733e071b4082b'; //开发者测试
}
......
......@@ -66,9 +66,9 @@ Page({
/**游戏信息 */
gameInfo: {},
/**5系解锁需要场数 */
unLock5Times:0,
unLock5Times: 0,
/**7系解锁需要场数 */
unLock7Times:0,
unLock7Times: 0,
},
navigateToOutsideGoodsDetail(e) {
......@@ -144,7 +144,7 @@ Page({
FYGE.RENDERER_TYPE.CANVAS
);
var con = stage.addChild(new FYGE.Container())
con.y=stage.viewRect.y;
con.y = stage.viewRect.y;
//stage初始化
stage.addEventListener(FYGE.Event.INIT_STAGE, () => {
SvgaParser.loadSvga(
......@@ -210,9 +210,9 @@ Page({
// const favoredStatus = await checkShopFavoredStatus(3035493001).catch(err => {
// console.log('查询关注店铺状态失败', err);
// });
this.favoredStatus = await checkShopFavoredStatus(3035493001).catch(r=>{
this.favoredStatus = await checkShopFavoredStatus(3035493001).catch(r => {
console.log("关注不对劲")
})||false;
}) || false;
// my.tb.checkShopFavoredStatus({
// id: 3035493001,
// success: (res) => {
......@@ -250,7 +250,11 @@ Page({
inviteStep: app.step
}).catch(res => {
// my.hideLoading();
commonToast(res && res.message);
if (res.code == "220003") {
this.getRankPrize();
} else {
commonToast(res && res.message);
}
}) || {};
if (success) {
......@@ -274,13 +278,13 @@ Page({
}) || {};
if (success) {
const nowTime = await getServerTime().catch(()=>{});
if(nowTime&&data.startTime>nowTime){
const nowTime = await getServerTime().catch(() => {});
if (nowTime && data.startTime > nowTime) {
my.hideLoading();
my.showToast({
content: '活动未开始',
duration: 5000,
});
});
return;
}
this.gameConfigList = data.gameConfigList;
......@@ -289,10 +293,40 @@ Page({
this.judgeDoHelp();
}
},
async getRankPrize() {
const {
success,
data
} = await API.getGameInfo().catch(r => {
my.hideLoading();
commonToast(r && r.message);
}) || {};
if (success) {
let str = data.rank > 500 ? '500+' : data.rank
this.setData({
gameInfo: data,
curWarms: data.warms + '',
curRank: str,
curGameStep: data.step,
unLock5Times: data.promotionNum1,
unLock7Times: data.promotionNum2
})
if (data.rankPrize && data.rankPrize.type == 5) {
this.setData({
modalStatus: modalType['ranknoprize']
})
} else if (data.rankPrize && data.rankPrize.type != 5 && data.rankPrize.image && data.rankPrize.image.length > 0) {
this.setData({
modalStatus: modalType['rankprize']
})
}
}
my.hideLoading();
},
/**判断是否是助力 */
judgeDoHelp() {
console.log("啦啦啦",typeof(app.inviteId),app.inviteId,typeof(app.openId),app.openId)
if (app.inviteId&&app.inviteId!=app.openId) {
console.log("啦啦啦", typeof (app.inviteId), app.inviteId, typeof (app.openId), app.openId)
if (app.inviteId && app.inviteId != app.openId) {
this.setData({
modalStatus: modalType['invite']
})
......@@ -317,8 +351,8 @@ Page({
curWarms: data.warms + '',
curRank: str,
curGameStep: data.step,
unLock5Times:data.promotionNum1,
unLock7Times:data.promotionNum2
unLock5Times: data.promotionNum1,
unLock7Times: data.promotionNum2
})
if (data.rankPrize && data.rankPrize.type == 5) {
......@@ -336,10 +370,14 @@ Page({
}
},
canOpenGamePage:false,
canOpenGamePage: false,
/**进入游戏页面 */
async openGamePage() {
if(!this.canOpenGamePage) return;
if(!this.start){
commonToast("活动已结束")
return;
}
if (!this.canOpenGamePage) return;
this.canOpenGamePage = false
my.showLoading();
const {
......@@ -349,14 +387,15 @@ Page({
} = await API.doJoin({
step: this.data.curGameStep
}).catch(r => {
if (r&&r.data && !r.data.isVip) {
if (r && r.data && !r.data.isVip) {
commonToast("3s入会,即可为好友助力", 1500, () => {
this.goVip = true;
this.canOpenGamePage = true;
navigateToOutside(r.data.url);
})
} else {
this.canOpenGamePage = true;
commonToast(r&&r.message)
commonToast(r && r.message)
}
my.hideLoading();
}) || {};
......@@ -371,18 +410,23 @@ Page({
})
my.hideLoading();
} else {
}
console.log("点击进入游戏页面")
},
/**打开弹窗 */
openModal(e) {
if(!this.start) return;
console.log(e);
const {
item
} = e.target.dataset;
if(!this.start&&item=='inviteList')
{
commonToast("活动已结束")
return;
}
if (!this.start&&item!='rule') return;
this.setData({
modalStatus: modalType[item] || 0
});
......@@ -395,10 +439,14 @@ Page({
},
/**点击跳转页面 */
navigateTo(e) {
if(!this.start) return;
const {
item
} = e.target.dataset;
if (!this.start && item == 'pagepagerank') {
commonToast("活动已结束")
return;
}
my.navigateTo({
url: `/pages/${item}/${item}`
});
......@@ -426,6 +474,7 @@ Page({
}
if (this.goVip) {
this.openGamePage();
this.goVip = false;
}
},
openInviteFailedModal() {
......
This diff is collapsed.
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