From d4e6d812bf1e9fa55ea62745983f0b2a878ed8aa Mon Sep 17 00:00:00 2001
From: ZZJ <zzjdsg2300@163.com>
Date: 星期四, 31 三月 2022 10:24:33 +0800
Subject: [PATCH] 管理中心

---
 src/views/productDetail/components/PayCard.vue |  284 ++++++++++++++++----------------------------------------
 1 files changed, 81 insertions(+), 203 deletions(-)

diff --git a/src/views/productDetail/components/PayCard.vue b/src/views/productDetail/components/PayCard.vue
index 8177742..2569d6d 100644
--- a/src/views/productDetail/components/PayCard.vue
+++ b/src/views/productDetail/components/PayCard.vue
@@ -36,207 +36,6 @@
         <div class="label">浠锋牸</div>
         <div class="number">锟{ data.priceBase }}.00</div>
       </div>
-      <!-- 
-      <div class="row">
-        <div class="label">璐拱鏁伴噺</div>
-        <el-input-number
-          v-model="cartItem.devCount"
-          :disabled="data.productType == 5"
-          size="small"
-          :min="1"
-          label="鎻忚堪鏂囧瓧"
-        ></el-input-number>
-      </div>
-
-      <div class="row">
-        <div class="label">鏈嶅姟鏃堕暱</div>
-        <el-button-group class="serviceYearOpt">
-          <el-button
-            type="default"
-            size="small"
-            :class="cartItem.timeLength == 1 ? 'selected' : ''"
-            @click="selectYear(1)"
-            >涓�骞�</el-button
-          >
-          <el-button
-            type="default"
-            size="small"
-            :class="cartItem.timeLength == 2 ? 'selected' : ''"
-            @click="selectYear(2)"
-            >涓ゅ勾</el-button
-          >
-          <el-button
-            type="default"
-            size="small"
-            :class="cartItem.timeLength == 3 ? 'selected' : ''"
-            @click="selectYear(3)"
-            >涓夊勾</el-button
-          >
-        </el-button-group>
-      </div>
-
-      <div class="row">
-        <div class="label">閰嶇疆妯″潡</div>
-        <div class="check-component">
-          <div class="check-list">
-            <div
-              class="check-item"
-              v-for="(item, index) in cartItem.modules"
-              :key="index + 'c'"
-              :style="isSmartCalDot ? { cursor: 'default' } : {}"
-              :class="item.selected ? 'selected' : ''"
-              @click="selectModel(index)"
-            >
-              {{ item.moduleName }}
-            </div>
-          </div>
-          <div class="checked-list">
-            <div class="label">宸查��</div>
-            <div class="list">
-              <div
-                class="checked-item"
-                v-for="(item, index) in cartItem.modules"
-                v-show="item.selected"
-                :key="index + 'd'"
-              >
-                {{ item.moduleName }}
-              </div>
-            </div>
-          </div>
-        </div>
-      </div>
-
-      <div class="row">
-        <div class="label">璇锋眰鐮�</div>
-        <el-input
-          type="textarea"
-          autosize
-          placeholder="璇疯緭鍏ヨ姹傜爜"
-          v-model="cartItem.requestCode"
-        >
-        </el-input>
-      </div>
-
-      <div class="row">
-        <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>
-      </div>
-
-      <div class="row">
-        <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"
-          :disabled="!data.hasAuthPrice"
-          size="small"
-          :min="this.cartItem.chCount"
-          label="鎻忚堪鏂囧瓧"
-        ></el-input-number>
-        <span class="desText">鍙敮鎸佺殑杞璺暟</span>
-      </div>
-
-      <div class="row">
-        <div class="label">閰嶇疆绠楁硶</div>
-        <div class="check-component">
-          <div class="check-list">
-            <div
-              class="check-item"
-              v-for="(item, index) in cartItem.sdks"
-              :key="index + 'c'"
-              :class="item.selected ? 'selected' : ''"
-              @click="selectAlgorithm(index)"
-            >
-              {{ item.sdkName }}
-            </div>
-          </div>
-          <div class="checked-list">
-            <div class="label">宸查��</div>
-            <div class="list">
-              <div
-                class="checked-item"
-                v-for="(item, index) in cartItem.sdks"
-                v-show="item.selected"
-                :key="index + 'd'"
-              >
-                {{ item.sdkName }}
-              </div>
-            </div>
-          </div>
-        </div>
-      </div>
-
-      <div class="row">
-        <div class="label">鑺墖鏋舵瀯</div>
-        <el-select
-          v-model="cartItem.targetPlatform"
-          placeholder="璇烽�夋嫨浣跨敤鑺墖"
-          style="
-            width: 329px;
-            height: 40px;
-            border-color: #ddd;
-            border-radius: 0;
-          "
-        >
-          <el-option
-            v-for="item in data.productBaseDetail &&
-            data.productBaseDetail.platforms"
-            style="font-size: 12px"
-            :key="item.id"
-            :label="item.id"
-            :value="item.id"
-            :title="item.name"
-          ></el-option>
-        </el-select>
-      </div>
-
-      <div class="row">
-        <div class="label">璁惧ID</div>
-        <el-select
-          collapse-tags
-          multiple
-          :multiple-limit="cartItem.devCount"
-          v-model="cartItem.devIdList"
-          placeholder="璇烽�夋嫨璁惧ID"
-          :popper-append-to-body="false"
-          style="
-            width: 329px;
-            height: 40px;
-            border-color: #ddd;
-            border-radius: 0;
-          "
-        >
-          <el-option
-            v-for="item in devList"
-            style="font-size: 12px"
-            :key="item.id"
-            :label="item.id"
-            :value="item.id"
-            :title="item.id"
-          >
-            <span class="option-lt" :title="item.id">{{ item.id }}</span>
-            <span class="option-rt" :title="item.name">{{ item.name }}</span>
-          </el-option>
-        </el-select>
-      </div> -->
 
       <div class="row">
         <div class="label">璐拱鏁伴噺</div>
