Commit 50bea767 by 高淑倩

modify: 优惠券列表切换问题

parent b7cefa1a
...@@ -47,8 +47,8 @@ wxService.page({ ...@@ -47,8 +47,8 @@ wxService.page({
} else { } else {
this.setData({ this.setData({
currentTab: current, currentTab: current,
couponList: [], // 清空数据 // couponList: [], // 清空数据
invalidCouponList: [], // invalidCouponList: [],
}) })
} }
...@@ -85,12 +85,24 @@ wxService.page({ ...@@ -85,12 +85,24 @@ wxService.page({
params = { params = {
status: 1 status: 1
} }
if(pageNo == 1){
this.setData({
pageNo: 1,
couponList: [], // 清空数据
})
}
} else { } else {
params = { params = {
statusNot: 1 statusNot: 1
} }
if(pageNo == 1){
this.setData({
invalidCouponList: [],
invalidPageNo: 1
})
}
} }
wxService.post(`/coupon/coupon/listWithMember4Mina?number=${pageNo}&size=${pageSize}`, params).then(res => { wxService.post(`/coupon/coupon/listWithMember4Mina?number=${pageNo}&size=${pageSize}`, params).then(res => {
const {result,data} = res.data const {result,data} = res.data
if(result == 0){ if(result == 0){
...@@ -116,7 +128,6 @@ wxService.page({ ...@@ -116,7 +128,6 @@ wxService.page({
invalidTotalElements: data.totalElements invalidTotalElements: data.totalElements
}) })
} }
} }
}).finally(() => { }).finally(() => {
...@@ -133,7 +144,6 @@ wxService.page({ ...@@ -133,7 +144,6 @@ wxService.page({
onReachBottom: function () { onReachBottom: function () {
// 可使用 0 or 已失效 1 // 可使用 0 or 已失效 1
const { currentTab, pageNo, pageSize, totalPages, invalidPageNo,invalidTotalPages } = this.data const { currentTab, pageNo, pageSize, totalPages, invalidPageNo,invalidTotalPages } = this.data
console.log('2222',currentTab)
if(currentTab == 0) { if(currentTab == 0) {
if ( pageNo < totalPages) { if ( pageNo < totalPages) {
this.setData({ this.setData({
......
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
<image src='/assets/imgs/qr-code.png' /> <image src='/assets/imgs/qr-code.png' />
</view> </view>
<view class='coupon-info'> <view class='coupon-info'>
<view class='coupon-name fs-28'>{{item.typeDesc}}</view> <view class='coupon-name fs-28'>{{item.title}}</view>
<view class='coupon-time fs-24'>{{item.startTime}} 至 {{item.endTime}}</view> <view class='coupon-time fs-24'>{{item.startTime}} 至 {{item.endTime}}</view>
<view class='coupon-desc fs-24'>{{item.notice}}</view> <view class='coupon-desc fs-24'>{{item.notice}}</view>
</view> </view>
......
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