Commit fe59ad8e authored by zhangjinzhou's avatar zhangjinzhou

进度条修改

parent d2900717
...@@ -54,7 +54,7 @@ Page({ ...@@ -54,7 +54,7 @@ Page({
nearchaprize: "",//再召唤xx好友得奖励x nearchaprize: "",//再召唤xx好友得奖励x
isVip: false, isVip: false,
vipLink: "", vipLink: "",
clickVip:"", clickVip: "",
giftype: 3,//1-新手礼盒,2-惊喜礼盒,3-锦鲤礼盒,0-都不显示 giftype: 3,//1-新手礼盒,2-惊喜礼盒,3-锦鲤礼盒,0-都不显示
ptimgbig: "",//选中的鞋子big ptimgbig: "",//选中的鞋子big
...@@ -270,14 +270,14 @@ Page({ ...@@ -270,14 +270,14 @@ Page({
console.log("onshow=========>"); console.log("onshow=========>");
let clickVip = this.data.clickVip; let clickVip = this.data.clickVip;
if(clickVip=="xinshou"){ if (clickVip == "xinshou") {
this.checkBackNgift(); this.checkBackNgift();
}else if(clickVip=="zhuli"){ } else if (clickVip == "zhuli") {
this.checkIsVip(); this.checkBackZhuli();
} }
this.setData({ this.setData({
clickVip:"" clickVip: ""
}); });
// 页面显示 // 页面显示
}, },
onHide() { onHide() {
...@@ -285,14 +285,23 @@ Page({ ...@@ -285,14 +285,23 @@ Page({
// 页面隐藏 // 页面隐藏
}, },
//onshow给新手 //onshow给新手
async checkBackNgift(){ async checkBackNgift() {
await this.checkIsVip(); await this.checkIsVip();
let isvip = this.data.isVip; let isvip = this.data.isVip;
if(isvip){ if (isvip) {
this.closeGift(); this.closeGift();
this.getOpenNgift(); this.getOpenNgift();
} }
}, },
//onshow助力
async checkBackZhuli() {
this.checkIsVip();
let isvip = this.data.isVip;
if (isvip) {
this.closeSp();
this.doHelp();
}
},
/** /**
* startAni * startAni
*/ */
...@@ -347,12 +356,12 @@ Page({ ...@@ -347,12 +356,12 @@ Page({
async init() { async init() {
// console.log("获取基本信息"); // console.log("获取基本信息");
//获取vip信息 //获取vip信息
this.getUserCardInfo(); this.getUserCardInfo();
this.getactivityData(); this.getactivityData();
console.log("from=====>init"); console.log("from=====>init");
}, },
/** /**
* 获取基本信息 * 获取基本信息
...@@ -365,10 +374,10 @@ Page({ ...@@ -365,10 +374,10 @@ Page({
if (success) { if (success) {
const { rule, startTime, endTime, awardReceiveExpiredTime, source1, source2, shoesList, sourceImg1, sourceImg2 } = data; const { rule, startTime, endTime, awardReceiveExpiredTime, source1, source2, shoesList, sourceImg1, sourceImg2 } = data;
const serverTime = await getServerTime().catch(() => {}) const serverTime = await getServerTime().catch(() => { })
// let datenow = Date.now(); // let datenow = Date.now();
let actover = false; let actover = false;
if (serverTime&&serverTime > endTime) {//活动未结束 if (serverTime && serverTime > endTime) {//活动未结束
actover = true; actover = true;
} }
this.setData({ this.setData({
...@@ -414,7 +423,7 @@ Page({ ...@@ -414,7 +423,7 @@ Page({
}) || {}; }) || {};
const { success, data } = userinfo; const { success, data } = userinfo;
if (success) { if (success) {
console.log("我的信息", userinfo); console.log("我的信息", userinfo);
let { shoesName, cardCountList, collectedCount, canTakeRankPrize, shoesType, inviteResult, hasTakeCollectedPrize, hasTakeFirstPrize } = data; let { shoesName, cardCountList, collectedCount, canTakeRankPrize, shoesType, inviteResult, hasTakeCollectedPrize, hasTakeFirstPrize } = data;
let selected = 2; let selected = 2;
...@@ -495,7 +504,7 @@ Page({ ...@@ -495,7 +504,7 @@ Page({
opengift: hasTakeFirstPrize, opengift: hasTakeFirstPrize,
selshoesname: selshoesname selshoesname: selshoesname
}); });
if(lselected==0){ if (lselected == 0) {
await this.checkIsVip(); await this.checkIsVip();
} }
...@@ -591,24 +600,62 @@ Page({ ...@@ -591,24 +600,62 @@ Page({
// console.log("邀请奖励", shareaward); // console.log("邀请奖励", shareaward);
const { success, data } = shareaward; const { success, data } = shareaward;
if (success) { if (success) {
const { list, inviteCount } = data; let { list, inviteCount } = data;
//
// list[0].times = 5;
// list[1].times = 7;
// list[2].times = 30;
// list[3].times = 36;
// //
// inviteCount = 6;
let nearchashare = 0; let nearchashare = 0;
let nearchaprize = ""; let nearchaprize = "";
let prostartx = -438;
let proendx = 0;
let levelpro = 0;
for (let i = 0; i < list.length; i++) { for (let i = 0; i < list.length; i++) {
let idata = list[i]; let idata = list[i];
let itimes = idata.times; let itimes = idata.times;
if (itimes > inviteCount && nearchashare == 0) {//最近差多少
if (itimes >= inviteCount && nearchashare == 0) {//最近差多少
nearchashare = itimes - inviteCount; nearchashare = itimes - inviteCount;
let itype = Number(idata.type);
nearchaprize = ["抽碎片次数", "随机稀有碎片", "未收录碎片"][itype - 1]; if (i == 0) {
prostartx = -438;
proendx = -410;
levelpro = inviteCount/itimes;
} else if (i == 1) {
prostartx = -410;
proendx = nearchashare>0?-300:-275;
levelpro = nearchashare>0?inviteCount/(itimes-1):1;
}else if(i==2){
prostartx = -275;
proendx = nearchashare>0?-165:-138;
levelpro = nearchashare>0?inviteCount/(itimes-1):1;
}else if(i==3){
prostartx = -138;
proendx = nearchashare>0?-28:0;
levelpro = nearchashare>0?inviteCount/(itimes-1):1;
}
if (nearchashare != 0) {
let itype = Number(idata.type);
nearchaprize = ["抽碎片次数", "随机稀有碎片", "未收录碎片"][itype - 1];
}
break; break;
} }
} }
let sharepro = inviteCount / list[list.length - 1].times; let sharepropos = '-438rpx 0rpx';
// console.log("代码暂存233====》",sharepro,inviteCount,list[list.length-1].times); if(inviteCount>=list[list.length-1].times){
if (sharepro > 1) sharepro = 1; sharepropos = '0rpx orpx';
let sharepropos = 438 * (sharepro - 1) + 'rpx 0rpx'; }else{
sharepropos = (proendx-prostartx)*levelpro+prostartx+'rpx 0rpx';
}
// let sharepro = inviteCount / list[list.length - 1].times;
// // console.log("代码暂存233====》",sharepro,inviteCount,list[list.length-1].times);
// if (sharepro > 1) sharepro = 1;
// let sharepropos = 438 * (sharepro - 1) + 'rpx 0rpx';
let nearchatxt = ""; let nearchatxt = "";
if (nearchashare > 0) { if (nearchashare > 0) {
...@@ -643,7 +690,7 @@ Page({ ...@@ -643,7 +690,7 @@ Page({
// if (res1 && res1.data) { // if (res1 && res1.data) {
// this.addDialogsData({}, "xinshouprize"); // this.addDialogsData({}, "xinshouprize");
// } else { // } else {
this.addDialogsData({}, "xinshou"); this.addDialogsData({}, "xinshou");
// } // }
} else { } else {
// this.setData({ // this.setData({
...@@ -699,7 +746,7 @@ Page({ ...@@ -699,7 +746,7 @@ Page({
let vipLink = this.data.vipLink; let vipLink = this.data.vipLink;
setTimeout(() => { setTimeout(() => {
this.setData({ this.setData({
clickVip:"xinshou" clickVip: "xinshou"
}); });
navigateToOutside(vipLink) navigateToOutside(vipLink)
}, 1000) }, 1000)
...@@ -758,7 +805,7 @@ Page({ ...@@ -758,7 +805,7 @@ Page({
let vipLink = this.data.vipLink; let vipLink = this.data.vipLink;
setTimeout(() => { setTimeout(() => {
this.setData({ this.setData({
clickVip:"zhuli" clickVip: "zhuli"
}); });
navigateToOutside(vipLink); navigateToOutside(vipLink);
}, 1000) }, 1000)
...@@ -1116,10 +1163,10 @@ Page({ ...@@ -1116,10 +1163,10 @@ Page({
}) || {}; }) || {};
// console.log("抽奖结果", glPrizeData); // console.log("抽奖结果", glPrizeData);
const { success, data } = glPrizeData; const { success, data } = glPrizeData;
if(success){ if (success) {
this.showPrizePage(success, data); this.showPrizePage(success, data);
} }
this.changeBtnReady(true); this.changeBtnReady(true);
this.setData({ this.setData({
canTakeRankPrize: false canTakeRankPrize: false
...@@ -1309,7 +1356,7 @@ Page({ ...@@ -1309,7 +1356,7 @@ Page({
if (app.openId) { if (app.openId) {
path = '/pages/pageshou_ye/pageshou_ye' + '?openId=' + app.openId + "&shoestype=" + this.data.shoesType; path = '/pages/pageshou_ye/pageshou_ye' + '?openId=' + app.openId + "&shoestype=" + this.data.shoesType;
} }
console.log('path', path) console.log('path', path)
return { return {
......
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