acdr-ui/dist/build/mp-weixin/modules/mall/sheep/router/index.js
2024-10-01 09:15:35 +08:00

2 lines
11 KiB
JavaScript

"use strict";const e=require("../../../../common/vendor.js"),l=require("../store/index.js"),t=require("../hooks/useModal.js"),s=require("../helper/throttle.js");var o={"/pages/index/index":{path:"/pages/index/index",aliasPath:"/"},"/pages/index/404":{path:"/pages/index/404"},"/modules/pet/address/index":{path:"/modules/pet/address/index"},"/modules/pet/ai/ai-interactive-space":{path:"/modules/pet/ai/ai-interactive-space"},"/modules/pet/certification/index":{path:"/modules/pet/certification/index"},"/modules/pet/certification/pet-sitter":{path:"/modules/pet/certification/pet-sitter"},"/modules/pet/extended/index":{path:"/modules/pet/extended/index"},"/modules/pet/h5mall/index":{path:"/modules/pet/h5mall/index"},"/modules/pet/login/index":{path:"/modules/pet/login/index"},"/modules/pet/login/phone":{path:"/modules/pet/login/phone"},"/modules/pet/map/index":{path:"/modules/pet/map/index"},"/modules/pet/message/chat":{path:"/modules/pet/message/chat"},"/modules/pet/message/index":{path:"/modules/pet/message/index"},"/modules/pet/message/message-list":{path:"/modules/pet/message/message-list"},"/modules/pet/message/privatechat":{path:"/modules/pet/message/privatechat"},"/modules/pet/my/index":{path:"/modules/pet/my/index"},"/modules/pet/order/index":{path:"/modules/pet/order/index"},"/modules/pet/order/order-detail":{path:"/modules/pet/order/order-detail"},"/modules/pet/order/take":{path:"/modules/pet/order/take"},"/modules/pet/others/agreement":{path:"/modules/pet/others/agreement"},"/modules/pet/others/null":{path:"/modules/pet/others/null"},"/modules/pet/others/official-account":{path:"/modules/pet/others/official-account"},"/modules/pet/permission/bind-phone":{path:"/modules/pet/permission/bind-phone"},"/modules/pet/permission/real-name-auth":{path:"/modules/pet/permission/real-name-auth"},"/modules/pet/pet/index":{path:"/modules/pet/pet/index"},"/modules/pet/pet/pet-add-page":{path:"/modules/pet/pet/pet-add-page"},"/modules/pet/pet/pet-detail-page":{path:"/modules/pet/pet/pet-detail-page"},"/modules/pet/push/door":{path:"/modules/pet/push/door"},"/modules/pet/push/goods":{path:"/modules/pet/push/goods"},"/modules/pet/push/index":{path:"/modules/pet/push/index"},"/modules/pet/push/share":{path:"/modules/pet/push/share"},"/modules/pet/service/accompany":{path:"/modules/pet/service/accompany"},"/modules/pet/service/detail":{path:"/modules/pet/service/detail"},"/modules/pet/service/door":{path:"/modules/pet/service/door"},"/modules/pet/service/index":{path:"/modules/pet/service/index"},"/modules/pet/service/knowledge":{path:"/modules/pet/service/knowledge"},"/modules/pet/service/my-service":{path:"/modules/pet/service/my-service"},"/modules/pet/service/search":{path:"/modules/pet/service/search"},"/modules/pet/service/shop":{path:"/modules/pet/service/shop"},"/modules/pet/service/slippery":{path:"/modules/pet/service/slippery"},"/modules/pet/service/store":{path:"/modules/pet/service/store"},"/modules/pet/settings/index":{path:"/modules/pet/settings/index"},"/modules/pet/space/index":{path:"/modules/pet/space/index"},"/modules/pet/webview/webview":{path:"/modules/pet/webview/webview"},"/modules/mall/index/index":{path:"/modules/mall/index/index",aliasPath:"/mall",meta:{auth:!1,sync:!0,title:"宠物商城",group:"商城"}},"/modules/mall/index/user":{path:"/modules/mall/index/user",meta:{sync:!0,title:"个人中心",group:"商城"}},"/modules/mall/index/category":{path:"/modules/mall/index/category",meta:{sync:!0,title:"商品分类",group:"商城"}},"/modules/mall/index/cart":{path:"/modules/mall/index/cart",meta:{sync:!0,title:"购物车",group:"商城"}},"/modules/mall/index/login":{path:"/modules/mall/index/login"},"/modules/mall/index/search":{path:"/modules/mall/index/search",meta:{sync:!0,title:"搜索",group:"商城"}},"/modules/mall/index/page":{path:"/modules/mall/index/page",meta:{auth:!1,sync:!0,title:"自定义页面",group:"商城"}},"/modules/mall/goods/index":{path:"/modules/mall/goods/index",meta:{sync:!0,title:"普通商品",group:"商品"}},"/modules/mall/goods/groupon":{path:"/modules/mall/goods/groupon",meta:{sync:!0,title:"拼团商品",group:"商品"}},"/modules/mall/goods/seckill":{path:"/modules/mall/goods/seckill",meta:{sync:!0,title:"秒杀商品",group:"商品"}},"/modules/mall/goods/list":{path:"/modules/mall/goods/list",meta:{sync:!0,title:"商品列表",group:"商品"}},"/modules/mall/goods/comment/add":{path:"/modules/mall/goods/comment/add",meta:{auth:!0}},"/modules/mall/goods/comment/list":{path:"/modules/mall/goods/comment/list"},"/modules/mall/order/detail":{path:"/modules/mall/order/detail",meta:{auth:!0,title:"订单详情"}},"/modules/mall/order/confirm":{path:"/modules/mall/order/confirm",meta:{auth:!0,title:"确认订单"}},"/modules/mall/order/list":{path:"/modules/mall/order/list",meta:{auth:!0,sync:!0,title:"用户订单",group:"订单中心"}},"/modules/mall/order/aftersale/apply":{path:"/modules/mall/order/aftersale/apply",meta:{auth:!0,title:"申请售后"}},"/modules/mall/order/aftersale/return-delivery":{path:"/modules/mall/order/aftersale/return-delivery",meta:{auth:!0,title:"退货物流"}},"/modules/mall/order/aftersale/list":{path:"/modules/mall/order/aftersale/list",meta:{auth:!0,sync:!0,title:"售后订单",group:"订单中心"}},"/modules/mall/order/aftersale/detail":{path:"/modules/mall/order/aftersale/detail",meta:{auth:!0,title:"售后详情"}},"/modules/mall/order/aftersale/log":{path:"/modules/mall/order/aftersale/log",meta:{auth:!0,title:"售后进度"}},"/modules/mall/order/express/log":{path:"/modules/mall/order/express/log",meta:{auth:!0,title:"物流轨迹"}},"/modules/mall/user/info":{path:"/modules/mall/user/info",meta:{auth:!0,sync:!0,title:"用户信息",group:"用户中心"}},"/modules/mall/user/goods-collect":{path:"/modules/mall/user/goods-collect",meta:{auth:!0,sync:!0,title:"商品收藏",group:"用户中心"}},"/modules/mall/user/goods-log":{path:"/modules/mall/user/goods-log",meta:{auth:!0,sync:!0,title:"浏览记录",group:"用户中心"}},"/modules/mall/user/address/list":{path:"/modules/mall/user/address/list",meta:{auth:!0,sync:!0,title:"地址管理",group:"用户中心"}},"/modules/mall/user/address/edit":{path:"/modules/mall/user/address/edit",meta:{auth:!0,title:"编辑地址"}},"/modules/mall/user/goods_details_store/index":{path:"/modules/mall/user/goods_details_store/index",meta:{auth:!0,sync:!0,title:"地址管理",group:"用户中心"}},"/modules/mall/user/wallet/money":{path:"/modules/mall/user/wallet/money",meta:{auth:!0,sync:!0,title:"用户余额",group:"用户中心"}},"/modules/mall/user/wallet/score":{path:"/modules/mall/user/wallet/score",meta:{auth:!0,sync:!0,title:"用户积分",group:"用户中心"}},"/modules/mall/commission/index":{path:"/modules/mall/commission/index",meta:{auth:!0,sync:!0,title:"分销中心",group:"分销商城"}},"/modules/mall/commission/wallet":{path:"/modules/mall/commission/wallet",meta:{auth:!0,sync:!0,title:"用户佣金",group:"分销中心"}},"/modules/mall/commission/goods":{path:"/modules/mall/commission/goods",meta:{auth:!0,sync:!0,title:"推广商品",group:"分销商城"}},"/modules/mall/commission/order":{path:"/modules/mall/commission/order",meta:{auth:!0,sync:!0,title:"分销订单",group:"分销商城"}},"/modules/mall/commission/team":{path:"/modules/mall/commission/team",meta:{auth:!0,sync:!0,title:"我的团队",group:"分销商城"}},"/modules/mall/commission/promoter":{path:"/modules/mall/commission/promoter",meta:{auth:!0,sync:!0,title:"推广人排行榜",group:"分销商城"}},"/modules/mall/commission/commission-ranking":{path:"/modules/mall/commission/commission-ranking",meta:{auth:!0,sync:!0,title:"佣金排行榜",group:"分销商城"}},"/modules/mall/commission/withdraw":{path:"/modules/mall/commission/withdraw",meta:{auth:!0,sync:!0,title:"申请提现",group:"分销商城"}},"/modules/mall/app/sign":{path:"/modules/mall/app/sign",meta:{auth:!0,sync:!0,title:"签到中心",group:"应用"}},"/modules/mall/public/setting":{path:"/modules/mall/public/setting",meta:{sync:!0,title:"系统设置",group:"通用"}},"/modules/mall/public/richtext":{path:"/modules/mall/public/richtext",meta:{sync:!0,title:"富文本",group:"通用"}},"/modules/mall/public/faq":{path:"/modules/mall/public/faq",meta:{sync:!0,title:"常见问题",group:"通用"}},"/modules/mall/public/error":{path:"/modules/mall/public/error"},"/modules/mall/public/webview":{path:"/modules/mall/public/webview"},"/modules/mall/coupon/list":{path:"/modules/mall/coupon/list",meta:{sync:!0,title:"领券中心",group:"优惠券"}},"/modules/mall/coupon/detail":{path:"/modules/mall/coupon/detail",meta:{auth:!1,sync:!0,title:"优惠券详情",group:"优惠券"}},"/modules/mall/chat/index":{path:"/modules/mall/chat/index",meta:{auth:!0,sync:!0,title:"客服",group:"客服"}},"/modules/mall/pay/index":{path:"/modules/mall/pay/index"},"/modules/mall/pay/result":{path:"/modules/mall/pay/result"},"/modules/mall/pay/recharge":{path:"/modules/mall/pay/recharge",meta:{auth:!0,sync:!0,title:"充值余额",group:"支付"}},"/modules/mall/pay/recharge-log":{path:"/modules/mall/pay/recharge-log",meta:{auth:!0,sync:!0,title:"充值记录",group:"支付"}},"/modules/mall/activity/groupon/detail":{path:"/modules/mall/activity/groupon/detail"},"/modules/mall/activity/groupon/order":{path:"/modules/mall/activity/groupon/order",meta:{auth:!0,sync:!0,title:"拼团订单",group:"营销活动"}},"/modules/mall/activity/index":{path:"/modules/mall/activity/index",meta:{sync:!0,title:"营销商品",group:"营销活动"}},"/modules/mall/activity/groupon/list":{path:"/modules/mall/activity/groupon/list",meta:{sync:!0,title:"拼团活动",group:"营销活动"}},"/modules/mall/activity/seckill/list":{path:"/modules/mall/activity/seckill/list",meta:{sync:!0,title:"秒杀活动",group:"营销活动"}}},a=["/pages/index/index","/pages/index/404"];const m=(s,m={},d={redirect:!1})=>{var u;let p="",r="",n="";if(e.isString(s)){if(e.startsWith(s,"http"))p="/modules/mall/public/webview",r=`url=${encodeURIComponent(s)}`;else{if(e.startsWith(s,"action:"))return void function(e){if("showShareModal"===e.split(":")[1])t.showShareModal()}(s);[p,r]=s.split("?")}if(!e.isEmpty(m)){const l=i(m);e.isEmpty(r)?r=l:r+="&"+l}}e.isObject(s)&&(p=s.url,e.isNil(s.params)||(r=i(s.params)));const h=o[p];h&&(!(null==(u=h.meta)?void 0:u.auth)||l.$store("user").isLogin?(n=p,e.isEmpty(r)||(n+=`?${r}`),a.includes(p)?e.index.switchTab({url:n}):d.redirect?e.index.redirectTo({url:n}):e.index.navigateTo({url:n})):t.showAuthModal())};function d(...e){s.throttle((()=>{m(...e)}))}function i(l){if(e.isEmpty(l))return"";const t=[];for(const e in l)t.push(e+"="+l[e]);return t.join("&")}function u(e,l={}){d(e,l,{redirect:!0})}function p(){const e=getCurrentPages();return e[e.length-1]}const r={go:d,back:function(){e.index.navigateBack()},hasHistory:function(){return getCurrentPages().length>1},redirect:u,getCurrentPage:p,getCurrentRoute:function(e=""){const l=p();return l.$page.route=l.route,l.$page.options=l.options,""!==e?l.$page[e]:l.$page},error:function(e,l=""){u("/modules/mall/public/error",{errCode:e,errMsg:l})}};exports.$router=r;