From a689af1348938afd3b4506aad9b6d5057193e25d Mon Sep 17 00:00:00 2001
From: ZZJ <10913410+zzj2100@user.noreply.gitee.com>
Date: 星期五, 27 五月 2022 09:59:00 +0800
Subject: [PATCH] bug修复

---
 src/views/productDetail/components/PayCard.vue |   33 +++++++++++++++++++++++++++++++--
 1 files changed, 31 insertions(+), 2 deletions(-)

diff --git a/src/views/productDetail/components/PayCard.vue b/src/views/productDetail/components/PayCard.vue
index 11c0f36..91c8931 100644
--- a/src/views/productDetail/components/PayCard.vue
+++ b/src/views/productDetail/components/PayCard.vue
@@ -319,6 +319,7 @@
 import { getReleaseProduct } from "@/api/product";
 import { resumeOrder } from "@/api/shopcart";
 import ConfirmOrder from "@/views/productDetail/components/ConfirmOrder";
+import { resumePay } from "@/api/order";
 
 export default {
   props: {
@@ -328,6 +329,9 @@
     ConfirmOrder,
   },
   created() {
+    this.data = this.dataInfo.data;
+    this.labels = this.dataInfo.labels;
+    this.cartItem.id = this.data.id;
     this.getDevList();
     if (this.dataInfo.data.pics.length > 0) {
       this.activeImg.url = this.dataInfo.data.pics[0].url;
@@ -336,8 +340,8 @@
   },
   data() {
     return {
-      data: this.dataInfo.data,
-      labels: this.dataInfo.labels,
+      data: {},
+      labels: [],
       cartItem: {
         id: "",
         productName: "",
@@ -539,6 +543,27 @@
       }).then((res) => {
         if (res.success) {
           this.orderId = res.data.orderId;
+
+          if (this.cartItem.totalPrice == 0) {
+            resumePay({ orderId: this.orderId, payMethod: 5 }).then((res) => {
+              if (res.success) {
+                this.$router.push({
+                  path: "/personalCenter",
+                  query: {
+                    id: 1,
+                  },
+                });
+                this.$notify({
+                  type: "success",
+                  message: "鎴愬姛璇曠敤",
+                  duration: 2500,
+                  offset: 57,
+                });
+              }
+            });
+            return;
+          }
+
           this.showOrder = true;
         }
       });
@@ -742,6 +767,10 @@
           border: 1px solid #c0c5cc;
           border-radius: 0;
         }
+
+        .el-tag {
+          margin-top: 0;
+        }
       }
     }
 

--
Gitblit v1.8.0