You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
2.9 KiB
2 lines
2.9 KiB
"use strict";const a=require("../../common/vendor.js"),d=require("../store/index.js"),u=require("../hooks/useModal.js"),m=require("../helper/throttle.js"),x=(e,t={},r={redirect:!1})=>{var n;let p="",s="",o="";if(a.lodashExports.isString(e)){if(a.lodashExports.startsWith(e,"http"))p="/pages/public/webview",s=`url=${encodeURIComponent(e)}`;else if(a.lodashExports.startsWith(e,"action:")){k(e);return}else[p,s]=e.split("?");if(!a.lodashExports.isEmpty(t)){let g=h(t);a.lodashExports.isEmpty(s)?s=g:s+="&"+g}}a.lodashExports.isObject(e)&&(p=e.url,a.lodashExports.isNil(e.params)||(s=h(e.params)));const i={"/pages/subpackages/mapnvue":{path:"/pages/subpackages/mapnvue",aliasPath:"/"},"/pages/subpackages/login":{path:"/pages/subpackages/login"},"/pages/subpackages/my":{path:"/pages/subpackages/my"},"/pages/public/richtext":{path:"/pages/public/richtext"},"/pages/pay/recharge":{path:"/pages/pay/recharge"},"/pages/pay/index":{path:"/pages/pay/index"},"/pages/pay/result":{path:"/pages/pay/result"},"/pages/index/authentication":{path:"/pages/index/authentication"},"/pages/index/immediately":{path:"/pages/index/immediately"},"/pages/index/phone":{path:"/pages/index/phone"},"/pages/home/guide/index":{path:"/pages/home/guide/index"},"/pages/home/account/payvip":{path:"/pages/home/account/payvip"},"/pages/home/account/package":{path:"/pages/home/account/package"},"/pages/home/wallet/exchange":{path:"/pages/home/wallet/exchange"},"/pages/home/wallet/index":{path:"/pages/home/wallet/index"},"/pages/home/mytrip/order":{path:"/pages/home/mytrip/order"},"/pages/home/mytrip/tripmain":{path:"/pages/home/mytrip/tripmain"},"/pages/home/personinfo":{path:"/pages/home/personinfo"},"/pages/home/emergent/roast":{path:"/pages/home/emergent/roast"},"/pages/home/detail/index":{path:"/pages/home/detail/index"},"/pages/home/updatepassword":{path:"/pages/home/updatepassword"},"/pages/home/signature":{path:"/pages/home/signature"}}[p];if(!i){console.log(`%c跳转路径参数错误<${p||"EMPTY"}>`,"color:red;background:yellow");return}if((n=i.meta)!=null&&n.auth&&!d.$store("user").isLogin){u.showAuthModal();return}if(o=p,a.lodashExports.isEmpty(s)||(o+=`?${s}`),["/pages/subpackages/mapnvue","/pages/subpackages/my"].includes(p)){a.index.switchTab({url:o});return}if(r.redirect){a.index.redirectTo({url:o});return}a.index.navigateTo({url:o})};function c(...e){m.throttle(()=>{x(...e)})}function h(e){if(a.lodashExports.isEmpty(e))return"";let t=[];for(let r in e)t.push(r+"="+e[r]);return t.join("&")}function y(){a.index.navigateBack()}function l(e,t={}){c(e,t,{redirect:!0})}function f(){return getCurrentPages().length>1}function b(){let e=getCurrentPages();return e[e.length-1]}function k(e){switch(e.split(":")[1]){case"showShareModal":u.showShareModal();break}}function w(e,t=""){l("/pages/public/error",{errCode:e,errMsg:t})}const E={go:c,back:y,hasHistory:f,redirect:l,getCurrentPage:b,error:w};exports.$router=E;
|