| 1 |
- import{aP as x,c as j,b as ee,m as te,t as se,d as B,ah as z,e as A,w as oe,X as ne,a as e,k as ae,D as f,E as _,V as E,A as i,L as ue,r as J,x as V,C as P,z as le,N,aY as ie,y as W,R as re,F as X,U as ce,q as de,P as b,I as O,Q as pe,G as M,J as q}from"./index-39878aac.js";import{i as me}from"./icon-gift-94736468.js";import{M as ge}from"./index-ff87d0c7.js";import{M as fe}from"./index-2e016041.js";import{O as he}from"./index-dadf9b9d.js";import{R as U,C as R,u as K,S as _e}from"./student-register-store-9a2132f5.js";import{F as w}from"./index-2a1e7134.js";import{I as L}from"./index-ca948403.js";import{F as Ce}from"./index-99392580.js";import{P as Y}from"./index-f51f1be7.js";import{O as ye}from"./index-be56755e.js";import{C as $}from"./index-94594873.js";import{C as D}from"./index-d05438d4.js";import{T as H}from"./index-3b53bac9.js";/* empty css */import"./index-0e33d63f.js";import"./Checker-5337f979.js";function Se(t,u){const{days:c}=u;let{hours:n,minutes:a,seconds:r,milliseconds:h}=u;if(t.includes("DD")?t=t.replace("DD",x(c)):n+=c*24,t.includes("HH")?t=t.replace("HH",x(n)):a+=n*60,t.includes("mm")?t=t.replace("mm",x(a)):r+=a*60,t.includes("ss")?t=t.replace("ss",x(r)):h+=r*1e3,t.includes("S")){const g=x(h,3);t.includes("SSS")?t=t.replace("SSS",g):t.includes("SS")?t=t.replace("SS",g.slice(0,2)):t=t.replace("S",g.charAt(0))}return t}const[Te,be]=j("count-down"),Fe={time:ee(0),format:te("HH:mm:ss"),autoStart:se,millisecond:Boolean};var we=B({name:Te,props:Fe,emits:["change","finish"],setup(t,{emit:u,slots:c}){const{start:n,pause:a,reset:r,current:h}=z({time:+t.time,millisecond:t.millisecond,onChange:T=>u("change",T),onFinish:()=>u("finish")}),g=A(()=>Se(t.format,h.value)),S=()=>{r(+t.time),t.autoStart&&n()};return oe(()=>t.time,S,{immediate:!0}),ne({start:n,pause:a,reset:S}),()=>e("div",{role:"timer",class:be()},[c.default?c.default(h.value):g.value])}});const Ee=ae(we),ve="_studentSection_1mcnc_7",xe="_goodsSection_1mcnc_25",De="_titleTool_1mcnc_36",Be="_titleBuy_1mcnc_45",Ie="_goodsCell_1mcnc_52",Pe="_noSelected_1mcnc_57",Ae="_selected_1mcnc_58",ke="_img_1mcnc_78",Ge="_brandName_1mcnc_91",Ne="_model_1mcnc_101",Re="_sbtnGroup_1mcnc_111",Ve="_btnDetail_1mcnc_123",Le="_btnVideo_1mcnc_124",Oe="_priceCell_1mcnc_164",Me="_sPriceGroup_1mcnc_167",qe="_tg_1mcnc_175",Ue="_giftCell_1mcnc_198",Ye="_gift_1mcnc_198",$e="_iconGift_1mcnc_216",He="_goodsEmpty_1mcnc_221",ze="_shopImg_1mcnc_230",Je="_goodsContainer_1mcnc_234",We="_tips_1mcnc_242",Xe="_goSelect_1mcnc_247",Ke="_addButton_1mcnc_266",Qe="_paymentContainer_1mcnc_285",Ze="_needPrice_1mcnc_295",je="_allPrice_1mcnc_308",et="_videoPopup_1mcnc_327",o={"student-register":"_student-register_1mcnc_1",studentSection:ve,goodsSection:xe,titleTool:De,titleBuy:Be,goodsCell:Ie,noSelected:Pe,selected:Ae,delete:"_delete_1mcnc_59",img:ke,brandName:Ge,model:Ne,sbtnGroup:Re,btnDetail:Ve,btnVideo:Le,priceCell:Oe,sPriceGroup:Me,tg:qe,giftCell:Ue,gift:Ye,iconGift:$e,goodsEmpty:He,shopImg:ze,goodsContainer:Je,tips:We,goSelect:Xe,addButton:Ke,paymentContainer:Qe,needPrice:Ze,allPrice:je,videoPopup:et},tt=""+new URL("shop-empty-6c02d334.png",import.meta.url).href,st="_registerModal_hxtgy_1",ot="_infoTitle_hxtgy_7",nt="_registerForm_hxtgy_13",at="_tips_hxtgy_20",ut="_codeText_hxtgy_40",lt="_codeTextDisabled_hxtgy_45",it="_submitBtn_hxtgy_48",y={registerModal:st,infoTitle:ot,registerForm:nt,tips:at,codeText:ut,codeTextDisabled:lt,submitBtn:it},rt=""+new URL("info-title-1f45c1de.png",import.meta.url).href,ct="_imgCode_mq980_1",dt="_codeTitle_mq980_4",pt="_img_mq980_1",mt="_imgChange_mq980_16",gt="_field_mq980_23",ft="_imgCodePopup_mq980_27",F={imgCode:ct,codeTitle:dt,img:pt,imgChange:mt,field:gt,imgCodePopup:ft},ht=B({name:"o-img-code",props:{value:Boolean,phone:[String,Number],type:{type:String,default:"LOGIN"}},emits:["close","sendCode"],data(){return{isSuffix:"/edu-app",showStatus:!1,identifyingCode:null,code:""}},mounted(){this.showStatus=this.value,this.sendImgCode()},watch:{value(t){this.showStatus=t},code(t){t.length>=4&&this.checkVerifyLoginImage()}},methods:{async sendImgCode(){const{data:t}=await f.get(this.isSuffix+"/open/sendImgCode",{requestType:"form",hideLoading:!0,params:{phone:this.phone}});this.identifyingCode=t},async updateIdentifyingCode(){this.sendImgCode()},async checkVerifyLoginImage(){try{if(this.code.length<4)return;await f.post("/edu-app/open/verifyImgCode",{requestType:"form",hideLoading:!0,data:{phone:this.phone,code:this.code}}),await f.post("/edu-app/open/sendSms",{requestType:"form",hideLoading:!0,data:{clientId:"cooleshow-student",type:"REGISTER",mobile:this.phone}}),setTimeout(()=>{_("验证码已发送")},100),this.$emit("close"),this.$emit("sendCode")}catch(t){this.code="",this.updateIdentifyingCode()}}},render(){return e(E,{show:this.showStatus,class:F.imgCodePopup,closeOnClickOverlay:!1,onClose:()=>{this.$emit("close")},closeable:!0,closeIcon:"close"},{default:()=>[e("div",{class:F.imgCode},[e("p",{class:F.codeTitle},[i("输入图形验证码")]),e(U,null,{default:()=>[e(R,{span:"14"},{default:()=>[e(w,{placeholder:"请输入验证码",modelValue:this.code,"onUpdate:modelValue":t=>this.code=t,class:F.field,autocomplete:"off"},null)]}),e(R,{span:"10",class:F.img},{default:()=>[e(L,{src:this.identifyingCode,onClick:()=>this.updateIdentifyingCode()},{loading:()=>e(ue,{type:"spinner",size:"20"},null)})]})]}),e(U,{style:{display:"flex",justifyContent:"end"}},{default:()=>[e(R,{span:"10"},{default:()=>[e("span",{class:F.imgChange,onClick:()=>this.updateIdentifyingCode()},[i("看不清?换一换")])]})]})])]})}}),_t=K(),Q=[];for(let t=1;t<=40;t++)Q.push({text:t+"班",value:t});const Ct=B({name:"register-modal",props:{schoolId:{type:String,default:""},gradeYear:{type:String,default:""},schoolType:{type:String,default:""}},emits:["close","submit"],setup(t,{emit:u}){const c=J(),n=A(()=>{let l=[];const m=[{text:"一年级",value:1},{text:"二年级",value:2},{text:"三年级",value:3},{text:"四年级",value:4},{text:"五年级",value:5}],p=[{text:"六年级",value:6}],v=[{text:"七年级",value:7},{text:"八年级",value:8},{text:"九年级",value:9}];return t.gradeYear==="FIVE_YEAR_SYSTEM"?l.push([...m]):t.gradeYear==="SIX_YEAR_SYSTEM"?l.push([...m,...p]):t.gradeYear==="THREE_YEAR_SYSTEM"?l.push([...v]):t.gradeYear==="FORE_YEAR_SYSTEM"?l.push([...p,...v]):l.push([...m,...p,...v]),l}),a=V({countDownStatus:!0,countDownTime:1e3*120,modelValue:!1,imgCodeStatus:!1,gradeNumText:"",currentClassText:"",gradeStatus:!1,classStatus:!1,loading:!1}),r=V({autoRegister:!0,client_id:"cooleshow-student",client_secret:"cooleshow-student",extra:{nickname:"",currentGradeNum:"",currentClass:""},grant_type:"password",loginType:"SMS",password:"",username:""}),h=()=>{a.countDownStatus=!1,le(()=>{c.value.start()})},g=()=>{if(!N(r.username))return _("请输入正确的手机号码");a.imgCodeStatus=!0},S=A(()=>!!N(r.username)),T=()=>{a.countDownStatus=!0,c.value.reset()},s=async()=>{try{if(d())return;a.loading=!0;const{extra:l,...m}=r,{data:p}=await f.post("/edu-app/userlogin",{hideLoading:!1,requestType:"form",data:{...m,extra:JSON.stringify({...l,schoolId:t.schoolId})}});_t.setToken(p.token_type+" "+p.access_token),ie(),u("close"),u("submit")}catch(l){}finally{a.loading=!1}},d=()=>{if(N(r.username))if(r.password)if(r.extra.nickname)if(r.extra.currentGradeNum){if(!r.extra.currentClass)return _("请选择所在班级"),!0}else return _("请选择所在年级"),!0;else return _("请输入学生姓名"),!0;else return _("请输入验证码"),!0;else return _("请输入正确的手机号码"),!0;return!1};return()=>e("div",{class:y.registerModal},[e("img",{src:rt,class:y.infoTitle},null),e(Ce,{labelAlign:"top",class:y.registerForm},{default:()=>[e(w,{clearable:!0,label:"联系方式(直接监护人)",placeholder:"请输入手机号码",type:"tel",autocomplete:"off",modelValue:r.username,"onUpdate:modelValue":l=>r.username=l,maxlength:11},{label:()=>e("div",null,[i("联系方式(直接监护人)"),e("p",{class:y.tips},[i("手机号是数字化器乐学练工具的唯一登录账户")])])}),e(w,{center:!0,clearable:!0,label:"验证码",placeholder:"请输入验证码",autocomplete:"off",type:"number",modelValue:r.password,"onUpdate:modelValue":l=>r.password=l,maxlength:6},{button:()=>a.countDownStatus?e("span",{class:[y.codeText,S.value?"":y.codeTextDisabled],onClick:g},[i("获取验证码")]):e(Ee,{ref:l=>c.value=l,"auto-start":!1,time:a.countDownTime,onFinish:T,format:"ss秒"},null)}),e(w,{clearable:!0,label:"学生姓名",placeholder:"请输入学生姓名",autocomplete:"off",modelValue:r.extra.nickname,"onUpdate:modelValue":l=>r.extra.nickname=l},null),e(w,{clearable:!0,label:"所在年级",placeholder:"请选择年级",isLink:!0,readonly:!0,clickable:!1,modelValue:a.gradeNumText,onClick:()=>a.gradeStatus=!0},null),e(w,{clearable:!0,label:"所在班级",placeholder:"请选择班级",isLink:!0,readonly:!0,clickable:!1,modelValue:a.currentClassText,onClick:()=>a.classStatus=!0},null)]}),e(he,{center:!0,modelValue:a.modelValue,"onUpdate:modelValue":l=>a.modelValue=l,prototcolType:"REGISTER"},null),e(P,{type:"primary",class:y.submitBtn,color:"linear-gradient(121deg, #FFD892 0%, #FFCB75 100%)",block:!0,onClick:s,disabled:a.loading,loading:a.loading},{default:()=>[i("确认")]}),a.imgCodeStatus?e(ht,{value:a.imgCodeStatus,"onUpdate:value":l=>a.imgCodeStatus=l,phone:r.username,onClose:()=>{a.imgCodeStatus=!1},onSendCode:h},null):null,e(E,{show:a.gradeStatus,"onUpdate:show":l=>a.gradeStatus=l,position:"bottom",round:!0,safeAreaInsetBottom:!0,lazyRender:!1,class:"popupBottomSearch"},{default:()=>[e(Y,{showToolbar:!0,columns:n.value,onCancel:()=>a.gradeStatus=!1,onConfirm:l=>{const m=l.selectedOptions[0];r.extra.currentGradeNum=m.value,a.gradeNumText=m.text,a.gradeStatus=!1}},null)]}),e(E,{show:a.classStatus,"onUpdate:show":l=>a.classStatus=l,position:"bottom",round:!0,class:"popupBottomSearch"},{default:()=>[e(Y,{showToolbar:!0,columns:Q,onCancel:()=>a.classStatus=!1,onConfirm:l=>{const m=l.selectedOptions[0];r.extra.currentClass=m.value,a.currentClassText=m.text,a.classStatus=!1}},null)]})])}}),Z=t=>{if(t===null)return null;const u=Object.assign({},t);return Object.keys(u).forEach(c=>u[c]=typeof t[c]=="object"?Z(t[c]):t[c]),Array.isArray(t)?(u.length=t.length,Array.from(u)):u},yt="_wxPopupDialog_1sfd3_1",St="_popupContainer_1sfd3_16",Tt="_title1_1sfd3_22",bt="_popupTips_1sfd3_29",I={wxPopupDialog:yt,popupContainer:St,title1:Tt,popupTips:bt},Ft=B({name:"m-wx-tip",props:{show:{type:Boolean,default:!0},title:{type:String,default:"温馨提示"},message:{type:String,default:"请使用微信打开"}},setup(t){const u=J(!1);return W(()=>{if(!re().weixin&&t.show){u.value=!0;return}}),()=>e(X,null,[e(E,{show:u.value,"onUpdate:show":c=>u.value=c,round:!0,style:{width:"88%"},closeOnClickOverlay:!1,class:I.wxPopupDialog},{default:()=>[e("div",{class:I.popupContainer},[e("p",{class:I.title1},[t.title]),e("p",{class:I.popupTips},[t.message])])]})])}}),qt=B({name:"student-register",setup(){const t=ce(),u=K(),c=de();u.setShoolId(t.query.sId);const n=V({schoolId:t.query.sId,popupShow:!1,popupRegister:!1,details:[],schoolType:"",gradeYear:"",bugGoods:!1,submitLoading:!1,dialogStatus:!1,dialogMessage:"",countDownTime:60*1e3,dialogConfig:{}}),a=z({time:n.countDownTime,onChange(s){n.dialogMessage=`有待支付订单,请在${Math.ceil(s.total/1e3)}s后重试`},onFinish(){n.dialogStatus=!1}}),r=async()=>{let s=!1;try{const{data:d}=await f.get("/edu-app/userPaymentOrder/unpaid");if(!d.id)return!1;if(d.cancelPayment)return await f.post("/edu-app/userPaymentOrder/cancelPayment/"+d.orderNo),!1;n.countDownTime=d.cancelTimes,a.reset(Number(d.cancelTimes)),a.start(),n.dialogMessage=`有待支付订单,请在${Math.ceil(a.current.value.total/1e3)}s后重试`,n.dialogStatus=!0,n.dialogConfig=d,s=!0}catch(d){}return s},h=async()=>{try{const{data:s}=await f.get("/edu-app/open/userOrder/registerGoods/"+n.schoolId,{noAuthorization:!0});u.setVip(s.details||[]),n.details=Z(s.details||[]),n.bugGoods=s.bugGoods,n.schoolType=s.schoolType,n.gradeYear=s.gradeYear}catch(s){}},g=A(()=>{let s=0,d=0;return u.getVip.forEach(p=>{s+=Number(p.currentPrice),d+=Number(p.originalPrice)}),u.getGoods.forEach(p=>{s+=Number(p.price)*p.quantity,d+=Number(p.originalPrice)*p.quantity}),{amount:s,originAmount:d}}),S=s=>{pe({message:"是否删除该商品",confirmButtonColor:"#FF8633"}).then(()=>{u.deleteGoods(s.productSkuId)})},T=async()=>{try{n.submitLoading=!0;const s=M.get(q)||"";if(!(await f.post("/edu-app/open/user/verification",{noAuthorization:!0,data:{token:s}})).data){M.remove(q),u.deleteToken(),n.popupRegister=!0;return}if(await r())return;const m=await f.get("/edu-app/userPaymentOrder/registerStatus/"+n.schoolId),p=u.getVip,v=u.getGoods;if(m.data.hasBuyCourse&&p.length>0){setTimeout(()=>{_("您已购买数字化器乐学练工具,请勿重复购买")},100);return}const k=[];p.forEach(C=>{k.push({goodsId:C.goodsId,goodsNum:1,goodsType:C.goodsType,paymentCashAmount:C.currentPrice,paymentCouponAmount:0})}),v.forEach(C=>{k.push({goodsId:C.productId,goodsNum:C.quantity,goodsType:"INSTRUMENTS",paymentCashAmount:C.price,paymentCouponAmount:0,goodsSkuId:C.productSkuId})});const{data:G}=await f.post("/edu-app/userPaymentOrder/executeOrder",{hideLoading:!1,data:{paymentType:"adapay",bizId:n.schoolId,orderType:"SCHOOL_REGISTER",paymentCashAmount:g.value.amount||0,paymentCouponAmount:0,goodsInfos:k,orderName:"学生登记",orderDesc:"学生登记"}});c.push({path:"/order-detail",query:{pm:1,config:JSON.stringify({...G.paymentConfig,paymentType:G.paymentType}),orderNo:G.orderNo}})}finally{n.submitLoading=!1}};return W(()=>{h()}),()=>e("div",{class:o["student-register"]},[e("div",{class:o.studentSection,style:{marginTop:"18px"}},[e("div",{class:o.titleTool},null),n.details.map(s=>e($,{class:o.goodsSection,onClick:()=>{u.selectedVip(s.goodsId)?u.deleteVip(s.goodsId):u.setVip([s])}},{default:()=>[e(D,{border:!1,class:o.goodsCell},{icon:()=>e(L,{class:o.img,src:s.goodsUrl},null),title:()=>e("div",{class:o.section},[e("div",{class:o.sectionContent},[e("h2",null,[s.goodsName,e(H,{class:o.brandName},{default:()=>[i("12个月")]})]),e("p",{class:[o.model]},[s.description]),e("div",{class:o.sbtnGroup},[e("span",{class:o.btnDetail,onClick:d=>{d.stopPropagation(),c.push("/student-digital-tools")}},[i("查看详情")]),e("span",{class:o.btnVideo,onClick:d=>{d.stopPropagation(),n.popupShow=!0}},[i("介绍视频")])])]),e("i",{class:u.selectedVip(s.goodsId)?o.selected:o.noSelected},null)])}),e(D,{border:!1,class:o.priceCell},{title:()=>e("div",{class:o.sPriceGroup},[e("div",{class:o.tg},[i("团购价:"),e("span",null,[e("i",null,[i("¥ ")]),b(s.currentPrice)])]),s.currentPrice<s.originalPrice&&e("del",null,[i("¥"),b(s.originalPrice)])])}),s.membershipDays>0&&e(D,{border:!1,class:o.giftCell},{title:()=>e("div",{class:o.gift},[e("img",{src:me,class:o.iconGift},null),i("现在购买赠送 "),e("span",null,[s.membershipDays||0]),i("天有效期")])})]}))]),n.bugGoods&&e(X,null,[e("div",{class:o.studentSection},[e("div",{class:o.titleBuy},null),u.getGoods&&u.getGoods.length<=0?e("div",{class:o.goodsEmpty},[e("img",{src:tt,class:o.shopImg},null),e("div",{class:o.goodsContainer},[e("h2",null,[i("为你的"),e("span",null,[i("音乐之旅")]),i("做好准备")]),e("p",{class:o.tips},[i("快去选购乐器吧~")]),e(P,{class:o.goSelect,type:"primary",onClick:()=>{c.push("/goods-list")}},{default:()=>[i("进入商城选购"),e(O,{name:"arrow"},null)]})])]):u.getGoods.map((s,d)=>e($,{class:o.goodsSection},{default:()=>[e(D,{border:!1,class:o.goodsCell},{icon:()=>e(L,{class:o.img,src:s.pic},null),title:()=>e("div",{class:o.section},[e("div",{class:o.sectionContent},[e("h2",null,[s.name,e(H,{class:o.brandName},{default:()=>[s.brandName]})]),e("p",{class:[o.model]},[i("规格:"),s.spDataJson]),e("p",{class:[o.model]},[s.productSn]),e(_e,{min:1,max:99,modelValue:s.quantity,"onUpdate:modelValue":l=>s.quantity=l},null)]),e("i",{class:o.delete,onClick:()=>S(s)},null)])}),e(D,{border:!1,class:o.priceCell},{title:()=>e("div",{class:o.sPriceGroup},[e("div",{class:o.tg},[i("团购价:"),e("span",null,[e("i",null,[i("¥ ")]),b(s.price)])]),s.price<s.originalPrice&&e("del",null,[i("¥"),b(s.originalPrice)])])})]}))]),u.getGoods&&u.getGoods.length>0&&e(P,{class:o.addButton,block:!0,onClick:()=>{c.push("/goods-list")}},{default:()=>[e(O,{name:"add-o"},null),i("进入商城选购")]})]),e(ge,{position:"bottom"},{default:()=>[e("div",{class:o.paymentContainer},[e("div",{class:o.payemntPrice},[e("span",{class:o.needPrice},[e("i",{style:"font-style: normal"},[i("¥ ")]),e("span",null,[b(g.value.amount)])]),e("del",{class:o.allPrice},[i("¥ "),b(g.value.originAmount)])]),e("div",{class:o.paymentBtn,onClick:()=>{const s=u.getVip,d=u.getGoods;if(s.length<=0&&d.length<=0){setTimeout(()=>{_("请选择需要购买的商品")},100);return}u.getToken?T():n.popupRegister=!0}},[e(P,{disabled:n.submitLoading,loading:n.submitLoading},{default:()=>[i("确认购买")]})])])]}),e(E,{show:n.popupShow,"onUpdate:show":s=>n.popupShow=s,class:o.videoPopup},{default:()=>[n.popupShow&&e(fe,{src:"https://daya.ks3-cn-beijing.ksyun.com/202105/SWmqmvW.mp4"},null)]}),e(E,{show:n.popupRegister,"onUpdate:show":s=>n.popupRegister=s,class:o.registerPopup,position:"bottom",round:!0},{default:()=>[e(Ct,{schoolId:n.schoolId,schoolType:n.schoolType,gradeYear:n.gradeYear,onClose:()=>n.popupRegister=!1,onSubmit:T},null)]}),e(ye,{title:"提示",show:n.dialogStatus,"onUpdate:show":s=>n.dialogStatus=s,message:n.dialogMessage,allowHtml:!0,confirmButtonText:"继续支付",onConfirm:()=>{const s=n.dialogConfig.paymentConfig;c.push({path:"/order-detail",query:{pm:1,config:JSON.stringify(s.paymentConfig),orderNo:s.orderNo}}),a.pause()},onCancel:s=>{a.pause()}},null),e(Ft,null,null)])}});export{qt as default};
|