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.
- package/components/hy-action-sheet/index.scss +0 -5
- package/components/hy-back-top/hy-back-top.vue +10 -9
- package/components/hy-back-top/props.ts +5 -3
- package/components/hy-badge/hy-badge.vue +2 -1
- package/components/hy-badge/props.ts +5 -3
- package/components/hy-button/hy-button.vue +5 -5
- package/components/hy-button/index.scss +9 -0
- package/components/hy-button/props.ts +11 -6
- package/components/hy-coupon/hy-coupon.vue +159 -167
- package/components/hy-coupon/index.scss +130 -516
- package/components/hy-coupon/props.ts +98 -127
- package/components/hy-coupon/typing.d.ts +147 -146
- package/components/hy-folding-panel-item/hy-folding-panel-item.vue +1 -3
- package/components/hy-folding-panel-item/index.scss +0 -8
- package/components/hy-form-group/hy-form-group.vue +308 -511
- package/components/hy-form-group/index.scss +0 -33
- package/components/hy-form-group/props.ts +103 -13
- package/components/hy-form-group/typing.d.ts +0 -77
- package/components/hy-form-item/hy-form-item.vue +3 -3
- package/components/hy-input/hy-input.vue +16 -10
- package/components/hy-input/index.scss +4 -0
- package/components/hy-input/props.ts +2 -2
- package/components/hy-notice-bar/hy-column-notice.vue +63 -70
- package/components/hy-notice-bar/hy-row-notice.vue +92 -110
- package/components/hy-notice-bar/index.scss +2 -4
- package/components/hy-notice-bar/props.ts +4 -1
- package/components/hy-qrcode/hy-qrcode.vue +1 -1
- package/components/hy-qrcode/index.scss +1 -0
- package/components/hy-qrcode/qrcode.js +1208 -1402
- package/components/hy-rate/hy-rate.vue +0 -1
- package/components/hy-read-more/hy-read-more.vue +1 -1
- package/components/hy-textarea/hy-textarea.vue +1 -1
- package/components/hy-textarea/index.scss +8 -7
- package/components/hy-toast/index.scss +2 -7
- package/libs/css/common.scss +0 -5
- package/libs/typing/modules/form.ts +159 -163
- package/package.json +2 -2
- package/web-types.json +1 -1
- package/components/hy-coupon/README.md +0 -133
|
@@ -1,129 +1,100 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
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
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
|
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
|
|
2
|
-
|
|
3
|
-
export type CouponStatus = '
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
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 {
|
|
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) {
|