fusions-ui 1.2.4 → 1.2.6
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/fu-avatar/fu-avatar.vue +4 -2
- package/components/fu-avatar/props.js +52 -15
- package/components/fu-avatar-group/fu-avatar-group.vue +3 -2
- package/components/fu-avatar-group/props.js +31 -9
- package/components/fu-badge/fu-badge.vue +8 -14
- package/components/fu-badge/props.js +56 -16
- package/components/fu-banner-arc/fu-banner-arc.vue +4 -5
- package/components/fu-banner-arc/props.js +15 -4
- package/components/fu-button/fu-button.vue +18 -20
- package/components/fu-button/props.js +108 -35
- package/components/fu-cell/fu-cell.vue +9 -8
- package/components/fu-cell-group/fu-cell-group.vue +2 -1
- package/components/fu-cell-group/props.js +7 -2
- package/components/fu-checkbox/fu-checkbox.vue +5 -4
- package/components/fu-checkbox/props.js +51 -14
- package/components/fu-code-input/fu-code-input.vue +10 -6
- package/components/fu-code-input/props.js +66 -17
- package/components/fu-code-verify/fu-code-verify.vue +9 -5
- package/components/fu-code-verify/props.js +64 -17
- package/components/fu-collapse/fu-collapse.vue +10 -3
- package/components/fu-collapse/props.js +9 -3
- package/components/fu-collapse-item/fu-collapse-item.vue +45 -31
- package/components/fu-collapse-item/props.js +49 -16
- package/components/fu-countdown/fu-countdown.vue +2 -1
- package/components/fu-countdown/props.js +15 -4
- package/components/fu-datetime-picker/fu-datetime-picker.vue +6 -5
- package/components/fu-datetime-picker/props.js +91 -25
- package/components/fu-form/fu-form.vue +2 -1
- package/components/fu-form/props.js +34 -6
- package/components/fu-form-item/fu-form-item.vue +26 -33
- package/components/fu-form-item/props.js +30 -8
- package/components/fu-grid/fu-grid.vue +16 -17
- package/components/fu-grid/props.js +20 -5
- package/components/fu-grid-item/fu-grid-item.vue +31 -35
- package/components/fu-grid-item/props.js +11 -3
- package/components/fu-icon/fu-icon.vue +107 -0
- package/components/fu-icon/icon.css +584 -0
- package/components/{fu-icons/icons.js → fu-icon/icon.js} +1031 -1031
- package/components/{fu-icons/fuicons.ttf → fu-icon/icon.ttf} +0 -0
- package/components/fu-icon/props.js +55 -0
- package/components/fu-image/fu-image.vue +15 -10
- package/components/fu-image/props.js +69 -18
- package/components/fu-index-anchor/fu-index-anchor.vue +6 -5
- package/components/fu-index-anchor/props.js +20 -6
- package/components/fu-index-item/fu-index-item.vue +4 -4
- package/components/fu-index-list/fu-index-list.vue +9 -9
- package/components/fu-index-list/props.js +19 -6
- package/components/fu-input/fu-input.vue +54 -68
- package/components/fu-input/props.js +145 -53
- package/components/fu-keyboard/fu-keyboard.vue +19 -9
- package/components/fu-keyboard/keyboard-car.vue +33 -22
- package/components/fu-keyboard/keyboard-number.vue +17 -9
- package/components/fu-keyboard/props.js +66 -17
- package/components/fu-line/fu-line.vue +17 -13
- package/components/fu-line/props.js +30 -5
- package/components/fu-link/fu-link.vue +14 -8
- package/components/fu-link/props.js +22 -7
- package/components/fu-loading/fu-loading.vue +32 -27
- package/components/fu-loading/props.js +28 -8
- package/components/fu-loading-more/fu-loading-more.vue +19 -23
- package/components/fu-loading-more/props.js +27 -13
- package/components/fu-modal/fu-modal.vue +11 -6
- package/components/fu-modal/props.js +61 -17
- package/components/{fu-nav-bar/fu-nav-bar.vue → fu-navbar/fu-navbar.vue} +37 -44
- package/components/fu-notice-bar/fu-notice-bar.vue +10 -8
- package/components/fu-notice-bar/notice-column.vue +187 -122
- package/components/fu-notice-bar/notice-row.vue +85 -28
- package/components/fu-notice-bar/props.js +83 -22
- package/components/fu-number-box/fu-number-box.vue +26 -28
- package/components/fu-number-box/props.js +37 -11
- package/components/fu-parse/fu-parse.vue +0 -1
- package/components/fu-picker/fu-picker.vue +22 -17
- package/components/fu-picker/props.js +70 -19
- package/components/fu-popup/fu-popup.vue +38 -43
- package/components/fu-popup/props.js +34 -9
- package/components/fu-progress/fu-progress.vue +3 -2
- package/components/fu-progress/props.js +36 -9
- package/components/fu-rate/fu-rate.vue +40 -32
- package/components/fu-rate/props.js +47 -13
- package/components/fu-read-more/fu-read-more.vue +19 -14
- package/components/fu-read-more/props.js +68 -46
- package/components/fu-ribbon/fu-ribbon.vue +8 -7
- package/components/fu-ribbon/props.js +15 -4
- package/components/fu-scroll-list/fu-scroll-list.vue +18 -34
- package/components/fu-scroll-list/props.js +19 -10
- package/components/fu-search/fu-search.vue +13 -18
- package/components/fu-search/props.js +69 -17
- package/components/fu-section/fu-section.vue +19 -22
- package/components/fu-section/props.js +30 -4
- package/components/fu-sign-board/fu-sign-board.vue +18 -3
- package/components/fu-sign-board/props.js +15 -5
- package/components/fu-skeleton/fu-skeleton.vue +8 -12
- package/components/fu-skeleton/props.js +15 -4
- package/components/fu-steps/fu-steps.vue +3 -2
- package/components/fu-steps/props.js +23 -7
- package/components/fu-steps-item/fu-steps-item.vue +3 -3
- package/components/fu-steps-item/props.js +15 -5
- package/components/fu-sticky/fu-sticky.vue +3 -3
- package/components/fu-sticky/props.js +21 -7
- package/components/fu-subsection/fu-subsection.vue +29 -22
- package/components/fu-subsection/props.js +40 -10
- package/components/fu-swipe-action-item/bindingx.js +1 -1
- package/components/fu-swipe-action-item/fu-swipe-action-item.vue +134 -123
- package/components/fu-swipe-action-item/mpwxs.js +1 -1
- package/components/fu-swipe-action-item/props.js +22 -6
- package/components/fu-swiper/fu-swiper.vue +29 -27
- package/components/fu-swiper/props.js +81 -25
- package/components/fu-switch/fu-switch.vue +20 -12
- package/components/fu-switch/props.js +48 -13
- package/components/fu-tabs/fu-tabs.vue +36 -33
- package/components/fu-tabs/props.js +46 -13
- package/components/fu-tag/fu-tag.vue +24 -21
- package/components/fu-tag/props.js +63 -17
- package/components/fu-text/fu-text.vue +72 -33
- package/components/fu-text/props.js +85 -27
- package/components/fu-text/value.js +6 -6
- package/components/fu-textarea/fu-textarea.vue +13 -17
- package/components/fu-textarea/props.js +103 -30
- package/components/fu-timeaxis/fu-timeaxis.vue +1 -1
- package/components/fu-timeaxis-item/fu-timeaxis-item.vue +8 -4
- package/components/fu-transition/fu-transition.vue +48 -49
- package/components/fu-transition/props.js +21 -0
- package/components/fu-upload/fu-upload.vue +3 -1
- package/components/fu-upload/props.js +67 -19
- package/components/fu-upload/upload-file.vue +31 -18
- package/components/fu-upload/upload-image.vue +37 -19
- package/components/fu-vtabs/fu-vtabs.vue +6 -4
- package/components/fu-vtabs/props.js +50 -15
- package/components/fu-waterfall/fu-waterfall.vue +11 -9
- package/components/fu-waterfall/props.js +37 -15
- package/index.js +17 -24
- package/index.scss +9 -7
- package/libs/config/config.js +16 -9
- package/libs/function/applyEven.js +9 -9
- package/libs/function/check.js +81 -89
- package/libs/function/{index.js → common.js} +5 -5
- package/libs/function/message.js +0 -27
- package/libs/mixin/mixin.js +26 -21
- package/libs/{utils/min.router.config.js → route/min.route.config.js} +7 -7
- package/libs/{utils/router.config.js → route/route.config.js} +10 -11
- package/libs/{css/main.scss → style/common.scss} +50 -87
- package/libs/style/style.h5.scss +8 -0
- package/libs/style/style.mp.scss +15 -0
- package/package.json +1 -1
- package/components/fu-calendar/calendar-item.vue +0 -214
- package/components/fu-calendar/calendar.js +0 -546
- package/components/fu-calendar/fu-calendar.vue +0 -536
- package/components/fu-calendar/i18n/en.json +0 -12
- package/components/fu-calendar/i18n/index.js +0 -8
- package/components/fu-calendar/i18n/zh-Hans.json +0 -12
- package/components/fu-calendar/i18n/zh-Hant.json +0 -12
- package/components/fu-calendar/util.js +0 -360
- package/components/fu-date-picker/calendar-item.vue +0 -177
- package/components/fu-date-picker/calendar.vue +0 -917
- package/components/fu-date-picker/fu-date-picker.vue +0 -1069
- package/components/fu-date-picker/i18n/en.json +0 -22
- package/components/fu-date-picker/i18n/index.js +0 -8
- package/components/fu-date-picker/i18n/zh-Hans.json +0 -22
- package/components/fu-date-picker/i18n/zh-Hant.json +0 -22
- package/components/fu-date-picker/props.js +0 -68
- package/components/fu-date-picker/time-picker.vue +0 -924
- package/components/fu-date-picker/util.js +0 -419
- package/components/fu-icons/fu-icons.vue +0 -102
- package/components/fu-icons/fuicons.css +0 -585
- package/components/fu-landscape/fu-landscape.vue +0 -167
- package/components/fu-landscape/props.js +0 -64
- package/components/fu-tabbar/fu-tabbar.vue +0 -333
- package/components/fu-tabbar/props.js +0 -78
- package/libs/css/style.h5.scss +0 -35
- package/libs/css/style.mp.scss +0 -50
- package/libs/utils/util.js +0 -58
- /package/components/{fu-nav-bar → fu-navbar}/props.js +0 -0
- /package/components/{fu-nav-bar → fu-navbar}/status-bar.vue +0 -0
- /package/{components/fu-datetime-picker → libs/function}/dayjs.js +0 -0
- /package/libs/{css → style}/color.scss +0 -0
- /package/libs/{css/component.scss → style/components.scss} +0 -0
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<view class="fu-landscape-class fu-landscape">
|
|
3
|
-
<view v-if="show" class="fu-landscape__container" :style="[containerStyle]">
|
|
4
|
-
<slot></slot>
|
|
5
|
-
|
|
6
|
-
<view class="fu-landscape__icon fu-icon-close-fill" :class="[{
|
|
7
|
-
'fu-landscape__icon--left-top': closePosition === 'leftTop',
|
|
8
|
-
'fu-landscape__icon--right-top': closePosition === 'rightTop',
|
|
9
|
-
'fu-landscape__icon--bottom': closePosition === 'bottom'
|
|
10
|
-
}]" :style="[closeBtnStyle]" @click="close" v-if="closeBtn">
|
|
11
|
-
<fu-icons name="close" :size="closeBtnStyle.fontSize" :color="closeBtnStyle.color"></fu-icons>
|
|
12
|
-
</view>
|
|
13
|
-
</view>
|
|
14
|
-
<view v-if="showMask" class="fu-landscape__mask" :class="[{'fu-landscape__mask--show': show}]" :style="[maskStyle]" @tap="closeMask"></view>
|
|
15
|
-
</view>
|
|
16
|
-
</template>
|
|
17
|
-
|
|
18
|
-
<script>
|
|
19
|
-
/** Landscape 压屏窗
|
|
20
|
-
* @description 此组件一般用于活动等场景
|
|
21
|
-
* @property {Boolean} closeBtn = [true|false] 显示关闭图标(默认 true)
|
|
22
|
-
* @property {String} closeColor 关闭图标颜色
|
|
23
|
-
* @property {String,Number} closeSize 关闭图标大小
|
|
24
|
-
* @property {String} closePosition 关闭图标位置
|
|
25
|
-
* @value leftTop 左上角
|
|
26
|
-
* @value rightTop 右上角
|
|
27
|
-
* @value bottom 底部
|
|
28
|
-
* @property {String,Number} closeTop 关闭图标top值(注:当关闭图标在leftTop或者rightTop时生效)
|
|
29
|
-
* @property {String,Number} closeRight 关闭图标right值(注:当关闭图标在RightTop时生效)
|
|
30
|
-
* @property {String,Number} closeBottom 关闭图标bottom值(注:当关闭图标在bottom时生效)
|
|
31
|
-
* @property {String,Number} closeLeft 关闭图标left值(注:当关闭图标在leftTop时生效)
|
|
32
|
-
* @property {Boolean} showMask = [true|false] 显示遮罩(默认 true)
|
|
33
|
-
* @property {Boolean} maskCloseable = [true|false] 点击遮罩可以关闭(默认 true)
|
|
34
|
-
* @property {Number} zIndex 层级(默认 10024)
|
|
35
|
-
*/
|
|
36
|
-
import mpMixin from '../../libs/mixin/mpMixin.js'
|
|
37
|
-
import props from './props.js'
|
|
38
|
-
export default {
|
|
39
|
-
name: 'fuLandscape',
|
|
40
|
-
emits: ['close'],
|
|
41
|
-
mixins: [mpMixin, props],
|
|
42
|
-
data() {
|
|
43
|
-
return {
|
|
44
|
-
show: false
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
computed: {
|
|
48
|
-
containerStyle() {
|
|
49
|
-
let style = {}
|
|
50
|
-
style.zIndex = this.zIndex || 10024
|
|
51
|
-
return style
|
|
52
|
-
},
|
|
53
|
-
closeBtnStyle() {
|
|
54
|
-
let style = {}
|
|
55
|
-
if (this.closePosition === 'leftTop') {
|
|
56
|
-
if (this.closeTop) {
|
|
57
|
-
style.top = this.$fu.addUnit(this.closeTop)
|
|
58
|
-
}
|
|
59
|
-
if (this.closeLeft) {
|
|
60
|
-
style.left = this.$fu.addUnit(this.closeLeft)
|
|
61
|
-
}
|
|
62
|
-
} else if (this.closePosition === 'rightTop') {
|
|
63
|
-
if (this.closeTop) {
|
|
64
|
-
style.top = this.$fu.addUnit(this.closeTop)
|
|
65
|
-
}
|
|
66
|
-
if (this.closeRight) {
|
|
67
|
-
style.right = this.$fu.addUnit(this.closeRight)
|
|
68
|
-
}
|
|
69
|
-
} else if (this.closePosition === 'bottom') {
|
|
70
|
-
if (this.closeBottom) {
|
|
71
|
-
style.bottom = this.$fu.addUnit(this.closeBottom)
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
if (this.closeSize) {
|
|
75
|
-
style.fontSize = this.$fu.addUnit(this.closeSize)
|
|
76
|
-
}
|
|
77
|
-
if (this.closeColor) {
|
|
78
|
-
style.color = this.closeColor
|
|
79
|
-
}
|
|
80
|
-
return style
|
|
81
|
-
},
|
|
82
|
-
maskStyle() {
|
|
83
|
-
let style = {}
|
|
84
|
-
style.zIndex = this.zIndex ? this.zIndex - 1 : 10024 - 1
|
|
85
|
-
return style
|
|
86
|
-
}
|
|
87
|
-
},
|
|
88
|
-
methods: {
|
|
89
|
-
// 打开
|
|
90
|
-
open() {
|
|
91
|
-
this.show = true;
|
|
92
|
-
},
|
|
93
|
-
|
|
94
|
-
// 关闭
|
|
95
|
-
close() {
|
|
96
|
-
this.show = false;
|
|
97
|
-
this.$emit('close')
|
|
98
|
-
},
|
|
99
|
-
// 点击遮罩关闭
|
|
100
|
-
closeMask() {
|
|
101
|
-
if (!this.maskCloseable) return
|
|
102
|
-
this.close()
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
</script>
|
|
107
|
-
|
|
108
|
-
<style lang="scss" scoped>
|
|
109
|
-
.fu-landscape {
|
|
110
|
-
width: 100%;
|
|
111
|
-
overflow: hidden;
|
|
112
|
-
|
|
113
|
-
&__container {
|
|
114
|
-
max-width: 100%;
|
|
115
|
-
position: fixed;
|
|
116
|
-
display: inline-flex;
|
|
117
|
-
flex-direction: column;
|
|
118
|
-
align-items: center;
|
|
119
|
-
justify-content: center;
|
|
120
|
-
left: 50%;
|
|
121
|
-
top: 50%;
|
|
122
|
-
transform: translate(-50%, -50%);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
&__icon {
|
|
126
|
-
position: absolute;
|
|
127
|
-
text-align: center;
|
|
128
|
-
font-size: 50rpx;
|
|
129
|
-
color: #FFFFFF;
|
|
130
|
-
|
|
131
|
-
&--left-top {
|
|
132
|
-
top: -100rpx;
|
|
133
|
-
left: 20rpx;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
&--right-top {
|
|
137
|
-
top: -100rpx;
|
|
138
|
-
right: 20rpx;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
&--bottom {
|
|
142
|
-
left: 50%;
|
|
143
|
-
bottom: -100rpx;
|
|
144
|
-
transform: translateX(-50%);
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
&__mask {
|
|
149
|
-
position: fixed;
|
|
150
|
-
width: 100%;
|
|
151
|
-
height: 100%;
|
|
152
|
-
background-color: rgba(0, 0, 0, 0.5);
|
|
153
|
-
top: 0;
|
|
154
|
-
right: 0;
|
|
155
|
-
bottom: 0;
|
|
156
|
-
left: 0;
|
|
157
|
-
opacity: 0;
|
|
158
|
-
transform: scale3d(1, 1, 0);
|
|
159
|
-
transition: all 0.25s ease-in;
|
|
160
|
-
|
|
161
|
-
&--show {
|
|
162
|
-
opacity: 1 !important;
|
|
163
|
-
transform: scale3d(1, 1, 1);
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
</style>
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
props: {
|
|
3
|
-
// 显示关闭图标
|
|
4
|
-
closeBtn: {
|
|
5
|
-
type: Boolean,
|
|
6
|
-
default: true
|
|
7
|
-
},
|
|
8
|
-
// 关闭图标颜色
|
|
9
|
-
closeColor: {
|
|
10
|
-
type: String,
|
|
11
|
-
default: ''
|
|
12
|
-
},
|
|
13
|
-
// 关闭图标大小
|
|
14
|
-
closeSize: {
|
|
15
|
-
type: [Number,String],
|
|
16
|
-
default: 0
|
|
17
|
-
},
|
|
18
|
-
// 关闭图标位置
|
|
19
|
-
// leftTop -> 左上角 rightTop -> 右上角 bottom -> 底部
|
|
20
|
-
closePosition: {
|
|
21
|
-
type: String,
|
|
22
|
-
default: 'rightTop'
|
|
23
|
-
},
|
|
24
|
-
// 关闭图标top值
|
|
25
|
-
// 当关闭图标在leftTop或者rightTop时生效
|
|
26
|
-
closeTop: {
|
|
27
|
-
type: [Number,String],
|
|
28
|
-
default: 0
|
|
29
|
-
},
|
|
30
|
-
// 关闭图标right值
|
|
31
|
-
// 当关闭图标在RightTop时生效
|
|
32
|
-
closeRight: {
|
|
33
|
-
type: [Number,String],
|
|
34
|
-
default: 0
|
|
35
|
-
},
|
|
36
|
-
// 关闭图标bottom值
|
|
37
|
-
// 当关闭图标在bottom时生效
|
|
38
|
-
closeBottom: {
|
|
39
|
-
type: [Number,String],
|
|
40
|
-
default: 0
|
|
41
|
-
},
|
|
42
|
-
// 关闭图标left值
|
|
43
|
-
// 当关闭图标在leftTop时生效
|
|
44
|
-
closeLeft: {
|
|
45
|
-
type: [Number,String],
|
|
46
|
-
default: 0
|
|
47
|
-
},
|
|
48
|
-
// 显示遮罩
|
|
49
|
-
showMask: {
|
|
50
|
-
type: Boolean,
|
|
51
|
-
default: true
|
|
52
|
-
},
|
|
53
|
-
// 点击遮罩可以关闭
|
|
54
|
-
maskCloseable: {
|
|
55
|
-
type: Boolean,
|
|
56
|
-
default: true
|
|
57
|
-
},
|
|
58
|
-
// zIndex
|
|
59
|
-
zIndex: {
|
|
60
|
-
type: Number,
|
|
61
|
-
default: 0
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
@@ -1,333 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<view class="fu-tabbar" :class="customClass" :style="[tabbarStyle]" @touchmove.stop.prevent="() => {}">
|
|
3
|
-
<view class="fu-tabbar__wrapper" :class="{'fu-border-top': border}" :style="[tabbarWrapperStyle, {paddingBottom: `${safeAreaInsets}px`}]">
|
|
4
|
-
<view
|
|
5
|
-
class="fu-tabbar__wrapper__item"
|
|
6
|
-
:class="{'fu-tabbar__content__circle': midButton && item.midButton}"
|
|
7
|
-
:style="{ background: bgColor }"
|
|
8
|
-
@tap.stop="handleClick(index)"
|
|
9
|
-
v-for="(item,index) in list" :key="index">
|
|
10
|
-
<view :class="[midButton && item.midButton? 'fu-tabbar__content__circle__button': 'fu-tabbar__wrapper__item__button']">
|
|
11
|
-
<fu-image :width="iconSize" :height="iconSize" :src="getIconPath(index)" v-if="isImg(getIconPath(index))"></fu-image>
|
|
12
|
-
<fu-icons :name="getIconPath(index)" :size="midButton && item.midButton? midButtonSize: iconSize" :color="getColor(index)" v-else></fu-icons>
|
|
13
|
-
</view>
|
|
14
|
-
<view class="fu-tabbar__wrapper__item__text" :style="{color: getColor(index)}">
|
|
15
|
-
<text>{{ item[keyName] || '' }}</text>
|
|
16
|
-
</view>
|
|
17
|
-
</view>
|
|
18
|
-
<view class="fu-tabbar__wrapper__circle__border" :class="{'fu-order': border}" :style="{ background: bgColor, left: midButtonLeft}" v-if="midButton"></view>
|
|
19
|
-
</view>
|
|
20
|
-
|
|
21
|
-
<!-- 加上一个48rpx的高度,是为了增高有凸起按钮时防止塌陷的高度(即按钮凸出来部分的高度) -->
|
|
22
|
-
<!-- calc计算0时单位不一致会计算失败,所以这里+1px -->
|
|
23
|
-
<view class="fu-fixed-placeholder" :style="[tabbarPlaceholderStyle, {paddingBottom: `${safeAreaInsets}px`}]"></view>
|
|
24
|
-
</view>
|
|
25
|
-
</template>
|
|
26
|
-
|
|
27
|
-
<script>
|
|
28
|
-
import mpMixin from '../../libs/mixin/mpMixin.js'
|
|
29
|
-
import mixin from '../../libs/mixin/mixin.js'
|
|
30
|
-
import props from './props.js';
|
|
31
|
-
/**
|
|
32
|
-
* Tabbar 底部导航栏
|
|
33
|
-
* @description 此组件提供了自定义tabbar的能力
|
|
34
|
-
* @property {String,Number} v-model双向绑定当前激活项的值(默认 0)
|
|
35
|
-
* @property {Boolean} show 是否显示(默认 true)
|
|
36
|
-
* @property {Array} list 各项的配置参数
|
|
37
|
-
* @property {String,Number} zIndex 元素层级z-index(默认 1)
|
|
38
|
-
* @property {String,Number} height tabbar的高度,默认50px,单位任意,如果为数值,则为px单位
|
|
39
|
-
* @property {Boolean} midButton 是否显示中部的凸起按钮(默认false)
|
|
40
|
-
* @property {String} bgColor 整个tabbar的背景颜色(默认 #ffffff)
|
|
41
|
-
* @property {Boolean} border 是否显示上方边框(默认 true)
|
|
42
|
-
* @property {String} keyName 从list元素对象中读取的键名(默认 'text' )
|
|
43
|
-
* @property {Function} beforeSwitch 切换前回调,
|
|
44
|
-
* @property {String,Number} iconSize fusions内置图标或者绝对路径的图片 默认图片宽度(高度等比例缩放)
|
|
45
|
-
* @property {String} activeColor 文字和字体图标激活时的颜色
|
|
46
|
-
* @property {String} inactiveColor 文字和字体图标未激活时的颜色
|
|
47
|
-
* @property {Boolean} hideTabbar 是否隐藏原生tabbar(默认 false)
|
|
48
|
-
*/
|
|
49
|
-
export default {
|
|
50
|
-
name: 'FuTabbar',
|
|
51
|
-
emits: ['change', 'update:modelValue'],
|
|
52
|
-
mixins: [mpMixin, mixin, props],
|
|
53
|
-
data() {
|
|
54
|
-
return {
|
|
55
|
-
pageUrl: '', // 当前页面的URL
|
|
56
|
-
midButtonLeft: '50%', // 通过css居中凸起按钮的外层元素有误差,故通过js计算将其居中
|
|
57
|
-
safeAreaInsets: 0
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
|
-
mounted() {
|
|
61
|
-
// 是否隐藏原生tabBar
|
|
62
|
-
// 注意:如果当前页面不是tabbar页面,浏览器控制台报错: {errMsg: 'hideTabBar:fail not TabBar page'}
|
|
63
|
-
if(this.hideTabbar) uni.hideTabBar()
|
|
64
|
-
// 获取引入了fu-tabbar页面的路由地址,此地址没有路径前面的"/"
|
|
65
|
-
const pages = getCurrentPages();
|
|
66
|
-
// 页面栈中的最后一个即为当前页面, route属性为页面路径
|
|
67
|
-
this.pageUrl = pages[pages.length - 1].route;
|
|
68
|
-
if(this.midButton) this.getMidButtonLeft()
|
|
69
|
-
const fixSize = () => {
|
|
70
|
-
// #ifdef MP-WEIXIN
|
|
71
|
-
const { windowWidth, windowHeight, windowTop, safeArea, screenHeight, safeAreaInsets } = uni.getWindowInfo()
|
|
72
|
-
// #endif
|
|
73
|
-
// #ifndef MP-WEIXIN
|
|
74
|
-
const { windowWidth, windowHeight, windowTop, safeArea, screenHeight, safeAreaInsets } = uni.getSystemInfoSync()
|
|
75
|
-
// #endif
|
|
76
|
-
// 是否适配底部安全区 ,目前微信ios 、和 app ios 计算有差异,需要框架修复
|
|
77
|
-
if (safeArea) {
|
|
78
|
-
// #ifdef MP-WEIXIN
|
|
79
|
-
this.safeAreaInsets = screenHeight - safeArea.bottom
|
|
80
|
-
// #endif
|
|
81
|
-
// #ifndef MP-WEIXIN
|
|
82
|
-
this.safeAreaInsets = safeAreaInsets.bottom
|
|
83
|
-
// #endif
|
|
84
|
-
} else {
|
|
85
|
-
this.safeAreaInsets = 0
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
fixSize()
|
|
89
|
-
// #ifdef H5 && VUE2
|
|
90
|
-
window.addEventListener('resize', fixSize)
|
|
91
|
-
this.$once('hook:beforeDestroy', () => {
|
|
92
|
-
window.removeEventListener('resize', fixSize)
|
|
93
|
-
})
|
|
94
|
-
// #endif
|
|
95
|
-
},
|
|
96
|
-
computed: {
|
|
97
|
-
tabbarStyle() {
|
|
98
|
-
const style = {
|
|
99
|
-
zIndex: this.zIndex
|
|
100
|
-
};
|
|
101
|
-
// 合并来自父组件的customStyle样式
|
|
102
|
-
return uni.$fu.deepMerge(style, uni.$fu.addStyle(this.customStyle))
|
|
103
|
-
},
|
|
104
|
-
|
|
105
|
-
tabbarPlaceholderStyle() {
|
|
106
|
-
return {
|
|
107
|
-
height: `calc(${uni.$fu.addUnit(this.height)} + ${this.midButton? '48rpx': '1px'})`
|
|
108
|
-
}
|
|
109
|
-
},
|
|
110
|
-
|
|
111
|
-
tabbarWrapperStyle() {
|
|
112
|
-
return {
|
|
113
|
-
height: uni.$fu.addUnit(this.height), background: this.bgColor
|
|
114
|
-
}
|
|
115
|
-
},
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* 计算当前iten的icon路径
|
|
119
|
-
*/
|
|
120
|
-
getIconPath() {
|
|
121
|
-
return (index) => {
|
|
122
|
-
// 遍历fu-tabbar的每一项item时, 判断是否传入了pagePath属性
|
|
123
|
-
// 如果传入了和data中的pageUrl属性对比
|
|
124
|
-
// 如果相等, 即可判断当前的item对应当前的tabbar页面,设置高亮图标
|
|
125
|
-
// 采用这个方法,可以无需使用v-model绑定的value值
|
|
126
|
-
const pagePath = this.list[index]?.pagePath;
|
|
127
|
-
// 如果定义了pagePath属性,意味使用系统自带tabbar方案,是否则使用一个页面多个组件模拟tabbar页面的方案
|
|
128
|
-
// 这两个方案对处理tabbar中的item的激活与否方式不一样
|
|
129
|
-
if(pagePath) {
|
|
130
|
-
if(pagePath === this.pageUrl || pagePath === `/${this.pageUrl}`) {
|
|
131
|
-
return this.list[index].selectedIconPath;
|
|
132
|
-
} else {
|
|
133
|
-
return this.list[index].iconPath;
|
|
134
|
-
}
|
|
135
|
-
} else {
|
|
136
|
-
// 普通方案,索引等于v-model值时,即为激活项
|
|
137
|
-
return index == this.modelValue? this.list[index].selectedIconPath: this.list[index].iconPath;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
},
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* 计算当前item的颜色
|
|
144
|
-
*/
|
|
145
|
-
getColor() {
|
|
146
|
-
return (index) => {
|
|
147
|
-
// 判断方法同理于getIconPath
|
|
148
|
-
const pagePath = this.list[index]?.pagePath;
|
|
149
|
-
if(pagePath) {
|
|
150
|
-
if(pagePath === this.pageUrl || pagePath === `/${this.pageUrl}`) return this.activeColor
|
|
151
|
-
} else {
|
|
152
|
-
return index == this.modelValue? this.activeColor: this.inactiveColor
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
},
|
|
157
|
-
methods: {
|
|
158
|
-
/**
|
|
159
|
-
* 点击Tabbar Item
|
|
160
|
-
*/
|
|
161
|
-
async handleClick(index) {
|
|
162
|
-
if(this.beforeSwitch && typeof this.beforeSwitch === 'function') {
|
|
163
|
-
// 执行回调,同时传入索引当做参数
|
|
164
|
-
let beforeSwitchResult = this.beforeSwitch(index);
|
|
165
|
-
// 判断是否返回了Promise
|
|
166
|
-
if( typeof beforeSwitchResult === 'object' && beforeSwitchResult !== null && typeof beforeSwitchResult.then === 'function' ) {
|
|
167
|
-
await beforeSwitchResult.then(() => {
|
|
168
|
-
// Promise返回成功
|
|
169
|
-
this.switchTab(index)
|
|
170
|
-
}).catch(() => {})
|
|
171
|
-
} else if( beforeSwitchResult === true ) {
|
|
172
|
-
// 如果返true
|
|
173
|
-
this.switchTab(index);
|
|
174
|
-
}
|
|
175
|
-
} else {
|
|
176
|
-
this.switchTab(index);
|
|
177
|
-
}
|
|
178
|
-
},
|
|
179
|
-
|
|
180
|
-
/**
|
|
181
|
-
* 切换Tab
|
|
182
|
-
*/
|
|
183
|
-
switchTab(index) {
|
|
184
|
-
// 事件和修改v-model绑定的值
|
|
185
|
-
this.$emit('change', index);
|
|
186
|
-
// 如果有配置pagePath属性,使用uni.switchTab进行跳转
|
|
187
|
-
if(this.list[index]?.pagePath) {
|
|
188
|
-
uni.switchTab({
|
|
189
|
-
url: this.list[index].pagePath
|
|
190
|
-
})
|
|
191
|
-
} else {
|
|
192
|
-
// 如果配置了pagePath属性,将不会双向绑定v-model传入的value值
|
|
193
|
-
// 因为这个模式下, 不再需要v-model绑定的value值了,而是通过getCurrentPages()适配
|
|
194
|
-
this.$emit('update:modelValue', index)
|
|
195
|
-
}
|
|
196
|
-
},
|
|
197
|
-
|
|
198
|
-
/**
|
|
199
|
-
* 判断list元素对象中传入的iconPath和selectedIconPath属性,是否图片路径,只要带有"/"均认为图片形式
|
|
200
|
-
*/
|
|
201
|
-
isImg(str) {
|
|
202
|
-
return str.indexOf('/') !== -1
|
|
203
|
-
},
|
|
204
|
-
|
|
205
|
-
/**
|
|
206
|
-
* 获取凸出按钮外层元素的left值,让其水平居中
|
|
207
|
-
*/
|
|
208
|
-
getMidButtonLeft() {
|
|
209
|
-
const windowWidth = uni.$fu.sys().windowWidth;
|
|
210
|
-
// 由于安卓中css计算left: 50%的结果有误差,故此js计算
|
|
211
|
-
this.midButtonLeft = `${windowWidth / 2}px`;
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
</script>
|
|
216
|
-
|
|
217
|
-
<style lang="scss" scoped>
|
|
218
|
-
@import '../../libs/css/component.scss';
|
|
219
|
-
|
|
220
|
-
.fu-fixed-placeholder {
|
|
221
|
-
/* #ifndef APP-NVUE */
|
|
222
|
-
box-sizing: content-box;
|
|
223
|
-
/* #endif */
|
|
224
|
-
height: 50px;
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
.fu-tabbar {
|
|
228
|
-
|
|
229
|
-
&__wrapper {
|
|
230
|
-
@include flex;
|
|
231
|
-
align-items: center;
|
|
232
|
-
position: relative;
|
|
233
|
-
position: fixed;
|
|
234
|
-
bottom: 0;
|
|
235
|
-
left: 0;
|
|
236
|
-
width: 100%;
|
|
237
|
-
z-index: 998;
|
|
238
|
-
/* #ifndef APP-NVUE */
|
|
239
|
-
box-sizing: content-box;
|
|
240
|
-
/* #endif */
|
|
241
|
-
|
|
242
|
-
&__circle__border {
|
|
243
|
-
border-radius: 100%;
|
|
244
|
-
width: 55px;
|
|
245
|
-
height: 55px;
|
|
246
|
-
top: -24px;
|
|
247
|
-
position: absolute;
|
|
248
|
-
z-index: 4;
|
|
249
|
-
background-color: #ffffff;
|
|
250
|
-
// 由于安卓的无能,导致只有3个tabbar item时,此css计算方式有误差
|
|
251
|
-
// 故使用js计算的形式来定位,此处不注释,是因为js计算有延后,避免出现位置闪动
|
|
252
|
-
left: 50%;
|
|
253
|
-
transform: translateX(-50%);
|
|
254
|
-
&:after {
|
|
255
|
-
border-radius: 100px;
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
&__item {
|
|
260
|
-
flex: 1;
|
|
261
|
-
@include flex;
|
|
262
|
-
justify-content: center;
|
|
263
|
-
flex-direction: column;
|
|
264
|
-
align-items: center;
|
|
265
|
-
position: relative;
|
|
266
|
-
height: 100%;
|
|
267
|
-
|
|
268
|
-
&__button {
|
|
269
|
-
position: absolute;
|
|
270
|
-
top: 3px;
|
|
271
|
-
left: 50%;
|
|
272
|
-
transform: translateX(-50%);
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
&__text {
|
|
276
|
-
color: #999999;
|
|
277
|
-
font-size: 10px;
|
|
278
|
-
line-height: normal;
|
|
279
|
-
position: absolute;
|
|
280
|
-
bottom: 3px;
|
|
281
|
-
left: 50%;
|
|
282
|
-
transform: translateX(-50%);
|
|
283
|
-
width: 100%;
|
|
284
|
-
text-align: center;
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
&__circle {
|
|
289
|
-
@include flex;
|
|
290
|
-
flex-direction: column;
|
|
291
|
-
justify-content: space-between;
|
|
292
|
-
position: relative;
|
|
293
|
-
z-index: 10;
|
|
294
|
-
/* #ifndef APP-NVUE */
|
|
295
|
-
height: calc(100% - 1px);
|
|
296
|
-
/* #endif */
|
|
297
|
-
&__button {
|
|
298
|
-
@include flex;
|
|
299
|
-
width: 45px;
|
|
300
|
-
height: 45px;
|
|
301
|
-
border-radius: 100%;
|
|
302
|
-
justify-content: center;
|
|
303
|
-
align-items: center;
|
|
304
|
-
position: absolute;
|
|
305
|
-
background-color: #ffffff;
|
|
306
|
-
top: -20px;
|
|
307
|
-
left: 50%;
|
|
308
|
-
z-index: 6;
|
|
309
|
-
transform: translateX(-50%);
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
.fu-border-top {
|
|
316
|
-
border-top-width: 1px;
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
.fu-border-top::after {
|
|
320
|
-
content: " ";
|
|
321
|
-
position: absolute;
|
|
322
|
-
left: 0;
|
|
323
|
-
top: 0;
|
|
324
|
-
pointer-events: none;
|
|
325
|
-
box-sizing: border-box;
|
|
326
|
-
transform-origin: 0 0;
|
|
327
|
-
width: 199.8%;
|
|
328
|
-
height: 199.7%;
|
|
329
|
-
transform: scale(0.5);
|
|
330
|
-
border: 0 solid rgba(0, 0, 0, 0.33);
|
|
331
|
-
z-index: 2;
|
|
332
|
-
}
|
|
333
|
-
</style>
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
props: {
|
|
3
|
-
// v-model双向绑定当前激活项的值
|
|
4
|
-
modelValue: {
|
|
5
|
-
type: [String,Number],
|
|
6
|
-
default: 0
|
|
7
|
-
},
|
|
8
|
-
// 是否显示(默认 true)
|
|
9
|
-
show: {
|
|
10
|
-
type: Boolean,
|
|
11
|
-
default: true
|
|
12
|
-
},
|
|
13
|
-
list: {
|
|
14
|
-
type: Array,
|
|
15
|
-
default: () => []
|
|
16
|
-
},
|
|
17
|
-
// 元素层级z-index(默认 1)
|
|
18
|
-
zIndex: {
|
|
19
|
-
type: [String,Number],
|
|
20
|
-
default: 1
|
|
21
|
-
},
|
|
22
|
-
// tabbar的高度,默认50px,单位任意,如果为数值,则为px单位
|
|
23
|
-
height: {
|
|
24
|
-
type: [String,Number],
|
|
25
|
-
default: 50
|
|
26
|
-
},
|
|
27
|
-
// 是否显示中部的凸起按钮(默认false)
|
|
28
|
-
midButton: {
|
|
29
|
-
type: Boolean,
|
|
30
|
-
default: false
|
|
31
|
-
},
|
|
32
|
-
// 凸起的图标的大小
|
|
33
|
-
midButtonSize: {
|
|
34
|
-
type: [String,Number],
|
|
35
|
-
default: 45
|
|
36
|
-
},
|
|
37
|
-
// 整个tabbar的背景颜色(默认 #ffffff)
|
|
38
|
-
bgColor: {
|
|
39
|
-
type: String,
|
|
40
|
-
default: '#ffffff'
|
|
41
|
-
},
|
|
42
|
-
// 是否显示上方边框(默认 true)
|
|
43
|
-
border: {
|
|
44
|
-
type: Boolean,
|
|
45
|
-
default: true
|
|
46
|
-
},
|
|
47
|
-
// 从list元素对象中读取的键名(默认 'text' )
|
|
48
|
-
keyName: {
|
|
49
|
-
type: String,
|
|
50
|
-
default: 'text'
|
|
51
|
-
},
|
|
52
|
-
// 切换前回调
|
|
53
|
-
beforeSwitch: {
|
|
54
|
-
type: Function,
|
|
55
|
-
default: null
|
|
56
|
-
},
|
|
57
|
-
// fusions内置图标或者绝对路径的图片 默认图片宽度(高度等比例缩放)
|
|
58
|
-
iconSize: {
|
|
59
|
-
type: [String,Number],
|
|
60
|
-
default: 24
|
|
61
|
-
},
|
|
62
|
-
// 文字和字体图标激活时的颜色
|
|
63
|
-
activeColor: {
|
|
64
|
-
type: String,
|
|
65
|
-
default: ''
|
|
66
|
-
},
|
|
67
|
-
// 文字和字体图标未激活时的颜色
|
|
68
|
-
inactiveColor: {
|
|
69
|
-
type: String,
|
|
70
|
-
default: ''
|
|
71
|
-
},
|
|
72
|
-
// 是否隐藏原生tabbar(默认 false)
|
|
73
|
-
hideTabbar: {
|
|
74
|
-
type: Boolean,
|
|
75
|
-
default: false
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
package/libs/css/style.h5.scss
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/* H5的时候,隐藏滚动条 */
|
|
2
|
-
::-webkit-scrollbar {
|
|
3
|
-
display: none;
|
|
4
|
-
width: 0 !important;
|
|
5
|
-
height: 0 !important;
|
|
6
|
-
-webkit-appearance: none;
|
|
7
|
-
background: transparent;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
/* 双标签 start*/
|
|
11
|
-
.capsule {
|
|
12
|
-
display: inline-flex;
|
|
13
|
-
vertical-align: middle;
|
|
14
|
-
width: 20%;
|
|
15
|
-
min-width: 136rpx;
|
|
16
|
-
height: 45rpx;
|
|
17
|
-
|
|
18
|
-
.capsule-tag {
|
|
19
|
-
margin: 0;
|
|
20
|
-
|
|
21
|
-
&:first-child {
|
|
22
|
-
border-top-right-radius: 0rpx;
|
|
23
|
-
border-bottom-right-radius: 0rpx;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
&:last-child {
|
|
27
|
-
|
|
28
|
-
&::after {
|
|
29
|
-
border-top-left-radius: 0rpx;
|
|
30
|
-
border-bottom-left-radius: 0rpx;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
/* 双标签 end*/
|