提交 549d831ec91ab265093bdd68de280b5083c1a1a9

作者 pangy
1 个父辈 85c8f070

大病 小数点问题

... ... @@ -1497,6 +1497,22 @@ Page({
1497 1497 this.dealIdInfo(idCardNo, e.currentTarget.id)
1498 1498 }
1499 1499 },
  1500 + medicalInput: function (e) {
  1501 + console.log('-------', e.detail.value)
  1502 + var num = parseFloat(e.detail.value)
  1503 + switch (e.currentTarget.id) {
  1504 + case 'medical_total_input':
  1505 + this.setData({
  1506 + total_amount: num.toFixed(2)
  1507 + })
  1508 + break;
  1509 + case 'medical_amount_input':
  1510 + this.setData({
  1511 + amount_by_person: num.toFixed(2)
  1512 + })
  1513 + break;
  1514 + }
  1515 + },
1500 1516 loan_input: function (e) {
1501 1517 console.log('-------', e.detail.value)
1502 1518 switch (e.currentTarget.id) {
... ...
... ... @@ -186,13 +186,13 @@
186 186 <view style='height:90rpx'>
187 187 <text class='red_star_right_10'>*</text>
188 188 <text class='text_777_30 float_left'>医疗支出总金额</text>
189   - <input class='input_wrap float_right' placeholder-class='text_999_30 float_right' style='line-height: 90rpx;text-align: right;width:200rpx;color:#000;' placeholder='请输入总金额' name='total_amount' value='{{total_amount}}'></input>
  189 + <input class='input_wrap float_right' placeholder-class='text_999_30 float_right' style='line-height: 90rpx;text-align: right;width:200rpx;color:#000;' placeholder='请输入总金额' name='total_amount' value='{{total_amount}}' bindblur='medicalInput' id="medical_total_input"></input>
190 190 </view>
191 191 <view class='divide_line_30'></view>
192 192 <view style='height:90rpx'>
193 193 <text class='red_star_right_10'>*</text>
194 194 <text class='text_777_30 float_left'>个人负担金额</text>
195   - <input class='input_wrap float_right' placeholder-class='text_999_30 float_right' style='line-height: 90rpx;text-align: right;color:#000;' placeholder='请输入金额' name='amount_by_person' value='{{total_amount}}'></input>
  195 + <input class='input_wrap float_right' placeholder-class='text_999_30 float_right' style='line-height: 90rpx;text-align: right;color:#000;' placeholder='请输入金额' name='amount_by_person' value='{{amount_by_person}}' bindblur='medicalInput' id="medical_amount_input"></input>
196 196 </view>
197 197 </view>
198 198 <!-- 住房 -->
... ...
注册登录 后发表评论