index-623fbf76.js 14 KB

1
  1. import{O as L}from"./index-a0da4df2.js";import{M}from"./index-1e52cc50.js";import{d as D,l as G,h as k,i as B,f as e,g as i,B as T,P as b,n as Y,c as v,e as f,r as y,o as z,k as J,F as O,p as X,u as W,m as _,I as x,j as Z}from"./index-4fdf58de.js";import{F as H,O as K}from"./index-fde27d71.js";import{C as j,I as Q}from"./index-e4bc0353.js";import{u as R,S as $}from"./student-register-store-7634c5ed.js";import{P as I}from"./index-5c01fded.js";import{F as S}from"./index-8985876e.js";import{O as ee}from"./index-f83b05de.js";import{C as P}from"./index-f5378f53.js";import{C as A}from"./index-c2b2e34a.js";import{T as q}from"./index-3e176cab.js";import{I as N}from"./index-7fda46b5.js";import"./plyr-a24de5e8.js";import"./Checker-9985e87e.js";import"./index-562439f0.js";const te="_studentSection_tqzai_7",oe="_goodsSection_tqzai_25",se="_titleTool_tqzai_36",ae="_titleBuy_tqzai_45",ue="_goodsCell_tqzai_52",le="_noSelected_tqzai_57",ne="_selected_tqzai_58",ie="_img_tqzai_78",re="_brandName_tqzai_91",ce="_model_tqzai_101",de="_sbtnGroup_tqzai_111",pe="_btnDetail_tqzai_123",ge="_btnVideo_tqzai_124",me="_priceCell_tqzai_164",fe="_sPriceGroup_tqzai_167",_e="_tg_tqzai_175",he="_giftCell_tqzai_198",ye="_gift_tqzai_198",Ce="_iconGift_tqzai_216",Se="_goodsEmpty_tqzai_221",Ae="_shopImg_tqzai_230",be="_goodsContainer_tqzai_234",Fe="_tips_tqzai_242",Ee="_goSelect_tqzai_247",Te="_addButton_tqzai_266",we="_paymentContainer_tqzai_285",Be="_needPrice_tqzai_295",De="_allPrice_tqzai_307",ve="_videoPopup_tqzai_326",o={"student-register":"_student-register_tqzai_1",studentSection:te,goodsSection:oe,titleTool:se,titleBuy:ae,goodsCell:ue,noSelected:le,selected:ne,delete:"_delete_tqzai_59",img:ie,brandName:re,model:ce,sbtnGroup:de,btnDetail:pe,btnVideo:ge,priceCell:me,sPriceGroup:fe,tg:_e,giftCell:he,gift:ye,iconGift:Ce,goodsEmpty:Se,shopImg:Ae,goodsContainer:be,tips:Fe,goSelect:Ee,addButton:Te,paymentContainer:we,needPrice:Be,allPrice:De,videoPopup:ve},xe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAMAAADW3miqAAAAjVBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8DizOFAAAALnRSTlMA4Y3756eI8JND97N+3co6M+pPKBIE9vLFv2BaHxwYmG9qSiokDwwI1LmuoHNC7/yX5QAAAVdJREFUOMuFktuWgjAMRYMdLBYEFBDxgo7X8Zb//7zRHFiodMF+OjXbJgTonSjwx1rlTjHYncnKMXC4QXurtpJtNX+ivOOXs5pzGyf6cOIJ21DLdwet9GZjUHWvCtai6YV7/JToIUWPKHJgjeqZMc9NDsPXLOfXP8fy66SEtJVTkckhzZl/JSUanbEfOeRrAjeenZAWLMgjBhI3VHFY7AicFUZ9ZUz4d6Av1lcW1LNHhPjUfPedueKKe93NODWaVZOldiHyJTRLG/AP1ZyUbIEI65haJZpJMSXdLyWk+qW4umlplTKFm6qZ9N0ixahxSRcEzyKNUNJEw16pINr1SgFRNumT9s/o9UihvG3TLWGFXqcUIp/GHZLZE4gMc2iRAsb3DpaKeT4EIedVchXzAAIswxbgNDx+LIpBr4bUbTlhQi1iX30oU7JSbn101UWwpw7SQ5yU9MU/KOVbcXkB4UkAAAAASUVORK5CYII=",Ie=""+new URL("shop-empty-6c02d334.png",import.meta.url).href,Pe="_registerModal_ra8en_1",qe="_infoTitle_ra8en_7",Ne="_registerForm_ra8en_13",Ge="_tips_ra8en_20",ke="_codeText_ra8en_40",ze="_submitBtn_ra8en_45",h={registerModal:Pe,infoTitle:qe,registerForm:Ne,tips:Ge,codeText:ke,submitBtn:ze},Oe=""+new URL("info-title-1f45c1de.png",import.meta.url).href,Re=R(),V=[];for(let n=1;n<=40;n++)V.push({text:n+"班",value:n});const Ve=D({name:"register-modal",props:{schoolId:{type:String,default:""},gradeYear:{type:String,default:""},schoolType:{type:String,default:""}},emits:["close","submit"],setup(n,{emit:u}){const d=G(),s=k(()=>{let a=[];const p=[{text:"一年级",value:1},{text:"二年级",value:2},{text:"三年级",value:3},{text:"四年级",value:4},{text:"五年级",value:5}],c=[{text:"六年级",value:6}],m=[{text:"七年级",value:7},{text:"八年级",value:8},{text:"九年级",value:9}];return n.gradeYear==="FIVE_YEAR_SYSTEM"?a.push([...p]):n.gradeYear==="SIX_YEAR_SYSTEM"?a.push([...p,...c]):n.gradeYear==="THREE_YEAR_SYSTEM"?a.push([...m]):n.gradeYear==="FORE_YEAR_SYSTEM"?a.push([...c,...m]):a.push([...p,...c,...m]),console.log(a,n.schoolType,n.gradeYear),a}),l=B({countDownStatus:!0,countDownTime:1e3*120,modelValue:!1,imgCodeStatus:!1,gradeNumText:"",currentClassText:"",gradeStatus:!1,classStatus:!1,loading:!1}),r=B({autoRegister:!0,client_id:"cooleshow-student",client_secret:"cooleshow-student",extra:{nickname:"",currentGradeNum:"",currentClass:""},grant_type:"password",loginType:"SMS",password:"",username:""}),C=()=>{l.countDownStatus=!1,Y(()=>{d.value.start()})},w=()=>{if(!v(r.username))return f("请输入正确的手机号码");l.imgCodeStatus=!0},F=()=>{l.countDownStatus=!0,d.value.reset()},t=async()=>{try{if(g())return;l.loading=!0;const{extra:a,...p}=r,{data:c}=await y.post("/edu-oauth/userlogin",{hideLoading:!1,requestType:"form",data:{...p,extra:JSON.stringify({...a,schoolId:n.schoolId})}});Re.setToken(c.token_type+" "+c.access_token),u("close"),u("submit")}catch(a){}finally{l.loading=!1}},g=()=>{if(v(r.username))if(r.password)if(r.extra.nickname)if(r.extra.currentGradeNum){if(!r.password)return f("请选择所在班级"),!0}else return f("请选择所在年级"),!0;else return f("请输入学生姓名"),!0;else return f("请输入验证码"),!0;else return f("请输入正确的手机号码"),!0;return!1};return()=>e("div",{class:h.registerModal},[e("img",{src:Oe,class:h.infoTitle},null),e(H,{labelAlign:"top",class:h.registerForm},{default:()=>[e(S,{clearable:!0,label:"联系方式(直接监护人)",placeholder:"请输入手机号码",type:"tel",autocomplete:"off",modelValue:r.username,"onUpdate:modelValue":a=>r.username=a,maxlength:11},{label:()=>e("div",null,[i("联系方式(直接监护人)"),e("p",{class:h.tips},[i("手机号是数字化器乐课堂的唯一登录账户")])])}),e(S,{center:!0,clearable:!0,label:"验证码",placeholder:"请输入验证码",autocomplete:"off",type:"number",modelValue:r.password,"onUpdate:modelValue":a=>r.password=a,maxlength:6},{button:()=>l.countDownStatus?e("span",{class:h.codeText,onClick:w},[i("获取验证码")]):e(j,{ref:a=>d.value=a,"auto-start":!1,time:l.countDownTime,onFinish:F,format:"ss秒"},null)}),e(S,{clearable:!0,label:"学生姓名",placeholder:"请输入学生姓名",autocomplete:"off",modelValue:r.extra.nickname,"onUpdate:modelValue":a=>r.extra.nickname=a},null),e(S,{clearable:!0,label:"所在年级",placeholder:"请选择年级",isLink:!0,readonly:!0,clickable:!1,modelValue:l.gradeNumText,onClick:()=>l.gradeStatus=!0},null),e(S,{clearable:!0,label:"所在班级",placeholder:"请选择班级",isLink:!0,readonly:!0,clickable:!1,modelValue:l.currentClassText,onClick:()=>l.classStatus=!0},null)]}),e(K,{center:!0,modelValue:l.modelValue,"onUpdate:modelValue":a=>l.modelValue=a,prototcolType:"REGISTER"},null),e(T,{type:"primary",class:h.submitBtn,color:"linear-gradient(121deg, #FFD892 0%, #FFCB75 100%)",block:!0,onClick:t,disabled:l.loading,loading:l.loading},{default:()=>[i("确认")]}),l.imgCodeStatus?e(Q,{value:l.imgCodeStatus,"onUpdate:value":a=>l.imgCodeStatus=a,phone:r.username,onClose:()=>{l.imgCodeStatus=!1},onSendCode:C},null):null,e(b,{show:l.gradeStatus,"onUpdate:show":a=>l.gradeStatus=a,position:"bottom",round:!0,safeAreaInsetBottom:!0,lazyRender:!1,class:"popupBottomSearch"},{default:()=>[e(I,{showToolbar:!0,columns:s.value,onCancel:()=>l.gradeStatus=!1,onConfirm:a=>{const p=a.selectedOptions[0];r.extra.currentGradeNum=p.value,l.gradeNumText=p.text,l.gradeStatus=!1}},null)]}),e(b,{show:l.classStatus,"onUpdate:show":a=>l.classStatus=a,position:"bottom",round:!0,class:"popupBottomSearch"},{default:()=>[e(I,{showToolbar:!0,columns:V,onCancel:()=>l.classStatus=!1,onConfirm:a=>{const p=a.selectedOptions[0];r.extra.currentClass=p.value,l.currentClassText=p.text,l.classStatus=!1}},null)]})])}}),U=n=>{if(n===null)return null;const u=Object.assign({},n);return Object.keys(u).forEach(d=>u[d]=typeof n[d]=="object"?U(n[d]):n[d]),Array.isArray(n)?(u.length=n.length,Array.from(u)):u},Ue="_wxPopupDialog_1sfd3_1",Le="_popupContainer_1sfd3_16",Me="_title1_1sfd3_22",Ye="_popupTips_1sfd3_29",E={wxPopupDialog:Ue,popupContainer:Le,title1:Me,popupTips:Ye},Je=D({name:"m-wx-tip",props:{show:{type:Boolean,default:!0},title:{type:String,default:"温馨提示"},message:{type:String,default:"请使用微信打开"}},setup(n){const u=G(!1);return z(()=>{if(!J().weixin&&n.show){u.value=!0;return}}),()=>e(O,null,[e(b,{show:u.value,"onUpdate:show":d=>u.value=d,round:!0,style:{width:"88%"},closeOnClickOverlay:!1,class:E.wxPopupDialog},{default:()=>[e("div",{class:E.popupContainer},[e("p",{class:E.title1},[n.title]),e("p",{class:E.popupTips},[n.message])])]})])}}),it=D({name:"student-register",setup(){const n=X(),u=R(),d=W();u.setShoolId(n.query.sId);const s=B({schoolId:n.query.sId,popupShow:!1,popupRegister:!1,details:[],schoolType:"",gradeYear:"",bugGoods:!1,submitLoading:!1,dialogStatus:!1,dialogMessage:"",dialogConfig:{},code:""}),l=async()=>{try{const{data:t}=await y.get("/edu-app/userPaymentOrder/unpaid");t.id&&(s.dialogMessage="您有待支付的订单,是否继续支付",s.dialogStatus=!0,s.dialogConfig=t)}catch(t){}},r=async()=>{try{const{data:t}=await y.get("/edu-app/open/userOrder/registerGoods/"+s.schoolId,{noAuthorization:!0});u.setVip(t.details||[]),s.details=U(t.details||[]),s.bugGoods=t.bugGoods,s.schoolType=t.schoolType,s.gradeYear=t.gradeYear,console.log(u.getGoods)}catch(t){}},C=k(()=>{let t=0,g=0;return u.getVip.forEach(c=>{t+=Number(c.currentPrice),g+=Number(c.originalPrice)}),u.getGoods.forEach(c=>{t+=Number(c.price)*c.quantity,g+=Number(c.originalPrice)*c.quantity}),{amount:t,originAmount:g}}),w=t=>{Z({title:"标题",message:"是否删除该商品",confirmButtonColor:"#FF8633"}).then(()=>{u.deleteGoods(t.goodsId)})},F=async()=>{try{if(s.submitLoading=!0,await l(),s.dialogStatus){s.submitLoading=!1;return}const t=await y.get("/edu-app/userPaymentOrder/registerStatus/"+s.schoolId),g=u.getVip,a=u.getGoods;if(t.data.hasBuyCourse&&g.length>0){f("您已购买数字化器乐学练工具,请勿重复购买");return}if(g.length<=0&&a.length<=0){f("请选择需要购买的商品");return}const p=[];g.forEach(m=>{p.push({goodsId:m.goodsId,goodsNum:1,goodsType:m.goodsType,paymentCashAmount:m.currentPrice,paymentCouponAmount:0})}),a.forEach(m=>{p.push({goodsId:m.productId,goodsNum:m.quantity,goodsType:"INSTRUMENTS",paymentCashAmount:m.price,paymentCouponAmount:0,goodsSkuId:m.productSkuId})});const{data:c}=await y.post("/edu-app/userPaymentOrder/executeOrder",{hideLoading:!1,data:{paymentType:"adapay",bizId:s.schoolId,orderType:"SCHOOL_REGISTER",paymentCashAmount:C.value.amount||0,paymentCouponAmount:0,goodsInfos:p,orderName:"学生注册",orderDesc:"学生注册"}});d.push({path:"/order-detail",query:{pm:1,config:JSON.stringify({...c.paymentConfig,paymentType:c.paymentType}),orderNo:c.orderNo}})}finally{s.submitLoading=!1}};return z(()=>{r()}),()=>e("div",{class:o["student-register"]},[e("div",{class:o.studentSection,style:{marginTop:"18px"}},[e("div",{class:o.titleTool},null),s.details.map(t=>e(P,{class:o.goodsSection,onClick:()=>{u.selectedVip(t.goodsId)?u.deleteVip(t.goodsId):u.setVip([t])}},{default:()=>[e(A,{border:!1,class:o.goodsCell},{icon:()=>e(N,{class:o.img,src:t.goodsUrl},null),title:()=>e("div",{class:o.section},[e("div",{class:o.sectionContent},[e("h2",null,[t.goodsName,e(q,{class:o.brandName},{default:()=>[i("12个月")]})]),e("p",{class:[o.model]},[t.description]),e("div",{class:o.sbtnGroup},[e("span",{class:o.btnDetail,onClick:g=>{g.stopPropagation(),d.push("/student-digital-tools")}},[i("查看详情")]),e("span",{class:o.btnVideo,onClick:g=>{g.stopPropagation(),s.popupShow=!0}},[i("介绍视频")])])]),e("i",{class:u.selectedVip(t.goodsId)?o.selected:o.noSelected},null)])}),e(A,{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.currentPrice)])]),e("del",null,[i("¥"),_(t.originalPrice)])])}),e(A,{border:!1,class:o.giftCell},{title:()=>e("div",{class:o.gift},[e("img",{src:xe,class:o.iconGift},null),i("现在购买赠送 "),e("span",null,[t.membershipDays||0]),i("天有效期")])})]}))]),s.bugGoods&&e(O,null,[e("div",{class:o.studentSection},[e("div",{class:o.titleBuy},null),u.getGoods&&u.getGoods.length<=0?e("div",{class:o.goodsEmpty},[e("img",{src:Ie,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(T,{class:o.goSelect,type:"primary",onClick:()=>{d.push("/goods-list")}},{default:()=>[i("进入商城选购"),e(x,{name:"arrow"},null)]})])]):u.getGoods.map(t=>e(P,{class:o.goodsSection},{default:()=>[e(A,{border:!1,class:o.goodsCell},{icon:()=>e(N,{class:o.img,src:t.pic},null),title:()=>e("div",{class:o.section},[e("div",{class:o.sectionContent},[e("h2",null,[t.name,e(q,{class:o.brandName},{default:()=>[t.brandName]})]),e("p",{class:[o.model]},[i("规格:"),t.spDataJson]),e("p",{class:[o.model]},[t.productSn]),e($,{min:1,max:99,modelValue:t.quantity,"onUpdate:modelValue":g=>t.quantity=g},null)]),e("i",{class:o.delete,onClick:()=>w(t)},null)])}),e(A,{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.price)])]),e("del",null,[i("¥"),_(t.originalPrice)])])})]}))]),u.getGoods&&u.getGoods.length>0&&e(T,{class:o.addButton,block:!0,onClick:()=>{d.push("/goods-list")}},{default:()=>[e(x,{name:"add-o"},null),i("进入商城选购")]})]),e(L,{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,[_(C.value.amount)])]),e("del",{class:o.allPrice},[i("¥ "),_(C.value.originAmount)])]),e("div",{class:o.paymentBtn,onClick:()=>{u.getToken?F():s.popupRegister=!0}},[e(T,{disabled:s.submitLoading,loading:s.submitLoading},{default:()=>[i("确认购买")]})])])]}),e(b,{show:s.popupShow,"onUpdate:show":t=>s.popupShow=t,class:o.videoPopup},{default:()=>[s.popupShow&&e(M,{src:"https://daya.ks3-cn-beijing.ksyun.com/202105/SWmqmvW.mp4"},null)]}),e(b,{show:s.popupRegister,"onUpdate:show":t=>s.popupRegister=t,class:o.registerPopup,position:"bottom",round:!0},{default:()=>[e(Ve,{schoolId:s.schoolId,schoolType:s.schoolType,gradeYear:s.gradeYear,onClose:()=>s.popupRegister=!1,onSubmit:F},null)]}),e(ee,{title:"提示",show:s.dialogStatus,"onUpdate:show":t=>s.dialogStatus=t,message:s.dialogMessage,confirmButtonText:"继续支付",cancelButtonText:"取消订单",showCancelButton:!0,onConfirm:()=>{const t=s.dialogConfig.paymentConfig;d.push({path:"/order-detail",query:{pm:1,config:JSON.stringify(t.paymentConfig),orderNo:t.orderNo}})},onCancel:async()=>{try{await y.post("/edu-app/userPaymentOrder/cancelPayment/"+s.dialogConfig.orderNo)}catch(t){}}},null),e(Je,null,null)])}});export{it as default};