Commit bd9275d7 authored by ziyu's avatar ziyu

feat: 按钮跑马灯等问题优化

parent 8cf89b36
import wepy from '@wepy/core'; import wepy from '@wepy/core';
import Notify from '../components/vant/notify/notify'; 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 request = async (url, options) => {
const pages = getCurrentPages(); const pages = getCurrentPages();
const safeAreaInsetTop = pages && pages.length > 0 ? pages[pages.length - 1].route === 'pages/index' : false; const safeAreaInsetTop = pages && pages.length > 0 ? pages[pages.length - 1].route === 'pages/index' : false;
...@@ -39,10 +42,10 @@ const request = async (url, options) => { ...@@ -39,10 +42,10 @@ const request = async (url, options) => {
return res.data.data; return res.data.data;
} }
Notify({ message: '服务器异常,请稍后重试', background: '#FF5D15', safeAreaInsetTop }); Notify({ message: '服务器异常,请稍后重试', background: '#FF5D15', safeAreaInsetTop });
throw new Error(res.data.msg || '服务器异常,请稍后重试'); throw new Error(res.data.msg || '服务器异常,请求url:'+url);
} }
Notify({ message: '服务器异常,请稍后重试', background: '#FF5D15', safeAreaInsetTop }); Notify({ message: '服务器异常,请稍后重试', background: '#FF5D15', safeAreaInsetTop });
throw new Error(res.data.msg || '服务器异常,请稍后重试'); throw new Error(res.data.msg || '服务器异常,请求url:'+url);
}); });
}; };
......
...@@ -41,6 +41,14 @@ ...@@ -41,6 +41,14 @@
height: 80rpx; height: 80rpx;
border-radius: 50%; border-radius: 50%;
} }
@-webkit-keyframes fadeout {
0% {
opacity:1 ;
}
100% {
opacity: 0;
}
}
.content{ .content{
position: absolute; position: absolute;
z-index: 9; z-index: 9;
...@@ -48,6 +56,12 @@ ...@@ -48,6 +56,12 @@
width: 100%; width: 100%;
color: white; color: white;
clear: both; clear: both;
&.anima {
animation:fadeout 2s;
}
&.hide {
display: none;
}
} }
.leftcont { .leftcont {
width: 44%; width: 44%;
...@@ -206,15 +220,15 @@ ...@@ -206,15 +220,15 @@
<video-lottery type="lottery" des="抽奖" @getAwards="getAwards" @getUserInfo="getUserInfo" :authmodal="authmodal"></video-lottery> <video-lottery type="lottery" des="抽奖" @getAwards="getAwards" @getUserInfo="getUserInfo" :authmodal="authmodal"></video-lottery>
<video-share type="share" des="分享"></video-share> <video-share type="share" des="分享"></video-share>
</view> </view>
<view class="content"> <view class="content {{isActiveDone}}" >
<view class="leftcont"> <view class="leftcont">
<swiper <swiper
class="list-wrapper" class="list-wrapper"
vertical="{{true}}" vertical="{{true}}"
circular="{{false}}" circular="{{true}}"
display-multiple-items="{{activityDisplayItems}}" display-multiple-items="{{activityDisplayItems}}"
bindchange="onActivityChange" bindchange="onActivityChange"
autoplay="{{autoplayActivity}}" autoplay="{{true}}"
interval="1500"> interval="1500">
<swiper-item wx:for="{{activityList}}" wx:key="index" catch:touchmove> <swiper-item wx:for="{{activityList}}" wx:key="index" catch:touchmove>
<view class="imgwrap"> <view class="imgwrap">
...@@ -285,13 +299,10 @@ ...@@ -285,13 +299,10 @@
data: { data: {
list: [], // 商品list list: [], // 商品list
// 活动信息 // 活动信息
activityList: [], activityList: [],
activityDisplayItems: 2, activityDisplayItems: 2,
current: 5, // 商品列表初次展示第几个 current: 5, // 商品列表初次展示第几个
// userInfo: {},
swiperItem: 2, swiperItem: 2,
videoList: [], videoList: [],
length: 4, length: 4,
...@@ -314,7 +325,7 @@ ...@@ -314,7 +325,7 @@
showAwardsModal: false, showAwardsModal: false,
awardsInfo: {}, awardsInfo: {},
isReceive: false, isReceive: false,
autoplayActivity: false isActiveDone:'',
}, },
computed: { computed: {
...@@ -627,12 +638,14 @@ ...@@ -627,12 +638,14 @@
// 1期方案先一次取50 // 1期方案先一次取50
const list = await getActivityFeed({ count: 50 }); const list = await getActivityFeed({ count: 50 });
this.activityList = list; this.activityList = list;
this.autoplayActivity = true;
}, },
onActivityChange(e) { onActivityChange(e) {
const lastIndex = this.activityList.length - this.activityDisplayItems; const lastIndex = this.activityList.length - this.activityDisplayItems;
if (e.$wx.detail.current === lastIndex) { if (e.$wx.detail.current === lastIndex) {
this.autoplayActivity = false; this.isActiveDone = 'anima';
setTimeout(()=>{
this.isActiveDone = 'anima hide';
},2000)
} }
} }
}, },
......
...@@ -85,15 +85,32 @@ ...@@ -85,15 +85,32 @@
margin-top:25rpx; margin-top:25rpx;
height:50rpx; height:50rpx;
line-height: 50rpx; line-height: 50rpx;
.checkimg { .checkimg{
display: inline-block;
width:24rpx; width:24rpx;
height:24rpx; height:24rpx;
border:3rpx solid #aaa;
border-radius: 4rpx;
vertical-align: middle; 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{ .checktext{
top: 2rpx; margin-left:10rpx;
position: relative; position: relative;
top:3rpx;
} }
} }
.joinin { .joinin {
...@@ -127,7 +144,9 @@ ...@@ -127,7 +144,9 @@
</view> </view>
</view> </view>
<view class="user-wish" bindtap="check"> <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> <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>
...@@ -222,15 +241,6 @@ ...@@ -222,15 +241,6 @@
}, },
}, },
computed: { computed: {
imgsrc() {
let imgsrc = '/static/images/selected.png';
if (this.isCheck) {
imgsrc = '/static/images/selected.png';
} else {
imgsrc = '/static/images/selectno.png';
}
return imgsrc;
},
opentype() { opentype() {
if (this.isCheck && !this.hasPhone) { if (this.isCheck && !this.hasPhone) {
return 'getPhoneNumber'; return 'getPhoneNumber';
...@@ -242,10 +252,6 @@ ...@@ -242,10 +252,6 @@
onLoad (query) { onLoad (query) {
let {prizeId, quantity, name, chance, photoUrl} = query; let {prizeId, quantity, name, chance, photoUrl} = query;
this.getProgress(prizeId); this.getProgress(prizeId);
/*if (progress) {
this.progress = progress;
this.progressStyle = 'width:' + progress;
}*/
this.hasPhone = wx.getStorageSync('hasPhone'); this.hasPhone = wx.getStorageSync('hasPhone');
this.quantity = quantity || ''; this.quantity = quantity || '';
this.name = name; this.name = name;
...@@ -262,6 +268,7 @@ ...@@ -262,6 +268,7 @@
"van-image": "../components/vant/image/index", "van-image": "../components/vant/image/index",
"van-loading": "../components/vant/loading/index", "van-loading": "../components/vant/loading/index",
"van-dialog": "../components/vant/dialog/index", "van-dialog": "../components/vant/dialog/index",
"van-icon": "../components/vant/icon/index",
} }
} }
</config> </config>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment