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