已优化

This commit is contained in:
2022-04-18 13:35:41 +08:00
committed by li tong bao
parent eadb8b1e61
commit 5acf8dbd21
9 changed files with 92 additions and 44 deletions
+21 -4
View File
@@ -1,8 +1,25 @@
import Taro from "@tarojs/taro"
import Qs from 'qs'
export const goLink = (path?:string, params?:Object) => {
Taro.navigateTo({
url: '/pages/search/index'
})
/**
* 跳转
* @param path
* @param params
* @param type false 跳转普通页面,true 跳转tabbar页面
*/
export const goLink = (path = '', params = {}, type:false|true = false) => {
if(path) {
let params_str = Qs.stringify(params)
path = params_str?path+'?'+params_str:path
if(!type) {
Taro.navigateTo({
url: path
})
} else {
Taro.switchTab({
url: path
})
}
}
}