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
44816998
Commit
44816998
authored
Jun 05, 2020
by
ziyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:细节优化
parent
bd9275d7
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
18 deletions
+24
-18
wxRequest.js
src/common/wxRequest.js
+5
-5
videolist.wpy
src/components/custom/videolist.wpy
+3
-2
index.wpy
src/pages/index.wpy
+9
-6
prize.wpy
src/pages/prize.wpy
+0
-1
raffle.wpy
src/pages/raffle.wpy
+7
-4
No files found.
src/common/wxRequest.js
View file @
44816998
import
wepy
from
'
@wepy/core
'
;
import
Notify
from
'
../components/vant/notify/notify
'
;
const
env
=
'
test
'
;
//每次上线手动切换成 prod/test
const
env
=
'
test
'
;
//
每次上线手动切换成 prod/test
let
baseUrl
=
'
https://api-luckii.q-gp.com
'
;
if
(
env
===
'
test
'
)
{
baseUrl
=
'
https://luckii-qa.liangkebang.net
'
if
(
env
===
'
test
'
)
{
baseUrl
=
'
https://luckii-qa.liangkebang.net
'
;
}
const
request
=
async
(
url
,
options
)
=>
{
const
pages
=
getCurrentPages
();
...
...
@@ -42,10 +42,10 @@ const request = async (url, options) => {
return
res
.
data
.
data
;
}
Notify
({
message
:
'
服务器异常,请稍后重试
'
,
background
:
'
#FF5D15
'
,
safeAreaInsetTop
});
throw
new
Error
(
res
.
data
.
msg
||
'
服务器异常,请求url:
'
+
url
);
throw
new
Error
(
res
.
data
.
msg
||
'
服务器异常,请求url:
'
+
url
);
}
Notify
({
message
:
'
服务器异常,请稍后重试
'
,
background
:
'
#FF5D15
'
,
safeAreaInsetTop
});
throw
new
Error
(
res
.
data
.
msg
||
'
服务器异常,请求url:
'
+
url
);
throw
new
Error
(
res
.
data
.
msg
||
'
服务器异常,请求url:
'
+
url
);
});
};
...
...
src/components/custom/videolist.wpy
View file @
44816998
...
...
@@ -195,7 +195,8 @@
this.prevQueue = [...this.prevQueue];
},
async getProgress(id) {
const detail = await getAwardsDetail({ prizeId: id });
let detail = await getAwardsDetail({ prizeId: id });
detail = detail || {};
const progress = Math.round((detail.join / detail.quantity) * 100) + '%';
this.nextQueue.forEach(v => {
if (v.id === id) {
...
...
@@ -329,7 +330,7 @@
photoUrl,
quantity: this.userAccount,
name,
chance: probability
,
chance: probability
});
// this._videoContexts.forEach((ctx, index) => {
// if (index !== current) {
...
...
src/pages/index.wpy
View file @
44816998
...
...
@@ -325,7 +325,7 @@
showAwardsModal: false,
awardsInfo: {},
isReceive: false,
isActiveDone:
'',
isActiveDone:
''
},
computed: {
...
...
@@ -606,7 +606,9 @@
getSharedGold: async function(v) {
this.showShareModal = false;
await addGold(v);
this.mainInfo.account.quantity += v.quantity;
let account = this.mainInfo.account || {};
let quantity = account.quantity || 0;
this.mainInfo.account.quantity = quantity + v.quantity;
this.isReceive = true;
setTimeout(() => {
if (this.mainInfo.joinRecord && this.mainInfo.joinRecord.id) {
...
...
@@ -616,7 +618,7 @@
},
getMainInfo: async function() {
this.mainInfo = await getUserInfo(wx.getStorageSync('openId'));
this.sign = this.mainInfo.signin;
this.sign = this.mainInfo
&& this.mainInfo
.signin;
wx.setStorageSync('hasPhone', this.mainInfo.phone);
if (this.mainInfo.inviteRecord && this.mainInfo.inviteRecord.length) {
this.showShareModal = true;
...
...
@@ -643,9 +645,9 @@
const lastIndex = this.activityList.length - this.activityDisplayItems;
if (e.$wx.detail.current === lastIndex) {
this.isActiveDone = 'anima';
setTimeout(()
=>
{
setTimeout(()
=>
{
this.isActiveDone = 'anima hide';
},
2000)
},
2000);
}
}
},
...
...
@@ -661,7 +663,8 @@
if (!wx.getStorageSync('openId')) {
const { code } = await wepy.wx.login();
const userInfo = await login(code);
let userInfo = await login(code);
userInfo = userInfo || {};
wx.setStorageSync('openId', userInfo.openid);
wx.setStorageSync('isRegister', userInfo.register);
}
...
...
src/pages/prize.wpy
View file @
44816998
...
...
@@ -202,7 +202,6 @@
if (!joinRecordId) Notify({message: '缺少参数错误!', background: '#FF5D15'});
// 请求接口得到数据
getOneRaffle({joinRecordId: joinRecordId}).then(data => {
console.log(555, data);
let dat = data || {};
this.prize = dat.prize;
this.quantity = dat.quantity;
...
...
src/pages/raffle.wpy
View file @
44816998
...
...
@@ -234,11 +234,14 @@
}
},
async getProgress(id) {
const detail = await getAwardsDetail({ prizeId: id });
let detail = await getAwardsDetail({ prizeId: id });
detail = detail || {};
this.batchId = detail.id;
this.progress = Math.round((detail.join / detail.quantity) * 100) + '%';
this.progressStyle = 'width:' + this.progress;
},
if (detail.quantity) {
this.progress = Math.round((detail.join / detail.quantity) * 100) + '%';
this.progressStyle = 'width:' + this.progress;
}
}
},
computed: {
opentype() {
...
...
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