index-81ea05fc.js 17 KB

1
  1. import{i as K}from"./icon-gift-94736468.js";import{M as Q}from"./index-f0e68d4e.js";import{M as Z}from"./index-8e198d56.js";import{aL as I,c as j,b as ee,m as te,t as se,d as D,aU as oe,e as k,w as ae,X as ne,a as e,k as le,C as f,D as _,U as E,z as i,L as ue,r as $,q as R,A as B,y as ie,N as A,x as H,R as re,F as z,P as T,I as N,V as de,E as ce,Q as pe,G as L,J as O}from"./index-a1bf1d15.js";import{O as me}from"./index-462c6ef1.js";import{R as q,C as G,u as J,S as ge}from"./student-register-store-4d8d7e51.js";import{F as x}from"./index-599f5e7e.js";import{I as V}from"./index-58d13ad6.js";import{F as fe}from"./index-812a25b0.js";import{P as U}from"./index-3ed4c541.js";import{C as Y}from"./index-190715f8.js";import{C as F}from"./index-e0238e8d.js";import{T as M}from"./index-4777b74f.js";/* empty css */import"./index-659048bb.js";import"./Checker-7c851491.js";import"./index-a789f42a.js";import"./use-tab-status-a66a826a.js";import"./index-32b5aea3.js";function he(t,a){const{days:d}=a;let{hours:l,minutes:n,seconds:r,milliseconds:m}=a;if(t.includes("DD")?t=t.replace("DD",I(d)):l+=d*24,t.includes("HH")?t=t.replace("HH",I(l)):n+=l*60,t.includes("mm")?t=t.replace("mm",I(n)):r+=n*60,t.includes("ss")?t=t.replace("ss",I(r)):m+=r*1e3,t.includes("S")){const h=I(m,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[_e,ye]=j("count-down"),Ce={time:ee(0),format:te("HH:mm:ss"),autoStart:se,millisecond:Boolean};var Se=D({name:_e,props:Ce,emits:["change","finish"],setup(t,{emit:a,slots:d}){const{start:l,pause:n,reset:r,current:m}=oe({time:+t.time,millisecond:t.millisecond,onChange:s=>a("change",s),onFinish:()=>a("finish")}),h=k(()=>he(t.format,m.value)),C=()=>{r(+t.time),t.autoStart&&l()};return ae(()=>t.time,C,{immediate:!0}),ne({start:l,pause:n,reset:C}),()=>e("div",{role:"timer",class:ye()},[d.default?d.default(m.value):h.value])}});const ve=le(Se),be="_studentSection_3dvma_7",Te="_goodsSection_3dvma_25",we="_titleTool_3dvma_36",xe="_titleBuy_3dvma_45",Ee="_goodsCell_3dvma_52",Ie="_noSelected_3dvma_57",Fe="_selected_3dvma_58",De="_img_3dvma_78",Pe="_brandName_3dvma_91",Be="_model_3dvma_101",ke="_sbtnGroup_3dvma_111",Ae="_btnDetail_3dvma_123",Ge="_btnVideo_3dvma_124",Re="_priceCell_3dvma_164",Ve="_sPriceGroup_3dvma_167",Ne="_tg_3dvma_175",Le="_giftCell_3dvma_198",Oe="_gift_3dvma_198",qe="_iconGift_3dvma_216",Ue="_goodsEmpty_3dvma_221",Ye="_shopImg_3dvma_230",Me="_goodsContainer_3dvma_234",$e="_tips_3dvma_242",He="_goSelect_3dvma_247",ze="_addButton_3dvma_266",Je="_paymentContainer_3dvma_285",We="_needPrice_3dvma_295",Xe="_allPrice_3dvma_308",Ke="_videoPopup_3dvma_327",o={"student-register":"_student-register_3dvma_1",studentSection:be,goodsSection:Te,titleTool:we,titleBuy:xe,goodsCell:Ee,noSelected:Ie,selected:Fe,delete:"_delete_3dvma_59",img:De,brandName:Pe,model:Be,sbtnGroup:ke,btnDetail:Ae,btnVideo:Ge,priceCell:Re,sPriceGroup:Ve,tg:Ne,giftCell:Le,gift:Oe,iconGift:qe,goodsEmpty:Ue,shopImg:Ye,goodsContainer:Me,tips:$e,goSelect:He,addButton:ze,paymentContainer:Je,needPrice:We,allPrice:Xe,videoPopup:Ke},Qe=""+new URL("shop-empty-6c02d334.png",import.meta.url).href,Ze="_registerModal_hxtgy_1",je="_infoTitle_hxtgy_7",et="_registerForm_hxtgy_13",tt="_tips_hxtgy_20",st="_codeText_hxtgy_40",ot="_codeTextDisabled_hxtgy_45",at="_submitBtn_hxtgy_48",v={registerModal:Ze,infoTitle:je,registerForm:et,tips:tt,codeText:st,codeTextDisabled:ot,submitBtn:at},nt=""+new URL("info-title-1f45c1de.png",import.meta.url).href,lt="_imgCode_mq980_1",ut="_codeTitle_mq980_4",it="_img_mq980_1",rt="_imgChange_mq980_16",dt="_field_mq980_23",ct="_imgCodePopup_mq980_27",w={imgCode:lt,codeTitle:ut,img:it,imgChange:rt,field:dt,imgCodePopup:ct},pt=D({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:w.imgCodePopup,closeOnClickOverlay:!1,onClose:()=>{this.$emit("close")},closeable:!0,closeIcon:"close"},{default:()=>[e("div",{class:w.imgCode},[e("p",{class:w.codeTitle},[i("输入图形验证码")]),e(q,null,{default:()=>[e(G,{span:"14"},{default:()=>[e(x,{placeholder:"请输入验证码",modelValue:this.code,"onUpdate:modelValue":t=>this.code=t,class:w.field,autocomplete:"off"},null)]}),e(G,{span:"10",class:w.img},{default:()=>[e(V,{src:this.identifyingCode,onClick:()=>this.updateIdentifyingCode()},{loading:()=>e(ue,{type:"spinner",size:"20"},null)})]})]}),e(q,{style:{display:"flex",justifyContent:"end"}},{default:()=>[e(G,{span:"10"},{default:()=>[e("span",{class:w.imgChange,onClick:()=>this.updateIdentifyingCode()},[i("看不清?换一换")])]})]})])]})}}),mt=J(),W=[];for(let t=1;t<=40;t++)W.push({text:t+"班",value:t});const gt=D({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=$(),l=k(()=>{let u=[];const c=[{text:"一年级",value:1},{text:"二年级",value:2},{text:"三年级",value:3},{text:"四年级",value:4},{text:"五年级",value:5}],g=[{text:"六年级",value:6}],S=[{text:"七年级",value:7},{text:"八年级",value:8},{text:"九年级",value:9}];return t.gradeYear==="FIVE_YEAR_SYSTEM"?u.push([...c]):t.gradeYear==="SIX_YEAR_SYSTEM"?u.push([...c,...g]):t.gradeYear==="THREE_YEAR_SYSTEM"?u.push([...S]):t.gradeYear==="FORE_YEAR_SYSTEM"?u.push([...g,...S]):u.push([...c,...g,...S]),u}),n=R({countDownStatus:!0,countDownTime:1e3*120,modelValue:!1,imgCodeStatus:!1,gradeNumText:"",currentClassText:"",gradeStatus:!1,classStatus:!1,loading:!1}),r=R({autoRegister:!0,client_id:"cooleshow-student",client_secret:"cooleshow-student",extra:{nickname:"",currentGradeNum:"",currentClass:""},grant_type:"password",loginType:"SMS",password:"",username:""}),m=()=>{n.countDownStatus=!1,ie(()=>{d.value.start()})},h=()=>{if(!A(r.username))return _("请输入正确的手机号码");n.imgCodeStatus=!0},C=k(()=>!!A(r.username)),s=()=>{n.countDownStatus=!0,d.value.reset()},p=async()=>{try{if(b())return;n.loading=!0;const{extra:u,...c}=r,{data:g}=await f.post("/edu-app/userlogin",{hideLoading:!1,requestType:"form",data:{...c,extra:JSON.stringify({...u,schoolId:t.schoolId})}});mt.setToken(g.token_type+" "+g.access_token),a("close"),a("submit")}catch(u){}finally{n.loading=!1}},b=()=>{if(A(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:v.registerModal},[e("img",{src:nt,class:v.infoTitle},null),e(fe,{labelAlign:"top",class:v.registerForm},{default:()=>[e(x,{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:v.tips},[i("手机号是数字化器乐学练工具的唯一登录账户")])])}),e(x,{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:[v.codeText,C.value?"":v.codeTextDisabled],onClick:h},[i("获取验证码")]):e(ve,{ref:u=>d.value=u,"auto-start":!1,time:n.countDownTime,onFinish:s,format:"ss秒"},null)}),e(x,{clearable:!0,label:"学生姓名",placeholder:"请输入学生姓名",autocomplete:"off",modelValue:r.extra.nickname,"onUpdate:modelValue":u=>r.extra.nickname=u},null),e(x,{clearable:!0,label:"所在年级",placeholder:"请选择年级",isLink:!0,readonly:!0,clickable:!1,modelValue:n.gradeNumText,onClick:()=>n.gradeStatus=!0},null),e(x,{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(B,{type:"primary",class:v.submitBtn,color:"linear-gradient(121deg, #FFD892 0%, #FFCB75 100%)",block:!0,onClick:p,disabled:n.loading,loading:n.loading},{default:()=>[i("确认")]}),n.imgCodeStatus?e(pt,{value:n.imgCodeStatus,"onUpdate:value":u=>n.imgCodeStatus=u,phone:r.username,onClose:()=>{n.imgCodeStatus=!1},onSendCode:m},null):null,e(E,{show:n.gradeStatus,"onUpdate:show":u=>n.gradeStatus=u,position:"bottom",round:!0,safeAreaInsetBottom:!0,lazyRender:!1,class:"popupBottomSearch"},{default:()=>[e(U,{showToolbar:!0,columns:l.value,onCancel:()=>n.gradeStatus=!1,onConfirm:u=>{const c=u.selectedOptions[0];r.extra.currentGradeNum=c.value,n.gradeNumText=c.text,n.gradeStatus=!1}},null)]}),e(E,{show:n.classStatus,"onUpdate:show":u=>n.classStatus=u,position:"bottom",round:!0,class:"popupBottomSearch"},{default:()=>[e(U,{showToolbar:!0,columns:W,onCancel:()=>n.classStatus=!1,onConfirm:u=>{const c=u.selectedOptions[0];r.extra.currentClass=c.value,n.currentClassText=c.text,n.classStatus=!1}},null)]})])}}),X=t=>{if(t===null)return null;const a=Object.assign({},t);return Object.keys(a).forEach(d=>a[d]=typeof t[d]=="object"?X(t[d]):t[d]),Array.isArray(t)?(a.length=t.length,Array.from(a)):a},ft="_wxPopupDialog_1sfd3_1",ht="_popupContainer_1sfd3_16",_t="_title1_1sfd3_22",yt="_popupTips_1sfd3_29",P={wxPopupDialog:ft,popupContainer:ht,title1:_t,popupTips:yt},Ct=D({name:"m-wx-tip",props:{show:{type:Boolean,default:!0},title:{type:String,default:"温馨提示"},message:{type:String,default:"请使用微信打开"}},setup(t){const a=$(!1);return H(()=>{if(!re().weixin&&t.show){a.value=!0;return}}),()=>e(z,null,[e(E,{show:a.value,"onUpdate:show":d=>a.value=d,round:!0,style:{width:"88%"},closeOnClickOverlay:!1,class:P.wxPopupDialog},{default:()=>[e("div",{class:P.popupContainer},[e("p",{class:P.title1},[t.title]),e("p",{class:P.popupTips},[t.message])])]})])}}),Ot=D({name:"student-register",setup(){const t=de(),a=J(),d=ce();a.setShoolId(t.query.sId);const l=R({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=X(s.details||[]),l.bugGoods=s.bugGoods,l.schoolType=s.schoolType,l.gradeYear=s.gradeYear}catch(s){}},m=k(()=>{let s=0,p=0;return a.getVip.forEach(c=>{s+=Number(c.currentPrice),p+=Number(c.originalPrice)}),a.getGoods.forEach(c=>{s+=Number(c.price)*c.quantity,p+=Number(c.originalPrice)*c.quantity}),{amount:s,originAmount:p}}),h=s=>{pe({message:"是否删除该商品",confirmButtonColor:"#FF8633"}).then(()=>{console.log(s,"item"),a.deleteGoods(s.productSkuId)})},C=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 b=await f.get("/edu-app/userPaymentOrder/registerStatus/"+l.schoolId),u=a.getVip,c=a.getGoods;if(b.data.hasBuyCourse&&u.length>0){setTimeout(()=>{_("您已购买数字化器乐学练工具,请勿重复购买")},100);return}const g=[];u.forEach(y=>{g.push({goodsId:y.goodsId,goodsNum:1,goodsType:y.goodsType,paymentCashAmount:y.currentPrice,paymentCouponAmount:0})}),c.forEach(y=>{g.push({goodsId:y.productId,goodsNum:y.quantity,goodsType:"INSTRUMENTS",paymentCashAmount:y.price,paymentCouponAmount:0,goodsSkuId:y.productSkuId})});const{data:S}=await f.post("/edu-app/userPaymentOrder/executeOrder",{hideLoading:!1,data:{paymentType:"adapay",bizId:l.schoolId,orderType:"SCHOOL_REGISTER",paymentCashAmount:m.value.amount||0,paymentCouponAmount:0,goodsInfos:g,orderName:"学生登记",orderDesc:"学生登记"}});d.push({path:"/order-detail",query:{pm:1,config:JSON.stringify({...S.paymentConfig,paymentType:S.paymentType}),orderNo:S.orderNo}})}finally{l.submitLoading=!1}};return H(()=>{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(Y,{class:o.goodsSection,onClick:()=>{a.selectedVip(s.goodsId)?a.deleteVip(s.goodsId):a.setVip([s])}},{default:()=>[e(F,{border:!1,class:o.goodsCell},{icon:()=>e(V,{class:o.img,src:s.goodsUrl},null),title:()=>e("div",{class:o.section},[e("div",{class:o.sectionContent},[e("h2",null,[s.goodsName,e(M,{class:o.brandName},{default:()=>[i("12个月")]})]),e("p",{class:[o.model]},[s.description]),e("div",{class:o.sbtnGroup},[e("span",{class:o.btnDetail,onClick:p=>{p.stopPropagation(),d.push("/student-digital-tools")}},[i("查看详情")]),e("span",{class:o.btnVideo,onClick:p=>{p.stopPropagation(),l.popupShow=!0}},[i("介绍视频")])])]),e("i",{class:a.selectedVip(s.goodsId)?o.selected:o.noSelected},null)])}),e(F,{border:!1,class:o.priceCell},{title:()=>e("div",{class:o.sPriceGroup},[e("div",{class:o.tg},[i("团购价:"),e("span",null,[e("i",null,[i("¥ ")]),T(s.currentPrice)])]),s.currentPrice<s.originalPrice&&e("del",null,[i("¥"),T(s.originalPrice)])])}),s.membershipDays>0&&e(F,{border:!1,class:o.giftCell},{title:()=>e("div",{class:o.gift},[e("img",{src:K,class:o.iconGift},null),i("现在购买赠送 "),e("span",null,[s.membershipDays||0]),i("天有效期")])})]}))]),l.bugGoods&&e(z,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:Qe,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(B,{class:o.goSelect,type:"primary",onClick:()=>{d.push("/goods-list")}},{default:()=>[i("进入商城选购"),e(N,{name:"arrow"},null)]})])]):a.getGoods.map((s,p)=>e(Y,{class:o.goodsSection},{default:()=>[e(F,{border:!1,class:o.goodsCell},{icon:()=>e(V,{class:o.img,src:s.pic},null),title:()=>e("div",{class:o.section},[e("div",{class:o.sectionContent},[e("h2",null,[s.name,e(M,{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":b=>s.quantity=b},null)]),e("i",{class:o.delete,onClick:()=>h(s)},null)])}),e(F,{border:!1,class:o.priceCell},{title:()=>e("div",{class:o.sPriceGroup},[e("div",{class:o.tg},[i("团购价:"),e("span",null,[e("i",null,[i("¥ ")]),T(s.price)])]),s.price<s.originalPrice&&e("del",null,[i("¥"),T(s.originalPrice)])])})]}))]),a.getGoods&&a.getGoods.length>0&&e(B,{class:o.addButton,block:!0,onClick:()=>{d.push("/goods-list")}},{default:()=>[e(N,{name:"add-o"},null),i("进入商城选购")]})]),e(Q,{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,[T(m.value.amount)])]),e("del",{class:o.allPrice},[i("¥ "),T(m.value.originAmount)])]),e("div",{class:o.paymentBtn,onClick:()=>{const s=a.getVip,p=a.getGoods;if(s.length<=0&&p.length<=0){setTimeout(()=>{_("请选择需要购买的商品")},100);return}a.getToken?C():l.popupRegister=!0}},[e(B,{disabled:l.submitLoading,loading:l.submitLoading},{default:()=>[i("确认购买")]})])])]}),e(E,{show:l.popupShow,"onUpdate:show":s=>l.popupShow=s,class:o.videoPopup},{default:()=>[l.popupShow&&e(Z,{src:"https://daya.ks3-cn-beijing.ksyun.com/202105/SWmqmvW.mp4"},null)]}),e(E,{show:l.popupRegister,"onUpdate:show":s=>l.popupRegister=s,class:o.registerPopup,position:"bottom",round:!0},{default:()=>[e(gt,{schoolId:l.schoolId,schoolType:l.schoolType,gradeYear:l.gradeYear,onClose:()=>l.popupRegister=!1,onSubmit:C},null)]}),e(Ct,null,null)])}});export{Ot as default};