hy-app 0.4.13 → 0.5.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 (211) hide show
  1. package/components/hy-action-sheet/hy-action-sheet.vue +155 -238
  2. package/components/hy-action-sheet/props.ts +68 -15
  3. package/components/hy-action-sheet/typing.d.ts +115 -115
  4. package/components/hy-address-picker/hy-address-picker.vue +185 -289
  5. package/components/hy-address-picker/props.ts +97 -21
  6. package/components/hy-address-picker/typing.d.ts +90 -89
  7. package/components/hy-avatar/hy-avatar.vue +121 -204
  8. package/components/hy-avatar/props.ts +76 -18
  9. package/components/hy-avatar/typing.d.ts +63 -62
  10. package/components/hy-back-top/hy-back-top.vue +65 -120
  11. package/components/hy-back-top/props.ts +57 -16
  12. package/components/hy-back-top/typing.d.ts +43 -42
  13. package/components/hy-badge/hy-badge.vue +66 -138
  14. package/components/hy-badge/props.ts +73 -17
  15. package/components/hy-badge/typing.d.ts +59 -58
  16. package/components/hy-button/hy-button.vue +226 -375
  17. package/components/hy-button/props.ts +129 -158
  18. package/components/hy-calendar/header.vue +48 -64
  19. package/components/hy-calendar/hy-calendar.vue +274 -438
  20. package/components/hy-calendar/month.vue +508 -516
  21. package/components/hy-calendar/props.ts +157 -35
  22. package/components/hy-calendar/typing.d.ts +129 -128
  23. package/components/hy-card/hy-card.vue +118 -240
  24. package/components/hy-card/index.scss +1 -2
  25. package/components/hy-card/props.ts +122 -27
  26. package/components/hy-card/typing.d.ts +119 -118
  27. package/components/hy-cell/hy-cell.vue +176 -258
  28. package/components/hy-cell/props.ts +71 -17
  29. package/components/hy-cell/typing.d.ts +87 -86
  30. package/components/hy-check-button/hy-check-button.vue +69 -139
  31. package/components/hy-check-button/props.ts +72 -18
  32. package/components/hy-check-button/typing.d.ts +74 -73
  33. package/components/hy-checkbox/hy-checkbox.vue +170 -263
  34. package/components/hy-checkbox/props.ts +94 -24
  35. package/components/hy-checkbox/typing.d.ts +72 -72
  36. package/components/hy-checkbox-group/hy-checkbox-group.vue +25 -100
  37. package/components/hy-checkbox-group/props.ts +80 -0
  38. package/components/hy-checkbox-group/typing.d.ts +65 -65
  39. package/components/hy-checkbox-item/hy-checkbox-item.vue +140 -177
  40. package/components/hy-checkbox-item/props.ts +24 -0
  41. package/components/hy-checkbox-item/typing.d.ts +4 -3
  42. package/components/hy-code-input/hy-code-input.vue +179 -262
  43. package/components/hy-code-input/props.ts +84 -18
  44. package/components/hy-code-input/typing.d.ts +71 -71
  45. package/components/hy-config-provider/hy-config-provider.vue +28 -50
  46. package/components/hy-config-provider/props.ts +26 -11
  47. package/components/hy-config-provider/typing.d.ts +20 -20
  48. package/components/hy-count-down/hy-count-down.vue +103 -131
  49. package/components/hy-count-down/props.ts +30 -8
  50. package/components/hy-count-down/typing.d.ts +25 -25
  51. package/components/hy-count-to/hy-count-to.vue +148 -213
  52. package/components/hy-count-to/props.ts +60 -15
  53. package/components/hy-count-to/typing.d.ts +46 -46
  54. package/components/hy-coupon/README.md +133 -0
  55. package/components/hy-coupon/hy-coupon.vue +180 -0
  56. package/components/hy-coupon/index.scss +553 -0
  57. package/components/hy-coupon/props.ts +129 -0
  58. package/components/hy-coupon/typing.d.ts +146 -0
  59. package/components/hy-datetime-picker/hy-datetime-picker.vue +415 -580
  60. package/components/hy-datetime-picker/props.ts +142 -32
  61. package/components/hy-datetime-picker/typing.d.ts +132 -132
  62. package/components/hy-divider/hy-divider.vue +90 -169
  63. package/components/hy-divider/props.ts +78 -19
  64. package/components/hy-divider/typing.d.ts +60 -60
  65. package/components/hy-dropdown/hy-dropdown.vue +37 -71
  66. package/components/hy-dropdown/props.ts +38 -15
  67. package/components/hy-dropdown/typing.d.ts +44 -44
  68. package/components/hy-dropdown-item/hy-dropdown-item.vue +141 -173
  69. package/components/hy-dropdown-item/props.ts +19 -8
  70. package/components/hy-empty/hy-empty.vue +75 -129
  71. package/components/hy-empty/props.ts +57 -15
  72. package/components/hy-empty/typing.d.ts +84 -84
  73. package/components/hy-flex/hy-flex.vue +33 -88
  74. package/components/hy-flex/props.ts +58 -0
  75. package/components/hy-flex/typing.d.ts +14 -16
  76. package/components/hy-float-button/hy-float-button.vue +289 -406
  77. package/components/hy-float-button/props.ts +109 -25
  78. package/components/hy-folding-panel/hy-folding-panel.vue +86 -374
  79. package/components/hy-folding-panel/props.ts +40 -15
  80. package/components/hy-folding-panel/typing.d.ts +52 -63
  81. package/components/hy-folding-panel-item/hy-folding-panel-item.vue +186 -228
  82. package/components/hy-folding-panel-item/index.scss +87 -0
  83. package/components/hy-folding-panel-item/props.ts +81 -0
  84. package/components/hy-folding-panel-item/typing.d.ts +23 -0
  85. package/components/hy-form/hy-form.vue +172 -212
  86. package/components/hy-form/props.ts +37 -0
  87. package/components/hy-form/typing.d.ts +68 -61
  88. package/components/hy-form-group/typing.d.ts +74 -74
  89. package/components/hy-form-item/hy-form-item.vue +100 -129
  90. package/components/hy-form-item/props.ts +25 -0
  91. package/components/hy-form-item/typing.d.ts +40 -37
  92. package/components/hy-grid/hy-grid.vue +76 -132
  93. package/components/hy-grid/props.ts +58 -16
  94. package/components/hy-grid/typing.d.ts +66 -66
  95. package/components/hy-icon/hy-icon.vue +84 -161
  96. package/components/hy-icon/props.ts +76 -22
  97. package/components/hy-icon/typing.d.ts +83 -82
  98. package/components/hy-image/hy-image.vue +142 -272
  99. package/components/hy-image/props.ts +105 -23
  100. package/components/hy-image/typing.d.ts +84 -87
  101. package/components/hy-input/hy-input.vue +230 -421
  102. package/components/hy-input/props.ts +183 -35
  103. package/components/hy-input/typing.d.ts +169 -169
  104. package/components/hy-line/hy-line.vue +34 -72
  105. package/components/hy-line/props.ts +41 -10
  106. package/components/hy-line/typing.d.ts +29 -29
  107. package/components/hy-line-progress/hy-line-progress.vue +66 -101
  108. package/components/hy-line-progress/props.ts +31 -10
  109. package/components/hy-line-progress/typing.d.ts +29 -29
  110. package/components/hy-list/hy-list.vue +151 -220
  111. package/components/hy-list/props.ts +67 -16
  112. package/components/hy-list/typing.d.ts +52 -52
  113. package/components/hy-loading/hy-loading.vue +63 -119
  114. package/components/hy-loading/props.ts +63 -15
  115. package/components/hy-loading/typing.d.ts +49 -49
  116. package/components/hy-menu/hy-menu.vue +124 -166
  117. package/components/hy-menu/props.ts +42 -10
  118. package/components/hy-menu/typing.d.ts +60 -60
  119. package/components/hy-modal/hy-modal.vue +127 -218
  120. package/components/hy-modal/props.ts +89 -24
  121. package/components/hy-navbar/hy-navbar.vue +104 -177
  122. package/components/hy-navbar/props.ts +76 -22
  123. package/components/hy-navbar/typing.d.ts +81 -81
  124. package/components/hy-notice-bar/hy-notice-bar.vue +67 -144
  125. package/components/hy-notice-bar/props.ts +80 -19
  126. package/components/hy-notice-bar/typing.d.ts +62 -62
  127. package/components/hy-notify/hy-notify.vue +128 -177
  128. package/components/hy-notify/props.ts +49 -12
  129. package/components/hy-notify/typing.d.ts +45 -41
  130. package/components/hy-number-step/hy-number-step.vue +281 -394
  131. package/components/hy-number-step/props.ts +110 -27
  132. package/components/hy-number-step/typing.d.ts +120 -120
  133. package/components/hy-overlay/hy-overlay.vue +39 -66
  134. package/components/hy-overlay/props.ts +31 -8
  135. package/components/hy-pagination/hy-pagination.vue +100 -155
  136. package/components/hy-pagination/props.ts +53 -13
  137. package/components/hy-picker/hy-picker.vue +309 -430
  138. package/components/hy-picker/index.scss +8 -12
  139. package/components/hy-picker/props.ts +110 -26
  140. package/components/hy-popover/hy-popover.vue +190 -252
  141. package/components/hy-popover/props.ts +48 -10
  142. package/components/hy-popup/hy-popup.vue +162 -248
  143. package/components/hy-popup/props.ts +82 -18
  144. package/components/hy-price/hy-price.vue +45 -104
  145. package/components/hy-price/props.ts +52 -12
  146. package/components/hy-price/typing.d.ts +41 -36
  147. package/components/hy-qrcode/hy-qrcode.vue +115 -185
  148. package/components/hy-qrcode/props.ts +68 -18
  149. package/components/hy-qrcode/typing.d.ts +67 -66
  150. package/components/hy-radio/hy-radio.vue +161 -259
  151. package/components/hy-radio/props.ts +95 -25
  152. package/components/hy-radio/typing.d.ts +85 -84
  153. package/components/hy-rate/hy-rate.vue +185 -270
  154. package/components/hy-rate/props.ts +76 -18
  155. package/components/hy-rate/typing.d.ts +61 -60
  156. package/components/hy-read-more/hy-read-more.vue +93 -136
  157. package/components/hy-read-more/props.ts +43 -13
  158. package/components/hy-scroll-list/hy-scroll-list.vue +81 -102
  159. package/components/hy-scroll-list/props.ts +22 -11
  160. package/components/hy-search/hy-search.vue +155 -284
  161. package/components/hy-search/props.ts +130 -25
  162. package/components/hy-signature/hy-signature.vue +491 -635
  163. package/components/hy-signature/props.ts +115 -26
  164. package/components/hy-signature/typing.d.ts +138 -138
  165. package/components/hy-slider/hy-slider.vue +388 -477
  166. package/components/hy-slider/props.ts +75 -19
  167. package/components/hy-steps/hy-steps.vue +212 -279
  168. package/components/hy-steps/props.ts +47 -13
  169. package/components/hy-submit-bar/hy-submit-bar.vue +137 -222
  170. package/components/hy-submit-bar/props.ts +89 -20
  171. package/components/hy-submit-bar/typing.d.ts +86 -85
  172. package/components/hy-subsection/hy-subsection.vue +132 -185
  173. package/components/hy-subsection/props.ts +50 -17
  174. package/components/hy-subsection/typing.d.ts +52 -52
  175. package/components/hy-swipe-action/hy-swipe-action.vue +228 -283
  176. package/components/hy-swipe-action/props.ts +43 -18
  177. package/components/hy-swipe-action/typing.d.ts +46 -46
  178. package/components/hy-swiper/hy-swiper.vue +159 -286
  179. package/components/hy-swiper/props.ts +126 -28
  180. package/components/hy-swiper/typing.d.ts +115 -115
  181. package/components/hy-switch/hy-switch.vue +112 -176
  182. package/components/hy-switch/props.ts +60 -15
  183. package/components/hy-switch/typing.d.ts +63 -63
  184. package/components/hy-tabBar/hy-tabBar.vue +64 -60
  185. package/components/hy-tabs/hy-tabs.vue +277 -380
  186. package/components/hy-tabs/props.ts +75 -18
  187. package/components/hy-tag/hy-tag.vue +111 -204
  188. package/components/hy-tag/props.ts +81 -19
  189. package/components/hy-text/hy-text.vue +200 -322
  190. package/components/hy-text/props.ts +107 -28
  191. package/components/hy-textarea/hy-textarea.vue +147 -256
  192. package/components/hy-textarea/props.ts +112 -25
  193. package/components/hy-textarea/typing.d.ts +42 -42
  194. package/components/hy-toast/hy-toast.vue +135 -143
  195. package/components/hy-tooltip/hy-tooltip.vue +220 -306
  196. package/components/hy-tooltip/props.ts +79 -15
  197. package/components/hy-transition/hy-transition.vue +111 -138
  198. package/components/hy-transition/props.ts +30 -8
  199. package/components/hy-upload/hy-upload.vue +320 -469
  200. package/components/hy-upload/props.ts +130 -27
  201. package/components/hy-warn/hy-warn.vue +80 -129
  202. package/components/hy-warn/props.ts +47 -12
  203. package/components/hy-waterfall/hy-waterfall.vue +139 -163
  204. package/components/hy-waterfall/props.ts +19 -7
  205. package/components/hy-watermark/hy-watermark.vue +762 -870
  206. package/components/hy-watermark/props.ts +103 -22
  207. package/global.d.ts +2 -0
  208. package/libs/css/theme.scss +3 -3
  209. package/package.json +2 -2
  210. package/web-types.json +1 -1
  211. package/components/hy-folding-panel/index.scss +0 -9
