hy-app 0.4.15 → 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 (206) 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/hy-coupon.vue +10 -5
  55. package/components/hy-coupon/index.scss +148 -64
  56. package/components/hy-coupon/props.ts +35 -50
  57. package/components/hy-coupon/typing.d.ts +10 -0
  58. package/components/hy-datetime-picker/hy-datetime-picker.vue +415 -580
  59. package/components/hy-datetime-picker/props.ts +142 -32
  60. package/components/hy-datetime-picker/typing.d.ts +132 -132
  61. package/components/hy-divider/hy-divider.vue +90 -169
  62. package/components/hy-divider/props.ts +78 -19
  63. package/components/hy-divider/typing.d.ts +60 -60
  64. package/components/hy-dropdown/hy-dropdown.vue +37 -71
  65. package/components/hy-dropdown/props.ts +38 -15
  66. package/components/hy-dropdown/typing.d.ts +44 -44
  67. package/components/hy-dropdown-item/hy-dropdown-item.vue +141 -173
  68. package/components/hy-dropdown-item/props.ts +19 -8
  69. package/components/hy-empty/hy-empty.vue +75 -129
  70. package/components/hy-empty/props.ts +57 -15
  71. package/components/hy-empty/typing.d.ts +84 -84
  72. package/components/hy-flex/hy-flex.vue +33 -88
  73. package/components/hy-flex/props.ts +58 -0
  74. package/components/hy-flex/typing.d.ts +14 -16
  75. package/components/hy-float-button/hy-float-button.vue +289 -406
  76. package/components/hy-float-button/props.ts +109 -25
  77. package/components/hy-folding-panel/hy-folding-panel.vue +74 -114
  78. package/components/hy-folding-panel/props.ts +42 -0
  79. package/components/hy-folding-panel/typing.d.ts +57 -57
  80. package/components/hy-folding-panel-item/hy-folding-panel-item.vue +139 -231
  81. package/components/hy-folding-panel-item/props.ts +81 -0
  82. package/components/hy-folding-panel-item/typing.d.ts +23 -23
  83. package/components/hy-form/hy-form.vue +172 -212
  84. package/components/hy-form/props.ts +37 -0
  85. package/components/hy-form/typing.d.ts +68 -61
  86. package/components/hy-form-group/typing.d.ts +74 -74
  87. package/components/hy-form-item/hy-form-item.vue +100 -129
  88. package/components/hy-form-item/props.ts +25 -0
  89. package/components/hy-form-item/typing.d.ts +40 -37
  90. package/components/hy-grid/hy-grid.vue +76 -132
  91. package/components/hy-grid/props.ts +58 -16
  92. package/components/hy-grid/typing.d.ts +66 -66
  93. package/components/hy-icon/hy-icon.vue +84 -161
  94. package/components/hy-icon/props.ts +76 -22
  95. package/components/hy-icon/typing.d.ts +83 -82
  96. package/components/hy-image/hy-image.vue +142 -272
  97. package/components/hy-image/props.ts +105 -23
  98. package/components/hy-image/typing.d.ts +84 -87
  99. package/components/hy-input/hy-input.vue +230 -421
  100. package/components/hy-input/props.ts +183 -35
  101. package/components/hy-input/typing.d.ts +169 -169
  102. package/components/hy-line/hy-line.vue +34 -72
  103. package/components/hy-line/props.ts +41 -10
  104. package/components/hy-line/typing.d.ts +29 -29
  105. package/components/hy-line-progress/hy-line-progress.vue +66 -101
  106. package/components/hy-line-progress/props.ts +31 -10
  107. package/components/hy-line-progress/typing.d.ts +29 -29
  108. package/components/hy-list/hy-list.vue +151 -220
  109. package/components/hy-list/props.ts +67 -16
  110. package/components/hy-list/typing.d.ts +52 -52
  111. package/components/hy-loading/hy-loading.vue +63 -119
  112. package/components/hy-loading/props.ts +63 -15
  113. package/components/hy-loading/typing.d.ts +49 -49
  114. package/components/hy-menu/hy-menu.vue +124 -166
  115. package/components/hy-menu/props.ts +42 -10
  116. package/components/hy-menu/typing.d.ts +60 -60
  117. package/components/hy-modal/hy-modal.vue +127 -218
  118. package/components/hy-modal/props.ts +89 -24
  119. package/components/hy-navbar/hy-navbar.vue +104 -177
  120. package/components/hy-navbar/props.ts +76 -22
  121. package/components/hy-navbar/typing.d.ts +81 -81
  122. package/components/hy-notice-bar/hy-notice-bar.vue +67 -144
  123. package/components/hy-notice-bar/props.ts +80 -19
  124. package/components/hy-notice-bar/typing.d.ts +62 -62
  125. package/components/hy-notify/hy-notify.vue +128 -177
  126. package/components/hy-notify/props.ts +49 -12
  127. package/components/hy-notify/typing.d.ts +45 -41
  128. package/components/hy-number-step/hy-number-step.vue +281 -394
  129. package/components/hy-number-step/props.ts +110 -27
  130. package/components/hy-number-step/typing.d.ts +120 -120
  131. package/components/hy-overlay/hy-overlay.vue +39 -66
  132. package/components/hy-overlay/props.ts +31 -8
  133. package/components/hy-pagination/hy-pagination.vue +100 -155
  134. package/components/hy-pagination/props.ts +53 -13
  135. package/components/hy-picker/hy-picker.vue +309 -430
  136. package/components/hy-picker/index.scss +8 -12
  137. package/components/hy-picker/props.ts +110 -26
  138. package/components/hy-popover/hy-popover.vue +190 -252
  139. package/components/hy-popover/props.ts +48 -10
  140. package/components/hy-popup/hy-popup.vue +162 -248
  141. package/components/hy-popup/props.ts +82 -18
  142. package/components/hy-price/hy-price.vue +45 -104
  143. package/components/hy-price/props.ts +52 -12
  144. package/components/hy-price/typing.d.ts +41 -36
  145. package/components/hy-qrcode/hy-qrcode.vue +115 -185
  146. package/components/hy-qrcode/props.ts +68 -18
  147. package/components/hy-qrcode/typing.d.ts +67 -66
  148. package/components/hy-radio/hy-radio.vue +161 -259
  149. package/components/hy-radio/props.ts +95 -25
  150. package/components/hy-radio/typing.d.ts +85 -84
  151. package/components/hy-rate/hy-rate.vue +185 -270
  152. package/components/hy-rate/props.ts +76 -18
  153. package/components/hy-rate/typing.d.ts +61 -60
  154. package/components/hy-read-more/hy-read-more.vue +93 -136
  155. package/components/hy-read-more/props.ts +43 -13
  156. package/components/hy-scroll-list/hy-scroll-list.vue +81 -102
  157. package/components/hy-scroll-list/props.ts +22 -11
  158. package/components/hy-search/hy-search.vue +155 -284
  159. package/components/hy-search/props.ts +130 -25
  160. package/components/hy-signature/hy-signature.vue +491 -635
  161. package/components/hy-signature/props.ts +115 -26
  162. package/components/hy-signature/typing.d.ts +138 -138
  163. package/components/hy-slider/hy-slider.vue +388 -477
  164. package/components/hy-slider/props.ts +75 -19
  165. package/components/hy-steps/hy-steps.vue +212 -279
  166. package/components/hy-steps/props.ts +47 -13
  167. package/components/hy-submit-bar/hy-submit-bar.vue +136 -221
  168. package/components/hy-submit-bar/props.ts +89 -20
  169. package/components/hy-submit-bar/typing.d.ts +87 -87
  170. package/components/hy-subsection/hy-subsection.vue +132 -185
  171. package/components/hy-subsection/props.ts +50 -17
  172. package/components/hy-subsection/typing.d.ts +52 -52
  173. package/components/hy-swipe-action/hy-swipe-action.vue +228 -283
  174. package/components/hy-swipe-action/props.ts +43 -18
  175. package/components/hy-swipe-action/typing.d.ts +46 -46
  176. package/components/hy-swiper/hy-swiper.vue +159 -286
  177. package/components/hy-swiper/props.ts +126 -28
  178. package/components/hy-swiper/typing.d.ts +115 -115
  179. package/components/hy-switch/hy-switch.vue +112 -176
  180. package/components/hy-switch/props.ts +60 -15
  181. package/components/hy-switch/typing.d.ts +63 -63
  182. package/components/hy-tabBar/hy-tabBar.vue +64 -60
  183. package/components/hy-tabs/hy-tabs.vue +277 -380
  184. package/components/hy-tabs/props.ts +75 -18
  185. package/components/hy-tag/hy-tag.vue +111 -204
  186. package/components/hy-tag/props.ts +81 -19
  187. package/components/hy-text/hy-text.vue +200 -322
  188. package/components/hy-text/props.ts +107 -28
  189. package/components/hy-textarea/hy-textarea.vue +147 -256
  190. package/components/hy-textarea/props.ts +112 -25
  191. package/components/hy-textarea/typing.d.ts +42 -42
  192. package/components/hy-toast/hy-toast.vue +135 -143
  193. package/components/hy-tooltip/hy-tooltip.vue +220 -306
  194. package/components/hy-tooltip/props.ts +79 -15
  195. package/components/hy-transition/hy-transition.vue +111 -138
  196. package/components/hy-transition/props.ts +30 -8
  197. package/components/hy-upload/hy-upload.vue +320 -469
  198. package/components/hy-upload/props.ts +130 -27
  199. package/components/hy-warn/hy-warn.vue +80 -129
  200. package/components/hy-warn/props.ts +47 -12
  201. package/components/hy-waterfall/hy-waterfall.vue +139 -163
  202. package/components/hy-waterfall/props.ts +19 -7
  203. package/components/hy-watermark/hy-watermark.vue +762 -870
  204. package/components/hy-watermark/props.ts +103 -22
  205. package/package.json +2 -2
  206. package/web-types.json +1 -1
