Commit c6f148ca by Chao Sun

部分bug修复

parent a7282ad4
...@@ -72,6 +72,7 @@ ...@@ -72,6 +72,7 @@
box-sizing: border-box; box-sizing: border-box;
font-size: 30rpx; font-size: 30rpx;
color: #333333; color: #333333;
scroll-behavior:smooth;
} }
.title{ .title{
display: flex; display: flex;
...@@ -122,6 +123,7 @@ ...@@ -122,6 +123,7 @@
opacity: 1; opacity: 1;
margin: 30rpx 15rpx 56rpx; margin: 30rpx 15rpx 56rpx;
padding: 15rpx 17rpx; padding: 15rpx 17rpx;
scroll-behavior:smooth;
} }
.simpleDataResult .resultTitle{ .simpleDataResult .resultTitle{
font-size: 32rpx; font-size: 32rpx;
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<!-- 使用说明 --> <!-- 使用说明 -->
<text>使用说明</text> <text>使用说明</text>
</view> </view>
<scroll-view scroll-y="true" class="formInfoContainer"> <scroll-view scroll-y="true" class="formInfoContainer" id="formInfoContainer">
<view class="tabTitle"> <view class="tabTitle">
<text @click="switchTab('1')" :class="{ 'actived': calcuteType==='1' }">增额</text> <text @click="switchTab('1')" :class="{ 'actived': calcuteType==='1' }">增额</text>
<text @click="switchTab('2')" :class="{ 'actived': calcuteType==='2' }">年金</text> <text @click="switchTab('2')" :class="{ 'actived': calcuteType==='2' }">年金</text>
...@@ -139,7 +139,7 @@ ...@@ -139,7 +139,7 @@
<!-- 现金价值单利复利结果展示 --> <!-- 现金价值单利复利结果展示 -->
<view class="resultContent"> <view class="resultContent">
<!-- 单次计算显示结果 --> <!-- 单次计算显示结果 -->
<view class="simpleDataResult" v-if="resultShowFlag && calcuteMethod == '1'"> <view id="simpleDataResult" class="simpleDataResult" v-if="resultShowFlag && calcuteMethod == '1'">
<view class="inputItem"> <view class="inputItem">
<text class="resultTitle">IRR复利</text> <text class="resultTitle">IRR复利</text>
<text class="calcNumber">{{irrAndSimpleResInfos.length>0?(irrAndSimpleResInfos[0]['irrValue'] * 100).toFixed(3):null}}%</text> <text class="calcNumber">{{irrAndSimpleResInfos.length>0?(irrAndSimpleResInfos[0]['irrValue'] * 100).toFixed(3):null}}%</text>
...@@ -171,7 +171,8 @@ ...@@ -171,7 +171,8 @@
</view> </view>
<!-- 操作 --> <!-- 操作 -->
<view class="optionContent"> <view class="optionContent">
<button type="default" plain="true" form-type="reset">清空</button> <button type="default" plain="true" form-type="reset"
@click="resetData()">清空</button>
<button type="default" plain="true" <button type="default" plain="true"
class="btn" @click="calcute(2)" class="btn" @click="calcute(2)"
v-show="calcuteMethod==2">输入批量数据</button> v-show="calcuteMethod==2">输入批量数据</button>
...@@ -204,7 +205,7 @@ ...@@ -204,7 +205,7 @@
withdrawalType:'1', //提领方式(1:正常提领; 2:减保取现) withdrawalType:'1', //提领方式(1:正常提领; 2:减保取现)
resultShowFlag:false, resultShowFlag:false,
calcuteMethod:'1', //计算方式(1:单次; 2:批量) calcuteMethod:'1', //计算方式(1:单次; 2:批量)
businessType:1, businessType:1, //业务类型(1:计算; 2:保存)
mobile:undefined, mobile:undefined,
irrAndSimpleCalcuteParam:{}, irrAndSimpleCalcuteParam:{},
yearWithdrawal:{ yearWithdrawal:{
...@@ -279,8 +280,6 @@ ...@@ -279,8 +280,6 @@
yearWithdrawalAmount:null}]); yearWithdrawalAmount:null}]);
}else if(e=='1'){ }else if(e=='1'){
this.irrAndSimpleCalcuteParam.allFirstPayment = null; this.irrAndSimpleCalcuteParam.allFirstPayment = null;
}else{
} }
this.resultShowFlag = false; this.resultShowFlag = false;
} }
...@@ -376,19 +375,53 @@ ...@@ -376,19 +375,53 @@
irrAndSimpleCalte(){ irrAndSimpleCalte(){
if(!this.irrAndSimpleCalcuteParam.paymentPeriod){ if(!this.irrAndSimpleCalcuteParam.paymentPeriod){
uni.showToast({ uni.showToast({
title: '请填写交费年限', title: '请填写交费年限',
duration: 2000, duration: 2000,
icon: 'none' icon: 'none'
}) })
return; return;
}else{
if(this.irrAndSimpleCalcuteParam.paymentPeriod >100 ){
uni.showToast({
title: '交费年限不能大于100年!',
duration: 2000,
icon: 'none'
})
return;
}
if(this.irrAndSimpleCalcuteParam.paymentPeriod < 0 ){
uni.showToast({
title: '交费年限必须大于0',
duration: 2000,
icon: 'none'
})
return;
}
} }
if(!this.irrAndSimpleCalcuteParam.annualPremium){ if(!this.irrAndSimpleCalcuteParam.annualPremium){
uni.showToast({ uni.showToast({
title: '请填写年交保费', title: '请填写年交保费',
duration: 2000, duration: 2000,
icon: 'none' icon: 'none'
}) })
return; return;
}else{
if(this.irrAndSimpleCalcuteParam.annualPremium > 1000000000){
uni.showToast({
title: '年交保费不能大于1,000,000,000',
duration: 2000,
icon: 'none'
})
return;
}
if(this.irrAndSimpleCalcuteParam.annualPremium < 0){
uni.showToast({
title: '年交保费不能小于0',
duration: 2000,
icon: 'none'
})
return;
}
} }
if(this.businessType == 2){ if(this.businessType == 2){
if(!this.mobile){ if(!this.mobile){
...@@ -436,12 +469,18 @@ ...@@ -436,12 +469,18 @@
withdrawalType:this.withdrawalType?'1':'2', withdrawalType:this.withdrawalType?'1':'2',
decimal: 5 decimal: 5
}; };
// document.getElementById(simpleDataResult).scrollIntoView({
// behavior: "smooth",
// block: "end",
// inline: "end"
// });
api.irrAndSimpleCalcute(params).then(res=>{ api.irrAndSimpleCalcute(params).then(res=>{
console.log(res) console.log(res)
if(res.success === true){ if(res.success === true){
if(res.data.irrAndSimpleResInfos){ if(res.data.irrAndSimpleResInfos){
this.irrAndSimpleResInfos = res.data.irrAndSimpleResInfos; this.irrAndSimpleResInfos = res.data.irrAndSimpleResInfos;
this.resultShowFlag = true; this.resultShowFlag = true;
}else{ }else{
this.irrAndSimpleResInfos = []; this.irrAndSimpleResInfos = [];
} }
...@@ -454,8 +493,13 @@ ...@@ -454,8 +493,13 @@
}) })
} }
}) })
},
resetData(){
this.irrAndSimpleCalcuteParam = {};
this.yearWithdrawalInfos = [];
this.withdrawalType = '1';
this.irrAndSimple = {nyear:undefined,cashValue:undefined}
} }
}, },
onShow() { onShow() {
if(uni.getStorageSync('resIrrAndSimpleResInfos')){ if(uni.getStorageSync('resIrrAndSimpleResInfos')){
......
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