From 4d1c8d14a4963bef44b8bcba5b49e71be3479f89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=AE=BF=E6=98=95?= Date: Fri, 30 Oct 2020 18:29:40 +0800 Subject: [PATCH] soon --- src/components/shop-cloud/shop-cloud.vue | 63 ++++++++++++++++------- src/pages/user/order/order_detail.vue | 4 +- src/pages/workbench/fwgl/cloud-detail.vue | 2 +- src/pages/workbench/fwgl/fwglList.vue | 5 ++ src/pages/workbench/fwzc_fwcs.vue | 2 +- src/request/api/service-shop.js | 2 +- 6 files changed, 55 insertions(+), 23 deletions(-) diff --git a/src/components/shop-cloud/shop-cloud.vue b/src/components/shop-cloud/shop-cloud.vue index 2cb6c83..be21b48 100644 --- a/src/components/shop-cloud/shop-cloud.vue +++ b/src/components/shop-cloud/shop-cloud.vue @@ -1053,15 +1053,27 @@ export default { a_deductions = this.deductions; if (this.formNew.cpu == "8") { if (this.formNew.memory == "16") { - sumCM += 10880; + let priceObj = this.cpu_memory.find(item => { + return item.cpu == 8 && item.memory == 16; + }) + sumCM += priceObj.price; } else if (this.formNew.memory == "32") { - sumCM += 16310; + let priceObj = this.cpu_memory.find(item => { + return item.cpu == 8 && item.memory == 32; + }) + sumCM += priceObj.price; } } else if (this.formNew.cpu == "16") { if (this.formNew.memory == "32") { - sumCM += 21750; + let priceObj = this.cpu_memory.find(item => { + return item.cpu == 16 && item.memory == 32; + }) + sumCM += priceObj.price; } else if (this.formNew.memory == "64") { - sumCM += 32610; + let priceObj = this.cpu_memory.find(item => { + return item.cpu == 16 && item.memory == 64; + }) + sumCM += priceObj.price; } } if ( @@ -1073,7 +1085,7 @@ export default { this.formNew.dataDisk * this.formNew.perDataDisk * this.formNew.appDuration * - 4.2; + this.hard_disk[0].price; this.jifeiList1[2] = { name: "数据盘", num: `${this.formNew.dataDisk}个数据盘,每个数据盘${this.formNew.perDataDisk}GB`, @@ -1100,15 +1112,27 @@ export default { a_deductions = this.deductions; if (this.formOld.cpu == "8") { if (this.formOld.memory == "16") { - sumCM += 10880; + let priceObj = this.cpu_memory.find(item => { + return item.cpu == 8 && item.memory == 16; + }) + sumCM += priceObj.price; } else if (this.formOld.memory == "32") { - sumCM += 16310; + let priceObj = this.cpu_memory.find(item => { + return item.cpu == 8 && item.memory == 32; + }) + sumCM += priceObj.price; } } else if (this.formOld.cpu == "16") { if (this.formOld.memory == "32") { - sumCM += 21750; + let priceObj = this.cpu_memory.find(item => { + return item.cpu == 16 && item.memory == 32; + }) + sumCM += priceObj.price; } else if (this.formOld.memory == "64") { - sumCM += 32610; + let priceObj = this.cpu_memory.find(item => { + return item.cpu == 16 && item.memory == 64; + }) + sumCM += priceObj.price; } } if ( @@ -1120,7 +1144,7 @@ export default { this.formOld.dataDisk * this.formOld.perDataDisk * this.formOld.appDuration * - 4.2; + this.hard_disk[0].price; this.jifeiList1[2] = { name: "数据盘", num: `${this.formOld.dataDisk}个数据盘,每个数据盘${this.formOld.perDataDisk}GB`, @@ -1144,7 +1168,7 @@ export default { this.formOld.appDuration >= 1 ? this.formOld.appDuration : 0 }个月`; } - this.amounts_payable = sumCM + sumDisk; + this.amounts_payable = (sumCM + sumDisk).toFixed(2); // this.total_money = sumCM + sumDisk - a_deductions; return this.amounts_payable; }, @@ -1444,11 +1468,14 @@ export default { sum: "金币", }, ], + cpu_memory: [], + hard_disk: [], }; }, mounted() { this.getUser(); this.getNameSpaceList(); + this.getSpecifications(); }, methods: { getQueryId() { @@ -1505,8 +1532,8 @@ export default { getSpecifications() { this.$api.serviceShop.getSpecifications().then((response) => { if (response.data.success == 1) { - this.amounts_payable = 1000; - this.amounts_payable = 1000; + this.cpu_memory = response.data.data.cpu_memory; + this.hard_disk = response.data.data.hard_disk; } else { this.$message({ message: "获取资源规格失败,请刷新网页", @@ -1648,16 +1675,16 @@ export default { }, disks: [ { - disk_num: this.formNew.dataDisk, - disk_cap: this.formNew.perDataDisk, - store_type: this.formNew.store_type, + disk_num: this.formNew.dataDisk + "", + disk_cap: this.formNew.perDataDisk + "", + store_type: this.formNew.store_type + "", }, ], payment: { - total_money: this.total_money, + // total_money: this.total_money, disk_single_money: this.disk_single_money, eci_single_money: this.eci_single_money, - amounts_payable: this.amounts_payable, + total_money: this.amounts_payable, }, }; this.$api.serviceShop.applicationCloud(query).then((response) => { diff --git a/src/pages/user/order/order_detail.vue b/src/pages/user/order/order_detail.vue index fbacf65..f74c14b 100644 --- a/src/pages/user/order/order_detail.vue +++ b/src/pages/user/order/order_detail.vue @@ -323,7 +323,7 @@ {{ orderDetail.total_money }}金币 - { urls.push({ - name: item.one_input, + req_name: item.one_input, response_type: "JSON", req_auth_mthod: 0, req_auth_token: item.tokenVal, diff --git a/src/request/api/service-shop.js b/src/request/api/service-shop.js index 946e3ab..439ed09 100644 --- a/src/request/api/service-shop.js +++ b/src/request/api/service-shop.js @@ -47,7 +47,7 @@ businessArea=${params.businessArea}&developable=${params.developable}&orgSource= return axios.get(`/apaas/service/v3/resource/apply/checkNs?namespace=${params.id}`) }, getSpecifications() { - return axios.get(``) + return axios.get(`/apaas/serviceapp/v3/resource/price`) }, // shopping cart -- 2.26.0