Commit 1d28df64 authored by Edwise's avatar Edwise 🍷

1123

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