From a0b5604fcefa0c7900ecc50830b718f77bba8f39 Mon Sep 17 00:00:00 2001
From: heyujie <516346543@qq.com>
Date: 星期五, 15 七月 2022 14:43:40 +0800
Subject: [PATCH] add cluster pwd

---
 src/views/productDetail/components/PayCard.vue |   59 ++++++++++++++++++++++++++++++++++++++++-------------------
 1 files changed, 40 insertions(+), 19 deletions(-)

diff --git a/src/views/productDetail/components/PayCard.vue b/src/views/productDetail/components/PayCard.vue
index 2569d6d..18a7ef1 100644
--- a/src/views/productDetail/components/PayCard.vue
+++ b/src/views/productDetail/components/PayCard.vue
@@ -1,16 +1,16 @@
 <template>
   <div class="PayCard">
     <div class="imageArea" v-if="data.pics.length">
-      <img class="activeImg" :src="'/httpImage/' + activeImg.url" />
+      <ImageShow class="activeImg" :src="activeImg.url" />
       <div class="imgList">
-        <img
+        <ImageShow
           v-for="(item, index) in data.pics"
           class="preImg"
-          :src="'/httpImage/' + item.url"
+          :src="item.url"
           :key="index"
           alt=""
           :class="{ active: activeImg.index == index }"
-          @click="selectImg(index, item.url)"
+          @click.native="selectImg(index, item.url)"
         />
       </div>
     </div>
@@ -142,16 +142,6 @@
         v-if="data.productBaseDetail && data.productBaseDetail.hasAuthPrice"
       >
         <div class="label">鎺堟潈鏁伴噺</div>
-        <el-input-number
-          v-model="cartItem.chCount"
-          @change="handleChangeCh"
-          :disabled="!data.hasChUnitPrice"
-          size="small"
-          :min="1"
-          :max="16"
-          label="鎻忚堪鏂囧瓧"
-        ></el-input-number>
-        <span class="desText">鏈�澶ф敮鎸�16璺�</span>
         <el-input-number
           v-model="cartItem.authCount"
           @change="handleChangeAuth"
@@ -310,7 +300,9 @@
 
       <div class="btns">
         <div class="button addCar">鍔犲叆璐墿杞�</div>
-        <div class="button pay" @click="confirmNow">绔嬪嵆璐拱</div>
+        <div class="button pay" @click="confirmNow">
+          {{ data.priceBase ? "绔嬪嵆璐拱" : "鍏嶈垂璇曠敤" }}
+        </div>
       </div>
     </div>
 
@@ -327,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: {
@@ -336,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;
@@ -344,8 +340,8 @@
   },
   data() {
     return {
-      data: this.dataInfo.data,
-      labels: this.dataInfo.labels,
+      data: {},
+      labels: [],
       cartItem: {
         id: "",
         productName: "",
@@ -520,7 +516,6 @@
       this.activeImg.url = url;
     },
     confirmNow() {
-      this.cartItem.totalPrice = this.computTotalPrice;
       let products = [
         {
           activateCode: this.cartItem.requestCode,
@@ -543,10 +538,32 @@
         payMethod: 0,
         products,
         status: 0,
+        userId: JSON.parse(sessionStorage.getItem("userInfo")).id,
       }).then((res) => {
         if (res.success) {
           this.orderId = res.data.orderId;
-          this.showOrder = true;
+
+          if (this.data.priceBase == 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;
+          } else {
+            this.showOrder = true;
+          }
         }
       });
     },
@@ -749,6 +766,10 @@
           border: 1px solid #c0c5cc;
           border-radius: 0;
         }
+
+        .el-tag {
+          margin-top: 0;
+        }
       }
     }
 

--
Gitblit v1.8.0