|
@@ -1,8 +1,7 @@
|
|
|
<template>
|
|
|
<div class="ttyf-wrapper">
|
|
|
<!--信息编辑-->
|
|
|
- <van-form @submit="onSubmit"
|
|
|
- ref="myVanform">
|
|
|
+ <van-form ref="myVanform">
|
|
|
<!--标题:妥妥计算器-->
|
|
|
<img class="title" src="" alt="">
|
|
|
<van-field
|
|
@@ -23,7 +22,7 @@
|
|
|
</template>
|
|
|
</van-field>
|
|
|
<!--公积金-->
|
|
|
- <template v-if="['2', '3'].findIndex(item => item === loanType.value) > -1">
|
|
|
+ <template v-if="[2, 3].findIndex(item => item === loanType.value) > -1">
|
|
|
<van-field
|
|
|
v-model="gjjjine"
|
|
|
type="tel"
|
|
@@ -75,7 +74,7 @@
|
|
|
</van-field>
|
|
|
</template>
|
|
|
<!--商业贷款-->
|
|
|
- <template v-if="['1', '3'].findIndex(item => item === loanType.value) > -1">
|
|
|
+ <template v-if="[1, 3].findIndex(item => item === loanType.value) > -1">
|
|
|
<van-field
|
|
|
v-model="sdjine"
|
|
|
type="tel"
|
|
@@ -134,7 +133,7 @@
|
|
|
:border="false"
|
|
|
:right-icon="iconOfarrow"
|
|
|
placeholder="请选择还款方式"
|
|
|
- class="ttyf-van-cell ttyf-no-arrow"
|
|
|
+ class="ttyf-van-cell"
|
|
|
@click="showPicker5 = true">
|
|
|
<template #label>
|
|
|
<p>
|
|
@@ -344,7 +343,6 @@ export default {
|
|
|
this.$route.meta.isUseCache = false
|
|
|
},
|
|
|
methods: {
|
|
|
- // sdYear, config.shangdaiLilv, config.shangdaiSelect
|
|
|
lilvCal (year, lilv, selectcontent) {
|
|
|
let getLilv = ''
|
|
|
lilv.forEach(item => {
|
|
@@ -363,6 +361,8 @@ export default {
|
|
|
onConfirm0 (value, index) {
|
|
|
this.loanType = value
|
|
|
this.showPicker0 = false
|
|
|
+
|
|
|
+ this.handleComputed()
|
|
|
},
|
|
|
onCancel0 () {
|
|
|
const index = this.columns0.findIndex(item => item.value === this.loanType.value)
|
|
@@ -375,6 +375,8 @@ export default {
|
|
|
onConfirm1 (value, index) {
|
|
|
this.gjjnianxian = value
|
|
|
this.showPicker1 = false
|
|
|
+
|
|
|
+ this.handleComputed()
|
|
|
},
|
|
|
onCancel1 () {
|
|
|
const index = this.columns1.findIndex(item => item.value === this.gjjnianxian.value)
|
|
@@ -387,6 +389,8 @@ export default {
|
|
|
onConfirm2 (value, index) {
|
|
|
this.gjjlilv = value
|
|
|
this.showPicker2 = false
|
|
|
+
|
|
|
+ this.handleComputed()
|
|
|
},
|
|
|
onCancel2 () {
|
|
|
const index = this.columns2.findIndex(item => item.lilv === this.gjjlilv.lilv)
|
|
@@ -396,9 +400,11 @@ export default {
|
|
|
this.showPicker2 = false
|
|
|
},
|
|
|
// 商贷年限
|
|
|
- onConfirm3 (value, index) {
|
|
|
+ onConfirm3 (value) {
|
|
|
this.sdnianxian = value
|
|
|
this.showPicker3 = false
|
|
|
+
|
|
|
+ this.handleComputed()
|
|
|
},
|
|
|
onCancel3 () {
|
|
|
const index = this.columns3.findIndex(item => item.value === this.sdnianxian.value)
|
|
@@ -411,7 +417,9 @@ export default {
|
|
|
onConfirm4 (value, index) {
|
|
|
this.sdlilv = value
|
|
|
this.showPicker4 = false
|
|
|
- console.log(calcute.singleDk(1, 20, this.sdnianxian.value, this.sdlilv.lilv))
|
|
|
+ calcute.singleDk(1, 20, this.sdnianxian.value, this.sdlilv.lilv)
|
|
|
+
|
|
|
+ this.handleComputed()
|
|
|
},
|
|
|
onCancel4 () {
|
|
|
const index = this.columns4.findIndex(item => item.lilv === this.sdlilv.lilv)
|
|
@@ -424,6 +432,8 @@ export default {
|
|
|
onConfirm5 (value, index) {
|
|
|
this.hkfangshi = value
|
|
|
this.showPicker5 = false
|
|
|
+
|
|
|
+ this.handleComputed()
|
|
|
},
|
|
|
onCancel5 () {
|
|
|
const index = this.columns5.findIndex(item => item.value === this.hkfangshi.value)
|
|
@@ -432,7 +442,30 @@ export default {
|
|
|
}
|
|
|
this.showPicker5 = false
|
|
|
},
|
|
|
- onSubmit (values = {}) {
|
|
|
+ async handleComputed () {
|
|
|
+ await this.$nextTick()
|
|
|
+ let result = {}
|
|
|
+ // 还款方式
|
|
|
+ const payType = this.hkfangshi.value
|
|
|
+ switch (this.loanType.value) {
|
|
|
+ case 1:
|
|
|
+ if (this.sdjine) {
|
|
|
+ result = calcute.singleDk(payType, this.sdjine, this.sdnianxian.value, this.sdlilv.lilv)
|
|
|
+ }
|
|
|
+ break
|
|
|
+ case 2:
|
|
|
+ if (this.gjjjine) {
|
|
|
+ result = calcute.singleDk(payType, this.gjjjine, this.gjjnianxian.value, this.gjjlilv.lilv)
|
|
|
+ }
|
|
|
+ break
|
|
|
+ case 3:
|
|
|
+ if (this.sdjine && this.gjjjine) {
|
|
|
+ result = calcute.zuhe(payType, this.sdjine, this.gjjjine, this.sdnianxian.value, this.gjjnianxian.value, this.sdlilv.lilv, this.gjjlilv.lilv)
|
|
|
+ }
|
|
|
+ break
|
|
|
+ }
|
|
|
+ this.meiyuehuanchuan = result.yuegong
|
|
|
+ this.zonglixi = result.totalLixi
|
|
|
}
|
|
|
},
|
|
|
beforeDestroy () {
|