uview-plus组件库全面升级更新,订单结算判断支付方式是否可用代码调整,公众号关注二维码修改
This commit is contained in:
@@ -7,7 +7,7 @@ export const props = defineMixin({
|
||||
type: [String, Number, null],
|
||||
default: () => defProps.tabbarItem.name
|
||||
},
|
||||
// uView内置图标或者绝对路径的图片
|
||||
// uview-plus内置图标或者绝对路径的图片
|
||||
icon: {
|
||||
icon: String,
|
||||
default: () => defProps.tabbarItem.icon
|
||||
@@ -31,7 +31,11 @@ export const props = defineMixin({
|
||||
badgeStyle: {
|
||||
type: [Object, String],
|
||||
default: () => defProps.tabbarItem.badgeStyle
|
||||
},
|
||||
// 模式,默认普通模式,midButton中间按钮模式
|
||||
mode: {
|
||||
type: String,
|
||||
default: () => defProps.tabbarItem.mode
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
@@ -15,6 +15,7 @@ export default {
|
||||
badge: null,
|
||||
dot: false,
|
||||
text: '',
|
||||
badgeStyle: 'top: 6px;right:2px;'
|
||||
badgeStyle: 'top: 6px;right:2px;',
|
||||
mode: ''
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,15 +2,21 @@
|
||||
<view
|
||||
class="u-tabbar-item"
|
||||
:style="[addStyle(customStyle)]"
|
||||
:class="[isMidButton ? 'u-tabbar-item--mid-button' : '']"
|
||||
@tap="clickHandler"
|
||||
>
|
||||
<view class="u-tabbar-item__icon">
|
||||
<u-icon
|
||||
<view
|
||||
class="u-tabbar-item__icon"
|
||||
:class="[isMidButton ? 'u-tabbar-item__icon--mid-button' : '']"
|
||||
>
|
||||
<view class="u-tabbar-item--mid-button-cover" v-if="isMidButton">
|
||||
</view>
|
||||
<up-icon
|
||||
v-if="icon"
|
||||
:name="icon"
|
||||
:color="isActive? parentData.activeColor : parentData.inactiveColor"
|
||||
:size="20"
|
||||
></u-icon>
|
||||
:size="isMidButton ? 26 : 20"
|
||||
></up-icon>
|
||||
<template v-else>
|
||||
<slot
|
||||
v-if="isActive"
|
||||
@@ -78,6 +84,12 @@
|
||||
options: {
|
||||
virtualHost: true //将自定义节点设置成虚拟的,更加接近Vue组件的表现。我们不希望自定义组件的这个节点本身可以设置样式、响应 flex 布局等
|
||||
},
|
||||
computed: {
|
||||
// 计算是否为中间按钮
|
||||
isMidButton() {
|
||||
return this.mode === 'midButton';
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.init()
|
||||
},
|
||||
@@ -88,7 +100,7 @@
|
||||
// 支付宝小程序不支持provide/inject,所以使用这个方法获取整个父组件,在created定义,避免循环引用
|
||||
this.updateParentData()
|
||||
if (!this.parent) {
|
||||
error('u-tabbar-item必须搭配u-tabbar组件使用')
|
||||
error('up-tabbar-item必须搭配up-tabbar组件使用')
|
||||
}
|
||||
// 本子组件在u-tabbar的children数组中的索引
|
||||
const index = this.parent.children.indexOf(this)
|
||||
@@ -120,7 +132,6 @@
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import "../../libs/css/components.scss";
|
||||
.u-tabbar-item {
|
||||
@include flex(column);
|
||||
align-items: center;
|
||||
@@ -147,6 +158,34 @@
|
||||
color: $u-content-color;
|
||||
}
|
||||
}
|
||||
|
||||
// 中间按钮样式
|
||||
.u-tabbar-item--mid-button {
|
||||
/* #ifndef APP-NVUE */
|
||||
transform: translateY(-10px);
|
||||
/* #endif */
|
||||
}
|
||||
|
||||
.u-tabbar-item--mid-button-cover {
|
||||
background-color: #fff;
|
||||
position: absolute;
|
||||
top: 22px;
|
||||
left: -10px;
|
||||
// right: -10px;
|
||||
width: 90px;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.u-tabbar-item__icon--mid-button {
|
||||
width: 70px;
|
||||
height: 70px;
|
||||
border-radius: 100px;
|
||||
background-color: #ffffff;
|
||||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
/* #ifdef MP */
|
||||
// 由于小程序都使用shadow DOM形式实现,需要给影子宿主设置flex: 1才能让其撑开
|
||||
@@ -155,4 +194,4 @@
|
||||
width: 100%;
|
||||
}
|
||||
/* #endif */
|
||||
</style>
|
||||
</style>
|
||||
Reference in New Issue
Block a user