hookehuyr

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

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