export default function jumpToUrl(url) {
  if (!url) return;

  if (/^https?:\/\//i.test(url)) {
    uni.navigateTo({
      url: `/pages/webview/webview?url=${encodeURIComponent(url)}`,
    });
    return;
  }

  if (/^\/pages\/(index|activity|my)\/index/.test(url)) {
    uni.switchTab({ url });
    return;
  }

  console.log("switch");
  uni.navigateTo({
    url,
  });
}
