csx 4 年 前
コミット
d5015af84f

+ 25 - 0
package-lock.json ファイルの表示

@@ -2070,6 +2070,11 @@
2070 2070
       "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==",
2071 2071
       "dev": true
2072 2072
     },
2073
+    "balajs": {
2074
+      "version": "0.1.9",
2075
+      "resolved": "https://registry.npm.taobao.org/balajs/download/balajs-0.1.9.tgz",
2076
+      "integrity": "sha1-4D0eb7iNU8waJZGnv+xw0eUtjwA="
2077
+    },
2073 2078
     "balanced-match": {
2074 2079
       "version": "1.0.0",
2075 2080
       "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
@@ -4381,6 +4386,11 @@
4381 4386
       "integrity": "sha512-tyGr+wh2c/JYBVMeflKpZ3ricwtBPyVBMtRNxYGObl7TP5bAeupgz4VZnBzQSFleZViXYTws1yZtKKFQYZyiYw==",
4382 4387
       "dev": true
4383 4388
     },
4389
+    "element-closest": {
4390
+      "version": "2.0.2",
4391
+      "resolved": "https://registry.npm.taobao.org/element-closest/download/element-closest-2.0.2.tgz",
4392
+      "integrity": "sha1-cqdAoQdFM4LijfnOXbtajfD5Zuw="
4393
+    },
4384 4394
     "element-ui": {
4385 4395
       "version": "2.13.0",
4386 4396
       "resolved": "https://registry.npmjs.org/element-ui/-/element-ui-2.13.0.tgz",
@@ -16468,6 +16478,21 @@
16468 16478
       "integrity": "sha512-nqHUnMXmBzT0w570r2JpJxfiSD1IzoI+HGVdd3aZ0yNi3ngvQ4jv1dtHt5VGxfI2yj5yqImPhOK4vmIh2xMbGg==",
16469 16479
       "dev": true
16470 16480
     },
16481
+    "weui": {
16482
+      "version": "2.3.0",
16483
+      "resolved": "https://registry.npm.taobao.org/weui/download/weui-2.3.0.tgz",
16484
+      "integrity": "sha1-tqAoDFShBy6sywXracLav6AAz2Q="
16485
+    },
16486
+    "weui.js": {
16487
+      "version": "1.2.1",
16488
+      "resolved": "https://registry.npm.taobao.org/weui.js/download/weui.js-1.2.1.tgz",
16489
+      "integrity": "sha1-8EA6Z2V9zodqJvba0fJ/F4s2onI=",
16490
+      "requires": {
16491
+        "balajs": "^0.1.9",
16492
+        "element-closest": "^2.0.1",
16493
+        "object-assign": "^4.1.0"
16494
+      }
16495
+    },
16471 16496
     "whatwg-encoding": {
16472 16497
       "version": "1.0.4",
16473 16498
       "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.4.tgz",

+ 3 - 1
package.json ファイルの表示

@@ -33,7 +33,9 @@
33 33
     "vue-pickers": "^1.1.5",
34 34
     "vue-router": "^3.0.1",
35 35
     "vuex": "^3.0.1",
36
-    "vux": "^2.9.4"
36
+    "vux": "^2.9.4",
37
+    "weui": "^2.3.0",
38
+    "weui.js": "^1.2.1"
37 39
   },
38 40
   "devDependencies": {
39 41
     "autoprefixer": "^7.1.2",

+ 3 - 1
src/App.vue ファイルの表示

@@ -31,7 +31,9 @@ export default {
31 31
       document.body.scrollTop = 0;
32 32
       document.documentElement.scrollTop = 0;
33 33
     }
34
-  }
34
+  },created(){
35
+    console.log("111111")
36
+  },
35 37
 };
36 38
 </script>
37 39
 

+ 76 - 0
src/api/login.js ファイルの表示

@@ -11,3 +11,79 @@ export function loginByPwd(mobile, password) {
11 11
     params: params
12 12
   })
13 13
 }
14
+
15
+export function isLogin() {
16
+  return request({
17
+    url: '/m/api/islogin',
18
+    method: 'get',
19
+  })
20
+}
21
+
22
+
23
+
24
+export function getCodeInit() {
25
+  return request({
26
+    url: '/m/api/code',
27
+    method: 'get',
28
+  })
29
+}
30
+
31
+
32
+export function getVerifyCode(params) {
33
+  return request({
34
+    url: '/m/api/getcode',
35
+    method: 'get',
36
+    params:params,
37
+  })
38
+}
39
+
40
+
41
+export function loginByCode(params) {
42
+  return request({
43
+    url: '/m/api/login/cs',
44
+    method: 'post',
45
+    params:params,
46
+  })
47
+}
48
+
49
+
50
+
51
+export function forgetPassWord(params) {
52
+  return request({
53
+    url: '/m/api/password/commit',
54
+    method: 'post',
55
+    params:params,
56
+  })
57
+}
58
+
59
+
60
+export function register(params) {
61
+  return request({
62
+    url: '/m/api/register/commit',
63
+    method: 'post',
64
+    params:params,
65
+  })
66
+}
67
+
68
+export function setName(params) {
69
+  return request({
70
+    url: '/m/api/register/setname',
71
+    method: 'post',
72
+    params:params,
73
+  })
74
+}
75
+
76
+
77
+
78
+
79
+export function login() {
80
+  return request({
81
+    url: '/m/api/register/login',
82
+    method: 'post',
83
+  })
84
+}
85
+
86
+
87
+
88
+
89
+

+ 1 - 1
src/api/patient/patient.js ファイルの表示

@@ -2,7 +2,7 @@ import request from '@/utils/request'
2 2
 
