78 lines
2.5 KiB
JavaScript
78 lines
2.5 KiB
JavaScript
"use strict";
|
|
const common_vendor = require("../../../../../common/vendor.js");
|
|
const modules_mall_sheep_index = require("../../index.js");
|
|
const _sfc_main = {
|
|
__name: "s-title-block",
|
|
props: {
|
|
// 装修数据
|
|
data: {
|
|
type: Object,
|
|
default: () => ({})
|
|
},
|
|
// 装修样式
|
|
styles: {
|
|
type: Object,
|
|
default: () => ({})
|
|
}
|
|
},
|
|
setup(__props) {
|
|
const state = common_vendor.reactive({
|
|
typeMap: {
|
|
left: "ss-row-left",
|
|
center: "ss-row-center"
|
|
}
|
|
});
|
|
const props = __props;
|
|
const bgStyle = common_vendor.computed(() => {
|
|
const { bgType, bgImg, bgColor } = props.styles;
|
|
return {
|
|
background: bgType === "img" ? `url(${bgImg}) no-repeat top center / 100% 100%` : bgColor
|
|
};
|
|
});
|
|
const titleStyles = {
|
|
color: props.data.titleColor,
|
|
fontSize: `${props.data.titleSize}px`,
|
|
textAlign: props.data.textAlign
|
|
};
|
|
const descStyles = {
|
|
color: props.data.descriptionColor,
|
|
textAlign: props.data.textAlign,
|
|
fontSize: `${props.data.descriptionSize}px`,
|
|
fontWeight: `${props.data.descriptionWeight}px`
|
|
};
|
|
return (_ctx, _cache) => {
|
|
var _a, _b;
|
|
return common_vendor.e({
|
|
a: __props.data.title
|
|
}, __props.data.title ? {
|
|
b: common_vendor.t(__props.data.title),
|
|
c: common_vendor.s(titleStyles)
|
|
} : {}, {
|
|
d: __props.data.description
|
|
}, __props.data.description ? {
|
|
e: common_vendor.t(__props.data.description),
|
|
f: common_vendor.s(descStyles)
|
|
} : {}, {
|
|
g: (_a = __props.data.more) == null ? void 0 : _a.show
|
|
}, ((_b = __props.data.more) == null ? void 0 : _b.show) ? common_vendor.e({
|
|
h: __props.data.more.type !== "icon"
|
|
}, __props.data.more.type !== "icon" ? {
|
|
i: common_vendor.t(__props.data.more.text)
|
|
} : {}, {
|
|
j: __props.data.more.type !== "text"
|
|
}, __props.data.more.type !== "text" ? {} : {}, {
|
|
k: common_vendor.o(($event) => common_vendor.unref(modules_mall_sheep_index.sheep).$router.go(__props.data.more.url)),
|
|
l: __props.data.descriptionColor
|
|
}) : {}, {
|
|
m: common_vendor.n(state.typeMap[__props.data.textAlign]),
|
|
n: common_vendor.s(bgStyle.value),
|
|
o: common_vendor.s({
|
|
marginLeft: `${__props.data.space}px`
|
|
})
|
|
});
|
|
};
|
|
}
|
|
};
|
|
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-b90cd943"]]);
|
|
wx.createComponent(Component);
|