;(function(){function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable;})),keys.push.apply(keys,symbols);}return keys;}function _objectSpread(target){for(var i=1;i=o.length)return{done:true};return{done:false,value:o[i++]};},e:function e(_e2){throw _e2;},f:F};}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var normalCompletion=true,didErr=false,err;return{s:function s(){it=it.call(o);},n:function n(){var step=it.next();normalCompletion=step.done;return step;},e:function e(_e3){didErr=true;err=_e3;},f:function f(){try{if(!normalCompletion&&it.return!=null)it.return();}finally{if(didErr)throw err;}}};}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen);}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i-1,presto:u.indexOf("Presto")>-1,webKit:u.indexOf("AppleWebKit")>-1,gecko:u.indexOf("Gecko")>-1&&u.indexOf("KHTML")==-1,mobile:!!u.match(/AppleWebKit.*Mobile.*/),ios:!!u.match(/Mac OS X/),android:u.indexOf("DAYAAPPA")>-1||u.indexOf("Adr")>-1,iPhone:u.indexOf("DAYAAPPI")>-1,isApp:u.indexOf("DAYAAPPI")>-1||u.indexOf("DAYAAPPA")>-1||u.indexOf("Adr")>-1,iPad:u.indexOf("iPad")>-1,webApp:u.indexOf("Safari")==-1,weixin:u.indexOf("MicroMessenger")>-1,huawei:!!u.match(/huawei/i)||!!u.match(/honor/i),xiaomi:!!u.match(/mi\s/i)||!!u.match(/redmi/i)||!!u.match(/mix/i)};});var getRandomKey=function getRandomKey(){var key=""+new Date().getTime()+Math.floor(Math.random()*1e6);return key;};var removeAuth=exports('a',function(){sessionStorage.removeItem("Authorization");});var _setAuth=exports('b',function(token){sessionStorage.setItem("Authorization",token);});var formatterDate=exports('f',function(type,val){if(type==="year"){return"".concat(val,"\u5E74");}if(type==="month"){return"".concat(val,"\u6708");}if(type==="day"){return"".concat(val,"\u65E5");}if(type==="hour"){return"".concat(val,"\u65F6");}if(type==="minute"){return"".concat(val,"\u5206");}return val;});var moneyFormat=exports('m',function(value){var format=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"0,0.00";return numeral(value).format(format);});function validStudentUrl(){var url=window.location.href;var returnUrl="";if(/test/.test(url)){returnUrl="http://mstutest.dayaedu.com";}else if(/dev/.test(url)){returnUrl="http://mstudev.dayaedu.com";}else if(/online/.test(url)){returnUrl="https://mstuonline.dayaedu.com";}else{returnUrl="http://mstutest.dayaedu.com";}return returnUrl;}var originalPostMessage=window.postMessage;window.postMessage=function(message){originalPostMessage(message,"*");};var loop=function loop(){};var calls={};var browserInfo=browser();if(browserInfo.isApp){window.addEventListener("message",function(evt){try{var _data$content,_data$content2,_data$content3;console.log(evt,"message",evt.data);var data=evt.data?_typeof(evt.data)==="object"?evt.data:JSON.parse(evt.data):{};var uuid=((_data$content=data.content)===null||_data$content===void 0?void 0:_data$content.uuid)||data.uuid;console.log(uuid,data.content,"uuid");try{if(data.content){data.content=JSON.parse(data.content);}}catch(error){}if(data!==null&&data!==void 0&&(_data$content2=data.content)!==null&&_data$content2!==void 0&&_data$content2.uuid){console.log("data",data);}if(!uuid){var keys=Object.keys(calls).filter(function(key){return key.indexOf(data.api)===0;});console.log(keys,"keys");console.log(data,"data");var _iterator5=_createForOfIteratorHelper(keys),_step5;try{for(_iterator5.s();!(_step5=_iterator5.n()).done;){var key=_step5.value;var callback2=calls[key]||loop;typeof callback2==="function"&&callback2(data);}}catch(err){_iterator5.e(err);}finally{_iterator5.f();}return;}var callId=((_data$content3=data.content)===null||_data$content3===void 0?void 0:_data$content3.uuid)||data.uuid||data.api+data.uuid;var callback=calls[callId]||loop;console.log(data,"data");typeof callback==="function"&&callback(data);}catch(error){console.error("\u901A\u4FE1\u6D88\u606F\u89E3\u6790\u9519\u8BEF",error);}});}var instance=window.DAYA||((_window$webkit=window.webkit)===null||_window$webkit===void 0?void 0:(_window$webkit$messag=_window$webkit.messageHandlers)===null||_window$webkit$messag===void 0?void 0:_window$webkit$messag.DAYA);var postMessage=exports('p',function(data,callback){if(browserInfo.isApp){var uuid=getRandomKey();calls[uuid]=callback||loop;data.content=data.content?_objectSpread(_objectSpread({},data.content),{},{uuid:uuid}):{uuid:uuid};instance.postMessage(JSON.stringify(data));console.log("send:",JSON.stringify(data));}});var request=exports('r',extend({timeout:2e4,timeoutMessage:"\u8BF7\u6C42\u8D85\u65F6"}));var initRequest=false;var toast;request.interceptors.request.use(function(url,options){if(!options.hideLoading){clearTimeout(toast);Toast.loading({message:"\u52A0\u8F7D\u4E2D...",forbidClick:true,loadingType:"spinner",duration:0});}initRequest=options.initRequest||false;var Authorization=sessionStorage.getItem("Authorization")||"";var authHeaders={};if(Authorization&&!["/api-auth/usernameLogin","/api-auth/smsLogin","/api-auth/code/sendSms"].includes(url)){authHeaders.Authorization=Authorization;}return{url:url,options:_objectSpread(_objectSpread({},options),{},{params:src(options.params),headers:_objectSpread(_objectSpread({},options.headers),authHeaders)})};},{global:false});request.interceptors.response.use(/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee(res){var msg,data,_msg,_browserInfo;return regeneratorRuntime.wrap(function _callee$(_context){while(1){switch(_context.prev=_context.next){case 0:toast=setTimeout(function(){Toast.clear();},100);if(!(res.status>299||res.status<200)){_context.next=6;break;}clearTimeout(toast);msg="\u670D\u52A1\u5668\u9519\u8BEF\uFF0C\u72B6\u6001\u7801"+res.status;Toast(msg);throw new Error(msg);case 6:_context.next=8;return res.clone().json();case 8:data=_context.sent;if(!(data.code!==200&&data.errCode!==0)){_context.next=16;break;}_msg=data.msg||data.message||"\u5904\u7406\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5";if(initRequest){if(data.code===403||data.code===401){setLogout();}else{setLoginError();}}if(!(data.code===403||data.code===401)){clearTimeout(toast);Toast(_msg);}_browserInfo=browser();if(data.code===403){_msg+="403";if(_browserInfo.isApp){postMessage({api:"login"});}else{setLogout();}}throw new Error(_msg);case 16:return _context.abrupt("return",res);case 17:case"end":return _context.stop();}}},_callee);}));return function(_x){return _ref.apply(this,arguments);};}(),{global:false});var empty="./assets/empty.41ba23f5.png";var __glob_7_0=/*#__PURE__*/Object.freeze((_Object$freeze={__proto__:null},_defineProperty(_Object$freeze,Symbol.toStringTag,'Module'),_defineProperty(_Object$freeze,'default',empty),_Object$freeze));var network="./assets/network.40ebc073.png";var __glob_7_1=/*#__PURE__*/Object.freeze((_Object$freeze2={__proto__:null},_defineProperty(_Object$freeze2,Symbol.toStringTag,'Module'),_defineProperty(_Object$freeze2,'default',network),_Object$freeze2));var no_shop_Goods="./assets/no_shop--goods.f27c43b7.png";var __glob_7_2=/*#__PURE__*/Object.freeze((_Object$freeze3={__proto__:null},_defineProperty(_Object$freeze3,Symbol.toStringTag,'Module'),_defineProperty(_Object$freeze3,'default',no_shop_Goods),_Object$freeze3));var notFond="./assets/notFond.21839776.png";var __glob_7_3=/*#__PURE__*/Object.freeze((_Object$freeze4={__proto__:null},_defineProperty(_Object$freeze4,Symbol.toStringTag,'Module'),_defineProperty(_Object$freeze4,'default',notFond),_Object$freeze4));var tips="_tips_hcemc_6";var btn="_btn_hcemc_11";var SMALL="_SMALL_hcemc_15";var CERT="_CERT_hcemc_19";var GOODS="_GOODS_hcemc_26";var styles={"col-result":"_col-result_hcemc_1",tips:tips,btn:btn,SMALL:SMALL,CERT:CERT,GOODS:GOODS};var getAssetsHomeFile=function getAssetsHomeFile(fileName){var path="./images/".concat(fileName);var modules={"./images/empty.png":__glob_7_0,"./images/network.png":__glob_7_1,"./images/no_shop--goods.png":__glob_7_2,"./images/notFond.png":__glob_7_3};return modules[path].default;};var ColResult=exports('C',defineComponent({name:'col-result',props:{tips:{type:String},type:{// 空 type:String,default:'empty'},classImgSize:{type:String,default:'SMALL'},plain:{type:Boolean,default:false},btnStatus:{type:Boolean,default:true},buttonText:{type:String,default:'我知道了'},onClick:Function},methods:{onResult:function onResult(){if(this.onClick){this.onClick();}else{postMessage({api:'back',content:{}});}}},computed:{image:function image(){var image=null;switch(this.type){case'error':image='error';break;case'network':image=getAssetsHomeFile('network.png');break;case'search':image='search';break;case'notFond':image=getAssetsHomeFile('notFond.png');break;case'goods':image=getAssetsHomeFile('no_shop--goods.png');break;default:image=getAssetsHomeFile('empty.png');break;}return image;}},render:function render(){var _this=this;return createVNode("div",{"class":[styles['col-result'],'col-result-container']},[createVNode(Empty,{"image":this.image,"class":styles[this.classImgSize],"description":this.tips},null),this.btnStatus?createVNode(Button,{"class":styles.btn,"round":true,"block":true,"type":"primary","plain":this.plain,"onClick":this.onResult},{default:function _default(){return[_this.buttonText];}}):null]);}}));browser();var Auth=defineComponent({name:'Auth',data:function data(){return{loading:false};},computed:{isExternal:function isExternal(){// 该路由在外部连接打开是否需要登录 // 只判断是否在学生端打开 return this.$route.meta.isExternal||false;},isNeedView:function isNeedView(){return state.user.status==='login'||this.$route.path==='/login'||this.isExternal;}},mounted:function mounted(){!this.isExternal&&this.setAuth();},methods:{setAuth:function setAuth(){var _this2=this;return _asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee2(){var query,token,res,message,route,_query;return regeneratorRuntime.wrap(function _callee2$(_context2){while(1){switch(_context2.prev=_context2.next){case 0:query=_this2.$route.query;token=query.userInfo||query.Authorization;if(token){_setAuth(token);}if(!_this2.loading){_context2.next=5;break;}return _context2.abrupt("return");case 5:if(!(state.user.status==='init'||state.user.status==='error')){_context2.next=19;break;}_this2.loading=true;_context2.prev=7;_context2.next=10;return request.get('/api-student/student/queryUserInfo',{initRequest:true// 初始化接口 });case 10:res=_context2.sent;setLogin(res.data);_context2.next=18;break;case 14:_context2.prev=14;_context2.t0=_context2["catch"](7);message=_context2.t0.message;if(message.indexOf('403')===-1&&message.indexOf('authentication')===-1){setLoginError();}else{setLogout();}case 18:_this2.loading=false;case 19:// console.log(state.user) if(state.user.status==='logout'){if(browser().isApp){postMessage({api:'login'});}else{try{route=_this2.$route;_query=_objectSpread({returnUrl:_this2.$route.path},_this2.$route.query);if(route.meta.isRegister){_query.isRegister=route.meta.isRegister;}_this2.$router.replace({path:'/login',query:_query});}catch(error){}}}case 20:case"end":return _context2.stop();}}},_callee2,null,[[7,14]]);}))();}},render:function render(){return createVNode(Fragment,null,[state.user.status==='error'?createVNode("div",{"class":styles$1.error},[createVNode(ColResult,{"type":"notFond","classImgSize":"CERT","tips":"加载失败,请稍后重试","buttonText":"重新加载","plain":true,"onClick":this.setAuth},null)]):this.isNeedView?createVNode(RouterView,null,null):null]);}});var router$1=[{path:"/orderDetail",name:"orderDetail",component:function component(){return __vitePreload(function(){return module.import('./index-legacy.176f8618.js');},false?"__VITE_PRELOAD__":void 0);},meta:{title:"\u8BA2\u5355\u8BE6\u60C5"}},{path:"/tradeDetail",name:"tradeDetail",component:function component(){return __vitePreload(function(){return module.import('./trade-detail-legacy.43dc3d69.js');},false?"__VITE_PRELOAD__":void 0);},meta:{title:"\u4EA4\u6613\u8BE6\u60C5"}},{path:"/goodsOrder",name:"goodsOrder",component:function component(){return __vitePreload(function(){return module.import('./index-legacy.26068a69.js');},false?"__VITE_PRELOAD__":void 0);},meta:{title:"\u5546\u54C1\u8BA2\u5355"}},{path:"/afterSale",name:"afterSale",component:function component(){return __vitePreload(function(){return module.import('./after-sale-legacy.2b74a48b.js');},false?"__VITE_PRELOAD__":void 0);},meta:{title:"\u552E\u540E\u670D\u52A1"}},{path:"/shopMall",name:"shopMall",component:function component(){return __vitePreload(function(){return module.import('./index-legacy.48ce14a8.js');},false?"__VITE_PRELOAD__":void 0);},meta:{title:"\u5546\u57CE"}},{path:"/goodsList",name:"goodsList",component:function component(){return __vitePreload(function(){return module.import('./index-legacy.dbdc292f.js');},false?"__VITE_PRELOAD__":void 0);},meta:{title:"\u5546\u54C1\u5217\u8868"}},{path:"/goodsDetail",name:"goodsDetail",component:function component(){return __vitePreload(function(){return module.import('./index-legacy.c9442d18.js');},false?"__VITE_PRELOAD__":void 0);},meta:{title:"\u5546\u54C1\u8BE6\u60C5"}},{path:"/cart",name:"cart",component:function component(){return __vitePreload(function(){return module.import('./index-legacy.8315daaf.js');},false?"__VITE_PRELOAD__":void 0);},meta:{title:"\u8D2D\u7269\u8F66"}},{path:"/cartConfirm",name:"cartConfirm",component:function component(){return __vitePreload(function(){return module.import('./index-legacy.36e82033.js');},false?"__VITE_PRELOAD__":void 0);},meta:{title:"\u786E\u8BA4\u8BA2\u5355"}},{path:"/cartConfirmAgin",name:"cartConfirmAgin",component:function component(){return __vitePreload(function(){return module.import('./index-legacy.b17f14dc.js');},false?"__VITE_PRELOAD__":void 0);},meta:{title:"\u786E\u8BA4\u8BA2\u5355"}},{path:"/shopOrderDetail",name:"shopOrderDetail",component:function component(){return __vitePreload(function(){return module.import('./index-legacy.82d9539d.js');},false?"__VITE_PRELOAD__":void 0);},meta:{title:"\u8BA2\u5355\u8BE6\u60C5"}},{path:"/address",name:"address",component:function component(){return __vitePreload(function(){return module.import('./index-legacy.45d591de.js');},false?"__VITE_PRELOAD__":void 0);},meta:{title:"\u5730\u5740\u5217\u8868"}},{path:"/editAddress",name:"editAddress",component:function component(){return __vitePreload(function(){return module.import('./edit-address-legacy.272bf1a7.js');},false?"__VITE_PRELOAD__":void 0);},meta:{title:"\u7F16\u8F91\u5730\u5740"}},{path:"/shopTrade",name:"shopTrade",component:function component(){return __vitePreload(function(){return module.import('./trade-detail-legacy.17de2a8f.js');},false?"__VITE_PRELOAD__":void 0);},meta:{title:"\u4EA4\u6613\u8BE6\u60C5"}},{path:"/coupons",name:"coupons",component:function component(){return __vitePreload(function(){return module.import('./index-legacy.df261b6c.js');},false?"__VITE_PRELOAD__":void 0);},meta:{title:"\u4F18\u60E0\u5238"}}];var rootRouter=[];var noLoginRouter=[];var routes=[{path:"/",component:Auth,redirect:"/shopMall",children:[].concat(router$1,[{path:"/login",name:"login",component:function component(){return __vitePreload(function(){return module.import('./login-legacy.f7b2dba6.js');},false?"__VITE_PRELOAD__":void 0);},meta:{isRegister:false}},{path:"/tradeRecord",name:"tradeRecord",component:function component(){return __vitePreload(function(){return module.import('./index-legacy.eee92df9.js');},false?"__VITE_PRELOAD__":void 0);},meta:{title:"\u4EA4\u6613\u8BB0\u5F55"}}])}].concat(noLoginRouter,rootRouter,[{path:"/:pathMatch(.*)*",component:function component(){return __vitePreload(function(){return module.import('./index-legacy.4dbf79a9.js');},false?"__VITE_PRELOAD__":void 0);},meta:{title:"404 Not Fund",platform:"STUDENT"}}]);var router=createRouter({history:createWebHashHistory(),routes:routes});router.beforeEach(function(to,from,next){var title=to.meta.title;document.title=title||"\u7BA1\u4E50\u8FF7";next();});var isOpen=false;router.onError(function(error){if(error instanceof Error){var isChunkLoadFailed=error.name.indexOf("chunk");var targetPath=router.currentRoute.value.fullPath;if(isChunkLoadFailed&&!isOpen){isOpen=true;Dialog.alert({title:"\u66F4\u65B0\u63D0\u793A",message:"APP\u6709\u66F4\u65B0\u8BF7\u70B9\u51FB\u786E\u5B9A\u5237\u65B0\u9875\u9762?",confirmButtonColor:"var(--van-primary)"}).then(function(){location.hash=targetPath;window.location.reload();});}}});var vueFilter={moneyFormat:function moneyFormat(value){return numeral(value).format("0,0.00");},dateFormat:function dateFormat(value){var format=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"YYYY-MM-DD HH:mm:ss";return dayjs(value).format(format);}};var normalize='';var index='';var app=createApp(App);dayjs.locale("zh-ch");app.config.globalProperties.$dayjs=dayjs;app.config.globalProperties.$filters=vueFilter;app.use(router);app.mount("#app");}};});})();