@@ -0,0 +1,553 @@
1
+ @use "../../libs/css/mixin.scss" as *;
2
+ @use "../../libs/css/theme" as *;
3
+
4
+ // 优惠券主题颜色变量
5
+ $coupon-primary-bg: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%) !default;
6
+ $coupon-secondary-bg: linear-gradient(135deg, #4ecdc4 0%, #45b7d1 100%) !default;
7
+ $coupon-tertiary-bg: linear-gradient(135deg, #feca57 0%, #ff9ff3 100%) !default;
8
+ $coupon-disabled-bg: linear-gradient(135deg, #c8d6e5 0%, #a5b1c2 100%) !default;
9
+ $coupon-used-bg: linear-gradient(135deg, #778beb 0%, #f8a5c2 100%) !default;
10
+ $coupon-expired-bg: linear-gradient(135deg, #e17055 0%, #d63031 100%) !default;
11
+ $coupon-content-bg: #ffffff !default;
12
+ $coupon-light-bg: #f8f9fa !default;
13
+
14
+ @include b(coupon) {
15
+ position: relative;
16
+ background-color: $coupon-light-bg;
17
+ border-radius: 12px;
18
+ overflow: hidden;
19
+ height: 110px;
20
+ display: flex;
21
+ align-items: stretch;
22
+ margin: 12px 0;
23
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
24
+ transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
25
+ cursor: pointer;
26
+
27
+ // 点击交互效果
28
+ &:active {
29
+ transform: scale(0.97);
30
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
31
+ }
32
+
33
+ // 正常状态悬浮效果
34
+ &:not(.hy-coupon--disabled):not(.hy-coupon--used):not(.hy-coupon--expired) {
35
+ &:hover {
36
+ box-shadow: 0 8px 20px rgba(255, 107, 107, 0.2);
37
+ transform: translateY(-2px);
38
+ }
39
+ }
40
+
41
+ // 不同类型的优惠券样式
42
+ &--secondary {
43
+ @include e(left) {
44
+ background: $coupon-secondary-bg;
45
+ }
46
+
47
+ &:not(.hy-coupon--disabled):not(.hy-coupon--used):not(.hy-coupon--expired) {
48
+ &:hover {
49
+ box-shadow: 0 8px 20px rgba(78, 205, 196, 0.2);
50
+ }
51
+ }
52
+
53
+ .limit-tag {
54
+ background-color: rgba(78, 205, 196, 0.15);
55
+ color: #4ecdc4;
56
+ box-shadow: 0 2px 4px rgba(78, 205, 196, 0.1);
57
+ }
58
+
59
+ .action-button {
60
+ background: linear-gradient(135deg, #4ecdc4 0%, #45b7d1 100%);
61
+ box-shadow: 0 3px 8px rgba(78, 205, 196, 0.2);
62
+
63
+ &:active {
64
+ background: linear-gradient(135deg, #45b7d1 0%, #4ecdc4 100%);
65
+ box-shadow: 0 2px 6px rgba(78, 205, 196, 0.3);
66
+ }
67
+ }
68
+ }
69
+
70
+ &--tertiary {
71
+ @include e(left) {
72
+ background: $coupon-tertiary-bg;
73
+ }
74
+
75
+ &:not(.hy-coupon--disabled):not(.hy-coupon--used):not(.hy-coupon--expired) {
76
+ &:hover {
77
+ box-shadow: 0 8px 20px rgba(254, 202, 87, 0.2);
78
+ }
79
+ }
80
+
81
+ .limit-tag {
82
+ background-color: rgba(254, 202, 87, 0.15);
83
+ color: #feca57;
84
+ box-shadow: 0 2px 4px rgba(254, 202, 87, 0.1);
85
+ }
86
+
87
+ .action-button {
88
+ background: linear-gradient(135deg, #feca57 0%, #ff9ff3 100%);
89
+ box-shadow: 0 3px 8px rgba(254, 202, 87, 0.2);
90
+
91
+ &:active {
92
+ background: linear-gradient(135deg, #ff9ff3 0%, #feca57 100%);
93
+ box-shadow: 0 2px 6px rgba(254, 202, 87, 0.3);
94
+ }
95
+ }
96
+ }
97
+
98
+ // 左侧金额区域
99
+ @include e(left) {
100
+ position: relative;
101
+ width: 110px;
102
+ background: $coupon-primary-bg;
103
+ color: white;
104
+ display: flex;
105
+ flex-direction: column;
106
+ align-items: center;
107
+ justify-content: center;
108
+ padding: 16px 0;
109
+ box-sizing: border-box;
110
+ overflow: hidden;
111
+ border-radius: 12px 0 0 12px;
112
+
113
+ // 装饰圆点 - 右侧
114
+ &::after {
115
+ content: '';
116
+ position: absolute;
117
+ top: 50%;
118
+ right: -5px;
119
+ transform: translateY(-50%);
120
+ width: 10px;
121
+ height: 10px;
122
+ background-color: $coupon-content-bg;
123
+ border-radius: 50%;
124
+ z-index: 3;
125
+ }
126
+
127
+ // 左侧装饰圆点
128
+ &::before {
129
+ content: '';
130
+ position: absolute;
131
+ top: 50%;
132
+ left: -5px;
133
+ transform: translateY(-50%);
134
+ width: 10px;
135
+ height: 10px;
136
+ background-color: $hy-background;
137
+ border-radius: 50%;
138
+ z-index: 3;
139
+ }
140
+
141
+ // 内部容器用于背景纹理
142
+ & > .texture {
143
+ position: absolute;
144
+ top: 0;
145
+ left: 0;
146
+ right: 0;
147
+ bottom: 0;
148
+ background-image:
149
+ radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
150
+ radial-gradient(circle at 70% 70%, rgba(255, 255, 255, 0.08) 0%, transparent 50%);
151
+ background-size: 100% 100%;
152
+ z-index: 0;
153
+ }
154
+
155
+ // 金额样式
156
+ .amount {
157
+ font-size: 32px;
158
+ font-weight: 800;
159
+ line-height: 1;
160
+ z-index: 1;
161
+ position: relative;
162
+ letter-spacing: -1px;
163
+ }
164
+
165
+ .amount-symbol {
166
+ font-size: 16px;
167
+ vertical-align: top;
168
+ margin-right: 2px;
169
+ opacity: 0.9;
170
+ font-weight: 600;
171
+ }
172
+
173
+ .min-spend {
174
+ font-size: 12px;
175
+ opacity: 0.9;
176
+ margin-top: 8px;
177
+ z-index: 1;
178
+ position: relative;
179
+ background: rgba(255, 255, 255, 0.2);
180
+ padding: 2px 8px;
181
+ border-radius: 10px;
182
+ backdrop-filter: blur(5px);
183
+ }
184
+ }
185
+
186
+ // 右侧内容区域
187
+ @include e(right) {
188
+ flex: 1;
189
+ padding: 16px 24px 16px 28px;
190
+ display: flex;
191
+ flex-direction: column;
192
+ justify-content: center;
193
+ position: relative;
194
+ background-color: $coupon-content-bg;
195
+ min-width: 0; // 防止内容溢出
196
+ border-radius: 0 12px 12px 0;
197
+
198
+ .content {
199
+ flex: 1;
200
+ display: flex;
201
+ flex-direction: column;
202
+ justify-content: center;
203
+ margin-bottom: 8px;
204
+ }
205
+
206
+ .title {
207
+ font-size: 17px;
208
+ font-weight: 700;
209
+ color: $hy-text-color;
210
+ line-height: 1.3;
211
+ margin-bottom: 6px;
212
+ overflow: hidden;
213
+ text-overflow: ellipsis;
214
+ display: -webkit-box;
215
+ -webkit-line-clamp: 1;
216
+ -webkit-box-orient: vertical;
217
+ }
218
+
219
+ .subtitle {
220
+ font-size: 13px;
221
+ color: $hy-text-color--2;
222
+ line-height: 1.4;
223
+ overflow: hidden;
224
+ text-overflow: ellipsis;
225
+ display: -webkit-box;
226
+ -webkit-line-clamp: 1;
227
+ -webkit-box-orient: vertical;
228
+ margin-bottom: 8px;
229
+ }
230
+
231
+ .validity {
232
+ font-size: 12px;
233
+ color: $hy-text-color--3;
234
+ margin-top: auto;
235
+ }
236
+
237
+ // 右侧角标记
238
+ &::before {
239
+ content: '';
240
+ position: absolute;
241
+ top: 50%;
242
+ right: 0;
243
+ transform: translateY(-50%);
244
+ width: 40px;
245
+ height: 40px;
246
+ background-color: $coupon-content-bg;
247
+ border-radius: 50%;
248
+ margin-right: -20px;
249
+ }
250
+ }
251
+
252
+ // 状态样式 - 禁用、已使用、已过期
253
+ @include m(disabled) {
254
+ opacity: 0.65;
255
+ cursor: not-allowed;
256
+
257
+ @include e(left) {
258
+ background-color: $coupon-disabled-bg;
259
+ }
260
+
261
+ @include e(right) {
262
+ .title,
263
+ .subtitle {
264
+ color: $hy-text-color--3;
265
+ }
266
+
267
+ // 添加禁用标记
268
+ &::after {
269
+ content: '已禁用';
270
+ position: absolute;
271
+ top: 50%;
272
+ right: -30px;
273
+ transform: translateY(-50%) rotate(45deg);
274
+ background-color: $hy-text-color--3;
275
+ color: white;
276
+ font-size: 12px;
277
+ padding: 4px 40px;
278
+ white-space: nowrap;
279
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
280
+ }
281
+ }
282
+ }
283
+
284
+ @include m(used) {
285
+ opacity: 0.7;
286
+ cursor: not-allowed;
287
+
288
+ @include e(left) {
289
+ background-color: $hy-info;
290
+ }
291
+
292
+ @include e(right) {
293
+ .title,
294
+ .subtitle {
295
+ color: $hy-text-color--3;
296
+ }
297
+ }
298
+ }
299
+
300
+ // 已使用状态标记
301
+ @include m(used) {
302
+ @include e(right) {
303
+ &::after {
304
+ content: '已使用';
305
+ position: absolute;
306
+ top: 50%;
307
+ right: -30px;
308
+ transform: translateY(-50%) rotate(45deg);
309
+ background-color: $coupon-used-bg;
310
+ color: white;
311
+ font-size: 12px;
312
+ padding: 4px 40px;
313
+ white-space: nowrap;
314
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
315
+ }
316
+ }
317
+
318
+ // 添加已使用水印效果
319
+ &::before {
320
+ content: '已使用';
321
+ position: absolute;
322
+ top: 50%;
323
+ left: 50%;
324
+ transform: translate(-50%, -50%) rotate(-30deg);
325
+ font-size: 30px;
326
+ font-weight: bold;
327
+ color: rgba(0, 0, 0, 0.05);
328
+ pointer-events: none;
329
+ }
330
+ }
331
+
332
+ // 已过期状态标记
333
+ @include m(expired) {
334
+ @include e(left) {
335
+ background-color: $coupon-expired-bg;
336
+ }
337
+
338
+ @include e(right) {
339
+ &::after {
340
+ content: '已过期';
341
+ position: absolute;
342
+ top: 50%;
343
+ right: -30px;
344
+ transform: translateY(-50%) rotate(45deg);
345
+ background-color: $coupon-expired-bg;
346
+ color: white;
347
+ font-size: 12px;
348
+ padding: 4px 40px;
349
+ white-space: nowrap;
350
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
351
+ }
352
+ }
353
+
354
+ // 添加已过期水印效果
355
+ &::before {
356
+ content: '已过期';
357
+ position: absolute;
358
+ top: 50%;
359
+ left: 50%;
360
+ transform: translate(-50%, -50%) rotate(-30deg);
361
+ font-size: 30px;
362
+ font-weight: bold;
363
+ color: rgba(0, 0, 0, 0.05);
364
+ pointer-events: none;
365
+ }
366
+ }
367
+
368
+ // 装饰性的虚线边框效果 - 更美观的实现
369
+ .coupon-border-left {
370
+ position: absolute;
371
+ left: 110px;
372
+ top: 10px;
373
+ bottom: 10px;
374
+ width: 1px;
375
+ background-image: linear-gradient(transparent 50%, rgba(255, 255, 255, 0.3) 50%);
376
+ background-size: 1px 8px;
377
+ z-index: 1;
378
+ }
379
+
380
+ .coupon-border-right {
381
+ position: absolute;
382
+ right: 0;
383
+ top: 10px;
384
+ bottom: 10px;
385
+ width: 1px;
386
+ background-image: linear-gradient(transparent 50%, $hy-border-color 50%);
387
+ background-size: 1px 8px;
388
+ }
389
+
390
+ // 顶部和底部波浪形装饰
391
+ & > .top-wave,
392
+ & > .bottom-wave {
393
+ content: '';
394
+ position: absolute;
395
+ width: 100%;
396
+ height: 8px;
397
+ background-image: radial-gradient(circle at 8px 4px, transparent 4px, $coupon-content-bg 5px, transparent 6px);
398
+ background-size: 16px 8px;
399
+ left: 0;
400
+ z-index: 1;
401
+ }
402
+
403
+ & > .top-wave {
404
+ top: 0;
405
+ }
406
+
407
+ & > .bottom-wave {
408
+ bottom: 0;
409
+ transform: rotate(180deg);
410
+ }
411
+
412
+ // 修复状态标记与波浪装饰的层级关系
413
+ @include m(disabled) {
414
+ @include e(right) {
415
+ &::after {
416
+ z-index: 2;
417
+ }
418
+ }
419
+ }
420
+
421
+ @include m(used) {
422
+ @include e(right) {
423
+ &::after {
424
+ z-index: 2;
425
+ }
426
+ }
427
+ }
428
+
429
+ @include m(expired) {
430
+ @include e(right) {
431
+ &::after {
432
+ z-index: 2;
433
+ }
434
+ }
435
+ }
436
+ }
437
+
438
+ // 响应式适配
439
+ @media (max-width: 375px) {
440
+ @include b(coupon) {
441
+ height: 100px;
442
+
443
+ @include e(left) {
444
+ width: 95px;
445
+
446
+ .amount {
447
+ font-size: 28px;
448
+ }
449
+
450
+ .min-spend {
451
+ font-size: 11px;
452
+ }
453
+ }
454
+
455
+ @include e(right) {
456
+ padding: 14px 20px 14px 24px;
457
+
458
+ .title {
459
+ font-size: 16px;
460
+ }
461
+
462
+ .subtitle {
463
+ font-size: 12px;
464
+ }
465
+ }
466
+
467
+ .coupon-border-left {
468
+ left: 95px;
469
+ }
470
+
471
+ .action-button {
472
+ font-size: 12px;
473
+ padding: 5px 14px;
474
+ }
475
+ }
476
+ }
477
+
478
+ .hy-coupon {
479
+ .limit-tags {
480
+ position: absolute;
481
+ top: 10px;
482
+ right: 10px;
483
+ display: flex;
484
+ gap: 6px;
485
+ flex-wrap: wrap;
486
+ }
487
+
488
+ .limit-tag {
489
+ background-color: rgba(255, 107, 107, 0.15);
490
+ color: #ff6b6b;
491
+ font-size: 11px;
492
+ padding: 3px 8px;
493
+ border-radius: 6px;
494
+ white-space: nowrap;
495
+ font-weight: 500;
496
+ box-shadow: 0 2px 4px rgba(255, 107, 107, 0.1);
497
+ }
498
+
499
+ .action-button {
500
+ position: absolute;
501
+ bottom: 10px;
502
+ right: 10px;
503
+ background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
504
+ color: white;
505
+ font-size: 13px;
506
+ padding: 6px 16px;
507
+ border-radius: 16px;
508
+ white-space: nowrap;
509
+ transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
510
+ font-weight: 600;
511
+ box-shadow: 0 3px 8px rgba(255, 107, 107, 0.2);
512
+ }
513
+
514
+ .action-button:active {
515
+ background: linear-gradient(135deg, #ee5a6f 0%, #ff6b6b 100%);
516
+ transform: scale(0.95);
517
+ box-shadow: 0 2px 6px rgba(255, 107, 107, 0.3);
518
+ }
519
+
520
+ .coupon-tooltip {
521
+ position: absolute;
522
+ top: -30px;
523
+ left: 50%;
524
+ transform: translateX(-50%);
525
+ background-color: rgba(0, 0, 0, 0.75);
526
+ color: white;
527
+ font-size: 12px;
528
+ padding: 4px 8px;
529
+ border-radius: 4px;
530
+ white-space: nowrap;
531
+ opacity: 0;
532
+ pointer-events: none;
533
+ transition: opacity 0.3s ease;
534
+ z-index: 10;
535
+
536
+ &::after {
537
+ content: "";
538
+ position: absolute;
539
+ bottom: -4px;
540
+ left: 50%;
541
+ transform: translateX(-50%);
542
+ width: 0;
543
+ height: 0;
544
+ border-left: 4px solid transparent;
545
+ border-right: 4px solid transparent;
546
+ border-top: 4px solid rgba(0, 0, 0, 0.75);
547
+ }
548
+ }
549
+
550
+ .coupon-tooltip.show {
551
+ opacity: 1;
552
+ }
553
+ }
@@ -0,0 +1,129 @@
1
+ import type { HyCouponProps } from "./typing";
2
+ import type { CSSProperties, PropType } from "vue";
3
+ import type { CouponStatus, CouponType } from "./typing";
4
+
5
+ export const defaultProps = {
6
+ amount: "",
7
+ title: "",
8
+ subTitle: "",
9
+ type: "primary",
10
+ status: "normal",
11
+ minSpend: 0,
12
+ validity: "",
13
+ customStyle: {} as CSSProperties,
14
+ customClass: "",
15
+ tooltip: "",
16
+ showActionButton: false,
17
+ customButtonText: "",
18
+ isExclusive: false,
19
+ limitPerUser: 0,
20
+ usedDate: "",
21
+ expireDate: "",
22
+ disabledReason: "",
23
+ triggerReceiveOnClick: true
24
+ };
25
+
26
+ export const props = {
27
+ /** 优惠券金额 */
28
+ amount: {
29
+ type: [String, Number],
30
+ required: true
31
+ },
32
+ /** 优惠券标题 */
33
+ title: {
34
+ type: String,
35
+ required: true
36
+ },
37
+ /** 优惠券副标题 */
38
+ subTitle: {
39
+ type: String,
40
+ default: defaultProps.subTitle
41
+ },
42
+ /**
43
+ * 优惠券主题类型
44
+ * @values primary,secondary,tertiary
45
+ */
46
+ type: {
47
+ type: String as PropType<CouponType>,
48
+ default: defaultProps.type,
49
+ validator: (value: CouponType) => {
50
+ return ["primary", "secondary", "tertiary"].includes(value);
51
+ }
52
+ },
53
+ /**
54
+ * 优惠券状态
55
+ * @values normal,disabled,used,expired
56
+ */
57
+ status: {
58
+ type: String as PropType<CouponStatus>,
59
+ default: defaultProps.status,
60
+ validator: (value: CouponStatus) => {
61
+ return ["normal", "disabled", "used", "expired"].includes(value);
62
+ }
63
+ },
64
+ /** 最小消费金额限制 */
65
+ minSpend: {
66
+ type: [String, Number],
67
+ default: defaultProps.minSpend
68
+ },
69
+ /** 有效期文本 */
70
+ validity: {
71
+ type: String,
72
+ default: defaultProps.validity
73
+ },
74
+ /** 自定义样式 */
75
+ customStyle: {
76
+ type: Object as PropType<CSSProperties>,
77
+ default: () => defaultProps.customStyle
78
+ },
79
+ /** 自定义类名 */
80
+ customClass: {
81
+ type: String,
82
+ default: defaultProps.customClass
83
+ },
84
+ /** 提示文本 */
85
+ tooltip: {
86
+ type: String,
87
+ default: defaultProps.tooltip
88
+ },
89
+ /** 是否显示操作按钮 */
90
+ showActionButton: {
91
+ type: Boolean,
92
+ default: defaultProps.showActionButton
93
+ },
94
+ /** 自定义按钮文本 */
95
+ customButtonText: {
96
+ type: String,
97
+ default: defaultProps.customButtonText
98
+ },
99
+ /** 是否为专属优惠券 */
100
+ isExclusive: {
101
+ type: Boolean,
102
+ default: defaultProps.isExclusive
103
+ },
104
+ /** 每用户限领数量 */
105
+ limitPerUser: {
106
+ type: Number,
107
+ default: defaultProps.limitPerUser
108
+ },
109
+ /** 使用日期(已使用状态时显示) */
110
+ usedDate: {
111
+ type: String,
112
+ default: defaultProps.usedDate
113
+ },
114
+ /** 过期日期(已过期状态时显示) */
115
+ expireDate: {
116
+ type: String,
117
+ default: defaultProps.expireDate
118
+ },
119
+ /** 禁用原因(已禁用状态时显示) */
120
+ disabledReason: {
121
+ type: String,
122
+ default: defaultProps.disabledReason
123
+ },
124
+ /** 点击时是否触发receive事件 */
125
+ triggerReceiveOnClick: {
126
+ type: Boolean,
127
+ default: defaultProps.triggerReceiveOnClick
128
+ }
129
+ };