1 |
- import{d as C,q as O,e as j,a as e,A as n,I as N,F,x as R,U as x,C as P,V as Q,R as f,M as A,D as h,W as V,r as G,w as W,y as L,z as Z,P as Y,Q as k,X as $,E as B}from"./index-521a9826.js";import{C as g}from"./index-1ad6a58d.js";import{T as H}from"./index-544f4e19.js";import{M as ee}from"./index-c0ea6da9.js";import{R as te,a as z}from"./index-7811aba5.js";import{C as q}from"./index-9b272659.js";import{O as ae}from"./index-a2b9ccab.js";import{F as oe}from"./index-de2c0be1.js";import{F as U}from"./index-e6f760ef.js";import{O as se}from"./index-e4b6c571.js";import{b as ne}from"./browser-e949d08f.js";import{I as re}from"./index-25b5c9d0.js";import"./index-fdaad3c0.js";import"./Checker-1ada2d85.js";const ue="_cartConfirm_1c37u_1",le="_cartConfirmBox_1c37u_9",ce="_cartItem_1c37u_15",ie="_mlr13_1c37u_24",de="_protocol_1c37u_28",me="_paymentContainer_1c37u_36",pe="_needPrice_1c37u_48",_e="_allPrice_1c37u_64",fe="_cellItem_1c37u_72",ye="_img_1c37u_77",he="_cellPrice_1c37u_85",ge="_numFont_1c37u_91",Ce="_numPrefix_1c37u_94",Te="_goodsContent_1c37u_98",Ae="_goodsNum_1c37u_98",Ie="_goodsPrice_1c37u_104",be="_free_1c37u_110",Ne="_goodsNums_1c37u_113",ve="_brandName_1c37u_128",we="_model_1c37u_137",Ee="_popupCode_1c37u_143",Se="_codeContainer_1c37u_147",Be="_codeClose_1c37u_150",De="_codeImg_1c37u_160",Fe="_codeTitle_1c37u_167",xe="_codeName_1c37u_175",Pe="_codeQr_1c37u_182",qe="_codeBtnText_1c37u_195",ke="_codeTips_1c37u_206",ze="_tipsTitle_1c37u_220",Ue="_close_1c37u_226",Oe="_codeBottom_1c37u_231",je="_title_1c37u_238",Re="_shareImg_1c37u_253",Ve="_shareText_1c37u_257",Ge="_freight_1c37u_263",Le="_submitBtn_1c37u_275",u={cartConfirm:ue,cartConfirmBox:le,cartItem:ce,mlr13:ie,protocol:de,paymentContainer:me,needPrice:pe,allPrice:_e,cellItem:fe,img:ye,cellPrice:he,numFont:ge,numPrefix:Ce,goodsContent:Te,goodsNum:Ae,goodsPrice:Ie,free:be,goodsNums:Ne,brandName:ve,model:we,popupCode:Ee,codeContainer:Se,codeClose:Be,codeImg:De,codeTitle:Fe,codeName:xe,codeQr:Pe,codeBtnText:qe,codeTips:ke,tipsTitle:ze,close:Ue,codeBottom:Oe,title:je,shareImg:Re,shareText:Ve,freight:Ge,submitBtn:Le},He="_cellEntry_1kuxn_1",Me="_cell_1kuxn_1",Xe="_userName_1kuxn_36",Je="_phone_1kuxn_41",Ke="_addressInfo_1kuxn_46",Qe="_emtry_1kuxn_51",y={cellEntry:He,cell:Me,userName:Xe,phone:Je,addressInfo:Ke,emtry:Qe},We="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAA4CAMAAACfWMssAAABiVBMVEUAAAD/qDn/oED/pDf/iTT/jjf/sEf/sEf/rEb/rkb/oED/qEL/sEf/oD//oD//sEf/kDf/jzf/ljr/ijX/kDb/oUH/rkr/kTb/sUX/kTP/jTb/sEf/iDP/r0b/qkT/lTr/izb/mT3/lzv/sEf/jzf/sEf/rEX/kzn/sEf/o0H/nT7/iDT/sEf/p0P/mTz/iTT/pEH/nD3/iDP/sEf/pUL/nD3/ijT/skf/jjX/skj/jDX/rkP/oUP/r0f/r0b/iDP/iDT/skj/sEj/mD3/mDr/////r0b/kDf/kzn/jjb/rUX/nD3/o0D/q0T/oT//nT7/qUP/rkb/pUH/p0L/lzv/jDX/lTn/mjz/ljr/nz7/iDT/mTv/ijT/1Kr/+vX/8eP/7dr/zJX/+PL/7t7/6NP/q07/oUv//fz//Pr/8+b/3Lj/2rD/xo3/um//9uz/5cr/3sH/wob/vn//wnn/tHP/tGz/s17/6M7/x5X/yo7/uGH/qFr/qFj/sFT/pVL/p0f/1bH/0pv/rGQBKLmeAAAARXRSTlMABAoH7eDfl4NN+O7r69/NzZWDg041JiYaGhP4+PPz8/Pw6+np4ODg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iG2nlc+ZdFoa3WanCka3lbXmFcFaW4b4sx0z3/7fh//zfdvlEDfKRQAAAABJRU5ErkJggg==",Ze=C({name:"cart-address",props:{item:{type:Object,default:()=>({})},isLink:{type:Boolean,default:!0},setAddress:{type:Function,default:a=>{}}},setup(a){const l=O(),t=j(()=>[a.item.provinceName,a.item.cityName,a.item.regionName,a.item.detailAddress].join("")),d=()=>{a.isLink&&l.push("/shopAddress")};return()=>e(F,null,[a.item&&a.item.phoneNumber?e(g,{class:y.cell,"is-link":a.isLink,onClick:()=>d(),titleStyle:{marginLeft:"0"}},{title:()=>e("div",null,[e("span",{class:y.userName},[a.item.name]),e("span",{class:y.phone},[a.item&&a.item.phoneNumber&&a.item.phoneNumber.replace(/^(\d{3})\d{4}(\d+)/,"$1****$2")]),a.item.defaultStatus&&e(H,{type:"primary",color:"linear-gradient(90deg, #FF8633 0%, #FFB047 100%)",round:!0,style:{"vertical-align":"text-top",marginLeft:"10px",padding:"1px 8px"}},{default:()=>[n("默认")]})]),label:()=>e("span",{class:y.addressInfo},[t.value])}):e(g,{class:y.cell,"is-link":a.isLink,onClick:()=>d()},{icon:()=>e(N,{name:We,size:28},null),title:()=>e("div",{class:y.emtry},[n("去填写收货地址")])})])}}),Ye="_payment_1ot0l_1",$e="_title_1ot0l_13",et="_payAmount_1ot0l_21",tt="_amount_1ot0l_31",at="_blank_1ot0l_38",ot="_payTypeRe_1ot0l_41",st="_recommend_1ot0l_45",nt="_payBtn_1ot0l_54",_={payment:Ye,title:$e,payAmount:et,amount:tt,blank:at,payTypeRe:ot,recommend:st,payBtn:nt},rt=C({name:"payment",props:{paymentConfig:{type:Object,default:{}}},emits:["backOut","close","confirm"],setup(a,{slots:l,attrs:t,emit:d}){const r=R({payType:"wx",pay_channel:""}),v=()=>{Q({message:"是否放弃本次付款",confirmButtonText:"继续付款",cancelButtonText:"放弃",showCancelButton:!0}).catch(async()=>{await T(),d("backOut"),d("close")})},T=async i=>{},w=async()=>{const i=r.payType;f().weixin?i=="zfb"?(r.pay_channel="alipay_qr",p("qrCode")):i=="wx"&&(r.pay_channel="wx_pub",p("pay")):f().alipay?i=="zfb"?(r.pay_channel="alipay_wap",p("pay")):i=="wx"&&(r.pay_channel="wx_pub",p("qrCode")):(i=="zfb"?r.pay_channel="alipay_qr":i=="wx"&&(r.pay_channel="wx_pub"),p("qrCode"))},p=i=>{const E=i=="qrCode"?"payCenter":"payResult";d("confirm",{payCode:E,pay_channel:r.pay_channel})};return()=>e("div",{class:_.payment},[e(N,{onClick:v,name:"cross",size:20},null),e("div",{class:[_.title]},[n("选择支付方式")]),e("div",{class:_.payAmount},[e("p",null,[n("应付金额")]),e("div",{class:_.amount},[e("span",null,[n("¥ ")]),x(a.paymentConfig.currentPrice)])]),e(te,{modelValue:r.payType,"onUpdate:modelValue":i=>r.payType=i},{default:()=>[e(q,{border:!1},{default:()=>[e(g,{border:!0,center:!0,onClick:()=>{r.payType="wx"}},{icon:()=>e(N,{name:"wechat-pay",color:"#15c434",size:22},null),"right-icon":()=>e(z,{name:"wx"},null),title:()=>e("div",{class:_.payTypeRe},[n("微信支付 "),e("span",{class:_.recommend},[n("推荐")])])}),e(g,{title:"支付宝支付",border:!0,center:!0,onClick:()=>{r.payType="zfb"}},{icon:()=>e(N,{name:"alipay",color:"#009fe9",size:22},null),"right-icon":()=>e(z,{name:"zfb"},null)})]})]}),e("div",{class:_.blank},null),e(P,{type:"primary",class:_.payBtn,block:!0,round:!0,onClick:w},{default:()=>[n("确认支付")]})])}}),ut="_userAuth_1wdij_1",lt="_cellGroup_1wdij_6",ct="_btnGroup_1wdij_38",it="_otherBtn_1wdij_42",D={userAuth:ut,cellGroup:lt,btnGroup:ct,otherBtn:it},dt=C({name:"UserAuth",props:{onSuccess:{type:Function,default:()=>{}},hideHeader:{type:Boolean,default:!1}},data(){return{form:{realName:"",idCardNo:""}}},mounted(){const a=A.user.data;this.form.realName=a==null?void 0:a.account.realName},methods:{async onSubmit(){try{const a="/edu-app/sysAccount/realNameAuth";await h.post(a,{data:{...this.form,contract:!0,save:!0}}),A.user.data.account.realName=this.form.realName,A.user.data.account.idCardNo=this.form.idCardNo,this.onSuccess()}catch(a){}}},render(){return e(oe,{class:D.userAuth,onSubmit:this.onSubmit},{default:()=>[!this.hideHeader&&e(V,{title:"实名认证"},null),e(q,{inset:!0,class:D.cellGroup},{default:()=>[e(U,{required:!0,label:"真实姓名",modelValue:this.form.realName,"onUpdate:modelValue":a=>this.form.realName=a,rules:[{required:!0,message:"请填写真实姓名"}],name:"realName",placeholder:"请填写真实姓名",autocomplete:"off",maxlength:"50"},null),e(U,{required:!0,label:"身份证号",modelValue:this.form.idCardNo,"onUpdate:modelValue":a=>this.form.idCardNo=a,maxlength:18,autocomplete:"off",rules:[{required:!0,message:"请输入身份证号"},{pattern:/^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/,message:"请输入正确的身份证号"}],placeholder:"请输入身份证号"},null)]}),e("div",{class:["btnGroup"]},[e(P,{block:!0,round:!0,type:"primary","native-type":"submit",class:D.otherBtn},{default:()=>[n("确定")]})])]})}}),mt={WAIT_PAY:"待支付",PAYING:"支付中",PAID:"已付款",TIMEOUT:"已关闭",FAIL:"支付失败",CLOSED:"已关闭",REFUNDING:"退款中",REFUNDED:"已退款"},pt="_saveShareImage_1vhog_1",_t="_tips_1vhog_5",ft="_tipsTitle_1vhog_11",yt="_tipsContent_1vhog_17",ht="_previewSection_1vhog_23",gt="_topImage_1vhog_30",Ct="_shareContaienr_1vhog_37",Tt="_schoolName_1vhog_45",At="_shareType_1vhog_51",It="_qrcodeSection_1vhog_60",bt="_memo_1vhog_68",m={saveShareImage:pt,tips:_t,tipsTitle:ft,tipsContent:yt,previewSection:ht,topImage:gt,shareContaienr:Ct,schoolName:Tt,shareType:At,qrcodeSection:It,memo:bt},Nt=""+new URL("smallLogo-517ff5bd.png",import.meta.url).href,vt="_qrcode_izshm_1",wt="_qrcodeCanvas_izshm_4",Et="_qrcodeLogo_izshm_8",St="_small_izshm_18",b={qrcode:vt,qrcodeCanvas:wt,qrcodeLogo:Et,small:St},Bt=C({props:{text:{type:String,default:""},size:{type:String,default:"200px"},logoSize:{type:String,default:"default"}},setup(a){const l=G(),t=()=>{ne.toCanvas(l.value,a.text,{margin:1},d=>{d&&console.log(d),console.log("success")})};return W(()=>a.text,()=>{t()}),L(()=>{Z(()=>{t()})}),()=>e("div",{class:b.qrcode,style:{width:a.size,height:a.size}},[e("canvas",{ref:l,class:b.qrcodeCanvas},null),e("img",{src:Nt,class:[b.qrcodeLogo,a.logoSize==="small"&&b.small]},null)])}}),Dt=C({name:"qrcode-payment",props:{url:{type:String,default:""},pay_channel:{type:String,default:"wx_pub"},orderType:{type:String,default:""}},setup(a){return()=>e("div",{class:[m.saveShareImage]},[e("div",{class:[m.shareContaienr]},[e("div",{class:m.schoolName},[a.orderType==="VIP"?"会员购买":"报名缴费"]),e("div",{class:m.shareType},[n("请截图下方二维码"),e("span",null,[n("登录"),a.pay_channel==="wx_pub"?"微信":"支付宝",n("扫码支付")])]),e("div",{class:m.qrcodeSection},[e(Bt,{text:a.url,logoSize:"small",size:"100%"},null)]),e("div",{class:m.memo},[n("请在30分钟内扫码支付")])]),e("div",{class:[m.tips]},[e("div",{class:m.tipsTitle},[n("使用说明:")]),e("div",{class:m.tipsContent},[n("1.打开"),a.pay_channel==="wx_pub"?"微信":"支付宝",n("扫一扫"),e("br",null,null),n("2.选择相册中的二维码"),e("br",null,null),n("3.请在30分钟内扫码支付")])])])}}),Ft=a=>{let l="qrCode";return f().weixin?a=="alipay_qr"||a=="alipay_wap"?l="qrCode":a=="wx_pub"&&(l="pay"):f().alipay&&a=="alipay_wap"?l="pay":l="qrCode",l=="qrCode"?"payDefine":"payResult"},Xt=C({name:"order-detail",setup(){const a=Y(),l=O(),t=R({paymentType:"adapay",orderTimer:null,paymentStatus:!1,showQrcode:!1,qrCodeUrl:"",pay_channel:"",orderNo:a.query.orderNo,orderInfo:{},goodsInfos:[],config:a.query.config?JSON.parse(a.query.config):{},hasFreight:!a.query.hf,freight:"",agreeStatus:!0,showHeader:!1,authShow:!1,selectGoodsId:null,currentPrice:0,hasInstrument:!1,dialogStatus:!1,dialogMessage:"",submitStatus:!1}),d=j(()=>t.orderInfo.orderType),r=G({}),v=async()=>{try{const{data:o}=await h.get("/edu-app/userPaymentOrder/detail/"+t.orderNo),s=o.goodsInfos||[];t.orderInfo=o;let c=!1;s.forEach(I=>{const K=I.goodsUrl?I.goodsUrl.split(",")[0]:"";I.goodsUrl=K,I.goodsType==="INSTRUMENTS"&&(c=!0)}),t.goodsInfos=s,r.value.id||(r.value=o.addresses||{}),t.hasInstrument=c,c?t.freight="到付":t.freight="免运费",o.status!=="WAIT_PAY"&&o.status!=="PAYING"&&(t.dialogStatus=!0,t.dialogMessage="订单"+mt[o.status])}catch(o){}},T=o=>{const s=t.config;t.pay_channel=o.pay_channel;const c=$.stringify({pay_channel:o.pay_channel,wxAppId:s.wxAppId,alipayAppId:s.alipayAppId,paymentType:t.paymentType,body:s.body,price:s.price,orderNo:s.merOrderNo,userId:s.userId});o.payCode==="payResult"?window.location.href=window.location.origin+"/classroom-app/#/payResult?"+c:(t.qrCodeUrl=window.location.origin+"/classroom-app/#/payDefine?"+c,t.showQrcode=!0,t.paymentStatus=!1,setTimeout(()=>{w()},300))},w=async()=>{const o=setInterval(async()=>{if(a.name!="order-detail"){clearInterval(o);return}t.orderTimer=o;try{const{data:s}=await h.post("/edu-app/open/userOrder/paymentStatus/"+t.orderNo,{hideLoading:!0});s.status!=="WAIT_PAY"&&s.status!=="PAYING"&&(t.showQrcode=!1,clearInterval(t.orderTimer),setTimeout(()=>{S()},100))}catch(s){clearInterval(t.orderTimer)}},5e3)},p=async()=>{clearInterval(t.orderTimer),d.value==="VIP"?E(i):M(i)},i=()=>{const o=t.pay_channel;if(o){const s=Ft(t.pay_channel);T({payCode:s,pay_channel:o})}else d.value==="VIP"?t.paymentStatus=!0:T({payCode:"payResult",pay_channel:"wx_pub"})},E=async o=>{try{if(!t.agreeStatus){B("请先阅读并同意《音乐数字课堂服务协议》");return}const s=A.user.data;if(!(s!=null&&s.account.realName)||!(s!=null&&s.account.idCardNo)){t.authShow=!0;return}t.submitStatus=!0;const{data:c}=await h.post("/edu-app/userPaymentOrder/updateReceiveAddress",{hideLoading:!1,data:{orderNo:t.orderNo,orderType:"VIP"}});t.pay_channel=c.paymentChannel,c.status!=="WAIT_PAY"&&c.status!=="PAYING"?l.replace({path:"/payment-result",query:{orderNo:t.orderNo}}):(o&&o(),t.submitStatus=!1)}catch(s){t.submitStatus=!1}},M=async o=>{if(!r.value.id&&t.hasInstrument){B("请选择收货地址");return}if(!t.agreeStatus){B("请先阅读并同意《音乐数字课堂服务协议》");return}const s=A.user.data;if(!(s!=null&&s.account.realName)||!(s!=null&&s.account.idCardNo)){t.authShow=!0;return}t.submitStatus=!0;try{const{data:c}=await h.post("/edu-app/userPaymentOrder/updateReceiveAddress",{hideLoading:!1,data:{orderNo:t.orderNo,orderType:"SCHOOL_REGISTER",receiveAddress:r.value.id||""}});t.pay_channel=c.paymentChannel,c.status!=="WAIT_PAY"&&c.status!=="PAYING"?S():(o&&o(),t.submitStatus=!1)}catch(c){t.submitStatus=!1}},S=()=>{l.replace({path:"/payment-result",query:{orderNo:t.orderNo}})},X=async()=>{try{await h.post("/edu-app/userPaymentOrder/cancelPayment/"+t.orderNo),l.back()}catch(o){}},J=()=>{t.authShow=!1,p()};return L(()=>{f().isApp?t.showHeader=!0:t.showHeader=!1;let o=sessionStorage.getItem("addressDetails");o=o?JSON.parse(o):{},r.value=o,sessionStorage.removeItem("addressDetails"),v()}),()=>e(F,null,[f().isApp&&e(V,{border:!1},null),e("div",{class:u.cartConfirm},[t.hasInstrument&&e("div",{class:u.cartConfirmBox},[e(Ze,{item:r.value},null)]),e(q,{style:{margin:0},border:!1},{default:()=>[t.goodsInfos&&t.goodsInfos.map(o=>e(g,{class:u.cellItem},{icon:()=>e(re,{class:u.img,src:o.goodsUrl},null),title:()=>e("div",{class:u.goodsContent},[e("h2",null,[e("span",null,[o.goodsName]),e("span",{class:u.goodsNum},[n("x "),o.goodsNum])]),e("div",{class:u.goodsPrice},[e(H,{class:u.brandName},{default:()=>[o.goodsType==="VIP"?"12个月":o.brandName]}),e("span",{class:[u.goodsNums,o.paymentCashAmount>0?u.numFont:u.free]},[o.paymentCashAmount>0?e(F,null,[e("span",{class:u.numPrefix},[n("¥ ")]),x(o.paymentCashAmount)]):"免费"])]),e("p",{class:u.model},[o.description])])}))]}),t.hasInstrument&&e(g,{class:u.freight,title:"运费",value:t.freight},null)]),e(ee,{position:"bottom"},{default:()=>[e("div",{class:u.paymentContainer},[e("div",{class:u.payemntPrice},[e("p",{class:u.needPrice},[n("支付金额:"),e("span",null,[e("i",null,[n("¥")]),x(t.orderInfo.currentPrice)])])]),e("div",{class:u.paymentBtn},[e(P,{round:!0,class:[u.submitBtn],onClick:p,loading:t.submitStatus,disabled:t.submitStatus},{default:()=>[n("提交")]})])])]}),e(k,{show:t.paymentStatus,closeOnClickOverlay:!1,position:"bottom",round:!0,closeOnPopstate:!0,safeAreaInsetBottom:!0,style:{minHeight:"30%"}},{default:()=>[e(rt,{paymentConfig:t.orderInfo,onClose:()=>t.paymentStatus=!1,onBackOut:X,onConfirm:o=>T(o)},null)]}),e(k,{show:t.showQrcode,"onUpdate:show":o=>t.showQrcode=o,round:!0,onClose:()=>{clearInterval(t.orderTimer)}},{default:()=>[e(Dt,{url:t.qrCodeUrl,pay_channel:t.pay_channel,orderType:d.value},null)]}),e(ae,{modelValue:t.authShow,"onUpdate:modelValue":o=>t.authShow=o},{default:()=>[e(dt,{onSuccess:J,hideHeader:!f().isApp},null)]}),e(se,{title:"提示",show:t.dialogStatus,"onUpdate:show":o=>t.dialogStatus=o,message:t.dialogMessage,confirmButtonText:"确定",onConfirm:()=>{S()}},null)])}});export{Xt as default};
|