import{_ as E,s as I,r as g,p as U,c as u,e as f,k as j,i as a,g as e,h as s,t as i,f as y,A as b,u as w,ej as z,aT as F,m as _,q as G,E as V,R as P,S as T}from"./index.0308b213.js";const l=p=>(P("data-v-0f8b4ea8"),p=p(),T(),p),$={class:"gift-container"},A={class:"item-info"},D=["src"],M={class:"item-details"},O={class:"item-title"},H={key:0,class:"item-spec"},J=l(()=>e("span",{class:"spec-label"},"\u89C4\u683C:",-1)),K={class:"spec-value"},L={class:"item-price"},W=l(()=>e("span",{class:"price-label"},"\u5355\u4EF7:",-1)),X={class:"price-value"},Y={class:"item-quantity"},Z=l(()=>e("span",{class:"quantity-label"},"\u5F53\u524D\u6570\u91CF:",-1)),ee={class:"quantity-value"},te={class:"quantity-selector"},se=l(()=>e("div",{class:"quantity-label"},"\u9009\u62E9\u8D60\u9001\u6570\u91CF:",-1)),oe={class:"quantity-input"},ae={class:"number-control"},ie={class:"gift-reason"},le=l(()=>e("div",{class:"reason-label"},"\u8D60\u9001\u539F\u56E0:",-1)),ne={class:"reason-options"},ce=_("\u5BA2\u6237\u6295\u8BC9"),_e=_("\u83DC\u54C1\u8D28\u91CF"),de=_("\u5BA2\u6237\u5173\u7CFB"),ue=_("\u5176\u4ED6"),pe={key:0,class:"custom-reason"},re={class:"gift-preview"},me=l(()=>e("p",{class:"preview-label"},"\u8D60\u9001\u540E\u6548\u679C\u9884\u89C8:",-1)),ve={class:"preview-result"},he={key:0,class:"preview-row"},fe=l(()=>e("span",{class:"preview-item"},"\u539F\u5546\u54C1:",-1)),ge={class:"preview-value"},ye={class:"preview-row"},be=l(()=>e("span",{class:"preview-item"},"\u8D60\u9001\u5546\u54C1:",-1)),we={class:"preview-value"},Ve=l(()=>e("span",{class:"gift-tag-preview"},"\u8D60",-1)),ke={class:"dialog-footer"},qe=_("\u53D6\u6D88"),xe=_("\u786E\u8BA4\u8D60\u9001"),Ce={props:{show:{type:Boolean,default:!1},item:{type:Object,required:!0}},emits:["update:show","apply-gift"],setup(p,{emit:k}){const t=p,r=I({get:()=>t.show,set:n=>k("update:show",n)}),o=g(1),m=g("\u5BA2\u6237\u6295\u8BC9"),v=g("");U(()=>t.item,n=>{n&&n.num&&(o.value=n.num)},{immediate:!0});const C=()=>{o.value<t.item.num?o.value++:V.warning(`\u6700\u591A\u53EA\u80FD\u8D60\u9001 ${t.item.num} \u4EF6\u5546\u54C1`)},Q=()=>{o.value>1?o.value--:V.warning("\u8D60\u9001\u6570\u91CF\u5FC5\u987B\u5927\u4E8E0")},B=()=>{if(o.value<1){V.warning("\u8D60\u9001\u6570\u91CF\u5FC5\u987B\u5927\u4E8E0");return}const n=m.value==="\u5176\u4ED6"&&v.value?v.value:m.value;k("apply-gift",{itemId:t.item.id,giftQuantity:o.value,giftReason:n}),r.value=!1};return(n,c)=>{const q=u("el-icon"),h=u("el-radio"),R=u("el-radio-group"),S=u("el-input"),x=u("el-button"),N=u("el-dialog");return f(),j(N,{modelValue:w(r),"onUpdate:modelValue":c[3]||(c[3]=d=>G(r)?r.value=d:null),title:"\u8D60\u9001\u83DC\u54C1",width:"350px","destroy-on-close":!0},{footer:a(()=>[e("span",ke,[s(x,{onClick:c[2]||(c[2]=d=>r.value=!1)},{default:a(()=>[qe]),_:1}),s(x,{type:"primary",onClick:B},{default:a(()=>[xe]),_:1})])]),default:a(()=>[e("div",$,[e("div",A,[e("img",{src:t.item.thumb,class:"item-thumb",alt:"\u5546\u54C1\u56FE\u7247"},null,8,D),e("div",M,[e("div",O,i(t.item.title),1),t.item.option_name?(f(),y("div",H,[J,e("span",K,i(t.item.option_name),1)])):b("",!0),e("div",L,[W,e("span",X,"\uFFE5"+i(t.item.price),1)]),e("div",Y,[Z,e("span",ee,"\xD7 "+i(t.item.num),1)])])]),e("div",te,[se,e("div",oe,[e("div",ae,[e("div",{class:"number-btn",onClick:Q},[s(q,{size:"11"},{default:a(()=>[s(w(z))]),_:1})]),e("span",null,i(o.value),1),e("div",{class:"number-btn",onClick:C},[s(q,{size:"11",color:"#1291FF"},{default:a(()=>[s(w(F))]),_:1})])])])]),e("div",ie,[le,e("div",ne,[s(R,{modelValue:m.value,"onUpdate:modelValue":c[0]||(c[0]=d=>m.value=d)},{default:a(()=>[s(h,{label:"\u5BA2\u6237\u6295\u8BC9"},{default:a(()=>[ce]),_:1}),s(h,{label:"\u83DC\u54C1\u8D28\u91CF"},{default:a(()=>[_e]),_:1}),s(h,{label:"\u5BA2\u6237\u5173\u7CFB"},{default:a(()=>[de]),_:1}),s(h,{label:"\u5176\u4ED6"},{default:a(()=>[ue]),_:1})]),_:1},8,["modelValue"]),m.value==="\u5176\u4ED6"?(f(),y("div",pe,[s(S,{modelValue:v.value,"onUpdate:modelValue":c[1]||(c[1]=d=>v.value=d),placeholder:"\u8BF7\u8F93\u5165\u8D60\u9001\u539F\u56E0",maxlength:"50","show-word-limit":""},null,8,["modelValue"])])):b("",!0)])]),e("div",re,[me,e("div",ve,[o.value<t.item.num?(f(),y("p",he,[fe,e("span",ge,i(t.item.title)+" \xD7 "+i(t.item.num-o.value),1)])):b("",!0),e("p",ye,[be,e("span",we,[_(i(t.item.title)+" ",1),Ve,_(" \xD7 "+i(o.value)+" (\uFFE50.00) ",1)])])])])])]),_:1},8,["modelValue"])}}},Be=E(Ce,[["__scopeId","data-v-0f8b4ea8"]]);export{Be as default};
