hy-app 0.1.4 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/hy-address-picker/hy-address-picker.vue +31 -10
- package/components/hy-address-picker/index.scss +1 -1
- package/components/hy-address-picker/props.ts +1 -3
- package/components/hy-address-picker/typing.d.ts +4 -11
- package/components/hy-avatar/hy-avatar.vue +11 -0
- package/components/hy-avatar/index.scss +8 -8
- package/components/hy-avatar/typing.d.ts +1 -1
- package/components/hy-back-top/hy-back-top.vue +27 -2
- package/components/hy-back-top/index.scss +11 -1
- package/components/hy-back-top/props.ts +1 -6
- package/components/hy-back-top/typing.d.ts +4 -7
- package/components/hy-badge/hy-badge.vue +11 -0
- package/components/hy-badge/index.scss +18 -40
- package/components/hy-badge/typing.d.ts +1 -1
- package/components/hy-button/hy-button.vue +44 -17
- package/components/hy-button/index.scss +25 -45
- package/components/hy-button/props.ts +1 -2
- package/components/hy-button/typing.d.ts +4 -7
- package/components/hy-calendar/header.vue +12 -12
- package/components/hy-calendar/hy-calendar.vue +11 -2
- package/components/hy-calendar/index.scss +140 -131
- package/components/hy-calendar/month.vue +18 -18
- package/components/hy-calendar/typing.d.ts +1 -1
- package/components/hy-card/hy-card.vue +11 -0
- package/components/hy-card/index.scss +12 -12
- package/components/hy-card/props.ts +2 -2
- package/components/hy-card/typing.d.ts +1 -1
- package/components/hy-cell/hy-cell.vue +57 -19
- package/components/hy-cell/index.scss +55 -28
- package/components/hy-cell/props.ts +4 -5
- package/components/hy-cell/typing.d.ts +11 -21
- package/components/hy-check-button/hy-check-button.vue +13 -2
- package/components/hy-check-button/index.scss +0 -5
- package/components/hy-check-button/typing.d.ts +1 -1
- package/components/hy-checkbox/hy-checkbox.vue +34 -10
- package/components/hy-checkbox/index.scss +15 -5
- package/components/hy-checkbox/props.ts +2 -3
- package/components/hy-checkbox/typing.d.ts +3 -3
- package/components/hy-config-provider/hy-config-provider.vue +52 -0
- package/components/hy-config-provider/index.scss +21 -0
- package/components/hy-config-provider/props.ts +13 -0
- package/components/hy-config-provider/typing.d.ts +28 -0
- package/components/hy-count-down/hy-count-down.vue +11 -0
- package/components/hy-count-down/index.scss +13 -1
- package/components/hy-count-down/typing.d.ts +1 -1
- package/components/hy-count-to/hy-count-to.vue +12 -1
- package/components/hy-count-to/index.scss +14 -1
- package/components/hy-count-to/props.ts +1 -1
- package/components/hy-count-to/typing.d.ts +1 -3
- package/components/hy-datetime-picker/hy-datetime-picker.vue +29 -14
- package/components/hy-datetime-picker/index.scss +1 -1
- package/components/hy-datetime-picker/props.ts +1 -3
- package/components/hy-datetime-picker/typing.d.ts +6 -13
- package/components/hy-divider/hy-divider.vue +11 -0
- package/components/hy-divider/index.scss +1 -1
- package/components/hy-divider/typing.d.ts +1 -1
- package/components/hy-dropdown/hy-dropdown.vue +13 -1
- package/components/hy-dropdown/index.scss +4 -1
- package/components/hy-dropdown/props.ts +2 -2
- package/components/hy-dropdown/typing.d.ts +1 -1
- package/components/hy-dropdown-item/hy-dropdown-item.vue +21 -3
- package/components/hy-dropdown-item/index.scss +35 -2
- package/components/hy-dropdown-item/typing.d.ts +1 -3
- package/components/hy-empty/hy-empty.vue +22 -10
- package/components/hy-empty/index.scss +17 -3
- package/components/hy-empty/props.ts +1 -5
- package/components/hy-empty/typing.d.ts +4 -19
- package/components/hy-float-button/hy-float-button.vue +11 -0
- package/components/hy-float-button/index.scss +13 -2
- package/components/hy-float-button/props.ts +3 -3
- package/components/hy-float-button/typing.d.ts +1 -1
- package/components/hy-folding-panel/hy-folding-panel.vue +11 -0
- package/components/hy-folding-panel/index.scss +4 -1
- package/components/hy-folding-panel/typing.d.ts +1 -1
- package/components/hy-form/hy-form.vue +214 -36
- package/components/hy-form/index.scss +13 -3
- package/components/hy-form/props.ts +0 -2
- package/components/hy-form/typing.d.ts +25 -7
- package/components/hy-grid/hy-grid.vue +27 -5
- package/components/hy-grid/index.scss +1 -1
- package/components/hy-grid/props.ts +1 -3
- package/components/hy-grid/typing.d.ts +13 -16
- package/components/hy-icon/hy-icon.vue +17 -10
- package/components/hy-icon/index.scss +16 -7
- package/components/hy-icon/props.ts +2 -2
- package/components/hy-icon/typing.d.ts +1 -1
- package/components/hy-image/hy-image.vue +11 -0
- package/components/hy-image/index.scss +4 -3
- package/components/hy-image/typing.d.ts +1 -1
- package/components/hy-input/hy-input.vue +58 -19
- package/components/hy-input/index.scss +12 -2
- package/components/hy-input/props.ts +3 -5
- package/components/hy-input/typing.d.ts +13 -12
- package/components/hy-line/hy-line.vue +11 -0
- package/components/hy-line/index.scss +4 -1
- package/components/hy-line/typing.d.ts +1 -1
- package/components/hy-line-progress/hy-line-progress.vue +17 -2
- package/components/hy-line-progress/index.scss +20 -8
- package/components/hy-line-progress/props.ts +4 -4
- package/components/hy-line-progress/typing.d.ts +5 -1
- package/components/hy-list/hy-list.vue +23 -8
- package/components/hy-list/index.scss +1 -4
- package/components/hy-list/typing.d.ts +1 -1
- package/components/hy-loading/hy-loading.vue +11 -0
- package/components/hy-loading/index.scss +2 -2
- package/components/hy-loading/typing.d.ts +1 -2
- package/components/hy-login/TheUserLogin.vue +63 -106
- package/components/hy-login/hy-login.vue +15 -10
- package/components/hy-login/props.ts +1 -1
- package/components/hy-login/typing.d.ts +6 -1
- package/components/hy-modal/hy-modal.vue +15 -7
- package/components/hy-modal/index.scss +19 -3
- package/components/hy-modal/typing.d.ts +1 -1
- package/components/hy-navbar/hy-navbar.vue +11 -0
- package/components/hy-navbar/index.scss +14 -3
- package/components/hy-navbar/props.ts +1 -1
- package/components/hy-navbar/typing.d.ts +1 -2
- package/components/hy-notice-bar/hy-notice-bar.vue +11 -0
- package/components/hy-notice-bar/index.scss +35 -35
- package/components/hy-notice-bar/typing.d.ts +1 -1
- package/components/hy-number-step/hy-number-step.vue +40 -18
- package/components/hy-number-step/index.scss +34 -25
- package/components/hy-number-step/props.ts +4 -4
- package/components/hy-number-step/typing.d.ts +8 -3
- package/components/hy-overlay/index.scss +3 -1
- package/components/hy-overlay/typing.d.ts +1 -1
- package/components/hy-parse/typing.d.ts +1 -1
- package/components/hy-picker/hy-picker.vue +30 -8
- package/components/hy-picker/index.scss +7 -3
- package/components/hy-picker/props.ts +2 -5
- package/components/hy-picker/typing.d.ts +4 -15
- package/components/hy-popup/hy-popup.vue +11 -0
- package/components/hy-popup/index.scss +10 -1
- package/components/hy-popup/typing.d.ts +1 -1
- package/components/hy-price/hy-price.vue +11 -0
- package/components/hy-price/index.scss +4 -1
- package/components/hy-price/typing.d.ts +1 -1
- package/components/hy-qrcode/hy-qrcode.vue +11 -0
- package/components/hy-qrcode/index.scss +4 -1
- package/components/hy-qrcode/typing.d.ts +1 -1
- package/components/hy-radio/hy-radio.vue +25 -5
- package/components/hy-radio/index.scss +17 -5
- package/components/hy-radio/props.ts +2 -3
- package/components/hy-radio/typing.d.ts +2 -2
- package/components/hy-rate/hy-rate.vue +11 -0
- package/components/hy-rate/index.scss +6 -6
- package/components/hy-rate/typing.d.ts +1 -1
- package/components/hy-read-more/hy-read-more.vue +23 -2
- package/components/hy-read-more/index.scss +29 -2
- package/components/hy-read-more/props.ts +2 -7
- package/components/hy-read-more/typing.d.ts +1 -1
- package/components/hy-scroll-list/hy-scroll-list.vue +31 -9
- package/components/hy-scroll-list/index.scss +10 -1
- package/components/hy-scroll-list/props.ts +2 -2
- package/components/hy-scroll-list/typing.d.ts +1 -1
- package/components/hy-search/hy-search.vue +23 -3
- package/components/hy-search/index.scss +25 -4
- package/components/hy-search/props.ts +3 -5
- package/components/hy-search/typing.d.ts +6 -13
- package/components/hy-slider/hy-slider.vue +11 -0
- package/components/hy-slider/index.scss +3 -2
- package/components/hy-slider/props.ts +1 -1
- package/components/hy-slider/typing.d.ts +1 -1
- package/components/hy-status-bar/typing.d.ts +1 -1
- package/components/hy-steps/hy-steps.vue +38 -20
- package/components/hy-steps/index.scss +57 -17
- package/components/hy-steps/props.ts +2 -2
- package/components/hy-steps/typing.d.ts +1 -1
- package/components/{hy-submitBar/hy-submitBar.vue → hy-submit-bar/hy-submit-bar.vue} +13 -34
- package/components/hy-submit-bar/index.scss +45 -0
- package/components/{hy-submitBar → hy-submit-bar}/typing.d.ts +1 -1
- package/components/hy-subsection/hy-subsection.vue +12 -0
- package/components/hy-subsection/index.scss +28 -8
- package/components/hy-subsection/props.ts +3 -3
- package/components/hy-subsection/typing.d.ts +1 -1
- package/components/hy-swipe-action/typing.d.ts +1 -1
- package/components/hy-swiper/hy-swiper.vue +11 -0
- package/components/hy-swiper/index.scss +13 -2
- package/components/hy-swiper/typing.d.ts +2 -5
- package/components/hy-switch/hy-switch.vue +28 -5
- package/components/hy-switch/index.scss +25 -7
- package/components/hy-switch/props.ts +1 -3
- package/components/hy-switch/typing.d.ts +6 -5
- package/components/hy-tabs/hy-tabs.vue +27 -15
- package/components/hy-tabs/index.scss +25 -4
- package/components/hy-tabs/props.ts +4 -10
- package/components/hy-tabs/typing.d.ts +1 -1
- package/components/hy-tag/hy-tag.vue +38 -22
- package/components/hy-tag/index.scss +27 -115
- package/components/hy-tag/props.ts +1 -2
- package/components/hy-tag/typing.d.ts +3 -10
- package/components/hy-text/hy-text.vue +12 -1
- package/components/hy-text/index.scss +20 -37
- package/components/hy-text/typing.d.ts +1 -1
- package/components/hy-textarea/hy-textarea.vue +17 -6
- package/components/hy-textarea/index.scss +16 -5
- package/components/hy-textarea/typing.d.ts +2 -2
- package/components/hy-toast/hy-toast.vue +13 -2
- package/components/hy-toast/index.scss +26 -26
- package/components/hy-toast/typing.d.ts +1 -1
- package/components/hy-tooltip/hy-tooltip.vue +11 -0
- package/components/hy-tooltip/index.scss +3 -3
- package/components/hy-tooltip/props.ts +1 -1
- package/components/hy-tooltip/typing.d.ts +1 -1
- package/components/hy-transition/typing.d.ts +1 -1
- package/components/hy-upload/hy-upload.vue +11 -0
- package/components/hy-upload/index.scss +12 -1
- package/components/hy-upload/typing.d.ts +1 -1
- package/components/hy-warn/hy-warn.vue +22 -11
- package/components/hy-warn/index.scss +46 -1
- package/components/hy-warn/typing.d.ts +1 -1
- package/components/hy-waterfall/hy-waterfall.vue +11 -0
- package/components/hy-waterfall/index.scss +1 -1
- package/components/hy-waterfall/typing.d.ts +1 -3
- package/components/index.ts +2 -2
- package/config/icon.ts +4 -0
- package/libs/css/common.scss +9 -0
- package/libs/css/mixin.scss +78 -0
- package/package.json +3 -3
- package/public/font/iconfont.css +3 -3
- package/store/userInfo.ts +26 -25
- package/theme.scss +76 -60
- package/typing/modules/common.d.ts +5 -1
- package/typing/modules/form.ts +29 -14
- package/utils/colorGradient.ts +1 -1
- package/utils/inside.ts +3 -0
- package/components/hy-submitBar/Index.vue +0 -17
- package/components/hy-submitBar/index.scss +0 -9
- /package/components/{hy-submitBar → hy-submit-bar}/props.ts +0 -0
|
@@ -66,16 +66,20 @@
|
|
|
66
66
|
|
|
67
67
|
<script lang="ts">
|
|
68
68
|
export default {
|
|
69
|
+
name: 'hy-list',
|
|
69
70
|
options: {
|
|
71
|
+
addGlobalClass: true,
|
|
70
72
|
virtualHost: true,
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
+
styleIsolation: 'shared'
|
|
74
|
+
}
|
|
75
|
+
}
|
|
73
76
|
</script>
|
|
74
77
|
|
|
75
78
|
<script lang="ts" setup>
|
|
76
79
|
import {
|
|
77
80
|
computed,
|
|
78
81
|
type CSSProperties,
|
|
82
|
+
getCurrentInstance,
|
|
79
83
|
nextTick,
|
|
80
84
|
onMounted,
|
|
81
85
|
reactive,
|
|
@@ -84,8 +88,7 @@ import {
|
|
|
84
88
|
useSlots,
|
|
85
89
|
watch,
|
|
86
90
|
} from "vue";
|
|
87
|
-
import { addUnit,
|
|
88
|
-
import HyDivider from "../hy-divider/hy-divider.vue";
|
|
91
|
+
import { addUnit, getPx, getRect } from "../../utils";
|
|
89
92
|
import type IProps from "./typing";
|
|
90
93
|
import defaultProps from "./props";
|
|
91
94
|
|
|
@@ -109,7 +112,10 @@ const slots = useSlots();
|
|
|
109
112
|
const scrollTop = ref(0);
|
|
110
113
|
// 可视区域的高度
|
|
111
114
|
const viewHeight = ref(0);
|
|
112
|
-
const waterfall: {
|
|
115
|
+
const waterfall: {
|
|
116
|
+
left: AnyObject[];
|
|
117
|
+
right: AnyObject[];
|
|
118
|
+
} = reactive({
|
|
113
119
|
left: [],
|
|
114
120
|
right: [],
|
|
115
121
|
});
|
|
@@ -117,10 +123,11 @@ const waterfall: { left: AnyObject[]; right: AnyObject[] } = reactive({
|
|
|
117
123
|
const arrange = computed(() => (line.value === 1 ? "column" : "row"));
|
|
118
124
|
const boxHeight = getPx(itemHeight.value) + getPx(marginBottom.value);
|
|
119
125
|
const listHeight = addUnit(containerHeight.value);
|
|
126
|
+
const instance = getCurrentInstance();
|
|
120
127
|
|
|
121
128
|
onMounted(() => {
|
|
122
129
|
nextTick(async () => {
|
|
123
|
-
const res = await getRect(".hy-virtual-container");
|
|
130
|
+
const res = await getRect(".hy-virtual-container", false, instance);
|
|
124
131
|
viewHeight.value = (res as UniApp.NodeInfo).height ?? 0;
|
|
125
132
|
});
|
|
126
133
|
});
|
|
@@ -178,9 +185,9 @@ watch(
|
|
|
178
185
|
if (line.value === 2 && newVal.every((item) => typeof item !== "string")) {
|
|
179
186
|
newVal.forEach((item, i) => {
|
|
180
187
|
if (i % 2 === 0) {
|
|
181
|
-
waterfall.left.push(item);
|
|
188
|
+
waterfall.left.push(item as AnyObject);
|
|
182
189
|
} else {
|
|
183
|
-
waterfall.right.push(item);
|
|
190
|
+
waterfall.right.push(item as AnyObject);
|
|
184
191
|
}
|
|
185
192
|
});
|
|
186
193
|
}
|
|
@@ -217,4 +224,12 @@ const slotDefault = useSlots().default;
|
|
|
217
224
|
|
|
218
225
|
<style lang="scss" scoped>
|
|
219
226
|
@import "./index.scss";
|
|
227
|
+
.hy-virtual-container {
|
|
228
|
+
height: v-bind(listHeight);
|
|
229
|
+
&__list {
|
|
230
|
+
padding: v-bind(paddingAttr);
|
|
231
|
+
display: flex;
|
|
232
|
+
flex-direction: v-bind(arrange);
|
|
233
|
+
}
|
|
234
|
+
}
|
|
220
235
|
</style>
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
@use "../../theme.scss" as *;
|
|
2
2
|
@use "../../libs/css/mixin.scss" as *;
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
height: v-bind(listHeight);
|
|
4
|
+
@include b(virtual-container) {
|
|
6
5
|
padding: 0 $hy-border-margin-padding-base;
|
|
7
6
|
box-sizing: border-box;
|
|
8
7
|
|
|
9
8
|
&__list {
|
|
10
|
-
padding: v-bind(paddingAttr);
|
|
11
|
-
@include flex(v-bind(arrange));
|
|
12
9
|
overflow-anchor: none;
|
|
13
10
|
&--item {
|
|
14
11
|
box-sizing: border-box;
|
|
@@ -46,6 +46,17 @@
|
|
|
46
46
|
</view>
|
|
47
47
|
</template>
|
|
48
48
|
|
|
49
|
+
<script lang="ts">
|
|
50
|
+
export default {
|
|
51
|
+
name: 'hy-loading',
|
|
52
|
+
options: {
|
|
53
|
+
addGlobalClass: true,
|
|
54
|
+
virtualHost: true,
|
|
55
|
+
styleIsolation: 'shared'
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
</script>
|
|
59
|
+
|
|
49
60
|
<script setup lang="ts">
|
|
50
61
|
import defaultProps from "./props";
|
|
51
62
|
import type IProps from "./typing";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
@use "../../libs/css/mixin.scss" as *;
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
@include b(loading-icon) {
|
|
6
6
|
@include flex(row);
|
|
7
7
|
align-items: center;
|
|
8
8
|
justify-content: center;
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
line-height: 1px;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
@include b(loading-icon) {
|
|
52
52
|
&__spinner--spinner {
|
|
53
53
|
animation-timing-function: steps(12);
|
|
54
54
|
}
|
|
@@ -1,71 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<view class="user-login">
|
|
3
|
-
<HyForm
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
border="bottom"
|
|
10
|
-
:customStyle="errorStyle"
|
|
11
|
-
@change="handleChange($event, record)"
|
|
12
|
-
@blur="handleBlur($event, record)"
|
|
13
|
-
>
|
|
14
|
-
<!-- #ifndef APP-PLUS-NVUE -->
|
|
15
|
-
<template #prefix>
|
|
16
|
-
<HyIcon :name="IconConfig.MINE" :color="themeColor"></HyIcon>
|
|
17
|
-
</template>
|
|
18
|
-
<template #suffix>
|
|
19
|
-
<HyIcon
|
|
20
|
-
:name="
|
|
21
|
-
!showChoice
|
|
22
|
-
? IconConfig.ARROW_DOWN_FILL
|
|
23
|
-
: IconConfig.ARROW_UP_FILL
|
|
24
|
-
"
|
|
25
|
-
@tap="showChoice = !showChoice"
|
|
26
|
-
:color="themeColor"
|
|
27
|
-
></HyIcon>
|
|
28
|
-
<view class="dialog-view" v-if="showChoice && choiceList.length">
|
|
29
|
-
<view
|
|
30
|
-
class="dialog-title"
|
|
31
|
-
v-for="(item, index) in choiceList"
|
|
32
|
-
:key="index"
|
|
33
|
-
@click="btnChoiceClick(index)"
|
|
34
|
-
>
|
|
35
|
-
{{ item.user }}
|
|
36
|
-
</view>
|
|
37
|
-
</view>
|
|
38
|
-
</template>
|
|
39
|
-
<!-- #endif -->
|
|
40
|
-
</HyInput>
|
|
41
|
-
</template>
|
|
42
|
-
<template #pwd="{ record }">
|
|
43
|
-
<HyInput
|
|
44
|
-
:type="showPwd ? 'text' : 'password'"
|
|
45
|
-
v-model="userForm.pwd"
|
|
46
|
-
:placeholder="pwdPlaceholder"
|
|
47
|
-
:clearable="true"
|
|
48
|
-
border="bottom"
|
|
49
|
-
:password-icon="false"
|
|
50
|
-
@change="handleChange($event, record)"
|
|
51
|
-
@blur="handleBlur($event, record)"
|
|
52
|
-
>
|
|
53
|
-
<!-- #ifndef APP-PLUS-NVUE -->
|
|
54
|
-
<template #prefix>
|
|
55
|
-
<HyIcon :name="IconConfig.LOCK" :color="themeColor"></HyIcon>
|
|
56
|
-
</template>
|
|
57
|
-
<template v-if="isShowPwd" #suffix>
|
|
58
|
-
<HyIcon
|
|
59
|
-
size="16"
|
|
60
|
-
@click="showPasswordFn"
|
|
61
|
-
color="#c8c9cc"
|
|
62
|
-
:name="showPwd ? 'eye-fill' : 'eye-off'"
|
|
63
|
-
></HyIcon>
|
|
64
|
-
</template>
|
|
65
|
-
<!-- #endif -->
|
|
66
|
-
</HyInput>
|
|
67
|
-
</template>
|
|
68
|
-
</HyForm>
|
|
3
|
+
<HyForm
|
|
4
|
+
ref="form_1Ref"
|
|
5
|
+
:columns="userColumns"
|
|
6
|
+
:formData="userForm"
|
|
7
|
+
:input="{ border: 'bottom' }"
|
|
8
|
+
></HyForm>
|
|
69
9
|
|
|
70
10
|
<!-- 记住密码 -->
|
|
71
11
|
<view class="mui-input-row mui-checkbox">
|
|
@@ -73,7 +13,7 @@
|
|
|
73
13
|
:columns="rememberList"
|
|
74
14
|
shape="square"
|
|
75
15
|
:active-color="themeColor"
|
|
76
|
-
v-model="
|
|
16
|
+
v-model="rememberPsw"
|
|
77
17
|
@change="checkboxChange"
|
|
78
18
|
></HyCheckbox>
|
|
79
19
|
</view>
|
|
@@ -81,20 +21,18 @@
|
|
|
81
21
|
</template>
|
|
82
22
|
|
|
83
23
|
<script setup lang="ts">
|
|
84
|
-
import { ref, reactive, onMounted } from "vue";
|
|
24
|
+
import { ref, reactive, onMounted, computed } from "vue";
|
|
85
25
|
import { onHide } from "@dcloudio/uni-app";
|
|
86
26
|
import { storeToRefs } from "pinia";
|
|
87
27
|
import { useUserInfo } from "../../store";
|
|
88
28
|
import { decryptData, encryptData } from "../../utils";
|
|
89
|
-
import type { FormColumnsType } from "../../typing";
|
|
90
29
|
import { FormTypeEnum } from "../../typing";
|
|
91
30
|
import { IconConfig } from "../../config";
|
|
31
|
+
import type { UserLoginInfoVo } from "./typing";
|
|
92
32
|
|
|
93
33
|
// 组件
|
|
94
34
|
import HyCheckbox from "../hy-checkbox/hy-checkbox.vue";
|
|
95
35
|
import HyForm from "../hy-form/hy-form.vue";
|
|
96
|
-
import HyInput from "../hy-input/hy-input.vue";
|
|
97
|
-
import HyIcon from "../hy-icon/hy-icon.vue";
|
|
98
36
|
|
|
99
37
|
interface IProps {
|
|
100
38
|
themeColor: string;
|
|
@@ -110,7 +48,7 @@ interface IProps {
|
|
|
110
48
|
|
|
111
49
|
const props = withDefaults(defineProps<IProps>(), {
|
|
112
50
|
themeColor: "",
|
|
113
|
-
prefix: "
|
|
51
|
+
prefix: "hy",
|
|
114
52
|
isShowPwd: false,
|
|
115
53
|
userPlaceholder: "",
|
|
116
54
|
pwdPlaceholder: "",
|
|
@@ -123,27 +61,60 @@ const emit = defineEmits(["handleHistory", "handleCheckbox"]);
|
|
|
123
61
|
const userInfoStore = useUserInfo();
|
|
124
62
|
const { userForm, choiceList, rememberPsw } = storeToRefs(userInfoStore);
|
|
125
63
|
|
|
126
|
-
const
|
|
64
|
+
const showChoice = ref<boolean>(false);
|
|
65
|
+
const showPwd = ref<boolean>(false);
|
|
66
|
+
const userColumns = computed(() => [
|
|
127
67
|
{
|
|
128
|
-
field: "
|
|
68
|
+
field: "userName",
|
|
129
69
|
label: "",
|
|
130
|
-
type: FormTypeEnum.
|
|
70
|
+
type: FormTypeEnum.TEXT,
|
|
71
|
+
input: {
|
|
72
|
+
clearable: true,
|
|
73
|
+
placeholder: props.userPlaceholder,
|
|
74
|
+
prefixIcon: {
|
|
75
|
+
name: IconConfig.MINE,
|
|
76
|
+
color: props.themeColor,
|
|
77
|
+
},
|
|
78
|
+
suffixIcon: {
|
|
79
|
+
name: showChoice.value
|
|
80
|
+
? IconConfig.ARROW_UP_FILL
|
|
81
|
+
: IconConfig.ARROW_DOWN_FILL,
|
|
82
|
+
color: props.themeColor,
|
|
83
|
+
},
|
|
84
|
+
onSuffix: () => {
|
|
85
|
+
showChoice.value = !showChoice.value;
|
|
86
|
+
},
|
|
87
|
+
},
|
|
131
88
|
rules: [props.customUserValidator, props.userNumValidator],
|
|
132
89
|
},
|
|
133
90
|
{
|
|
134
|
-
field: "
|
|
91
|
+
field: "password",
|
|
135
92
|
label: "",
|
|
136
|
-
type: FormTypeEnum.
|
|
93
|
+
type: showPwd.value ? FormTypeEnum.TEXT : FormTypeEnum.PASSWORD,
|
|
94
|
+
input: {
|
|
95
|
+
clearable: true,
|
|
96
|
+
placeholder: props.pwdPlaceholder,
|
|
97
|
+
prefixIcon: {
|
|
98
|
+
name: IconConfig.LOCK,
|
|
99
|
+
color: props.themeColor,
|
|
100
|
+
},
|
|
101
|
+
suffixIcon: {
|
|
102
|
+
name: showPwd.value ? IconConfig.EYE : IconConfig.EYE_CLOSE,
|
|
103
|
+
color: props.themeColor,
|
|
104
|
+
},
|
|
105
|
+
onSuffix: () => {
|
|
106
|
+
showPwd.value = !showPwd.value;
|
|
107
|
+
console.log(showChoice.value);
|
|
108
|
+
},
|
|
109
|
+
},
|
|
137
110
|
rules: [props.customUserValidator, props.pwdNumValidator],
|
|
138
111
|
},
|
|
139
112
|
]);
|
|
140
113
|
const rememberList = reactive([{ label: "记住密码", value: 1 }]);
|
|
141
|
-
const showPwd = ref<boolean>(false);
|
|
142
|
-
const showChoice = ref<boolean>(false);
|
|
143
114
|
const form_1Ref = ref<InstanceType<typeof HyForm>>();
|
|
144
115
|
// 效验用户名和密码
|
|
145
116
|
const userRules = reactive({
|
|
146
|
-
|
|
117
|
+
userName: [
|
|
147
118
|
{
|
|
148
119
|
required: true,
|
|
149
120
|
message: "请先输入账号",
|
|
@@ -153,7 +124,7 @@ const userRules = reactive({
|
|
|
153
124
|
props.customUserValidator,
|
|
154
125
|
props.userNumValidator,
|
|
155
126
|
],
|
|
156
|
-
|
|
127
|
+
password: [
|
|
157
128
|
{
|
|
158
129
|
required: true,
|
|
159
130
|
message: "请输入密码",
|
|
@@ -164,30 +135,27 @@ const userRules = reactive({
|
|
|
164
135
|
props.customPwdValidator,
|
|
165
136
|
],
|
|
166
137
|
});
|
|
167
|
-
const rememberPassword = ref(
|
|
138
|
+
const rememberPassword = ref(false);
|
|
168
139
|
const account = uni.getStorageSync(`${props.prefix}_account`);
|
|
169
140
|
const accountList = uni.getStorageSync(`${props.prefix}_choiceList`);
|
|
170
141
|
|
|
171
142
|
onMounted(() => {
|
|
172
143
|
if (!account) return;
|
|
173
144
|
const result = decryptData(account);
|
|
145
|
+
console.log(result);
|
|
174
146
|
//有缓存就赋值给文本没有就清空
|
|
175
|
-
rememberPsw.value = result
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
} else {
|
|
181
|
-
userForm.value.name = "";
|
|
182
|
-
userForm.value.pwd = "";
|
|
183
|
-
}
|
|
147
|
+
rememberPsw.value = result?.rememberPsw;
|
|
148
|
+
//获取缓存的账号和密码
|
|
149
|
+
userForm.value.userName = result?.userName;
|
|
150
|
+
userForm.value.password = result?.password;
|
|
151
|
+
|
|
184
152
|
if (accountList) {
|
|
185
|
-
choiceList.value = decryptData(accountList);
|
|
153
|
+
choiceList.value = decryptData(accountList) as UserLoginInfoVo[];
|
|
186
154
|
}
|
|
187
155
|
});
|
|
188
156
|
|
|
189
157
|
onHide(() => {
|
|
190
|
-
if (!account) return;
|
|
158
|
+
// if (!account) return;
|
|
191
159
|
//获取缓存的账号和密码
|
|
192
160
|
const { userName, password } = decryptData(account);
|
|
193
161
|
if (choiceList.value.length) {
|
|
@@ -222,7 +190,7 @@ onHide(() => {
|
|
|
222
190
|
const loginFn = () => {
|
|
223
191
|
return new Promise((resolve, reject) => {
|
|
224
192
|
form_1Ref.value
|
|
225
|
-
|
|
193
|
+
?.handleSubmit()
|
|
226
194
|
.then((res) => {
|
|
227
195
|
resolve("success" + res);
|
|
228
196
|
})
|
|
@@ -236,7 +204,7 @@ const loginFn = () => {
|
|
|
236
204
|
* 勾选是否记住密码
|
|
237
205
|
* */
|
|
238
206
|
const checkboxChange = () => {
|
|
239
|
-
emit("handleCheckbox",
|
|
207
|
+
emit("handleCheckbox", rememberPassword.value);
|
|
240
208
|
};
|
|
241
209
|
|
|
242
210
|
/**
|
|
@@ -269,17 +237,6 @@ const extensionFun = (index: number, username: string) => {
|
|
|
269
237
|
}
|
|
270
238
|
};
|
|
271
239
|
|
|
272
|
-
const showPasswordFn = () => {
|
|
273
|
-
showPwd.value = !showPwd.value;
|
|
274
|
-
};
|
|
275
|
-
|
|
276
|
-
const handleChange = (event: string, temp: FormColumnsType) => {
|
|
277
|
-
form_1Ref.value?.validateField(temp.rules, event, temp.field, "change");
|
|
278
|
-
};
|
|
279
|
-
const handleBlur = (event: string, temp: FormColumnsType) => {
|
|
280
|
-
form_1Ref.value?.validateField(temp.rules, event, temp.field, "blur");
|
|
281
|
-
};
|
|
282
|
-
|
|
283
240
|
defineExpose({
|
|
284
241
|
loginFn,
|
|
285
242
|
});
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
:customPwdValidator="props.customPwdValidator"
|
|
34
34
|
:userNumValidator="props.userNumValidator"
|
|
35
35
|
:pwdNumValidator="props.pwdNumValidator"
|
|
36
|
+
@handleCheckbox="handleCheckbox"
|
|
36
37
|
/>
|
|
37
38
|
<ThePhoneLogin
|
|
38
39
|
v-if="'phone' === indexCode(currentTab)"
|
|
@@ -120,8 +121,8 @@ const tabs = ref([
|
|
|
120
121
|
},
|
|
121
122
|
]);
|
|
122
123
|
const currentTab = ref(0);
|
|
123
|
-
const userLoginRef = ref<typeof TheUserLogin
|
|
124
|
-
const phoneLoginRef = ref<typeof ThePhoneLogin
|
|
124
|
+
const userLoginRef = ref<InstanceType<typeof TheUserLogin>>();
|
|
125
|
+
const phoneLoginRef = ref<InstanceType<typeof ThePhoneLogin>>();
|
|
125
126
|
watch(
|
|
126
127
|
() => Number(props.loginType),
|
|
127
128
|
(newVal) => {
|
|
@@ -146,17 +147,16 @@ const loginFn = async () => {
|
|
|
146
147
|
const type = await selectModel(currentTab.value);
|
|
147
148
|
switch (type) {
|
|
148
149
|
case "user":
|
|
149
|
-
let user = userForm.value.
|
|
150
|
-
let pwd = userForm.value.
|
|
151
|
-
await userLoginRef.value
|
|
150
|
+
// let user = userForm.value.userName;
|
|
151
|
+
// let pwd = userForm.value.password;
|
|
152
|
+
await userLoginRef.value?.loginFn();
|
|
152
153
|
//缓存账号和密码
|
|
153
|
-
if (rememberPsw.value
|
|
154
|
+
if (rememberPsw.value) {
|
|
154
155
|
uni.setStorageSync(
|
|
155
156
|
`${props.prefix}_account`,
|
|
156
157
|
encryptData({
|
|
157
158
|
rememberPsw: rememberPsw.value,
|
|
158
|
-
|
|
159
|
-
password: pwd,
|
|
159
|
+
...userForm.value,
|
|
160
160
|
}),
|
|
161
161
|
);
|
|
162
162
|
} else {
|
|
@@ -167,10 +167,10 @@ const loginFn = async () => {
|
|
|
167
167
|
encryptData({ rememberPsw: rememberPsw.value }),
|
|
168
168
|
);
|
|
169
169
|
}
|
|
170
|
-
emit("login",
|
|
170
|
+
emit("login", userForm.value);
|
|
171
171
|
break;
|
|
172
172
|
case "phone":
|
|
173
|
-
await phoneLoginRef.value
|
|
173
|
+
await phoneLoginRef.value?.loginFn();
|
|
174
174
|
break;
|
|
175
175
|
default:
|
|
176
176
|
break;
|
|
@@ -183,6 +183,11 @@ const loginFn = async () => {
|
|
|
183
183
|
const clickMenuFn = (index: number) => {
|
|
184
184
|
emit("handleClickMenu", index);
|
|
185
185
|
};
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* @description 记住密码
|
|
189
|
+
* */
|
|
190
|
+
const handleCheckbox = () => {};
|
|
186
191
|
</script>
|
|
187
192
|
|
|
188
193
|
<style lang="scss" scoped>
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
v-if="showConfirmButton && showCancelButton"
|
|
71
71
|
></view>
|
|
72
72
|
<view
|
|
73
|
-
class="hy-modal__button-group__wrapper
|
|
73
|
+
class="hy-modal__button-group__wrapper hy-modal__button-group__wrapper--confirm"
|
|
74
74
|
:hover-stay-time="150"
|
|
75
75
|
hover-class="hy-modal__button-group__wrapper--hover"
|
|
76
76
|
:class="[
|
|
@@ -81,14 +81,10 @@
|
|
|
81
81
|
v-if="showConfirmButton"
|
|
82
82
|
@tap="confirmHandler"
|
|
83
83
|
>
|
|
84
|
-
<
|
|
85
|
-
v-if="loading"
|
|
86
|
-
:name="IconConfig.LOADING"
|
|
87
|
-
:isRotate="loading"
|
|
88
|
-
></HyIcon>
|
|
84
|
+
<HyLoading v-if="loading"></HyLoading>
|
|
89
85
|
<text
|
|
90
86
|
v-else
|
|
91
|
-
class="hy-modal__button-group__wrapper__text"
|
|
87
|
+
class="hy-modal__button-group__wrapper__text hy-modal__button-group__wrapper--confirm-text"
|
|
92
88
|
:style="{
|
|
93
89
|
color: confirmColor,
|
|
94
90
|
}"
|
|
@@ -101,6 +97,17 @@
|
|
|
101
97
|
</HyPopup>
|
|
102
98
|
</template>
|
|
103
99
|
|
|
100
|
+
<script lang="ts">
|
|
101
|
+
export default {
|
|
102
|
+
name: "hy-modal",
|
|
103
|
+
options: {
|
|
104
|
+
addGlobalClass: true,
|
|
105
|
+
virtualHost: true,
|
|
106
|
+
styleIsolation: "shared",
|
|
107
|
+
},
|
|
108
|
+
};
|
|
109
|
+
</script>
|
|
110
|
+
|
|
104
111
|
<script setup lang="ts">
|
|
105
112
|
import { ref, toRefs, watch } from "vue";
|
|
106
113
|
import defaultProps from "./props";
|
|
@@ -111,6 +118,7 @@ import { IconConfig } from "../../config";
|
|
|
111
118
|
// 组件
|
|
112
119
|
import HyIcon from "../hy-icon/hy-icon.vue";
|
|
113
120
|
import HyPopup from "../hy-popup/hy-popup.vue";
|
|
121
|
+
import HyLoading from "../hy-loading/hy-loading.vue";
|
|
114
122
|
|
|
115
123
|
const props = withDefaults(defineProps<IProps>(), defaultProps);
|
|
116
124
|
const { show, asyncClose, closeOnClickOverlay } = toRefs(props);
|
|
@@ -1,7 +1,19 @@
|
|
|
1
1
|
@use "../../theme.scss" as *;
|
|
2
2
|
@use "../../libs/css/mixin.scss" as *;
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
/* 暗色主题 */
|
|
5
|
+
@include b(theme){
|
|
6
|
+
@include m(dark) {
|
|
7
|
+
@include b(modal) {
|
|
8
|
+
color: $hy-dark-color;
|
|
9
|
+
&__button-group__wrapper--hover {
|
|
10
|
+
background-color: $hy-dark-background--hover;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@include b(modal) {
|
|
5
17
|
width: 650rpx;
|
|
6
18
|
border-radius: $hy-border-radius-base;
|
|
7
19
|
overflow: hidden;
|
|
@@ -48,7 +60,7 @@
|
|
|
48
60
|
height: 48px;
|
|
49
61
|
|
|
50
62
|
&--line {
|
|
51
|
-
background: $hy-
|
|
63
|
+
background: $hy-border-color-light;
|
|
52
64
|
width: 1px;
|
|
53
65
|
height: 48px;
|
|
54
66
|
}
|
|
@@ -64,7 +76,7 @@
|
|
|
64
76
|
}
|
|
65
77
|
|
|
66
78
|
&--hover {
|
|
67
|
-
background-color: $hy-
|
|
79
|
+
background-color: $hy-light-background-hover;
|
|
68
80
|
}
|
|
69
81
|
|
|
70
82
|
&__text {
|
|
@@ -72,6 +84,10 @@
|
|
|
72
84
|
font-size: 16px;
|
|
73
85
|
text-align: center;
|
|
74
86
|
}
|
|
87
|
+
|
|
88
|
+
&--confirm-text {
|
|
89
|
+
color: $hy-primary;
|
|
90
|
+
}
|
|
75
91
|
}
|
|
76
92
|
}
|
|
77
93
|
}
|
|
@@ -82,6 +82,17 @@
|
|
|
82
82
|
</view>
|
|
83
83
|
</template>
|
|
84
84
|
|
|
85
|
+
<script lang="ts">
|
|
86
|
+
export default {
|
|
87
|
+
name: 'hy-navbar',
|
|
88
|
+
options: {
|
|
89
|
+
addGlobalClass: true,
|
|
90
|
+
virtualHost: true,
|
|
91
|
+
styleIsolation: 'shared'
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
</script>
|
|
95
|
+
|
|
85
96
|
<script setup lang="ts">
|
|
86
97
|
import defaultProps from "./props";
|
|
87
98
|
import type IProps from "./typing";
|
|
@@ -1,7 +1,19 @@
|
|
|
1
1
|
@use "../../theme.scss" as *;
|
|
2
2
|
@use "../../libs/css/mixin.scss" as *;
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
/* 暗色主题 */
|
|
5
|
+
@include b(theme){
|
|
6
|
+
@include m(dark) {
|
|
7
|
+
@include b(navbar) {
|
|
8
|
+
&__content {
|
|
9
|
+
color: $hy-dark-color;
|
|
10
|
+
background-color: $hy-dark-background;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@include b(navbar) {
|
|
5
17
|
&--fixed {
|
|
6
18
|
position: fixed;
|
|
7
19
|
left: 0;
|
|
@@ -14,7 +26,7 @@
|
|
|
14
26
|
@include flex(row);
|
|
15
27
|
align-items: center;
|
|
16
28
|
height: 44px;
|
|
17
|
-
background-color: #
|
|
29
|
+
background-color: #F8F8F8;
|
|
18
30
|
position: relative;
|
|
19
31
|
justify-content: center;
|
|
20
32
|
|
|
@@ -47,7 +59,6 @@
|
|
|
47
59
|
text-align: center;
|
|
48
60
|
&--title {
|
|
49
61
|
font-size: $hy-font-size-subtitle;
|
|
50
|
-
color: $hy-color-title;
|
|
51
62
|
}
|
|
52
63
|
&--sub {
|
|
53
64
|
font-size: $hy-font-size-hint;
|