Commit 67cf8ea4 authored by ziyu's avatar ziyu

Merge branch 'master' of git.quantgroup.cn:ui/mini-program-wepy into change

parents 72a30da7 f59ae42b
......@@ -68,7 +68,7 @@
bindchange="cancelPause"
>
<!-- curQueue 循环会导致video重新插入,objectFit 不可变更 -->
<swiper-item class="video-item" wx:for="{{curQueue}}" wx:key="index">
<swiper-item class="video-item" v-for="(item, idx) in curQueue" :key="item.id">
<view class="video-wrapper">
<!-- <video
id="video_{{index}}"
......@@ -89,7 +89,7 @@
<video-pause :pause="pause"></video-pause>
</video> < !-->
<view class="rightcont">
<view class="info">奖品库存: 1/8</view>
<view class="info">奖品库存: {{item.stock}}/{{item.totalStock}}</view>
<view class="info">中奖概率: {{item.probability}}</view>
<view class="progress">
<view class="text">{{item.progress}}</view>
......@@ -148,8 +148,8 @@
videoList () {
const newVal = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
this.loading = false;
this.init();
if (newVal.length) this._videoListChanged(newVal);
if (!newVal.length) return;
this._videoListChanged(newVal);
this.compute(this.userAccount);
},
userAccount(newVal) {
......@@ -217,19 +217,6 @@
this.nextQueue = [...this.nextQueue];
this.prevQueue = [...this.prevQueue];
},
init() {
this.pause = false;
this.nextQueue = [];
this.prevQueue = [];
this.curQueue = [];
this.circular = false;
this._last = 1;
this._change = -1;
this._invalidUp = 0;
this._invalidDown = 0;
this._videoContexts = [];
this.loading = false;
},
_videoListChanged (newVal) {
newVal.forEach((item, index) => {
item.time = 0;
......@@ -248,9 +235,8 @@
this.playCurrent(current);
this.$emit('change', { activeId: this.curQueue[current].id });
this.loading = true;
this.circular = false;
setTimeout(() => {
// setTimeout(() => {
const direction = diff === 1 || diff === -2 ? 'up' : 'down';
if (direction === 'up') {
if (this._invalidDown === 0) {
......@@ -278,6 +264,7 @@
this.curQueue[_change2] = _add;
this.nextQueue.unshift(_remove);
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());
} else {
this._invalidDown += 1;
......@@ -286,8 +273,21 @@
this._invalidUp -= 1;
}
}
this.curQueue = [...this.curQueue];
this.nextQueue = [...this.nextQueue];
this.prevQueue = [...this.prevQueue];
this.circular = true;
});
if (this.nextQueue.length === 0 && current !== 0) {
console.log('circular1');
this.circular = false;
}
if (this.prevQueue.length === 0 && current !== 2) {
console.log('circular2');
this.circular = false;
}
// console.log(this.prevQueue.map(v => v.id), this.curQueue.map(v => v.id), this.nextQueue.map(v => v.id));
// });
},
onWaiting (e) {
this.trigger(e, 'wait');
......
......@@ -492,6 +492,13 @@
},
fail (res) {
console.log('requestSubscribeMessage fail', res);
let info = '订阅消息失败,请稍后重试';
switch (res.errCode) {
case '20004':
info = '您关闭了主开关,无法进行订阅';
break;
}
Notify({ message: info, background: '#FF5D15', safeAreaInsetTop: true });
}
});
},
......
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