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
2fee3ff7
Commit
2fee3ff7
authored
Jun 05, 2020
by
付清曌
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/optimize3' into 'master'
Feature/optimize3 See merge request
!36
parents
8cf89b36
7e9f6105
Changes
7
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
73 additions
and
42 deletions
+73
-42
.eslintcache
.eslintcache
+1
-1
wxRequest.js
src/common/wxRequest.js
+7
-4
videolist.wpy
src/components/custom/videolist.wpy
+3
-2
help.wpy
src/pages/help.wpy
+1
-1
index.wpy
src/pages/index.wpy
+30
-12
prize.wpy
src/pages/prize.wpy
+0
-1
raffle.wpy
src/pages/raffle.wpy
+31
-21
No files found.
.eslintcache
View file @
2fee3ff7
This diff is collapsed.
Click to expand it.
src/common/wxRequest.js
View file @
2fee3ff7
import
wepy
from
'
@wepy/core
'
;
import
Notify
from
'
../components/vant/notify/notify
'
;
const
baseUrl
=
'
https://luckii-qa.liangkebang.net
'
;
const
env
=
'
test
'
;
// 每次上线手动切换成 prod/test
let
baseUrl
=
'
https://api-luckii.q-gp.com
'
;
if
(
env
===
'
test
'
)
{
baseUrl
=
'
https://luckii-qa.liangkebang.net
'
;
}
const
request
=
async
(
url
,
options
)
=>
{
const
pages
=
getCurrentPages
();
const
safeAreaInsetTop
=
pages
&&
pages
.
length
>
0
?
pages
[
pages
.
length
-
1
].
route
===
'
pages/index
'
:
false
;
...
...
@@ -39,10 +42,10 @@ const request = async (url, options) => {
return
res
.
data
.
data
;
}
Notify
({
message
:
'
服务器异常,请稍后重试
'
,
background
:
'
#FF5D15
'
,
safeAreaInsetTop
});
throw
new
Error
(
res
.
data
.
msg
||
'
服务器异常
,请稍后重试
'
);
throw
new
Error
(
res
.
data
.
msg
||
'
服务器异常
,请求url:
'
+
url
);
}
Notify
({
message
:
'
服务器异常,请稍后重试
'
,
background
:
'
#FF5D15
'
,
safeAreaInsetTop
});
throw
new
Error
(
res
.
data
.
msg
||
'
服务器异常
,请稍后重试
'
);
throw
new
Error
(
res
.
data
.
msg
||
'
服务器异常
,请求url:
'
+
url
);
});
};
...
...
src/components/custom/videolist.wpy
View file @
2fee3ff7
...
...
@@ -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/help.wpy
View file @
2fee3ff7
...
...
@@ -43,7 +43,7 @@
<view class="help-info">
<view>1.打卡:每次可获得1克币,每天仅限打卡一次;</view>
<view>2.分享:通过分享每次邀请1名新的好友参加,即可获得10克币;</view>
<
!--<view>3.购买:通过在Luckii购买产品即可获得克币,克币数量根据购买产品价格而定。</view>--
>
<
view>3.购买:通过在Luckii购买产品即可获得克币,克币数量根据购买产品价格而定。</view
>
</view>
<view class="help-title">如何使用克币?</view>
<view class="help-info">
...
...
src/pages/index.wpy
View file @
2fee3ff7
...
...
@@ -41,6 +41,14 @@
height: 80rpx;
border-radius: 50%;
}
@-webkit-keyframes fadeout {
0% {
opacity:1 ;
}
100% {
opacity: 0;
}
}
.content{
position: absolute;
z-index: 9;
...
...
@@ -48,6 +56,12 @@
width: 100%;
color: white;
clear: both;
&.anima {
animation:fadeout 2s;
}
&.hide {
display: none;
}
}
.leftcont {
width: 44%;
...
...
@@ -206,15 +220,15 @@
<video-lottery type="lottery" des="抽奖" @getAwards="getAwards" @getUserInfo="getUserInfo" :authmodal="authmodal"></video-lottery>
<video-share type="share" des="分享"></video-share>
</view>
<view class="content
"
>
<view class="content
{{isActiveDone}}"
>
<view class="leftcont">
<swiper
class="list-wrapper"
vertical="{{true}}"
circular="{{
fals
e}}"
circular="{{
tru
e}}"
display-multiple-items="{{activityDisplayItems}}"
bindchange="onActivityChange"
autoplay="{{
autoplayActivity
}}"
autoplay="{{
isAuto
}}"
interval="1500">
<swiper-item wx:for="{{activityList}}" wx:key="index" catch:touchmove>
<view class="imgwrap">
...
...
@@ -285,13 +299,10 @@
data: {
list: [], // 商品list
// 活动信息
activityList: [],
activityDisplayItems: 2,
current: 5, // 商品列表初次展示第几个
// userInfo: {},
swiperItem: 2,
videoList: [],
length: 4,
...
...
@@ -314,7 +325,8 @@
showAwardsModal: false,
awardsInfo: {},
isReceive: false,
autoplayActivity: false
isActiveDone: '',
isAuto:true,
},
computed: {
...
...
@@ -595,7 +607,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) {
...
...
@@ -605,7 +619,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;
...
...
@@ -627,12 +641,15 @@
// 1期方案先一次取50
const list = await getActivityFeed({ count: 50 });
this.activityList = list;
this.autoplayActivity = true;
},
onActivityChange(e) {
const lastIndex = this.activityList.length - this.activityDisplayItems;
if (e.$wx.detail.current === lastIndex) {
this.autoplayActivity = false;
this.isActiveDone = 'anima';
setTimeout(() => {
this.isActiveDone = 'anima hide';
this.isAuto = false;
}, 2000);
}
}
},
...
...
@@ -648,7 +665,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 @
2fee3ff7
...
...
@@ -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 @
2fee3ff7
...
...
@@ -85,15 +85,32 @@
margin-top:25rpx;
height:50rpx;
line-height: 50rpx;
.checkimg {
.checkimg{
display: inline-block;
width:24rpx;
height:24rpx;
border:3rpx solid #aaa;
border-radius: 4rpx;
vertical-align: middle;
margin-right:10rpx;
position: relative;
&.checked{
background-color: #FF5D15;
border:3rpx solid #FF5D15;
}
}
.checkicon {
position: absolute;
top:0;
left:0;
right:0;bottom:0;margin:0 auto;
&.hide {
display: none;
}
}
.checktext{
top: 2
rpx;
margin-left:10
rpx;
position: relative;
top:3rpx;
}
}
.joinin {
...
...
@@ -127,7 +144,9 @@
</view>
</view>
<view class="user-wish" bindtap="check">
<image src="{{imgsrc}}" class="checkimg"></image>
<view class="checkimg {{isCheck?'checked':''}}">
<van-icon name="success" color="#fff" size="24rpx" class="checkicon {{isCheck?'':'hide'}}"/>
</view>
<text class="checktext">我同意花费所有克币参与抽奖,并承诺商品不退货。</text>
</view>
<button class="joinin" open-type="{{opentype}}" bindtap="joinin" bindgetphonenumber="getPhoneNumber">{{btnfont}}</button>
...
...
@@ -215,22 +234,16 @@
}
},
async getProgress(id) {
const detail = await getAwardsDetail({ prizeId: id });
let detail = await getAwardsDetail({ prizeId: id });
detail = detail || {};
this.batchId = detail.id;
if (detail.quantity) {
this.progress = Math.round((detail.join / detail.quantity) * 100) + '%';
this.progressStyle = 'width:' + this.progress;
},
},
computed: {
imgsrc() {
let imgsrc = '/static/images/selected.png';
if (this.isCheck) {
imgsrc = '/static/images/selected.png';
} else {
imgsrc = '/static/images/selectno.png';
}
return imgsrc;
}
},
computed: {
opentype() {
if (this.isCheck && !this.hasPhone) {
return 'getPhoneNumber';
...
...
@@ -242,10 +255,6 @@
onLoad (query) {
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.quantity = quantity || '';
this.name = name;
...
...
@@ -262,6 +271,7 @@
"van-image": "../components/vant/image/index",
"van-loading": "../components/vant/loading/index",
"van-dialog": "../components/vant/dialog/index",
"van-icon": "../components/vant/icon/index",
}
}
</config>
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