Procházet zdrojové kódy

修改 修改端登陆界面

weiximei před 6 roky
rodič
revize
19c08e982d

+ 29
- 20
VUECODE/smart-property-manage/src/views/login/index.vue Zobrazit soubor

@@ -29,6 +29,7 @@
29 29
         </el-form-item>
30 30
         <div class="pwdSend">
31 31
           <el-form-item prop="password">
32
+            <!--@blur.prevent="getUserCommunity"-->
32 33
             <el-input
33 34
               v-model="loginForm.password"
34 35
               name="password"
@@ -36,7 +37,6 @@
36 37
               auto-complete="on"
37 38
               placeholder="请输入验证码"
38 39
               @keyup.enter.native="handleLogin"
39
-              @blur.prevent="getUserCommunity"
40 40
             />
41 41
           </el-form-item>
42 42
           <el-button v-if="isCodeNum == false" type="primary" @click="sendCode();">发送验证码</el-button>
@@ -47,27 +47,32 @@
47 47
             <div v-if="isSelectCommunity" class="select-community">
48 48
               <i class="el-icon-circle-close-outline" style="margin-left: 60px;"/>  当前手机号未绑定任何社区
49 49
             </div>
50
-            <div v-else class="select-community" >
51
-              <el-select v-model="loginForm.communityId" placeholder="请选择小区">
52
-                <el-option
53
-                  v-for="item in communityArr"
54
-                  :key="item.id"
55
-                  :label="item.communityName"
56
-                  :value="item.id"/>
57
-              </el-select>
58
-            </div>
59 50
           </el-form-item>
60 51
         </div>
52
+        <!-- @click.native.prevent="handleLogin" -->
53
+        <!-- v-if="isLoginButton" -->
61 54
         <el-button
62
-          v-if="isLoginButton"
63 55
           :loading="loading"
64 56
           type="primary"
65 57
           style="width:100%;"
66
-          @click.native.prevent="handleLogin"
58
+          @click.native.prevent="getUserCommunity"
67 59
         >登录</el-button>
68
-        <el-button v-else type="primary" style="width:100%;" disabled>登录</el-button>
60
+        <!--<el-button v-else type="primary" style="width:100%;" disabled>登录</el-button>-->
69 61
       </el-form>
70 62
     </div>
63
+    <el-dialog :visible.sync="dialogFormVisible" title="小区" width="20%" append-to-body>
64
+      <el-select v-model="loginForm.communityId" placeholder="请选择小区">
65
+        <el-option
66
+          v-for="item in communityArr"
67
+          :key="item.id"
68
+          :label="item.communityName"
69
+          :value="item.id"/>
70
+      </el-select>
71
+      <div slot="footer" class="dialog-footer">
72
+        <el-button @click="dialogFormVisible = false">取 消</el-button>
73
+        <el-button type="primary" @click="handleLogin">确 定</el-button>
74
+      </div>
75
+    </el-dialog>
71 76
     <span class="bottom-desc">Copyright © 南京锦城佳业网络科技有限公司, All Rights Reserved.</span>
72 77
   </div>
73 78
 </template>
@@ -99,6 +104,7 @@ export default {
99 104
       isSelectDiv: false,
100 105
       isSelectCommunity: false, // 是否显示 社区选项
101 106
       isLoginButton: false, // 默认按钮为不可点击
107
+      dialogFormVisible: false, // 显示小区选择
102 108
       communityArr: [], // 小区集合
103 109
       loginForm: {
104 110
         username: '',
@@ -133,6 +139,8 @@ export default {
133 139
       'UserCommunity'
134 140
     ]),
135 141
     handleLogin() {
142
+      // 隐藏选择小区弹框
143
+      this.dialogFormVisible = false
136 144
       this.$refs.loginForm.validate(valid => {
137 145
         if (valid) {
138 146
           this.loading = true
@@ -189,6 +197,7 @@ export default {
189 197
       })
190 198
       this.UserCommunity(this.loginForm).then((res) => {
191 199
         if (res.code === '0') {
200
+          this.dialogFormVisible = true
192 201
           this.communityArr = res.data
193 202
           this.loading = false
194 203
           loading.close()
@@ -226,22 +235,22 @@ export default {
226 235
       } else if (communitys.length === 1) {
227 236
         // 只有一个小区的时候, 默认选中
228 237
         // 显示 div
229
-        this.isCommunityDiv = true
230
-        this.isWidSelectDiv = true
238
+        // this.isCommunityDiv = true
239
+        this.isCommunityDiv = false
240
+        this.isWidSelectDiv = false
231 241
         this.isSelectCommunity = false
232
-        this.isWidSelectDiv = true
233 242
         this.isSelectDiv = false
234
-        this.isLoginButton = true
235 243
         this.loginForm.communityId = communitys[0].id
244
+        // 执行登陆方法
245
+        this.handleLogin()
236 246
       } else {
237 247
         // 让用户选择
238 248
         // 显示 div
239
-        this.isCommunityDiv = true
249
+        // this.isCommunityDiv = true
250
+        this.isCommunityDiv = false
240 251
         this.isWidSelectDiv = true
241 252
         this.isSelectCommunity = false
242
-        this.isWidSelectDiv = true
243 253
         this.isSelectDiv = false
244
-        this.isLoginButton = true
245 254
       }
246 255
     }
247 256
   }