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.
Files changed (229) hide show
  1. package/components/hy-address-picker/hy-address-picker.vue +31 -10
  2. package/components/hy-address-picker/index.scss +1 -1
  3. package/components/hy-address-picker/props.ts +1 -3
  4. package/components/hy-address-picker/typing.d.ts +4 -11
  5. package/components/hy-avatar/hy-avatar.vue +11 -0
  6. package/components/hy-avatar/index.scss +8 -8
  7. package/components/hy-avatar/typing.d.ts +1 -1
  8. package/components/hy-back-top/hy-back-top.vue +27 -2
  9. package/components/hy-back-top/index.scss +11 -1
  10. package/components/hy-back-top/props.ts +1 -6
  11. package/components/hy-back-top/typing.d.ts +4 -7
  12. package/components/hy-badge/hy-badge.vue +11 -0
  13. package/components/hy-badge/index.scss +18 -40
  14. package/components/hy-badge/typing.d.ts +1 -1
  15. package/components/hy-button/hy-button.vue +44 -17
  16. package/components/hy-button/index.scss +25 -45
  17. package/components/hy-button/props.ts +1 -2
  18. package/components/hy-button/typing.d.ts +4 -7
  19. package/components/hy-calendar/header.vue +12 -12
  20. package/components/hy-calendar/hy-calendar.vue +11 -2
  21. package/components/hy-calendar/index.scss +140 -131
  22. package/components/hy-calendar/month.vue +18 -18
  23. package/components/hy-calendar/typing.d.ts +1 -1
  24. package/components/hy-card/hy-card.vue +11 -0
  25. package/components/hy-card/index.scss +12 -12
  26. package/components/hy-card/props.ts +2 -2
  27. package/components/hy-card/typing.d.ts +1 -1
  28. package/components/hy-cell/hy-cell.vue +57 -19
  29. package/components/hy-cell/index.scss +55 -28
  30. package/components/hy-cell/props.ts +4 -5
  31. package/components/hy-cell/typing.d.ts +11 -21
  32. package/components/hy-check-button/hy-check-button.vue +13 -2
  33. package/components/hy-check-button/index.scss +0 -5
  34. package/components/hy-check-button/typing.d.ts +1 -1
  35. package/components/hy-checkbox/hy-checkbox.vue +34 -10
  36. package/components/hy-checkbox/index.scss +15 -5
  37. package/components/hy-checkbox/props.ts +2 -3
  38. package/components/hy-checkbox/typing.d.ts +3 -3
  39. package/components/hy-config-provider/hy-config-provider.vue +52 -0
  40. package/components/hy-config-provider/index.scss +21 -0
  41. package/components/hy-config-provider/props.ts +13 -0
  42. package/components/hy-config-provider/typing.d.ts +28 -0
  43. package/components/hy-count-down/hy-count-down.vue +11 -0
  44. package/components/hy-count-down/index.scss +13 -1
  45. package/components/hy-count-down/typing.d.ts +1 -1
  46. package/components/hy-count-to/hy-count-to.vue +12 -1
  47. package/components/hy-count-to/index.scss +14 -1
  48. package/components/hy-count-to/props.ts +1 -1
  49. package/components/hy-count-to/typing.d.ts +1 -3
  50. package/components/hy-datetime-picker/hy-datetime-picker.vue +29 -14
  51. package/components/hy-datetime-picker/index.scss +1 -1
  52. package/components/hy-datetime-picker/props.ts +1 -3
  53. package/components/hy-datetime-picker/typing.d.ts +6 -13
  54. package/components/hy-divider/hy-divider.vue +11 -0
  55. package/components/hy-divider/index.scss +1 -1
  56. package/components/hy-divider/typing.d.ts +1 -1
  57. package/components/hy-dropdown/hy-dropdown.vue +13 -1
  58. package/components/hy-dropdown/index.scss +4 -1
  59. package/components/hy-dropdown/props.ts +2 -2
  60. package/components/hy-dropdown/typing.d.ts +1 -1
  61. package/components/hy-dropdown-item/hy-dropdown-item.vue +21 -3
  62. package/components/hy-dropdown-item/index.scss +35 -2
  63. package/components/hy-dropdown-item/typing.d.ts +1 -3
  64. package/components/hy-empty/hy-empty.vue +22 -10
  65. package/components/hy-empty/index.scss +17 -3
  66. package/components/hy-empty/props.ts +1 -5
  67. package/components/hy-empty/typing.d.ts +4 -19
  68. package/components/hy-float-button/hy-float-button.vue +11 -0
  69. package/components/hy-float-button/index.scss +13 -2
  70. package/components/hy-float-button/props.ts +3 -3
  71. package/components/hy-float-button/typing.d.ts +1 -1
  72. package/components/hy-folding-panel/hy-folding-panel.vue +11 -0
  73. package/components/hy-folding-panel/index.scss +4 -1
  74. package/components/hy-folding-panel/typing.d.ts +1 -1
  75. package/components/hy-form/hy-form.vue +214 -36
  76. package/components/hy-form/index.scss +13 -3
  77. package/components/hy-form/props.ts +0 -2
  78. package/components/hy-form/typing.d.ts +25 -7
  79. package/components/hy-grid/hy-grid.vue +27 -5
  80. package/components/hy-grid/index.scss +1 -1
  81. package/components/hy-grid/props.ts +1 -3
  82. package/components/hy-grid/typing.d.ts +13 -16
  83. package/components/hy-icon/hy-icon.vue +17 -10
  84. package/components/hy-icon/index.scss +16 -7
  85. package/components/hy-icon/props.ts +2 -2
  86. package/components/hy-icon/typing.d.ts +1 -1
  87. package/components/hy-image/hy-image.vue +11 -0
  88. package/components/hy-image/index.scss +4 -3
  89. package/components/hy-image/typing.d.ts +1 -1
  90. package/components/hy-input/hy-input.vue +58 -19
  91. package/components/hy-input/index.scss +12 -2
  92. package/components/hy-input/props.ts +3 -5
  93. package/components/hy-input/typing.d.ts +13 -12
  94. package/components/hy-line/hy-line.vue +11 -0
  95. package/components/hy-line/index.scss +4 -1
  96. package/components/hy-line/typing.d.ts +1 -1
  97. package/components/hy-line-progress/hy-line-progress.vue +17 -2
  98. package/components/hy-line-progress/index.scss +20 -8
  99. package/components/hy-line-progress/props.ts +4 -4
  100. package/components/hy-line-progress/typing.d.ts +5 -1
  101. package/components/hy-list/hy-list.vue +23 -8
  102. package/components/hy-list/index.scss +1 -4
  103. package/components/hy-list/typing.d.ts +1 -1
  104. package/components/hy-loading/hy-loading.vue +11 -0
  105. package/components/hy-loading/index.scss +2 -2
  106. package/components/hy-loading/typing.d.ts +1 -2
  107. package/components/hy-login/TheUserLogin.vue +63 -106
  108. package/components/hy-login/hy-login.vue +15 -10
  109. package/components/hy-login/props.ts +1 -1
  110. package/components/hy-login/typing.d.ts +6 -1
  111. package/components/hy-modal/hy-modal.vue +15 -7
  112. package/components/hy-modal/index.scss +19 -3
  113. package/components/hy-modal/typing.d.ts +1 -1
  114. package/components/hy-navbar/hy-navbar.vue +11 -0
  115. package/components/hy-navbar/index.scss +14 -3
  116. package/components/hy-navbar/props.ts +1 -1
  117. package/components/hy-navbar/typing.d.ts +1 -2
  118. package/components/hy-notice-bar/hy-notice-bar.vue +11 -0
  119. package/components/hy-notice-bar/index.scss +35 -35
  120. package/components/hy-notice-bar/typing.d.ts +1 -1
  121. package/components/hy-number-step/hy-number-step.vue +40 -18
  122. package/components/hy-number-step/index.scss +34 -25
  123. package/components/hy-number-step/props.ts +4 -4
  124. package/components/hy-number-step/typing.d.ts +8 -3
  125. package/components/hy-overlay/index.scss +3 -1
  126. package/components/hy-overlay/typing.d.ts +1 -1
  127. package/components/hy-parse/typing.d.ts +1 -1
  128. package/components/hy-picker/hy-picker.vue +30 -8
  129. package/components/hy-picker/index.scss +7 -3
  130. package/components/hy-picker/props.ts +2 -5
  131. package/components/hy-picker/typing.d.ts +4 -15
  132. package/components/hy-popup/hy-popup.vue +11 -0
  133. package/components/hy-popup/index.scss +10 -1
  134. package/components/hy-popup/typing.d.ts +1 -1
  135. package/components/hy-price/hy-price.vue +11 -0
  136. package/components/hy-price/index.scss +4 -1
  137. package/components/hy-price/typing.d.ts +1 -1
  138. package/components/hy-qrcode/hy-qrcode.vue +11 -0
  139. package/components/hy-qrcode/index.scss +4 -1
  140. package/components/hy-qrcode/typing.d.ts +1 -1
  141. package/components/hy-radio/hy-radio.vue +25 -5
  142. package/components/hy-radio/index.scss +17 -5
  143. package/components/hy-radio/props.ts +2 -3
  144. package/components/hy-radio/typing.d.ts +2 -2
  145. package/components/hy-rate/hy-rate.vue +11 -0
  146. package/components/hy-rate/index.scss +6 -6
  147. package/components/hy-rate/typing.d.ts +1 -1
  148. package/components/hy-read-more/hy-read-more.vue +23 -2
  149. package/components/hy-read-more/index.scss +29 -2
  150. package/components/hy-read-more/props.ts +2 -7
  151. package/components/hy-read-more/typing.d.ts +1 -1
  152. package/components/hy-scroll-list/hy-scroll-list.vue +31 -9
  153. package/components/hy-scroll-list/index.scss +10 -1
  154. package/components/hy-scroll-list/props.ts +2 -2
  155. package/components/hy-scroll-list/typing.d.ts +1 -1
  156. package/components/hy-search/hy-search.vue +23 -3
  157. package/components/hy-search/index.scss +25 -4
  158. package/components/hy-search/props.ts +3 -5
  159. package/components/hy-search/typing.d.ts +6 -13
  160. package/components/hy-slider/hy-slider.vue +11 -0
  161. package/components/hy-slider/index.scss +3 -2
  162. package/components/hy-slider/props.ts +1 -1
  163. package/components/hy-slider/typing.d.ts +1 -1
  164. package/components/hy-status-bar/typing.d.ts +1 -1
  165. package/components/hy-steps/hy-steps.vue +38 -20
  166. package/components/hy-steps/index.scss +57 -17
  167. package/components/hy-steps/props.ts +2 -2
  168. package/components/hy-steps/typing.d.ts +1 -1
  169. package/components/{hy-submitBar/hy-submitBar.vue → hy-submit-bar/hy-submit-bar.vue} +13 -34
  170. package/components/hy-submit-bar/index.scss +45 -0
  171. package/components/{hy-submitBar → hy-submit-bar}/typing.d.ts +1 -1
  172. package/components/hy-subsection/hy-subsection.vue +12 -0
  173. package/components/hy-subsection/index.scss +28 -8
  174. package/components/hy-subsection/props.ts +3 -3
  175. package/components/hy-subsection/typing.d.ts +1 -1
  176. package/components/hy-swipe-action/typing.d.ts +1 -1
  177. package/components/hy-swiper/hy-swiper.vue +11 -0
  178. package/components/hy-swiper/index.scss +13 -2
  179. package/components/hy-swiper/typing.d.ts +2 -5
  180. package/components/hy-switch/hy-switch.vue +28 -5
  181. package/components/hy-switch/index.scss +25 -7
  182. package/components/hy-switch/props.ts +1 -3
  183. package/components/hy-switch/typing.d.ts +6 -5
  184. package/components/hy-tabs/hy-tabs.vue +27 -15
  185. package/components/hy-tabs/index.scss +25 -4
  186. package/components/hy-tabs/props.ts +4 -10
  187. package/components/hy-tabs/typing.d.ts +1 -1
  188. package/components/hy-tag/hy-tag.vue +38 -22
  189. package/components/hy-tag/index.scss +27 -115
  190. package/components/hy-tag/props.ts +1 -2
  191. package/components/hy-tag/typing.d.ts +3 -10
  192. package/components/hy-text/hy-text.vue +12 -1
  193. package/components/hy-text/index.scss +20 -37
  194. package/components/hy-text/typing.d.ts +1 -1
  195. package/components/hy-textarea/hy-textarea.vue +17 -6
  196. package/components/hy-textarea/index.scss +16 -5
  197. package/components/hy-textarea/typing.d.ts +2 -2
  198. package/components/hy-toast/hy-toast.vue +13 -2
  199. package/components/hy-toast/index.scss +26 -26
  200. package/components/hy-toast/typing.d.ts +1 -1
  201. package/components/hy-tooltip/hy-tooltip.vue +11 -0
  202. package/components/hy-tooltip/index.scss +3 -3
  203. package/components/hy-tooltip/props.ts +1 -1
  204. package/components/hy-tooltip/typing.d.ts +1 -1
  205. package/components/hy-transition/typing.d.ts +1 -1
  206. package/components/hy-upload/hy-upload.vue +11 -0
  207. package/components/hy-upload/index.scss +12 -1
  208. package/components/hy-upload/typing.d.ts +1 -1
  209. package/components/hy-warn/hy-warn.vue +22 -11
  210. package/components/hy-warn/index.scss +46 -1
  211. package/components/hy-warn/typing.d.ts +1 -1
  212. package/components/hy-waterfall/hy-waterfall.vue +11 -0
  213. package/components/hy-waterfall/index.scss +1 -1
  214. package/components/hy-waterfall/typing.d.ts +1 -3
  215. package/components/index.ts +2 -2
  216. package/config/icon.ts +4 -0
  217. package/libs/css/common.scss +9 -0
  218. package/libs/css/mixin.scss +78 -0
  219. package/package.json +3 -3
  220. package/public/font/iconfont.css +3 -3
  221. package/store/userInfo.ts +26 -25
  222. package/theme.scss +76 -60
  223. package/typing/modules/common.d.ts +5 -1
  224. package/typing/modules/form.ts +29 -14
  225. package/utils/colorGradient.ts +1 -1
  226. package/utils/inside.ts +3 -0
  227. package/components/hy-submitBar/Index.vue +0 -17
  228. package/components/hy-submitBar/index.scss +0 -9
  229. /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, debounce, getPx, getRect } from "../../utils";
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: { left: AnyObject[]; right: AnyObject[] } = reactive({
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
- .hy-virtual-container {
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;
@@ -1,4 +1,4 @@
1
- export default interface IProps {
1
+ export default interface HyListProps {
2
2
  /**
3
3
  * @description 数据列表
4
4
  * */
@@ -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
- .hy-loading-icon {
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
- .hy-loading-icon {
51
+ @include b(loading-icon) {
52
52
  &__spinner--spinner {
53
53
  animation-timing-function: steps(12);
54
54
  }
@@ -1,7 +1,6 @@
1
1
  import type { CSSProperties } from "vue";
2
- import type { LoadingMode } from "@/package/typing/modules/common";
3
2
 
4
- export default interface IProps {
3
+ export default interface HyLoadingProps {
5
4
  /**
6
5
  * @description 是否显示组件 (默认 true)
7
6
  * */
@@ -1,71 +1,11 @@
1
1
  <template>
2
2
  <view class="user-login">
3
- <HyForm ref="form_1Ref" :columns="userColumns" :formData="userForm">
4
- <template #user="{ record, errorStyle }">
5
- <HyInput
6
- v-model="userForm.name"
7
- :placeholder="userPlaceholder"
8
- :clearable="true"
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="rememberPassword"
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: "gxh",
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 userColumns = reactive([
64
+ const showChoice = ref<boolean>(false);
65
+ const showPwd = ref<boolean>(false);
66
+ const userColumns = computed(() => [
127
67
  {
128
- field: "user",
68
+ field: "userName",
129
69
  label: "",
130
- type: FormTypeEnum.CUSTOM,
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: "pwd",
91
+ field: "password",
135
92
  label: "",
136
- type: FormTypeEnum.CUSTOM,
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
- name: [
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
- pwd: [
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([0]);
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.rememberPsw;
176
- if (account) {
177
- //获取缓存的账号和密码
178
- userForm.value.name = result.userName;
179
- userForm.value.pwd = result.password;
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
- .handleSubmit()
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", rememberPsw.value);
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>(null);
124
- const phoneLoginRef = ref<typeof ThePhoneLogin>(null);
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.name;
150
- let pwd = userForm.value.pwd;
151
- await userLoginRef.value.loginFn();
150
+ // let user = userForm.value.userName;
151
+ // let pwd = userForm.value.password;
152
+ await userLoginRef.value?.loginFn();
152
153
  //缓存账号和密码
153
- if (rememberPsw.value == 1) {
154
+ if (rememberPsw.value) {
154
155
  uni.setStorageSync(
155
156
  `${props.prefix}_account`,
156
157
  encryptData({
157
158
  rememberPsw: rememberPsw.value,
158
- userName: user,
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", { user, pwd });
170
+ emit("login", userForm.value);
171
171
  break;
172
172
  case "phone":
173
- await phoneLoginRef.value.loginFn();
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>
@@ -4,7 +4,7 @@ const defaultProps: IProps = {
4
4
  logo: "",
5
5
  loginType: 0,
6
6
  themeColor: "#20D56E",
7
- prefix: "gxh",
7
+ prefix: "hy",
8
8
  isShowPwd: false,
9
9
  userPlaceholder: "输入您的用户名",
10
10
  pwdPlaceholder: "输入您的密码",
@@ -1,4 +1,9 @@
1
- export default interface IProps {
1
+ export interface UserLoginInfoVo {
2
+ userName: string;
3
+ password: string;
4
+ }
5
+
6
+ export default interface HyLoginProps {
2
7
  /**
3
8
  * @description 登录logo
4
9
  * */
@@ -70,7 +70,7 @@
70
70
  v-if="showConfirmButton && showCancelButton"
71
71
  ></view>
72
72
  <view
73
- class="hy-modal__button-group__wrapper u-modal__button-group__wrapper--confirm"
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
- <HyIcon
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
- .hy-modal {
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-text-color-light;
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-bg-color-grey;
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
  }
@@ -1,4 +1,4 @@
1
- export default interface IProps {
1
+ export default interface HyModalProps {
2
2
  /**
3
3
  * @description 是否显示模态框,请赋值给show (默认 false )
4
4
  * */
@@ -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
- .hy-navbar {
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: #9acafc;
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;
@@ -13,7 +13,7 @@ const defaultProps: IProps = {
13
13
  title: "",
14
14
  sub: "",
15
15
  titleColor: "",
16
- bgColor: "#ffffff",
16
+ bgColor: "",
17
17
  titleWidth: "400rpx",
18
18
  height: "44px",
19
19
  leftIconSize: 20,