瀏覽代碼

用户名校验

huangb 7 年之前
父節點
當前提交
5695e571d1
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. 4 2
      components/mobile/staffManagement/StaffAdd.vue

+ 4 - 2
components/mobile/staffManagement/StaffAdd.vue

@@ -13,7 +13,7 @@
       <div class="staff-record" v-if="switchType == 'addNoRegister'" >
         <div class="list-content">
           <ul class="staff-adds">
-            <li><span>姓名:</span><input type="text" v-model="newUserName" placeholder="请输入用户名"></li>
+            <li><span>姓名:</span><input type="text" v-model="newUserName" maxlength="10" placeholder="请输入用户名"></li>
             <li style="overflow: visible;"><span>性别:</span>
               <div class="sex-filter">
                 <div class="select-wrap" @click.stop="openChoose">{{sex === 'M' ? '男' : '女'}}<i class="iconfont icon-arrow-down"></i></div>
@@ -180,7 +180,9 @@
       },
       // 绑定未注册用户
       addNewUser () {
-        if (!this.newUserPhone || this.newUserPhone === '') {
+        if (!this.newUserName ||this.newUserName === '') {
+          this.onRemind('请输入用户名')
+        } else if (!this.newUserPhone || this.newUserPhone === '') {
           this.onRemind('请输入手机号码')
           this.newPhoneCheck = false
         } else if (!this.newUserEmail || this.newUserEmail === '') {