|
@@ -53,7 +53,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:{
|
|
@@ -86,20 +86,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
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -116,8 +116,8 @@
|
|
|
this.showEmpty = false
|
|
|
this.hasNextPage = response.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 = '上拉显示更多'
|
|
@@ -133,9 +133,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(){// 上滑加载分页
|
|
@@ -146,8 +146,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 = '上拉显示更多'
|
|
@@ -164,7 +164,7 @@
|
|
|
},
|
|
|
receiveCoupon(coupon){// 点击优惠券领取按钮
|
|
|
if(this.hasLogin){
|
|
|
- if(this.isReceiveLoading){return;}
|
|
|
+ if(this.isReceiveLoading){return}
|
|
|
this.ProductService.ReceiveCoupon(
|
|
|
{
|
|
|
userId:this.listQuery.userId,
|
|
@@ -172,15 +172,16 @@
|
|
|
source:2
|
|
|
})
|
|
|
.then(response =>{
|
|
|
- this.isMobileDisabled = true;
|
|
|
+ this.isReceiveLoading = true
|
|
|
this.$util.msg('领取成功',1500,true,'success')
|
|
|
setTimeout(()=>{
|
|
|
- coupon.couponBtnType = 1;
|
|
|
- this.isMobileDisabled = false;
|
|
|
+ coupon.couponBtnType = 1
|
|
|
+ this.isReceiveLoading = false
|
|
|
},1500)
|
|
|
})
|
|
|
.catch(error =>{
|
|
|
- this.$util.msg(error.msg,2000);
|
|
|
+ this.$util.msg(error.msg,2000)
|
|
|
+ this.isReceiveLoading = false
|
|
|
})
|
|
|
}else{
|
|
|
this.$api.navigateTo('/pages/login/login')
|
|
@@ -195,25 +196,25 @@
|
|
|
}else{
|
|
|
this.$api.navigateTo('/pages/user/coupon/coupon-product?couponId='+coupon.couponId)
|
|
|
}
|
|
|
- break;
|
|
|
+ break
|
|
|
case 1:// 品类券:跳转到产品 287 / 仪器页 286
|
|
|
- let categoryId = 0;
|
|
|
+ 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
|
|
|
}
|
|
|
},
|
|
|
navigator(url){
|
|
@@ -236,7 +237,7 @@
|
|
|
onShow(){
|
|
|
this.$api.getComStorage('userInfo').then((resolve) =>{
|
|
|
this.listQuery.userId = resolve.userId ? resolve.userId : 0
|
|
|
- this.QueryCouponList();
|
|
|
+ this.QueryCouponList()
|
|
|
})
|
|
|
}
|
|
|
}
|