Commit 2dea00d6 authored by 郭志伟's avatar 郭志伟

"style: lint"

parent c31eedea
...@@ -71,11 +71,10 @@ ...@@ -71,11 +71,10 @@
prevQueue: [], prevQueue: [],
curQueue: [], curQueue: [],
circular: false, circular: false,
_last: -1, _last: 1,
_invalidUp: 0, _invalidUp: 0,
_invalidDown: 0, _invalidDown: 0,
_videoContexts: [], _videoContexts: [],
currentIndex: 0,
videoPause: false, videoPause: false,
showPopup: false, showPopup: false,
videoLoading: true videoLoading: true
...@@ -101,9 +100,9 @@ ...@@ -101,9 +100,9 @@
// 同时展示的元素只有三个,curQueue中始终只有三个元素,用来解决吧video过多时,资源加载问题 // 同时展示的元素只有三个,curQueue中始终只有三个元素,用来解决吧video过多时,资源加载问题
// 当前的资源加载解决方案是参考小程序的video-swiper源码 // 当前的资源加载解决方案是参考小程序的video-swiper源码
newVal.forEach(function (item, index) { newVal.forEach(function (item, index) {
if (index === 1) { if (index === 0) {
_this.curQueue[0] = item; _this.curQueue[0] = item;
} else if (index === 0) { } else if (index === 1) {
_this.curQueue[1] = item; _this.curQueue[1] = item;
} else if (index === 2) { } else if (index === 2) {
_this.curQueue[2] = item; _this.curQueue[2] = item;
...@@ -122,7 +121,6 @@ ...@@ -122,7 +121,6 @@
_this.nextQueue.push(item); _this.nextQueue.push(item);
}); });
} }
// this.compute(this.userAccount);
}, },
moveSwiper(e) { moveSwiper(e) {
this.videoPause = false; this.videoPause = false;
...@@ -130,12 +128,8 @@ ...@@ -130,12 +128,8 @@
if (e.$wx.detail.source === 'touch') { if (e.$wx.detail.source === 'touch') {
// 增加一个透明遮罩层,控制用户滑动速度,400ms内只能滑动一次,解决用户滑动过快,不触发animationfinish的bug // 增加一个透明遮罩层,控制用户滑动速度,400ms内只能滑动一次,解决用户滑动过快,不触发animationfinish的bug
this.showPopup = true; this.showPopup = true;
// debounce(() => {
// this.showPopup = false;
// }, 200)();
const current = e.$wx.detail.current; const current = e.$wx.detail.current;
this.currentIndex = current;
// 如果next中如果就剩下4个了,请求下一页 // 如果next中如果就剩下4个了,请求下一页
if (this.nextQueue.length === 4) { if (this.nextQueue.length === 4) {
getPrizeList().then(data => { getPrizeList().then(data => {
...@@ -207,7 +201,7 @@ ...@@ -207,7 +201,7 @@
this._videoContexts.forEach(function (ctx, index) { this._videoContexts.forEach(function (ctx, index) {
if (ctx) { if (ctx) {
const showType = that.curQueue[current] && that.curQueue[current].showType && that.curQueue[current].showType.value === 2; const showType = that.curQueue[current] && that.curQueue[current].showType && that.curQueue[current].showType.value === 2;
if (index === current || showType) { if (index === current && showType) {
ctx.play(); ctx.play();
} else { } else {
ctx.pause(); ctx.pause();
......
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