feat:基座页面
This commit is contained in:
1 parent
36a8665bae
commit
4b1e41b550
6 files changed
+86
-17
No files matched your search
@@ -39,16 +39,30 @@ const isTabbar = computed(() => {
|
||||
return router.hasTabbar()
|
||||
})
|
||||
|
||||
const isDashboard = computed(() => {
|
||||
const pages = getCurrentPages()
|
||||
const currentPage = pages[pages.length - 1]
|
||||
if (!currentPage) {
|
||||
return true
|
||||
}
|
||||
return currentPage.route != "pages/root/dashboard"
|
||||
})
|
||||
|
||||
function doBackClick() {
|
||||
router.back()
|
||||
}
|
||||
|
||||
function doToDashboard() {
|
||||
router.jump("/pages/root/dashboard", {}, 3)
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<view class="navbar" :style="{ backgroundColor: bgColor, height: '44px' }">
|
||||
<view class="navbar_left" v-if="showLeft && !isTabbar" @tap="doBackClick">
|
||||
<text class="sicon-back icon" v-if="isHistiry" />
|
||||
<text class="sicon-home icon" v-else />
|
||||
<view class="navbar_left">
|
||||
<view class="sicon-back icon" @tap="doBackClick" />
|
||||
<view v-if="isDashboard" class="navbar_left_line" />
|
||||
<view v-if="isDashboard" class="sicon-home icon" @tap="doToDashboard" />
|
||||
</view>
|
||||
<view class="navbar_title" :style="{ color: titleColor }">{{ props.title }}</view>
|
||||
<view v-if="props.rightIcon" class="navbar_right" @tap="emit('rightClick')">
|
||||
@@ -68,14 +82,25 @@ function doBackClick() {
|
||||
&_left {
|
||||
position: absolute;
|
||||
left: 20rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 56rpx;
|
||||
border-radius: 28rpx;
|
||||
background: #fff;
|
||||
box-shadow: 0px 0px 4rpx rgba(51, 51, 51, 0.08), 0px 4rpx 6rpx 2rpx rgba(102, 102, 102, 0.12);
|
||||
border-radius: 28rpx;
|
||||
width: 56rpx;
|
||||
height: 56rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
&_line {
|
||||
width: 1rpx;
|
||||
height: 25rpx;
|
||||
background: #999;
|
||||
}
|
||||
|
||||
&>.icon {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 56rpx;
|
||||
}
|
||||
}
|
||||
|
||||
&_right {
|
||||
|
||||
Reference in new issue
Block a user