Commit 8ccea150 by kyle

购房能力测算优化

parent 3c2ec528
...@@ -45,7 +45,11 @@ export default { ...@@ -45,7 +45,11 @@ export default {
if(num){ if(num){
if(type===1){ if(type===1){
const dataNum = (num * Math.pow(10, digitNum + 1) / Math.pow(10, digitNum + 1)).toString(); const dataNum = (num * Math.pow(10, digitNum + 1) / Math.pow(10, digitNum + 1)).toString();
return (Number(dataNum.slice(0, dataNum.indexOf('.') + digitNum + 1)) + 10 / Math.pow(10, digitNum + 1)).toFixed(digitNum) if(dataNum.indexOf('.')>-1){
return (Number(dataNum.slice(0, dataNum.indexOf('.') + digitNum + 1)) + 10 / Math.pow(10, digitNum + 1)).toFixed(digitNum)
}else{
return dataNum;
}
}else{ }else{
return (num * Math.pow(10, digitNum + 1) / Math.pow(10, digitNum + 1)).toFixed(digitNum) return (num * Math.pow(10, digitNum + 1) / Math.pow(10, digitNum + 1)).toFixed(digitNum)
} }
......
...@@ -19,7 +19,7 @@ const config = { ...@@ -19,7 +19,7 @@ const config = {
stage, stage,
prod prod
} }
let env = 'stage'; let env = 'dev';
// if (process.env.NODE_ENV === 'development') { // if (process.env.NODE_ENV === 'development') {
// env = 'dev'; // env = 'dev';
// }else if (process.env.NODE_ENV === 'production') { // }else if (process.env.NODE_ENV === 'production') {
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
<view class="inputContent"> <view class="inputContent">
<input class="uni-input" type="digit" placeholder="请输入" <input class="uni-input" type="digit" placeholder="请输入"
v-model="housePurchaseInfo.targetPrice" maxlength="12" v-model="housePurchaseInfo.targetPrice" maxlength="12"
/><label for="">m²/元</label> /><label for="">元/m²</label>
</view> </view>
</view> </view>
<view class="inputItem"> <view class="inputItem">
...@@ -161,7 +161,7 @@ ...@@ -161,7 +161,7 @@
</radio-group> </radio-group>
</view> </view>
<view id="myEcharts" style="height: 450rpx;"></view> <view id="myEcharts" style="height: 450rpx;"></view>
<view style="text-align: center;color: #c3c1c1;font-size: 22rpx;"> <view style="text-align: center;color: #c3c1c1;font-size: 22rpx;" v-if="isNeedDis">
差额 = 可实现的 - 你想要的 差额 = 可实现的 - 你想要的
</view> </view>
<view class="resultSummaryContent"> <view class="resultSummaryContent">
...@@ -280,6 +280,7 @@ ...@@ -280,6 +280,7 @@
value: '4', value: '4',
name: '总贷款(万元)' name: '总贷款(万元)'
}], }],
isNeedDis:true,
isNeedOfficialAccountQrcode:true, isNeedOfficialAccountQrcode:true,
tipsPrice:null, tipsPrice:null,
tipsTotalPrice:null, tipsTotalPrice:null,
...@@ -430,13 +431,26 @@ ...@@ -430,13 +431,26 @@
// 绘制图表 // 绘制图表
let list1; let list1;
let showLists; let showLists;
let dataOption = ['可实现的', '你想要的', '差额'];
if(this.housePurchasePrices.length){ if(this.housePurchasePrices.length){
if(type){ if(type){
list1 = this.housePurchasePrices.filter((item)=>{ list1 = this.housePurchasePrices.filter((item)=>{
return item.priceType == type return item.priceType == type
})[0]; })[0];
showLists = [].concat(this.formatFloat(list1.pvPriceRealization / 10000,2,2),this.formatFloat(list1.pvPriceDesired/10000,2,2), this.isNeedDis = list1.pvDifference>0;
{value:this.formatFloat(Math.abs(list1.pvDifference)/10000),itemStyle:{color:'#ff0000'}}) if(list1.pvDifference>0){
showLists = [].concat(
this.formatFloat(list1.pvPriceRealization / 10000,2,2),
this.formatFloat(list1.pvPriceDesired/10000,2,2),
{value:this.formatFloat(Math.abs(list1.pvDifference)/10000),
itemStyle:{color:'#ff0000'}})
}else{
showLists = [].concat(
this.formatFloat(list1.pvPriceRealization / 10000,2,2),
this.formatFloat(list1.pvPriceDesired/10000,2,2));
dataOption = ['可实现的', '你想要的']
}
} }
} }
this.myChart.setOption({ this.myChart.setOption({
...@@ -445,7 +459,7 @@ ...@@ -445,7 +459,7 @@
left: '20%', // 调整这个属性 left: '20%', // 调整这个属性
}, },
xAxis: { xAxis: {
data: ['可实现的', '你想要的', '差额'], data: dataOption,
axisTick:{//坐标轴刻度相关设置。 axisTick:{//坐标轴刻度相关设置。
show: false, show: false,
}, },
......
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
{id:'02',name:'房屋折旧率',value:2,type:'number',remark:'',alias:'houseDepreciationRate',isShow:true}, {id:'02',name:'房屋折旧率',value:2,type:'number',remark:'',alias:'houseDepreciationRate',isShow:true},
{id:'03',name:'首付款最低成数',value:30,type:'number',remark:'',alias:'downPaymentMin',isShow:true}, {id:'03',name:'首付款最低成数',value:30,type:'number',remark:'',alias:'downPaymentMin',isShow:true},
{id:'05',name:'资产投资回报率',value:3.74,type:'number',remark:'',alias:'tnvestmentRate',isShow:true}, {id:'05',name:'资产投资回报率',value:3.74,type:'number',remark:'',alias:'tnvestmentRate',isShow:true},
{id:'06',name:'投入资金增长率',value:0,type:'number',remark:'"年末预备投入房产资金"将会按照该设定值进行增长型测算',alias:'incomeRate',isShow:true}, {id:'06',name:'投入资金增长率',value:0,type:'number',remark:'"每年投入房产资金"将会按照该设定值进行增长型测算',alias:'incomeRate',isShow:true},
{id:'07',name:'可接受本金损失',value:10,type:'number',remark:'',alias:'acceptableLossRate',isShow:true} {id:'07',name:'可接受本金损失',value:10,type:'number',remark:'',alias:'acceptableLossRate',isShow:true}
], ],
editParamLists:[], editParamLists:[],
......
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