hy-app 0.1.1
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/README.md +42 -0
- package/api/http.ts +138 -0
- package/api/index.ts +1 -0
- package/common/index.ts +1 -0
- package/common/versionControl.ts +102 -0
- package/components/dialog/TheDialog.vue +128 -0
- package/components/dialog/index.ts +38 -0
- package/components/hy-address-picker/hy-address-picker.vue +262 -0
- package/components/hy-address-picker/props.ts +27 -0
- package/components/hy-address-picker/typing.d.ts +98 -0
- package/components/hy-avatar/hy-avatar.vue +217 -0
- package/components/hy-avatar/props.ts +20 -0
- package/components/hy-avatar/typing.d.ts +64 -0
- package/components/hy-back-top/hy-back-top.vue +71 -0
- package/components/hy-back-top/props.ts +23 -0
- package/components/hy-back-top/typing.d.ts +49 -0
- package/components/hy-badge/hy-badge.vue +155 -0
- package/components/hy-badge/props.ts +19 -0
- package/components/hy-badge/typing.d.ts +60 -0
- package/components/hy-button/hy-button.vue +394 -0
- package/components/hy-button/props.ts +36 -0
- package/components/hy-button/typing.d.ts +125 -0
- package/components/hy-card/hy-card.vue +198 -0
- package/components/hy-card/props.ts +29 -0
- package/components/hy-card/typing.d.ts +112 -0
- package/components/hy-cell/hy-cell.vue +268 -0
- package/components/hy-cell/props.ts +20 -0
- package/components/hy-cell/typing.d.ts +98 -0
- package/components/hy-check-button/hy-check-button.vue +71 -0
- package/components/hy-check-button/props.ts +20 -0
- package/components/hy-check-button/typing.d.ts +79 -0
- package/components/hy-checkbox/hy-checkbox.vue +299 -0
- package/components/hy-checkbox/props.ts +28 -0
- package/components/hy-checkbox/typing.d.ts +77 -0
- package/components/hy-datetime-picker/hy-datetime-picker.vue +584 -0
- package/components/hy-datetime-picker/props.ts +36 -0
- package/components/hy-datetime-picker/typing.d.ts +135 -0
- package/components/hy-divider/hy-divider.vue +164 -0
- package/components/hy-divider/props.ts +21 -0
- package/components/hy-divider/typing.d.ts +64 -0
- package/components/hy-empty/hy-empty.vue +122 -0
- package/components/hy-empty/props.ts +21 -0
- package/components/hy-empty/typing.d.ts +68 -0
- package/components/hy-folding-panel/hy-folding-panel.vue +94 -0
- package/components/hy-folding-panel/props.ts +17 -0
- package/components/hy-folding-panel/typing.d.ts +59 -0
- package/components/hy-form/hy-form.vue +372 -0
- package/components/hy-form/props.ts +15 -0
- package/components/hy-form/typing.d.ts +51 -0
- package/components/hy-grid/hy-grid.vue +126 -0
- package/components/hy-grid/props.ts +16 -0
- package/components/hy-grid/typing.d.ts +62 -0
- package/components/hy-icon/hy-icon.vue +207 -0
- package/components/hy-icon/props.ts +24 -0
- package/components/hy-icon/typing.d.ts +80 -0
- package/components/hy-input/hy-input.vue +402 -0
- package/components/hy-input/props.ts +41 -0
- package/components/hy-input/typing.d.ts +148 -0
- package/components/hy-line/hy-line.vue +44 -0
- package/components/hy-line/props.ts +12 -0
- package/components/hy-line/typing.d.ts +32 -0
- package/components/hy-line-progress/hy-line-progress.vue +118 -0
- package/components/hy-line-progress/props.ts +12 -0
- package/components/hy-line-progress/typing.d.ts +28 -0
- package/components/hy-list/hy-list.vue +250 -0
- package/components/hy-list/props.ts +18 -0
- package/components/hy-list/typing.d.ts +50 -0
- package/components/hy-login/ThePhoneLogin.vue +106 -0
- package/components/hy-login/TheUserLogin.vue +391 -0
- package/components/hy-login/hy-login.vue +283 -0
- package/components/hy-login/props.ts +32 -0
- package/components/hy-login/typing.d.ts +60 -0
- package/components/hy-modal/hy-modal.vue +240 -0
- package/components/hy-modal/props.ts +24 -0
- package/components/hy-modal/typing.d.ts +70 -0
- package/components/hy-navbar/hy-navbar.vue +194 -0
- package/components/hy-navbar/props.ts +24 -0
- package/components/hy-navbar/typing.d.ts +81 -0
- package/components/hy-notice-bar/hy-column-notice.vue +130 -0
- package/components/hy-notice-bar/hy-notice-bar.vue +82 -0
- package/components/hy-notice-bar/hy-row-notice.vue +182 -0
- package/components/hy-notice-bar/props.ts +19 -0
- package/components/hy-notice-bar/typing.d.ts +56 -0
- package/components/hy-number-step/hy-number-step.vue +428 -0
- package/components/hy-number-step/props.ts +29 -0
- package/components/hy-number-step/typing.d.ts +104 -0
- package/components/hy-overlay/hy-overlay.vue +54 -0
- package/components/hy-overlay/props.ts +10 -0
- package/components/hy-overlay/typing.d.ts +24 -0
- package/components/hy-picker/hy-picker.vue +499 -0
- package/components/hy-picker/props.ts +30 -0
- package/components/hy-picker/typing.d.ts +115 -0
- package/components/hy-popup/hy-popup.vue +269 -0
- package/components/hy-popup/props.ts +21 -0
- package/components/hy-popup/typing.d.ts +68 -0
- package/components/hy-price/hy-price.vue +86 -0
- package/components/hy-price/props.ts +13 -0
- package/components/hy-price/typing.d.ts +36 -0
- package/components/hy-qrcode/hy-qrcode.vue +153 -0
- package/components/hy-qrcode/props.ts +20 -0
- package/components/hy-qrcode/qrcode.js +1364 -0
- package/components/hy-qrcode/typing.d.ts +64 -0
- package/components/hy-radio/hy-radio.vue +319 -0
- package/components/hy-radio/props.ts +28 -0
- package/components/hy-radio/typing.d.ts +85 -0
- package/components/hy-rate/hy-rate.vue +261 -0
- package/components/hy-rate/props.ts +18 -0
- package/components/hy-rate/typing.d.ts +60 -0
- package/components/hy-read-more/hy-read-more.vue +134 -0
- package/components/hy-read-more/props.ts +20 -0
- package/components/hy-read-more/typing.d.ts +44 -0
- package/components/hy-safe-bottom/hy-safe-bottom.vue +64 -0
- package/components/hy-scroll-list/hy-scroll-list.vue +146 -0
- package/components/hy-scroll-list/props.ts +12 -0
- package/components/hy-scroll-list/typing.d.ts +28 -0
- package/components/hy-search/hy-search.vue +294 -0
- package/components/hy-search/props.ts +29 -0
- package/components/hy-search/typing.d.ts +109 -0
- package/components/hy-slider/hy-slider.vue +511 -0
- package/components/hy-slider/props.ts +21 -0
- package/components/hy-slider/typing.d.ts +68 -0
- package/components/hy-steps/hy-steps.vue +352 -0
- package/components/hy-steps/props.ts +15 -0
- package/components/hy-steps/typing.d.ts +58 -0
- package/components/hy-subsection/hy-subsection.vue +272 -0
- package/components/hy-subsection/props.ts +16 -0
- package/components/hy-subsection/typing.d.ts +44 -0
- package/components/hy-swiper/hy-swiper-indicator.vue +105 -0
- package/components/hy-swiper/hy-swiper.vue +242 -0
- package/components/hy-swiper/props.ts +30 -0
- package/components/hy-swiper/typing.d.ts +107 -0
- package/components/hy-switch/hy-switch.vue +168 -0
- package/components/hy-switch/props.ts +16 -0
- package/components/hy-switch/typing.d.ts +48 -0
- package/components/hy-tabs/hy-tabs.vue +416 -0
- package/components/hy-tabs/props.ts +26 -0
- package/components/hy-tabs/typing.d.ts +86 -0
- package/components/hy-tag/hy-tag.vue +374 -0
- package/components/hy-tag/props.ts +22 -0
- package/components/hy-tag/typing.d.ts +76 -0
- package/components/hy-textarea/hy-textarea.vue +229 -0
- package/components/hy-textarea/props.ts +26 -0
- package/components/hy-textarea/typing.d.ts +27 -0
- package/components/hy-tooltip/hy-tooltip.vue +332 -0
- package/components/hy-tooltip/props.ts +17 -0
- package/components/hy-tooltip/typing.d.ts +52 -0
- package/components/hy-transition/hy-transition.vue +150 -0
- package/components/hy-transition/index.scss +113 -0
- package/components/hy-transition/props.ts +10 -0
- package/components/hy-transition/typing.d.ts +36 -0
- package/components/hy-upload/hy-upload.vue +557 -0
- package/components/hy-upload/props.ts +29 -0
- package/components/hy-upload/typing.d.ts +147 -0
- package/components/hy-warn/hy-warn.vue +228 -0
- package/components/hy-warn/props.ts +14 -0
- package/components/hy-warn/typing.d.ts +40 -0
- package/components/hy-waterfall/hy-waterfall.vue +51 -0
- package/components/hy-waterfall/props.ts +10 -0
- package/components/hy-waterfall/typing.d.ts +20 -0
- package/components/index.ts +162 -0
- package/components/message/TheMessage.vue +169 -0
- package/components/message/index.ts +54 -0
- package/components/u-form/form.js +22 -0
- package/components/u-form/hy-form.vue +324 -0
- package/components/u-form/props.js +49 -0
- package/components/u-form/schema.js +1451 -0
- package/components/u-form/u-form.vue +267 -0
- package/components/u-form/utils.js +65 -0
- package/components/u-form-item/formItem.js +24 -0
- package/components/u-form-item/hy-form-item.vue +360 -0
- package/components/u-form-item/props.js +57 -0
- package/components/u-form-item/u-form-item.vue +294 -0
- package/components/yk-dialog/yk-dialog.vue +129 -0
- package/components/yk-tabbar/props.ts +49 -0
- package/components/yk-tabbar/yk-tabbar.vue +224 -0
- package/config/color.ts +6 -0
- package/config/icon.ts +366 -0
- package/config/index.ts +2 -0
- package/global/index.ts +6 -0
- package/global/register-properties.ts +37 -0
- package/index.ts +8 -0
- package/libs/css/common.scss +0 -0
- package/libs/css/iconfont.css +379 -0
- package/libs/css/iconfont.ttf +0 -0
- package/libs/css/mixin.scss +15 -0
- package/package.json +42 -0
- package/public/icons/error.png +0 -0
- package/public/icons/success.png +0 -0
- package/public/icons/warning.png +0 -0
- package/store/index.ts +1 -0
- package/store/userInfo.ts +25 -0
- package/theme.scss +94 -0
- package/typing/index.ts +7 -0
- package/typing/modules/common.d.ts +50 -0
- package/typing/modules/dialog.ts +17 -0
- package/typing/modules/enum.ts +67 -0
- package/typing/modules/form.ts +161 -0
- package/typing/modules/http.ts +68 -0
- package/typing/modules/icon.d.ts +366 -0
- package/typing/modules/img.ts +15 -0
- package/typing/modules/rect.ts +10 -0
- package/utils/address.json +5890 -0
- package/utils/base64.ts +119 -0
- package/utils/index.ts +3 -0
- package/utils/inside.ts +310 -0
- package/utils/utils.ts +446 -0
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { CSSProperties } from "vue";
|
|
2
|
+
|
|
3
|
+
export interface FileVo {
|
|
4
|
+
/**
|
|
5
|
+
* @description 上传文件本地地址链接
|
|
6
|
+
* */
|
|
7
|
+
url: string;
|
|
8
|
+
/**
|
|
9
|
+
* @description 上传文件类型
|
|
10
|
+
* */
|
|
11
|
+
type: "image" | "video" | "file";
|
|
12
|
+
/**
|
|
13
|
+
* @description 上传文件本地地址链接
|
|
14
|
+
* */
|
|
15
|
+
thumb: string;
|
|
16
|
+
/**
|
|
17
|
+
* @description 文件大小
|
|
18
|
+
* */
|
|
19
|
+
size: number;
|
|
20
|
+
/**
|
|
21
|
+
* @description 是否视频
|
|
22
|
+
* */
|
|
23
|
+
isVideo: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* @description 是否图片
|
|
26
|
+
* */
|
|
27
|
+
isImage: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* @description 是否显示删除按钮
|
|
30
|
+
* */
|
|
31
|
+
deletable: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* @description 上传时候状态
|
|
34
|
+
* */
|
|
35
|
+
status: "loading" | "failed" | "success";
|
|
36
|
+
/**
|
|
37
|
+
* @description 提示信息
|
|
38
|
+
* */
|
|
39
|
+
message: string;
|
|
40
|
+
/**
|
|
41
|
+
* @description 进度条
|
|
42
|
+
* */
|
|
43
|
+
schedule: string | number;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export default interface IProps {
|
|
47
|
+
/**
|
|
48
|
+
* @description 接受的文件类型, 可选值为all media image file video (默认 'image' )
|
|
49
|
+
* */
|
|
50
|
+
accept?: HyApp.FileType;
|
|
51
|
+
/**
|
|
52
|
+
* @description 根据文件拓展名过滤,每一项都不能是空字符串。默认不过滤。
|
|
53
|
+
* */
|
|
54
|
+
extension?: string[];
|
|
55
|
+
/**
|
|
56
|
+
* @description 图片或视频拾取模式,当accept为image类型时设置capture可选额外camera可以直接调起摄像头(默认 ['album', 'camera'] )
|
|
57
|
+
* */
|
|
58
|
+
capture?: ("album" | "camera")[];
|
|
59
|
+
/**
|
|
60
|
+
* @description 当accept为video时生效,是否压缩视频,默认为true(默认 true )
|
|
61
|
+
* */
|
|
62
|
+
compressed?: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* @description 当accept为video时生效,可选值为back或front(默认 'back' )
|
|
65
|
+
* */
|
|
66
|
+
camera?: "back" | "front";
|
|
67
|
+
/**
|
|
68
|
+
* @description 当accept为video时生效,拍摄视频最长拍摄时间,单位秒(默认 60 )
|
|
69
|
+
* */
|
|
70
|
+
maxDuration?: number;
|
|
71
|
+
/**
|
|
72
|
+
* @description 上传区域的图标,只能内置图标(默认 'camera-fill' )
|
|
73
|
+
* */
|
|
74
|
+
uploadIcon?: string;
|
|
75
|
+
/**
|
|
76
|
+
* @description 上传区域的图标的字体颜色,只能内置图标(默认 #D3D4D6 )
|
|
77
|
+
* */
|
|
78
|
+
uploadIconColor?: string;
|
|
79
|
+
/**
|
|
80
|
+
* @description 是否开启文件读取前事件(默认 false )
|
|
81
|
+
* */
|
|
82
|
+
useBeforeRead?: boolean;
|
|
83
|
+
/**
|
|
84
|
+
* @description 是否显示组件自带的图片预览功能(默认 true )
|
|
85
|
+
* */
|
|
86
|
+
previewFullImage?: boolean;
|
|
87
|
+
/**
|
|
88
|
+
* @description 最大上传数量(默认 52 )
|
|
89
|
+
* */
|
|
90
|
+
maxCount?: number;
|
|
91
|
+
/**
|
|
92
|
+
* @description 是否启用(默认 false )
|
|
93
|
+
* */
|
|
94
|
+
disabled?: boolean;
|
|
95
|
+
/**
|
|
96
|
+
* @description 预览上传的图片时的裁剪模式,和image组件mode属性一致(默认 'aspectFill' )
|
|
97
|
+
* */
|
|
98
|
+
imageMode?: "aspectFill" | "aspectFit" | "widthFix";
|
|
99
|
+
/**
|
|
100
|
+
* @description 标识符,可以在回调函数的第二项参数中获取
|
|
101
|
+
* */
|
|
102
|
+
name?: string;
|
|
103
|
+
/**
|
|
104
|
+
* @description 所选的图片的尺寸, 可选值为original compressed(默认 ['original', 'compressed'] )
|
|
105
|
+
* */
|
|
106
|
+
sizeType?: ("original" | "compressed")[];
|
|
107
|
+
/**
|
|
108
|
+
* @description 是否开启图片多选,部分安卓机型不支持 (默认 false )
|
|
109
|
+
* */
|
|
110
|
+
multiple?: boolean;
|
|
111
|
+
/**
|
|
112
|
+
* @description 是否展示删除按钮(默认 true )
|
|
113
|
+
* */
|
|
114
|
+
deletable?: boolean;
|
|
115
|
+
/**
|
|
116
|
+
* @description 文件大小限制,单位为byte (默认 Number.MAX_VALUE )
|
|
117
|
+
* */
|
|
118
|
+
maxSize?: number;
|
|
119
|
+
/**
|
|
120
|
+
* @description 显示已上传的文件列表
|
|
121
|
+
* */
|
|
122
|
+
fileList?: FileVo[];
|
|
123
|
+
/**
|
|
124
|
+
* @description 上传区域的提示文字
|
|
125
|
+
* */
|
|
126
|
+
uploadText?: string;
|
|
127
|
+
/**
|
|
128
|
+
* @description 内部预览图片区域和选择图片按钮的区域宽度(默认 80 )
|
|
129
|
+
* */
|
|
130
|
+
width?: string | number;
|
|
131
|
+
/**
|
|
132
|
+
* @description 内部预览图片区域和选择图片按钮的区域高度(默认 80 )
|
|
133
|
+
* */
|
|
134
|
+
height?: string | number;
|
|
135
|
+
/**
|
|
136
|
+
* @description 读取前的处理函数
|
|
137
|
+
* */
|
|
138
|
+
beforeRead?: (file: FileVo, detail: { name: string; index: number }) => void;
|
|
139
|
+
/**
|
|
140
|
+
* @description 读取后的处理函数
|
|
141
|
+
* */
|
|
142
|
+
afterRead?: (file: FileVo, detail: { name: string; index: number }) => void;
|
|
143
|
+
/**
|
|
144
|
+
* @description 定义需要用到的外部样式
|
|
145
|
+
* */
|
|
146
|
+
customStyle?: CSSProperties;
|
|
147
|
+
}
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<HyTransition mode="fade" :show="show">
|
|
3
|
+
<view
|
|
4
|
+
class="hy-alert"
|
|
5
|
+
:class="[`hy-alert--${type}--${effect}`]"
|
|
6
|
+
@tap.stop="clickHandler"
|
|
7
|
+
:style="[customStyle]"
|
|
8
|
+
>
|
|
9
|
+
<view class="hy-alert__icon" v-if="showIcon">
|
|
10
|
+
<HyIcon :name="iconName" size="21" :color="iconColor"></HyIcon>
|
|
11
|
+
</view>
|
|
12
|
+
<view
|
|
13
|
+
class="hy-alert__content"
|
|
14
|
+
:style="[
|
|
15
|
+
{
|
|
16
|
+
paddingRight: closable ? '20px' : 0
|
|
17
|
+
}
|
|
18
|
+
]"
|
|
19
|
+
>
|
|
20
|
+
<text
|
|
21
|
+
class="hy-alert__content__title"
|
|
22
|
+
v-if="title"
|
|
23
|
+
:style="[
|
|
24
|
+
{
|
|
25
|
+
fontSize: addUnit(fontSize),
|
|
26
|
+
textAlign: center ? 'center' : 'left'
|
|
27
|
+
}
|
|
28
|
+
]"
|
|
29
|
+
:class="[
|
|
30
|
+
effect === 'dark'
|
|
31
|
+
? 'hy-alert__text--dark'
|
|
32
|
+
: `hy-alert__text--${type}--light`
|
|
33
|
+
]"
|
|
34
|
+
>{{ title }}</text
|
|
35
|
+
>
|
|
36
|
+
<text
|
|
37
|
+
class="hy-alert__content__desc"
|
|
38
|
+
v-if="description"
|
|
39
|
+
:style="[
|
|
40
|
+
{
|
|
41
|
+
fontSize: addUnit(fontSize),
|
|
42
|
+
textAlign: center ? 'center' : 'left'
|
|
43
|
+
}
|
|
44
|
+
]"
|
|
45
|
+
:class="[
|
|
46
|
+
effect === 'dark'
|
|
47
|
+
? 'hy-alert__text--dark'
|
|
48
|
+
: `hy-alert__text--${type}--light`
|
|
49
|
+
]"
|
|
50
|
+
>{{ description }}</text
|
|
51
|
+
>
|
|
52
|
+
</view>
|
|
53
|
+
<view class="hy-alert__close" v-if="closable" @tap.stop="closeHandler">
|
|
54
|
+
<HyIcon :name="IconConfig.CLOSE" :color="iconColor" size="15"></HyIcon>
|
|
55
|
+
</view>
|
|
56
|
+
</view>
|
|
57
|
+
</HyTransition>
|
|
58
|
+
</template>
|
|
59
|
+
|
|
60
|
+
<script setup lang="ts">
|
|
61
|
+
import { computed, ref, toRefs } from "vue";
|
|
62
|
+
import defaultProps from "./props";
|
|
63
|
+
import IProps from "./typing";
|
|
64
|
+
import { addUnit } from "../../utils";
|
|
65
|
+
import { IconConfig } from "../../config";
|
|
66
|
+
|
|
67
|
+
// 组件
|
|
68
|
+
import HyTransition from "../hy-transition/hy-transition.vue";
|
|
69
|
+
import HyIcon from "../hy-icon/hy-icon.vue";
|
|
70
|
+
|
|
71
|
+
const props = withDefaults(defineProps<IProps>(), defaultProps);
|
|
72
|
+
const { type, effect } = toRefs(props);
|
|
73
|
+
const emit = defineEmits(["click", "close"]);
|
|
74
|
+
|
|
75
|
+
const show = ref<boolean>(true);
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* @description icon颜色
|
|
79
|
+
* */
|
|
80
|
+
const iconColor = computed(() => {
|
|
81
|
+
return effect.value === "light" ? type.value : "#fff";
|
|
82
|
+
});
|
|
83
|
+
/**
|
|
84
|
+
* @description 不同主题对应不同的图标
|
|
85
|
+
* */
|
|
86
|
+
const iconName = computed(() => {
|
|
87
|
+
switch (type.value) {
|
|
88
|
+
case "success":
|
|
89
|
+
return IconConfig.SUCCESS_FILL;
|
|
90
|
+
case "error":
|
|
91
|
+
return IconConfig.CLOSE_CIRCLE_FILL;
|
|
92
|
+
case "warning":
|
|
93
|
+
return IconConfig.NOTICE_FILL;
|
|
94
|
+
case "info":
|
|
95
|
+
return IconConfig.HELP_FILL;
|
|
96
|
+
case "primary":
|
|
97
|
+
return IconConfig.MESSAGE_FILL;
|
|
98
|
+
default:
|
|
99
|
+
return IconConfig.CLOSE_CIRCLE_FILL;
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* @description 点击内容
|
|
105
|
+
* */
|
|
106
|
+
const clickHandler = () => {
|
|
107
|
+
emit("click");
|
|
108
|
+
};
|
|
109
|
+
/**
|
|
110
|
+
* @description 点击关闭按钮
|
|
111
|
+
* */
|
|
112
|
+
const closeHandler = () => {
|
|
113
|
+
show.value = false;
|
|
114
|
+
emit("close");
|
|
115
|
+
};
|
|
116
|
+
</script>
|
|
117
|
+
|
|
118
|
+
<style lang="scss" scoped>
|
|
119
|
+
@import "../../libs/css/mixin.scss";
|
|
120
|
+
@import "../../theme.scss";
|
|
121
|
+
|
|
122
|
+
.hy-alert {
|
|
123
|
+
position: relative;
|
|
124
|
+
background-color: $hy-primary;
|
|
125
|
+
padding: 8px 10px;
|
|
126
|
+
@include flex(row);
|
|
127
|
+
align-items: center;
|
|
128
|
+
border-radius: 4px;
|
|
129
|
+
|
|
130
|
+
&--primary--dark {
|
|
131
|
+
background-color: $hy-primary;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
&--primary--light {
|
|
135
|
+
background-color: #ecf5ff;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
&--error--dark {
|
|
139
|
+
background-color: $hy-error;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
&--error--light {
|
|
143
|
+
background-color: #fef0f0;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
&--success--dark {
|
|
147
|
+
background-color: $hy-success;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
&--success--light {
|
|
151
|
+
background-color: #f5fff0;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
&--warning--dark {
|
|
155
|
+
background-color: $hy-warning;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
&--warning--light {
|
|
159
|
+
background-color: #fdf6ec;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
&--info--dark {
|
|
163
|
+
background-color: $hy-info;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
&--info--light {
|
|
167
|
+
background-color: #f4f4f5;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
&__icon {
|
|
171
|
+
margin-right: 5px;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
&__content {
|
|
175
|
+
@include flex(column);
|
|
176
|
+
flex: 1;
|
|
177
|
+
|
|
178
|
+
&__title {
|
|
179
|
+
font-size: 14px;
|
|
180
|
+
font-weight: bold;
|
|
181
|
+
color: #fff;
|
|
182
|
+
margin-bottom: 2px;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
&__desc {
|
|
186
|
+
font-size: 14px;
|
|
187
|
+
flex-wrap: wrap;
|
|
188
|
+
color: #fff;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
&__title--dark,
|
|
193
|
+
&__desc--dark {
|
|
194
|
+
color: #ffffff;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
&__text--primary--light,
|
|
198
|
+
&__text--primary--light {
|
|
199
|
+
color: $hy-primary;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
&__text--success--light,
|
|
203
|
+
&__text--success--light {
|
|
204
|
+
color: $hy-success;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
&__text--warning--light,
|
|
208
|
+
&__text--warning--light {
|
|
209
|
+
color: $hy-warning;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
&__text--error--light,
|
|
213
|
+
&__text--error--light {
|
|
214
|
+
color: $hy-error;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
&__text--info--light,
|
|
218
|
+
&__text--info--light {
|
|
219
|
+
color: $hy-info;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
&__close {
|
|
223
|
+
position: absolute;
|
|
224
|
+
top: 11px;
|
|
225
|
+
right: 10px;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
</style>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { CSSProperties } from "vue";
|
|
2
|
+
|
|
3
|
+
export default interface IProps {
|
|
4
|
+
/**
|
|
5
|
+
* @description 显示的文字
|
|
6
|
+
* */
|
|
7
|
+
title: string;
|
|
8
|
+
/**
|
|
9
|
+
* @description 使用预设的颜色 (默认 'warning' )
|
|
10
|
+
* */
|
|
11
|
+
type?: HyApp.ThemeType;
|
|
12
|
+
/**
|
|
13
|
+
* @description 辅助性文字,颜色比title浅一点,字号也小一点,可选
|
|
14
|
+
* */
|
|
15
|
+
description?: string;
|
|
16
|
+
/**
|
|
17
|
+
* @description 关闭按钮(默认为叉号icon图标) (默认 false )
|
|
18
|
+
* */
|
|
19
|
+
closable?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* @description 是否显示左边的辅助图标 ( 默认 false )
|
|
22
|
+
* */
|
|
23
|
+
showIcon?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* @description 多图时,图片缩放裁剪的模式 (默认 'light' )
|
|
26
|
+
* */
|
|
27
|
+
effect?: "light" | "dark";
|
|
28
|
+
/**
|
|
29
|
+
* @description 文字是否居中 (默认 false )
|
|
30
|
+
* */
|
|
31
|
+
center?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* @description 字体大小 (默认 14 )
|
|
34
|
+
* */
|
|
35
|
+
fontSize?: number;
|
|
36
|
+
/**
|
|
37
|
+
* @description 定义需要用到的外部样式
|
|
38
|
+
* */
|
|
39
|
+
customStyle?: CSSProperties;
|
|
40
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<HyList
|
|
3
|
+
:container-height="containerHeight"
|
|
4
|
+
:list="list"
|
|
5
|
+
:itemHeight="itemHeight"
|
|
6
|
+
>
|
|
7
|
+
</HyList>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script setup lang="ts">
|
|
11
|
+
import { computed, CSSProperties, toRefs } from "vue";
|
|
12
|
+
import defaultProps from "./props";
|
|
13
|
+
import IProps from "./typing";
|
|
14
|
+
import HyTransition from "../hy-transition/hy-transition.vue";
|
|
15
|
+
|
|
16
|
+
const props = withDefaults(defineProps<IProps>(), defaultProps);
|
|
17
|
+
const { customStyle, opacity, zIndex } = toRefs(props);
|
|
18
|
+
const emit = defineEmits(["click"]);
|
|
19
|
+
|
|
20
|
+
const overlayStyle = computed<CSSProperties>(() => {
|
|
21
|
+
const style: CSSProperties = {
|
|
22
|
+
position: "fixed",
|
|
23
|
+
top: 0,
|
|
24
|
+
left: 0,
|
|
25
|
+
right: 0,
|
|
26
|
+
zIndex: zIndex?.value,
|
|
27
|
+
bottom: 0,
|
|
28
|
+
"background-color": `rgba(0, 0, 0, ${opacity.value})`
|
|
29
|
+
};
|
|
30
|
+
return Object.assign(style, customStyle.value || {});
|
|
31
|
+
});
|
|
32
|
+
const clickHandler = () => {
|
|
33
|
+
emit("click");
|
|
34
|
+
};
|
|
35
|
+
</script>
|
|
36
|
+
|
|
37
|
+
<style lang="scss" scoped>
|
|
38
|
+
$u-overlay-top: 0 !default;
|
|
39
|
+
$u-overlay-left: 0 !default;
|
|
40
|
+
$u-overlay-width: 100% !default;
|
|
41
|
+
$u-overlay-height: 100% !default;
|
|
42
|
+
$u-overlay-background-color: rgba(0, 0, 0, 0.7) !default;
|
|
43
|
+
.u-overlay {
|
|
44
|
+
position: fixed;
|
|
45
|
+
top: $u-overlay-top;
|
|
46
|
+
left: $u-overlay-left;
|
|
47
|
+
width: $u-overlay-width;
|
|
48
|
+
height: $u-overlay-height;
|
|
49
|
+
background-color: $u-overlay-background-color;
|
|
50
|
+
}
|
|
51
|
+
</style>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { CSSProperties } from "vue";
|
|
2
|
+
|
|
3
|
+
export default interface IProps {
|
|
4
|
+
/**
|
|
5
|
+
* @description 数据列表
|
|
6
|
+
* */
|
|
7
|
+
list: (AnyObject | string)[];
|
|
8
|
+
/**
|
|
9
|
+
* @description 容器高度,必须给个高度,否则加载全部数据
|
|
10
|
+
* */
|
|
11
|
+
containerHeight: string;
|
|
12
|
+
/**
|
|
13
|
+
* @description 子容器的高度,必须和内容一致,否则计算有问题
|
|
14
|
+
* */
|
|
15
|
+
itemHeight?: number | string;
|
|
16
|
+
/**
|
|
17
|
+
* @description 定义需要用到的外部样式
|
|
18
|
+
* */
|
|
19
|
+
customStyle?: CSSProperties;
|
|
20
|
+
}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import YkTabbar from "./yk-tabbar/yk-tabbar.vue";
|
|
2
|
+
import Dialog from "./dialog";
|
|
3
|
+
/* #ifdef H5 */
|
|
4
|
+
import DialogService from "./message";
|
|
5
|
+
/* #endif */
|
|
6
|
+
|
|
7
|
+
// 组件库
|
|
8
|
+
import HyAddressPicker from "./hy-address-picker/hy-address-picker.vue";
|
|
9
|
+
import HyAvatar from "./hy-avatar/hy-avatar.vue";
|
|
10
|
+
import HyBackTop from "./hy-back-top/hy-back-top.vue";
|
|
11
|
+
import HyBadge from "./hy-badge/hy-badge.vue";
|
|
12
|
+
import HyButton from "./hy-button/hy-button.vue";
|
|
13
|
+
import HyCard from "./hy-card/hy-card.vue";
|
|
14
|
+
import HyCell from "./hy-cell/hy-cell.vue";
|
|
15
|
+
import HyCheckButton from "./hy-check-button/hy-check-button.vue";
|
|
16
|
+
import HyCheckbox from "./hy-checkbox/hy-checkbox.vue";
|
|
17
|
+
import HyDatetimePicker from "./hy-datetime-picker/hy-datetime-picker.vue";
|
|
18
|
+
import HyDivider from "./hy-divider/hy-divider.vue";
|
|
19
|
+
import YkEmpty from "./hy-empty/hy-empty.vue";
|
|
20
|
+
import HyFoldingPanel from "./hy-folding-panel/hy-folding-panel.vue";
|
|
21
|
+
import HyForm from "./hy-form/hy-form.vue";
|
|
22
|
+
import HyGrid from "./hy-grid/hy-grid.vue";
|
|
23
|
+
import HyIcon from "./hy-icon/hy-icon.vue";
|
|
24
|
+
import HyInput from "./hy-input/hy-input.vue";
|
|
25
|
+
import HyLine from "./hy-line/hy-line.vue";
|
|
26
|
+
import HyLineProgress from "./hy-line-progress/hy-line-progress.vue";
|
|
27
|
+
import HyList from "./hy-list/hy-list.vue";
|
|
28
|
+
import YkLogin from "./hy-login/hy-login.vue";
|
|
29
|
+
import HyModal from "./hy-modal/hy-modal.vue";
|
|
30
|
+
import HyNavbar from "./hy-navbar/hy-navbar.vue";
|
|
31
|
+
import HyNoticeBar from "./hy-notice-bar/hy-notice-bar.vue";
|
|
32
|
+
import HyNumberStep from "./hy-number-step/hy-number-step.vue";
|
|
33
|
+
import HyOverlay from "./hy-overlay/hy-overlay.vue";
|
|
34
|
+
import YkPrice from "./hy-price/hy-price.vue";
|
|
35
|
+
import HyPicker from "./hy-picker/hy-picker.vue";
|
|
36
|
+
import HyPopup from "./hy-popup/hy-popup.vue";
|
|
37
|
+
import HyQrcode from "./hy-qrcode/hy-qrcode.vue";
|
|
38
|
+
import HyRadio from "./hy-radio/hy-radio.vue";
|
|
39
|
+
import HyRate from "./hy-rate/hy-rate.vue";
|
|
40
|
+
import HyReadMore from "./hy-read-more/hy-read-more.vue";
|
|
41
|
+
// import HySafeBottom from "./hy-safe-bottom/hy-safe-bottom.vue";
|
|
42
|
+
import HyScrollList from "./hy-scroll-list/hy-scroll-list.vue";
|
|
43
|
+
import HySearch from "./hy-search/hy-search.vue";
|
|
44
|
+
import HySlider from "./hy-slider/hy-slider.vue";
|
|
45
|
+
import HySteps from "./hy-steps/hy-steps.vue";
|
|
46
|
+
import HySubsection from "./hy-subsection/hy-subsection.vue";
|
|
47
|
+
import HySwiper from "./hy-swiper/hy-swiper.vue";
|
|
48
|
+
import HySwitch from "./hy-switch/hy-switch.vue";
|
|
49
|
+
import HyTabs from "./hy-tabs/hy-tabs.vue";
|
|
50
|
+
import HyTag from "./hy-tag/hy-tag.vue";
|
|
51
|
+
import HyTextarea from "./hy-textarea/hy-textarea.vue";
|
|
52
|
+
import HyTooltip from "./hy-tooltip/hy-tooltip.vue";
|
|
53
|
+
import HyTransition from "./hy-transition/hy-transition.vue";
|
|
54
|
+
import HyUpload from "./hy-upload/hy-upload.vue";
|
|
55
|
+
import HyWarn from "./hy-warn/hy-warn.vue";
|
|
56
|
+
|
|
57
|
+
const install = (Vue: any) => {
|
|
58
|
+
Vue.component("yk-tabbar", YkTabbar);
|
|
59
|
+
|
|
60
|
+
Vue.component("HyAddressPicker", HyAddressPicker);
|
|
61
|
+
Vue.component("HyAvatar", HyAvatar);
|
|
62
|
+
Vue.component("HyBackTop", HyBackTop);
|
|
63
|
+
Vue.component("HyBadge", HyBadge);
|
|
64
|
+
Vue.component("HyButton", HyButton);
|
|
65
|
+
Vue.component("HyCard", HyCard);
|
|
66
|
+
Vue.component("HyCell", HyCell);
|
|
67
|
+
Vue.component("HyCheckButton", HyCheckButton);
|
|
68
|
+
Vue.component("HyCheckbox", HyCheckbox);
|
|
69
|
+
Vue.component("HyDatetimePicker", HyDatetimePicker);
|
|
70
|
+
Vue.component("HyDivider", HyDivider);
|
|
71
|
+
Vue.component("YkEmpty", YkEmpty);
|
|
72
|
+
Vue.component("HyFoldingPanel", HyFoldingPanel);
|
|
73
|
+
Vue.component("HyForm", HyForm);
|
|
74
|
+
Vue.component("HyGrid", HyGrid);
|
|
75
|
+
Vue.component("HyIcon", HyIcon);
|
|
76
|
+
Vue.component("HyInput", HyInput);
|
|
77
|
+
Vue.component("HyLine", HyLine);
|
|
78
|
+
Vue.component("HyLineProgress", HyLineProgress);
|
|
79
|
+
Vue.component("HyList", HyList);
|
|
80
|
+
Vue.component("YkLogin", YkLogin);
|
|
81
|
+
Vue.component("HyModal", HyModal);
|
|
82
|
+
Vue.component("HyNavbar", HyNavbar);
|
|
83
|
+
Vue.component("HyNoticeBar", HyNoticeBar);
|
|
84
|
+
Vue.component("HyNumberStep", HyNumberStep);
|
|
85
|
+
Vue.component("HyOverlay", HyOverlay);
|
|
86
|
+
Vue.component("YkPrice", YkPrice);
|
|
87
|
+
Vue.component("HyPicker", HyPicker);
|
|
88
|
+
Vue.component("HyPopup", HyPopup);
|
|
89
|
+
Vue.component("HyQrcode", HyQrcode);
|
|
90
|
+
Vue.component("HyRadio", HyRadio);
|
|
91
|
+
Vue.component("HyRate", HyRate);
|
|
92
|
+
Vue.component("HyReadMore", HyReadMore);
|
|
93
|
+
Vue.component("HyScrollList", HyScrollList);
|
|
94
|
+
Vue.component("HySearch", HySearch);
|
|
95
|
+
Vue.component("HySlider", HySlider);
|
|
96
|
+
Vue.component("HySteps", HySteps);
|
|
97
|
+
Vue.component("HySubsection", HySubsection);
|
|
98
|
+
Vue.component("HySwiper", HySwiper);
|
|
99
|
+
Vue.component("HySwitch", HySwitch);
|
|
100
|
+
Vue.component("HyTabs", HyTabs);
|
|
101
|
+
Vue.component("HyTag", HyTag);
|
|
102
|
+
Vue.component("HyTextarea", HyTextarea);
|
|
103
|
+
Vue.component("HyTooltip", HyTooltip);
|
|
104
|
+
Vue.component("HyTransition", HyTransition);
|
|
105
|
+
Vue.component("HyUpload", HyUpload);
|
|
106
|
+
Vue.component("HyWarn", HyWarn);
|
|
107
|
+
// Vue.config.globalProperties.$dialog = myDialog;
|
|
108
|
+
};
|
|
109
|
+
export {
|
|
110
|
+
install,
|
|
111
|
+
// Dialog,
|
|
112
|
+
/* #ifdef H5 */
|
|
113
|
+
DialogService,
|
|
114
|
+
/* #endif */
|
|
115
|
+
HyAddressPicker,
|
|
116
|
+
HyAvatar,
|
|
117
|
+
HyBackTop,
|
|
118
|
+
HyBadge,
|
|
119
|
+
HyButton,
|
|
120
|
+
HyCard,
|
|
121
|
+
HyCell,
|
|
122
|
+
HyCheckButton,
|
|
123
|
+
HyCheckbox,
|
|
124
|
+
HyDatetimePicker,
|
|
125
|
+
HyDivider,
|
|
126
|
+
YkEmpty,
|
|
127
|
+
HyFoldingPanel,
|
|
128
|
+
HyForm,
|
|
129
|
+
HyGrid,
|
|
130
|
+
HyIcon,
|
|
131
|
+
HyInput,
|
|
132
|
+
HyLine,
|
|
133
|
+
HyLineProgress,
|
|
134
|
+
HyList,
|
|
135
|
+
YkLogin,
|
|
136
|
+
HyModal,
|
|
137
|
+
HyNavbar,
|
|
138
|
+
HyNoticeBar,
|
|
139
|
+
HyNumberStep,
|
|
140
|
+
HyOverlay,
|
|
141
|
+
YkPrice,
|
|
142
|
+
HyPicker,
|
|
143
|
+
HyPopup,
|
|
144
|
+
HyQrcode,
|
|
145
|
+
HyRadio,
|
|
146
|
+
HyRate,
|
|
147
|
+
HyReadMore,
|
|
148
|
+
HyScrollList,
|
|
149
|
+
HySearch,
|
|
150
|
+
HySlider,
|
|
151
|
+
HySteps,
|
|
152
|
+
HySubsection,
|
|
153
|
+
HySwiper,
|
|
154
|
+
HySwitch,
|
|
155
|
+
HyTabs,
|
|
156
|
+
HyTag,
|
|
157
|
+
HyTextarea,
|
|
158
|
+
HyTooltip,
|
|
159
|
+
HyTransition,
|
|
160
|
+
HyUpload,
|
|
161
|
+
HyWarn
|
|
162
|
+
};
|