Commit fe59ad8e authored by zhangjinzhou's avatar zhangjinzhou

进度条修改

parent d2900717
......@@ -54,7 +54,7 @@ Page({
nearchaprize: "",//再召唤xx好友得奖励x
isVip: false,
vipLink: "",
clickVip:"",
clickVip: "",
giftype: 3,//1-新手礼盒,2-惊喜礼盒,3-锦鲤礼盒,0-都不显示
ptimgbig: "",//选中的鞋子big
......@@ -270,13 +270,13 @@ Page({
console.log("onshow=========>");
let clickVip = this.data.clickVip;
if(clickVip=="xinshou"){
if (clickVip == "xinshou") {
this.checkBackNgift();
}else if(clickVip=="zhuli"){
this.checkIsVip();
} else if (clickVip == "zhuli") {
this.checkBackZhuli();
}
this.setData({
clickVip:""
clickVip: ""
});
// 页面显示
},
......@@ -285,14 +285,23 @@ Page({
// 页面隐藏
},
//onshow给新手
async checkBackNgift(){
async checkBackNgift() {
await this.checkIsVip();
let isvip = this.data.isVip;
if(isvip){
if (isvip) {
this.closeGift();
this.getOpenNgift();
}
},
//onshow助力
async checkBackZhuli() {
this.checkIsVip();
let isvip = this.data.isVip;
if (isvip) {
this.closeSp();
this.doHelp();
}
},
/**
* startAni
*/
......@@ -365,10 +374,10 @@ Page({
if (success) {
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 actover = false;
if (serverTime&&serverTime > endTime) {//活动未结束
if (serverTime && serverTime > endTime) {//活动未结束
actover = true;
}
this.setData({
......@@ -495,7 +504,7 @@ Page({
opengift: hasTakeFirstPrize,
selshoesname: selshoesname
});
if(lselected==0){
if (lselected == 0) {
await this.checkIsVip();
}
......@@ -591,24 +600,62 @@ Page({
// console.log("邀请奖励", shareaward);
const { success, data } = shareaward;
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 nearchaprize = "";
let prostartx = -438;
let proendx = 0;
let levelpro = 0;
for (let i = 0; i < list.length; i++) {
let idata = list[i];
let itimes = idata.times;
if (itimes > inviteCount && nearchashare == 0) {//最近差多少
if (itimes >= inviteCount && nearchashare == 0) {//最近差多少
nearchashare = itimes - inviteCount;
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;
}
}
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 sharepropos = '-438rpx 0rpx';
if(inviteCount>=list[list.length-1].times){
sharepropos = '0rpx orpx';
}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 = "";
if (nearchashare > 0) {
......@@ -699,7 +746,7 @@ Page({
let vipLink = this.data.vipLink;
setTimeout(() => {
this.setData({
clickVip:"xinshou"
clickVip: "xinshou"
});
navigateToOutside(vipLink)
}, 1000)
......@@ -758,7 +805,7 @@ Page({
let vipLink = this.data.vipLink;
setTimeout(() => {
this.setData({
clickVip:"zhuli"
clickVip: "zhuli"
});
navigateToOutside(vipLink);
}, 1000)
......@@ -1116,7 +1163,7 @@ Page({
}) || {};
// console.log("抽奖结果", glPrizeData);
const { success, data } = glPrizeData;
if(success){
if (success) {
this.showPrizePage(success, data);
}
......
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