acdr-ui/dist/dev/mp-weixin/modules/mall/sheep/components/s-image-banner/s-image-banner.js
2024-10-01 09:15:35 +08:00

72 lines
2.3 KiB
JavaScript

"use strict";
var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
for (var prop in b || (b = {}))
if (__hasOwnProp.call(b, prop))
__defNormalProp(a, prop, b[prop]);
if (__getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(b)) {
if (__propIsEnum.call(b, prop))
__defNormalProp(a, prop, b[prop]);
}
return a;
};
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
const common_vendor = require("../../../../../common/vendor.js");
const modules_mall_sheep_index = require("../../index.js");
if (!Array) {
const _easycom_su_swiper2 = common_vendor.resolveComponent("su-swiper");
_easycom_su_swiper2();
}
const _easycom_su_swiper = () => "../../ui/su-swiper/su-swiper.js";
if (!Math) {
_easycom_su_swiper();
}
const _sfc_main = {
__name: "s-image-banner",
props: {
data: {
type: Object,
default: () => ({})
},
styles: {
type: Object,
default: () => ({})
}
},
setup(__props) {
const props = __props;
const imgList = common_vendor.computed(
() => props.data.items.map((item) => {
const src = item.type === "img" ? item.imgUrl : item.videoUrl;
return __spreadProps(__spreadValues({}, item), {
type: item.type === "img" ? "image" : "video",
src: modules_mall_sheep_index.sheep.$url.cdn(src),
poster: modules_mall_sheep_index.sheep.$url.cdn(item.imgUrl)
});
})
);
return (_ctx, _cache) => {
return {
a: common_vendor.p({
list: imgList.value,
dotStyle: __props.data.indicator === "dot" ? "long" : "tag",
imageMode: "scaleToFill",
dotCur: "bg-mask-40",
seizeHeight: 300,
autoplay: __props.data.autoplay,
interval: __props.data.interval * 1e3,
mode: __props.data.type
})
};
};
}
};
wx.createComponent(_sfc_main);