acdr-ui/dist/dev/mp-weixin/modules/mall/sheep/components/s-goods-item/s-goods-item.js

95 lines
2.4 KiB
JavaScript
Raw Normal View History

2024-09-19 07:20:14 +08:00
"use strict";
2024-10-01 09:15:35 +08:00
const common_vendor = require("../../../../../common/vendor.js");
const modules_mall_sheep_index = require("../../index.js");
const modules_mall_sheep_hooks_useGoods = require("../../hooks/useGoods.js");
2024-09-19 07:20:14 +08:00
const _sfc_main = {
__name: "s-goods-item",
props: {
img: {
type: String,
default: "https://img1.baidu.com/it/u=1601695551,235775011&fm=26&fmt=auto"
},
title: {
type: String,
default: ""
},
titleWidth: {
type: Number,
default: 0
},
skuText: {
type: [String, Array],
default: ""
},
price: {
type: [String, Number],
default: ""
},
priceColor: {
type: [String],
default: ""
},
num: {
type: [String, Number],
default: 0
},
score: {
type: [String, Number],
default: ""
},
radius: {
type: [String],
default: ""
},
marginBottom: {
type: [String],
default: ""
}
},
setup(__props) {
const props = __props;
const skuString = common_vendor.computed(() => {
if (!props.skuText) {
return "";
}
if (typeof props.skuText === "object") {
return props.skuText.join(",");
}
return props.skuText;
});
return (_ctx, _cache) => {
return common_vendor.e({
2024-10-01 09:15:35 +08:00
a: common_vendor.unref(modules_mall_sheep_index.sheep).$url.cdn(__props.img),
2024-09-19 07:20:14 +08:00
b: __props.title
}, __props.title ? {
c: common_vendor.t(__props.title)
} : {}, {
d: skuString.value
}, skuString.value ? {
e: common_vendor.t(skuString.value)
} : {}, {
f: __props.price && Number(__props.price) > 0
}, __props.price && Number(__props.price) > 0 ? {
2024-10-01 09:15:35 +08:00
g: common_vendor.t(common_vendor.unref(modules_mall_sheep_hooks_useGoods.fen2yuan)(__props.price)),
2024-09-19 07:20:14 +08:00
h: common_vendor.s({
color: __props.priceColor
})
} : {}, {
i: __props.num
}, __props.num ? {
j: common_vendor.t(__props.num)
} : {}, {
k: common_vendor.s({
width: __props.titleWidth ? __props.titleWidth + "rpx" : ""
}),
l: common_vendor.s({
borderRadius: __props.radius + "rpx",
marginBottom: __props.marginBottom + "rpx"
})
});
};
}
};
2024-10-01 09:15:35 +08:00
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-27792683"]]);
2024-09-19 07:20:14 +08:00
wx.createComponent(Component);