hy-app 0.5.2 → 0.5.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 (39) hide show
  1. package/components/hy-action-sheet/index.scss +0 -5
  2. package/components/hy-back-top/hy-back-top.vue +10 -9
  3. package/components/hy-back-top/props.ts +5 -3
  4. package/components/hy-badge/hy-badge.vue +2 -1
  5. package/components/hy-badge/props.ts +5 -3
  6. package/components/hy-button/hy-button.vue +5 -5
  7. package/components/hy-button/index.scss +9 -0
  8. package/components/hy-button/props.ts +11 -6
  9. package/components/hy-coupon/hy-coupon.vue +159 -167
  10. package/components/hy-coupon/index.scss +130 -516
  11. package/components/hy-coupon/props.ts +98 -127
  12. package/components/hy-coupon/typing.d.ts +147 -146
  13. package/components/hy-folding-panel-item/hy-folding-panel-item.vue +1 -3
  14. package/components/hy-folding-panel-item/index.scss +0 -8
  15. package/components/hy-form-group/hy-form-group.vue +308 -511
  16. package/components/hy-form-group/index.scss +0 -33
  17. package/components/hy-form-group/props.ts +103 -13
  18. package/components/hy-form-group/typing.d.ts +0 -77
  19. package/components/hy-form-item/hy-form-item.vue +3 -3
  20. package/components/hy-input/hy-input.vue +16 -10
  21. package/components/hy-input/index.scss +4 -0
  22. package/components/hy-input/props.ts +2 -2
  23. package/components/hy-notice-bar/hy-column-notice.vue +63 -70
  24. package/components/hy-notice-bar/hy-row-notice.vue +92 -110
  25. package/components/hy-notice-bar/index.scss +2 -4
  26. package/components/hy-notice-bar/props.ts +4 -1
  27. package/components/hy-qrcode/hy-qrcode.vue +1 -1
  28. package/components/hy-qrcode/index.scss +1 -0
  29. package/components/hy-qrcode/qrcode.js +1208 -1402
  30. package/components/hy-rate/hy-rate.vue +0 -1
  31. package/components/hy-read-more/hy-read-more.vue +1 -1
  32. package/components/hy-textarea/hy-textarea.vue +1 -1
  33. package/components/hy-textarea/index.scss +8 -7
  34. package/components/hy-toast/index.scss +2 -7
  35. package/libs/css/common.scss +0 -5
  36. package/libs/typing/modules/form.ts +159 -163
  37. package/package.json +2 -2
  38. package/web-types.json +1 -1
  39. package/components/hy-coupon/README.md +0 -133
