Commit c21a0be6 by Chao Sun

购房能力测算结果显示调整

parents f6b4c609 f5dd8b1c
{
"name": "sfp-program",
"lockfileVersion": 2,
"requires": true,
"lockfileVersion": 1,
"packages": {
"": {
"dependencies": {
"echarts": "^5.3.3",
"jweixin-module": "^1.6.0",
"nanoid": "^4.0.0"
}
},
"node_modules/echarts": {
"version": "5.3.3",
"resolved": "https://registry.npmmirror.com/echarts/-/echarts-5.3.3.tgz",
"integrity": "sha512-BRw2serInRwO5SIwRviZ6Xgm5Lb7irgz+sLiFMmy/HOaf4SQ+7oYqxKzRHAKp4xHQ05AuHw1xvoQWJjDQq/FGw==",
"dependencies": {
"tslib": "2.3.0",
"zrender": "5.3.2"
}
},
"node_modules/jweixin-module": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/jweixin-module/-/jweixin-module-1.6.0.tgz",
"integrity": "sha512-dGk9cf+ipipHmtzYmKZs5B2toX+p4hLyllGLF6xuC8t+B05oYxd8fYoaRz0T30U2n3RUv8a4iwvjhA+OcYz52w=="
},
"node_modules/nanoid": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-4.0.0.tgz",
"integrity": "sha512-IgBP8piMxe/gf73RTQx7hmnhwz0aaEXYakvqZyE302IXW3HyVNhdNGC+O2MwMAVhLEnvXlvKtGbtJf6wvHihCg==",
"bin": {
"nanoid": "bin/nanoid.js"
},
"engines": {
"node": "^14 || ^16 || >=18"
}
},
"node_modules/tslib": {
"version": "2.3.0",
"resolved": "https://registry.npmmirror.com/tslib/-/tslib-2.3.0.tgz",
"integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg=="
},
"node_modules/zrender": {
"version": "5.3.2",
"resolved": "https://registry.npmmirror.com/zrender/-/zrender-5.3.2.tgz",
"integrity": "sha512-8IiYdfwHj2rx0UeIGZGGU4WEVSDEdeVCaIg/fomejg1Xu6OifAL1GVzIPHg2D+MyUkbNgPWji90t0a8IDk+39w==",
"dependencies": {
"tslib": "2.3.0"
}
}
},
"dependencies": {
"echarts": {
"version": "5.3.3",
......@@ -18,7 +66,7 @@
},
"nanoid": {
"version": "4.0.0",
"resolved": "https://registry.npmmirror.com/nanoid/-/nanoid-4.0.0.tgz",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-4.0.0.tgz",
"integrity": "sha512-IgBP8piMxe/gf73RTQx7hmnhwz0aaEXYakvqZyE302IXW3HyVNhdNGC+O2MwMAVhLEnvXlvKtGbtJf6wvHihCg=="
},
"tslib": {
......
<template>
<follow :redirectUrl="'sfp/pages/housePurchase/housePurchase'" @getFollowData="getFollowData"></follow>
<follow :redirectUrl="'sfp/pages/housePurchase/housePurchase'" @getFollowData="getFollowData"
v-show="isNeedOfficialAccountQrcode"></follow>
<view class="wrapper" v-show="!isNeedOfficialAccountQrcode">
<view class="banner">
<!--头部技术支持组件-->
......@@ -33,7 +34,7 @@
<text>预购面积:</text>
<view class="inputContent">
<input class="uni-input" type="number" placeholder="请输入"
v-model="housePurchaseInfo.preOrderSize"
v-model="housePurchaseInfo.preOrderSize" @blur="queryCommercialHousingPrice()"
/><label for=""></label>
</view>
</view>
......@@ -124,7 +125,7 @@
<view>
规划参数
</view>
<view class="view" @click="paramsSelected=dialogIsShow=true;isLoanSelected = false;">
<view class="view" @click="viewPlanningParams()">
查看
</view>
</view>
......@@ -139,7 +140,7 @@
</view>
</form>
<!--测算结果-- v-show="resultFlag"-->
<view class="result_wrapper">
<view class="result_wrapper" v-if="resultFlag">
<view class="suggestInfo">
<view class="title">
<view>
......@@ -147,21 +148,21 @@
</view>
</view>
<view id="myEcharts" style="height: 500rpx;"></view>
<view>
<view style="text-align: center;margin-bottom: 30rpx;color: #c3c1c1;font-size: 22rpx;">
差额 = 你想要的-可实现的
</view>
<view v-show="resultInfos.code == 'A001' || resultInfos.code =='A002'">
1.如您想实现{{resultInfos.nyear}}年后在{{resultInfos.provinceName}} {{resultInfos.cityName}}地区购买{{resultInfos.preOrderSize}}㎡的房产,那么您还需要提高首付款到{{resultInfos.pvDownPayment}}元,或您需提高每年预备还房贷资金总额到{{resultInfos.houseSpecialPurpose}}元。
</view>
<view>
{{resultInfos.code == 'A001' || resultInfos.code =='A002'?'1':'2'}}.
{{resultInfos.code == 'A001' || resultInfos.code =='A002'?'2':'1'}}.
根据您的已备首付款和每年预备还房贷资金总额,您在{{resultInfos.nyear}}年后可实现购买房屋单价为{{tipsPrice}}元/㎡,总价为{{tipsTotalPrice}}元的房产。
</view>
</view>
<view class="line" v-for="houseItem in housePurchasePrices">
<view class="line_title">{{getResultTitle(houseItem.priceType)}}
<img src="../../static/images/can.png" alt="" v-show="houseItem.fvDifference >= 0">
<img src="../../static/images/cannot.png" alt="" v-show="houseItem.fvDifference < 0">
<img src="../../static/images/can.png" alt="" v-show="houseItem.fvDifference <= 0">
<img src="../../static/images/cannot.png" alt="" v-show="houseItem.fvDifference > 0">
</view>
<view class="content">
<view class="left">
......@@ -180,12 +181,12 @@
</view>
</view>
</view>
<view class="line_bottom" v-show="houseItem.fvDifference > 0">
<text style="font-size: 36rpx;">恭喜您</text>!经过测算,您已超出目标值XXXX,N年后可以达成您的目标.
<view class="line_bottom" v-show="houseItem.fvDifference <= 0">
<text style="font-size: 36rpx;">恭喜您</text>!经过测算,您已超出目标值{{numberConverter(Math.abs(houseItem.fvDifference))}},{{resultInfos.nyear}}年后可以达成您的目标.
</view>
<view class="line_bottom fail" v-show="houseItem.fvDifference < 0">
<view class="line_bottom fail" v-show="houseItem.fvDifference > 0">
<text style="font-size: 36rpx;">很遗憾!</text>
经过测算,距离实现您的目标还差XXX。您可以参考我们给出的建议进行调整。
经过测算,距离实现您的目标还差{{numberConverter(Math.abs(houseItem.fvDifference))}}。您可以参考我们给出的建议进行调整。
</view>
</view>
</view>
......@@ -202,7 +203,7 @@
<!--旧房贷款余额组件-->
<loanBalance v-if="isLoanSelected" :a="accumulationFundParams" :b="commercialLoansParams" :loanType="1" @getData="getData"></loanBalance>
<!--规划参数组件-->
<planningParameters v-if="paramsSelected" @getData="getPlanParams"></planningParameters>
<planningParameters v-if="paramsSelected" :cityInfo="cityInfo" @getData="getPlanParams"></planningParameters>
</view>
</view>
</template>
......@@ -224,6 +225,7 @@
return{
tipsPrice:null,
tipsTotalPrice:null,
cityInfo:{},
isEditFlag:false,
dataLists:null,
dialogIsShow:false,//弹窗显示与隐藏
......@@ -263,6 +265,7 @@
},
housePurchasePrices:[],
resultFlag:false,
planningParams:{}
}
},
components:{
......@@ -276,12 +279,26 @@
this.provCityQry();
},
methods:{
viewPlanningParams(){
// 查看规划参数
this.paramsSelected=this.dialogIsShow=true;
this.isLoanSelected = false;
this.cityInfo['isNew'] = '1';
if(this.housePurchaseInfo.preOrderSize <= 90){
this.cityInfo['area'] = '1'
}else if(this.housePurchaseInfo.preOrderSize <= 144){
this.cityInfo['area'] = '2'
}else{
this.cityInfo['area'] = '3'
}
},
getFollowData(e){
this.isNeedOfficialAccountQrcode= ref(e);
console.log('父组件拿到值了',e);
},
getPlanParams(e){
console.log(e)
console.log('规划参数子组件传过来的====',e)
this.planningParams = e;
// 从规划参数弹窗获取数据
this.closeBtn()
},
......@@ -300,9 +317,15 @@
console.log(this.houseLoanOldList)
},
onchange(e) {
const value = e.detail.value
const value = e.detail.value;
this.queryCommercialHousingPrice();
},
onnodeclick(node) {
this.cityInfo = {
cityId: node.value,
provinceId:node.parent_value ? node.parent_value : null,
}
},
onnodeclick(node) {},
drawLine() {
this.downPaymentList = this.totalLoanList = [];
// 基于准备好的dom,初始化echarts实例
......@@ -312,11 +335,11 @@
const list1 = this.housePurchasePrices.filter((item)=>{
return item.priceType == 3
})[0];
this.downPaymentList = this.downPaymentList.concat(list1.pvPriceRealization,list1.pvPriceDesired,list1.pvDifference)
this.downPaymentList = [].concat(list1.pvPriceRealization,list1.pvPriceDesired,list1.pvDifference)
const list2 = this.housePurchasePrices.filter((item)=>{
return item.priceType == 4
})[0];
this.totalLoanList = this.totalLoanList.concat(list2.fvPriceRealization,list2.fvPriceDesired,list2.fvDifference)
this.totalLoanList = [].concat(list2.fvPriceRealization,list2.fvPriceDesired,list2.fvDifference)
}
this.myChart.setOption({
legend: {
......@@ -405,8 +428,21 @@
common.errorDialog(1,'请填写年预备还房贷资金总额')
return false;
}
// 规划参数默认值
const palnningParamsDefault = {
acceptableLossRate: 0.1,
downPaymentMin: 30,
houseDepreciationRate: 0.02,
housePriceGrowthRate: 0.0625,
incomeRate: 0.03,
interestRate: 0.049,
tnvestmentRate: 0.0374
}
const param = {
...palnningParamsDefault,
...this.housePurchaseInfo,
...this.planningParams,
interestRate:this.housePurchaseInfo.interestRate / 100,
houseLoanOldList:this.houseLoanOldList,
// businessNo: uni.getStorageSync('businessNo'),
businessNo:'businessNo20220829000000001',
......@@ -425,8 +461,7 @@
return item.priceType == 1;
})[0]['fvPriceDesired'];
}
this.drawLine();
setTimeout(()=>{this.drawLine()});
}else{
common.errorDialog(2,res['message'])
}
......@@ -468,9 +503,28 @@
numberConverter(val){
return dataHandling.numberConverter(val)
},
// 获取房价增长率
queryCommercialHousingPrice(){
if(this.housePurchaseInfo.preOrderSize <= 90){
this.cityInfo['area'] = '1'
}else if(this.housePurchaseInfo.preOrderSize <= 144){
this.cityInfo['area'] = '2'
}else{
this.cityInfo['area'] = '3'
}
this.cityInfo = {
...this.cityInfo,
isNew:1,
}
api.queryCommercialHousingPrice(this.cityInfo).then(res=>{
if(res['success']){
this.planningParams.housePriceGrowthRate = res['data']['priceInfo']['rateB'] / 100;
}
})
}
},
mounted(){
this.drawLine();
// this.drawLine();
}
}
</script>
......
......@@ -11,7 +11,7 @@
<div class="dataSelect">
<div v-if="item.type==='data-picker'">
<view>
<uni-data-picker :localdata="provinceList" popup-title="请选择城市" @change="onchange" @nodeclick="onnodeclick"></uni-data-picker>
<uni-data-picker v-model="cityId" :localdata="provinceList" popup-title="请选择城市" @change="onchange" @nodeclick="onnodeclick"></uni-data-picker>
</view>
</div>
</div>
......@@ -28,9 +28,11 @@
import api from '../../api/api';
import common from '../../common/common'
export default{
props:['cityInfo'],
emits:['getData'],
data(){
return {
cityId:null,
paramsLists:[
{id:'01',name:'房价增长率',value:6.25,type:'data-picker',remark:'',alias:'housePriceGrowthRate' },
{id:'02',name:'房屋折旧率',value:2,type:'number',remark:'',alias:'houseDepreciationRate'},
......@@ -42,7 +44,6 @@
],
editParamLists:[],
provinceList:[],
cityInfo:null
}
},
......@@ -54,10 +55,11 @@
},
setup(props,content){
const cityInfo = props.cityInfo ? props.cityInfo : null;
const sendData = (e) =>{
content.emit('getData',e);
}
return {sendData}
return {sendData,cityInfo}
},
methods:{
onchange(e) {
......@@ -66,12 +68,11 @@
onnodeclick(node) {
// console.log(node);
this.cityInfo = {
provinceId: node.value,
cityId:node.parent_value ? node.parent_value : null,
area:1,
isNew:1
...this.cityInfo,
cityId: node.value,
provinceId:node.parent_value ? node.parent_value : null,
}
this.queryCommercialHousingPrice(this.cityInfo)
this.queryCommercialHousingPrice()
},
resetParams(){
this.editParamLists = JSON.parse(JSON.stringify(this.paramsLists))
......@@ -85,18 +86,19 @@
},
confirmParams(){
const params = {
housePriceGrowthRate:this.editParamLists.filter(item=>item.alias==='housePriceGrowthRate')[0].value,//房价增长率
houseDepreciationRate:this.editParamLists.filter(item=>item.alias==='houseDepreciationRate')[0].value,//房屋折旧率
housePriceGrowthRate:this.editParamLists.filter(item=>item.alias==='housePriceGrowthRate')[0].value / 100,//房价增长率
houseDepreciationRate:this.editParamLists.filter(item=>item.alias==='houseDepreciationRate')[0].value / 100,//房屋折旧率
downPaymentMin:this.editParamLists.filter(item=>item.alias==='downPaymentMin')[0].value,//首付款最低成数(百分位)
interestRate:this.editParamLists.filter(item=>item.alias==='interestRate')[0].value, //贷款年利率
tnvestmentRate:this.editParamLists.filter(item=>item.alias==='tnvestmentRate')[0].value,//投资回报率
incomeRate:this.editParamLists.filter(item=>item.alias==='incomeRate')[0].value,//收入增长率
acceptableLossRate:this.editParamLists.filter(item=>item.alias==='acceptableLossRate')[0].value,//可接受本金损失率
interestRate:this.editParamLists.filter(item=>item.alias==='interestRate')[0].value / 100, //贷款年利率
tnvestmentRate:this.editParamLists.filter(item=>item.alias==='tnvestmentRate')[0].value / 100,//投资回报率
incomeRate:this.editParamLists.filter(item=>item.alias==='incomeRate')[0].value / 100,//收入增长率
acceptableLossRate:this.editParamLists.filter(item=>item.alias==='acceptableLossRate')[0].value / 100,//可接受本金损失率
}
this.sendData(params)
},
// 获取房价增长率
queryCommercialHousingPrice(provinceId,cityId){
queryCommercialHousingPrice(){
console.log(this.cityInfo)
api.queryCommercialHousingPrice(this.cityInfo).then(res=>{
if(res['success']){
this.editParamLists.find(item=>item.alias==='housePriceGrowthRate')['value'] = res['data']['priceInfo']['rateB'];
......@@ -107,6 +109,8 @@
mounted() {
this.editParamLists = JSON.parse(JSON.stringify(this.paramsLists));
this.provCityQry();
this.cityId = this.cityInfo.cityId;
this.queryCommercialHousingPrice()
}
}
</script>
......
......@@ -6,7 +6,7 @@
<img src="../../static/images/qrcodeBg_1.png" alt="" srcset="">
</view>
</view> -->
<follow :redirectUrl="'sfp/pages/index/index'" @getFollowData="getFollowData"></follow>
<follow :redirectUrl="'sfp/pages/index/index'" @getFollowData="getFollowData" v-show="isNeedOfficialAccountQrcode"></follow>
<!-- 已关注公众号用户 -->
<view class="content" v-show="!isNeedOfficialAccountQrcode">
<view class="banner">
......@@ -431,7 +431,7 @@
allFirstPayment:this.irrAndSimpleCalcuteParam.allFirstPayment,
yearWithdrawalInfos:this.yearWithdrawalInfos,
calcuteType:this.calcuteType,
businessNo:this.businessNo,
businessNo:uni.getStorageSync('businessNo'),
businessType:this.businessType,
withdrawalType:this.withdrawalType
}
......
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