goback兜底处理

This commit is contained in:
aihe 2024-08-07 17:52:10 +08:00
parent 49a953aee9
commit 5e520734eb
2 changed files with 8 additions and 3 deletions

View File

@ -33,7 +33,12 @@ const goto = (url, type = 1)=> {
}
const goBack = (opt = {})=> {
uni.navigateBack(opt)
uni.navigateBack({
fail: ()=>{
goto(opt._finalUrl || `tabBar/sending/sending`, 1)
},
...opt,
})
}
const reLaunch = (opt = {})=> {

View File

@ -303,7 +303,7 @@
// 初始化默认model
await initDefaultModel(this.submitParam)
this.queryOption.billCode = this.queryOption.billCode || this.queryOption.copyBillCode
this.curPageType = this.pageTypeMap[this.queryOption.type || pageTypeEnum.create]
this.curPageType = this.pageTypeMap[this.queryOption.type] || this.pageTypeMap[pageTypeEnum.create]
this.setNavigationBarTitle(this.curPageType.title)
this.isEdit = Boolean(this.queryOption.billCode || this.queryOption.orderSn)
if(this.queryOption.defaultSubParams) {
@ -409,7 +409,7 @@
// 刷新当前页面状态
this.reloadCurrentPage(this)
} else {
this.goBack()
this.goBack({_finalUrl: 'tabBar/search/search'})
}
} else {
this.showToast('操作成功')