cashier_wx/utils/uniapp.js

16 lines
298 B
JavaScript

export const back=()=>{
console.log('back');
try {
const arr= getCurrentPages()
if(arr.length>=2){
return uni.navigateBack()
}else{
uni.reLaunch({
url:'/pages/index/index'
})
}
} catch (error) {
console.error('页面返回出错',error)
//TODO handle the exception
}
}