@@ -370,7 +169,8 @@
           data.productBaseDetail &&
           data.productBaseDetail.hasPriceBase &&
           data.productType != 5 &&
-          !isSmartCalDot
+          !isSmartCalDot &&
+          cartItem.sdks.length > 0
         "
       >
         <div class="label">閰嶇疆绠楁硶</div>
@@ -441,6 +241,40 @@
         v-if="
           data.productType != 2 &&
           data.productType != 1 &&
+          data.productType != 5 &&
+          data.productType == 3 &&
+          (cartItem.targetPlatform.includes('x86') ||
+            cartItem.targetPlatform.includes('X86'))
+        "
+      >
+        <div class="label">鏄惧崱鍨嬪彿</div>
+        <el-select
+          v-model="cartItem.vGpu"
+          style="
+            width: 329px;
+            height: 40px;
+            border-color: #ddd;
+            border-radius: 0;
+          "
+          placeholder="璇烽�夋嫨鏄惧崱鍨嬪彿"
+        >
+          <el-option
+            v-for="item in data.productBaseDetail &&
+            data.productBaseDetail.vGpus"
+            style="font-size: 12px"
+            :key="item.id"
+            :label="item.id"
+            :value="item.id"
+            :title="item.name"
+          ></el-option>
+        </el-select>
+      </div>
+
+      <div
+        class="row"
+        v-if="
+          data.productType != 2 &&
+          data.productType != 1 &&
           data.productType != 5
         "
       >
@@ -476,19 +310,30 @@
 
       <div class="btns">
         <div class="button addCar">鍔犲叆璐墿杞�</div>
-        <div class="button pay">绔嬪嵆璐拱</div>
+        <div class="button pay" @click="confirmNow">绔嬪嵆璐拱</div>
       </div>
     </div>
+
+    <ConfirmOrder
+      v-if="showOrder"
+      :orderId="orderId"
+      @close="showOrder = false"
+    ></ConfirmOrder>
   </div>
 </template>
 
 <script>
 import { findDevListByUser } from "@/api/device";
 import { getReleaseProduct } from "@/api/product";
+import { resumeOrder } from "@/api/shopcart";
+import ConfirmOrder from "@/views/productDetail/components/ConfirmOrder";
 
 export default {
   props: {
     dataInfo: {},
+  },
+  components: {
+    ConfirmOrder,
   },
   created() {
     this.getDevList();
@@ -528,6 +373,8 @@
         index: 0,
         url: "",
       },
+      showOrder: false,
+      orderId: "",
     };
   },
   methods: {
@@ -672,6 +519,37 @@
       this.activeImg.index = index;
       this.activeImg.url = url;
     },
+    confirmNow() {
+      this.cartItem.totalPrice = this.computTotalPrice;
+      let products = [
+        {
+          activateCode: this.cartItem.requestCode,
+          authCount: this.cartItem.authCount,
+          chCount: this.cartItem.chCount,
+          devCount: this.cartItem.devCount,
+          devIdList: this.cartItem.devIdList,
+          moduleIds: this.cartItem.moduleIds,
+          productId: this.cartItem.id,
+          productPrice: this.cartItem.totalPrice,
+          quantity: 1,
+          sdkIds: this.cartItem.sdkIds,
+          serveYear: this.cartItem.timeLength,
+          targetPlatform: this.cartItem.targetPlatform,
+          vGpu: this.cartItem.vGpu,
+        },
+      ];
+      resumeOrder({
+        orderMoney: this.numeral(this.sum).value(),
+        payMethod: 0,
+        products,
+        status: 0,
+      }).then((res) => {
+        if (res.success) {
+          this.orderId = res.data.orderId;
+          this.showOrder = true;
+        }
+      });
+    },
   },
 };
 </script>

--
Gitblit v1.8.0