import{ab as d,ac as p}from"./index.DLhCD1Qz.js";import{s as h,w as _}from"./sao.BNgKEQCS.js";import{a as u}from"./ali_pay.D6tweDOb.js";import{_ as y}from"./yb_admin_plugin.DNFUAscl.js";import{aZ as f,aL as o,s as v,bJ as g,v as t,bb as a,H as w,u as n,t as l}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:"apipay",components:{},props:{orderno:{type:String,default:()=>""}},data(){return{totalSeconds:2*60*60,timer:null,isFinished:!1,weis:_,alipay:u,sao:h,qrcode:"",price:"",pay_type:2,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(),d({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:2,platForm:10}).then(e=>{e.code==0?(this.qrcode=e.data,this.pay_type==2&&(this.getOrderStutas(),this.time=setInterval(s=>{this.getOrderStutas()},1500))):this.$message.error(e.msg)})},getOrderStutas(){d({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"},B={class:"weipay-top"},q={class:"weipay-top-left"},x={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"},$=["src"];function E(e,s,r,H,i,c){const m=f("el-form");return o(),v(m,{ref:"form",model:e.form,"label-width":"110px"},{default:g(()=>[t("div",b,[t("div",k,[t("div",B,[t("div",q,"订单提交成功，请尽快支付！订单号："+a(r.orderno),1),t("div",x,[s[0]||(s[0]=w(" 应付金额： ",-1)),t("span",null,"￥"+a(i.price),1)])]),t("div",I,[t("h1",null,a(c.formattedTime),1),i.isFinished?(o(),n("p",O,"二维码已过期！")):l("",!0)]),t("div",F,[t("img",{src:i.alipay,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)):l("",!0),i.qrcode!=""?(o(),n("img",{key:1,src:i.qrcode,alt:""},null,8,V)):l("",!0)]),t("div",D,[t("div",M,[t("img",{src:i.sao,alt:""},null,8,$),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",E]]);export{pt as default};
