Browse Source

fix(开鲁水查查):修改购水量校验

chenlong 4 years ago
parent
commit
7b41753021

+ 2 - 2
shuichacha-for-KL/pages/payment/payment.js

@@ -13,7 +13,7 @@ Page({
     volume: '',
     volumeTags: [10, 20, 30, 50],
     amount: '0.00',
-    amountTip: '请输入0-9999之间的数字',
+    amountTip: '请输入1-999之间的数字',
     numberFormat: app.$util.numberFormat
   },
 
@@ -52,7 +52,7 @@ Page({
       })
       return;
     }
-    if (!(/^\d{1,4}$/.test(volume))) {
+    if (!(/^\d{1,3}$/.test(volume)) || volume < 1) {
       wx.showToast({
         title: '输入用水量格式有误',
         icon: 'none',

+ 1 - 1
shuichacha-for-KL/pages/payment/payment.wxml

@@ -46,7 +46,7 @@
       <view class="title line">购水量</view>
       <view class="input">
         <image class="shuidi" src="/static/img/icon_shuidi.png"></image>
-        <input type="number" maxlength="4" value="{{volume}}" bindinput="setAmount" placeholder="{{amountTip}}"
+        <input type="number" maxlength="3" value="{{volume}}" bindinput="setAmount" placeholder="{{amountTip}}"
           placeholder-style="font-size:30rpx;color:rgba(66, 70, 86, 0.4)" />
         <text class="unit">吨</text>
       </view>