Commit 203542de authored by youjie's avatar youjie

优化优惠券列表

parent 8b503633
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
<view v-if="couponDataList.length > 0" style=" height: calc(100vh - 50px); width: calc(100vw); overflow: hidden;padding-bottom: 50px;"> <view v-if="couponDataList.length > 0" style=" height: calc(100vh - 50px); width: calc(100vw); overflow: hidden;padding-bottom: 50px;">
<scroll-view :scroll-y="true" :enable-back-to-top="true" :enable-flex="true" @scrolltolower="lower" :style="{ height: '100%' }"> <scroll-view :scroll-y="true" :enable-back-to-top="true" :enable-flex="true" @scrolltolower="lower" :style="{ height: '100%' }">
<view class="couponList"> <view class="couponList">
<view class="couponListBox" :class="[x.couponsUseScope>=0?'active'+x.couponsUseScope:'active0']" <view class="couponListBox" :class="[x.couponsUseScope>0?'active'+(x.couponsUseScope-1):'active0']"
v-for="(x, i) in couponDataList" :key="i"> v-for="(x, i) in couponDataList" :key="i">
<view class="item"> <view class="item">
<view :style="{'background-image':`url(${x.backGroubd}) `}" class="couponItemLeft"> <view :style="{'background-image':`url(${x.backGroubd}) `}" class="couponItemLeft">
...@@ -238,7 +238,6 @@ ...@@ -238,7 +238,6 @@
} }
}, (failed) => { }, (failed) => {
uni.showToast({ uni.showToast({
title: failed.message, title: failed.message,
icon: "none", icon: "none",
}); });
...@@ -283,21 +282,19 @@ ...@@ -283,21 +282,19 @@
} }
arrList(res.data.pageData) arrList(res.data.pageData)
this.couponDataList = res.data.pageData; this.couponDataList = res.data.pageData;
this.couponDataList.forEach(x => { this.couponDataList.forEach((x,index) => {
if(x.couponsUseScope<=8){ // if(x.couponsUseScope==1) x.backGroubd = this.lineImgs[0]
if(x.couponsUseScope==0) x.backGroubd = this.lineImgs[0] // if(x.couponsUseScope==2) x.backGroubd = this.lineImgs[1]
if(x.couponsUseScope==1) x.backGroubd = this.lineImgs[1] // if(x.couponsUseScope==3) x.backGroubd = this.lineImgs[2]
if(x.couponsUseScope==2) x.backGroubd = this.lineImgs[2] // if(x.couponsUseScope==4) x.backGroubd = this.lineImgs[3]
if(x.couponsUseScope==3) x.backGroubd = this.lineImgs[3] // if(x.couponsUseScope==5) x.backGroubd = this.lineImgs[4]
if(x.couponsUseScope==4) x.backGroubd = this.lineImgs[4] // if(x.couponsUseScope==6) x.backGroubd = this.lineImgs[5]
if(x.couponsUseScope==5) x.backGroubd = this.lineImgs[5] // if(x.couponsUseScope==7) x.backGroubd = this.lineImgs[6]
if(x.couponsUseScope==6) x.backGroubd = this.lineImgs[6] // if(x.couponsUseScope==8) x.backGroubd = this.lineImgs[7]
if(x.couponsUseScope==7) x.backGroubd = this.lineImgs[7] // if(x.couponsUseScope==9) x.backGroubd = this.lineImgs[8]
if(x.couponsUseScope==8) x.backGroubd = this.lineImgs[8] // if(x.couponsUseScope==10) x.backGroubd = this.lineImgs[0]
}else{ // if(x.couponsUseScope==11) x.backGroubd = this.lineImgs[1]
x.backGroubd = this.lineImgs[0] if(x.couponsUseScope==this.getLineImgs()+1) x.backGroubd = this.lineImgs[this.getLineImgs()]
}
}) })
this.page_count = res.data.pageCount; this.page_count = res.data.pageCount;
if(this.page_count==1) this.status = 'nomore' if(this.page_count==1) this.status = 'nomore'
...@@ -313,6 +310,12 @@ ...@@ -313,6 +310,12 @@
this.loading = false; this.loading = false;
}) })
}, },
getLineImgs(){
let i = 0
if(i<this.lineImgs.length-1) i++
if(i==this.lineImgs.length-1) i = 0
return i
},
lower(e) { lower(e) {
if (this.msg.pageIndex < this.page_count) { if (this.msg.pageIndex < this.page_count) {
this.msg.pageIndex++; this.msg.pageIndex++;
......
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