Commit 8eeb9e21 authored by 郝聪敏's avatar 郝聪敏

修改奖品列表重复问题

parent 6e812dde
...@@ -151,8 +151,7 @@ ...@@ -151,8 +151,7 @@
_invalidDown: 0, _invalidDown: 0,
_videoContexts: [], _videoContexts: [],
loading: false, loading: false,
isFirstUp: true, isFirstUp: true,
isComputing: false
}, },
watch: { watch: {
videoList () { videoList () {
...@@ -178,7 +177,8 @@ ...@@ -178,7 +177,8 @@
}, },
methods: { methods: {
compute (newVal) { compute (newVal) {
this.isComputing = true; if (!this.curQueue.length) return;
this.nextQueue.forEach(v => { this.nextQueue.forEach(v => {
v.probability = getProbability(+newVal, +v.coinQuantity); v.probability = getProbability(+newVal, +v.coinQuantity);
}); });
...@@ -194,7 +194,6 @@ ...@@ -194,7 +194,6 @@
this.curQueue = [...this.curQueue]; this.curQueue = [...this.curQueue];
this.nextQueue = [...this.nextQueue]; this.nextQueue = [...this.nextQueue];
this.prevQueue = [...this.prevQueue]; this.prevQueue = [...this.prevQueue];
this.isComputing = false;
}, },
async getProgress(id) { async getProgress(id) {
const detail = await getAwardsDetail({ prizeId: id }); const detail = await getAwardsDetail({ prizeId: id });
...@@ -252,9 +251,7 @@ ...@@ -252,9 +251,7 @@
this.isFirstUp = false; this.isFirstUp = false;
await fn(700); await fn(700);
} }
// if (timeout) clearTimeout(timeout);
// timeout = setTimeout(() => {
const direction = diff === 1 || diff === -2 ? 'up' : 'down'; const direction = diff === 1 || diff === -2 ? 'up' : 'down';
if (direction === 'up') { if (direction === 'up') {
if (this._invalidDown === 0) { if (this._invalidDown === 0) {
...@@ -282,7 +279,6 @@ ...@@ -282,7 +279,6 @@
this.curQueue[_change2] = _add; this.curQueue[_change2] = _add;
this.nextQueue.unshift(_remove); this.nextQueue.unshift(_remove);
this._change = (_change2 - 1 + 3) % 3; this._change = (_change2 - 1 + 3) % 3;
console.log('this.prevQueue.length', this.prevQueue.length);
if (this.prevQueue.length === 0) this.prevQueue.push(this.nextQueue.pop()); if (this.prevQueue.length === 0) this.prevQueue.push(this.nextQueue.pop());
} else { } else {
this._invalidDown += 1; this._invalidDown += 1;
...@@ -297,15 +293,11 @@ ...@@ -297,15 +293,11 @@
this.circular = true; this.circular = true;
if (this.nextQueue.length === 0 && current !== 0) { if (this.nextQueue.length === 0 && current !== 0) {
console.log('circular1');
this.circular = false; this.circular = false;
} }
if (this.prevQueue.length === 0 && current !== 2) { if (this.prevQueue.length === 0 && current !== 2) {
console.log('circular2');
this.circular = false; this.circular = false;
} }
console.log(this.prevQueue.map(v => v.id), this.curQueue.map(v => v.id), this.nextQueue.map(v => v.id));
// }, 700);
}, },
onWaiting (e) { onWaiting (e) {
this.trigger(e, 'wait'); this.trigger(e, 'wait');
...@@ -366,7 +358,7 @@ ...@@ -366,7 +358,7 @@
cancelPause() { cancelPause() {
// console.log('bindchange'); // console.log('bindchange');
this.pause = false; this.pause = false;
}, }
} }
}); });
</script> </script>
......
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