Browse Source

优化

master
zhaoyongnian 5 years ago
parent
commit
7735c0400e
  1. 7
      subpages/heart/pages/volunteer/volunteer.js
  2. 6
      subpages/heart/pages/volunteer/volunteer.wxml

7
subpages/heart/pages/volunteer/volunteer.js

@ -180,10 +180,17 @@ Page({
this.showToast('姓名不能超过20个字') this.showToast('姓名不能超过20个字')
return false return false
} }
if (!this.data.identityNo) { if (!this.data.identityNo) {
this.showToast('请输入身份证号') this.showToast('请输入身份证号')
return false return false
} }
var reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
if (reg.test(this.data.identityNo) === false) {
this.showToast('请输入正确的身份证号')
return false
}
if (this.data.getMobileType === 'wx') { if (this.data.getMobileType === 'wx') {
if (!this.data.mobile) { if (!this.data.mobile) {
this.showToast('请获取手机号') this.showToast('请获取手机号')

6
subpages/heart/pages/volunteer/volunteer.wxml

@ -18,7 +18,7 @@
<view class="title">姓名</view> <view class="title">姓名</view>
</view> </view>
<view class="right"> <view class="right">
<input confirm-type="next" bindblur="bindRealNameInput" bindinput="bindRealNameInput" value="{{realName}}" placeholder-class="placeholder-style" placeholder="请输入姓名" /> <input maxlength="20" confirm-type="next" bindblur="bindRealNameInput" bindinput="bindRealNameInput" value="{{realName}}" placeholder-class="placeholder-style" placeholder="请输入姓名" />
</view> </view>
</view> </view>
<view class="list-item identity-no"> <view class="list-item identity-no">
@ -79,7 +79,7 @@
<view class="info-box"> <view class="info-box">
<view class="address name"> <view class="address name">
<input placeholder="请输入所在小区或所在道路" controlled value="{{road}}" bind:change="adInputStreet"></input> <input maxlength="100" placeholder="请输入所在小区或所在道路" controlled value="{{road}}" bind:change="adInputStreet"></input>
</view> </view>
<view class="clear"></view> <view class="clear"></view>
</view> </view>
@ -110,7 +110,7 @@
<view class="info-box-last"> <view class="info-box-last">
<view class="introduce"> <view class="introduce">
<textarea placeholder="请输入自我介绍、是否参加过公益活动、参加了哪些公益活动" bindblur="adInputIntroduce" bindinput="adInputIntroduce" maxlength="500"></textarea> <textarea placeholder="请输入自我介绍、是否参加过公益活动、参加了哪些公益活动" bindblur="adInputIntroduce" bindinput="adInputIntroduce" maxlength="200"></textarea>
</view> </view>
</view> </view>
</view> </view>

Loading…
Cancel
Save