hy-app 0.3.2 → 0.3.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 +1 -1
- package/components/hy-address-picker/index.scss +1 -1
- package/components/hy-avatar/hy-avatar.vue +10 -13
- package/components/hy-avatar/index.scss +2 -2
- package/components/hy-back-top/index.scss +2 -2
- package/components/hy-badge/index.scss +1 -1
- package/components/hy-button/index.scss +3 -3
- package/components/hy-calendar/header.vue +11 -11
- package/components/hy-calendar/index.scss +26 -26
- package/components/hy-calendar/month.vue +18 -19
- package/components/hy-card/hy-card.vue +10 -12
- package/components/hy-card/index.scss +12 -10
- package/components/hy-cell/hy-cell.vue +13 -13
- package/components/hy-cell/index.scss +16 -16
- package/components/hy-checkbox/hy-checkbox.vue +10 -10
- package/components/hy-checkbox/index.scss +25 -24
- package/components/hy-code-input/hy-code-input.vue +314 -314
- package/components/hy-code-input/index.scss +1 -1
- package/components/hy-config-provider/index.scss +3 -2
- package/components/hy-count-down/index.scss +1 -1
- package/components/hy-count-to/index.scss +1 -1
- package/components/hy-divider/index.scss +1 -1
- package/components/hy-dropdown/index.scss +1 -1
- package/components/hy-dropdown-item/index.scss +1 -1
- package/components/hy-empty/hy-empty.vue +15 -12
- package/components/hy-empty/icon.ts +32 -58
- package/components/hy-empty/index.scss +3 -3
- package/components/hy-empty/typing.d.ts +48 -35
- package/components/hy-float-button/index.scss +1 -1
- package/components/hy-folding-panel/index.scss +1 -1
- package/components/hy-form/hy-form.vue +3 -2
- package/components/hy-form-group/index.scss +1 -1
- package/components/hy-form-item/index.scss +41 -41
- package/components/hy-grid/index.scss +1 -1
- package/components/hy-icon/index.scss +1 -1
- package/components/hy-image/index.scss +1 -1
- package/components/hy-input/hy-input.vue +2 -2
- package/components/hy-input/index.scss +1 -1
- package/components/hy-line/index.scss +1 -1
- package/components/hy-line-progress/index.scss +1 -1
- package/components/hy-list/index.scss +1 -1
- package/components/hy-loading/index.scss +1 -1
- package/components/hy-menu/index.scss +1 -1
- package/components/hy-modal/index.scss +1 -1
- package/components/hy-navbar/index.scss +1 -1
- package/components/hy-notice-bar/hy-column-notice.vue +2 -2
- package/components/hy-notice-bar/hy-row-notice.vue +1 -1
- package/components/hy-notice-bar/index.scss +7 -1
- package/components/hy-notify/index.scss +1 -1
- package/components/hy-number-step/index.scss +1 -1
- package/components/hy-overlay/index.scss +1 -1
- package/components/hy-pagination/index.scss +1 -1
- package/components/hy-picker/index.scss +1 -1
- package/components/hy-popover/index.scss +4 -4
- package/components/hy-popup/index.scss +1 -1
- package/components/hy-price/index.scss +1 -1
- package/components/hy-qrcode/index.scss +1 -1
- package/components/hy-radio/index.scss +1 -1
- package/components/hy-read-more/index.scss +1 -1
- package/components/hy-scroll-list/index.scss +1 -1
- package/components/hy-search/hy-search.vue +2 -9
- package/components/hy-search/index.scss +1 -1
- package/components/hy-signature/index.scss +1 -1
- package/components/hy-slider/hy-slider.vue +1 -1
- package/components/hy-slider/index.scss +1 -1
- package/components/hy-steps/index.scss +1 -1
- package/components/hy-submit-bar/index.scss +1 -1
- package/components/hy-subsection/index.scss +1 -1
- package/components/hy-swipe-action/index.scss +1 -1
- package/components/hy-swiper/index.scss +1 -1
- package/components/hy-switch/index.scss +1 -1
- package/components/hy-tabBar/index.scss +1 -1
- package/components/hy-tabs/index.scss +1 -1
- package/components/hy-tag/hy-tag.vue +2 -2
- package/components/hy-tag/index.scss +14 -13
- package/components/hy-text/index.scss +1 -1
- package/components/hy-textarea/index.scss +7 -1
- package/components/hy-toast/index.scss +1 -1
- package/components/hy-tooltip/index.scss +1 -1
- package/components/hy-upload/hy-upload.vue +5 -12
- package/components/hy-upload/index.scss +1 -1
- package/components/hy-upload/typing.d.ts +21 -0
- package/components/hy-warn/index.scss +1 -1
- package/components/hy-watermark/index.scss +1 -1
- package/index.scss +3 -2
- package/libs/css/common.scss +1 -1
- package/libs/css/mixin.scss +16 -13
- package/{theme.scss → libs/css/theme.scss} +2 -0
- package/libs/css/{vars.css → vars.scss} +2 -0
- package/package.json +6 -3
- package/typing/modules/common.d.ts +2 -0
- package/web-types.json +1 -1
- package/components/avatar.zip +0 -0
|
@@ -62,7 +62,7 @@ export default {
|
|
|
62
62
|
</script>
|
|
63
63
|
|
|
64
64
|
<script setup lang="ts">
|
|
65
|
-
import { computed,
|
|
65
|
+
import { computed, ref, watch } from "vue";
|
|
66
66
|
import type { CSSProperties, PropType } from "vue";
|
|
67
67
|
import type { IAvatarEmit } from "./typing";
|
|
68
68
|
import { addUnit, isNumber, random } from "../../utils";
|
|
@@ -92,7 +92,7 @@ const props = defineProps({
|
|
|
92
92
|
* @values large, medium, small
|
|
93
93
|
* */
|
|
94
94
|
size: {
|
|
95
|
-
type: [String, Number]
|
|
95
|
+
type: [String, Number] as PropType<string | number>,
|
|
96
96
|
default: "medium",
|
|
97
97
|
},
|
|
98
98
|
/**
|
|
@@ -140,7 +140,10 @@ const props = defineProps({
|
|
|
140
140
|
default: 0,
|
|
141
141
|
},
|
|
142
142
|
/** 组件标识符 */
|
|
143
|
-
name:
|
|
143
|
+
name: {
|
|
144
|
+
type: String,
|
|
145
|
+
default: "",
|
|
146
|
+
},
|
|
144
147
|
/** 自定义输入框外部样式 */
|
|
145
148
|
customStyle: {
|
|
146
149
|
type: Object as PropType<CSSProperties>,
|
|
@@ -203,10 +206,10 @@ const avatarStyle = computed<CSSProperties>(() => {
|
|
|
203
206
|
style.height = addUnit(props.size);
|
|
204
207
|
}
|
|
205
208
|
|
|
206
|
-
return Object.assign(style, customStyle
|
|
209
|
+
return Object.assign(style, props.customStyle);
|
|
207
210
|
});
|
|
208
211
|
const avatarClass = computed<string[]>(() => {
|
|
209
|
-
const classes: string[] = [`hy-avatar--${shape
|
|
212
|
+
const classes: string[] = [`hy-avatar--${props.shape}`];
|
|
210
213
|
if (typeof props.size === "string") {
|
|
211
214
|
classes.push(`hy-avatar--${props.size}`);
|
|
212
215
|
}
|
|
@@ -224,22 +227,16 @@ const init = () => {
|
|
|
224
227
|
};
|
|
225
228
|
init();
|
|
226
229
|
|
|
227
|
-
/**
|
|
228
|
-
* @description 判断传入的name属性,是否图片路径,只要带有"/"均认为是图片形式
|
|
229
|
-
* */
|
|
230
|
-
const isImg = () => {
|
|
231
|
-
return props.src.indexOf("/") !== -1;
|
|
232
|
-
};
|
|
233
230
|
// 图片加载时失败时触发
|
|
234
231
|
function errorHandler() {
|
|
235
|
-
avatarUrl.value = defaultUrl
|
|
232
|
+
avatarUrl.value = props.defaultUrl || base64Avatar;
|
|
236
233
|
}
|
|
237
234
|
|
|
238
235
|
/**
|
|
239
236
|
* @description 点击头像
|
|
240
237
|
* */
|
|
241
238
|
const clickHandler = (e: Event) => {
|
|
242
|
-
emit("click", name
|
|
239
|
+
emit("click", props.name, e);
|
|
243
240
|
};
|
|
244
241
|
</script>
|
|
245
242
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
@use "../../libs/css/mixin.scss" as *;
|
|
2
|
-
@use "../../theme
|
|
2
|
+
@use "../../libs/css/theme" as *;
|
|
3
3
|
|
|
4
4
|
@include b(avatar) {
|
|
5
5
|
@include flex;
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
height: $hy-avatar-size-lg;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
@include e(image) {
|
|
33
33
|
width: 100%;
|
|
34
34
|
height: 100%;
|
|
35
35
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
@use "../../libs/css/mixin.scss" as *;
|
|
2
|
-
@use "../../theme
|
|
2
|
+
@use "../../libs/css/theme" as *;
|
|
3
3
|
|
|
4
4
|
@include b(back-top) {
|
|
5
5
|
@include flex;
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
justify-content: center;
|
|
11
11
|
background-color: $hy-background--3;
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
@include e(tips) {
|
|
14
14
|
font-size: 12px;
|
|
15
15
|
transform: scale(0.8);
|
|
16
16
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
@use "../../libs/css/mixin.scss" as *;
|
|
2
|
-
@use "../../theme
|
|
2
|
+
@use "../../libs/css/theme" as *;
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
@include b(button){
|
|
@@ -14,11 +14,11 @@
|
|
|
14
14
|
/* #endif */
|
|
15
15
|
flex-direction: row;
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
@include e(text) {
|
|
18
18
|
font-size: 15px;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
@include e(loading-text) {
|
|
22
22
|
font-size: 15px;
|
|
23
23
|
margin-left: 4px;
|
|
24
24
|
}
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<view class="hy-calendar
|
|
3
|
-
<text class="hy-calendar
|
|
4
|
-
<text class="hy-calendar
|
|
2
|
+
<view class="hy-calendar--header hy-border-bottom">
|
|
3
|
+
<text class="hy-calendar--header__title" v-if="showTitle">{{ title }}</text>
|
|
4
|
+
<text class="hy-calendar--header__subtitle" v-if="showSubtitle">{{
|
|
5
5
|
subtitle
|
|
6
6
|
}}</text>
|
|
7
|
-
<view class="hy-calendar
|
|
8
|
-
<text class="hy-calendar
|
|
7
|
+
<view class="hy-calendar--header__weekdays">
|
|
8
|
+
<text class="hy-calendar--header__weekdays__weekday">{{
|
|
9
9
|
weekText[0]
|
|
10
10
|
}}</text>
|
|
11
|
-
<text class="hy-calendar
|
|
11
|
+
<text class="hy-calendar--header__weekdays__weekday">{{
|
|
12
12
|
weekText[1]
|
|
13
13
|
}}</text>
|
|
14
|
-
<text class="hy-calendar
|
|
14
|
+
<text class="hy-calendar--header__weekdays__weekday">{{
|
|
15
15
|
weekText[2]
|
|
16
16
|
}}</text>
|
|
17
|
-
<text class="hy-calendar
|
|
17
|
+
<text class="hy-calendar--header__weekdays__weekday">{{
|
|
18
18
|
weekText[3]
|
|
19
19
|
}}</text>
|
|
20
|
-
<text class="hy-calendar
|
|
20
|
+
<text class="hy-calendar--header__weekdays__weekday">{{
|
|
21
21
|
weekText[4]
|
|
22
22
|
}}</text>
|
|
23
|
-
<text class="hy-calendar
|
|
23
|
+
<text class="hy-calendar--header__weekdays__weekday">{{
|
|
24
24
|
weekText[5]
|
|
25
25
|
}}</text>
|
|
26
|
-
<text class="hy-calendar
|
|
26
|
+
<text class="hy-calendar--header__weekdays__weekday">{{
|
|
27
27
|
weekText[6]
|
|
28
28
|
}}</text>
|
|
29
29
|
</view>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
@use "../../libs/css/mixin.scss" as *;
|
|
2
|
-
@use "../../theme
|
|
2
|
+
@use "../../libs/css/theme" as *;
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
/* 主样式 */
|
|
@@ -10,12 +10,12 @@
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
/* 头部样式 */
|
|
13
|
-
|
|
13
|
+
@include m(header) {
|
|
14
14
|
display: flex;
|
|
15
15
|
flex-direction: column;
|
|
16
16
|
padding-bottom: 4px;
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
@include e(title) {
|
|
19
19
|
font-size: 16px;
|
|
20
20
|
text-align: center;
|
|
21
21
|
height: 42px;
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
font-weight: bold;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
@include e(subtitle) {
|
|
27
27
|
font-size: 14px;
|
|
28
28
|
color: $hy-text-color--2;
|
|
29
29
|
height: 40px;
|
|
@@ -32,11 +32,11 @@
|
|
|
32
32
|
font-weight: bold;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
@include e(weekdays) {
|
|
36
36
|
@include flex;
|
|
37
37
|
justify-content: space-between;
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
@include e(weekday) {
|
|
40
40
|
font-size: 13px;
|
|
41
41
|
color: $hy-text-color--grey;
|
|
42
42
|
line-height: 30px;
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
@include m(month) {
|
|
51
|
+
@include e(title) {
|
|
52
52
|
display: flex;
|
|
53
53
|
flex-direction: column;
|
|
54
54
|
font-size: 14px;
|
|
@@ -60,16 +60,16 @@
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
/* 内容样式 */
|
|
63
|
-
|
|
63
|
+
@include e(wrapper) {
|
|
64
64
|
margin-top: 4px;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
@include e(days) {
|
|
68
68
|
position: relative;
|
|
69
69
|
@include flex;
|
|
70
70
|
flex-wrap: wrap;
|
|
71
71
|
|
|
72
|
-
|
|
72
|
+
@include e(month-mark-wrapper) {
|
|
73
73
|
position: absolute;
|
|
74
74
|
top: 0;
|
|
75
75
|
bottom: 0;
|
|
@@ -79,13 +79,13 @@
|
|
|
79
79
|
justify-content: center;
|
|
80
80
|
align-items: center;
|
|
81
81
|
|
|
82
|
-
|
|
82
|
+
@include e(text) {
|
|
83
83
|
font-size: 155px;
|
|
84
84
|
color: $hy-text-color--4;
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
|
|
88
|
+
@include e(day) {
|
|
89
89
|
@include flex;
|
|
90
90
|
padding: 2px;
|
|
91
91
|
/* #ifndef APP-NVUE */
|
|
@@ -94,13 +94,13 @@
|
|
|
94
94
|
box-sizing: border-box;
|
|
95
95
|
/* #endif */
|
|
96
96
|
|
|
97
|
-
|
|
97
|
+
@include e(select) {
|
|
98
98
|
flex: 1;
|
|
99
99
|
@include flex;
|
|
100
100
|
align-items: center;
|
|
101
101
|
justify-content: center;
|
|
102
102
|
position: relative;
|
|
103
|
-
|
|
103
|
+
@include m(selected) {
|
|
104
104
|
background-color: $hy-primary;
|
|
105
105
|
@include flex;
|
|
106
106
|
justify-content: center;
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
|
|
117
|
+
@include e(dot) {
|
|
118
118
|
width: 7px;
|
|
119
119
|
height: 7px;
|
|
120
120
|
border-radius: 100px;
|
|
@@ -124,7 +124,7 @@
|
|
|
124
124
|
right: 7px;
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
-
|
|
127
|
+
@include e(button-info) {
|
|
128
128
|
color: $hy-text-color--2;
|
|
129
129
|
text-align: center;
|
|
130
130
|
position: absolute;
|
|
@@ -133,40 +133,40 @@
|
|
|
133
133
|
left: 0;
|
|
134
134
|
right: 0;
|
|
135
135
|
|
|
136
|
-
|
|
136
|
+
@include m(selected) {
|
|
137
137
|
color: #ffffff;
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
-
|
|
141
|
-
|
|
140
|
+
@include m(disabled) {
|
|
141
|
+
color: $hy-text-color--disabled;
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
144
|
|
|
145
|
-
|
|
145
|
+
@include e(info) {
|
|
146
146
|
text-align: center;
|
|
147
147
|
font-size: 16px;
|
|
148
148
|
|
|
149
|
-
|
|
149
|
+
@include m(selected) {
|
|
150
150
|
color: #ffffff;
|
|
151
151
|
background-color: $hy-primary;
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
-
|
|
154
|
+
@include m(disabled) {
|
|
155
155
|
color: $hy-text-color--disabled;
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
158
|
|
|
159
|
-
|
|
159
|
+
@include m(range-selected) {
|
|
160
160
|
opacity: 0.3;
|
|
161
161
|
border-radius: 0;
|
|
162
162
|
}
|
|
163
163
|
|
|
164
|
-
|
|
164
|
+
@include m(range-start-selected) {
|
|
165
165
|
border-top-right-radius: 0;
|
|
166
166
|
border-bottom-right-radius: 0;
|
|
167
167
|
}
|
|
168
168
|
|
|
169
|
-
|
|
169
|
+
@include m(range-end-selected ) {
|
|
170
170
|
border-top-left-radius: 0;
|
|
171
171
|
border-bottom-left-radius: 0;
|
|
172
172
|
}
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<view class="hy-calendar
|
|
2
|
+
<view class="hy-calendar--month__wrapper" ref="hy-calendar--month__wrapper">
|
|
3
3
|
<view
|
|
4
4
|
v-for="(item, index) in months"
|
|
5
5
|
:key="index"
|
|
6
|
-
:class="[`hy-calendar
|
|
7
|
-
:ref="`hy-calendar
|
|
6
|
+
:class="[`hy-calendar--month__${index}`]"
|
|
7
|
+
:ref="`hy-calendar--month__${index}`"
|
|
8
8
|
:id="`month-${index}`"
|
|
9
9
|
>
|
|
10
|
-
<text v-if="index !== 0" class="hy-calendar
|
|
10
|
+
<text v-if="index !== 0" class="hy-calendar--month__title"
|
|
11
11
|
>{{ item.year }}年{{ item.month }}月</text
|
|
12
12
|
>
|
|
13
|
-
<view class="hy-calendar
|
|
13
|
+
<view class="hy-calendar--month__days">
|
|
14
14
|
<view
|
|
15
15
|
v-if="showMark"
|
|
16
|
-
class="hy-calendar
|
|
16
|
+
class="hy-calendar--month__days__month-mark-wrapper"
|
|
17
17
|
>
|
|
18
|
-
<text class="hy-calendar
|
|
18
|
+
<text class="hy-calendar--month__days__month-mark-wrapper__text">{{
|
|
19
19
|
item.month
|
|
20
20
|
}}</text>
|
|
21
21
|
</view>
|
|
22
22
|
<view
|
|
23
|
-
class="hy-calendar
|
|
23
|
+
class="hy-calendar--month__days__day"
|
|
24
24
|
v-for="(item1, index1) in item.date"
|
|
25
25
|
:key="index1"
|
|
26
26
|
:style="[dayStyle(index, index1, item1)]"
|
|
@@ -31,10 +31,10 @@
|
|
|
31
31
|
:style="[daySelectStyle(index, index1, item1)]"
|
|
32
32
|
>
|
|
33
33
|
<text
|
|
34
|
-
class="hy-calendar
|
|
34
|
+
class="hy-calendar--month__days__day__select__info"
|
|
35
35
|
:class="[
|
|
36
36
|
item1.disabled || isForbid(item1)
|
|
37
|
-
? 'hy-calendar
|
|
37
|
+
? 'hy-calendar--month__days__day__select__info--disabled'
|
|
38
38
|
: '',
|
|
39
39
|
]"
|
|
40
40
|
:style="[textStyle(item1)]"
|
|
@@ -42,10 +42,10 @@
|
|
|
42
42
|
>
|
|
43
43
|
<text
|
|
44
44
|
v-if="getBottomInfo(index, index1, item1)"
|
|
45
|
-
class="hy-calendar-
|
|
45
|
+
class="hy-calendar--month__days__day__select__button-info"
|
|
46
46
|
:class="[
|
|
47
47
|
item1.disabled || isForbid(item1)
|
|
48
|
-
? 'hy-calendar-
|
|
48
|
+
? 'hy-calendar--month__days__day__select__button-info--disabled'
|
|
49
49
|
: '',
|
|
50
50
|
]"
|
|
51
51
|
:style="[textStyle(item1)]"
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
>
|
|
54
54
|
<text
|
|
55
55
|
v-if="item1.dot"
|
|
56
|
-
class="hy-calendar
|
|
56
|
+
class="hy-calendar--month__days__day__select__dot"
|
|
57
57
|
></text>
|
|
58
58
|
</view>
|
|
59
59
|
</view>
|
|
@@ -65,7 +65,6 @@
|
|
|
65
65
|
<script>
|
|
66
66
|
import { addUnit, colorGradient, deepClone, getRect, sleep } from "../../utils";
|
|
67
67
|
import dayjs from "dayjs/esm";
|
|
68
|
-
import { formatTime } from "../../utils";
|
|
69
68
|
export default {
|
|
70
69
|
name: "hy-calendar-month",
|
|
71
70
|
props: {
|
|
@@ -219,10 +218,10 @@ export default {
|
|
|
219
218
|
return (index1, index2, item) => {
|
|
220
219
|
const date = dayjs(item.date).format("YYYY-MM-DD");
|
|
221
220
|
const len = this.selected.length - 1;
|
|
222
|
-
const classes = ["hy-calendar
|
|
221
|
+
const classes = ["hy-calendar--month__days__day__select"];
|
|
223
222
|
// 判断选中的
|
|
224
223
|
if (this.selected.some((item) => this.dateSame(item, date))) {
|
|
225
|
-
classes.push("hy-calendar
|
|
224
|
+
classes.push("hy-calendar--month__days__day__select--selected");
|
|
226
225
|
if (this.selected.length >= 2) {
|
|
227
226
|
// 判断非两边选中内容
|
|
228
227
|
if (
|
|
@@ -230,7 +229,7 @@ export default {
|
|
|
230
229
|
!this.dateSame(date, this.selected[len])
|
|
231
230
|
) {
|
|
232
231
|
classes.push(
|
|
233
|
-
"hy-calendar
|
|
232
|
+
"hy-calendar--month__days__day__select--selected--center",
|
|
234
233
|
);
|
|
235
234
|
}
|
|
236
235
|
}
|
|
@@ -385,7 +384,7 @@ export default {
|
|
|
385
384
|
// 获取月份数据区域的宽度,因为nvue不支持百分比,所以无法通过css设置每个日期item的宽度
|
|
386
385
|
getWrapperWidth() {
|
|
387
386
|
// #ifndef APP-NVUE
|
|
388
|
-
getRect(".hy-calendar
|
|
387
|
+
getRect(".hy-calendar--month__wrapper").then((size) => {
|
|
389
388
|
this.width = size.width;
|
|
390
389
|
});
|
|
391
390
|
// #endif
|
|
@@ -393,7 +392,7 @@ export default {
|
|
|
393
392
|
getMonthRect() {
|
|
394
393
|
// 获取每个月份数据的尺寸,用于父组件在scroll-view滚动事件中,监听当前滚动到了第几个月份
|
|
395
394
|
const promiseAllArr = this.months.map((item, index) =>
|
|
396
|
-
this.getMonthRectByPromise(`hy-calendar
|
|
395
|
+
this.getMonthRectByPromise(`hy-calendar--month__${index}`),
|
|
397
396
|
);
|
|
398
397
|
// 一次性返回
|
|
399
398
|
Promise.all(promiseAllArr).then((sizes) => {
|
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
<view class="hy-card" @tap.stop="click" :class="cardClass" :style="cardStyle">
|
|
3
3
|
<view
|
|
4
4
|
v-if="showHead"
|
|
5
|
-
class="hy-
|
|
5
|
+
class="hy-card--head"
|
|
6
6
|
:style="[{ padding: addUnit(paddingHead || padding) }, headStyle]"
|
|
7
7
|
:class="{
|
|
8
8
|
'hy-border__bottom': headBorderBottom,
|
|
9
9
|
}"
|
|
10
10
|
@tap="headClick"
|
|
11
11
|
>
|
|
12
|
-
<view v-if="!$slots.header" class="hy-
|
|
13
|
-
<view class="hy-
|
|
12
|
+
<view v-if="!$slots.header" class="hy-card--head__flex">
|
|
13
|
+
<view class="hy-card--head__left" v-if="title">
|
|
14
14
|
<image
|
|
15
15
|
:src="thumb"
|
|
16
|
-
class="hy-
|
|
16
|
+
class="hy-card--head__left__thumb"
|
|
17
17
|
mode="aspectFill"
|
|
18
18
|
v-if="thumb"
|
|
19
19
|
:style="{
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
}"
|
|
24
24
|
></image>
|
|
25
25
|
<text
|
|
26
|
-
class="hy-
|
|
26
|
+
class="hy-card--head__left__title"
|
|
27
27
|
:style="{
|
|
28
28
|
fontSize: addUnit(titleSize),
|
|
29
29
|
color: titleColor,
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
{{ title }}
|
|
33
33
|
</text>
|
|
34
34
|
</view>
|
|
35
|
-
<view class="hy-
|
|
35
|
+
<view class="hy-card--head__right hy-line-1" v-if="subTitle">
|
|
36
36
|
<text
|
|
37
|
-
class="hy-
|
|
37
|
+
class="hy-card--head__title__text"
|
|
38
38
|
:style="{
|
|
39
39
|
fontSize: addUnit(subTitleSize),
|
|
40
40
|
color: subTitleColor,
|
|
@@ -88,7 +88,7 @@ export default {
|
|
|
88
88
|
import { computed } from "vue";
|
|
89
89
|
import type { CSSProperties, PropType } from "vue";
|
|
90
90
|
import type { ICardEmits } from "./typing";
|
|
91
|
-
import { addUnit } from "../../utils";
|
|
91
|
+
import { addUnit, getPx } from "../../utils";
|
|
92
92
|
|
|
93
93
|
/**
|
|
94
94
|
* 卡片组件一般用于多个列表条目,且风格统一的场景。
|
|
@@ -203,13 +203,11 @@ const props = defineProps({
|
|
|
203
203
|
});
|
|
204
204
|
const emit = defineEmits<ICardEmits>();
|
|
205
205
|
|
|
206
|
-
const hasBorder =
|
|
207
|
-
+(props.borderRadius.toString().replace(/\D.*$/, "") || 0) > 0;
|
|
208
206
|
const cardClass = computed(() => {
|
|
207
|
+
const hasBorder = getPx(props.borderRadius) > 0;
|
|
209
208
|
return [
|
|
210
209
|
props.border && "hy-border",
|
|
211
|
-
props.full && "hy-
|
|
212
|
-
props.border && "hy-card-full",
|
|
210
|
+
props.full && "hy-card--full",
|
|
213
211
|
hasBorder && "hy-card--border",
|
|
214
212
|
].filter(Boolean);
|
|
215
213
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
@use "../../libs/css/mixin.scss" as *;
|
|
2
|
-
@use "../../theme
|
|
2
|
+
@use "../../libs/css/theme" as *;
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
@include b(card) {
|
|
@@ -9,38 +9,40 @@
|
|
|
9
9
|
background-color: $hy-background--container;
|
|
10
10
|
box-sizing: border-box;
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
@include m(full) {
|
|
13
13
|
// 如果是与屏幕之间不留空隙,应该设置左右边距为0
|
|
14
14
|
margin-left: 0 !important;
|
|
15
15
|
margin-right: 0 !important;
|
|
16
16
|
width: 100%;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
@include m(border) {
|
|
20
|
+
@include pseudo(after) {
|
|
21
|
+
border-radius: 16rpx;
|
|
22
|
+
}
|
|
21
23
|
}
|
|
22
24
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
+
@include m(head) {
|
|
26
|
+
@include e(flex) {
|
|
25
27
|
display: flex;
|
|
26
28
|
align-items: center;
|
|
27
29
|
justify-content: space-between;
|
|
28
30
|
}
|
|
29
31
|
|
|
30
|
-
|
|
32
|
+
@include e(left) {
|
|
31
33
|
display: flex;
|
|
32
34
|
|
|
33
|
-
|
|
35
|
+
@include e(thumb) {
|
|
34
36
|
margin-right: 16rpx;
|
|
35
37
|
}
|
|
36
38
|
|
|
37
|
-
|
|
39
|
+
@include e(title) {
|
|
38
40
|
max-width: 400rpx;
|
|
39
41
|
@include lineEllipsis;
|
|
40
42
|
}
|
|
41
43
|
}
|
|
42
44
|
|
|
43
|
-
|
|
45
|
+
@include e(right) {
|
|
44
46
|
color: $hy-text-color--grey;
|
|
45
47
|
margin-left: 6rpx;
|
|
46
48
|
}
|