From acce6953fe5a06ee8ecf73e3fa7e646a064dd702 Mon Sep 17 00:00:00 2001 From: zyronon Date: Wed, 18 Aug 2021 14:26:03 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E5=BD=95=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 1 + src/components/BaseButton.vue | 2 +- src/components/dialog/ConfirmDialog.vue | 59 +++++++-- src/components/dialog/NoticeDialog.vue | 115 +++++++++++++++++ src/pages/login/Base.js | 36 ++++++ src/pages/login/Base.scss | 56 +++++++++ src/pages/login/OtherLogin.vue | 83 ++---------- src/pages/login/PasswordLogin.vue | 83 +++--------- src/pages/login/RetrievePassword.vue | 147 ++++++++++++++++++++++ src/pages/login/VerificationCode.vue | 65 ++++------ src/pages/login/components/LoginInput.vue | 45 +++++-- src/pages/me/rightMenu/LookHistory.vue | 2 +- src/router/index.js | 2 + src/utils/global-methods.js | 38 +++++- 14 files changed, 529 insertions(+), 205 deletions(-) create mode 100644 src/components/dialog/NoticeDialog.vue create mode 100644 src/pages/login/Base.js create mode 100644 src/pages/login/Base.scss create mode 100644 src/pages/login/RetrievePassword.vue diff --git a/src/App.vue b/src/App.vue index c1e6e40..a9c0a9c 100644 --- a/src/App.vue +++ b/src/App.vue @@ -73,6 +73,7 @@ export default { '/login/other', '/login/password', '/login/verification-code', + '/login/retrieve-password', '/service-protocol', diff --git a/src/components/BaseButton.vue b/src/components/BaseButton.vue index 4dc0643..ad8c354 100644 --- a/src/components/BaseButton.vue +++ b/src/components/BaseButton.vue @@ -1,6 +1,6 @@ diff --git a/src/components/dialog/ConfirmDialog.vue b/src/components/dialog/ConfirmDialog.vue index 824ea3e..e60facd 100644 --- a/src/components/dialog/ConfirmDialog.vue +++ b/src/components/dialog/ConfirmDialog.vue @@ -2,12 +2,12 @@
-
{{ title }}
-
{{ subtitle }}
+
{{ title }}
+
{{ subtitle }}
@@ -31,7 +31,31 @@ export default { default() { return '' } - } + }, + subtitleColor: { + type: String, + default() { + return 'gray' + } + }, + okText: { + type: String, + default() { + return '确定' + } + }, + cancelText: { + type: String, + default() { + return '取消' + } + }, + cancelTextColor: { + type: String, + default() { + return 'gray' + } + }, }, data() { return {} @@ -58,30 +82,32 @@ export default { .content { background: white; - width: 80%; + width: 70%; border-radius: 2px; box-sizing: border-box; font-size: 1.5rem; text-align: center; .body { - padding: 1rem; + padding: 2.5rem; .title { - margin-top: 1rem; font-size: 1.5rem; + font-weight: bold; + margin-bottom: 1rem; } .subtitle { - margin-top: 1rem; - color: $second-text-color; font-size: 1.3rem; + + &.gray { + color: $second-text-color; + } } } .footer { - height: 4rem; - margin-top: 2rem; + height: 4.6rem; display: flex; border-top: 1px solid whitesmoke; font-size: 1.4rem; @@ -93,9 +119,16 @@ export default { width: 49%; } + .ok { + font-weight: bold; + } + .cancel { - color: $second-text-color; border-right: 1px solid whitesmoke; + + &.gray { + color: $second-text-color; + } } } diff --git a/src/components/dialog/NoticeDialog.vue b/src/components/dialog/NoticeDialog.vue new file mode 100644 index 0000000..4b5831c --- /dev/null +++ b/src/components/dialog/NoticeDialog.vue @@ -0,0 +1,115 @@ + + + + diff --git a/src/pages/login/Base.js b/src/pages/login/Base.js new file mode 100644 index 0000000..21d57f0 --- /dev/null +++ b/src/pages/login/Base.js @@ -0,0 +1,36 @@ +export default { + name: "Base", + props: {}, + data() { + return { + isAgree: false, + isOtherLogin: false, + showAnim: false, + showTooltip: false, + loading: false, + } + }, + computed: {}, + created() { + }, + methods: { + async check() { + return new Promise((resolve, reject) => { + if (this.isAgree) { + resolve(true) + } else { + if (!this.showAnim && !this.showTooltip) { + this.showAnim = true + setTimeout(() => { + this.showAnim = false + this.showTooltip = true + }, 500) + setTimeout(() => { + this.showTooltip = false + }, 3000) + } + } + }) + } + } +} \ No newline at end of file diff --git a/src/pages/login/Base.scss b/src/pages/login/Base.scss new file mode 100644 index 0000000..9b26073 --- /dev/null +++ b/src/pages/login/Base.scss @@ -0,0 +1,56 @@ +@import "../../assets/scss/index"; + +.content { + padding: 6rem 3rem; + //padding-top: 6rem; + + .desc { + margin-bottom: 2rem; + margin-top: 4rem; + display: flex; + align-items: flex-start; + flex-direction: column; + + .title { + font-weight: bold; + font-size: 2rem; + margin-bottom: 1rem; + } + + .sub-title { + font-size: 1.2rem; + color: $second-text-color; + } + } + + .notice { + margin-top: 1rem; + font-size: 1.3rem; + color: $primary-btn-color; + } + + .button { + margin-bottom: .5rem; + } + + .protocol { + position: relative; + color: gray; + margin-top: 2rem; + margin-bottom: 2rem; + font-size: 1.2rem; + display: flex; + + .left { + padding-top: .1rem; + margin-right: .5rem; + } + } + + .options { + font-size: 1.2rem; + margin-top: 2rem; + display: flex; + justify-content: space-between; + } +} \ No newline at end of file diff --git a/src/pages/login/OtherLogin.vue b/src/pages/login/OtherLogin.vue index 3ce6abf..836a68a 100644 --- a/src/pages/login/OtherLogin.vue +++ b/src/pages/login/OtherLogin.vue @@ -13,7 +13,7 @@ -
+
{{ notice }}
@@ -47,9 +47,11 @@ import Check from "../../components/Check"; import Tooltip from "./components/Tooltip"; import LoginInput from "./components/LoginInput"; +import Base from "./Base.js"; export default { name: "OtherLogin", + extends: Base, components: { Check, Tooltip, @@ -57,12 +59,7 @@ export default { }, data() { return { - isAgree: false, phone: '', - isOtherLogin: false, - showAnim: false, - showTooltip: false, - loading: false, notice: '' } }, @@ -70,23 +67,13 @@ export default { created() { }, methods: { - getCode() { - if (this.isAgree) { + async getCode() { + let res = await this.check() + if (res){ this.loading = true - setTimeout(()=>{ + setTimeout(() => { this.$nav('/login/verification-code') - },2000) - } else { - if (!this.showAnim && !this.showTooltip) { - this.showAnim = true - setTimeout(() => { - this.showAnim = false - this.showTooltip = true - }, 500) - setTimeout(() => { - this.showTooltip = false - }, 3000) - } + }, 2000) } } } @@ -95,6 +82,7 @@ export default { diff --git a/src/pages/login/PasswordLogin.vue b/src/pages/login/PasswordLogin.vue index 0ef3735..29dd966 100644 --- a/src/pages/login/PasswordLogin.vue +++ b/src/pages/login/PasswordLogin.vue @@ -6,14 +6,15 @@
-
+
手机号密码登录
-
+
+
@@ -26,13 +27,17 @@
+
+ {{ notice }} +
+ {{ loading ? '登录中' : '登录' }}
- 忘记了?找回密码 + 忘记了?找回密码
@@ -42,22 +47,23 @@ + + diff --git a/src/pages/login/VerificationCode.vue b/src/pages/login/VerificationCode.vue index 55444e3..39587de 100644 --- a/src/pages/login/VerificationCode.vue +++ b/src/pages/login/VerificationCode.vue @@ -6,7 +6,7 @@
-
+
请输入验证码
验证码已通过短信发送到+86 13800138000
@@ -17,7 +17,7 @@ v-model:isSendVerificationCode="isSendVerificationCode" @send="sendCode" /> -
+
收不到短信?获取语音验证码 @@ -27,21 +27,18 @@ {{ loading ? '登录中' : '登录' }} -