12345678 |
- import{d as O,u as Ee,h as Ve,f as l,g as A,I as ee,F as he,i as Be,m as me,B as Ae,j as ut,k as U,P as ze,a as te,r as z,O as Ie,l as qe,w as lt,o as xe,n as ct,p as dt,e as ve}from"./index-abe5b65a.js";import{C as q}from"./index-62d15662.js";import{T as He}from"./index-042489dd.js";import{O as Ge}from"./index-585f5e1f.js";import{R as ft,a as Me}from"./index-cc9c430f.js";import{C as Te}from"./index-fc58b782.js";import{F as gt,O as ht}from"./index-73958388.js";import{q as pe}from"./base-aba1ba3e.js";import{F as De}from"./index-d0092180.js";import{O as mt}from"./index-cfc2b884.js";import{I as Qe}from"./index-2304cbd2.js";import"./Checker-7a659f46.js";const pt="_cartConfirm_1u6ge_1",yt="_cartConfirmBox_1u6ge_9",wt="_cartItem_1u6ge_15",_t="_mlr13_1u6ge_24",Ct="_protocol_1u6ge_28",Et="_paymentContainer_1u6ge_36",Bt="_needPrice_1u6ge_48",At="_allPrice_1u6ge_64",It="_cellItem_1u6ge_72",Tt="_img_1u6ge_77",Nt="_cellPrice_1u6ge_85",St="_numFont_1u6ge_91",bt="_numPrefix_1u6ge_94",Pt="_goodsContent_1u6ge_98",Ft="_goodsNum_1u6ge_98",vt="_goodsPrice_1u6ge_104",Mt="_free_1u6ge_110",Dt="_goodsNums_1u6ge_113",Lt="_brandName_1u6ge_128",Rt="_model_1u6ge_137",Ut="_popupCode_1u6ge_143",kt="_codeContainer_1u6ge_147",Ot="_codeClose_1u6ge_150",Vt="_codeImg_1u6ge_160",zt="_codeTitle_1u6ge_167",qt="_codeName_1u6ge_175",xt="_codeQr_1u6ge_182",Ht="_codeBtnText_1u6ge_195",Gt="_codeTips_1u6ge_206",Qt="_tipsTitle_1u6ge_220",Yt="_close_1u6ge_226",Jt="_codeBottom_1u6ge_231",jt="_title_1u6ge_238",Kt="_shareImg_1u6ge_253",Zt="_shareText_1u6ge_257",Xt="_freight_1u6ge_263",Wt="_submitBtn_1u6ge_275",T={cartConfirm:pt,cartConfirmBox:yt,cartItem:wt,mlr13:_t,protocol:Ct,paymentContainer:Et,needPrice:Bt,allPrice:At,cellItem:It,img:Tt,cellPrice:Nt,numFont:St,numPrefix:bt,goodsContent:Pt,goodsNum:Ft,goodsPrice:vt,free:Mt,goodsNums:Dt,brandName:Lt,model:Rt,popupCode:Ut,codeContainer:kt,codeClose:Ot,codeImg:Vt,codeTitle:zt,codeName:qt,codeQr:xt,codeBtnText:Ht,codeTips:Gt,tipsTitle:Qt,close:Yt,codeBottom:Jt,title:jt,shareImg:Kt,shareText:Zt,freight:Xt,submitBtn:Wt},$t="_cellEntry_1kuxn_1",en="_cell_1kuxn_1",tn="_userName_1kuxn_36",nn="_phone_1kuxn_41",on="_addressInfo_1kuxn_46",rn="_emtry_1kuxn_51",V={cellEntry:$t,cell:en,userName:tn,phone:nn,addressInfo:on,emtry:rn},sn="data:image/png;base64,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",an=O({name:"cart-address",props:{item:{type:Object,default:()=>({})},isLink:{type:Boolean,default:!0},setAddress:{type:Function,default:e=>{}}},setup(e){const n=Ee(),t=Ve(()=>[e.item.provinceName,e.item.cityName,e.item.regionName,e.item.detailAddress].join("")),s=()=>{e.isLink&&n.push("/shopAddress")};return()=>l(he,null,[e.item&&e.item.phoneNumber?l(q,{class:V.cell,"is-link":e.isLink,onClick:()=>s(),titleStyle:{marginLeft:"0"}},{title:()=>l("div",null,[l("span",{class:V.userName},[e.item.name]),l("span",{class:V.phone},[e.item&&e.item.phoneNumber&&e.item.phoneNumber.replace(/^(\d{3})\d{4}(\d+)/,"$1****$2")]),e.item.defaultStatus&&l(He,{type:"primary",color:"linear-gradient(90deg, #FF8633 0%, #FFB047 100%)",round:!0,style:{"vertical-align":"text-top",marginLeft:"10px",padding:"1px 8px"}},{default:()=>[A("默认")]})]),label:()=>l("span",{class:V.addressInfo},[t.value])}):l(q,{class:V.cell,"is-link":e.isLink,onClick:()=>s()},{icon:()=>l(ee,{name:sn,size:28},null),title:()=>l("div",{class:V.emtry},[A("去填写收货地址")])})])}}),un="_payment_1ot0l_1",ln="_title_1ot0l_13",cn="_payAmount_1ot0l_21",dn="_amount_1ot0l_31",fn="_blank_1ot0l_38",gn="_payTypeRe_1ot0l_41",hn="_recommend_1ot0l_45",mn="_payBtn_1ot0l_54",L={payment:un,title:ln,payAmount:cn,amount:dn,blank:fn,payTypeRe:gn,recommend:hn,payBtn:mn},pn=O({name:"payment",props:{paymentConfig:{type:Object,default:{}}},emits:["backOut","close","confirm"],setup(e,{slots:n,attrs:t,emit:s}){const o=Be({payType:"wx",pay_channel:""}),r=()=>{ut({message:"是否放弃本次付款",confirmButtonText:"继续付款",cancelButtonText:"放弃",showCancelButton:!0}).catch(async()=>{await a(),s("backOut"),s("close")})},a=async d=>{},u=async()=>{const d=o.payType;U().weixin?d=="zfb"?(o.pay_channel="alipay_qr",i("qrCode")):d=="wx"&&(o.pay_channel="wx_pub",i("pay")):U().alipay?d=="zfb"?(o.pay_channel="alipay_wap",i("pay")):d=="wx"&&(o.pay_channel="wx_pub",i("qrCode")):(d=="zfb"?o.pay_channel="alipay_qr":d=="wx"&&(o.pay_channel="wx_pub"),i("qrCode"))},i=d=>{const f=d=="qrCode"?"payCenter":"payResult";s("confirm",{payCode:f,pay_channel:o.pay_channel})};return()=>l("div",{class:L.payment},[l(ee,{onClick:r,name:"cross",size:20},null),l("div",{class:[L.title]},[A("选择支付方式")]),l("div",{class:L.payAmount},[l("p",null,[A("应付金额")]),l("div",{class:L.amount},[l("span",null,[A("¥ ")]),me(e.paymentConfig.currentPrice)])]),l(ft,{modelValue:o.payType,"onUpdate:modelValue":d=>o.payType=d},{default:()=>[l(Te,{border:!1},{default:()=>[l(q,{border:!0,center:!0,onClick:()=>{o.payType="wx"}},{icon:()=>l(ee,{name:"wechat-pay",color:"#15c434",size:22},null),"right-icon":()=>l(Me,{name:"wx"},null),title:()=>l("div",{class:L.payTypeRe},[A("微信支付 "),l("span",{class:L.recommend},[A("推荐")])])}),l(q,{title:"支付宝支付",border:!0,center:!0,onClick:()=>{o.payType="zfb"}},{icon:()=>l(ee,{name:"alipay",color:"#009fe9",size:22},null),"right-icon":()=>l(Me,{name:"zfb"},null)})]})]}),l("div",{class:L.blank},null),l(Ae,{type:"primary",class:L.payBtn,block:!0,round:!0,onClick:u},{default:()=>[A("确认支付")]})])}}),Le=O({name:"col-popup",props:{height:{type:String,default:"100%"},width:{type:String,default:"100%"},teleport:{type:String,default:""},destroy:{type:Boolean,default:!1},modelValue:{type:Boolean,default:!1},position:{type:String,default:"bottom"},zIndex:{type:Number,default:2018}},emits:["close","update:modelValue"],data(){return{popupShow:!1,isDestroy:!1}},watch:{modelValue(){this.hashState()}},mounted(){this.destroy&&(this.isDestroy=!1),window.addEventListener("hashchange",this.onHash,!1)},unmounted(){window.removeEventListener("hashchange",this.onHash,!1)},methods:{onHash(){this.$emit("update:modelValue",!1),this.isDestroy=!1,this.$emit("close")},onPopupClose(e){this.$emit("update:modelValue",e),this.hashState()},hashState(){if(this.modelValue){this.isDestroy=!1;const e=window.location.hash.slice(1).split("?"),n=pe.parse(e[1]);let t=0;for(const r in n)t++;const s=window.location.href,o=t>0?"&sPop="+ +new Date:"?sPop="+ +new Date;history.pushState("","",`${s}${o}`)}else{const e=window.location.hash.slice(1).split("?");pe.parse(e[1]).sPop&&window.history.go(-1)}this.$refs.protocolPopup&&(this.$refs.protocolPopup.scrollTop=0)}},render(){return l(ze,{ref:"protocolPopup",show:this.modelValue,transitionAppear:!0,position:this.position,teleport:this.teleport,style:{height:this.height,width:this.width},zIndex:this.zIndex,onClosed:()=>{this.destroy&&(this.isDestroy=!0)}},{default:()=>[this.$slots.default&&!this.isDestroy&&this.$slots.default()]})}}),yn="_userAuth_1sper_1",wn="_cellGroup_1sper_6",_n="_btnGroup_1sper_38",Re={userAuth:yn,cellGroup:wn,btnGroup:_n},Cn=O({name:"UserAuth",props:{onSuccess:{type:Function,default:()=>{}},hideHeader:{type:Boolean,default:!1}},data(){return{form:{realName:"",idCardNo:""}}},mounted(){const e=te.user.data;this.form.realName=e==null?void 0:e.account.realName},methods:{async onSubmit(){try{const e="/edu-app/sysAccount/realNameAuth";await z.post(e,{data:{...this.form,contract:!0,save:!0}}),te.user.data.account.realName=this.form.realName,te.user.data.account.idCardNo=this.form.idCardNo,this.onSuccess()}catch(e){}}},render(){return l(gt,{class:Re.userAuth,onSubmit:this.onSubmit},{default:()=>[!this.hideHeader&&l(Ie,{title:"实名认证"},null),l(Te,{inset:!0,class:Re.cellGroup},{default:()=>[l(De,{required:!0,label:"真实姓名",modelValue:this.form.realName,"onUpdate:modelValue":e=>this.form.realName=e,rules:[{required:!0,message:"请填写真实姓名"}],name:"realName",placeholder:"请填写真实姓名",maxlength:"50"},null),l(De,{required:!0,label:"身份证号",modelValue:this.form.idCardNo,"onUpdate:modelValue":e=>this.form.idCardNo=e,maxlength:18,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)]}),l("div",{class:["btnGroup"]},[l(Ae,{block:!0,round:!0,type:"primary","native-type":"submit"},{default:()=>[A("确定")]})])]})}}),En={WAIT_PAY:"待支付",PAYING:"支付中",PAID:"已付款",TIMEOUT:"已关闭",FAIL:"支付失败",CLOSED:"已关闭",REFUNDING:"退款中",REFUNDED:"已退款"},Bn="_saveShareImage_y5txd_1",An="_btnHeader_y5txd_16",In="_iconBack_y5txd_21",Tn="_previewSection_y5txd_28",Nn="_topImage_y5txd_35",Sn="_shareContaienr_y5txd_42",bn="_orchestraContainer_y5txd_51",Pn="_schoolName_y5txd_55",Fn="_tips_y5txd_61",vn="_tipsTitle_y5txd_67",Mn="_tipsContent_y5txd_73",Dn="_schoolLogo_y5txd_79",Ln="_shareType_y5txd_99",Rn="_qrcodeSection_y5txd_108",Un="_memo_y5txd_116",kn="_endTime_y5txd_128",b={saveShareImage:Bn,btnHeader:An,iconBack:In,previewSection:Tn,topImage:Nn,shareContaienr:Sn,orchestraContainer:bn,schoolName:Pn,tips:Fn,tipsTitle:vn,tipsContent:Mn,schoolLogo:Dn,shareType:Ln,qrcodeSection:Rn,memo:Un,endTime:kn},On=""+new URL("orchestra-top_bg-5f030910.png",import.meta.url).href,Vn=""+new URL("smallLogo-517ff5bd.png",import.meta.url).href;var K={},zn=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},Ye={},S={};let Ne;const qn=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];S.getSymbolSize=function(n){if(!n)throw new Error('"version" cannot be null or undefined');if(n<1||n>40)throw new Error('"version" should be in range from 1 to 40');return n*4+17};S.getSymbolTotalCodewords=function(n){return qn[n]};S.getBCHDigit=function(e){let n=0;for(;e!==0;)n++,e>>>=1;return n};S.setToSJISFunction=function(n){if(typeof n!="function")throw new Error('"toSJISFunc" is not a valid function.');Ne=n};S.isKanjiModeEnabled=function(){return typeof Ne<"u"};S.toSJIS=function(n){return Ne(n)};var re={};(function(e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function n(t){if(typeof t!="string")throw new Error("Param is not a string");switch(t.toLowerCase()){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw new Error("Unknown EC Level: "+t)}}e.isValid=function(s){return s&&typeof s.bit<"u"&&s.bit>=0&&s.bit<4},e.from=function(s,o){if(e.isValid(s))return s;try{return n(s)}catch(r){return o}}})(re);function Je(){this.buffer=[],this.length=0}Je.prototype={get:function(e){const n=Math.floor(e/8);return(this.buffer[n]>>>7-e%8&1)===1},put:function(e,n){for(let t=0;t<n;t++)this.putBit((e>>>n-t-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(e){const n=Math.floor(this.length/8);this.buffer.length<=n&&this.buffer.push(0),e&&(this.buffer[n]|=128>>>this.length%8),this.length++}};var xn=Je;function Z(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}Z.prototype.set=function(e,n,t,s){const o=e*this.size+n;this.data[o]=t,s&&(this.reservedBit[o]=!0)};Z.prototype.get=function(e,n){return this.data[e*this.size+n]};Z.prototype.xor=function(e,n,t){this.data[e*this.size+n]^=t};Z.prototype.isReserved=function(e,n){return this.reservedBit[e*this.size+n]};var Hn=Z,je={};(function(e){const n=S.getSymbolSize;e.getRowColCoords=function(s){if(s===1)return[];const o=Math.floor(s/7)+2,r=n(s),a=r===145?26:Math.ceil((r-13)/(2*o-2))*2,u=[r-7];for(let i=1;i<o-1;i++)u[i]=u[i-1]-a;return u.push(6),u.reverse()},e.getPositions=function(s){const o=[],r=e.getRowColCoords(s),a=r.length;for(let u=0;u<a;u++)for(let i=0;i<a;i++)u===0&&i===0||u===0&&i===a-1||u===a-1&&i===0||o.push([r[u],r[i]]);return o}})(je);var Ke={};const Gn=S.getSymbolSize,Ue=7;Ke.getPositions=function(n){const t=Gn(n);return[[0,0],[t-Ue,0],[0,t-Ue]]};var Ze={};(function(e){e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const n={N1:3,N2:3,N3:40,N4:10};e.isValid=function(o){return o!=null&&o!==""&&!isNaN(o)&&o>=0&&o<=7},e.from=function(o){return e.isValid(o)?parseInt(o,10):void 0},e.getPenaltyN1=function(o){const r=o.size;let a=0,u=0,i=0,d=null,f=null;for(let B=0;B<r;B++){u=i=0,d=f=null;for(let p=0;p<r;p++){let g=o.get(B,p);g===d?u++:(u>=5&&(a+=n.N1+(u-5)),d=g,u=1),g=o.get(p,B),g===f?i++:(i>=5&&(a+=n.N1+(i-5)),f=g,i=1)}u>=5&&(a+=n.N1+(u-5)),i>=5&&(a+=n.N1+(i-5))}return a},e.getPenaltyN2=function(o){const r=o.size;let a=0;for(let u=0;u<r-1;u++)for(let i=0;i<r-1;i++){const d=o.get(u,i)+o.get(u,i+1)+o.get(u+1,i)+o.get(u+1,i+1);(d===4||d===0)&&a++}return a*n.N2},e.getPenaltyN3=function(o){const r=o.size;let a=0,u=0,i=0;for(let d=0;d<r;d++){u=i=0;for(let f=0;f<r;f++)u=u<<1&2047|o.get(d,f),f>=10&&(u===1488||u===93)&&a++,i=i<<1&2047|o.get(f,d),f>=10&&(i===1488||i===93)&&a++}return a*n.N3},e.getPenaltyN4=function(o){let r=0;const a=o.data.length;for(let i=0;i<a;i++)r+=o.data[i];return Math.abs(Math.ceil(r*100/a/5)-10)*n.N4};function t(s,o,r){switch(s){case e.Patterns.PATTERN000:return(o+r)%2===0;case e.Patterns.PATTERN001:return o%2===0;case e.Patterns.PATTERN010:return r%3===0;case e.Patterns.PATTERN011:return(o+r)%3===0;case e.Patterns.PATTERN100:return(Math.floor(o/2)+Math.floor(r/3))%2===0;case e.Patterns.PATTERN101:return o*r%2+o*r%3===0;case e.Patterns.PATTERN110:return(o*r%2+o*r%3)%2===0;case e.Patterns.PATTERN111:return(o*r%3+(o+r)%2)%2===0;default:throw new Error("bad maskPattern:"+s)}}e.applyMask=function(o,r){const a=r.size;for(let u=0;u<a;u++)for(let i=0;i<a;i++)r.isReserved(i,u)||r.xor(i,u,t(o,i,u))},e.getBestMask=function(o,r){const a=Object.keys(e.Patterns).length;let u=0,i=1/0;for(let d=0;d<a;d++){r(d),e.applyMask(d,o);const f=e.getPenaltyN1(o)+e.getPenaltyN2(o)+e.getPenaltyN3(o)+e.getPenaltyN4(o);e.applyMask(d,o),f<i&&(i=f,u=d)}return u}})(Ze);var se={};const R=re,X=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],W=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];se.getBlocksCount=function(n,t){switch(t){case R.L:return X[(n-1)*4+0];case R.M:return X[(n-1)*4+1];case R.Q:return X[(n-1)*4+2];case R.H:return X[(n-1)*4+3];default:return}};se.getTotalCodewordsCount=function(n,t){switch(t){case R.L:return W[(n-1)*4+0];case R.M:return W[(n-1)*4+1];case R.Q:return W[(n-1)*4+2];case R.H:return W[(n-1)*4+3];default:return}};var Xe={},ae={};const J=new Uint8Array(512),ne=new Uint8Array(256);(function(){let n=1;for(let t=0;t<255;t++)J[t]=n,ne[n]=t,n<<=1,n&256&&(n^=285);for(let t=255;t<512;t++)J[t]=J[t-255]})();ae.log=function(n){if(n<1)throw new Error("log("+n+")");return ne[n]};ae.exp=function(n){return J[n]};ae.mul=function(n,t){return n===0||t===0?0:J[ne[n]+ne[t]]};(function(e){const n=ae;e.mul=function(s,o){const r=new Uint8Array(s.length+o.length-1);for(let a=0;a<s.length;a++)for(let u=0;u<o.length;u++)r[a+u]^=n.mul(s[a],o[u]);return r},e.mod=function(s,o){let r=new Uint8Array(s);for(;r.length-o.length>=0;){const a=r[0];for(let i=0;i<o.length;i++)r[i]^=n.mul(o[i],a);let u=0;for(;u<r.length&&r[u]===0;)u++;r=r.slice(u)}return r},e.generateECPolynomial=function(s){let o=new Uint8Array([1]);for(let r=0;r<s;r++)o=e.mul(o,new Uint8Array([1,n.exp(r)]));return o}})(Xe);const We=Xe;function Se(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}Se.prototype.initialize=function(n){this.degree=n,this.genPoly=We.generateECPolynomial(this.degree)};Se.prototype.encode=function(n){if(!this.genPoly)throw new Error("Encoder not initialized");const t=new Uint8Array(n.length+this.degree);t.set(n);const s=We.mod(t,this.genPoly),o=this.degree-s.length;if(o>0){const r=new Uint8Array(this.degree);return r.set(s,o),r}return s};var Qn=Se,$e={},k={},be={};be.isValid=function(n){return!isNaN(n)&&n>=1&&n<=40};var v={};const et="[0-9]+",Yn="[A-Z $%*+\\-./:]+";let j="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";j=j.replace(/u/g,"\\u");const Jn="(?:(?![A-Z0-9 $%*+\\-./:]|"+j+`)(?:.|[\r
- ]))+`;v.KANJI=new RegExp(j,"g");v.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");v.BYTE=new RegExp(Jn,"g");v.NUMERIC=new RegExp(et,"g");v.ALPHANUMERIC=new RegExp(Yn,"g");const jn=new RegExp("^"+j+"$"),Kn=new RegExp("^"+et+"$"),Zn=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");v.testKanji=function(n){return jn.test(n)};v.testNumeric=function(n){return Kn.test(n)};v.testAlphanumeric=function(n){return Zn.test(n)};(function(e){const n=be,t=v;e.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(r,a){if(!r.ccBits)throw new Error("Invalid mode: "+r);if(!n.isValid(a))throw new Error("Invalid version: "+a);return a>=1&&a<10?r.ccBits[0]:a<27?r.ccBits[1]:r.ccBits[2]},e.getBestModeForData=function(r){return t.testNumeric(r)?e.NUMERIC:t.testAlphanumeric(r)?e.ALPHANUMERIC:t.testKanji(r)?e.KANJI:e.BYTE},e.toString=function(r){if(r&&r.id)return r.id;throw new Error("Invalid mode")},e.isValid=function(r){return r&&r.bit&&r.ccBits};function s(o){if(typeof o!="string")throw new Error("Param is not a string");switch(o.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+o)}}e.from=function(r,a){if(e.isValid(r))return r;try{return s(r)}catch(u){return a}}})(k);(function(e){const n=S,t=se,s=re,o=k,r=be,a=7973,u=n.getBCHDigit(a);function i(p,g,C){for(let c=1;c<=40;c++)if(g<=e.getCapacity(c,C,p))return c}function d(p,g){return o.getCharCountIndicator(p,g)+4}function f(p,g){let C=0;return p.forEach(function(c){const w=d(c.mode,g);C+=w+c.getBitsLength()}),C}function B(p,g){for(let C=1;C<=40;C++)if(f(p,C)<=e.getCapacity(C,g,o.MIXED))return C}e.from=function(g,C){return r.isValid(g)?parseInt(g,10):C},e.getCapacity=function(g,C,c){if(!r.isValid(g))throw new Error("Invalid QR Code version");typeof c>"u"&&(c=o.BYTE);const w=n.getSymbolTotalCodewords(g),h=t.getTotalCodewordsCount(g,C),_=(w-h)*8;if(c===o.MIXED)return _;const m=_-d(c,g);switch(c){case o.NUMERIC:return Math.floor(m/10*3);case o.ALPHANUMERIC:return Math.floor(m/11*2);case o.KANJI:return Math.floor(m/13);case o.BYTE:default:return Math.floor(m/8)}},e.getBestVersionForData=function(g,C){let c;const w=s.from(C,s.M);if(Array.isArray(g)){if(g.length>1)return B(g,w);if(g.length===0)return 1;c=g[0]}else c=g;return i(c.mode,c.getLength(),w)},e.getEncodedBits=function(g){if(!r.isValid(g)||g<7)throw new Error("Invalid QR Code version");let C=g<<12;for(;n.getBCHDigit(C)-u>=0;)C^=a<<n.getBCHDigit(C)-u;return g<<12|C}})($e);var tt={};const ye=S,nt=1335,Xn=21522,ke=ye.getBCHDigit(nt);tt.getEncodedBits=function(n,t){const s=n.bit<<3|t;let o=s<<10;for(;ye.getBCHDigit(o)-ke>=0;)o^=nt<<ye.getBCHDigit(o)-ke;return(s<<10|o)^Xn};var ot={};const Wn=k;function x(e){this.mode=Wn.NUMERIC,this.data=e.toString()}x.getBitsLength=function(n){return 10*Math.floor(n/3)+(n%3?n%3*3+1:0)};x.prototype.getLength=function(){return this.data.length};x.prototype.getBitsLength=function(){return x.getBitsLength(this.data.length)};x.prototype.write=function(n){let t,s,o;for(t=0;t+3<=this.data.length;t+=3)s=this.data.substr(t,3),o=parseInt(s,10),n.put(o,10);const r=this.data.length-t;r>0&&(s=this.data.substr(t),o=parseInt(s,10),n.put(o,r*3+1))};var $n=x;const eo=k,le=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function H(e){this.mode=eo.ALPHANUMERIC,this.data=e}H.getBitsLength=function(n){return 11*Math.floor(n/2)+6*(n%2)};H.prototype.getLength=function(){return this.data.length};H.prototype.getBitsLength=function(){return H.getBitsLength(this.data.length)};H.prototype.write=function(n){let t;for(t=0;t+2<=this.data.length;t+=2){let s=le.indexOf(this.data[t])*45;s+=le.indexOf(this.data[t+1]),n.put(s,11)}this.data.length%2&&n.put(le.indexOf(this.data[t]),6)};var to=H,no=function(n){for(var t=[],s=n.length,o=0;o<s;o++){var r=n.charCodeAt(o);if(r>=55296&&r<=56319&&s>o+1){var a=n.charCodeAt(o+1);a>=56320&&a<=57343&&(r=(r-55296)*1024+a-56320+65536,o+=1)}if(r<128){t.push(r);continue}if(r<2048){t.push(r>>6|192),t.push(r&63|128);continue}if(r<55296||r>=57344&&r<65536){t.push(r>>12|224),t.push(r>>6&63|128),t.push(r&63|128);continue}if(r>=65536&&r<=1114111){t.push(r>>18|240),t.push(r>>12&63|128),t.push(r>>6&63|128),t.push(r&63|128);continue}t.push(239,191,189)}return new Uint8Array(t).buffer};const oo=no,ro=k;function G(e){this.mode=ro.BYTE,typeof e=="string"&&(e=oo(e)),this.data=new Uint8Array(e)}G.getBitsLength=function(n){return n*8};G.prototype.getLength=function(){return this.data.length};G.prototype.getBitsLength=function(){return G.getBitsLength(this.data.length)};G.prototype.write=function(e){for(let n=0,t=this.data.length;n<t;n++)e.put(this.data[n],8)};var so=G;const ao=k,io=S;function Q(e){this.mode=ao.KANJI,this.data=e}Q.getBitsLength=function(n){return n*13};Q.prototype.getLength=function(){return this.data.length};Q.prototype.getBitsLength=function(){return Q.getBitsLength(this.data.length)};Q.prototype.write=function(e){let n;for(n=0;n<this.data.length;n++){let t=io.toSJIS(this.data[n]);if(t>=33088&&t<=40956)t-=33088;else if(t>=57408&&t<=60351)t-=49472;else throw new Error("Invalid SJIS character: "+this.data[n]+`
- Make sure your charset is UTF-8`);t=(t>>>8&255)*192+(t&255),e.put(t,13)}};var uo=Q,rt={exports:{}};(function(e){var n={single_source_shortest_paths:function(t,s,o){var r={},a={};a[s]=0;var u=n.PriorityQueue.make();u.push(s,0);for(var i,d,f,B,p,g,C,c,w;!u.empty();){i=u.pop(),d=i.value,B=i.cost,p=t[d]||{};for(f in p)p.hasOwnProperty(f)&&(g=p[f],C=B+g,c=a[f],w=typeof a[f]>"u",(w||c>C)&&(a[f]=C,u.push(f,C),r[f]=d))}if(typeof o<"u"&&typeof a[o]>"u"){var h=["Could not find a path from ",s," to ",o,"."].join("");throw new Error(h)}return r},extract_shortest_path_from_predecessor_list:function(t,s){for(var o=[],r=s;r;)o.push(r),t[r],r=t[r];return o.reverse(),o},find_path:function(t,s,o){var r=n.single_source_shortest_paths(t,s,o);return n.extract_shortest_path_from_predecessor_list(r,o)},PriorityQueue:{make:function(t){var s=n.PriorityQueue,o={},r;t=t||{};for(r in s)s.hasOwnProperty(r)&&(o[r]=s[r]);return o.queue=[],o.sorter=t.sorter||s.default_sorter,o},default_sorter:function(t,s){return t.cost-s.cost},push:function(t,s){var o={value:t,cost:s};this.queue.push(o),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};e.exports=n})(rt);var lo=rt.exports;(function(e){const n=k,t=$n,s=to,o=so,r=uo,a=v,u=S,i=lo;function d(h){return unescape(encodeURIComponent(h)).length}function f(h,_,m){const y=[];let E;for(;(E=h.exec(m))!==null;)y.push({data:E[0],index:E.index,mode:_,length:E[0].length});return y}function B(h){const _=f(a.NUMERIC,n.NUMERIC,h),m=f(a.ALPHANUMERIC,n.ALPHANUMERIC,h);let y,E;return u.isKanjiModeEnabled()?(y=f(a.BYTE,n.BYTE,h),E=f(a.KANJI,n.KANJI,h)):(y=f(a.BYTE_KANJI,n.BYTE,h),E=[]),_.concat(m,y,E).sort(function(N,P){return N.index-P.index}).map(function(N){return{data:N.data,mode:N.mode,length:N.length}})}function p(h,_){switch(_){case n.NUMERIC:return t.getBitsLength(h);case n.ALPHANUMERIC:return s.getBitsLength(h);case n.KANJI:return r.getBitsLength(h);case n.BYTE:return o.getBitsLength(h)}}function g(h){return h.reduce(function(_,m){const y=_.length-1>=0?_[_.length-1]:null;return y&&y.mode===m.mode?(_[_.length-1].data+=m.data,_):(_.push(m),_)},[])}function C(h){const _=[];for(let m=0;m<h.length;m++){const y=h[m];switch(y.mode){case n.NUMERIC:_.push([y,{data:y.data,mode:n.ALPHANUMERIC,length:y.length},{data:y.data,mode:n.BYTE,length:y.length}]);break;case n.ALPHANUMERIC:_.push([y,{data:y.data,mode:n.BYTE,length:y.length}]);break;case n.KANJI:_.push([y,{data:y.data,mode:n.BYTE,length:d(y.data)}]);break;case n.BYTE:_.push([{data:y.data,mode:n.BYTE,length:d(y.data)}])}}return _}function c(h,_){const m={},y={start:{}};let E=["start"];for(let I=0;I<h.length;I++){const N=h[I],P=[];for(let D=0;D<N.length;D++){const F=N[D],Y=""+I+D;P.push(Y),m[Y]={node:F,lastCount:0},y[Y]={};for(let ue=0;ue<E.length;ue++){const M=E[ue];m[M]&&m[M].node.mode===F.mode?(y[M][Y]=p(m[M].lastCount+F.length,F.mode)-p(m[M].lastCount,F.mode),m[M].lastCount+=F.length):(m[M]&&(m[M].lastCount=F.length),y[M][Y]=p(F.length,F.mode)+4+n.getCharCountIndicator(F.mode,_))}}E=P}for(let I=0;I<E.length;I++)y[E[I]].end=0;return{map:y,table:m}}function w(h,_){let m;const y=n.getBestModeForData(h);if(m=n.from(_,y),m!==n.BYTE&&m.bit<y.bit)throw new Error('"'+h+'" cannot be encoded with mode '+n.toString(m)+`.
- Suggested mode is: `+n.toString(y));switch(m===n.KANJI&&!u.isKanjiModeEnabled()&&(m=n.BYTE),m){case n.NUMERIC:return new t(h);case n.ALPHANUMERIC:return new s(h);case n.KANJI:return new r(h);case n.BYTE:return new o(h)}}e.fromArray=function(_){return _.reduce(function(m,y){return typeof y=="string"?m.push(w(y,null)):y.data&&m.push(w(y.data,y.mode)),m},[])},e.fromString=function(_,m){const y=B(_,u.isKanjiModeEnabled()),E=C(y),I=c(E,m),N=i.find_path(I.map,"start","end"),P=[];for(let D=1;D<N.length-1;D++)P.push(I.table[N[D]].node);return e.fromArray(g(P))},e.rawSplit=function(_){return e.fromArray(B(_,u.isKanjiModeEnabled()))}})(ot);const ie=S,ce=re,co=xn,fo=Hn,go=je,ho=Ke,we=Ze,_e=se,mo=Qn,oe=$e,po=tt,yo=k,de=ot;function wo(e,n){const t=e.size,s=ho.getPositions(n);for(let o=0;o<s.length;o++){const r=s[o][0],a=s[o][1];for(let u=-1;u<=7;u++)if(!(r+u<=-1||t<=r+u))for(let i=-1;i<=7;i++)a+i<=-1||t<=a+i||(u>=0&&u<=6&&(i===0||i===6)||i>=0&&i<=6&&(u===0||u===6)||u>=2&&u<=4&&i>=2&&i<=4?e.set(r+u,a+i,!0,!0):e.set(r+u,a+i,!1,!0))}}function _o(e){const n=e.size;for(let t=8;t<n-8;t++){const s=t%2===0;e.set(t,6,s,!0),e.set(6,t,s,!0)}}function Co(e,n){const t=go.getPositions(n);for(let s=0;s<t.length;s++){const o=t[s][0],r=t[s][1];for(let a=-2;a<=2;a++)for(let u=-2;u<=2;u++)a===-2||a===2||u===-2||u===2||a===0&&u===0?e.set(o+a,r+u,!0,!0):e.set(o+a,r+u,!1,!0)}}function Eo(e,n){const t=e.size,s=oe.getEncodedBits(n);let o,r,a;for(let u=0;u<18;u++)o=Math.floor(u/3),r=u%3+t-8-3,a=(s>>u&1)===1,e.set(o,r,a,!0),e.set(r,o,a,!0)}function fe(e,n,t){const s=e.size,o=po.getEncodedBits(n,t);let r,a;for(r=0;r<15;r++)a=(o>>r&1)===1,r<6?e.set(r,8,a,!0):r<8?e.set(r+1,8,a,!0):e.set(s-15+r,8,a,!0),r<8?e.set(8,s-r-1,a,!0):r<9?e.set(8,15-r-1+1,a,!0):e.set(8,15-r-1,a,!0);e.set(s-8,8,1,!0)}function Bo(e,n){const t=e.size;let s=-1,o=t-1,r=7,a=0;for(let u=t-1;u>0;u-=2)for(u===6&&u--;;){for(let i=0;i<2;i++)if(!e.isReserved(o,u-i)){let d=!1;a<n.length&&(d=(n[a]>>>r&1)===1),e.set(o,u-i,d),r--,r===-1&&(a++,r=7)}if(o+=s,o<0||t<=o){o-=s,s=-s;break}}}function Ao(e,n,t){const s=new co;t.forEach(function(i){s.put(i.mode.bit,4),s.put(i.getLength(),yo.getCharCountIndicator(i.mode,e)),i.write(s)});const o=ie.getSymbolTotalCodewords(e),r=_e.getTotalCodewordsCount(e,n),a=(o-r)*8;for(s.getLengthInBits()+4<=a&&s.put(0,4);s.getLengthInBits()%8!==0;)s.putBit(0);const u=(a-s.getLengthInBits())/8;for(let i=0;i<u;i++)s.put(i%2?17:236,8);return Io(s,e,n)}function Io(e,n,t){const s=ie.getSymbolTotalCodewords(n),o=_e.getTotalCodewordsCount(n,t),r=s-o,a=_e.getBlocksCount(n,t),u=s%a,i=a-u,d=Math.floor(s/a),f=Math.floor(r/a),B=f+1,p=d-f,g=new mo(p);let C=0;const c=new Array(a),w=new Array(a);let h=0;const _=new Uint8Array(e.buffer);for(let N=0;N<a;N++){const P=N<i?f:B;c[N]=_.slice(C,C+P),w[N]=g.encode(c[N]),C+=P,h=Math.max(h,P)}const m=new Uint8Array(s);let y=0,E,I;for(E=0;E<h;E++)for(I=0;I<a;I++)E<c[I].length&&(m[y++]=c[I][E]);for(E=0;E<p;E++)for(I=0;I<a;I++)m[y++]=w[I][E];return m}function To(e,n,t,s){let o;if(Array.isArray(e))o=de.fromArray(e);else if(typeof e=="string"){let d=n;if(!d){const f=de.rawSplit(e);d=oe.getBestVersionForData(f,t)}o=de.fromString(e,d||40)}else throw new Error("Invalid data");const r=oe.getBestVersionForData(o,t);if(!r)throw new Error("The amount of data is too big to be stored in a QR Code");if(!n)n=r;else if(n<r)throw new Error(`
- The chosen QR Code version cannot contain this amount of data.
- Minimum version required to store current data is: `+r+`.
- `);const a=Ao(n,t,o),u=ie.getSymbolSize(n),i=new fo(u);return wo(i,n),_o(i),Co(i,n),fe(i,t,0),n>=7&&Eo(i,n),Bo(i,a),isNaN(s)&&(s=we.getBestMask(i,fe.bind(null,i,t))),we.applyMask(s,i),fe(i,t,s),{modules:i,version:n,errorCorrectionLevel:t,maskPattern:s,segments:o}}Ye.create=function(n,t){if(typeof n>"u"||n==="")throw new Error("No input text");let s=ce.M,o,r;return typeof t<"u"&&(s=ce.from(t.errorCorrectionLevel,ce.M),o=oe.from(t.version),r=we.from(t.maskPattern),t.toSJISFunc&&ie.setToSJISFunction(t.toSJISFunc)),To(n,o,s,r)};var st={},Pe={};(function(e){function n(t){if(typeof t=="number"&&(t=t.toString()),typeof t!="string")throw new Error("Color should be defined as hex string");let s=t.slice().replace("#","").split("");if(s.length<3||s.length===5||s.length>8)throw new Error("Invalid hex color: "+t);(s.length===3||s.length===4)&&(s=Array.prototype.concat.apply([],s.map(function(r){return[r,r]}))),s.length===6&&s.push("F","F");const o=parseInt(s.join(""),16);return{r:o>>24&255,g:o>>16&255,b:o>>8&255,a:o&255,hex:"#"+s.slice(0,6).join("")}}e.getOptions=function(s){s||(s={}),s.color||(s.color={});const o=typeof s.margin>"u"||s.margin===null||s.margin<0?4:s.margin,r=s.width&&s.width>=21?s.width:void 0,a=s.scale||4;return{width:r,scale:r?4:a,margin:o,color:{dark:n(s.color.dark||"#000000ff"),light:n(s.color.light||"#ffffffff")},type:s.type,rendererOpts:s.rendererOpts||{}}},e.getScale=function(s,o){return o.width&&o.width>=s+o.margin*2?o.width/(s+o.margin*2):o.scale},e.getImageWidth=function(s,o){const r=e.getScale(s,o);return Math.floor((s+o.margin*2)*r)},e.qrToImageData=function(s,o,r){const a=o.modules.size,u=o.modules.data,i=e.getScale(a,r),d=Math.floor((a+r.margin*2)*i),f=r.margin*i,B=[r.color.light,r.color.dark];for(let p=0;p<d;p++)for(let g=0;g<d;g++){let C=(p*d+g)*4,c=r.color.light;if(p>=f&&g>=f&&p<d-f&&g<d-f){const w=Math.floor((p-f)/i),h=Math.floor((g-f)/i);c=B[u[w*a+h]?1:0]}s[C++]=c.r,s[C++]=c.g,s[C++]=c.b,s[C]=c.a}}})(Pe);(function(e){const n=Pe;function t(o,r,a){o.clearRect(0,0,r.width,r.height),r.style||(r.style={}),r.height=a,r.width=a,r.style.height=a+"px",r.style.width=a+"px"}function s(){try{return document.createElement("canvas")}catch(o){throw new Error("You need to specify a canvas element")}}e.render=function(r,a,u){let i=u,d=a;typeof i>"u"&&(!a||!a.getContext)&&(i=a,a=void 0),a||(d=s()),i=n.getOptions(i);const f=n.getImageWidth(r.modules.size,i),B=d.getContext("2d"),p=B.createImageData(f,f);return n.qrToImageData(p.data,r,i),t(B,d,f),B.putImageData(p,0,0),d},e.renderToDataURL=function(r,a,u){let i=u;typeof i>"u"&&(!a||!a.getContext)&&(i=a,a=void 0),i||(i={});const d=e.render(r,a,i),f=i.type||"image/png",B=i.rendererOpts||{};return d.toDataURL(f,B.quality)}})(st);var at={};const No=Pe;function Oe(e,n){const t=e.a/255,s=n+'="'+e.hex+'"';return t<1?s+" "+n+'-opacity="'+t.toFixed(2).slice(1)+'"':s}function ge(e,n,t){let s=e+n;return typeof t<"u"&&(s+=" "+t),s}function So(e,n,t){let s="",o=0,r=!1,a=0;for(let u=0;u<e.length;u++){const i=Math.floor(u%n),d=Math.floor(u/n);!i&&!r&&(r=!0),e[u]?(a++,u>0&&i>0&&e[u-1]||(s+=r?ge("M",i+t,.5+d+t):ge("m",o,0),o=0,r=!1),i+1<n&&e[u+1]||(s+=ge("h",a),a=0)):o++}return s}at.render=function(n,t,s){const o=No.getOptions(t),r=n.modules.size,a=n.modules.data,u=r+o.margin*2,i=o.color.light.a?"<path "+Oe(o.color.light,"fill")+' d="M0 0h'+u+"v"+u+'H0z"/>':"",d="<path "+Oe(o.color.dark,"stroke")+' d="'+So(a,r,o.margin)+'"/>',f='viewBox="0 0 '+u+" "+u+'"',p='<svg xmlns="http://www.w3.org/2000/svg" '+(o.width?'width="'+o.width+'" height="'+o.width+'" ':"")+f+' shape-rendering="crispEdges">'+i+d+`</svg>
- `;return typeof s=="function"&&s(null,p),p};const bo=zn,Ce=Ye,it=st,Po=at;function Fe(e,n,t,s,o){const r=[].slice.call(arguments,1),a=r.length,u=typeof r[a-1]=="function";if(!u&&!bo())throw new Error("Callback required as last argument");if(u){if(a<2)throw new Error("Too few arguments provided");a===2?(o=t,t=n,n=s=void 0):a===3&&(n.getContext&&typeof o>"u"?(o=s,s=void 0):(o=s,s=t,t=n,n=void 0))}else{if(a<1)throw new Error("Too few arguments provided");return a===1?(t=n,n=s=void 0):a===2&&!n.getContext&&(s=t,t=n,n=void 0),new Promise(function(i,d){try{const f=Ce.create(t,s);i(e(f,n,s))}catch(f){d(f)}})}try{const i=Ce.create(t,s);o(null,e(i,n,s))}catch(i){o(i)}}K.create=Ce.create;K.toCanvas=Fe.bind(null,it.render);K.toDataURL=Fe.bind(null,it.renderToDataURL);K.toString=Fe.bind(null,function(e,n,t){return Po.render(e,t)});const Fo="_qrcode_izshm_1",vo="_qrcodeCanvas_izshm_4",Mo="_qrcodeLogo_izshm_8",Do="_small_izshm_18",$={qrcode:Fo,qrcodeCanvas:vo,qrcodeLogo:Mo,small:Do},Lo=O({props:{text:{type:String,default:""},size:{type:String,default:"200px"},logoSize:{type:String,default:"default"}},setup(e){const n=qe(),t=()=>{K.toCanvas(n.value,e.text,{margin:1},s=>{s&&console.log(s),console.log("success")})};return lt(()=>e.text,()=>{t()}),xe(()=>{ct(()=>{t()})}),()=>l("div",{class:$.qrcode,style:{width:e.size,height:e.size}},[l("canvas",{ref:n,class:$.qrcodeCanvas},null),l("img",{src:Vn,class:[$.qrcodeLogo,e.logoSize==="small"&&$.small]},null)])}}),Ro=O({name:"qrcode-payment",props:{url:{type:String,default:""},pay_channel:{type:String,default:"wx_pub"},orderType:{type:String,default:""}},setup(e){return Ee(),Be({height:0}),()=>l("div",{class:[b.saveShareImage]},[U().isApp&&l(Ge,{position:"top"},{default:()=>[l(Ie,{title:e.orderType==="VIP"?"会员购买":"报名缴费"},null)]}),l(Qe,{src:On,class:b.topImage},null),l("div",{class:[b.shareContaienr,b.orchestraContainer]},[l("div",{class:b.schoolName},[e.orderType==="VIP"?"会员购买":"报名缴费"]),l("div",{class:b.shareType},[A("请截图下方二维码"),l("span",null,[A("登录"),e.pay_channel==="wx_pub"?"微信":"支付宝",A("扫码支付")])]),l("div",{class:b.qrcodeSection},[l(Lo,{text:e.url,logoSize:"small",size:"100%"},null)]),l("div",{class:b.memo},[A("请在30分钟内扫码支付")])]),l("div",{class:[b.shareContaienr,b.tips]},[l("div",{class:b.tipsTitle},[A("使用说明:")]),l("div",{class:b.tipsContent},[A("1.打开"),e.pay_channel==="wx_pub"?"微信":"支付宝",A("扫一扫"),l("br",null,null),A("2.选择相册中的二维码"),l("br",null,null),A("3.请在30分钟内扫码支付")])])])}}),Uo=e=>{let n="qrCode";return U().weixin?e=="alipay_qr"||e=="alipay_wap"?n="qrCode":e=="wx_pub"&&(n="pay"):U().alipay&&e=="alipay_wap"?n="pay":n="qrCode",n=="qrCode"?"payDefine":"payResult"},Ko=O({name:"order-detail",setup(){const e=dt(),n=Ee(),t=Be({paymentType:"adapay",orderTimer:null,paymentStatus:!1,showQrcode:!1,qrCodeUrl:"",pay_channel:"",orderNo:e.query.orderNo,orderInfo:{},goodsInfos:[],config:e.query.config?JSON.parse(e.query.config):{},hasFreight:!e.query.hf,freight:"",agreeStatus:!0,showHeader:!1,authShow:!1,selectGoodsId:null,currentPrice:0,dialogStatus:!1,dialogMessage:"",submitStatus:!1}),s=Ve(()=>t.orderInfo.orderType),o=qe({}),r=async()=>{try{const{data:c}=await z.get("/edu-app/userPaymentOrder/detail/"+t.orderNo),w=c.goodsInfos||[];t.orderInfo=c;let h=!1;w.forEach(_=>{const m=_.goodsUrl?_.goodsUrl.split(",")[0]:"";_.goodsUrl=m,_.goodsType==="INSTRUMENTS"&&(h=!0)}),t.goodsInfos=w,o.value.id||(o.value=c.addresses||{}),h?t.freight="到付":t.freight="免运费",c.status!=="WAIT_PAY"&&c.status!=="PAYING"&&(t.dialogStatus=!0,t.dialogMessage="订单"+En[c.status])}catch(c){}},a=c=>{const w=t.config;t.pay_channel=c.pay_channel;const h=pe.stringify({pay_channel:c.pay_channel,wxAppId:w.wxAppId,body:w.body,price:w.price,orderNo:w.merOrderNo,userId:w.userId});c.payCode==="payResult"?window.location.href=window.location.origin+"/classroom-app/#/payResult?"+h:(t.qrCodeUrl=window.location.origin+"/classroom-app/#/payDefine?"+h,t.showQrcode=!0,t.paymentStatus=!1,setTimeout(()=>{u()},300))},u=async()=>{const c=setInterval(async()=>{if(e.name!="orderDetail"){clearInterval(c);return}t.orderTimer=c;try{const{data:w}=await z.post("/api-student/open/userOrder/paymentStatus/"+t.orderNo,{hideLoading:!0});w.status!=="WAIT_PAY"&&w.status!=="PAYING"&&(t.showQrcode=!1,clearInterval(t.orderTimer),setTimeout(()=>{p()},100))}catch(w){clearInterval(t.orderTimer)}},5e3)},i=async()=>{clearInterval(t.orderTimer),s.value==="VIP"?f(d):B(d)},d=()=>{const c=t.pay_channel;if(c){const w=Uo(t.pay_channel);a({payCode:w,pay_channel:c})}else s.value==="VIP"?t.paymentStatus=!0:a({payCode:"payResult",pay_channel:"wx_pub"})},f=async c=>{try{t.submitStatus=!0;const{data:w}=await z.get("/edu-app/userPaymentOrder/detail/"+t.orderNo,{hideLoading:!1});t.pay_channel=w.paymentChannel,t.submitStatus=!1,w.status!=="WAIT_PAY"&&w.status!=="PAYING"?n.replace({path:"/payment-result",query:{orderNo:t.orderNo}}):c&&c()}catch(w){t.submitStatus=!1}},B=async c=>{if(!o.value.id){ve("请选择收货地址");return}if(!t.agreeStatus){ve("请先阅读并同意《管乐团平台服务协议》");return}te.user.data,t.submitStatus=!0;try{const{data:w}=await z.post("/edu-app/userPaymentOrder/updateReceiveAddress",{hideLoading:!1,data:{orderNo:t.orderNo,orderType:"SCHOOL_REGISTER",receiveAddress:o.value.id}});t.pay_channel=w.paymentChannel,w.status!=="WAIT_PAY"&&w.status!=="PAYING"?p():c&&c()}catch(w){}finally{t.submitStatus=!1}},p=()=>{n.replace({path:"/payment-result",query:{orderNo:t.orderNo}})},g=async()=>{try{await z.post("/edu-app/userPaymentOrder/cancelPayment/"+t.orderNo),n.back()}catch(c){}},C=()=>{t.authShow=!1,i()};return xe(()=>{U().isApp?t.showHeader=!0:t.showHeader=!1;let c=sessionStorage.getItem("addressDetails");c=c?JSON.parse(c):{},o.value=c,sessionStorage.removeItem("addressDetails"),r()}),()=>l(he,null,[U().isApp&&l(Ie,{border:!1},null),l("div",{class:T.cartConfirm},[s.value==="SCHOOL_REGISTER"&&l("div",{class:T.cartConfirmBox},[l(an,{item:o.value},null)]),l(Te,{style:{margin:0}},{default:()=>[t.goodsInfos&&t.goodsInfos.map(c=>l(q,{class:T.cellItem},{icon:()=>l(Qe,{class:T.img,src:c.goodsUrl},null),title:()=>l("div",{class:T.goodsContent},[l("h2",null,[l("span",null,[c.goodsName]),l("span",{class:T.goodsNum},[A("x "),c.goodsNum])]),l("div",{class:T.goodsPrice},[l(He,{class:T.brandName},{default:()=>[c.goodsType==="VIP"?"12个月":c.brandName]}),l("span",{class:[T.goodsNums,c.paymentCashAmount>0?T.numFont:T.free]},[c.paymentCashAmount>0?l(he,null,[l("span",{class:T.numPrefix},[A("¥ ")]),me(c.paymentCashAmount)]):"免费"])]),l("p",{class:T.model},[c.description])])}))]}),s.value==="SCHOOL_REGISTER"&&l(q,{class:T.freight,title:"运费",value:t.freight},null)]),l(Ge,{position:"bottom"},{default:()=>[l("div",{class:T.protocol},[l(ht,{modelValue:t.agreeStatus,"onUpdate:modelValue":c=>t.agreeStatus=c,showHeader:t.showHeader,style:{paddingTop:0,paddingBottom:0}},null)]),l("div",{class:T.paymentContainer},[l("div",{class:T.payemntPrice},[l("p",{class:T.needPrice},[A("支付金额:"),l("span",null,[l("i",null,[A("¥")]),me(t.orderInfo.currentPrice)])])]),l("div",{class:T.paymentBtn},[l(Ae,{round:!0,class:T.submitBtn,onClick:i,loading:t.submitStatus,disabled:t.submitStatus},{default:()=>[A("提交")]})])])]}),l(ze,{show:t.paymentStatus,closeOnClickOverlay:!1,position:"bottom",round:!0,closeOnPopstate:!0,safeAreaInsetBottom:!0,style:{minHeight:"30%"}},{default:()=>[l(pn,{paymentConfig:t.orderInfo,onClose:()=>t.paymentStatus=!1,onBackOut:g,onConfirm:c=>a(c)},null)]}),l(Le,{modelValue:t.showQrcode,"onUpdate:modelValue":c=>t.showQrcode=c,onClose:()=>{clearInterval(t.orderTimer)}},{default:()=>[l(Ro,{url:t.qrCodeUrl,pay_channel:t.pay_channel,orderType:s.value},null)]}),l(Le,{modelValue:t.authShow,"onUpdate:modelValue":c=>t.authShow=c},{default:()=>[l(Cn,{onSuccess:C,hideHeader:!U().isApp},null)]}),l(mt,{title:"提示",show:t.dialogStatus,"onUpdate:show":c=>t.dialogStatus=c,message:t.dialogMessage,confirmButtonText:"确定",onConfirm:()=>{p()}},null)])}});export{Ko as default};
|