Ver Fonte

首页结算页面获取优惠券数量

DELL há 3 anos atrás
pai
commit
69fd13f02b
1 ficheiros alterados com 15 adições e 2 exclusões
  1. 15 2
      src/components/pay-popup/pay-popup.vue

+ 15 - 2
src/components/pay-popup/pay-popup.vue

@@ -20,7 +20,7 @@
 					</view>
 					<view class="coupon-right flex">
 						<view class="txt coupon-right-color" v-if="$numberFormat(payInfo.discountAmt) != 0">-¥{{ $numberFormat(payInfo.discountAmt)}}</view>
-						<view class="txt" v-else-if="payInfo.listNum != undefined">{{payInfo.listNum}}张可用</view>
+						<view class="txt" v-else-if="total != 0">{{ total }}张可用</view>
 						<view class="txt" v-else>暂无可用优惠券</view>
 						<image src="../../static/public/public_right_arrow.png" mode="scaleToFill"></image>
 					</view>
@@ -72,10 +72,23 @@
 			return {
 				checked: true,
 				authShow: false,
+				total: 0,
 			};
 		},
-		
+		created(){
+			this.getTotal()
+		},
 		methods: {
+			getTotal(){
+				$http.post(`/api/v1/mp/user/ticket/order/coupon/listPage`, {}).then(
+					res => {
+						if (res.code == 0) {
+							this.total = res.total
+							console.log(res);
+						}
+					}).catch(() => {
+				})
+			},
 			changeChecked(e) {
 				this.checked = e
 			},