完善手机号校验和验证码发送限制
This commit is contained in:
@@ -85,6 +85,10 @@ Page({
|
||||
wx.showToast({ title: '请填写客户姓名和手机号', icon: 'none' })
|
||||
return
|
||||
}
|
||||
if (!/^1[3-9]\d{9}$/.test(phone)) {
|
||||
wx.showToast({ title: '请输入正确手机号', icon: 'none' })
|
||||
return
|
||||
}
|
||||
this.setData({ creating: true })
|
||||
try {
|
||||
await customersApi.create({ nickname, phone })
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
</view>
|
||||
<view class="modal-field">
|
||||
<text class="required-label">手机号</text>
|
||||
<input value="{{createForm.phone}}" data-field="phone" bindinput="onCreateInput" type="number" placeholder="请输入手机号" />
|
||||
<input value="{{createForm.phone}}" data-field="phone" bindinput="onCreateInput" type="number" maxlength="11" placeholder="请输入手机号" />
|
||||
</view>
|
||||
</view>
|
||||
<button class="primary-btn modal-submit" loading="{{creating}}" bindtap="submitCustomer">保存客户</button>
|
||||
|
||||
Reference in New Issue
Block a user