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
b047f4b7
Commit
b047f4b7
authored
Jun 23, 2020
by
ziyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improvement: youhua
parent
c0414228
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
72 additions
and
24 deletions
+72
-24
app.wpy
src/app.wpy
+2
-1
video.wpy
src/components/custom/video.wpy
+26
-18
agreement.wpy
src/pages/agreement.wpy
+15
-0
index.wpy
src/pages/index.wpy
+19
-4
raffle.wpy
src/pages/raffle.wpy
+9
-1
search.wpy
src/pages/search.wpy
+1
-0
No files found.
src/app.wpy
View file @
b047f4b7
...
@@ -52,7 +52,8 @@ wepy.app({
...
@@ -52,7 +52,8 @@ wepy.app({
'pages/prize',
'pages/prize',
'pages/myraffles',
'pages/myraffles',
'pages/help',
'pages/help',
'pages/search'
'pages/search',
'pages/agreement'
],
],
window: {
window: {
backgroundTextStyle: 'light',
backgroundTextStyle: 'light',
...
...
src/components/custom/video.wpy
View file @
b047f4b7
<
wxs module="video" src="../../common/common.wxs"></wxs
>
<
!--<wxs module="video" src="../../common/common.wxs"></wxs>--
>
<template>
<template>
<view class="container">
<view class="container">
<swiper
<swiper
class="video-swiper"
class="video-swiper"
duration="
6
00"
duration="
7
00"
circular="{{circular}}"
circular="{{circular}}"
vertical
vertical
current="
0
"
current="
1
"
bindchange="moveSwiper"
bindchange="moveSwiper"
bindanimationfinish="animationfinish">
bindanimationfinish="animationfinish">
<swiper-item wx:for="{{curQueue}}" wx:key="index">
<swiper-item wx:for="{{curQueue}}" wx:key="index">
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
enable-progress-gesture
enable-progress-gesture
show-center-play-btn="{{false}}"
show-center-play-btn="{{false}}"
controls="{{false}}"
controls="{{false}}"
src="{{
video.showVideo(item,currentIndex,index)?item.videoUrl:nul
l}}"
src="{{
item.videoUr
l}}"
data-id="{{item.id}}"
data-id="{{item.id}}"
object-fit="contain"
object-fit="contain"
data-index="{{index}}"
data-index="{{index}}"
...
@@ -67,10 +67,10 @@
...
@@ -67,10 +67,10 @@
nextQueue: [],
nextQueue: [],
prevQueue: [],
prevQueue: [],
curQueue: [],
curQueue: [],
circular:
fals
e,
circular:
tru
e,
_last:
0
,
_last:
1
,
_invalidUp: 0,
_invalidUp: 0,
_invalidDown:
1
,
_invalidDown:
0
,
_videoContexts: [],
_videoContexts: [],
currentIndex:0,
currentIndex:0,
videoPause: false,
videoPause: false,
...
@@ -112,14 +112,19 @@
...
@@ -112,14 +112,19 @@
_videoListChanged (newVal) {
_videoListChanged (newVal) {
const _this = this;
const _this = this;
if (this.curQueue.length === 0) {
if (this.curQueue.length === 0) {
//因为列表默认展示1的位置,而后端逻辑会把要展示的放在0的位置,所以交换位置,展示出来
newVal.forEach(function (item,index) {
newVal.forEach(function (item,index) {
if(index < 3) {
if(index === 1) {
_this.curQueue.push(item);
_this.curQueue[0] = item;
}else {
}else if (index === 0){
_this.curQueue[1] = item;
}else if (index === 2) {
_this.curQueue[2] = item;
} else {
_this.nextQueue.push(item);
_this.nextQueue.push(item);
}
}
});
});
this.playCurrent(
0
);
this.playCurrent(
1
);
}else{
}else{
//新进入的数组要去重
//新进入的数组要去重
const curIds = this.curQueue.map(item => item.id);
const curIds = this.curQueue.map(item => item.id);
...
@@ -211,6 +216,7 @@
...
@@ -211,6 +216,7 @@
index !== current ? ctx.pause() : ctx.play();
index !== current ? ctx.pause() : ctx.play();
}
}
});
});
this.updateAwardsInfo(current)
},
},
videoTap(e) {
videoTap(e) {
const current = e.currentTarget.dataset.index;
const current = e.currentTarget.dataset.index;
...
@@ -224,13 +230,15 @@
...
@@ -224,13 +230,15 @@
}
}
},
},
updateAwardsInfo(current) {
updateAwardsInfo(current) {
const { id, photoUrl, name, probability } = this.curQueue[current];
if(this.curQueue[current]) {
this.$emit('getAwardsInfo', {
const { id, photoUrl, name, probability } = this.curQueue[current];
id,
this.$emit('getAwardsInfo', {
photoUrl: encodeURIComponent(photoUrl),
id,
name,
photoUrl: encodeURIComponent(photoUrl),
chance: probability
name,
});
chance: probability
});
}
},
},
async getProgress(id) {
async getProgress(id) {
if (id <= 0) return;
if (id <= 0) return;
...
...
src/pages/agreement.wpy
0 → 100644
View file @
b047f4b7
<template>
<web-view src="https://luckii.q-gp.com/agreement.html"></web-view>
</template>
<script>
import wepy from '@wepy/core';
wepy.page({
data: {
}
});
</script>
<config>
{
}
</config>
src/pages/index.wpy
View file @
b047f4b7
...
@@ -221,7 +221,7 @@
...
@@ -221,7 +221,7 @@
<!--活动图片弹窗-->
<!--活动图片弹窗-->
<van-popup show="{{ avtivityModal }}" bind:close="ModalClose" round closeable>
<van-popup show="{{ avtivityModal }}" bind:close="ModalClose" round closeable>
<view class="img-wrapper">
<view class="img-wrapper">
<van-image use-loading-slot src="
https://luckiistatic.q-gp.com/product-1.png
" width="400rpx" fit="widthFix" radius="10rpx">
<van-image use-loading-slot src="
{{ mainInfo.activity }}
" width="400rpx" fit="widthFix" radius="10rpx">
<van-loading slot="loading" type="spinner" size="30" vertical />
<van-loading slot="loading" type="spinner" size="30" vertical />
</van-image>
</van-image>
</view>
</view>
...
@@ -407,12 +407,16 @@
...
@@ -407,12 +407,16 @@
this.mainInfo = await getMainInfo();
this.mainInfo = await getMainInfo();
this.sign = this.mainInfo && this.mainInfo.signin;
this.sign = this.mainInfo && this.mainInfo.signin;
wx.setStorageSync('hasPhone', this.mainInfo.phone);
wx.setStorageSync('hasPhone', this.mainInfo.phone);
const show = wx.getStorageSync('hasShowActivity');
if (this.mainInfo && this.mainInfo.innerActivity) {
if (this.mainInfo && this.mainInfo.innerActivity) {
wx.setStorageSync('innerActivity', this.mainInfo.innerActivity);
wx.setStorageSync('innerActivity', this.mainInfo.innerActivity);
} else {
} else {
wx.setStorageSync('innerActivity', '');
wx.setStorageSync('innerActivity', '');
}
}
if (this.mainInfo.inviteRecord && this.mainInfo.inviteRecord.length) {
// 弹窗有多个,展示顺序 1、活动弹窗 2、邀请好友 3、购买获得克币 4、开奖宝箱
if(this.mainInfo.activity && !show) {
this.avtivityModal = true;
} else if (this.mainInfo.inviteRecord && this.mainInfo.inviteRecord.length) {
this.showModal = 1;
this.showModal = 1;
} else if (this.mainInfo.buyRecord && this.mainInfo.buyRecord.length) {
} else if (this.mainInfo.buyRecord && this.mainInfo.buyRecord.length) {
//购买获得金币
//购买获得金币
...
@@ -449,8 +453,19 @@
...
@@ -449,8 +453,19 @@
this.cornModal = true;
this.cornModal = true;
},
},
ModalClose() {
ModalClose() {
this.cornModal = false;
this.cornModal && (this.cornModal = false);
this.avtivityModal = false;
if(this.avtivityModal) {
wx.setStorageSync('hasShowActivity', 1);
this.avtivityModal = false;
if (this.mainInfo.inviteRecord && this.mainInfo.inviteRecord.length) {
this.showModal = 1;
} else if (this.mainInfo.buyRecord && this.mainInfo.buyRecord.length) {
//购买获得金币
this.showModal = 4;
} else if (this.mainInfo.joinRecord && this.mainInfo.joinRecord.id) {
this.showModal = 2;
}
}
},
},
checkCode() {
checkCode() {
if (this.cornCode === '') {
if (this.cornCode === '') {
...
...
src/pages/raffle.wpy
View file @
b047f4b7
...
@@ -110,6 +110,9 @@
...
@@ -110,6 +110,9 @@
margin-left:10rpx;
margin-left:10rpx;
position: relative;
position: relative;
top:3rpx;
top:3rpx;
&.red {
color:@maincolor
}
}
}
}
}
.joinin {
.joinin {
...
@@ -227,7 +230,9 @@
...
@@ -227,7 +230,9 @@
<view class="checkimg {{isCheck?'checked':''}}">
<view class="checkimg {{isCheck?'checked':''}}">
<van-icon name="success" color="#fff" size="24rpx" class="checkicon {{isCheck?'':'hide'}}"/>
<van-icon name="success" color="#fff" size="24rpx" class="checkicon {{isCheck?'':'hide'}}"/>
</view>
</view>
<text class="checktext">我同意花费所有克币参与抽奖,并承诺商品不退货。</text>
<text class="checktext">阅读</text>
<text class="checktext red" catchtap="toAgreement">《隐私协议》</text>
<text class="checktext">并同意花费所有克币参与抽奖且商品不退货</text>
</view>
</view>
<button class="joinin" open-type="{{opentype}}" bindtap="joinin" bindgetphonenumber="getPhoneNumber">{{btnfont}}</button>
<button class="joinin" open-type="{{opentype}}" bindtap="joinin" bindgetphonenumber="getPhoneNumber">{{btnfont}}</button>
<van-notify id="van-notify" />
<van-notify id="van-notify" />
...
@@ -380,6 +385,9 @@
...
@@ -380,6 +385,9 @@
this.isError = false;
this.isError = false;
this.code = '';
this.code = '';
},
},
toAgreement() {
wx.navigateTo({url:'/pages/agreement'});
},
checkCode () {
checkCode () {
if (this.code === '') {
if (this.code === '') {
this.errorText = '请输入邀请码';
this.errorText = '请输入邀请码';
...
...
src/pages/search.wpy
View file @
b047f4b7
...
@@ -55,6 +55,7 @@
...
@@ -55,6 +55,7 @@
},
},
getList(val) {
getList(val) {
this.isLoading = true;
this.isLoading = true;
this.isDone = false;
getSearchList({keyword:val,page:page}).then(data=>{
getSearchList({keyword:val,page:page}).then(data=>{
this.isLoading = false;
this.isLoading = false;
if(!data.hasMore) {
if(!data.hasMore) {
...
...
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