appletsNav.js 709 B

1234567891011121314151617181920212223
  1. import { methods, Global } from '../helpers/config';
  2. import { formatURLQuery } from '../helpers/util';
  3. /**
  4. * @param {Object} finalRoute 格式化后的路由跳转规则
  5. * @param {Object} NAVTYPE 需要调用的跳转方法
  6. */
  7. const appletsUniPushTo = function (finalRoute, NAVTYPE) {
  8. return new Promise((resolve) => {
  9. const query = formatURLQuery(`?${finalRoute.uniRoute.query}`);
  10. const { url } = finalRoute.uniRoute;
  11. uni[methods[NAVTYPE]]({
  12. url: url + query,
  13. complete: () => {
  14. resolve(url);
  15. Global.LockStatus = false; // 跳转完成解锁状态
  16. },
  17. });
  18. });
  19. };
  20. export default appletsUniPushTo;