1 |
- import{z as s,c as e,a0 as t,a2 as l,f as a,g as o,w as i,B as d,k as r,x as c,s as u,i as n,u as g,v as y,a7 as p,ah as f,l as h,F as m,r as _,af as x,y as k,j as b,I as w,aB as v}from"./index-ba48620e.js";import{_ as F}from"./points.c381a8e1.js";import{q as P,b as S,a as C,f as $}from"./useGoods.edb8879f.js";/* empty css */import{_ as T}from"./_plugin-vue_export-helper.1b428a4d.js";import"./s-layout.04b95866.js";import"./uni-load-more.966faf1b.js";/* empty css */import"./phone-international-input.dd3ca29e.js";/* empty css */const j=T({__name:"s-goods-column",props:{goodsFields:{type:[Array,Object],default:()=>({price:{show:!0},stock:{show:!0},name:{show:!0},introduction:{show:!0},promotionFee:{show:!0},salesCount:{show:!0}})},tagStyle:{type:Object,default:{}},data:{type:Object,default:{}},size:{type:String,default:"sl"},background:{type:String,default:""},topRadius:{type:Number,default:0},bottomRadius:{type:Number,default:0},titleWidth:{type:Number,default:0},titleColor:{type:String,default:"#333"},priceColor:{type:String,default:""},originPriceColor:{type:String,default:"#C4C4C4"},priceUnit:{type:String,default:"¥"},subTitleColor:{type:String,default:"#999999"},subTitleBackground:{type:String,default:""},buttonShow:{type:Boolean,default:!0},seckillTag:{type:Boolean,default:!1},grouponTag:{type:Boolean,default:!1}},emits:["click","getHeight"],setup(T,{emit:j}){s({});const U=T,A=e((()=>({background:U.background,"border-top-left-radius":U.topRadius+"px","border-top-right-radius":U.topRadius+"px","border-bottom-left-radius":U.bottomRadius+"px","border-bottom-right-radius":U.bottomRadius+"px"}))),z=e((()=>{var s,e;let t=[];return(null==(s=U.goodsFields.salesCount)?void 0:s.show)&&t.push(P(U.data.sales_show_type,U.data.salesCount)),(null==(e=U.goodsFields.stock)?void 0:e.show)&&t.push(S(U.data.stock_show_type,U.data.stock)),t.join(" | ")})),B=j,W=()=>{B("click")},{proxy:R}=v(),O=`sheep_${Math.ceil(1e6*Math.random()).toString(36)}`;return t((()=>{l((()=>{!function(){if("md"===U.size){const s=x().in(R);s.select(`#${O}`).fields({size:!0,scrollOffset:!0}),s.exec((s=>{let e=0;const t=s[0];e=U.data.image_wh?t.width/U.data.image_wh.w*U.data.image_wh.h+t.height:t.width,B("getHeight",e)}))}}()}))})),(s,e)=>{const t=k,l=b,x=w;return a(),o(l,{class:"ss-goods-wrap"},{default:i((()=>["xs"===T.size?(a(),o(l,{key:0,class:"xs-goods-card ss-flex ss-col-stretch",style:d([A.value]),onClick:W},{default:i((()=>{var s,e,f;return[T.tagStyle.show?(a(),o(l,{key:0,class:"tag-icon-box"},{default:i((()=>[r(t,{class:"tag-icon",src:c(u).$url.cdn(T.tagStyle.src||T.tagStyle.imgUrl)},null,8,["src"])])),_:1})):n("",!0),r(t,{class:"xs-img-box",src:c(u).$url.cdn(T.data.image||T.data.picUrl),mode:"aspectFit"},null,8,["src"]),(null==(s=T.goodsFields.title)?void 0:s.show)||(null==(e=T.goodsFields.name)?void 0:e.show)||(null==(f=T.goodsFields.price)?void 0:f.show)?(a(),o(l,{key:1,class:"xs-goods-content ss-flex-col ss-row-around"},{default:i((()=>{var s,e,u;return[(null==(s=T.goodsFields.title)?void 0:s.show)||(null==(e=T.goodsFields.name)?void 0:e.show)?(a(),o(l,{key:0,class:"xs-goods-title ss-line-1",style:d([{color:T.titleColor,width:T.titleWidth?T.titleWidth+"rpx":""}])},{default:i((()=>[g(y(T.data.title||T.data.name),1)])),_:1},8,["style"])):n("",!0),(null==(u=T.goodsFields.price)?void 0:u.show)?(a(),o(l,{key:1,class:"xs-goods-price ss-flex",style:d([{color:T.goodsFields.price.color}])},{default:i((()=>[2==T.data.spuPayType?(a(),o(t,{key:0,src:F,class:"ss-m-r-10",style:{width:"40rpx",height:"40rpx"}})):(a(),o(x,{key:1},{default:i((()=>[g("¥")])),_:1})),T.data.highPrecision?(a(),o(x,{key:2},{default:i((()=>[g(y(c(p.isArray)(T.data.highPrecisionPrice)?c(C)(T.data.highPrecisionPrice[0]):c(C)(T.data.highPrecisionPrice)),1)])),_:1})):(a(),o(x,{key:3},{default:i((()=>[g(y(c(p.isArray)(T.data.price)?c($)(T.data.price[0]):c($)(T.data.price)),1)])),_:1}))])),_:1},8,["style"])):n("",!0),r(l,null,{default:i((()=>[T.data.promotionFee>=0?(a(),o(l,{key:0,class:"origin-price-text"},{default:i((()=>[g(" 积分:"+y(c($)(T.data.promotionFee)),1)])),_:1})):n("",!0)])),_:1})]})),_:1})):n("",!0)]})),_:1},8,["style"])):n("",!0),"sm"===T.size?(a(),o(l,{key:1,class:"sm-goods-card ss-flex-col",style:d([A.value]),onClick:W},{default:i((()=>{var s,e,f;return[T.tagStyle.show?(a(),o(l,{key:0,class:"tag-icon-box"},{default:i((()=>[r(t,{class:"tag-icon",src:c(u).$url.cdn(T.tagStyle.src||T.tagStyle.imgUrl)},null,8,["src"])])),_:1})):n("",!0),r(t,{class:"sm-img-box",src:c(u).$url.cdn(T.data.image||T.data.picUrl),mode:"aspectFill"},null,8,["src"]),(null==(s=T.goodsFields.title)?void 0:s.show)||(null==(e=T.goodsFields.name)?void 0:e.show)||(null==(f=T.goodsFields.price)?void 0:f.show)?(a(),o(l,{key:1,class:"sm-goods-content",style:d([{color:T.titleColor,width:T.titleWidth?T.titleWidth+"rpx":""}])},{default:i((()=>{var s,e,r;return[(null==(s=T.goodsFields.title)?void 0:s.show)||(null==(e=T.goodsFields.name)?void 0:e.show)?(a(),o(l,{key:0,class:"sm-goods-title ss-line-1 ss-m-b-8"},{default:i((()=>[g(y(T.data.title||T.data.name),1)])),_:1})):n("",!0),(null==(r=T.goodsFields.price)?void 0:r.show)?(a(),o(l,{key:1,class:"sm-goods-price ss-flex",style:d([{color:T.goodsFields.price.color}])},{default:i((()=>[2==T.data.spuPayType?(a(),o(t,{key:0,src:F,class:"ss-m-r-10",style:{width:"40rpx",height:"40rpx"}})):(a(),o(x,{key:1},{default:i((()=>[g("¥")])),_:1})),T.data.highPrecision?(a(),o(x,{key:2},{default:i((()=>[g(y(c(p.isArray)(T.data.highPrecisionPrice)?c(C)(T.data.highPrecisionPrice[0]):c(C)(T.data.highPrecisionPrice)),1)])),_:1})):(a(),o(x,{key:3},{default:i((()=>[g(y(c(p.isArray)(T.data.price)?c($)(T.data.price[0]):c($)(T.data.price)),1)])),_:1}))])),_:1},8,["style"])):n("",!0),T.data.promotionFee>=0?(a(),o(l,{key:2,class:"origin-price-text"},{default:i((()=>[g(" 积分:"+y(c($)(T.data.promotionFee)),1)])),_:1})):n("",!0)]})),_:1},8,["style"])):n("",!0)]})),_:1},8,["style"])):n("",!0),"md"===T.size?(a(),o(l,{key:2,class:"md-goods-card ss-flex-col",style:d([A.value]),onClick:W},{default:i((()=>[T.tagStyle.show?(a(),o(l,{key:0,class:"tag-icon-box"},{default:i((()=>[r(t,{class:"tag-icon",src:c(u).$url.cdn(T.tagStyle.src||T.tagStyle.imgUrl)},null,8,["src"])])),_:1})):n("",!0),r(t,{class:"md-img-box",src:c(u).$url.cdn(T.data.image||T.data.picUrl),mode:"widthFix"},null,8,["src"]),r(l,{class:"md-goods-content ss-flex-col ss-row-around ss-p-b-20 ss-p-t-20 ss-p-x-16",id:O},{default:i((()=>{var e,u,k,b;return[(null==(e=T.goodsFields.title)?void 0:e.show)||(null==(u=T.goodsFields.name)?void 0:u.show)?(a(),o(l,{key:0,class:"md-goods-title ss-line-1",style:d([{color:T.titleColor,width:T.titleWidth?T.titleWidth+"rpx":""}])},{default:i((()=>[g(y(T.data.title||T.data.name),1)])),_:1},8,["style"])):n("",!0),(null==(k=T.goodsFields.subtitle)?void 0:k.show)||(null==(b=T.goodsFields.introduction)?void 0:b.show)?(a(),o(l,{key:1,class:"md-goods-subtitle ss-m-t-16 ss-line-1",style:d([{color:T.subTitleColor,background:T.subTitleBackground}])},{default:i((()=>[g(y(T.data.subtitle||T.data.introduction),1)])),_:1},8,["style"])):n("",!0),f(s.$slots,"activity",{},(()=>{var s;return[(null==(s=T.data.promos)?void 0:s.length)?(a(),o(l,{key:0,class:"tag-box ss-flex-wrap ss-flex ss-col-center"},{default:i((()=>[(a(!0),h(m,null,_(T.data.promos,(s=>(a(),o(l,{class:"activity-tag ss-m-r-10 ss-m-t-16",key:s.id},{default:i((()=>[g(y(s.title),1)])),_:2},1024)))),128))])),_:1})):n("",!0)]}),!0),r(l,{class:"ss-flex ss-col-center ss-m-t-16"},{default:i((()=>{var s;return[(null==(s=T.goodsFields.price)?void 0:s.show)?(a(),o(l,{key:0,class:"md-goods-price ss-flex ss-m-r-10",style:d([{color:T.goodsFields.price.color}])},{default:i((()=>[2==T.data.spuPayType?(a(),o(t,{key:0,src:F,class:"ss-m-r-10",style:{width:"40rpx",height:"40rpx"}})):(a(),o(x,{key:1},{default:i((()=>[g("¥")])),_:1})),T.data.highPrecision?(a(),o(x,{key:2},{default:i((()=>[g(y(c(p.isArray)(T.data.highPrecisionPrice)?c(C)(T.data.highPrecisionPrice[0]):c(C)(T.data.highPrecisionPrice)),1)])),_:1})):(a(),o(x,{key:3},{default:i((()=>[g(y(c(p.isArray)(T.data.price)?c($)(T.data.price[0]):c($)(T.data.price)),1)])),_:1}))])),_:1},8,["style"])):n("",!0),T.data.promotionFee>=0?(a(),o(l,{key:1,class:"origin-price-text"},{default:i((()=>[g(" 积分:"+y(c($)(T.data.promotionFee)),1)])),_:1})):n("",!0)]})),_:1}),r(l,{class:"ss-m-t-32 ss-flex ss-col-center ss-flex-wrap"},{default:i((()=>[r(l,{class:"sales-text"},{default:i((()=>[g(y(z.value),1)])),_:1})])),_:1})]})),_:3}),f(s.$slots,"cart",{},(()=>[r(l,{class:"cart-box ss-flex ss-col-center ss-row-center"},{default:i((()=>[r(t,{class:"cart-icon",src:"./static/img/shop/tabbar/category2.png",mode:""})])),_:1})]),!0)])),_:3},8,["style"])):n("",!0),"lg"===T.size?(a(),o(l,{key:3,class:"lg-goods-card ss-flex ss-col-stretch",style:d([A.value]),onClick:W},{default:i((()=>[T.tagStyle.show?(a(),o(l,{key:0,class:"tag-icon-box"},{default:i((()=>[r(t,{class:"tag-icon",src:c(u).$url.cdn(T.tagStyle.src||T.tagStyle.imgUrl)},null,8,["src"])])),_:1})):n("",!0),T.seckillTag?(a(),o(l,{key:1,class:"seckill-tag ss-flex ss-row-center"},{default:i((()=>[g(" 秒杀 ")])),_:1})):n("",!0),T.grouponTag?(a(),o(l,{key:2,class:"groupon-tag ss-flex ss-row-center"},{default:i((()=>[r(l,{class:"tag-icon"},{default:i((()=>[g("拼团")])),_:1})])),_:1})):n("",!0),r(t,{class:"lg-img-box",src:c(u).$url.cdn(T.data.image||T.data.picUrl),mode:"aspectFill"},null,8,["src"]),r(l,{class:"lg-goods-content ss-flex-1 ss-flex-col ss-row-between ss-p-b-10 ss-p-t-20"},{default:i((()=>[r(l,null,{default:i((()=>{var s,e,t,r;return[(null==(s=T.goodsFields.title)?void 0:s.show)||(null==(e=T.goodsFields.name)?void 0:e.show)?(a(),o(l,{key:0,class:"lg-goods-title ss-line-2",style:d([{color:T.titleColor}])},{default:i((()=>[g(y(T.data.title||T.data.name),1)])),_:1},8,["style"])):n("",!0),(null==(t=T.goodsFields.subtitle)?void 0:t.show)||(null==(r=T.goodsFields.introduction)?void 0:r.show)?(a(),o(l,{key:1,class:"lg-goods-subtitle ss-m-t-10 ss-line-1",style:d([{color:T.subTitleColor,background:T.subTitleBackground}])},{default:i((()=>[g(y(T.data.subtitle||T.data.introduction),1)])),_:1},8,["style"])):n("",!0)]})),_:1}),r(l,null,{default:i((()=>[f(s.$slots,"activity",{},(()=>{var s;return[(null==(s=T.data.promos)?void 0:s.length)?(a(),o(l,{key:0,class:"tag-box ss-flex ss-col-center"},{default:i((()=>[(a(!0),h(m,null,_(T.data.promos,(s=>(a(),o(l,{class:"activity-tag ss-m-r-10",key:s.id},{default:i((()=>[g(y(s.title),1)])),_:2},1024)))),128))])),_:1})):n("",!0)]}),!0),r(l,{class:"ss-flex ss-col-bottom ss-m-b-10"},{default:i((()=>{var s;return[(null==(s=T.goodsFields.price)?void 0:s.show)?(a(),o(l,{key:0,class:"lg-goods-price ss-m-r-12 ss-flex ss-col-bottom ss-flex",style:d([{color:T.goodsFields.price.color}])},{default:i((()=>[2==T.data.spuPayType?(a(),o(t,{key:0,src:F,class:"ss-m-r-10",style:{width:"40rpx",height:"40rpx"}})):(a(),o(x,{key:1},{default:i((()=>[g("¥")])),_:1})),T.data.highPrecision?(a(),o(x,{key:2},{default:i((()=>[g(y(c(p.isArray)(T.data.highPrecisionPrice)?c(C)(T.data.highPrecisionPrice[0]):c(C)(T.data.highPrecisionPrice)),1)])),_:1})):(a(),o(x,{key:3},{default:i((()=>[g(y(c(p.isArray)(T.data.price)?c($)(T.data.price[0]):c($)(T.data.price)),1)])),_:1}))])),_:1},8,["style"])):n("",!0)]})),_:1}),r(l,{class:"ss-flex ss-col-bottom ss-m-b-10"},{default:i((()=>[T.data.promotionFee>=0?(a(),o(l,{key:0,class:"origin-price-text"},{default:i((()=>[g(" 积分:"+y(c($)(T.data.promotionFee)),1)])),_:1})):n("",!0)])),_:1}),r(l,{class:"ss-m-t-8 ss-flex ss-col-center ss-flex-wrap"},{default:i((()=>[r(l,{class:"sales-text"},{default:i((()=>[g(y(z.value),1)])),_:1})])),_:1})])),_:3})])),_:3}),f(s.$slots,"cart",{},(()=>[T.buttonShow?(a(),o(l,{key:0,class:"buy-box ss-flex ss-col-center ss-row-center"},{default:i((()=>[g(" 去购买 ")])),_:1})):n("",!0)]),!0)])),_:3},8,["style"])):n("",!0),"sl"===T.size?(a(),o(l,{key:4,class:"sl-goods-card ss-flex-col",style:d([A.value]),onClick:W},{default:i((()=>[T.tagStyle.show?(a(),o(l,{key:0,class:"tag-icon-box"},{default:i((()=>[r(t,{class:"tag-icon",src:c(u).$url.cdn(T.tagStyle.src||T.tagStyle.imgUrl)},null,8,["src"])])),_:1})):n("",!0),r(t,{class:"sl-img-box",src:c(u).$url.cdn(T.data.image||T.data.picUrl),mode:"aspectFill"},null,8,["src"]),r(l,{class:"sl-goods-content"},{default:i((()=>[r(l,null,{default:i((()=>{var s,e,t,r;return[(null==(s=T.goodsFields.title)?void 0:s.show)||(null==(e=T.goodsFields.name)?void 0:e.show)?(a(),o(l,{key:0,class:"sl-goods-title ss-line-1",style:d([{color:T.titleColor}])},{default:i((()=>[g(y(T.data.title||T.data.name),1)])),_:1},8,["style"])):n("",!0),(null==(t=T.goodsFields.subtitle)?void 0:t.show)||(null==(r=T.goodsFields.introduction)?void 0:r.show)?(a(),o(l,{key:1,class:"sl-goods-subtitle ss-m-t-16",style:d([{color:T.subTitleColor,background:T.subTitleBackground}])},{default:i((()=>[g(y(T.data.subtitle||T.data.introduction),1)])),_:1},8,["style"])):n("",!0)]})),_:1}),r(l,null,{default:i((()=>{var e;return[f(s.$slots,"activity",{},(()=>{var s;return[(null==(s=T.data.promos)?void 0:s.length)?(a(),o(l,{key:0,class:"tag-box ss-flex ss-col-center ss-flex-wrap"},{default:i((()=>[(a(!0),h(m,null,_(T.data.promos,(s=>(a(),o(l,{class:"activity-tag ss-m-r-10 ss-m-t-16",key:s.id},{default:i((()=>[g(y(s.title),1)])),_:2},1024)))),128))])),_:1})):n("",!0)]}),!0),(null==(e=T.goodsFields.price)?void 0:e.show)?(a(),o(l,{key:0,class:"ss-flex ss-col-bottom ss-flex ss-m-t-10"},{default:i((()=>[r(l,{class:"sl-goods-price ss-m-r-12",style:d([{color:T.goodsFields.price.color}])},{default:i((()=>[2==T.data.spuPayType?(a(),o(t,{key:0,src:F,class:"ss-m-r-10",style:{width:"40rpx",height:"40rpx"}})):(a(),o(x,{key:1},{default:i((()=>[g("¥")])),_:1})),g(y(c(p.isArray)(T.data.price)?c($)(T.data.price[0]):c($)(T.data.price)),1)])),_:1},8,["style"]),T.data.promotionFee>=0?(a(),o(l,{key:0,class:"origin-price-text"},{default:i((()=>[g(" 积分:"+y(c($)(T.data.promotionFee)),1)])),_:1})):n("",!0)])),_:1})):n("",!0),r(l,{class:"ss-m-t-16 ss-flex ss-flex-wrap"},{default:i((()=>[r(l,{class:"sales-text"},{default:i((()=>[g(y(z.value),1)])),_:1})])),_:1})]})),_:3})])),_:3}),f(s.$slots,"cart",{},(()=>[r(l,{class:"buy-box ss-flex ss-col-center ss-row-center"},{default:i((()=>[g("去购买")])),_:1})]),!0)])),_:3},8,["style"])):n("",!0)])),_:3})}}},[["__scopeId","data-v-10f37678"]]);export{j as _};
|