hy-app 0.1.1 → 0.1.3
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/README.md +1 -1
- package/api/http.ts +8 -8
- package/components/dialog/index.ts +2 -2
- package/components/hy-address-picker/hy-address-picker.vue +14 -42
- package/components/hy-address-picker/index.scss +27 -0
- package/components/hy-address-picker/props.ts +2 -3
- package/components/hy-address-picker/typing.d.ts +1 -2
- package/components/hy-avatar/hy-avatar.vue +10 -54
- package/components/hy-avatar/index.scss +45 -0
- package/components/hy-avatar/props.ts +2 -2
- package/components/hy-avatar/typing.d.ts +2 -2
- package/components/hy-back-top/hy-back-top.vue +7 -22
- package/components/hy-back-top/index.scss +16 -0
- package/components/hy-back-top/props.ts +4 -4
- package/components/hy-back-top/typing.d.ts +2 -3
- package/components/hy-badge/hy-badge.vue +5 -75
- package/components/hy-badge/index.scss +72 -0
- package/components/hy-badge/props.ts +2 -2
- package/components/hy-badge/typing.d.ts +2 -2
- package/components/hy-button/hy-button.vue +22 -134
- package/components/hy-button/index.scss +116 -0
- package/components/hy-button/props.ts +4 -5
- package/components/hy-button/typing.d.ts +3 -3
- package/components/hy-calendar/header.vue +76 -0
- package/components/hy-calendar/hy-calendar.vue +366 -0
- package/components/hy-calendar/index.scss +171 -0
- package/components/hy-calendar/month.vue +524 -0
- package/components/hy-calendar/props.ts +37 -0
- package/components/hy-calendar/typing.d.ts +126 -0
- package/components/hy-card/hy-card.vue +21 -84
- package/components/hy-card/index.scss +57 -0
- package/components/hy-card/props.ts +2 -2
- package/components/hy-card/typing.d.ts +1 -1
- package/components/hy-cell/hy-cell.vue +30 -131
- package/components/hy-cell/index.scss +137 -0
- package/components/hy-cell/props.ts +2 -2
- package/components/hy-cell/typing.d.ts +4 -3
- package/components/hy-check-button/hy-check-button.vue +14 -7
- package/components/hy-check-button/index.scss +5 -0
- package/components/hy-check-button/props.ts +3 -3
- package/components/hy-checkbox/hy-checkbox.vue +24 -107
- package/components/hy-checkbox/index.scss +94 -0
- package/components/hy-checkbox/props.ts +4 -5
- package/components/hy-checkbox/typing.d.ts +3 -7
- package/components/hy-count-down/hy-count-down.vue +150 -0
- package/components/hy-count-down/index.scss +6 -0
- package/components/hy-count-down/index.ts +52 -0
- package/components/hy-count-down/props.ts +10 -0
- package/components/hy-count-down/typing.d.ts +20 -0
- package/components/hy-count-to/hy-count-to.vue +213 -0
- package/components/hy-count-to/index.scss +6 -0
- package/components/hy-count-to/props.ts +17 -0
- package/components/hy-count-to/typing.d.ts +48 -0
- package/components/hy-datetime-picker/hy-datetime-picker.vue +38 -64
- package/components/hy-datetime-picker/index.scss +28 -0
- package/components/hy-datetime-picker/props.ts +2 -2
- package/components/hy-datetime-picker/typing.d.ts +1 -1
- package/components/hy-divider/hy-divider.vue +24 -49
- package/components/hy-divider/index.scss +25 -0
- package/components/hy-divider/props.ts +2 -2
- package/components/hy-divider/typing.d.ts +1 -1
- package/components/hy-dropdown/hy-dropdown.vue +43 -0
- package/components/hy-dropdown/index.scss +17 -0
- package/components/hy-dropdown/props.ts +17 -0
- package/components/hy-dropdown/typing.d.ts +48 -0
- package/components/hy-dropdown-item/hy-dropdown-item.vue +194 -0
- package/components/hy-dropdown-item/index.scss +96 -0
- package/components/hy-dropdown-item/props.ts +10 -0
- package/components/hy-dropdown-item/typing.d.ts +31 -0
- package/components/hy-empty/hy-empty.vue +8 -26
- package/components/hy-empty/index.scss +19 -0
- package/components/hy-empty/props.ts +2 -2
- package/components/hy-empty/typing.d.ts +1 -1
- package/components/hy-float-button/hy-float-button.vue +201 -0
- package/components/hy-float-button/index.scss +69 -0
- package/components/hy-float-button/props.ts +25 -0
- package/components/hy-float-button/typing.d.ts +93 -0
- package/components/hy-folding-panel/hy-folding-panel.vue +9 -12
- package/components/hy-folding-panel/index.scss +6 -0
- package/components/hy-folding-panel/props.ts +2 -2
- package/components/hy-folding-panel/typing.d.ts +2 -2
- package/components/hy-form/hy-form.vue +22 -39
- package/components/hy-form/index.scss +30 -0
- package/components/hy-form/props.ts +4 -2
- package/components/hy-form/typing.d.ts +10 -2
- package/components/hy-grid/hy-grid.vue +4 -45
- package/components/hy-grid/index.scss +40 -0
- package/components/hy-grid/props.ts +5 -5
- package/components/hy-grid/typing.d.ts +2 -2
- package/components/hy-icon/hy-icon.vue +7 -97
- package/components/hy-icon/index.scss +84 -0
- package/components/hy-icon/props.ts +5 -5
- package/components/hy-image/hy-image.vue +212 -0
- package/components/hy-image/index.scss +26 -0
- package/components/hy-image/props.ts +24 -0
- package/components/hy-image/typing.d.ts +76 -0
- package/components/hy-input/hy-input.vue +11 -82
- package/components/hy-input/index.scss +65 -0
- package/components/hy-input/props.ts +2 -2
- package/components/hy-input/typing.d.ts +2 -2
- package/components/hy-line/hy-line.vue +4 -8
- package/components/hy-line/index.scss +5 -0
- package/components/hy-line/props.ts +3 -3
- package/components/hy-line/typing.d.ts +2 -2
- package/components/hy-line-progress/hy-line-progress.vue +15 -44
- package/components/hy-line-progress/index.scss +38 -0
- package/components/hy-line-progress/props.ts +2 -2
- package/components/hy-line-progress/typing.d.ts +1 -1
- package/components/hy-list/hy-list.vue +11 -41
- package/components/hy-list/index.scss +32 -0
- package/components/hy-list/props.ts +2 -2
- package/components/hy-loading/hy-loading.vue +95 -0
- package/components/hy-loading/index.scss +103 -0
- package/components/hy-loading/props.ts +17 -0
- package/components/hy-loading/typing.d.ts +52 -0
- package/components/hy-login/TheUserLogin.vue +16 -16
- package/components/hy-login/hy-login.vue +9 -9
- package/components/hy-login/props.ts +4 -4
- package/components/hy-modal/hy-modal.vue +11 -89
- package/components/hy-modal/index.scss +77 -0
- package/components/hy-modal/props.ts +2 -2
- package/components/hy-modal/typing.d.ts +1 -1
- package/components/hy-navbar/hy-navbar.vue +20 -92
- package/components/hy-navbar/index.scss +67 -0
- package/components/hy-navbar/props.ts +2 -2
- package/components/hy-navbar/typing.d.ts +1 -1
- package/components/hy-notice-bar/hy-column-notice.vue +11 -39
- package/components/hy-notice-bar/hy-notice-bar.vue +10 -12
- package/components/hy-notice-bar/hy-row-notice.vue +5 -56
- package/components/hy-notice-bar/index.scss +93 -0
- package/components/hy-notice-bar/props.ts +4 -2
- package/components/hy-notice-bar/typing.d.ts +13 -3
- package/components/hy-number-step/hy-number-step.vue +55 -105
- package/components/hy-number-step/index.scss +71 -0
- package/components/hy-number-step/props.ts +2 -2
- package/components/hy-number-step/typing.d.ts +1 -1
- package/components/hy-overlay/hy-overlay.vue +5 -17
- package/components/hy-overlay/index.scss +9 -0
- package/components/hy-overlay/props.ts +2 -2
- package/components/hy-overlay/typing.d.ts +1 -1
- package/components/hy-picker/hy-picker.vue +21 -87
- package/components/hy-picker/index.scss +68 -0
- package/components/hy-picker/props.ts +3 -2
- package/components/hy-picker/typing.d.ts +5 -1
- package/components/hy-popup/hy-popup.vue +7 -80
- package/components/hy-popup/index.scss +60 -0
- package/components/hy-popup/props.ts +2 -2
- package/components/hy-popup/typing.d.ts +1 -1
- package/components/hy-price/hy-price.vue +5 -15
- package/components/hy-price/index.scss +11 -0
- package/components/hy-price/props.ts +2 -2
- package/components/hy-price/typing.d.ts +1 -1
- package/components/hy-qrcode/hy-qrcode.vue +15 -37
- package/components/hy-qrcode/index.scss +23 -0
- package/components/hy-qrcode/props.ts +2 -2
- package/components/hy-qrcode/typing.d.ts +2 -2
- package/components/hy-radio/hy-radio.vue +27 -113
- package/components/hy-radio/index.scss +93 -0
- package/components/hy-radio/props.ts +4 -4
- package/components/hy-radio/typing.d.ts +2 -2
- package/components/hy-rate/hy-rate.vue +33 -53
- package/components/hy-rate/index.scss +33 -0
- package/components/hy-rate/props.ts +4 -3
- package/components/hy-rate/typing.d.ts +1 -1
- package/components/hy-read-more/hy-read-more.vue +7 -30
- package/components/hy-read-more/index.scss +25 -0
- package/components/hy-read-more/props.ts +3 -3
- package/components/hy-read-more/typing.d.ts +1 -1
- package/components/hy-safe-bottom/hy-safe-bottom.vue +5 -9
- package/components/hy-safe-bottom/index.scss +5 -0
- package/components/hy-scroll-list/hy-scroll-list.vue +13 -43
- package/components/hy-scroll-list/index.scss +34 -0
- 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 +12 -94
- package/components/hy-search/index.scss +83 -0
- package/components/hy-search/props.ts +2 -2
- package/components/hy-search/typing.d.ts +1 -2
- package/components/hy-slider/hy-slider.vue +42 -119
- package/components/hy-slider/index.scss +77 -0
- package/components/hy-slider/props.ts +2 -2
- package/components/hy-status-bar/hy-status-bar.vue +41 -0
- package/components/hy-status-bar/index.scss +6 -0
- package/components/hy-status-bar/props.ts +8 -0
- package/components/hy-status-bar/typing.d.ts +12 -0
- package/components/hy-steps/hy-steps.vue +36 -163
- package/components/hy-steps/index.scss +131 -0
- package/components/hy-steps/props.ts +2 -2
- package/components/hy-steps/typing.d.ts +2 -2
- package/components/hy-subsection/hy-subsection.vue +62 -125
- package/components/hy-subsection/index.scss +82 -0
- package/components/hy-subsection/props.ts +7 -3
- package/components/hy-subsection/typing.d.ts +20 -8
- package/components/hy-swipe-action/hy-swipe-action.vue +294 -0
- package/components/hy-swipe-action/index.scss +9 -0
- package/components/hy-swipe-action/index.wxs +235 -0
- package/components/hy-swipe-action/props.ts +16 -0
- package/components/hy-swipe-action/typing.d.ts +55 -0
- package/components/hy-swipe-action/wxs.js +15 -0
- package/components/hy-swiper/hy-swiper-indicator.vue +5 -35
- package/components/hy-swiper/hy-swiper.vue +45 -65
- package/components/hy-swiper/index.scss +82 -0
- package/components/hy-swiper/props.ts +3 -3
- package/components/hy-swiper/typing.d.ts +7 -4
- package/components/hy-switch/hy-switch.vue +65 -68
- package/components/hy-switch/index.scss +46 -0
- package/components/hy-switch/props.ts +6 -3
- package/components/hy-switch/typing.d.ts +14 -1
- package/components/hy-tabs/hy-tabs.vue +22 -81
- package/components/hy-tabs/index.scss +63 -0
- package/components/hy-tabs/props.ts +5 -5
- package/components/hy-tabs/typing.d.ts +1 -1
- package/components/hy-tag/hy-tag.vue +15 -230
- package/components/hy-tag/index.scss +204 -0
- package/components/hy-tag/props.ts +2 -2
- package/components/hy-tag/typing.d.ts +2 -2
- package/components/hy-text/hy-text.vue +238 -0
- package/components/hy-text/index.scss +70 -0
- package/components/hy-text/index.ts +0 -0
- package/components/hy-text/props.ts +30 -0
- package/components/hy-text/typing.d.ts +98 -0
- package/components/hy-textarea/hy-textarea.vue +13 -51
- package/components/hy-textarea/index.scss +40 -0
- package/components/hy-textarea/props.ts +2 -2
- package/components/hy-textarea/typing.d.ts +1 -1
- package/components/hy-tooltip/hy-tooltip.vue +42 -95
- package/components/hy-tooltip/index.scss +64 -0
- package/components/hy-tooltip/props.ts +2 -2
- package/components/hy-tooltip/typing.d.ts +1 -1
- package/components/hy-transition/hy-transition.vue +17 -8
- package/components/hy-transition/props.ts +2 -2
- package/components/hy-transition/typing.d.ts +2 -14
- package/components/hy-upload/hy-upload.vue +37 -182
- package/components/hy-upload/index.scss +147 -0
- package/components/hy-upload/props.ts +2 -2
- package/components/hy-upload/typing.d.ts +11 -11
- package/components/hy-warn/hy-warn.vue +15 -123
- package/components/hy-warn/index.scss +109 -0
- package/components/hy-warn/props.ts +3 -3
- package/components/hy-warn/typing.d.ts +4 -3
- package/components/hy-waterfall/index.scss +82 -0
- package/components/index.ts +25 -1
- package/components/message/index.ts +54 -54
- package/config/color.ts +2 -1
- package/global/index.ts +6 -6
- package/global/register-properties.ts +2 -2
- package/index.scss +2 -0
- package/libs/css/common.scss +16 -0
- package/package.json +4 -4
- package/{libs/css → public/font}/iconfont.css +5 -5
- package/{libs/css → public/font}/iconfont.ttf +0 -0
- package/public/font/iconfont.woff +0 -0
- package/public/font/iconfont.woff2 +0 -0
- package/theme.scss +9 -7
- package/typing/index.ts +0 -1
- package/typing/modules/common.d.ts +66 -1
- package/typing/modules/form.ts +3 -3
- package/utils/calendar.js +1021 -0
- package/utils/colorGradient.ts +112 -0
- package/utils/index.ts +2 -0
- package/utils/inside.ts +80 -34
- package/utils/inspect.ts +66 -0
- package/utils/utils.ts +27 -19
- package/typing/modules/img.ts +0 -15
|
@@ -67,26 +67,26 @@
|
|
|
67
67
|
<script lang="ts">
|
|
68
68
|
export default {
|
|
69
69
|
options: {
|
|
70
|
-
virtualHost: true
|
|
71
|
-
}
|
|
70
|
+
virtualHost: true,
|
|
71
|
+
},
|
|
72
72
|
};
|
|
73
73
|
</script>
|
|
74
74
|
|
|
75
75
|
<script lang="ts" setup>
|
|
76
76
|
import {
|
|
77
77
|
computed,
|
|
78
|
-
CSSProperties,
|
|
78
|
+
type CSSProperties,
|
|
79
79
|
nextTick,
|
|
80
80
|
onMounted,
|
|
81
81
|
reactive,
|
|
82
82
|
ref,
|
|
83
83
|
toRefs,
|
|
84
84
|
useSlots,
|
|
85
|
-
watch
|
|
85
|
+
watch,
|
|
86
86
|
} from "vue";
|
|
87
87
|
import { addUnit, debounce, getPx, getRect } from "../../utils";
|
|
88
88
|
import HyDivider from "../hy-divider/hy-divider.vue";
|
|
89
|
-
import IProps from "./typing";
|
|
89
|
+
import type IProps from "./typing";
|
|
90
90
|
import defaultProps from "./props";
|
|
91
91
|
|
|
92
92
|
const props = withDefaults(defineProps<IProps>(), defaultProps);
|
|
@@ -100,7 +100,7 @@ const {
|
|
|
100
100
|
padding,
|
|
101
101
|
borderRadius,
|
|
102
102
|
background,
|
|
103
|
-
border
|
|
103
|
+
border,
|
|
104
104
|
} = toRefs(props);
|
|
105
105
|
const emit = defineEmits(["scrollButton", "click"]);
|
|
106
106
|
|
|
@@ -111,7 +111,7 @@ const scrollTop = ref(0);
|
|
|
111
111
|
const viewHeight = ref(0);
|
|
112
112
|
const waterfall: { left: AnyObject[]; right: AnyObject[] } = reactive({
|
|
113
113
|
left: [],
|
|
114
|
-
right: []
|
|
114
|
+
right: [],
|
|
115
115
|
});
|
|
116
116
|
// 排列方式
|
|
117
117
|
const arrange = computed(() => (line.value === 1 ? "column" : "row"));
|
|
@@ -132,7 +132,7 @@ const itemStyle = computed((): CSSProperties => {
|
|
|
132
132
|
marginBottom: addUnit(marginBottom.value),
|
|
133
133
|
borderRadius: addUnit(borderRadius.value),
|
|
134
134
|
background: background.value,
|
|
135
|
-
border: border.value ? "1px solid #dadbde" : ""
|
|
135
|
+
border: border.value ? "1px solid #dadbde" : "",
|
|
136
136
|
};
|
|
137
137
|
});
|
|
138
138
|
|
|
@@ -149,7 +149,7 @@ const start = computed(() => {
|
|
|
149
149
|
*/
|
|
150
150
|
const over = computed(() => {
|
|
151
151
|
const o = Math.floor(
|
|
152
|
-
(scrollTop.value + viewHeight.value + 1) / boxHeight + 5
|
|
152
|
+
(scrollTop.value + viewHeight.value + 1) / boxHeight + 5,
|
|
153
153
|
);
|
|
154
154
|
return Math.min(list.value.length, o * line.value);
|
|
155
155
|
});
|
|
@@ -185,7 +185,7 @@ watch(
|
|
|
185
185
|
});
|
|
186
186
|
}
|
|
187
187
|
},
|
|
188
|
-
{ immediate: true, deep: true }
|
|
188
|
+
{ immediate: true, deep: true },
|
|
189
189
|
);
|
|
190
190
|
|
|
191
191
|
/**
|
|
@@ -216,35 +216,5 @@ const slotDefault = useSlots().default;
|
|
|
216
216
|
</script>
|
|
217
217
|
|
|
218
218
|
<style lang="scss" scoped>
|
|
219
|
-
@import "
|
|
220
|
-
@import "../../libs/css/mixin.scss";
|
|
221
|
-
.hy-virtual-container {
|
|
222
|
-
height: v-bind(listHeight);
|
|
223
|
-
padding: 0 $hy-border-margin-padding-base;
|
|
224
|
-
box-sizing: border-box;
|
|
225
|
-
|
|
226
|
-
&__list {
|
|
227
|
-
padding: v-bind(paddingAttr);
|
|
228
|
-
@include flex(v-bind(arrange));
|
|
229
|
-
overflow-anchor: none;
|
|
230
|
-
&--item {
|
|
231
|
-
box-sizing: border-box;
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
&--left {
|
|
235
|
-
margin-right: $hy-border-margin-padding-base;
|
|
236
|
-
}
|
|
237
|
-
&--box {
|
|
238
|
-
box-sizing: border-box;
|
|
239
|
-
width: 50%;
|
|
240
|
-
display: flex;
|
|
241
|
-
flex-direction: column;
|
|
242
|
-
&-item {
|
|
243
|
-
box-sizing: border-box;
|
|
244
|
-
position: relative;
|
|
245
|
-
overflow: hidden;
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
}
|
|
219
|
+
@import "./index.scss";
|
|
250
220
|
</style>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
@use "../../theme.scss" as *;
|
|
2
|
+
@use "../../libs/css/mixin.scss" as *;
|
|
3
|
+
|
|
4
|
+
.hy-virtual-container {
|
|
5
|
+
height: v-bind(listHeight);
|
|
6
|
+
padding: 0 $hy-border-margin-padding-base;
|
|
7
|
+
box-sizing: border-box;
|
|
8
|
+
|
|
9
|
+
&__list {
|
|
10
|
+
padding: v-bind(paddingAttr);
|
|
11
|
+
@include flex(v-bind(arrange));
|
|
12
|
+
overflow-anchor: none;
|
|
13
|
+
&--item {
|
|
14
|
+
box-sizing: border-box;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
&--left {
|
|
18
|
+
margin-right: $hy-border-margin-padding-base;
|
|
19
|
+
}
|
|
20
|
+
&--box {
|
|
21
|
+
box-sizing: border-box;
|
|
22
|
+
width: 50%;
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-direction: column;
|
|
25
|
+
&-item {
|
|
26
|
+
box-sizing: border-box;
|
|
27
|
+
position: relative;
|
|
28
|
+
overflow: hidden;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import IProps from "./typing";
|
|
1
|
+
import type IProps from "./typing";
|
|
2
2
|
|
|
3
3
|
const defaultProps: IProps = {
|
|
4
4
|
list: [],
|
|
@@ -12,7 +12,7 @@ const defaultProps: IProps = {
|
|
|
12
12
|
line: 1,
|
|
13
13
|
keyField: "id",
|
|
14
14
|
load: "loadMore",
|
|
15
|
-
showDivider: true
|
|
15
|
+
showDivider: true,
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
export default defaultProps;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view
|
|
3
|
+
class="hy-loading-icon"
|
|
4
|
+
:style="customStyle"
|
|
5
|
+
:class="[vertical && 'hy-loading-icon--vertical']"
|
|
6
|
+
v-if="show"
|
|
7
|
+
>
|
|
8
|
+
<view
|
|
9
|
+
v-if="!webviewHide"
|
|
10
|
+
class="hy-loading-icon__spinner"
|
|
11
|
+
:class="[`hy-loading-icon__spinner--${mode}`]"
|
|
12
|
+
ref="ani"
|
|
13
|
+
:style="{
|
|
14
|
+
color: color,
|
|
15
|
+
width: addUnit(size),
|
|
16
|
+
height: addUnit(size),
|
|
17
|
+
borderTopColor: color,
|
|
18
|
+
borderBottomColor: otherBorderColor,
|
|
19
|
+
borderLeftColor: otherBorderColor,
|
|
20
|
+
borderRightColor: otherBorderColor,
|
|
21
|
+
'animation-duration': `${duration}ms`,
|
|
22
|
+
'animation-timing-function':
|
|
23
|
+
mode === 'semicircle' || mode === 'circle' ? timingFunction : '',
|
|
24
|
+
}"
|
|
25
|
+
>
|
|
26
|
+
<block v-if="mode === 'spinner'">
|
|
27
|
+
<!-- #ifndef APP-NVUE -->
|
|
28
|
+
<view
|
|
29
|
+
v-for="(item, index) in array12"
|
|
30
|
+
:key="index"
|
|
31
|
+
class="hy-loading-icon__dot"
|
|
32
|
+
>
|
|
33
|
+
</view>
|
|
34
|
+
<!-- #endif -->
|
|
35
|
+
</block>
|
|
36
|
+
</view>
|
|
37
|
+
<text
|
|
38
|
+
v-if="text"
|
|
39
|
+
class="hy-loading-icon__text"
|
|
40
|
+
:style="{
|
|
41
|
+
fontSize: addUnit(textSize),
|
|
42
|
+
color: textColor,
|
|
43
|
+
}"
|
|
44
|
+
>{{ text }}</text
|
|
45
|
+
>
|
|
46
|
+
</view>
|
|
47
|
+
</template>
|
|
48
|
+
|
|
49
|
+
<script setup lang="ts">
|
|
50
|
+
import defaultProps from "./props";
|
|
51
|
+
import type IProps from "./typing";
|
|
52
|
+
import { toRefs, ref, computed } from "vue";
|
|
53
|
+
import { addUnit, colorGradient } from "../../utils";
|
|
54
|
+
|
|
55
|
+
const props = withDefaults(defineProps<IProps>(), defaultProps);
|
|
56
|
+
const { show, size, color, mode, inactiveColor } = toRefs(props);
|
|
57
|
+
const emit = defineEmits(["update:modelValue", "change"]);
|
|
58
|
+
|
|
59
|
+
//动画旋转角度
|
|
60
|
+
const aniAngel = ref(360);
|
|
61
|
+
const array12 = Array.from({
|
|
62
|
+
length: 12,
|
|
63
|
+
});
|
|
64
|
+
const webviewHide = ref(false);
|
|
65
|
+
|
|
66
|
+
const otherBorderColor = computed(() => {
|
|
67
|
+
const lightColor = colorGradient(color.value, "#ffffff", 100)[80];
|
|
68
|
+
if (mode.value === "circle") {
|
|
69
|
+
return inactiveColor.value ? inactiveColor.value : lightColor;
|
|
70
|
+
} else {
|
|
71
|
+
return "transparent";
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
// 监听webview的显示与隐藏
|
|
76
|
+
// const addEventListenerToWebview = () => {
|
|
77
|
+
// // webview的堆栈
|
|
78
|
+
// const pages = getCurrentPages()
|
|
79
|
+
// // 当前页面
|
|
80
|
+
// const page = pages[pages.length - 1]
|
|
81
|
+
// // 当前页面的webview实例
|
|
82
|
+
// const currentWebview = page.$getAppWebview()
|
|
83
|
+
// // 监听webview的显示与隐藏,从而停止或者开始动画(为了性能)
|
|
84
|
+
// currentWebview.addEventListener('hide', () => {
|
|
85
|
+
// webviewHide.value = true
|
|
86
|
+
// })
|
|
87
|
+
// currentWebview.addEventListener('show', () => {
|
|
88
|
+
// webviewHide.value = false
|
|
89
|
+
// })
|
|
90
|
+
// }
|
|
91
|
+
</script>
|
|
92
|
+
|
|
93
|
+
<style lang="scss" scoped>
|
|
94
|
+
@import "./index.scss";
|
|
95
|
+
</style>
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
@use "../../theme.scss" as *;
|
|
2
|
+
@use "../../libs/css/mixin.scss" as *;
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
.hy-loading-icon {
|
|
6
|
+
@include flex(row);
|
|
7
|
+
align-items: center;
|
|
8
|
+
justify-content: center;
|
|
9
|
+
color: #c8c9cc;
|
|
10
|
+
|
|
11
|
+
&__text {
|
|
12
|
+
margin-left: 4px;
|
|
13
|
+
color: $hy-text-color-grey;
|
|
14
|
+
font-size: 14px;
|
|
15
|
+
line-height: 20px;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
&__spinner {
|
|
19
|
+
width: 30px;
|
|
20
|
+
height: 30px;
|
|
21
|
+
position: relative;
|
|
22
|
+
/* #ifndef APP-NVUE */
|
|
23
|
+
box-sizing: border-box;
|
|
24
|
+
max-width: 100%;
|
|
25
|
+
max-height: 100%;
|
|
26
|
+
animation: hy-rotate 1s linear infinite;
|
|
27
|
+
/* #endif */
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&__spinner--semicircle {
|
|
31
|
+
border: 2px solid transparent;
|
|
32
|
+
border-radius: 50%;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&__spinner--circle {
|
|
36
|
+
border-radius: 50%;
|
|
37
|
+
border: 2px solid #e5e5e5;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&--vertical {
|
|
41
|
+
flex-direction: column;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/* #ifndef APP-NVUE */
|
|
46
|
+
:host {
|
|
47
|
+
font-size: 0;
|
|
48
|
+
line-height: 1px;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.hy-loading-icon {
|
|
52
|
+
&__spinner--spinner {
|
|
53
|
+
animation-timing-function: steps(12);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
&__text:empty {
|
|
57
|
+
display: none;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
&--vertical &__text {
|
|
61
|
+
margin: 6px 0 0;
|
|
62
|
+
color: $hy-text-color-grey;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&__dot {
|
|
66
|
+
position: absolute;
|
|
67
|
+
top: 0;
|
|
68
|
+
left: 0;
|
|
69
|
+
width: 100%;
|
|
70
|
+
height: 100%;
|
|
71
|
+
|
|
72
|
+
&:before {
|
|
73
|
+
/* #ifndef APP-NVUE */
|
|
74
|
+
display: block;
|
|
75
|
+
/* #endif */
|
|
76
|
+
width: 2px;
|
|
77
|
+
height: 25%;
|
|
78
|
+
margin: 0 auto;
|
|
79
|
+
background-color: currentColor;
|
|
80
|
+
border-radius: 40%;
|
|
81
|
+
content: " ";
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
@for $i from 1 through 12 {
|
|
87
|
+
.hy-loading-icon__dot:nth-of-type(#{$i}) {
|
|
88
|
+
transform: rotate($i * 30deg);
|
|
89
|
+
opacity: 1 - 0.0625 * ($i - 1);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
@keyframes hy-rotate {
|
|
94
|
+
0% {
|
|
95
|
+
transform: rotate(0deg);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
to {
|
|
99
|
+
transform: rotate(1turn);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/* #endif */
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type IProps from "./typing";
|
|
2
|
+
|
|
3
|
+
const defaultProps: IProps = {
|
|
4
|
+
show: true,
|
|
5
|
+
color: "#909399",
|
|
6
|
+
textColor: "#909399",
|
|
7
|
+
vertical: false,
|
|
8
|
+
mode: "spinner",
|
|
9
|
+
size: 24,
|
|
10
|
+
textSize: 15,
|
|
11
|
+
text: "",
|
|
12
|
+
timingFunction: "ease-in-out",
|
|
13
|
+
duration: 1200,
|
|
14
|
+
inactiveColor: "",
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export default defaultProps;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { CSSProperties } from "vue";
|
|
2
|
+
|
|
3
|
+
export default interface IProps {
|
|
4
|
+
/**
|
|
5
|
+
* @description 是否显示组件 (默认 true)
|
|
6
|
+
* */
|
|
7
|
+
show?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* @description 动画活动区域的颜色,只对 mode = flower 模式有效
|
|
10
|
+
* */
|
|
11
|
+
color?: string;
|
|
12
|
+
/**
|
|
13
|
+
* @description 提示文本的颜色
|
|
14
|
+
* */
|
|
15
|
+
textColor?: string;
|
|
16
|
+
/**
|
|
17
|
+
* @description 文字和图标是否垂直排列 (默认 false )
|
|
18
|
+
* */
|
|
19
|
+
vertical?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* @description 模式选择,见官网说明(默认 'circle' )
|
|
22
|
+
* */
|
|
23
|
+
mode?: "spinner" | "circle" | "semicircle";
|
|
24
|
+
/**
|
|
25
|
+
* @description 加载图标的大小,单位px (默认 24 )
|
|
26
|
+
* */
|
|
27
|
+
size?: number | string;
|
|
28
|
+
/**
|
|
29
|
+
* @description 文字大小(默认 15 )
|
|
30
|
+
* */
|
|
31
|
+
textSize?: number | string;
|
|
32
|
+
/**
|
|
33
|
+
* @description 文字内容
|
|
34
|
+
* */
|
|
35
|
+
text?: string;
|
|
36
|
+
/**
|
|
37
|
+
* @description 动画模式 (默认 'ease-in-out' )
|
|
38
|
+
* */
|
|
39
|
+
timingFunction?: "ease-in-out" | "linear" | "ease-in" | "ease-out" | "ease";
|
|
40
|
+
/**
|
|
41
|
+
* @description 动画执行周期时间(默认 1200)
|
|
42
|
+
* */
|
|
43
|
+
duration?: number;
|
|
44
|
+
/**
|
|
45
|
+
* @description mode=circle时的暗边颜色
|
|
46
|
+
* */
|
|
47
|
+
inactiveColor?: string;
|
|
48
|
+
/**
|
|
49
|
+
* @description 定义需要用到的外部样式
|
|
50
|
+
* */
|
|
51
|
+
customStyle?: CSSProperties;
|
|
52
|
+
}
|
|
@@ -150,18 +150,19 @@
|
|
|
150
150
|
</template>
|
|
151
151
|
|
|
152
152
|
<script setup lang="ts">
|
|
153
|
-
import { ref, reactive,
|
|
153
|
+
import { ref, reactive, onMounted } from "vue";
|
|
154
154
|
import { onHide } from "@dcloudio/uni-app";
|
|
155
155
|
import { storeToRefs } from "pinia";
|
|
156
156
|
import { useUserInfo } from "../../store";
|
|
157
157
|
import { decryptData, encryptData } from "../../utils";
|
|
158
|
+
import type { FormColumnsType, FormTypeEnum } from "../../typing";
|
|
159
|
+
import { IconConfig } from "../../config";
|
|
158
160
|
|
|
159
161
|
// 组件
|
|
160
162
|
import HyCheckbox from "../hy-checkbox/hy-checkbox.vue";
|
|
161
163
|
import HyForm from "../hy-form/hy-form.vue";
|
|
162
164
|
import HyInput from "../hy-input/hy-input.vue";
|
|
163
165
|
import HyIcon from "../hy-icon/hy-icon.vue";
|
|
164
|
-
import { FormColumnsType, FormTypeEnum, IconConfig } from "@/package";
|
|
165
166
|
|
|
166
167
|
interface IProps {
|
|
167
168
|
themeColor: string;
|
|
@@ -184,7 +185,7 @@ const props = withDefaults(defineProps<IProps>(), {
|
|
|
184
185
|
customUserValidator: () => ({}),
|
|
185
186
|
customPwdValidator: () => ({}),
|
|
186
187
|
userNumValidator: () => ({}),
|
|
187
|
-
pwdNumValidator: () => ({})
|
|
188
|
+
pwdNumValidator: () => ({}),
|
|
188
189
|
});
|
|
189
190
|
const emit = defineEmits(["handleHistory", "handleCheckbox"]);
|
|
190
191
|
const userInfoStore = useUserInfo();
|
|
@@ -195,14 +196,14 @@ const userColumns = reactive([
|
|
|
195
196
|
field: "user",
|
|
196
197
|
label: "",
|
|
197
198
|
type: FormTypeEnum.CUSTOM,
|
|
198
|
-
rules: [props.customUserValidator, props.userNumValidator]
|
|
199
|
+
rules: [props.customUserValidator, props.userNumValidator],
|
|
199
200
|
},
|
|
200
201
|
{
|
|
201
202
|
field: "pwd",
|
|
202
203
|
label: "",
|
|
203
204
|
type: FormTypeEnum.CUSTOM,
|
|
204
|
-
rules: [props.customUserValidator, props.pwdNumValidator]
|
|
205
|
-
}
|
|
205
|
+
rules: [props.customUserValidator, props.pwdNumValidator],
|
|
206
|
+
},
|
|
206
207
|
]);
|
|
207
208
|
const rememberList = reactive([{ label: "记住密码", value: 1 }]);
|
|
208
209
|
const showPwd = ref<boolean>(false);
|
|
@@ -215,21 +216,21 @@ const userRules = reactive({
|
|
|
215
216
|
required: true,
|
|
216
217
|
message: "请先输入账号",
|
|
217
218
|
// 可以单个或者同时写两个触发验证方式
|
|
218
|
-
trigger: ["blur", "change"]
|
|
219
|
+
trigger: ["blur", "change"],
|
|
219
220
|
},
|
|
220
221
|
props.customUserValidator,
|
|
221
|
-
props.userNumValidator
|
|
222
|
+
props.userNumValidator,
|
|
222
223
|
],
|
|
223
224
|
pwd: [
|
|
224
225
|
{
|
|
225
226
|
required: true,
|
|
226
227
|
message: "请输入密码",
|
|
227
228
|
// 可以单个或者同时写两个触发验证方式
|
|
228
|
-
trigger: ["blur", "change"]
|
|
229
|
+
trigger: ["blur", "change"],
|
|
229
230
|
},
|
|
230
231
|
props.pwdNumValidator,
|
|
231
|
-
props.customPwdValidator
|
|
232
|
-
]
|
|
232
|
+
props.customPwdValidator,
|
|
233
|
+
],
|
|
233
234
|
});
|
|
234
235
|
const rememberPassword = ref([0]);
|
|
235
236
|
const account = uni.getStorageSync(`${props.prefix}_account`);
|
|
@@ -270,7 +271,7 @@ onHide(() => {
|
|
|
270
271
|
// 数组前面加数据
|
|
271
272
|
choiceList.value.unshift({
|
|
272
273
|
user: userName,
|
|
273
|
-
pwd: password
|
|
274
|
+
pwd: password,
|
|
274
275
|
});
|
|
275
276
|
// 数组最多只放三个账号
|
|
276
277
|
if (choiceList.value.length >= 5) {
|
|
@@ -278,7 +279,7 @@ onHide(() => {
|
|
|
278
279
|
}
|
|
279
280
|
uni.setStorageSync(
|
|
280
281
|
`${props.prefix}_choiceList`,
|
|
281
|
-
encryptData(choiceList.value)
|
|
282
|
+
encryptData(choiceList.value),
|
|
282
283
|
);
|
|
283
284
|
}
|
|
284
285
|
});
|
|
@@ -291,7 +292,6 @@ const loginFn = () => {
|
|
|
291
292
|
form_1Ref.value
|
|
292
293
|
.handleSubmit()
|
|
293
294
|
.then((res) => {
|
|
294
|
-
console.log(111);
|
|
295
295
|
resolve("success" + res);
|
|
296
296
|
})
|
|
297
297
|
.catch((err) => {
|
|
@@ -329,7 +329,7 @@ const extensionFun = (index: number, username: string) => {
|
|
|
329
329
|
choiceList.value.splice(i, 1);
|
|
330
330
|
uni.setStorageSync(
|
|
331
331
|
`${props.prefix}_choiceList`,
|
|
332
|
-
encryptData(choiceList.value)
|
|
332
|
+
encryptData(choiceList.value),
|
|
333
333
|
);
|
|
334
334
|
break;
|
|
335
335
|
default:
|
|
@@ -349,7 +349,7 @@ const handleBlur = (event: string, temp: FormColumnsType) => {
|
|
|
349
349
|
};
|
|
350
350
|
|
|
351
351
|
defineExpose({
|
|
352
|
-
loginFn
|
|
352
|
+
loginFn,
|
|
353
353
|
});
|
|
354
354
|
</script>
|
|
355
355
|
|
|
@@ -59,12 +59,12 @@
|
|
|
59
59
|
</template>
|
|
60
60
|
|
|
61
61
|
<script lang="ts" setup>
|
|
62
|
-
import { ref,
|
|
62
|
+
import { ref, computed, watch } from "vue";
|
|
63
63
|
import { storeToRefs } from "pinia";
|
|
64
64
|
import { encryptData } from "../../utils";
|
|
65
65
|
import { useUserInfo } from "../../store";
|
|
66
66
|
import defaultProps from "./props";
|
|
67
|
-
import IProps from "./typing";
|
|
67
|
+
import type IProps from "./typing";
|
|
68
68
|
|
|
69
69
|
// 组件
|
|
70
70
|
import TheUserLogin from "./TheUserLogin.vue";
|
|
@@ -113,11 +113,11 @@ const selectModel = (temp: number) => {
|
|
|
113
113
|
};
|
|
114
114
|
const tabs = ref([
|
|
115
115
|
{
|
|
116
|
-
name: "账号登录"
|
|
116
|
+
name: "账号登录",
|
|
117
117
|
},
|
|
118
118
|
{
|
|
119
|
-
name: "验证码登录"
|
|
120
|
-
}
|
|
119
|
+
name: "验证码登录",
|
|
120
|
+
},
|
|
121
121
|
]);
|
|
122
122
|
const currentTab = ref(0);
|
|
123
123
|
const userLoginRef = ref<typeof TheUserLogin>(null);
|
|
@@ -136,7 +136,7 @@ watch(
|
|
|
136
136
|
}
|
|
137
137
|
}).value;
|
|
138
138
|
},
|
|
139
|
-
{ immediate: true, deep: true }
|
|
139
|
+
{ immediate: true, deep: true },
|
|
140
140
|
);
|
|
141
141
|
|
|
142
142
|
/**
|
|
@@ -156,15 +156,15 @@ const loginFn = async () => {
|
|
|
156
156
|
encryptData({
|
|
157
157
|
rememberPsw: rememberPsw.value,
|
|
158
158
|
userName: user,
|
|
159
|
-
password: pwd
|
|
160
|
-
})
|
|
159
|
+
password: pwd,
|
|
160
|
+
}),
|
|
161
161
|
);
|
|
162
162
|
} else {
|
|
163
163
|
// 如果没有选记住密码就移除之前保存的
|
|
164
164
|
uni.removeStorageSync(`${props.prefix}_account`);
|
|
165
165
|
uni.setStorageSync(
|
|
166
166
|
`${props.prefix}_account`,
|
|
167
|
-
encryptData({ rememberPsw: rememberPsw.value })
|
|
167
|
+
encryptData({ rememberPsw: rememberPsw.value }),
|
|
168
168
|
);
|
|
169
169
|
}
|
|
170
170
|
emit("login", { user, pwd });
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import IProps from "./typing";
|
|
1
|
+
import type IProps from "./typing";
|
|
2
2
|
|
|
3
3
|
const defaultProps: IProps = {
|
|
4
4
|
logo: "",
|
|
@@ -16,7 +16,7 @@ const defaultProps: IProps = {
|
|
|
16
16
|
min: 6,
|
|
17
17
|
max: 20,
|
|
18
18
|
message: "长度在6-20个字符之间",
|
|
19
|
-
trigger: ["blur", "change"]
|
|
19
|
+
trigger: ["blur", "change"],
|
|
20
20
|
}),
|
|
21
21
|
customPhoneValidator: () => ({
|
|
22
22
|
// 自定义验证函数,见上说明
|
|
@@ -25,8 +25,8 @@ const defaultProps: IProps = {
|
|
|
25
25
|
return /^[1][0-9]{10}$/.test(value);
|
|
26
26
|
},
|
|
27
27
|
message: "手机号码不正确",
|
|
28
|
-
trigger: ["change", "blur"]
|
|
29
|
-
})
|
|
28
|
+
trigger: ["change", "blur"],
|
|
29
|
+
}),
|
|
30
30
|
};
|
|
31
31
|
|
|
32
32
|
export default defaultProps;
|