1 line
5.2 KiB
Plaintext
1 line
5.2 KiB
Plaintext
|
{"version":3,"file":"s-goods-item.js","sources":["../../../../../../src/sheep/components/s-goods-item/s-goods-item.vue","../../../../../../uniComponent:/RDovQXBwL1dvcmsvYWRkci9hY2RyLXVpL3NyYy9zaGVlcC9jb21wb25lbnRzL3MtZ29vZHMtaXRlbS9zLWdvb2RzLWl0ZW0udnVl"],"sourcesContent":["<template>\r\n <view>\r\n <view>\r\n <slot name=\"top\"></slot>\r\n </view>\r\n <view\r\n class=\"ss-order-card-warp ss-flex ss-col-stretch ss-row-between bg-white\"\r\n :style=\"[{ borderRadius: radius + 'rpx', marginBottom: marginBottom + 'rpx' }]\"\r\n >\r\n <view class=\"img-box ss-m-r-24\">\r\n <image class=\"order-img\" :src=\"sheep.$url.cdn(img)\" mode=\"aspectFill\"></image>\r\n </view>\r\n <view\r\n class=\"box-right ss-flex-col ss-row-between\"\r\n :style=\"[{ width: titleWidth ? titleWidth + 'rpx' : '' }]\"\r\n >\r\n <view class=\"title-text ss-line-2\" v-if=\"title\">{{ title }}</view>\r\n <view v-if=\"skuString\" class=\"spec-text ss-m-t-8 ss-m-b-12\">{{ skuString }}</view>\r\n <view class=\"groupon-box\">\r\n <slot name=\"groupon\"></slot>\r\n </view>\r\n <view class=\"ss-flex\">\r\n <view class=\"ss-flex ss-col-center\">\r\n <view\r\n class=\"price-text ss-flex ss-col-center\"\r\n :style=\"[{ color: priceColor }]\"\r\n v-if=\"price && Number(price) > 0\"\r\n >\r\n ¥{{ fen2yuan(price) }}\r\n </view>\r\n <view v-if=\"num\" class=\"total-text ss-flex ss-col-center\">x {{ num }}</view>\r\n <slot name=\"priceSuffix\"></slot>\r\n </view>\r\n </view>\r\n <view class=\"tool-box\">\r\n <slot name=\"tool\"></slot>\r\n </view>\r\n <view>\r\n <slot name=\"rightBottom\"></slot>\r\n </view>\r\n </view>\r\n </view>\r\n </view>\r\n</template>\r\n\r\n<script setup>\r\nimport sheep from '@/sheep'\r\nimport { computed } from 'vue'\r\nimport { fen2yuan } from '@/sheep/hooks/useGoods'\r\n/**\r\n * 订单卡片\r\n *\r\n * @property {String} img \t\t\t\t\t\t\t\t\t\t\t- 图片\r\n * @property {String} title \t\t\t\t\t\t\t\t\t\t- 标题\r\n * @property {Number} titleWidth = 0\t\t\t\t\t\t\t\t- 标题宽度,默认0,单位rpx\r\n * @property {String} skuText \t\t\t\t\t\t\t\t\t\t- 规格\r\n * @property {String | Number} price \t\t\t\t\t\t\t\t- 价格\r\n * @property {String} priceColor \t\t\t\t\t\t\t\t\t- 价格颜色\r\n * @property {Number | String} num\t\t\t\t\t\t\t\t\t- 数量\r\n *\r\n */\r\nconst props = defineProps({\r\n img: {\r\n type: String,\r\n default: 'https://img1.baidu.com/it/u=1601695551,235775011&fm=26&fmt=auto',\r\n },\r\n title: {\r\n type: String,\r\n default: '',\r\n },\r\n titleWidth: {\r\n type: Number,\r\n default: 0,\r\n },\r\n skuText: {\r\n type: [String, Array],\r\n default: '',\r\n },\r\n price: {\r\n type: [String, Number],\r\n default: '',\r\n },\r\n priceColor: {\r\n type: [String],\r\n default: '',\r\n },\r\n num: {\r\n type: [String, Number],\r\n default: 0,\r\n },\r\n score: {\r\n type: [String, Number],\r\n default: '',\r\n },\r\n radius: {\r\n type: [String],\r\n default: '',\r\n },\r\n marginBottom: {\r\n type: [String],\r\n default: '',\r\n },\r\n})\r\nconst skuString = computed(() => {\r\n if (!props.skuText) {\r\n return ''\r\n }\r\n if (typeof props.skuText === 'object') {\r\n return props.skuText.join(',')\r\n }\r\n return props.skuText\r\n})\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n \r\n.score-img {\r\n width: 36rpx;\r\n height: 36rpx;\r\n margin: 0 4rpx;\r\n}\r\n.ss-order-card-warp {\r\n padding: 20rpx;\r\n\r\n .img-box {\r\n width: 164rpx;\r\n height: 164rpx;\r\n overflow: hidden;\r\n border-radius: 10rpx;\r\n\r\n .order-img {\r\n width: 164rpx;\r\n height: 164rpx;\r\n }\r\n }\r\n\r\n .box-right {\r\n // width: 500rpx;\r\n // height: 164rpx;\r\n position: relative;\r\n
|