index-8c1bf190.js 57 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236
  1. <<<<<<< HEAD
  2. import{ac as E,c as X,b as W,m as Z,t as z,d as w,ad as K,e as N,w as $,X as j,a as e,k as Q,D as C,E as _,V as b,A as i,L as ee,r as U,x,C as B,z as te,N as k,y as M,R as oe,F as q,U as se,q as ae,P as S,I as G,Q as ne}from"./index-0b3380a9.js";import{M as ue}from"./index-919c5bf7.js";import{M as le}from"./index-c2e562a2.js";import{F as ie,O as de}from"./index-1cec3df4.js";import{R,C as I,u as Y,S as re}from"./student-register-store-f0e25580.js";import{F}from"./index-451fefb3.js";import{I as P}from"./index-02bb440b.js";import{P as V}from"./index-3d730154.js";import{O as ce}from"./index-211c0d06.js";import{C as L}from"./index-a7cda64a.js";import{C as T}from"./index-e2c278c3.js";import{T as O}from"./index-f87aeb09.js";import"./plyr-a24de5e8.js";import"./Checker-a18684d0.js";function pe(t,n){const{days:r}=n;let{hours:a,minutes:u,seconds:d,milliseconds:f}=n;if(t.includes("DD")?t=t.replace("DD",E(r)):a+=r*24,t.includes("HH")?t=t.replace("HH",E(a)):u+=a*60,t.includes("mm")?t=t.replace("mm",E(u)):d+=u*60,t.includes("ss")?t=t.replace("ss",E(d)):f+=d*1e3,t.includes("S")){const h=E(f,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[me,ge]=X("count-down"),fe={time:W(0),format:Z("HH:mm:ss"),autoStart:z,millisecond:Boolean};var he=w({name:me,props:fe,emits:["change","finish"],setup(t,{emit:n,slots:r}){const{start:a,pause:u,reset:d,current:f}=K({time:+t.time,millisecond:t.millisecond,onChange:o=>n("change",o),onFinish:()=>n("finish")}),h=N(()=>pe(t.format,f.value)),y=()=>{d(+t.time),t.autoStart&&a()};return $(()=>t.time,y,{immediate:!0}),j({start:a,pause:u,reset:y}),()=>e("div",{role:"timer",class:ge()},[r.default?r.default(f.value):h.value])}});const _e=Q(he),Ce="_studentSection_3dvma_7",ye="_goodsSection_3dvma_25",Se="_titleTool_3dvma_36",ve="_titleBuy_3dvma_45",Ae="_goodsCell_3dvma_52",Fe="_noSelected_3dvma_57",be="_selected_3dvma_58",Ee="_img_3dvma_78",Te="_brandName_3dvma_91",we="_model_3dvma_101",De="_sbtnGroup_3dvma_111",Be="_btnDetail_3dvma_123",Ie="_btnVideo_3dvma_124",xe="_priceCell_3dvma_164",Pe="_sPriceGroup_3dvma_167",Ne="_tg_3dvma_175",ke="_giftCell_3dvma_198",Ge="_gift_3dvma_198",Re="_iconGift_3dvma_216",Ve="_goodsEmpty_3dvma_221",Le="_shopImg_3dvma_230",Oe="_goodsContainer_3dvma_234",Ue="_tips_3dvma_242",Me="_goSelect_3dvma_247",qe="_addButton_3dvma_266",Ye="_paymentContainer_3dvma_285",He="_needPrice_3dvma_295",Je="_allPrice_3dvma_308",Xe="_videoPopup_3dvma_327",s={"student-register":"_student-register_3dvma_1",studentSection:Ce,goodsSection:ye,titleTool:Se,titleBuy:ve,goodsCell:Ae,noSelected:Fe,selected:be,delete:"_delete_3dvma_59",img:Ee,brandName:Te,model:we,sbtnGroup:De,btnDetail:Be,btnVideo:Ie,priceCell:xe,sPriceGroup:Pe,tg:Ne,giftCell:ke,gift:Ge,iconGift:Re,goodsEmpty:Ve,shopImg:Le,goodsContainer:Oe,tips:Ue,goSelect:Me,addButton:qe,paymentContainer:Ye,needPrice:He,allPrice:Je,videoPopup:Xe},We="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAMAAADW3miqAAAAjVBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8DizOFAAAALnRSTlMA4Y3756eI8JND97N+3co6M+pPKBIE9vLFv2BaHxwYmG9qSiokDwwI1LmuoHNC7/yX5QAAAVdJREFUOMuFktuWgjAMRYMdLBYEFBDxgo7X8Zb//7zRHFiodMF+OjXbJgTonSjwx1rlTjHYncnKMXC4QXurtpJtNX+ivOOXs5pzGyf6cOIJ21DLdwet9GZjUHWvCtai6YV7/JToIUWPKHJgjeqZMc9NDsPXLOfXP8fy66SEtJVTkckhzZl/JSUanbEfOeRrAjeenZAWLMgjBhI3VHFY7AicFUZ9ZUz4d6Av1lcW1LNHhPjUfPedueKKe93NODWaVZOldiHyJTRLG/AP1ZyUbIEI65haJZpJMSXdLyWk+qW4umlplTKFm6qZ9N0ixahxSRcEzyKNUNJEw16pINr1SgFRNumT9s/o9UihvG3TLWGFXqcUIp/GHZLZE4gMc2iRAsb3DpaKeT4EIedVchXzAAIswxbgNDx+LIpBr4bUbTlhQi1iX30oU7JSbn101UWwpw7SQ5yU9MU/KOVbcXkB4UkAAAAASUVORK5CYII=",Ze=""+new URL("shop-empty-6c02d334.png",import.meta.url).href,ze="_registerModal_ra8en_1",Ke="_infoTitle_ra8en_7",$e="_registerForm_ra8en_13",je="_tips_ra8en_20",Qe="_codeText_ra8en_40",et="_submitBtn_ra8en_45",v={registerModal:ze,infoTitle:Ke,registerForm:$e,tips:je,codeText:Qe,submitBtn:et},tt=""+new URL("info-title-1f45c1de.png",import.meta.url).href,ot="_imgCode_mq980_1",st="_codeTitle_mq980_4",at="_img_mq980_1",nt="_imgChange_mq980_16",ut="_field_mq980_23",lt="_imgCodePopup_mq980_27",A={imgCode:ot,codeTitle:st,img:at,imgChange:nt,field:ut,imgCodePopup:lt},it=w({name:"o-img-code",props:{value:Boolean,phone:[String,Number],type:{type:String,default:"LOGIN"}},emits:["close","sendCode"],data(){return{isSuffix:"/edu-oauth",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 C.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 C.post("/edu-oauth/open/verifyImgCode",{requestType:"form",hideLoading:!0,data:{phone:this.phone,code:this.code}}),await C.post("/edu-oauth/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(b,{show:this.showStatus,class:A.imgCodePopup,closeOnClickOverlay:!1,onClose:()=>{this.$emit("close")},closeable:!0,closeIcon:"close"},{default:()=>[e("div",{class:A.imgCode},[e("p",{class:A.codeTitle},[i("输入图形验证码")]),e(R,null,{default:()=>[e(I,{span:"14"},{default:()=>[e(F,{placeholder:"请输入验证码",modelValue:this.code,"onUpdate:modelValue":t=>this.code=t,class:A.field,autocomplete:"off"},null)]}),e(I,{span:"10",class:A.img},{default:()=>[e(P,{src:this.identifyingCode,onClick:()=>this.updateIdentifyingCode()},{loading:()=>e(ee,{type:"spinner",size:"20"},null)})]})]}),e(R,{style:{display:"flex",justifyContent:"end"}},{default:()=>[e(I,{span:"10"},{default:()=>[e("span",{class:A.imgChange,onClick:()=>this.updateIdentifyingCode()},[i("看不清?换一换")])]})]})])]})}}),dt=Y(),H=[];for(let t=1;t<=40;t++)H.push({text:t+"班",value:t});const rt=w({name:"register-modal",props:{schoolId:{type:String,default:""},gradeYear:{type:String,default:""},schoolType:{type:String,default:""}},emits:["close","submit"],setup(t,{emit:n}){const r=U(),a=N(()=>{let l=[];const p=[{text:"一年级",value:1},{text:"二年级",value:2},{text:"三年级",value:3},{text:"四年级",value:4},{text:"五年级",value:5}],c=[{text:"六年级",value:6}],g=[{text:"七年级",value:7},{text:"八年级",value:8},{text:"九年级",value:9}];return t.gradeYear==="FIVE_YEAR_SYSTEM"?l.push([...p]):t.gradeYear==="SIX_YEAR_SYSTEM"?l.push([...p,...c]):t.gradeYear==="THREE_YEAR_SYSTEM"?l.push([...g]):t.gradeYear==="FORE_YEAR_SYSTEM"?l.push([...c,...g]):l.push([...p,...c,...g]),console.log(l,t.schoolType,t.gradeYear),l}),u=x({countDownStatus:!0,countDownTime:1e3*120,modelValue:!1,imgCodeStatus:!1,gradeNumText:"",currentClassText:"",gradeStatus:!1,classStatus:!1,loading:!1}),d=x({autoRegister:!0,client_id:"cooleshow-student",client_secret:"cooleshow-student",extra:{nickname:"",currentGradeNum:"",currentClass:""},grant_type:"password",loginType:"SMS",password:"",username:""}),f=()=>{u.countDownStatus=!1,te(()=>{r.value.start()})},h=()=>{if(!k(d.username))return _("请输入正确的手机号码");u.imgCodeStatus=!0},y=()=>{u.countDownStatus=!0,r.value.reset()},o=async()=>{try{if(m())return;u.loading=!0;const{extra:l,...p}=d,{data:c}=await C.post("/edu-oauth/userlogin",{hideLoading:!1,requestType:"form",data:{...p,extra:JSON.stringify({...l,schoolId:t.schoolId})}});dt.setToken(c.token_type+" "+c.access_token),n("close"),n("submit")}catch(l){}finally{u.loading=!1}},m=()=>{if(k(d.username))if(d.password)if(d.extra.nickname)if(d.extra.currentGradeNum){if(!d.password)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:tt,class:v.infoTitle},null),e(ie,{labelAlign:"top",class:v.registerForm},{default:()=>[e(F,{clearable:!0,label:"联系方式(直接监护人)",placeholder:"请输入手机号码",type:"tel",autocomplete:"off",modelValue:d.username,"onUpdate:modelValue":l=>d.username=l,maxlength:11},{label:()=>e("div",null,[i("联系方式(直接监护人)"),e("p",{class:v.tips},[i("手机号是数字化器乐课堂的唯一登录账户")])])}),e(F,{center:!0,clearable:!0,label:"验证码",placeholder:"请输入验证码",autocomplete:"off",type:"number",modelValue:d.password,"onUpdate:modelValue":l=>d.password=l,maxlength:6},{button:()=>u.countDownStatus?e("span",{class:v.codeText,onClick:h},[i("获取验证码")]):e(_e,{ref:l=>r.value=l,"auto-start":!1,time:u.countDownTime,onFinish:y,format:"ss秒"},null)}),e(F,{clearable:!0,label:"学生姓名",placeholder:"请输入学生姓名",autocomplete:"off",modelValue:d.extra.nickname,"onUpdate:modelValue":l=>d.extra.nickname=l},null),e(F,{clearable:!0,label:"所在年级",placeholder:"请选择年级",isLink:!0,readonly:!0,clickable:!1,modelValue:u.gradeNumText,onClick:()=>u.gradeStatus=!0},null),e(F,{clearable:!0,label:"所在班级",placeholder:"请选择班级",isLink:!0,readonly:!0,clickable:!1,modelValue:u.currentClassText,onClick:()=>u.classStatus=!0},null)]}),e(de,{center:!0,modelValue:u.modelValue,"onUpdate:modelValue":l=>u.modelValue=l,prototcolType:"REGISTER"},null),e(B,{type:"primary",class:v.submitBtn,color:"linear-gradient(121deg, #FFD892 0%, #FFCB75 100%)",block:!0,onClick:o,disabled:u.loading,loading:u.loading},{default:()=>[i("确认")]}),u.imgCodeStatus?e(it,{value:u.imgCodeStatus,"onUpdate:value":l=>u.imgCodeStatus=l,phone:d.username,onClose:()=>{u.imgCodeStatus=!1},onSendCode:f},null):null,e(b,{show:u.gradeStatus,"onUpdate:show":l=>u.gradeStatus=l,position:"bottom",round:!0,safeAreaInsetBottom:!0,lazyRender:!1,class:"popupBottomSearch"},{default:()=>[e(V,{showToolbar:!0,columns:a.value,onCancel:()=>u.gradeStatus=!1,onConfirm:l=>{const p=l.selectedOptions[0];d.extra.currentGradeNum=p.value,u.gradeNumText=p.text,u.gradeStatus=!1}},null)]}),e(b,{show:u.classStatus,"onUpdate:show":l=>u.classStatus=l,position:"bottom",round:!0,class:"popupBottomSearch"},{default:()=>[e(V,{showToolbar:!0,columns:H,onCancel:()=>u.classStatus=!1,onConfirm:l=>{const p=l.selectedOptions[0];d.extra.currentClass=p.value,u.currentClassText=p.text,u.classStatus=!1}},null)]})])}}),J=t=>{if(t===null)return null;const n=Object.assign({},t);return Object.keys(n).forEach(r=>n[r]=typeof t[r]=="object"?J(t[r]):t[r]),Array.isArray(t)?(n.length=t.length,Array.from(n)):n},ct="_wxPopupDialog_1sfd3_1",pt="_popupContainer_1sfd3_16",mt="_title1_1sfd3_22",gt="_popupTips_1sfd3_29",D={wxPopupDialog:ct,popupContainer:pt,title1:mt,popupTips:gt},ft=w({name:"m-wx-tip",props:{show:{type:Boolean,default:!0},title:{type:String,default:"温馨提示"},message:{type:String,default:"请使用微信打开"}},setup(t){const n=U(!1);return M(()=>{if(!oe().weixin&&t.show){n.value=!0;return}}),()=>e(q,null,[e(b,{show:n.value,"onUpdate:show":r=>n.value=r,round:!0,style:{width:"88%"},closeOnClickOverlay:!1,class:D.wxPopupDialog},{default:()=>[e("div",{class:D.popupContainer},[e("p",{class:D.title1},[t.title]),e("p",{class:D.popupTips},[t.message])])]})])}}),It=w({name:"student-register",setup(){const t=se(),n=Y(),r=ae();n.setShoolId(t.query.sId);const a=x({schoolId:t.query.sId,popupShow:!1,popupRegister:!1,details:[],schoolType:"",gradeYear:"",bugGoods:!1,submitLoading:!1,dialogStatus:!1,dialogMessage:"",dialogConfig:{},code:""}),u=async()=>{try{const{data:o}=await C.get("/edu-app/userPaymentOrder/unpaid");o.id&&(a.dialogMessage="您有待支付的订单,是否继续支付",a.dialogStatus=!0,a.dialogConfig=o)}catch(o){}},d=async()=>{try{const{data:o}=await C.get("/edu-app/open/userOrder/registerGoods/"+a.schoolId,{noAuthorization:!0});n.setVip(o.details||[]),a.details=J(o.details||[]),a.bugGoods=o.bugGoods,a.schoolType=o.schoolType,a.gradeYear=o.gradeYear,console.log(n.getGoods)}catch(o){}},f=N(()=>{let o=0,m=0;return n.getVip.forEach(c=>{o+=Number(c.currentPrice),m+=Number(c.originalPrice)}),n.getGoods.forEach(c=>{o+=Number(c.price)*c.quantity,m+=Number(c.originalPrice)*c.quantity}),{amount:o,originAmount:m}}),h=o=>{ne({message:"是否删除该商品",confirmButtonColor:"#FF8633"}).then(()=>{n.deleteGoods(o.goodsId)})},y=async()=>{try{if(a.submitLoading=!0,await u(),a.dialogStatus){a.submitLoading=!1;return}const o=await C.get("/edu-app/userPaymentOrder/registerStatus/"+a.schoolId),m=n.getVip,l=n.getGoods;if(o.data.hasBuyCourse&&m.length>0){setTimeout(()=>{_("您已购买数字化器乐学练工具,请勿重复购买")},100);return}if(m.length<=0&&l.length<=0){setTimeout(()=>{_("请选择需要购买的商品")},100);return}const p=[];m.forEach(g=>{p.push({goodsId:g.goodsId,goodsNum:1,goodsType:g.goodsType,paymentCashAmount:g.currentPrice,paymentCouponAmount:0})}),l.forEach(g=>{p.push({goodsId:g.productId,goodsNum:g.quantity,goodsType:"INSTRUMENTS",paymentCashAmount:g.price,paymentCouponAmount:0,goodsSkuId:g.productSkuId})});const{data:c}=await C.post("/edu-app/userPaymentOrder/executeOrder",{hideLoading:!1,data:{paymentType:"adapay",bizId:a.schoolId,orderType:"SCHOOL_REGISTER",paymentCashAmount:f.value.amount||0,paymentCouponAmount:0,goodsInfos:p,orderName:"学生登记",orderDesc:"学生登记"}});r.push({path:"/order-detail",query:{pm:1,config:JSON.stringify({...c.paymentConfig,paymentType:c.paymentType}),orderNo:c.orderNo}})}finally{a.submitLoading=!1}};return M(()=>{d()}),()=>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(L,{class:s.goodsSection,onClick:()=>{n.selectedVip(o.goodsId)?n.deleteVip(o.goodsId):n.setVip([o])}},{default:()=>[e(T,{border:!1,class:s.goodsCell},{icon:()=>e(P,{class:s.img,src:o.goodsUrl},null),title:()=>e("div",{class:s.section},[e("div",{class:s.sectionContent},[e("h2",null,[o.goodsName,e(O,{class:s.brandName},{default:()=>[i("12个月")]})]),e("p",{class:[s.model]},[o.description]),e("div",{class:s.sbtnGroup},[e("span",{class:s.btnDetail,onClick:m=>{m.stopPropagation(),r.push("/student-digital-tools")}},[i("查看详情")]),e("span",{class:s.btnVideo,onClick:m=>{m.stopPropagation(),a.popupShow=!0}},[i("介绍视频")])])]),e("i",{class:n.selectedVip(o.goodsId)?s.selected:s.noSelected},null)])}),e(T,{border:!1,class:s.priceCell},{title:()=>e("div",{class:s.sPriceGroup},[e("div",{class:s.tg},[i("团购价:"),e("span",null,[e("i",null,[i("¥ ")]),S(o.currentPrice)])]),e("del",null,[i("¥"),S(o.originalPrice)])])}),e(T,{border:!1,class:s.giftCell},{title:()=>e("div",{class:s.gift},[e("img",{src:We,class:s.iconGift},null),i("现在购买赠送 "),e("span",null,[o.membershipDays||0]),i("天有效期")])})]}))]),a.bugGoods&&e(q,null,[e("div",{class:s.studentSection},[e("div",{class:s.titleBuy},null),n.getGoods&&n.getGoods.length<=0?e("div",{class:s.goodsEmpty},[e("img",{src:Ze,class:s.shopImg},null),e("div",{class:s.goodsContainer},[e("h2",null,[i("为你的"),e("span",null,[i("音乐之旅")]),i("做好准备")]),e("p",{class:s.tips},[i("快去选购乐器吧~")]),e(B,{class:s.goSelect,type:"primary",onClick:()=>{r.push("/goods-list")}},{default:()=>[i("进入商城选购"),e(G,{name:"arrow"},null)]})])]):n.getGoods.map(o=>e(L,{class:s.goodsSection},{default:()=>[e(T,{border:!1,class:s.goodsCell},{icon:()=>e(P,{class:s.img,src:o.pic},null),title:()=>e("div",{class:s.section},[e("div",{class:s.sectionContent},[e("h2",null,[o.name,e(O,{class:s.brandName},{default:()=>[o.brandName]})]),e("p",{class:[s.model]},[i("规格:"),o.spDataJson]),e("p",{class:[s.model]},[o.productSn]),e(re,{min:1,max:99,modelValue:o.quantity,"onUpdate:modelValue":m=>o.quantity=m},null)]),e("i",{class:s.delete,onClick:()=>h(o)},null)])}),e(T,{border:!1,class:s.priceCell},{title:()=>e("div",{class:s.sPriceGroup},[e("div",{class:s.tg},[i("团购价:"),e("span",null,[e("i",null,[i("¥ ")]),S(o.price)])]),e("del",null,[i("¥"),S(o.originalPrice)])])})]}))]),n.getGoods&&n.getGoods.length>0&&e(B,{class:s.addButton,block:!0,onClick:()=>{r.push("/goods-list")}},{default:()=>[e(G,{name:"add-o"},null),i("进入商城选购")]})]),e(ue,{position:"bottom"},{default:()=>[e("div",{class:s.paymentContainer},[e("div",{class:s.payemntPrice},[e("span",{class:s.needPrice},[e("i",{style:"font-style: normal"},[i("¥ ")]),e("span",null,[S(f.value.amount)])]),e("del",{class:s.allPrice},[i("¥ "),S(f.value.originAmount)])]),e("div",{class:s.paymentBtn,onClick:()=>{n.getToken?y():a.popupRegister=!0}},[e(B,{disabled:a.submitLoading,loading:a.submitLoading},{default:()=>[i("确认购买")]})])])]}),e(b,{show:a.popupShow,"onUpdate:show":o=>a.popupShow=o,class:s.videoPopup},{default:()=>[a.popupShow&&e(le,{src:"https://daya.ks3-cn-beijing.ksyun.com/202105/SWmqmvW.mp4"},null)]}),e(b,{show:a.popupRegister,"onUpdate:show":o=>a.popupRegister=o,class:s.registerPopup,position:"bottom",round:!0},{default:()=>[e(rt,{schoolId:a.schoolId,schoolType:a.schoolType,gradeYear:a.gradeYear,onClose:()=>a.popupRegister=!1,onSubmit:y},null)]}),e(ce,{title:"提示",show:a.dialogStatus,"onUpdate:show":o=>a.dialogStatus=o,message:a.dialogMessage,confirmButtonText:"继续支付",cancelButtonText:"取消订单",showCancelButton:!0,onConfirm:()=>{const o=a.dialogConfig.paymentConfig;r.push({path:"/order-detail",query:{pm:1,config:JSON.stringify(o.paymentConfig),orderNo:o.orderNo}})},onCancel:async()=>{try{await C.post("/edu-app/userPaymentOrder/cancelPayment/"+a.dialogConfig.orderNo)}catch(o){}}},null),e(ft,null,null)])}});export{It as default};
  3. =======
  4. import {
  5. ac as E,
  6. c as X,
  7. b as W,
  8. m as Z,
  9. t as z,
  10. d as w,
  11. ad as K,
  12. e as N,
  13. w as $,
  14. X as j,
  15. a as e,
  16. k as Q,
  17. D as C,
  18. E as _,
  19. V as b,
  20. A as i,
  21. L as ee,
  22. r as U,
  23. x,
  24. C as B,
  25. z as te,
  26. N as k,
  27. y as M,
  28. R as oe,
  29. F as q,
  30. U as se,
  31. q as ae,
  32. P as S,
  33. I as G,
  34. Q as ne
  35. } from './index-0b3380a9.js';
  36. import { M as ue } from './index-919c5bf7.js';
  37. import { M as le } from './index-c2e562a2.js';
  38. import { F as ie, O as de } from './index-1cec3df4.js';
  39. import {
  40. R,
  41. C as I,
  42. u as Y,
  43. S as re
  44. } from './student-register-store-f0e25580.js';
  45. import { F } from './index-451fefb3.js';
  46. import { I as P } from './index-02bb440b.js';
  47. import { P as V } from './index-3d730154.js';
  48. import { O as ce } from './index-211c0d06.js';
  49. import { C as L } from './index-a7cda64a.js';
  50. import { C as T } from './index-e2c278c3.js';
  51. import { T as O } from './index-f87aeb09.js';
  52. import './plyr-a24de5e8.js';
  53. import './Checker-a18684d0.js';
  54. function pe(t, n) {
  55. const { days: r } = n;
  56. let { hours: a, minutes: u, seconds: d, milliseconds: f } = n;
  57. if (
  58. (t.includes('DD') ? (t = t.replace('DD', E(r))) : (a += r * 24),
  59. t.includes('HH') ? (t = t.replace('HH', E(a))) : (u += a * 60),
  60. t.includes('mm') ? (t = t.replace('mm', E(u))) : (d += u * 60),
  61. t.includes('ss') ? (t = t.replace('ss', E(d))) : (f += d * 1e3),
  62. t.includes('S'))
  63. ) {
  64. const h = E(f, 3);
  65. t.includes('SSS')
  66. ? (t = t.replace('SSS', h))
  67. : t.includes('SS')
  68. ? (t = t.replace('SS', h.slice(0, 2)))
  69. : (t = t.replace('S', h.charAt(0)));
  70. }
  71. return t;
  72. }
  73. const [me, ge] = X('count-down'),
  74. fe = {
  75. time: W(0),
  76. format: Z('HH:mm:ss'),
  77. autoStart: z,
  78. millisecond: Boolean
  79. };
  80. var he = w({
  81. name: me,
  82. props: fe,
  83. emits: ['change', 'finish'],
  84. setup(t, { emit: n, slots: r }) {
  85. const {
  86. start: a,
  87. pause: u,
  88. reset: d,
  89. current: f
  90. } = K({
  91. time: +t.time,
  92. millisecond: t.millisecond,
  93. onChange: o => n('change', o),
  94. onFinish: () => n('finish')
  95. }),
  96. h = N(() => pe(t.format, f.value)),
  97. y = () => {
  98. d(+t.time), t.autoStart && a();
  99. };
  100. return (
  101. $(() => t.time, y, { immediate: !0 }),
  102. j({ start: a, pause: u, reset: y }),
  103. () =>
  104. e('div', { role: 'timer', class: ge() }, [
  105. r.default ? r.default(f.value) : h.value
  106. ])
  107. );
  108. }
  109. });
  110. const _e = Q(he),
  111. Ce = '_studentSection_3dvma_7',
  112. ye = '_goodsSection_3dvma_25',
  113. Se = '_titleTool_3dvma_36',
  114. ve = '_titleBuy_3dvma_45',
  115. Ae = '_goodsCell_3dvma_52',
  116. Fe = '_noSelected_3dvma_57',
  117. be = '_selected_3dvma_58',
  118. Ee = '_img_3dvma_78',
  119. Te = '_brandName_3dvma_91',
  120. we = '_model_3dvma_101',
  121. De = '_sbtnGroup_3dvma_111',
  122. Be = '_btnDetail_3dvma_123',
  123. Ie = '_btnVideo_3dvma_124',
  124. xe = '_priceCell_3dvma_164',
  125. Pe = '_sPriceGroup_3dvma_167',
  126. Ne = '_tg_3dvma_175',
  127. ke = '_giftCell_3dvma_198',
  128. Ge = '_gift_3dvma_198',
  129. Re = '_iconGift_3dvma_216',
  130. Ve = '_goodsEmpty_3dvma_221',
  131. Le = '_shopImg_3dvma_230',
  132. Oe = '_goodsContainer_3dvma_234',
  133. Ue = '_tips_3dvma_242',
  134. Me = '_goSelect_3dvma_247',
  135. qe = '_addButton_3dvma_266',
  136. Ye = '_paymentContainer_3dvma_285',
  137. He = '_needPrice_3dvma_295',
  138. Je = '_allPrice_3dvma_308',
  139. Xe = '_videoPopup_3dvma_327',
  140. s = {
  141. 'student-register': '_student-register_3dvma_1',
  142. studentSection: Ce,
  143. goodsSection: ye,
  144. titleTool: Se,
  145. titleBuy: ve,
  146. goodsCell: Ae,
  147. noSelected: Fe,
  148. selected: be,
  149. delete: '_delete_3dvma_59',
  150. img: Ee,
  151. brandName: Te,
  152. model: we,
  153. sbtnGroup: De,
  154. btnDetail: Be,
  155. btnVideo: Ie,
  156. priceCell: xe,
  157. sPriceGroup: Pe,
  158. tg: Ne,
  159. giftCell: ke,
  160. gift: Ge,
  161. iconGift: Re,
  162. goodsEmpty: Ve,
  163. shopImg: Le,
  164. goodsContainer: Oe,
  165. tips: Ue,
  166. goSelect: Me,
  167. addButton: qe,
  168. paymentContainer: Ye,
  169. needPrice: He,
  170. allPrice: Je,
  171. videoPopup: Xe
  172. },
  173. We =
  174. 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAMAAADW3miqAAAAjVBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8DizOFAAAALnRSTlMA4Y3756eI8JND97N+3co6M+pPKBIE9vLFv2BaHxwYmG9qSiokDwwI1LmuoHNC7/yX5QAAAVdJREFUOMuFktuWgjAMRYMdLBYEFBDxgo7X8Zb//7zRHFiodMF+OjXbJgTonSjwx1rlTjHYncnKMXC4QXurtpJtNX+ivOOXs5pzGyf6cOIJ21DLdwet9GZjUHWvCtai6YV7/JToIUWPKHJgjeqZMc9NDsPXLOfXP8fy66SEtJVTkckhzZl/JSUanbEfOeRrAjeenZAWLMgjBhI3VHFY7AicFUZ9ZUz4d6Av1lcW1LNHhPjUfPedueKKe93NODWaVZOldiHyJTRLG/AP1ZyUbIEI65haJZpJMSXdLyWk+qW4umlplTKFm6qZ9N0ixahxSRcEzyKNUNJEw16pINr1SgFRNumT9s/o9UihvG3TLWGFXqcUIp/GHZLZE4gMc2iRAsb3DpaKeT4EIedVchXzAAIswxbgNDx+LIpBr4bUbTlhQi1iX30oU7JSbn101UWwpw7SQ5yU9MU/KOVbcXkB4UkAAAAASUVORK5CYII=',
  175. Ze = '' + new URL('shop-empty-6c02d334.png', import.meta.url).href,
  176. ze = '_registerModal_ra8en_1',
  177. Ke = '_infoTitle_ra8en_7',
  178. $e = '_registerForm_ra8en_13',
  179. je = '_tips_ra8en_20',
  180. Qe = '_codeText_ra8en_40',
  181. et = '_submitBtn_ra8en_45',
  182. v = {
  183. registerModal: ze,
  184. infoTitle: Ke,
  185. registerForm: $e,
  186. tips: je,
  187. codeText: Qe,
  188. submitBtn: et
  189. },
  190. tt = '' + new URL('info-title-1f45c1de.png', import.meta.url).href,
  191. ot = '_imgCode_mq980_1',
  192. st = '_codeTitle_mq980_4',
  193. at = '_img_mq980_1',
  194. nt = '_imgChange_mq980_16',
  195. ut = '_field_mq980_23',
  196. lt = '_imgCodePopup_mq980_27',
  197. A = {
  198. imgCode: ot,
  199. codeTitle: st,
  200. img: at,
  201. imgChange: nt,
  202. field: ut,
  203. imgCodePopup: lt
  204. },
  205. it = w({
  206. name: 'o-img-code',
  207. props: {
  208. value: Boolean,
  209. phone: [String, Number],
  210. type: { type: String, default: 'LOGIN' }
  211. },
  212. emits: ['close', 'sendCode'],
  213. data() {
  214. return {
  215. isSuffix: '/edu-app',
  216. showStatus: !1,
  217. identifyingCode: null,
  218. code: ''
  219. };
  220. },
  221. mounted() {
  222. (this.showStatus = this.value), this.sendImgCode();
  223. },
  224. watch: {
  225. value(t) {
  226. this.showStatus = t;
  227. },
  228. code(t) {
  229. t.length >= 4 && this.checkVerifyLoginImage();
  230. }
  231. },
  232. methods: {
  233. async sendImgCode() {
  234. const { data: t } = await C.get(this.isSuffix + '/open/sendImgCode', {
  235. requestType: 'form',
  236. hideLoading: !0,
  237. params: { phone: this.phone }
  238. });
  239. this.identifyingCode = t;
  240. },
  241. async updateIdentifyingCode() {
  242. this.sendImgCode();
  243. },
  244. async checkVerifyLoginImage() {
  245. try {
  246. if (this.code.length < 4) return;
  247. await C.post('/edu-app/open/verifyImgCode', {
  248. requestType: 'form',
  249. hideLoading: !0,
  250. data: { phone: this.phone, code: this.code }
  251. }),
  252. await C.post('/edu-app/open/sendSms', {
  253. requestType: 'form',
  254. hideLoading: !0,
  255. data: {
  256. clientId: 'cooleshow-student',
  257. type: 'REGISTER',
  258. mobile: this.phone
  259. }
  260. }),
  261. setTimeout(() => {
  262. _('验证码已发送');
  263. }, 100),
  264. this.$emit('close'),
  265. this.$emit('sendCode');
  266. } catch (t) {
  267. (this.code = ''), this.updateIdentifyingCode();
  268. }
  269. }
  270. },
  271. render() {
  272. return e(
  273. b,
  274. {
  275. show: this.showStatus,
  276. class: A.imgCodePopup,
  277. closeOnClickOverlay: !1,
  278. onClose: () => {
  279. this.$emit('close');
  280. },
  281. closeable: !0,
  282. closeIcon: 'close'
  283. },
  284. {
  285. default: () => [
  286. e('div', { class: A.imgCode }, [
  287. e('p', { class: A.codeTitle }, [i('输入图形验证码')]),
  288. e(R, null, {
  289. default: () => [
  290. e(
  291. I,
  292. { span: '14' },
  293. {
  294. default: () => [
  295. e(
  296. F,
  297. {
  298. placeholder: '请输入验证码',
  299. modelValue: this.code,
  300. 'onUpdate:modelValue': t => (this.code = t),
  301. class: A.field,
  302. autocomplete: 'off'
  303. },
  304. null
  305. )
  306. ]
  307. }
  308. ),
  309. e(
  310. I,
  311. { span: '10', class: A.img },
  312. {
  313. default: () => [
  314. e(
  315. P,
  316. {
  317. src: this.identifyingCode,
  318. onClick: () => this.updateIdentifyingCode()
  319. },
  320. {
  321. loading: () =>
  322. e(ee, { type: 'spinner', size: '20' }, null)
  323. }
  324. )
  325. ]
  326. }
  327. )
  328. ]
  329. }),
  330. e(
  331. R,
  332. { style: { display: 'flex', justifyContent: 'end' } },
  333. {
  334. default: () => [
  335. e(
  336. I,
  337. { span: '10' },
  338. {
  339. default: () => [
  340. e(
  341. 'span',
  342. {
  343. class: A.imgChange,
  344. onClick: () => this.updateIdentifyingCode()
  345. },
  346. [i('看不清?换一换')]
  347. )
  348. ]
  349. }
  350. )
  351. ]
  352. }
  353. )
  354. ])
  355. ]
  356. }
  357. );
  358. }
  359. }),
  360. dt = Y(),
  361. H = [];
  362. for (let t = 1; t <= 40; t++) H.push({ text: t + '班', value: t });
  363. const rt = w({
  364. name: 'register-modal',
  365. props: {
  366. schoolId: { type: String, default: '' },
  367. gradeYear: { type: String, default: '' },
  368. schoolType: { type: String, default: '' }
  369. },
  370. emits: ['close', 'submit'],
  371. setup(t, { emit: n }) {
  372. const r = U(),
  373. a = N(() => {
  374. let l = [];
  375. const p = [
  376. { text: '一年级', value: 1 },
  377. { text: '二年级', value: 2 },
  378. { text: '三年级', value: 3 },
  379. { text: '四年级', value: 4 },
  380. { text: '五年级', value: 5 }
  381. ],
  382. c = [{ text: '六年级', value: 6 }],
  383. g = [
  384. { text: '七年级', value: 7 },
  385. { text: '八年级', value: 8 },
  386. { text: '九年级', value: 9 }
  387. ];
  388. return (
  389. t.gradeYear === 'FIVE_YEAR_SYSTEM'
  390. ? l.push([...p])
  391. : t.gradeYear === 'SIX_YEAR_SYSTEM'
  392. ? l.push([...p, ...c])
  393. : t.gradeYear === 'THREE_YEAR_SYSTEM'
  394. ? l.push([...g])
  395. : t.gradeYear === 'FORE_YEAR_SYSTEM'
  396. ? l.push([...c, ...g])
  397. : l.push([...p, ...c, ...g]),
  398. console.log(l, t.schoolType, t.gradeYear),
  399. l
  400. );
  401. }),
  402. u = x({
  403. countDownStatus: !0,
  404. countDownTime: 1e3 * 120,
  405. modelValue: !1,
  406. imgCodeStatus: !1,
  407. gradeNumText: '',
  408. currentClassText: '',
  409. gradeStatus: !1,
  410. classStatus: !1,
  411. loading: !1
  412. }),
  413. d = x({
  414. autoRegister: !0,
  415. client_id: 'cooleshow-student',
  416. client_secret: 'cooleshow-student',
  417. extra: { nickname: '', currentGradeNum: '', currentClass: '' },
  418. grant_type: 'password',
  419. loginType: 'SMS',
  420. password: '',
  421. username: ''
  422. }),
  423. f = () => {
  424. (u.countDownStatus = !1),
  425. te(() => {
  426. r.value.start();
  427. });
  428. },
  429. h = () => {
  430. if (!k(d.username)) return _('请输入正确的手机号码');
  431. u.imgCodeStatus = !0;
  432. },
  433. y = () => {
  434. (u.countDownStatus = !0), r.value.reset();
  435. },
  436. o = async () => {
  437. try {
  438. if (m()) return;
  439. u.loading = !0;
  440. const { extra: l, ...p } = d,
  441. { data: c } = await C.post('/edu-app/userlogin', {
  442. hideLoading: !1,
  443. requestType: 'form',
  444. data: {
  445. ...p,
  446. extra: JSON.stringify({ ...l, schoolId: t.schoolId })
  447. }
  448. });
  449. dt.setToken(c.token_type + ' ' + c.access_token),
  450. n('close'),
  451. n('submit');
  452. } catch (l) {
  453. } finally {
  454. u.loading = !1;
  455. }
  456. },
  457. m = () => {
  458. if (k(d.username))
  459. if (d.password)
  460. if (d.extra.nickname)
  461. if (d.extra.currentGradeNum) {
  462. if (!d.password) return _('请选择所在班级'), !0;
  463. } else return _('请选择所在年级'), !0;
  464. else return _('请输入学生姓名'), !0;
  465. else return _('请输入验证码'), !0;
  466. else return _('请输入正确的手机号码'), !0;
  467. return !1;
  468. };
  469. return () =>
  470. e('div', { class: v.registerModal }, [
  471. e('img', { src: tt, class: v.infoTitle }, null),
  472. e(
  473. ie,
  474. { labelAlign: 'top', class: v.registerForm },
  475. {
  476. default: () => [
  477. e(
  478. F,
  479. {
  480. clearable: !0,
  481. label: '联系方式(直接监护人)',
  482. placeholder: '请输入手机号码',
  483. type: 'tel',
  484. autocomplete: 'off',
  485. modelValue: d.username,
  486. 'onUpdate:modelValue': l => (d.username = l),
  487. maxlength: 11
  488. },
  489. {
  490. label: () =>
  491. e('div', null, [
  492. i('联系方式(直接监护人)'),
  493. e('p', { class: v.tips }, [
  494. i('手机号是数字化器乐课堂的唯一登录账户')
  495. ])
  496. ])
  497. }
  498. ),
  499. e(
  500. F,
  501. {
  502. center: !0,
  503. clearable: !0,
  504. label: '验证码',
  505. placeholder: '请输入验证码',
  506. autocomplete: 'off',
  507. type: 'number',
  508. modelValue: d.password,
  509. 'onUpdate:modelValue': l => (d.password = l),
  510. maxlength: 6
  511. },
  512. {
  513. button: () =>
  514. u.countDownStatus
  515. ? e('span', { class: v.codeText, onClick: h }, [
  516. i('获取验证码')
  517. ])
  518. : e(
  519. _e,
  520. {
  521. ref: l => (r.value = l),
  522. 'auto-start': !1,
  523. time: u.countDownTime,
  524. onFinish: y,
  525. format: 'ss秒'
  526. },
  527. null
  528. )
  529. }
  530. ),
  531. e(
  532. F,
  533. {
  534. clearable: !0,
  535. label: '学生姓名',
  536. placeholder: '请输入学生姓名',
  537. autocomplete: 'off',
  538. modelValue: d.extra.nickname,
  539. 'onUpdate:modelValue': l => (d.extra.nickname = l)
  540. },
  541. null
  542. ),
  543. e(
  544. F,
  545. {
  546. clearable: !0,
  547. label: '所在年级',
  548. placeholder: '请选择年级',
  549. isLink: !0,
  550. readonly: !0,
  551. clickable: !1,
  552. modelValue: u.gradeNumText,
  553. onClick: () => (u.gradeStatus = !0)
  554. },
  555. null
  556. ),
  557. e(
  558. F,
  559. {
  560. clearable: !0,
  561. label: '所在班级',
  562. placeholder: '请选择班级',
  563. isLink: !0,
  564. readonly: !0,
  565. clickable: !1,
  566. modelValue: u.currentClassText,
  567. onClick: () => (u.classStatus = !0)
  568. },
  569. null
  570. )
  571. ]
  572. }
  573. ),
  574. e(
  575. de,
  576. {
  577. center: !0,
  578. modelValue: u.modelValue,
  579. 'onUpdate:modelValue': l => (u.modelValue = l),
  580. prototcolType: 'REGISTER'
  581. },
  582. null
  583. ),
  584. e(
  585. B,
  586. {
  587. type: 'primary',
  588. class: v.submitBtn,
  589. color: 'linear-gradient(121deg, #FFD892 0%, #FFCB75 100%)',
  590. block: !0,
  591. onClick: o,
  592. disabled: u.loading,
  593. loading: u.loading
  594. },
  595. { default: () => [i('确认')] }
  596. ),
  597. u.imgCodeStatus
  598. ? e(
  599. it,
  600. {
  601. value: u.imgCodeStatus,
  602. 'onUpdate:value': l => (u.imgCodeStatus = l),
  603. phone: d.username,
  604. onClose: () => {
  605. u.imgCodeStatus = !1;
  606. },
  607. onSendCode: f
  608. },
  609. null
  610. )
  611. : null,
  612. e(
  613. b,
  614. {
  615. show: u.gradeStatus,
  616. 'onUpdate:show': l => (u.gradeStatus = l),
  617. position: 'bottom',
  618. round: !0,
  619. safeAreaInsetBottom: !0,
  620. lazyRender: !1,
  621. class: 'popupBottomSearch'
  622. },
  623. {
  624. default: () => [
  625. e(
  626. V,
  627. {
  628. showToolbar: !0,
  629. columns: a.value,
  630. onCancel: () => (u.gradeStatus = !1),
  631. onConfirm: l => {
  632. const p = l.selectedOptions[0];
  633. (d.extra.currentGradeNum = p.value),
  634. (u.gradeNumText = p.text),
  635. (u.gradeStatus = !1);
  636. }
  637. },
  638. null
  639. )
  640. ]
  641. }
  642. ),
  643. e(
  644. b,
  645. {
  646. show: u.classStatus,
  647. 'onUpdate:show': l => (u.classStatus = l),
  648. position: 'bottom',
  649. round: !0,
  650. class: 'popupBottomSearch'
  651. },
  652. {
  653. default: () => [
  654. e(
  655. V,
  656. {
  657. showToolbar: !0,
  658. columns: H,
  659. onCancel: () => (u.classStatus = !1),
  660. onConfirm: l => {
  661. const p = l.selectedOptions[0];
  662. (d.extra.currentClass = p.value),
  663. (u.currentClassText = p.text),
  664. (u.classStatus = !1);
  665. }
  666. },
  667. null
  668. )
  669. ]
  670. }
  671. )
  672. ]);
  673. }
  674. }),
  675. J = t => {
  676. if (t === null) return null;
  677. const n = Object.assign({}, t);
  678. return (
  679. Object.keys(n).forEach(
  680. r => (n[r] = typeof t[r] == 'object' ? J(t[r]) : t[r])
  681. ),
  682. Array.isArray(t) ? ((n.length = t.length), Array.from(n)) : n
  683. );
  684. },
  685. ct = '_wxPopupDialog_1sfd3_1',
  686. pt = '_popupContainer_1sfd3_16',
  687. mt = '_title1_1sfd3_22',
  688. gt = '_popupTips_1sfd3_29',
  689. D = { wxPopupDialog: ct, popupContainer: pt, title1: mt, popupTips: gt },
  690. ft = w({
  691. name: 'm-wx-tip',
  692. props: {
  693. show: { type: Boolean, default: !0 },
  694. title: { type: String, default: '温馨提示' },
  695. message: { type: String, default: '请使用微信打开' }
  696. },
  697. setup(t) {
  698. const n = U(!1);
  699. return (
  700. M(() => {
  701. if (!oe().weixin && t.show) {
  702. n.value = !0;
  703. return;
  704. }
  705. }),
  706. () =>
  707. e(q, null, [
  708. e(
  709. b,
  710. {
  711. show: n.value,
  712. 'onUpdate:show': r => (n.value = r),
  713. round: !0,
  714. style: { width: '88%' },
  715. closeOnClickOverlay: !1,
  716. class: D.wxPopupDialog
  717. },
  718. {
  719. default: () => [
  720. e('div', { class: D.popupContainer }, [
  721. e('p', { class: D.title1 }, [t.title]),
  722. e('p', { class: D.popupTips }, [t.message])
  723. ])
  724. ]
  725. }
  726. )
  727. ])
  728. );
  729. }
  730. }),
  731. It = w({
  732. name: 'student-register',
  733. setup() {
  734. const t = se(),
  735. n = Y(),
  736. r = ae();
  737. n.setShoolId(t.query.sId);
  738. const a = x({
  739. schoolId: t.query.sId,
  740. popupShow: !1,
  741. popupRegister: !1,
  742. details: [],
  743. schoolType: '',
  744. gradeYear: '',
  745. bugGoods: !1,
  746. submitLoading: !1,
  747. dialogStatus: !1,
  748. dialogMessage: '',
  749. dialogConfig: {},
  750. code: ''
  751. }),
  752. u = async () => {
  753. try {
  754. const { data: o } = await C.get('/edu-app/userPaymentOrder/unpaid');
  755. o.id &&
  756. ((a.dialogMessage = '您有待支付的订单,是否继续支付'),
  757. (a.dialogStatus = !0),
  758. (a.dialogConfig = o));
  759. } catch (o) {}
  760. },
  761. d = async () => {
  762. try {
  763. const { data: o } = await C.get(
  764. '/edu-app/open/userOrder/registerGoods/' + a.schoolId,
  765. { noAuthorization: !0 }
  766. );
  767. n.setVip(o.details || []),
  768. (a.details = J(o.details || [])),
  769. (a.bugGoods = o.bugGoods),
  770. (a.schoolType = o.schoolType),
  771. (a.gradeYear = o.gradeYear),
  772. console.log(n.getGoods);
  773. } catch (o) {}
  774. },
  775. f = N(() => {
  776. let o = 0,
  777. m = 0;
  778. return (
  779. n.getVip.forEach(c => {
  780. (o += Number(c.currentPrice)), (m += Number(c.originalPrice));
  781. }),
  782. n.getGoods.forEach(c => {
  783. (o += Number(c.price) * c.quantity),
  784. (m += Number(c.originalPrice) * c.quantity);
  785. }),
  786. { amount: o, originAmount: m }
  787. );
  788. }),
  789. h = o => {
  790. ne({ message: '是否删除该商品', confirmButtonColor: '#FF8633' }).then(
  791. () => {
  792. n.deleteGoods(o.goodsId);
  793. }
  794. );
  795. },
  796. y = async () => {
  797. try {
  798. if (((a.submitLoading = !0), await u(), a.dialogStatus)) {
  799. a.submitLoading = !1;
  800. return;
  801. }
  802. const o = await C.get(
  803. '/edu-app/userPaymentOrder/registerStatus/' + a.schoolId
  804. ),
  805. m = n.getVip,
  806. l = n.getGoods;
  807. if (o.data.hasBuyCourse && m.length > 0) {
  808. setTimeout(() => {
  809. _('您已购买数字化器乐学练工具,请勿重复购买');
  810. }, 100);
  811. return;
  812. }
  813. if (m.length <= 0 && l.length <= 0) {
  814. setTimeout(() => {
  815. _('请选择需要购买的商品');
  816. }, 100);
  817. return;
  818. }
  819. const p = [];
  820. m.forEach(g => {
  821. p.push({
  822. goodsId: g.goodsId,
  823. goodsNum: 1,
  824. goodsType: g.goodsType,
  825. paymentCashAmount: g.currentPrice,
  826. paymentCouponAmount: 0
  827. });
  828. }),
  829. l.forEach(g => {
  830. p.push({
  831. goodsId: g.productId,
  832. goodsNum: g.quantity,
  833. goodsType: 'INSTRUMENTS',
  834. paymentCashAmount: g.price,
  835. paymentCouponAmount: 0,
  836. goodsSkuId: g.productSkuId
  837. });
  838. });
  839. const { data: c } = await C.post(
  840. '/edu-app/userPaymentOrder/executeOrder',
  841. {
  842. hideLoading: !1,
  843. data: {
  844. paymentType: 'adapay',
  845. bizId: a.schoolId,
  846. orderType: 'SCHOOL_REGISTER',
  847. paymentCashAmount: f.value.amount || 0,
  848. paymentCouponAmount: 0,
  849. goodsInfos: p,
  850. orderName: '学生登记',
  851. orderDesc: '学生登记'
  852. }
  853. }
  854. );
  855. r.push({
  856. path: '/order-detail',
  857. query: {
  858. pm: 1,
  859. config: JSON.stringify({
  860. ...c.paymentConfig,
  861. paymentType: c.paymentType
  862. }),
  863. orderNo: c.orderNo
  864. }
  865. });
  866. } finally {
  867. a.submitLoading = !1;
  868. }
  869. };
  870. return (
  871. M(() => {
  872. d();
  873. }),
  874. () =>
  875. e('div', { class: s['student-register'] }, [
  876. e(
  877. 'div',
  878. { class: s.studentSection, style: { marginTop: '18px' } },
  879. [
  880. e('div', { class: s.titleTool }, null),
  881. a.details.map(o =>
  882. e(
  883. L,
  884. {
  885. class: s.goodsSection,
  886. onClick: () => {
  887. n.selectedVip(o.goodsId)
  888. ? n.deleteVip(o.goodsId)
  889. : n.setVip([o]);
  890. }
  891. },
  892. {
  893. default: () => [
  894. e(
  895. T,
  896. { border: !1, class: s.goodsCell },
  897. {
  898. icon: () =>
  899. e(P, { class: s.img, src: o.goodsUrl }, null),
  900. title: () =>
  901. e('div', { class: s.section }, [
  902. e('div', { class: s.sectionContent }, [
  903. e('h2', null, [
  904. o.goodsName,
  905. e(
  906. O,
  907. { class: s.brandName },
  908. { default: () => [i('12个月')] }
  909. )
  910. ]),
  911. e('p', { class: [s.model] }, [o.description]),
  912. e('div', { class: s.sbtnGroup }, [
  913. e(
  914. 'span',
  915. {
  916. class: s.btnDetail,
  917. onClick: m => {
  918. m.stopPropagation(),
  919. r.push('/student-digital-tools');
  920. }
  921. },
  922. [i('查看详情')]
  923. ),
  924. e(
  925. 'span',
  926. {
  927. class: s.btnVideo,
  928. onClick: m => {
  929. m.stopPropagation(),
  930. (a.popupShow = !0);
  931. }
  932. },
  933. [i('介绍视频')]
  934. )
  935. ])
  936. ]),
  937. e(
  938. 'i',
  939. {
  940. class: n.selectedVip(o.goodsId)
  941. ? s.selected
  942. : s.noSelected
  943. },
  944. null
  945. )
  946. ])
  947. }
  948. ),
  949. e(
  950. T,
  951. { border: !1, class: s.priceCell },
  952. {
  953. title: () =>
  954. e('div', { class: s.sPriceGroup }, [
  955. e('div', { class: s.tg }, [
  956. i('团购价:'),
  957. e('span', null, [
  958. e('i', null, [i('¥ ')]),
  959. S(o.currentPrice)
  960. ])
  961. ]),
  962. e('del', null, [i('¥'), S(o.originalPrice)])
  963. ])
  964. }
  965. ),
  966. e(
  967. T,
  968. { border: !1, class: s.giftCell },
  969. {
  970. title: () =>
  971. e('div', { class: s.gift }, [
  972. e('img', { src: We, class: s.iconGift }, null),
  973. i('现在购买赠送 '),
  974. e('span', null, [o.membershipDays || 0]),
  975. i('天有效期')
  976. ])
  977. }
  978. )
  979. ]
  980. }
  981. )
  982. )
  983. ]
  984. ),
  985. a.bugGoods &&
  986. e(q, null, [
  987. e('div', { class: s.studentSection }, [
  988. e('div', { class: s.titleBuy }, null),
  989. n.getGoods && n.getGoods.length <= 0
  990. ? e('div', { class: s.goodsEmpty }, [
  991. e('img', { src: Ze, class: s.shopImg }, null),
  992. e('div', { class: s.goodsContainer }, [
  993. e('h2', null, [
  994. i('为你的'),
  995. e('span', null, [i('音乐之旅')]),
  996. i('做好准备')
  997. ]),
  998. e('p', { class: s.tips }, [i('快去选购乐器吧~')]),
  999. e(
  1000. B,
  1001. {
  1002. class: s.goSelect,
  1003. type: 'primary',
  1004. onClick: () => {
  1005. r.push('/goods-list');
  1006. }
  1007. },
  1008. {
  1009. default: () => [
  1010. i('进入商城选购'),
  1011. e(G, { name: 'arrow' }, null)
  1012. ]
  1013. }
  1014. )
  1015. ])
  1016. ])
  1017. : n.getGoods.map(o =>
  1018. e(
  1019. L,
  1020. { class: s.goodsSection },
  1021. {
  1022. default: () => [
  1023. e(
  1024. T,
  1025. { border: !1, class: s.goodsCell },
  1026. {
  1027. icon: () =>
  1028. e(P, { class: s.img, src: o.pic }, null),
  1029. title: () =>
  1030. e('div', { class: s.section }, [
  1031. e('div', { class: s.sectionContent }, [
  1032. e('h2', null, [
  1033. o.name,
  1034. e(
  1035. O,
  1036. { class: s.brandName },
  1037. { default: () => [o.brandName] }
  1038. )
  1039. ]),
  1040. e('p', { class: [s.model] }, [
  1041. i('规格:'),
  1042. o.spDataJson
  1043. ]),
  1044. e('p', { class: [s.model] }, [
  1045. o.productSn
  1046. ]),
  1047. e(
  1048. re,
  1049. {
  1050. min: 1,
  1051. max: 99,
  1052. modelValue: o.quantity,
  1053. 'onUpdate:modelValue': m =>
  1054. (o.quantity = m)
  1055. },
  1056. null
  1057. )
  1058. ]),
  1059. e(
  1060. 'i',
  1061. {
  1062. class: s.delete,
  1063. onClick: () => h(o)
  1064. },
  1065. null
  1066. )
  1067. ])
  1068. }
  1069. ),
  1070. e(
  1071. T,
  1072. { border: !1, class: s.priceCell },
  1073. {
  1074. title: () =>
  1075. e('div', { class: s.sPriceGroup }, [
  1076. e('div', { class: s.tg }, [
  1077. i('团购价:'),
  1078. e('span', null, [
  1079. e('i', null, [i('¥ ')]),
  1080. S(o.price)
  1081. ])
  1082. ]),
  1083. e('del', null, [
  1084. i('¥'),
  1085. S(o.originalPrice)
  1086. ])
  1087. ])
  1088. }
  1089. )
  1090. ]
  1091. }
  1092. )
  1093. )
  1094. ]),
  1095. n.getGoods &&
  1096. n.getGoods.length > 0 &&
  1097. e(
  1098. B,
  1099. {
  1100. class: s.addButton,
  1101. block: !0,
  1102. onClick: () => {
  1103. r.push('/goods-list');
  1104. }
  1105. },
  1106. {
  1107. default: () => [
  1108. e(G, { name: 'add-o' }, null),
  1109. i('进入商城选购')
  1110. ]
  1111. }
  1112. )
  1113. ]),
  1114. e(
  1115. ue,
  1116. { position: 'bottom' },
  1117. {
  1118. default: () => [
  1119. e('div', { class: s.paymentContainer }, [
  1120. e('div', { class: s.payemntPrice }, [
  1121. e('span', { class: s.needPrice }, [
  1122. e('i', { style: 'font-style: normal' }, [i('¥ ')]),
  1123. e('span', null, [S(f.value.amount)])
  1124. ]),
  1125. e('del', { class: s.allPrice }, [
  1126. i('¥ '),
  1127. S(f.value.originAmount)
  1128. ])
  1129. ]),
  1130. e(
  1131. 'div',
  1132. {
  1133. class: s.paymentBtn,
  1134. onClick: () => {
  1135. n.getToken ? y() : (a.popupRegister = !0);
  1136. }
  1137. },
  1138. [
  1139. e(
  1140. B,
  1141. {
  1142. disabled: a.submitLoading,
  1143. loading: a.submitLoading
  1144. },
  1145. { default: () => [i('确认购买')] }
  1146. )
  1147. ]
  1148. )
  1149. ])
  1150. ]
  1151. }
  1152. ),
  1153. e(
  1154. b,
  1155. {
  1156. show: a.popupShow,
  1157. 'onUpdate:show': o => (a.popupShow = o),
  1158. class: s.videoPopup
  1159. },
  1160. {
  1161. default: () => [
  1162. a.popupShow &&
  1163. e(
  1164. le,
  1165. {
  1166. src: 'https://daya.ks3-cn-beijing.ksyun.com/202105/SWmqmvW.mp4'
  1167. },
  1168. null
  1169. )
  1170. ]
  1171. }
  1172. ),
  1173. e(
  1174. b,
  1175. {
  1176. show: a.popupRegister,
  1177. 'onUpdate:show': o => (a.popupRegister = o),
  1178. class: s.registerPopup,
  1179. position: 'bottom',
  1180. round: !0
  1181. },
  1182. {
  1183. default: () => [
  1184. e(
  1185. rt,
  1186. {
  1187. schoolId: a.schoolId,
  1188. schoolType: a.schoolType,
  1189. gradeYear: a.gradeYear,
  1190. onClose: () => (a.popupRegister = !1),
  1191. onSubmit: y
  1192. },
  1193. null
  1194. )
  1195. ]
  1196. }
  1197. ),
  1198. e(
  1199. ce,
  1200. {
  1201. title: '提示',
  1202. show: a.dialogStatus,
  1203. 'onUpdate:show': o => (a.dialogStatus = o),
  1204. message: a.dialogMessage,
  1205. confirmButtonText: '继续支付',
  1206. cancelButtonText: '取消订单',
  1207. showCancelButton: !0,
  1208. onConfirm: () => {
  1209. const o = a.dialogConfig.paymentConfig;
  1210. r.push({
  1211. path: '/order-detail',
  1212. query: {
  1213. pm: 1,
  1214. config: JSON.stringify(o.paymentConfig),
  1215. orderNo: o.orderNo
  1216. }
  1217. });
  1218. },
  1219. onCancel: async () => {
  1220. try {
  1221. await C.post(
  1222. '/edu-app/userPaymentOrder/cancelPayment/' +
  1223. a.dialogConfig.orderNo
  1224. );
  1225. } catch (o) {}
  1226. }
  1227. },
  1228. null
  1229. ),
  1230. e(ft, null, null)
  1231. ])
  1232. );
  1233. }
  1234. });
  1235. export { It as default };
  1236. >>>>>>> iteration-create