Commit bd9275d7 authored by ziyu's avatar ziyu

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

parent 8cf89b36
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);
});
};
......
......@@ -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="{{false}}"
circular="{{true}}"
display-multiple-items="{{activityDisplayItems}}"
bindchange="onActivityChange"
autoplay="{{autoplayActivity}}"
autoplay="{{true}}"
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,7 @@
showAwardsModal: false,
awardsInfo: {},
isReceive: false,
autoplayActivity: false
isActiveDone:'',
},
computed: {
......@@ -627,12 +638,14 @@
// 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';
},2000)
}
}
},
......
......@@ -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: 2rpx;
margin-left:10rpx;
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>
......@@ -222,15 +241,6 @@
},
},
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() {
if (this.isCheck && !this.hasPhone) {
return 'getPhoneNumber';
......@@ -242,10 +252,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 +268,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>
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