|
@@ -27,7 +27,7 @@
|
|
<view class="floor-tags" @click.stop="clickPopupShow(item,2)">{{item.promotions.name}}</view>
|
|
<view class="floor-tags" @click.stop="clickPopupShow(item,2)">{{item.promotions.name}}</view>
|
|
</view>
|
|
</view>
|
|
<view class="text">{{item.name}}</view>
|
|
<view class="text">{{item.name}}</view>
|
|
- <view class="text-coupon" @click="showPopup(0)">领券</view>
|
|
|
|
|
|
+ <view class="text-coupon" @click="showPopup(0,item)" v-if="item.couponsLogo">领券</view>
|
|
</view>
|
|
</view>
|
|
<view class="productlist">
|
|
<view class="productlist">
|
|
<view class="goods-pros" v-for="(pros,idx) in item.cartList" :key="idx" >
|
|
<view class="goods-pros" v-for="(pros,idx) in item.cartList" :key="idx" >
|
|
@@ -200,38 +200,48 @@
|
|
</view>
|
|
</view>
|
|
<div class="tui-popup-main coupon">
|
|
<div class="tui-popup-main coupon">
|
|
<scroll-view class="tui-popup-scroll" scroll-y="true">
|
|
<scroll-view class="tui-popup-scroll" scroll-y="true">
|
|
- <view v-for="(coupon,index) in dataList" :key="index" :id="coupon.id" class="coupon-list">
|
|
|
|
- <view class="list-cell-le">
|
|
|
|
- <view class="coupon-maxMoney">
|
|
|
|
- <text class="small">¥</text>
|
|
|
|
- {{ coupon.maxMoney }}
|
|
|
|
- </view>
|
|
|
|
- <view class="coupon-minMoney">
|
|
|
|
- 满{{ coupon.minMoney }}可用
|
|
|
|
|
|
+ <view class="coupon-empty" v-if="isCouponEmpty">
|
|
|
|
+ <image class="empty-container-image" :src="StaticUrl+'/icon/icon-coupon-empty@2x.png'"></image>
|
|
|
|
+ <text class="error-text">暂无可领的优惠券~</text>
|
|
|
|
+ </view>
|
|
|
|
+ <template v-else>
|
|
|
|
+ <view v-for="(coupon,index) in productCouponList"
|
|
|
|
+ :key="index"
|
|
|
|
+ :id="coupon.couponId"
|
|
|
|
+ class="coupon-list"
|
|
|
|
+ >
|
|
|
|
+ <view class="list-cell-le">
|
|
|
|
+ <view class="coupon-maxMoney"><text class="small">¥</text>{{ coupon.couponAmount }}</view>
|
|
|
|
+ <view class="coupon-minMoney">满{{ coupon.touchPrice }}可用</view>
|
|
</view>
|
|
</view>
|
|
- </view>
|
|
|
|
- <view class="list-cell-ri">
|
|
|
|
- <view class="list-cell-top">
|
|
|
|
- <view class="list-cell-type">
|
|
|
|
- <view class="list-cell-tags">
|
|
|
|
- <text class="tags">{{ coupon.couponType | TypeFormat }}</text>
|
|
|
|
- </view>
|
|
|
|
- <view class="list-cell-texts" :class="currentTab == 1 || currentTab == 2 ? 'none' : ''">
|
|
|
|
- <text v-if="coupon.useType == 1">{{ coupon.useType | TypeFormatText }}</text>
|
|
|
|
- <text v-if="coupon.useType == 2">{{ coupon.useType | TypeFormatText }}</text>
|
|
|
|
- <text v-if="coupon.useType == 3">{{ coupon.useType | TypeFormatText }}{{ coupon.couponText }}的商品</text>
|
|
|
|
|
|
+ <view class="list-cell-ri">
|
|
|
|
+ <view class="list-cell-top">
|
|
|
|
+ <view class="list-cell-type">
|
|
|
|
+ <view class="list-cell-tags">
|
|
|
|
+ <text class="tags">{{ coupon.couponType | TypeFormat }}</text>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="list-cell-texts" :class="currentTab == 1 || currentTab == 2 ? 'none' : ''">
|
|
|
|
+ <text v-if="coupon.couponType == 0">
|
|
|
|
+ {{ coupon.productType && coupon.productType == 1 ? '全商城商品通用' : '仅可购买指定商品' }}
|
|
|
|
+ </text>
|
|
|
|
+ <text v-if="coupon.couponType == 1">
|
|
|
|
+ {{ coupon.categoryType == 1 ? '仅限购买产品类商品' : '仅限购买仪器类商品' }}
|
|
|
|
+ </text>
|
|
|
|
+ <text v-if="coupon.couponType == 3">仅限购买店铺【{{ coupon.shopName }}】的商品</text>
|
|
|
|
+ <text v-if="coupon.couponType == 4 || coupon.couponType == 2">全商城商品通用</text>
|
|
|
|
+ </view>
|
|
</view>
|
|
</view>
|
|
- </view>
|
|
|
|
- <view class="list-cell-btn">
|
|
|
|
- <view class="icon-used">
|
|
|
|
- <view class="icon-used-btn receive" v-if="currentTab == 0" @click="receiveCoupon(coupon)">领取</view>
|
|
|
|
- <view class="icon-used-btn make" v-if="currentTab == 1">已领取</view>
|
|
|
|
|
|
+ <view class="list-cell-btn">
|
|
|
|
+ <view class="icon-used">
|
|
|
|
+ <view class="icon-used-btn receive" v-if="currentTab == 0" @click="receiveCoupon(coupon)">领取</view>
|
|
|
|
+ <view class="icon-used-btn make" v-if="currentTab == 1">已领取</view>
|
|
|
|
+ </view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
+ <view class="list-cell-time">{{ coupon.endDate }}</view>
|
|
</view>
|
|
</view>
|
|
- <view class="list-cell-time">{{ coupon.couponTime }}</view>
|
|
|
|
</view>
|
|
</view>
|
|
- </view>
|
|
|
|
|
|
+ </template>
|
|
</scroll-view>
|
|
</scroll-view>
|
|
</div>
|
|
</div>
|
|
</view>
|
|
</view>
|
|
@@ -298,29 +308,31 @@
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return{
|
|
return{
|
|
- CustomBar:this.CustomBar,// 顶部导航栏高度
|
|
|
|
|
|
+ StaticUrl:this.$Static, // 静态图片路径
|
|
|
|
+ CustomBar:this.CustomBar, // 顶部导航栏高度
|
|
isIphoneX:this.$store.state.isIphoneX,
|
|
isIphoneX:this.$store.state.isIphoneX,
|
|
- userID:'',
|
|
|
|
|
|
+ userId:'',
|
|
alertType:'',
|
|
alertType:'',
|
|
isStock:'',
|
|
isStock:'',
|
|
- handlerPros:{},//监听单挑促销商品
|
|
|
|
- failureList:[], //失效商品列表
|
|
|
|
- goodsList:[], //购物车的商品
|
|
|
|
- promotionsList:[],//促销列表
|
|
|
|
- delGoodsList:'',//要删除的商品
|
|
|
|
- setGoodData:'', //确认订单的商品
|
|
|
|
- isCheckAll:false,//是否全选
|
|
|
|
- kindCount:0,//购物车宝贝数量
|
|
|
|
- allPrice:0,//所有价格
|
|
|
|
- totalOriginalPrice:0,//所有原价价
|
|
|
|
- reducedPrice:0,//满减
|
|
|
|
- allCount:0,//被选中的产品数量
|
|
|
|
|
|
+ handlerPros:{}, // 监听单挑促销商品
|
|
|
|
+ failureList:[], // 失效商品列表
|
|
|
|
+ goodsList:[], // 购物车的商品
|
|
|
|
+ promotionsList:[], // 促销列表
|
|
|
|
+ totalCouponList:[], // 优惠券算列表
|
|
|
|
+ delGoodsList:'', // 要删除的商品
|
|
|
|
+ setGoodData:'', // 确认订单的商品
|
|
|
|
+ isCheckAll:false, // 是否全选
|
|
|
|
+ kindCount:0, // 购物车宝贝数量
|
|
|
|
+ allPrice:0, // 所有价格
|
|
|
|
+ totalOriginalPrice:0, // 所有原价价
|
|
|
|
+ reducedPrice:0, // 满减
|
|
|
|
+ allCount:0, // 被选中的产品数量
|
|
isModallayer:false,
|
|
isModallayer:false,
|
|
skeletonShow:true,
|
|
skeletonShow:true,
|
|
isshowDelbtn:false,
|
|
isshowDelbtn:false,
|
|
- isDisabled: false, // 供应商/店铺全选是否禁用状态
|
|
|
|
|
|
+ isDisabled: false, // 供应商/店铺全选是否禁用状态
|
|
isNoConfim:false,
|
|
isNoConfim:false,
|
|
- isEmpty:false,//显示空购物车
|
|
|
|
|
|
+ isEmpty:false, // 显示空购物车
|
|
scrollHeight: 'auto',
|
|
scrollHeight: 'auto',
|
|
nomoreText: '上拉显示更多',
|
|
nomoreText: '上拉显示更多',
|
|
hasNextPage: false,
|
|
hasNextPage: false,
|
|
@@ -333,68 +345,24 @@
|
|
popupShow:false,
|
|
popupShow:false,
|
|
popupShow0:false,
|
|
popupShow0:false,
|
|
popupShow1:false,
|
|
popupShow1:false,
|
|
- currentTab: 0,
|
|
|
|
|
|
+ currentTab: 1,
|
|
navbar: [
|
|
navbar: [
|
|
- { name: "未领取",num:3 },
|
|
|
|
- { name: "已领取",num:4 }
|
|
|
|
- ],
|
|
|
|
- dataList:[
|
|
|
|
- {
|
|
|
|
- maxMoney:5000,
|
|
|
|
- minMoney:1000,
|
|
|
|
- couponType:1,
|
|
|
|
- couponTime:'2021.06.28~2021.07.28',
|
|
|
|
- couponText:'华熙生物技术有限公司',
|
|
|
|
- useType:1,
|
|
|
|
- couponBtnType:0
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- maxMoney:2000,
|
|
|
|
- minMoney:200,
|
|
|
|
- couponType:2,
|
|
|
|
- couponTime:'2021.06.28~2021.07.28',
|
|
|
|
- couponText:'华熙生物技术有限公司',
|
|
|
|
- useType:2,
|
|
|
|
- couponBtnType:0
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- maxMoney:4000,
|
|
|
|
- minMoney:800,
|
|
|
|
- couponType:3,
|
|
|
|
- couponTime:'2021.06.28~2021.07.28',
|
|
|
|
- couponText:'华熙生物技术有限公司',
|
|
|
|
- useType:3,
|
|
|
|
- couponBtnType:0
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- maxMoney:6000,
|
|
|
|
- minMoney:1000,
|
|
|
|
- couponType:4,
|
|
|
|
- couponTime:'2021.06.28~2021.07.28',
|
|
|
|
- couponText:'华熙生物技术有限公司',
|
|
|
|
- useType:1,
|
|
|
|
- couponBtnType:0
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- maxMoney:6000,
|
|
|
|
- minMoney:1000,
|
|
|
|
- couponType:5,
|
|
|
|
- couponTime:'2021.06.28~2021.07.28',
|
|
|
|
- couponText:'华熙生物技术有限公司',
|
|
|
|
- useType:2,
|
|
|
|
- couponBtnType:0
|
|
|
|
- }
|
|
|
|
|
|
+ { name: "未领取",num:0 },
|
|
|
|
+ { name: "已领取",num:0 }
|
|
],
|
|
],
|
|
|
|
+ couponParam:{ // 获取弹窗优惠券领取参数
|
|
|
|
+ userId:0,
|
|
|
|
+ shopId:0,
|
|
|
|
+ status:1,
|
|
|
|
+ source:2
|
|
|
|
+ },
|
|
|
|
+ productCouponList:[], // 优惠券弹窗列表
|
|
|
|
+ isCouponEmpty:false,
|
|
}
|
|
}
|
|
},
|
|
},
|
|
created(){
|
|
created(){
|
|
this.setScrollHeight();
|
|
this.setScrollHeight();
|
|
console.log('pathType',this.pathType)
|
|
console.log('pathType',this.pathType)
|
|
- if(this.hasLogin){
|
|
|
|
- this.initData()
|
|
|
|
- }else{
|
|
|
|
- this.initLogin()
|
|
|
|
- }
|
|
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
...mapState(['hasLogin','userInfo','isWxAuthorize'])
|
|
...mapState(['hasLogin','userInfo','isWxAuthorize'])
|
|
@@ -415,37 +383,24 @@
|
|
totalprice(val,count){//单件商品的价格 × 数量
|
|
totalprice(val,count){//单件商品的价格 × 数量
|
|
return (val * count).toFixed(2)
|
|
return (val * count).toFixed(2)
|
|
},
|
|
},
|
|
- TypeFormat:function(value) {
|
|
|
|
|
|
+ TypeFormat(value) {
|
|
switch (value) {
|
|
switch (value) {
|
|
- case 1:
|
|
|
|
|
|
+ case 0:
|
|
return '活动券';
|
|
return '活动券';
|
|
break;
|
|
break;
|
|
- case 2:
|
|
|
|
|
|
+ case 1:
|
|
return '品类券';
|
|
return '品类券';
|
|
break;
|
|
break;
|
|
|
|
+ case 2:
|
|
|
|
+ return '用户专享券';
|
|
|
|
+ break;
|
|
case 3:
|
|
case 3:
|
|
return '店铺券';
|
|
return '店铺券';
|
|
break;
|
|
break;
|
|
case 4:
|
|
case 4:
|
|
- return '专享券';
|
|
|
|
- break;
|
|
|
|
- case 5:
|
|
|
|
return '新用户券';
|
|
return '新用户券';
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
- },
|
|
|
|
- TypeFormatText:function(value) {
|
|
|
|
- switch (value) {
|
|
|
|
- case 1:
|
|
|
|
- return '全商城商品通用';
|
|
|
|
- break;
|
|
|
|
- case 2:
|
|
|
|
- return '仅限购买仪器类商品';
|
|
|
|
- break;
|
|
|
|
- case 3:
|
|
|
|
- return '仅可购买店铺';
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods:{
|
|
methods:{
|
|
@@ -455,12 +410,12 @@
|
|
this.isCheckAll=false//是否全选
|
|
this.isCheckAll=false//是否全选
|
|
this.submitIds = []
|
|
this.submitIds = []
|
|
this.$api.getStorage().then((resolve) => {
|
|
this.$api.getStorage().then((resolve) => {
|
|
- this.userID = resolve.userId;
|
|
|
|
|
|
+ this.userId = this.couponParam.userId = resolve.userId ? resolve.userId : 0;
|
|
this.initGetCartGoodsList();
|
|
this.initGetCartGoodsList();
|
|
})
|
|
})
|
|
},
|
|
},
|
|
initLogin(){
|
|
initLogin(){
|
|
- this.$api.redirectTo('/pages/login/login?type=4')
|
|
|
|
|
|
+ this.$api.redirectTo('/pages/login/login')
|
|
},
|
|
},
|
|
clickPopupShow(pros,type){
|
|
clickPopupShow(pros,type){
|
|
this.popupShow = true;
|
|
this.popupShow = true;
|
|
@@ -481,11 +436,12 @@
|
|
}, 500)
|
|
}, 500)
|
|
},
|
|
},
|
|
initGetCartGoodsList(){//初始化购物车 index:1
|
|
initGetCartGoodsList(){//初始化购物车 index:1
|
|
- this.ProductService.QueryShoppingCartList({userId:this.userID}).then(response =>{
|
|
|
|
|
|
+ this.ProductService.QueryShoppingCartList({userId:this.userId}).then(response =>{
|
|
this.skeletonShow = false
|
|
this.skeletonShow = false
|
|
let data = response.data
|
|
let data = response.data
|
|
this.kindCount = data.kindCount
|
|
this.kindCount = data.kindCount
|
|
this.promotionsList = data.promotions
|
|
this.promotionsList = data.promotions
|
|
|
|
+ this.totalCouponList = data.couponList
|
|
this.$store.commit('updateAllNum',data.kindCount)
|
|
this.$store.commit('updateAllNum',data.kindCount)
|
|
if( data.list.length > 0 || data.invalid.length > 0){
|
|
if( data.list.length > 0 || data.invalid.length > 0){
|
|
this.isEmpty =false
|
|
this.isEmpty =false
|
|
@@ -716,7 +672,7 @@
|
|
reducedPrice += item.reducedprice;
|
|
reducedPrice += item.reducedprice;
|
|
originalPrice += item.originalprice;
|
|
originalPrice += item.originalprice;
|
|
})
|
|
})
|
|
- //总促销计算
|
|
|
|
|
|
+ // 总促销计算
|
|
this.promotionsList.forEach(promotions =>{
|
|
this.promotionsList.forEach(promotions =>{
|
|
// 凑单满减
|
|
// 凑单满减
|
|
if(promotions.mode*1===2 && promotions.type*1===2){
|
|
if(promotions.mode*1===2 && promotions.type*1===2){
|
|
@@ -732,11 +688,13 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- //最后统计商品原价
|
|
|
|
|
|
+ // 计算优惠券
|
|
|
|
+ this.calculationCoupon()
|
|
|
|
+ // 最后统计商品原价
|
|
this.totalOriginalPrice = originalPrice;
|
|
this.totalOriginalPrice = originalPrice;
|
|
- //最后满减金额 = 店铺减去金额 + 单品减去金额 + 凑单减去金额
|
|
|
|
|
|
+ // 最后满减金额 = 店铺减去金额 + 单品减去金额 + 凑单减去金额
|
|
this.reducedPrice = reducedPrice;
|
|
this.reducedPrice = reducedPrice;
|
|
- //最终合计价格 = 店铺满减合计 + 单品满减 + 正常合计 + 凑单满减
|
|
|
|
|
|
+ // 最终合计价格 = 店铺满减合计 + 单品满减 + 正常合计 + 凑单满减
|
|
this.allPrice = totalPrice ;
|
|
this.allPrice = totalPrice ;
|
|
},
|
|
},
|
|
totalCount(){//计算总数量
|
|
totalCount(){//计算总数量
|
|
@@ -754,7 +712,48 @@
|
|
}
|
|
}
|
|
})
|
|
})
|
|
})
|
|
})
|
|
- },
|
|
|
|
|
|
+ },
|
|
|
|
+ calculationCoupon(){// 优惠券计算
|
|
|
|
+ const checkedProList = []
|
|
|
|
+ this.goodsList.forEach((shop,index)=>{
|
|
|
|
+ shop.cartList.forEach(pros=>{
|
|
|
|
+ if(pros.productsChecked){
|
|
|
|
+ checkedProList.push(pros)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ console.log('checkedProList',checkedProList)
|
|
|
|
+ this.totalCouponList.map((coupon,index)=>{
|
|
|
|
+ const couponType = coupon.couponType
|
|
|
|
+ checkedProList.forEach(pros=>{
|
|
|
|
+ if(couponType == 0){// 活动券
|
|
|
|
+ if(coupon.productType == 1){// 活动券-全商城商品
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }else if(coupon.productType == 2){// 活动券-指定商品
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }else if(couponType == 1){// 品类券 commodityType
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }else if(couponType == 2 || couponType == 4){// 用户专享券和新用户券
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }else if(couponType == 3){// 店铺券 supplierId
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ },
|
|
changeCountAdd(item,pros){//商品数量加加
|
|
changeCountAdd(item,pros){//商品数量加加
|
|
if(pros.step === 2){
|
|
if(pros.step === 2){
|
|
pros.isStep = false
|
|
pros.isStep = false
|
|
@@ -820,7 +819,7 @@
|
|
}
|
|
}
|
|
},
|
|
},
|
|
updateShoppogNum(pros){//加减购物车商品更新到后台
|
|
updateShoppogNum(pros){//加减购物车商品更新到后台
|
|
- let params ={userID:this.userID,productID:pros.productId,productCount:pros.number}
|
|
|
|
|
|
+ let params ={userID:this.userId,productID:pros.productId,productCount:pros.number}
|
|
this.ProductService.ShoppingCartUpdate(params).then(response =>{
|
|
this.ProductService.ShoppingCartUpdate(params).then(response =>{
|
|
this.isshowDelbtn = false;
|
|
this.isshowDelbtn = false;
|
|
this.initGetCartGoodsList();
|
|
this.initGetCartGoodsList();
|
|
@@ -950,7 +949,7 @@
|
|
return
|
|
return
|
|
}else{
|
|
}else{
|
|
this.$util.modal('','确定删除选中的商品吗?','确定','取消',true,() =>{
|
|
this.$util.modal('','确定删除选中的商品吗?','确定','取消',true,() =>{
|
|
- this.ProductService.ShoppingCartDelete({userID:this.userID,productIDs:this.delGoodsList}).then(response =>{
|
|
|
|
|
|
+ this.ProductService.ShoppingCartDelete({userID:this.userId,productIDs:this.delGoodsList}).then(response =>{
|
|
this.$util.msg('删除成功',2000);
|
|
this.$util.msg('删除成功',2000);
|
|
setTimeout(()=>{
|
|
setTimeout(()=>{
|
|
this.isshowDelbtn = false;
|
|
this.isshowDelbtn = false;
|
|
@@ -965,7 +964,7 @@
|
|
deletefailureList(){
|
|
deletefailureList(){
|
|
this.failureList.forEach(failure=>{ this.delGoodsList += failure.productId+',' })
|
|
this.failureList.forEach(failure=>{ this.delGoodsList += failure.productId+',' })
|
|
this.$util.modal('','确定清空全部失效商品吗?','确定','取消',true,() =>{
|
|
this.$util.modal('','确定清空全部失效商品吗?','确定','取消',true,() =>{
|
|
- this.ProductService.ShoppingCartDelete({userID:this.userID,productIDs:this.delGoodsList}).then(response =>{
|
|
|
|
|
|
+ this.ProductService.ShoppingCartDelete({userID:this.userId,productIDs:this.delGoodsList}).then(response =>{
|
|
this.$util.msg('删除成功',2000);
|
|
this.$util.msg('删除成功',2000);
|
|
setTimeout(()=>{
|
|
setTimeout(()=>{
|
|
this.isshowDelbtn = false;
|
|
this.isshowDelbtn = false;
|
|
@@ -1044,9 +1043,49 @@
|
|
}
|
|
}
|
|
return false
|
|
return false
|
|
},
|
|
},
|
|
- showPopup(index){// 显示popup弹窗
|
|
|
|
|
|
+ queryPopupCoupons(){// 获取弹窗优惠券列表
|
|
|
|
+ this.ProductService.ShoppingCartGetCoupon(this.couponParam).then(response =>{
|
|
|
|
+ let data = response.data
|
|
|
|
+ this.navbar[0].num = data.notCouponNum
|
|
|
|
+ this.navbar[1].num = data.couponNum
|
|
|
|
+ if(data.couponList && data.couponList.length >0){
|
|
|
|
+ this.productCouponList = data.couponList
|
|
|
|
+ this.isCouponEmpty = false
|
|
|
|
+ }else{
|
|
|
|
+ this.isCouponEmpty = true
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ .catch(error =>{
|
|
|
|
+ console.log('获取优惠券列表失败')
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ receiveCoupon(coupon){// 点击优惠券领取按钮
|
|
|
|
+ this.ProductService.ReceiveCoupon(
|
|
|
|
+ {
|
|
|
|
+ userId:this.couponParam.userId,
|
|
|
|
+ couponId:coupon.couponId,
|
|
|
|
+ source:2
|
|
|
|
+ }
|
|
|
|
+ )
|
|
|
|
+ .then(response =>{
|
|
|
|
+ this.$util.msg('领取成功',1500,true,'success')
|
|
|
|
+ setTimeout(()=>{
|
|
|
|
+ this.currentTab = 1
|
|
|
|
+ this.couponParam.status = 2
|
|
|
|
+ this.queryPopupCoupons()
|
|
|
|
+ },1500)
|
|
|
|
+ })
|
|
|
|
+ .catch(error =>{
|
|
|
|
+ this.$util.msg(error.msg,2000);
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ showPopup(index,shop){// 显示popup弹窗
|
|
switch(index){
|
|
switch(index){
|
|
case 0:
|
|
case 0:
|
|
|
|
+ this.currentTab = 0
|
|
|
|
+ this.couponParam.status = 1
|
|
|
|
+ this.couponParam.shopId = shop.id
|
|
|
|
+ this.queryPopupCoupons()
|
|
this.popupShow0 = true
|
|
this.popupShow0 = true
|
|
break;
|
|
break;
|
|
case 1:
|
|
case 1:
|
|
@@ -1066,18 +1105,15 @@
|
|
},
|
|
},
|
|
couponChange(e) {
|
|
couponChange(e) {
|
|
this.currentTab = e.index
|
|
this.currentTab = e.index
|
|
- console.log('currentTab',this.currentTab)
|
|
|
|
switch(this.currentTab){
|
|
switch(this.currentTab){
|
|
case 0:
|
|
case 0:
|
|
- this.listClass = 'list-used'
|
|
|
|
|
|
+ this.couponParam.status = 1
|
|
|
|
+ this.queryPopupCoupons()
|
|
break;
|
|
break;
|
|
case 1:
|
|
case 1:
|
|
- this.listClass = 'list-none'
|
|
|
|
- break;
|
|
|
|
- case 2:
|
|
|
|
- this.listClass = 'list-none'
|
|
|
|
|
|
+ this.couponParam.status = 2
|
|
|
|
+ this.queryPopupCoupons()
|
|
break;
|
|
break;
|
|
-
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1698,6 +1734,27 @@
|
|
float: left;
|
|
float: left;
|
|
&.coupon{
|
|
&.coupon{
|
|
padding-bottom: 40rpx;
|
|
padding-bottom: 40rpx;
|
|
|
|
+ .coupon-empty{
|
|
|
|
+ width: 100%;
|
|
|
|
+ height: 600rpx;
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ flex-direction: column;
|
|
|
|
+ position: fixed;
|
|
|
|
+ background: $bg-color;
|
|
|
|
+ .empty-container-image{
|
|
|
|
+ width: 150rpx;
|
|
|
|
+ height: 150rpx;
|
|
|
|
+ margin-bottom: 0;
|
|
|
|
+ margin-top: 0;
|
|
|
|
+ }
|
|
|
|
+ .error-text{
|
|
|
|
+ font-size: $font-size-28;
|
|
|
|
+ color: #999999;
|
|
|
|
+ line-height: 88rpx;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
.tui-popup-scroll{
|
|
.tui-popup-scroll{
|
|
width: 100%;
|
|
width: 100%;
|