3 3
 export function getBloodDialysisPatient(params) {
4 4
   return request({
5
-    url: '/api/patient/getbloodDialysisPatient',
5
+    url: '/m/api/patient/getbloodDialysisPatient',
6 6
     method: 'get',
7 7
     params: params
8 8
   })

+ 0 - 0
src/assets/area/area.json ファイルの表示


BIN
src/assets/images/nojoin.png ファイルの表示


File diff suppressed because it is too large
+ 4288 - 0
src/pages/home/createOrg/index.vue


+ 463 - 0
src/pages/home/forgetPassword/index.vue ファイルの表示

@@ -0,0 +1,463 @@
1
+<template>
2
+  <div class="page_noPassword">
3
+    <div class="nopasswordTitle">
4
+      <i class="iconfont icon-zuojiantou jiantou"></i>
5
+      <span class="titleName">忘记密码</span>
6
+    </div>
7
+    <div class="forgetmyInput">
8
+      <el-form ref="forgetForm" :model="forgetForm" :rules="rules">
9
+        <el-form-item required prop="phone">
10
+          <div class="phoneLine">
11
+            <i class="el-icon-mobile mobile"></i>
12
+            <el-input
13
+              class="phoneInput"
14
+              placeholder="请输入手机号码"
15
+              v-model="forgetForm.phone"
16
+              v-on:input="watchNum"
17
+              maxlength="11"
18
+              @input="change(forgetForm.phone)"
19
+            ></el-input>
20
+          </div>
21
+        </el-form-item>
22
+        <el-form-item required prop="code">
23
+          <div class="code">
24
+            <i class="iconfont icon-dunpai dunpai"></i>
25
+            <el-input
26
+              v-model="forgetForm.code"
27
+              placeholder="请输入验证码"
28
+              v-on:input="watchNum"
29
+            ></el-input>
30
+            <div class="getCode" @click="getVerifyCode()">{{code_btn_title}}</div>
31
+
32
+          </div>
33
+        </el-form-item>
34
+        <el-form-item>
35
+          <div class="phoneLine">
36
+            <i class="el-icon-lock lock"></i>
37
+            <el-input
38
+              class="phoneInput"
39
+              v-model="psd"
40
+              placeholder="请输入密码"
41
+              show-password
42
+              clearable
43
+            ></el-input>
44
+          </div>
45
+        </el-form-item>
46
+      </el-form>
47
+    </div>
48
+    <div class="logintwo" @click="modifyAndLogin()">登录</div>
49
+    <div class="problem">
50
+      遇到问题?点击
51
+      <span @click="contact = true">联系客服</span>
52
+    </div>
53
+
54
+    <!-- 弹窗 联系客服 -->
55
+    <el-dialog
56
+      title="客服电话"
57
+      :visible.sync="contact"
58
+      width="19.1875rem"
59
+      top="12.5rem"
60
+      center
61
+      class="myDialog"
62
+    >
63
+      <span class="telephone">0755-86526342</span>
64
+      <span slot="footer" class="dialog-footer">
65
+        <span @click="contact = false">取消</span>
66
+        <span>|</span>
67
+        <span type="primary" @click="callPhone()">拨打</span>
68
+      </span>
69
+    </el-dialog>
70
+  </div>
71
+</template>
72
+
73
+<script>
74
+// import { getCode, NextStep } from "@/api/login/login";
75
+import {
76
+  getCodeInit,getVerifyCode,forgetPassWord
77
+} from '@/api/login'
78
+import { checkMobile } from "@/utils/tools";
79
+import { hex_md5 } from "@/utils/md5";
80
+
81
+export default {
82
+  data() {
83
+    var checkMobileRule = (rule, value, callback) => {
84
+      if (!checkMobile(value)) {
85
+        callback(new Error("请填写正确的手机号"));
86
+      } else {
87
+        callback();
88
+      }
89
+    };
90
+    return {
91
+      phone: "",
92
+      code: "",
93
+      psd: "",
94
+      contact: false,
95
+      count_downing: false,
96
+      count_down: 0,
97
+      aespass:"",
98
+      forgetForm: {
99
+        phone: "",
100
+        code: ""
101
+      },
102
+      rules: {
103
+        phone: [
104
+          { required: true, message: "手机号码不能为空" },
105
+          { validator: checkMobileRule }
106
+        ],
107
+        code: [{ required: true, message: "验证码不能为空" }]
108
+      },
109
+      loginshow: false,
110
+      loginshowtwo: true,
111
+      codeshow: false,
112
+      codeshowtwo: true
113
+    };
114
+  },
115
+  created(){
116
+    this.GetCodeInit()
117
+  },
118
+  methods: {
119
+    modifyAndLogin(){
120
+      if (this.forgetForm.phone.trim().length == 0) {
121
+        this.$toast({
122
+          message:"手机号码不能为空!"
123
+        });
124
+        return
125
+      }
126
+      if (!checkMobile(this.forgetForm.phone)) {
127
+        this.$toast({
128
+          message:"请填写正确的手机号码!"
129
+        });
130
+        return
131
+      }
132
+      if (this.forgetForm.code.trim().length == 0) {
133
+        this.$toast({
134
+          message:"验证码不能为空!"
135
+        });
136
+        return
137
+      }
138
+
139
+      let params = {
140
+        mobile: this.forgetForm.phone,
141
+        code: this.forgetForm.code,
142
+        password: hex_md5(this.psd),
143
+      }
144
+      forgetPassWord(params).then(response => {
145
+        if (response.data.state === 1) {
146
+          var user = response.data.data.user;
147
+          var admin = response.data.data.admin;
148
+          var org = response.data.data.org;
149
+          var subscibe = response.data.data.subscibe;
150
+          var config_list = response.data.data.config_list;
151
+          var template_info = response.data.data.template_info;
152
+          var filed_list = response.data.data.filed_list;
153
+
154
+          this.$store.dispatch("InitUserInfo", {
155
+            admin:admin,
156
+            user: user,
157
+            org: org,
158
+            subscibe: subscibe,
159
+            template_info: template_info,
160
+            filed_list: filed_list
161
+          });
162
+          this.$store.dispatch("SetConfigList", config_list);
163
+          this.$router.replace("/myIndex")
164
+
165
+          }
166
+      })
167
+    },
168
+    GetCodeInit(){
169
+      getCodeInit().then(response => {
170
+        if (response.data.state === 1) {
171
+          this.aespass = response.data.data.aespass
172
+
173
+        }
174
+      })
175
+    },
176
+    getVerifyCode() {
177
+      if (this.forgetForm.phone.length == 0) {
178
+        this.$toast({
179
+          message:"手机号码不能为空!"
180
+        });
181
+        return
182
+      }
183
+      if (!checkMobile(this.forgetForm.phone)) {
184
+        this.$toast({
185
+          message:"请填写正确的手机号码!"
186
+        });
187
+        return
188
+      }
189
+
190
+      if (!this.count_downing) {
191
+        let parms = {
192
+          phone: this.forgetForm.phone,
193
+          aespass: this.aespass,
194
+        }
195
+        getVerifyCode(parms).then(response => {
196
+          if (response.data.state === 1) {
197
+            this.count_downing = true;
198
+            this.count_down = 61;
199
+            this.countDown();
200
+          }
201
+        })
202
+      }
203
+    },
204
+
205
+    callPhone() {
206
+      window.location.href = "tel://075586526342";
207
+    },
208
+    countDown: function() {
209
+      this.count_down = this.count_down - 1;
210
+      if (this.count_down === 0) {
211
+        this.count_downing = false;
212
+        return;
213
+      }
214
+      var t = this;
215
+      setTimeout(() => {
216
+        this.countDown();
217
+      }, 1000);
218
+    },
219
+    watchNum() {
220
+      if (this.forgetForm.phone.length === 11) {
221
+        this.codeshow = true;
222
+        this.codeshowtwo = false;
223
+      } else {
224
+        this.codeshow = false;
225
+        this.codeshowtwo = true;
226
+      }
227
+
228
+      if (this.forgetForm.phone === "" || this.forgetForm.code === "") {
229
+        this.loginshow = false;
230
+        this.loginshowtwo = true;
231
+      } else {
232
+        this.loginshow = true;
233
+        this.loginshowtwo = false;
234
+      }
235
+    },
236
+    change(value) {
237
+      this.forgetForm.phone = value.replace(/[^0-9]+/g, "");
238
+    }
239
+  },
240
+  computed: {
241
+    code_btn_title: function() {
242
+      if (this.count_down == 0) {
243
+        return "获取验证码";
244
+      } else {
245
+        return "重新发送(" + this.count_down + ")";
246
+      }
247
+    }
248
+  }
249
+};
250
+</script>
251
+
252
+<style lang="scss" scoped>
253
+.page_noPassword {
254
+  overflow: hidden;
255
+  height: 100%;
256
+  .nopasswordTitle {
257
+    height: 3.125rem;
258
+    line-height: 3.125rem;
259
+    display: flex;
260
+    align-items: center;
261
+  }
262
+  .jiantou {
263
+    margin-left: 1.25rem;
264
+    font-size: 1.5rem;
265
+    font-weight: 600;
266
+    margin-right: 6.625rem;
267
+  }
268
+  .titleName {
269
+    font-size: 1.125rem;
270
+    font-weight: 600;
271
+  }
272
+  .forgetmyInput {
273
+    margin-top: 4rem;
274
+    .phoneLine {
275
+      width: 84%;
276
+      margin: 0 auto;
277
+      display: flex;
278
+      border-bottom: 1px solid #e6e6e6;
279
+      .mobile {
280
+        float: left;
281
+        color: #acacac;
282
+        font-size: 1.5rem;
283
+        margin-left: 0.375rem;
284
+        line-height: 3.375rem;
285
+        width: 1.5rem;
286
+      }
287
+      .phoneInput {
288
+        width: 95%;
289
+      }
290
+    }
291
+
292
+    .lock {
293
+      float: left;
294
+      color: #acacac;
295
+      font-size: 1.5rem;
296
+      margin-left: 0.375rem;
297
+      line-height: 3.375rem;
298
+      width: 1.5rem;
299
+    }
300
+    .code {
301
+      line-height: 3.375rem;
302
+      width: 84%;
303
+      height: 3.375rem;
304
+      margin: 0 auto;
305
+      border-bottom: 1px solid #e6e6e6;
306
+      display: flex;
307
+      align-items: center;
308
+
309
+      .dunpai {
310
+        float: left;
311
+        color: #acacac;
312
+        font-size: 1.5rem;
313
+        margin-left: 0.375rem;
314
+      }
315
+      .el-input {
316
+        float: left;
317
+        width: 10.6rem;
318
+        border: none;
319
+        padding: 0;
320
+      }
321
+      .el-input__inner {
322
+        padding: 0;
323
+        padding-left: 0.75rem;
324
+      }
325
+      .getCode {
326
+        // float: left;
327
+        width: 5.75rem;
328
+        height: 2rem;
329
+        line-height: 2rem;
330
+        text-align: center;
331
+        color: #fff;
332
+        background: #338afb;
333
+        border-radius: 1.4375rem;
334
+        font-size: 0.8125rem;
335
+      }
336
+      .getCodetwo {
337
+        width: 5.75rem;
338
+        height: 2rem;
339
+        // line-height: 2rem;
340
+        text-align: center;
341
+        color: #fff;
342
+        background: #e5e5e5;
343
+        border-radius: 1.4375rem;
344
+        font-size: 0.8125rem;
345
+      }
346
+
347
+      .el-button--primary {
348
+        border-color: transparent;
349
+      }
350
+    }
351
+  }
352
+  .login {
353
+    width: 19.25rem;
354
+    height: 2.875rem;
355
+    background: linear-gradient(
356
+      -90deg,
357
+      rgba(129, 159, 246, 1),
358
+      rgba(81, 119, 238, 1),
359
+      rgba(75, 102, 234, 1)
360
+    );
361
+    border-radius: 1.4375rem;
362
+    margin: 0 auto;
363
+    line-height: 2.875rem;
364
+    text-align: center;
365
+    color: #fff;
366
+    margin-top: 2.875rem;
367
+  }
368
+  .problem {
369
+    width: 84%;
370
+    font-size: 0.8125rem;
371
+    margin: 15rem auto 0;
372
+    text-align: center;
373
+    span {
374
+      color: #338afb;
375
+    }
376
+  }
377
+}
378
+
379
+.el-form-item__error {
380
+  margin-left: 2.5rem;
381
+}
382
+
383
+.logintwo {
384
+  width: 19.25rem;
385
+  height: 2.875rem;
386
+  background: #e5e5e5;
387
+  border-radius: 1.4375rem;
388
+  margin: 0 auto;
389
+  line-height: 2.875rem;
390
+  text-align: center;
391
+  color: #fff;
392
+  margin-top: 2.875rem;
393
+}
394
+.el-button--medium {
395
+  padding: 0;
396
+}
397
+</style>
398
+<style lang="scss">
399
+.forgetmyInput {
400
+  .el-form-item {
401
+    margin-bottom: 0;
402
+  }
403
+  .el-input {
404
+    display: flex;
405
+    align-items: center;
406
+    margin: 0 auto;
407
+    color: rgba(155, 155, 155, 1);
408
+    padding-left: 0.75rem;
409
+    box-sizing: border-box;
410
+    height: 3.375rem;
411
+    line-height: 3.375rem;
412
+  }
413
+  .el-input__inner {
414
+    border: none;
415
+    font-size: 1rem;
416
+    padding-left: 0;
417
+  }
418
+  .el-input__prefix {
419
+    font-size: 1.5rem;
420
+    color: #acacac;
421
+  }
422
+
423
+  .phoneLine {
424
+    .el-input__clear {
425
+      margin-right: 0.625rem;
426
+    }
427
+    .el-input__icon {
428
+      line-height: 3.375rem;
429
+      font-size: 1.5rem;
430
+    }
431
+  }
432
+}
433
+.myDialog {
434
+  line-height: 50%;
435
+  height: 100%;
436
+  .el-dialog {
437
+    border-radius: 10px;
438
+  }
439
+  .el-dialog__title {
440
+    color: #000000;
441
+  }
442
+  .telephone {
443
+    width: 12.5rem;
444
+    height: 1.125rem;
445
+    font-size: 1.5rem;
446
+    font-weight: 500;
447
+    color: #338afb;
448
+    margin-left: 2.5rem;
449
+  }
450
+  .dialog-footer {
451
+    > span:nth-of-type(1) {
452
+      color: #9b9b9b;
453
+    }
454
+    > span:nth-of-type(2) {
455
+      padding: 0 3.125rem;
456
+      color: #e6e6e6;
457
+    }
458
+    > span:nth-of-type(3) {
459
+      color: #000000;
460
+    }
461
+  }
462
+}
463
+</style>

+ 211 - 369
src/pages/home/login.vue ファイルの表示

@@ -1,127 +1,147 @@
1 1
 <template>
2
-  <div class="container">
3
-    <div class="newLogin">
4
-      <div class="login">
5
-        <div>
6
-          <img src="../../assets/login/newImg.png" alt style="width: 100%;" />
7
-        </div>
8
-        <div class="logo">
9
-          <img src="../../assets/login/newLogo.png" alt />
10
-        </div>
11
-        <div class="reg">
12
-          <div class="form">
13
-            <ul>
14
-              <li>
15
-                <span class="iconfont">&#xe78b;</span>
16
-                <input
17
-                  placeholder="请输入手机号"
18
-                  type="tel"
19
-                  class="tel"
20
-                  v-model="form.mobile"
21
-                />
22
-              </li>
23
-              <li>
24
-                <span class="iconfont">&#xe6c0;</span>
25
-                <input
26
-                  placeholder="请输入密码"
27
-                  type="password"
28
-                  class="tel"
29
-                  v-model="form.pwd"
30
-                />
31
-              </li>
32
-            </ul>
33
-          </div>
34
-          <!-- <router-link to="/product"> -->
35
-          <div class="remember">
36
-            <el-checkbox v-model="checked">记住密码</el-checkbox>
37
-          </div>
38
-          <!-- <button
39
-            class="loginBtn"
40
-            @click="loginAction"
41
-            :class="loginDisable ? 'disableLoginBtn' : ''"
42
-            :disabled="loginDisable"
43
-          >
44
-            登录
45
-          </button>-->
46
-          <button
47
-            class="loginBtn"
48
-            @click="submitForm"
49
-            :class="loginDisable ? 'disableLoginBtn' : ''"
50
-            :disabled="loginDisable"
51
-          >
52
-            登录
53
-          </button>
54
-
55
-          <!-- <router-link to="/forgetPassword">
56
-            <div class="newForget">忘记密码</div>
57
-          </router-link>-->
58
-          <!-- </router-link> -->
59
-          <!-- <div class="forget">
60
-          <a href="">免密码登录</a>
61
-          <a href="">忘记密码?</a>
62
-          </div>-->
63
-        </div>
64
-        <div class="agree">
65
-          <el-checkbox v-model="agreement">我已阅读并同意</el-checkbox>
66
-          <span class="agreeText" @click="agree()">《隐私服务协议》</span>
67
-          <span class="agreeText" @click="agree1()">《用户协议》</span>
68
-        </div>
2
+  <div class="page_login">
3
+    <div class="loginTop">
4
+      <img src="../../assets/images/loginLogo.png" alt />
5
+    </div>
6
+    <div class="loginBottom">
7
+      <div class="ipts">
8
+        <el-form ref="LoginForm" :model="LoginForm" :rules="rules">
9
+          <el-form-item required prop="tel">
10
+            <el-input
11
+              placeholder="请输入手机号码"
12
+              prefix-icon="el-icon-mobile"
13
+              v-model="LoginForm.tel"
14
+              clearable
15
+              v-on:input="watchNum"
16
+              maxlength="11"
17
+              @input="change(LoginForm.tel)"
18
+            ></el-input>
19
+          </el-form-item>
20
+          <el-form-item>
21
+            <el-input
22
+              placeholder="请输入密码"
23
+              prefix-icon="el-icon-lock"
24
+              v-model="LoginForm.psd"
25
+              show-password
26
+              clearable
27
+              v-on:input="watchNum"
28
+            ></el-input>
29
+          </el-form-item>
30
+        </el-form>
31
+      </div>
32
+      <p class="forget" @click="toForgetPassword()">忘记密码?</p>
33
+      <div class="login" @click="submitForm()" v-show="loginshow">登录</div>
34
+      <div class="login3" v-show="loginshowtwo">登录</div>
35
+      <div class="login2">
36
+        <p @click="noPassword()">免密码登录</p>
37
+        <p class="register" @click="ToRegister()">快速注册</p>
69 38
       </div>
70 39
     </div>
40
+    <div class="agreeBox">
41
+      <van-checkbox v-model="checked" shape="square"
42
+      >我已阅读并同意</van-checkbox
43
+      ><span class="newColor" @click="agree()">《隐私服务协议》</span
44
+    ><span class="newColor" @click="agree1()">《用户协议》</span>
45
+    </div>
71 46
   </div>
72 47
 </template>
73 48
 
49
+
50
+
51
+
74 52
 <script>
75 53
 import { loginByPwd } from "@/api/login";
76 54
 import { hex_md5 } from "@/utils/md5";
77
-import { getLoginInfoCache, cacheLoginInfo } from "@/utils/admin_info_cache";
78 55
 import { Toast } from "vant";
56
+import { checkMobile } from "@/utils/tools";
79 57
 
80 58
 export default {
81 59
   name: "Home",
82 60
   data() {
61
+    var checkMobileRule = (rule, value, callback) => {
62
+      if (!checkMobile(value)) {
63
+        callback(new Error("请填写正确的手机号"));
64
+      } else {
65
+        callback();
66
+      }
67
+    };
83 68
     return {
69
+      checked: true,
70
+      tel: "",
71
+      psd: "",
72
+      LoginForm: {
73
+        tel: "",
74
+        psd: ""
75
+      },
76
+      loginshow: false,
77
+      loginshowtwo: true,
78
+      rules: {
79
+        tel: [
80
+          { required: true, message: "手机号码不能为空" },
81
+          { validator: checkMobileRule }
82
+        ]
83
+      },
84 84
       form: {
85 85
         mobile: "",
86 86
         pwd: ""
87 87
       },
88
-      checked: false,
89 88
       agreement: true
90 89
     };
91 90
   },
92
-  computed: {
93
-    loginDisable() {
94
-      // return false
95
-      return this.form.mobile.length == 0 || this.form.pwd.length == 0;
96
-    }
97
-  },
91
+
98 92
   created() {
99
-    var loginInfo = getLoginInfoCache();
100
-    this.form.mobile = loginInfo.mobile;
101
-    this.form.pwd = loginInfo.password;
102
-  },
103
-  mounted() {
104
-    this.getCookie();
105 93
   },
94
+
106 95
   methods: {
107
-    loginAction: function() {
108
-      loginByPwd(this.form.mobile, hex_md5(this.form.pwd)).then(rs => {
109
-        var resp = rs.data;
96
+    ToRegister() {
97
+      this.$router.push("/register");
98
+    },
99
+    toForgetPassword() {
100
+      this.$router.push("/forget");
101
+    },
102
+    noPassword() {
103
+      this.$router.push("/nopassword");
104
+    },
105
+    change(val) {
106
+      this.LoginForm.tel = val.replace(/[^0-9]+/g, "");
107
+    },
108
+    watchNum() {
109
+      if (this.LoginForm.tel === "" || this.LoginForm.psd === "") {
110
+        this.loginshow = false;
111
+        this.loginshowtwo = true;
112
+      } else {
113
+        this.loginshow = true;
114
+        this.loginshowtwo = false;
115
+      }
116
+      if (this.LoginForm.psd.length < 6) {
117
+        this.loginshow = false;
118
+        this.loginshowtwo = true;
119
+      }
120
+      if (this.LoginForm.psd.length > 6) {
121
+        this.loginshow = true;
122
+        this.loginshowtwo = false;
123
+      }
124
+    },
125
+
110 126
 
111
-        if (resp.state == 1) {
112
-          cacheLoginInfo(this.form.mobile, this.form.pwd);
113
-          console.log(resp);
127
+    submitForm() {
128
+      loginByPwd(this.LoginForm.tel, hex_md5(this.LoginForm.psd)).then(rs => {
129
+        var resp = rs.data;
130
+        if (this.agreement != true) {
131
+          Toast("请同意隐私服务协议");
132
+        }
114 133
 
134
+        if (resp.state == 1 && this.agreement == true) {
115 135
           var user = resp.data.user;
136
+          var admin = resp.data.admin;
116 137
           var org = resp.data.org;
117 138
           var subscibe = resp.data.subscibe;
118 139
           var config_list = resp.data.config_list;
119 140
           var template_info = resp.data.template_info;
120 141
           var filed_list = resp.data.filed_list;
121
-          console.log(resp.data.filed_list);
122
-          console.log(filed_list);
123 142
 
124 143
           this.$store.dispatch("InitUserInfo", {
144
+            admin:admin,
125 145
             user: user,
126 146
             org: org,
127 147
             subscibe: subscibe,
@@ -129,315 +149,137 @@ export default {
129 149
             filed_list: filed_list
130 150
           });
131 151
           this.$store.dispatch("SetConfigList", config_list);
132
-
133
-          // this.$router.push({path: "/product"})
134
-          this.$router.push({ path: "/main" });
152
+          this.$router.replace({ path: "/myIndex" });
135 153
         } else {
136 154
           this.$toast({
137 155
             message: resp.msg
138 156
           });
139 157
         }
140 158
       });
141
-    },
142
-    to: function() {
143
-      this.$router.push({ path: "/privacy" });
144
-    },
145
-    submitForm() {
146
-      this.$router.push({ path: "/myIndex" });
147
-    },
148
-    // submitForm() {
149
-    //   const self = this;
150
-    //   //判断复选框是否被勾选 勾选则调用配置cookie方法
151
-    //   if (self.checked == true) {
152
-    //     console.log("checked == true");
153
-    //     //传入账号名,密码,和保存天数3个参数
154
-    //     self.setCookie(self.form.mobile, self.form.pwd, 7);
155
-    //   } else {
156
-    //     console.log("清空Cookie");
157
-    //     //清空Cookie
158
-    //     self.clearCookie();
159
-    //   }
160
-    //
161
-    //   //与后端请求代码,本功能不需要与后台交互所以省略
162
-    //
163
-    //   loginByPwd(this.form.mobile, hex_md5(this.form.pwd)).then(rs => {
164
-    //     var resp = rs.data;
165
-    //     if (this.agreement != true) {
166
-    //       Toast("请同意隐私服务协议");
167
-    //     }
168
-    //
169
-    //     if (resp.state == 1 && this.agreement == true) {
170
-    //       cacheLoginInfo(this.form.mobile, this.form.pwd);
171
-    //       console.log(resp);
172
-    //
173
-    //       var user = resp.data.user;
174
-    //       var org = resp.data.org;
175
-    //       var subscibe = resp.data.subscibe;
176
-    //       var config_list = resp.data.config_list;
177
-    //       var template_info = resp.data.template_info;
178
-    //       var filed_list = resp.data.filed_list;
179
-    //       console.log(resp.data.filed_list);
180
-    //       console.log(filed_list);
181
-    //
182
-    //       this.$store.dispatch("InitUserInfo", {
183
-    //         user: user,
184
-    //         org: org,
185
-    //         subscibe: subscibe,
186
-    //         template_info: template_info,
187
-    //         filed_list: filed_list
188
-    //       });
189
-    //       this.$store.dispatch("SetConfigList", config_list);
190
-    //
191
-    //       // this.$router.push({path: "/product"})
192
-    //       this.$router.push({ path: "/main" });
193
-    //     } else {
194
-    //       this.$toast({
195
-    //         message: resp.msg
196
-    //       });
197
-    //     }
198
-    //   });
199
-    //   console.log("登陆成功");
200
-    // },
201
-    // 设置cookie
202
-    setCookie(c_name, c_pwd, exdays) {
203
-      var exdate = new Date(); // 获取时间
204
-      exdate.setTime(exdate.getTime() + 24 * 60 * 60 * 1000 * exdays); // 保存的天数
205
-      // 字符串拼接cookie
206
-      window.document.cookie =
207
-        "userName" + "=" + c_name + ";path=/;expires=" + exdate.toGMTString();
208
-      window.document.cookie =
209
-        "userPwd" + "=" + c_pwd + ";path=/;expires=" + exdate.toGMTString();
210
-    },
211
-    getCookie: function() {
212
-      this.$nextTick(() => {
213
-        if (this.form.pwd != "") {
214
-          this.checked = true;
215
-        }
216
-      });
217
-      if (document.cookie.length > 0) {
218
-        var arr = document.cookie.split("; "); // 这里显示的格式需要切割一下自己可输出看下
219
-        for (var i = 0; i < arr.length; i++) {
220
-          var arr2 = arr[i].split("="); // 再次切割
221
-          // 判断查找相对应的值
222
-          if (arr2[0] == "userName") {
223
-            this.form.mobile = arr2[1]; // 保存到保存数据的地方
224
-          } else if (arr2[0] == "userPwd") {
225
-            this.form.pwd = arr2[1];
226
-          }
227
-        }
228
-      }
229
-    },
230
-    // 清除cookie
231
-    clearCookie: function() {
232
-      this.setCookie("", "", -1); // 修改2值都为空,天数为负1天就好了
233
-    },
234
-    agree() {
159
+    }, agree() {
235 160
       this.$router.push({ path: "/privacy" });
236 161
     },
237 162
     agree1() {
238 163
       this.$router.push({ path: "/userAgreement" });
239 164
     }
165
+
240 166
   }
241 167
 };
242 168
 </script>
243 169
 
244
-<style rel="stylesheet/scss" lang="scss" scoped>
245
-.container {
246
-  // background: $white-bg;
247
-  background: #fff;
248
-  @include box-sizing;
249
-  position: fixed;
250
-  width: 100%;
251
-  height: 100%;
252
-  display: flex;
253
-  justify-content: space-between;
254
-
255
-  .newLogin {
256
-    width: 100%;
170
+<style lang="scss" scoped>
171
+  .page_login {
172
+    overflow: hidden;
257 173
     height: 100%;
258
-    margin: auto;
259
-    // box-shadow: 0px 2px 25px 0px rgba(37, 143, 252, 0.1);
260
-    background: #fff;
174
+  .loginTop {
175
+    width: 100%;
176
+  img {
177
+    width: 7.75rem;
178
+    height: 2.5rem;
179
+    border: none;
180
+    margin: 6.25rem auto 3.75rem;
181
+    display: block;
182
+  }
183
+  }
184
+  .loginBottom {
185
+    width: 23.4375rem;
186
+    padding-top: 1rem;
187
+    box-sizing: border-box;
188
+  }
189
+  .forget {
190
+    font-size: 0.8125rem;
191
+    color: #1a8cff;
192
+    margin: 0.5625rem 0 1.5rem 17.4375rem;
193
+  }
194
+  .agreeBox {
195
+    width: 82%;
196
+    display: flex;
197
+    align-items: center;
198
+    font-size: 0.8125rem;
199
+    margin: 3.75rem auto 0;
200
+
201
+  .newColor {
202
+    color: #338afb;
203
+  }
261 204
   }
262 205
   .login {
263
-    // @include box-shadow;
264
-    @include text-align;
265
-    @include display-flex;
266
-    @include align-items-center;
267
-    // @include justify-content-center;
268
-    @include flex-direction;
269
-    height: 100%;
270
-    overflow-y: auto;
271
-    .logo {
272
-      // padding: 3rem 0 2.5rem;
273
-      padding: 0 0 0.5rem;
274
-      img {
275
-        width: 44%;
276
-        height: auto;
277
-        display: inline-block;
278
-      }
279
-    }
280
-    .reg {
281
-      width: 9.3rem;
282
-      .welcome {
283
-        text-align: left;
284
-        font-size: 0.55rem;
285
-        font-weight: 400;
286
-        color: rgba(37, 143, 252, 1);
287
-        margin-bottom: 0.5rem;
288
-        // line-height: 14px;
289
-      }
290
-      .newForget {
291
-        text-align: right;
292
-        font-size: 0.45rem;
293
-        font-weight: 400;
294
-        color: rgba(37, 143, 252, 1);
295
-        margin-top: 0.3rem;
296
-      }
297
-      .form {
298
-        border: 1px $border-color solid;
299
-        border-radius: 4px;
300
-        li {
301
-          border-bottom: 1px $border-color solid;
302
-          @include align-items-center;
303
-          @include text-align;
304
-          @include display-flex;
305
-          @include box-sizing;
306
-          .tel {
307
-            padding: 0.4rem 0;
308
-            width: 90%;
309
-            border: none;
310
-            outline: none;
311
-            font-size: 0.6rem;
312
-          }
313
-          .mint-cell {
314
-            width: 100%;
315
-          }
316
-          &:last-child {
317
-            border: none;
318
-          }
319
-          .iconfont {
320
-            color: $main-color;
321
-            font-size: 0.6rem;
322
-            margin: 0 0.46rem;
323
-          }
324
-        }
325
-      }
326
-      .forget {
327
-        text-align: left;
328
-        padding: 0.45rem 1rem;
329
-        a {
330
-          float: left;
331
-          font-size: 0.28rem;
332
-          color: $main-color;
333
-          &:nth-child(2) {
334
-            color: #999999;
335
-            float: right;
336
-          }
337
-          &:active {
338
-            background: $white-bg;
339
-          }
340
-        }
341
-      }
342
-      .loginBtn {
343
-        width: 100%;
344
-        height: 1.4rem;
345
-        line-height: 1.4rem;
346
-        background: $main-color;
347
-        color: #fff;
348
-        font-size: 0.6rem;
349
-        @include text-align;
350
-        border-radius: 4px;
351
-        margin: 1rem 0 0 0;
352
-      }
353
-      .disableLoginBtn {
354
-        background: lightgray;
355
-      }
356
-    }
206
+    width: 19.25rem;
207
+    height: 2.875rem;
208
+    background: #338afb;
209
+    border-radius: 1.4375rem;
210
+    margin: 0 auto;
211
+    line-height: 2.875rem;
212
+    color: #fff;
213
+    text-align: center;
357 214
   }
358
-  .remember {
215
+  .login2 {
216
+    margin-top: 1.75rem;
217
+    font-size: 0.8125rem;
218
+    color: rgba(81, 119, 238, 1);
219
+  > p:first-child {
359 220
     float: left;
221
+    margin-left: 3rem;
222
+  }
223
+  .register {
224
+    margin-left: 17.4375rem;
225
+    color: #1a8cff;
226
+  }
227
+  }
228
+  .login3 {
229
+    width: 19.25rem;
230
+    height: 2.875rem;
231
+    background: #e5e5e5;
232
+    border-radius: 1.4375rem;
233
+    margin: 0 auto;
234
+    line-height: 2.875rem;
235
+    color: #fff;
236
+    text-align: center;
360 237
   }
361
-  .agreeText {
362
-    color: #409eff;
363
-    font-size: 14px;
364 238
   }
365
-}
366
-</style>
367 239
 
368
-<style lang="scss">
369
-.remember {
370
-  .el-checkbox__inner {
371
-    @media only screen and (min-width: 415px) and (max-width: 767px) {
372
-      width: 20px;
373
-      height: 20px;
374
-    }
375
-    @media only screen and (min-width: 768px) {
376
-      width: 20px;
377
-      height: 20px;
378
-    }
240
+  .el-form-item__error {
241
+    margin-left: 2.5rem;
242
+  }
243
+  .el-button--medium {
244
+    padding: 0;
379 245
   }
380
-  .el-checkbox__inner::after {
381
-    @media only screen and (min-width: 415px) and (max-width: 767px) {
382
-      left: 7px;
383
-      height: 12px;
384
-      width: 4px;
385
-    }
386 246
 
387
-    @media only screen and (min-width: 768px) {
388
-      left: 7px;
389
-      height: 12px;
390
-      width: 4px;
391
-    }
247
+  .el-message {
248
+    min-width: 20rem;
392 249
   }
393
-  .el-checkbox__label {
394
-    @media only screen and (min-width: 415px) and (max-width: 767px) {
395
-      font-size: 0.45rem;
396
-    }
397
-    @media only screen and (min-width: 768px) {
398
-      font-size: 0.45rem;
399
-    }
250
+</style>
251
+<style lang="scss">
252
+  .loginBottom {
253
+  .el-form-item {
254
+    margin-bottom: 0;
400 255
   }
401
-}
402
-.agree {
403
-  .el-checkbox__inner {
404
-    @media only screen and (min-width: 415px) and (max-width: 767px) {
405
-      width: 20px;
406
-      height: 20px;
407
-    }
408
-    @media only screen and (min-width: 768px) {
409
-      width: 20px;
410
-      height: 20px;
411
-    }
256
+  .ipts {
257
+  .el-icon-circle-close {
258
+    margin-right: 0.625rem;
412 259
   }
413
-  .el-checkbox__inner::after {
414
-    @media only screen and (min-width: 415px) and (max-width: 767px) {
415
-      left: 7px;
416
-      height: 12px;
417
-      width: 4px;
418
-    }
419
-
420
-    @media only screen and (min-width: 768px) {
421
-      left: 7px;
422
-      height: 12px;
423
-      width: 4px;
424
-    }
260
+  .el-input {
261
+    display: block;
262
+    margin: 0 auto;
263
+    width: 19.0625rem;
264
+    border-bottom: 1px solid #e6e6e6;
265
+    color: rgba(155, 155, 155, 1);
266
+    padding-left: 0.75rem;
267
+    box-sizing: border-box;
268
+    height: 3.375rem;
269
+    line-height: 3.375rem;
270
+    font-size: 1rem;
271
+  }
272
+  .el-input__inner {
273
+    border: none;
274
+    font-size: 1rem;
275
+  }
276
+  .el-input__prefix {
277
+    font-size: 1.5rem;
278
+  }
279
+  .el-input__icon {
280
+    font-size: 1.5rem;
281
+    line-height: 3.375rem;
425 282
   }
426
-  .el-checkbox__label {
427
-    @media only screen and (min-width: 415px) and (max-width: 767px) {
428
-      font-size: 0.45rem;
429
-    }
430
-    @media only screen and (min-width: 768px) {
431
-      font-size: 0.45rem;
432
-    }
433 283
   }
434
-  .agreeText {
435
-    @media only screen and (min-width: 415px) and (max-width: 767px) {
436
-      font-size: 0.45rem;
437
-    }
438
-    @media only screen and (min-width: 768px) {
439
-      font-size: 0.45rem;
440
-    }
441 284
   }
442
-}
443 285
 </style>

+ 134 - 0
src/pages/home/noJoinedGroup/index.vue ファイルの表示

@@ -0,0 +1,134 @@
1
+<template>
2
+  <div class="page_noJoinedGroup">
3
+    <div class="noJoinedGroupTitle">
4
+      <i class="iconfont icon-zuojiantou jiantou"></i>
5
+    </div>
6
+    <div class="noJoinedGroupTxt">
7
+      你已经被邀请加入以下医院/组织/团队
8
+    </div>
9
+    <div class="nojoinBox">
10
+      <div class="nojoinImgBox">
11
+        <img class="nojoinImg" src="../../../assets/images/nojoin.png" alt="" />
12
+        <p class="nojoinTxt">为了更好的体验酷医云系统</p>
13
+        <p class="nojoinTxt">请先创建你的医院/组织/团队</p>
14
+      </div>
15
+    </div>
16
+    <div class="know" @click="goCreateOrg()">创建</div>
17
+    <div class="wantCreate" @click="goHome()">我已了解,进入酷医云 ></div>
18
+  </div>
19
+</template>
20
+<script>
21
+  import {login} from '@/api/login';
22
+
23
+  export default {
24
+    data() {
25
+      return {
26
+      };
27
+    },
28
+    methods: {
29
+      goCreateOrg(){
30
+        this.$router.push("/createorg")
31
+      },goHome(){
32
+        login().then(response => {
33
+          if (response.data.state === 1) {
34
+            var user = response.data.data.user;
35
+            var admin = response.data.data.admin;
36
+            var org = response.data.data.org;
37
+            var subscibe = response.data.data.subscibe;
38
+            var config_list = response.data.data.config_list;
39
+            var template_info = response.data.data.template_info;
40
+            var filed_list = response.data.data.filed_list;
41
+            this.$store.dispatch("InitUserInfo", {
42
+              admin:admin,
43
+              user: user,
44
+              org: org,
45
+              subscibe: subscibe,
46
+              template_info: template_info,
47
+              filed_list: filed_list
48
+            });
49
+            this.$store.dispatch("SetConfigList", config_list);
50
+            this.$router.replace("/myIndex")
51
+          }else{
52
+            this.$toast({
53
+              message:response.data.msg
54
+            });
55
+          }
56
+        })
57
+      }
58
+    },
59
+  };
60
+</script>
61
+
62
+
63
+<style lang="scss" scoped>
64
+.page_noJoinedGroup {
65
+  height: 100%;
66
+  overflow: hidden;
67
+  .noJoinedGroupTitle {
68
+    height: 3.125rem;
69
+    line-height: 3.125rem;
70
+    display: flex;
71
+    align-items: center;
72
+  }
73
+  .jiantou {
74
+    margin-left: 1rem;
75
+    font-size: 1.5rem;
76
+    font-weight: 600;
77
+  }
78
+  .noJoinedGroupTxt {
79
+    font-size: 1.0625rem;
80
+    font-family: PingFangSC;
81
+    font-weight: bold;
82
+    color: rgba(0, 0, 0, 1);
83
+    line-height: 0.9375rem;
84
+  }
85
+  .noJoinedGroupTxt {
86
+    padding: 1.25rem;
87
+    font-size: 17px;
88
+    font-family: PingFangSC;
89
+    font-weight: bold;
90
+    color: rgba(0, 0, 0, 1);
91
+    line-height: 15px;
92
+  }
93
+  .nojoinBox {
94
+    width: 21.125rem;
95
+    height: 22.75rem;
96
+    background: rgba(255, 255, 255, 1);
97
+    box-shadow: 0px 1px 15px 0px rgba(91, 91, 91, 0.3);
98
+    border-radius: 3px;
99
+    margin: 0 auto;
100
+    .nojoinImgBox {
101
+      width: 10.5rem;
102
+      margin: 0 auto;
103
+      padding-top: 3rem;
104
+    }
105
+    .nojoinImg {
106
+      width: 10.5rem;
107
+      height: 10.5rem;
108
+    }
109
+    .nojoinTxt {
110
+      font-size: 0.8125rem;
111
+      text-align: center;
112
+      color: #338afb;
113
+      line-height: 1.125rem;
114
+    }
115
+  }
116
+  .know {
117
+    width: 19.25rem;
118
+    height: 2.875rem;
119
+    line-height: 2.875rem;
120
+    background: rgba(51, 138, 251, 1);
121
+    box-shadow: 0px 1px 12px 0px rgba(51, 138, 251, 1);
122
+    border-radius: 23px;
123
+    color: #fff;
124
+    text-align: center;
125
+    margin: 1.875rem auto 1.625rem;
126
+  }
127
+  .wantCreate {
128
+    text-align: center;
129
+    text-decoration: underline;
130
+    color: #338afb;
131
+    font-size: 0.8125rem;
132
+  }
133
+}
134
+</style>

+ 465 - 0
src/pages/home/noPassword/index.vue ファイルの表示

@@ -0,0 +1,465 @@
1
+<template>
2
+  <div class="page_noPassword">
3
+    <div class="nopasswordTitle">
4
+      <i class="iconfont icon-zuojiantou jiantou"></i>
5
+      <span class="titleName">免密码登录</span>
6
+    </div>
7
+    <div class="myInput">
8
+      <el-form ref="NoPassForm" :model="NoPassForm" :rules="rules">
9
+        <el-form-item required prop="phone">
10
+          <div class="phoneLine">
11
+            <i class="el-icon-mobile mobile"></i>
12
+            <el-input
13
+              class="phoneInput"
14
+              placeholder="请输入手机号码"
15
+              v-model="NoPassForm.phone"
16
+              v-on:input="watchNum"
17
+              :maxlength="11"
18
+              @input="change(NoPassForm.phone)"
19
+            ></el-input>
20
+          </div>
21
+        </el-form-item>
22
+        <el-form-item required prop="code">
23
+          <div class="code">
24
+            <i class="iconfont icon-dunpai dunpai"></i>
25
+            <el-input
26
+              class="yzm"
27
+              v-model="NoPassForm.code"
28
+              placeholder="请输入验证码"
29
+              v-on:input="watchNum"
30
+            ></el-input>
31
+            <div>
32
+              <div class="getCode" @click="getVerifyCode()">{{code_btn_title}}</div>
33
+            </div>
34
+
35
+          </div>
36
+        </el-form-item>
37
+      </el-form>
38
+    </div>
39
+    <div class="login" @click="NoPassToLogin('NoPassForm')" v-show="loginshow">
40
+      登录
41
+    </div>
42
+    <div class="logintwo" v-show="loginshowtwo">登录</div>
43
+    <div class="agreeBox">
44
+      <van-checkbox v-model="checked" shape="square"
45
+        >我已阅读并同意</van-checkbox
46
+      ><span class="newColor" @click="agree()">《隐私服务协议》</span
47
+      ><span class="newColor" @click="agree1()">《用户协议》</span>
48
+    </div>
49
+    <div class="problem">
50
+      遇到问题?点击
51
+      <span @click="contact = true">联系客服</span>
52
+    </div>
53
+
54
+    <!-- 弹窗 联系客服 -->
55
+    <el-dialog
56
+      title="客服电话"
57
+      :visible.sync="contact"
58
+      width="19.1875rem"
59
+      top="12.5rem"
60
+      center
61
+      class="myDialog"
62
+    >
63
+      <span class="telephone">0755-86526342</span>
64
+      <span slot="footer" class="dialog-footer">
65
+        <span @click="contact = false">取消</span>
66
+        <span>|</span>
67
+        <span type="primary" @click="callPhone()">拨打</span>
68
+      </span>
69
+    </el-dialog>
70
+  </div>
71
+</template>
72
+
73
+<script>
74
+import { checkMobile } from "@/utils/tools";
75
+import {
76
+  getCodeInit,getVerifyCode,loginByCode
77
+} from '@/api/login'
78
+export default {
79
+  data() {
80
+    var checkMobileRule = (rule, value, callback) => {
81
+      if (!checkMobile(value)) {
82
+        callback(new Error("请填写正确的手机号"));
83
+      } else {
84
+        callback();
85
+      }
86
+    };
87
+    return {
88
+      checked: true,
89
+      phone: "",
90
+      code: "",
91
+      contact: false,
92
+      aespass: "",
93
+      NoPassForm: {
94
+        phone: "",
95
+        code: ""
96
+      },
97
+      rules: {
98
+        phone: [
99
+          { required: true, message: "手机号码不能为空" },
100
+          { validator: checkMobileRule }
101
+        ],
102
+        code: [{ required: true, message: "验证码不能为空" }]
103
+      },
104
+      loginshow: false,
105
+      loginshowtwo: true,
106
+      count_downing: false,
107
+      count_down: 0,
108
+      codeshow: false,
109
+      codeshowtwo: true
110
+    };
111
+  },
112
+  created(){
113
+    this.GetCodeInit()
114
+  },
115
+  methods: {
116
+    GetCodeInit(){
117
+      getCodeInit().then(response => {
118
+        if (response.data.state === 1) {
119
+          this.aespass = response.data.data.aespass
120
+
121
+        }
122
+      })
123
+    },
124
+    getVerifyCode() {
125
+      if (this.NoPassForm.phone.length == 0) {
126
+        this.$toast({
127
+          message:"手机号码不能为空!"
128
+        });
129
+        return
130
+      }
131
+      if (!checkMobile(this.NoPassForm.phone)) {
132
+        this.$toast({
133
+          message:"请填写正确的手机号码!"
134
+        });
135
+        return
136
+      }
137
+
138
+
139
+
140
+      if (!this.count_downing) {
141
+        let parms = {
142
+          phone: this.NoPassForm.phone,
143
+          aespass: this.aespass,
144
+        }
145
+        getVerifyCode(parms).then(response => {
146
+          if (response.data.state === 1) {
147
+            this.count_downing = true;
148
+            this.count_down = 61;
149
+            this.countDown();
150
+          }
151
+        })
152
+      }
153
+    },
154
+    countDown: function() {
155
+      this.count_down = this.count_down - 1;
156
+      if (this.count_down == 0) {
157
+        this.count_downing = false;
158
+        return;
159
+      }
160
+      var t = this;
161
+      setTimeout(() => {
162
+        this.countDown();
163
+      }, 1000);
164
+    },
165
+
166
+    callPhone() {
167
+      window.location.href = "tel://075586526342";
168
+    },
169
+    NoPassToLogin(formName) {
170
+
171
+      this.$refs[formName].validate(valid => {
172
+        if (valid) {
173
+          if (this.NoPassForm.phone.length == 0) {
174
+            this.$toast({
175
+              message:"手机号码不能为空!"
176
+            });
177
+            return
178
+          }
179
+          if (!checkMobile(this.NoPassForm.phone)) {
180
+            this.$toast({
181
+              message:"请填写正确的手机号码!"
182
+            });
183
+            return
184
+          }
185
+          if (this.NoPassForm.code.length == 0) {
186
+            this.$toast({
187
+              message:"验证码不能为空!"
188
+            });
189
+            return
190
+          }
191
+
192
+
193
+          let params = {
194
+            mobile: this.NoPassForm.phone,
195
+            code: this.NoPassForm.code
196
+          }
197
+          loginByCode(params).then(
198
+            response => {
199
+              if (response.data.state === 1) {
200
+                var user = response.data.data.user;
201
+                var admin = response.data.data.admin;
202
+                var org = response.data.data.org;
203
+                var subscibe = response.data.data.subscibe;
204
+                var config_list = response.data.data.config_list;
205
+                var template_info = response.data.data.template_info;
206
+                var filed_list = response.data.data.filed_list;
207
+
208
+                this.$store.dispatch("InitUserInfo", {
209
+                  admin:admin,
210
+                  user: user,
211
+                  org: org,
212
+                  subscibe: subscibe,
213
+                  template_info: template_info,
214
+                  filed_list: filed_list
215
+                });
216
+                this.$store.dispatch("SetConfigList", config_list);
217
+                this.$router.replace("/myIndex")
218
+              } else {
219
+                this.$toast({
220
+                  message: resp.data.msg
221
+                });
222
+              }
223
+            }
224
+          );
225
+        }
226
+      });
227
+    },
228
+    watchNum() {
229
+      if (this.NoPassForm.phone.length === 11) {
230
+        this.codeshow = true;
231
+        this.codeshowtwo = false;
232
+      } else {
233
+        this.codeshowtwo = true;
234
+        this.codeshow = false;
235
+      }
236
+
237
+      if (this.NoPassForm.phone === "" || this.NoPassForm.code === "") {
238
+        this.loginshow = false;
239
+        this.loginshowtwo = true;
240
+      } else {
241
+        this.loginshow = true;
242
+        this.loginshowtwo = false;
243
+      }
244
+    },
245
+    change(val) {
246
+      this.NoPassForm.phone = val.replace(/[^0-9]+/g, "");
247
+    },agree() {
248
+      this.$router.push({ path: "/privacy" });
249
+    },
250
+    agree1() {
251
+      this.$router.push({ path: "/userAgreement" });
252
+    }
253
+  },
254
+  computed: {
255
+    code_btn_title: function() {
256
+      if (this.count_down == 0) {
257
+        return "获取验证码";
258
+      } else {
259
+        return "重新发送(" + this.count_down + ")";
260
+      }
261
+    }
262
+  }
263
+};
264
+</script>
265
+
266
+<style lang="scss" scoped>
267
+.page_noPassword {
268
+  overflow: hidden;
269
+  height: 100%;
270
+  .nopasswordTitle {
271
+    height: 3.125rem;
272
+    line-height: 3.125rem;
273
+    display: flex;
274
+    align-items: center;
275
+  }
276
+  .jiantou {
277
+    margin-left: 1.25rem;
278
+    font-size: 1.5rem;
279
+    font-weight: 600;
280
+    margin-right: 6.625rem;
281
+  }
282
+  .titleName {
283
+    font-size: 1.125rem;
284
+    font-weight: 600;
285
+  }
286
+  .myInput {
287
+    margin-top: 4rem;
288
+    .phoneLine {
289
+      width: 84%;
290
+      margin: 0 auto;
291
+      border-bottom: 1px solid #e6e6e6;
292
+      display: flex;
293
+      .phoneInput {
294
+        width: 95%;
295
+      }
296
+      .mobile {
297
+        float: left;
298
+        color: #acacac;
299
+        font-size: 1.5rem;
300
+        margin-left: 0.375rem;
301
+        line-height: 3.375rem;
302
+        width: 1.5rem;
303
+      }
304
+    }
305
+    .code {
306
+      line-height: 3.375rem;
307
+      width: 84%;
308
+      height: 3.375rem;
309
+      margin: 0 auto;
310
+      border-bottom: 1px solid #e6e6e6;
311
+      display: flex;
312
+      align-items: center;
313
+      .dunpai {
314
+        float: left;
315
+        color: #acacac;
316
+        font-size: 1.5rem;
317
+        margin-left: 0.375rem;
318
+      }
319
+      .el-input {
320
+        float: left;
321
+        width: 10.6rem;
322
+        border: none;
323
+        padding: 0;
324
+      }
325
+      .el-input__inner {
326
+        padding: 0;
327
+        padding-left: 0.75rem;
328
+      }
329
+      .getCode {
330
+        float: right;
331
+        width: 5.75rem;
332
+        height: 2rem;
333
+        line-height: 2rem;
334
+        text-align: center;
335
+        color: #fff;
336
+        background: #338afb;
337
+        border-radius: 1.4375rem;
338
+        font-size: 0.8125rem;
339
+      }
340
+      .getCodetwo {
341
+        // float: left;
342
+        width: 5.75rem;
343
+        height: 2rem;
344
+        // line-height: 2rem;
345
+        text-align: center;
346
+        color: #fff;
347
+        background: #e5e5e5;
348
+        border-radius: 1.4375rem;
349
+        font-size: 0.8125rem;
350
+      }
351
+      .el-button--primary {
352
+        border-color: transparent;
353
+      }
354
+    }
355
+  }
356
+  .login {
357
+    width: 84%;
358
+    height: 2.875rem;
359
+    background: #338afb;
360
+    border-radius: 1.4375rem;
361
+    margin: 0 auto;
362
+    line-height: 2.875rem;
363
+    text-align: center;
364
+    color: #fff;
365
+    margin-top: 2.875rem;
366
+  }
367
+  .problem {
368
+    width: 84%;
369
+    font-size: 0.8125rem;
370
+    margin: 16.75rem auto 0;
371
+    text-align: center;
372
+    span {
373
+      color: #338afb;
374
+    }
375
+  }
376
+  .agreeBox {
377
+    width: 82%;
378
+    display: flex;
379
+    align-items: center;
380
+    font-size: 0.8125rem;
381
+    margin: 1.25rem auto 0;
382
+    .newColor {
383
+      color: #338afb;
384
+    }
385
+  }
386
+}
387
+
388
+.el-form-item__error {
389
+  margin-left: 2.5rem;
390
+}
391
+
392
+.logintwo {
393
+  width: 19.25rem;
394
+  height: 2.875rem;
395
+  background: #e5e5e5;
396
+  border-radius: 1.4375rem;
397
+  margin: 0 auto;
398
+  line-height: 2.875rem;
399
+  text-align: center;
400
+  color: #fff;
401
+  margin-top: 2.875rem;
402
+}
403
+
404
+.el-message {
405
+  min-width: 20rem;
406
+}
407
+</style>
408
+<style lang="scss">
409
+.myInput {
410
+  .el-form-item {
411
+    margin-bottom: 0;
412
+  }
413
+  .el-input {
414
+    display: block;
415
+    margin: 0 auto;
416
+    // width: 19.0625rem;
417
+
418
+    color: rgba(155, 155, 155, 1);
419
+    padding-left: 0.75rem;
420
+    box-sizing: border-box;
421
+    height: 3.375rem;
422
+    line-height: 3.375rem;
423
+  }
424
+  .el-input__inner {
425
+    border: none;
426
+    font-size: 1rem;
427
+    padding-left: 0;
428
+  }
429
+  .el-input__prefix {
430
+    font-size: 1.5rem;
431
+    color: #acacac;
432
+    line-height: 3.375rem;
433
+  }
434
+}
435
+.myDialog {
436
+  line-height: 50%;
437
+  height: 100%;
438
+  .el-dialog {
439
+    border-radius: 10px;
440
+  }
441
+  .el-dialog__title {
442
+    color: #000000;
443
+  }
444
+  .telephone {
445
+    width: 12.5rem;
446
+    height: 1.125rem;
447
+    font-size: 1.5rem;
448
+    font-weight: 500;
449
+    color: #338afb;
450
+    margin-left: 2.5rem;
451
+  }
452
+  .dialog-footer {
453
+    > span:nth-of-type(1) {
454
+      color: #9b9b9b;
455
+    }
456
+    > span:nth-of-type(2) {
457
+      padding: 0 3.125rem;
458
+      color: #e6e6e6;
459
+    }
460
+    > span:nth-of-type(3) {
461
+      color: #000000;
462
+    }
463
+  }
464
+}
465
+</style>

+ 115 - 0
src/pages/home/register/name.vue ファイルの表示

@@ -0,0 +1,115 @@
1
+<template>
2
+  <div class="page_getName">
3
+    <div class="getNameTitle">
4
+      <i class="iconfont icon-zuojiantou jiantou"></i>
5
+    </div>
6
+    <div class="getNameBox">
7
+      <div class="welcome">你好,欢迎使用酷医云</div>
8
+      <div class="tips">接下来请完善信息,以便获取更精准的服务</div>
9
+      <div class="problemBox">
10
+        <span style="color:#F44746">*</span>
11
+        <span class="problem">请问你的姓名是?</span>
12
+      </div>
13
+      <div class="inputBox">
14
+        <van-field v-model="name" placeholder="请输入用户名"/>
15
+      </div>
16
+      <div class="next" @click="setName()">下一步</div>
17
+    </div>
18
+  </div>
19
+</template>
20
+
21
+<script>
22
+  import {setName} from '@/api/login';
23
+
24
+  export default {
25
+    data() {
26
+      return {
27
+        name: '',
28
+      };
29
+    },
30
+    methods: {
31
+        setName(){
32
+          if(this.name.trim().length == 0){
33
+            this.$message.error("名字不能为空!");
34
+            return
35
+          }
36
+          let params = {
37
+            name : this.name
38
+          }
39
+          setName(params).then(
40
+            response => {
41
+              if (response.data.state === 1) {
42
+                this.$router.replace("/join")
43
+              } else {
44
+                this.$message.error(response.data.msg);
45
+              }
46
+            }
47
+          );
48
+        }
49
+
50
+
51
+    },
52
+  };
53
+</script>
54
+
55
+
56
+<style lang="scss" scoped>
57
+  .page_getName {
58
+    height: 100%;
59
+    overflow: hidden;
60
+
61
+  .getNameTitle {
62
+    height: 3.125rem;
63
+    line-height: 3.125rem;
64
+    display: flex;
65
+    align-items: center;
66
+  }
67
+
68
+  .jiantou {
69
+    margin-left: 1rem;
70
+    font-size: 1.5rem;
71
+    font-weight: 600;
72
+  }
73
+
74
+  .getNameBox {
75
+    padding: 1rem 2rem 0;
76
+  }
77
+
78
+  .welcome {
79
+    font-weight: bold;
80
+    font-size: 1.125rem;
81
+    color: #000;
82
+  }
83
+
84
+  .problemBox {
85
+    margin-top: 2.625rem;
86
+  }
87
+
88
+  .tips {
89
+    font-size: 0.75rem;
90
+    margin-top: 0.875rem;
91
+  }
92
+
93
+  .problem {
94
+    font-size: 0.75rem;
95
+  }
96
+
97
+  .inputBox {
98
+    border-bottom: 1px solid #e8e8e8;
99
+    margin-top: 1.25rem;
100
+  }
101
+
102
+  .next {
103
+    width: 100%;
104
+    height: 2.875rem;
105
+    background: rgba(51, 138, 251, 1);
106
+    box-shadow: 0px 1px 12px 0px rgba(51, 138, 251, 1);
107
+    border-radius: 23px;
108
+    text-align: center;
109
+    line-height: 2.875rem;
110
+    color: #fff;
111
+    margin-top: 3.125rem;
112
+  }
113
+
114
+  }
115
+</style>

+ 483 - 0
src/pages/home/register/register.vue ファイルの表示

@@ -0,0 +1,483 @@
1
+<template>
2
+  <div class="page_register">
3
+    <div class="registerTitle">
4
+      <i class="iconfont icon-zuojiantou jiantou"></i>
5
+      <span class="titleName">注册</span>
6
+    </div>
7
+    <div class="registermyInput">
8
+      <el-form ref="registerForm" :model="registerForm" :rules="rules">
9
+        <el-form-item required prop="phone">
10
+          <div class="phoneLine">
11
+            <i class="el-icon-mobile mobile"></i>
12
+            <el-input
13
+              placeholder="请输入手机号码"
14
+              v-model="registerForm.phone"
15
+              v-on:input="watchNum"
16
+              maxlength="11"
17
+              @input="change(registerForm.phone)"
18
+            ></el-input>
19
+          </div>
20
+        </el-form-item>
21
+        <el-form-item required prop="code">
22
+          <div class="code">
23
+            <i class="iconfont icon-dunpai dunpai"></i>
24
+            <el-input
25
+              v-model="registerForm.code"
26
+              placeholder="请输入验证码"
27
+              v-on:input="watchNum"
28
+            ></el-input>
29
+            <div class="getCode" @click="getVerifyCode()">{{code_btn_title}}</div>
30
+            <!-- <el-button class="getCode" :type="count_downing ? 'info' : 'primary'" :disabled="count_downing" @click="getCodeAction" v-show="codeshow">{{ code_btn_title }}</el-button>
31
+            <el-button class="getCodetwo" :type="count_downing ? 'info' : 'primary'" :disabled="count_downing" v-show="codeshowtwo">{{ code_btn_title }}</el-button>-->
32
+          </div>
33
+        </el-form-item>
34
+        <el-form-item required prop="password">
35
+          <div class="phoneLine">
36
+            <i class="el-icon-lock lock"></i>
37
+            <el-input
38
+              v-model="registerForm.password"
39
+              show-password
40
+              clearable
41
+              placeholder="请输入密码"
42
+            ></el-input>
43
+          </div>
44
+        </el-form-item>
45
+      </el-form>
46
+      <!-- <el-input placeholder="请输入手机号码" prefix-icon="el-icon-mobile" v-model="phone"></el-input>
47
+
48
+      <div class="code">
49
+        <i class="iconfont icon-dunpai dunpai"></i>
50
+        <el-input v-model="code" placeholder="请输入验证码"></el-input>
51
+        <div class="getCode">获取验证码</div>
52
+      </div>
53
+      <el-input placeholder="请输入密码" prefix-icon="el-icon-lock" v-model="psd" show-password></el-input>-->
54
+    </div>
55
+    <div
56
+      class="login"
57
+      @click="submitModifyPwdAction('registerForm')"
58
+      v-show="loginshow"
59
+    >
60
+      下一步
61
+    </div>
62
+    <div class="logintwo" v-show="loginshowtwo">下一步</div>
63
+    <div class="agreeBox">
64
+      <van-checkbox v-model="checked" shape="square"
65
+        >我已阅读并同意</van-checkbox
66
+      ><span class="newColor">《隐私服务协议》</span
67
+      ><span class="newColor">《用户协议》</span>
68
+    </div>
69
+    <div class="problem">
70
+      遇到问题?点击
71
+      <span @click="contact = true">联系客服</span>
72
+    </div>
73
+
74
+    <!-- 弹窗 -->
75
+    <el-dialog
76
+      title="客服电话"
77
+      :visible.sync="contact"
78
+      width="19.1875rem"
79
+      top="12.5rem"
80
+      center
81
+      class="myDialog"
82
+    >
83
+      <span class="telephone">0755-86526342</span>
84
+      <span slot="footer" class="dialog-footer">
85
+        <span @click="contact = false">取消</span>
86
+        <span>|</span>
87
+        <span type="primary" @click="callPhone()">拨打</span>
88
+      </span>
89
+    </el-dialog>
90
+  </div>
91
+</template>
92
+
93
+<script>
94
+import { checkMobile, checkPassWordTwo } from "@/utils/tools";
95
+import {getCodeInit,getVerifyCode,register} from '@/api/login';
96
+import { hex_md5 } from "@/utils/md5";
97
+
98
+export default {
99
+  data() {
100
+    var checkMobileRule = (rule, value, callback) => {
101
+      if (!checkMobile(value)) {
102
+        callback(new Error("请填写正确的手机号"));
103
+      } else {
104
+        callback();
105
+      }
106
+    };
107
+    var checkPasswordRule = (rule, value, callback) => {
108
+      if (!checkPassWordTwo(value)) {
109
+        callback(new Error("密码长度不能小于6位数"));
110
+      } else {
111
+        callback();
112
+      }
113
+    };
114
+    return {
115
+      checked: true,
116
+      phone: "",
117
+      code: "",
118
+      psd: "",
119
+      contact: false,
120
+      count_downing: false,
121
+      count_down: 0,
122
+      modify_pwd_loading: false,
123
+      registerForm: {
124
+        phone: "",
125
+        code: "",
126
+        password: ""
127
+      },
128
+      rules: {
129
+        phone: [
130
+          { required: true, message: "手机号码不能为空" },
131
+          { validator: checkMobileRule }
132
+        ],
133
+        code: [{ required: true, message: "验证码不能为空" }],
134
+        password: [
135
+          { required: true, message: "密码不能为空" },
136
+          { validator: checkPasswordRule }
137
+        ]
138
+      },
139
+      loginshow: true,
140
+      loginshowtwo: false,
141
+      codeshow: false,
142
+      codeshowtwo: true,
143
+      aespass:"",
144
+    };
145
+  },
146
+  created(){
147
+    this.GetCodeInit()
148
+  },
149
+  methods: {
150
+    GetCodeInit(){
151
+      getCodeInit().then(response => {
152
+        if (response.data.state === 1) {
153
+          this.aespass = response.data.data.aespass
154
+
155
+        }
156
+      })
157
+    },
158
+    getVerifyCode() {
159
+      if (this.registerForm.phone.length == 0) {
160
+        this.$toast({
161
+          message:"手机号码不能为空!"
162
+        });
163
+        return
164
+      }
165
+      if (!checkMobile(this.registerForm.phone)) {
166
+        this.$toast({
167
+          message:"请填写正确的手机号码!"
168
+        });
169
+        return
170
+      }
171
+
172
+      if (!this.count_downing) {
173
+        let parms = {
174
+          phone: this.registerForm.phone,
175
+          aespass: this.aespass,
176
+        }
177
+        getVerifyCode(parms).then(response => {
178
+          if (response.data.state === 1) {
179
+            this.count_downing = true;
180
+            this.count_down = 61;
181
+            this.countDown();
182
+          }
183
+        })
184
+      }
185
+    },
186
+
187
+    countDown: function() {
188
+      this.count_down = this.count_down - 1;
189
+      if (this.count_down == 0) {
190
+        this.count_downing = false;
191
+        return;
192
+      }
193
+      var t = this;
194
+      setTimeout(() => {
195
+        this.countDown();
196
+      }, 1000);
197
+    },
198
+    watchNum() {
199
+      if (this.registerForm.phone.length === 11) {
200
+        this.codeshow = true;
201
+        this.codeshowtwo = false;
202
+      } else {
203
+        this.codeshow = false;
204
+        this.codeshowtwo = true;
205
+      }
206
+      if (this.registerForm.phone === "" || this.registerForm.code === "") {
207
+        this.loginshow = false;
208
+        this.loginshowtwo = true;
209
+      } else {
210
+        this.loginshow = true;
211
+        this.loginshowtwo = false;
212
+      }
213
+    },
214
+    submitModifyPwdAction(formName) {
215
+      this.$refs[formName].validate(valid => {
216
+        if (valid) {
217
+          let params = {
218
+            mobile: this.registerForm.phone,
219
+            password: hex_md5(this.psd),
220
+            code: this.registerForm.code,
221
+          }
222
+          register(params).then(response => {
223
+            if (response.data.state === 1) {
224
+              this.$router.push("/setname")
225
+            } else {
226
+              this.$toast({
227
+                message: response.data.msg
228
+              });
229
+            }
230
+          });
231
+        }
232
+      });
233
+    },
234
+
235
+    callPhone() {
236
+      window.location.href = "tel://075586526342";
237
+    },
238
+    // 不能输入中文和字母
239
+    change(val) {
240
+      console.log("val", val);
241
+      this.registerForm.phone = val.replace(/[^0-9]+/g, "");
242
+    }
243
+  },
244
+  computed: {
245
+    code_btn_title: function() {
246
+      if (this.count_down === 0) {
247
+        return "获取验证码";
248
+      } else {
249
+        return "重新发送(" + this.count_down + ")";
250
+      }
251
+    }
252
+  }
253
+};
254
+</script>
255
+
256
+<style lang="scss" scoped>
257
+.page_register {
258
+  overflow: hidden;
259
+  height: 100%;
260
+  .registerTitle {
261
+    height: 3.125rem;
262
+    line-height: 3.125rem;
263
+    display: flex;
264
+    align-items: center;
265
+  }
266
+  .jiantou {
267
+    margin-left: 1.25rem;
268
+    font-size: 1.5rem;
269
+    font-weight: 600;
270
+    margin-right: 8rem;
271
+  }
272
+  .titleName {
273
+    font-size: 1.125rem;
274
+    font-weight: 600;
275
+  }
276
+  .registermyInput {
277
+    margin-top: 4rem;
278
+    .phoneLine {
279
+      width: 84%;
280
+      margin: 0 auto;
281
+      display: flex;
282
+      border-bottom: 1px solid #e6e6e6;
283
+      .mobile {
284
+        float: left;
285
+        color: #acacac;
286
+        font-size: 1.5rem;
287
+        margin-left: 0.375rem;
288
+        line-height: 3.375rem;
289
+        width: 1.5rem;
290
+      }
291
+      .phoneInput {
292
+        width: 95%;
293
+      }
294
+    }
295
+    .lock {
296
+      float: left;
297
+      color: #acacac;
298
+      font-size: 1.5rem;
299
+      margin-left: 0.375rem;
300
+      line-height: 3.375rem;
301
+      width: 1.5rem;
302
+    }
303
+    .code {
304
+      line-height: 3.375rem;
305
+      width: 84%;
306
+      height: 3.375rem;
307
+      margin: 0 auto;
308
+      border-bottom: 1px solid #e6e6e6;
309
+      display: flex;
310
+      align-items: center;
311
+
312
+      .dunpai {
313
+        float: left;
314
+        color: #acacac;
315
+        font-size: 1.5rem;
316
+        margin-left: 0.375rem;
317
+      }
318
+      .el-input {
319
+        float: left;
320
+        width: 10.6rem;
321
+        border: none;
322
+        padding: 0;
323
+      }
324
+      .el-input__inner {
325
+        padding: 0;
326
+        padding-left: 0.75rem;
327
+      }
328
+      .getCode {
329
+        // float: left;
330
+        width: 5.75rem;
331
+        height: 2rem;
332
+        line-height: 2rem;
333
+        text-align: center;
334
+        color: #fff;
335
+        background: #338afb;
336
+        border-radius: 1.4375rem;
337
+        font-size: 0.8125rem;
338
+        // margin-top: 0.9375rem;
339
+      }
340
+
341
+      .getCodetwo {
342
+        width: 5.75rem;
343
+        height: 2rem;
344
+        // line-height: 2rem;
345
+        text-align: center;
346
+        color: #fff;
347
+        background: #e5e5e5;
348
+        border-radius: 1.4375rem;
349
+        font-size: 0.8125rem;
350
+      }
351
+
352
+      .el-button--primary {
353
+        border-color: transparent;
354
+      }
355
+    }
356
+  }
357
+  .login {
358
+    width: 84%;
359
+    height: 2.875rem;
360
+    background: #338afb;
361
+    border-radius: 1.4375rem;
362
+    margin: 0 auto;
363
+    line-height: 2.875rem;
364
+    text-align: center;
365
+    color: #fff;
366
+    margin-top: 2.875rem;
367
+  }
368
+  .logintwo {
369
+    width: 84%;
370
+    height: 2.875rem;
371
+    background: #e5e5e5;
372
+    border-radius: 1.4375rem;
373
+    margin: 0 auto;
374
+    line-height: 2.875rem;
375
+    text-align: center;
376
+    color: #fff;
377
+    margin-top: 2.875rem;
378
+  }
379
+  .problem {
380
+    width: 84%;
381
+    font-size: 0.8125rem;
382
+    margin: 13rem auto 0;
383
+    text-align: center;
384
+    span {
385
+      color: #338afb;
386
+    }
387
+  }
388
+  .agreeBox {
389
+    width: 82%;
390
+    display: flex;
391
+    align-items: center;
392
+    font-size: 0.8125rem;
393
+    margin: 1.25rem auto 0;
394
+    .newColor {
395
+      color: #338afb;
396
+    }
397
+  }
398
+}
399
+
400
+.el-form-item__error {
401
+  margin-left: 2.5rem;
402
+}
403
+.el-button--medium {
404
+  padding: 0;
405
+}
406
+
407
+.el-message {
408
+  min-width: 20rem;
409
+}
410
+</style>
411
+
412
+<style lang="scss">
413
+.registermyInput {
414
+  .el-form-item {
415
+    margin-bottom: 0;
416
+  }
417
+  .el-input {
418
+    display: flex;
419
+    align-items: center;
420
+    margin: 0 auto;
421
+    color: rgba(155, 155, 155, 1);
422
+    padding-left: 0.75rem;
423
+    box-sizing: border-box;
424
+    height: 3.375rem;
425
+    line-height: 3.375rem;
426
+  }
427
+  .el-input__inner {
428
+    border: none;
429
+    font-size: 1rem;
430
+    padding-left: 0;
431
+  }
432
+  .el-input__prefix {
433
+    font-size: 1.5rem;
434
+    color: #acacac;
435
+  }
436
+
437
+  .phoneLine {
438
+    .el-input__clear {
439
+      margin-right: 0.625rem;
440
+    }
441
+    .el-input__icon {
442
+      line-height: 3.375rem;
443
+      font-size: 1.5rem;
444
+    }
445
+  }
446
+}
447
+.myDialog {
448
+  line-height: 50%;
449
+  height: 100%;
450
+  .el-dialog {
451
+    border-radius: 10px;
452
+  }
453
+  .el-dialog__title {
454
+    color: #000000;
455
+  }
456
+  .telephone {
457
+    width: 12.5rem;
458
+    height: 1.125rem;
459
+    font-size: 1.5rem;
460
+    font-weight: 500;
461
+    color: #338afb;
462
+    margin-left: 2.5rem;
463
+  }
464
+  .dialog-footer {
465
+    //   display: flex;
466
+    //   justify-content: space-around;
467
+    //   align-items: center;
468
+    > span:nth-of-type(1) {
469
+      color: #9b9b9b;
470
+    }
471
+    > span:nth-of-type(2) {
472
+      // width: 0.125rem;
473
+      // height: 1.75rem;
474
+      // line-height: 1.75rem;
475
+      padding: 0 3.125rem;
476
+      color: #e6e6e6;
477
+    }
478
+    > span:nth-of-type(3) {
479
+      color: #000000;
480
+    }
481
+  }
482
+}
483
+</style>

+ 47 - 0
src/pages/home/verifyToken.vue ファイルの表示

@@ -0,0 +1,47 @@
1
+<template>
2
+  <div>
3
+    <h2 style="text-align:center;">加载中...</h2>
4
+  </div>
5
+</template>
6
+
7
+<script>
8
+  import {
9
+    isLogin,
10
+  } from '@/api/login'
11
+
12
+  export default {
13
+    name: "verifyToken",
14
+    created() {
15
+      isLogin().then(response => {
16
+        if (response.data.state === 1) {
17
+          var data = response.data.data
18
+          if(data.isLogin){ //登录
19
+            var admin = data.admin;
20
+            var user = data.user;
21
+            var org = data.org;
22
+            var subscibe = data.subscibe;
23
+            var config_list = data.config_list;
24
+            var template_info = data.template_info;
25
+            var filed_list = data.filed_list;
26
+            this.$store.dispatch("InitUserInfo", {
27
+              admin:admin,
28
+              user: user,
29
+              org: org,
30
+              subscibe: subscibe,
31
+              template_info: template_info,
32
+              filed_list: filed_list
33
+            });
34
+            this.$store.dispatch("SetConfigList", config_list);
35
+            this.$router.replace("/myIndex")
36
+          }else{ //未登录
37
+            this.$router.replace("/login")
38
+          }
39
+        }
40
+      })
41
+    }
42
+  }
43
+</script>
44
+
45
+<style scoped>
46
+
47
+</style>

+ 2 - 0
src/pages/homeIndex/index.vue ファイルの表示

@@ -138,6 +138,8 @@
138 138
       toPatients(){
139 139
         this.$router.push({path:"/patients"})
140 140
       }
141
+    },created(){
142
+      console.log(this.$store.getters.user.user)
141 143
     }
142 144
   };
143 145
 </script>

+ 3 - 2
src/permission.js ファイルの表示

@@ -1,13 +1,14 @@
1 1
 import router from "./router";
2 2
 import store from "./store";
3
+import  isLogin  from "@/api/login";
3 4
 
4
-const loginWhiteList = ["/", "/privacy", "/forgetPassword", "/userAgreement","/myIndex","/patients","/addPatints"]; // 登录验证白名单
5
+const loginWhiteList = ["/", "/login", "/privacy", "/forgetPassword", "/userAgreement","/myIndex","/patients","/addPatints","/nopassword","/forget","/register","/setname",'/join','/createorg']; // 登录验证白名单
5 6
 
6 7
 router.beforeEach((to, from, next) => {
7 8
   // 线上注释
8 9
   //   next()
9 10
   //   return
10
-
11
+  console.log(store.getters.user.user.id)
11 12
   if (store.getters.user.user.id == 0) {
12 13
     if (loginWhiteList.indexOf(to.path) !== -1) {
13 14
       next();

+ 35 - 0
src/router/index.js ファイルの表示

@@ -7,8 +7,43 @@ export default new Router({
7 7
   routes: [{
8 8
       path: '/',
9 9
       name: 'Home',
10
+      component: () => import('@/pages/home/verifyToken')
11
+    },
12
+    {
13
+      path: '/login',
14
+      name: 'Home',
10 15
       component: () => import('@/pages/home/login')
11 16
     },
17
+    {
18
+      path: '/nopassword',
19
+      name: 'Home',
20
+      component: () => import('@/pages/home/noPassword')
21
+    },
22
+    {
23
+      path: '/setname',
24
+      name: 'Home',
25
+      component: () => import('@/pages/home/register/name')
26
+    },
27
+    {
28
+      path: '/register',
29
+      name: 'Home',
30
+      component: () => import('@/pages/home/register/register')
31
+    },
32
+    {
33
+      path: '/join',
34
+      name: 'Home',
35
+      component: () => import('@/pages/home/noJoinedGroup')
36
+    },
37
+    {
38
+      path: '/forget',
39
+      name: 'Home',
40
+      component: () => import('@/pages/home/forgetPassword')
41
+    },
42
+    {
43
+      path: '/createorg',
44
+      name: 'Home',
45
+      component: () => import('@/pages/home/createOrg')
46
+    },
12 47
     // 首页
13 48
     {
14 49
       path: '/myIndex',

+ 72 - 28
src/store/user/user.js ファイルの表示

@@ -1,4 +1,8 @@
1 1
 
2
+import {
3
+  isLogin,
4
+} from '@/api/login'
5
+
2 6
 const user = {
3 7
   state: {
4 8
 
@@ -16,6 +20,7 @@ const user = {
16 20
       user_type: 0,
17 21
       user_title: 0
18 22
     },
23
+    admin:null,
19 24
     org: {
20 25
       id: 0,
21 26
       org_short_name: '',
@@ -49,36 +54,64 @@ const user = {
49 54
   },
50 55
 
51 56
   mutations: {
57
+    SET_ADMIN: (state, payload) => {
58
+      state.admin = payload.admin
59
+    },
52 60
     SET_FILEDS: (state, payload) => {
53 61
       state.fileds = payload.fileds
54
-      console.log(payload.fileds)
55
-      console.log(state.fileds)
56 62
     },
57 63
     SET_USER: (state, user) => {
58
-      state.user.id = user.id
59
-      state.user.mobile = user.mobile
60
-      state.user.avatar = user.avatar
61
-      state.user.user_name = user.user_name
62
-      state.user.intro = user.intro
63
-      state.user.user_type = user.user_type
64
-      state.user.user_title = user.user_title
64
+      if(user == null){
65
+        state.user.id = 0
66
+        state.user.mobile = ''
67
+        state.user.avatar = ''
68
+        state.user.user_name = ''
69
+        state.user.intro = ''
70
+        state.user.user_type = 0
71
+        state.user.user_title = ''
72
+      }else{
73
+        state.user.id = user.id
74
+        state.user.mobile = user.mobile
75
+        state.user.avatar = user.avatar
76
+        state.user.user_name = user.user_name
77
+        state.user.intro = user.intro
78
+        state.user.user_type = user.user_type
79
+        state.user.user_title = user.user_title
80
+
81
+      }
82
+
83
+
65 84
     },
66 85
     SET_ORG: (state, org) => {
67
-      state.org.id = org.id
68
-      state.org.org_short_name = org.org_short_name
69
-      state.org.org_name = org.org_name
70
-      state.org.org_intro = org.org_intro
71
-      state.org.org_logo = org.org_logo
72
-      state.org.address = org.address
73
-      state.org.province = org.province
74
-      state.org.city = org.city
75
-      state.org.district = org.district
86
+      if(org == null){
87
+        state.org.id = 0
88
+        state.org.org_short_name = ''
89
+        state.org.org_name = ''
90
+        state.org.org_intro =''
91
+        state.org.org_logo = ''
92
+        state.org.address = ''
93
+        state.org.province = 0
94
+        state.org.city = 0
95
+        state.org.district = 0
96
+
97
+      }else{
98
+        state.org.id = org.id
99
+        state.org.org_short_name = org.org_short_name
100
+        state.org.org_name = org.org_name
101
+        state.org.org_intro = org.org_intro
102
+        state.org.org_logo = org.org_logo
103
+        state.org.address = org.address
104
+        state.org.province = org.province
105
+        state.org.city = org.city
106
+        state.org.district = org.district
107
+      }
108
+
76 109
     },
77 110
     SET_SUBSCIBE: (state, subscibe) => {
78
-      state.subscibe.id = subscibe.id
79
-      state.subscibe.period_start = subscibe.period_start
80
-      state.subscibe.period_end = subscibe.period_end
81
-      state.subscibe.state = subscibe.state
111
+      // state.subscibe.id = subscibe.id
112
+      // state.subscibe.period_start = subscibe.period_start
113
+      // state.subscibe.period_end = subscibe.period_end
114
+      // state.subscibe.state = subscibe.state
82 115
     },
83 116
     SET_ROLE_TYPE: (state, type) => {
84 117
       state.role_type = type
@@ -91,9 +124,19 @@ const user = {
91 124
     },
92 125
     // eslint-disable-next-line camelcase
93 126
     SET_TEMPLATE: (state, template_info) => {
94
-      state.template_info.id = template_info.id
95
-      state.template_info.org_id = template_info.org_id
96
-      state.template_info.template_id = template_info.template_id
127
+      if(template_info == null){
128
+
129
+        state.template_info.id = 0
130
+        state.template_info.org_id = 0
131
+        state.template_info.template_id = 0
132
+
133
+      }else{
134
+
135
+        state.template_info.id = template_info.id
136
+        state.template_info.org_id = template_info.org_id
137
+        state.template_info.template_id = template_info.template_id
138
+
139
+      }
97 140
     },
98 141
     SET_REQUESTSCHEDUALS: (state, requestScheduals) => {
99 142
       state.requestScheduals = requestScheduals
@@ -114,12 +157,10 @@ const user = {
114 157
       var user = userInfo.user
115 158
       var org = userInfo.org
116 159
       var subscibe = userInfo.subscibe
117
-      // eslint-disable-next-line camelcase
118 160
       var template_info = userInfo.template_info
161
+      var admin = userInfo.admin
119 162
 
120 163
       var fileds = userInfo.filed_list
121
-      console.log(userInfo.filed_list)
122
-      console.log(fileds)
123 164
 
124 165
       commit('SET_USER', user)
125 166
       commit('SET_ORG', org)
@@ -128,6 +169,9 @@ const user = {
128 169
       commit('SET_FILEDS', {
129 170
         fileds
130 171
       })
172
+      commit('SET_ADMIN', {
173
+        admin
174
+      })
131 175
     },
132 176
     SwitchRoleTypeToDoctor ({commit}) {
133 177
       commit('SET_ROLE_TYPE', 1)

+ 7 - 0
src/utils/tools.js ファイルの表示

@@ -169,3 +169,10 @@ export function checkMobile(mobile) {
169 169
   }
170 170
   return true
171 171
 }
172
+
173
+export function checkPassWordTwo(password) {
174
+  if (!(/^[0-9A-Za-z]{6,}$/.test(password))) {
175
+    return false
176
+  }
177
+  return true
178
+}