import{a,x as s,G as o,H as t,o as e,j as l,w as d,h as u,I as i,l as r,i as c,z as n,f as g,Q as f,a0 as p,m as _,B as m,A as v,p as k,u as y}from"./index-9bec188e.js";import{_ as b}from"./uv-line-progress.1b208e51.js";import{_ as h}from"./uv-button.9242bdc2.js";import{G as x}from"./good-attr-select.96595f56.js";import{a3 as E}from"./images.52fc6216.js";import{L as j}from"./index.2f3cf70a.js";import{_ as C}from"./_plugin-vue_export-helper.1b428a4d.js";const I=C({__name:"goods",props:["data","groupBuy","original","stock","list","buyProgress","total","selectModel","model","purchase","link","price","hasFirst"],setup(C){const I=C,P=a(void 0!==I.list),T=a(I.groupBuy),w=a(I.stock),D=a(I.total),F=a(I.buyProgress),q=a(void 0!==I.selectModel),B=a(void 0!==I.model),M=a(I.purchase);a(I.price);const S=a(I.original),A=a(null),G=a(void 0!==I.link),N=a(I.hasFirst),{push:z}=y(),H=()=>{G.value&&z({url:"/pages/goodsDetail/goodsDetail"},{data:{id:I.data.id,skuId:I.data.skuId}})},L=()=>{A.value.open()},Q=()=>{},W=s((()=>{const a=I.data.campaignTotal||I.data.total;return(a-(I.data.campaignStock||I.data.stock))/a*100})),X=s((()=>{const a=I.data.campaignTotal||I.data.total,s=I.data.campaignStock||I.data.stock;return Math.floor((a-s)/a*100).toFixed(0)+"%"}));return(a,s)=>{const y=m,I=o(t("uv-line-progress"),b),G=v,z=k,$=o(t("uv-button"),h),J=o(t("good-attr-select"),x);return e(),l(y,{class:_(["goods",[P.value&&"goods-list",N.value&&"goods-first"]]),onClick:H},{default:d((()=>[u(y,{class:"goods-header"},{default:d((()=>[u(y,{class:"goods-thumb"},{default:d((()=>[u(j,{unique:C.data.id,src:C.data.image,class:"goods-thumb-img",mode:"aspectFit"},null,8,["unique","src"])])),_:1})])),_:1}),u(y,{class:"goods-content"},{default:d((()=>[u(y,null,{default:d((()=>[u(y,{class:"goods-storeName"},{default:d((()=>[i(r(C.data.storeName),1)])),_:1}),N.value&&F.value?(e(),l(y,{key:0,class:"buy-progress-first"},{default:d((()=>[u(I,{activeColor:"#EE6D46",inactiveColor:"#E6E6E6",height:"14rpx",percentage:c(W),showText:!1},null,8,["percentage"]),u(G,{class:"text"},{default:d((()=>[i("已售"+r(c(X)),1)])),_:1})])),_:1})):n("",!0)])),_:1}),q.value?(e(),l(y,{key:0,class:"goods-list-model"},{default:d((()=>[g("div",{class:"goods-list-model-border",onClick:f(L,["stop"])},[u(y,{class:"goods-list-model-label"},{default:d((()=>[i(r(C.data.attrInfo.sku),1)])),_:1}),u(y,{class:"goods-list-model-action icon"},{default:d((()=>[u(z,{src:c(E)},null,8,["src"])])),_:1})],8,["onClick"])])),_:1})):n("",!0),B.value?(e(),l(y,{key:1,class:"goods-list-model-info"},{default:d((()=>[u(y,{class:"goods-list-model-label"},{default:d((()=>[i(r(C.data.attrInfo.sku),1)])),_:1})])),_:1})):n("",!0),u(y,null,{default:d((()=>[u(y,{class:"goods-info"},{default:d((()=>[u(y,{class:"goods-info-left"},{default:d((()=>[T.value?(e(),l(y,{key:0,class:"goods-desc"},{default:d((()=>[i(r(C.data.person)+"人团 ",1)])),_:1})):n("",!0),u(y,{class:"goods-price-row"},{default:d((()=>[u(y,{class:"goods-price"},{default:d((()=>[i(" ¥"+r(C.data.campaignPrice||C.data.price),1)])),_:1}),S.value?(e(),l(y,{key:0,class:"goods-price goods-price-original"},{default:d((()=>[i(" ¥"+r(C.data.otPrice||C.data.originalPrice),1)])),_:1})):n("",!0)])),_:1})])),_:1}),u(y,{class:"goods-info-action"},{default:d((()=>[u(y,{class:"goods-info-action-btn"},{default:d((()=>[p(a.$slots,"action",{},void 0,!0)])),_:3}),w.value?(e(),l(y,{key:0,class:"goods-info-action-desc"},{default:d((()=>[C.data.stock?(e(),l(G,{key:0},{default:d((()=>[i("仅剩"+r(C.data.stock)+"件",1)])),_:1})):(e(),l(G,{key:1},{default:d((()=>[i("库存不足")])),_:1}))])),_:1})):n("",!0),M.value?(e(),l(y,{key:1,class:"buy-num"},{default:d((()=>[u(y,{class:"buy-num-info-desc"},{default:d((()=>[i(" x"+r(M.value),1)])),_:1})])),_:1})):n("",!0),T.value?(e(),l($,{key:2,class:"button",round:"",block:"",type:"primary"},{default:d((()=>[i(" 立刻拼团 ")])),_:1})):n("",!0)])),_:3})])),_:3}),!N.value&&F.value?(e(),l(y,{key:0,class:"buy-progress"},{default:d((()=>[u(y,{class:"buy-progress-info"},{default:d((()=>[D.value?(e(),l(y,{key:0,class:"buy-progress-info-desc"},{default:d((()=>[i(" 限量"+r(C.data.campaignTotal||C.data.total)+"件 ",1)])),_:1})):n("",!0),u(I,{activeColor:"#EE6D46",inactiveColor:"#E6E6E6",height:"14rpx",percentage:c(W),showText:!1},null,8,["percentage"])])),_:1}),u(y,{class:"buy-progress-action"},{default:d((()=>[u($,{round:"",block:"",type:"primary"},{default:d((()=>[i(" 立即抢购 ")])),_:1})])),_:1})])),_:1})):n("",!0)])),_:3})])),_:3}),u(J,{ref_key:"selectAttrPanel",ref:A,id:C.data.id,onSelect:Q},null,8,["id"])])),_:3},8,["class"])}}},[["__scopeId","data-v-880dbd95"]]);export{I as _};
