jump.js 497 Bytes
import wx from '../utils/wx';
import {stringify} from '../vendors/query-string';

export default {
  navigateTo(path, qs) {
    return wx.navigateTo({ url: `${path}?${stringify(qs)}` });
  },
  redirectTo(path, qs) {
    return wx.redirectTo({ url: `${path}?${stringify(qs)}` });
  },
  switchTab(path) {
    return wx.switchTab({ url: path });
  },
  navigateToMiniProgram(appId, path, qs) {
    return wx.navigateToMiniProgram({
      appId,
      path: `${path}?${stringify(qs)}`,
    })
  }
};