import{_ as e}from"./el-navbar.DVIyjZEN.js";import{r as a,E as t,b as l,d as s,e as o,f as n,w as u,g as d,j as i,h as r,i as c,F as _,l as p,t as f,v as m,p as h,aj as y,A as v,_ as b,y as k}from"./index-DVkgSHpn.js";import{_ as g}from"./el-empty.CMLN1lgh.js";import{_ as w,b as x,a as j}from"./el-layout._U-vZTft.js";const $=w({__name:"index",setup(w){const $=a([]);t((()=>{C()}));const C=()=>{uni.$http.get("ucenter.invoice/index").then((e=>{e.code&&($.value=e.data)}))},z=()=>{f("pages/index/ucenter")};return(a,t)=>{const w=l(s("el-navbar"),e),T=l(s("el-empty"),g),A=k,B=h,E=l(s("uni-icons"),x),F=y,I=l(s("el-layout"),j);return o(),n(I,null,{default:u((()=>[d(w,{placeholder:!0,fixed:!0,onLeft:z,autoBack:!1,border:!0,title:"发票列表"}),d(B,{class:"wrapper"},{default:u((()=>[$.value.length<=0?(o(),n(T,{key:0,mode:"data"})):i("",!0),$.value.length>0?(o(!0),r(_,{key:1},c($.value,((e,a)=>(o(),n(B,{class:"item-box"},{default:u((()=>[d(B,{class:"item-wrap"},{default:u((()=>[d(B,{class:"top"},{default:u((()=>[d(A,null,{default:u((()=>[m(v(1==e.header_type?"个人":"企业")+"发票",1)])),_:2},1024),d(A,null,{default:u((()=>[m(v(e.name||""),1)])),_:2},1024)])),_:2},1024),d(B,{class:"content"},{default:u((()=>[1==e.header_type?(o(),n(B,{key:0},{default:u((()=>[d(B,null,{default:u((()=>[m("个人邮箱："+v(e.email),1)])),_:2},1024),d(B,null,{default:u((()=>[m("电话号码："+v(e.drawer_phone),1)])),_:2},1024)])),_:2},1024)):(o(),n(B,{key:1},{default:u((()=>[d(B,null,{default:u((()=>[m("企业邮箱："+v(e.email),1)])),_:2},1024),d(B,null,{default:u((()=>[m("企业税号："+v(e.duty_number),1)])),_:2},1024)])),_:2},1024))])),_:2},1024),d(B,{class:"bottom"},{default:u((()=>[d(B),d(B,{class:"operate"},{default:u((()=>[d(B,{onClick:b((a=>p(f)(`pages/ucenter/invoice/editor?id=${e.id}`)),["stop"])},{default:u((()=>[d(E,{class:"icon",type:"compose",size:"17"}),m(" 编辑 ")])),_:2},1032,["onClick"]),d(B,{onClick:b((a=>{return t=e.id,void uni.$layer.showModal("您确定要删除该内容吗？").then((()=>{uni.$http.post("ucenter.invoice/delete",{id:t}).then((e=>{e.code?(C(),uni.$layer.showToast("删除成功")):uni.$layer.showToast(e.msg)}))}));var t}),["stop"])},{default:u((()=>[d(E,{class:"icon",type:"trash",size:"17"}),m(" 删除 ")])),_:2},1032,["onClick"])])),_:2},1024)])),_:2},1024)])),_:2},1024)])),_:2},1024)))),256)):i("",!0)])),_:1}),d(B,{class:"placeholder"}),d(B,{class:"footer"},{default:u((()=>[d(F,{class:"btn",onClick:t[0]||(t[0]=e=>p(f)("pages/ucenter/invoice/editor"))},{default:u((()=>[m("添加抬头")])),_:1})])),_:1})])),_:1})}}},[["__scopeId","data-v-1dfcbbab"]]);export{$ as default};
//# sourceMappingURL=pages-ucenter-invoice-index.BW8XM7Rt.js.map
