浏览代码

修改计算金额

lex-xin 10 月之前
父节点
当前提交
71aae6e1b0
共有 1 个文件被更改,包括 13 次插入1 次删除
  1. 13 1
      src/views/resetTeaming/modals/subject-preview.vue

+ 13 - 1
src/views/resetTeaming/modals/subject-preview.vue

@@ -763,7 +763,19 @@ export default {
         toolsPackage.forEach(item => {
         toolsPackage.forEach(item => {
           if (item.isStatus) {
           if (item.isStatus) {
             this.buyCloudTeacher = true; // 临时处理,原因一条数据事要使用,如果多条数据会有问题
             this.buyCloudTeacher = true; // 临时处理,原因一条数据事要使用,如果多条数据会有问题
-            marketPrice += parseFloat(item.originalAmount);
+            const num = (this.tempNum[item.period] || 1) * item.num;
+            let price = 0;
+            if (num % 6 === 0) {
+              const halfYearNum = Number(num / 6);
+              this.formatList.forEach((format) => {
+                price += Number(format.halfYearPrice * halfYearNum);
+              });
+            } else {
+              this.formatList.forEach((format) => {
+                price += Number(format.monthPrice * num);
+              });
+            }
+            marketPrice += parseFloat(price);
             amount += parseFloat(item.actualAmount);
             amount += parseFloat(item.actualAmount);
           } else {
           } else {
             this.buyCloudTeacher = false;
             this.buyCloudTeacher = false;