diff --git a/common/mixin.js b/common/mixin.js index f7303db..0a87aa9 100644 --- a/common/mixin.js +++ b/common/mixin.js @@ -70,18 +70,19 @@ export default{ }); }, $url(url, options = {}){ - // TODO 判断登录逻辑;防抖 - if(options.type && options.type !== ''){ - if(options.type === 'redirect'){ // 关闭当前,跳转 - uni.redirectTo({ url }) - }else if(options.type === 'switch'){ // 跳转 - uni.switchTab({ url }) - }else if(options.type === 'launch'){ // 关闭所有,跳转 - uni.reLaunch({ url }) + this.$u.throttle(() => { + if(options.type && options.type !== ''){ + if(options.type === 'redirect'){ // 关闭当前,跳转 + uni.redirectTo({ url }) + }else if(options.type === 'switch'){ // 跳转 + uni.switchTab({ url }) + }else if(options.type === 'launch'){ // 关闭所有,跳转 + uni.reLaunch({ url }) + } + }else{ + uni.navigateTo({ url }) // 跳转 } - }else{ - uni.navigateTo({ url }) // 跳转 - } + }, 100); }, $toBack(){ let pages = getCurrentPages(); // 当前页