hy-app 0.5.2 → 0.5.4
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-avatar/hy-avatar.vue +4 -3
- 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 +5 -4
- package/components/hy-badge/index.scss +0 -1
- package/components/hy-badge/props.ts +11 -4
- 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 +135 -516
- package/components/hy-coupon/props.ts +101 -127
- package/components/hy-coupon/typing.d.ts +147 -146
- package/components/hy-datetime-picker/props.ts +1 -3
- package/components/hy-folding-panel/props.ts +1 -1
- package/components/hy-folding-panel/typing.d.ts +0 -38
- package/components/hy-folding-panel-item/hy-folding-panel-item.vue +2 -5
- package/components/hy-folding-panel-item/index.scss +0 -8
- package/components/hy-folding-panel-item/typing.d.ts +14 -0
- 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-icon/hy-icon.vue +3 -8
- 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-list/props.ts +1 -1
- 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-notice-bar/typing.d.ts +2 -0
- package/components/hy-popup/hy-popup.vue +0 -1
- package/components/hy-qrcode/hy-qrcode.vue +69 -3
- package/components/hy-qrcode/index.scss +3 -3
- package/components/hy-qrcode/qrcode.js +1344 -1400
- package/components/hy-rate/hy-rate.vue +0 -1
- package/components/hy-read-more/hy-read-more.vue +1 -1
- package/components/hy-signature/hy-signature.vue +25 -22
- package/components/hy-signature/index.scss +0 -4
- package/components/hy-tabbar/hy-tabbar.vue +137 -0
- package/components/{hy-tabBar → hy-tabbar}/index.scss +30 -30
- package/components/hy-tabbar/props.ts +59 -0
- package/components/hy-tabbar/typing.d.ts +61 -0
- package/components/hy-tabbar-group/README.md +326 -0
- package/components/hy-tabbar-group/hy-tabbar-group.vue +87 -0
- package/components/hy-tabbar-group/index.scss +57 -0
- package/components/hy-tabbar-group/props.ts +78 -0
- package/components/hy-tabbar-group/typing.ts +16 -0
- package/components/hy-tabbar-item/hy-tabbar-item.vue +103 -0
- package/components/hy-tabbar-item/index.scss +43 -0
- package/components/hy-tabbar-item/props.ts +24 -0
- package/components/hy-tabbar-item/typing.ts +22 -0
- package/components/hy-tag/props.ts +8 -2
- package/components/hy-text/props.ts +8 -2
- package/components/hy-textarea/hy-textarea.vue +1 -1
- package/components/hy-textarea/index.scss +8 -7
- package/components/hy-textarea/props.ts +4 -1
- package/components/hy-toast/index.scss +2 -7
- package/components/hy-tooltip/props.ts +1 -3
- package/components/hy-upload/props.ts +1 -1
- package/components/index.ts +177 -177
- package/global.d.ts +87 -85
- 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
- package/components/hy-tabBar/hy-tabBar.vue +0 -109
- package/components/hy-tabBar/props.ts +0 -13
- package/components/hy-tabBar/typing.d.ts +0 -54
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
# HyCoupon 优惠券组件
|
|
2
|
-
|
|
3
|
-
市场上常用的优惠券组件,支持多种状态展示和丰富的功能配置。
|
|
4
|
-
|
|
5
|
-
## 引入方式
|
|
6
|
-
|
|
7
|
-
```js
|
|
8
|
-
// 全局引入
|
|
9
|
-
import { createApp } from 'vue'
|
|
10
|
-
import HyDesignUni from '@/package'
|
|
11
|
-
import App from './App.vue'
|
|
12
|
-
|
|
13
|
-
const app = createApp(App)
|
|
14
|
-
app.use(HyDesignUni)
|
|
15
|
-
app.mount('#app')
|
|
16
|
-
|
|
17
|
-
// 局部引入
|
|
18
|
-
import { HyCoupon } from '@/package'
|
|
19
|
-
|
|
20
|
-
export default {
|
|
21
|
-
components: {
|
|
22
|
-
HyCoupon
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
## 基本用法
|
|
28
|
-
|
|
29
|
-
```html
|
|
30
|
-
<hy-coupon
|
|
31
|
-
amount="50"
|
|
32
|
-
title="新人专享优惠券"
|
|
33
|
-
subtitle="全场通用,无门槛使用"
|
|
34
|
-
validity="2023.10.01-2023.12.31"
|
|
35
|
-
@click="onCouponClick"
|
|
36
|
-
/>
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
## 状态展示
|
|
40
|
-
|
|
41
|
-
```html
|
|
42
|
-
<!-- 已使用状态 -->
|
|
43
|
-
<hy-coupon
|
|
44
|
-
amount="30"
|
|
45
|
-
title="已使用优惠券"
|
|
46
|
-
status="used"
|
|
47
|
-
used-date="2023-10-15 14:30"
|
|
48
|
-
/>
|
|
49
|
-
|
|
50
|
-
<!-- 已过期状态 -->
|
|
51
|
-
<hy-coupon
|
|
52
|
-
amount="15"
|
|
53
|
-
title="已过期优惠券"
|
|
54
|
-
status="expired"
|
|
55
|
-
expire-date="2023-10-01"
|
|
56
|
-
/>
|
|
57
|
-
|
|
58
|
-
<!-- 已禁用状态 -->
|
|
59
|
-
<hy-coupon
|
|
60
|
-
amount="25"
|
|
61
|
-
title="已禁用优惠券"
|
|
62
|
-
status="disabled"
|
|
63
|
-
disabled-reason="账户等级不足"
|
|
64
|
-
/>
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
## 增强功能
|
|
68
|
-
|
|
69
|
-
```html
|
|
70
|
-
<!-- 专属优惠券 -->
|
|
71
|
-
<hy-coupon
|
|
72
|
-
amount="40"
|
|
73
|
-
title="专属优惠券"
|
|
74
|
-
is-exclusive
|
|
75
|
-
limit-per-user="1"
|
|
76
|
-
/>
|
|
77
|
-
|
|
78
|
-
<!-- 显示操作按钮 -->
|
|
79
|
-
<hy-coupon
|
|
80
|
-
amount="60"
|
|
81
|
-
title="限时优惠券"
|
|
82
|
-
show-action-button
|
|
83
|
-
@receive="onCouponReceive"
|
|
84
|
-
/>
|
|
85
|
-
|
|
86
|
-
<!-- 自定义按钮文本 -->
|
|
87
|
-
<hy-coupon
|
|
88
|
-
amount="100"
|
|
89
|
-
title="大额优惠券"
|
|
90
|
-
show-action-button
|
|
91
|
-
custom-button-text="立即兑换"
|
|
92
|
-
/>
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
## Props
|
|
96
|
-
|
|
97
|
-
| 属性名 | 类型 | 默认值 | 说明 |
|
|
98
|
-
|-------|------|-------|------|
|
|
99
|
-
| amount | string/number | - | 优惠券金额 |
|
|
100
|
-
| title | string | - | 优惠券标题 |
|
|
101
|
-
| subtitle | string | '' | 优惠券副标题 |
|
|
102
|
-
| status | string | 'normal' | 优惠券状态:normal/disabled/used/expired |
|
|
103
|
-
| minSpend | string/number | 0 | 最低消费金额 |
|
|
104
|
-
| validity | string | '' | 有效期文本 |
|
|
105
|
-
| customStyle | Object | {} | 自定义样式 |
|
|
106
|
-
| showRightBorder | boolean | true | 是否显示右侧边框装饰 |
|
|
107
|
-
| tooltip | string | '' | 提示文本 |
|
|
108
|
-
| showActionButton | boolean | false | 是否显示操作按钮 |
|
|
109
|
-
| customButtonText | string | '' | 自定义按钮文本 |
|
|
110
|
-
| isExclusive | boolean | false | 是否为专属优惠券 |
|
|
111
|
-
| limitPerUser | number | 0 | 每用户限领数量 |
|
|
112
|
-
| usedDate | string | '' | 使用日期(已使用状态时显示) |
|
|
113
|
-
| expireDate | string | '' | 过期日期(已过期状态时显示) |
|
|
114
|
-
| disabledReason | string | '' | 禁用原因(已禁用状态时显示) |
|
|
115
|
-
| triggerReceiveOnClick | boolean | true | 点击时是否触发receive事件 |
|
|
116
|
-
|
|
117
|
-
## Events
|
|
118
|
-
|
|
119
|
-
| 事件名 | 说明 | 回调参数 |
|
|
120
|
-
|-------|------|--------|
|
|
121
|
-
| click | 点击优惠券时触发(仅正常状态) | event: { status: CouponStatus } |
|
|
122
|
-
| receive | 领取优惠券时触发 | - |
|
|
123
|
-
| hover | 鼠标悬停状态改变时触发 | value: boolean |
|
|
124
|
-
|
|
125
|
-
## 示例页面
|
|
126
|
-
|
|
127
|
-
请查看 `pages/coupon-demo/index.vue` 了解更多使用示例。
|
|
128
|
-
|
|
129
|
-
## 注意事项
|
|
130
|
-
|
|
131
|
-
1. 在移动端环境下,`hover` 相关效果可能表现不同,请根据实际情况调整。
|
|
132
|
-
2. 当优惠券金额较大时,建议使用 `customStyle` 调整字体大小以保证显示效果。
|
|
133
|
-
3. 在小屏幕设备上,长文本可能会被截断,建议优化文本内容或调整组件宽度。
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<view class="hy-tabBar--placeholder"></view>
|
|
3
|
-
<view class="hy-tabBar">
|
|
4
|
-
<view class="hy-tabBar--box" :style="{ backgroundColor: barBgColor }">
|
|
5
|
-
<view class="hy-tabBar--container">
|
|
6
|
-
<view
|
|
7
|
-
:class="[
|
|
8
|
-
'hy-tabBar--container__item',
|
|
9
|
-
'list',
|
|
10
|
-
current === i ? 'is-active' : ''
|
|
11
|
-
]"
|
|
12
|
-
v-for="(item, i) in list"
|
|
13
|
-
:key="i"
|
|
14
|
-
@click="checkItem(i)"
|
|
15
|
-
>
|
|
16
|
-
<view class="hy-tabBar--container__item--bar">
|
|
17
|
-
<view class="icon">
|
|
18
|
-
<hy-badge
|
|
19
|
-
:value="item?.badge"
|
|
20
|
-
absolute
|
|
21
|
-
:offset="[-13, 25]"
|
|
22
|
-
:max="badge?.max"
|
|
23
|
-
:is-dot="badge?.isDot"
|
|
24
|
-
:inverted="badge?.inverted"
|
|
25
|
-
:bg-color="badge?.bgColor"
|
|
26
|
-
:type="badge?.type"
|
|
27
|
-
:number-type="badge?.numberType"
|
|
28
|
-
:shape="badge?.shape"
|
|
29
|
-
:show-zero="badge?.showZero"
|
|
30
|
-
:show="!!item?.badge"
|
|
31
|
-
></hy-badge>
|
|
32
|
-
<hy-icon :name="item.icon" :color="color" size="25"></hy-icon>
|
|
33
|
-
</view>
|
|
34
|
-
<text class="text" :style="[{ color: color }]">{{ item.name }}</text>
|
|
35
|
-
<text class="circle"></text>
|
|
36
|
-
</view>
|
|
37
|
-
</view>
|
|
38
|
-
<view
|
|
39
|
-
class="hy-tabBar--indicator"
|
|
40
|
-
:style="{
|
|
41
|
-
'--num': `translateX(calc(((100vw - 110rpx - ${list.length} * 70rpx) / ${list.length - 1} + 70rpx) * ${current}))`,
|
|
42
|
-
background: activeColor
|
|
43
|
-
}"
|
|
44
|
-
></view>
|
|
45
|
-
</view>
|
|
46
|
-
</view>
|
|
47
|
-
</view>
|
|
48
|
-
</template>
|
|
49
|
-
|
|
50
|
-
<script lang="ts">
|
|
51
|
-
export default {
|
|
52
|
-
name: 'hy-switch',
|
|
53
|
-
options: {
|
|
54
|
-
addGlobalClass: true,
|
|
55
|
-
virtualHost: true,
|
|
56
|
-
styleIsolation: 'shared'
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
</script>
|
|
60
|
-
|
|
61
|
-
<script setup lang="ts">
|
|
62
|
-
import { ref, toRefs, watch } from 'vue'
|
|
63
|
-
import defaultProps from './props'
|
|
64
|
-
import type IProps from './typing'
|
|
65
|
-
|
|
66
|
-
// 组件
|
|
67
|
-
import HyIcon from '../hy-icon/hy-icon.vue'
|
|
68
|
-
import HyBadge from '../hy-badge/hy-badge.vue'
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* 一般用于导航轮播,广告展示等场景,可开箱即用
|
|
72
|
-
* @displayName hy-swiper
|
|
73
|
-
*/
|
|
74
|
-
defineOptions({})
|
|
75
|
-
|
|
76
|
-
const props = withDefaults(defineProps<IProps>(), defaultProps)
|
|
77
|
-
const { modelValue, baseBgColor } = toRefs(props)
|
|
78
|
-
const emit = defineEmits(['clickTab'])
|
|
79
|
-
|
|
80
|
-
const baseBackgroundColor = baseBgColor.value ? baseBgColor.value : 'var(--hy-background)'
|
|
81
|
-
const current = ref(0)
|
|
82
|
-
watch(
|
|
83
|
-
() => modelValue.value,
|
|
84
|
-
(newVal) => {
|
|
85
|
-
current.value = newVal
|
|
86
|
-
}
|
|
87
|
-
)
|
|
88
|
-
|
|
89
|
-
const checkItem = (index: number) => {
|
|
90
|
-
current.value = index
|
|
91
|
-
emit('clickTab', index)
|
|
92
|
-
}
|
|
93
|
-
</script>
|
|
94
|
-
|
|
95
|
-
<style lang="scss" scoped>
|
|
96
|
-
@import './index.scss';
|
|
97
|
-
.hy-tabBar {
|
|
98
|
-
background: v-bind(baseBackgroundColor);
|
|
99
|
-
&--indicator {
|
|
100
|
-
border: 12rpx solid v-bind(baseBackgroundColor);
|
|
101
|
-
&::before {
|
|
102
|
-
box-shadow: 1px -15rpx 0 v-bind(baseBackgroundColor);
|
|
103
|
-
}
|
|
104
|
-
&::after {
|
|
105
|
-
box-shadow: -1px -15rpx 0 v-bind(baseBackgroundColor);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
</style>
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import type HyBadgeProps from "../hy-badge/typing";
|
|
2
|
-
|
|
3
|
-
export interface TabListVo {
|
|
4
|
-
/**
|
|
5
|
-
* @description 标题
|
|
6
|
-
* */
|
|
7
|
-
name: string;
|
|
8
|
-
/**
|
|
9
|
-
* @description icon图标或者图片
|
|
10
|
-
* */
|
|
11
|
-
icon: string;
|
|
12
|
-
/**
|
|
13
|
-
* @description 徽标值
|
|
14
|
-
* */
|
|
15
|
-
badge?: number;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export default interface HyTabBarProps {
|
|
19
|
-
/**
|
|
20
|
-
* @description tab当前值
|
|
21
|
-
* */
|
|
22
|
-
modelValue: number;
|
|
23
|
-
/**
|
|
24
|
-
* @description 导航栏值
|
|
25
|
-
* {
|
|
26
|
-
* name: 中文名,
|
|
27
|
-
* icon: uview-plus里面的矢量图标库
|
|
28
|
-
* }
|
|
29
|
-
* */
|
|
30
|
-
list: TabListVo[];
|
|
31
|
-
/**
|
|
32
|
-
* @description 文字颜色
|
|
33
|
-
* */
|
|
34
|
-
color?: string;
|
|
35
|
-
/**
|
|
36
|
-
* @description 底部导航栏底部背景颜色(颜色设置必须要和页面背景颜色一样,才有重合感觉)
|
|
37
|
-
* 支持渐变色--linear-gradient(155deg, #192b6e, #a6307c)
|
|
38
|
-
* */
|
|
39
|
-
baseBgColor?: string;
|
|
40
|
-
/**
|
|
41
|
-
* @description 底部导航栏背景颜色
|
|
42
|
-
* 支持渐变色--linear-gradient(155deg, #192b6e, #a6307c)
|
|
43
|
-
* */
|
|
44
|
-
barBgColor?: string;
|
|
45
|
-
/**
|
|
46
|
-
* @description 点击突出按钮的背景颜色
|
|
47
|
-
* 支持渐变色--linear-gradient(0deg, #ffa576,#0951eb)
|
|
48
|
-
* */
|
|
49
|
-
activeColor?: string;
|
|
50
|
-
/**
|
|
51
|
-
* @description 徽标属性集合
|
|
52
|
-
* */
|
|
53
|
-
badge?: Partial<HyBadgeProps>;
|
|
54
|
-
}
|