1 |
- import{d as he,P as ge,q as fe,r as P,x as O,ag as k,e as V,S as L,bi as ye,X as z,y as Te,D as m,Q as Ce,a as s,A as i,N as h,z as j,F as Fe,W as q,C as Z,R as D,M as _,a7 as R,bj as we,J as Se,K as Ee,aP as Ie,bk as ve}from"./index-869d77fb.js";import{M as be}from"./index-3eb77ad0.js";import{u as De}from"./student-register-store-a294a38a.js";import{d as _e}from"./deep-clone-c0d00fc2.js";import{C as xe,M as Be}from"./index-4a265525.js";import{O as X}from"./index-b286ae32.js";import{i as Q}from"./icon-gift-20293d47.js";import{P as Ne,Q as Oe,U as Ve,b as Le}from"./user-auth-8e7edf72.js";import{M as je}from"./index-b9d9d40c.js";import{O as Re}from"./index-ba9324bc.js";import{b as Ge,c as We}from"./index-155c29c2.js";import{T as G}from"./index-70d6770d.js";import{P as K}from"./index-6f985828.js";import{F as Ue}from"./index-988f61a4.js";import{F as w}from"./index-0153d173.js";import{R as He,a as Y}from"./index-62365511.js";import{C as Me}from"./index-1c6c2ec0.js";import{I as Pe}from"./index-e76f2a88.js";import"./index-cff93552.js";import"./index-32adfdfb.js";import"./browser-e949d08f.js";import"./index-8150a3e4.js";import"./Checker-4ac02e10.js";const ke="_studentRegisterContainer_17hh9_8",ze="_countdownSection_17hh9_13",qe="_timer_17hh9_32",Ze="_timerAll_17hh9_37",Xe="_timerTitle_17hh9_59",Qe="_timerTip_17hh9_64",Ke="_paymentContainer_17hh9_74",Ye="_giftTip_17hh9_84",Je="_needPrice_17hh9_88",$e="_unit_17hh9_105",et="_allPrice_17hh9_108",tt="_traditionBtn_17hh9_127",st="_studentSection_17hh9_135",ot="_studentSectionForm_17hh9_142",nt="_noSendDay_17hh9_146",at="_title1_17hh9_149",ut="_title2_17hh9_156",rt="_goodsGroup_17hh9_163",it="_goodsItem_17hh9_168",lt="_goodsInner_17hh9_182",ct="_checked_17hh9_186",dt="_checked1_17hh9_192",pt="_proposalTip_17hh9_198",mt="_registerForm_17hh9_212",At="_fieldTipsGroup_17hh9_220",ht="_fieldTips_17hh9_220",gt="_tips_17hh9_232",ft="_username_17hh9_239",yt="_countDown_17hh9_247",Tt="_codeText_17hh9_265",Ct="_memberNumer_17hh9_269",Ft="_iconGift_17hh9_281",wt="_radioSection_17hh9_291",St="_radioItem_17hh9_299",Et="_goodsSection_17hh9_310",It="_iconArrow_17hh9_321",vt="_goodsExtra_17hh9_328",bt="_goodsCell_17hh9_362",Dt="_img_17hh9_367",_t="_goodsName_17hh9_383",xt="_brandName_17hh9_388",Bt="_model_17hh9_400",Nt="_sendInstrument_17hh9_418",Ot="_moreBtn_17hh9_422",Vt="_sbtnGroup_17hh9_429",Lt="_goodsTradition_17hh9_441",jt="_goodsTitle_17hh9_453",Rt="_step_17hh9_460",Gt="_stepContent_17hh9_480",Wt="_nums_17hh9_490",Ut="_numInner_17hh9_501",n={"student-register":"_student-register_17hh9_1",studentRegisterContainer:ke,countdownSection:ze,timer:qe,timerAll:Ze,timerTitle:Xe,timerTip:Qe,paymentContainer:Ke,giftTip:Ye,needPrice:Je,unit:$e,allPrice:et,traditionBtn:tt,studentSection:st,studentSectionForm:ot,noSendDay:nt,title1:at,title2:ut,goodsGroup:rt,goodsItem:it,goodsInner:lt,checked:ct,checked1:dt,proposalTip:pt,registerForm:mt,fieldTipsGroup:At,fieldTips:ht,tips:gt,username:ft,countDown:yt,codeText:Tt,memberNumer:Ct,iconGift:Ft,radioSection:wt,radioItem:St,goodsSection:Et,iconArrow:It,goodsExtra:vt,goodsCell:bt,img:Dt,goodsName:_t,brandName:xt,model:Bt,sendInstrument:Nt,moreBtn:Ot,sbtnGroup:Vt,goodsTradition:Lt,goodsTitle:jt,step:Rt,stepContent:Gt,nums:Wt,numInner:Ut},Ht=""+new URL("tuangou-50d77141.png",import.meta.url).href,Mt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAAeCAMAAACc0eUaAAAAn1BMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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o8ioGPvJMKVfxWAhOQwH+zM3bZcETvnWqCdoh6j0WbPPvVD0tFNzQbwpK/mhVrG8xwW1KpKAcrQmGuGeZbV/ysncaBG+EC1qUUhwZUrp5XlAdM/jar4eC58w2eRVvxAeD8rVuFiRCcFaI/o/gTvxjURVUx4x5xlzfyff75+WtyxNS55cECVbatSjYaSUj/Rw84iT2eFyQnC0DiM7mlwRXcF01HNQrxlmSJwSnk8kEJ+9PJqP/EhzC9yVpEIwChhyfEHylil//FhNLfIl/VDCyWq0nBf1awZ04dV4SPJyO3nq93pYEB9Bt1wq2Lhf6hOD7B0PSgyY49TS6umA0tB0XRWRuaIJIvaCgVtAJAqYJmiETxEqw8RwMVRQF6fnMXhdsu66hBMFKF8QRru3im14WhDlXBVffFdxDu15wJu45WCeHZwWD83I1fn8g6H4508dVfLTunL4jmBpYg3kWZN8W7GYz63jKJ1QWTG+2WT1m6tEFvR7HlE0E4xFcwbqZEx+tM+wh+YpE+r3jeDxOmp6I4Li/Ud61871kXEsAAAAASUVORK5CYII=",Pt=""+new URL("icon-5-3d444825.png",import.meta.url).href,kt=""+new URL("icon-6-cbc3f8a5.png",import.meta.url).href,zt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJwAAAA2CAMAAAAF4QD3AAACylBMVEUAAAD/d1j/NWH/bFv/W13/NmH/OWL/flj/OV//NmD/eVn/N2H/eln/N1//eVj/N2D/NmD/OGD/OGD/elj/eVn/eFf/eFf/elf/OF//eFj/eFj/eFj/N2D/elj/N2H/N2L/OWH/N2D/d1j/NmD/OGD/eVj/e1b/clj/NV//eFj/e1j/elf/eFj/elj/eVf/OWH/cVj/fFn/e1n/////blj/cVj/dVf/PF//Ol//Xlr/RF7/Pl//S13/N1//aln/Ql7/T1z/QF7/Ulz/XFv/Ylr/NmD/ZFr/YFr/c1j/Tl3/SV3/OV//dFj/bFn/d1f/cFj/Rl7/WVv/YVr/P17/aVn/eVf/eFf/Z1n/W1v/SF3/VVz/VFz//f3/6+7/V1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urV0vGxlWwMs/Wf/u9dZBXE40v1GVLUbh/+721UZVyxTW/7ResU6TwwH/3vbWRV+tqdYvnz4n2GwFv0dLjugI1AAAAAElFTkSuQmCC",x=[];for(let p=1;p<=40;p++)x.push({text:p+"班",value:p});const J={1:"一年级",2:"二年级",3:"三年级",4:"四年级",5:"五年级",6:"六年级",7:"七年级",8:"八年级",9:"九年级"},$=(p,c)=>{let A=[];const f=[{text:"一年级",value:1,instrumentCode:c},{text:"二年级",value:2,instrumentCode:c},{text:"三年级",value:3,instrumentCode:c},{text:"四年级",value:4,instrumentCode:c},{text:"五年级",value:5,instrumentCode:c}],y=[{text:"六年级",value:6,instrumentCode:c}],e=[{text:"七年级",value:7,instrumentCode:c},{text:"八年级",value:8,instrumentCode:c},{text:"九年级",value:9,instrumentCode:c}];return p==="FIVE_YEAR_SYSTEM"?A.push(...f):p==="SIX_YEAR_SYSTEM"?A.push(...f,...y):p==="THREE_YEAR_SYSTEM"?A.push(...e):p==="FORE_YEAR_SYSTEM"?A.push(...y,...e):A.push(...f,...y,...e),A},hs=he({name:"student-register",setup(){const p=ge(),c=De(),A=fe();c.setShoolId(p.query.sId);const f=P(),y=P(),e=O({schoolId:p.query.sId,paymentType:"",details:[],gradeYear:"",schoolInstrumentSetType:null,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:"",dialogConfirmStatus:!1,contract_sign:!1,countDownTimePay:60*1e3,dialogConfig:{},showOtherSchool:!1,showOtherMessage:"",joinType:"",gradeList:[],classList:[],saveId:null,openId:null,code:null,intervalFnRef:null,registerExpireTime:null,instrumentCode:null,activeOverTime:0,activeOverStatus:!0}),u=O({showQrcode:!1,qrCodeUrl:"",pay_channel:"",orderInfo:{},authShow:!1,orderNo:null,config:{},paymentStatus:!1,orderTimer:null}),a=O({autoRegister:!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:""}),S=Ge(1e3,{controls:!0});S.pause();const E=k({time:e.countDownTimePay,onChange(t){e.dialogMessage=`有待支付订单,请在${Math.ceil(t.total/1e3)}s后重试`},onFinish(){e.dialogStatus=!1}}),T=k({time:e.activeOverTime,onFinish(){e.activeOverStatus=!0,!e.submitLoading&&v()}}),v=()=>{e.showTips=!0,e.showMessage="团购时间已截止,感谢您的参与",e.showButton=!1},ee=()=>{e.countDownStatus=!1,j(()=>{f.value.start()})},te=()=>{if(!_(a.username))return h("请输入正确的手机号码");e.imgCodeStatus=!0},se=V(()=>!!_(a.username)),oe=()=>{e.countDownStatus=!0,f.value.reset()},W=V(()=>u.orderInfo.orderType),ne=async()=>{var t;try{const{data:o}=await m.get("/edu-app/open/userOrder/registerGoods/"+e.schoolId,{noAuthorization:!0});c.setVip(o.details||[]),e.details=_e(o.details||[]),e.registerExpireTime=o.registerExpireTime,e.registerExpireTime&&(R(new Date).isBefore(e.registerExpireTime)?(e.activeOverStatus=!1,e.activeOverTime=R(e.registerExpireTime).diff(R(new Date)),T.reset(e.activeOverTime),T.start()):(v(),e.activeOverStatus=!0)),e.details.length>0&&(e.detailVip=e.details[0]),e.giftVipDay=o.giftVipDay||0,e.gradeYear=o.gradeYear,e.schoolInstrumentSetType=o.schoolInstrumentSetType,e.registerType=o.registerType,a.extra.registerType=o.registerType;const r=o.schoolInstrumentList||[];if(o.schoolInstrumentSetType==="SCHOOL"){const l=(t=r[0])==null?void 0:t.instrumentCode;e.gradeList=$(o.gradeYear,l),e.classList=x}else if(o.schoolInstrumentSetType==="GRADE")r.forEach(l=>{e.gradeList.push({text:J[l.gradeNum],value:l.gradeNum,instrumentId:l.instrumentId,instrumentCode:l.instrumentCode})}),e.classList=x;else if(o.schoolInstrumentSetType==="CLASS"){const l=[];r.forEach(C=>{l.includes(C.gradeNum)||l.push(C.gradeNum)});const d=[];l.forEach(C=>{const F={text:J[C],value:C,instrumentId:"",instrumentCode:"",instrumentName:"",classList:[]};r.forEach(g=>{C===g.gradeNum&&(F.instrumentId=g.instrumentId,F.instrumentCode=g.instrumentCode,F.instrumentName=g.instrumentName,F.classList.push({text:g.classNum+"班",value:g.classNum,instrumentCode:g.instrumentCode}))}),F.classList.sort((g,Ae)=>g.value-Ae.value),d.push(F)}),e.gradeList=d,e.classList=[]}else e.gradeList=$(o.gradeYear),e.classList=x;if(L().weixin){if(o.registerType!=="BUG_GOODS"||o.schoolStatus===0){e.showTips=!0,e.showMessage="二维码已经失效,详情请咨询学校老师",e.showButton=!1;return}}else e.showTips=!0}catch(o){}},I=V(()=>{let t=0,o=0;return c.getVip.forEach(l=>{t+=Number(l.currentPrice),o+=Number(l.originalPrice)}),{amount:t,originAmount:o}}),ae=()=>{if(_(a.username))if(a.password)if(a.extra.nickname)if(a.extra.currentGradeNum){if(!a.extra.currentClass)return h("请选择所在班级"),!0}else return h("请选择所在年级"),!0;else return h("请输入学生姓名"),!0;else return h("请输入验证码"),!0;else return h("请输入正确的手机号码"),!0;return!1},U=async()=>{e.submitLoading=!0;try{if(ae()){e.submitLoading=!1;return}const{extra:t,...o}=a,r=await m.post("/edu-app/userlogin",{requestType:"form",data:{...o,extra:JSON.stringify({...t,giftVipDay:e.detailVip.membershipDays||0+e.giftVipDay||0,schoolId:e.schoolId})}});if(r.code!==200)r.code===5436?(e.showTips=!0,e.showMessage="二维码已经失效,详情请咨询学校老师",e.showButton=!1):r.code===5435?(e.showTips=!0,e.showMessage=r.message,e.showButton=!0):r.code===5435&&(e.showTips=!0,e.showMessage=r.message,e.showButton=!1);else{c.setToken(r.data.token_type+" "+r.data.access_token),we();let l="NOT_REGISTER";e.joinType==="digitalize"&&(l="SELECT_INSTRUMENT"),e.joinType==="tradition"&&(l="NOT_BUY_INSTRUMENT"),await M(S.counter.value,l,r.data.userId,e.schoolId),S.counter.value=0;const d=await m.get("/edu-app/user/getUserInfo",{requestType:"form"});Se(d.data),await ue()}}finally{}e.submitLoading=!1},ue=async()=>{try{if(await ie())return;const o=await m.get("/edu-app/userPaymentOrder/registerStatus/"+e.schoolId),r=c.getVip;if(o.data.hasBuyCourse&&r.length>0){e.dialogConfirmStatus=!0;return}if(e.joinType==="tradition"){setTimeout(()=>{h("报名成功"),A.push("/download")},100);return}await B()}catch(t){}},re=async()=>{if(!(a.password.length!==6||!_(a.username)))try{const{data:t}=await m.get(`/edu-app/open/student/studentInfo?mobile=${a.username}&code=${a.password}&type=REGISTER`);if(t){if(a.extra.nickname||(a.extra.nickname=t.nickname),!a.extra.currentGradeNum){const o=e.gradeList||[];o==null||o.forEach(r=>{r.value===t.currentGradeNum&&(e.instrumentCode=r.instrumentCode,e.gradeNumText=r.text,a.extra.currentGradeNum=t.currentGradeNum,e.classList=r.classList)})}a.extra.currentClass||e.classList.forEach(o=>{o.value===t.currentClass&&(e.currentClassText=o.text,a.extra.currentClass=t.currentClass)}),a.extra.gender=a.extra.gender!==t.gender?t.gender:a.extra.gender}}catch(t){}},ie=async()=>{let t=!1;try{const{data:o}=await m.get("/edu-app/userPaymentOrder/unpaid");if(!o.id)return!1;if(o.cancelPayment)return await m.post("/edu-app/userPaymentOrder/cancelPayment/"+o.orderNo),!1;e.countDownTime=o.cancelTimes,E.reset(Number(o.cancelTimes)),E.start(),e.dialogMessage=`有待支付订单,请在${Math.ceil(E.current.value.total/1e3)}s后重试`,e.dialogStatus=!0,e.dialogConfig=o,t=!0}catch(o){}return t},B=async()=>{try{const t=c.getVip,o=c.getGoods,r=[];t.forEach(d=>{r.push({giftVipDay:d.membershipDays,goodsId:d.goodsId,goodsNum:1,goodsType:d.goodsType,paymentCashAmount:d.currentPrice,paymentCouponAmount:0})}),o.forEach(d=>{r.push({goodsId:d.productId,goodsNum:d.quantity,goodsType:"INSTRUMENTS",paymentCashAmount:d.price,paymentCouponAmount:0,goodsSkuId:d.productSkuId})});const l=await m.post("/edu-app/userPaymentOrder/executeOrder",{data:{buryId:e.saveId,registerType:e.registerType,paymentType:e.paymentType,bizId:e.schoolId,orderType:"SCHOOL_REGISTER",paymentCashAmount:I.value.amount||0,paymentCouponAmount:0,goodsInfos:r,orderName:"学生登记",orderDesc:"学生登记"}});l.code===5436?(e.showTips=!0,e.showMessage="二维码已经失效,详情请咨询学校老师",e.showButton=!1):l.code===5435?(e.showTips=!0,e.showMessage=l.message,e.showButton=!0):(u.config={...l.data.paymentConfig,paymentType:l.data.paymentType},u.orderNo=l.data.orderNo,await H())}catch(t){console.log(t,"any")}},H=async()=>{try{const t=Ee.user.data;if(e.contract_sign&&(!(t!=null&&t.account.realName)||!(t!=null&&t.account.idCardNo))){u.authShow=!0;return}const{data:o}=await m.post("/edu-app/userPaymentOrder/updateReceiveAddress",{data:{orderNo:u.orderNo,orderType:"SCHOOL_REGISTER"}});u.pay_channel=o.paymentChannel,o.status!=="WAIT_PAY"&&o.status!=="PAYING"?A.replace({path:"/payment-result",query:{orderNo:u.orderNo}}):le()}catch(t){}},le=()=>{const t=u.pay_channel;if(t){const o=Le(u.pay_channel);N({payCode:o,pay_channel:t})}else W.value==="VIP"?u.paymentStatus=!0:N({payCode:"payResult",pay_channel:"wx_pub"})},N=t=>{const o=u.config;u.pay_channel=t.pay_channel;const r=z.stringify({pay_channel:t.pay_channel,wxAppId:o.wxAppId,alipayAppId:o.alipayAppId,paymentType:e.paymentType,body:o.body,price:o.price,orderNo:o.merOrderNo,userId:o.userId});t.payCode==="payResult"?window.location.href=window.location.origin+"/classroom-app/#/payResult?"+r:(u.qrCodeUrl=window.location.origin+"/classroom-app/#/payDefine?"+r,u.showQrcode=!0,u.paymentStatus=!1,setTimeout(()=>{de()},300))},ce=async()=>{try{await m.post("/edu-app/userPaymentOrder/cancelPayment/"+u.orderNo)}catch(t){}},de=async()=>{const t=setInterval(async()=>{if(p.name!="student-register-form"){clearInterval(t);return}u.orderTimer=t;try{const{data:o}=await m.post("/edu-app/open/userOrder/paymentStatus/"+u.orderNo,{hideLoading:!0});o.status!=="WAIT_PAY"&&o.status!=="PAYING"&&(u.showQrcode=!1,clearInterval(u.orderTimer),setTimeout(()=>{A.replace({path:"/payment-result",query:{orderNo:u.orderNo}})},100))}catch(o){clearInterval(u.orderTimer)}},5e3)},pe=()=>{u.authShow=!1,B()},M=async(t=5,o,r,l)=>{try{const{data:d}=await m.post("/edu-app/open/studentRegisterPointRecord/update",{data:{id:e.saveId,useTime:t,joinType:o,userId:r,schoolId:l}});e.saveId=d}catch(d){}},me=async t=>{try{const{data:o}=await m.get("/edu-app/open/paramConfig/wechatAppId");o&&(Ie(),ve(o,t))}catch(o){}};if(L().weixin){const t=sessionStorage.getItem("active-open-id");e.openId=t;const o=ye();if(o)e.code=o;else{const r=window.location.origin+window.location.pathname+"#"+p.path+"?"+z.stringify({...p.query});return me(r),""}}const b=t=>t>9?t+"":"0"+t;return Te(async()=>{try{if(ne(),!e.code)return;const{data:t}=await m.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=We(async()=>{S.counter.value=0,S.resume(),await M()},5e3)}catch(t){}}),Ce(()=>{var t;(t=e.intervalFnRef)==null||t.pause()}),()=>s("div",{class:n["student-register"]},[s("div",{class:n.studentRegisterContainer},[!e.activeOverStatus&&s("div",{class:n.countdownSection},[s("div",{class:n.timer},[s("img",{src:Mt,class:n.timerTitle},null),s("div",{class:n.timerAll},[s("span",null,[b(T.current.value.days)]),i("天"),s("span",null,[b(T.current.value.hours)]),i("时"),s("span",null,[b(T.current.value.minutes)]),i("分"),s("span",null,[b(T.current.value.seconds)]),i("秒")])]),s("div",{class:n.timerTip},[i("请在规定时间内报名,超过截止时间,将无法使用个人账号")])]),s("div",{class:[n.studentSection,n.studentSectionForm,e.giftVipDay<=0&&n.noSendDay]},[s("div",{class:n.title1},null),s(Ue,{labelAlign:"left",class:n.registerForm},{default:()=>[s(w,{clearable:!1,label:"联系方式(直接监护人)",placeholder:"请输入手机号码",type:"tel",required:!0,autocomplete:"off",inputAlign:"right",class:n.username,modelValue:a.username,"onUpdate:modelValue":t=>a.username=t,border:!1,maxlength:11},{label:()=>s("div",null,[i("联系方式"),s("p",{class:n.tips},[i("(直接监护人)")])])}),s("div",{class:["van-hairline--bottom",n.fieldTipsGroup]},[s("div",{class:[n.fieldTips]},[i("手机号是音乐数字课堂的唯一登录账户")])]),s(w,{center:!0,clearable:!1,required:!0,inputAlign:"right",label:"验证码",placeholder:"请输入验证码",autocomplete:"off",type:"number",modelValue:a.password,"onUpdate:modelValue":[t=>a.password=t,t=>{re()}],maxlength:6},{button:()=>e.countDownStatus?s("span",{class:[n.codeText,se.value?"":n.codeTextDisabled],onClick:te},[i("获取验证码")]):s(xe,{ref:t=>f.value=t,"auto-start":!1,class:n.countDown,time:e.countDownTime,onFinish:oe,format:"ss秒后重试"},null)}),s(w,{clearable:!1,required:!0,inputAlign:"right",label:"学生姓名",placeholder:"请输入学生姓名",autocomplete:"off",maxlength:14,modelValue:a.extra.nickname,"onUpdate:modelValue":t=>a.extra.nickname=t},null),s(w,{clearable:!1,required:!0,inputAlign:"right",label:"学生性别",placeholder:"请选择性别",autocomplete:"off"},{input:()=>s(He,{"checked-color":"linear-gradient( 135deg, #31C7FF 0%, #007AFE 100%)",modelValue:a.extra.gender,"onUpdate:modelValue":t=>a.extra.gender=t,direction:"horizontal"},{default:()=>[s(G,{size:"large",type:"primary",color:a.extra.gender!==1?"#F5F6FA":"linear-gradient( 135deg, #31C7FF 0%, #007AFE 100%)",textColor:a.extra.gender!==1?"#626264":"#fff",class:n.radioSection},{default:()=>[s(Y,{class:n.radioItem,name:1},null),i("男")]}),s(G,{size:"large",type:"primary",color:a.extra.gender!==0?"#F5F6FA":"linear-gradient( 135deg, #31C7FF 0%, #007AFE 100%)",textColor:a.extra.gender!==0?"#626264":"#fff",class:n.radioSection},{default:()=>[s(Y,{class:n.radioItem,name:0},null),i("女")]})]})}),s(w,{clearable:!1,required:!0,inputAlign:"right",label:"所在年级",placeholder:"请选择年级",isLink:!0,readonly:!0,clickable:!1,modelValue:e.gradeNumText,onClick:()=>e.gradeStatus=!0},null),s(w,{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){h("请先选择年级");return}e.classStatus=!0}},null),e.giftVipDay>0?s("div",{class:n.memberNumer},[s("img",{src:Q,class:n.iconGift},null),s("p",null,[i("注册成功即可获得乐器AI学练工具"),s("span",null,[e.giftVipDay||0]),i("天有效期")])]):""]})]),s("div",{class:n.studentSection},[s("div",{class:n.title2},null),s("div",{class:n.goodsGroup},[s("div",{class:[n.goodsItem,n.digitalize,e.joinType==="digitalize"&&n.checked],onClick:()=>{if(!e.gradeNumText||!e.currentClassText){h("请先选择所在年级班级");return}e.joinType="digitalize",j(()=>{var t;(t=y.value)==null||t.onChnageHeight(),setTimeout(()=>{window.scrollTo(0,1e3)},50)})}},[s("div",{class:n.goodsInner},[s("i",{class:n.proposalTip},null),i("数字化方式")])]),s("div",{class:[n.goodsItem,n.tradition,e.joinType==="tradition"&&n.checked1],onClick:()=>{if(!e.gradeNumText||!e.currentClassText){h("请先选择所在年级班级");return}e.joinType="tradition",j(()=>{var t;(t=y.value)==null||t.onChnageHeight(),setTimeout(()=>{window.scrollTo(0,1e3)},50)})}},[s("div",{class:n.goodsInner},[i("传统方式")])])])]),e.joinType==="digitalize"&&s("div",{class:[n.goodsExtra]},[s("i",{class:n.iconArrow},null),s(Me,{border:!1,class:n.goodsCell},{icon:()=>s(Pe,{class:n.img,src:Ht},null),title:()=>s("div",{class:n.section},[s("div",{class:n.sectionContent},[s("h2",null,[s("img",{src:Pt,class:n.goodsName},null),s(G,{class:n.brandName},{default:()=>[i("12个月")]})]),s("p",{class:[n.model]},[s("p",null,[s("i",null,null),i("解决学生不会练、不知练的对错")]),s("p",null,[s("i",null,null),i("家长无法辅导、无需再额外请老师")])]),s("img",{src:kt,class:n.sendInstrument},null)])])}),e.detailVip.membershipDays?s("div",{class:n.memberNumer},[s("img",{src:Q,class:n.iconGift},null),s("p",null,[i("现在购买赠送乐器AI学练工具"),s("span",null,[e.detailVip.membershipDays||0]),i("天有效期")])]):""]),e.joinType==="tradition"&&s("div",{class:n.goodsTradition},[s("i",{class:n.iconArrow},null),s("div",{class:n.goodsTitle},null),s("div",{class:n.steps},[s("div",{class:n.step},[s("span",{class:n.nums},[s("span",{class:n.numInner},[i("1")])]),s("div",{class:n.stepContent},[s("span",null,[i("AI工具标准:")]),i("可以学练音乐教材中的乐曲,通过手机应用商店准备。")])]),e.instrumentCode==="Panpipes"&&s("div",{class:n.step},[s("span",{class:n.nums},[s("span",{class:n.numInner},[i("2")])]),s("div",{class:n.stepContent},[s("span",null,[i("乐器标准:")]),i("管数不限,建议20管以上C调加嘴排箫(音域宽,能演奏更多复杂乐曲,不需要重复更换),黑色,要选择单一原调(调性多学生很难掌握),价格由学生根据自身情况确定。")])])])]),e.joinType&&s(be,{position:"bottom",ref:y},{default:()=>[s("div",{class:n.paymentContainer},[e.joinType==="digitalize"&&s(Fe,null,[s("div",{class:n.payemntPrice},[s("img",{src:zt,class:n.giftTip},null),s("div",null,[s("span",{class:n.needPrice},[s("i",{style:"font-style: normal"},[i("¥ ")]),s("span",null,[q(I.value.amount)]),s("i",{class:n.unit,style:"font-style: normal"},[i("/年")])]),I.value.originAmount>I.value.amount?s("del",{class:n.allPrice},[i("¥ "),q(I.value.originAmount)]):""])]),s("div",{class:n.paymentBtn,onClick:()=>{U()}},[s(Z,{round:!0,disabled:e.submitLoading,loading:e.submitLoading},{default:()=>[i("立即支付")]})])]),e.joinType==="tradition"&&s("div",{class:n.traditionBtn,onClick:()=>{U()}},[s(Z,{round:!0,disabled:e.submitLoading,loading:e.submitLoading},{default:()=>[i("提交报名")]})])])]})]),e.imgCodeStatus?s(je,{value:e.imgCodeStatus,"onUpdate:value":t=>e.imgCodeStatus=t,phone:a.username,type:"REGISTER",onClose:()=>{e.imgCodeStatus=!1},onSendCode:ee},null):null,s(D,{show:e.gradeStatus,"onUpdate:show":t=>e.gradeStatus=t,position:"bottom",round:!0,safeAreaInsetBottom:!0,lazyRender:!1,class:"popupBottomSearch"},{default:()=>[s(K,{showToolbar:!0,columns:e.gradeList,onCancel:()=>e.gradeStatus=!1,onConfirm:t=>{const o=t.selectedOptions[0];a.extra.currentGradeNum=o.value,e.gradeNumText=o.text,e.gradeStatus=!1,["SCHOOL","GRADE"].includes(e.schoolInstrumentSetType)&&(e.instrumentCode=o.instrumentCode),e.schoolInstrumentSetType==="CLASS"&&(e.classList=o.classList),["CLASS","GRADE"].includes(e.schoolInstrumentSetType)&&(e.currentClassText="",a.extra.currentClass="")}},null)]}),s(D,{show:e.classStatus,"onUpdate:show":t=>e.classStatus=t,position:"bottom",round:!0,class:"popupBottomSearch"},{default:()=>[s(K,{showToolbar:!0,columns:e.classList,onCancel:()=>e.classStatus=!1,onConfirm:t=>{const o=t.selectedOptions[0];a.extra.currentClass=o.value,e.currentClassText=o.text,e.classStatus=!1,["CLASS"].includes(e.schoolInstrumentSetType)&&(e.instrumentCode=o.instrumentCode)}},null)]}),s(X,{title:"提示",show:e.dialogConfirmStatus,"onUpdate:show":t=>e.dialogConfirmStatus=t,message:"已购买会员,是否确认购买?",primaryColor:"#FF8057",allowHtml:!0,confirmButtonText:"确定",showCancelButton:!0,onConfirm:async()=>{await B()},onCancel:()=>{e.registerExpireTime&&e.activeOverStatus&&v()}},null),s(X,{title:"提示",show:e.dialogStatus,"onUpdate:show":t=>e.dialogStatus=t,message:e.dialogMessage,allowHtml:!0,primaryColor:"#FF8057",confirmButtonText:"继续支付",onConfirm:async()=>{E.pause();const t=e.dialogConfig.paymentConfig;u.config=t==null?void 0:t.paymentConfig,u.orderNo=t==null?void 0:t.orderNo,await H()},onCancel:t=>{E.pause(),e.registerExpireTime&&e.activeOverStatus&&v()}},null),s(D,{show:u.paymentStatus,closeOnClickOverlay:!1,position:"bottom",round:!0,closeOnPopstate:!0,safeAreaInsetBottom:!0,style:{minHeight:"30%"}},{default:()=>[s(Ne,{paymentConfig:u.orderInfo,onClose:()=>u.paymentStatus=!1,onBackOut:ce,onConfirm:t=>N(t)},null)]}),s(D,{show:u.showQrcode,"onUpdate:show":t=>u.showQrcode=t,round:!0,onClose:()=>{clearInterval(u.orderTimer)}},{default:()=>[s(Oe,{url:u.qrCodeUrl,pay_channel:u.pay_channel,orderType:W.value},null)]}),s(Re,{modelValue:u.authShow,"onUpdate:modelValue":t=>u.authShow=t},{default:()=>[s(Ve,{onSuccess:pe,hideHeader:!L().isApp},null)]}),s(Be,{show:e.showTips,message:e.showMessage,showButton:e.showButton,buttonText:"刷新",onConfirm:()=>window.location.reload()},null)])}});export{hs as default};
|