hookehuyr

fix(页面路由): 修复从我的车辆进入编辑页面的导航标题显示问题

在从我的车辆页面进入编辑页面时,添加type参数并处理导航栏标题显示
......@@ -155,7 +155,7 @@ const goToSell = () => {
*/
const editCar = (carId) => {
Taro.navigateTo({
url: `/pages/sell/index?id=${carId}&mode=edit`
url: `/pages/sell/index?id=${carId}&mode=edit&type=myCar`
})
}
......
......@@ -3,7 +3,7 @@
<!-- 顶部导航 -->
<nut-config-provider :theme-vars="themeVars">
<nut-sticky top="0">
<nut-navbar v-if="!isAuthMode" :title="isEditMode ? '编辑车源' : '发布车源'" left-show @on-click-back="goBack">
<nut-navbar v-if="!isAuthMode && !isMyCarMode" :title="isEditMode ? '编辑车源' : '发布车源'" left-show @on-click-back="goBack">
<template #left-show>
<RectLeft color="white" />
</template>
......@@ -320,6 +320,7 @@ const instance = Taro.getCurrentInstance()
const { id, mode, type } = instance.router?.params || {}
const isEditMode = ref(mode === 'edit' && id)
const isAuthMode = ref(type === 'auth' && id)
const isMyCarMode = ref(type === 'myCar' && id)
const carId = ref(id || '')
// 文件上传相关
......@@ -855,5 +856,10 @@ onMounted(() => {
title: '发布车源'
});
}
if (isMyCarMode.value) {
wx.setNavigationBarTitle({
title: '编辑车源'
});
}
})
</script>
......