index-af23d03f.js 17 KB

1
  1. import{aw as E,c as K,b as $,m as j,t as Q,d as F,aB as ee,e as G,w as te,X as se,a as e,k as oe,D as f,E as _,V as w,A as i,L as ae,r as H,x as k,C as P,z as ne,N as R,y as J,R as le,F as X,U as ue,q as ie,P as v,I as V,Q as re,G as L,J as O}from"./index-7cb827e0.js";import{M as de}from"./index-0f5e3b29.js";import{M as ce}from"./index-10268605.js";import{F as pe,O as me}from"./index-56362ecd.js";import{R as U,C as B,u as z,S as ge}from"./student-register-store-6a0d1ef7.js";import{F as T}from"./index-9d69b8b1.js";import{I as N}from"./index-85b1f167.js";import{P as M}from"./index-86b681d0.js";import{C as q}from"./index-2cc36847.js";import{C as I}from"./index-bae3f75b.js";import{T as Y}from"./index-a07b9ab6.js";/* empty css */import"./Checker-ab94c5ad.js";import"./index-e200509c.js";import"./use-tab-status-6b1fcfe4.js";import"./index-6191cf05.js";function fe(t,a){const{days:d}=a;let{hours:l,minutes:n,seconds:r,milliseconds:g}=a;if(t.includes("DD")?t=t.replace("DD",E(d)):l+=d*24,t.includes("HH")?t=t.replace("HH",E(l)):n+=l*60,t.includes("mm")?t=t.replace("mm",E(n)):r+=n*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[he,_e]=K("count-down"),Ce={time:$(0),format:j("HH:mm:ss"),autoStart:Q,millisecond:Boolean};var ye=F({name:he,props:Ce,emits:["change","finish"],setup(t,{emit:a,slots:d}){const{start:l,pause:n,reset:r,current:g}=ee({time:+t.time,millisecond:t.millisecond,onChange:s=>a("change",s),onFinish:()=>a("finish")}),h=G(()=>fe(t.format,g.value)),y=()=>{r(+t.time),t.autoStart&&l()};return te(()=>t.time,y,{immediate:!0}),se({start:l,pause:n,reset:y}),()=>e("div",{role:"timer",class:_e()},[d.default?d.default(g.value):h.value])}});const Se=oe(ye),ve="_studentSection_3dvma_7",be="_goodsSection_3dvma_25",Ae="_titleTool_3dvma_36",Te="_titleBuy_3dvma_45",we="_goodsCell_3dvma_52",Ee="_noSelected_3dvma_57",Ie="_selected_3dvma_58",Fe="_img_3dvma_78",xe="_brandName_3dvma_91",Pe="_model_3dvma_101",De="_sbtnGroup_3dvma_111",Be="_btnDetail_3dvma_123",ke="_btnVideo_3dvma_124",Ne="_priceCell_3dvma_164",Ge="_sPriceGroup_3dvma_167",Re="_tg_3dvma_175",Ve="_giftCell_3dvma_198",Le="_gift_3dvma_198",Oe="_iconGift_3dvma_216",Ue="_goodsEmpty_3dvma_221",Me="_shopImg_3dvma_230",qe="_goodsContainer_3dvma_234",Ye="_tips_3dvma_242",He="_goSelect_3dvma_247",Je="_addButton_3dvma_266",Xe="_paymentContainer_3dvma_285",ze="_needPrice_3dvma_295",We="_allPrice_3dvma_308",Ze="_videoPopup_3dvma_327",o={"student-register":"_student-register_3dvma_1",studentSection:ve,goodsSection:be,titleTool:Ae,titleBuy:Te,goodsCell:we,noSelected:Ee,selected:Ie,delete:"_delete_3dvma_59",img:Fe,brandName:xe,model:Pe,sbtnGroup:De,btnDetail:Be,btnVideo:ke,priceCell:Ne,sPriceGroup:Ge,tg:Re,giftCell:Ve,gift:Le,iconGift:Oe,goodsEmpty:Ue,shopImg:Me,goodsContainer:qe,tips:Ye,goSelect:He,addButton:Je,paymentContainer:Xe,needPrice:ze,allPrice:We,videoPopup:Ze},Ke="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAMAAADW3miqAAAAjVBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8DizOFAAAALnRSTlMA4Y3756eI8JND97N+3co6M+pPKBIE9vLFv2BaHxwYmG9qSiokDwwI1LmuoHNC7/yX5QAAAVdJREFUOMuFktuWgjAMRYMdLBYEFBDxgo7X8Zb//7zRHFiodMF+OjXbJgTonSjwx1rlTjHYncnKMXC4QXurtpJtNX+ivOOXs5pzGyf6cOIJ21DLdwet9GZjUHWvCtai6YV7/JToIUWPKHJgjeqZMc9NDsPXLOfXP8fy66SEtJVTkckhzZl/JSUanbEfOeRrAjeenZAWLMgjBhI3VHFY7AicFUZ9ZUz4d6Av1lcW1LNHhPjUfPedueKKe93NODWaVZOldiHyJTRLG/AP1ZyUbIEI65haJZpJMSXdLyWk+qW4umlplTKFm6qZ9N0ixahxSRcEzyKNUNJEw16pINr1SgFRNumT9s/o9UihvG3TLWGFXqcUIp/GHZLZE4gMc2iRAsb3DpaKeT4EIedVchXzAAIswxbgNDx+LIpBr4bUbTlhQi1iX30oU7JSbn101UWwpw7SQ5yU9MU/KOVbcXkB4UkAAAAASUVORK5CYII=",$e=""+new URL("shop-empty-6c02d334.png",import.meta.url).href,je="_registerModal_ra8en_1",Qe="_infoTitle_ra8en_7",et="_registerForm_ra8en_13",tt="_tips_ra8en_20",st="_codeText_ra8en_40",ot="_submitBtn_ra8en_45",b={registerModal:je,infoTitle:Qe,registerForm:et,tips:tt,codeText:st,submitBtn:ot},at=""+new URL("info-title-1f45c1de.png",import.meta.url).href,nt="_imgCode_mq980_1",lt="_codeTitle_mq980_4",ut="_img_mq980_1",it="_imgChange_mq980_16",rt="_field_mq980_23",dt="_imgCodePopup_mq980_27",A={imgCode:nt,codeTitle:lt,img:ut,imgChange:it,field:rt,imgCodePopup:dt},ct=F({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(B,{span:"14"},{default:()=>[e(T,{placeholder:"请输入验证码",modelValue:this.code,"onUpdate:modelValue":t=>this.code=t,class:A.field,autocomplete:"off"},null)]}),e(B,{span:"10",class:A.img},{default:()=>[e(N,{src:this.identifyingCode,onClick:()=>this.updateIdentifyingCode()},{loading:()=>e(ae,{type:"spinner",size:"20"},null)})]})]}),e(U,{style:{display:"flex",justifyContent:"end"}},{default:()=>[e(B,{span:"10"},{default:()=>[e("span",{class:A.imgChange,onClick:()=>this.updateIdentifyingCode()},[i("看不清?换一换")])]})]})])]})}}),pt=z(),W=[];for(let t=1;t<=40;t++)W.push({text:t+"班",value:t});const mt=F({name:"register-modal",props:{schoolId:{type:String,default:""},gradeYear:{type:String,default:""},schoolType:{type:String,default:""}},emits:["close","submit"],setup(t,{emit:a}){const d=H(),l=G(()=>{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}),n=k({countDownStatus:!0,countDownTime:1e3*120,modelValue:!1,imgCodeStatus:!1,gradeNumText:"",currentClassText:"",gradeStatus:!1,classStatus:!1,loading:!1}),r=k({autoRegister:!0,client_id:"cooleshow-student",client_secret:"cooleshow-student",extra:{nickname:"",currentGradeNum:"",currentClass:""},grant_type:"password",loginType:"SMS",password:"",username:""}),g=()=>{n.countDownStatus=!1,ne(()=>{d.value.start()})},h=()=>{if(!R(r.username))return _("请输入正确的手机号码");n.imgCodeStatus=!0},y=()=>{n.countDownStatus=!0,d.value.reset()},s=async()=>{try{if(m())return;n.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})}});pt.setToken(c.token_type+" "+c.access_token),a("close"),a("submit")}catch(u){}finally{n.loading=!1}},m=()=>{if(R(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:at,class:b.infoTitle},null),e(pe,{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:()=>n.countDownStatus?e("span",{class:b.codeText,onClick:h},[i("获取验证码")]):e(Se,{ref:u=>d.value=u,"auto-start":!1,time:n.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:n.gradeNumText,onClick:()=>n.gradeStatus=!0},null),e(T,{clearable:!0,label:"所在班级",placeholder:"请选择班级",isLink:!0,readonly:!0,clickable:!1,modelValue:n.currentClassText,onClick:()=>n.classStatus=!0},null)]}),e(me,{center:!0,modelValue:n.modelValue,"onUpdate:modelValue":u=>n.modelValue=u,prototcolType:"REGISTER"},null),e(P,{type:"primary",class:b.submitBtn,color:"linear-gradient(121deg, #FFD892 0%, #FFCB75 100%)",block:!0,onClick:s,disabled:n.loading,loading:n.loading},{default:()=>[i("确认")]}),n.imgCodeStatus?e(ct,{value:n.imgCodeStatus,"onUpdate:value":u=>n.imgCodeStatus=u,phone:r.username,onClose:()=>{n.imgCodeStatus=!1},onSendCode:g},null):null,e(w,{show:n.gradeStatus,"onUpdate:show":u=>n.gradeStatus=u,position:"bottom",round:!0,safeAreaInsetBottom:!0,lazyRender:!1,class:"popupBottomSearch"},{default:()=>[e(M,{showToolbar:!0,columns:l.value,onCancel:()=>n.gradeStatus=!1,onConfirm:u=>{const p=u.selectedOptions[0];r.extra.currentGradeNum=p.value,n.gradeNumText=p.text,n.gradeStatus=!1}},null)]}),e(w,{show:n.classStatus,"onUpdate:show":u=>n.classStatus=u,position:"bottom",round:!0,class:"popupBottomSearch"},{default:()=>[e(M,{showToolbar:!0,columns:W,onCancel:()=>n.classStatus=!1,onConfirm:u=>{const p=u.selectedOptions[0];r.extra.currentClass=p.value,n.currentClassText=p.text,n.classStatus=!1}},null)]})])}}),Z=t=>{if(t===null)return null;const a=Object.assign({},t);return Object.keys(a).forEach(d=>a[d]=typeof t[d]=="object"?Z(t[d]):t[d]),Array.isArray(t)?(a.length=t.length,Array.from(a)):a},gt="_wxPopupDialog_1sfd3_1",ft="_popupContainer_1sfd3_16",ht="_title1_1sfd3_22",_t="_popupTips_1sfd3_29",x={wxPopupDialog:gt,popupContainer:ft,title1:ht,popupTips:_t},Ct=F({name:"m-wx-tip",props:{show:{type:Boolean,default:!0},title:{type:String,default:"温馨提示"},message:{type:String,default:"请使用微信打开"}},setup(t){const a=H(!1);return J(()=>{if(!le().weixin&&t.show){a.value=!0;return}}),()=>e(X,null,[e(w,{show:a.value,"onUpdate:show":d=>a.value=d,round:!0,style:{width:"88%"},closeOnClickOverlay:!1,class:x.wxPopupDialog},{default:()=>[e("div",{class:x.popupContainer},[e("p",{class:x.title1},[t.title]),e("p",{class:x.popupTips},[t.message])])]})])}}),Gt=F({name:"student-register",setup(){const t=ue(),a=z(),d=ie();a.setShoolId(t.query.sId);const l=k({schoolId:t.query.sId,popupShow:!1,popupRegister:!1,details:[],schoolType:"",gradeYear:"",bugGoods:!1,submitLoading:!1}),n=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});a.setVip(s.details||[]),l.details=Z(s.details||[]),l.bugGoods=s.bugGoods,l.schoolType=s.schoolType,l.gradeYear=s.gradeYear}catch(s){}},g=G(()=>{let s=0,m=0;return a.getVip.forEach(c=>{s+=Number(c.currentPrice),m+=Number(c.originalPrice)}),a.getGoods.forEach(c=>{s+=Number(c.price)*c.quantity,m+=Number(c.originalPrice)*c.quantity}),{amount:s,originAmount:m}}),h=s=>{re({message:"是否删除该商品",confirmButtonColor:"#FF8633"}).then(()=>{console.log(s,"item"),a.deleteGoods(s.productSkuId)})},y=async()=>{try{l.submitLoading=!0;const s=L.get(O)||"";if(!(await f.post("/edu-app/open/user/verification",{noAuthorization:!0,data:{token:s}})).data){L.remove(O),a.deleteToken(),l.popupRegister=!0;return}await n();const u=await f.get("/edu-app/userPaymentOrder/registerStatus/"+l.schoolId),p=a.getVip,c=a.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 J(()=>{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(q,{class:o.goodsSection,onClick:()=>{a.selectedVip(s.goodsId)?a.deleteVip(s.goodsId):a.setVip([s])}},{default:()=>[e(I,{border:!1,class:o.goodsCell},{icon:()=>e(N,{class:o.img,src:s.goodsUrl},null),title:()=>e("div",{class:o.section},[e("div",{class:o.sectionContent},[e("h2",null,[s.goodsName,e(Y,{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:a.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:Ke,class:o.iconGift},null),i("现在购买赠送 "),e("span",null,[s.membershipDays||0]),i("天有效期")])})]}))]),l.bugGoods&&e(X,null,[e("div",{class:o.studentSection},[e("div",{class:o.titleBuy},null),a.getGoods&&a.getGoods.length<=0?e("div",{class:o.goodsEmpty},[e("img",{src:$e,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:()=>{d.push("/goods-list")}},{default:()=>[i("进入商城选购"),e(V,{name:"arrow"},null)]})])]):a.getGoods.map((s,m)=>e(q,{class:o.goodsSection},{default:()=>[e(I,{border:!1,class:o.goodsCell},{icon:()=>e(N,{class:o.img,src:s.pic},null),title:()=>e("div",{class:o.section},[e("div",{class:o.sectionContent},[e("h2",null,[s.name,e(Y,{class:o.brandName},{default:()=>[s.brandName]})]),e("p",{class:[o.model]},[i("规格:"),s.spDataJson]),e("p",{class:[o.model]},[s.productSn]),e(ge,{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)])])})]}))]),a.getGoods&&a.getGoods.length>0&&e(P,{class:o.addButton,block:!0,onClick:()=>{d.push("/goods-list")}},{default:()=>[e(V,{name:"add-o"},null),i("进入商城选购")]})]),e(de,{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=a.getVip,m=a.getGoods;if(s.length<=0&&m.length<=0){setTimeout(()=>{_("请选择需要购买的商品")},100);return}a.getToken?y():l.popupRegister=!0}},[e(P,{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(ce,{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(mt,{schoolId:l.schoolId,schoolType:l.schoolType,gradeYear:l.gradeYear,onClose:()=>l.popupRegister=!1,onSubmit:y},null)]}),e(Ct,null,null)])}});export{Gt as default};