@@ -1,51 +1,51 @@
1
1
  export default interface HyCountToProps {
2
- /**
3
- * @description 开始的数值,默认从0增长到某一个数(默认 0 )
4
- * */
5
- startVal?: number;
6
- /**
7
- * @description 要滚动的目标数值,必须 (默认 0 )
8
- * */
9
- endVal: number;
10
- /**
11
- * @description 滚动到目标数值的动画持续时间,单位为毫秒(ms) (默认
12
- * */
13
- duration?: number;
14
- /**
15
- * @description 设置数值后是否自动开始滚动 (默认 true )
16
- * */
17
- autoplay?: boolean;
18
- /**
19
- * @description 要显示的小数位数,见官网说明(默认 0 )
20
- * */
21
- decimals?: number;
22
- /**
23
- * @description 滚动结束时,是否缓动结尾,见官网说明(默认 true )
24
- * */
25
- useEasing?: boolean;
26
- /**
27
- * @description 十进制分割 ( 默认 "." )
28
- * */
29
- decimal?: string;
30
- /**
31
- * @description 字体颜色( 默认 '#606266' )
32
- * */
33
- color?: string;
34
- /**
35
- * @description 字体大小,单位px( 默认 22 )
36
- * */
37
- fontSize?: number | string;
38
- /**
39
- * @description 字体是否加粗(默认 false )
40
- * */
41
- bold?: boolean;
42
- /**
43
- * @description 千位分隔符,见官网说明
44
- * */
45
- separator?: string;
2
+ /**
3
+ * @description 开始的数值,默认从0增长到某一个数(默认 0 )
4
+ * */
5
+ startVal?: number
6
+ /**
7
+ * @description 要滚动的目标数值,必须 (默认 0 )
8
+ * */
9
+ endVal: number
10
+ /**
11
+ * @description 滚动到目标数值的动画持续时间,单位为毫秒(ms) (默认
12
+ * */
13
+ duration?: number
14
+ /**
15
+ * @description 设置数值后是否自动开始滚动 (默认 true )
16
+ * */
17
+ autoplay?: boolean
18
+ /**
19
+ * @description 要显示的小数位数,见官网说明(默认 0 )
20
+ * */
21
+ decimals?: number
22
+ /**
23
+ * @description 滚动结束时,是否缓动结尾,见官网说明(默认 true )
24
+ * */
25
+ useEasing?: boolean
26
+ /**
27
+ * @description 十进制分割 ( 默认 "." )
28
+ * */
29
+ decimal?: string
30
+ /**
31
+ * @description 字体颜色( 默认 '#606266' )
32
+ * */
33
+ color?: string
34
+ /**
35
+ * @description 字体大小,单位px( 默认 22 )
36
+ * */
37
+ fontSize?: number | string
38
+ /**
39
+ * @description 字体是否加粗(默认 false )
40
+ * */
41
+ bold?: boolean
42
+ /**
43
+ * @description 千位分隔符,见官网说明
44
+ * */
45
+ separator?: string
46
46
  }
