hy-app 0.5.11 → 0.5.12
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-button/hy-button.vue +289 -275
- package/components/hy-button/index.scss +24 -1
- package/components/hy-button/props.ts +143 -135
- package/components/hy-button/typing.d.ts +35 -30
- package/components/hy-coupon/hy-coupon.vue +183 -172
- package/components/hy-coupon/index.scss +12 -16
- package/components/hy-coupon/props.ts +108 -103
- package/components/hy-form/hy-form.vue +220 -220
- package/components/hy-input/hy-input.vue +333 -333
- package/components/hy-input/index.scss +1 -2
- package/components/hy-input/props.ts +186 -186
- package/components/hy-notice-bar/hy-row-notice.vue +121 -121
- package/components/hy-parse/node/node.vue +619 -422
- package/components/hy-parse/parser.js +1253 -1060
- package/components/hy-table/hy-table.vue +579 -358
- package/components/hy-table/index.scss +134 -159
- package/components/hy-table/props.ts +62 -47
- package/components/hy-table/typing.d.ts +29 -34
- package/components/hy-tabs/hy-tabs.vue +335 -335
- package/components/hy-text/hy-text.vue +237 -237
- package/components/hy-text/props.ts +115 -115
- package/components/hy-textarea/hy-textarea.vue +198 -197
- package/components/hy-textarea/index.scss +2 -3
- package/components/hy-toast/hy-toast.vue +190 -190
- package/libs/css/theme.scss +1 -0
- package/libs/css/vars.scss +2 -2
- package/libs/typing/modules/common.d.ts +139 -139
- package/libs/utils/inside.ts +336 -350
- package/package.json +2 -2
- package/web-types.json +1 -1
|
@@ -1,172 +1,183 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<view
|
|
3
|
-
:class="cardClass"
|
|
4
|
-
@click="handleClick"
|
|
5
|
-
:style="[
|
|
6
|
-
{
|
|
7
|
-
background: bgColor,
|
|
8
|
-
filter: boxShadow ? 'drop-shadow(2px 2px 2px rgba(0, 0, 0, 0.2))' : ''
|
|
9
|
-
},
|
|
10
|
-
customStyle
|
|
11
|
-
]"
|
|
12
|
-
>
|
|
13
|
-
<!-- 优惠券主体 -->
|
|
14
|
-
<view class="hy-coupon__content">
|
|
15
|
-
<!-- 左侧金额/折扣信息 -->
|
|
16
|
-
<view class="hy-coupon__content--left">
|
|
17
|
-
<!-- @slot 自定义金额插槽 -->
|
|
18
|
-
<slot v-if="$slots.left" name="left"></slot>
|
|
19
|
-
<template v-else>
|
|
20
|
-
<view class="hy-coupon__content--left__block">
|
|
21
|
-
<view class="hy-coupon__content--left__value">
|
|
22
|
-
<text>
|
|
23
|
-
{{ amount || 0 }}
|
|
24
|
-
</text>
|
|
25
|
-
</view>
|
|
26
|
-
<view class="hy-coupon__content--left__suffix">
|
|
27
|
-
<text v-if="unit">{{ unit }}</text>
|
|
28
|
-
<text v-else-if="type === 'discount'">折</text>
|
|
29
|
-
<text v-else>元</text>
|
|
30
|
-
</view>
|
|
31
|
-
</view>
|
|
32
|
-
|
|
33
|
-
<hy-tag
|
|
34
|
-
:text="typeValue"
|
|
35
|
-
size="mini"
|
|
36
|
-
plain
|
|
37
|
-
shape="circle"
|
|
38
|
-
color="#FFFFFF"
|
|
39
|
-
></hy-tag>
|
|
40
|
-
</template>
|
|
41
|
-
</view>
|
|
42
|
-
|
|
43
|
-
<hy-line
|
|
44
|
-
:hairline="false"
|
|
45
|
-
direction="column"
|
|
46
|
-
dashed
|
|
47
|
-
color="#FFFFFF"
|
|
48
|
-
length="70%"
|
|
49
|
-
></hy-line>
|
|
50
|
-
|
|
51
|
-
<!-- 右侧描述信息 -->
|
|
52
|
-
<view class="hy-coupon__content--right">
|
|
53
|
-
<!-- 自定义详情插槽 -->
|
|
54
|
-
<slot v-if="$slots.right" name="right"></slot>
|
|
55
|
-
<template v-else>
|
|
56
|
-
<view class="hy-coupon__content--right__name">{{ title }}</view>
|
|
57
|
-
<view
|
|
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
|
-
import
|
|
112
|
-
import
|
|
113
|
-
import
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
const
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
case '
|
|
140
|
-
text = '
|
|
141
|
-
break
|
|
142
|
-
|
|
143
|
-
text = '
|
|
144
|
-
break
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
const
|
|
159
|
-
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<view
|
|
3
|
+
:class="cardClass"
|
|
4
|
+
@click="handleClick"
|
|
5
|
+
:style="[
|
|
6
|
+
{
|
|
7
|
+
background: bgColor,
|
|
8
|
+
filter: boxShadow ? 'drop-shadow(2px 2px 2px rgba(0, 0, 0, 0.2))' : ''
|
|
9
|
+
},
|
|
10
|
+
customStyle
|
|
11
|
+
]"
|
|
12
|
+
>
|
|
13
|
+
<!-- 优惠券主体 -->
|
|
14
|
+
<view class="hy-coupon__content">
|
|
15
|
+
<!-- 左侧金额/折扣信息 -->
|
|
16
|
+
<view class="hy-coupon__content--left">
|
|
17
|
+
<!-- @slot 自定义金额插槽 -->
|
|
18
|
+
<slot v-if="$slots.left" name="left"></slot>
|
|
19
|
+
<template v-else>
|
|
20
|
+
<view class="hy-coupon__content--left__block">
|
|
21
|
+
<view class="hy-coupon__content--left__value">
|
|
22
|
+
<text>
|
|
23
|
+
{{ amount || 0 }}
|
|
24
|
+
</text>
|
|
25
|
+
</view>
|
|
26
|
+
<view class="hy-coupon__content--left__suffix">
|
|
27
|
+
<text v-if="unit">{{ unit }}</text>
|
|
28
|
+
<text v-else-if="type === 'discount'">折</text>
|
|
29
|
+
<text v-else>元</text>
|
|
30
|
+
</view>
|
|
31
|
+
</view>
|
|
32
|
+
|
|
33
|
+
<hy-tag
|
|
34
|
+
:text="typeValue"
|
|
35
|
+
size="mini"
|
|
36
|
+
plain
|
|
37
|
+
shape="circle"
|
|
38
|
+
color="#FFFFFF"
|
|
39
|
+
></hy-tag>
|
|
40
|
+
</template>
|
|
41
|
+
</view>
|
|
42
|
+
|
|
43
|
+
<hy-line
|
|
44
|
+
:hairline="false"
|
|
45
|
+
direction="column"
|
|
46
|
+
dashed
|
|
47
|
+
color="#FFFFFF"
|
|
48
|
+
length="70%"
|
|
49
|
+
></hy-line>
|
|
50
|
+
|
|
51
|
+
<!-- 右侧描述信息 -->
|
|
52
|
+
<view class="hy-coupon__content--right">
|
|
53
|
+
<!-- 自定义详情插槽 -->
|
|
54
|
+
<slot v-if="$slots.right" name="right"></slot>
|
|
55
|
+
<template v-else>
|
|
56
|
+
<view class="hy-coupon__content--right__name">{{ title }}</view>
|
|
57
|
+
<view
|
|
58
|
+
:class="[
|
|
59
|
+
'hy-coupon__content--right__desc',
|
|
60
|
+
desEllipsis !== 'none' && 'is-ellipsis'
|
|
61
|
+
]"
|
|
62
|
+
>{{ description }}</view
|
|
63
|
+
>
|
|
64
|
+
<view class="hy-coupon__content--right__validity">
|
|
65
|
+
{{
|
|
66
|
+
dateDesc
|
|
67
|
+
? dateDesc
|
|
68
|
+
: `有效期: ${formatTime(startDate, format)} - ${formatTime(endDate, format)}`
|
|
69
|
+
}}
|
|
70
|
+
</view>
|
|
71
|
+
</template>
|
|
72
|
+
</view>
|
|
73
|
+
</view>
|
|
74
|
+
|
|
75
|
+
<!-- 右侧状态标签 -->
|
|
76
|
+
<view class="hy-coupon__btn">
|
|
77
|
+
<!-- 自定义按钮插槽 -->
|
|
78
|
+
<slot v-if="$slots.button" name="button"></slot>
|
|
79
|
+
<template v-else>
|
|
80
|
+
<view v-if="btnMode === 'text'" class="hy-coupon__tag">
|
|
81
|
+
<text class="hy-coupon__tag--btn" @tap.stop="onUsed">{{ btnText }}</text>
|
|
82
|
+
</view>
|
|
83
|
+
<hy-button
|
|
84
|
+
v-if="btnMode === 'button'"
|
|
85
|
+
:text="btnText"
|
|
86
|
+
plain
|
|
87
|
+
:disabled="isDisable"
|
|
88
|
+
:size="buttonProp?.size || 'small'"
|
|
89
|
+
:shape="buttonProp?.shape || 'circle'"
|
|
90
|
+
:color="buttonProp?.color || '#FFFFFF'"
|
|
91
|
+
:custom-style="{ marginRight: '10px' }"
|
|
92
|
+
@click="onUsed"
|
|
93
|
+
></hy-button>
|
|
94
|
+
</template>
|
|
95
|
+
</view>
|
|
96
|
+
</view>
|
|
97
|
+
</template>
|
|
98
|
+
|
|
99
|
+
<script lang="ts">
|
|
100
|
+
export default {
|
|
101
|
+
name: 'hy-coupon',
|
|
102
|
+
options: {
|
|
103
|
+
addGlobalClass: true,
|
|
104
|
+
virtualHost: true,
|
|
105
|
+
styleIsolation: 'shared'
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
</script>
|
|
109
|
+
|
|
110
|
+
<script setup lang="ts">
|
|
111
|
+
import { computed } from 'vue'
|
|
112
|
+
import type { ICouponEmits } from './typing'
|
|
113
|
+
import { formatTime } from '../../libs'
|
|
114
|
+
import couponProps from './props'
|
|
115
|
+
|
|
116
|
+
// 组件
|
|
117
|
+
import hyTag from '../hy-tag/hy-tag.vue'
|
|
118
|
+
import hyLine from '../hy-line/hy-line.vue'
|
|
119
|
+
import hyButton from '../hy-button/hy-button.vue'
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* 用于商品优惠券的业务组件
|
|
123
|
+
* @displayName hy-coupon
|
|
124
|
+
*/
|
|
125
|
+
defineOptions({})
|
|
126
|
+
|
|
127
|
+
const props = defineProps(couponProps)
|
|
128
|
+
const emit = defineEmits<ICouponEmits>()
|
|
129
|
+
|
|
130
|
+
// 禁用功能
|
|
131
|
+
const isDisable = computed(() => props.disabledStatus.includes(props.status))
|
|
132
|
+
|
|
133
|
+
const typeValue = computed(() => {
|
|
134
|
+
let text = ''
|
|
135
|
+
if (props.typeText) {
|
|
136
|
+
text = props.typeText
|
|
137
|
+
} else {
|
|
138
|
+
switch (props.type) {
|
|
139
|
+
case 'moneyOff':
|
|
140
|
+
text = '满减券'
|
|
141
|
+
break
|
|
142
|
+
case 'discount':
|
|
143
|
+
text = '折扣券'
|
|
144
|
+
break
|
|
145
|
+
case 'fixedAmount':
|
|
146
|
+
text = '无门槛券'
|
|
147
|
+
break
|
|
148
|
+
default:
|
|
149
|
+
text = '未知券'
|
|
150
|
+
break
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
return text
|
|
154
|
+
})
|
|
155
|
+
|
|
156
|
+
const cardClass = computed(() => {
|
|
157
|
+
const baseClass = 'hy-coupon hy-coupon__card'
|
|
158
|
+
const typeClass = `hy-coupon--${props.type}`
|
|
159
|
+
const statusClass = isDisable.value && 'hy-coupon--disabled'
|
|
160
|
+
return `${baseClass} ${typeClass} ${statusClass} ${props.customClass}`
|
|
161
|
+
})
|
|
162
|
+
|
|
163
|
+
// 点击优惠券触发
|
|
164
|
+
const handleClick = () => {
|
|
165
|
+
emit('click')
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// 点击使用优惠券触发
|
|
169
|
+
const onUsed = () => {
|
|
170
|
+
if (!isDisable.value) {
|
|
171
|
+
emit('used')
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
</script>
|
|
175
|
+
|
|
176
|
+
<style scoped lang="scss">
|
|
177
|
+
@import './index.scss';
|
|
178
|
+
@import '../../libs/css/mixin.scss';
|
|
179
|
+
|
|
180
|
+
@include is(ellipsis) {
|
|
181
|
+
@include multiEllipsis(v-bind(desEllipsis));
|
|
182
|
+
}
|
|
183
|
+
</style>
|
|
@@ -5,7 +5,9 @@ $hy-box-width: 180rpx;
|
|
|
5
5
|
@include b(coupon) {
|
|
6
6
|
width: 100%;
|
|
7
7
|
min-height: 190rpx;
|
|
8
|
-
max-height:
|
|
8
|
+
max-height: 330rpx;
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-direction: row;
|
|
9
11
|
|
|
10
12
|
/* 已使用/过期状态的置灰效果 */
|
|
11
13
|
@include m(disabled) {
|
|
@@ -30,10 +32,10 @@ $hy-box-width: 180rpx;
|
|
|
30
32
|
/* 不同类型优惠券的背景色 */
|
|
31
33
|
@include m(moneyOff) {
|
|
32
34
|
background:
|
|
33
|
-
radial-gradient(circle at $hy-box-width top, transparent 15rpx, #ff7d00 0) top / 100%
|
|
35
|
+
radial-gradient(circle at $hy-box-width top, transparent 15rpx, #ff7d00 0) top / 100% 85px
|
|
34
36
|
no-repeat,
|
|
35
37
|
radial-gradient(circle at $hy-box-width bottom, transparent 15rpx, #ff7d00 0) bottom / 100%
|
|
36
|
-
|
|
38
|
+
85px no-repeat;
|
|
37
39
|
//background:
|
|
38
40
|
// radial-gradient(circle at left center, transparent 15rpx, #ff7d00 0) left center / 30rpx 100% no-repeat,
|
|
39
41
|
// radial-gradient(circle at right center, transparent 15rpx, #ff7d00 0) right center / 30rpx 100% no-repeat;
|
|
@@ -42,14 +44,14 @@ $hy-box-width: 180rpx;
|
|
|
42
44
|
}
|
|
43
45
|
@include m(discount) {
|
|
44
46
|
background:
|
|
45
|
-
radial-gradient(circle at $hy-box-width top, transparent 15rpx, #00c6ff 0) top / 100%
|
|
47
|
+
radial-gradient(circle at $hy-box-width top, transparent 15rpx, #00c6ff 0) top / 100% 70px
|
|
46
48
|
no-repeat,
|
|
47
49
|
radial-gradient(circle at $hy-box-width bottom, transparent 15rpx, #00c6ff 0) bottom / 100%
|
|
48
50
|
51px no-repeat;
|
|
49
51
|
}
|
|
50
52
|
@include m(fixedAmount) {
|
|
51
53
|
background:
|
|
52
|
-
radial-gradient(circle at $hy-box-width top, transparent 15rpx, $hy-error 0) top / 100%
|
|
54
|
+
radial-gradient(circle at $hy-box-width top, transparent 15rpx, $hy-error 0) top / 100% 70px
|
|
53
55
|
no-repeat,
|
|
54
56
|
radial-gradient(circle at $hy-box-width bottom, transparent 15rpx, $hy-error 0) bottom / 100%
|
|
55
57
|
51px no-repeat;
|
|
@@ -73,6 +75,7 @@ $hy-box-width: 180rpx;
|
|
|
73
75
|
width: $hy-box-width;
|
|
74
76
|
padding: $hy-border-margin-padding-base;
|
|
75
77
|
box-sizing: border-box;
|
|
78
|
+
flex-shrink: 0;
|
|
76
79
|
|
|
77
80
|
@include e(block) {
|
|
78
81
|
display: flex;
|
|
@@ -97,25 +100,23 @@ $hy-box-width: 180rpx;
|
|
|
97
100
|
|
|
98
101
|
/* 右侧描述 */
|
|
99
102
|
@include m(right) {
|
|
100
|
-
flex: 1;
|
|
101
103
|
display: flex;
|
|
102
104
|
flex-direction: column;
|
|
103
|
-
|
|
104
|
-
text-align: start;
|
|
105
|
+
box-sizing: border-box;
|
|
105
106
|
padding: $hy-border-margin-padding-base;
|
|
106
107
|
|
|
107
108
|
@include e(name) {
|
|
108
109
|
font-size: 30rpx;
|
|
109
110
|
font-weight: 600;
|
|
110
111
|
margin-bottom: 8rpx;
|
|
111
|
-
@include lineEllipsis;
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
@include e(desc) {
|
|
115
|
-
|
|
115
|
+
width: 100%;
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
@include e(validity) {
|
|
119
|
+
width: 100%;
|
|
119
120
|
@include lineEllipsis;
|
|
120
121
|
}
|
|
121
122
|
|
|
@@ -123,24 +124,19 @@ $hy-box-width: 180rpx;
|
|
|
123
124
|
font-size: 22rpx;
|
|
124
125
|
opacity: 0.9;
|
|
125
126
|
line-height: 1.4;
|
|
126
|
-
@include lineEllipsis;
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
/* 右侧状态标签 */
|
|
132
132
|
@include e(btn) {
|
|
133
|
-
position: absolute;
|
|
134
|
-
bottom: 0;
|
|
135
|
-
right: 0;
|
|
136
|
-
height: 100%;
|
|
137
133
|
display: flex;
|
|
138
134
|
justify-content: flex-start;
|
|
139
135
|
align-items: center;
|
|
140
136
|
}
|
|
141
137
|
@include e(tag) {
|
|
142
138
|
height: 100%;
|
|
143
|
-
margin-left:
|
|
139
|
+
margin-left: 20rpx;
|
|
144
140
|
width: 120rpx;
|
|
145
141
|
display: flex;
|
|
146
142
|
align-items: center;
|
|
@@ -1,103 +1,108 @@
|
|
|
1
|
-
import type { CSSProperties, PropType } from 'vue'
|
|
2
|
-
import type { HyButtonProps } from '../hy-button/typing'
|
|
3
|
-
|
|
4
|
-
const couponProps = {
|
|
5
|
-
/** 优惠券标题 */
|
|
6
|
-
title: {
|
|
7
|
-
type: String,
|
|
8
|
-
default: ''
|
|
9
|
-
},
|
|
10
|
-
/**
|
|
11
|
-
* 优惠券类型:moneyOff:满减券,discount:折扣券,fixedAmount:无门槛券
|
|
12
|
-
* @values moneyOff,discount,fixedAmount
|
|
13
|
-
* */
|
|
14
|
-
type: {
|
|
15
|
-
type: String,
|
|
16
|
-
default: ''
|
|
17
|
-
},
|
|
18
|
-
/** 金额底部优惠券类型文字描述 */
|
|
19
|
-
typeText: {
|
|
20
|
-
type: String,
|
|
21
|
-
default: ''
|
|
22
|
-
},
|
|
23
|
-
/** 优惠券状态 */
|
|
24
|
-
status: {
|
|
25
|
-
type: String,
|
|
26
|
-
default: ''
|
|
27
|
-
},
|
|
28
|
-
/** 优惠券禁用状态 */
|
|
29
|
-
disabledStatus: {
|
|
30
|
-
type: Array,
|
|
31
|
-
default: () => ['']
|
|
32
|
-
},
|
|
33
|
-
/** 优惠券描述备注 */
|
|
34
|
-
description: {
|
|
35
|
-
type: String,
|
|
36
|
-
default: ''
|
|
37
|
-
},
|
|
38
|
-
/** 优惠券金额 */
|
|
39
|
-
amount: {
|
|
40
|
-
type: [String, Number],
|
|
41
|
-
default: ''
|
|
42
|
-
},
|
|
43
|
-
/** 优惠券单位,没有就用默认值 */
|
|
44
|
-
unit: {
|
|
45
|
-
type: String,
|
|
46
|
-
default: ''
|
|
47
|
-
},
|
|
48
|
-
/**
|
|
49
|
-
|
|
50
|
-
type: String,
|
|
51
|
-
default: ''
|
|
52
|
-
},
|
|
53
|
-
/**
|
|
54
|
-
|
|
55
|
-
type: String,
|
|
56
|
-
default: ''
|
|
57
|
-
},
|
|
58
|
-
/**
|
|
59
|
-
|
|
60
|
-
type: String,
|
|
61
|
-
default: '
|
|
62
|
-
},
|
|
63
|
-
/**
|
|
64
|
-
|
|
65
|
-
type: String,
|
|
66
|
-
default: ''
|
|
67
|
-
},
|
|
68
|
-
/**
|
|
69
|
-
|
|
70
|
-
type: String,
|
|
71
|
-
default: ''
|
|
72
|
-
},
|
|
73
|
-
/**
|
|
74
|
-
|
|
75
|
-
type:
|
|
76
|
-
default:
|
|
77
|
-
},
|
|
78
|
-
/**
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
type: String,
|
|
89
|
-
default: '
|
|
90
|
-
},
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
type: Object as PropType<
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
1
|
+
import type { CSSProperties, PropType } from 'vue'
|
|
2
|
+
import type { HyButtonProps } from '../hy-button/typing'
|
|
3
|
+
|
|
4
|
+
const couponProps = {
|
|
5
|
+
/** 优惠券标题 */
|
|
6
|
+
title: {
|
|
7
|
+
type: String,
|
|
8
|
+
default: ''
|
|
9
|
+
},
|
|
10
|
+
/**
|
|
11
|
+
* 优惠券类型:moneyOff:满减券,discount:折扣券,fixedAmount:无门槛券
|
|
12
|
+
* @values moneyOff,discount,fixedAmount
|
|
13
|
+
* */
|
|
14
|
+
type: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: ''
|
|
17
|
+
},
|
|
18
|
+
/** 金额底部优惠券类型文字描述 */
|
|
19
|
+
typeText: {
|
|
20
|
+
type: String,
|
|
21
|
+
default: ''
|
|
22
|
+
},
|
|
23
|
+
/** 优惠券状态 */
|
|
24
|
+
status: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: ''
|
|
27
|
+
},
|
|
28
|
+
/** 优惠券禁用状态 */
|
|
29
|
+
disabledStatus: {
|
|
30
|
+
type: Array,
|
|
31
|
+
default: () => ['']
|
|
32
|
+
},
|
|
33
|
+
/** 优惠券描述备注 */
|
|
34
|
+
description: {
|
|
35
|
+
type: String,
|
|
36
|
+
default: ''
|
|
37
|
+
},
|
|
38
|
+
/** 优惠券金额 */
|
|
39
|
+
amount: {
|
|
40
|
+
type: [String, Number],
|
|
41
|
+
default: ''
|
|
42
|
+
},
|
|
43
|
+
/** 优惠券单位,没有就用默认值 */
|
|
44
|
+
unit: {
|
|
45
|
+
type: String,
|
|
46
|
+
default: ''
|
|
47
|
+
},
|
|
48
|
+
/** 描述省略行数,none不省略,1代表一行省略 */
|
|
49
|
+
desEllipsis: {
|
|
50
|
+
type: [String, Number],
|
|
51
|
+
default: 'none'
|
|
52
|
+
},
|
|
53
|
+
/** 优惠券开始时间 */
|
|
54
|
+
startDate: {
|
|
55
|
+
type: String,
|
|
56
|
+
default: ''
|
|
57
|
+
},
|
|
58
|
+
/** 优惠券结束时间 */
|
|
59
|
+
endDate: {
|
|
60
|
+
type: String,
|
|
61
|
+
default: ''
|
|
62
|
+
},
|
|
63
|
+
/** 时间格式 */
|
|
64
|
+
format: {
|
|
65
|
+
type: String,
|
|
66
|
+
default: 'yyyy-MM-dd'
|
|
67
|
+
},
|
|
68
|
+
/** 日期描述,没有日期描述就用开始时间到结束时间 */
|
|
69
|
+
dateDesc: {
|
|
70
|
+
type: String,
|
|
71
|
+
default: ''
|
|
72
|
+
},
|
|
73
|
+
/** 背景色 */
|
|
74
|
+
bgColor: {
|
|
75
|
+
type: String,
|
|
76
|
+
default: ''
|
|
77
|
+
},
|
|
78
|
+
/** 是否显示阴影 */
|
|
79
|
+
boxShadow: {
|
|
80
|
+
type: Boolean,
|
|
81
|
+
default: false
|
|
82
|
+
},
|
|
83
|
+
/**
|
|
84
|
+
* 按钮类型
|
|
85
|
+
* @values test,button,none
|
|
86
|
+
* */
|
|
87
|
+
btnMode: {
|
|
88
|
+
type: String,
|
|
89
|
+
default: 'button'
|
|
90
|
+
},
|
|
91
|
+
/** 按钮文字 */
|
|
92
|
+
btnText: {
|
|
93
|
+
type: String,
|
|
94
|
+
default: '立即领取'
|
|
95
|
+
},
|
|
96
|
+
buttonProp: {
|
|
97
|
+
type: Object as PropType<HyButtonProps>,
|
|
98
|
+
default: () => ({})
|
|
99
|
+
},
|
|
100
|
+
/** 定义需要用到的外部样式 */
|
|
101
|
+
customStyle: {
|
|
102
|
+
type: Object as PropType<CSSProperties>
|
|
103
|
+
},
|
|
104
|
+
/** 自定义外部类名 */
|
|
105
|
+
customClass: String
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export default couponProps
|