1 line
5.1 KiB
Plaintext
1 line
5.1 KiB
Plaintext
{"version":3,"file":"s-goods-shelves.js","sources":["../../../../../../src/sheep/components/s-goods-shelves/s-goods-shelves.vue","../../../../../../uniComponent:/RDovQXBwL1dvcmsvYWRkci9hY2RyLXVpL3NyYy9zaGVlcC9jb21wb25lbnRzL3MtZ29vZHMtc2hlbHZlcy9zLWdvb2RzLXNoZWx2ZXMudnVl"],"sourcesContent":["<!-- 装修商品组件:商品栏 -->\r\n<template>\r\n <view>\r\n <!-- 布局1. 两列商品,图片左文案右 -->\r\n <view\r\n v-if=\"layoutType === 'twoCol'\"\r\n class=\"goods-xs-box ss-flex ss-flex-wrap\"\r\n :style=\"[{ margin: '-' + data.space + 'rpx' }]\"\r\n >\r\n <view\r\n class=\"goods-xs-list\"\r\n v-for=\"item in goodsList\"\r\n :key=\"item.id\"\r\n :style=\"[\r\n {\r\n padding: data.space + 'rpx',\r\n },\r\n ]\"\r\n >\r\n <s-goods-column\r\n class=\"goods-card\"\r\n size=\"xs\"\r\n :goodsFields=\"data.fields\"\r\n :tagStyle=\"data.badge\"\r\n :data=\"item\"\r\n :titleColor=\"data.fields.name?.color\"\r\n :topRadius=\"data.borderRadiusTop\"\r\n :bottomRadius=\"data.borderRadiusBottom\"\r\n :titleWidth=\"(454 - marginRight * 2 - data.space * 2 - marginLeft * 2) / 2\"\r\n @click=\"sheep.$router.go('/modules/mall/goods/index', { id: item.id })\"\r\n />\r\n </view>\r\n </view>\r\n <!-- 布局. 三列商品:图片上文案下 -->\r\n <view\r\n v-if=\"layoutType === 'threeCol'\"\r\n class=\"goods-sm-box ss-flex ss-flex-wrap\"\r\n :style=\"[{ margin: '-' + data.space + 'rpx' }]\"\r\n >\r\n <view\r\n v-for=\"item in goodsList\"\r\n :key=\"item.id\"\r\n class=\"goods-card-box\"\r\n :style=\"[\r\n {\r\n padding: data.space + 'rpx',\r\n },\r\n ]\"\r\n >\r\n <s-goods-column\r\n class=\"goods-card\"\r\n size=\"sm\"\r\n :goodsFields=\"data.fields\"\r\n :tagStyle=\"data.badge\"\r\n :data=\"item\"\r\n :titleColor=\"data.fields.name?.color\"\r\n :topRadius=\"data.borderRadiusTop\"\r\n :bottomRadius=\"data.borderRadiusBottom\"\r\n @click=\"sheep.$router.go('/modules/mall/goods/index', { id: item.id })\"\r\n />\r\n </view>\r\n </view>\r\n\r\n <!-- 布局3. 一行商品,水平滑动 -->\r\n <view v-if=\"layoutType === 'horizSwiper'\" class=\"\">\r\n <scroll-view class=\"scroll-box goods-scroll-box\" scroll-x scroll-anchoring>\r\n <view class=\"goods-box ss-flex\">\r\n <view\r\n class=\"goods-card-box\"\r\n v-for=\"item in goodsList\"\r\n :key=\"item.id\"\r\n :style=\"[{ marginRight: data.space * 2 + 'rpx' }]\"\r\n >\r\n <s-goods-column\r\n class=\"goods-card\"\r\n size=\"sm\"\r\n :goodsFields=\"data.fields\"\r\n :tagStyle=\"data.badge\"\r\n :data=\"item\"\r\n :titleColor=\"data.fields.name?.color\"\r\n :titleWidth=\"(750 - marginRight * 2 - data.space * 4 - marginLeft * 2) / 3\"\r\n @click=\"sheep.$router.go('/modules/mall/goods/index', { id: item.id })\"\r\n />\r\n </view>\r\n </view>\r\n </scroll-view>\r\n </view>\r\n </view>\r\n</template>\r\n\r\n<script setup>\r\n/**\r\n * 商品栏\r\n */\r\nimport { onMounted, ref, computed } from 'vue'\r\nimport sheep from '@/sheep'\r\nimport SpuApi from '@/sheep/api/product/spu'\r\n\r\nconst props = defineProps({\r\n data: {\r\n type: Object,\r\n default() {},\r\n },\r\n styles: {\r\n type: Object,\r\n default() {},\r\n },\r\n})\r\nconst { layoutType, spuIds } = props.data\r\nconst { marginLeft, marginRight } = props.styles\r\nconst goodsList = ref([])\r\nonMounted(async () => {\r\n if (spuIds.length > 0) {\r\n const { data } = await SpuApi.getSpuListByIds(spuIds.join(','))\r\n goodsList.value = data\r\n }\r\n})\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n \r\n.goods-xs-box {\r\n // margin: 0 auto;\r\n width: 100%;\r\n .goods-xs-list {\r\n box-sizing: border-box;\r\n flex-shrink: 0;\r\n width: 50%;\r\n overflow: hidden;\r\n }\r\n}\r\n\r\n.goods-sm-box {\r\n box-sizing: border-box;\r\n margin: 0 auto;\r\n .goods-card-box {\r\n box-sizing: border-box;\r\n flex-shrink: 0;\r\n width: 33.3%;\r\n overflow: hidden;\r\n }\r\n}\r\n.goods-scroll-box {\r\n box-sizing: border-box;\r\n width: 100%;\r\n margin: 0 auto;\r\n}\r\n</style>\r\n","import Component from 'D:/App/Work/addr/acdr-ui/src/sheep/components/s-goods-shelves/s-goods-shelves.vue'\nwx.createComponent(Component)"],"names":["ref","onMounted","SpuApi"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkGA,UAAM,QAAQ;AAUd,UAAM,EAAE,YAAY,WAAW,MAAM;AACrC,UAAM,EAAE,YAAY,gBAAgB,MAAM;AAC1C,UAAM,YAAYA,cAAG,IAAC,EAAE;AACxBC,kBAAAA,UAAU,MAAY;AACpB,UAAI,OAAO,SAAS,GAAG;AACrB,cAAM,EAAE,KAAM,IAAG,MAAMC,sBAAM,OAAC,gBAAgB,OAAO,KAAK,GAAG,CAAC;AAC9D,kBAAU,QAAQ;AAAA,MACnB;AAAA,IACH,EAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACnHD,GAAG,gBAAgB,SAAS;"} |