gcj преди 3 години
родител
ревизия
5f9717391e
променени са 1 файла, в които са добавени 19 реда и са изтрити 5 реда
  1. 19 5
      src/components/pyment/Confirmorder.vue

+ 19 - 5
src/components/pyment/Confirmorder.vue

@@ -36,7 +36,11 @@
         <!-- 确定 -->
         {{ $t("Key94") }}</span
       >
-      <span class="sp2" v-else>-¥<span v-html="changePrice(discount_money,16)"></span></span>
+       <template v-else>
+        <span class="sp2" v-if="discount_code_status == 1"
+          >-<span v-html="changePrice(discount_money, 16)"></span
+        ></span>
+      </template>
     </div>
     <div class="total">
       <p class="p1">
@@ -88,6 +92,7 @@ export default {
       discount_money: 0, // 优惠金额
       receivables_money: this.data.price, // 应收款
       back_discount_code: "", //优惠码
+      discount_code_status:0,
       loading: false,
       codeloading: false,
       isShow: true,
@@ -162,10 +167,19 @@ export default {
       };
       LearnWebSI(MethodName, data).then((res) => {
         this.codeloading = false;
-        this.isShow = false;
-        this.back_discount_code = res.discount_code;
-        this.discount_money = res.discount_money; // 优惠金额
-        this.receivables_money = res.receivables_money; // 应收款
+        this.discount_code_status = res.discount_code_status;
+        if (this.discount_code_status != 1 && this.discount_code_status != 2) {
+          this.$message.warning("优惠码无效");
+        } else {
+          if (this.discount_code_status == 2) {
+            this.$message.warning("优惠码已被使用");
+          } else {
+            this.isShow = false;
+            this.back_discount_code = res.discount_code;
+            this.discount_money = res.discount_money; // 优惠金额
+            this.receivables_money = res.receivables_money; // 应收款
+          }
+        }
       });
     },
     changePrice(price, fontSize1, fontSize2) {