index-apply-23353212.js 30 KB

123
  1. import{d as Ie,P as xe,q as Be,r as J,x as L,al as ve,e as q,U as P,bg as Fe,Y as K,y as Ae,D as g,ac as N,Q as Ee,a as o,A as m,N as T,X,C as Ne,S as D,z as De,M as k,bh as be,J as Re,K as ze,$ as Oe,bi as Le}from"./index-0a267f11.js";import{M as Pe}from"./index-c524ffdb.js";import{u as ke}from"./student-register-store-92cc72f4.js";import{i as Ge,t as Ve,r as Me}from"./icon-3-d0fe50a1.js";import{d as Ue}from"./deep-clone-c0d00fc2.js";import{M as qe}from"./index-1c1b31a9.js";import{O as je}from"./index-bb603e3e.js";import{i as Z}from"./icon-gift-20293d47.js";import{P as Ye,Q as Qe,U as $e,b as He}from"./user-auth-088e8bb5.js";import{M as We}from"./index-03ce731f.js";import{O as Je}from"./index-e1e37707.js";import{M as Ke}from"./index-b2de799a.js";import{S as Xe}from"./index-5eadb578.js";import{b as Ze,c as et}from"./index-b59303b6.js";import{F as tt}from"./index-e91eb35c.js";import{F as x}from"./index-da36ca85.js";import{C as st}from"./index-d9a4476f.js";import{R as ot,a as ee}from"./index-fa73e071.js";import{T as te}from"./index-61be2044.js";import{C as at}from"./index-8d862166.js";import{I as nt}from"./index-df9fbb6b.js";import{P as se}from"./index-ea02b664.js";import"./index-cec09b0d.js";import"./index-01460a0f.js";import"./browser-e949d08f.js";import"./index-c6fb21e9.js";import"./Checker-b2be5d0a.js";const rt="_studentRegisterContainer_yu1fz_8",ut="_countdownSection_yu1fz_13",it="_timer_yu1fz_32",lt="_timerAll_yu1fz_37",ct="_timerTitle_yu1fz_60",dt="_timerTip_yu1fz_66",pt="_paymentContainer_yu1fz_78",mt="_giftTip_yu1fz_88",ft="_needPrice_yu1fz_92",gt="_unit_yu1fz_109",ht="_allPrice_yu1fz_112",yt="_traditionBtn_yu1fz_131",_t="_studentSection_yu1fz_139",Tt="_studentSectionForm_yu1fz_146",St="_noSendDay_yu1fz_150",wt="_title1_yu1fz_153",Ct="_title3_yu1fz_154",It="_title2_yu1fz_161",xt="_goodsGroup_yu1fz_172",Bt="_goodsItem_yu1fz_177",vt="_goodsInner_yu1fz_191",Ft="_checked_yu1fz_195",At="_checked1_yu1fz_201",Et="_proposalTip_yu1fz_207",Nt="_registerForm_yu1fz_221",Dt="_selectStudentGroup_yu1fz_225",bt="_selectStudentGroupChecked_yu1fz_233",Rt="_fieldTipsGroup_yu1fz_253",zt="_fieldTips_yu1fz_253",Ot="_iconQuestion_yu1fz_267",Lt="_tips_yu1fz_276",Pt="_username_yu1fz_283",kt="_countDown_yu1fz_292",Gt="_codeText_yu1fz_312",Vt="_memberNumer_yu1fz_316",Mt="_iconGift_yu1fz_327",Ut="_radioSection_yu1fz_342",qt="_radioItem_yu1fz_351",jt="_goodsSection_yu1fz_362",Yt="_iconArrow_yu1fz_373",Qt="_goodsExtra_yu1fz_380",$t="_goodsCell_yu1fz_419",Ht="_iconChecked_yu1fz_424",Wt="_selected_yu1fz_433",Jt="_checkedGroup_yu1fz_437",Kt="_showBg_yu1fz_441",Xt="_img_yu1fz_451",Zt="_section_yu1fz_467",es="_goodsName_yu1fz_471",ts="_brandName_yu1fz_476",ss="_sectionContent_yu1fz_488",os="_model_yu1fz_491",as="_sendInstrument_yu1fz_511",ns="_moreBtn_yu1fz_515",rs="_sbtnGroup_yu1fz_522",us="_goodsTradition_yu1fz_534",is="_goodsTitle_yu1fz_546",ls="_step_yu1fz_553",cs="_stepContent_yu1fz_573",ds="_nums_yu1fz_584",ps="_numInner_yu1fz_595",ms="_selectStudentPopup_yu1fz_607",u={"student-register":"_student-register_yu1fz_1",studentRegisterContainer:rt,countdownSection:ut,timer:it,timerAll:lt,timerTitle:ct,timerTip:dt,paymentContainer:pt,giftTip:mt,needPrice:ft,unit:gt,allPrice:ht,traditionBtn:yt,studentSection:_t,studentSectionForm:Tt,noSendDay:St,title1:wt,title3:Ct,title2:It,goodsGroup:xt,goodsItem:Bt,goodsInner:vt,checked:Ft,checked1:At,proposalTip:Et,registerForm:Nt,selectStudentGroup:Dt,selectStudentGroupChecked:bt,fieldTipsGroup:Rt,fieldTips:zt,iconQuestion:Ot,tips:Lt,username:Pt,countDown:kt,codeText:Gt,memberNumer:Vt,iconGift:Mt,radioSection:Ut,radioItem:qt,goodsSection:jt,iconArrow:Yt,goodsExtra:Qt,goodsCell:$t,iconChecked:Ht,selected:Wt,checkedGroup:Jt,showBg:Kt,img:Xt,section:Zt,goodsName:es,brandName:ts,sectionContent:ss,model:os,sendInstrument:as,moreBtn:ns,sbtnGroup:rs,goodsTradition:us,goodsTitle:is,step:ls,stepContent:cs,nums:ds,numInner:ps,selectStudentPopup:ms},fs=""+new URL("icon-5-e35db738.png",import.meta.url).href,G=[];for(let p=1;p<=40;p++)G.push({text:p+"班",value:p});const oe={1:"一年级",2:"二年级",3:"三年级",4:"四年级",5:"五年级",6:"六年级",7:"七年级",8:"八年级",9:"九年级"},ae=(p,f)=>{let S=[];const C=[{text:"一年级",value:1,instrumentCode:f},{text:"二年级",value:2,instrumentCode:f},{text:"三年级",value:3,instrumentCode:f},{text:"四年级",value:4,instrumentCode:f},{text:"五年级",value:5,instrumentCode:f}],B=[{text:"六年级",value:6,instrumentCode:f}],e=[{text:"七年级",value:7,instrumentCode:f},{text:"八年级",value:8,instrumentCode:f},{text:"九年级",value:9,instrumentCode:f}];return p==="FIVE_YEAR_SYSTEM"?S.push(...C):p==="SIX_YEAR_SYSTEM"?S.push(...C,...B):p==="THREE_YEAR_SYSTEM"?S.push(...e):p==="FORE_YEAR_SYSTEM"?S.push(...B,...e):S.push(...C,...B,...e),S},Us=Ie({name:"student-register",setup(){const p=xe(),f=ke(),S=Be();f.setShoolId(p.query.sId);const C=J(),B=J(),e=L({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=L({showOtherSchool:!1,showCloseButton:!0,showOtherMessage:"",otherType:"",showCancelButton:!0,cancelButtonColor:"",cancelButtonText:"取消",showConfirmButton:!0,confirmButtonColor:"",confirmButtonText:"确定",messageAlign:"left"}),l=L({showQrcode:!1,qrCodeUrl:"",pay_channel:"",orderInfo:{},authShow:!1,orderNo:null,config:{},paymentStatus:!1,orderTimer:null}),r=L({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:""}),v=Ze(1e3,{controls:!0});v.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()},ne=()=>{e.countDownStatus=!1,De(()=>{C.value.start()})},re=()=>{if(!k(r.username))return T("请输入正确的手机号码");e.imgCodeStatus=!0},ue=q(()=>!!k(r.username)),ie=()=>{e.countDownStatus=!0,C.value.reset()},j=q(()=>l.orderInfo.orderType),le=async()=>{var t;try{const{data:s}=await g.get("/edu-app/open/userOrder/registerGoods/"+e.schoolId,{noAuthorization:!0});f.setVip(s.details||[]),e.details=Ue(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 i=s.schoolInstrumentList||[];if(s.schoolInstrumentSetType==="SCHOOL"){const n=(t=i[0])==null?void 0:t.instrumentCode;e.gradeList=ae(s.gradeYear,n),e.classList=G}else if(s.schoolInstrumentSetType==="GRADE")i.forEach(n=>{e.gradeList.push({text:oe[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=[];i.forEach(h=>{n.includes(h.gradeNum)||n.push(h.gradeNum)});const d=[];n.forEach(h=>{const y={text:oe[h],value:h,instrumentId:"",instrumentCode:"",instrumentName:"",classList:[]};i.forEach(c=>{h===c.gradeNum&&(y.instrumentId=c.instrumentId,y.instrumentCode=c.instrumentCode,y.instrumentName=c.instrumentName,y.classList.push({text:c.classNum+"班",value:c.classNum,instrumentCode:c.instrumentCode}))}),y.classList.sort((c,O)=>c.value-O.value),d.push(y)}),d.sort((h,y)=>h.value-y.value),e.gradeList=d,e.classList=[]}else e.gradeList=ae(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)&&Se()}catch(s){}},A=q(()=>{let t=0,s=0;return f.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},ce=(t=!0)=>{if(k(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},de=()=>{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(ce()||de()){e.submitLoading=!1;return}const{extra:t,loginType:s,autoRegister:i,password:n,multiUser:d,...h}=r;let y=s,c=i,O=n,H=d;e.isRegister==="update"&&(y="TOKEN",c=!1,O=e.studentItem.token,H=!1);const w=await g.post("/edu-app/userlogin",{requestType:"form",data:{loginType:y,autoRegister:c,password:O,multiUser:H,...h,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{f.setToken(w.data.token_type+" "+w.data.access_token),be();let U="NOT_REGISTER";e.joinType==="digitalize"&&(U="SELECT_INSTRUMENT"),e.joinType==="tradition"&&(U="NOT_BUY_INSTRUMENT");const W=await $(v.counter.value,U,w.data.userId,e.schoolId);e.saveId=W,e.saveUserId=W,v.counter.value=0;const Ce=await g.get("/edu-app/user/getUserInfo",{requestType:"form"});Re(Ce.data),await Y()}}catch(t){_(e.isRegister!=="create",!1)}finally{e.submitLoading=!1}},b=async()=>{try{const{extra:t,username:s}=r,i=await g.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 i.code!==200?(i.code===5436?(e.showTips=!0,e.showMessage="二维码已经失效,详情请咨询学校老师",e.showButton=!1):i.code===5435?(e.showTips=!0,e.showMessage=i.message,e.showButton=!0):i.code===5437&&(e.showTips=!0,e.showMessage='<p style="color: #F44541">报名已截止,感谢您的参与</p>',e.showButton=!1),!1):!0}catch(t){}},Y=async()=>{try{if(await me())return;const s=await g.get("/edu-app/userPaymentOrder/registerStatus/"+e.schoolId),i=f.getVip;if(e.joinType==="tradition"){if(!await b())return;setTimeout(()=>{T("报名成功")},100),setTimeout(()=>{P().weixin&&window.WeixinJSBridge.call("closeWindow")},1e3);return}if(s.data.hasBuyCourse&&i.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 R()}catch(t){_(e.isRegister!=="create",!1)}},pe=async()=>{if(!(r.password.length!==6||!k(r.username)))try{const{data:t}=await g.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 i=e.gradeList||[];i==null||i.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){}},me=async()=>{let t=!1;try{const{data:s}=await g.get("/edu-app/userPaymentOrder/schoolRegisterOrder?schoolId="+e.schoolId);if(s&&s.length>0){let i=!1,n={},d={},h=!1,y={};return s.forEach(c=>{(c.status==="PAYING"||c.status==="WAIT_PAY")&&(i=!0,n=c.paymentConfig,d=c),(c.status==="PAID"||c.status==="PART_REFUNDED"||c.status==="REFUNDED")&&(h=!0,y=c.paymentConfig)}),h&&e.joinType==="tradition"?(setTimeout(()=>{T("您已报名成功,请勿重复报名")},100),!0):i&&e.joinType==="tradition"?(e.dialogConfig=n,await V()&&E(),!0):i&&e.joinType==="digitalize"?(e.dialogConfig=n,await V()&&await R(),!0):!1}else return!1}catch(s){_(e.isRegister!=="create",!1)}return t},fe=async()=>{var t;try{const s=(t=e.dialogConfig)==null?void 0:t.orderNo;if(!s)return;await g.post("/edu-app/userPaymentOrder/cancelPayment/"+s),await Y()}catch(s){}},V=async()=>{var t;try{const s=(t=e.dialogConfig)==null?void 0:t.orderNo;return s?(await g.post("/edu-app/userPaymentOrder/cancelPayment/"+s),!0):void 0}catch(s){return!1}},R=async()=>{try{const t=f.getVip,s=[];if(t.forEach(d=>{s.push({giftVipDay:d.membershipDays,goodsId:d.goodsId,goodsNum:1,goodsType:d.goodsType,paymentCashAmount:d.currentPrice,paymentCouponAmount:0})}),!await b())return;const n=await g.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=ze.user.data;if(e.contract_sign&&(!(t!=null&&t.account.realName)||!(t!=null&&t.account.idCardNo))){l.authShow=!0;return}const{data:s}=await g.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=He(l.pay_channel);M({payCode:s,pay_channel:t})}else j.value==="VIP"?l.paymentStatus=!0:M({payCode:"payResult",pay_channel:e.paymentChannel})},M=t=>{const s=l.config;l.pay_channel=t.pay_channel;const i=K.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?"+i:(l.qrCodeUrl=window.location.origin+"/classroom-app/#/payDefine?"+i,l.showQrcode=!0,l.paymentStatus=!1,setTimeout(()=>{ye()},300))},he=async()=>{try{await g.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 g.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)},_e=()=>{l.authShow=!1,R()},$=async(t=5,s,i,n)=>{try{const{data:d}=await Me.post("/edu-app/open/studentRegisterPointRecord/update",{data:{id:e.saveId,useTime:t,joinType:s,userId:i,schoolId:n}});return e.saveId=d,d}catch(d){}},Te=async t=>{try{const{data:s}=await g.get("/edu-app/open/paramConfig/wechatAppId");s&&(Oe(),Le(s,t))}catch(s){}};if(P().weixin){const t=sessionStorage.getItem("active-open-id");e.openId=t;const s=Fe();if(s)e.code=s;else{const i=window.location.origin+window.location.pathname+"#"+p.path+"?"+K.stringify({...p.query});return Te(i),""}}const z=t=>t>9?t+"":"0"+t,Se=async()=>{try{if(!e.code)return;const{data:t}=await g.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=et(async()=>{v.counter.value=0,v.resume(),await $()},5e3)}catch(t){}},we=()=>{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 Ae(async()=>{try{let t=null;const{data:s}=await g.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 i=p.query.t;i&&t!==null&&N(Number(i)).add(t,"day").isBefore(N())&&(e.showTips=!0,e.showMessage="二维码已经失效,详情请咨询学校老师",e.showButton=!1),await le()}catch(t){}}),Ee(()=>{var t;(t=e.intervalFnRef)==null||t.pause()}),()=>o("div",{class:u["student-register"]},[o("div",{class:u.studentRegisterContainer},[!e.activeOverStatus&&o("div",{class:u.countdownSection},[o("div",{class:u.timer},[o("img",{src:Ge,class:u.timerTitle},null),o("div",{class:u.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:u.timerTip},[m("为了确保您能顺利参与学习,请在规定时间内报名")])]),o("div",{class:[u.studentSection,u.studentSectionForm,e.giftVipDay<=0&&u.noSendDay]},[o(tt,{labelAlign:"left",class:u.registerForm},{default:()=>[o(x,{clearable:!1,label:"联系方式(直接监护人)",placeholder:"请输入手机号码",type:"tel",required:!0,autocomplete:"off",inputAlign:"right",class:u.username,modelValue:r.username,"onUpdate:modelValue":[t=>r.username=t,()=>{we()}],border:!1,maxlength:11},{label:()=>o("div",null,[m("联系方式"),o("p",{class:u.tips},[m("(直接监护人)")])])}),o("div",{class:["van-hairline--bottom",u.fieldTipsGroup]},[o("div",{class:[u.fieldTips]},[o("i",{class:u.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=>{pe()}],maxlength:6},{button:()=>e.countDownStatus?o("span",{class:[u.codeText,ue.value?"":u.codeTextDisabled],onClick:re},[m("获取验证码")]):o(st,{ref:t=>C.value=t,"auto-start":!1,class:u.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:[u.selectStudentGroup,e.showSelectStudent&&u.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(ot,{"checked-color":"linear-gradient( 135deg, #31C7FF 0%, #007AFE 100%)",modelValue:r.extra.gender,"onUpdate:modelValue":t=>r.extra.gender=t,direction:"horizontal"},{default:()=>[o(te,{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:u.radioSection},{default:()=>[o(ee,{class:u.radioItem,name:1},null),m("男")]}),o(te,{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:u.radioSection},{default:()=>[o(ee,{class:u.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:u.memberNumer},[o("img",{src:Z,class:u.iconGift},null),o("p",null,[m("注册成功即可获得乐器AI学练工具"),o("span",null,[e.giftVipDay||0]),m("天有效期")])]):""]})]),o("div",{class:[u.goodsExtra]},[o(at,{border:!1,class:u.goodsCell,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:u.checkedGroup},[o("i",{class:[u.iconChecked,e.joinType==="digitalize"&&u.selected]},null),e.joinType==="digitalize"&&o("i",{class:u.showBg},null)]),title:()=>o("div",{class:u.section},[o(nt,{class:u.img,src:e.detailVip.goodsUrl||Ve},null),o("div",{class:u.sectionContent},[o("img",{src:fs,class:u.goodsName},null)])])}),e.detailVip.membershipDays?o("div",{class:[u.memberNumer,u.aiMemberNumber]},[o("img",{src:Z,class:u.iconGift},null),o("p",null,[m("首次购买赠送乐器AI学练工具"),o("span",null,[e.detailVip.membershipDays||0]),m("天有效期")])]):""]),e.joinType&&o(Pe,{position:"bottom",ref:B},{default:()=>[o("div",{class:u.paymentContainer},[o("div",{class:u.payemntPrice},[o("div",null,[o("span",{class:u.needPrice},[o("i",{style:"font-style: normal"},[m("¥ ")]),o("span",null,[X(A.value.amount)]),o("i",{class:u.unit,style:"font-style: normal"},[m("/年")])]),A.value.originAmount>A.value.amount&&e.joinType==="digitalize"?o("del",{class:u.allPrice},[m("¥ "),X(A.value.originAmount)]):""])]),o("div",{class:u.paymentBtn,onClick:()=>{E()}},[o(Ne,{round:!0,disabled:e.submitLoading,loading:e.submitLoading},{default:()=>[e.joinType==="digitalize"?"报名与支付":"提交报名"]})])])]})]),e.imgCodeStatus?o(We,{value:e.imgCodeStatus,"onUpdate:value":t=>e.imgCodeStatus=t,phone:r.username,type:"REGISTER",onClose:()=>{e.imgCodeStatus=!1},onSendCode:ne},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(se,{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(se,{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(je,{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 V(),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 b())return;await Q()}},onCancel:t=>{e.joinType==="tradition"&&(e.dialogStatus=!1,e.registerExpireTime&&e.activeOverStatus&&F()),e.joinType==="digitalize"&&fe()}},null),o(D,{show:l.paymentStatus,closeOnClickOverlay:!1,position:"bottom",round:!0,closeOnPopstate:!0,safeAreaInsetBottom:!0,style:{minHeight:"30%"}},{default:()=>[o(Ye,{paymentConfig:l.orderInfo,onClose:()=>l.paymentStatus=!1,onBackOut:he,onConfirm:t=>M(t)},null)]}),o(D,{show:l.showQrcode,"onUpdate:show":t=>l.showQrcode=t,round:!0,onClose:()=>{clearInterval(l.orderTimer)}},{default:()=>[o(Qe,{url:l.qrCodeUrl,pay_channel:l.pay_channel,orderType:j.value},null)]}),o(Je,{modelValue:l.authShow,"onUpdate:modelValue":t=>l.authShow=t},{default:()=>[o($e,{onSuccess:_e,hideHeader:!P().isApp},null)]}),o(qe,{show:e.showTips,message:e.showMessage,showButton:e.showButton,buttonText:"刷新",onConfirm:()=>window.location.reload()},null),o(Ke,{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 b())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 R()}},null),o(D,{show:e.showSelectStudent,"onUpdate:show":t=>e.showSelectStudent=t,round:!0,position:"bottom",safeAreaInsetBottom:!0,closeable:!0},{default:()=>[o(Xe,{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 i=e.gradeList||[];r.extra.currentGradeNum=null,e.gradeNumText="",e.instrumentCode="",i==null||i.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{Us as default};