router.js 552 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'
};

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

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

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

  console.log(`page => ${params.url}`);
  wx.navigateTo(params);
}

export default {
  go: jumpFn
};