import"./base-a9e1396c.js";import{E as V}from"./el-button-4f2e1711.js";import{a as x,E as T}from"./el-tab-pane-2840eee7.js";import{m as t,s as B,v as z,x as e,y as s,w as r,E as c,a9 as u,A as p,a as N,J as D,a8 as M,o as v,z as f}from"./normalize-8daa80b1.js";import{_ as O,a as S}from"./back-32e905a3.js";import{Q as U}from"./qrcode.vue.esm-5def5f14.js";import{c as F,d as I}from"./order-cb3c1efb.js";import"./config-provider-ecb8405d.js";import"./aria-fbed35f0.js";import"./strings-4a84079a.js";import"./vnode-cca0b0eb.js";import"./request-ba216ded.js";import"./axios-4a70c6fc.js";const L={id:"printMe"},P={class:"card-preview"},Q=e("img",{src:O},null,-1),j={class:"front"},A={class:"front-cname"},J={class:"front-ename"},R=["src"],q={class:"card-preview"},G=e("img",{src:S},null,-1),H={class:"back"},K={class:"nfcimg"},W={class:"action"},_e={__name:"printcard",setup(X){let h=location.href,i=new URL(h).searchParams.get("sn");const n=t(0),l=t("front"),a=t({cname:"",ename:"",images:"",user_id:""}),g=t(100);B(async()=>{let o=await F(i);console.log("res",o),o.code===200&&(a.value=o.data)});const b=()=>{l.value==="front"?n.value=1:n.value=0},w=t({id:"printMe",popTitle:"card print",beforeOpenCallback(o){console.log("打開之前")},openCallback(o){console.log("執行了打印")},closeCallback(o){console.log("關閉了打印工具")}}),k=async()=>{(await I({order_sn:i,order_status:3})).code===200&&(console.log("window close"),window.location.href="about:blank",window.close())};return(o,d)=>{const _=T,y=x,m=V,C=M("print");return v(),z(D,null,[e("div",null,[s(y,{modelValue:l.value,"onUpdate:modelValue":d[0]||(d[0]=E=>l.value=E),type:"card",onTabClick:b},{default:r(()=>[s(_,{label:"正面",name:"front"}),s(_,{label:"反面",name:"back"})]),_:1},8,["modelValue"]),e("div",L,[c(e("div",P,[Q,e("div",j,[e("div",A,p(a.value.cname),1),e("div",J,p(a.value.ename),1),e("img",{class:"front-logo",src:a.value.image},null,8,R)])],512),[[u,n.value===0]]),c(e("div",q,[G,e("div",H,[e("div",K,[s(U,{value:a.value.nfcurl,size:g.value,level:"L"},null,8,["value","size"])])])],512),[[u,n.value===1]])])]),e("div",W,[c((v(),N(m,{type:"primary"},{default:r(()=>[f("製卡")]),_:1})),[[C,w.value]]),s(m,{type:"success",onClick:k},{default:r(()=>[f("完成")]),_:1})])],64)}}};export{_e as default};