47
47
 
48
48
  export interface ICountToEmits {
49
- /** 结束执行函数 */
50
- (e: "end"): void;
49
+ /** 结束执行函数 */
50
+ (e: 'end'): void
51
51
  }
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <view
3
- :class="['hy-coupon', `hy-coupon--${status}`, customClass]"
3
+ :class="['hy-coupon', `hy-coupon--${status}`, `hy-coupon--${type}`, customClass]"
4
4
  :style="customStyle"
5
5
  @click="handleClick"
6
6
  @mouseenter="handleMouseEnter"
@@ -9,7 +9,7 @@
9
9
  <!-- 顶部和底部波浪形装饰 -->
10
10
  <view class="top-wave"></view>
11
11
  <view class="bottom-wave"></view>
12
-
12
+
13
13
  <!-- 左侧金额区域 -->
14
14
  <view class="hy-coupon__left">
15
15
  <!-- 背景纹理 -->
@@ -57,14 +57,19 @@
57
57
 
58
58
  <script lang="ts">
59
59
  import { defineComponent, ref, computed } from "vue";
60
- import { props } from "./props";
61
60
  import type { CouponStatus } from "./typing";
61
+ import { props } from "./props";
62
62
 
63
+ /**
64
+ * 优惠券组件
65
+ * @displayName hy-coupon
66
+ */
63
67
  export default defineComponent({
64
68
  name: "HyCoupon",
65
69
  props,
66
70
  emits: ["click", "receive", "hover"],
67
- setup(props, { emit }) {
71
+ setup(props: any, { emit }) {
72
+
68
73
  // 响应式数据
69
74
  const showTooltip = ref(false);
70
75
 
@@ -166,7 +171,7 @@ export default defineComponent({
166
171
  handleMouseEnter,
167
172
  handleMouseLeave,
168
173
  };
169
- },
174
+ }
170
175
  });
171
176
  </script>
172
177
 
@@ -2,52 +2,113 @@
2
2
  @use "../../libs/css/theme" as *;
3
3
 
4
4
  // 优惠券主题颜色变量
5
- $coupon-primary-bg: $hy-primary !default;
6
- $coupon-disabled-bg: $hy-info !default;
7
- $coupon-used-bg: $hy-info !default;
8
- $coupon-expired-bg: $hy-warning !default;
9
- $coupon-content-bg: $hy-background--2 !default;
10
- $coupon-light-bg: $hy-primary-light !default;
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;
11
13
 
12
14
  @include b(coupon) {
13
15
  position: relative;
14
16
  background-color: $coupon-light-bg;
15
- border-radius: 8px;
17
+ border-radius: 12px;
16
18
  overflow: hidden;
17
- height: 96px;
19
+ height: 110px;
18
20
  display: flex;
19
21
  align-items: stretch;
20
- margin: 10px 0;
21
- box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
22
- transition: all 0.3s ease;
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);
23
25
  cursor: pointer;
24
26
 
25
27
  // 点击交互效果
26
28
  &:active {
27
- transform: scale(0.98);
28
- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
29
+ transform: scale(0.97);
30
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
29
31
  }
30
32
 
31
33
  // 正常状态悬浮效果
32
34
  &:not(.hy-coupon--disabled):not(.hy-coupon--used):not(.hy-coupon--expired) {
33
35
  &:hover {
34
- box-shadow: 0 4px 12px rgba(41, 121, 255, 0.15);
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
+ }
35
95
  }
36
96
  }
