已优化

This commit is contained in:
2022-04-14 14:34:55 +08:00
parent 9350978491
commit 8e5e73909d
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
})
}
}
}