router.js 573 Bytes
import {stringify} from '../../../vendors/query-string';

const route = {
  index: '/pages/zeroSell/index',
  myList: '/pages/zeroSell/myList',
  detail: '/pages/zeroSell/detail',
  snapShare: '/pages/zeroSell/snapshootShare',
  webview: '/pages/zeroSell/h5Page',
  bindPhoneNumber: '/pages/bindPhoneNumber/bindPhoneNumber'
};

function jumpFn(name, qs) {
  let path = '';

  if (name in route) {
    path = route[name];
  } else {
    path = name;
  }

  let params = {
    url: `${path}?${stringify(qs)}`
  };

  wx.navigateTo(params);
}

export default {
  go: jumpFn
};