"use strict";const e=require("../../../common/vendor.js"),t=require("../../index.js"),r=require("../../api/product/spu.js");if(require("../../url/index.js"),require("../../store/index.js"),require("../../store/app.js"),require("../../api/promotion/diy.js"),require("../../request/index.js"),require("../../config/index.js"),require("../../platform/index.js"),require("../../platform/provider/wechat/index.js"),require("../../platform/provider/wechat/miniProgram.js"),require("../../api/member/auth.js"),require("../../api/member/social.js"),require("../../api/member/user.js"),require("../../platform/provider/apple/index.js"),require("../../platform/share.js"),require("../../router/index.js"),require("../../hooks/useModal.js"),require("../../helper/index.js"),require("../../helper/test.js"),require("../../helper/digit.js"),require("../../api/member/signin.js"),require("../../helper/throttle.js"),require("../../platform/pay.js"),require("../../api/pay/order.js"),require("../../store/user.js"),require("../../store/cart.js"),require("../../api/trade/cart.js"),require("../../api/pay/wallet.js"),require("../../api/trade/order.js"),require("../../api/promotion/coupon.js"),require("../../store/sys.js"),require("../../store/modal.js"),require("../../config/zIndex.js"),!Array){e.resolveComponent("s-goods-column")()}Math;const o={__name:"s-goods-card",props:{data:{type:Object,default(){}},styles:{type:Object,default(){}}},setup(o){const i="oneColBigImg",a="twoCol",d="oneColSmallImg",s=e.reactive({goodsList:[],leftGoodsList:[],rightGoodsList:[]}),u=o,{layoutType:n,btnBuy:l,spuIds:p}=u.data??{},{marginLeft:g,marginRight:f}=u.styles??{},c=e.computed((()=>"text"===l.type?{background:"linear-gradient(90deg, var(--ui-BG-Main), var(--ui-BG-Main-gradient))"}:"img"===l.type?{width:"54rpx",height:"54rpx",background:`url(${t.sheep.$url.cdn(l.imgUrl)}) no-repeat`,backgroundSize:"100% 100%"}:void 0));let m=0,b=0,j=0;function h(e=0,t="left"){s.goodsList[m]&&("left"===t&&(b+=e),"right"===t&&(j+=e),b<=j?s.leftGoodsList.push(s.goodsList[m]):s.rightGoodsList.push(s.goodsList[m]),m++)}return e.onMounted((async()=>{s.goodsList=await async function(e){const{data:t}=await r.SpuApi.getSpuListByIds(e);return t}(p.join(",")),n===a&&h()})),(r,u)=>e.e({a:e.unref(n)===i&&s.goodsList.length},e.unref(n)===i&&s.goodsList.length?{b:e.f(s.goodsList,((r,i,a)=>{var d;return{a:e.o((o=>e.unref(t.sheep).$router.go("/pages/goods/index",{id:r.id})),r.id),b:"26b356c5-0-"+a,c:e.p({size:"sl",goodsFields:o.data.fields,tagStyle:o.data.badge,data:r,titleColor:null==(d=o.data.fields.name)?void 0:d.color,subTitleColor:o.data.fields.introduction.color,topRadius:o.data.borderRadiusTop,bottomRadius:o.data.borderRadiusBottom}),d:r.id}})),c:e.t("text"===e.unref(l).type?e.unref(l).text:""),d:e.s(c.value),e:e.s({marginBottom:2*o.data.space+"rpx"})}:{},{f:e.unref(n)===a&&s.goodsList.length},e.unref(n)===a&&s.goodsList.length?{g:e.f(s.leftGoodsList,((r,i,a)=>{var d;return{a:e.o((o=>e.unref(t.sheep).$router.go("/pages/goods/index",{id:r.id})),r.id),b:e.o((e=>h(e,"left")),r.id),c:"26b356c5-1-"+a,d:e.p({size:"md",goodsFields:o.data.fields,tagStyle:o.data.badge,data:r,titleColor:null==(d=o.data.fields.name)?void 0:d.color,subTitleColor:o.data.fields.introduction.color,topRadius:o.data.borderRadiusTop,bottomRadius:o.data.borderRadiusBottom,titleWidth:330-e.unref(g)-e.unref(f)}),e:r.id}})),h:e.t("text"===e.unref(l).type?e.unref(l).text:""),i:e.s(c.value),j:e.s({paddingRight:o.data.space+"rpx",marginBottom:o.data.space+"px"}),k:e.f(s.rightGoodsList,((r,i,a)=>{var d;return{a:e.o((o=>e.unref(t.sheep).$router.go("/pages/goods/index",{id:r.id})),r.id),b:e.o((e=>h(e,"right")),r.id),c:"26b356c5-2-"+a,d:e.p({size:"md",goodsFields:o.data.fields,tagStyle:o.data.badge,data:r,titleColor:null==(d=o.data.fields.name)?void 0:d.color,subTitleColor:o.data.fields.introduction.color,topRadius:o.data.borderRadiusTop,bottomRadius:o.data.borderRadiusBottom,titleWidth:330-e.unref(g)-e.unref(f)}),e:r.id}})),l:e.t("text"===e.unref(l).type?e.unref(l).text:""),m:e.s(c.value),n:e.s({paddingLeft:o.data.space+"rpx",marginBottom:o.data.space+"px"})}:{},{o:e.unref(n)===d&&s.goodsList.length},e.unref(n)===d&&s.goodsList.length?{p:e.f(s.goodsList,((r,i,a)=>{var d;return{a:e.o((o=>e.unref(t.sheep).$router.go("/pages/goods/index",{id:r.id})),r.id),b:"26b356c5-3-"+a,c:e.p({size:"lg",goodsFields:o.data.fields,data:r,tagStyle:o.data.badge,titleColor:null==(d=o.data.fields.name)?void 0:d.color,subTitleColor:o.data.fields.introduction.color,topRadius:o.data.borderRadiusTop,bottomRadius:o.data.borderRadiusBottom}),d:r.id}})),q:e.t("text"===e.unref(l).type?e.unref(l).text:""),r:e.s(c.value),s:e.s({marginBottom:o.data.space+"px"})}:{})}},i=e._export_sfc(o,[["__scopeId","data-v-26b356c5"]]);wx.createComponent(i);
