From 3ad5e6df619db267e10ec9435066f143cfd55ae0 Mon Sep 17 00:00:00 2001
From: heyujie <516346543@qq.com>
Date: 星期五, 22 四月 2022 16:30:06 +0800
Subject: [PATCH] login type code
---
src/views/productDetail/components/PayCard.vue | 297 ++++++++++++++++------------------------------------------
1 files changed, 84 insertions(+), 213 deletions(-)
diff --git a/src/views/productDetail/components/PayCard.vue b/src/views/productDetail/components/PayCard.vue
index 8177742..182540f 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>
@@ -344,16 +143,6 @@
>
<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"
@@ -370,7 +159,8 @@
data.productBaseDetail &&
data.productBaseDetail.hasPriceBase &&
data.productType != 5 &&
- !isSmartCalDot
+ !isSmartCalDot &&
+ cartItem.sdks.length > 0
"
>
<div class="label">閰嶇疆绠楁硶</div>
@@ -441,6 +231,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 +300,32 @@
<div class="btns">
<div class="button addCar">鍔犲叆璐墿杞�</div>
- <div class="button pay">绔嬪嵆璐拱</div>
+ <div class="button pay" @click="confirmNow">
+ {{ data.priceBase ? "绔嬪嵆璐拱" : "鍏嶈垂璇曠敤" }}
+ </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 +365,8 @@
index: 0,
url: "",
},
+ showOrder: false,
+ orderId: "",
};
},
methods: {
@@ -672,6 +511,38 @@
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,
+ userId: JSON.parse(sessionStorage.getItem("userInfo")).id,
+ }).then((res) => {
+ if (res.success) {
+ this.orderId = res.data.orderId;
+ this.showOrder = true;
+ }
+ });
+ },
},
};
</script>
--
Gitblit v1.8.0