瀏覽代碼

超级会员会员优惠券联调

zhengjinyi 3 年之前
父節點
當前提交
82b7023620

+ 1 - 1
components/cm-module/orderDetails/goodsList.vue

@@ -79,7 +79,7 @@
 							<view class="view-num">已退货/已取消</view>
 							<view class="view-right">{{ pros.returnedNum }}/{{ pros.actualCancelNum }}</view>
 						</view>
-						<view class="product-view">
+						<view class="product-view" v-if="pros.svipPriceType != 1">
 							<view class="view-num">折扣</view>
 							<view class="view-right">{{ pros.discount == null ? '0' : pros.discount }}%</view>
 						</view>

+ 38 - 37
pages/seller/cart/cart.vue

@@ -99,43 +99,44 @@
 											</view>
 											<view class="floor-item-act">
 												<template v-if="pros.actStatus == 1 && pros.promotions">
-                                                <view
-                                                    v-if="PromotionsFormat(pros.promotions)"
-                                                    class="floor-tags"
-                                                    @click.stop="clickPopupShow(pros, 1)"
-                                                >
-                                                    {{ pros.promotions.name }}
-                                                    <text v-if="pros.promotions != null && pros.promotions.type != 3">
-                                                        :¥{{
-                                                            pros.promotions == null
-                                                                ? '0.00'
-                                                                : pros.promotions.touchPrice | NumFormat
-                                                        }}
-                                                    </text>
-                                                </view>
-                                                <view
-                                                    v-else-if="pros.promotions.type != 3"
-                                                    class="floor-tags"
-                                                    @click.stop="clickPopupShow(pros, 2)"
-                                                >
-                                                    {{ pros.promotions.name }}
-                                                </view>
-                                            </template>
-                                            <template v-if="pros.actStatus == null && pros.ladderFlag == 1">
-                                                <view class="floor-tags" @click.stop="clickPopupShow(pros, 2)"
-                                                    >阶梯价格</view
-                                                >
-                                            </template>
-                                            <template v-if="pros.svipProductFlag == 1">
-                                                <view class="svip-tags">
-                                                    <view class="tags" :class="{ none: vipFlag == 0 }">SVIP</view>
-                                                    <view
-                                                        class="price"
-                                                        v-if="isShowVipFlag(pros)"
-                                                        >{{ pros.svipPriceTag }}</view
-                                                    >
-                                                </view>
-                                            </template>
+													<view
+														v-if="PromotionsFormat(pros.promotions)"
+														class="floor-tags"
+														@click.stop="clickPopupShow(pros, 1)"
+													>
+														{{ pros.promotions.name }}
+														<text v-if="pros.promotions != null && pros.promotions.type != 3">
+															:¥{{
+																pros.promotions == null
+																	? '0.00'
+																	: pros.promotions.touchPrice | NumFormat
+															}}
+														</text>
+													</view>
+													<view
+														v-else-if="pros.promotions.type != 3"
+														class="floor-tags"
+														@click.stop="clickPopupShow(pros, 2)"
+													>
+														{{ pros.promotions.name }}
+													</view>
+												</template>
+												<template v-if="pros.actStatus == null && pros.ladderFlag == 1">
+													<view class="floor-tags" @click.stop="clickPopupShow(pros, 2)"
+														>阶梯价格</view
+													>
+												</template>
+												<template v-if="pros.svipProductFlag == 1">
+													<view class="svip-tags">
+														<view class="tags" :class="{ none: vipFlag == 0 }">SVIP</view>
+														<view
+															class="price"
+															v-if="isShowVipFlag(pros)"
+															>{{ pros.svipPriceTag }}</view
+														>
+													</view>
+												</template>
+											</view>
 										</view>
 									</view>
 								</view>

+ 30 - 29
pages/user/coupon/coupon-collection.vue

@@ -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()
 			})
 		}
 	}

+ 26 - 3
pages/user/member/member.vue

@@ -83,10 +83,10 @@
 						</view>
 					</view>
 					<view class="list-cell-ri">
-						<view class="icon-used-btn receive" v-if="coupon.useStatus == 0" @click="receiveCoupon(coupon)"
+						<view class="icon-used-btn receive" v-if="coupon.getFlag == 0" @click="receiveCoupon(coupon)"
 							>立即领取</view
 						>
-						<view class="icon-used-btn make" v-if="coupon.useStatus == 1">已领取</view>
+						<view class="icon-used-btn make" v-if="coupon.getFlag == 1">已领取</view>
 					</view>
 				</view>
 			</view>
@@ -248,7 +248,8 @@ export default {
 				pageSize: 4
 			},
 			productCouponList: [],
-			productList: []
+			productList: [],
+			isReceiveLoading:false
 		}
 	},
 	onLoad() {},
@@ -293,6 +294,7 @@ export default {
 				.then(response => {
 					let data = response.data
 					this.userVip = data.vip
+					this.productCouponList = data.coupon
 					this.getSvipProductPage()
 					this.getUserSuperPackage()
 					this.isRequest = true
@@ -327,6 +329,27 @@ export default {
 					console.log('获取会员套餐异常~')
 				})
 		},
+		receiveCoupon(coupon){// 点击优惠券领取按钮
+			if(this.isReceiveLoading){return}
+			this.ProductService.ReceiveCoupon(
+				{
+					userId:this.payParam.userId,
+					couponId:coupon.couponId,
+					source:2
+				}) 
+			.then(response =>{
+				this.isReceiveLoading = true
+				this.$util.msg('领取成功',1500,true,'success')
+				setTimeout(()=>{
+					coupon.getFlag = 1
+					this.isReceiveLoading = false
+				},1500)
+			})
+			.catch(error =>{
+				this.$util.msg(error.msg,2000)
+				this.isReceiveLoading = false
+			})
+		},
 		hanldeShowBeans() {
 			// 显示采美豆抵扣开通超级会员弹窗
 			this.isShowBeansModal = true