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
f59ae42b
Commit
f59ae42b
authored
May 28, 2020
by
郝聪敏
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/animation' into 'master'
修改奖品列表重复bug See merge request
!24
parents
2e9a8227
2fbe8c6f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
20 deletions
+27
-20
videolist.wpy
src/components/custom/videolist.wpy
+20
-20
index.wpy
src/pages/index.wpy
+7
-0
No files found.
src/components/custom/videolist.wpy
View file @
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');
...
...
src/pages/index.wpy
View file @
f59ae42b
...
...
@@ -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 });
}
});
},
...
...
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