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
8eeb9e21
Commit
8eeb9e21
authored
May 29, 2020
by
郝聪敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改奖品列表重复问题
parent
6e812dde
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
51 deletions
+43
-51
videolist.wpy
src/components/custom/videolist.wpy
+43
-51
No files found.
src/components/custom/videolist.wpy
View file @
8eeb9e21
...
...
@@ -151,8 +151,7 @@
_invalidDown: 0,
_videoContexts: [],
loading: false,
isFirstUp: true,
isComputing: false
isFirstUp: true,
},
watch: {
videoList () {
...
...
@@ -178,7 +177,8 @@
},
methods: {
compute (newVal) {
this.isComputing = true;
if (!this.curQueue.length) return;
this.nextQueue.forEach(v => {
v.probability = getProbability(+newVal, +v.coinQuantity);
});
...
...
@@ -194,7 +194,6 @@
this.curQueue = [...this.curQueue];
this.nextQueue = [...this.nextQueue];
this.prevQueue = [...this.prevQueue];
this.isComputing = false;
},
async getProgress(id) {
const detail = await getAwardsDetail({ prizeId: id });
...
...
@@ -252,9 +251,7 @@
this.isFirstUp = false;
await fn(700);
}
// if (timeout) clearTimeout(timeout);
// timeout = setTimeout(() => {
const direction = diff === 1 || diff === -2 ? 'up' : 'down';
if (direction === 'up') {
if (this._invalidDown === 0) {
...
...
@@ -282,7 +279,6 @@
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;
...
...
@@ -297,15 +293,11 @@
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));
// }, 700);
},
onWaiting (e) {
this.trigger(e, 'wait');
...
...
@@ -366,7 +358,7 @@
cancelPause() {
// console.log('bindchange');
this.pause = false;
}
,
}
}
});
</script>
...
...
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