import"./base-60afcd29.js";import{E as x}from"./el-button-c8e39703.js";import{Q as E,a as T,E as B}from"./qrcode.vue.esm-a6dce5be.js";import{m as s,s as z,v as N,x as e,y as t,w as c,G as r,_ as m,A as p,a as D,H as M,Z as O,o as v,z as f}from"./index-6f5315ad.js";import{_ as S,a as U}from"./back-32e905a3.js";import{c as F,d as I}from"./order-cb3c1efb.js";import"./config-provider-338f87a0.js";import"./strings-b8ab9b28.js";import"./vnode-76677048.js";import"./request-ba216ded.js";import"./axios-4a70c6fc.js";const L={id:"printMe"},P={class:"card-preview"},Q=e("img",{src:S},null,-1),j={class:"front"},A={class:"front-cname"},G={class:"front-ename"},H=["src"],R={class:"card-preview"},Z=e("img",{src:U},null,-1),q={class:"back"},J={class:"nfcimg"},K={class:"action"},ie={__name:"printcard",setup(W){let h=location.href,i=new URL(h).searchParams.get("sn");const n=s(0),l=s("front"),a=s({cname:"",ename:"",images:"",user_id:""}),g=s(100);z(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=s({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 _=B,y=T,u=x,C=O("print");return v(),N(M,null,[e("div",null,[t(y,{modelValue:l.value,"onUpdate:modelValue":d[0]||(d[0]=V=>l.value=V),type:"card",onTabClick:b},{default:c(()=>[t(_,{label:"正面",name:"front"}),t(_,{label:"反面",name:"back"})]),_:1},8,["modelValue"]),e("div",L,[r(e("div",P,[Q,e("div",j,[e("div",A,p(a.value.cname),1),e("div",G,p(a.value.ename),1),e("img",{class:"front-logo",src:a.value.image},null,8,H)])],512),[[m,n.value===0]]),r(e("div",R,[Z,e("div",q,[e("div",J,[t(E,{value:a.value.nfcurl,size:g.value,level:"L"},null,8,["value","size"])])])],512),[[m,n.value===1]])])]),e("div",K,[r((v(),D(u,{type:"primary"},{default:c(()=>[f("製卡")]),_:1})),[[C,w.value]]),t(u,{type:"success",onClick:k},{default:c(()=>[f("完成")]),_:1})])],64)}}};export{ie as default};
