import{d as T,r as A,c as e,a5 as k,q as n,b6 as x,B as F,b9 as Y,f as p,m as y,P as U,aj as I,g as C,ag as H,ah as Q,y as W,$ as X,F as O,be as j,o as J}from"./index.332c7f08.js";import{O as G}from"./index.d7c1b6ac.js";import{R as K,a as D}from"./index.a4155be3.js";import{C as E}from"./index.324108a5.js";import{C as B}from"./index.91135ff9.js";import{c as Z}from"./icon-checkbox-check.b4753e7f.js";import{c as ee}from"./icon-checkbox-default.a253b329.js";import{C as te}from"./index.2e331ab5.js";import{O as S}from"./index.ed5fc819.js";import{F as oe}from"./index.f74c7b35.js";import{F as V}from"./index.1ed6273e.js";import{M as ae,G as se}from"./index.bee2a0d1.js";import{O as ne}from"./index.a8f5f4b5.js";import{b as re}from"./index.b28db9f5.js";import{o as le}from"./orchestra-top_bg.d871f0f3.js";import{O as ce}from"./index.20ac1dfd.js";import{I as M}from"./index.96a8db5e.js";import"./Checker.1af5496e.js";import"./function-call.3db51140.js";import"./ImagePreview.e5b44a77.js";import"./index.1e2dfe6e.js";const ue="_cartConfirm_d9k0a_1",ie="_mlr13_d9k0a_8",de="_protocol_d9k0a_12",pe="_paymentContainer_d9k0a_20",me="_needPrice_d9k0a_32",_e="_allPrice_d9k0a_42",he="_cellItem_d9k0a_52",ye="_img_d9k0a_57",fe="_cellPrice_d9k0a_65",ge="_numFont_d9k0a_71",Ce="_numPrefix_d9k0a_75",Te="_goodsContent_d9k0a_79",be="_goodsNum_d9k0a_79",Se="_goodsPrice_d9k0a_85",we="_free_d9k0a_91",ke="_goodsNums_d9k0a_94",Ie="_brandName_d9k0a_109",Pe="_model_d9k0a_115",ve="_popupCode_d9k0a_122",Ne="_codeContainer_d9k0a_126",xe="_codeClose_d9k0a_129",Be="_codeImg_d9k0a_139",Ae="_codeTitle_d9k0a_146",Fe="_codeName_d9k0a_154",Ee="_codeQr_d9k0a_161",qe="_codeBtnText_d9k0a_174",Oe="_codeTips_d9k0a_185",De="_tipsTitle_d9k0a_199",Ve="_close_d9k0a_205",Re="_codeBottom_d9k0a_210",Ue="_title_d9k0a_217",He="_shareImg_d9k0a_232",Ge="_shareText_d9k0a_236",Me="_freight_d9k0a_242";var l={cartConfirm:ue,mlr13:ie,protocol:de,paymentContainer:pe,needPrice:me,allPrice:_e,cellItem:he,img:ye,cellPrice:fe,numFont:ge,numPrefix:Ce,goodsContent:Te,goodsNum:be,goodsPrice:Se,free:we,goodsNums:ke,brandName:Ie,model:Pe,popupCode:ve,codeContainer:Ne,codeClose:xe,codeImg:Be,codeTitle:Ae,codeName:Fe,codeQr:Ee,codeBtnText:qe,codeTips:Oe,tipsTitle:De,close:Ve,codeBottom:Re,title:Ue,shareImg:He,shareText:Ge,freight:Me};const $e="_payment_1ot0l_1",Le="_title_1ot0l_13",ze="_payAmount_1ot0l_21",Ye="_amount_1ot0l_31",Qe="_blank_1ot0l_38",We="_payTypeRe_1ot0l_41",Xe="_recommend_1ot0l_45",je="_payBtn_1ot0l_54";var h={payment:$e,title:Le,payAmount:ze,amount:Ye,blank:Qe,payTypeRe:We,recommend:Xe,payBtn:je},Je=T({name:"payment",props:{paymentConfig:{type:Object,default:{}}},emits:["backOut","close","confirm"],setup(a,{slots:r,attrs:t,emit:d}){const c=A({payType:"wx",pay_channel:""}),f=()=>{Y({message:"\u662F\u5426\u653E\u5F03\u672C\u6B21\u4ED8\u6B3E",confirmButtonText:"\u7EE7\u7EED\u4ED8\u6B3E",cancelButtonText:"\u653E\u5F03",showCancelButton:!0}).catch(async()=>{await P(),d("backOut"),d("close")})},P=async u=>{},b=async()=>{const u=c.payType;p().weixin?u=="zfb"?(c.pay_channel="alipay_qr",m("qrCode")):u=="wx"&&(c.pay_channel="wx_pub",m("pay")):p().alipay?u=="zfb"?(c.pay_channel="alipay_wap",m("pay")):u=="wx"&&(c.pay_channel="wx_pub",m("qrCode")):(u=="zfb"?c.pay_channel="alipay_qr":u=="wx"&&(c.pay_channel="wx_pub"),m("qrCode"))},m=u=>{const v=u=="qrCode"?"payCenter":"payResult";d("confirm",{payCode:v,pay_channel:c.pay_channel})};return()=>e("div",{class:h.payment},[e(k,{onClick:f,name:"cross",size:20},null),e("div",{class:[h.title]},[n("\u9009\u62E9\u652F\u4ED8\u65B9\u5F0F")]),e("div",{class:h.payAmount},[e("p",null,[n("\u5E94\u4ED8\u91D1\u989D")]),e("div",{class:h.amount},[e("span",null,[n("\uFFE5 ")]),x(a.paymentConfig.currentPrice)])]),e(K,{modelValue:c.payType,"onUpdate:modelValue":u=>c.payType=u},{default:()=>[e(E,{border:!1},{default:()=>[e(B,{border:!0,center:!0,onClick:()=>{c.payType="wx"}},{icon:()=>e(k,{name:"wechat-pay",color:"#15c434",size:22},null),"right-icon":()=>e(D,{name:"wx"},null),title:()=>e("div",{class:h.payTypeRe},[n("\u5FAE\u4FE1\u652F\u4ED8 "),e("span",{class:h.recommend},[n("\u63A8\u8350")])])}),e(B,{title:"\u652F\u4ED8\u5B9D\u652F\u4ED8",border:!0,center:!0,onClick:()=>{c.payType="zfb"}},{icon:()=>e(k,{name:"alipay",color:"#009fe9",size:22},null),"right-icon":()=>e(D,{name:"zfb"},null)})]})]}),e("div",{class:h.blank},null),e(F,{type:"primary",class:h.payBtn,block:!0,round:!0,onClick:b},{default:()=>[n("\u786E\u8BA4\u652F\u4ED8")]})])}});const Ke="_colProtocol_rqtsv_1",Ze="_protocolText_rqtsv_6",et="_boxStyle_rqtsv_10",tt="_protocolContent_rqtsv_30";var w={colProtocol:Ke,protocolText:Ze,boxStyle:et,protocolContent:tt};const ot={BUY_ORDER:"\u300A\u7BA1\u4E50\u56E2\u5E73\u53F0\u670D\u52A1\u534F\u8BAE\u300B",REGISTER:"\u300A\u7BA1\u4E50\u56E2\u5E73\u53F0\u6CE8\u518C\u534F\u8BAE\u300B"};var at=T({name:"o-protocol",props:{showHeader:{type:Boolean,default:!1},modelValue:{type:Boolean,default:!1},prototcolType:{type:String,default:"BUY_ORDER"}},data(){return{exists:!0,checked:this.modelValue,popupStatus:!1,protocolHTML:"",protocolPopup:null}},async mounted(){try{this.checked=this.checked||this.exists,this.$emit("update:modelValue",this.checked||this.exists)}catch{}this.checked=this.modelValue,window.addEventListener("hashchange",this.onHash,!1)},unmounted(){window.removeEventListener("hashchange",this.onHash,!1)},watch:{checked(a){this.$emit("update:modelValue",a)}},methods:{async getContractDetail(){try{if(!this.protocolHTML){const{data:a}=await y.get("/api-student/schoolContractTemplate/queryLatestContractTemplate",{params:{contractType:this.prototcolType}});this.protocolHTML=a.contractTemplateContent}this.onPopupClose()}catch{}},onHash(){this.popupStatus=!1},onPopupClose(){if(this.popupStatus=!this.popupStatus,this.popupStatus){const a=this.$route;let r=0;for(let c in a.query)r+=1;const t=window.location.href,d=r>0?"&pto="+ +new Date:"?pto="+ +new Date;history.pushState("","",`${t}${d}`)}else window.history.go(-1);this.protocolPopup&&(this.protocolPopup.scrollTop=0)}},render(){return e("div",{class:w.colProtocol},[e(te,{modelValue:this.checked,"onUpdate:modelValue":a=>this.checked=a},{default:()=>[n("\u6211\u5DF2\u9605\u8BFB\u5E76\u540C\u610F")],icon:a=>e(k,{class:w.boxStyle,name:a.checked?Z:ee,size:"15"},null)}),e("span",{onClick:this.getContractDetail,class:w.protocolText},[ot[this.prototcolType]]),e(U,{ref:this.protocolPopup,show:this.popupStatus,position:"bottom",style:{height:"100%"}},{default:()=>[this.showHeader&&e(I,{title:"\u7BA1\u4E50\u56E2\u5E73\u53F0\u670D\u52A1\u534F\u8BAE"},null),this.popupStatus&&e("div",{id:"mProtocol"},[e("div",{class:w.protocolContent,innerHTML:this.protocolHTML},null)])]})])}});const st="_userAuth_1sper_1",nt="_cellGroup_1sper_6",rt="_btnGroup_1sper_38";var R={userAuth:st,cellGroup:nt,btnGroup:rt},lt=T({name:"UserAuth",props:{onSuccess:{type:Function,default:()=>{}},hideHeader:{type:Boolean,default:!1}},data(){return{form:{realName:"",idCardNo:""}}},mounted(){const a=C.user.data;this.form.realName=a==null?void 0:a.account.realName},methods:{async onSubmit(){try{const a=C.platformApi+"/sysAccount/realNameAuth";await y.post(a,{data:{...this.form,contract:!0,save:!0}}),C.user.data.account.realName=this.form.realName,C.user.data.account.idCardNo=this.form.idCardNo,this.onSuccess()}catch{}}},render(){return e(oe,{class:R.userAuth,onSubmit:this.onSubmit},{default:()=>[!this.hideHeader&&e(I,{title:"\u5B9E\u540D\u8BA4\u8BC1"},null),e(E,{inset:!0,class:R.cellGroup},{default:()=>[e(V,{required:!0,label:"\u771F\u5B9E\u59D3\u540D",modelValue:this.form.realName,"onUpdate:modelValue":a=>this.form.realName=a,rules:[{required:!0,message:"\u8BF7\u586B\u5199\u771F\u5B9E\u59D3\u540D"}],name:"realName",placeholder:"\u8BF7\u586B\u5199\u771F\u5B9E\u59D3\u540D",maxlength:"50"},null),e(V,{required:!0,label:"\u8EAB\u4EFD\u8BC1\u53F7",modelValue:this.form.idCardNo,"onUpdate:modelValue":a=>this.form.idCardNo=a,maxlength:18,rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u8EAB\u4EFD\u8BC1\u53F7"},{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:"\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u8EAB\u4EFD\u8BC1\u53F7"}],placeholder:"\u8BF7\u8F93\u5165\u8EAB\u4EFD\u8BC1\u53F7"},null)]}),e("div",{class:["btnGroup"]},[e(F,{block:!0,round:!0,type:"primary","native-type":"submit"},{default:()=>[n("\u786E\u5B9A")]})])]})}});const ct="_saveShareImage_sn42f_1",ut="_btnHeader_sn42f_16",it="_iconBack_sn42f_21",dt="_previewSection_sn42f_28",pt="_topImage_sn42f_35",mt="_shareContaienr_sn42f_41",_t="_orchestraContainer_sn42f_50",ht="_schoolName_sn42f_54",yt="_tips_sn42f_60",ft="_tipsTitle_sn42f_66",gt="_tipsContent_sn42f_72",Ct="_schoolLogo_sn42f_78",Tt="_shareType_sn42f_98",bt="_qrcodeSection_sn42f_107",St="_memo_sn42f_115",wt="_endTime_sn42f_127";var i={saveShareImage:ct,btnHeader:ut,iconBack:it,previewSection:dt,topImage:pt,shareContaienr:mt,orchestraContainer:_t,schoolName:ht,tips:yt,tipsTitle:ft,tipsContent:gt,schoolLogo:Ct,shareType:Tt,qrcodeSection:bt,memo:St,endTime:wt},kt=T({name:"qrcode-payment",props:{url:{type:String,default:""},pay_channel:{type:String,default:"wx_pub"},orderType:{type:String,default:""}},setup(a){H();const r=A({height:0});return()=>e("div",{class:[i.saveShareImage]},[p().isApp&&e(G,{position:"top",onGetHeight:t=>{r.height=t,console.log(t,"height")}},{default:()=>[e(I,{title:a.orderType==="VIP"?"\u4F1A\u5458\u8D2D\u4E70":"\u62A5\u540D\u7F34\u8D39"},null)]}),e(M,{src:le,class:i.topImage,style:{top:r.height+"px"}},null),e("div",{class:[i.shareContaienr,i.orchestraContainer]},[e("div",{class:i.schoolName},[a.orderType==="VIP"?"\u4F1A\u5458\u8D2D\u4E70":"\u62A5\u540D\u7F34\u8D39"]),e("div",{class:i.shareType},[n("\u8BF7\u622A\u56FE\u4E0B\u65B9\u4E8C\u7EF4\u7801"),e("span",null,[n("\u767B\u5F55"),a.pay_channel==="wx_pub"?"\u5FAE\u4FE1":"\u652F\u4ED8\u5B9D",n("\u626B\u7801\u652F\u4ED8")])]),e("div",{class:i.qrcodeSection},[e(ce,{text:a.url,logoSize:"small",size:"100%"},null)]),e("div",{class:i.memo},[n("\u8BF7\u572830\u5206\u949F\u5185\u626B\u7801\u652F\u4ED8")])]),e("div",{class:[i.shareContaienr,i.tips]},[e("div",{class:i.tipsTitle},[n("\u4F7F\u7528\u8BF4\u660E\uFF1A")]),e("div",{class:i.tipsContent},[n("1.\u6253\u5F00"),a.pay_channel==="wx_pub"?"\u5FAE\u4FE1":"\u652F\u4ED8\u5B9D",n("\u626B\u4E00\u626B"),e("br",null,null),n("2.\u9009\u62E9\u76F8\u518C\u4E2D\u7684\u4E8C\u7EF4\u7801"),e("br",null,null),n("3.\u8BF7\u572830\u5206\u949F\u5185\u626B\u7801\u652F\u4ED8")])])])}});const It=a=>{let r="qrCode";return p().weixin?a=="alipay_qr"||a=="alipay_wap"?r="qrCode":a=="wx_pub"&&(r="pay"):p().alipay&&a=="alipay_wap"?r="pay":r="qrCode",r=="qrCode"?"payDefine":"payResult"};var Qt=T({name:"order-detail",setup(){const a=Q(),r=H(),t=A({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,memberBaoStatus:!1,goodsStatus:!1,selectGoodsId:null,currentPrice:0,dialogStatus:!1,dialogMessage:"",submitStatus:!1}),d=W(()=>t.orderInfo.orderType),c=async()=>{try{const{data:o}=await y.get("/api-student/userPaymentOrder/detail/"+t.orderNo),s=o.goodsInfos||[];t.orderInfo=o;let _=!1,q=!1;s.forEach(g=>{const z=g.goodsUrl?g.goodsUrl.split(",")[0]:"";g.goodsUrl=z,g.goodsType==="INSTRUMENTS"?_=!0:g.goodsType==="TEXTBOOK"&&(q=!0)}),t.goodsInfos=s,!_&&q?t.freight="\u5230\u4ED8":t.freight="\u514D\u8FD0\u8D39",o.status!=="WAIT_PAY"&&o.status!=="PAYING"&&(t.dialogStatus=!0,t.dialogMessage="\u8BA2\u5355"+re[o.status])}catch{}},f=o=>{const s=t.config;t.pay_channel=o.pay_channel;const _=j.stringify({pay_channel:o.pay_channel,wxAppId:s.wxAppId,alipayAppId:s.alipayAppId,body:s.body,price:s.price,paymentType:s.paymentType,orderNo:s.merOrderNo,userId:s.userId});o.payCode==="payResult"?window.location.href=window.location.origin+"/orchestra-student/#/payResult?"+_:(t.qrCodeUrl=window.location.origin+"/orchestra-student/#/payDefine?"+_,t.showQrcode=!0,t.paymentStatus=!1,setTimeout(()=>{P()},300))},P=async()=>{const o=setInterval(async()=>{if(a.name!="orderDetail"){clearInterval(o);return}t.orderTimer=o;try{const{data:s}=await y.post("/api-student/open/userOrder/paymentStatus/"+t.orderNo,{hideLoading:!0});s.status!=="WAIT_PAY"&&s.status!=="PAYING"&&(t.showQrcode=!1,clearInterval(t.orderTimer),setTimeout(()=>{N()},100))}catch{clearInterval(t.orderTimer)}},5e3)},b=async()=>{clearInterval(t.orderTimer),d.value==="VIP"?u(m):v(m)},m=()=>{const o=t.pay_channel;if(o){const s=It(t.pay_channel);f({payCode:s,pay_channel:o})}else d.value==="VIP"||p().isApp?t.paymentStatus=!0:f({payCode:"payResult",pay_channel:"wx_pub"})},u=async o=>{try{t.submitStatus=!0;const{data:s}=await y.get("/api-student/userPaymentOrder/detail/"+t.orderNo,{hideLoading:!1});t.pay_channel=s.paymentChannel,t.submitStatus=!1,s.status!=="WAIT_PAY"&&s.status!=="PAYING"?r.replace({path:"/payment-result",query:{orderNo:t.orderNo}}):o&&o()}catch{t.submitStatus=!1}},v=async o=>{if(!t.agreeStatus){J("\u8BF7\u5148\u9605\u8BFB\u5E76\u540C\u610F\u300A\u7BA1\u4E50\u56E2\u5E73\u53F0\u670D\u52A1\u534F\u8BAE\u300B");return}const s=C.user.data;if(!(s!=null&&s.account.realName)||!(s!=null&&s.account.idCardNo)){t.authShow=!0;return}t.submitStatus=!0;try{const{data:_}=await y.post("/api-student/userPaymentOrder/updateReceiveAddress",{hideLoading:!1,data:{orderNo:t.orderNo,orderType:"ORCHESTRA",receiveAddress:null}});_.status!=="WAIT_PAY"&&_.status!=="PAYING"?N():o&&o()}catch{}finally{t.submitStatus=!1}},N=()=>{d.value==="ORCHESTRA"&&!p().isApp?window.location.replace("https://mp.weixin.qq.com/s?__biz=MzkxMDMwOTI5Nw==&mid=2247485362&idx=3&sn=9b265d36b5dabe7f9393fc679c367540&chksm=c12c256cf65bac7ae2a865435b950f6e1285afd226356db0ffde815b1ee345f29cfcdb798cc9#rd"):r.replace({path:"/payment-result",query:{orderNo:t.orderNo}})},$=async()=>{try{await y.post("/api-student/userPaymentOrder/cancelPayment/"+t.orderNo),r.back()}catch{}},L=()=>{t.authShow=!1,b()};return X(()=>{p().isApp?t.showHeader=!0:t.showHeader=!1,c()}),()=>e(O,null,[p().isApp&&e(I,{border:!1},null),e("div",{class:l.cartConfirm},[e(E,{style:{margin:0},border:!1},{default:()=>[t.goodsInfos&&t.goodsInfos.map(o=>e(B,{class:l.cellItem,onClick:()=>{o.goodsType==="INSTRUMENTS"||o.goodsType==="TEXTBOOK"?(t.selectGoodsId=o.goodsId,t.currentPrice=o.currentPrice,t.goodsStatus=!0):o.goodsType==="VIP"&&(t.memberBaoStatus=!0)}},{icon:()=>e(M,{class:l.img,src:o.goodsUrl},null),title:()=>e("div",{class:l.goodsContent},[e("h2",null,[e("span",null,[o.goodsName]),e("span",{class:[l.goodsNums,o.paymentCashAmount>0?l.numFont:l.free]},[o.paymentCashAmount>0?e(O,null,[e("span",{class:l.numPrefix},[n("\xA5 ")]),x(o.paymentCashAmount)]):t.orderInfo.orchestraRegisterType==="GROUP_BUY"&&o.goodsType==="INSTRUMENTS"?"\u514D\u8D39\u63D0\u4F9B":"\u514D\u8D39"])]),e("div",{class:l.goodsPrice},[o.goodsType==="INSTRUMENT_INSPECT"?e("span",{class:[l.model,"van-multi-ellipsis--l2"]},[n("1-2\u6B21/\u5B66\u671F")]):e("span",{class:[l.model,"van-multi-ellipsis--l2"]},[o.description]),e("span",{class:l.goodsNum},[o.goodsType==="VIP"?"6\u4E2A\u6708":"x 1"])])])}))]})]),e(G,{position:"bottom",background:"white-only"},{default:()=>[e("div",{class:l.protocol},[e(at,{modelValue:t.agreeStatus,"onUpdate:modelValue":o=>t.agreeStatus=o,showHeader:t.showHeader,style:{paddingTop:0,paddingBottom:0}},null)]),e("div",{class:l.paymentContainer},[e("div",{class:l.payemntPrice},[e("p",{class:l.needPrice},[n("\u652F\u4ED8\u91D1\u989D\uFF1A"),e("span",null,[n("\xA5 "),x(t.orderInfo.currentPrice)])])]),e("div",{class:l.paymentBtn},[e(F,{color:"linear-gradient(135deg, #FF8C4A 0%, #FF531C 100%)",round:!0,onClick:b,loading:t.submitStatus,disabled:t.submitStatus},{default:()=>[n("\u7ACB\u5373\u8D2D\u4E70")]})])])]}),e(U,{show:t.paymentStatus,closeOnClickOverlay:!1,position:"bottom",round:!0,closeOnPopstate:!0,safeAreaInsetBottom:!0,style:{minHeight:"30%"}},{default:()=>[e(Je,{paymentConfig:t.orderInfo,onClose:()=>t.paymentStatus=!1,onBackOut:$,onConfirm:o=>f(o)},null)]}),e(S,{modelValue:t.showQrcode,"onUpdate:modelValue":o=>t.showQrcode=o,onClose:()=>{clearInterval(t.orderTimer)}},{default:()=>[e(kt,{url:t.qrCodeUrl,pay_channel:t.pay_channel,orderType:d.value},null)]}),e(S,{modelValue:t.authShow,"onUpdate:modelValue":o=>t.authShow=o},{default:()=>[e(lt,{onSuccess:L,hideHeader:!p().isApp},null)]}),e(S,{modelValue:t.memberBaoStatus,"onUpdate:modelValue":o=>t.memberBaoStatus=o,position:"right"},{default:()=>[e(ae,null,null)]}),e(S,{modelValue:t.goodsStatus,"onUpdate:modelValue":o=>t.goodsStatus=o,position:"right",destroy:!0},{default:()=>[t.goodsStatus&&e(se,{id:t.selectGoodsId,groupPrice:t.currentPrice},null)]}),e(ne,{title:"\u63D0\u793A",show:t.dialogStatus,"onUpdate:show":o=>t.dialogStatus=o,message:t.dialogMessage,confirmButtonText:"\u786E\u5B9A",onConfirm:()=>{N()}},null)])}});export{Qt as default};