1 |
- import{aN as x,c as K,b as Q,m as Z,t as j,d as B,aW as ee,e as A,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 $,x as N,C as P,z as ne,N as k,y as H,R as ue,F as z,U as le,q as ie,P as F,I as V,Q as re,G as L,J as O}from"./index-25053a57.js";import{i as de}from"./icon-gift-94736468.js";import{M as ce}from"./index-9d440a13.js";import{M as pe}from"./index-12f28f3e.js";import{O as me}from"./index-682c30ae.js";import{R as q,C as G,u as J,S as ge}from"./student-register-store-7ba89772.js";import{F as E}from"./index-1fc41cfb.js";import{I as R}from"./index-69ac4e49.js";import{F as fe}from"./index-284e9b4d.js";import{P as U}from"./index-c37b22db.js";import{C as Y}from"./index-9838e14a.js";import{C as D}from"./index-6900892b.js";import{T as M}from"./index-fe3b5b3a.js";/* empty css */import"./index-55761331.js";import"./Checker-007df346.js";function he(t,a){const{days:d}=a;let{hours:u,minutes:n,seconds:r,milliseconds:m}=a;if(t.includes("DD")?t=t.replace("DD",x(d)):u+=d*24,t.includes("HH")?t=t.replace("HH",x(u)):n+=u*60,t.includes("mm")?t=t.replace("mm",x(n)):r+=n*60,t.includes("ss")?t=t.replace("ss",x(r)):m+=r*1e3,t.includes("S")){const h=x(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,Ce]=K("count-down"),ye={time:Q(0),format:Z("HH:mm:ss"),autoStart:j,millisecond:Boolean};var Se=B({name:_e,props:ye,emits:["change","finish"],setup(t,{emit:a,slots:d}){const{start:u,pause:n,reset:r,current:m}=ee({time:+t.time,millisecond:t.millisecond,onChange:s=>a("change",s),onFinish:()=>a("finish")}),h=A(()=>he(t.format,m.value)),y=()=>{r(+t.time),t.autoStart&&u()};return te(()=>t.time,y,{immediate:!0}),se({start:u,pause:n,reset:y}),()=>e("div",{role:"timer",class:Ce()},[d.default?d.default(m.value):h.value])}});const ve=oe(Se),be="_studentSection_3dvma_7",Fe="_goodsSection_3dvma_25",Te="_titleTool_3dvma_36",Ee="_titleBuy_3dvma_45",we="_goodsCell_3dvma_52",xe="_noSelected_3dvma_57",De="_selected_3dvma_58",Be="_img_3dvma_78",Ie="_brandName_3dvma_91",Pe="_model_3dvma_101",Ae="_sbtnGroup_3dvma_111",ke="_btnDetail_3dvma_123",Ge="_btnVideo_3dvma_124",Ne="_priceCell_3dvma_164",Re="_sPriceGroup_3dvma_167",Ve="_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:Fe,titleTool:Te,titleBuy:Ee,goodsCell:we,noSelected:xe,selected:De,delete:"_delete_3dvma_59",img:Be,brandName:Ie,model:Pe,sbtnGroup:Ae,btnDetail:ke,btnVideo:Ge,priceCell:Ne,sPriceGroup:Re,tg:Ve,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,ut="_imgCode_mq980_1",lt="_codeTitle_mq980_4",it="_img_mq980_1",rt="_imgChange_mq980_16",dt="_field_mq980_23",ct="_imgCodePopup_mq980_27",T={imgCode:ut,codeTitle:lt,img:it,imgChange:rt,field:dt,imgCodePopup:ct},pt=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(w,{show:this.showStatus,class:T.imgCodePopup,closeOnClickOverlay:!1,onClose:()=>{this.$emit("close")},closeable:!0,closeIcon:"close"},{default:()=>[e("div",{class:T.imgCode},[e("p",{class:T.codeTitle},[i("输入图形验证码")]),e(q,null,{default:()=>[e(G,{span:"14"},{default:()=>[e(E,{placeholder:"请输入验证码",modelValue:this.code,"onUpdate:modelValue":t=>this.code=t,class:T.field,autocomplete:"off"},null)]}),e(G,{span:"10",class:T.img},{default:()=>[e(R,{src:this.identifyingCode,onClick:()=>this.updateIdentifyingCode()},{loading:()=>e(ae,{type:"spinner",size:"20"},null)})]})]}),e(q,{style:{display:"flex",justifyContent:"end"}},{default:()=>[e(G,{span:"10"},{default:()=>[e("span",{class:T.imgChange,onClick:()=>this.updateIdentifyingCode()},[i("看不清?换一换")])]})]})])]})}}),mt=J(),W=[];for(let t=1;t<=40;t++)W.push({text:t+"班",value:t});const gt=B({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=$(),u=A(()=>{let l=[];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"?l.push([...c]):t.gradeYear==="SIX_YEAR_SYSTEM"?l.push([...c,...g]):t.gradeYear==="THREE_YEAR_SYSTEM"?l.push([...S]):t.gradeYear==="FORE_YEAR_SYSTEM"?l.push([...g,...S]):l.push([...c,...g,...S]),l}),n=N({countDownStatus:!0,countDownTime:1e3*120,modelValue:!1,imgCodeStatus:!1,gradeNumText:"",currentClassText:"",gradeStatus:!1,classStatus:!1,loading:!1}),r=N({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,ne(()=>{d.value.start()})},h=()=>{if(!k(r.username))return _("请输入正确的手机号码");n.imgCodeStatus=!0},y=A(()=>!!k(r.username)),s=()=>{n.countDownStatus=!0,d.value.reset()},p=async()=>{try{if(b())return;n.loading=!0;const{extra:l,...c}=r,{data:g}=await f.post("/edu-app/userlogin",{hideLoading:!1,requestType:"form",data:{...c,extra:JSON.stringify({...l,schoolId:t.schoolId})}});mt.setToken(g.token_type+" "+g.access_token),a("close"),a("submit")}catch(l){}finally{n.loading=!1}},b=()=>{if(k(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(E,{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:v.tips},[i("手机号是数字化器乐学练工具的唯一登录账户")])])}),e(E,{center:!0,clearable:!0,label:"验证码",placeholder:"请输入验证码",autocomplete:"off",type:"number",modelValue:r.password,"onUpdate:modelValue":l=>r.password=l,maxlength:6},{button:()=>n.countDownStatus?e("span",{class:[v.codeText,y.value?"":v.codeTextDisabled],onClick:h},[i("获取验证码")]):e(ve,{ref:l=>d.value=l,"auto-start":!1,time:n.countDownTime,onFinish:s,format:"ss秒"},null)}),e(E,{clearable:!0,label:"学生姓名",placeholder:"请输入学生姓名",autocomplete:"off",modelValue:r.extra.nickname,"onUpdate:modelValue":l=>r.extra.nickname=l},null),e(E,{clearable:!0,label:"所在年级",placeholder:"请选择年级",isLink:!0,readonly:!0,clickable:!1,modelValue:n.gradeNumText,onClick:()=>n.gradeStatus=!0},null),e(E,{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":l=>n.modelValue=l,prototcolType:"REGISTER"},null),e(P,{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":l=>n.imgCodeStatus=l,phone:r.username,onClose:()=>{n.imgCodeStatus=!1},onSendCode:m},null):null,e(w,{show:n.gradeStatus,"onUpdate:show":l=>n.gradeStatus=l,position:"bottom",round:!0,safeAreaInsetBottom:!0,lazyRender:!1,class:"popupBottomSearch"},{default:()=>[e(U,{showToolbar:!0,columns:u.value,onCancel:()=>n.gradeStatus=!1,onConfirm:l=>{const c=l.selectedOptions[0];r.extra.currentGradeNum=c.value,n.gradeNumText=c.text,n.gradeStatus=!1}},null)]}),e(w,{show:n.classStatus,"onUpdate:show":l=>n.classStatus=l,position:"bottom",round:!0,class:"popupBottomSearch"},{default:()=>[e(U,{showToolbar:!0,columns:W,onCancel:()=>n.classStatus=!1,onConfirm:l=>{const c=l.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",Ct="_popupTips_1sfd3_29",I={wxPopupDialog:ft,popupContainer:ht,title1:_t,popupTips:Ct},yt=B({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(!ue().weixin&&t.show){a.value=!0;return}}),()=>e(z,null,[e(w,{show:a.value,"onUpdate:show":d=>a.value=d,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])])]})])}}),Rt=B({name:"student-register",setup(){const t=le(),a=J(),d=ie();a.setShoolId(t.query.sId);const u=N({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/"+u.schoolId,{noAuthorization:!0});a.setVip(s.details||[]),u.details=X(s.details||[]),u.bugGoods=s.bugGoods,u.schoolType=s.schoolType,u.gradeYear=s.gradeYear}catch(s){}},m=A(()=>{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=>{re({message:"是否删除该商品",confirmButtonColor:"#FF8633"}).then(()=>{console.log(s,"item"),a.deleteGoods(s.productSkuId)})},y=async()=>{try{u.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(),u.popupRegister=!0;return}await n();const b=await f.get("/edu-app/userPaymentOrder/registerStatus/"+u.schoolId),l=a.getVip,c=a.getGoods;if(b.data.hasBuyCourse&&l.length>0){setTimeout(()=>{_("您已购买数字化器乐学练工具,请勿重复购买")},100);return}const g=[];l.forEach(C=>{g.push({goodsId:C.goodsId,goodsNum:1,goodsType:C.goodsType,paymentCashAmount:C.currentPrice,paymentCouponAmount:0})}),c.forEach(C=>{g.push({goodsId:C.productId,goodsNum:C.quantity,goodsType:"INSTRUMENTS",paymentCashAmount:C.price,paymentCouponAmount:0,goodsSkuId:C.productSkuId})});const{data:S}=await f.post("/edu-app/userPaymentOrder/executeOrder",{hideLoading:!1,data:{paymentType:"adapay",bizId:u.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{u.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),u.details.map(s=>e(Y,{class:o.goodsSection,onClick:()=>{a.selectedVip(s.goodsId)?a.deleteVip(s.goodsId):a.setVip([s])}},{default:()=>[e(D,{border:!1,class:o.goodsCell},{icon:()=>e(R,{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(),u.popupShow=!0}},[i("介绍视频")])])]),e("i",{class:a.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("¥ ")]),F(s.currentPrice)])]),s.currentPrice<s.originalPrice&&e("del",null,[i("¥"),F(s.originalPrice)])])}),s.membershipDays>0&&e(D,{border:!1,class:o.giftCell},{title:()=>e("div",{class:o.gift},[e("img",{src:de,class:o.iconGift},null),i("现在购买赠送 "),e("span",null,[s.membershipDays||0]),i("天有效期")])})]}))]),u.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(P,{class:o.goSelect,type:"primary",onClick:()=>{d.push("/goods-list")}},{default:()=>[i("进入商城选购"),e(V,{name:"arrow"},null)]})])]):a.getGoods.map((s,p)=>e(Y,{class:o.goodsSection},{default:()=>[e(D,{border:!1,class:o.goodsCell},{icon:()=>e(R,{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(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("¥ ")]),F(s.price)])]),s.price<s.originalPrice&&e("del",null,[i("¥"),F(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(ce,{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,[F(m.value.amount)])]),e("del",{class:o.allPrice},[i("¥ "),F(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?y():u.popupRegister=!0}},[e(P,{disabled:u.submitLoading,loading:u.submitLoading},{default:()=>[i("确认购买")]})])])]}),e(w,{show:u.popupShow,"onUpdate:show":s=>u.popupShow=s,class:o.videoPopup},{default:()=>[u.popupShow&&e(pe,{src:"https://daya.ks3-cn-beijing.ksyun.com/202105/SWmqmvW.mp4"},null)]}),e(w,{show:u.popupRegister,"onUpdate:show":s=>u.popupRegister=s,class:o.registerPopup,position:"bottom",round:!0},{default:()=>[e(gt,{schoolId:u.schoolId,schoolType:u.schoolType,gradeYear:u.gradeYear,onClose:()=>u.popupRegister=!1,onSubmit:y},null)]}),e(yt,null,null)])}});export{Rt as default};
|