Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mini-program-wepy
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ui
mini-program-wepy
Commits
2dea00d6
Commit
2dea00d6
authored
Jul 17, 2020
by
郭志伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
"style: lint"
parent
c31eedea
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
10 deletions
+4
-10
video.wpy
src/components/custom/video.wpy
+4
-10
No files found.
src/components/custom/video.wpy
View file @
2dea00d6
...
@@ -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();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment