1 |
- "use strict";const e=require("../../common/vendor.js"),t=require("../store/index.js"),a=require("../hooks/useModal.js"),s=require("../helper/throttle.js"),p=(s,p={},r={redirect:!1})=>{var i;let g="",l="",u="";if(e.lodashExports.isString(s)){if(e.lodashExports.startsWith(s,"http"))g="/pages/public/webview",l=`url=${encodeURIComponent(s)}`;else{if(e.lodashExports.startsWith(s,"action:"))return void function(e){if("showShareModal"===e.split(":")[1])a.showShareModal()}(s);[g,l]=s.split("?")}if(!e.lodashExports.isEmpty(p)){let t=o(p);e.lodashExports.isEmpty(l)?l=t:l+="&"+t}}e.lodashExports.isObject(s)&&(g=s.url,e.lodashExports.isNil(s.params)||(l=o(s.params)));const n={"/pages/index/index":{path:"/pages/index/index",aliasPath:"/",meta:{auth:!1,sync:!0,title:"首页",group:"商城"}},"/pages/index/user":{path:"/pages/index/user",meta:{sync:!0,title:"个人中心",group:"商城"}},"/pages/index/category":{path:"/pages/index/category",meta:{sync:!0,title:"商品分类",group:"商城"}},"/pages/index/cart":{path:"/pages/index/cart",meta:{sync:!0,title:"购物车",group:"商城"}},"/pages/index/login":{path:"/pages/index/login"},"/pages/index/search":{path:"/pages/index/search",meta:{sync:!0,title:"搜索",group:"商城"}},"/pages/index/page":{path:"/pages/index/page",meta:{auth:!1,sync:!0,title:"自定义页面",group:"商城"}},"/pages/goods/index":{path:"/pages/goods/index",meta:{sync:!0,title:"普通商品",group:"商品"}},"/pages/goods/groupon":{path:"/pages/goods/groupon",meta:{sync:!0,title:"拼团商品",group:"商品"}},"/pages/goods/seckill":{path:"/pages/goods/seckill",meta:{sync:!0,title:"秒杀商品",group:"商品"}},"/pages/goods/list":{path:"/pages/goods/list",meta:{sync:!0,title:"商品列表",group:"商品"}},"/pages/goods/comment/add":{path:"/pages/goods/comment/add",meta:{auth:!0}},"/pages/goods/comment/list":{path:"/pages/goods/comment/list"},"/pages/order/detail":{path:"/pages/order/detail",meta:{auth:!0,title:"订单详情"}},"/pages/order/confirm":{path:"/pages/order/confirm",meta:{auth:!0,title:"确认订单"}},"/pages/order/list":{path:"/pages/order/list",meta:{auth:!0,sync:!0,title:"用户订单",group:"订单中心"}},"/pages/order/aftersale/apply":{path:"/pages/order/aftersale/apply",meta:{auth:!0,title:"申请售后"}},"/pages/order/aftersale/return-delivery":{path:"/pages/order/aftersale/return-delivery",meta:{auth:!0,title:"退货物流"}},"/pages/order/aftersale/list":{path:"/pages/order/aftersale/list",meta:{auth:!0,sync:!0,title:"售后订单",group:"订单中心"}},"/pages/order/aftersale/detail":{path:"/pages/order/aftersale/detail",meta:{auth:!0,title:"售后详情"}},"/pages/order/aftersale/log":{path:"/pages/order/aftersale/log",meta:{auth:!0,title:"售后进度"}},"/pages/order/express/log":{path:"/pages/order/express/log",meta:{auth:!0,title:"物流轨迹"}},"/pages/order/otherlist":{path:"/pages/order/otherlist"},"/pages/user/info":{path:"/pages/user/info",meta:{auth:!0,sync:!0,title:"用户信息",group:"用户中心"}},"/pages/user/setting":{path:"/pages/user/setting",meta:{auth:!0,sync:!0,title:"用户设置",group:"用户中心"}},"/pages/user/qrcode-share":{path:"/pages/user/qrcode-share",meta:{auth:!0,sync:!0,title:"我的二维码/分享页",group:"用户中心"}},"/pages/user/goods-collect":{path:"/pages/user/goods-collect",meta:{auth:!0,sync:!0,title:"商品收藏",group:"用户中心"}},"/pages/user/goods-log":{path:"/pages/user/goods-log",meta:{auth:!0,sync:!0,title:"浏览记录",group:"用户中心"}},"/pages/user/address/list":{path:"/pages/user/address/list",meta:{auth:!0,sync:!0,title:"地址管理",group:"用户中心"}},"/pages/user/dummyAddress/list":{path:"/pages/user/dummyAddress/list",meta:{auth:!0,sync:!0,title:"虚拟商品收货地址",group:"用户中心"}},"/pages/user/invoice/edit":{path:"/pages/user/invoice/edit",meta:{auth:!0,title:"发票抬头"}},"/pages/user/invoice/list":{path:"/pages/user/invoice/list",meta:{auth:!0,sync:!0,title:"发票抬头管理",group:"用户中心"}},"/pages/user/address/edit":{path:"/pages/user/address/edit",meta:{auth:!0,title:"编辑地址"}},"/pages/user/dummyAddress/edit":{path:"/pages/user/dummyAddress/edit",meta:{auth:!0,title:"编辑地址"}},"/pages/user/wallet/money":{path:"/pages/user/wallet/money",meta:{auth:!0,sync:!0,title:"用户余额",group:"用户中心"}},"/pages/user/wallet/score":{path:"/pages/user/wallet/score",meta:{auth:!0,sync:!0,title:"用户积分",group:"用户中心"}},"/pages/user/wallet/scoreToMoney":{path:"/pages/user/wallet/scoreToMoney",meta:{auth:!0,sync:!0,title:"积分兑换",group:"用户中心"}},"/pages/user/wallet/ScoreLog":{path:"/pages/user/wallet/ScoreLog"},"/pages/user/wallet/maxScoreLog":{path:"/pages/user/wallet/maxScoreLog"},"/pages/user/wallet/team":{path:"/pages/user/wallet/team",meta:{auth:!0,sync:!0,title:"团队",group:"用户中心"}},"/pages/commission/index":{path:"/pages/commission/index",meta:{auth:!0,sync:!0,title:"分销中心",group:"分销商城"}},"/pages/commission/wallet":{path:"/pages/commission/wallet",meta:{auth:!0,sync:!0,title:"用户佣金",group:"分销中心"}},"/pages/commission/goods":{path:"/pages/commission/goods",meta:{auth:!0,sync:!0,title:"推广商品",group:"分销商城"}},"/pages/commission/order":{path:"/pages/commission/order",meta:{auth:!0,sync:!0,title:"分销订单",group:"分销商城"}},"/pages/commission/team":{path:"/pages/commission/team",meta:{auth:!0,sync:!0,title:"我的团队",group:"分销商城"}},"/pages/commission/promoter":{path:"/pages/commission/promoter",meta:{auth:!0,sync:!0,title:"推广人排行榜",group:"分销商城"}},"/pages/commission/commission-ranking":{path:"/pages/commission/commission-ranking",meta:{auth:!0,sync:!0,title:"佣金排行榜",group:"分销商城"}},"/pages/commission/withdraw":{path:"/pages/commission/withdraw",meta:{auth:!0,sync:!0,title:"申请提现",group:"分销商城"}},"/pages/app/sign":{path:"/pages/app/sign",meta:{auth:!0,sync:!0,title:"签到中心",group:"应用"}},"/pages/shop/index":{path:"/pages/shop/index",meta:{auth:!0,sync:!0,title:"店铺首页",group:"应用"}},"/pages/public/setting":{path:"/pages/public/setting",meta:{sync:!0,title:"系统设置",group:"通用"}},"/pages/public/richtext":{path:"/pages/public/richtext",meta:{sync:!0,title:"富文本",group:"通用"}},"/pages/public/faq":{path:"/pages/public/faq",meta:{sync:!0,title:"常见问题",group:"通用"}},"/pages/public/error":{path:"/pages/public/error"},"/pages/public/webview":{path:"/pages/public/webview"},"/pages/coupon/list":{path:"/pages/coupon/list",meta:{sync:!0,title:"领券中心",group:"优惠券"}},"/pages/coupon/detail":{path:"/pages/coupon/detail",meta:{auth:!1,sync:!0,title:"优惠券详情",group:"优惠券"}},"/pages/chat/index":{path:"/pages/chat/index",meta:{auth:!0,sync:!0,title:"客服",group:"客服"}},"/pages/chat/speechtotext":{path:"/pages/chat/speechtotext",meta:{auth:!0,sync:!0,title:"语音转文字",group:"语音转文字"}},"/pages/pay/index":{path:"/pages/pay/index"},"/pages/pay/result":{path:"/pages/pay/result"},"/pages/pay/recharge":{path:"/pages/pay/recharge",meta:{auth:!0,sync:!0,title:"充值余额",group:"支付"}},"/pages/pay/recharge-log":{path:"/pages/pay/recharge-log",meta:{auth:!0,sync:!0,title:"充值记录",group:"支付"}},"/pages/activity/groupon/detail":{path:"/pages/activity/groupon/detail"},"/pages/activity/groupon/order":{path:"/pages/activity/groupon/order",meta:{auth:!0,sync:!0,title:"拼团订单",group:"营销活动"}},"/pages/activity/index":{path:"/pages/activity/index",meta:{sync:!0,title:"营销商品",group:"营销活动"}},"/pages/activity/groupon/list":{path:"/pages/activity/groupon/list",meta:{sync:!0,title:"拼团活动",group:"营销活动"}},"/pages/activity/seckill/list":{path:"/pages/activity/seckill/list",meta:{sync:!0,title:"秒杀活动",group:"营销活动"}},"/pages/activity/bargain/list":{path:"/pages/activity/bargain/list",meta:{sync:!0,title:"砍价列表",group:"营销活动"}},"/pages/activity/bargain/detail":{path:"/pages/activity/bargain/detail",meta:{sync:!0,title:"砍价详情",group:"营销活动"}}}[g];n?!(null==(i=n.meta)?void 0:i.auth)||t.$store("user").isLogin?(u=g,e.lodashExports.isEmpty(l)||(u+=`?${l}`),["/pages/index/index","/pages/index/cart","/pages/index/user"].includes(g)?e.index.switchTab({url:u}):r.redirect?e.index.redirectTo({url:u}):e.index.navigateTo({url:u})):a.showAuthModal():console.log(`%c跳转路径参数错误<${g||"EMPTY"}>`,"color:red;background:yellow")};function r(...e){s.throttle((()=>{p(...e)}))}function o(t){if(e.lodashExports.isEmpty(t))return"";let a=[];for(let e in t)a.push(e+"="+t[e]);return a.join("&")}function i(e,t={}){r(e,t,{redirect:!0})}function g(){let e=getCurrentPages();return e[e.length-1]}const l={go:r,back:function(){e.index.navigateBack()},hasHistory:function(){return getCurrentPages().length>1},redirect:i,getCurrentPage:g,getCurrentRoute:function(e=""){let t=g();return t.$page.route=t.route,t.$page.options=t.options,""!==e?t.$page[e]:t.$page},error:function(e,t=""){i("/pages/public/error",{errCode:e,errMsg:t})}};exports.$router=l;
|