index-apply-b8618bb7.js 31 KB

123
  1. import{d as Ce,P as Ie,q as xe,r as J,x as b,al as ve,e as M,V as P,bX as Be,Y as X,y as Fe,D as f,ac as N,R as Ae,a as o,A as m,N as T,X as K,C as Ee,U as D,z as Ne,M as L,bY as De,J as je,K as Oe,$ as ze,bZ as Re}from"./index-7a2f1d19.js";import{M as be}from"./index-a36a7624.js";import{u as Pe}from"./student-register-store-168d8b2b.js";import{i as Le,v as Ge,a as ke,g as Ve,r as Ue}from"./index-57385b50.js";import{d as Me}from"./deep-clone-c0d00fc2.js";import{O as qe}from"./index-f7217279.js";import{O as Ye}from"./index-72a677c6.js";import{i as Qe}from"./icon-gift-20293d47.js";import{P as $e,Q as He,U as We,b as Je}from"./user-auth-9dbbaa58.js";import{M as Xe}from"./index-7b80e4c8.js";import{O as Ke}from"./index-c4cc6c4d.js";import{M as Ze}from"./index-dab1363e.js";import{S as et}from"./index-b1d2960a.js";import{b as tt,d as st}from"./index-23d1a3b3.js";import{F as ot}from"./index-c439ef57.js";import{F as x}from"./index-dd020c38.js";import{C as at}from"./index-776d7a81.js";import{R as nt,a as Z}from"./index-24635c17.js";import{T as ee}from"./index-84245713.js";import{C as rt}from"./index-1ec8d9dd.js";import{I as it}from"./index-5fd96e7f.js";import{P as te}from"./index-c6b67e3c.js";import"./tcplayer.v4.8.0.min-db38be33.js";/* empty css */import"./index-0c6ab101.js";import"./index-d2a62d45.js";import"./browser-e949d08f.js";import"./index-2dc73493.js";import"./Checker-d8c824a3.js";import"./Picker-351d76b2.js";const ut="_studentRegisterContainer_3zyyj_8",lt="_countdownSection_3zyyj_13",ct="_timer_3zyyj_32",dt="_timerAll_3zyyj_37",pt="_timerTitle_3zyyj_60",mt="_timerTip_3zyyj_66",gt="_paymentContainer_3zyyj_78",ft="_giftTip_3zyyj_88",yt="_needPrice_3zyyj_92",ht="_unit_3zyyj_109",_t="_allPrice_3zyyj_112",Tt="_traditionBtn_3zyyj_131",St="_studentSection_3zyyj_139",wt="_studentSectionForm_3zyyj_146",Ct="_noSendDay_3zyyj_150",It="_title1_3zyyj_153",xt="_title3_3zyyj_154",vt="_title2_3zyyj_161",Bt="_goodsGroup_3zyyj_172",Ft="_goodsItem_3zyyj_177",At="_goodsInner_3zyyj_191",Et="_checked_3zyyj_195",Nt="_checked1_3zyyj_201",Dt="_proposalTip_3zyyj_207",jt="_registerForm_3zyyj_221",Ot="_selectStudentGroup_3zyyj_225",zt="_selectStudentGroupChecked_3zyyj_233",Rt="_fieldTipsGroup_3zyyj_253",bt="_fieldTips_3zyyj_253",Pt="_iconQuestion_3zyyj_267",Lt="_tips_3zyyj_276",Gt="_username_3zyyj_283",kt="_countDown_3zyyj_292",Vt="_codeText_3zyyj_312",Ut="_memberNumer_3zyyj_316",Mt="_iconGift_3zyyj_327",qt="_radioSection_3zyyj_342",Yt="_radioItem_3zyyj_351",Qt="_goodsSection_3zyyj_362",$t="_iconArrow_3zyyj_373",Ht="_goodsExtra_3zyyj_380",Wt="_goodsCell_3zyyj_419",Jt="_goodsBuyGoods_3zyyj_424",Xt="_goodsName_3zyyj_427",Kt="_img_3zyyj_431",Zt="_iconChecked_3zyyj_435",es="_selected_3zyyj_444",ts="_checkedGroup_3zyyj_448",ss="_showBg_3zyyj_452",os="_section_3zyyj_478",as="_brandName_3zyyj_487",ns="_sectionContent_3zyyj_499",rs="_model_3zyyj_502",is="_sendInstrument_3zyyj_522",us="_moreBtn_3zyyj_526",ls="_sbtnGroup_3zyyj_533",cs="_goodsTradition_3zyyj_545",ds="_goodsTitle_3zyyj_557",ps="_step_3zyyj_564",ms="_stepContent_3zyyj_584",gs="_nums_3zyyj_595",fs="_numInner_3zyyj_606",ys="_selectStudentPopup_3zyyj_618",hs="_vipGiftContainer_3zyyj_621",_s="_vipGiftNum_3zyyj_653",Ts="_vipGiftPreviod_3zyyj_659",i={"student-register":"_student-register_3zyyj_1",studentRegisterContainer:ut,countdownSection:lt,timer:ct,timerAll:dt,timerTitle:pt,timerTip:mt,paymentContainer:gt,giftTip:ft,needPrice:yt,unit:ht,allPrice:_t,traditionBtn:Tt,studentSection:St,studentSectionForm:wt,noSendDay:Ct,title1:It,title3:xt,title2:vt,goodsGroup:Bt,goodsItem:Ft,goodsInner:At,checked:Et,checked1:Nt,proposalTip:Dt,registerForm:jt,selectStudentGroup:Ot,selectStudentGroupChecked:zt,fieldTipsGroup:Rt,fieldTips:bt,iconQuestion:Pt,tips:Lt,username:Gt,countDown:kt,codeText:Vt,memberNumer:Ut,iconGift:Mt,radioSection:qt,radioItem:Yt,goodsSection:Qt,iconArrow:$t,goodsExtra:Ht,goodsCell:Wt,goodsBuyGoods:Jt,goodsName:Xt,img:Kt,iconChecked:Zt,selected:es,checkedGroup:ts,showBg:ss,section:os,brandName:as,sectionContent:ns,model:rs,sendInstrument:is,moreBtn:us,sbtnGroup:ls,goodsTradition:cs,goodsTitle:ds,step:ps,stepContent:ms,nums:gs,numInner:fs,selectStudentPopup:ys,vipGiftContainer:hs,vipGiftNum:_s,vipGiftPreviod:Ts},Ss=""+new URL("tuangou-3941c8ce.png",import.meta.url).href,ws=""+new URL("icon-5-7b3d7dd6.png",import.meta.url).href,Cs=""+new URL("icon-10-a9d3e14d.png",import.meta.url).href,G=[];for(let p=1;p<=40;p++)G.push({text:p+"班",value:p});const se={1:"一年级",2:"二年级",3:"三年级",4:"四年级",5:"五年级",6:"六年级",7:"七年级",8:"八年级",9:"九年级"},oe=(p,g)=>{let S=[];const C=[{text:"一年级",value:1,instrumentCode:g},{text:"二年级",value:2,instrumentCode:g},{text:"三年级",value:3,instrumentCode:g},{text:"四年级",value:4,instrumentCode:g},{text:"五年级",value:5,instrumentCode:g}],v=[{text:"六年级",value:6,instrumentCode:g}],e=[{text:"七年级",value:7,instrumentCode:g},{text:"八年级",value:8,instrumentCode:g},{text:"九年级",value:9,instrumentCode:g}];return p==="FIVE_YEAR_SYSTEM"?S.push(...C):p==="SIX_YEAR_SYSTEM"?S.push(...C,...v):p==="THREE_YEAR_SYSTEM"?S.push(...e):p==="FORE_YEAR_SYSTEM"?S.push(...v,...e):S.push(...C,...v,...e),S},Zs=Ce({name:"student-register",setup(){const p=Ie(),g=Pe(),S=xe();g.setShoolId(p.query.sId);const C=J(),v=J(),e=b({schoolId:p.query.sId,paymentType:"",paymentChannel:"",multi_user_limit:1,registerDetails:{},details:[],gradeYear:"",schoolInstrumentSetType:null,isRegister:"create",isTipRegister:!1,isChangeSchool:!1,registerType:"",detailVip:{},giftVipDay:0,submitLoading:!1,showTips:!1,showButton:!1,showMessage:"请使用微信扫描二维码",countDownStatus:!0,countDownTime:1e3*120,imgCodeStatus:!1,gradeNumText:"",currentClassText:"",gradeStatus:!1,classStatus:!1,loading:!1,dialogStatus:!1,dialogMessage:"",confirmButtonText:"确定",cancelButtonText:"取消",messageAlign:"center",tipStatus:!0,dialogConfirmStatus:!1,contract_sign:!1,countDownTimePay:60*1e3,dialogConfig:{},showSelectStudent:!1,studentList:[],studentItem:{},joinType:"digitalize",gradeList:[],classList:[],saveUserId:null,saveId:null,openId:null,code:null,intervalFnRef:null,registerExpireTime:null,instrumentCode:null,activeOverTime:0,activeOverStatus:!0,gradePopupShow:!1,gradePopupIndex:[],classPopupShow:!1,classPopupIndex:[]}),a=b({showOtherSchool:!1,showCloseButton:!0,showOtherMessage:"",otherType:"",showCancelButton:!0,cancelButtonColor:"",cancelButtonText:"取消",showConfirmButton:!0,confirmButtonColor:"",confirmButtonText:"确定",messageAlign:"left"}),l=b({showQrcode:!1,qrCodeUrl:"",pay_channel:"",orderInfo:{},authShow:!1,orderNo:null,config:{},paymentStatus:!1,orderTimer:null}),r=b({autoRegister:!0,multiUser:!0,client_id:"cooleshow-student",client_secret:"cooleshow-student",extra:{nickname:"",currentGradeNum:"",currentClass:"",gender:1,registerType:null,giftVipDay:0},grant_type:"password",loginType:"SMS",password:"",username:""}),B=tt(1e3,{controls:!0});B.pause();const I=ve({time:e.activeOverTime,onFinish(){e.activeOverStatus=!0,!e.submitLoading&&F()}}),F=()=>{var t;e.showTips=!0,e.showMessage='<p style="color: #F44541">报名已截止,感谢您的参与</p>',e.showButton=!1,(t=e.intervalFnRef)==null||t.pause()},ae=()=>{e.countDownStatus=!1,Ne(()=>{C.value.start()})},ne=()=>{if(!L(r.username))return T("请输入正确的手机号码");e.imgCodeStatus=!0},re=M(()=>!!L(r.username)),ie=()=>{e.countDownStatus=!0,C.value.reset()},q=M(()=>l.orderInfo.orderType),ue=async()=>{var t;try{const{data:s}=await f.get("/edu-app/open/userOrder/registerGoods/"+e.schoolId,{noAuthorization:!0});g.setVip(s.details||[]),e.details=Me(s.details||[]),e.registerDetails=s,e.registerExpireTime=s.registerExpireTime,e.registerExpireTime&&(N(new Date).isBefore(e.registerExpireTime)?(e.activeOverStatus=!1,e.activeOverTime=N(e.registerExpireTime).diff(N(new Date)),I.reset(e.activeOverTime),I.start()):(F(),e.activeOverStatus=!0)),e.details.length>0&&(e.detailVip=e.details[0]),e.giftVipDay=s.giftVipDay||0,e.gradeYear=s.gradeYear,e.schoolInstrumentSetType=s.schoolInstrumentSetType,e.registerType=s.registerType,r.extra.registerType=s.registerType;const u=s.schoolInstrumentList||[];if(s.schoolInstrumentSetType==="SCHOOL"){const n=(t=u[0])==null?void 0:t.instrumentCode;e.gradeList=oe(s.gradeYear,n),e.classList=G}else if(s.schoolInstrumentSetType==="GRADE")u.forEach(n=>{e.gradeList.push({text:se[n.gradeNum],value:n.gradeNum,instrumentId:n.instrumentId,instrumentCode:n.instrumentCode})}),e.gradeList.sort((n,d)=>n.value-d.value),e.classList=G;else if(s.schoolInstrumentSetType==="CLASS"){const n=[];u.forEach(y=>{n.includes(y.gradeNum)||n.push(y.gradeNum)});const d=[];n.forEach(y=>{const h={text:se[y],value:y,instrumentId:"",instrumentCode:"",instrumentName:"",classList:[]};u.forEach(c=>{y===c.gradeNum&&(h.instrumentId=c.instrumentId,h.instrumentCode=c.instrumentCode,h.instrumentName=c.instrumentName,h.classList.push({text:c.classNum+"班",value:c.classNum,instrumentCode:c.instrumentCode}))}),h.classList.sort((c,R)=>c.value-R.value),d.push(h)}),d.sort((y,h)=>y.value-h.value),e.gradeList=d,e.classList=[]}else e.gradeList=oe(s.gradeYear),e.classList=G;if(P().weixin){if(p.query.rt&&p.query.rt!==s.registerType||s.schoolStatus===0){e.showTips=!0,e.showMessage="二维码已经失效,详情请咨询学校老师",e.showButton=!1;return}}else{e.showTips=!0;return}(!e.registerExpireTime||!e.activeOverStatus)&&Te()}catch(s){}},A=M(()=>{let t=0,s=0;return g.getVip.forEach(n=>{t+=e.joinType==="digitalize"?Number(n.currentPrice):0,s+=Number(n.originalPrice)}),{amount:t,originAmount:s}}),_=(t,s)=>{e.isTipRegister=t,e.isChangeSchool=s},le=(t=!0)=>{if(L(r.username))if(r.password)if(r.extra.nickname)if([0,1].includes(r.extra.gender))if(r.extra.currentGradeNum){if(!r.extra.currentClass)return t&&T("请选择所在班级"),!0}else return t&&T("请选择所在年级"),!0;else return t&&T("请选择性别"),!0;else return t&&T("请输入学生姓名"),!0;else return t&&T("请输入验证码"),!0;else return t&&T("请输入正确的手机号码"),!0;return!1},ce=()=>{var s;const{extra:t}=r;return e.studentItem.nickname!==t.nickname&&e.isTipRegister?(a.showOtherMessage="学生姓名与上次提交信息不一致,请确认修改学生信息或创建新的学生账号",a.showOtherSchool=!0,a.showCancelButton=!0,a.showCloseButton=!0,a.cancelButtonColor="linear-gradient( 224deg, #3FE1E6 0%, #00CDD4 100%)",a.cancelButtonText="新建学生",a.confirmButtonColor="linear-gradient( 305deg, #40C8FF 0%, #3192FF 100%)",a.confirmButtonText="修改信息",a.otherType="nickname",a.messageAlign="left",!0):e.isRegister==="create"&&e.studentList.length>=e.multi_user_limit?(a.showOtherMessage=`同一手机号最多创建${e.multi_user_limit}个学生`,a.showOtherSchool=!0,a.showCancelButton=!1,a.showCloseButton=!0,a.confirmButtonColor="linear-gradient( 305deg, #40C8FF 0%, #3192FF 100%)",a.confirmButtonText="我知道了",a.otherType="limit",a.messageAlign="center",!0):e.studentItem.schoolId&&e.studentItem.schoolId!==e.registerDetails.schoolId&&!e.isChangeSchool&&e.isRegister==="update"?(a.showOtherMessage=`您已绑定<span style="color: #2B85FF">【${((s=e.studentItem)==null?void 0:s.schoolName)||""}】</span>,提交后将更换到
  2. <span style="color: #2B85FF">【${e.registerDetails.schoolName||""}】</span>
  3. ,是否确认提交?`,a.showOtherSchool=!0,a.showCloseButton=!1,a.showCancelButton=!0,a.cancelButtonColor="",a.cancelButtonText="取消",a.confirmButtonColor="",a.confirmButtonText="确定",a.otherType="change",a.messageAlign="left",!0):!1},E=async()=>{e.submitLoading=!0;try{if(le()||ce()){e.submitLoading=!1;return}const{extra:t,loginType:s,autoRegister:u,password:n,multiUser:d,...y}=r;let h=s,c=u,R=n,H=d;e.isRegister==="update"&&(h="TOKEN",c=!1,R=e.studentItem.token,H=!1);const w=await f.post("/edu-app/userlogin",{requestType:"form",data:{loginType:h,autoRegister:c,password:R,multiUser:H,...y,extra:JSON.stringify({...t,giftVipDay:e.detailVip.membershipDays||0+e.giftVipDay||0,schoolId:e.schoolId})}});if(w.code!==200)w.code===5436?(e.showTips=!0,e.showMessage="二维码已经失效,详情请咨询学校老师",e.showButton=!1):w.code===5435?(e.showTips=!0,e.showMessage=w.message,e.showButton=!0):w.code===5437&&(e.showTips=!0,e.showMessage='<p style="color: #F44541">报名已截止,感谢您的参与</p>',e.showButton=!1);else{g.setToken(w.data.token_type+" "+w.data.access_token),De();let U="NOT_REGISTER";e.joinType==="digitalize"&&(U="SELECT_INSTRUMENT"),e.joinType==="tradition"&&(U="NOT_BUY_INSTRUMENT");const W=await $(B.counter.value,U,w.data.userId,e.schoolId);e.saveId=W,e.saveUserId=W,B.counter.value=0;const we=await f.get("/edu-app/user/getUserInfo",{requestType:"form"});je(we.data),await Y()}}catch(t){_(e.isRegister!=="create",!1)}finally{e.submitLoading=!1}},j=async()=>{try{const{extra:t,username:s}=r,u=await f.post("/edu-app/student/register",{data:{schoolId:e.schoolId,clientType:"STUDENT",...t,giftVipFlag:e.registerDetails.giftVipFlag||!1,giftVipDay:e.giftVipDay||0,schoolVerify:!0,firstVipDay:e.detailVip.membershipDays||0,mobile:s,newRegUser:e.isRegister==="create"}});return u.code!==200?(u.code===5436?(e.showTips=!0,e.showMessage="二维码已经失效,详情请咨询学校老师",e.showButton=!1):u.code===5435?(e.showTips=!0,e.showMessage=u.message,e.showButton=!0):u.code===5437&&(e.showTips=!0,e.showMessage='<p style="color: #F44541">报名已截止,感谢您的参与</p>',e.showButton=!1),!1):!0}catch(t){}},Y=async()=>{try{if(await pe())return;const s=await f.get("/edu-app/userPaymentOrder/registerStatus/"+e.schoolId),u=g.getVip;if(e.joinType==="tradition"){if(!await j())return;setTimeout(()=>{T("报名成功")},100),setTimeout(()=>{P().weixin&&window.WeixinJSBridge.call("closeWindow")},1e3);return}if(s.data.hasBuyCourse&&u.length>0){a.showOtherMessage="该学员已购买会员,是否再次购买?",a.showOtherSchool=!0,a.showCloseButton=!1,a.showCancelButton=!0,a.cancelButtonColor="",a.cancelButtonText="取消",a.confirmButtonColor="",a.confirmButtonText="确定",a.otherType="member",a.messageAlign="center";return}await O()}catch(t){_(e.isRegister!=="create",!1)}},de=async()=>{if(!(r.password.length!==6||!L(r.username)))try{const{data:t}=await f.get(`/edu-app/open/student/studentInfo?mobile=${r.username}&code=${r.password}&type=REGISTER`);if(e.studentList=t||[],e.studentList.length>0){const s=e.studentList[0];e.studentItem=s,r.extra.nickname=s.nickname;const u=e.gradeList||[];u==null||u.forEach(n=>{n.value===s.currentGradeNum&&(e.instrumentCode=n.instrumentCode,e.gradeNumText=n.text,r.extra.currentGradeNum=s.currentGradeNum,e.schoolInstrumentSetType==="CLASS"&&(e.classList=n.classList))}),e.classList.forEach(n=>{n.value===s.currentClass&&(e.currentClassText=n.text,r.extra.currentClass=s.currentClass)}),r.extra.gender=s.gender,e.isRegister="update",_(!0,!1)}else e.isRegister="create",_(!1,!1),e.studentItem=[]}catch(t){}},pe=async()=>{let t=!1;try{const{data:s}=await f.get("/edu-app/userPaymentOrder/schoolRegisterOrder?schoolId="+e.schoolId);if(s&&s.length>0){let u=!1,n={},d={},y=!1,h={};return s.forEach(c=>{(c.status==="PAYING"||c.status==="WAIT_PAY")&&(u=!0,n=c.paymentConfig,d=c),(c.status==="PAID"||c.status==="PART_REFUNDED"||c.status==="REFUNDED")&&(y=!0,h=c.paymentConfig)}),y&&e.joinType==="tradition"?(setTimeout(()=>{T("您已报名成功,请勿重复报名")},100),!0):u&&e.joinType==="tradition"?(e.dialogConfig=n,await k()&&E(),!0):u&&e.joinType==="digitalize"?(e.dialogConfig=n,await k()&&await O(),!0):!1}else return!1}catch(s){_(e.isRegister!=="create",!1)}return t},me=async()=>{var t;try{const s=(t=e.dialogConfig)==null?void 0:t.orderNo;if(!s)return;await f.post("/edu-app/userPaymentOrder/cancelPayment/"+s),await Y()}catch(s){}},k=async()=>{var t;try{const s=(t=e.dialogConfig)==null?void 0:t.orderNo;return s?(await f.post("/edu-app/userPaymentOrder/cancelPayment/"+s),!0):void 0}catch(s){return!1}},O=async()=>{try{const t=g.getVip,s=[];if(t.forEach(d=>{s.push({giftVipDay:d.membershipDays,giftPeriod:d.giftPeriod,goodsId:d.goodsId,goodsNum:1,goodsType:d.goodsType,paymentCashAmount:d.currentPrice,paymentCouponAmount:0})}),!await j())return;const n=await f.post("/edu-app/userPaymentOrder/executeOrder",{data:{buryId:e.saveUserId,registerType:e.registerType,paymentType:e.paymentType,bizId:e.schoolId,orderType:"SCHOOL_REGISTER",paymentCashAmount:A.value.amount||0,paymentCouponAmount:0,goodsInfos:s,orderName:"学生登记",orderDesc:"学生登记"}});n.code===5436?(e.showTips=!0,e.showMessage="二维码已经失效,详情请咨询学校老师",e.showButton=!1):n.code===5435?(e.showTips=!0,e.showMessage=n.message,e.showButton=!0):(l.config={...n.data.paymentConfig,paymentType:n.data.paymentType},l.orderNo=n.data.orderNo,await Q())}catch(t){console.log(t,"any"),_(e.isRegister!=="create",!1)}},Q=async()=>{try{const t=Oe.user.data;if(e.contract_sign&&(!(t!=null&&t.account.realName)||!(t!=null&&t.account.idCardNo))){l.authShow=!0;return}const{data:s}=await f.post("/edu-app/userPaymentOrder/updateReceiveAddress",{data:{orderNo:l.orderNo,orderType:"SCHOOL_REGISTER"}});l.pay_channel=s.paymentChannel,s.status!=="WAIT_PAY"&&s.status!=="PAYING"?S.replace({path:"/payment-result",query:{orderNo:l.orderNo}}):ge()}catch(t){_(e.isRegister!=="create",!1)}},ge=()=>{const t=l.pay_channel;if(t){const s=Je(l.pay_channel);V({payCode:s,pay_channel:t})}else q.value==="VIP"?l.paymentStatus=!0:V({payCode:"payResult",pay_channel:e.paymentChannel})},V=t=>{const s=l.config;l.pay_channel=t.pay_channel;const u=X.stringify({pay_channel:t.pay_channel,wxAppId:s.wxAppId,alipayAppId:s.alipayAppId,paymentType:e.paymentType,body:s.body,price:s.price,orderNo:s.merOrderNo,userId:s.userId});t.payCode==="payResult"?window.location.href=window.location.origin+"/classroom-app/#/payResult?"+u:(l.qrCodeUrl=window.location.origin+"/classroom-app/#/payDefine?"+u,l.showQrcode=!0,l.paymentStatus=!1,setTimeout(()=>{ye()},300))},fe=async()=>{try{await f.post("/edu-app/userPaymentOrder/cancelPayment/"+l.orderNo)}catch(t){}},ye=async()=>{const t=setInterval(async()=>{if(p.name!="student-register-form"){clearInterval(t);return}l.orderTimer=t;try{const{data:s}=await f.post("/edu-app/open/userOrder/paymentStatus/"+l.orderNo,{hideLoading:!0});s.status!=="WAIT_PAY"&&s.status!=="PAYING"&&(l.showQrcode=!1,clearInterval(l.orderTimer),setTimeout(()=>{S.replace({path:"/payment-result",query:{orderNo:l.orderNo}})},100))}catch(s){clearInterval(l.orderTimer)}},5e3)},he=()=>{l.authShow=!1,O()},$=async(t=5,s,u,n)=>{try{const{data:d}=await Ue.post("/edu-app/open/studentRegisterPointRecord/update",{data:{id:e.saveId,useTime:t,joinType:s,userId:u,schoolId:n}});return e.saveId=d,d}catch(d){}},_e=async t=>{try{const{data:s}=await f.get("/edu-app/open/paramConfig/wechatAppId");s&&(ze(),Re(s,t))}catch(s){}};if(P().weixin){const t=sessionStorage.getItem("active-open-id");e.openId=t;const s=Be();if(s)e.code=s;else{const u=window.location.origin+window.location.pathname+"#"+p.path+"?"+X.stringify({...p.query});return _e(u),""}}const z=t=>t>9?t+"":"0"+t,Te=async()=>{try{if(!e.code)return;const{data:t}=await f.post("/edu-app/open/studentRegisterPointRecord/save",{data:{code:e.code,schoolId:e.schoolId,openId:e.openId}});e.saveId=t.id,e.openId=t.openId,sessionStorage.setItem("active-open-id",t.openId),e.intervalFnRef=st(async()=>{B.counter.value=0,B.resume(),await $()},5e3)}catch(t){}},Se=()=>{r.password="",r.extra.nickname="",r.extra.currentGradeNum="",r.extra.currentClass="",r.extra.gender=1,e.currentClassText="",e.gradeNumText="",e.studentList=[],e.studentItem={},e.isRegister="create",e.isTipRegister=!1,e.isChangeSchool=!1};return Fe(async()=>{try{let t=null;const{data:s}=await f.get("/edu-app/open/paramConfig/queryByParamNameList",{requestType:"form",params:{paramNames:"payment_service_provider,contract_sign,multi_user_limit,qr_code_expire_time"}});s&&Array.isArray(s)&&s.forEach(n=>{if(n.paramName==="contract_sign")e.contract_sign=n.paramValue==="1";else if(n.paramName==="payment_service_provider"){const d=JSON.parse(n.paramValue);e.paymentType=d.vendor,e.paymentChannel=d.channel}else n.paramName==="multi_user_limit"?e.multi_user_limit=n.paramValue?Number(n.paramValue):1:n.paramName==="qr_code_expire_time"&&(t=n.paramValue?Number(n.paramValue):null)});const u=p.query.t;u&&t!==null&&N(Number(u)).add(t,"day").isBefore(N())&&(e.showTips=!0,e.showMessage="二维码已经失效,详情请咨询学校老师",e.showButton=!1),await ue()}catch(t){}}),Ae(()=>{var t;(t=e.intervalFnRef)==null||t.pause()}),()=>o("div",{class:i["student-register"]},[o("div",{class:i.studentRegisterContainer},[!e.activeOverStatus&&o("div",{class:i.countdownSection},[o("div",{class:i.timer},[o("img",{src:Le,class:i.timerTitle},null),o("div",{class:i.timerAll},[o("span",null,[z(I.current.value.days)]),m("天"),o("span",null,[z(I.current.value.hours)]),m("时"),o("span",null,[z(I.current.value.minutes)]),m("分"),o("span",null,[z(I.current.value.seconds)]),m("秒")])]),o("div",{class:i.timerTip},[m("为了确保您能顺利参与学习,请在规定时间内报名")])]),o("div",{class:[i.studentSection,i.studentSectionForm,e.giftVipDay<=0&&i.noSendDay]},[o(ot,{labelAlign:"left",class:i.registerForm},{default:()=>[o(x,{clearable:!1,label:"联系方式(直接监护人)",placeholder:"请输入手机号码",type:"tel",required:!0,autocomplete:"off",inputAlign:"right",class:i.username,modelValue:r.username,"onUpdate:modelValue":[t=>r.username=t,()=>{Se()}],border:!1,maxlength:11},{label:()=>o("div",null,[m("联系方式"),o("p",{class:i.tips},[m("(直接监护人)")])])}),o("div",{class:["van-hairline--bottom",i.fieldTipsGroup]},[o("div",{class:[i.fieldTips]},[o("i",{class:i.iconQuestion},null),m("手机号是音乐数字课堂的唯一登录账户")])]),o(x,{center:!0,clearable:!1,required:!0,inputAlign:"right",label:"验证码",placeholder:"请输入验证码",autocomplete:"off",type:"number",modelValue:r.password,"onUpdate:modelValue":[t=>r.password=t,t=>{de()}],maxlength:6},{button:()=>e.countDownStatus?o("span",{class:[i.codeText,re.value?"":i.codeTextDisabled],onClick:ne},[m("获取验证码")]):o(at,{ref:t=>C.value=t,"auto-start":!1,class:i.countDown,time:e.countDownTime,onFinish:ie,format:"ss秒后重试"},null)}),o(x,{clearable:!1,required:!0,inputAlign:"right",label:"学生姓名",placeholder:"请输入学生姓名",autocomplete:"off",maxlength:14,modelValue:r.extra.nickname,"onUpdate:modelValue":t=>r.extra.nickname=t},{extra:()=>e.studentList.length>1&&o("div",{class:[i.selectStudentGroup,e.showSelectStudent&&i.selectStudentGroupChecked],onClick:()=>e.showSelectStudent=!0},[o("span",null,[e.studentItem.userId?"切换":"新增"])])}),o(x,{clearable:!1,required:!0,inputAlign:"right",label:"学生性别",placeholder:"请选择性别",autocomplete:"off"},{input:()=>o(nt,{"checked-color":"linear-gradient( 135deg, #31C7FF 0%, #007AFE 100%)",modelValue:r.extra.gender,"onUpdate:modelValue":t=>r.extra.gender=t,direction:"horizontal"},{default:()=>[o(ee,{size:"large",type:"primary",color:r.extra.gender!==1?"#F5F6FA":"linear-gradient( 135deg, #31C7FF 0%, #007AFE 100%)",textColor:r.extra.gender!==1?"#626264":"#fff",class:i.radioSection},{default:()=>[o(Z,{class:i.radioItem,name:1},null),m("男")]}),o(ee,{size:"large",type:"primary",color:r.extra.gender!==0?"#F5F6FA":"linear-gradient( 135deg, #31C7FF 0%, #007AFE 100%)",textColor:r.extra.gender!==0?"#626264":"#fff",class:i.radioSection},{default:()=>[o(Z,{class:i.radioItem,name:0},null),m("女")]})]})}),o(x,{clearable:!1,required:!0,inputAlign:"right",label:"所在年级",placeholder:"请选择年级",isLink:!0,readonly:!0,clickable:!1,modelValue:e.gradeNumText,onClick:()=>{e.gradePopupIndex=[r.extra.currentGradeNum],e.gradeStatus=!0}},null),o(x,{clearable:!1,required:!0,inputAlign:"right",label:"所在班级",placeholder:"请选择班级",isLink:!0,readonly:!0,clickable:!1,modelValue:e.currentClassText,onClick:()=>{if(e.schoolInstrumentSetType==="CLASS"&&e.classList.length<=0){T("请先选择年级");return}e.classPopupIndex=[r.extra.currentClass],e.classStatus=!0}},null),e.giftVipDay>0?o("div",{class:i.memberNumer},[o("img",{src:Qe,class:i.iconGift},null),o("p",null,[m("注册成功即可获得乐器AI学练工具"),o("span",null,[e.giftVipDay||0]),m("天有效期")])]):""]})]),o("div",{class:[i.goodsExtra]},[o(rt,{border:!1,class:[i.goodsCell,e.registerType==="SELECT_BUY_GOODS"&&i.goodsBuyGoods],center:!0,onClick:()=>{e.registerType==="SELECT_BUY_GOODS"&&(e.joinType==="digitalize"?(a.showOtherMessage="没有陪练工具,将无法实现同步练习",a.showOtherSchool=!0,a.showCloseButton=!0,a.showCancelButton=!0,a.cancelButtonColor="",a.cancelButtonText="确认取消",a.confirmButtonColor="",a.confirmButtonText="放弃取消",a.otherType="payment",a.messageAlign="center"):e.joinType==="tradition"&&(e.joinType="digitalize"))}},{icon:()=>e.registerType==="SELECT_BUY_GOODS"&&o("div",{class:i.checkedGroup},[o("i",{class:[i.iconChecked,e.joinType==="digitalize"&&i.selected]},null),e.joinType==="digitalize"&&o("i",{class:i.showBg},null)]),title:()=>o("div",{class:i.section},[o(it,{class:i.img,src:e.detailVip.goodsUrl||Ss},null),o("div",{class:i.sectionContent},[o("img",{src:e.registerType==="SELECT_BUY_GOODS"?ws:Cs,class:i.goodsName},null)])])})]),e.detailVip.membershipDays?o("div",{class:i.vipGiftContainer},[o("img",{src:Ge,class:i.iconGift},null),o("p",null,[m("现在购买额外赠送有效期"),o("div",null,[o("span",{class:i.vipGiftNum},[e.detailVip.membershipDays||0]),o("span",{class:i.vipGiftPreviod},[ke[e.detailVip.giftPeriod]])])])]):"",e.joinType&&o(be,{position:"bottom",ref:v},{default:()=>[o("div",{class:i.paymentContainer},[o("div",{class:i.payemntPrice},[o("img",{src:Ve,class:i.giftTip},null),o("div",null,[o("span",{class:i.needPrice},[o("i",{style:"font-style: normal"},[m("¥ ")]),o("span",null,[K(A.value.amount)]),o("i",{class:i.unit,style:"font-style: normal"},[m("/年")])]),A.value.originAmount>A.value.amount&&e.joinType==="digitalize"?o("del",{class:i.allPrice},[m("¥ "),K(A.value.originAmount)]):""])]),o("div",{class:i.paymentBtn,onClick:()=>{E()}},[o(Ee,{round:!0,disabled:e.submitLoading,loading:e.submitLoading},{default:()=>[e.joinType==="digitalize"?"报名与支付":"提交报名"]})])])]})]),e.imgCodeStatus?o(Xe,{value:e.imgCodeStatus,"onUpdate:value":t=>e.imgCodeStatus=t,phone:r.username,type:"REGISTER",onClose:()=>{e.imgCodeStatus=!1},onSendCode:ae},null):null,o(D,{show:e.gradeStatus,"onUpdate:show":t=>e.gradeStatus=t,position:"bottom",round:!0,safeAreaInsetBottom:!0,lazyRender:!1,class:"popupBottomSearch",onOpen:()=>{e.gradePopupShow=!0},onClosed:()=>{e.gradePopupShow=!1}},{default:()=>[e.gradePopupShow&&o(te,{showToolbar:!0,modelValue:e.gradePopupIndex,"onUpdate:modelValue":t=>e.gradePopupIndex=t,columns:e.gradeList,onCancel:()=>e.gradeStatus=!1,onConfirm:t=>{const s=t.selectedOptions[0];r.extra.currentGradeNum=s.value,e.gradeNumText=s.text,e.gradeStatus=!1,["SCHOOL","GRADE"].includes(e.schoolInstrumentSetType)&&(e.instrumentCode=s.instrumentCode),e.schoolInstrumentSetType==="CLASS"&&(e.classList=s.classList),["CLASS","GRADE"].includes(e.schoolInstrumentSetType)&&(e.currentClassText="",r.extra.currentClass="")}},null)]}),o(D,{show:e.classStatus,"onUpdate:show":t=>e.classStatus=t,position:"bottom",round:!0,class:"popupBottomSearch",onOpen:()=>{e.classPopupShow=!0},onClosed:()=>{e.classPopupShow=!1}},{default:()=>[e.classPopupShow&&o(te,{showToolbar:!0,modelValue:e.classPopupIndex,"onUpdate:modelValue":t=>e.classPopupIndex=t,columns:e.classList,onCancel:()=>e.classStatus=!1,onConfirm:t=>{const s=t.selectedOptions[0];r.extra.currentClass=s.value,e.currentClassText=s.text,e.classStatus=!1,["CLASS"].includes(e.schoolInstrumentSetType)&&(e.instrumentCode=s.instrumentCode)}},null)]}),o(Ye,{title:"提示",show:e.dialogStatus,"onUpdate:show":t=>e.dialogStatus=t,message:e.dialogMessage,allowHtml:!0,primaryColor:"#FF8057",showCancelButton:!0,messageAlign:e.messageAlign,confirmButtonText:e.confirmButtonText,cancelButtonText:e.cancelButtonText,onConfirm:async()=>{if(e.joinType==="tradition"&&(await k(),e.registerExpireTime&&e.activeOverStatus&&F()),e.joinType==="digitalize"){const t=e.dialogConfig;if(l.config=t==null?void 0:t.paymentConfig,l.orderNo=t==null?void 0:t.orderNo,!await j())return;await Q()}},onCancel:t=>{e.joinType==="tradition"&&(e.dialogStatus=!1,e.registerExpireTime&&e.activeOverStatus&&F()),e.joinType==="digitalize"&&me()}},null),o(D,{show:l.paymentStatus,closeOnClickOverlay:!1,position:"bottom",round:!0,closeOnPopstate:!0,safeAreaInsetBottom:!0,style:{minHeight:"30%"}},{default:()=>[o($e,{paymentConfig:l.orderInfo,onClose:()=>l.paymentStatus=!1,onBackOut:fe,onConfirm:t=>V(t)},null)]}),o(D,{show:l.showQrcode,"onUpdate:show":t=>l.showQrcode=t,round:!0,onClose:()=>{clearInterval(l.orderTimer)}},{default:()=>[o(He,{url:l.qrCodeUrl,pay_channel:l.pay_channel,orderType:q.value},null)]}),o(Ke,{modelValue:l.authShow,"onUpdate:modelValue":t=>l.authShow=t},{default:()=>[o(We,{onSuccess:he,hideHeader:!P().isApp},null)]}),o(qe,{show:e.showTips,message:e.showMessage,showButton:e.showButton,buttonText:"刷新",onConfirm:()=>window.location.reload()},null),o(Ze,{show:a.showOtherSchool,messageAlign:a.messageAlign,message:a.showOtherMessage,showCancelButton:a.showCancelButton,cancelButtonColor:a.cancelButtonColor,cancelButtonText:a.cancelButtonText,confirmButtonColor:a.confirmButtonColor,confirmButtonText:a.confirmButtonText,onClose:()=>a.showOtherSchool=!1,onCancel:async()=>{if(a.showOtherSchool=!1,a.otherType==="nickname")e.isRegister="create",_(!1,!1),E();else if(a.otherType==="member"){if(!await j())return;e.registerExpireTime&&e.activeOverStatus&&F()}else a.otherType==="payment"&&(e.joinType="tradition")},onConfirm:async()=>{a.showOtherSchool=!1,a.otherType==="nickname"?(e.isRegister="update",_(!1,!1),E()):a.otherType==="change"?(e.isChangeSchool=!0,E()):a.otherType==="limit"?_(!(e.isRegister==="create"&&!e.studentItem.userId),!1):a.otherType==="member"&&await O()}},null),o(D,{show:e.showSelectStudent,"onUpdate:show":t=>e.showSelectStudent=t,round:!0,position:"bottom",safeAreaInsetBottom:!0,closeable:!0},{default:()=>[o(et,{studentItem:e.studentItem,list:e.studentList,onClose:()=>e.showSelectStudent=!1,onConfirm:t=>{if(t.userId){e.studentItem=t;const s=t;r.extra.nickname=s.nickname;const u=e.gradeList||[];r.extra.currentGradeNum=null,e.gradeNumText="",e.instrumentCode="",u==null||u.forEach(n=>{n.value===s.currentGradeNum&&(e.instrumentCode=n.instrumentCode,e.gradeNumText=n.text,r.extra.currentGradeNum=s.currentGradeNum,e.schoolInstrumentSetType==="CLASS"&&(e.classList=n.classList))}),r.extra.currentClass=null,e.currentClassText="",e.classList.forEach(n=>{n.value===s.currentClass&&(e.currentClassText=n.text,r.extra.currentClass=s.currentClass)}),r.extra.gender=s.gender,e.isRegister="update",_(!0,!1),e.showSelectStudent=!1}else{if(e.studentList.length>=e.multi_user_limit)return a.showOtherMessage=`同一手机号最多创建${e.multi_user_limit}个学生`,a.showOtherSchool=!0,a.showCancelButton=!1,a.showCloseButton=!0,a.confirmButtonColor="linear-gradient( 305deg, #40C8FF 0%, #3192FF 100%)",a.confirmButtonText="我知道了",a.otherType="limit",a.messageAlign="center",!0;e.studentItem=t,e.isRegister="create",_(!1,!1),r.extra.nickname="",r.extra.currentGradeNum="",r.extra.currentClass="",r.extra.gender=1,e.currentClassText="",e.gradeNumText="",e.showSelectStudent=!1}}},null)]})])}});export{Zs as default};