mirror of
http://36.133.248.69:3088/admin/RentWeAppFront.git
synced 2026-03-07 17:32:25 +08:00
完成大体功能和样式
This commit is contained in:
@@ -12,20 +12,18 @@
|
||||
<view class="nav-content">
|
||||
<!-- 左侧返回 -->
|
||||
<view class="nav-left">
|
||||
<u-icon
|
||||
name="arrow-left"
|
||||
size="44"
|
||||
:color="textColor"
|
||||
@click="onBack"
|
||||
v-if="showBack"
|
||||
></u-icon>
|
||||
<u-icon
|
||||
name="home"
|
||||
size="44"
|
||||
:color="textColor"
|
||||
@click="goHome"
|
||||
v-if="showHome"
|
||||
></u-icon>
|
||||
<view class="icon-btn" @click="onBack" v-if="showBack">
|
||||
<u-icon
|
||||
name="arrow-left"
|
||||
size="44"
|
||||
:color="textColor"
|
||||
|
||||
></u-icon>
|
||||
</view>
|
||||
|
||||
<view class="icon-btn" @click="goHome" v-if="showHome" :style="{marginLeft: 10 + 'rpx'}">
|
||||
<u-icon name="home" size="44" :color="textColor" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 中间标题 -->
|
||||
@@ -106,7 +104,7 @@ export default {
|
||||
},
|
||||
showHome: {
|
||||
type: Boolean,
|
||||
default: false // 回首页按钮默认不显示
|
||||
default: true // 回首页按钮默认不显示
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@@ -155,15 +153,18 @@ export default {
|
||||
},
|
||||
|
||||
onBack() {
|
||||
if (this.back) {
|
||||
this.back();
|
||||
} else {
|
||||
const pages = getCurrentPages();
|
||||
if (pages.length > 1) {
|
||||
uni.navigateBack();
|
||||
} else {
|
||||
uni.switchTab({
|
||||
url:'/pages/index/index'
|
||||
})
|
||||
}
|
||||
},
|
||||
goHome(){
|
||||
uni.reLaunch({
|
||||
url:'../index/index'
|
||||
uni.switchTab({
|
||||
url:'/pages/index/index'
|
||||
})
|
||||
},
|
||||
onExtraIconClick(index) {
|
||||
@@ -186,30 +187,41 @@ export default {
|
||||
.nav-content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
position: relative;
|
||||
height: 100%;
|
||||
padding: 0 24rpx;
|
||||
}
|
||||
|
||||
.nav-left {
|
||||
width: 50rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.nav-title {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.nav-right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.nav-btn {
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
}
|
||||
.nav-left{
|
||||
width: 120rpx;
|
||||
}
|
||||
.nav-left,
|
||||
.nav-right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
z-index: 2;
|
||||
}
|
||||
.nav-title {
|
||||
pointer-events: none;
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
max-width: 60%;
|
||||
text-align: center;
|
||||
font-size: 32rpx;
|
||||
font-weight: 500;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
z-index: 1;
|
||||
}
|
||||
// .nav-right {
|
||||
// display: flex;
|
||||
// align-items: center;
|
||||
// .nav-btn {
|
||||
// margin-left: 20rpx;
|
||||
// }
|
||||
// }
|
||||
|
||||
// 透明状态样式
|
||||
&.transparent {
|
||||
|
||||
@@ -87,11 +87,14 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
onBack() {
|
||||
if (this.back) {
|
||||
this.back();
|
||||
} else {
|
||||
uni.navigateBack();
|
||||
}
|
||||
const pages = getCurrentPages();
|
||||
if (pages > 1) {
|
||||
uni.navigateBack();
|
||||
} else {
|
||||
uni.switchTab({
|
||||
url:'/pages/index/index'
|
||||
})
|
||||
}
|
||||
},
|
||||
goHome(){
|
||||
uni.reLaunch({
|
||||
|
||||
Reference in New Issue
Block a user