1 line
6.5 KiB
Plaintext
1 line
6.5 KiB
Plaintext
|
{"version":3,"file":"s-groupon-block.js","sources":["../../../../../../src/sheep/components/s-groupon-block/s-groupon-block.vue","../../../../../../uniComponent:/RDovQXBwL1dvcmsvYWRkci9hY2RyLXVpL3NyYy9zaGVlcC9jb21wb25lbnRzL3MtZ3JvdXBvbi1ibG9jay9zLWdyb3Vwb24tYmxvY2sudnVl"],"sourcesContent":["<!-- 装修组件 - 拼团 -->\r\n<template>\r\n <view>\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=\"product in productList\"\r\n class=\"goods-card-box\"\r\n :key=\"product.id\"\r\n :style=\"[{ padding: data.space + 'rpx' }]\"\r\n >\r\n <s-goods-column\r\n class=\"goods-card\"\r\n size=\"sm\"\r\n :goodsFields=\"goodsFields\"\r\n :tagStyle=\"badge\"\r\n :data=\"product\"\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/groupon', { id: props.data.activityId })\"\r\n ></s-goods-column>\r\n </view>\r\n </view>\r\n <!-- 样式2 一行一个 图片左 文案右 -->\r\n <view class=\"goods-box\" v-if=\"layoutType === 'oneCol'\">\r\n <view\r\n class=\"goods-list\"\r\n v-for=\"(product, index) in productList\"\r\n :key=\"index\"\r\n :style=\"[{ marginBottom: space + 'px' }]\"\r\n >\r\n <s-goods-column\r\n class=\"goods-card\"\r\n size=\"lg\"\r\n :grouponTag=\"true\"\r\n :goodsFields=\"goodsFields\"\r\n :tagStyle=\"badge\"\r\n :data=\"product\"\r\n :titleColor=\"data.fields.name?.color\"\r\n :subTitleColor=\"data.fields.introduction?.color\"\r\n :topRadius=\"data.borderRadiusTop\"\r\n :bottomRadius=\"data.borderRadiusBottom\"\r\n @click=\"sheep.$router.go('/modules/mall/goods/groupon', { id: props.data.activityId })\"\r\n >\r\n <template v-slot:cart>\r\n <button class=\"ss-reset-button cart-btn\" :style=\"[buyStyle]\">\r\n {{ btnBuy?.type === 'text' ? btnBuy.text : '去拼团' }}\r\n </button>\r\n </template>\r\n </s-goods-column>\r\n </view>\r\n </view>\r\n </view>\r\n</template>\r\n\r\n<script setup>\r\n/**\r\n * 拼团\r\n */\r\nimport { computed, onMounted, reactive, ref } from 'vue'\r\nimport sheep from '@/sheep'\r\nimport SpuApi from '@/sheep/api/product/spu'\r\nimport CombinationApi from '@/sheep/api/promotion/combination'\r\n\r\n// 接收参数\r\nconst props = defineProps({\r\n // 装修数据\r\n data: {\r\n type: Object,\r\n default: () => ({}),\r\n },\r\n // 装修样式\r\n styles: {\r\n type: Object,\r\n default: () => ({}),\r\n },\r\n})\r\n\r\n// 设置相关信息是否显示\r\nconst goodsFields = reactive({\r\n // 商品价格\r\n price: { show: true },\r\n // 库存\r\n stock: { show: true },\r\n // 商品名称\r\n name: { show: true },\r\n // 商品介绍\r\n introduction: { show: true },\r\n // 市场价\r\n marketPrice: { show: true },\r\n // 销量\r\n salesCount: { show: true },\r\n})\r\n\r\nconst { layoutType, badge, btnBuy, space } = props.data\r\nconst { marginLeft, marginRight } = props.styles\r\n\r\n// 购买按钮样式(暂未实现)\r\nconst buyStyle = computed(() => {\r\n const btnBuy = props.data.btnBuy\r\n if (btnBuy?.type === 'text') {\r\n return {\r\n background: `linear-gradient(to right, ${btnBuy.bgBeginColor}, ${btnBuy.bgEndColor})`,\r\n }\r\n }\r\n\r\n if (btnBuy?.type === 'img') {\r\n return {\r\n width: '54rpx',\r\n height: '54rpx',\r\n background: `url(${sheep.$url.cdn(btnBuy.imgUrl)}) no-repeat`,\r\n backgroundSize: '100% 100%',\r\n }\r\n }\r\n})\r\n\r\nconst productList = ref([])\r\nonMounted(async () => {\r\n // todo:@owen 与Yudao结构不一致,待重构\r\n const { data:
|