1 |
- import{d as V,r as N,x as j,e as W,y as Y,a as e,A as l,C as x,V as F,z as U,N as P,E as C,D as y,b3 as J,U as H,q as X,af as Z,I as B,P as D,F as K,R as Q,Q as $,G as L,J as G}from"./index-5e5e4ebc.js";import{i as ee}from"./icon-gift-94736468.js";import{M as te}from"./index-9096eaf6.js";import{M as oe}from"./index-821fe5bf.js";import{M as se}from"./index-74781a0d.js";import{u as q}from"./student-register-store-64ec444b.js";import{F as ae}from"./index-d76a3626.js";import{R as ne,a as M}from"./index-cb21536d.js";import{T as k}from"./index-cc5b42dd.js";import{C as re,O as ue}from"./index-54551fae.js";import{P as R}from"./index-06479965.js";import{F as w}from"./index-f6b73f03.js";import{d as le}from"./deep-clone-c0d00fc2.js";import{O as ie}from"./index-d3a70a7f.js";import{C as z}from"./index-9827a1cb.js";import{C as b}from"./index-4bcfa431.js";import{S as ce}from"./index-8338d355.js";import{I as O}from"./index-fa23aaeb.js";import"./index-572087e5.js";/* empty css */import"./index-0e2c1963.js";import"./Checker-d0f399df.js";const de="_studentSection_1jl6o_7",pe="_goodsSection_1jl6o_25",me="_titleTool_1jl6o_36",ge="_titleBuy_1jl6o_45",fe="_goodsCell_1jl6o_52",he="_noSelected_1jl6o_57",ye="_selected_1jl6o_58",Ce="_img_1jl6o_78",Te="_brandName_1jl6o_93",Se="_iconDateMember_1jl6o_104",De="_model_1jl6o_108",we="_more_1jl6o_118",be="_moreBtn_1jl6o_122",ve="_sbtnGroup_1jl6o_129",Ae="_btnDetail_1jl6o_141",xe="_btnVideo_1jl6o_142",Fe="_priceCell_1jl6o_182",_e="_sPriceGroup_1jl6o_185",Ee="_tg_1jl6o_193",Pe="_giftCell_1jl6o_217",Be="_gift_1jl6o_217",je="_iconGift_1jl6o_235",ke="_goodsEmpty_1jl6o_240",Ie="_shopImg_1jl6o_248",Ne="_goodsContainer_1jl6o_252",Le="_tips_1jl6o_262",Ge="_goSelect_1jl6o_267",Me="_addButton_1jl6o_286",Re="_paymentContainer_1jl6o_306",ze="_needPrice_1jl6o_316",Oe="_allPrice_1jl6o_329",Ve="_videoPopup_1jl6o_349",s={"student-register":"_student-register_1jl6o_1",studentSection:de,goodsSection:pe,titleTool:me,titleBuy:ge,goodsCell:fe,noSelected:he,selected:ye,delete:"_delete_1jl6o_59",img:Ce,brandName:Te,iconDateMember:Se,model:De,more:we,moreBtn:be,sbtnGroup:ve,btnDetail:Ae,btnVideo:xe,priceCell:Fe,sPriceGroup:_e,tg:Ee,giftCell:Pe,gift:Be,iconGift:je,goodsEmpty:ke,shopImg:Ie,goodsContainer:Ne,tips:Le,goSelect:Ge,addButton:Me,paymentContainer:Re,needPrice:ze,allPrice:Oe,videoPopup:Ve},We=""+new URL("shop-empty-6c02d334.png",import.meta.url).href,Ye="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANgAAAAoCAMAAACrbMTGAAAC+lBMVEX/exv/gCT/1n7/uF3/t13/p0v/03v/uF//1X3/umD/hyf/03z/wGb/w2r/vGL/vmT/x27/v2X/q1H/0nn/u2IAAAD/yG//0Hf/wWj/14D/xGv/z3f/ynD/rlT/zXT/13//xm3/wmj/vmT/y3P/0nr/03v/xWz/u2L/znT/iCn/0Hn/xW7/1Hz/y3H/wmr/znb/xm3/ul//1n//wGb/zXXCNALEOQX/0nv/0Xj/w2vDNgP/x2//y3P/u2HDNwPwqlv/y3TCMwHWZSf/ynL/y3P/1H3abSv/yG/QVhvPUhf/0HjEOgbJRA7GPgn/vWT/mTPFOQXVYiP/xWzDNgPENwPSXiHNTBLqkETefDfjgzv2u2jaaij5r1n/umDMTRPtmkzyplXKRxDGPgnnkknmjEPokEXifjjXZCPUWhvHQArXair9y3TNTxT8yXPLSBDkiED6vWffdzLlhTzxmkrFOwbbbizun1Lpk0f/znXTWRvVXiDifDTbaSfqij/9t1//ehz/exv/exv/eh//eyHMThXOURj/oETOTxbcdjLSWh7qmk7uo1X9yXPolErJRAzLSRDvpFb/ljjLSA/+x2//kzXvoVL+xW3XZSXecy7um0zheDH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G8Nm1f1EuzwDXPpTxlvC2JuBi1YekpUPspCFmnmIuBwiEPqmFz709ydG+gF/Tqmk6lnCLhgJhUdEZGeKSOF9kCgsptlgY7bkCFGi7thb986BN4axZiswNtUjSUAgCxqbGiTOfIvg2fi3kxWlshL+3tyjUaK5GTcOciqLDqnMou0YYCzAAwh7SDLV+KCHNh3eUd+VrnunYexd1mkFcz7WDjCWElF5h4gSzpUd0pyjYbw6VQ7AQw/XeuDxu7OC7KizgGdwbhYtzuOZdc5iOZ2jRIqTt3pGGh+EiVZS6KpAL0nXPTr7Thhb8bZ6W7G8xv4UPSIGGozpcVLFqCHkDxLxIWJfra38mlAKOXRFvF4vzuFNPDTujccrCMKt9XO9DMcW2Ji4tI6k2YcAtaeNetyYlvVyvBIP49HynhU2dgfGmqywsa6upq6mzUihECSKc/IAStIOOTzkMJwSrYgOm5aIgh/5DMcQTHQhwww2mWAgz/w39l421pCL45qUPBSIUQ7kGcbu4Ndvq5WWem60RImWeb+RIyYt8pukJJHkPBqGcqI3qVCypSUapKjeFA8OaqTmWm7MEJNEvwQ6LHNnzPivfbgv2pDPFWhIxqgDnKW+svqMf2FarDqsLIVCyyLS0umhZM5IR2cc9x33sRz5QtIhWZ4wP8GMwzER5WBC0yCwIvX/y1I4vNSoz6fN6TOapk0s52vnavEFjL3cXs2dN7h9/jYWR3b+1nOy9LnV7Zf6lxKljd9nTxG/N0rP74ivkYob+XOnhvxG8cwr+cVfqe1X/jK4evkqFgIRA8sZ6/j8ydDnf7WVznw1v6rdLhUvtF04CqTbsI7P886cDH2xtP381en/cv00/jnEH9aeodnklrpXAAAAAElFTkSuQmCC",qe="_registerModal_1koh8_1",Ue="_infoTitle_1koh8_7",Je="_registerForm_1koh8_13",He="_tips_1koh8_20",Xe="_codeText_1koh8_42",Ze="_codeTextDisabled_1koh8_47",Ke="_submitBtn_1koh8_50",Qe="_radioSection_1koh8_60",$e="_radioItem_1koh8_67",g={registerModal:qe,infoTitle:Ue,registerForm:Je,tips:He,codeText:Xe,codeTextDisabled:Ze,submitBtn:Ke,radioSection:Qe,radioItem:$e},et=""+new URL("info-title-1f45c1de.png",import.meta.url).href,tt=q(),I=[];for(let p=1;p<=40;p++)I.push({text:p+"班",value:p});const ot=V({name:"register-modal",props:{schoolId:{type:String,default:""},gradeYear:{type:String,default:""},schoolType:{type:String,default:""},giftVipDay:{type:[String,Number],default:""},registerType:{type:String,default:""}},emits:["close","submit","error"],setup(p,{emit:u}){const T=sessionStorage.getItem("register-student"),t=N(),f=N([]),n=j({countDownStatus:!0,countDownTime:1e3*120,modelValue:!1,imgCodeStatus:!1,gradeNumText:"",currentClassText:"",gradeStatus:!1,classStatus:!1,loading:!1}),r=j({autoRegister:!0,client_id:"cooleshow-student",client_secret:"cooleshow-student",extra:{nickname:"",currentGradeNum:"",currentClass:"",gender:1,registerType:p.registerType,giftVipDay:p.giftVipDay||0},grant_type:"password",loginType:"SMS",password:"",username:""}),S=()=>{n.countDownStatus=!1,U(()=>{t.value.start()})},_=()=>{if(!P(r.username))return C("请输入正确的手机号码");n.imgCodeStatus=!0},v=W(()=>!!P(r.username)),o=()=>{n.countDownStatus=!0,t.value.reset()},c=async()=>{try{if(E())return;n.loading=!0;const{extra:a,...i}=r,d=await y.post("/edu-app/userlogin",{hideLoading:!1,requestType:"form",data:{...i,extra:JSON.stringify({...a,schoolId:p.schoolId})}});d.code!==200?(sessionStorage.setItem("register-student",JSON.stringify({...i,extra:JSON.stringify({...a,schoolId:p.schoolId})})),u("close"),u("error",{code:d.code,message:d.message})):(console.log(111),tt.setToken(d.data.token_type+" "+d.data.access_token),J(),u("close"),u("submit"))}catch(a){}finally{n.loading=!1}},E=()=>{if(r.extra.nickname)if(r.extra.currentGradeNum)if(r.extra.currentClass)if(P(r.username)){if(!r.password)return C("请输入验证码"),!0}else return C("请输入正确的手机号码"),!0;else return C("请选择所在班级"),!0;else return C("请选择所在年级"),!0;else return C("请输入学生姓名"),!0;return!1},A=()=>{let a=[];const i=[{text:"一年级",value:1},{text:"二年级",value:2},{text:"三年级",value:3},{text:"四年级",value:4},{text:"五年级",value:5}],d=[{text:"六年级",value:6}],m=[{text:"七年级",value:7},{text:"八年级",value:8},{text:"九年级",value:9}];return p.gradeYear==="FIVE_YEAR_SYSTEM"?a.push([...i]):p.gradeYear==="SIX_YEAR_SYSTEM"?a.push([...i,...d]):p.gradeYear==="THREE_YEAR_SYSTEM"?a.push([...m]):p.gradeYear==="FORE_YEAR_SYSTEM"?a.push([...d,...m]):a.push([...i,...d,...m]),a};return Y(()=>{if(f.value=A(),T){const a=JSON.parse(T),i=a.extra?JSON.parse(a.extra):{};r.extra.nickname=i.nickname,r.extra.currentGradeNum=i.currentGradeNum,r.extra.currentClass=i.currentClass,r.extra.gender=i.gender,r.username=a.username,I.forEach(m=>{m.value===i.currentClass&&(n.currentClassText=m.text)});const d=f.value[0]||[];d==null||d.forEach(m=>{m.value===i.currentGradeNum&&(n.gradeNumText=m.text)}),sessionStorage.removeItem("register-student")}}),()=>e("div",{class:g.registerModal},[e("img",{src:et,class:g.infoTitle},null),e(ae,{labelAlign:"top",class:g.registerForm},{default:()=>[e(w,{clearable:!0,label:"学生姓名",placeholder:"请输入学生姓名",autocomplete:"off",maxlength:14,modelValue:r.extra.nickname,"onUpdate:modelValue":a=>r.extra.nickname=a},null),e(w,{clearable:!0,label:"学生性别",placeholder:"请选择性别",autocomplete:"off"},{input:()=>e(ne,{"checked-color":"#ffcb75",modelValue:r.extra.gender,"onUpdate:modelValue":a=>r.extra.gender=a,direction:"horizontal"},{default:()=>[e(k,{size:"large",type:"primary",color:r.extra.gender!==1?"#EAEAEA":"#ffcb75",textColor:r.extra.gender!==1?"#AAA":"#5B2C03",class:g.radioSection,round:!0},{default:()=>[e(M,{class:g.radioItem,name:1},null),l("男")]}),e(k,{size:"large",type:"primary",color:r.extra.gender!==0?"#EAEAEA":"#ffcb75",textColor:r.extra.gender!==0?"#AAA":"#5B2C03",class:g.radioSection,round:!0},{default:()=>[e(M,{class:g.radioItem,name:0},null),l("女")]})]})}),e(w,{clearable:!0,label:"所在年级",placeholder:"请选择年级",isLink:!0,readonly:!0,clickable:!1,modelValue:n.gradeNumText,onClick:()=>n.gradeStatus=!0},null),e(w,{clearable:!0,label:"所在班级",placeholder:"请选择班级",isLink:!0,readonly:!0,clickable:!1,modelValue:n.currentClassText,onClick:()=>n.classStatus=!0},null),e(w,{clearable:!0,label:"联系方式(直接监护人)",placeholder:"请输入手机号码",type:"tel",autocomplete:"off",modelValue:r.username,"onUpdate:modelValue":a=>r.username=a,maxlength:11},{label:()=>e("div",null,[l("联系方式"),e("p",{class:g.tips},[l("手机号是音乐数字课堂的唯一登录账户")])])}),e(w,{center:!0,clearable:!0,label:"验证码",placeholder:"请输入验证码",autocomplete:"off",type:"number",modelValue:r.password,"onUpdate:modelValue":a=>r.password=a,maxlength:6},{button:()=>n.countDownStatus?e("span",{class:[g.codeText,v.value?"":g.codeTextDisabled],onClick:_},[l("获取验证码")]):e(re,{ref:a=>t.value=a,"auto-start":!1,time:n.countDownTime,onFinish:o,format:"ss秒"},null)})]}),e(x,{type:"primary",class:g.submitBtn,color:"linear-gradient(121deg, #FFD892 0%, #FFCB75 100%)",block:!0,onClick:c,disabled:n.loading,loading:n.loading},{default:()=>[l("确认")]}),n.imgCodeStatus?e(se,{value:n.imgCodeStatus,"onUpdate:value":a=>n.imgCodeStatus=a,phone:r.username,onClose:()=>{n.imgCodeStatus=!1},onSendCode:S},null):null,e(F,{show:n.gradeStatus,"onUpdate:show":a=>n.gradeStatus=a,position:"bottom",round:!0,safeAreaInsetBottom:!0,lazyRender:!1,class:"popupBottomSearch"},{default:()=>[e(R,{showToolbar:!0,columns:f.value,onCancel:()=>n.gradeStatus=!1,onConfirm:a=>{const i=a.selectedOptions[0];r.extra.currentGradeNum=i.value,n.gradeNumText=i.text,n.gradeStatus=!1}},null)]}),e(F,{show:n.classStatus,"onUpdate:show":a=>n.classStatus=a,position:"bottom",round:!0,class:"popupBottomSearch"},{default:()=>[e(R,{showToolbar:!0,columns:I,onCancel:()=>n.classStatus=!1,onConfirm:a=>{const i=a.selectedOptions[0];r.extra.currentClass=i.value,n.currentClassText=i.text,n.classStatus=!1}},null)]})])}}),At=V({name:"student-register",setup(){const p=H(),u=q(),T=X();u.setShoolId(p.query.sId);const t=j({schoolId:p.query.sId,paymentType:"",popupShow:!1,popupRegister:!1,details:[],schoolType:"",gradeYear:"",bugGoods:!1,registerType:"",giftVipDay:0,submitLoading:!1,dialogStatus:!1,dialogMessage:"",countDownTime:60*1e3,dialogConfig:{},showMore:!0,showTips:!1,showButton:!1,showMessage:"请使用微信打开"}),f=Z({time:t.countDownTime,onChange(o){t.dialogMessage=`有待支付订单,请在${Math.ceil(o.total/1e3)}s后重试`},onFinish(){t.dialogStatus=!1}}),n=async()=>{let o=!1;try{const{data:c}=await y.get("/edu-app/userPaymentOrder/unpaid");if(!c.id)return!1;if(c.cancelPayment)return await y.post("/edu-app/userPaymentOrder/cancelPayment/"+c.orderNo),!1;t.countDownTime=c.cancelTimes,f.reset(Number(c.cancelTimes)),f.start(),t.dialogMessage=`有待支付订单,请在${Math.ceil(f.current.value.total/1e3)}s后重试`,t.dialogStatus=!0,t.dialogConfig=c,o=!0}catch(c){}return o},r=async()=>{try{const{data:o}=await y.get("/edu-app/open/userOrder/registerGoods/"+t.schoolId,{noAuthorization:!0});u.setVip(o.details||[]),t.details=le(o.details||[]),t.details.length>0&&(t.giftVipDay=t.details[0].membershipDays),t.bugGoods=o.bugGoods,t.schoolType=o.schoolType,t.gradeYear=o.gradeYear,t.registerType=o.registerType,Q().weixin&&o.registerType!=="BUG_GOODS"&&(t.showTips=!0,t.showMessage="二维码已经失效,详情请咨询乐团老师",t.showButton=!1)}catch(o){}},S=W(()=>{let o=0,c=0;return u.getVip.forEach(a=>{o+=Number(a.currentPrice),c+=Number(a.originalPrice)}),u.getGoods.forEach(a=>{o+=Number(a.price)*a.quantity,c+=Number(a.originalPrice)*a.quantity}),{amount:o,originAmount:c}}),_=o=>{$({message:"是否删除该商品",confirmButtonColor:"#FF8633"}).then(()=>{u.deleteGoods(o.productSkuId)})},v=async()=>{try{t.submitLoading=!0;const o=L.get(G)||"";if(!(await y.post("/edu-app/open/user/verification",{noAuthorization:!0,data:{token:o}})).data){L.remove(G),u.deleteToken(),t.popupRegister=!0;return}if(await n())return;const A=await y.get("/edu-app/userPaymentOrder/registerStatus/"+t.schoolId),a=u.getVip,i=u.getGoods;if(A.data.hasBuyCourse&&a.length>0){setTimeout(()=>{C("您已购买乐器AI学练工具,请勿重复购买")},100);return}const d=[];a.forEach(h=>{d.push({giftVipDay:h.membershipDays,goodsId:h.goodsId,goodsNum:1,goodsType:h.goodsType,paymentCashAmount:h.currentPrice,paymentCouponAmount:0})}),i.forEach(h=>{d.push({goodsId:h.productId,goodsNum:h.quantity,goodsType:"INSTRUMENTS",paymentCashAmount:h.price,paymentCouponAmount:0,goodsSkuId:h.productSkuId})});const m=await y.post("/edu-app/userPaymentOrder/executeOrder",{hideLoading:!1,data:{registerType:t.registerType,paymentType:t.paymentType,bizId:t.schoolId,orderType:"SCHOOL_REGISTER",paymentCashAmount:S.value.amount||0,paymentCouponAmount:0,goodsInfos:d,orderName:"学生登记",orderDesc:"学生登记"}});m.code===5436?(t.showTips=!0,t.showMessage="二维码已经失效,详情请咨询乐团老师",t.showButton=!1,t.popupRegister=!1):m.code===5435?(t.showTips=!0,t.showMessage=m.message,t.showButton=!0,t.popupRegister=!1):T.push({path:"/order-detail",query:{pm:1,config:JSON.stringify({...m.data.paymentConfig,paymentType:m.data.paymentType}),orderNo:m.data.orderNo}})}finally{t.submitLoading=!1}};return Y(async()=>{try{const{data:o}=await y.get("/edu-app/open/paramConfig/queryByParamName",{requestType:"form",params:{paramName:"payment_service_provider"}});o.id&&(t.paymentType=o.paramValue||""),r()}catch(o){}}),()=>e("div",{class:s["student-register"]},[e("div",{class:s.studentSection,style:{marginTop:"18px"}},[e("div",{class:s.titleTool},null),t.details.map(o=>e(z,{class:s.goodsSection,onClick:()=>{u.selectedVip(o.goodsId)?u.deleteVip(o.goodsId):u.setVip([o])}},{default:()=>[e(b,{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,[e("img",{src:Ye,class:s.iconDateMember},null)]),e("p",{class:[s.model,t.showMore?s.more:""]},[o.description]),o.description&&o.description.length>=36&&t.showMore?e("span",{class:s.moreBtn,onClick:c=>{c.stopPropagation(),t.showMore=!1}},[l("查看更多"),e(B,{name:"arrow-down",color:"#aaa"},null)]):""]),e("i",{class:u.selectedVip(o.goodsId)?s.selected:s.noSelected},null)])}),e(b,{border:!1,class:s.priceCell},{title:()=>e("div",{class:s.sPriceGroup},[e("div",{class:s.tg},[l("团购价:"),e("span",null,[e("i",null,[l("¥ ")]),D(o.currentPrice)])]),o.currentPrice<o.originalPrice&&e("del",null,[l("¥"),D(o.originalPrice)])])}),o.membershipDays>0&&e(b,{border:!1,class:s.giftCell},{title:()=>e("div",{class:s.gift},[e("img",{src:ee,class:s.iconGift},null),l("现在购买赠送 "),e("span",null,[o.membershipDays||0]),l("天有效期")])})]}))]),t.bugGoods&&e(K,null,[e("div",{class:s.studentSection},[e("div",{class:s.titleBuy},null),u.getGoods&&u.getGoods.length<=0?e("div",{class:s.goodsEmpty},[e("img",{src:We,class:s.shopImg},null),e("div",{class:s.goodsContainer},[e("h2",null,[l("为你的"),e("span",null,[l("音乐之旅")]),l("做好准备")]),e("p",{class:s.tips},[l("快去选购乐器吧~")]),e(x,{class:s.goSelect,type:"primary",onClick:()=>{T.push("/goods-list")}},{default:()=>[l("进入商城选购"),e(B,{name:"arrow"},null)]})])]):u.getGoods.map(o=>e(z,{class:s.goodsSection},{default:()=>[e(b,{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]},[l("规格:"),o.spDataJson]),e("p",{class:[s.model]},[o.productSn]),e(ce,{min:1,max:99,modelValue:o.quantity,"onUpdate:modelValue":c=>o.quantity=c,disableInput:!0},null)]),e("i",{class:s.delete,onClick:()=>_(o)},null)])}),e(b,{border:!1,class:s.priceCell},{title:()=>e("div",{class:s.sPriceGroup},[e("div",{class:s.tg},[l("团购价:"),e("span",null,[e("i",null,[l("¥ ")]),D(o.price)])]),o.price<o.originalPrice&&e("del",null,[l("¥"),D(o.originalPrice)])])})]}))]),u.getGoods&&u.getGoods.length>0&&e(x,{class:s.addButton,block:!0,onClick:()=>{T.push("/goods-list")}},{default:()=>[e(B,{name:"add-o"},null),l("进入商城选购")]})]),e(te,{position:"bottom"},{default:()=>[e("div",{class:s.paymentContainer},[e("div",{class:s.payemntPrice},[e("span",{class:s.needPrice},[e("i",{style:"font-style: normal"},[l("¥ ")]),e("span",null,[D(S.value.amount)])]),S.value.originAmount>S.value.amount?e("del",{class:s.allPrice},[l("¥ "),D(S.value.originAmount)]):""]),e("div",{class:s.paymentBtn,onClick:()=>{const o=u.getVip,c=u.getGoods;if(o.length<=0&&c.length<=0){setTimeout(()=>{C("请选择需要购买的商品")},100);return}u.getToken?v():t.popupRegister=!0}},[e(x,{disabled:t.submitLoading,loading:t.submitLoading},{default:()=>[l("确认购买")]})])])]}),e(F,{show:t.popupShow,"onUpdate:show":o=>t.popupShow=o,class:s.videoPopup},{default:()=>[t.popupShow&&e(oe,{src:"https://daya.ks3-cn-beijing.ksyun.com/202105/SWmqmvW.mp4"},null)]}),e(F,{show:t.popupRegister,"onUpdate:show":o=>t.popupRegister=o,class:s.registerPopup,position:"bottom",round:!0},{default:()=>[e(ot,{schoolId:t.schoolId,schoolType:t.schoolType,gradeYear:t.gradeYear,registerType:t.registerType,giftVipDay:t.giftVipDay,onClose:()=>t.popupRegister=!1,onSubmit:v,onError:o=>{o.code===5436?(t.showTips=!0,t.showMessage="二维码已经失效,详情请咨询乐团老师",t.showButton=!1,t.popupRegister=!1):o.code===5435&&(t.showTips=!0,t.showMessage=o.message,t.showButton=!0,t.popupRegister=!1)}},null)]}),e(ie,{title:"提示",show:t.dialogStatus,"onUpdate:show":o=>t.dialogStatus=o,message:t.dialogMessage,allowHtml:!0,confirmButtonText:"继续支付",onConfirm:()=>{const o=t.dialogConfig.paymentConfig;T.push({path:"/order-detail",query:{pm:1,config:JSON.stringify(o.paymentConfig),orderNo:o.orderNo}}),f.pause()},onCancel:o=>{f.pause()}},null),e(ue,{show:t.showTips,message:t.showMessage,showButton:t.showButton,buttonText:"刷新",onConfirm:()=>window.location.reload()},null)])}});export{At as default};
|