index-80af149f.js 37 KB

123
  1. var qe=Object.defineProperty;var je=(g,h,y)=>h in g?qe(g,h,{enumerable:!0,configurable:!0,writable:!0,value:y}):g[h]=y;var G=(g,h,y)=>(je(g,typeof h!="symbol"?h+"":h,y),y);import{d as Ye,P as ze,aN as He,q as $e,r as Z,x as V,al as Qe,e as ee,U as z,bg as We,Y as pe,w as me,y as Je,D as w,ac as M,Q as Ke,a as o,A as f,N as v,z as te,F as ge,X as he,C as fe,S as U,M as H,bh as Xe,J as Ze,K as et,$ as tt,bi as st}from"./index-62e2a3f6.js";import{T as $}from"./tcplayer.v4.8.0.min-82003a20.js";/* empty css */import{M as ot}from"./index-7fbcafd9.js";import{u as at}from"./student-register-store-6d1f3d60.js";import{i as nt,g as rt,r as it}from"./icon-9-39a75ebc.js";import{d as se}from"./deep-clone-c0d00fc2.js";import{M as ut}from"./index-ac0ca667.js";import{O as lt}from"./index-f54ff1ed.js";import{i as ye}from"./icon-gift-20293d47.js";import{P as ct,Q as dt,U as pt,b as mt}from"./user-auth-60121eb7.js";import{M as gt}from"./index-b688b27b.js";import{O as ht}from"./index-9a0f147a.js";import{M as ft}from"./index-d76be7fd.js";import{S as yt}from"./index-0d6fa01c.js";import{b as oe,c as Tt}from"./index-258a6b70.js";import{C as wt}from"./index-a2ec5041.js";import{T as Te}from"./index-700fde59.js";import{P as we}from"./index-fda37d7b.js";import{F as _t}from"./index-5688a17b.js";import{F as R}from"./index-3f465cf8.js";import{R as St,a as _e}from"./index-1fc18b9c.js";import"./index-b8b0afb7.js";import"./index-5514dfc9.js";import"./index-89ef9410.js";import"./browser-e949d08f.js";import"./index-4f86e96b.js";import"./index-426d7470.js";import"./Checker-66b545df.js";const Ct="_studentRegisterContainer_5thc6_8",vt="_videoDuration_5thc6_22",It="_coverImg_5thc6_33",xt="_video_5thc6_13",Bt="_countdownSection_5thc6_94",Ft="_timer_5thc6_113",At="_timerAll_5thc6_118",Et="_timerTitle_5thc6_140",Dt="_timerTip_5thc6_145",Nt="_paymentContainer_5thc6_155",Rt="_payemntPrice_5thc6_165",bt="_giftTip_5thc6_169",Pt="_needPrice_5thc6_173",Lt="_unit_5thc6_190",Ot="_allPrice_5thc6_193",kt="_traditionBtn_5thc6_212",Gt="_studentSection_5thc6_220",Vt="_studentSectionForm_5thc6_227",Mt="_noSendDay_5thc6_231",Ut="_title1_5thc6_234",qt="_title3_5thc6_235",jt="_title4_5thc6_236",Yt="_title2_5thc6_243",zt="_goodsGroup_5thc6_258",Ht="_goodsItem_5thc6_263",$t="_goodsInner_5thc6_277",Qt="_checked_5thc6_281",Wt="_checked1_5thc6_287",Jt="_proposalTip_5thc6_293",Kt="_goodsTypeGroup_5thc6_307",Xt="_showImg_5thc6_311",Zt="_memberNumer_5thc6_314",es="_iconGift_5thc6_325",ts="_registerForm_5thc6_336",ss="_selectStudentGroup_5thc6_340",os="_selectStudentGroupChecked_5thc6_348",as="_fieldTipsGroup_5thc6_368",ns="_fieldTips_5thc6_368",rs="_tips_5thc6_380",is="_username_5thc6_387",us="_countDown_5thc6_395",ls="_codeText_5thc6_413",cs="_radioSection_5thc6_439",ds="_radioItem_5thc6_448",ps="_goodsSection_5thc6_459",ms="_iconArrow_5thc6_470",gs="_goodsExtra_5thc6_477",hs="_goodsCell_5thc6_511",fs="_img_5thc6_516",ys="_goodsName_5thc6_532",Ts="_brandName_5thc6_537",ws="_model_5thc6_549",_s="_sendInstrument_5thc6_567",Ss="_moreBtn_5thc6_571",Cs="_sbtnGroup_5thc6_578",vs="_goodsTradition_5thc6_590",Is="_goodsTitle_5thc6_602",xs="_step_5thc6_609",Bs="_stepContent_5thc6_629",Fs="_nums_5thc6_640",As="_numInner_5thc6_651",Es="_selectStudentPopup_5thc6_663",i={"student-register":"_student-register_5thc6_1",studentRegisterContainer:Ct,"video-content":"_video-content_5thc6_13",videoDuration:vt,coverImg:It,video:xt,countdownSection:Bt,timer:Ft,timerAll:At,timerTitle:Et,timerTip:Dt,paymentContainer:Nt,payemntPrice:Rt,giftTip:bt,needPrice:Pt,unit:Lt,allPrice:Ot,traditionBtn:kt,studentSection:Gt,studentSectionForm:Vt,noSendDay:Mt,title1:Ut,title3:qt,title4:jt,title2:Yt,goodsGroup:zt,goodsItem:Ht,goodsInner:$t,checked:Qt,checked1:Wt,proposalTip:Jt,goodsTypeGroup:Kt,showImg:Xt,memberNumer:Zt,iconGift:es,registerForm:ts,selectStudentGroup:ss,selectStudentGroupChecked:os,fieldTipsGroup:as,fieldTips:ns,tips:rs,username:is,countDown:us,codeText:ls,radioSection:cs,radioItem:ds,goodsSection:ps,iconArrow:ms,goodsExtra:gs,goodsCell:hs,img:fs,goodsName:ys,brandName:Ts,model:ws,sendInstrument:_s,moreBtn:Ss,sbtnGroup:Cs,goodsTradition:vs,goodsTitle:Is,step:xs,stepContent:Bs,nums:Fs,numInner:As,selectStudentPopup:Es},Ds=""+new URL("icon-n-10-89abe28d.png",import.meta.url).href,Ns=""+new URL("icon-n-11-64a5489e.png",import.meta.url).href;class Rs{constructor(){G(this,"startTime");G(this,"elapsedTime");G(this,"timerId");G(this,"isRunning");this.startTime=0,this.elapsedTime=0,this.timerId=null,this.isRunning=!1}start(){this.isRunning||(this.isRunning=!0,this.startTime=Date.now()-this.elapsedTime,this.timerId=window.setInterval(()=>{this.elapsedTime=Date.now()-this.startTime},10))}pause(){this.isRunning&&(this.isRunning=!1,this.timerId!==null&&clearInterval(this.timerId))}resume(){this.isRunning||this.start()}resetTime(){this.elapsedTime=0,this.startTime=Date.now()-this.elapsedTime}reset(){this.isRunning=!1,this.timerId!==null&&clearInterval(this.timerId),this.elapsedTime=0}getTime(){return this.elapsedTime/1e3}formatTime(h){return h/1e3}pad(h,y=2){return h.toString().padStart(y,"0")}}const Q=[];for(let g=1;g<=40;g++)Q.push({text:g+"班",value:g});const Se={1:"一年级",2:"二年级",3:"三年级",4:"四年级",5:"五年级",6:"六年级",7:"七年级",8:"八年级",9:"九年级"},Ce=(g,h)=>{let y=[];const E=[{text:"一年级",value:1,instrumentCode:h},{text:"二年级",value:2,instrumentCode:h},{text:"三年级",value:3,instrumentCode:h},{text:"四年级",value:4,instrumentCode:h},{text:"五年级",value:5,instrumentCode:h}],B=[{text:"六年级",value:6,instrumentCode:h}],F=[{text:"七年级",value:7,instrumentCode:h},{text:"八年级",value:8,instrumentCode:h},{text:"九年级",value:9,instrumentCode:h}];return g==="FIVE_YEAR_SYSTEM"?y.push(...E):g==="SIX_YEAR_SYSTEM"?y.push(...E,...B):g==="THREE_YEAR_SYSTEM"?y.push(...F):g==="FORE_YEAR_SYSTEM"?y.push(...B,...F):y.push(...E,...B,...F),y},lo=Ye({name:"student-register",setup(){const g=ze(),h=He(),y=at(),E=$e();y.setShoolId(g.query.sId);const B=Z(),F=Z(),e=V({schoolId:g.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",showDuration:!0,dialogConfirmStatus:!1,contract_sign:!1,countDownTimePay:60*1e3,dialogConfig:{},showSelectStudent:!1,studentList:[],studentItem:{},joinType:"",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:[]}),r=V({showOtherSchool:!1,showCloseButton:!0,showOtherMessage:"",otherType:"",showCancelButton:!0,cancelButtonColor:"",cancelButtonText:"取消",showConfirmButton:!0,confirmButtonColor:"",confirmButtonText:"确定",messageAlign:"left"}),c=V({showQrcode:!1,qrCodeUrl:"",pay_channel:"",orderInfo:{},authShow:!1,orderNo:null,config:{},paymentStatus:!1,orderTimer:null}),u=V({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:""}),l=V({introductionVideo:"",introductionVideoTime:0,videoBrowsePoint:0,player:null,playerSpeed:1,intervalFnRef:null,videoDetails:[],pointVideo:{},pointVideoTime:0}),_=oe(1e3,{controls:!0});_.pause();const I=new Rs,D=oe(1e3,{controls:!0});D.pause();const ae=t=>{const s=[];t.sort((n,d)=>n[0]-d[0]);let a=t[0];for(let n=1;n<t.length;n++){const d=t[n];a[1]>=d[0]?a[1]=Math.max(d[1],a[1]):(s.push(a),a=d)}return s.push(a),s},ve=t=>{const s=ae(t);let a=0;return s.forEach(n=>{a+=n[1]-n[0]}),a},N=Qe({time:e.activeOverTime,onFinish(){e.activeOverStatus=!0,!e.submitLoading&&b()}}),b=()=>{var t;e.showTips=!0,e.showMessage='<p style="color: #F44541">报名已截止,感谢您的参与</p>',e.showButton=!1,(t=e.intervalFnRef)==null||t.pause()},Ie=()=>{e.countDownStatus=!1,te(()=>{B.value.start()})},xe=()=>{if(!H(u.username))return v("请输入正确的手机号码");e.imgCodeStatus=!0},Be=ee(()=>!!H(u.username)),Fe=()=>{e.countDownStatus=!0,B.value.reset()},ne=ee(()=>c.orderInfo.orderType),Ae=async()=>{var t;try{const{data:s}=await w.get("/edu-app/open/userOrder/registerGoods/"+e.schoolId,{noAuthorization:!0});y.setVip(s.details||[]),e.details=se(s.details||[]),e.registerDetails=s,e.registerExpireTime=s.registerExpireTime,e.registerExpireTime&&(M(new Date).isBefore(e.registerExpireTime)?(e.activeOverStatus=!1,e.activeOverTime=M(e.registerExpireTime).diff(M(new Date)),N.reset(e.activeOverTime),N.start()):(b(),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,u.extra.registerType=s.registerType;const a=s.schoolInstrumentList||[];if(s.schoolInstrumentSetType==="SCHOOL"){const n=(t=a[0])==null?void 0:t.instrumentCode;e.gradeList=Ce(s.gradeYear,n),e.classList=Q}else if(s.schoolInstrumentSetType==="GRADE")a.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=Q;else if(s.schoolInstrumentSetType==="CLASS"){const n=[];a.forEach(m=>{n.includes(m.gradeNum)||n.push(m.gradeNum)});const d=[];n.forEach(m=>{const T={text:Se[m],value:m,instrumentId:"",instrumentCode:"",instrumentName:"",classList:[]};a.forEach(p=>{m===p.gradeNum&&(T.instrumentId=p.instrumentId,T.instrumentCode=p.instrumentCode,T.instrumentName=p.instrumentName,T.classList.push({text:p.classNum+"班",value:p.classNum,instrumentCode:p.instrumentCode}))}),T.classList.sort((p,A)=>p.value-A.value),d.push(T)}),d.sort((m,T)=>m.value-T.value),e.gradeList=d,e.classList=[]}else e.gradeList=Ce(s.gradeYear),e.classList=Q;if(z().weixin){if(s.registerType!=="BUG_GOODS"||s.schoolStatus===0){e.showTips=!0,e.showMessage="二维码已经失效,详情请咨询学校老师",e.showButton=!1;return}}else{e.showTips=!0;return}(!e.registerExpireTime||!e.activeOverStatus)&&Ve()}catch(s){}},P=ee(()=>{let t=0,s=0;return y.getVip.forEach(n=>{t+=Number(n.currentPrice),s+=Number(n.originalPrice)}),{amount:t,originAmount:s}}),C=(t,s)=>{e.isTipRegister=t,e.isChangeSchool=s},W=(t=!0)=>{if(H(u.username))if(u.password)if(u.extra.nickname)if([0,1].includes(u.extra.gender))if(u.extra.currentGradeNum){if(!u.extra.currentClass)return t&&v("请选择所在班级"),!0}else return t&&v("请选择所在年级"),!0;else return t&&v("请选择性别"),!0;else return t&&v("请输入学生姓名"),!0;else return t&&v("请输入验证码"),!0;else return t&&v("请输入正确的手机号码"),!0;return!1},Ee=()=>{var s;const{extra:t}=u;return e.studentItem.nickname!==t.nickname&&e.isTipRegister?(r.showOtherMessage="学生姓名与上次提交信息不一致,请确认修改学生信息或创建新的学生账号",r.showOtherSchool=!0,r.showCancelButton=!0,r.showCloseButton=!0,r.cancelButtonColor="linear-gradient( 224deg, #3FE1E6 0%, #00CDD4 100%)",r.cancelButtonText="新建学生",r.confirmButtonColor="linear-gradient( 305deg, #40C8FF 0%, #3192FF 100%)",r.confirmButtonText="修改信息",r.otherType="nickname",r.messageAlign="left",!0):e.isRegister==="create"&&e.studentList.length>=e.multi_user_limit?(r.showOtherMessage=`同一手机号最多创建${e.multi_user_limit}个学生`,r.showOtherSchool=!0,r.showCancelButton=!1,r.showCloseButton=!0,r.confirmButtonColor="linear-gradient( 305deg, #40C8FF 0%, #3192FF 100%)",r.confirmButtonText="我知道了",r.otherType="limit",r.messageAlign="center",!0):e.studentItem.schoolId&&e.studentItem.schoolId!==e.registerDetails.schoolId&&!e.isChangeSchool&&e.isRegister==="update"?(r.showOtherMessage=`您已绑定<span style="color: #2B85FF">【${((s=e.studentItem)==null?void 0:s.schoolName)||""}】</span>,提交后将更换到
  2. <span style="color: #2B85FF">【${e.registerDetails.schoolName||""}】</span>
  3. ,是否确认提交?`,r.showOtherSchool=!0,r.showCloseButton=!1,r.showCancelButton=!0,r.cancelButtonColor="",r.cancelButtonText="取消",r.confirmButtonColor="",r.confirmButtonText="确定",r.otherType="change",r.messageAlign="left",!0):!1},L=async()=>{e.submitLoading=!0,e.intervalFnRef.pause();try{if(W()||Ee()){e.submitLoading=!1;return}const{extra:t,loginType:s,autoRegister:a,password:n,multiUser:d,...m}=u;let T=s,p=a,A=n,Y=d;e.isRegister==="update"&&(T="TOKEN",p=!1,A=e.studentItem.token,Y=!1);const x=await w.post("/edu-app/userlogin",{requestType:"form",data:{loginType:T,autoRegister:p,password:A,multiUser:Y,...m,extra:JSON.stringify({...t,giftVipDay:e.giftVipDay||0,schoolId:e.schoolId})}});if(x.code!==200)x.code===5436?(e.showTips=!0,e.showMessage="二维码已经失效,详情请咨询学校老师",e.showButton=!1):x.code===5435?(e.showTips=!0,e.showMessage=x.message,e.showButton=!0):x.code===5437&&(e.showTips=!0,e.showMessage='<p style="color: #F44541">报名已截止,感谢您的参与</p>',e.showButton=!1);else{y.setToken(x.data.token_type+" "+x.data.access_token),Xe();let X="NOT_REGISTER";e.joinType==="digitalize"&&(X="SELECT_INSTRUMENT"),e.joinType==="tradition"&&(X="NOT_BUY_INSTRUMENT"),await K(D.counter.value);const de=await K(D.counter.value,X,x.data.userId,e.schoolId);e.saveId=de,e.saveUserId=de,D.counter.value=0;const Ue=await w.get("/edu-app/user/getUserInfo",{requestType:"form"});Ze(Ue.data),await re()}}catch(t){C(e.isRegister!=="create",!1)}finally{e.submitLoading=!1,e.intervalFnRef.resume()}},O=async()=>{try{const{extra:t,username:s}=u,a=await w.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 a.code!==200?(a.code===5436?(e.showTips=!0,e.showMessage="二维码已经失效,详情请咨询学校老师",e.showButton=!1):a.code===5435?(e.showTips=!0,e.showMessage=a.message,e.showButton=!0):a.code===5437&&(e.showTips=!0,e.showMessage='<p style="color: #F44541">报名已截止,感谢您的参与</p>',e.showButton=!1),!1):!0}catch(t){}},re=async()=>{try{if(await Ne())return;const s=await w.get("/edu-app/userPaymentOrder/registerStatus/"+e.schoolId),a=y.getVip;if(e.joinType==="tradition"){if(!await O())return;setTimeout(()=>{v("报名成功")},100),setTimeout(()=>{z().weixin&&window.WeixinJSBridge.call("closeWindow")},1e3);return}if(s.data.hasBuyCourse&&a.length>0){r.showOtherMessage="该学员已购买会员,是否再次购买?",r.showOtherSchool=!0,r.showCloseButton=!1,r.showCancelButton=!0,r.cancelButtonColor="",r.cancelButtonText="取消",r.confirmButtonColor="",r.confirmButtonText="确定",r.otherType="member",r.messageAlign="center";return}await q()}catch(t){C(e.isRegister!=="create",!1)}},De=async()=>{if(!(u.password.length!==6||!H(u.username)))try{const{data:t}=await w.get(`/edu-app/open/student/studentInfo?mobile=${u.username}&code=${u.password}&type=REGISTER`);if(e.studentList=t||[],e.studentList.length>0){const s=e.studentList[0];e.studentItem=s,u.extra.nickname=s.nickname;const a=e.gradeList||[];a==null||a.forEach(n=>{n.value===s.currentGradeNum&&(e.instrumentCode=n.instrumentCode,e.gradeNumText=n.text,u.extra.currentGradeNum=s.currentGradeNum,e.schoolInstrumentSetType==="CLASS"&&(e.classList=n.classList))}),e.classList.forEach(n=>{n.value===s.currentClass&&(e.currentClassText=n.text,u.extra.currentClass=s.currentClass)}),u.extra.gender=s.gender,e.isRegister="update",C(!0,!1)}else e.isRegister="create",C(!1,!1),e.studentItem=[]}catch(t){}},Ne=async()=>{let t=!1;try{const{data:s}=await w.get("/edu-app/userPaymentOrder/schoolRegisterOrder?schoolId="+e.schoolId);if(s&&s.length>0){let a=!1,n={},d={},m=!1,T={};return s.forEach(p=>{(p.status==="PAYING"||p.status==="WAIT_PAY")&&(a=!0,n=p.paymentConfig,d=p),(p.status==="PAID"||p.status==="PART_REFUNDED"||p.status==="REFUNDED")&&(m=!0,T=p.paymentConfig)}),m&&e.joinType==="tradition"?await O()?(setTimeout(()=>{v("您已通过数字化方式报名成功")},100),!0):void 0:a&&e.joinType==="tradition"?(e.dialogStatus=!0,e.dialogMessage="您有数字化方式报名的待支付订单,请关闭订单后重新报名",e.cancelButtonText="取消",e.confirmButtonText="关闭",e.dialogConfig=n,e.messageAlign="left",!0):a&&e.joinType==="digitalize"?(e.dialogConfig=n,await ie()&&await q(),!0):!1}else return!1}catch(s){C(e.isRegister!=="create",!1)}return t},Re=async()=>{var t;try{const s=(t=e.dialogConfig)==null?void 0:t.orderNo;if(!s)return;await w.post("/edu-app/userPaymentOrder/cancelPayment/"+s),await re()}catch(s){}},ie=async()=>{var t;try{const s=(t=e.dialogConfig)==null?void 0:t.orderNo;return s?(await w.post("/edu-app/userPaymentOrder/cancelPayment/"+s),!0):void 0}catch(s){return!1}},q=async()=>{try{const t=y.getVip,s=y.getGoods,a=[];if(t.forEach(m=>{a.push({giftVipDay:m.membershipDays,goodsId:m.goodsId,goodsNum:1,goodsType:m.goodsType,paymentCashAmount:m.currentPrice,paymentCouponAmount:0})}),s.forEach(m=>{a.push({goodsId:m.productId,goodsNum:m.quantity,goodsType:"INSTRUMENTS",paymentCashAmount:m.price,paymentCouponAmount:0,goodsSkuId:m.productSkuId})}),!await O())return;const d=await w.post("/edu-app/userPaymentOrder/executeOrder",{data:{buryId:e.saveUserId,registerType:e.registerType,paymentType:e.paymentType,bizId:e.schoolId,orderType:"SCHOOL_REGISTER",paymentCashAmount:P.value.amount||0,paymentCouponAmount:0,goodsInfos:a,orderName:"学生登记",orderDesc:"学生登记"}});d.code===5436?(e.showTips=!0,e.showMessage="二维码已经失效,详情请咨询学校老师",e.showButton=!1):d.code===5435?(e.showTips=!0,e.showMessage=d.message,e.showButton=!0):(c.config={...d.data.paymentConfig,paymentType:d.data.paymentType},c.orderNo=d.data.orderNo,await ue())}catch(t){console.log(t,"any"),C(e.isRegister!=="create",!1)}},ue=async()=>{try{const t=et.user.data;if(e.contract_sign&&(!(t!=null&&t.account.realName)||!(t!=null&&t.account.idCardNo))){c.authShow=!0;return}const{data:s}=await w.post("/edu-app/userPaymentOrder/updateReceiveAddress",{data:{orderNo:c.orderNo,orderType:"SCHOOL_REGISTER"}});c.pay_channel=s.paymentChannel,s.status!=="WAIT_PAY"&&s.status!=="PAYING"?E.replace({path:"/payment-result",query:{orderNo:c.orderNo}}):be()}catch(t){C(e.isRegister!=="create",!1)}},be=()=>{const t=c.pay_channel;if(t){const s=mt(c.pay_channel);J({payCode:s,pay_channel:t})}else ne.value==="VIP"?c.paymentStatus=!0:J({payCode:"payResult",pay_channel:e.paymentChannel})},J=t=>{const s=c.config;c.pay_channel=t.pay_channel;const a=pe.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?"+a:(c.qrCodeUrl=window.location.origin+"/classroom-app/#/payDefine?"+a,c.showQrcode=!0,c.paymentStatus=!1,setTimeout(()=>{Le()},300))},Pe=async()=>{try{await w.post("/edu-app/userPaymentOrder/cancelPayment/"+c.orderNo)}catch(t){}},Le=async()=>{const t=setInterval(async()=>{if(g.name!="student-register-form"){clearInterval(t);return}c.orderTimer=t;try{const{data:s}=await w.post("/edu-app/open/userOrder/paymentStatus/"+c.orderNo,{hideLoading:!0});s.status!=="WAIT_PAY"&&s.status!=="PAYING"&&(c.showQrcode=!1,clearInterval(c.orderTimer),setTimeout(()=>{E.replace({path:"/payment-result",query:{orderNo:c.orderNo}})},100))}catch(s){clearInterval(c.orderTimer)}},5e3)},Oe=()=>{c.authShow=!1,q()},K=async(t=5,s,a,n)=>{try{const d={id:e.saveId,useTime:t,joinType:s,userId:a,schoolId:n};let m={};if(!a&&l.player.duration()>0){const p=k.value.length>0?ae(k.value):[],A=p.length>0?ve(p):0,Y=Math.floor(Math.round(A)/Math.floor(l.player.duration())*100);m={videoBrowseData:JSON.stringify(p),videoBrowseDataTime:A||0,videoBrowsePercentage:Y||0,videoBrowseTime:I.getTime(),videoBrowsePoint:l.player.currentTime()}}const{data:T}=await it.post("/edu-app/open/studentRegisterPointRecord/update",{data:{...d,...m}});return T!==e.saveId&&(k.value=[]),e.saveId=T,T}catch(d){}},ke=async t=>{try{const{data:s}=await w.get("/edu-app/open/paramConfig/wechatAppId");s&&(tt(),st(s,t))}catch(s){}};if(z().weixin){const t=sessionStorage.getItem("active-open-id");e.openId=t;const s=We();if(s)e.code=s;else{const a=window.location.origin+window.location.pathname+"#"+g.path+"?"+pe.stringify({...g.query});return ke(a),""}}const j=t=>t>9?t+"":"0"+t,Ge=()=>{const t=$.getComponent("Button"),s=$.getComponent("BigPlayButton");s.prototype.createEl=function(){const a=t.prototype.createEl.call(this),n='<button><svg width="42px" height="42px" viewBox="0 0 42 42" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><circle stroke="#FFFFFF" stroke-width="1.0112392" fill-opacity="0.3" fill="#000000" stroke-linecap="square" cx="21" cy="21" r="20.5056196"></circle><g transform="translate(13.000000, 12.000000)" fill="#FFFFFF"><path d="M11.7432433,3.46351367 L18.2071084,14.4520843 C18.7734418,15.4148511 18.4520691,16.6544316 17.4893024,17.2207649 C17.1784947,17.403593 16.8244584,17.5 16.4638651,17.5 L3.53613489,17.5 C2.41915092,17.5 1.51365649,16.5945056 1.51365649,15.4775216 C1.51365649,15.1169283 1.6100635,14.762892 1.79289156,14.4520843 L8.25675667,3.46351367 C8.82309003,2.50074696 10.0626705,2.17937423 11.0254373,2.74570759 C11.3218389,2.92006148 11.5688894,3.16711204 11.7432433,3.46351367 Z" id="三角形" transform="translate(10.000000, 9.000000) rotate(-270.000000) translate(-10.000000, -9.000000) "></path></g></g></svg></button>';return a.appendChild($.dom.createEl("div",{className:"vjs-button-icon",innerHTML:n})),a},l.player=$("register-video",{appID:"",controls:!0,plugins:{}}),l.player&&(l.player.src(l.introductionVideo||"https://oss.dayaedu.com/ktyq/1715849628836a8856d6a.mp4"),l.player.poster("https://oss.dayaedu.com/ktyq/17158281330381317fd87.png"),l.player.on("ready",a=>{}),l.player.on("loadedmetadata",()=>{console.log("loadedmetadata"),l.player.currentTime(l.videoBrowsePoint)}),l.player.on("ratechange",()=>{l.playerSpeed=l.playerSpeed<l.player.playbackRate()?l.player.playbackRate():l.playerSpeed}),l.player.on("seeking",()=>{console.log("seeking"),_.isActive.value&&_.pause(),I.pause()}),l.player.on("seeked",()=>{console.log("seeked"),_.isActive.value&&_.pause(),I.pause()}),l.player.on("waiting",()=>{_.isActive.value&&_.pause(),I.pause()}),l.player.on("timeupdate",()=>{!_.isActive.value&&l.player.currentTime()>0&&!l.player.paused()&&(_.resume(),I.resume())}),l.player.on("ended",()=>{l.player.pause()}),l.player.on("play",()=>{console.log("play"),e.showDuration=!1,_.resume(),I.resume()}),l.player.on("pause",()=>{console.log("pause",_.isActive.value),_.pause(),I.pause()}),l.player.on("fullscreenchange",()=>{if(l.player.isFullscreen()){console.log("fullscreen");const a=document.createElement("i");a.id="fullscreen-back",a.className="van-icon van-icon-arrow-left video-back",a.addEventListener("click",()=>{l.player.exitFullscreen()}),document.getElementsByClassName("video-js")[0].appendChild(a)}else{console.log("exitfullscreen");const a=document.getElementById("fullscreen-back");a&&a.remove()}}))},k=Z([]);let S=[];const le=oe(1e3,{controls:!0});me(()=>_.isActive.value,t=>{console.log(_.isActive.value,"videoIntervalRef"),ce(t)});const ce=(t,s=!1)=>{const a=se(S);if(s?S.length>0&&(S[1]=Math.floor(l.player.currentTime()*1e3)/1e3):t?S[0]=Math.floor(l.player.currentTime()*1e3)/1e3:S[1]=Math.floor(l.player.currentTime()*1e3)/1e3,S.length>=2){const n=S[1]-S[0]-le.counter.value*l.playerSpeed>2;S[1]>=S[0]&&!n&&k.value.push(S),s?S=se(a):(S=[],le.counter.value=0)}};me(h,t=>{t=="hidden"&&l.player.pause()});const Ve=async()=>{try{if(!e.code)return;const{data:t}=await w.post("/edu-app/open/studentRegisterPointRecord/save",{data:{code:e.code,schoolId:e.schoolId,openId:e.openId}});e.saveId=t.id,e.openId=t.openId,k.value=t.videoBrowseData?JSON.parse(t.videoBrowseData):[],l.videoBrowsePoint=t.videoBrowsePoint||0,l.player&&l.player.currentTime(t.videoBrowsePoint||0),sessionStorage.setItem("active-open-id",t.openId),e.intervalFnRef=Tt(async()=>{e.intervalFnRef.pause(),D.counter.value=0,D.resume(),ce(!1,!0),K(),I.resetTime(),_.counter.value=0,e.intervalFnRef.resume()},5e3)}catch(t){}},Me=()=>{u.password="",u.extra.nickname="",u.extra.currentGradeNum="",u.extra.currentClass="",u.extra.gender=1,e.currentClassText="",e.gradeNumText="",e.studentList=[],e.studentItem={},e.isRegister="create",e.isTipRegister=!1,e.isChangeSchool=!1};return Je(async()=>{try{let t=null;const{data:s}=await w.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 a=g.query.t;a&&t!==null&&M(Number(a)).add(t,"day").isBefore(M())&&(e.showTips=!0,e.showMessage="二维码已经失效,详情请咨询学校老师",e.showButton=!1),Ge(),await Ae()}catch(t){}}),Ke(()=>{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:nt,class:i.timerTitle},null),o("div",{class:i.timerAll},[o("span",null,[j(N.current.value.days)]),f("天"),o("span",null,[j(N.current.value.hours)]),f("时"),o("span",null,[j(N.current.value.minutes)]),f("分"),o("span",null,[j(N.current.value.seconds)]),f("秒")])]),o("div",{class:i.timerTip},[f("为了确保您能顺利参与学习,请在规定时间内报名。")])]),o("div",{class:[i.studentSection,i.studentSectionForm]},[o("div",{class:i.title4},null),o("div",{class:i["video-content"]},[o("video",{id:"register-video",class:i.video,src:"https://oss.dayaedu.com/ktyq/1715849628836a8856d6a.mp4",playsinline:!0,poster:"https://oss.dayaedu.com/ktyq/17158281330381317fd87.png",preload:"auto"},null),e.showDuration&&o("span",{class:i.videoDuration},[f("1:56")])])]),o("div",{class:[i.studentSection,i.studentSectionForm,e.giftVipDay<=0&&i.noSendDay]},[o("div",{class:i.title1},null),o(_t,{labelAlign:"left",class:i.registerForm},{default:()=>[o(R,{clearable:!1,label:"联系方式(直接监护人)",placeholder:"请输入手机号码",type:"tel",required:!0,autocomplete:"off",inputAlign:"right",class:i.username,modelValue:u.username,"onUpdate:modelValue":[t=>u.username=t,()=>{Me()}],border:!1,maxlength:11},{label:()=>o("div",null,[f("联系方式"),o("p",{class:i.tips},[f("(直接监护人)")])])}),o("div",{class:["van-hairline--bottom",i.fieldTipsGroup]},[o("div",{class:[i.fieldTips]},[f("手机号是音乐数字课堂的唯一登录账户")])]),o(R,{center:!0,clearable:!1,required:!0,inputAlign:"right",label:"验证码",placeholder:"请输入验证码",autocomplete:"off",type:"number",modelValue:u.password,"onUpdate:modelValue":[t=>u.password=t,t=>{De()}],maxlength:6},{button:()=>e.countDownStatus?o("span",{class:[i.codeText,Be.value?"":i.codeTextDisabled],onClick:xe},[f("获取验证码")]):o(wt,{ref:t=>B.value=t,"auto-start":!1,class:i.countDown,time:e.countDownTime,onFinish:Fe,format:"ss秒后重试"},null)}),o(R,{clearable:!1,required:!0,inputAlign:"right",label:"学生姓名",placeholder:"请输入学生姓名",autocomplete:"off",maxlength:14,modelValue:u.extra.nickname,"onUpdate:modelValue":t=>u.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(R,{clearable:!1,required:!0,inputAlign:"right",label:"学生性别",placeholder:"请选择性别",autocomplete:"off"},{input:()=>o(St,{"checked-color":"linear-gradient( 135deg, #31C7FF 0%, #007AFE 100%)",modelValue:u.extra.gender,"onUpdate:modelValue":t=>u.extra.gender=t,direction:"horizontal"},{default:()=>[o(Te,{size:"large",type:"primary",color:u.extra.gender!==1?"#F5F6FA":"linear-gradient( 135deg, #31C7FF 0%, #007AFE 100%)",textColor:u.extra.gender!==1?"#626264":"#fff",class:i.radioSection},{default:()=>[o(_e,{class:i.radioItem,name:1},null),f("男")]}),o(Te,{size:"large",type:"primary",color:u.extra.gender!==0?"#F5F6FA":"linear-gradient( 135deg, #31C7FF 0%, #007AFE 100%)",textColor:u.extra.gender!==0?"#626264":"#fff",class:i.radioSection},{default:()=>[o(_e,{class:i.radioItem,name:0},null),f("女")]})]})}),o(R,{clearable:!1,required:!0,inputAlign:"right",label:"所在年级",placeholder:"请选择年级",isLink:!0,readonly:!0,clickable:!1,modelValue:e.gradeNumText,onClick:()=>{e.gradePopupIndex=[u.extra.currentGradeNum],e.gradeStatus=!0}},null),o(R,{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){v("请先选择年级");return}e.classPopupIndex=[u.extra.currentClass],e.classStatus=!0}},null),e.giftVipDay>0?o("div",{class:i.memberNumer},[o("img",{src:ye,class:i.iconGift},null),o("p",null,[f("注册成功即可获得乐器AI学练工具"),o("span",null,[e.giftVipDay||0]),f("天有效期")])]):""]})]),o("div",{class:i.studentSection},[o("div",{class:i.title2},null),o("div",{class:i.goodsGroup},[o("div",{class:[i.goodsItem,i.digitalize,e.joinType==="digitalize"&&i.checked],onClick:()=>{if(W()){v("请将资料填写完整");return}e.joinType="digitalize",te(()=>{var t;(t=F.value)==null||t.onChnageHeight(),setTimeout(()=>{window.scrollTo(0,1e3)},50)})}},[o("div",{class:i.goodsInner},[o("i",{class:i.proposalTip},null),f("数字化方式")])]),o("div",{class:[i.goodsItem,i.tradition,e.joinType==="tradition"&&i.checked1],onClick:()=>{if(W()){v("请将资料填写完整");return}e.joinType="tradition",te(()=>{var t;(t=F.value)==null||t.onChnageHeight(),setTimeout(()=>{window.scrollTo(0,1e3)},50)})}},[o("div",{class:i.goodsInner},[f("传统方式")])])]),e.joinType&&o("div",{class:i.goodsTypeGroup},[e.joinType==="digitalize"&&o(ge,null,[o("img",{src:Ds,class:i.showImg},null),e.detailVip.membershipDays?o("div",{class:i.memberNumer},[o("img",{src:ye,class:i.iconGift},null),o("p",null,[f("首次购买赠送乐器AI学练工具"),o("span",null,[e.detailVip.membershipDays||0]),f("天有效期")])]):""]),e.joinType==="tradition"&&o("img",{src:Ns,class:i.showImg},null)])]),e.joinType&&o(ot,{position:"bottom",ref:F},{default:()=>[o("div",{class:i.paymentContainer},[e.joinType==="digitalize"&&o(ge,null,[o("div",{class:i.payemntPrice},[o("img",{src:rt,class:i.giftTip},null),o("div",null,[o("span",{class:i.needPrice},[o("i",{style:"font-style: normal"},[f("¥ ")]),o("span",null,[he(P.value.amount)]),o("i",{class:i.unit,style:"font-style: normal"},[f("/年")])]),P.value.originAmount>P.value.amount?o("del",{class:i.allPrice},[f("¥ "),he(P.value.originAmount)]):""])]),o("div",{class:i.paymentBtn,onClick:()=>{L()}},[o(fe,{round:!0,disabled:e.submitLoading,loading:e.submitLoading},{default:()=>[f("立即支付")]})])]),e.joinType==="tradition"&&o("div",{class:i.traditionBtn,onClick:()=>{L()}},[o(fe,{round:!0,disabled:e.submitLoading,loading:e.submitLoading},{default:()=>[f("提交报名")]})])])]})]),e.imgCodeStatus?o(gt,{value:e.imgCodeStatus,"onUpdate:value":t=>e.imgCodeStatus=t,phone:u.username,type:"REGISTER",onClose:()=>{e.imgCodeStatus=!1},onSendCode:Ie},null):null,o(U,{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(we,{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];u.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="",u.extra.currentClass="")}},null)]}),o(U,{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(we,{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];u.extra.currentClass=s.value,e.currentClassText=s.text,e.classStatus=!1,["CLASS"].includes(e.schoolInstrumentSetType)&&(e.instrumentCode=s.instrumentCode)}},null)]}),o(lt,{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 ie(),e.registerExpireTime&&e.activeOverStatus&&b()),e.joinType==="digitalize"){const t=e.dialogConfig;if(c.config=t==null?void 0:t.paymentConfig,c.orderNo=t==null?void 0:t.orderNo,!await O())return;await ue()}},onCancel:t=>{e.joinType==="tradition"&&(e.dialogStatus=!1,e.registerExpireTime&&e.activeOverStatus&&b()),e.joinType==="digitalize"&&Re()}},null),o(U,{show:c.paymentStatus,closeOnClickOverlay:!1,position:"bottom",round:!0,closeOnPopstate:!0,safeAreaInsetBottom:!0,style:{minHeight:"30%"}},{default:()=>[o(ct,{paymentConfig:c.orderInfo,onClose:()=>c.paymentStatus=!1,onBackOut:Pe,onConfirm:t=>J(t)},null)]}),o(U,{show:c.showQrcode,"onUpdate:show":t=>c.showQrcode=t,round:!0,onClose:()=>{clearInterval(c.orderTimer)}},{default:()=>[o(dt,{url:c.qrCodeUrl,pay_channel:c.pay_channel,orderType:ne.value},null)]}),o(ht,{modelValue:c.authShow,"onUpdate:modelValue":t=>c.authShow=t},{default:()=>[o(pt,{onSuccess:Oe,hideHeader:!z().isApp},null)]}),o(ut,{show:e.showTips,message:e.showMessage,showButton:e.showButton,buttonText:"刷新",onConfirm:()=>window.location.reload()},null),o(ft,{show:r.showOtherSchool,messageAlign:r.messageAlign,message:r.showOtherMessage,showCancelButton:r.showCancelButton,cancelButtonColor:r.cancelButtonColor,cancelButtonText:r.cancelButtonText,confirmButtonColor:r.confirmButtonColor,confirmButtonText:r.confirmButtonText,onClose:()=>r.showOtherSchool=!1,onCancel:async()=>{if(r.showOtherSchool=!1,r.otherType==="nickname")e.isRegister="create",C(!1,!1),L();else if(r.otherType==="member"){if(!await O())return;e.registerExpireTime&&e.activeOverStatus&&b()}},onConfirm:async()=>{r.showOtherSchool=!1,r.otherType==="nickname"?(e.isRegister="update",C(!1,!1),L()):r.otherType==="change"?(e.isChangeSchool=!0,L()):r.otherType==="limit"?C(!(e.isRegister==="create"&&!e.studentItem.userId),!1):r.otherType==="member"&&await q()}},null),o(U,{show:e.showSelectStudent,"onUpdate:show":t=>e.showSelectStudent=t,round:!0,position:"bottom",safeAreaInsetBottom:!0,closeable:!0,class:i.selectStudentPopup},{default:()=>[o(yt,{studentItem:e.studentItem,list:e.studentList,onClose:()=>e.showSelectStudent=!1,onConfirm:t=>{if(t.userId){e.studentItem=t;const s=t;u.extra.nickname=s.nickname;const a=e.gradeList||[];u.extra.currentGradeNum=null,e.gradeNumText="",e.instrumentCode="",a==null||a.forEach(n=>{n.value===s.currentGradeNum&&(e.instrumentCode=n.instrumentCode,e.gradeNumText=n.text,u.extra.currentGradeNum=s.currentGradeNum,e.schoolInstrumentSetType==="CLASS"&&(e.classList=n.classList))}),u.extra.currentClass=null,e.currentClassText="",e.classList.forEach(n=>{n.value===s.currentClass&&(e.currentClassText=n.text,u.extra.currentClass=s.currentClass)}),u.extra.gender=s.gender,e.isRegister="update",C(!0,!1),e.showSelectStudent=!1}else{if(e.studentList.length>=e.multi_user_limit)return r.showOtherMessage=`同一手机号最多创建${e.multi_user_limit}个学生`,r.showOtherSchool=!0,r.showCancelButton=!1,r.showCloseButton=!0,r.confirmButtonColor="linear-gradient( 305deg, #40C8FF 0%, #3192FF 100%)",r.confirmButtonText="我知道了",r.otherType="limit",r.messageAlign="center",!0;e.studentItem=t,e.isRegister="create",C(!1,!1),u.extra.nickname="",u.extra.currentGradeNum="",u.extra.currentClass="",u.extra.gender=1,e.currentClassText="",e.gradeNumText="",e.showSelectStudent=!1}}},null)]})])}});export{lo as default};