uview-plus 3.8.49 → 3.8.86
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 +2043 -1827
- package/components/u-action-sheet/props.js +3 -1
- package/components/u-action-sheet/u-action-sheet.vue +1 -0
- package/components/u-album/props.js +3 -1
- package/components/u-alert/props.js +4 -2
- package/components/u-avatar/props.js +4 -1
- package/components/u-avatar-group/props.js +4 -1
- package/components/u-back-top/props.js +4 -1
- package/components/u-badge/props.js +4 -1
- package/components/u-barcode/u-barcode.vue +46 -15
- package/components/u-box/props.js +5 -2
- package/components/u-button/props.js +4 -1
- package/components/u-button/vue.scss +3 -3
- package/components/u-calendar/calendar.js +14 -2
- package/components/u-calendar/month.vue +41 -6
- package/components/u-calendar/props.js +63 -1
- package/components/u-calendar/u-calendar.vue +311 -2
- package/components/u-calendar-strip/props.js +3 -1
- package/components/u-canvas/u-canvas.vue +734 -423
- package/components/u-car-keyboard/props.js +3 -1
- package/components/u-card/props.js +3 -1
- package/components/u-cell/props.js +4 -1
- package/components/u-cell/u-cell.vue +1 -1
- package/components/u-cell-group/props.js +4 -1
- package/components/u-checkbox/props.js +4 -1
- package/components/u-checkbox/u-checkbox.vue +7 -3
- package/components/u-checkbox-group/props.js +3 -1
- package/components/u-circle-progress/props.js +4 -1
- package/components/u-code/props.js +4 -1
- package/components/u-code-input/props.js +4 -1
- package/components/u-col/props.js +4 -1
- package/components/u-collapse/props.js +4 -1
- package/components/u-collapse-item/props.js +4 -1
- package/components/u-color-picker/u-color-picker.vue +1 -0
- package/components/u-column-notice/props.js +4 -1
- package/components/u-count-down/props.js +4 -1
- package/components/u-count-to/props.js +4 -1
- package/components/u-cropper/u-cropper.vue +95 -51
- package/components/u-datetime-picker/props.js +4 -1
- package/components/u-divider/props.js +4 -1
- package/components/u-dragsort/u-dragsort.vue +2 -1
- package/components/u-dropdown/props.js +3 -1
- package/components/u-dropdown-item/props.js +3 -1
- package/components/u-empty/props.js +4 -1
- package/components/u-form/props.js +4 -1
- package/components/u-form-item/props.js +4 -1
- package/components/u-gap/props.js +4 -1
- package/components/u-grid/props.js +4 -1
- package/components/u-grid-item/props.js +4 -1
- package/components/u-guide/props.js +3 -1
- package/components/u-icon/props.js +4 -1
- package/components/u-icon/u-icon.vue +2 -2
- package/components/u-icon/upicon.ttf +0 -0
- package/components/u-icon/util.js +29 -7
- package/components/u-image/props.js +4 -1
- package/components/u-image/u-image.vue +280 -267
- package/components/u-index-anchor/props.js +4 -1
- package/components/u-index-item/props.js +2 -1
- package/components/u-index-list/props.js +4 -1
- package/components/u-input/props.js +3 -1
- package/components/u-input/u-input.vue +10 -1
- package/components/u-keyboard/props.js +4 -1
- package/components/u-line/props.js +4 -1
- package/components/u-line-progress/props.js +6 -3
- package/components/u-link/props.js +4 -1
- package/components/u-list/props.js +4 -1
- package/components/u-list-item/props.js +4 -1
- package/components/u-loading-icon/props.js +4 -1
- package/components/u-loading-page/props.js +3 -1
- package/components/u-loadmore/props.js +4 -1
- package/components/u-markdown/u-markdown.vue +45 -3
- package/components/u-modal/props.js +4 -1
- package/components/u-navbar/props.js +4 -2
- package/components/u-navbar/u-navbar.vue +15 -9
- package/components/u-no-network/props.js +4 -1
- package/components/u-notice-bar/props.js +4 -1
- package/components/u-notify/props.js +4 -1
- package/components/u-number-box/props.js +4 -1
- package/components/u-number-box/u-number-box.vue +2 -2
- package/components/u-number-keyboard/props.js +4 -1
- package/components/u-overlay/props.js +4 -1
- package/components/u-pagination/u-pagination.vue +60 -39
- package/components/u-parse/props.js +4 -1
- package/components/u-picker/props.js +4 -1
- package/components/u-picker/u-picker.vue +15 -0
- package/components/u-picker-column/props.js +3 -1
- package/components/u-popover/props.js +2 -1
- package/components/u-popup/props.js +4 -1
- package/components/u-poster/u-poster.vue +29 -14
- package/components/u-qrcode/qrcode.js +88 -87
- package/components/u-qrcode/u-qrcode.vue +138 -256
- package/components/u-radio/props.js +4 -1
- package/components/u-radio/u-radio.vue +7 -3
- package/components/u-radio-group/props.js +4 -1
- package/components/u-rate/props.js +4 -1
- package/components/u-read-more/props.js +4 -1
- package/components/u-row/props.js +4 -1
- package/components/u-row-notice/props.js +4 -1
- package/components/u-safe-bottom/props.js +2 -1
- package/components/u-scroll-list/props.js +4 -1
- package/components/u-search/props.js +3 -1
- package/components/u-skeleton/props.js +4 -1
- package/components/u-slider/props.js +3 -1
- package/components/u-slider/u-slider.vue +70 -28
- package/components/u-status-bar/props.js +4 -1
- package/components/u-steps/props.js +4 -1
- package/components/u-steps-item/props.js +4 -1
- package/components/u-sticky/props.js +4 -1
- package/components/u-sticky/u-sticky.vue +11 -0
- package/components/u-subsection/props.js +3 -1
- package/components/u-swipe-action/props.js +4 -1
- package/components/u-swipe-action-item/props.js +4 -1
- package/components/u-swipe-action-item/u-swipe-action-item.vue +14 -0
- package/components/u-swiper/props.js +9 -1
- package/components/u-swiper/swiper.js +1 -0
- package/components/u-swiper/u-swiper.vue +2 -0
- package/components/u-swiper-indicator/props.js +4 -1
- package/components/u-switch/props.js +4 -1
- package/components/u-tabbar/props.js +3 -1
- package/components/u-tabbar-item/props.js +4 -1
- package/components/u-table/props.js +3 -1
- package/components/u-table2/tableRow.vue +155 -69
- package/components/u-table2/u-table2.vue +328 -140
- package/components/u-tabs/props.js +4 -1
- package/components/u-tabs-item/props.js +3 -1
- package/components/u-tag/props.js +4 -1
- package/components/u-td/props.js +3 -1
- package/components/u-text/props.js +4 -1
- package/components/u-textarea/props.js +3 -1
- package/components/u-textarea/u-textarea.vue +16 -5
- package/components/u-th/props.js +3 -1
- package/components/u-toolbar/props.js +4 -1
- package/components/u-tooltip/props.js +10 -2
- package/components/u-tooltip/tooltip.js +2 -1
- package/components/u-tooltip/u-tooltip.vue +31 -3
- package/components/u-tr/props.js +3 -1
- package/components/u-transition/nvue-ani-map.js +75 -68
- package/components/u-transition/props.js +4 -1
- package/components/u-transition/transitionMixin.js +164 -163
- package/components/u-upload/props.js +4 -1
- package/components/u-upload/u-upload.vue +47 -40
- package/components/u-waterfall/u-waterfall.vue +50 -51
- package/index.js +65 -8
- package/libs/config/props.js +179 -204
- package/libs/css/components.scss +3 -0
- package/libs/function/uni-api-shims.js +29 -0
- package/libs/i18n/index.js +71 -36
- package/libs/i18n/locale-packs.js +11 -0
- package/libs/i18n/locales/all.js +23 -0
- package/libs/i18n/locales/{de.json → de.js} +1 -1
- package/libs/i18n/locales/{en.json → en.js} +2 -2
- package/libs/i18n/locales/{es.json → es.js} +1 -1
- package/libs/i18n/locales/{fr.json → fr.js} +2 -2
- package/libs/i18n/locales/{ja.json → ja.js} +1 -1
- package/libs/i18n/locales/{ko.json → ko.js} +1 -1
- package/libs/i18n/locales/{ru.json → ru.js} +1 -1
- package/libs/i18n/locales/{th.json → th.js} +1 -1
- package/libs/i18n/locales/{zh-Hans.json → zh-Hans.js} +1 -1
- package/libs/i18n/locales/{zh-Hant.json → zh-Hant.js} +1 -1
- package/libs/mixin/mixin.js +14 -4
- package/libs/util/gcanvas/bridge/bridge-weex.js +10 -5
- package/package.json +4 -5
- package/tsconfig.json +18 -0
- package/types/comps/calendar.d.ts +57 -0
- package/types/comps/checkbox.d.ts +12 -0
- package/types/comps/lineProgress.d.ts +5 -0
- package/types/comps/navbar.d.ts +3 -3
- package/types/comps/swiper.d.ts +5 -0
- package/types/comps/tooltip.d.ts +36 -1
- /package/components/u-markdown/{marked.esm.js → marked.esm.mjs} +0 -0
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { defineMixin } from '../../libs/vue'
|
|
2
|
-
import
|
|
2
|
+
import LineProgressDefaultProps from './lineProgress'
|
|
3
|
+
import { registerComponentProps } from '../../libs/config/props.js'
|
|
4
|
+
|
|
5
|
+
const defProps = registerComponentProps(LineProgressDefaultProps)
|
|
3
6
|
export const props = defineMixin({
|
|
4
7
|
props: {
|
|
5
8
|
// 激活部分的颜色
|
|
@@ -9,12 +12,12 @@ export const props = defineMixin({
|
|
|
9
12
|
},
|
|
10
13
|
inactiveColor: {
|
|
11
14
|
type: String,
|
|
12
|
-
default: () => defProps.lineProgress.
|
|
15
|
+
default: () => defProps.lineProgress.inactiveColor
|
|
13
16
|
},
|
|
14
17
|
// 进度百分比,数值
|
|
15
18
|
percentage: {
|
|
16
19
|
type: [String, Number],
|
|
17
|
-
default: () => defProps.lineProgress.
|
|
20
|
+
default: () => defProps.lineProgress.percentage
|
|
18
21
|
},
|
|
19
22
|
// 是否在进度条内部显示百分比的值
|
|
20
23
|
showText: {
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { defineMixin } from '../../libs/vue'
|
|
2
|
-
import
|
|
2
|
+
import LinkDefaultProps from './link'
|
|
3
|
+
import { registerComponentProps } from '../../libs/config/props.js'
|
|
4
|
+
|
|
5
|
+
const defProps = registerComponentProps(LinkDefaultProps)
|
|
3
6
|
export const props = defineMixin({
|
|
4
7
|
props: {
|
|
5
8
|
// 文字颜色
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { defineMixin } from '../../libs/vue'
|
|
2
|
-
import
|
|
2
|
+
import ListDefaultProps from './list'
|
|
3
|
+
import { registerComponentProps } from '../../libs/config/props.js'
|
|
4
|
+
|
|
5
|
+
const defProps = registerComponentProps(ListDefaultProps)
|
|
3
6
|
export const props = defineMixin({
|
|
4
7
|
props: {
|
|
5
8
|
// 控制是否出现滚动条,仅nvue有效
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { defineMixin } from '../../libs/vue'
|
|
2
|
-
import
|
|
2
|
+
import ListItemDefaultProps from './listItem'
|
|
3
|
+
import { registerComponentProps } from '../../libs/config/props.js'
|
|
4
|
+
|
|
5
|
+
const defProps = registerComponentProps(ListItemDefaultProps)
|
|
3
6
|
export const props = defineMixin({
|
|
4
7
|
props: {
|
|
5
8
|
// 用于滚动到指定item
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { defineMixin } from '../../libs/vue'
|
|
2
|
-
import
|
|
2
|
+
import LoadingIconDefaultProps from './loadingIcon'
|
|
3
|
+
import { registerComponentProps } from '../../libs/config/props.js'
|
|
4
|
+
|
|
5
|
+
const defProps = registerComponentProps(LoadingIconDefaultProps)
|
|
3
6
|
export const props = defineMixin({
|
|
4
7
|
props: {
|
|
5
8
|
// 是否显示组件
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { defineMixin } from '../../libs/vue'
|
|
2
|
-
import
|
|
2
|
+
import LoadingPageDefaultProps from './loadingPage'
|
|
3
|
+
import { registerComponentProps } from '../../libs/config/props.js'
|
|
3
4
|
|
|
5
|
+
const defProps = registerComponentProps(LoadingPageDefaultProps)
|
|
4
6
|
export const props = defineMixin({
|
|
5
7
|
props: {
|
|
6
8
|
// 提示内容
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { defineMixin } from '../../libs/vue'
|
|
2
|
-
import
|
|
2
|
+
import LoadmoreDefaultProps from './loadmore'
|
|
3
|
+
import { registerComponentProps } from '../../libs/config/props.js'
|
|
4
|
+
|
|
5
|
+
const defProps = registerComponentProps(LoadmoreDefaultProps)
|
|
3
6
|
export const props = defineMixin({
|
|
4
7
|
props: {
|
|
5
8
|
// 组件状态,loadmore-加载前的状态,loading-加载中的状态,nomore-没有更多的状态
|
|
@@ -1,14 +1,28 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<view class="up-markdown" :class="theme">
|
|
3
|
-
<up-parse
|
|
3
|
+
<up-parse
|
|
4
|
+
:content="parsedContent"
|
|
5
|
+
:previewImg="previewImg"
|
|
6
|
+
:copyLink="copyLink"
|
|
7
|
+
:domain="domain"
|
|
8
|
+
@load="emitLoad"
|
|
9
|
+
@ready="emitReady"
|
|
10
|
+
@imgtap="emitImgtap"
|
|
11
|
+
@linktap="emitLinktap"
|
|
12
|
+
@play="emitPlay"
|
|
13
|
+
@error="emitError"
|
|
14
|
+
></up-parse>
|
|
4
15
|
</view>
|
|
5
16
|
</template>
|
|
6
17
|
|
|
7
18
|
<script>
|
|
8
|
-
import { marked } from './marked.esm.
|
|
19
|
+
import { marked } from './marked.esm.mjs';
|
|
9
20
|
|
|
10
21
|
export default {
|
|
11
22
|
name: 'up-markdown',
|
|
23
|
+
// #ifdef VUE3
|
|
24
|
+
emits: ['load', 'ready', 'imgtap', 'linktap', 'play', 'error'],
|
|
25
|
+
// #endif
|
|
12
26
|
props: {
|
|
13
27
|
// markdown内容
|
|
14
28
|
content: {
|
|
@@ -20,6 +34,16 @@ export default {
|
|
|
20
34
|
type: Boolean,
|
|
21
35
|
default: true
|
|
22
36
|
},
|
|
37
|
+
// 是否允许外部链接被点击时自动打开
|
|
38
|
+
copyLink: {
|
|
39
|
+
type: [Boolean, String],
|
|
40
|
+
default: true
|
|
41
|
+
},
|
|
42
|
+
// 主域名,用于 up-parse 处理相对链接
|
|
43
|
+
domain: {
|
|
44
|
+
type: String,
|
|
45
|
+
default: ''
|
|
46
|
+
},
|
|
23
47
|
// 是否显示代码块行号
|
|
24
48
|
showLineNumber: {
|
|
25
49
|
type: Boolean,
|
|
@@ -93,6 +117,24 @@ export default {
|
|
|
93
117
|
applyTheme(html) {
|
|
94
118
|
// 可以根据theme属性添加不同的样式类
|
|
95
119
|
return html;
|
|
120
|
+
},
|
|
121
|
+
emitLoad(event) {
|
|
122
|
+
this.$emit('load', event)
|
|
123
|
+
},
|
|
124
|
+
emitReady(event) {
|
|
125
|
+
this.$emit('ready', event)
|
|
126
|
+
},
|
|
127
|
+
emitImgtap(event) {
|
|
128
|
+
this.$emit('imgtap', event)
|
|
129
|
+
},
|
|
130
|
+
emitLinktap(event) {
|
|
131
|
+
this.$emit('linktap', event)
|
|
132
|
+
},
|
|
133
|
+
emitPlay(event) {
|
|
134
|
+
this.$emit('play', event)
|
|
135
|
+
},
|
|
136
|
+
emitError(event) {
|
|
137
|
+
this.$emit('error', event)
|
|
96
138
|
}
|
|
97
139
|
}
|
|
98
140
|
};
|
|
@@ -297,4 +339,4 @@ export default {
|
|
|
297
339
|
line-height: 1.6;
|
|
298
340
|
}
|
|
299
341
|
}
|
|
300
|
-
</style>
|
|
342
|
+
</style>
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { defineMixin } from '../../libs/vue'
|
|
2
|
-
import
|
|
2
|
+
import ModalDefaultProps from './modal'
|
|
3
|
+
import { registerComponentProps } from '../../libs/config/props.js'
|
|
4
|
+
|
|
5
|
+
const defProps = registerComponentProps(ModalDefaultProps)
|
|
3
6
|
export const props = defineMixin({
|
|
4
7
|
props: {
|
|
5
8
|
// 是否展示modal
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { defineMixin } from '../../libs/vue'
|
|
2
|
-
import
|
|
3
|
-
|
|
2
|
+
import NavbarDefaultProps from './navbar'
|
|
3
|
+
import { registerComponentProps } from '../../libs/config/props.js'
|
|
4
|
+
|
|
5
|
+
const defProps = registerComponentProps(NavbarDefaultProps)
|
|
4
6
|
export const props = defineMixin({
|
|
5
7
|
props: {
|
|
6
8
|
// 是否开启顶部安全区适配
|
|
@@ -7,17 +7,18 @@
|
|
|
7
7
|
height: addUnit(getPx(height) + getWindowInfo().statusBarHeight,'px'),
|
|
8
8
|
}"
|
|
9
9
|
></view>
|
|
10
|
-
<view
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
<view
|
|
11
|
+
class="u-navbar__inner"
|
|
12
|
+
:class="[fixed && 'u-navbar--fixed']"
|
|
13
|
+
:style="[navbarInnerStyle]"
|
|
14
|
+
>
|
|
15
|
+
<u-status-bar v-if="safeAreaInsetTop"></u-status-bar>
|
|
15
16
|
<view
|
|
16
17
|
class="u-navbar__content"
|
|
17
18
|
:class="[border && 'u-border-bottom']"
|
|
18
19
|
:style="{
|
|
19
20
|
height: addUnit(height),
|
|
20
|
-
backgroundColor:
|
|
21
|
+
backgroundColor: 'transparent',
|
|
21
22
|
}"
|
|
22
23
|
>
|
|
23
24
|
<view
|
|
@@ -95,8 +96,8 @@
|
|
|
95
96
|
* @property {String} rightIcon 右边返回图标的名称,只能为uview-plus自带的图标
|
|
96
97
|
* @property {String} title 导航栏标题,如设置为空字符,将会隐藏标题占位区域
|
|
97
98
|
* @property {String} titleColor 文字颜色 (默认 '' )
|
|
98
|
-
* @property {String} bgColor
|
|
99
|
-
* @property {String} statusBarBgColor
|
|
99
|
+
* @property {String} bgColor 导航栏背景设置,支持颜色、渐变或背景图 (默认 '#ffffff' )
|
|
100
|
+
* @property {String} statusBarBgColor 状态栏背景颜色,保留兼容;导航栏内部统一使用 bgColor 作为整体背景
|
|
100
101
|
* @property {String | Number} titleWidth 导航栏标题的最大宽度,内容超出会以省略号隐藏 (默认 '400rpx' )
|
|
101
102
|
* @property {String | Number} height 导航栏高度(不包括状态栏高度在内,内部自动加上)(默认 '44px' )
|
|
102
103
|
* @property {String | Number} leftIconSize 左侧返回图标的大小(默认 20px )
|
|
@@ -129,6 +130,11 @@
|
|
|
129
130
|
},
|
|
130
131
|
navbarRightColor() {
|
|
131
132
|
return this.upThemeVar('--up-main-color', this.$u.color.mainColor)
|
|
133
|
+
},
|
|
134
|
+
navbarInnerStyle() {
|
|
135
|
+
const style = {}
|
|
136
|
+
style.background = this.navbarBgColor
|
|
137
|
+
return style
|
|
132
138
|
}
|
|
133
139
|
},
|
|
134
140
|
emits: ["leftClick", "rightClick"],
|
|
@@ -142,7 +148,7 @@
|
|
|
142
148
|
// 如果配置了autoBack,自动返回上一页
|
|
143
149
|
this.$emit('leftClick')
|
|
144
150
|
if (config.interceptor.navbarLeftClick != null) {
|
|
145
|
-
config.interceptor.navbarLeftClick()
|
|
151
|
+
config.interceptor.navbarLeftClick.call(this, this)
|
|
146
152
|
} else {
|
|
147
153
|
if(this.autoBack) {
|
|
148
154
|
uni.navigateBack()
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { defineMixin } from '../../libs/vue'
|
|
2
|
-
import
|
|
2
|
+
import NoNetworkDefaultProps from './noNetwork'
|
|
3
|
+
import { registerComponentProps } from '../../libs/config/props.js'
|
|
4
|
+
|
|
5
|
+
const defProps = registerComponentProps(NoNetworkDefaultProps)
|
|
3
6
|
export const props = defineMixin({
|
|
4
7
|
props: {
|
|
5
8
|
// 页面文字提示
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { defineMixin } from '../../libs/vue'
|
|
2
|
-
import
|
|
2
|
+
import NoticeBarDefaultProps from './noticeBar'
|
|
3
|
+
import { registerComponentProps } from '../../libs/config/props.js'
|
|
4
|
+
|
|
5
|
+
const defProps = registerComponentProps(NoticeBarDefaultProps)
|
|
3
6
|
export const props = defineMixin({
|
|
4
7
|
props: {
|
|
5
8
|
// 显示的内容,数组
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { defineMixin } from '../../libs/vue'
|
|
2
|
-
import
|
|
2
|
+
import NotifyDefaultProps from './notify'
|
|
3
|
+
import { registerComponentProps } from '../../libs/config/props.js'
|
|
4
|
+
|
|
5
|
+
const defProps = registerComponentProps(NotifyDefaultProps)
|
|
3
6
|
export const props = defineMixin({
|
|
4
7
|
props: {
|
|
5
8
|
// 到顶部的距离
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { defineMixin } from '../../libs/vue'
|
|
2
|
-
import
|
|
2
|
+
import NumberBoxDefaultProps from './numberBox'
|
|
3
|
+
import { registerComponentProps } from '../../libs/config/props.js'
|
|
4
|
+
|
|
5
|
+
const defProps = registerComponentProps(NumberBoxDefaultProps)
|
|
3
6
|
export const props = defineMixin({
|
|
4
7
|
props: {
|
|
5
8
|
// 步进器标识符,在change回调返回
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
@blur="onBlur"
|
|
42
42
|
@focus="onFocus"
|
|
43
43
|
@input="onInput"
|
|
44
|
-
type="number"
|
|
44
|
+
:type="integer ? 'number' : 'digit'"
|
|
45
45
|
:style="[inputStyle]"
|
|
46
46
|
/>
|
|
47
47
|
<!-- #endif -->
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
@blur="onBlur"
|
|
56
56
|
@focus="onFocus"
|
|
57
57
|
@input="onInput"
|
|
58
|
-
type="number"
|
|
58
|
+
:type="integer ? 'number' : 'digit'"
|
|
59
59
|
:style="[inputStyle]"
|
|
60
60
|
/>
|
|
61
61
|
<!-- #endif -->
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { defineMixin } from '../../libs/vue'
|
|
2
|
-
import
|
|
2
|
+
import NumberKeyboardDefaultProps from './numberKeyboard'
|
|
3
|
+
import { registerComponentProps } from '../../libs/config/props.js'
|
|
4
|
+
|
|
5
|
+
const defProps = registerComponentProps(NumberKeyboardDefaultProps)
|
|
3
6
|
export const props = defineMixin({
|
|
4
7
|
props: {
|
|
5
8
|
// 键盘的类型,number-数字键盘,card-身份证键盘
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { defineMixin } from '../../libs/vue'
|
|
2
|
-
import
|
|
2
|
+
import OverlayDefaultProps from './overlay'
|
|
3
|
+
import { registerComponentProps } from '../../libs/config/props.js'
|
|
4
|
+
|
|
5
|
+
const defProps = registerComponentProps(OverlayDefaultProps)
|
|
3
6
|
export const props = defineMixin({
|
|
4
7
|
props: {
|
|
5
8
|
// 是否显示遮罩
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<view class="u-pagination">
|
|
3
|
-
|
|
4
|
-
<!-- 上一页按钮 -->
|
|
1
|
+
<template>
|
|
2
|
+
<view class="u-pagination">
|
|
3
|
+
<!-- 上一页按钮 -->
|
|
5
4
|
<view
|
|
6
5
|
:class="[
|
|
7
6
|
'u-pagination-btn',
|
|
@@ -30,23 +29,23 @@
|
|
|
30
29
|
</view>
|
|
31
30
|
</template>
|
|
32
31
|
|
|
33
|
-
<!-- 总数显示 -->
|
|
34
|
-
<view v-if="total > 0 && layout.includes('total')" class="u-pagination-total">
|
|
35
|
-
{{
|
|
36
|
-
</view>
|
|
37
|
-
|
|
38
|
-
<!-- 每页数量选择器 -->
|
|
39
|
-
|
|
40
|
-
v-if="layout.includes('sizes')"
|
|
41
|
-
mode="selector"
|
|
42
|
-
:range="
|
|
43
|
-
range-key="label"
|
|
44
|
-
:value="pageSizeIndex"
|
|
45
|
-
@change="handleSizeChange"
|
|
46
|
-
class="u-pagination-sizes"
|
|
47
|
-
>
|
|
48
|
-
<view>{{ pageSizeLabel }}</view>
|
|
49
|
-
</picker>
|
|
32
|
+
<!-- 总数显示 -->
|
|
33
|
+
<view v-if="total > 0 && layout.includes('total')" class="u-pagination-total">
|
|
34
|
+
共 {{ total }} 条
|
|
35
|
+
</view>
|
|
36
|
+
|
|
37
|
+
<!-- 每页数量选择器 -->
|
|
38
|
+
<picker
|
|
39
|
+
v-if="layout.includes('sizes') && normalizedPageSizes.length"
|
|
40
|
+
mode="selector"
|
|
41
|
+
:range="normalizedPageSizes"
|
|
42
|
+
range-key="label"
|
|
43
|
+
:value="pageSizeIndex"
|
|
44
|
+
@change="handleSizeChange"
|
|
45
|
+
class="u-pagination-sizes"
|
|
46
|
+
>
|
|
47
|
+
<view>{{ pageSizeLabel }}</view>
|
|
48
|
+
</picker>
|
|
50
49
|
|
|
51
50
|
<!-- 下一页按钮 -->
|
|
52
51
|
<view
|
|
@@ -139,17 +138,38 @@ export default {
|
|
|
139
138
|
};
|
|
140
139
|
},
|
|
141
140
|
computed: {
|
|
142
|
-
totalPages() {
|
|
143
|
-
return Math.max(1, Math.ceil(this.total / this.pageSize));
|
|
144
|
-
},
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
return
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
141
|
+
totalPages() {
|
|
142
|
+
return Math.max(1, Math.ceil(this.total / this.pageSize));
|
|
143
|
+
},
|
|
144
|
+
normalizedPageSizes() {
|
|
145
|
+
if (!Array.isArray(this.pageSizes)) return [];
|
|
146
|
+
return this.pageSizes
|
|
147
|
+
.map(size => {
|
|
148
|
+
if (typeof size === 'number' || typeof size === 'string') {
|
|
149
|
+
return {
|
|
150
|
+
label: `${size}条/页`,
|
|
151
|
+
value: Number(size)
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
if (size && typeof size === 'object') {
|
|
155
|
+
const value = Number(size.value);
|
|
156
|
+
return {
|
|
157
|
+
label: size.label || `${value}条/页`,
|
|
158
|
+
value
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
return null;
|
|
162
|
+
})
|
|
163
|
+
.filter(size => size && !isNaN(size.value));
|
|
164
|
+
},
|
|
165
|
+
pageSizeIndex() {
|
|
166
|
+
const index = this.normalizedPageSizes.findIndex(size => size.value === this.pageSize);
|
|
167
|
+
return index >= 0 ? index : 0;
|
|
168
|
+
},
|
|
169
|
+
pageSizeLabel() {
|
|
170
|
+
const found = this.normalizedPageSizes.find(size => size.value === this.pageSize);
|
|
171
|
+
return found?.label || this.pageSize;
|
|
172
|
+
},
|
|
153
173
|
displayedPages() {
|
|
154
174
|
const total = this.totalPages;
|
|
155
175
|
const current = this.currentPage;
|
|
@@ -197,13 +217,14 @@ export default {
|
|
|
197
217
|
}
|
|
198
218
|
},
|
|
199
219
|
methods: {
|
|
200
|
-
t,
|
|
201
|
-
handleSizeChange(e) {
|
|
202
|
-
const selected = e.detail.value;
|
|
203
|
-
const size = this.
|
|
204
|
-
|
|
205
|
-
this.$emit('
|
|
206
|
-
|
|
220
|
+
t,
|
|
221
|
+
handleSizeChange(e) {
|
|
222
|
+
const selected = Number(e.detail.value);
|
|
223
|
+
const size = this.normalizedPageSizes[selected]?.value || this.normalizedPageSizes[0]?.value;
|
|
224
|
+
if (!size) return;
|
|
225
|
+
this.$emit('update:pageSize', size);
|
|
226
|
+
this.$emit('size-change', size);
|
|
227
|
+
},
|
|
207
228
|
prev() {
|
|
208
229
|
if (this.currentPage > 1) {
|
|
209
230
|
this.goTo(this.currentPage - 1);
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { defineMixin } from '../../libs/vue'
|
|
2
|
-
import
|
|
2
|
+
import ParseDefaultProps from './parse'
|
|
3
|
+
import { registerComponentProps } from '../../libs/config/props.js'
|
|
4
|
+
|
|
5
|
+
const defProps = registerComponentProps(ParseDefaultProps)
|
|
3
6
|
export const props = defineMixin({
|
|
4
7
|
props: {
|
|
5
8
|
containerStyle: {
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { defineMixin } from '../../libs/vue'
|
|
2
|
-
import
|
|
2
|
+
import PickerDefaultProps from './picker'
|
|
3
|
+
import { registerComponentProps } from '../../libs/config/props.js'
|
|
4
|
+
|
|
5
|
+
const defProps = registerComponentProps(PickerDefaultProps)
|
|
3
6
|
export const props = defineMixin({
|
|
4
7
|
props: {
|
|
5
8
|
modelValue: {
|
|
@@ -407,10 +407,25 @@ export default {
|
|
|
407
407
|
// 设置整体各列的columns的值
|
|
408
408
|
setColumns(columns) {
|
|
409
409
|
// console.log(columns)
|
|
410
|
+
const prevColumns = this.innerColumns
|
|
410
411
|
this.innerColumns = deepClone(columns)
|
|
411
412
|
// 如果在设置各列数据时,没有被设置默认的各列索引defaultIndex,那么用0去填充它,数组长度为列的数量
|
|
412
413
|
if (this.innerIndex.length === 0) {
|
|
413
414
|
this.innerIndex = new Array(columns.length).fill(0)
|
|
415
|
+
} else {
|
|
416
|
+
// 修复异步columns加载时defaultIndex位置不更新的问题 (issue #841)
|
|
417
|
+
// 当某列从空数组变为有数据时,picker-view不会因为:value未变化而重新滚动到指定位置
|
|
418
|
+
// 需要通过先清空再赋值的方式强制触发picker-view的滚动更新
|
|
419
|
+
const hasColumnsChangedFromEmpty = columns.some(
|
|
420
|
+
(col, i) => col && col.length > 0 && (!prevColumns[i] || prevColumns[i].length === 0)
|
|
421
|
+
)
|
|
422
|
+
if (hasColumnsChangedFromEmpty) {
|
|
423
|
+
const targetIndex = deepClone(this.innerIndex)
|
|
424
|
+
this.innerIndex = []
|
|
425
|
+
this.$nextTick(() => {
|
|
426
|
+
this.innerIndex = targetIndex
|
|
427
|
+
})
|
|
428
|
+
}
|
|
414
429
|
}
|
|
415
430
|
},
|
|
416
431
|
// 获取各列选中值对应的索引
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { defineMixin } from '../../libs/vue'
|
|
2
|
-
import
|
|
2
|
+
import { registerComponentProps } from '../../libs/config/props.js'
|
|
3
|
+
|
|
4
|
+
const defProps = registerComponentProps({ pickerColumn: {} })
|
|
3
5
|
export const props = defineMixin({
|
|
4
6
|
props: {
|
|
5
7
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { defineMixin } from '../../libs/vue'
|
|
2
|
-
import
|
|
2
|
+
import { registerComponentProps } from '../../libs/config/props.js'
|
|
3
3
|
|
|
4
|
+
const defProps = registerComponentProps({ popover: {} })
|
|
4
5
|
export const props = defineMixin({
|
|
5
6
|
props: {
|
|
6
7
|
// 显示的文字内容
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { defineMixin } from '../../libs/vue'
|
|
2
|
-
import
|
|
2
|
+
import PopupDefaultProps from './popup'
|
|
3
|
+
import { registerComponentProps } from '../../libs/config/props.js'
|
|
4
|
+
|
|
5
|
+
const defProps = registerComponentProps(PopupDefaultProps)
|
|
3
6
|
export const props = defineMixin({
|
|
4
7
|
props: {
|
|
5
8
|
// 是否展示弹窗
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<view class="up-poster">
|
|
3
3
|
<!-- canvas用于绘制海报 -->
|
|
4
|
-
<canvas
|
|
5
|
-
v-if="showCanvas"
|
|
4
|
+
<up-canvas
|
|
5
|
+
v-if="showCanvas"
|
|
6
|
+
ref="posterCanvas"
|
|
6
7
|
class="up-poster__hidden-canvas"
|
|
7
8
|
:canvas-id="canvasId"
|
|
8
|
-
:
|
|
9
|
+
:width="canvasWidth"
|
|
10
|
+
:height="canvasHeight"
|
|
11
|
+
bg-color="transparent"
|
|
9
12
|
:style="{ width: canvasWidth + 'px', height: canvasHeight + 'px' }">
|
|
10
|
-
</canvas>
|
|
13
|
+
</up-canvas>
|
|
11
14
|
<!-- 隐藏的二维码组件,用于生成二维码图片 -->
|
|
12
15
|
<up-qrcode
|
|
13
16
|
ref="qrCode"
|
|
@@ -102,8 +105,8 @@ export default {
|
|
|
102
105
|
// 等待DOM更新
|
|
103
106
|
await this.$nextTick();
|
|
104
107
|
|
|
105
|
-
|
|
106
|
-
const ctx =
|
|
108
|
+
const posterCanvas = await this.getPosterCanvas();
|
|
109
|
+
const ctx = posterCanvas;
|
|
107
110
|
|
|
108
111
|
// 绘制背景
|
|
109
112
|
if (posterSize.background) {
|
|
@@ -125,9 +128,11 @@ export default {
|
|
|
125
128
|
ctx.draw(false, () => {
|
|
126
129
|
// 等待绘制完成
|
|
127
130
|
setTimeout(() => {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
+
posterCanvas.toTempFilePath({
|
|
132
|
+
width,
|
|
133
|
+
height,
|
|
134
|
+
destWidth: width,
|
|
135
|
+
destHeight: height,
|
|
131
136
|
success: (res) => {
|
|
132
137
|
// 隐藏canvas
|
|
133
138
|
this.showCanvas = false;
|
|
@@ -145,7 +150,7 @@ export default {
|
|
|
145
150
|
this.showCanvas = false;
|
|
146
151
|
reject(new Error('导出图片失败: ' + JSON.stringify(err)));
|
|
147
152
|
}
|
|
148
|
-
}
|
|
153
|
+
});
|
|
149
154
|
}, 300);
|
|
150
155
|
});
|
|
151
156
|
|
|
@@ -160,6 +165,16 @@ export default {
|
|
|
160
165
|
}
|
|
161
166
|
});
|
|
162
167
|
},
|
|
168
|
+
|
|
169
|
+
async getPosterCanvas() {
|
|
170
|
+
await this.$nextTick();
|
|
171
|
+
const posterCanvas = this.$refs.posterCanvas;
|
|
172
|
+
if (!posterCanvas) {
|
|
173
|
+
throw new Error('无法获取海报画布实例');
|
|
174
|
+
}
|
|
175
|
+
await posterCanvas.initCanvas(true);
|
|
176
|
+
return posterCanvas;
|
|
177
|
+
},
|
|
163
178
|
|
|
164
179
|
/**
|
|
165
180
|
* 绘制单个元素
|
|
@@ -224,7 +239,7 @@ export default {
|
|
|
224
239
|
return new Promise((resolve) => {
|
|
225
240
|
uni.getImageInfo({
|
|
226
241
|
src: item.src,
|
|
227
|
-
success: (res) => {
|
|
242
|
+
success: async (res) => {
|
|
228
243
|
// console.log('图片加载成功: ' + item.src, res);
|
|
229
244
|
// 处理圆角
|
|
230
245
|
if (css.radius) {
|
|
@@ -232,7 +247,7 @@ export default {
|
|
|
232
247
|
this.clipRoundRect(ctx, left, top, width, height, radius);
|
|
233
248
|
}
|
|
234
249
|
// 不能用item.src,要用res.path。
|
|
235
|
-
ctx.drawImage(res.path, left, top, width, height);
|
|
250
|
+
await ctx.drawImage(res.path, left, top, width, height);
|
|
236
251
|
// 恢复剪切区域
|
|
237
252
|
ctx.restore();
|
|
238
253
|
resolve();
|
|
@@ -255,8 +270,8 @@ export default {
|
|
|
255
270
|
return new Promise((resolve) => {
|
|
256
271
|
uni.getImageInfo({
|
|
257
272
|
src: qrCodeImageUrl,
|
|
258
|
-
success: (res) => {
|
|
259
|
-
ctx.drawImage(res.path, left, top, width, height);
|
|
273
|
+
success: async (res) => {
|
|
274
|
+
await ctx.drawImage(res.path, left, top, width, height);
|
|
260
275
|
resolve();
|
|
261
276
|
},
|
|
262
277
|
fail: () => {
|