| 1 |
- import{aw as E,c as X,b as z,m as Z,t as W,d as x,ax as K,e as N,w as j,X as $,a as e,k as Q,D as f,E as _,V as w,A as i,L as ee,r as te,x as B,C as F,z as se,N as G,U as oe,q as ae,y as ne,P as v,F as le,I as V,Q as ue,G as R,J as L}from"./index-23748bc0.js";import{M as ie}from"./index-895c30f0.js";import{M as re}from"./index-9050e6c4.js";import{F as de,O as ce}from"./index-ce0dcceb.js";import{R as U,C as P,u as Y,S as pe}from"./student-register-store-7c08f809.js";import{F as T}from"./index-fa4b33b9.js";import{I as k}from"./index-ea067d86.js";import{P as O}from"./index-9ef7e6a2.js";import{C as M}from"./index-8abbc743.js";import{C as I}from"./index-d8999b5a.js";import{T as q}from"./index-fccd84c4.js";/* empty css */import"./Checker-0c3bf72a.js";import"./index-e848b0b0.js";import"./use-tab-status-1ae2cc0e.js";import"./index-e641524c.js";function me(t,n){const{days:d}=n;let{hours:l,minutes:a,seconds:r,milliseconds:g}=n;if(t.includes("DD")?t=t.replace("DD",E(d)):l+=d*24,t.includes("HH")?t=t.replace("HH",E(l)):a+=l*60,t.includes("mm")?t=t.replace("mm",E(a)):r+=a*60,t.includes("ss")?t=t.replace("ss",E(r)):g+=r*1e3,t.includes("S")){const h=E(g,3);t.includes("SSS")?t=t.replace("SSS",h):t.includes("SS")?t=t.replace("SS",h.slice(0,2)):t=t.replace("S",h.charAt(0))}return t}const[ge,fe]=X("count-down"),he={time:z(0),format:Z("HH:mm:ss"),autoStart:W,millisecond:Boolean};var _e=x({name:ge,props:he,emits:["change","finish"],setup(t,{emit:n,slots:d}){const{start:l,pause:a,reset:r,current:g}=K({time:+t.time,millisecond:t.millisecond,onChange:s=>n("change",s),onFinish:()=>n("finish")}),h=N(()=>me(t.format,g.value)),y=()=>{r(+t.time),t.autoStart&&l()};return j(()=>t.time,y,{immediate:!0}),$({start:l,pause:a,reset:y}),()=>e("div",{role:"timer",class:fe()},[d.default?d.default(g.value):h.value])}});const Ce=Q(_e),ye="_studentSection_3dvma_7",Se="_goodsSection_3dvma_25",ve="_titleTool_3dvma_36",be="_titleBuy_3dvma_45",Ae="_goodsCell_3dvma_52",Te="_noSelected_3dvma_57",Ee="_selected_3dvma_58",Ie="_img_3dvma_78",we="_brandName_3dvma_91",Fe="_model_3dvma_101",xe="_sbtnGroup_3dvma_111",De="_btnDetail_3dvma_123",Pe="_btnVideo_3dvma_124",Be="_priceCell_3dvma_164",ke="_sPriceGroup_3dvma_167",Ne="_tg_3dvma_175",Ge="_giftCell_3dvma_198",Ve="_gift_3dvma_198",Re="_iconGift_3dvma_216",Le="_goodsEmpty_3dvma_221",Ue="_shopImg_3dvma_230",Oe="_goodsContainer_3dvma_234",Me="_tips_3dvma_242",qe="_goSelect_3dvma_247",Ye="_addButton_3dvma_266",He="_paymentContainer_3dvma_285",Je="_needPrice_3dvma_295",Xe="_allPrice_3dvma_308",ze="_videoPopup_3dvma_327",o={"student-register":"_student-register_3dvma_1",studentSection:ye,goodsSection:Se,titleTool:ve,titleBuy:be,goodsCell:Ae,noSelected:Te,selected:Ee,delete:"_delete_3dvma_59",img:Ie,brandName:we,model:Fe,sbtnGroup:xe,btnDetail:De,btnVideo:Pe,priceCell:Be,sPriceGroup:ke,tg:Ne,giftCell:Ge,gift:Ve,iconGift:Re,goodsEmpty:Le,shopImg:Ue,goodsContainer:Oe,tips:Me,goSelect:qe,addButton:Ye,paymentContainer:He,needPrice:Je,allPrice:Xe,videoPopup:ze},Ze="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAMAAADW3miqAAAAjVBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8DizOFAAAALnRSTlMA4Y3756eI8JND97N+3co6M+pPKBIE9vLFv2BaHxwYmG9qSiokDwwI1LmuoHNC7/yX5QAAAVdJREFUOMuFktuWgjAMRYMdLBYEFBDxgo7X8Zb//7zRHFiodMF+OjXbJgTonSjwx1rlTjHYncnKMXC4QXurtpJtNX+ivOOXs5pzGyf6cOIJ21DLdwet9GZjUHWvCtai6YV7/JToIUWPKHJgjeqZMc9NDsPXLOfXP8fy66SEtJVTkckhzZl/JSUanbEfOeRrAjeenZAWLMgjBhI3VHFY7AicFUZ9ZUz4d6Av1lcW1LNHhPjUfPedueKKe93NODWaVZOldiHyJTRLG/AP1ZyUbIEI65haJZpJMSXdLyWk+qW4umlplTKFm6qZ9N0ixahxSRcEzyKNUNJEw16pINr1SgFRNumT9s/o9UihvG3TLWGFXqcUIp/GHZLZE4gMc2iRAsb3DpaKeT4EIedVchXzAAIswxbgNDx+LIpBr4bUbTlhQi1iX30oU7JSbn101UWwpw7SQ5yU9MU/KOVbcXkB4UkAAAAASUVORK5CYII=",We=""+new URL("shop-empty-6c02d334.png",import.meta.url).href,Ke="_registerModal_ra8en_1",je="_infoTitle_ra8en_7",$e="_registerForm_ra8en_13",Qe="_tips_ra8en_20",et="_codeText_ra8en_40",tt="_submitBtn_ra8en_45",b={registerModal:Ke,infoTitle:je,registerForm:$e,tips:Qe,codeText:et,submitBtn:tt},st=""+new URL("info-title-1f45c1de.png",import.meta.url).href,ot="_imgCode_mq980_1",at="_codeTitle_mq980_4",nt="_img_mq980_1",lt="_imgChange_mq980_16",ut="_field_mq980_23",it="_imgCodePopup_mq980_27",A={imgCode:ot,codeTitle:at,img:nt,imgChange:lt,field:ut,imgCodePopup:it},rt=x({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(w,{show:this.showStatus,class:A.imgCodePopup,closeOnClickOverlay:!1,onClose:()=>{this.$emit("close")},closeable:!0,closeIcon:"close"},{default:()=>[e("div",{class:A.imgCode},[e("p",{class:A.codeTitle},[i("输入图形验证码")]),e(U,null,{default:()=>[e(P,{span:"14"},{default:()=>[e(T,{placeholder:"请输入验证码",modelValue:this.code,"onUpdate:modelValue":t=>this.code=t,class:A.field,autocomplete:"off"},null)]}),e(P,{span:"10",class:A.img},{default:()=>[e(k,{src:this.identifyingCode,onClick:()=>this.updateIdentifyingCode()},{loading:()=>e(ee,{type:"spinner",size:"20"},null)})]})]}),e(U,{style:{display:"flex",justifyContent:"end"}},{default:()=>[e(P,{span:"10"},{default:()=>[e("span",{class:A.imgChange,onClick:()=>this.updateIdentifyingCode()},[i("看不清?换一换")])]})]})])]})}}),dt=Y(),H=[];for(let t=1;t<=40;t++)H.push({text:t+"班",value:t});const ct=x({name:"register-modal",props:{schoolId:{type:String,default:""},gradeYear:{type:String,default:""},schoolType:{type:String,default:""}},emits:["close","submit"],setup(t,{emit:n}){const d=te(),l=N(()=>{let u=[];const p=[{text:"一年级",value:1},{text:"二年级",value:2},{text:"三年级",value:3},{text:"四年级",value:4},{text:"五年级",value:5}],c=[{text:"六年级",value:6}],S=[{text:"七年级",value:7},{text:"八年级",value:8},{text:"九年级",value:9}];return t.gradeYear==="FIVE_YEAR_SYSTEM"?u.push([...p]):t.gradeYear==="SIX_YEAR_SYSTEM"?u.push([...p,...c]):t.gradeYear==="THREE_YEAR_SYSTEM"?u.push([...S]):t.gradeYear==="FORE_YEAR_SYSTEM"?u.push([...c,...S]):u.push([...p,...c,...S]),u}),a=B({countDownStatus:!0,countDownTime:1e3*120,modelValue:!1,imgCodeStatus:!1,gradeNumText:"",currentClassText:"",gradeStatus:!1,classStatus:!1,loading:!1}),r=B({autoRegister:!0,client_id:"cooleshow-student",client_secret:"cooleshow-student",extra:{nickname:"",currentGradeNum:"",currentClass:""},grant_type:"password",loginType:"SMS",password:"",username:""}),g=()=>{a.countDownStatus=!1,se(()=>{d.value.start()})},h=()=>{if(!G(r.username))return _("请输入正确的手机号码");a.imgCodeStatus=!0},y=()=>{a.countDownStatus=!0,d.value.reset()},s=async()=>{try{if(m())return;a.loading=!0;const{extra:u,...p}=r,{data:c}=await f.post("/edu-app/userlogin",{hideLoading:!1,requestType:"form",data:{...p,extra:JSON.stringify({...u,schoolId:t.schoolId})}});dt.setToken(c.token_type+" "+c.access_token),n("close"),n("submit")}catch(u){}finally{a.loading=!1}},m=()=>{if(G(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:b.registerModal},[e("img",{src:st,class:b.infoTitle},null),e(de,{labelAlign:"top",class:b.registerForm},{default:()=>[e(T,{clearable:!0,label:"联系方式(直接监护人)",placeholder:"请输入手机号码",type:"tel",autocomplete:"off",modelValue:r.username,"onUpdate:modelValue":u=>r.username=u,maxlength:11},{label:()=>e("div",null,[i("联系方式(直接监护人)"),e("p",{class:b.tips},[i("手机号是数字化器乐课堂的唯一登录账户")])])}),e(T,{center:!0,clearable:!0,label:"验证码",placeholder:"请输入验证码",autocomplete:"off",type:"number",modelValue:r.password,"onUpdate:modelValue":u=>r.password=u,maxlength:6},{button:()=>a.countDownStatus?e("span",{class:b.codeText,onClick:h},[i("获取验证码")]):e(Ce,{ref:u=>d.value=u,"auto-start":!1,time:a.countDownTime,onFinish:y,format:"ss秒"},null)}),e(T,{clearable:!0,label:"学生姓名",placeholder:"请输入学生姓名",autocomplete:"off",modelValue:r.extra.nickname,"onUpdate:modelValue":u=>r.extra.nickname=u},null),e(T,{clearable:!0,label:"所在年级",placeholder:"请选择年级",isLink:!0,readonly:!0,clickable:!1,modelValue:a.gradeNumText,onClick:()=>a.gradeStatus=!0},null),e(T,{clearable:!0,label:"所在班级",placeholder:"请选择班级",isLink:!0,readonly:!0,clickable:!1,modelValue:a.currentClassText,onClick:()=>a.classStatus=!0},null)]}),e(ce,{center:!0,modelValue:a.modelValue,"onUpdate:modelValue":u=>a.modelValue=u,prototcolType:"REGISTER"},null),e(F,{type:"primary",class:b.submitBtn,color:"linear-gradient(121deg, #FFD892 0%, #FFCB75 100%)",block:!0,onClick:s,disabled:a.loading,loading:a.loading},{default:()=>[i("确认")]}),a.imgCodeStatus?e(rt,{value:a.imgCodeStatus,"onUpdate:value":u=>a.imgCodeStatus=u,phone:r.username,onClose:()=>{a.imgCodeStatus=!1},onSendCode:g},null):null,e(w,{show:a.gradeStatus,"onUpdate:show":u=>a.gradeStatus=u,position:"bottom",round:!0,safeAreaInsetBottom:!0,lazyRender:!1,class:"popupBottomSearch"},{default:()=>[e(O,{showToolbar:!0,columns:l.value,onCancel:()=>a.gradeStatus=!1,onConfirm:u=>{const p=u.selectedOptions[0];r.extra.currentGradeNum=p.value,a.gradeNumText=p.text,a.gradeStatus=!1}},null)]}),e(w,{show:a.classStatus,"onUpdate:show":u=>a.classStatus=u,position:"bottom",round:!0,class:"popupBottomSearch"},{default:()=>[e(O,{showToolbar:!0,columns:H,onCancel:()=>a.classStatus=!1,onConfirm:u=>{const p=u.selectedOptions[0];r.extra.currentClass=p.value,a.currentClassText=p.text,a.classStatus=!1}},null)]})])}}),J=t=>{if(t===null)return null;const n=Object.assign({},t);return Object.keys(n).forEach(d=>n[d]=typeof t[d]=="object"?J(t[d]):t[d]),Array.isArray(t)?(n.length=t.length,Array.from(n)):n},Ft=x({name:"student-register",setup(){const t=oe(),n=Y(),d=ae();n.setShoolId(t.query.sId);const l=B({schoolId:t.query.sId,popupShow:!1,popupRegister:!1,details:[],schoolType:"",gradeYear:"",bugGoods:!1,submitLoading:!1}),a=async()=>{try{const{data:s}=await f.get("/edu-app/userPaymentOrder/unpaid");s.id&&await f.post("/edu-app/userPaymentOrder/cancelPayment/"+s.orderNo)}catch(s){}},r=async()=>{try{const{data:s}=await f.get("/edu-app/open/userOrder/registerGoods/"+l.schoolId,{noAuthorization:!0});n.setVip(s.details||[]),l.details=J(s.details||[]),l.bugGoods=s.bugGoods,l.schoolType=s.schoolType,l.gradeYear=s.gradeYear}catch(s){}},g=N(()=>{let s=0,m=0;return n.getVip.forEach(c=>{s+=Number(c.currentPrice),m+=Number(c.originalPrice)}),n.getGoods.forEach(c=>{s+=Number(c.price)*c.quantity,m+=Number(c.originalPrice)*c.quantity}),{amount:s,originAmount:m}}),h=s=>{ue({message:"是否删除该商品",confirmButtonColor:"#FF8633"}).then(()=>{console.log(s,"item"),n.deleteGoods(s.productSkuId)})},y=async()=>{try{l.submitLoading=!0;const s=R.get(L)||"";if(!(await f.post("/edu-app/open/user/verification",{noAuthorization:!0,data:{token:s}})).data){R.remove(L),n.deleteToken(),l.popupRegister=!0;return}await a();const u=await f.get("/edu-app/userPaymentOrder/registerStatus/"+l.schoolId),p=n.getVip,c=n.getGoods;if(u.data.hasBuyCourse&&p.length>0){setTimeout(()=>{_("您已购买数字化器乐学练工具,请勿重复购买")},100);return}const S=[];p.forEach(C=>{S.push({goodsId:C.goodsId,goodsNum:1,goodsType:C.goodsType,paymentCashAmount:C.currentPrice,paymentCouponAmount:0})}),c.forEach(C=>{S.push({goodsId:C.productId,goodsNum:C.quantity,goodsType:"INSTRUMENTS",paymentCashAmount:C.price,paymentCouponAmount:0,goodsSkuId:C.productSkuId})});const{data:D}=await f.post("/edu-app/userPaymentOrder/executeOrder",{hideLoading:!1,data:{paymentType:"adapay",bizId:l.schoolId,orderType:"SCHOOL_REGISTER",paymentCashAmount:g.value.amount||0,paymentCouponAmount:0,goodsInfos:S,orderName:"学生登记",orderDesc:"学生登记"}});d.push({path:"/order-detail",query:{pm:1,config:JSON.stringify({...D.paymentConfig,paymentType:D.paymentType}),orderNo:D.orderNo}})}finally{l.submitLoading=!1}};return ne(()=>{r()}),()=>e("div",{class:o["student-register"]},[e("div",{class:o.studentSection,style:{marginTop:"18px"}},[e("div",{class:o.titleTool},null),l.details.map(s=>e(M,{class:o.goodsSection,onClick:()=>{n.selectedVip(s.goodsId)?n.deleteVip(s.goodsId):n.setVip([s])}},{default:()=>[e(I,{border:!1,class:o.goodsCell},{icon:()=>e(k,{class:o.img,src:s.goodsUrl},null),title:()=>e("div",{class:o.section},[e("div",{class:o.sectionContent},[e("h2",null,[s.goodsName,e(q,{class:o.brandName},{default:()=>[i("12个月")]})]),e("p",{class:[o.model]},[s.description]),e("div",{class:o.sbtnGroup},[e("span",{class:o.btnDetail,onClick:m=>{m.stopPropagation(),d.push("/student-digital-tools")}},[i("查看详情")]),e("span",{class:o.btnVideo,onClick:m=>{m.stopPropagation(),l.popupShow=!0}},[i("介绍视频")])])]),e("i",{class:n.selectedVip(s.goodsId)?o.selected:o.noSelected},null)])}),e(I,{border:!1,class:o.priceCell},{title:()=>e("div",{class:o.sPriceGroup},[e("div",{class:o.tg},[i("团购价:"),e("span",null,[e("i",null,[i("¥ ")]),v(s.currentPrice)])]),s.currentPrice<s.originalPrice&&e("del",null,[i("¥"),v(s.originalPrice)])])}),e(I,{border:!1,class:o.giftCell},{title:()=>e("div",{class:o.gift},[e("img",{src:Ze,class:o.iconGift},null),i("现在购买赠送 "),e("span",null,[s.membershipDays||0]),i("天有效期")])})]}))]),l.bugGoods&&e(le,null,[e("div",{class:o.studentSection},[e("div",{class:o.titleBuy},null),n.getGoods&&n.getGoods.length<=0?e("div",{class:o.goodsEmpty},[e("img",{src:We,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(F,{class:o.goSelect,type:"primary",onClick:()=>{d.push("/goods-list")}},{default:()=>[i("进入商城选购"),e(V,{name:"arrow"},null)]})])]):n.getGoods.map((s,m)=>e(M,{class:o.goodsSection},{default:()=>[e(I,{border:!1,class:o.goodsCell},{icon:()=>e(k,{class:o.img,src:s.pic},null),title:()=>e("div",{class:o.section},[e("div",{class:o.sectionContent},[e("h2",null,[s.name,e(q,{class:o.brandName},{default:()=>[s.brandName]})]),e("p",{class:[o.model]},[i("规格:"),s.spDataJson]),e("p",{class:[o.model]},[s.productSn]),e(pe,{min:1,max:99,modelValue:s.quantity,"onUpdate:modelValue":u=>s.quantity=u},null)]),e("i",{class:o.delete,onClick:()=>h(s)},null)])}),e(I,{border:!1,class:o.priceCell},{title:()=>e("div",{class:o.sPriceGroup},[e("div",{class:o.tg},[i("团购价:"),e("span",null,[e("i",null,[i("¥ ")]),v(s.price)])]),s.price<s.originalPrice&&e("del",null,[i("¥"),v(s.originalPrice)])])})]}))]),n.getGoods&&n.getGoods.length>0&&e(F,{class:o.addButton,block:!0,onClick:()=>{d.push("/goods-list")}},{default:()=>[e(V,{name:"add-o"},null),i("进入商城选购")]})]),e(ie,{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,[v(g.value.amount)])]),e("del",{class:o.allPrice},[i("¥ "),v(g.value.originAmount)])]),e("div",{class:o.paymentBtn,onClick:()=>{const s=n.getVip,m=n.getGoods;if(s.length<=0&&m.length<=0){setTimeout(()=>{_("请选择需要购买的商品")},100);return}n.getToken?y():l.popupRegister=!0}},[e(F,{disabled:l.submitLoading,loading:l.submitLoading},{default:()=>[i("确认购买")]})])])]}),e(w,{show:l.popupShow,"onUpdate:show":s=>l.popupShow=s,class:o.videoPopup},{default:()=>[l.popupShow&&e(re,{src:"https://daya.ks3-cn-beijing.ksyun.com/202105/SWmqmvW.mp4"},null)]}),e(w,{show:l.popupRegister,"onUpdate:show":s=>l.popupRegister=s,class:o.registerPopup,position:"bottom",round:!0},{default:()=>[e(ct,{schoolId:l.schoolId,schoolType:l.schoolType,gradeYear:l.gradeYear,onClose:()=>l.popupRegister=!1,onSubmit:y},null)]})])}});export{Ft as default};
|