panyong 3 роки тому
батько
коміт
4c631b96dc
1 змінених файлів з 14 додано та 3 видалено
  1. 14 3
      htmldev/loan/src/views/loan/calculator/index.vue

+ 14 - 3
htmldev/loan/src/views/loan/calculator/index.vue

@@ -489,12 +489,23 @@ export default {
       }
       this.meiyuehuanchuan = yuegong
       this.zonglixi = totalLixi
-      this.fetchRecommendProduct()
     },
     fetchRecommendProduct (moneyRate) {
+      let totalMoney = 0
+      let productMmaxYear = 0
+      if (loanType.value === 1) {
+        totalMoney = parseFloat(this.sdjine) * 10000
+        productMmaxYear = this.sdnianxian.value
+      } else if (loanType.value === 2) {
+        totalMoney = parseFloat(this.gjjjine) * 10000
+        productMmaxYear = this.gjjnianxian.value
+      } else if (loanType.value === 3) {
+        totalMoney = parseFloat(this.gjjjine) * 10000 + parseFloat(this.sdjine) * 10000
+        productMmaxYear = this.gjjnianxian.value + this.sdnianxian.value
+      }
       const postData = {
-        total_money: parseFloat(this.gjjjine) * 10000 + parseFloat(this.sdjine) * 10000, // 总贷款金额(单位:元)
-        product_max_year: this.gjjnianxian.value + this.sdnianxian.value, // 贷款年限
+        total_money: totalMoney, // 总贷款金额(单位:元)
+        product_max_year: productMmaxYear, // 贷款年限
         product_back_method: this.hkfangshi.text, // 还款方式(先息后本、等额本息、等额本金)
         money_rate: moneyRate // 计算器计算的利息
       }