|
@@ -268,9 +268,10 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { Form, Field, Popup, Picker, Button } from 'vant'
|
|
|
+import { Form, Field, Popup, Picker, Button, Toast } from 'vant'
|
|
|
import { loanConfig } from './config'
|
|
|
import { calcute } from './config/calculate'
|
|
|
+import { getRecommendProduct } from './api'
|
|
|
|
|
|
export default {
|
|
|
name: 'index',
|
|
@@ -330,6 +331,14 @@ export default {
|
|
|
// 商贷利率
|
|
|
columns4 () {
|
|
|
return this.lilvCal(this.sdnianxian.value, loanConfig.shangdaiLilv, loanConfig.shangdaiSelect)
|
|
|
+ },
|
|
|
+ recommendedProduct: {
|
|
|
+ get () {
|
|
|
+ return this.$store.state.loan.recommendedProduct
|
|
|
+ },
|
|
|
+ set (val) {
|
|
|
+ this.$store.commit('loan/UPDATE_RECOMMENDEDPRODUCT', val)
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
activated () {
|
|
@@ -469,16 +478,35 @@ export default {
|
|
|
}
|
|
|
break
|
|
|
}
|
|
|
-
|
|
|
+ this.recommendedProduct = []
|
|
|
if (result.yuegong) {
|
|
|
yuegong = this.formatCurrency(result.yuegong)
|
|
|
}
|
|
|
|
|
|
if (result.totalLixi) {
|
|
|
totalLixi = this.formatCurrency(result.totalLixi / 10000)
|
|
|
+ this.fetchRecommendProduct(result.totalLixi)
|
|
|
}
|
|
|
this.meiyuehuanchuan = yuegong
|
|
|
this.zonglixi = totalLixi
|
|
|
+ this.fetchRecommendProduct()
|
|
|
+ },
|
|
|
+ fetchRecommendProduct (moneyRate) {
|
|
|
+ const postData = {
|
|
|
+ total_money: parseFloat(this.gjjjine) * 10000 + parseFloat(this.sdjine) * 10000, // 总贷款金额(单位:元)
|
|
|
+ product_max_year: this.gjjnianxian.value + this.sdnianxian.value, // 贷款年限
|
|
|
+ product_back_method: this.hkfangshi.text, // 还款方式(先息后本、等额本息、等额本金)
|
|
|
+ money_rate: moneyRate // 计算器计算的利息
|
|
|
+ }
|
|
|
+ getRecommendProduct(postData).then(res => {
|
|
|
+ if (res.status) {
|
|
|
+ this.recommendedProduct = res.data
|
|
|
+ return
|
|
|
+ }
|
|
|
+ Toast(res.msg)
|
|
|
+ }).catch(err => {
|
|
|
+ Toast(err.msg)
|
|
|
+ })
|
|
|
}
|
|
|
},
|
|
|
beforeDestroy () {
|