import{d as I,s as P,r as C,c as w,e as n,k as E,i as D,g as t,t as m,f as _,A as l,h as a,u as y,ek as q,el as R,em as U,q as $,E as c,R as G,S as N,_ as O}from"./index.0308b213.js";import Q from"./RemarkPopup.30c621c2.js";import T from"./GiftQuantityPopup.8d781e9b.js";import j from"./DiscountPopup.87c1ae91.js";const u=d=>(G("data-v-acf04865"),d=d(),N(),d),M={class:"operation-container"},z={class:"item-info"},H=["src"],J={class:"item-details"},K={class:"item-title"},L={key:0,class:"item-spec"},W=u(()=>t("span",{class:"spec-label"},"\u89C4\u683C:",-1)),X={class:"spec-value"},Y={class:"item-price"},Z=u(()=>t("span",{class:"price-label"},"\u5355\u4EF7:",-1)),ee={class:"price-value"},te={class:"item-quantity"},se=u(()=>t("span",{class:"quantity-label"},"\u6570\u91CF:",-1)),oe={class:"quantity-value"},ie={key:1,class:"item-discount"},ue=u(()=>t("span",{class:"discount-label"},"\u6298\u6263:",-1)),ae={class:"discount-value"},ne={key:2,class:"item-gift"},le=u(()=>t("span",{class:"gift-label"},"\u72B6\u6001:",-1)),ce=u(()=>t("span",{class:"gift-value"},"\u8D60\u54C1",-1)),de=[le,ce],pe={class:"operation-buttons"},re={class:"icon-wrapper discount"},me=u(()=>t("div",{class:"operation-text"},"\u83DC\u54C1\u6253\u6298",-1)),_e={class:"icon-wrapper gift"},fe=u(()=>t("div",{class:"operation-text"},"\u8D60\u9001\u83DC\u54C1",-1)),ve={class:"icon-wrapper remark"},he=u(()=>t("div",{class:"operation-text"},"\u5355\u54C1\u5907\u6CE8",-1)),Ce=I({props:{show:{type:Boolean,default:!1},item:{type:Object,required:!0}},emits:["update:show","apply-discount","apply-gift","apply-remark"],setup(d,{emit:f}){const e=d,p=P({get:()=>e.show,set:s=>f("update:show",s)}),r=C(!1),v=C(""),F=()=>{e.item&&e.item.remark?v.value=e.item.remark:v.value="",r.value=!0},x=s=>{r.value=!1,setTimeout(()=>{f("apply-remark",{itemId:e.item.id,remark:s}),c.success("\u5907\u6CE8\u5DF2\u6DFB\u52A0")},100)},B=()=>{if(e.item.discount&&e.item.discount<100){c.warning("\u5DF2\u6253\u6298\u7684\u83DC\u54C1\u4E0D\u80FD\u8BBE\u4E3A\u8D60\u54C1");return}h.value=!0},h=C(!1),b=s=>{if(console.log("\u6536\u5230\u8D60\u9001\u6570\u636E:",s),e.item.discount&&e.item.discount<100){c.warning("\u5DF2\u6253\u6298\u7684\u83DC\u54C1\u4E0D\u80FD\u8BBE\u4E3A\u8D60\u54C1"),h.value=!1;return}f("apply-gift",s),c.success(`\u5DF2\u5C06 ${e.item.title} \u7684 ${s.giftQuantity} \u4EFD\u8BBE\u4E3A\u8D60\u54C1`),p.value=!1},g=C(!1),V=()=>{g.value=!0},S=s=>{console.log("\u6536\u5230\u6298\u6263\u6570\u636E:",s),f("apply-discount",s),s.discount===null||s.discount===100?c.success(`\u5DF2\u53D6\u6D88 ${e.item.title} \u7684\u6298\u6263`):c.success(`\u5DF2\u5BF9 ${e.item.title} \u5E94\u7528 ${s.discount}% \u7684\u6298\u6263`),p.value=!1};return(s,o)=>{const k=w("el-icon"),A=w("el-dialog");return n(),E(A,{modelValue:y(p),"onUpdate:modelValue":o[4]||(o[4]=i=>$(p)?p.value=i:null),title:"\u83DC\u54C1\u64CD\u4F5C",width:"400px","destroy-on-close":!0},{default:D(()=>[t("div",M,[t("div",z,[t("img",{src:e.item.thumb,class:"item-thumb",alt:"\u5546\u54C1\u56FE\u7247"},null,8,H),t("div",J,[t("div",K,m(e.item.title),1),e.item.option_name?(n(),_("div",L,[W,t("span",X,m(e.item.option_name),1)])):l("",!0),t("div",Y,[Z,t("span",ee,"\uFFE5"+m(e.item.price),1)]),t("div",te,[se,t("span",oe,"\xD7 "+m(e.item.num),1)]),e.item.discount&&e.item.discount<100?(n(),_("div",ie,[ue,t("span",ae,m(e.item.discount)+"%",1)])):l("",!0),e.item.is_gift?(n(),_("div",ne,de)):l("",!0)])]),t("div",pe,[e.item.is_gift?l("",!0):(n(),_("div",{key:0,class:"operation-item",onClick:V},[t("div",re,[a(k,null,{default:D(()=>[a(y(q))]),_:1})]),me])),!e.item.is_gift&&!(e.item.discount&&e.item.discount<100)?(n(),_("div",{key:1,class:"operation-item",onClick:B},[t("div",_e,[a(k,null,{default:D(()=>[a(y(R))]),_:1})]),fe])):l("",!0),t("div",{class:"operation-item",onClick:F},[t("div",ve,[a(k,null,{default:D(()=>[a(y(U))]),_:1})]),he])])]),r.value?(n(),E(Q,{key:0,show:r.value,"onUpdate:show":o[0]||(o[0]=i=>r.value=i),text:v.value,"onUpdate:text":o[1]||(o[1]=i=>v.value=i),record:e.item,onSave:x},null,8,["show","text","record"])):l("",!0),a(j,{show:g.value,"onUpdate:show":o[2]||(o[2]=i=>g.value=i),item:e.item,onApplyDiscount:S},null,8,["show","item"]),a(T,{show:h.value,"onUpdate:show":o[3]||(o[3]=i=>h.value=i),item:e.item,onApplyGift:b},null,8,["show","item"])]),_:1},8,["modelValue"])}}});const we=O(Ce,[["__scopeId","data-v-acf04865"]]);export{we as default};
