This commit is contained in:
杨鹏
2025-09-09 22:07:09 +08:00
parent 4e5d687c18
commit 1a1bbec15c
9 changed files with 404 additions and 9 deletions
+7 -2
View File
@@ -14,6 +14,7 @@
:opacityBgUi="opacityBgUi"
@search="(e) => emits('search', e)"
:defaultSearch="defaultSearch"
:leftIcon="leftIcon"
/>
<!-- 顶部导航栏-情况2装修组件导航栏-标准 -->
@@ -135,6 +136,10 @@
type: Boolean,
default: false,
},
leftIcon: {
type: String,
default: 'left',
},
});
const emits = defineEmits(['search']);
@@ -213,11 +218,11 @@
// #endif
// 组件中使用 onMounted 监听页面加载,不是页面组件不使用 onShow
onMounted(()=>{
onMounted(() => {
if (!isEmpty(shareInfo.value)) {
sheep.$platform.share.updateShareInfo(shareInfo.value);
}
})
});
</script>
<style lang="scss" scoped>
+34
View File
@@ -195,6 +195,40 @@ const adaptTemplate = async (appTemplate, templateId) => {
// appTemplate.basic.tabbar.badgeStyle = {
// backgroundColor: '#882222',
// }
appTemplate.basic.tabbar.items = [
{
activeIconUrl: "https://3d.aidigitalfield.com/imgs/home.png",
iconUrl: "https://3d.aidigitalfield.com/imgs/home.png",
text: "首页",
url: "/pages/index/index",
},
{
activeIconUrl: "https://3d.aidigitalfield.com/imgs/list.png",
iconUrl: "https://3d.aidigitalfield.com/imgs/list.png",
text: "商品列表",
url: "/pages/index/list",
},
{
activeIconUrl: "https://3d.aidigitalfield.com/imgs/room.png",
iconUrl: "https://3d.aidigitalfield.com/imgs/room.png",
text: "试衣间",
url: "/pages/index/room",
},
{
activeIconUrl: "https://3d.aidigitalfield.com/imgs/chat.png",
iconUrl: "https://3d.aidigitalfield.com/imgs/chat.png",
text: "聊天",
url: "/pages/index/chat",
},
{
activeIconUrl: "https://3d.aidigitalfield.com/imgs/my.png",
iconUrl: "https://3d.aidigitalfield.com/imgs/my.png",
text: "我的",
url: "/pages/index/user",
},
];
if (tabBar?.theme) {
appTemplate.basic.theme = tabBar?.theme;
}
+2 -2
View File
@@ -212,8 +212,8 @@
});
const searchModel = computed(() => {
return props.defaultSearch
})
return props.defaultSearch;
});
const themeBgColor = computed(() => {
if (props.dark) {
+2 -1
View File
@@ -89,7 +89,8 @@
const titleStyle = computed(() => uiTabProvide?.props?.titleStyle);
const computedQuery = () => {
uni.createSelectorQuery()
uni
.createSelectorQuery()
.in(vm)
.select('#tab-' + props.index)
.boundingClientRect((data) => {
+17 -4
View File
@@ -24,9 +24,22 @@
<slot v-else name="inactive-icon" />
</block>
</uni-badge>
</view>
<slot name="text">
<!-- 选中的当前tabbar加上下横线 -->
<view
:style="{
width: '20rpx',
height: '1rpx',
background: '#000',
position: 'absolute',
left: 'calc(50% - 10rpx)',
bottom: '-5rpx',
display: isActive ? 'inline-block' : 'none',
}"
/>
</view>
<!-- 底部tabbar不要文字 -->
<!-- <slot name="text">
<text
class="u-tabbar-item__text"
:style="{
@@ -35,7 +48,7 @@
>
{{ text }}
</text>
</slot>
</slot> -->
</template>
</view>
</template>
@@ -104,7 +117,7 @@
// 控制徽标的位置,对象或者字符串形式,可以设置top和right属性
badgeStyle: {
type: Object,
default: ()=>{},
default: () => {},
},
isCenter: {
type: Boolean,