自定义navbar返回到主页或者返回到上一页,安卓手机手势返回需要返回两次,苹果无异常?
这是商品详情页 左边有一个back图标,根据是否回到主页判断使用switchTab还是navigateBack
<uv-navbar :safeAreaInsetTop="true">
<template v-slot:left>
<view class="uv-nav-slot">
<view @click="navigateBack" >
<image class="home-back-icon" src="@/static/common/detail-back.png"></image>
</view>
<view @click="navigateToHome" class="home-back-text" >首页</view>
<view class="bar-line"></view>
<view class="home-back-text">{{ detailContent.PrimaryCatName }}</view>
</view>
</template>
</uv-navbar>
这个是配置的页面tabBar路由
"tabBar": {
"color": "#555555",
"selectedColor": "#46C663",
"borderStyle": "black",
"backgroundColor": "#ffffff",
"list": [
{
"pagePath": "pages/home/index",
"iconPath": "static/icon/tab_bar_icon_home.png",
"selectedIconPath": "static/icon/tab_bar_icon_Home_selected.png",
"text": "首页"
},
{
"pagePath": "pages/tool",
"iconPath": "static/icon/tab_bar_icon_gongju.png",
"selectedIconPath": "static/icon/tab_bar_icon_gongju_selected.png",
"text": "工具"
},
{
"pagePath": "pages/activityEntry",
"iconPath": "static/icon/tab_bar_icon_huodong.png",
"selectedIconPath": "static/icon/tab_bar_icon_huodong_selected.png",
"text": "活动"
},
{
"pagePath": "pages/userCenter",
"iconPath": "static/icon/tab_bar_icon_wode.png",
"selectedIconPath": "static/icon/tab_bar_icon_my_selected.png",
"text": "我的"
}
]