| 1 |
- import{O as fe}from"./index-cf020853.js";import{M as he}from"./index-70960b35.js";import{i as _e,l as B,t as w,n as V,d as X,q as J,D as T,j,k as Se,x as M,ah as be,g as e,T as O,a9 as U,o as $,ai as Q,aj as ee,ad as te,L as ue,ak as ye,al as Y,am as Ce,an as Ae,ao as ve,w as Ee,$ as W,h as c,B as G,a3 as L,e as oe,f as A,a as F,u as Fe,a2 as Te,E as Be,ap as v,F as we,I as xe,aq as Ie}from"./index-5a32ac2a.js";import{F as De,O as Pe,a as Ne}from"./index-1ffcdba0.js";import{C as Ve,I as qe}from"./index-e04a5267.js";import{u as ie}from"./student-register-store-661c2b01.js";import{P as se}from"./index-425cf49d.js";import{F as x}from"./index-282736eb.js";import{C as ae}from"./index-b69f848b.js";import{C as I}from"./index-f43bbc70.js";import{T as ne}from"./index-e93b5dc7.js";import{I as le}from"./index-bd833346.js";import"./plyr.min-a24de5e8.js";import"./Checker-9d551370.js";import"./index-bbbf930e.js";const[Re,q]=_e("stepper"),Ge=200,R=(t,i)=>String(t)===String(i),Le={min:B(1),max:B(1/0),name:B(""),step:B(1),theme:String,integer:Boolean,disabled:Boolean,showPlus:w,showMinus:w,showInput:w,longPress:w,autoFixed:w,allowEmpty:Boolean,modelValue:V,inputWidth:V,buttonSize:V,placeholder:String,disablePlus:Boolean,disableMinus:Boolean,disableInput:Boolean,beforeChange:Function,defaultValue:B(1),decimalLength:V};var ke=X({name:Re,props:Le,emits:["plus","blur","minus","focus","change","overlimit","update:modelValue"],setup(t,{emit:i}){const g=(s,h=!0)=>{const{min:S,max:P,allowEmpty:b,decimalLength:N}=t;return b&&s===""||(s=ee(String(s),!t.integer),s=s===""?0:+s,s=Number.isNaN(s)?+S:s,s=h?Math.max(Math.min(+P,s),+S):s,te(N)&&(s=s.toFixed(+N))),s},l=()=>{var s;const h=(s=t.modelValue)!=null?s:t.defaultValue,S=g(h);return R(S,t.modelValue)||i("update:modelValue",S),S};let n;const d=J(),m=J(l()),C=T(()=>t.disabled||t.disableMinus||+m.value<=+t.min),y=T(()=>t.disabled||t.disablePlus||+m.value>=+t.max),o=T(()=>({width:j(t.inputWidth),height:j(t.buttonSize)})),f=T(()=>Se(t.buttonSize)),u=()=>{const s=g(m.value);R(s,m.value)||(m.value=s)},p=s=>{t.beforeChange?Ce(t.beforeChange,{args:[s],done(){m.value=s}}):m.value=s},r=()=>{if(n==="plus"&&y.value||n==="minus"&&C.value){i("overlimit",n);return}const s=n==="minus"?-t.step:+t.step,h=g(Ae(+m.value,s));p(h),i(n)},_=s=>{const h=s.target,{value:S}=h,{decimalLength:P}=t;let b=ee(String(S),!t.integer);if(te(P)&&b.includes(".")){const K=b.split(".");b=`${K[0]}.${K[1].slice(0,+P)}`}t.beforeChange?h.value=String(m.value):R(S,b)||(h.value=b);const N=b===String(+b);p(N?+b:b)},de=s=>{var h;t.disableInput?(h=d.value)==null||h.blur():i("focus",s)},me=s=>{const h=s.target,S=g(h.value,t.autoFixed);h.value=String(S),m.value=S,ue(()=>{i("blur",s),ye()})};let k,D;const z=()=>{D=setTimeout(()=>{r(),z()},Ge)},ge=()=>{t.longPress&&(k=!1,clearTimeout(D),D=setTimeout(()=>{k=!0,r(),z()},ve))},H=s=>{t.longPress&&(clearTimeout(D),k&&Y(s))},pe=s=>{t.disableInput&&Y(s)},Z=s=>({onClick:h=>{Y(h),n=s,r()},onTouchstartPassive:()=>{n=s,ge()},onTouchend:H,onTouchcancel:H});return M(()=>[t.max,t.min,t.integer,t.decimalLength],u),M(()=>t.modelValue,s=>{R(s,m.value)||(m.value=g(s))}),M(m,s=>{i("update:modelValue",s),i("change",s,{name:t.name})}),be(()=>t.modelValue),()=>e("div",{role:"group",class:q([t.theme])},[O(e("button",$({type:"button",style:f.value,class:[q("minus",{disabled:C.value}),{[Q]:!C.value}],"aria-disabled":C.value||void 0},Z("minus")),null),[[U,t.showMinus]]),O(e("input",{ref:d,type:t.integer?"tel":"text",role:"spinbutton",class:q("input"),value:m.value,style:o.value,disabled:t.disabled,readonly:t.disableInput,inputmode:t.integer?"numeric":"decimal",placeholder:t.placeholder,"aria-valuemax":t.max,"aria-valuemin":t.min,"aria-valuenow":m.value,onBlur:me,onInput:_,onFocus:de,onMousedown:pe},null),[[U,t.showInput]]),O(e("button",$({type:"button",style:f.value,class:[q("plus",{disabled:y.value}),{[Q]:!y.value}],"aria-disabled":y.value||void 0},Z("plus")),null),[[U,t.showPlus]])])}});const Me=Ee(ke),Oe="_studentSection_11qas_7",Ue="_goodsSection_11qas_25",Ye="_titleTool_11qas_36",Je="_titleBuy_11qas_45",We="_goodsCell_11qas_52",Xe="_noSelected_11qas_57",ze="_selected_11qas_58",He="_img_11qas_78",Ze="_brandName_11qas_91",Ke="_model_11qas_101",je="_sbtnGroup_11qas_111",$e="_btnDetail_11qas_123",Qe="_btnVideo_11qas_124",et="_priceCell_11qas_164",tt="_sPriceGroup_11qas_167",ot="_tg_11qas_175",st="_giftCell_11qas_198",at="_gift_11qas_198",nt="_iconGift_11qas_216",lt="_goodsEmpty_11qas_221",ut="_shopImg_11qas_230",it="_goodsContainer_11qas_234",rt="_tips_11qas_242",ct="_goSelect_11qas_247",dt="_addButton_11qas_256",mt="_paymentContainer_11qas_275",gt="_needPrice_11qas_285",pt="_allPrice_11qas_297",ft="_videoPopup_11qas_313",a={"student-register":"_student-register_11qas_1",studentSection:Oe,goodsSection:Ue,titleTool:Ye,titleBuy:Je,goodsCell:We,noSelected:Xe,selected:ze,delete:"_delete_11qas_59",img:He,brandName:Ze,model:Ke,sbtnGroup:je,btnDetail:$e,btnVideo:Qe,priceCell:et,sPriceGroup:tt,tg:ot,giftCell:st,gift:at,iconGift:nt,goodsEmpty:lt,shopImg:ut,goodsContainer:it,tips:rt,goSelect:ct,addButton:dt,paymentContainer:mt,needPrice:gt,allPrice:pt,videoPopup:ft},ht="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAMAAADW3miqAAAAjVBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8DizOFAAAALnRSTlMA4Y3756eI8JND97N+3co6M+pPKBIE9vLFv2BaHxwYmG9qSiokDwwI1LmuoHNC7/yX5QAAAVdJREFUOMuFktuWgjAMRYMdLBYEFBDxgo7X8Zb//7zRHFiodMF+OjXbJgTonSjwx1rlTjHYncnKMXC4QXurtpJtNX+ivOOXs5pzGyf6cOIJ21DLdwet9GZjUHWvCtai6YV7/JToIUWPKHJgjeqZMc9NDsPXLOfXP8fy66SEtJVTkckhzZl/JSUanbEfOeRrAjeenZAWLMgjBhI3VHFY7AicFUZ9ZUz4d6Av1lcW1LNHhPjUfPedueKKe93NODWaVZOldiHyJTRLG/AP1ZyUbIEI65haJZpJMSXdLyWk+qW4umlplTKFm6qZ9N0ixahxSRcEzyKNUNJEw16pINr1SgFRNumT9s/o9UihvG3TLWGFXqcUIp/GHZLZE4gMc2iRAsb3DpaKeT4EIedVchXzAAIswxbgNDx+LIpBr4bUbTlhQi1iX30oU7JSbn101UWwpw7SQ5yU9MU/KOVbcXkB4UkAAAAASUVORK5CYII=",_t=""+new URL("shop-empty-6c02d334.png",import.meta.url).href,St="_registerModal_ra8en_1",bt="_infoTitle_ra8en_7",yt="_registerForm_ra8en_13",Ct="_tips_ra8en_20",At="_codeText_ra8en_40",vt="_submitBtn_ra8en_45",E={registerModal:St,infoTitle:bt,registerForm:yt,tips:Ct,codeText:At,submitBtn:vt},Et=""+new URL("info-title-1f45c1de.png",import.meta.url).href,Ft=ie(),re=[];for(let t=1;t<=40;t++)re.push({text:t+"班",value:t});const Tt=X({name:"register-modal",props:{schoolId:{type:String,default:""},gradeYear:{type:String,default:""},schoolType:{type:String,default:""}},emits:["close","submit"],setup(t,{emit:i}){const g=J(),l=T(()=>{let u=[];const p=[{text:"一年级",value:1},{text:"二年级",value:2},{text:"三年级",value:3},{text:"四年级",value:4},{text:"五年级",value:5}],r=[{text:"六年级",value:6}],_=[{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,...r]):t.gradeYear==="THREE_YEAR_SYSTEM"?u.push([..._]):t.gradeYear==="FORE_YEAR_SYSTEM"?u.push([...r,..._]):u.push([...p,...r,..._]),console.log(u,t.schoolType,t.gradeYear),u}),n=W({countDownStatus:!0,countDownTime:1e3*120,modelValue:!1,imgCodeStatus:!1,gradeNumText:"",currentClassText:"",gradeStatus:!1,classStatus:!1,loading:!1}),d=W({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,ue(()=>{g.value.start()})},C=()=>{if(!oe(d.username))return A("请输入正确的手机号码");n.imgCodeStatus=!0},y=()=>{n.countDownStatus=!0,g.value.reset()},o=async()=>{try{if(f())return;n.loading=!0;const{extra:u,...p}=d,{data:r}=await F.post("/edu-oauth/userlogin",{hideLoading:!1,requestType:"form",data:{...p,extra:JSON.stringify({...u,schoolId:t.schoolId})}});Ft.setToken(r.token_type+" "+r.access_token),i("close"),i("submit")}catch(u){}finally{n.loading=!1}},f=()=>{if(oe(d.username))if(d.password)if(d.extra.nickname)if(d.extra.currentGradeNum){if(!d.password)return A("请选择所在班级"),!0}else return A("请选择所在年级"),!0;else return A("请输入学生姓名"),!0;else return A("请输入验证码"),!0;else return A("请输入正确的手机号码"),!0;return!1};return()=>e("div",{class:E.registerModal},[e("img",{src:Et,class:E.infoTitle},null),e(De,{labelAlign:"top",class:E.registerForm},{default:()=>[e(x,{clearable:!0,label:"联系方式(直接监护人)",placeholder:"请输入手机号码",type:"tel",autocomplete:"off",modelValue:d.username,"onUpdate:modelValue":u=>d.username=u,maxlength:11},{label:()=>e("div",null,[c("联系方式(直接监护人)"),e("p",{class:E.tips},[c("手机号是数字化器乐课堂的唯一登录账户")])])}),e(x,{center:!0,clearable:!0,label:"验证码",placeholder:"请输入验证码",autocomplete:"off",type:"number",modelValue:d.password,"onUpdate:modelValue":u=>d.password=u,maxlength:6},{button:()=>n.countDownStatus?e("span",{class:E.codeText,onClick:C},[c("获取验证码")]):e(Ve,{ref:u=>g.value=u,"auto-start":!1,time:n.countDownTime,onFinish:y,format:"ss秒"},null)}),e(x,{clearable:!0,label:"学生姓名",placeholder:"请输入学生姓名",autocomplete:"off",modelValue:d.extra.nickname,"onUpdate:modelValue":u=>d.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(Pe,{center:!0,modelValue:n.modelValue,"onUpdate:modelValue":u=>n.modelValue=u,prototcolType:"REGISTER"},null),e(G,{type:"primary",class:E.submitBtn,color:"linear-gradient(121deg, #FFD892 0%, #FFCB75 100%)",block:!0,onClick:o,disabled:n.loading,loading:n.loading},{default:()=>[c("确认")]}),n.imgCodeStatus?e(qe,{value:n.imgCodeStatus,"onUpdate:value":u=>n.imgCodeStatus=u,phone:d.username,onClose:()=>{n.imgCodeStatus=!1},onSendCode:m},null):null,e(L,{show:n.gradeStatus,"onUpdate:show":u=>n.gradeStatus=u,position:"bottom",round:!0,safeAreaInsetBottom:!0,lazyRender:!1,class:"popupBottomSearch"},{default:()=>[e(se,{showToolbar:!0,columns:l.value,onCancel:()=>n.gradeStatus=!1,onConfirm:u=>{const p=u.selectedOptions[0];d.extra.currentGradeNum=p.value,n.gradeNumText=p.text,n.gradeStatus=!1}},null)]}),e(L,{show:n.classStatus,"onUpdate:show":u=>n.classStatus=u,position:"bottom",round:!0,class:"popupBottomSearch"},{default:()=>[e(se,{showToolbar:!0,columns:re,onCancel:()=>n.classStatus=!1,onConfirm:u=>{const p=u.selectedOptions[0];d.extra.currentClass=p.value,n.currentClassText=p.text,n.classStatus=!1}},null)]})])}}),ce=t=>{if(t===null)return null;const i=Object.assign({},t);return Object.keys(i).forEach(g=>i[g]=typeof t[g]=="object"?ce(t[g]):t[g]),Array.isArray(t)?(i.length=t.length,Array.from(i)):i},Ut=X({name:"student-register",setup(){const t=Fe(),i=ie(),g=Te(),l=W({schoolId:t.query.sId,popupShow:!1,popupRegister:!1,details:[],schoolType:"",gradeYear:"",bugGoods:!1,submitLoading:!1,dialogStatus:!1,dialogMessage:"",dialogConfig:{}}),n=async()=>{try{const{data:o}=await F.get("/edu-app/userPaymentOrder/unpaid");o.id&&(l.dialogMessage="您有待支付的订单,是否继续支付",l.dialogStatus=!0,l.dialogConfig=o,console.log(o,"data"))}catch(o){}},d=async()=>{try{const{data:o}=await F.get("/edu-app/open/userOrder/registerGoods/"+l.schoolId);i.setVip(o.details||[]),l.details=ce(o.details||[]),l.bugGoods=o.bugGoods,l.schoolType=o.schoolType,l.gradeYear=o.gradeYear}catch(o){}},m=T(()=>{let o=0,f=0;return i.getVip.forEach(r=>{o+=Number(r.currentPrice),f+=Number(r.originalPrice)}),i.getGoods.forEach(r=>{o+=Number(r.price)*r.count,f+=Number(r.originalPrice)*r.count}),{amount:o,originAmount:f}}),C=o=>{Ie({title:"标题",message:"是否删除该商品",confirmButtonColor:"#FF8633"}).then(()=>{i.deleteGoods(o.goodsId)})},y=async()=>{try{if(l.submitLoading=!0,await n(),l.dialogStatus){l.submitLoading=!1;return}const o=await F.get("/edu-app/userPaymentOrder/registerStatus/"+l.schoolId),f=i.getVip,u=i.getGoods;if(o.data.hasBuyCourse&&f.length>0){A("您已购买数字化器乐学练工具,请勿重复购买");return}if(f.length<=0&&u.length<=0){A("请选择需要购买的商品");return}const p=[];f.forEach(_=>{p.push({goodsId:_.goodsId,goodsNum:1,goodsType:_.goodsType,paymentCashAmount:_.currentPrice,paymentCouponAmount:0})}),u.forEach(_=>{p.push({goodsId:_.id,goodsNum:_.count,goodsType:"INSTRUMENTS",paymentCashAmount:_.price,paymentCouponAmount:0})});const{data:r}=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:p,orderName:"学生注册",orderDesc:"学生注册"}});g.push({path:"/order-detail",query:{pm:1,config:JSON.stringify({...r.paymentConfig,paymentType:r.paymentType}),orderNo:r.orderNo}})}finally{l.submitLoading=!1}};return Be(()=>{d()}),()=>e("div",{class:a["student-register"]},[e("div",{class:a.studentSection,style:{marginTop:"18px"}},[e("div",{class:a.titleTool},null),l.details.map(o=>e(ae,{class:a.goodsSection,onClick:()=>{i.selectedVip(o.goodsId)?i.deleteVip(o.goodsId):i.setVip([o])}},{default:()=>[e(I,{border:!1,class:a.goodsCell},{icon:()=>e(le,{class:a.img,src:o.goodsUrl},null),title:()=>e("div",{class:a.section},[e("div",{class:a.sectionContent},[e("h2",null,[o.goodsName,e(ne,{class:a.brandName},{default:()=>[c("12个月")]})]),e("p",{class:[a.model]},[o.description]),e("div",{class:a.sbtnGroup},[e("span",{class:a.btnDetail,onClick:f=>{f.stopPropagation(),g.push("/student-digital-tools")}},[c("查看详情")]),e("span",{class:a.btnVideo,onClick:f=>{f.stopPropagation(),l.popupShow=!0}},[c("介绍视频")])])]),e("i",{class:i.selectedVip(o.goodsId)?a.selected:a.noSelected},null)])}),e(I,{border:!1,class:a.priceCell},{title:()=>e("div",{class:a.sPriceGroup},[e("div",{class:a.tg},[c("团购价:"),e("span",null,[e("i",null,[c("¥ ")]),v(o.currentPrice)])]),e("del",null,[c("¥"),v(o.originalPrice)])])}),e(I,{border:!1,class:a.giftCell},{title:()=>e("div",{class:a.gift},[e("img",{src:ht,class:a.iconGift},null),c("现在购买赠送 "),e("span",null,[o.membershipDays||0]),c("天有效期")])})]}))]),l.bugGoods&&e(we,null,[e("div",{class:a.studentSection},[e("div",{class:a.titleBuy},null),i.getGoods&&i.getGoods.length<=0?e("div",{class:a.goodsEmpty},[e("img",{src:_t,class:a.shopImg},null),e("div",{class:a.goodsContainer},[e("h2",null,[c("为你的"),e("span",null,[c("音乐之旅")]),c("做好准备")]),e("p",{class:a.tips},[c("快去选购乐器吧~")]),e(G,{class:a.goSelect,type:"primary",onClick:()=>{g.push("/goods-list")}},null)])]):i.getGoods.map(o=>e(ae,{class:a.goodsSection},{default:()=>[e(I,{border:!1,class:a.goodsCell},{icon:()=>e(le,{class:a.img,src:o.pic},null),title:()=>e("div",{class:a.section},[e("div",{class:a.sectionContent},[e("h2",null,[o.name,e(ne,{class:a.brandName},{default:()=>[o.brandName]})]),e("p",{class:[a.model]},[o.productSn]),e(Me,{min:1,max:99,modelValue:o.count,"onUpdate:modelValue":f=>o.count=f},null)]),e("i",{class:a.delete,onClick:()=>C(o)},null)])}),e(I,{border:!1,class:a.priceCell},{title:()=>e("div",{class:a.sPriceGroup},[e("div",{class:a.tg},[c("团购价:"),e("span",null,[e("i",null,[c("¥ ")]),v(o.price)])]),e("del",null,[c("¥"),v(o.originalPrice)])])})]}))]),i.getGoods&&i.getGoods.length>0&&e(G,{class:a.addButton,block:!0,onClick:()=>{g.push("/goods-list")}},{default:()=>[e(xe,{name:"add-o"},null),c("添加购买")]})]),e(fe,{position:"bottom"},{default:()=>[e("div",{class:a.paymentContainer},[e("div",{class:a.payemntPrice},[e("span",{class:a.needPrice},[e("i",{style:"font-style: normal"},[c("¥ ")]),e("span",null,[v(m.value.amount)])]),e("del",{class:a.allPrice},[c("¥ "),v(m.value.originAmount)])]),e("div",{class:a.paymentBtn,onClick:()=>{i.getToken?y():l.popupRegister=!0}},[e(G,{disabled:l.submitLoading,loading:l.submitLoading},null)])])]}),e(L,{show:l.popupShow,"onUpdate:show":o=>l.popupShow=o,class:a.videoPopup},{default:()=>[l.popupShow&&e(he,{src:"https://daya.ks3-cn-beijing.ksyun.com/202105/SWmqmvW.mp4"},null)]}),e(L,{show:l.popupRegister,"onUpdate:show":o=>l.popupRegister=o,class:a.registerPopup,position:"bottom",round:!0},{default:()=>[e(Tt,{schoolId:l.schoolId,schoolType:l.schoolType,gradeYear:l.gradeYear,onClose:()=>l.popupRegister=!1,onSubmit:y},null)]}),e(Ne,{title:"提示",show:l.dialogStatus,"onUpdate:show":o=>l.dialogStatus=o,message:l.dialogMessage,confirmButtonText:"继续支付",cancelButtonText:"取消订单",showCancelButton:!0,onConfirm:()=>{const o=l.dialogConfig.paymentConfig;g.push({path:"/order-detail",query:{pm:1,config:JSON.stringify(o.paymentConfig),orderNo:o.orderNo}})},onCancel:async()=>{try{await F.post("/edu-app/userPaymentOrder/cancelPayment/"+l.dialogConfig.orderNo)}catch(o){}}},null)])}});export{Ut as default};
|