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: activity } = await CombinationApi.getCombinationActivity(props.data.activityId)\r\n const { data: spu } = await SpuApi.getSpuDetail(activity.spuId)\r\n // 循环活动信息,赋值拼团最低价格\r\n activity.products.forEach((product) => {\r\n spu.price = Math.min(spu.price, product.combinationPrice) // 设置 SPU 的最低价格\r\n })\r\n productList.value = [spu]\r\n})\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n \r\n.goods-list {\r\n position: relative;\r\n\r\n .cart-btn {\r\n position: absolute;\r\n bottom: 10rpx;\r\n right: 20rpx;\r\n z-index: 11;\r\n height: 50rpx;\r\n line-height: 50rpx;\r\n padding: 0 20rpx;\r\n border-radius: 25rpx;\r\n font-size: 24rpx;\r\n color: #fff;\r\n background: linear-gradient(90deg, #ff6600 0%, #fe832a 100%);\r\n }\r\n}\r\n\r\n.goods-list {\r\n &:nth-last-of-type(1) {\r\n margin-bottom: 0 !important;\r\n }\r\n}\r\n\r\n.goods-sm-box {\r\n margin: 0 auto;\r\n box-sizing: border-box;\r\n\r\n .goods-card-box {\r\n flex-shrink: 0;\r\n overflow: hidden;\r\n width: 33.3%;\r\n box-sizing: border-box;\r\n }\r\n}\r\n</style>\r\n","import Component from 'D:/App/Work/addr/acdr-ui/src/sheep/components/s-groupon-block/s-groupon-block.vue'\nwx.createComponent(Component)"],"names":["reactive","computed","btnBuy","sheep","ref","onMounted","CombinationApi","SpuApi"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqEA,UAAM,QAAQ;AAcd,UAAM,cAAcA,cAAAA,SAAS;AAAA;AAAA,MAE3B,OAAO,EAAE,MAAM,KAAM;AAAA;AAAA,MAErB,OAAO,EAAE,MAAM,KAAM;AAAA;AAAA,MAErB,MAAM,EAAE,MAAM,KAAM;AAAA;AAAA,MAEpB,cAAc,EAAE,MAAM,KAAM;AAAA;AAAA,MAE5B,aAAa,EAAE,MAAM,KAAM;AAAA;AAAA,MAE3B,YAAY,EAAE,MAAM,KAAM;AAAA,IAC5B,CAAC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