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
1bf10dd6
Commit
1bf10dd6
authored
Jun 12, 2020
by
zhijie.xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
回滚资源到代码目录
parent
32b474b8
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
22 deletions
+22
-22
raffleProbability.js
src/common/raffleProbability.js
+1
-1
prizeList.wpy
src/components/custom/prizeList.wpy
+3
-2
index.wpy
src/pages/index.wpy
+1
-5
raffle.wpy
src/pages/raffle.wpy
+17
-14
No files found.
src/common/raffleProbability.js
View file @
1bf10dd6
...
...
@@ -9,7 +9,7 @@ function getCommonDivisor(firstNum, secondNum) {
function
getProbability
(
quantity
,
coinQuantity
)
{
// 如果用户克币数是0
if
(
quantity
===
0
)
{
return
'
0
/
'
+
coinQuantity
;
return
'
0
'
;
}
var
divisor
=
getCommonDivisor
(
quantity
,
coinQuantity
);
var
value
=
quantity
/
divisor
;
...
...
src/components/custom/prizeList.wpy
View file @
1bf10dd6
...
...
@@ -23,7 +23,6 @@
width: 100%;
}
.rightcont {
font-size: @font-normal;
position: absolute;
z-index: 9;
bottom: 415rpx;
...
...
@@ -161,7 +160,9 @@
let detail = await getAwardsDetail({ prizeId: id });
detail = detail || {};
if (detail.join > detail.quantity) detail.join = detail.quantity;
const progress = Math.round((detail.join / detail.quantity) * 100) + '%';
const progressFloat = detail.join / detail.quantity;
let progress = Math.round(progressFloat * 100) + '%';
if (progressFloat > 0 && progressFloat < 1) progress = '1%';
this.curQueue.forEach(v => {
if (v.id === id) {
...
...
src/pages/index.wpy
View file @
1bf10dd6
...
...
@@ -255,11 +255,7 @@
}
}
wx.requestSubscribeMessage({
tmplIds: [
'xbA7XopO2j0V0Ne0F61UzSxoyfKrf92GQk6Z4pQvnd4',
'_yZWJYT-3lGCQG6g7Wa7F-0zxvGaPe4zwAI9D4zW4EY',
'7YzXgiVNGXiRvXNmR6WUtH_WplUyo97eAy45dsyviKQ'
],
tmplIds,
success (res) {
console.log('requestSubscribeMessage success', res);
if (res.errMsg === 'requestSubscribeMessage:ok') {
...
...
src/pages/raffle.wpy
View file @
1bf10dd6
...
...
@@ -257,7 +257,7 @@
store,
data: {
progress: '0%',
progressStyle: '',
progressStyle: '
width:0%
',
isCheck: true,
batchId: null,
quantity: '',
...
...
@@ -270,8 +270,8 @@
innerActivity: '',
isError: false,
code: '',
errorText:'',
errorBtn:
'确定',
errorText:
'',
errorBtn:
'确定'
},
methods: {
check() {
...
...
@@ -294,7 +294,7 @@
if (detail.encryptedData) {
this.btnfont = '参与中...';
wx.checkSession({
success (){
success ()
{
goprize();
},
async fail () {
...
...
@@ -323,8 +323,8 @@
this.btnfont = '立即参与';
let code = data.joinCode;
if (code === undefined) code = 3;
//参与抽奖成功
if(+code === 0) {
//
参与抽奖成功
if
(+code === 0) {
wx.setStorageSync('userJoin', 1);
}
Dialog.alert({
...
...
@@ -357,7 +357,10 @@
this.batchId = detail.id;
if (detail.quantity) {
if (detail.join > detail.quantity) detail.join = detail.quantity;
this.progress = Math.round((detail.join / detail.quantity) * 100) + '%';
const progressFloat = detail.join / detail.quantity;
this.progress = Math.round(progressFloat * 100) + '%';
// 当进度介于0 - 1之间时显示1
if (progressFloat > 0 && progressFloat < 1) this.progress = '1%';
this.progressStyle = 'width:' + this.progress;
}
},
...
...
@@ -373,12 +376,12 @@
this.code = '';
},
checkCode () {
if(this.code === '') {
if
(this.code === '') {
this.errorText = '请输入邀请码';
this.isError = true;
return;
}
if(this.errorBtn !== '确定') {
if
(this.errorBtn !== '确定') {
return;
}
this.errorBtn = '验证中...';
...
...
@@ -388,12 +391,12 @@
this.closeModal();
this.confirmRaff();
} else {
let index = data.checkCode
+
2;
let mesg = ['邀请码错误,请重新输入',
'该邀请码已被使用,请重新输入']
let index = data.checkCode
+
2;
let mesg = ['邀请码错误,请重新输入',
'该邀请码已被使用,请重新输入'];
this.errorText = mesg[index];
this.isError = true;
}
}).catch(()
=>
{
}).catch(()
=>
{
this.errorBtn = '确定';
});
}
...
...
@@ -408,8 +411,8 @@
}
},
watch: {
code(val,oldval) {
if (val
!==
oldval && this.isError) {
code(val,
oldval) {
if (val
!==
oldval && this.isError) {
this.isError = false;
}
}
...
...
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