login-legacy.dc045695.js 8.0 KB

1
  1. !function(){var e=["returnUrl","isRegister"];function t(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function n(e){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?t(Object(o),!0).forEach((function(t){r(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):t(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},s=Object.keys(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function s(e,t,n,r,o,s,a){try{var u=e[s](a),i=u.value}catch(c){return void n(c)}u.done?t(i):Promise.resolve(i).then(r,o)}function a(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function u(e){s(a,r,o,u,i,"next",e)}function i(e){s(a,r,o,u,i,"throw",e)}u(void 0)}))}}System.register(["./index-legacy.90c82f08.js","./validate-legacy.6cdb2ccf.js","./index-legacy.55839436.js","./index-legacy.3c5580aa.js","./index-legacy.baa64f1d.js","./index-legacy.eb4bc59e.js","./index-legacy.f3e5e283.js"],(function(t){"use strict";var r,s,u,i,c,l,p,d,f,h,g,m,y,w,b,v,x,S,P,O,C,j,k,R;return{setters:[function(e){r=e.d,s=e.bm,u=e.f,i=e.m,c=e.bf,l=e.bg,p=e.g,d=e.be,f=e.s,h=e.n,g=e.o,m=e.c,y=e.bn,w=e.F,b=e.q,v=e.B,x=e.P},function(e){S=e.c,P=e.R,O=e.C,C=e.I},function(e){j=e.C},function(e){k=e.F},function(e){R=e.C},function(){},function(){}],execute:function(){t("default",r({name:"login-music",data:function(){return{loginType:"SMS",username:"",password:"",smsCode:"",countDownStatus:!0,countDownTime:12e4,imgCodeStatus:!1,showPopup:!1,showPopupMessage:"请使用微信打开",wxAppId:"",code:"",orchestraPath:"preApply",orchestraInfo:{},hasBuyInstruments:!1,testIsWeixin:!1}},computed:{codeDisable:function(){var e=!0;return this.username&&this.smsCode&&(e=!1),e}},mounted:function(){var e=this.$route.query.returnUrl;this.orchestraPath=e,s(),this.directNext(),u().weixin||this.testIsWeixin||(this.showPopup=!0),this.getDetails(),console.log(this.$route.query.returnUrl)},methods:{getDetails:function(){var e=this;return a(regeneratorRuntime.mark((function t(){var n,r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,e.$route.query.id){t.next=4;break}return t.abrupt("return");case 4:return t.next=6,i.get("/api-student/open/orchestra/detail/"+e.$route.query.id);case 6:n=t.sent,r=n.data,e.orchestraInfo=r||{},r.canSignUp?"ING"!==r.registerOpen&&(e.showPopup=!0,e.showPopupMessage="该乐团已截止报名"):(e.showPopup=!0,e.showPopupMessage="乐团报名时间已过,请等待通知"),t.next=14;break;case 12:t.prev=12,t.t0=t.catch(0);case 14:case"end":return t.stop()}}),t,null,[[0,12]])})))()},getAppIdAndCode:function(e){return a(regeneratorRuntime.mark((function t(){var n,r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,i.get("/api-student/open/paramConfig/wechatAppId");case 3:n=t.sent,(r=n.data)&&(c(),l(r,e)),t.next=10;break;case 8:t.prev=8,t.t0=t.catch(0);case 10:case"end":return t.stop()}}),t,null,[[0,8]])})))()},directNext:function(){var t=this;return a(regeneratorRuntime.mark((function r(){var s,a,u,i;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if("login"!==p.user.status&&"error"!==p.user.status){r.next=13;break}if(s=t.$route.query,a=s.returnUrl,s.isRegister,u=o(s,e),i=window.location.origin+window.location.pathname+"#"+a+"?"+d.stringify(n({},u)),!t.hasBuyInstruments){r.next=7;break}return i=window.location.origin+window.location.pathname+"#/preGoodsSuccess?t=pay",window.location.href=i,r.abrupt("return");case 7:if(!t.testIsWeixin){r.next=11;break}t.locationReplace(i),r.next=13;break;case 11:return r.next=13,t.getAppIdAndCode(i);case 13:case"end":return r.stop()}}),r)})))()},locationReplace:function(e){history.replaceState?(history.replaceState(null,document.title,e),history.go(0)):location.replace(e)},onLogin:function(){var e=this;return a(regeneratorRuntime.mark((function t(){var r,o,s,a,u,c,l,p;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,e.orchestraInfo.canSignUp){t.next=5;break}return e.showPopup=!0,e.showPopupMessage="学校已关闭",t.abrupt("return");case 5:return r={username:e.username,client_id:"jmedu-student",client_secret:"jmedu-student",autoRegister:!0,password:e.smsCode,loginType:"SMS",grant_type:"password",extra:e.$route.query.id},t.next=8,i.post("/api-oauth/userlogin",{requestType:"form",data:n({},r)});case 8:return o=t.sent,s=o.data,f(s.token_type+" "+s.access_token),t.next=13,i.get("/api-student/user/getUserInfo",{initRequest:!0});case 13:if(a=t.sent,h(a.data),u=e.$route.query,c=u.returnUrl,l=u.id,"/preGoodsApply"!==c){t.next=21;break}return t.next=19,i.get("/api-student/orchestraRegister/registerStatus/"+l);case 19:p=t.sent,e.hasBuyInstruments=p.data.hasBuyInstruments||!1;case 21:e.directNext(),t.next=26;break;case 24:t.prev=24,t.t0=t.catch(0);case 26:case"end":return t.stop()}}),t,null,[[0,24]])})))()},onSendCode:function(){var e=this;return a(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(S(e.username)){t.next=2;break}return t.abrupt("return",g("请输入正确的手机号码"));case 2:e.imgCodeStatus=!0;case 3:case"end":return t.stop()}}),t)})))()},onCodeSend:function(){var e=this;this.countDownStatus=!1,this.$nextTick((function(){e.$refs.countDownRef.start()}))},onFinished:function(){this.countDownStatus=!0,this.$refs.countDownRef.reset()},onChange:function(){"PWD"===this.loginType?this.loginType="SMS":"SMS"===this.loginType&&(this.loginType="PWD")}},render:function(){var e=this;return m("div",{class:y.login},[m("div",{class:y.loginTitle},["/preGoodsApply"===this.orchestraPath?"乐团报名":m(w,null,[b("您好,"),m("br",null,null),b(" 欢迎使用管乐团学员端")," "])]),m(j,{class:y.margin34,border:!1},{default:function(){return[m(P,{style:{marginBottom:"16px"}},{default:function(){return[m(O,{span:24,class:y.formTitle},{default:function(){return[b("手机号")]}}),m(O,{span:24,class:"van-hairline--bottom"},{default:function(){return[m(k,{modelValue:e.username,"onUpdate:modelValue":function(t){return e.username=t},name:"手机号",placeholder:"请输入您的手机号",type:"tel",maxlength:11},null)]}})]}}),m(P,null,{default:function(){return[m(O,{span:24,class:y.formTitle},{default:function(){return[b("验证码")]}}),m(O,{span:24,class:"van-hairline--bottom"},{default:function(){return[m(k,{modelValue:e.smsCode,"onUpdate:modelValue":function(t){return e.smsCode=t},name:"验证码",placeholder:"请输入验证码",type:"tel",maxlength:6},{button:function(){return e.countDownStatus?m("span",{class:y.codeText,onClick:e.onSendCode},[b("获取验证码")]):m(R,{ref:"countDownRef","auto-start":!1,time:e.countDownTime,onFinish:e.onFinished,format:"ss秒"},null)}})]}})]}})]}}),m("div",{class:y.margin34},[m(v,{round:!0,block:!0,type:"primary",disabled:this.codeDisable,onClick:this.onLogin},{default:function(){return[b("提交")]}})]),this.imgCodeStatus?m(C,{value:this.imgCodeStatus,"onUpdate:value":function(t){return e.imgCodeStatus=t},phone:this.username,type:"REGISTER",onClose:function(){e.imgCodeStatus=!1},onSendCode:this.onCodeSend},null):null,m(x,{show:this.showPopup,"onUpdate:show":function(t){return e.showPopup=t},round:!0,style:{width:"88%"},closeOnClickOverlay:!1,class:y.wxPopupDialog},{default:function(){return[m("div",{class:y.popupContainer},[m("p",{class:y.title},[b("温馨提示")]),m("p",{class:y.popupTips,innerHTML:e.showPopupMessage},null)])]}})])}}))}}}))}();