|
@@ -83,7 +83,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import { mapState,mapMutations} from 'vuex';
|
|
|
+ import { mapState,mapMutations} from 'vuex'
|
|
|
import couponTabs from '@/components/cm-module/coupon/tui-tabs.vue'
|
|
|
export default {
|
|
|
components:{
|
|
@@ -103,9 +103,9 @@
|
|
|
status:1
|
|
|
},
|
|
|
navbar: [
|
|
|
- { name: "未使用",num:0 },
|
|
|
- { name: "已使用",num:0 },
|
|
|
- { name: "已失效",num:0 },
|
|
|
+ { name: '未使用',num:0 },
|
|
|
+ { name: '已使用',num:0 },
|
|
|
+ { name: '已失效',num:0 },
|
|
|
],
|
|
|
coupinList:[],
|
|
|
windowHeight:'',
|
|
@@ -125,20 +125,20 @@
|
|
|
TypeFormat(value) {
|
|
|
switch (value) {
|
|
|
case 0:
|
|
|
- return '活动券';
|
|
|
- break;
|
|
|
+ return '活动券'
|
|
|
+ break
|
|
|
case 1:
|
|
|
- return '品类券';
|
|
|
- break;
|
|
|
+ return '品类券'
|
|
|
+ break
|
|
|
case 2:
|
|
|
- return '用户专享券';
|
|
|
- break;
|
|
|
+ return '用户专享券'
|
|
|
+ break
|
|
|
case 3:
|
|
|
- return '店铺券';
|
|
|
- break;
|
|
|
+ return '店铺券'
|
|
|
+ break
|
|
|
case 4:
|
|
|
- return '新用户券';
|
|
|
- break;
|
|
|
+ return '新用户券'
|
|
|
+ break
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -147,9 +147,9 @@
|
|
|
},
|
|
|
methods: {
|
|
|
setScrollHeight() {
|
|
|
- const {windowHeight, pixelRatio} = wx.getSystemInfoSync();
|
|
|
- this.windowHeight = windowHeight - 1;
|
|
|
- this.scrollHeight = windowHeight - 1;
|
|
|
+ const {windowHeight, pixelRatio} = wx.getSystemInfoSync()
|
|
|
+ this.windowHeight = windowHeight - 1
|
|
|
+ this.scrollHeight = windowHeight - 1
|
|
|
},
|
|
|
QueryCouponList() {// 获取优惠券列表
|
|
|
this.coupinList = []
|
|
@@ -160,8 +160,8 @@
|
|
|
this.showEmpty = false
|
|
|
this.hasNextPage = data.hasNextPage
|
|
|
this.coupinList = data.list
|
|
|
- this.pullFlag = false;
|
|
|
- setTimeout(()=>{this.pullFlag = true;},500)
|
|
|
+ this.pullFlag = false
|
|
|
+ setTimeout(()=>{this.pullFlag = true},500)
|
|
|
if(this.hasNextPage){
|
|
|
this.pullUpOn = false
|
|
|
this.nomoreText = '上拉显示更多'
|
|
@@ -177,9 +177,9 @@
|
|
|
}else{
|
|
|
this.showEmpty = true
|
|
|
}
|
|
|
- this.isRequest = true;
|
|
|
+ this.isRequest = true
|
|
|
}).catch(error =>{
|
|
|
- this.$util.msg(error.msg,2000);
|
|
|
+ this.$util.msg(error.msg,2000)
|
|
|
})
|
|
|
},
|
|
|
getOnReachBottomData(){// 上滑加载分页
|
|
@@ -190,8 +190,8 @@
|
|
|
if(data.list&&data.list.length > 0){
|
|
|
this.hasNextPage = data.hasNextPage
|
|
|
this.coupinList = this.coupinList.concat(data.list)
|
|
|
- this.pullFlag = false;// 防上拉暴滑
|
|
|
- setTimeout(()=>{this.pullFlag = true;},500)
|
|
|
+ this.pullFlag = false// 防上拉暴滑
|
|
|
+ setTimeout(()=>{this.pullFlag = true},500)
|
|
|
if(this.hasNextPage){
|
|
|
this.pullUpOn = false
|
|
|
this.nomoreText = '上拉显示更多'
|
|
@@ -219,7 +219,7 @@
|
|
|
this.navbar[2].num = data.expiredNum
|
|
|
})
|
|
|
.catch(error =>{
|
|
|
- this.$util.msg(error.msg,2000);
|
|
|
+ this.$util.msg(error.msg,2000)
|
|
|
})
|
|
|
},
|
|
|
toUseCoupon(coupon){// 去使用跳转路径
|
|
@@ -232,25 +232,19 @@
|
|
|
}else{
|
|
|
this.$api.navigateTo('/pages/user/coupon/coupon-product?couponId='+coupon.couponId)
|
|
|
}
|
|
|
- break;
|
|
|
+ break
|
|
|
case 1:// 品类券:跳转到产品 287 / 仪器页 286
|
|
|
- let categoryId = 0;
|
|
|
- if(coupon.categoryType == 1){
|
|
|
- categoryId = 287
|
|
|
- }else{
|
|
|
- categoryId = 286
|
|
|
- }
|
|
|
this.$api.navigateTo(`/pages/goods/good-floor?linkId=${ coupon.categoryType == 1 ? 287 : 286 }`)
|
|
|
- break;
|
|
|
+ break
|
|
|
case 2:// 用户专享券:跳转到商城首页
|
|
|
this.$api.switchTabTo('/pages/tabBar/home/index')
|
|
|
- break;
|
|
|
+ break
|
|
|
case 3:// 店铺券:跳转到店铺首页
|
|
|
this.$api.navigateTo('/pages/supplier/user/my-shop?shopId='+coupon.shopId)
|
|
|
- break;
|
|
|
+ break
|
|
|
case 4:// 新用户券:跳转到商城首页
|
|
|
this.$api.switchTabTo('/pages/tabBar/home/index')
|
|
|
- break;
|
|
|
+ break
|
|
|
}
|
|
|
},
|
|
|
change(e) {
|
|
@@ -261,15 +255,15 @@
|
|
|
case 0:
|
|
|
this.listClass = 'list-used'
|
|
|
this.listQuery.status = 1
|
|
|
- break;
|
|
|
+ break
|
|
|
case 1:
|
|
|
this.listClass = 'list-none'
|
|
|
this.listQuery.status = 2
|
|
|
- break;
|
|
|
+ break
|
|
|
case 2:
|
|
|
this.listClass = 'list-none'
|
|
|
this.listQuery.status = 3
|
|
|
- break;
|
|
|
+ break
|
|
|
|
|
|
}
|
|
|
this.QueryCouponList()
|
|
@@ -292,11 +286,11 @@
|
|
|
}
|
|
|
},
|
|
|
onShow(){
|
|
|
- this.setScrollHeight();
|
|
|
+ this.setScrollHeight()
|
|
|
this.$api.getComStorage('userInfo').then((resolve) =>{
|
|
|
- this.listQuery.userId = resolve.userId ? resolve.userId : 0;
|
|
|
+ this.listQuery.userId = resolve.userId ? resolve.userId : 0
|
|
|
this.getQueryCouponsCount()
|
|
|
- this.QueryCouponList();
|
|
|
+ this.QueryCouponList()
|
|
|
})
|
|
|
}
|
|
|
}
|