37
97
 
38
98
  // 左侧金额区域
39
99
  @include e(left) {
40
100
  position: relative;
41
- width: 96px;
42
- background-color: $coupon-primary-bg;
101
+ width: 110px;
102
+ background: $coupon-primary-bg;
43
103
  color: white;
44
104
  display: flex;
45
105
  flex-direction: column;
46
106
  align-items: center;
47
107
  justify-content: center;
48
- padding: 12px 0;
108
+ padding: 16px 0;
49
109
  box-sizing: border-box;
50
110
  overflow: hidden;
111
+ border-radius: 12px 0 0 12px;
51
112
 
52
113
  // 装饰圆点 - 右侧
53
114
  &::after {
@@ -85,64 +146,69 @@ $coupon-light-bg: $hy-primary-light !default;
85
146
  right: 0;
86
147
  bottom: 0;
87
148
  background-image:
88
- linear-gradient(45deg, rgba(255, 255, 255, 0.05) 25%, transparent 25%),
89
- linear-gradient(-45deg, rgba(255, 255, 255, 0.05) 25%, transparent 25%),
90
- linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.05) 75%),
91
- linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.05) 75%);
92
- background-size: 20px 20px;
93
- background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
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%;
94
152
  z-index: 0;
95
153
  }
96
154
 
