import{a9 as l,aa as p}from"./index.DLhCD1Qz.js";import{s as h,w as _}from"./sao.BNgKEQCS.js";import{w as u}from"./weipay.C7z360W3.js";import{_ as y}from"./yb_admin_plugin.DNFUAscl.js";import{aZ as f,aL as o,s as v,bJ as w,v as t,bb as a,H as g,u as n,t as d}from"./@vue.Da0bZ210.js";import"./vue.Bj6dTZYa.js";import"./@element-plus.pQhr8KT1.js";import"./echarts.Dms41JYJ.js";import"./tslib.BDyQ-Jie.js";import"./zrender.BueMfJu3.js";import"./axios.BjtuyMK1.js";import"./pinia.Tngw-S_5.js";import"./vue-router.DaVMGKLh.js";import"./element-plus.DC208N5p.js";import"./lodash-es.DVGGNlzX.js";import"./@vueuse.BhH-hw9p.js";import"./async-validator.9PlIezaS.js";import"./@popperjs.C5az9QE8.js";import"./@ctrl.C4Rzlq_k.js";import"./dayjs.BLMYetss.js";import"./memoize-one.BdPwpGay.js";import"./normalize-wheel-es.BQoi3Ox2.js";import"./@floating-ui.DCXYYTka.js";import"./vue-i18n.C7BagGww.js";import"./@intlify.TnaUIxGf.js";import"./moment.C5S46NFB.js";const S={title:"微信支付",name:"wxpay",components:{},props:{orderno:{type:String,default:()=>""}},data(){return{totalSeconds:2*60*60,timer:null,isFinished:!1,weis:_,weipay:u,sao:h,qrcode:"",price:"",pay_type:0,time:null}},beforeUnmount(){clearInterval(this.timer),clearInterval(this.time)},computed:{formattedTime(){if(this.isFinished)return"00:00:00";const e=Math.floor(this.totalSeconds/3600).toString().padStart(2,"0"),s=Math.floor(this.totalSeconds%3600/60).toString().padStart(2,"0"),r=(this.totalSeconds%60).toString().padStart(2,"0");return`${e}:${s}:${r}`}},created(){this.goOrderPay(),this.startTimer(),l({out_trade_no:this.orderno}).then(e=>{e.code==0?(this.price==""&&(this.price=e.data.pay_money),e.data.order_status==3&&this.callBack&&this.callBack()):this.$message.error(e.msg)})},methods:{startTimer(){this.timer=setInterval(()=>{this.totalSeconds>0?this.totalSeconds--:(this.isFinished=!0,clearInterval(this.timer))},1e3)},goOrderPay(){p({order_no:this.orderno,pay_type:0,platForm:10}).then(e=>{e.code==0?(this.qrcode=e.data,this.pay_type==0&&(this.getOrderStutas(),this.time=setInterval(s=>{this.getOrderStutas()},1500))):this.$message.error(e.msg)})},getOrderStutas(){l({out_trade_no:this.orderno}).then(e=>{e.code==0?(this.price==""&&(this.price=e.data.pay_money),e.data.order_status==3&&(clearInterval(this.time),this.callBack&&this.callBack())):this.$message.error(e.msg)})}}},b={id:"weiPay"},k={class:"weiPay-main"},x={class:"weipay-top"},B={class:"weipay-top-left"},q={class:"weipay-top-right"},I={class:"countdown"},O={key:0},F={class:"weipay-title"},P=["src"],T={class:"weipay-content"},C={class:"weipay-qr"},N={key:0,class:"weipay-qr-div"},V=["src"],D={class:"werpay-btm"},M={class:"weipay-btm-btn"},E=["src"];function H(e,s,r,J,i,c){const m=f("el-form");return o(),v(m,{ref:"form",model:e.form,"label-width":"110px"},{default:w(()=>[t("div",b,[t("div",k,[t("div",x,[t("div",B,"订单提交成功，请尽快支付！订单号："+a(r.orderno),1),t("div",q,[s[0]||(s[0]=g(" 应付金额： ",-1)),t("span",null,"￥"+a(i.price),1)])]),t("div",I,[t("h1",null,a(c.formattedTime),1),i.isFinished?(o(),n("p",O,"二维码已过期！")):d("",!0)]),t("div",F,[t("img",{src:i.weipay,alt:""},null,8,P),s[1]||(s[1]=t("div",null,"微信支付",-1))]),t("div",T,[t("div",null,[t("div",C,[i.qrcode==""?(o(),n("div",N)):d("",!0),i.qrcode!=""?(o(),n("img",{key:1,src:i.qrcode,alt:""},null,8,V)):d("",!0)]),t("div",D,[t("div",M,[t("img",{src:i.sao,alt:""},null,8,E),s[2]||(s[2]=t("div",{class:"weipay-btm-btn-txt"},[t("div",null,"请使用微信扫一扫"),t("div",null,"扫描二维码支付")],-1))])])])])])])]),_:1},8,["model"])}const pt=y(S,[["render",H]]);export{pt as default};
