acdr-ui/dist/dev/mp-weixin/sheep/components/s-goods-shelves/s-goods-shelves.js.map

1 line
5.1 KiB
Plaintext
Raw Normal View History

2024-09-19 07:20:14 +08:00
{"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<st