From 8c740c14be602692594e03b528b1a729e2b11b4d Mon Sep 17 00:00:00 2001 From: pengYYYYY Date: Wed, 17 Nov 2021 19:20:07 +0800 Subject: [PATCH] feat: complate pages --- src/components/trend/index.vue | 2 +- src/pages/dashboard/detail/constants.ts | 44 ++++ src/pages/list/select/index.vue | 6 +- src/pages/list/tree/constants.ts | 86 +++++++ src/pages/login/components/Register.vue | 213 ++++++++++++++++ src/pages/login/index.less | 312 +++++++++--------------- src/utils/hooks.ts | 43 +++- 7 files changed, 499 insertions(+), 207 deletions(-) create mode 100644 src/pages/dashboard/detail/constants.ts create mode 100644 src/pages/list/tree/constants.ts create mode 100644 src/pages/login/components/Register.vue diff --git a/src/components/trend/index.vue b/src/components/trend/index.vue index 220dc0e..ad0e045 100644 --- a/src/components/trend/index.vue +++ b/src/components/trend/index.vue @@ -2,7 +2,7 @@ - + diff --git a/src/pages/list/tree/constants.ts b/src/pages/list/tree/constants.ts new file mode 100644 index 0000000..81b9cb3 --- /dev/null +++ b/src/pages/list/tree/constants.ts @@ -0,0 +1,86 @@ +export const TREE_DATA = [ + { + label: '深圳总部', + value: 0, + children: [ + { + label: '总办', + value: '0-0', + }, + { + label: '市场部', + value: '0-1', + children: [ + { + label: '采购1组', + value: '0-1-0', + }, + { + label: '采购2组', + value: '0-1-1', + }, + ], + }, + { + label: '技术部', + value: '0-2', + }, + ], + }, + { + label: '北京总部', + value: 1, + children: [ + { + label: '总办', + value: '1-0', + }, + { + label: '市场部', + value: '1-1', + children: [ + { + label: '采购1组', + value: '1-1-0', + }, + { + label: '采购2组', + value: '1-1-1', + }, + ], + }, + ], + }, + { + label: '上海总部', + value: 2, + children: [ + { + label: '市场部', + value: '2-0', + }, + { + label: '财务部', + value: '2-1', + children: [ + { + label: '财务1组', + value: '2-1-0', + }, + { + label: '财务2组', + value: '2-1-1', + }, + ], + }, + ], + }, + { + label: '湖南', + value: 3, + }, + { + label: '湖北', + value: 4, + }, +] \ No newline at end of file diff --git a/src/pages/login/components/Register.vue b/src/pages/login/components/Register.vue new file mode 100644 index 0000000..3c8bb0c --- /dev/null +++ b/src/pages/login/components/Register.vue @@ -0,0 +1,213 @@ +
+
+ + + + + + + + + + +
+ 我已阅读并同意 TDesign服务协议TDesign 隐私声明 +
+ + 注册 + +
+
+ 使用手机号注册 +
+
+ +
+
+ + + + + + + + + + +
+ + + {{ countDown == 0 ? '发送验证码' : `${countDown}秒后可重发` }} + +
+
+ 我已阅读并同意 TDesign服务协议TDesign 隐私声明 +
+ + 注册 + +
+
+ 使用邮箱注册 +
+
+ + + + + diff --git a/src/pages/login/index.less b/src/pages/login/index.less index 8d2fe1d..51da78c 100644 --- a/src/pages/login/index.less +++ b/src/pages/login/index.less @@ -46,121 +46,156 @@ } } -.login-step1 { +.item-container { .input-container { - margin-top: 72px; + margin-top: 64px; - .t-input { - display: block; + .tip-container { + margin-bottom: 16px; + + .tip1 { + font-size: 14px; + color: rgba(0,0,0,.60); + } + + .tip2 { + float: right; + font-size: 14px; + color: @brand-color-8; + + .t-icon { + height: 20px; + vertical-align: text-bottom; + } + } } - - .t-popup-reference { - margin: 24px 0; + + .button-container { + margin-top: 16px; } - } - - .check-container { - - .t-checkbox__label { - color: @text-color-secondary; - - span { + + .check-container { + font-size: 14px; + color: rgba(0,0,0,.60); + + .tip { + float: right; + font-size: 14px; color: @brand-color-8; } } } -} -.login-step3 { - - .input-container { - margin-top: 34px; + .t-input { + display: block; } -} -.input-container { + .check-container { + margin-top: 24px; + display: flex; + align-items: center; - .tip-container { - margin-bottom: 16px; - - .tip1 { - font-size: 14px; - color: rgba(0,0,0,.60); + .t-checkbox__label { + color: @text-color-secondary; } - .tip2 { - float: right; - font-size: 14px; + span { color: @brand-color-8; - .t-icon { - height: 20px; - vertical-align: text-bottom; + &:hover { + cursor: pointer; } } } - .button-container { - margin-top: 16px; + .t-popup-reference { + margin-top: 24px; } - .check-container { - font-size: 14px; - color: rgba(0,0,0,.60); + .verification-code { + margin-top: 24px; - .tip { - float: right; - font-size: 14px; - color: @brand-color-8; + .t-input { + display: inline-block; + } + + button { + width: 102px; + height: 40px; + margin-left: 11px; } } -} - -.login-step1 { .bottom-container { - margin-top: 72px; - } -} - -.login-step3 { - - .bottom-container { - margin-top: 32px; - } - - .input-container .tip-container { - width: 192px; - } -} - -.login-step2 { - - .input-container { - margin-top: 108.9px; - - .tip1 { + margin-top: 66px; + + .tip { + font-size: 14px; + color: @brand-color-8; cursor: pointer; } + + i { + font-style: normal; + color: @gray-color-3; + margin: 0 14px; + } } -} + -.bottom-container { - margin-top: 66px; + &.login-pwd { - .tip { - font-size: 14px; - color: @brand-color-8; - cursor: pointer; + .input-container { + margin-top: 72px; + } + + .bottom-container { + margin-top: 72px; + } + } + + &.login-qrcode { + + .input-container { + margin-top: 34px; + } + + .tip-container { + width: 192px; + + .refresh { + display: flex; + align-items: center; + + &:hover { + cursor: pointer; + } + } + } + + .bottom-container { + margin-top: 32px; + } } - i { - font-style: normal; - color: @gray-color-3; - margin: 0 14px; + &.login-phone { + + .bottom-container { + margin-top: 66px; + } } + &.register-phone { + + .input-container { + margin-top: 64px; + + .t-select-popup-reference { + margin: 0; + } + } + } } .rex-check { @@ -178,124 +213,3 @@ } } -.login-step4 { - - .input-container { - margin-top: 64px; - - .t-input { - display: block; - } - - .t-popup-reference { - margin: 24px 0; - } - - .verification-code { - margin-bottom: 24px; - - .t-input { - display: inline-block; - } - - button { - width: 102px; - height: 40px; - margin-left: 11px; - } - } - } - - .bottom-container { - margin-top: 66px; - } - - .check-container { - - .t-checkbox__label { - color: @text-color-secondary; - - span { - color: @brand-color-8; - } - } - } -} - -.login-step5 { - - .input-container { - margin-top: 64px; - - .t-input { - display: block; - } - - .t-popup-reference { - margin: 24px 0; - } - - .t-select-popup-reference { - margin: 0; - } - } - - .bottom-container { - margin-top: 66px; - } - - .check-container { - - .t-checkbox__label { - color: @text-color-secondary; - - span { - color: @brand-color-8; - } - } - } -} - -.login-step6 { - - .input-container { - margin-top: 64px; - - .t-input { - display: block; - } - - .t-popup-reference { - margin: 24px 0; - } - - .verification-code { - margin: 24px 0; - - .t-input { - display: inline-block; - } - - button { - width: 102px; - height: 40px; - margin-left: 11px; - } - } - } - - .bottom-container { - margin-top: 66px; - } - - .check-container { - - .t-checkbox__label { - color: @text-color-secondary; - - span { - color: @brand-color-8; - } - } - } -} \ No newline at end of file diff --git a/src/utils/hooks.ts b/src/utils/hooks.ts index f6b6d5b..818025d 100644 --- a/src/utils/hooks.ts +++ b/src/utils/hooks.ts @@ -1,9 +1,14 @@ -import { Ref, onUnmounted, onMounted } from 'vue'; +import { ref, Ref, onUnmounted, onMounted } from 'vue'; import * as echarts from 'echarts/core'; -export const useChart = (domId: string, chart: Ref) => { +/** + * eChart hook + * @param domId + * @param chart + */ +export const useChart = (domId: string) => { let chartContainer: HTMLCanvasElement; - const selfChart = chart; + const selfChart = ref(); const updateContainer = () => { selfChart.value.resize({ width: chartContainer.clientWidth, @@ -24,4 +29,34 @@ export const useChart = (domId: string, chart: Ref) => { onUnmounted(() => { window.removeEventListener('resize', updateContainer); }); -}; \ No newline at end of file + + return selfChart +}; + +/** + * counter utils + * @param duration + * @returns + */ +export const useCounter = (duration: number = 60): [ + Ref, () => void +] => { + let intervalTimer = null; + onMounted(() => { + clearInterval(intervalTimer) + }) + const countDown = ref(0); + + return [countDown, () => { + countDown.value = duration; + intervalTimer = setInterval(() => { + if (countDown.value > 0) { + countDown.value -= 1; + } else { + clearInterval(intervalTimer); + countDown.value = 0; + intervalTimer = null; + } + }, 1000) + }]; +} \ No newline at end of file