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
cef69292
Commit
cef69292
authored
Jun 10, 2020
by
ziyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improvement: 优化
parent
fbc7b073
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
index.wpy
src/pages/index.wpy
+6
-1
raffle.wpy
src/pages/raffle.wpy
+5
-0
No files found.
src/pages/index.wpy
View file @
cef69292
...
@@ -388,7 +388,7 @@
...
@@ -388,7 +388,7 @@
// 获取openid
// 获取openid
await this.getOpenId();
await this.getOpenId();
// 获取用户信息并注册
// 获取用户信息并注册
if (this.userInfo.nickName) {
if (this.userInfo.nickName) {
this.registUser(this.userInfo);
this.registUser(this.userInfo);
...
@@ -411,6 +411,11 @@
...
@@ -411,6 +411,11 @@
this.videoList = await getPrizeList();
this.videoList = await getPrizeList();
},
},
async onShow() {
async onShow() {
let join = wx.getStorageSync('userJoin');
if (join == 1) {
wx.removeStorageSync('userJoin');
this.showActivity();
}
}
}
});
});
...
...
src/pages/raffle.wpy
View file @
cef69292
...
@@ -318,6 +318,10 @@
...
@@ -318,6 +318,10 @@
this.btnfont = '立即参与';
this.btnfont = '立即参与';
let code = data.joinCode;
let code = data.joinCode;
if (code === undefined) code = 3;
if (code === undefined) code = 3;
//参与抽奖成功
if(+code === 0) {
wx.setStorageSync('userJoin', 1);
}
Dialog.alert({
Dialog.alert({
title: title[code],
title: title[code],
message: message[code]
message: message[code]
...
@@ -347,6 +351,7 @@
...
@@ -347,6 +351,7 @@
detail = detail || {};
detail = detail || {};
this.batchId = detail.id;
this.batchId = detail.id;
if (detail.quantity) {
if (detail.quantity) {
if (detail.join > detail.quantity) detail.join = detail.quantity;
this.progress = Math.round((detail.join / detail.quantity) * 100) + '%';
this.progress = Math.round((detail.join / detail.quantity) * 100) + '%';
this.progressStyle = 'width:' + this.progress;
this.progressStyle = 'width:' + this.progress;
}
}
...
...
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