From 2b99047683332624832c1dfcae596e957a710b7d Mon Sep 17 00:00:00 2001 From: ZZJ <10913410+zzj2100@user.noreply.gitee.com> Date: 星期四, 28 七月 2022 10:20:49 +0800 Subject: [PATCH] bug修复 --- src/views/productDetail/components/PayCard.vue | 77 ++++++++++++++++++++++++++++++++------ 1 files changed, 65 insertions(+), 12 deletions(-) diff --git a/src/views/productDetail/components/PayCard.vue b/src/views/productDetail/components/PayCard.vue index 18a7ef1..b4d8c35 100644 --- a/src/views/productDetail/components/PayCard.vue +++ b/src/views/productDetail/components/PayCard.vue @@ -19,22 +19,31 @@ <div class="title"> <div class="name">{{ data.productName }}</div> <div class="tagList"> - <span class="tag" v-for="(name, index) in labels" :key="index">{{ + <!-- <span class="tag" v-for="(name, index) in labels" :key="index">{{ name - }}</span> + }}</span> --> + <span class="tag red" v-if="data.productType == 1">杞欢</span> + <span class="tag orange" v-if="data.productType == 4">搴旂敤</span> + <span class="tag lightBlue" v-if="data.productType == 3">SDK</span> + <span class="tag" v-if="data.productType == 2">杞‖涓�浣�</span> + <span class="tag blue" v-if="data.productType == 5">浜у搧瀵嗛挜</span> </div> </div> <div class="des">{{ data.description }}</div> <div class="typeVersion"> <div class="label">鍨嬪彿:</div> - <div class="typeVersionContent">{{ data.productModel }}</div> + <div class="typeVersionContent"> + {{ data.productModel ? data.productModel : "-" }} + </div> <div class="label">鐗堟湰:</div> - <div class="typeVersionContent">{{ data.productVersion }}</div> + <div class="typeVersionContent"> + {{ data.productVersion ? data.productVersion : "-" }} + </div> </div> <div class="price"> <div class="label">浠锋牸</div> - <div class="number">锟{ data.priceBase }}.00</div> + <div class="number">锟{ this.totalMoney }}.00</div> </div> <div class="row"> @@ -299,9 +308,9 @@ </div> <div class="btns"> - <div class="button addCar">鍔犲叆璐墿杞�</div> + <!-- <div class="button addCar">鍔犲叆璐墿杞�</div> --> <div class="button pay" @click="confirmNow"> - {{ data.priceBase ? "绔嬪嵆璐拱" : "鍏嶈垂璇曠敤" }} + {{ totalMoney ? "绔嬪嵆璐拱" : "鍏嶈垂璇曠敤" }} </div> </div> </div> @@ -372,6 +381,28 @@ showOrder: false, orderId: "", }; + }, + computed: { + totalMoney() { + let modulesPrice = 0; + this.cartItem.moduleIds.forEach((id) => { + this.data.modulePriceSet.forEach((module) => { + if (module.moduleId === id) { + modulesPrice += module.modulePrice; + } + }); + }); + + let priceSingle = + this.data.priceBase + + this.data.authPrice * this.cartItem.authCount + + this.data.chUnitPrice * this.cartItem.chCount + + modulesPrice; + + console.log(this.data); + + return priceSingle * this.cartItem.devCount * this.cartItem.timeLength; + }, }, methods: { getInfo() { @@ -453,8 +484,6 @@ this.cartItem.timeLength = year; }, selectModel(index) { - console.log("-----"); - console.log(this.isSmartCalDot); if (this.isSmartCalDot) { return; } @@ -534,7 +563,7 @@ }, ]; resumeOrder({ - orderMoney: this.numeral(this.sum).value(), + orderMoney: this.numeral(this.totalMoney).value(), payMethod: 0, products, status: 0, @@ -543,13 +572,13 @@ if (res.success) { this.orderId = res.data.orderId; - if (this.data.priceBase == 0) { + if (this.totalMoney == 0) { resumePay({ orderId: this.orderId, payMethod: 5 }).then((res) => { if (res.success) { this.$router.push({ path: "/personalCenter", query: { - id: 1, + id: 0, }, }); this.$notify({ @@ -630,6 +659,26 @@ padding: 2px 5px; border: 1px solid #ff5033; color: #ff5033; + + &.red { + color: #ff4f32; + border-color: #ff4f32; + } + + &.orange { + color: #ff9500; + border-color: #ff9500; + } + + &.lightBlue { + color: #00bee7; + border-color: #00bee7; + } + + &.blue { + color: #0064ff; + border-color: #0064ff; + } } } } @@ -770,6 +819,10 @@ .el-tag { margin-top: 0; } + + .el-select__tags-text { + color: #999; + } } } -- Gitblit v1.8.0