import{P as D}from"./page.3b4d44cb.js";import{b7 as A,b as k,ar as v,a as B,N as Y,E as F,_ as $,c as s,e as b,k as C,i as t,g as d,h as o,t as i,A as M,m as _}from"./index.0308b213.js";import{I as E,J as L}from"./storeActivity.634c4426.js";const N={components:{Page:D},setup(){const a=A(),l=k({loading:!1,delLoading:!1,tableData:[]}),p=()=>{a.push({path:"/store/marketing/addGetCoupon"})},g=n=>{a.push({path:"/store/marketing/getCouponDetail",query:{id:n}})},c=()=>{l.loading=!0,E().then(n=>{console.log("\u8BF7\u6C42\u7ED3\u679C\uFF1A",n.coupons),l.tableData=n.coupons?[n.coupons]:[]}).finally(()=>{l.loading=!1})};c();const f=n=>{console.log("\u64A4\u9500"),Y.alert("\u786E\u5B9A\u8981\u64A4\u9500\u6D3B\u52A8\u5417\uFF1F","\u63D0\u793A",{showCancelButton:!0}).then(r=>{l.delLoading=!0,L().then(m=>{F.success("\u64A4\u9500\u6210\u529F"),c()}).finally(()=>{l.delLoading=!1})}).catch(()=>{})};return{...v(l),toAddGetCoupon:p,del:f,toDetail:g,dayjs:B}}};const P={class:"container"},V=_("\u521B\u5EFA\u9886\u52B5\u6D3B\u52A8"),j=_("\u67E5\u770B"),G=_("\u64A4\u9500\u6D3B\u52A8");function I(a,l,p,g,c,f){const n=s("el-button"),r=s("el-row"),m=s("el-alert"),u=s("el-table-column"),h=s("el-table"),w=s("Page");return b(),C(w,{showBorder:!1,loading:a.loading},{main:t(()=>[d("div",P,[o(r,null,{default:t(()=>[o(n,{type:"primary",onClick:l[0]||(l[0]=e=>a.toAddGetCoupon())},{default:t(()=>[V]),_:1})]),_:1}),o(r,null,{default:t(()=>[o(m,{title:"\u6BCF\u4E2A\u95E8\u5E97\u6700\u591A\u652F\u6301\u4E0A\u67B6\u4E00\u4E2A\u8FD4\u5238\u6D3B\u52A8\u3002",type:"warning",closable:!1,"show-icon":""})]),_:1}),o(r,null,{default:t(()=>[o(h,{border:"",data:a.tableData,style:{width:"100%"}},{default:t(()=>[o(u,{align:"center",prop:"title",label:"\u6D3B\u52A8\u540D\u79F0"}),o(u,{align:"center",label:"\u6D3B\u52A8\u65F6\u95F4"},{default:t(e=>[d("span",null,i(a.dayjs(e.row.starttime*1e3).format("YYYY-MM-DD"))+"~"+i(a.dayjs(e.row.endtime*1e3).format("YYYY-MM-DD")),1)]),_:1}),o(u,{align:"center",label:"\u72B6\u6001"},{default:t(e=>[d("span",null,i(e.row.status==1?"\u6D3B\u52A8\u751F\u6548\u4E2D":e.row.status==2?"\u6D3B\u52A8\u672A\u5F00\u59CB":"\u6D3B\u52A8\u5DF2\u7ED3\u675F\u6216\u5DF2\u64A4\u9500"),1)]),_:1}),o(u,{align:"center",label:"\u9762\u5411\u4EBA\u7FA4"},{default:t(e=>[d("span",null,i(e.row.type_limit==1?"\u6240\u6709\u7528\u6237":"\u65B0\u7528\u6237"),1)]),_:1}),o(u,{align:"center",label:"\u64CD\u4F5C"},{default:t(e=>[o(n,{onClick:y=>a.toDetail(e.row.id)},{default:t(()=>[j]),_:2},1032,["onClick"]),e.row.status<2?(b(),C(n,{key:0,loading:a.delLoading,onClick:y=>a.del(e.row.id)},{default:t(()=>[G]),_:2},1032,["loading","onClick"])):M("",!0)]),_:1})]),_:1},8,["data"])]),_:1})])]),_:1},8,["loading"])}const S=$(N,[["render",I],["__scopeId","data-v-7bf749f5"]]);export{S as default};
