2 lines
2.2 KiB
JavaScript
2 lines
2.2 KiB
JavaScript
"use strict";const e=require("../../../common/vendor.js"),a=require("../../index.js"),t=require("../../api/product/spu.js");if(!Array){e.resolveComponent("s-goods-column")()}Math;const d={__name:"s-goods-shelves",props:{data:{type:Object,default(){}},styles:{type:Object,default(){}}},setup(d){const o=d,{layoutType:r,spuIds:s}=o.data,{marginLeft:i,marginRight:l}=o.styles,n=e.ref([]);return e.onMounted((()=>{return e=this,a=null,d=function*(){if(s.length>0){const{data:e}=yield t.SpuApi.getSpuListByIds(s.join(","));n.value=e}},new Promise(((t,o)=>{var r=e=>{try{i(d.next(e))}catch(a){o(a)}},s=e=>{try{i(d.throw(e))}catch(a){o(a)}},i=e=>e.done?t(e.value):Promise.resolve(e.value).then(r,s);i((d=d.apply(e,a)).next())}));var e,a,d})),(t,o)=>e.e({a:"twoCol"===e.unref(r)},"twoCol"===e.unref(r)?{b:e.f(n.value,((t,o,r)=>{var s;return{a:e.o((d=>e.unref(a.sheep).$router.go("/modules/mall/goods/index",{id:t.id})),t.id),b:"4a579dcb-0-"+r,c:e.p({size:"xs",goodsFields:d.data.fields,tagStyle:d.data.badge,data:t,titleColor:null==(s=d.data.fields.name)?void 0:s.color,topRadius:d.data.borderRadiusTop,bottomRadius:d.data.borderRadiusBottom,titleWidth:(454-2*e.unref(l)-2*d.data.space-2*e.unref(i))/2}),d:t.id}})),c:e.s({padding:d.data.space+"rpx"}),d:e.s({margin:"-"+d.data.space+"rpx"})}:{},{e:"threeCol"===e.unref(r)},"threeCol"===e.unref(r)?{f:e.f(n.value,((t,o,r)=>{var s;return{a:e.o((d=>e.unref(a.sheep).$router.go("/modules/mall/goods/index",{id:t.id})),t.id),b:"4a579dcb-1-"+r,c:e.p({size:"sm",goodsFields:d.data.fields,tagStyle:d.data.badge,data:t,titleColor:null==(s=d.data.fields.name)?void 0:s.color,topRadius:d.data.borderRadiusTop,bottomRadius:d.data.borderRadiusBottom}),d:t.id}})),g:e.s({padding:d.data.space+"rpx"}),h:e.s({margin:"-"+d.data.space+"rpx"})}:{},{i:"horizSwiper"===e.unref(r)},"horizSwiper"===e.unref(r)?{j:e.f(n.value,((t,o,r)=>{var s;return{a:e.o((d=>e.unref(a.sheep).$router.go("/modules/mall/goods/index",{id:t.id})),t.id),b:"4a579dcb-2-"+r,c:e.p({size:"sm",goodsFields:d.data.fields,tagStyle:d.data.badge,data:t,titleColor:null==(s=d.data.fields.name)?void 0:s.color,titleWidth:(750-2*e.unref(l)-4*d.data.space-2*e.unref(i))/3}),d:t.id}})),k:e.s({marginRight:2*d.data.space+"rpx"})}:{})}},o=e._export_sfc(d,[["__scopeId","data-v-4a579dcb"]]);wx.createComponent(o);
|