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
356617a7
Commit
356617a7
authored
Jul 23, 2020
by
zhijie.xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复签到成功后进入抽奖,概率未变化的问题
parent
b797594b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
8 deletions
+9
-8
video.wpy
src/components/custom/video.wpy
+2
-1
index.wpy
src/pages/index.wpy
+7
-7
No files found.
src/components/custom/video.wpy
View file @
356617a7
...
...
@@ -236,7 +236,8 @@
id,
photoUrl: encodeURIComponent(photoUrl),
name,
chance: getProbability(this.userAccount, coinQuantity)
chance: getProbability(this.userAccount, coinQuantity),
coinQuantity
});
}
},
...
...
src/pages/index.wpy
View file @
356617a7
...
...
@@ -234,6 +234,7 @@
import { debounce, compressShareImage } from '../common/utils';
import Notify from '../components/vant/notify/notify';
import Dialog from '../components/vant/dialog/dialog';
import {getProbability} from '../common/raffleProbability';
import { login, register, getMainInfo, addGold, getPrizeList, signIn, getActivityFeed, checkCornCode } from '../common/api.js';
let flag = false;
wepy.page({
...
...
@@ -334,26 +335,23 @@
console.error(res.errCode);
});
const { coins } = await signIn();
wepy.wx.hideLoading();
if (coins === 0) return;
that.mainInfo.account.quantity = coins;
}, 700)();
} else {
wepy.wx.hideLoading();
}
} else {
wepy.wx.hideLoading();
}
},
fail (res) {
console.error('requestSubscribeMessage fail', res);
},
complete() {
wepy.wx.hideLoading();
}
});
},
getAwards: function() {
const { id, photoUrl, name, c
hance
} = this.awardsInfo;
const { id, photoUrl, name, c
oinQuantity
} = this.awardsInfo;
if ((!id && id !== 0) || !this.mainInfo || !this.mainInfo.account) {
Notify({ message: '服务器异常,请稍后重试', safeAreaInsetTop: true });
return;
...
...
@@ -367,8 +365,10 @@
return;
}
const userCoins = this.mainInfo.account.quantity;
const chance = getProbability(userCoins, coinQuantity);
wx.navigateTo({
url: `/pages/raffle?prizeId=${id}&chance=${chance}&photoUrl=${photoUrl}&quantity=${
this.mainInfo.account.quantity
}&name=${name}`
url: `/pages/raffle?prizeId=${id}&chance=${chance}&photoUrl=${photoUrl}&quantity=${
userCoins
}&name=${name}`
});
},
getAwardsInfo: function(v) {
...
...
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