Commit 860d0e5c authored by ziyu's avatar ziyu

feat: 改成测试环境,修改bug

parent 13765a50
<style>
page {
font-family: 'PingFangSC-Regular';
font-family: 'PingFangSC-Regular',monospace;
width:100%;
height:100%;
background-color:#F1F1F1;
......
import wepy from '@wepy/core';
import Notify from '../components/vant/notify/notify';
const baseUrl = 'https://api-luckii.q-gp.com';
const baseUrl = 'https://luckii-qa.liangkebang.net';
const request = async (url, options) => {
const pages = getCurrentPages();
......
......@@ -35,15 +35,15 @@
position: relative;
.text {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
top:0;
left:0;
width:100%;
height:100%;
z-index: 2;
background-color: transparent;
text-align: center;
line-height:20rpx;
background-color: transparent;
font-size: 18rpx;
line-height: 20rpx;
}
.orange {
width: 0;
......@@ -159,7 +159,7 @@
this.loading = false;
if (!newVal.length) return;
this._videoListChanged(newVal);
this.compute(this.userAccount);
// this.compute(this.userAccount);
},
userAccount(newVal) {
this.compute(newVal);
......@@ -178,7 +178,6 @@
methods: {
compute (newVal) {
if (!this.curQueue.length) return;
this.nextQueue.forEach(v => {
v.probability = getProbability(+newVal, +v.coinQuantity);
});
......@@ -235,6 +234,7 @@
});
if (!this.curQueue.length) {
this.curQueue = this.nextQueue.splice(0, 3);
this.compute(this.userAccount);
this.playCurrent(1);
}
},
......@@ -320,17 +320,16 @@
this.curQueue = [...this.curQueue];
}
},
async playCurrent(current) {
playCurrent(current) {
if (!this.curQueue || this.curQueue.length <= 1) return;
await this.getProgress(this.curQueue[current].id);
const { batchId, photoUrl, name, probability, progress } = this.curQueue[current];
this.getProgress(this.curQueue[current].id);
const { id, photoUrl, name, probability } = this.curQueue[current];
this.$emit('getAwardsInfo', {
batchId,
id,
photoUrl,
quantity: this.userAccount,
name,
chance: probability,
progress: progress
});
// this._videoContexts.forEach((ctx, index) => {
// if (index !== current) {
......
......@@ -573,8 +573,8 @@
};
},
getAwards: function() {
const { batchId, photoUrl, quantity, name, chance, progress } = this.awardsInfo;
if (!batchId || !this.mainInfo || !this.mainInfo.account) {
const { id, photoUrl, quantity, name, chance } = this.awardsInfo;
if (!id || !this.mainInfo || !this.mainInfo.account) {
Notify({ message: '服务器异常,请稍后重试', background: '#FF5D15', safeAreaInsetTop: true });
return;
}
......@@ -583,7 +583,7 @@
return;
}
wx.navigateTo({
url: `/pages/raffle?batchId=${batchId}&progress=${progress}&chance=${chance}&photoUrl=${photoUrl}&quantity=${quantity}&name=${name}`
url: `/pages/raffle?prizeId=${id}&chance=${chance}&photoUrl=${photoUrl}&quantity=${quantity}&name=${name}`
});
},
getAwardsInfo: function(v) {
......
......@@ -139,7 +139,7 @@
import wepy from '@wepy/core';
import Notify from '../components/vant/notify/notify';
import Dialog from '../components/vant/dialog/dialog';
import { updateUserPhone, confirmRaffle, register } from '../common/api';
import { updateUserPhone, confirmRaffle, register, login, getAwardsDetail } from '../common/api';
import store from '../store';
wepy.page({
store,
......@@ -174,15 +174,9 @@
}
if (detail.encryptedData) {
this.btnfont = '提交中...';
wx.checkSession({
success () {
const { code } = await wepy.wx.login();
await login(code);
goprize();
},
async fail () {
await wepy.wx.login();
goprize();
}
});
} else {
Notify({message: '参与失败,请重新授权!', background: '#FF5D15'});
}
......@@ -219,7 +213,13 @@
if (this.hasPhone) {
this.confirmRaff();
}
}
},
async getProgress(id) {
const detail = await getAwardsDetail({ prizeId: id });
this.batchId = detail.id;
this.progress = Math.round((detail.join / detail.quantity) * 100) + '%';
this.progressStyle = 'width:' + this.progress;
},
},
computed: {
imgsrc() {
......@@ -240,13 +240,13 @@
}
},
onLoad (query) {
let {batchId, quantity, name, chance, photoUrl, progress} = query;
if (progress) {
let {prizeId, quantity, name, chance, photoUrl} = query;
this.getProgress(prizeId);
/*if (progress) {
this.progress = progress;
this.progressStyle = 'width:' + progress;
}
}*/
this.hasPhone = wx.getStorageSync('hasPhone');
this.batchId = batchId;
this.quantity = quantity || '';
this.name = name;
this.chance = chance;
......
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