|
@@ -28,8 +28,8 @@
|
|
|
<view class="limit">
|
|
|
<view class="limit-text">
|
|
|
<view class="limit-text1">
|
|
|
- <u-read-more ref="uReadMore" :shadow-style="shadowStyle" :show-height="50" text-indent="0" :close-text="closeContent"
|
|
|
- :open-text="openContent" color="#999999" :toggle="true">
|
|
|
+ <u-read-more ref="uReadMore" :shadow-style="shadowStyle" :show-height="50" text-indent="0" color="#999999" :close-text="closeContent"
|
|
|
+ :open-text="openContent" :toggle="true">
|
|
|
<rich-text :nodes="item.useScope"></rich-text>
|
|
|
</u-read-more>
|
|
|
</view>
|
|
@@ -57,7 +57,8 @@
|
|
|
current: 0,
|
|
|
couponType: '0',
|
|
|
myCouponList: [],
|
|
|
- readContent: `限用户充电电费+服务费满100元使用。限微信钱包、支付宝生活号APP端使用,<br />不支持找零,限登录和充电帐号为155****1111使用。`,
|
|
|
+ pageIndex: 1,
|
|
|
+ recordsTotal: 0,
|
|
|
shadowStyle: {
|
|
|
width: "110%",
|
|
|
backgroundImage: "none",
|
|
@@ -66,12 +67,17 @@
|
|
|
justifyContent: "right",
|
|
|
},
|
|
|
closeContent: '',
|
|
|
- openContent: ','
|
|
|
+ openContent: '',
|
|
|
}
|
|
|
},
|
|
|
onShow() {
|
|
|
this.getCouponList();
|
|
|
},
|
|
|
+ onReachBottom() {
|
|
|
+ if (this.myCouponList.length < this.recordsTotal) {
|
|
|
+ this.myLoadmore();
|
|
|
+ }
|
|
|
+ },
|
|
|
methods:{
|
|
|
toConversion() {
|
|
|
uni.navigateTo({
|
|
@@ -83,17 +89,26 @@
|
|
|
url: '/pages/index/index'
|
|
|
})
|
|
|
},
|
|
|
- getCouponList() {
|
|
|
+ getCouponList(bl) {
|
|
|
uni.showLoading({
|
|
|
title: "加载中",
|
|
|
mask: true,
|
|
|
- })
|
|
|
+ })
|
|
|
+ if (bl) {
|
|
|
+ this.myCouponList = [];
|
|
|
+ this.pageIndex = 1;
|
|
|
+ }
|
|
|
userApi.couponList({
|
|
|
+ pageIndex: this.pageIndex,
|
|
|
status: this.couponType
|
|
|
}).then((res) => {
|
|
|
uni.hideLoading();
|
|
|
|
|
|
- this.myCouponList = res.data.data;
|
|
|
+ this.myCouponList = [
|
|
|
+ ...this.myCouponList,
|
|
|
+ ...res.data.data
|
|
|
+ ];
|
|
|
+ this.recordsTotal = res.data.recordsTotal;
|
|
|
}).catch(error => {
|
|
|
uni.showToast({
|
|
|
title: error,
|
|
@@ -104,7 +119,11 @@
|
|
|
change(index) {
|
|
|
this.current = index;
|
|
|
this.couponType = this.tabList[index].type;
|
|
|
- this.getCouponList();
|
|
|
+ this.getCouponList(true);
|
|
|
+ },
|
|
|
+ myLoadmore() {
|
|
|
+ this.pageIndex += 1;
|
|
|
+ this.getCouponList()
|
|
|
},
|
|
|
}
|
|
|
}
|