97
155
  // 金额样式
98
156
  .amount {
99
- font-size: 26px;
100
- font-weight: bold;
157
+ font-size: 32px;
158
+ font-weight: 800;
101
159
  line-height: 1;
102
160
  z-index: 1;
103
161
  position: relative;
162
+ letter-spacing: -1px;
104
163
  }
105
164
 
106
165
  .amount-symbol {
107
- font-size: 14px;
166
+ font-size: 16px;
108
167
  vertical-align: top;
109
168
  margin-right: 2px;
110
169
  opacity: 0.9;
170
+ font-weight: 600;
111
171
  }
112
172
 
113
173
  .min-spend {
114
- font-size: 11px;
115
- opacity: 0.85;
116
- margin-top: 6px;
174
+ font-size: 12px;
175
+ opacity: 0.9;
176
+ margin-top: 8px;
117
177
  z-index: 1;
118
178
  position: relative;
179
+ background: rgba(255, 255, 255, 0.2);
180
+ padding: 2px 8px;
181
+ border-radius: 10px;
182
+ backdrop-filter: blur(5px);
119
183
  }
120
184
  }
121
185
 
122
186
  // 右侧内容区域
123
187
  @include e(right) {
124
188
  flex: 1;
125
- padding: 14px 20px 14px 24px;
189
+ padding: 16px 24px 16px 28px;
126
190
  display: flex;
127
191
  flex-direction: column;
128
- justify-content: space-between;
192
+ justify-content: center;
129
193
  position: relative;
130
194
  background-color: $coupon-content-bg;
131
195
  min-width: 0; // 防止内容溢出
196
+ border-radius: 0 12px 12px 0;
132
197
 
133
198
  .content {
134
199
  flex: 1;
135
200
  display: flex;
136
201
  flex-direction: column;
137
202
  justify-content: center;
203
+ margin-bottom: 8px;
138
204
  }
139
205
 
140
206
  .title {
141
- font-size: 15px;
142
- font-weight: 600;
207
+ font-size: 17px;
208
+ font-weight: 700;
143
209
  color: $hy-text-color;
144
210
  line-height: 1.3;
145
- margin-bottom: 4px;
211
+ margin-bottom: 6px;
146
212
  overflow: hidden;
147
213
  text-overflow: ellipsis;
148
214
  display: -webkit-box;
@@ -151,7 +217,7 @@ $coupon-light-bg: $hy-primary-light !default;
151
217
  }
152
218
 
153
219
  .subtitle {
154
- font-size: 12px;
220
+ font-size: 13px;
155
221
  color: $hy-text-color--2;
156
222
  line-height: 1.4;
157
223
  overflow: hidden;
@@ -159,7 +225,7 @@ $coupon-light-bg: $hy-primary-light !default;
159
225
  display: -webkit-box;
160
226
  -webkit-line-clamp: 1;
161
227
  -webkit-box-orient: vertical;
162
- margin-bottom: 6px;
228
+ margin-bottom: 8px;
163
229
  }
164
230
 
165
231
  .validity {
@@ -302,11 +368,11 @@ $coupon-light-bg: $hy-primary-light !default;
302
368
  // 装饰性的虚线边框效果 - 更美观的实现
303
369
  .coupon-border-left {
304
370
  position: absolute;
305
- left: 96px;
306
- top: 0;
307
- bottom: 0;
371
+ left: 110px;
372
+ top: 10px;
373
+ bottom: 10px;
308
374
  width: 1px;
309
- background-image: linear-gradient(transparent 50%, $hy-border-color 50%);
375
+ background-image: linear-gradient(transparent 50%, rgba(255, 255, 255, 0.3) 50%);
310
376
  background-size: 1px 8px;
311
377
  z-index: 1;
312
378
  }
@@ -314,8 +380,8 @@ $coupon-light-bg: $hy-primary-light !default;
314
380
  .coupon-border-right {
315
381
  position: absolute;
316
382
  right: 0;
317
- top: 0;
318
- bottom: 0;
383
+ top: 10px;
384
+ bottom: 10px;
319
385
  width: 1px;
320
386
  background-image: linear-gradient(transparent 50%, $hy-border-color 50%);
321
387
  background-size: 1px 8px;
@@ -372,26 +438,39 @@ $coupon-light-bg: $hy-primary-light !default;
372
438
  // 响应式适配
373
439
  @media (max-width: 375px) {
374
440
  @include b(coupon) {
375
- height: 90px;
441
+ height: 100px;
376
442
 
377
443
  @include e(left) {
378
- width: 85px;
444
+ width: 95px;
379
445
 
380
446
  .amount {
381
- font-size: 22px;
447
+ font-size: 28px;
448
+ }
449
+
450
+ .min-spend {
451
+ font-size: 11px;
382
452
  }
383
453
  }
384
454
 
385
455
  @include e(right) {
386
- padding: 12px 16px 12px 20px;
456
+ padding: 14px 20px 14px 24px;
387
457
 
388
458
  .title {
389
- font-size: 14px;
459
+ font-size: 16px;
460
+ }
461
+
462
+ .subtitle {
463
+ font-size: 12px;
390
464
  }
391
465
  }
392
466
 
393
467
  .coupon-border-left {
394
- left: 85px;
468
+ left: 95px;
469
+ }
470
+
471
+ .action-button {
472
+ font-size: 12px;
473
+ padding: 5px 14px;
395
474
  }
396
475
  }
397
476
  }
@@ -399,38 +478,43 @@ $coupon-light-bg: $hy-primary-light !default;
399
478
  .hy-coupon {
400
479
  .limit-tags {
401
480
  position: absolute;
402
- top: 8px;
403
- right: 8px;
481
+ top: 10px;
482
+ right: 10px;
404
483
  display: flex;
405
- gap: 4px;
484
+ gap: 6px;
406
485
  flex-wrap: wrap;
407
486
  }
408
487
 
409
488
  .limit-tag {
410
- background-color: rgba(41, 121, 255, 0.1);
411
- color: $hy-primary;
412
- font-size: 10px;
413
- padding: 2px 6px;
414
- border-radius: 4px;
489
+ background-color: rgba(255, 107, 107, 0.15);
490
+ color: #ff6b6b;
491
+ font-size: 11px;
492
+ padding: 3px 8px;
493
+ border-radius: 6px;
415
494
  white-space: nowrap;
495
+ font-weight: 500;
496
+ box-shadow: 0 2px 4px rgba(255, 107, 107, 0.1);
416
497
  }
417
498
 
418
499
  .action-button {
419
500
  position: absolute;
420
- bottom: 8px;
421
- right: 8px;
422
- background-color: $hy-primary;
501
+ bottom: 10px;
502
+ right: 10px;
503
+ background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
423
504
  color: white;
424
- font-size: 12px;
425
- padding: 4px 12px;
426
- border-radius: 12px;
505
+ font-size: 13px;
506
+ padding: 6px 16px;
507
+ border-radius: 16px;
427
508
  white-space: nowrap;
428
- transition: all 0.2s ease;
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);
429
512
  }
430
513
 
431
514
  .action-button:active {
432
- background-color: $hy-primary;
515
+ background: linear-gradient(135deg, #ee5a6f 0%, #ff6b6b 100%);
433
516
  transform: scale(0.95);
517
+ box-shadow: 0 2px 6px rgba(255, 107, 107, 0.3);
434
518
  }
435
519
 
436
520
  .coupon-tooltip {
@@ -1,141 +1,126 @@
1
1
  import type { HyCouponProps } from "./typing";
2
2
  import type { CSSProperties, PropType } from "vue";
3
- import type { CouponStatus } from "./typing";
3
+ import type { CouponStatus, CouponType } from "./typing";
4
4
 
5
- export const defaultProps: HyCouponProps = {
6
- amount: '',
7
- title: '',
8
- subTitle: '',
9
- status: 'normal' as CouponStatus,
5
+ export const defaultProps = {
6
+ amount: "",
7
+ title: "",
8
+ subTitle: "",
9
+ type: "primary",
10
+ status: "normal",
10
11
  minSpend: 0,
11
- validity: '',
12
- showLeftBorder: true,
13
- showRightBorder: true,
12
+ validity: "",
14
13
  customStyle: {} as CSSProperties,
15
- customClass: '',
16
- tooltip: '',
14
+ customClass: "",
15
+ tooltip: "",
17
16
  showActionButton: false,
18
- customButtonText: '',
17
+ customButtonText: "",
19
18
  isExclusive: false,
20
19
  limitPerUser: 0,
21
- usedDate: '',
22
- expireDate: '',
23
- disabledReason: '',
20
+ usedDate: "",
21
+ expireDate: "",
22
+ disabledReason: "",
24
23
  triggerReceiveOnClick: true
25
24
  };
26
25
 
27
26
  export const props = {
28
27
  /** 优惠券金额 */
29
28
  amount: {
30
- type: String,
29
+ type: [String, Number],
31
30
  required: true
32
31
  },
33
-
34
32
  /** 优惠券标题 */
35
33
  title: {
36
34
  type: String,
37
35
  required: true
38
36
  },
39
-
40
37
  /** 优惠券副标题 */
41
38
  subTitle: {
42
39
  type: String,
43
40
  default: defaultProps.subTitle
44
41
  },
45
-
46
- /** 优惠券状态 */
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
+ */
47
57
  status: {
48
58
  type: String as PropType<CouponStatus>,
49
59
  default: defaultProps.status,
50
- validator: (v: string): boolean => {
51
- return ['normal', 'disabled', 'used', 'expired'].includes(v);
60
+ validator: (value: CouponStatus) => {
61
+ return ["normal", "disabled", "used", "expired"].includes(value);
52
62
  }
53
63
  },
54
-
55
64
  /** 最小消费金额限制 */
56
65
  minSpend: {
57
- type: Number,
66
+ type: [String, Number],
58
67
  default: defaultProps.minSpend
59
68
  },
60
-
61
- /** 有效期 */
69
+ /** 有效期文本 */
62
70
  validity: {
63
71
  type: String,
64
72
  default: defaultProps.validity
65
73
  },
66
-
67
- /** 是否显示左边界装饰 */
68
- showLeftBorder: {
69
- type: Boolean,
70
- default: defaultProps.showLeftBorder
71
- },
72
-
73
- /** 是否显示右边界装饰 */
74
- showRightBorder: {
75
- type: Boolean,
76
- default: defaultProps.showRightBorder
77
- },
78
-
79
74
  /** 自定义样式 */
80
75
  customStyle: {
81
76
  type: Object as PropType<CSSProperties>,
82
- default: () => ({})
77
+ default: () => defaultProps.customStyle
83
78
  },
84
-
85
79
  /** 自定义类名 */
86
80
  customClass: {
87
81
  type: String,
88
82
  default: defaultProps.customClass
89
83
  },
90
-
91
84
  /** 提示文本 */
92
85
  tooltip: {
93
86
  type: String,
94
87
  default: defaultProps.tooltip
95
88
  },
96
-
97
89
  /** 是否显示操作按钮 */
98
90
  showActionButton: {
99
91
  type: Boolean,
100
92
  default: defaultProps.showActionButton
101
93
  },
102
-
103
94
  /** 自定义按钮文本 */
104
95
  customButtonText: {
105
96
  type: String,
106
97
  default: defaultProps.customButtonText
107
98
  },
108
-
109
99
  /** 是否为专属优惠券 */
110
100
  isExclusive: {
111
101
  type: Boolean,
112
102
  default: defaultProps.isExclusive
113
103
  },
114
-
115
104
  /** 每用户限领数量 */
116
105
  limitPerUser: {
117
106
  type: Number,
118
107
  default: defaultProps.limitPerUser
119
108
  },
120
-
121
109
  /** 使用日期(已使用状态时显示) */
122
110
  usedDate: {
123
111
  type: String,
124
112
  default: defaultProps.usedDate
125
113
  },
126
-
127
114
  /** 过期日期(已过期状态时显示) */
128
115
  expireDate: {
129
116
  type: String,
130
117
  default: defaultProps.expireDate
131
118
  },
132
-
133
119
  /** 禁用原因(已禁用状态时显示) */
134
120
  disabledReason: {
135
121
  type: String,
136
122
  default: defaultProps.disabledReason
137
123
  },
138
-
139
124
  /** 点击时是否触发receive事件 */
140
125
  triggerReceiveOnClick: {
141
126
  type: Boolean,