Commit 4df11457 by Sweet Zhang
parents 22659fdb c6f3f133
......@@ -10,13 +10,29 @@ export default {
const model = { // 把后端返回过来的数据里面的键给替换成我想要的键
source: x,
text: x.provinceName ? x.provinceName : x.cityName,
value: x.cityId ? x.cityId: x.provinceId ,
value: x.provinceId ? x.provinceId : x.cityId,
};
const children = this.action(x.citys); // 子级数据
if(children){ // 一直往下循环查找有没有children这个键,如果有就直接添加一个子级字段名,这个字段名就是存子级数据
model.children = children;
}
return model; // 返回这个数据
return model; // 返回这个数据
});
},
// 封装报错弹窗
errorDialog(type,content){
// type 1 必填项校验 2 规则校验
uni.showModal({
title: type===1 ? '必填项校验' : '规则校验',
content:content,
showCancel:false,
success: function (res) {
if (res.confirm) {
console.log('用户点击确定');
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
}
}
\ No newline at end of file
......@@ -32,7 +32,7 @@
<text>预购面积:</text>
<view class="inputContent">
<input class="uni-input" type="number" placeholder="请输入"
maxlength="3" v-model="housePurchaseInfo.preOrderSize"
v-model="housePurchaseInfo.preOrderSize"
/><label for=""></label>
</view>
</view>
......@@ -40,7 +40,7 @@
<text>预购房产现在市场单价:</text>
<view class="inputContent">
<input class="uni-input" type="number" placeholder="请输入"
maxlength="3" v-model="housePurchaseInfo.targetPrice"
v-model="housePurchaseInfo.targetPrice"
/><label for="">m²/元</label>
</view>
</view>
......@@ -49,7 +49,7 @@
<view class="inputContent">
<input class="uni-input" type="number" placeholder="请输入"
maxlength="3" v-model="housePurchaseInfo.downPaymentMin"
/><label for=""></label>
/><label for="">%</label>
</view>
</view>
<view class="inputItem">
......@@ -57,21 +57,21 @@
<view class="inputContent">
<input class="uni-input" type="number" placeholder="请输入"
maxlength="3" v-model="housePurchaseInfo.newLoanYear"
/><label for=""></label>
/><label for=""></label>
</view>
</view>
<view class="inputItem">
<text>新房贷款年利率:</text>
<view class="inputContent">
<input class="uni-input" type="number" placeholder="请输入"
maxlength="3" v-model="housePurchaseInfo.housePriceGrowthRate"
/><label for=""></label>
maxlength="3" v-model="housePurchaseInfo.interestRate"
/><label for="">%</label>
</view>
</view>
<view class="inputItem">
<text style="flex: 0 0 30%;">购房用途:</text>
<view class="btn_wrapper">
<view class="btn_item" :class="{ 'selected': housePurchaseType==housePurchaseTypeItem.id }"
<view class="btn_item" :class="{ 'selected': housePurchaseInfo.housePurchaseType==housePurchaseTypeItem.id }"
v-for="housePurchaseTypeItem in housePurchaseTypeList"
@click="housePurchase(housePurchaseTypeItem.id)">
{{housePurchaseTypeItem.name}}
......@@ -90,7 +90,7 @@
<text>已备首付:</text>
<view class="inputContent">
<input class="uni-input" type="number" placeholder="请输入"
maxlength="3" v-model="housePurchaseInfo.firstHouseAmount"
v-model="housePurchaseInfo.firstHouseAmount"
/><label for="">万元</label>
</view>
</view>
......@@ -98,7 +98,7 @@
<text>年预备还房贷资金总额:</text>
<view class="inputContent">
<input class="uni-input" type="number" placeholder="请输入"
maxlength="3" v-model="housePurchaseInfo.repaymentSpecial"
v-model="housePurchaseInfo.repaymentSpecial"
/><label for="">万元</label>
</view>
</view>
......@@ -106,58 +106,62 @@
<!--房屋置换-->
<view class="houseInfo">
<view class="title">
<view class="radioButton" :class="{'selected':!isDisplace }"></view>
<text style="margin-left: 10rpx;">是否置换旧房</text>
<view class="radioButton" :class="{'selected':isDisplace }"
@click="openLoan()"></view>
<text style="margin-left: 10rpx;">是否置换旧房{{isDisplace}}</text>
</view>
<view class="inputItem">
<text>旧房贷款余额:</text>
<view class="inputItem">
<text>旧房贷款余额:</text>
<view class="inputContent">
<input class="uni-input" type="number" placeholder="请输入"
maxlength="3"
/><label for="">万元</label>
</view>
</view>
<view class="inputItem">
<text>旧房贷款剩余月份:</text>
<view class="inputContent">
<input class="uni-input" type="number" placeholder="请输入"
maxlength="3"
/><label for=""></label>
</view>
</view>
<view class="inputItem">
<text>旧房贷款利率:</text>
<view class="inputContent">
<input class="uni-input" type="number" placeholder="请输入"
maxlength="3"
/><label for="">万元</label>
/><label for="">%</label>
</view>
</view>
<view class="inputItem">
<text>旧房贷款剩余月份:</text>
<view class="inputContent">
<input class="uni-input" type="number" placeholder="请输入"
maxlength="3"
/><label for=""></label>
</view>
</view>
<view class="inputItem">
<text>旧房贷款利率:</text>
<view class="inputContent">
<input class="uni-input" type="number" placeholder="请输入"
maxlength="3"
/><label for="">%</label>
</view>
</view>
<view class="inputItem">
<text style="flex: 0 0 35%;">旧房贷款方式:</text>
<view class="btn_wrapper">
<view class="btn_item" style="width: 120rpx;">
公积金
</view>
<view class="btn_item selected" style="width: 120rpx;">
商业贷
</view>
<view class="btn_item" style="width: 120rpx;">
组合贷
<view class="inputItem">
<text style="flex: 0 0 35%;">旧房贷款方式:</text>
<view class="btn_wrapper">
<view class="btn_item" style="width: 120rpx;">
公积金
</view>
<view class="btn_item selected" style="width: 120rpx;">
商业贷
</view>
<view class="btn_item" style="width: 120rpx;">
组合贷
</view>
</view>
</view>
</view>
<view class="inputItem">
<text style="flex: 0 0 35%;">旧房还款方式:</text>
<view class="btn_wrapper">
<view class="btn_item" style="width: 140rpx;">
等额本金
</view>
<view class="btn_item selected" style="width: 140rpx;">
等额本息
<view class="inputItem">
<text style="flex: 0 0 35%;">旧房还款方式:</text>
<view class="btn_wrapper">
<view class="btn_item" style="width: 140rpx;">
等额本金
</view>
<view class="btn_item selected" style="width: 140rpx;">
等额本息
</view>
</view>
</view>
</view>
</view>
<!--规划参数-->
<view class="parametersInfo">
......@@ -165,11 +169,10 @@
<view>
规划参数
</view>
<view class="view">
<view class="view" @click="isPlan = true">
查看
</view>
</view>
</view>
<!-- 操作 -->
......@@ -252,14 +255,14 @@
<foot></foot>
</view>
<!--旧房贷款余额组件-->
<!-- <loanBalance></loanBalance> -->
<loanBalance @closeLoan="closeChildLoan" :getChildLoanInfo="getChildLoanInfo" v-show="isLoanSelected"></loanBalance>
<!--规划参数组件-->
<planningParameters></planningParameters>
</template>
<script>
import loanBalance from './loanBalance.vue';
import planningParameters from './loanBalance.vue';
import planningParameters from './planningParameters.vue';
import head from '../header/header.vue';
import foot from '../footer/footer.vue';
import * as echarts from 'echarts';
......@@ -270,10 +273,11 @@
data(){
return{
isDisplace:false,
isLoanSelected:false,
myChart:null,
provinceList: [],
housePurchaseInfo:{
nyear:null,//几年后购房
provinceList: [],
provinceCode:null,
provinceName:null,
cityCode:null,
......@@ -285,6 +289,7 @@
firstHouseAmount:null,//初期购房资金(单位万)
housePurchaseType:null,//购房用途
repaymentSpecial:null,//每年还贷专用款(单位万)
interestRate:null, //贷款年利率
},
housePurchaseTypeList:[{id:1,name:'投资'},{id:2,name:'自住'},{id:3,name:'其他'}]
}
......@@ -331,15 +336,53 @@
console.log(res)
if(res['success']){
this.provinceList = common.action(res['data']['provinces']);
console.log(this.provinceList)
}
})
},
housePurchase(id){
this.housePurchaseType = id;
this.housePurchaseInfo.housePurchaseType = id;
},
startCount(){
if(!this.housePurchaseInfo.nyear){
common.errorDialog(1,'请填写几年后购房')
return false;
}
if(!this.housePurchaseInfo.provinceName || !this.housePurchaseInfo.provinceCode || !this.housePurchaseInfo.cityCode || !this.housePurchaseInfo.cityName){
common.errorDialog(1,'请选择预购城市')
return false;
}
if(!this.housePurchaseInfo.preOrderSize){
common.errorDialog(1,'请填写预购面积')
return false;
}
if(!this.housePurchaseInfo.targetPrice){
common.errorDialog(1,'请填写预购房产现在市场单价')
return false;
}
if(!this.housePurchaseInfo.downPaymentMin){
common.errorDialog(1,'请填写首付款最低成数')
return false;
}
if(!this.housePurchaseInfo.newLoanYear){
common.errorDialog(1,'请填写新房贷款年限')
return false;
}
if(!this.housePurchaseInfo.interestRate){
common.errorDialog(1,'请填写新房贷款年利率')
return false;
}
if(!this.housePurchaseInfo.housePurchaseType){
common.errorDialog(1,'请填写购房用途')
return false;
}
if(!this.housePurchaseInfo.firstHouseAmount){
common.errorDialog(1,'请填写已备首付')
return false;
}
if(!this.housePurchaseInfo.repaymentSpecial){
common.errorDialog(1,'请填写年预备还房贷资金总额')
return false;
}
const param = {
...this.housePurchaseInfo,
}
......@@ -349,11 +392,35 @@
},
onchange(e) {
const value = e.detail.value;
console.log(e)
},
onnodeclick(node) {
console.log(node)
}
if(value){
this.housePurchaseInfo.provinceName = value[0]['text'];
this.housePurchaseInfo.provinceCode = value[0]['value'];
this.housePurchaseInfo.cityCode = value[1]['value'];
this.housePurchaseInfo.cityName = value[1]['text'];
}else{
this.housePurchaseInfo.provinceName = this.housePurchaseInfo.provinceCode =
this.housePurchaseInfo.cityCode = this.housePurchaseInfo.cityName = null;
}
},
closeChildLoan(){
this.isLoanSelected = false;
},
getChildLoanInfo(houseLoanOldList){
//获取旧房贷款信息
console.log(houseLoanOldList)
this.houseLoanOldList = houseLoanOldList;
},
//打开房屋置换组件
openLoan(){
this.isDisplace = !this.isDisplace;
if(this.isDisplace == false){
this.isLoanSelected = false;
}else{
this.isLoanSelected = true;
}
}
},
mounted(){
this.drawLine();
......
<template>
<div class="mortgageCalculatorContainer">
<!-- 关闭按钮 -->
<div class="closeBtn">
<div class="closeBtn" @click="closeBlan()">
<svg t="1663922894848" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2545" width="26" height="26"><path d="M557.311759 513.248864l265.280473-263.904314c12.54369-12.480043 12.607338-32.704421 0.127295-45.248112-12.512727-12.576374-32.704421-12.607338-45.248112-0.127295L512.127295 467.904421 249.088241 204.063755c-12.447359-12.480043-32.704421-12.54369-45.248112-0.063647-12.512727 12.480043-12.54369 32.735385-0.063647 45.280796l262.975407 263.775299-265.151458 263.744335c-12.54369 12.480043-12.607338 32.704421-0.127295 45.248112 6.239161 6.271845 14.463432 9.440452 22.687703 9.440452 8.160624 0 16.319527-3.103239 22.560409-9.311437l265.216826-263.807983 265.440452 266.240344c6.239161 6.271845 14.432469 9.407768 22.65674 9.407768 8.191587 0 16.352211-3.135923 22.591372-9.34412 12.512727-12.480043 12.54369-32.704421 0.063647-45.248112L557.311759 513.248864z" p-id="2546"></path></svg>
</div>
<view class="tabTitle">
......@@ -52,6 +52,7 @@
<script>
export default{
props: ['getChildLoanInfo'],
data(){
return{
accumulationFundParams:[
......@@ -239,8 +240,12 @@
// 旧房贷款信息集合
console.log(this.houseLoanOldList)
this.getChildLoanInfo(this.houseLoanOldList);
},
closeBlan(){
//向父组件发送关闭弹窗
this.$emit('closeLoan')
}
}
}
</script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment