hy-app 0.1.2 → 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.
Files changed (221) hide show
  1. package/README.md +1 -1
  2. package/api/http.ts +8 -8
  3. package/components/dialog/index.ts +2 -2
  4. package/components/hy-address-picker/hy-address-picker.vue +3 -29
  5. package/components/hy-address-picker/index.scss +27 -0
  6. package/components/hy-avatar/hy-avatar.vue +1 -45
  7. package/components/hy-avatar/index.scss +45 -0
  8. package/components/hy-avatar/typing.d.ts +1 -1
  9. package/components/hy-back-top/hy-back-top.vue +7 -22
  10. package/components/hy-back-top/index.scss +16 -0
  11. package/components/hy-back-top/props.ts +4 -4
  12. package/components/hy-back-top/typing.d.ts +2 -3
  13. package/components/hy-badge/hy-badge.vue +1 -72
  14. package/components/hy-badge/index.scss +72 -0
  15. package/components/hy-button/hy-button.vue +12 -124
  16. package/components/hy-button/index.scss +116 -0
  17. package/components/hy-calendar/header.vue +76 -0
  18. package/components/hy-calendar/hy-calendar.vue +366 -0
  19. package/components/hy-calendar/index.scss +171 -0
  20. package/components/hy-calendar/month.vue +524 -0
  21. package/components/hy-calendar/props.ts +37 -0
  22. package/components/hy-calendar/typing.d.ts +126 -0
  23. package/components/hy-card/hy-card.vue +21 -84
  24. package/components/hy-card/index.scss +57 -0
  25. package/components/hy-card/props.ts +2 -2
  26. package/components/hy-card/typing.d.ts +1 -1
  27. package/components/hy-cell/hy-cell.vue +1 -137
  28. package/components/hy-cell/index.scss +137 -0
  29. package/components/hy-check-button/hy-check-button.vue +1 -0
  30. package/components/hy-check-button/index.scss +5 -0
  31. package/components/hy-checkbox/hy-checkbox.vue +2 -95
  32. package/components/hy-checkbox/index.scss +94 -0
  33. package/components/hy-checkbox/typing.d.ts +1 -2
  34. package/components/hy-count-down/hy-count-down.vue +150 -0
  35. package/components/hy-count-down/index.scss +6 -0
  36. package/components/hy-count-down/index.ts +52 -0
  37. package/components/hy-count-down/props.ts +10 -0
  38. package/components/hy-count-down/typing.d.ts +20 -0
  39. package/components/hy-count-to/hy-count-to.vue +213 -0
  40. package/components/hy-count-to/index.scss +6 -0
  41. package/components/hy-count-to/props.ts +17 -0
  42. package/components/hy-count-to/typing.d.ts +48 -0
  43. package/components/hy-datetime-picker/hy-datetime-picker.vue +2 -28
  44. package/components/hy-datetime-picker/index.scss +28 -0
  45. package/components/hy-divider/hy-divider.vue +24 -49
  46. package/components/hy-divider/index.scss +25 -0
  47. package/components/hy-divider/props.ts +2 -2
  48. package/components/hy-divider/typing.d.ts +1 -1
  49. package/components/hy-dropdown/hy-dropdown.vue +43 -0
  50. package/components/hy-dropdown/index.scss +17 -0
  51. package/components/hy-dropdown/props.ts +17 -0
  52. package/components/hy-dropdown/typing.d.ts +48 -0
  53. package/components/hy-dropdown-item/hy-dropdown-item.vue +194 -0
  54. package/components/hy-dropdown-item/index.scss +96 -0
  55. package/components/hy-dropdown-item/props.ts +10 -0
  56. package/components/hy-dropdown-item/typing.d.ts +31 -0
  57. package/components/hy-empty/hy-empty.vue +8 -26
  58. package/components/hy-empty/index.scss +19 -0
  59. package/components/hy-empty/props.ts +2 -2
  60. package/components/hy-empty/typing.d.ts +1 -1
  61. package/components/hy-float-button/hy-float-button.vue +201 -0
  62. package/components/hy-float-button/index.scss +69 -0
  63. package/components/hy-float-button/props.ts +25 -0
  64. package/components/hy-float-button/typing.d.ts +93 -0
  65. package/components/hy-folding-panel/hy-folding-panel.vue +9 -12
  66. package/components/hy-folding-panel/index.scss +6 -0
  67. package/components/hy-folding-panel/props.ts +2 -2
  68. package/components/hy-folding-panel/typing.d.ts +2 -2
  69. package/components/hy-form/hy-form.vue +17 -34
  70. package/components/hy-form/index.scss +30 -0
  71. package/components/hy-form/props.ts +2 -0
  72. package/components/hy-form/typing.d.ts +9 -1
  73. package/components/hy-grid/hy-grid.vue +1 -43
  74. package/components/hy-grid/index.scss +40 -0
  75. package/components/hy-icon/hy-icon.vue +1 -93
  76. package/components/hy-icon/index.scss +84 -0
  77. package/components/hy-image/hy-image.vue +212 -0
  78. package/components/hy-image/index.scss +26 -0
  79. package/components/hy-image/props.ts +24 -0
  80. package/components/hy-image/typing.d.ts +76 -0
  81. package/components/hy-input/hy-input.vue +2 -72
  82. package/components/hy-input/index.scss +65 -0
  83. package/components/hy-line/hy-line.vue +4 -8
  84. package/components/hy-line/index.scss +5 -0
  85. package/components/hy-line/props.ts +3 -3
  86. package/components/hy-line/typing.d.ts +2 -2
  87. package/components/hy-line-progress/hy-line-progress.vue +15 -44
  88. package/components/hy-line-progress/index.scss +38 -0
  89. package/components/hy-line-progress/props.ts +2 -2
  90. package/components/hy-line-progress/typing.d.ts +1 -1
  91. package/components/hy-list/hy-list.vue +11 -41
  92. package/components/hy-list/index.scss +32 -0
  93. package/components/hy-list/props.ts +2 -2
  94. package/components/hy-loading/hy-loading.vue +95 -0
  95. package/components/hy-loading/index.scss +103 -0
  96. package/components/hy-loading/props.ts +17 -0
  97. package/components/hy-loading/typing.d.ts +52 -0
  98. package/components/hy-login/TheUserLogin.vue +16 -16
  99. package/components/hy-login/hy-login.vue +9 -9
  100. package/components/hy-login/props.ts +4 -4
  101. package/components/hy-modal/hy-modal.vue +11 -89
  102. package/components/hy-modal/index.scss +77 -0
  103. package/components/hy-modal/props.ts +2 -2
  104. package/components/hy-modal/typing.d.ts +1 -1
  105. package/components/hy-navbar/hy-navbar.vue +20 -92
  106. package/components/hy-navbar/index.scss +67 -0
  107. package/components/hy-navbar/props.ts +2 -2
  108. package/components/hy-navbar/typing.d.ts +1 -1
  109. package/components/hy-notice-bar/hy-column-notice.vue +11 -39
  110. package/components/hy-notice-bar/hy-notice-bar.vue +10 -12
  111. package/components/hy-notice-bar/hy-row-notice.vue +5 -56
  112. package/components/hy-notice-bar/index.scss +93 -0
  113. package/components/hy-notice-bar/props.ts +4 -2
  114. package/components/hy-notice-bar/typing.d.ts +13 -3
  115. package/components/hy-number-step/hy-number-step.vue +1 -70
  116. package/components/hy-number-step/index.scss +71 -0
  117. package/components/hy-overlay/hy-overlay.vue +2 -14
  118. package/components/hy-overlay/index.scss +9 -0
  119. package/components/hy-picker/hy-picker.vue +1 -68
  120. package/components/hy-picker/index.scss +68 -0
  121. package/components/hy-popup/hy-popup.vue +1 -74
  122. package/components/hy-popup/index.scss +60 -0
  123. package/components/hy-price/hy-price.vue +1 -11
  124. package/components/hy-price/index.scss +11 -0
  125. package/components/hy-qrcode/hy-qrcode.vue +15 -37
  126. package/components/hy-qrcode/index.scss +23 -0
  127. package/components/hy-qrcode/props.ts +2 -2
  128. package/components/hy-qrcode/typing.d.ts +2 -2
  129. package/components/hy-radio/hy-radio.vue +2 -101
  130. package/components/hy-radio/index.scss +93 -0
  131. package/components/hy-radio/typing.d.ts +1 -2
  132. package/components/hy-rate/hy-rate.vue +1 -33
  133. package/components/hy-rate/index.scss +33 -0
  134. package/components/hy-read-more/hy-read-more.vue +7 -30
  135. package/components/hy-read-more/index.scss +25 -0
  136. package/components/hy-read-more/props.ts +3 -3
  137. package/components/hy-read-more/typing.d.ts +1 -1
  138. package/components/hy-safe-bottom/hy-safe-bottom.vue +5 -9
  139. package/components/hy-safe-bottom/index.scss +5 -0
  140. package/components/hy-scroll-list/hy-scroll-list.vue +13 -43
  141. package/components/hy-scroll-list/index.scss +34 -0
  142. package/components/hy-scroll-list/props.ts +2 -2
  143. package/components/hy-scroll-list/typing.d.ts +1 -1
  144. package/components/hy-search/hy-search.vue +1 -83
  145. package/components/hy-search/index.scss +83 -0
  146. package/components/hy-slider/hy-slider.vue +14 -92
  147. package/components/hy-slider/index.scss +77 -0
  148. package/components/hy-status-bar/hy-status-bar.vue +41 -0
  149. package/components/hy-status-bar/index.scss +6 -0
  150. package/components/hy-status-bar/props.ts +8 -0
  151. package/components/hy-status-bar/typing.d.ts +12 -0
  152. package/components/hy-steps/hy-steps.vue +36 -163
  153. package/components/hy-steps/index.scss +131 -0
  154. package/components/hy-steps/props.ts +2 -2
  155. package/components/hy-steps/typing.d.ts +2 -2
  156. package/components/hy-subsection/hy-subsection.vue +40 -132
  157. package/components/hy-subsection/index.scss +82 -0
  158. package/components/hy-subsection/props.ts +1 -0
  159. package/components/hy-subsection/typing.d.ts +13 -4
  160. package/components/hy-swipe-action/hy-swipe-action.vue +294 -0
  161. package/components/hy-swipe-action/index.scss +9 -0
  162. package/components/hy-swipe-action/index.wxs +235 -0
  163. package/components/hy-swipe-action/props.ts +16 -0
  164. package/components/hy-swipe-action/typing.d.ts +55 -0
  165. package/components/hy-swipe-action/wxs.js +15 -0
  166. package/components/hy-swiper/hy-swiper-indicator.vue +5 -35
  167. package/components/hy-swiper/hy-swiper.vue +1 -54
  168. package/components/hy-swiper/index.scss +82 -0
  169. package/components/hy-switch/hy-switch.vue +62 -72
  170. package/components/hy-switch/index.scss +46 -0
  171. package/components/hy-switch/props.ts +4 -1
  172. package/components/hy-switch/typing.d.ts +14 -1
  173. package/components/hy-tabs/hy-tabs.vue +22 -81
  174. package/components/hy-tabs/index.scss +63 -0
  175. package/components/hy-tabs/props.ts +5 -5
  176. package/components/hy-tabs/typing.d.ts +1 -1
  177. package/components/hy-tag/hy-tag.vue +1 -214
  178. package/components/hy-tag/index.scss +204 -0
  179. package/components/hy-text/hy-text.vue +238 -0
  180. package/components/hy-text/index.scss +70 -0
  181. package/components/hy-text/index.ts +0 -0
  182. package/components/hy-text/props.ts +30 -0
  183. package/components/hy-text/typing.d.ts +98 -0
  184. package/components/hy-textarea/hy-textarea.vue +1 -46
  185. package/components/hy-textarea/index.scss +40 -0
  186. package/components/hy-tooltip/hy-tooltip.vue +42 -95
  187. package/components/hy-tooltip/index.scss +64 -0
  188. package/components/hy-tooltip/props.ts +2 -2
  189. package/components/hy-tooltip/typing.d.ts +1 -1
  190. package/components/hy-transition/hy-transition.vue +4 -2
  191. package/components/hy-transition/typing.d.ts +1 -13
  192. package/components/hy-upload/hy-upload.vue +37 -182
  193. package/components/hy-upload/index.scss +147 -0
  194. package/components/hy-upload/props.ts +2 -2
  195. package/components/hy-upload/typing.d.ts +11 -11
  196. package/components/hy-warn/hy-warn.vue +15 -123
  197. package/components/hy-warn/index.scss +109 -0
  198. package/components/hy-warn/props.ts +3 -3
  199. package/components/hy-warn/typing.d.ts +4 -3
  200. package/components/hy-waterfall/index.scss +82 -0
  201. package/components/index.ts +25 -1
  202. package/components/message/index.ts +54 -54
  203. package/config/color.ts +2 -1
  204. package/global/index.ts +6 -6
  205. package/global/register-properties.ts +2 -2
  206. package/index.scss +2 -1
  207. package/libs/css/common.scss +14 -2
  208. package/package.json +2 -2
  209. package/{libs/css → public/font}/iconfont.css +4 -4
  210. package/theme.scss +6 -4
  211. package/typing/modules/common.d.ts +16 -1
  212. package/utils/calendar.js +1021 -0
  213. package/utils/colorGradient.ts +112 -0
  214. package/utils/index.ts +2 -0
  215. package/utils/inside.ts +80 -34
  216. package/utils/inspect.ts +66 -0
  217. package/utils/utils.ts +11 -12
  218. package/libs/css/download.zip +0 -0
  219. /package/{libs/css → public/font}/iconfont.ttf +0 -0
  220. /package/{libs/css → public/font}/iconfont.woff +0 -0
  221. /package/{libs/css → public/font}/iconfont.woff2 +0 -0
@@ -0,0 +1,71 @@
1
+ @use "../../theme.scss" as *;
2
+ @use "../../libs/css/mixin.scss" as *;
3
+
4
+ $u-numberBox-hover-bgColor: #e6e6e6 !default;
5
+ $u-numberBox-disabled-color: #c8c9cc !default;
6
+ $u-numberBox-disabled-bgColor: #f7f8fa !default;
7
+ $u-numberBox-plus-radius: 4px !default;
8
+ $u-numberBox-minus-radius: 4px !default;
9
+ $u-numberBox-input-text-align: center !default;
10
+ $u-numberBox-input-font-size: 15px !default;
11
+ $u-numberBox-input-padding: 0 !default;
12
+ $u-numberBox-input-margin: 0 2px !default;
13
+ $u-numberBox-input-disabled-color: #c8c9cc !default;
14
+ $u-numberBox-input-disabled-bgColor: #f2f3f5 !default;
15
+
16
+ .hy-number-box {
17
+ @include flex(row);
18
+ align-items: center;
19
+
20
+ &__slot {
21
+ /* #ifndef APP-NVUE */
22
+ touch-action: none;
23
+ /* #endif */
24
+ }
25
+
26
+ &__plus,
27
+ &__minus {
28
+ width: 35px;
29
+ @include flex;
30
+ justify-content: center;
31
+ align-items: center;
32
+ /* #ifndef APP-NVUE */
33
+ touch-action: none;
34
+ /* #endif */
35
+
36
+ &--hover {
37
+ background-color: $u-numberBox-hover-bgColor !important;
38
+ }
39
+
40
+ &--disabled {
41
+ color: $u-numberBox-disabled-color;
42
+ background-color: $u-numberBox-disabled-bgColor;
43
+ }
44
+ }
45
+
46
+ &__plus {
47
+ border-top-right-radius: $u-numberBox-plus-radius;
48
+ border-bottom-right-radius: $u-numberBox-plus-radius;
49
+ }
50
+
51
+ &__minus {
52
+ border-top-left-radius: $u-numberBox-minus-radius;
53
+ border-bottom-left-radius: $u-numberBox-minus-radius;
54
+ }
55
+
56
+ &__input {
57
+ position: relative;
58
+ text-align: $u-numberBox-input-text-align;
59
+ font-size: $u-numberBox-input-font-size;
60
+ padding: $u-numberBox-input-padding;
61
+ margin: $u-numberBox-input-margin;
62
+ @include flex;
63
+ align-items: center;
64
+ justify-content: center;
65
+
66
+ &--disabled {
67
+ color: $u-numberBox-input-disabled-color;
68
+ background-color: $u-numberBox-input-disabled-bgColor;
69
+ }
70
+ }
71
+ }
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <HyTransition
3
3
  :show="show"
4
- custom-class="u-overlay"
4
+ custom-class="hy-overlay"
5
5
  :duration="duration"
6
6
  :custom-style="overlayStyle"
7
7
  @click="clickHandler"
@@ -38,17 +38,5 @@ const clickHandler = () => {
38
38
  </script>
39
39
 
40
40
  <style lang="scss" scoped>
41
- $u-overlay-top: 0 !default;
42
- $u-overlay-left: 0 !default;
43
- $u-overlay-width: 100% !default;
44
- $u-overlay-height: 100% !default;
45
- $u-overlay-background-color: rgba(0, 0, 0, 0.7) !default;
46
- .u-overlay {
47
- position: fixed;
48
- top: $u-overlay-top;
49
- left: $u-overlay-left;
50
- width: $u-overlay-width;
51
- height: $u-overlay-height;
52
- background-color: $u-overlay-background-color;
53
- }
41
+ @import "./index.scss";
54
42
  </style>
@@ -0,0 +1,9 @@
1
+
2
+ .hy-overlay {
3
+ position: fixed;
4
+ top: 0;
5
+ left: 0;
6
+ width: 100%;
7
+ height: 100%;
8
+ background-color: rgba(0, 0, 0, 0.7);
9
+ }
@@ -429,72 +429,5 @@ defineExpose({
429
429
  </script>
430
430
 
431
431
  <style lang="scss" scoped>
432
- @import "../../libs/css/mixin.scss";
433
- @import "../../theme.scss";
434
-
435
- .hy-picker {
436
- position: relative;
437
- &-input {
438
- position: relative;
439
- .input-cover {
440
- opacity: 0;
441
- position: absolute;
442
- top: 0;
443
- bottom: 0;
444
- left: 0;
445
- right: 0;
446
- z-index: 1;
447
- }
448
- }
449
-
450
- &__title {
451
- @include flex();
452
- justify-content: space-between;
453
- padding: $hy-border-margin-padding-lg;
454
- &--center {
455
- font-size: $hy-font-size-subtitle;
456
- color: $hy-color-subtitle;
457
- }
458
- }
459
-
460
- &__view {
461
- &__column {
462
- @include flex;
463
- flex: 1;
464
- justify-content: center;
465
-
466
- &__item {
467
- @include flex;
468
- justify-content: center;
469
- align-items: center;
470
- font-size: 16px;
471
- text-align: center;
472
- /* #ifndef APP-NVUE */
473
- display: block;
474
- /* #endif */
475
- color: #303133ff;
476
-
477
- &--disabled {
478
- /* #ifndef APP-NVUE */
479
- cursor: not-allowed;
480
- /* #endif */
481
- opacity: 0.35;
482
- }
483
- }
484
- }
485
- }
486
-
487
- &--loading {
488
- position: absolute;
489
- top: 0;
490
- right: 0;
491
- left: 0;
492
- bottom: 0;
493
- @include flex;
494
- justify-content: center;
495
- align-items: center;
496
- background-color: rgba(255, 255, 255, 0.87);
497
- z-index: 1000;
498
- }
499
- }
432
+ @import "./index.scss";
500
433
  </style>
@@ -0,0 +1,68 @@
1
+ @use "../../theme.scss" as *;
2
+ @use "../../libs/css/mixin.scss" as *;
3
+
4
+ .hy-picker {
5
+ position: relative;
6
+ &-input {
7
+ position: relative;
8
+ .input-cover {
9
+ opacity: 0;
10
+ position: absolute;
11
+ top: 0;
12
+ bottom: 0;
13
+ left: 0;
14
+ right: 0;
15
+ z-index: 1;
16
+ }
17
+ }
18
+
19
+ &__title {
20
+ @include flex();
21
+ justify-content: space-between;
22
+ padding: $hy-border-margin-padding-lg;
23
+ &--center {
24
+ font-size: $hy-font-size-subtitle;
25
+ color: $hy-color-subtitle;
26
+ }
27
+ }
28
+
29
+ &__view {
30
+ &__column {
31
+ @include flex;
32
+ flex: 1;
33
+ justify-content: center;
34
+
35
+ &__item {
36
+ @include flex;
37
+ justify-content: center;
38
+ align-items: center;
39
+ font-size: 16px;
40
+ text-align: center;
41
+ /* #ifndef APP-NVUE */
42
+ display: block;
43
+ /* #endif */
44
+ color: #303133ff;
45
+
46
+ &--disabled {
47
+ /* #ifndef APP-NVUE */
48
+ cursor: not-allowed;
49
+ /* #endif */
50
+ opacity: 0.35;
51
+ }
52
+ }
53
+ }
54
+ }
55
+
56
+ &--loading {
57
+ position: absolute;
58
+ top: 0;
59
+ right: 0;
60
+ left: 0;
61
+ bottom: 0;
62
+ @include flex;
63
+ justify-content: center;
64
+ align-items: center;
65
+ background-color: rgba(255, 255, 255, 0.87);
66
+ z-index: 1000;
67
+ }
68
+ }
@@ -192,78 +192,5 @@ const clickHandler = () => {
192
192
  </script>
193
193
 
194
194
  <style lang="scss" scoped>
195
- $u-popup-flex: 1 !default;
196
- $u-popup-content-background-color: #fff !default;
197
-
198
- .hy-popup {
199
- flex: $u-popup-flex;
200
-
201
- &__content {
202
- background-color: $u-popup-content-background-color;
203
- position: relative;
204
-
205
- &--round-top {
206
- border-top-left-radius: 0;
207
- border-top-right-radius: 0;
208
- border-bottom-left-radius: 10px;
209
- border-bottom-right-radius: 10px;
210
- }
211
-
212
- &--round-left {
213
- border-top-left-radius: 0;
214
- border-top-right-radius: 10px;
215
- border-bottom-left-radius: 0;
216
- border-bottom-right-radius: 10px;
217
- }
218
-
219
- &--round-right {
220
- border-top-left-radius: 10px;
221
- border-top-right-radius: 0;
222
- border-bottom-left-radius: 10px;
223
- border-bottom-right-radius: 0;
224
- }
225
-
226
- &--round-bottom {
227
- border-top-left-radius: 10px;
228
- border-top-right-radius: 10px;
229
- border-bottom-left-radius: 0;
230
- border-bottom-right-radius: 0;
231
- }
232
-
233
- &--round-center {
234
- border-top-left-radius: 10px;
235
- border-top-right-radius: 10px;
236
- border-bottom-left-radius: 10px;
237
- border-bottom-right-radius: 10px;
238
- }
239
-
240
- &__close {
241
- position: absolute;
242
-
243
- &--hover {
244
- opacity: 0.4;
245
- }
246
- }
247
-
248
- &__close--top-left {
249
- top: 15px;
250
- left: 15px;
251
- }
252
-
253
- &__close--top-right {
254
- top: 15px;
255
- right: 15px;
256
- }
257
-
258
- &__close--bottom-left {
259
- bottom: 15px;
260
- left: 15px;
261
- }
262
-
263
- &__close--bottom-right {
264
- right: 15px;
265
- bottom: 15px;
266
- }
267
- }
268
- }
195
+ @import "./index.scss";
269
196
  </style>
@@ -0,0 +1,60 @@
1
+ @use "../../theme.scss" as *;
2
+ @use "../../libs/css/mixin.scss" as *;
3
+
4
+
5
+ .hy-popup {
6
+ flex: 1;
7
+
8
+ &__content {
9
+ background-color: #fff;
10
+ position: relative;
11
+
12
+ &--round-top {
13
+ border-radius: 0 0 $hy-border-radius-lg $hy-border-radius-lg;
14
+ }
15
+
16
+ &--round-left {
17
+ border-radius: 0 $hy-border-radius-lg $hy-border-radius-lg 0;
18
+ }
19
+
20
+ &--round-right {
21
+ border-radius: $hy-border-radius-lg 0 0 $hy-border-radius-lg;
22
+ }
23
+
24
+ &--round-bottom {
25
+ border-radius: $hy-border-radius-lg $hy-border-radius-lg 0 0;
26
+ }
27
+
28
+ &--round-center {
29
+ border-radius: $hy-border-radius-lg;
30
+ }
31
+
32
+ &__close {
33
+ position: absolute;
34
+
35
+ &--hover {
36
+ opacity: 0.4;
37
+ }
38
+ }
39
+
40
+ &__close--top-left {
41
+ top: $hy-border-margin-padding-lg;
42
+ left: $hy-border-margin-padding-lg;
43
+ }
44
+
45
+ &__close--top-right {
46
+ top: $hy-border-margin-padding-lg;
47
+ right: $hy-border-margin-padding-lg;
48
+ }
49
+
50
+ &__close--bottom-left {
51
+ bottom: $hy-border-margin-padding-lg;
52
+ left: $hy-border-margin-padding-lg;
53
+ }
54
+
55
+ &__close--bottom-right {
56
+ right: $hy-border-margin-padding-lg;
57
+ bottom: $hy-border-margin-padding-lg;
58
+ }
59
+ }
60
+ }
@@ -72,15 +72,5 @@ const handleClick = () => {
72
72
  </script>
73
73
 
74
74
  <style lang="scss" scoped>
75
- .hy-price {
76
- font-size: 32rpx;
77
- font-weight: 500;
78
- margin-top: 5px;
79
- &__prefix {
80
- font-size: 24rpx;
81
- }
82
- &__decimal {
83
- font-size: 24rpx;
84
- }
85
- }
75
+ @import "./index.scss";
86
76
  </style>
@@ -0,0 +1,11 @@
1
+ .hy-price {
2
+ font-size: 32rpx;
3
+ font-weight: 500;
4
+ margin-top: 5px;
5
+ &__prefix {
6
+ font-size: 24rpx;
7
+ }
8
+ &__decimal {
9
+ font-size: 24rpx;
10
+ }
11
+ }
@@ -14,7 +14,7 @@
14
14
  class="hy-qrcode__loading"
15
15
  :style="{ width: addUnit(size), height: addUnit(size) }"
16
16
  >
17
- <HyIcon :name="IconConfig.LOADING" is-rotate></HyIcon>
17
+ <HyLoading></HyLoading>
18
18
  </view>
19
19
  </view>
20
20
  </view>
@@ -23,11 +23,14 @@
23
23
  <script setup lang="ts">
24
24
  import { getCurrentInstance, toRefs, ref, onMounted } from "vue";
25
25
  import defaultProps from "./props";
26
- import IProps from "./typing";
26
+ import type IProps from "./typing";
27
27
  import QRCode from "./qrcode.js";
28
- import { addUnit } from "../../utils";
28
+ import { addUnit, error } from "../../utils";
29
29
  import { IconConfig } from "../../config";
30
+
31
+ // 组件
30
32
  import HyIcon from "../hy-icon/hy-icon.vue";
33
+ import HyLoading from "../hy-loading/hy-loading.vue";
31
34
 
32
35
  const props = withDefaults(defineProps<IProps>(), defaultProps);
33
36
  const { text, allowPreview } = toRefs(props);
@@ -39,12 +42,13 @@ const qrcode = ref("");
39
42
  const result = ref("");
40
43
 
41
44
  onMounted(() => {
45
+ console.log(111);
42
46
  initQrCode();
43
47
  });
44
48
 
45
49
  const initQrCode = () => {
46
50
  if (text.value) {
47
- loading.value;
51
+ loading.value = true;
48
52
  qrcode.value = new QRCode({
49
53
  context: instance, // 上下文环境
50
54
  canvasId: props.cid, // canvas-id
@@ -62,14 +66,10 @@ const initQrCode = () => {
62
66
  cbResult: function (res: any) {
63
67
  // 生成二维码的回调
64
68
  _result(res);
65
- }
69
+ },
66
70
  });
67
71
  } else {
68
- uni.showToast({
69
- title: "二维码内容不能为空",
70
- icon: "none",
71
- duration: 2000
72
- });
72
+ error("二维码内容不能为空");
73
73
  }
74
74
  };
75
75
 
@@ -87,9 +87,9 @@ const _saveCode = () => {
87
87
  uni.showToast({
88
88
  title: "二维码保存成功",
89
89
  icon: "success",
90
- duration: 2000
90
+ duration: 2000,
91
91
  });
92
- }
92
+ },
93
93
  });
94
94
  }
95
95
  };
@@ -114,8 +114,8 @@ const preview = (e) => {
114
114
  },
115
115
  fail: function (err) {
116
116
  console.error(err.errMsg);
117
- }
118
- }
117
+ },
118
+ },
119
119
  });
120
120
  }
121
121
  emit("preview", result.value, e);
@@ -127,27 +127,5 @@ const onLongPress = () => {
127
127
  </script>
128
128
 
129
129
  <style lang="scss" scoped>
130
- .hy-qrcode {
131
- &__loading {
132
- display: flex;
133
- justify-content: center;
134
- align-items: center;
135
- background-color: #f7f7f7;
136
- position: absolute;
137
- top: 0;
138
- bottom: 0;
139
- left: 0;
140
- right: 0;
141
- }
142
- &__content {
143
- position: relative;
144
-
145
- &__canvas {
146
- position: fixed;
147
- top: -99999rpx;
148
- left: -99999rpx;
149
- z-index: -99999;
150
- }
151
- }
152
- }
130
+ @import "./index.scss";
153
131
  </style>
@@ -0,0 +1,23 @@
1
+ .hy-qrcode {
2
+ &__loading {
3
+ display: flex;
4
+ justify-content: center;
5
+ align-items: center;
6
+ background-color: #f7f7f7;
7
+ position: absolute;
8
+ top: 0;
9
+ bottom: 0;
10
+ left: 0;
11
+ right: 0;
12
+ }
13
+ &__content {
14
+ position: relative;
15
+
16
+ &__canvas {
17
+ position: fixed;
18
+ top: -99999rpx;
19
+ left: -99999rpx;
20
+ z-index: -99999;
21
+ }
22
+ }
23
+ }
@@ -1,4 +1,4 @@
1
- import IProps from "./typing";
1
+ import type IProps from "./typing";
2
2
 
3
3
  const defaultProps: IProps = {
4
4
  cid: "hy-qrcode-canvas" + Math.random().toString(),
@@ -14,7 +14,7 @@ const defaultProps: IProps = {
14
14
  iconSize: 40,
15
15
  showLoading: true,
16
16
  loadingText: "二维码生成中",
17
- allowPreview: false
17
+ allowPreview: false,
18
18
  };
19
19
 
20
20
  export default defaultProps;
@@ -1,8 +1,8 @@
1
- import { CSSProperties } from "vue";
1
+ import type { CSSProperties } from "vue";
2
2
 
3
3
  export default interface IProps {
4
4
  /**
5
- * @description 实例ID字符串(必须)
5
+ * @description 实例ID字符串(如果有多个二维码组件必须设置不一样的cid)
6
6
  * */
7
7
  cid?: string;
8
8
  /**
@@ -7,7 +7,7 @@
7
7
  :style="radioStyle"
8
8
  :class="[
9
9
  `hy-radio-label--${iconPlacement}`,
10
- borderBottom && placement === 'column' && 'hy-border-bottom',
10
+ borderBottom && placement === 'column' && 'hy-border__bottom',
11
11
  ]"
12
12
  >
13
13
  <view
@@ -229,104 +229,5 @@ const setRadioCheckedStatus = (temp: CheckboxColumnsVo) => {
229
229
  </script>
230
230
 
231
231
  <style lang="scss" scoped>
232
- @import "../../libs/css/mixin.scss";
233
- @import "../../theme.scss";
234
-
235
- .hy-radio {
236
- /* #ifndef APP-NVUE */
237
- @include flex(row);
238
- /* #endif */
239
- overflow: hidden;
240
- flex-direction: row;
241
- align-items: center;
242
- margin-bottom: 5px;
243
- margin-top: 5px;
244
-
245
- &-group {
246
- flex: 1;
247
-
248
- &--row {
249
- /* #ifndef APP-NVUE */
250
- display: flex;
251
- /* #endif */
252
- flex-flow: row wrap;
253
- }
254
-
255
- &--column {
256
- @include flex(column);
257
- margin: $hy-border-margin-padding-lg 0;
258
- }
259
- }
260
-
261
- &-label--left {
262
- flex-direction: row;
263
- }
264
-
265
- &-label--right {
266
- flex-direction: row-reverse;
267
- justify-content: space-between;
268
- }
269
-
270
- &__icon-wrap {
271
- /* #ifndef APP-NVUE */
272
- box-sizing: border-box;
273
- // nvue下,border-color过渡有问题
274
- transition-property: border-color, background-color, color;
275
- transition-duration: 0.2s;
276
- /* #endif */
277
- @include flex;
278
- align-items: center;
279
- justify-content: center;
280
- color: transparent;
281
- text-align: center;
282
- margin-right: $hy-border-margin-padding-sm;
283
- border: $hy-border-line;
284
-
285
- /* #ifdef MP-TOUTIAO */
286
- // 头条小程序兼容性问题,需要设置行高为0,否则图标偏下
287
- &__icon {
288
- line-height: 0;
289
- }
290
-
291
- /* #endif */
292
-
293
- &--circle {
294
- border-radius: 50%;
295
- }
296
-
297
- &--square {
298
- border-radius: 3px;
299
- }
300
-
301
- &--checked {
302
- color: $hy-text-color-inverse;
303
- background-color: $hy-primary;
304
- border-color: $hy-primary;
305
- }
306
-
307
- &--disabled {
308
- background-color: $hy-color-disable-bg !important;
309
- }
310
-
311
- &--disabled--checked {
312
- color: $hy-color-disable-icon !important;
313
- }
314
- }
315
-
316
- &__label-wrap {
317
- /* #ifndef APP-NVUE */
318
- word-wrap: break-word;
319
- /* #endif */
320
- color: $hy-text-color;
321
- font-size: $hy-font-size-base;
322
- margin-right: $hy-border-margin-padding-sm;
323
-
324
- &--disabled {
325
- color: $hy-text-color-disable;
326
- }
327
- }
328
- }
329
- .hy-border-bottom {
330
- border-bottom: $hy-border-line;
331
- }
232
+ @import "./index.scss";
332
233
  </style>