uview-plus 3.2.8 → 3.2.10
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/changelog.md +10 -0
- package/components/u--form/u--form.vue +7 -7
- package/components/u--image/u--image.vue +3 -3
- package/components/u--input/u--input.vue +9 -9
- package/components/u--textarea/u--textarea.vue +3 -3
- package/components/u-action-sheet/u-action-sheet.vue +5 -4
- package/components/u-album/u-album.vue +9 -7
- package/components/u-alert/u-alert.vue +9 -6
- package/components/u-avatar/props.js +2 -1
- package/components/u-avatar/u-avatar.vue +15 -11
- package/components/u-avatar-group/u-avatar-group.vue +9 -5
- package/components/u-back-top/u-back-top.vue +9 -8
- package/components/u-badge/u-badge.vue +10 -6
- package/components/u-button/u-button.vue +13 -9
- package/components/u-calendar/header.vue +3 -3
- package/components/u-calendar/month.vue +17 -15
- package/components/u-calendar/u-calendar.vue +26 -10
- package/components/u-car-keyboard/u-car-keyboard.vue +7 -6
- package/components/u-cell/u-cell.vue +9 -6
- package/components/u-cell-group/u-cell-group.vue +8 -4
- package/components/u-checkbox/u-checkbox.vue +13 -11
- package/components/u-checkbox-group/u-checkbox-group.vue +3 -3
- package/components/u-circle-progress/u-circle-progress.vue +5 -4
- package/components/u-code/u-code.vue +3 -3
- package/components/u-code-input/u-code-input.vue +9 -8
- package/components/u-col/u-col.vue +9 -8
- package/components/u-collapse/u-collapse.vue +3 -3
- package/components/u-collapse-item/u-collapse-item.vue +32 -15
- package/components/u-column-notice/u-column-notice.vue +8 -6
- package/components/u-count-down/u-count-down.vue +3 -3
- package/components/u-count-to/u-count-to.vue +6 -4
- package/components/u-datetime-picker/u-datetime-picker.vue +16 -15
- package/components/u-divider/u-divider.vue +7 -5
- package/components/u-dropdown/u-dropdown.vue +12 -10
- package/components/u-dropdown-item/u-dropdown-item.vue +7 -5
- package/components/u-empty/u-empty.vue +12 -8
- package/components/u-form/u-form.vue +12 -10
- package/components/u-form-item/u-form-item.vue +17 -11
- package/components/u-gap/u-gap.vue +3 -3
- package/components/u-grid/u-grid.vue +18 -7
- package/components/u-grid-item/u-grid-item.vue +14 -9
- package/components/u-icon/u-icon.vue +21 -19
- package/components/u-image/u-image.vue +18 -16
- package/components/u-index-anchor/u-index-anchor.vue +11 -9
- package/components/u-index-item/u-index-item.vue +6 -5
- package/components/u-index-list/u-index-list.vue +20 -18
- package/components/u-input/u-input.vue +19 -12
- package/components/u-keyboard/u-keyboard.vue +3 -3
- package/components/u-line/u-line.vue +7 -6
- package/components/u-line-progress/u-line-progress.vue +11 -8
- package/components/u-link/u-link.vue +9 -8
- package/components/u-list/u-list.vue +9 -9
- package/components/u-list-item/u-list-item.vue +5 -4
- package/components/u-loading-icon/u-loading-icon.vue +14 -10
- package/components/u-loading-page/u-loading-page.vue +10 -7
- package/components/u-loadmore/u-loadmore.vue +12 -10
- package/components/u-modal/u-modal.vue +7 -5
- package/components/u-navbar/u-navbar.vue +12 -7
- package/components/u-no-network/u-no-network.vue +6 -6
- package/components/u-notice-bar/u-notice-bar.vue +6 -5
- package/components/u-notify/u-notify.vue +19 -15
- package/components/u-number-box/u-number-box.vue +8 -7
- package/components/u-number-keyboard/u-number-keyboard.vue +7 -7
- package/components/u-overlay/u-overlay.vue +5 -5
- package/components/u-picker/u-picker.vue +19 -15
- package/components/u-picker-column/u-picker-column.vue +3 -3
- package/components/u-popup/u-popup.vue +13 -13
- package/components/u-radio/u-radio.vue +12 -12
- package/components/u-radio-group/u-radio-group.vue +3 -3
- package/components/u-rate/u-rate.vue +16 -14
- package/components/u-read-more/u-read-more.vue +9 -7
- package/components/u-row/u-row.vue +8 -7
- package/components/u-row-notice/u-row-notice.vue +14 -12
- package/components/u-safe-bottom/u-safe-bottom.vue +5 -4
- package/components/u-scroll-list/nvue.js +4 -4
- package/components/u-scroll-list/u-scroll-list.vue +13 -10
- package/components/u-search/u-search.vue +8 -6
- package/components/u-skeleton/u-skeleton.vue +20 -17
- package/components/u-slider/mpwxs.js +3 -2
- package/components/u-slider/nvue - /345/211/257/346/234/254.js" +2 -2
- package/components/u-slider/nvue.js +2 -2
- package/components/u-slider/u-slider.vue +8 -5
- package/components/u-status-bar/u-status-bar.vue +6 -5
- package/components/u-steps/u-steps.vue +5 -4
- package/components/u-steps-item/u-steps-item.vue +9 -7
- package/components/u-sticky/u-sticky.vue +12 -10
- package/components/u-subsection/u-subsection.vue +8 -6
- package/components/u-swipe-action/u-swipe-action.vue +3 -3
- package/components/u-swipe-action-item/nvue - backup.js +3 -3
- package/components/u-swipe-action-item/nvue.js +3 -3
- package/components/u-swipe-action-item/u-swipe-action-item.vue +8 -5
- package/components/u-swiper/u-swiper.vue +35 -24
- package/components/u-swiper-indicator/u-swiper-indicator.vue +10 -7
- package/components/u-switch/u-switch.vue +15 -13
- package/components/u-tabbar/u-tabbar.vue +6 -5
- package/components/u-tabbar-item/u-tabbar-item.vue +7 -5
- package/components/u-table/u-table.vue +3 -3
- package/components/u-tabs/u-tabs.vue +18 -14
- package/components/u-tabs-item/u-tabs-item.vue +3 -3
- package/components/u-tag/u-tag.vue +6 -4
- package/components/u-td/u-td.vue +3 -3
- package/components/u-text/u-text.vue +12 -10
- package/components/u-text/value.js +14 -12
- package/components/u-textarea/u-textarea.vue +11 -8
- package/components/u-toast/u-toast.vue +12 -9
- package/components/u-toolbar/u-toolbar.vue +3 -3
- package/components/u-tooltip/u-tooltip.vue +18 -17
- package/components/u-tr/u-tr.vue +3 -3
- package/components/u-transition/transition.js +2 -2
- package/components/u-transition/u-transition.vue +6 -5
- package/components/u-upload/mixin.js +4 -3
- package/components/u-upload/u-upload.vue +20 -17
- package/index.js +0 -5
- package/libs/function/index.js +27 -20
- package/libs/function/throttle.js +2 -2
- package/libs/mixin/mixin.js +14 -6
- package/libs/mixin/style.js +23 -4
- package/libs/util/route.js +6 -6
- package/package.json +1 -1
- package/types/index.d.ts +0 -1
package/changelog.md
CHANGED
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
* 所以在nvue下,取名为u--form,内部其实还是u-form.vue,只不过做一层中转
|
|
22
22
|
*/
|
|
23
23
|
import uvForm from '../u-form/u-form.vue';
|
|
24
|
-
import props from '../u-form/props.js';
|
|
25
|
-
import mpMixin from '../../libs/mixin/mpMixin
|
|
26
|
-
import mixin from '../../libs/mixin/mixin
|
|
24
|
+
import props from '../u-form/props.js';
|
|
25
|
+
import mpMixin from '../../libs/mixin/mpMixin';
|
|
26
|
+
import mixin from '../../libs/mixin/mixin';
|
|
27
27
|
export default {
|
|
28
28
|
// #ifdef MP-WEIXIN
|
|
29
29
|
name: 'u-form',
|
|
@@ -38,10 +38,10 @@
|
|
|
38
38
|
created() {
|
|
39
39
|
this.children = []
|
|
40
40
|
},
|
|
41
|
-
methods: {
|
|
42
|
-
// 手动设置校验的规则,如果规则中有函数的话,微信小程序中会过滤掉,所以只能手动调用设置规则
|
|
43
|
-
setRules(rules) {
|
|
44
|
-
this.$refs.uForm.setRules(rules)
|
|
41
|
+
methods: {
|
|
42
|
+
// 手动设置校验的规则,如果规则中有函数的话,微信小程序中会过滤掉,所以只能手动调用设置规则
|
|
43
|
+
setRules(rules) {
|
|
44
|
+
this.$refs.uForm.setRules(rules)
|
|
45
45
|
},
|
|
46
46
|
validate() {
|
|
47
47
|
/**
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
* 所以在nvue下,取名为u--image,内部其实还是u-iamge.vue,只不过做一层中转
|
|
37
37
|
*/
|
|
38
38
|
import uvImage from '../u-image/u-image.vue';
|
|
39
|
-
import props from '../u-image/props.js';
|
|
40
|
-
import mpMixin from '../../libs/mixin/mpMixin
|
|
41
|
-
import mixin from '../../libs/mixin/mixin
|
|
39
|
+
import props from '../u-image/props.js';
|
|
40
|
+
import mpMixin from '../../libs/mixin/mpMixin';
|
|
41
|
+
import mixin from '../../libs/mixin/mixin';
|
|
42
42
|
export default {
|
|
43
43
|
name: 'u--image',
|
|
44
44
|
mixins: [mpMixin, props, mixin],
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<uvInput
|
|
2
|
+
<uvInput
|
|
3
3
|
<!-- #ifdef VUE2 -->
|
|
4
|
-
:value="value"
|
|
5
|
-
@input="e => $emit('input', e)"
|
|
6
|
-
<!-- #endif -->
|
|
4
|
+
:value="value"
|
|
5
|
+
@input="e => $emit('input', e)"
|
|
6
|
+
<!-- #endif -->
|
|
7
7
|
<!-- #ifdef VUE3 -->
|
|
8
|
-
:modelValue="modelValue"
|
|
9
|
-
@update:modelValue="e => $emit('update:modelValue', e)"
|
|
8
|
+
:modelValue="modelValue"
|
|
9
|
+
@update:modelValue="e => $emit('update:modelValue', e)"
|
|
10
10
|
<!-- #endif -->
|
|
11
11
|
:type="type"
|
|
12
12
|
:fixed="fixed"
|
|
@@ -61,9 +61,9 @@
|
|
|
61
61
|
* 所以在nvue下,取名为u--input,内部其实还是u-input.vue,只不过做一层中转
|
|
62
62
|
*/
|
|
63
63
|
import uvInput from '../u-input/u-input.vue';
|
|
64
|
-
import props from '../u-input/props.js';
|
|
65
|
-
import mpMixin from '../../libs/mixin/mpMixin
|
|
66
|
-
import mixin from '../../libs/mixin/mixin
|
|
64
|
+
import props from '../u-input/props.js';
|
|
65
|
+
import mpMixin from '../../libs/mixin/mpMixin';
|
|
66
|
+
import mixin from '../../libs/mixin/mixin';
|
|
67
67
|
export default {
|
|
68
68
|
name: 'u--input',
|
|
69
69
|
mixins: [mpMixin, props, mixin],
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
* 所以在nvue下,取名为u--textarea,内部其实还是u-textarea.vue,只不过做一层中转
|
|
35
35
|
*/
|
|
36
36
|
import uvTextarea from '../u-textarea/u-textarea.vue';
|
|
37
|
-
import props from '../u-textarea/props.js';
|
|
38
|
-
import mpMixin from '../../libs/mixin/mpMixin
|
|
39
|
-
import mixin from '../../libs/mixin/mixin
|
|
37
|
+
import props from '../u-textarea/props.js';
|
|
38
|
+
import mpMixin from '../../libs/mixin/mpMixin';
|
|
39
|
+
import mixin from '../../libs/mixin/mixin';
|
|
40
40
|
export default {
|
|
41
41
|
name: 'u--textarea',
|
|
42
42
|
mixins: [mpMixin, props, mixin],
|
|
@@ -108,9 +108,10 @@
|
|
|
108
108
|
<script>
|
|
109
109
|
import openType from '../../libs/mixin/openType'
|
|
110
110
|
import button from '../../libs/mixin/button'
|
|
111
|
-
import props from './props
|
|
112
|
-
import mpMixin from '../../libs/mixin/mpMixin
|
|
113
|
-
import mixin from '../../libs/mixin/mixin
|
|
111
|
+
import props from './props';
|
|
112
|
+
import mpMixin from '../../libs/mixin/mpMixin';
|
|
113
|
+
import mixin from '../../libs/mixin/mixin';
|
|
114
|
+
import { addUnit } from '../../libs/function/index';
|
|
114
115
|
/**
|
|
115
116
|
* ActionSheet 操作菜单
|
|
116
117
|
* @description 本组件用于从底部弹出一个操作菜单,供用户选择并返回结果。本组件功能类似于uni的uni.showActionSheetAPI,配置更加灵活,所有平台都表现一致。
|
|
@@ -159,7 +160,7 @@
|
|
|
159
160
|
return (index) => {
|
|
160
161
|
let style = {};
|
|
161
162
|
if (this.actions[index].color) style.color = this.actions[index].color
|
|
162
|
-
if (this.actions[index].fontSize) style.fontSize =
|
|
163
|
+
if (this.actions[index].fontSize) style.fontSize = addUnit(this.actions[index].fontSize)
|
|
163
164
|
// 选项被禁用的样式
|
|
164
165
|
if (this.actions[index].disabled) style.color = '#c0c4cc'
|
|
165
166
|
return style;
|
|
@@ -53,9 +53,11 @@
|
|
|
53
53
|
</template>
|
|
54
54
|
|
|
55
55
|
<script>
|
|
56
|
-
import props from './props
|
|
57
|
-
import mpMixin from '../../libs/mixin/mpMixin
|
|
58
|
-
|
|
56
|
+
import props from './props';
|
|
57
|
+
import mpMixin from '../../libs/mixin/mpMixin';
|
|
58
|
+
import mixin from '../../libs/mixin/mixin';
|
|
59
|
+
import { addUnit, sleep } from '../../libs/function/index';
|
|
60
|
+
import test from '../../libs/function/test';
|
|
59
61
|
// #ifdef APP-NVUE
|
|
60
62
|
// 由于weex为阿里的KPI业绩考核的产物,所以不支持百分比单位,这里需要通过dom查询组件的宽度
|
|
61
63
|
const dom = uni.requireNativePlugin('dom')
|
|
@@ -146,12 +148,12 @@ export default {
|
|
|
146
148
|
return arr
|
|
147
149
|
},
|
|
148
150
|
imageWidth() {
|
|
149
|
-
return
|
|
151
|
+
return addUnit(
|
|
150
152
|
this.urls.length === 1 ? this.singleWidth : this.multipleSize
|
|
151
153
|
)
|
|
152
154
|
},
|
|
153
155
|
imageHeight() {
|
|
154
|
-
return
|
|
156
|
+
return addUnit(
|
|
155
157
|
this.urls.length === 1 ? this.singleHeight : this.multipleSize
|
|
156
158
|
)
|
|
157
159
|
},
|
|
@@ -183,7 +185,7 @@ export default {
|
|
|
183
185
|
},
|
|
184
186
|
// 获取图片的路径
|
|
185
187
|
getSrc(item) {
|
|
186
|
-
return
|
|
188
|
+
return test.object(item)
|
|
187
189
|
? (this.keyName && item[this.keyName]) || item.src
|
|
188
190
|
: item
|
|
189
191
|
},
|
|
@@ -212,7 +214,7 @@ export default {
|
|
|
212
214
|
// 获取组件的宽度
|
|
213
215
|
async getComponentWidth() {
|
|
214
216
|
// 延时一定时间,以获取dom尺寸
|
|
215
|
-
await
|
|
217
|
+
await sleep(30)
|
|
216
218
|
// #ifndef APP-NVUE
|
|
217
219
|
this.$uGetRect('.u-album__row').then((size) => {
|
|
218
220
|
this.singleWidth = size.width * this.singlePercent
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
class="u-alert"
|
|
8
8
|
:class="[`u-alert--${type}--${effect}`]"
|
|
9
9
|
@tap.stop="clickHandler"
|
|
10
|
-
:style="[
|
|
10
|
+
:style="[addStyle(customStyle)]"
|
|
11
11
|
>
|
|
12
12
|
<view
|
|
13
13
|
class="u-alert__icon"
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
class="u-alert__content__title"
|
|
30
30
|
v-if="title"
|
|
31
31
|
:style="[{
|
|
32
|
-
fontSize:
|
|
32
|
+
fontSize: addUnit(fontSize),
|
|
33
33
|
textAlign: center ? 'center' : 'left'
|
|
34
34
|
}]"
|
|
35
35
|
:class="[effect === 'dark' ? 'u-alert__text--dark' : `u-alert__text--${type}--light`]"
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
class="u-alert__content__desc"
|
|
39
39
|
v-if="description"
|
|
40
40
|
:style="[{
|
|
41
|
-
fontSize:
|
|
41
|
+
fontSize: addUnit(fontSize),
|
|
42
42
|
textAlign: center ? 'center' : 'left'
|
|
43
43
|
}]"
|
|
44
44
|
:class="[effect === 'dark' ? 'u-alert__text--dark' : `u-alert__text--${type}--light`]"
|
|
@@ -60,9 +60,10 @@
|
|
|
60
60
|
</template>
|
|
61
61
|
|
|
62
62
|
<script>
|
|
63
|
-
import props from './props
|
|
64
|
-
import mpMixin from '../../libs/mixin/mpMixin
|
|
65
|
-
import mixin from '../../libs/mixin/mixin
|
|
63
|
+
import props from './props';
|
|
64
|
+
import mpMixin from '../../libs/mixin/mpMixin';
|
|
65
|
+
import mixin from '../../libs/mixin/mixin';
|
|
66
|
+
import { addUnit, addStyle } from '../../libs/function/index';
|
|
66
67
|
/**
|
|
67
68
|
* Alert 警告提示
|
|
68
69
|
* @description 警告提示,展现需要关注的信息。
|
|
@@ -117,6 +118,8 @@
|
|
|
117
118
|
},
|
|
118
119
|
emits: ["click"],
|
|
119
120
|
methods: {
|
|
121
|
+
addUnit,
|
|
122
|
+
addStyle,
|
|
120
123
|
// 点击内容
|
|
121
124
|
clickHandler() {
|
|
122
125
|
this.$emit('click')
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import defProps from '../../libs/config/props.js';
|
|
2
|
+
import test from '../../libs/function/test';
|
|
2
3
|
export default {
|
|
3
4
|
props: {
|
|
4
5
|
// 头像图片路径(不能为相对路径)
|
|
@@ -66,7 +67,7 @@ export default {
|
|
|
66
67
|
type: [String, Number],
|
|
67
68
|
// 校验参数规则,索引在0-19之间
|
|
68
69
|
validator(n) {
|
|
69
|
-
return
|
|
70
|
+
return test.range(n, [0, 19]) || n === ''
|
|
70
71
|
},
|
|
71
72
|
default: () => defProps.avatar.colorIndex
|
|
72
73
|
},
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
class="u-avatar"
|
|
4
4
|
:class="[`u-avatar--${shape}`]"
|
|
5
5
|
:style="[{
|
|
6
|
-
backgroundColor: (text || icon) ? (randomBgColor ? colors[colorIndex !== '' ? colorIndex :
|
|
7
|
-
width:
|
|
8
|
-
height:
|
|
9
|
-
},
|
|
6
|
+
backgroundColor: (text || icon) ? (randomBgColor ? colors[colorIndex !== '' ? colorIndex : random(0, 19)] : bgColor) : 'transparent',
|
|
7
|
+
width: addUnit(size),
|
|
8
|
+
height: addUnit(size),
|
|
9
|
+
}, addStyle(customStyle)]"
|
|
10
10
|
@tap="clickHandler"
|
|
11
11
|
>
|
|
12
12
|
<slot>
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
v-if="mpAvatar && allowMp"
|
|
16
16
|
type="userAvatarUrl"
|
|
17
17
|
:style="[{
|
|
18
|
-
width:
|
|
19
|
-
height:
|
|
18
|
+
width: addUnit(size),
|
|
19
|
+
height: addUnit(size)
|
|
20
20
|
}]"
|
|
21
21
|
/>
|
|
22
22
|
<!-- #endif -->
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
:mode="mode"
|
|
46
46
|
@error="errorHandler"
|
|
47
47
|
:style="[{
|
|
48
|
-
width:
|
|
49
|
-
height:
|
|
48
|
+
width: addUnit(size),
|
|
49
|
+
height: addUnit(size)
|
|
50
50
|
}]"
|
|
51
51
|
></image>
|
|
52
52
|
</slot>
|
|
@@ -54,9 +54,10 @@
|
|
|
54
54
|
</template>
|
|
55
55
|
|
|
56
56
|
<script>
|
|
57
|
-
import props from './props
|
|
58
|
-
import mpMixin from '../../libs/mixin/mpMixin
|
|
59
|
-
import mixin from '../../libs/mixin/mixin
|
|
57
|
+
import props from './props';
|
|
58
|
+
import mpMixin from '../../libs/mixin/mpMixin';
|
|
59
|
+
import mixin from '../../libs/mixin/mixin';
|
|
60
|
+
import { addStyle, addUnit, random } from '../../libs/function/index';
|
|
60
61
|
const base64Avatar =
|
|
61
62
|
"data:image/jpg;base64,/9j/4QAYRXhpZgAASUkqAAgAAAAAAAAAAAAAAP/sABFEdWNreQABAAQAAAA8AAD/4QMraHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLwA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/PiA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA1LjMtYzAxMSA2Ni4xNDU2NjEsIDIwMTIvMDIvMDYtMTQ6NTY6MjcgICAgICAgICI+IDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+IDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bXA6Q3JlYXRvclRvb2w9IkFkb2JlIFBob3Rvc2hvcCBDUzYgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjREMEQwRkY0RjgwNDExRUE5OTY2RDgxODY3NkJFODMxIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjREMEQwRkY1RjgwNDExRUE5OTY2RDgxODY3NkJFODMxIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6NEQwRDBGRjJGODA0MTFFQTk5NjZEODE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1UUrOQ9FpC4/UwK6aaqtU+DAAAAAAAAAAAAAAA4lKMIuUmoxWrb4ARNx3R3q2rLpa4Sl0y/YCcAAAAAAAAAAANmFud7G8r89r6X0dgFvGzLGRGtuWvTF6NAdwAAAAAAAAAAAy5W442PVN+K59EePp5ARMvOv5MvO6QXCC4AZwAAAAAAAAAAAAAcxlKLUotprg1owN+PvORborq+7Hnwl3gUbO74VzRydt8pKn68ANcJwmqwkpLmnUDkAAAAfNy9atqtyagut0AxXt5xIV8Fbj6lRd7Am5G65V6qUvtwfyx94GMAAAAAAAAAAAAAAAAAAAOU2nVOj5gdsc3LiqRvTpyqwOxbnnrhdfpSfrQB7pnv/AGvuS9gHXPMy5/Fem1yq0v0A6W29XqwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//Z";
|
|
62
63
|
/**
|
|
@@ -123,6 +124,9 @@
|
|
|
123
124
|
},
|
|
124
125
|
emits: ["click"],
|
|
125
126
|
methods: {
|
|
127
|
+
addStyle,
|
|
128
|
+
addUnit,
|
|
129
|
+
random,
|
|
126
130
|
init() {
|
|
127
131
|
// 目前只有这几个小程序平台具有open-data标签
|
|
128
132
|
// 其他平台可以通过uni.getUserInfo类似接口获取信息,但是需要弹窗授权(首次),不合符组件逻辑
|
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
v-for="(item, index) in showUrl"
|
|
6
6
|
:key="index"
|
|
7
7
|
:style="{
|
|
8
|
-
marginLeft: index === 0 ? 0 :
|
|
8
|
+
marginLeft: index === 0 ? 0 : addUnit(-size * gap)
|
|
9
9
|
}"
|
|
10
10
|
>
|
|
11
11
|
<u-avatar
|
|
12
12
|
:size="size"
|
|
13
13
|
:shape="shape"
|
|
14
14
|
:mode="mode"
|
|
15
|
-
:src="
|
|
15
|
+
:src="testObject(item) ? keyName && item[keyName] || item.url : item"
|
|
16
16
|
></u-avatar>
|
|
17
17
|
<view
|
|
18
18
|
class="u-avatar-group__item__show-more"
|
|
@@ -32,9 +32,11 @@
|
|
|
32
32
|
</template>
|
|
33
33
|
|
|
34
34
|
<script>
|
|
35
|
-
import props from './props
|
|
36
|
-
import mpMixin from '../../libs/mixin/mpMixin
|
|
37
|
-
import mixin from '../../libs/mixin/mixin
|
|
35
|
+
import props from './props';
|
|
36
|
+
import mpMixin from '../../libs/mixin/mpMixin';
|
|
37
|
+
import mixin from '../../libs/mixin/mixin';
|
|
38
|
+
import { addUnit } from '../../libs/function/index';
|
|
39
|
+
import test from '../../libs/function/test';
|
|
38
40
|
/**
|
|
39
41
|
* AvatarGroup 头像组
|
|
40
42
|
* @description 本组件一般用于展示头像的地方,如个人中心,或者评论列表页的用户头像展示等场所。
|
|
@@ -67,6 +69,8 @@
|
|
|
67
69
|
},
|
|
68
70
|
emits: ["showMore"],
|
|
69
71
|
methods: {
|
|
72
|
+
addUnit,
|
|
73
|
+
testObject: test.object,
|
|
70
74
|
clickHandler() {
|
|
71
75
|
this.$emit('showMore')
|
|
72
76
|
}
|
|
@@ -24,9 +24,10 @@
|
|
|
24
24
|
</template>
|
|
25
25
|
|
|
26
26
|
<script>
|
|
27
|
-
import props from './props
|
|
28
|
-
import mpMixin from '../../libs/mixin/mpMixin
|
|
29
|
-
import mixin from '../../libs/mixin/mixin
|
|
27
|
+
import props from './props';
|
|
28
|
+
import mpMixin from '../../libs/mixin/mpMixin';
|
|
29
|
+
import mixin from '../../libs/mixin/mixin';
|
|
30
|
+
import { addUnit, addStyle, getPx, deepMerge, error } from '../../libs/function/index';
|
|
30
31
|
// #ifdef APP-NVUE
|
|
31
32
|
const dom = weex.requireModule('dom')
|
|
32
33
|
// #endif
|
|
@@ -56,8 +57,8 @@
|
|
|
56
57
|
backTopStyle() {
|
|
57
58
|
// 动画组件样式
|
|
58
59
|
const style = {
|
|
59
|
-
bottom:
|
|
60
|
-
right:
|
|
60
|
+
bottom: addUnit(this.bottom),
|
|
61
|
+
right: addUnit(this.right),
|
|
61
62
|
width: '40px',
|
|
62
63
|
height: '40px',
|
|
63
64
|
position: 'fixed',
|
|
@@ -66,7 +67,7 @@
|
|
|
66
67
|
return style
|
|
67
68
|
},
|
|
68
69
|
show() {
|
|
69
|
-
return
|
|
70
|
+
return getPx(this.scrollTop) > getPx(this.top)
|
|
70
71
|
},
|
|
71
72
|
contentStyle() {
|
|
72
73
|
const style = {}
|
|
@@ -82,7 +83,7 @@
|
|
|
82
83
|
style.borderTopRightRadius = radius
|
|
83
84
|
style.borderBottomLeftRadius = radius
|
|
84
85
|
style.borderBottomRightRadius = radius
|
|
85
|
-
return
|
|
86
|
+
return deepMerge(style, addStyle(this.customStyle))
|
|
86
87
|
}
|
|
87
88
|
},
|
|
88
89
|
emits: ["click"],
|
|
@@ -90,7 +91,7 @@
|
|
|
90
91
|
backToTop() {
|
|
91
92
|
// #ifdef APP-NVUE
|
|
92
93
|
if (!this.$parent.$refs['u-back-top']) {
|
|
93
|
-
|
|
94
|
+
error(`nvue页面需要给页面最外层元素设置"ref='u-back-top'`)
|
|
94
95
|
}
|
|
95
96
|
dom.scrollToElement(this.$parent.$refs['u-back-top'], {
|
|
96
97
|
offset: 0
|
|
@@ -2,15 +2,16 @@
|
|
|
2
2
|
<text
|
|
3
3
|
v-if="show && ((Number(value) === 0 ? showZero : true) || isDot)"
|
|
4
4
|
:class="[isDot ? 'u-badge--dot' : 'u-badge--not-dot', inverted && 'u-badge--inverted', shape === 'horn' && 'u-badge--horn', `u-badge--${type}${inverted ? '--inverted' : ''}`]"
|
|
5
|
-
:style="[
|
|
5
|
+
:style="[addStyle(customStyle), badgeStyle]"
|
|
6
6
|
class="u-badge"
|
|
7
7
|
>{{ isDot ? '' :showValue }}</text>
|
|
8
8
|
</template>
|
|
9
9
|
|
|
10
10
|
<script>
|
|
11
|
-
import props from './props
|
|
12
|
-
import mpMixin from '../../libs/mixin/mpMixin
|
|
13
|
-
import mixin from '../../libs/mixin/mixin
|
|
11
|
+
import props from './props';
|
|
12
|
+
import mpMixin from '../../libs/mixin/mpMixin';
|
|
13
|
+
import mixin from '../../libs/mixin/mixin';
|
|
14
|
+
import { addStyle, addUnit } from '../../libs/function/index';
|
|
14
15
|
/**
|
|
15
16
|
* badge 徽标数
|
|
16
17
|
* @description 该组件一般用于图标右上角显示未读的消息数量,提示用户点击,有圆点和圆包含文字两种形式。
|
|
@@ -57,8 +58,8 @@
|
|
|
57
58
|
// top和right分为为offset的第一个和第二个值,如果没有第二个值,则right等于top
|
|
58
59
|
const top = this.offset[0]
|
|
59
60
|
const right = this.offset[1] || top
|
|
60
|
-
style.top =
|
|
61
|
-
style.right =
|
|
61
|
+
style.top = addUnit(top)
|
|
62
|
+
style.right = addUnit(right)
|
|
62
63
|
}
|
|
63
64
|
}
|
|
64
65
|
return style
|
|
@@ -80,6 +81,9 @@
|
|
|
80
81
|
return Number(this.value)
|
|
81
82
|
}
|
|
82
83
|
},
|
|
84
|
+
},
|
|
85
|
+
methods: {
|
|
86
|
+
addStyle
|
|
83
87
|
}
|
|
84
88
|
}
|
|
85
89
|
</script>
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
@agreeprivacyauthorization="agreeprivacyauthorization"
|
|
23
23
|
:hover-class="!disabled && !loading ? 'u-button--active' : ''"
|
|
24
24
|
class="u-button u-reset-button"
|
|
25
|
-
:style="[baseColor,
|
|
25
|
+
:style="[baseColor, addStyle(customStyle)]"
|
|
26
26
|
@tap="clickHandler"
|
|
27
27
|
:class="bemClass"
|
|
28
28
|
>
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"
|
|
72
72
|
@tap="clickHandler"
|
|
73
73
|
:class="bemClass"
|
|
74
|
-
:style="[baseColor,
|
|
74
|
+
:style="[baseColor, addStyle(customStyle)]"
|
|
75
75
|
>
|
|
76
76
|
<template v-if="loading">
|
|
77
77
|
<u-loading-icon
|
|
@@ -110,11 +110,14 @@
|
|
|
110
110
|
</template>
|
|
111
111
|
|
|
112
112
|
<script lang="ts">
|
|
113
|
-
import button from "../../libs/mixin/button
|
|
114
|
-
import openType from "../../libs/mixin/openType
|
|
115
|
-
import mpMixin from '../../libs/mixin/mpMixin
|
|
116
|
-
import mixin from '../../libs/mixin/mixin
|
|
117
|
-
import props from "./props
|
|
113
|
+
import button from "../../libs/mixin/button";
|
|
114
|
+
import openType from "../../libs/mixin/openType";
|
|
115
|
+
import mpMixin from '../../libs/mixin/mpMixin';
|
|
116
|
+
import mixin from '../../libs/mixin/mixin';
|
|
117
|
+
import props from "./props";
|
|
118
|
+
import { addStyle } from '../../libs/function/index';
|
|
119
|
+
import { throttle } from '../../libs/function/throttle';
|
|
120
|
+
import color from '../../libs/config/color';
|
|
118
121
|
/**
|
|
119
122
|
* button 按钮
|
|
120
123
|
* @description Button 按钮
|
|
@@ -194,7 +197,7 @@ export default {
|
|
|
194
197
|
// 如果有设置color值,则用color值,否则使用type主题颜色
|
|
195
198
|
return this.color
|
|
196
199
|
? this.color
|
|
197
|
-
:
|
|
200
|
+
: color[`u-${this.type}`];
|
|
198
201
|
}
|
|
199
202
|
if (this.type === "info") {
|
|
200
203
|
return "#c9c9c9";
|
|
@@ -267,11 +270,12 @@ export default {
|
|
|
267
270
|
emits: ['click', 'getphonenumber', 'getuserinfo',
|
|
268
271
|
'error', 'opensetting', 'launchapp', 'agreeprivacyauthorization'],
|
|
269
272
|
methods: {
|
|
273
|
+
addStyle,
|
|
270
274
|
clickHandler() {
|
|
271
275
|
// 非禁止并且非加载中,才能点击
|
|
272
276
|
if (!this.disabled && !this.loading) {
|
|
273
277
|
// 进行节流控制,每this.throttle毫秒内,只在开始处执行
|
|
274
|
-
|
|
278
|
+
throttle(() => {
|
|
275
279
|
this.$emit("click");
|
|
276
280
|
}, this.throttleTime);
|
|
277
281
|
}
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
</view>
|
|
21
21
|
</template>
|
|
22
22
|
|
|
23
|
-
<script>
|
|
24
|
-
import mpMixin from '../../libs/mixin/mpMixin
|
|
25
|
-
import mixin from '../../libs/mixin/mixin
|
|
23
|
+
<script>
|
|
24
|
+
import mpMixin from '../../libs/mixin/mpMixin';
|
|
25
|
+
import mixin from '../../libs/mixin/mixin';
|
|
26
26
|
export default {
|
|
27
27
|
name: 'u-calendar-header',
|
|
28
28
|
mixins: [mpMixin, mixin],
|
|
@@ -31,10 +31,12 @@
|
|
|
31
31
|
// 由于nvue不支持百分比单位,需要查询宽度来计算每个日期的宽度
|
|
32
32
|
const dom = uni.requireNativePlugin('dom')
|
|
33
33
|
// #endif
|
|
34
|
-
import mpMixin from '../../libs/mixin/mpMixin
|
|
35
|
-
import mixin from '../../libs/mixin/mixin
|
|
36
|
-
import
|
|
37
|
-
|
|
34
|
+
import mpMixin from '../../libs/mixin/mpMixin';
|
|
35
|
+
import mixin from '../../libs/mixin/mixin';
|
|
36
|
+
import { addUnit, deepClone, toast, sleep } from '../../libs/function/index';
|
|
37
|
+
import { colorGradient } from '../../libs/function/colorGradient';
|
|
38
|
+
import test from '../../libs/function/test';
|
|
39
|
+
import defProps from '../../libs/config/props';
|
|
38
40
|
import dayjs from 'dayjs/esm/index'
|
|
39
41
|
export default {
|
|
40
42
|
name: 'u-calendar-month',
|
|
@@ -103,7 +105,7 @@
|
|
|
103
105
|
// 是否为只读状态,只读状态下禁止选择日期
|
|
104
106
|
readonly: {
|
|
105
107
|
type: Boolean,
|
|
106
|
-
default: () =>
|
|
108
|
+
default: () => defProps.calendar.readonly
|
|
107
109
|
},
|
|
108
110
|
// 日期区间最多可选天数,默认无限制,mode = range时有效
|
|
109
111
|
maxRange: {
|
|
@@ -156,13 +158,13 @@
|
|
|
156
158
|
const dayWidth = Number(parseFloat(this.width / 7).toFixed(3).slice(0, -1))
|
|
157
159
|
// 得出每个日期的宽度
|
|
158
160
|
// #ifdef APP-NVUE
|
|
159
|
-
style.width =
|
|
161
|
+
style.width = addUnit(dayWidth)
|
|
160
162
|
// #endif
|
|
161
|
-
style.height =
|
|
163
|
+
style.height = addUnit(this.rowHeight)
|
|
162
164
|
if (index2 === 0) {
|
|
163
165
|
// 获取当前为星期几,如果为0,则为星期天,减一为每月第一天时,需要向左偏移的item个数
|
|
164
166
|
week = (week === 0 ? 7 : week) - 1
|
|
165
|
-
style.marginLeft =
|
|
167
|
+
style.marginLeft = addUnit(week * dayWidth)
|
|
166
168
|
}
|
|
167
169
|
if (this.mode === 'range') {
|
|
168
170
|
// 之所以需要这么写,是因为DCloud公司的iOS客户端的开发者能力有限导致的bug
|
|
@@ -206,7 +208,7 @@
|
|
|
206
208
|
// 处于第一和最后一个之间的日期,背景色设置为浅色,通过将对应颜色进行等分,再取其尾部的颜色值
|
|
207
209
|
if (dayjs(date).isAfter(dayjs(this.selected[0])) && dayjs(date).isBefore(dayjs(this
|
|
208
210
|
.selected[len]))) {
|
|
209
|
-
style.backgroundColor =
|
|
211
|
+
style.backgroundColor = colorGradient(this.color, '#ffffff', 100)[90]
|
|
210
212
|
// 增加一个透明度,让范围区间的背景色也能看到底部的mark水印字符
|
|
211
213
|
style.opacity = 0.7
|
|
212
214
|
}
|
|
@@ -289,7 +291,7 @@
|
|
|
289
291
|
this.$nextTick(() => {
|
|
290
292
|
// 这里需要另一个延时,因为获取宽度后,会进行月份数据渲染,只有渲染完成之后,才有真正的高度
|
|
291
293
|
// 因为nvue下,$nextTick并不是100%可靠的
|
|
292
|
-
|
|
294
|
+
sleep(10).then(() => {
|
|
293
295
|
this.getWrapperWidth()
|
|
294
296
|
this.getMonthRect()
|
|
295
297
|
})
|
|
@@ -361,7 +363,7 @@
|
|
|
361
363
|
const date = dayjs(item.date).format("YYYY-MM-DD")
|
|
362
364
|
if (item.disabled) return
|
|
363
365
|
// 对上一次选择的日期数组进行深度克隆
|
|
364
|
-
let selected =
|
|
366
|
+
let selected = deepClone(this.selected)
|
|
365
367
|
if (this.mode === 'single') {
|
|
366
368
|
// 单选情况下,让数组中的元素为当前点击的日期
|
|
367
369
|
selected = [date]
|
|
@@ -389,9 +391,9 @@
|
|
|
389
391
|
// 当前日期减去最大可选的日期天数,如果大于起始时间,则进行提示
|
|
390
392
|
if(dayjs(dayjs(date).subtract(this.maxRange, 'day')).isAfter(dayjs(selected[0])) && this.showRangePrompt) {
|
|
391
393
|
if(this.rangePrompt) {
|
|
392
|
-
|
|
394
|
+
toast(this.rangePrompt)
|
|
393
395
|
} else {
|
|
394
|
-
|
|
396
|
+
toast(`选择天数不能超过 ${this.maxRange} 天`)
|
|
395
397
|
}
|
|
396
398
|
return
|
|
397
399
|
}
|
|
@@ -431,14 +433,14 @@
|
|
|
431
433
|
const maxDate = this.maxDate || dayjs(minDate).add(this.maxMonth - 1, 'month').format("YYYY-MM-DD")
|
|
432
434
|
if (this.mode === 'single') {
|
|
433
435
|
// 单选模式,可以是字符串或数组,Date对象等
|
|
434
|
-
if (!
|
|
436
|
+
if (!test.array(this.defaultDate)) {
|
|
435
437
|
defaultDate = [dayjs(this.defaultDate).format("YYYY-MM-DD")]
|
|
436
438
|
} else {
|
|
437
439
|
defaultDate = [this.defaultDate[0]]
|
|
438
440
|
}
|
|
439
441
|
} else {
|
|
440
442
|
// 如果为非数组,则不执行
|
|
441
|
-
if (!
|
|
443
|
+
if (!test.array(this.defaultDate)) return
|
|
442
444
|
defaultDate = this.defaultDate
|
|
443
445
|
}
|
|
444
446
|
// 过滤用户传递的默认数组,取出只在可允许最大值与最小值之间的元素
|