Browse Source

可以使用优惠券

gcz 11 months ago
parent
commit
b8f265bac3
2 changed files with 9 additions and 4 deletions
  1. 3 1
      common/apiurl.js
  2. 6 3
      pages/choosePayment/choosePayment.vue

+ 3 - 1
common/apiurl.js

@@ -132,6 +132,7 @@ export const apiurl = {
   getDictUrl: '/admin/dict/data/type/',
   // 微信支付
   wechatPayUrl: '/client/pay/wechat',
+  wechatPayUrl: '/client/pay/wechatV2',
   // 停车场微信支付
   parkingWechatPayUrl: '/client/payment/parking/wechat',
   // 获取参数
@@ -147,7 +148,8 @@ export const apiurl = {
   // 根据订单号刷新优惠券状态(用于取消支付情况)
   updateCouponStatusUrl: '/client/couponInfo/backCoupon',
   // 根据订单id获取符合要求的优惠券
-  getCouponByOrderIdUrl: '/client/couponInfo/memberCoupon',
+  // getCouponByOrderIdUrl: '/client/couponInfo/memberCoupon',
+  getCouponByOrderIdUrl: '/client/couponInfo/couponPayList',
   // 根据室内停车场二维码查询车辆列表信息
   getVehicleInquiryListUrl: '/client/parking-orderinfo/detail/advance',
   // 根据停车场编号和车牌查询订单

+ 6 - 3
pages/choosePayment/choosePayment.vue

@@ -331,7 +331,8 @@ export default {
       // 计算订单金额
       this.orderMoney = details.payAmount.toFixed(2);
       // 如果是单个停车订单,且是路边停车,且不是月卡支付,则显示优惠券
-      if (numType === 'single' && orderType === 'parking' && !this.isMonthPay && this.wxEnv) {
+	  // console.table({numType:numType,orderType:orderType,isMonthPay:!this.isMonthPay,wxEnv:this.wxEnv});
+      if (numType === 'single' && orderType === 'road' && !this.isMonthPay && this.wxEnv) {
         this.isShowCoupon = true;
         this.isCancelCoupon = true;
         this.getCouponList(details.id);
@@ -344,8 +345,10 @@ export default {
      * @returns {any}
      */
     getCouponList(orderId) {
-      this.$u.api.getCouponByOrderIdApi({ orderId }).then((res) => {
-        this.couponPopup.couponList = res?.data ?? [];
+      this.$u.api.getCouponByOrderIdApi({ orderId:orderId,payAmount:this.orderMoney }).then((res) => {
+		  console.log('getCouponList',res);
+        this.couponPopup.couponList = res?.data.list ?? [];
+		  // console.log(' this.couponPopup.couponList', this.couponPopup.couponList);
       });
     },
     /**