Commit 3c2ec528 by kyle

优化购房能力测算

parent e82a8299
......@@ -19,7 +19,7 @@ const config = {
stage,
prod
}
let env = 'dev';
let env = 'stage';
// if (process.env.NODE_ENV === 'development') {
// env = 'dev';
// }else if (process.env.NODE_ENV === 'production') {
......
......@@ -17,7 +17,7 @@
<div id="app"><!--app-html--></div>
<script type="module" src="/main.js"></script>
<!-- 移动端调试 -->
<script type="text/javascript" src="//cdn.jsdelivr.net/npm/eruda"></script>
<script>eruda.init();</script>
<!-- <script type="text/javascript" src="//cdn.jsdelivr.net/npm/eruda"></script>
<script>eruda.init();</script> -->
</body>
</html>
......@@ -392,9 +392,13 @@
return flated;
},
educationEstimate(){
this.flatEduGradeLists = JSON.parse(JSON.stringify(this.objFlat(this.schoolingLists)))
this.flatEduGradeLists.map((val,idx)=>{
val['educationNo'] = idx + 1;
});
// 数据校验
if(this.eduPlanParam.age && this.eduPlanParam.age > 50){
common.errorDialog(2,'子女教育规划一般年龄不会超过40岁');
if(this.eduPlanParam.age && (this.eduPlanParam.age > 40 || this.eduPlanParam.age < 0) ){
common.errorDialog(2,'子女教育规划一般年龄不会小于0且不超过40岁');
return false;
}else if(this.haveAcceptEduFlag && !this.eduPlanParam.maxGrade){
common.errorDialog(1,'为了精准测算,请选择小孩的最高学历');
......@@ -408,6 +412,9 @@
}else if(this.getEducationNo(this.eduPlanParam.startPlan) >= this.getEducationNo(this.eduPlanParam.endPlan)){
common.errorDialog(1,'您的规划起始阶段应小于结束阶段');
return false;
}else if(this.haveAcceptEduFlag && this.eduPlanParam.maxGrade > this.eduPlanParam.startPlan){
common.errorDialog(2,'规划开始阶段应大于或等于最高学历');
return false;
}else if((!this.eduPlanParam.initEducationFund && this.eduPlanParam.initEducationFund!=0) || this.eduPlanParam.initEducationFund < 0){
common.errorDialog(1,'请输入目前您已备教育资金总额');
return false;
......
......@@ -96,10 +96,10 @@
/><label for="">万元</label>
</view>
</view>
<view class="inputItem">
<view class="inputItem" style="position: relative;">
<view>
<view>年末预备投入房产资金:</view>
<view style="font-size: 26rpx;color: red;letter-spacing: 1px;">(从测算当年开始投入)</view>
<view>每年投入房产资金:</view>
<view style="position: absolute;left: 0;bottom: -1px;font-size: 24rpx;color: red;letter-spacing: 1px;">(从今年末开始投入,用于首付和按揭)</view>
</view>
<view class="inputContent">
<input class="uni-input" type="digit" placeholder="请输入"
......@@ -164,17 +164,37 @@
<view style="text-align: center;color: #c3c1c1;font-size: 22rpx;">
差额 = 可实现的 - 你想要的
</view>
<view class="resultSummaryContent">
<view v-if="resultInfos.code == 'B001' || resultInfos.code =='B002'" style="display: flex;align-items: center;">
<view style="margin-right: 8rpx;">
<img src="../../static/images/happy.png" alt="" srcset="">
</view>
<view>
<view>恭喜您!</view>
<view>您实现买房自由了哦~</view>
</view>
</view>
<view v-if="resultInfos.code == 'A001' || resultInfos.code =='A002'" style="display: flex;align-items: center;">
<view style="margin-right: 8rpx;">
<img src="../../static/images/sad.png" alt="" srcset="">
</view>
<view>
<view>很遗憾!</view>
<view>您还不能实现目标,请继续加油哦~</view>
</view>
</view>
</view>
<view style="background: rgba(36,255,0,3%);padding: 6rpx 10rpx;border-radius: 12rpx;line-height: 1.5;">
<view v-if="resultInfos.code == 'A001' || resultInfos.code =='A002'" style="display: flex;">
<text class="seriesNo">1</text>
<view>如您想实现<strong>{{resultInfos.nyear}}</strong>年后在<strong>{{resultInfos.provinceName}}-{{resultInfos.cityName}}</strong>地区购买
<strong>{{resultInfos.preOrderSize}}</strong>㎡的房产,那么您还需要提高首付款到
<strong>{{formatFloat(resultInfos.pvDownPayment/10000,2,1)}}</strong>万元,或您需提高年末预备投入房产资金到
<strong>{{formatFloat(resultInfos.pvDownPayment/10000,2,1)}}</strong>万元,或您需提高每年投入房产资金到
<strong>{{formatFloat(resultInfos.houseSpecialPurpose/10000)}}</strong>万元。 </view>
</view>
<view style="margin-top: 10rpx;display: flex;">
<text class="seriesNo">{{resultInfos.code == 'A001' || resultInfos.code =='A002'?'2':'1'}}</text>
<view>根据您的已备首付款和预备投入房产资金测算,您在<strong>{{resultInfos.nyear}}</strong>年后最高可实现购买房屋单价为<strong>{{formatFloat(tipsPrice/10000)}}</strong>万元/㎡,总价为<strong>{{formatFloat(tipsTotalPrice/10000)}}</strong>万元的房产。</view>
<view>根据您的已备首付款和每年投入房产资金测算,您在<strong>{{resultInfos.nyear}}</strong>年后最高可实现购买房屋单价为<strong>{{formatFloat(tipsPrice/10000)}}</strong>万元/㎡,总价为<strong>{{formatFloat(tipsTotalPrice/10000)}}</strong>万元的房产。</view>
</view>
</view>
......@@ -517,7 +537,7 @@
return false;
}
if(!this.housePurchaseInfo.repaymentSpecial){
common.errorDialog(1,'请填写年末预备投入房产资金')
common.errorDialog(1,'请填写每年投入房产资金')
return false;
}
// 规划参数默认值
......@@ -717,6 +737,14 @@
text-align: center;
}
.result_wrapper{
.resultSummaryContent{
background: #FFDBD4;
border-radius: 3px;
padding: 8px 20px;
box-shadow: 3px 1px 4px 0 rgb(0 0 0 / 25%);
margin: 20px 0;
font-size: 18px;
}
.seriesNo{
width: 0;
height: 40rpx;
......
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