@@ -1,129 +1,100 @@
1
- import type { HyCouponProps } from "./typing";
2
- import type { CSSProperties, PropType } from "vue";
3
- import type { CouponStatus, CouponType } from "./typing";
1
+ import type { CSSProperties, PropType } from 'vue'
2
+ import type { HyButtonProps } from '../hy-button/typing'
4
3
 
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
- };
4
+ const couponProps = {
5
+ /** 优惠券标题 */
6
+ title: {
7
+ type: String,
8
+ default: ''
9
+ },
10
+ /** 优惠券开始时间 */
11
+ type: {
12
+ type: String,
13
+ default: ''
14
+ },
15
+ /** 优惠券开始时间 */
16
+ typeText: {
17
+ type: String,
18
+ default: ''
19
+ },
20
+ /** 优惠券状态 */
21
+ status: {
22
+ type: String,
23
+ default: ''
24
+ },
25
+ /** 优惠券禁用状态 */
26
+ disabledStatus: {
27
+ type: Array,
28
+ default: () => ['']
29
+ },
30
+ /** 优惠券描述 */
31
+ description: {
32
+ type: String,
33
+ default: ''
34
+ },
35
+ /** 优惠券金额 */
36
+ amount: {
37
+ type: [String, Number],
38
+ default: ''
39
+ },
40
+ /** 优惠券单位,没有就用默认值 */
41
+ unit: {
42
+ type: String,
43
+ default: ''
44
+ },
45
+ /** 优惠券开始时间 */
46
+ startDate: {
47
+ type: String,
48
+ default: ''
49
+ },
50
+ /** 优惠券结束时间 */
51
+ endDate: {
52
+ type: String,
53
+ default: ''
54
+ },
55
+ /** 时间格式 */
56
+ format: {
57
+ type: String,
58
+ default: 'yyyy-MM-dd'
59
+ },
60
+ /** 日期描述,没有日期描述就用开始时间到结束时间 */
61
+ dateDesc: {
62
+ type: String,
63
+ default: ''
64
+ },
65
+ /** 背景色 */
66
+ bgColor: {
67
+ type: String,
68
+ default: ''
69
+ },
70
+ /** 是否显示阴影 */
71
+ boxShadow: {
72
+ type: Boolean,
73
+ default: false
74
+ },
75
+ /**
76
+ * 按钮类型
77
+ * @values text,button
78
+ * */
79
+ btnMode: {
80
+ type: String,
81
+ default: 'button'
82
+ },
83
+ /** 按钮文字 */
84
+ btnText: {
85
+ type: String,
86
+ default: '立即领取'
87
+ },
88
+ buttonProp: {
89
+ type: Object as PropType<HyButtonProps>,
90
+ default: () => ({})
91
+ },
92
+ /** 定义需要用到的外部样式 */
93
+ customStyle: {
94
+ type: Object as PropType<CSSProperties>
95
+ },
96
+ /** 自定义外部类名 */
97
+ customClass: String
98
+ }
25
99
 
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
- };
100
+ export default couponProps
@@ -1,146 +1,147 @@
1
- import type { CSSProperties } from "vue";
2
-
3
- export type CouponStatus = 'normal' | 'disabled' | 'used' | 'expired';
4
- export type CouponType = 'primary' | 'secondary' | 'tertiary';
5
-
6
- export interface HyCouponProps {
7
- /**
8
- * 优惠券金额
9
- * @type {string}
10
- */
11
- amount: string;
12
-
13
- /**
14
- * 优惠券主题类型
15
- * @type {'primary' | 'secondary' | 'tertiary'}
16
- * @default 'primary'
17
- * @values primary, secondary, tertiary
18
- */
19
- type?: CouponType;
20
-
21
- /**
22
- * 优惠券标题
23
- * @type {string}
24
- */
25
- title: string;
26
-
27
- /**
28
- * 优惠券副标题
29
- * @type {string}
30
- * @default ''
31
- */
32
- subTitle?: string;
33
-
34
- /**
35
- * 优惠券状态
36
- * @type {'normal' | 'disabled' | 'used' | 'expired'}
37
- * @default 'normal'
38
- * @values normal, disabled, used, expired
39
- */
40
- status?: CouponStatus;
41
-
42
- /**
43
- * 最小消费金额限制
44
- * @type {number}
45
- * @default 0
46
- */
47
- minSpend?: number;
48
-
49
- /**
50
- * 有效期
51
- * @type {string}
52
- * @default ''
53
- */
54
- validity?: string;
55
-
56
- /**
57
- * 是否显示左边界装饰
58
- * @type {boolean}
59
- * @default true
60
- */
61
- showLeftBorder?: boolean;
62
-
63
- /**
64
- * 是否显示右边界装饰
65
- * @type {boolean}
66
- * @default true
67
- */
68
- showRightBorder?: boolean;
69
-
70
- /**
71
- * 自定义样式
72
- * @type {CSSProperties}
73
- * @default {}
74
- */
75
- customStyle?: CSSProperties;
76
-
77
- /**
78
- * 自定义类名
79
- * @type {string}
80
- * @default ''
81
- */
82
- customClass?: string;
83
-
84
- /**
85
- * 提示文本
86
- * @type {string}
87
- * @default ''
88
- */
89
- tooltip?: string;
90
-
91
- /**
92
- * 是否显示操作按钮
93
- * @type {boolean}
94
- * @default false
95
- */
96
- showActionButton?: boolean;
97
-
98
- /**
99
- * 自定义按钮文本
100
- * @type {string}
101
- * @default ''
102
- */
103
- customButtonText?: string;
104
-
105
- /**
106
- * 是否为专属优惠券
107
- * @type {boolean}
108
- * @default false
109
- */
110
- isExclusive?: boolean;
111
-
112
- /**
113
- * 每用户限领数量
114
- * @type {number}
115
- * @default 0
116
- */
117
- limitPerUser?: number;
118
-
119
- /**
120
- * 使用日期(已使用状态时显示)
121
- * @type {string}
122
- * @default ''
123
- */
124
- usedDate?: string;
125
-
126
- /**
127
- * 过期日期(已过期状态时显示)
128
- * @type {string}
129
- * @default ''
130
- */
131
- expireDate?: string;
132
-
133
- /**
134
- * 禁用原因(已禁用状态时显示)
135
- * @type {string}
136
- * @default ''
137
- */
138
- disabledReason?: string;
139
-
140
- /**
141
- * 点击时是否触发receive事件
142
- * @type {boolean}
143
- * @default true
144
- */
145
- triggerReceiveOnClick?: boolean;
146
- }
1
+ import type { CSSProperties } from 'vue'
2
+
3
+ export type CouponStatus = 'unused' | 'used' | 'expired' | 'redeemed'
4
+ /**
5
+ * moneyOff,discount:折扣券,fixedAmount,
6
+ * */
7
+ export type CouponType = 'moneyOff' | 'discount' | 'fixedAmount'
8
+
9
+ export interface HyCouponProps {
10
+ /**
11
+ * 优惠券金额
12
+ * @type {string}
13
+ */
14
+ amount: string
15
+
16
+ /**
17
+ * 优惠券标题
18
+ * @type {string}
19
+ */
20
+ title: string
21
+
22
+ /**
23
+ * 优惠券副标题
24
+ * @type {string}
25
+ * @default ''
26
+ */
27
+ subTitle?: string
28
+
29
+ /**
30
+ * 优惠券状态
31
+ * @type {'normal' | 'disabled' | 'used' | 'expired'}
32
+ * @default 'normal'
33
+ */
34
+ status?: CouponStatus
35
+
36
+ /**
37
+ * 最小消费金额限制
38
+ * @type {number}
39
+ * @default 0
40
+ */
41
+ minSpend?: number
42
+
43
+ /**
44
+ * 有效期
45
+ * @type {string}
46
+ * @default ''
47
+ */
48
+ validity?: string
49
+
50
+ /**
51
+ * 是否显示左边界装饰
52
+ * @type {boolean}
53
+ * @default true
54
+ */
55
+ showLeftBorder?: boolean
56
+
57
+ /**
58
+ * 是否显示右边界装饰
59
+ * @type {boolean}
60
+ * @default true
61
+ */
62
+ showRightBorder?: boolean
63
+
64
+ /**
65
+ * 自定义样式
66
+ * @type {CSSProperties}
67
+ * @default {}
68
+ */
69
+ customStyle?: CSSProperties
70
+
71
+ /**
72
+ * 自定义类名
73
+ * @type {string}
74
+ * @default ''
75
+ */
76
+ customClass?: string
77
+
78
+ /**
79
+ * 提示文本
80
+ * @type {string}
81
+ * @default ''
82
+ */
83
+ tooltip?: string
84
+
85
+ /**
86
+ * 是否显示操作按钮
87
+ * @type {boolean}
88
+ * @default false
89
+ */
90
+ showActionButton?: boolean
91
+
92
+ /**
93
+ * 自定义按钮文本
94
+ * @type {string}
95
+ * @default ''
96
+ */
97
+ customButtonText?: string
98
+
99
+ /**
100
+ * 是否为专属优惠券
101
+ * @type {boolean}
102
+ * @default false
103
+ */
104
+ isExclusive?: boolean
105
+
106
+ /**
107
+ * 每用户限领数量
108
+ * @type {number}
109
+ * @default 0
110
+ */
111
+ limitPerUser?: number
112
+
113
+ /**
114
+ * 使用日期(已使用状态时显示)
115
+ * @type {string}
116
+ * @default ''
117
+ */
118
+ usedDate?: string
119
+
120
+ /**
121
+ * 过期日期(已过期状态时显示)
122
+ * @type {string}
123
+ * @default ''
124
+ */
125
+ expireDate?: string
126
+
127
+ /**
128
+ * 禁用原因(已禁用状态时显示)
129
+ * @type {string}
130
+ * @default ''
131
+ */
132
+ disabledReason?: string
133
+
134
+ /**
135
+ * 点击时是否触发receive事件
136
+ * @type {boolean}
137
+ * @default true
138
+ */
139
+ triggerReceiveOnClick?: boolean
140
+ }
141
+
142
+ export interface ICouponEmits {
143
+ /** 点击优惠券 */
144
+ (e: 'click'): void
145
+ /** 点击使用优惠券 */
146
+ (e: 'used'): void
147
+ }
@@ -67,7 +67,7 @@ export default {
67
67
 
68
68
  <script setup lang="ts">
69
69
  import { ref, computed, inject, onMounted } from 'vue'
70
- import type { HyFoldingPanelItemEmits } from './typing'
70
+ import type { IFoldingPanelItemEmits } from './typing'
71
71
  import type { HyFoldingPanelGroupConfig } from '../hy-folding-panel/typing'
72
72
  import { addUnit, IconConfig } from '../../libs'
73
73
  import foldingPanelItemProps from './props'
@@ -94,7 +94,6 @@ const expanded = ref(props.defaultOpen)
94
94
  // 计算当前是否展开
95
95
  const isExpanded = computed(() => {
96
96
  if (groupConfig?.accordion?.value) {
97
- console.log(groupConfig.activeIndex.value, props.index)
98
97
  // 如果在group中,根据group的activeIndex判断
99
98
  return groupConfig.activeIndex.value === props.index
100
99
  }
@@ -105,7 +104,6 @@ const isExpanded = computed(() => {
105
104
  // 处理点击事件
106
105
  const handleClick = () => {
107
106
  if (props.disabled) return
108
- console.log(groupConfig?.accordion?.value)
109
107
 
110
108
  if (groupConfig?.accordion?.value) {
111
109
  // 在group中时,通知group更新激活索引
@@ -10,16 +10,8 @@
10
10
  pointer-events: none;
11
11
  }
12
12
 
13
- @include is(active) {
14
- background-color: $hy-background--active;
15
- }
16
-
17
13
  @include m(border) {
18
14
  border-bottom: $hy-border-line;
19
-
20
- &:last-child {
21
- border-bottom: none;
22
- }
23
15
  }
24
16
 
25
17
  @include m(large) {