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
8cf89b36
Commit
8cf89b36
authored
Jun 05, 2020
by
付清曌
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/optimize2' into 'master'
feat: 改成测试环境,修改bug See merge request
!35
parents
13765a50
860d0e5c
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
42 additions
and
43 deletions
+42
-43
app.wpy
src/app.wpy
+1
-1
wxRequest.js
src/common/wxRequest.js
+1
-1
videolist.wpy
src/components/custom/videolist.wpy
+12
-13
index.wpy
src/pages/index.wpy
+13
-13
raffle.wpy
src/pages/raffle.wpy
+15
-15
No files found.
src/app.wpy
View file @
8cf89b36
<style>
page {
font-family: 'PingFangSC-Regular';
font-family: 'PingFangSC-Regular'
,monospace
;
width:100%;
height:100%;
background-color:#F1F1F1;
...
...
src/common/wxRequest.js
View file @
8cf89b36
import
wepy
from
'
@wepy/core
'
;
import
Notify
from
'
../components/vant/notify/notify
'
;
const
baseUrl
=
'
https://
api-luckii.q-gp.com
'
;
const
baseUrl
=
'
https://
luckii-qa.liangkebang.net
'
;
const
request
=
async
(
url
,
options
)
=>
{
const
pages
=
getCurrentPages
();
...
...
src/components/custom/videolist.wpy
View file @
8cf89b36
...
...
@@ -35,15 +35,15 @@
position: relative;
.text {
position: absolute;
top:
0;
left:
0;
width:
100%;
height:
100%;
top:0;
left:0;
width:100%;
height:100%;
z-index: 2;
background-color: transparent;
text-align: center;
line-height:20rpx;
background-color: transparent;
font-size: 18rpx;
line-height: 20rpx;
}
.orange {
width: 0;
...
...
@@ -159,7 +159,7 @@
this.loading = false;
if (!newVal.length) return;
this._videoListChanged(newVal);
this.compute(this.userAccount);
//
this.compute(this.userAccount);
},
userAccount(newVal) {
this.compute(newVal);
...
...
@@ -178,7 +178,6 @@
methods: {
compute (newVal) {
if (!this.curQueue.length) return;
this.nextQueue.forEach(v => {
v.probability = getProbability(+newVal, +v.coinQuantity);
});
...
...
@@ -235,6 +234,7 @@
});
if (!this.curQueue.length) {
this.curQueue = this.nextQueue.splice(0, 3);
this.compute(this.userAccount);
this.playCurrent(1);
}
},
...
...
@@ -320,17 +320,16 @@
this.curQueue = [...this.curQueue];
}
},
async
playCurrent(current) {
playCurrent(current) {
if (!this.curQueue || this.curQueue.length <= 1) return;
await
this.getProgress(this.curQueue[current].id);
const {
batchId, photoUrl, name, probability, progress
} = this.curQueue[current];
this.getProgress(this.curQueue[current].id);
const {
id, photoUrl, name, probability
} = this.curQueue[current];
this.$emit('getAwardsInfo', {
batchI
d,
i
d,
photoUrl,
quantity: this.userAccount,
name,
chance: probability,
progress: progress
});
// this._videoContexts.forEach((ctx, index) => {
// if (index !== current) {
...
...
src/pages/index.wpy
View file @
8cf89b36
...
...
@@ -573,8 +573,8 @@
};
},
getAwards: function() {
const {
batchId, photoUrl, quantity, name, chance, progress
} = this.awardsInfo;
if (!
batchI
d || !this.mainInfo || !this.mainInfo.account) {
const {
id, photoUrl, quantity, name, chance
} = this.awardsInfo;
if (!
i
d || !this.mainInfo || !this.mainInfo.account) {
Notify({ message: '服务器异常,请稍后重试', background: '#FF5D15', safeAreaInsetTop: true });
return;
}
...
...
@@ -583,7 +583,7 @@
return;
}
wx.navigateTo({
url: `/pages/raffle?
batchId=${batchId}&progress=${progress
}&chance=${chance}&photoUrl=${photoUrl}&quantity=${quantity}&name=${name}`
url: `/pages/raffle?
prizeId=${id
}&chance=${chance}&photoUrl=${photoUrl}&quantity=${quantity}&name=${name}`
});
},
getAwardsInfo: function(v) {
...
...
src/pages/raffle.wpy
View file @
8cf89b36
...
...
@@ -139,7 +139,7 @@
import wepy from '@wepy/core';
import Notify from '../components/vant/notify/notify';
import Dialog from '../components/vant/dialog/dialog';
import { updateUserPhone, confirmRaffle, register } from '../common/api';
import { updateUserPhone, confirmRaffle, register
, login, getAwardsDetail
} from '../common/api';
import store from '../store';
wepy.page({
store,
...
...
@@ -174,15 +174,9 @@
}
if (detail.encryptedData) {
this.btnfont = '提交中...';
wx.checkSession({
success () {
const { code } = await wepy.wx.login();
await login(code);
goprize();
},
async fail () {
await wepy.wx.login();
goprize();
}
});
} else {
Notify({message: '参与失败,请重新授权!', background: '#FF5D15'});
}
...
...
@@ -219,7 +213,13 @@
if (this.hasPhone) {
this.confirmRaff();
}
}
},
async getProgress(id) {
const detail = await getAwardsDetail({ prizeId: id });
this.batchId = detail.id;
this.progress = Math.round((detail.join / detail.quantity) * 100) + '%';
this.progressStyle = 'width:' + this.progress;
},
},
computed: {
imgsrc() {
...
...
@@ -240,13 +240,13 @@
}
},
onLoad (query) {
let {batchId, quantity, name, chance, photoUrl, progress} = query;
if (progress) {
let {prizeId, quantity, name, chance, photoUrl} = query;
this.getProgress(prizeId);
/*if (progress) {
this.progress = progress;
this.progressStyle = 'width:' + progress;
}
}
*/
this.hasPhone = wx.getStorageSync('hasPhone');
this.batchId = batchId;
this.quantity = quantity || '';
this.name = name;
this.chance = chance;
...
...
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