"use strict";
const common_vendor = require("../../../common/vendor.js");
const sheep_index = require("../../index.js");
const sheep_api_product_spu = require("../../api/product/spu.js");
const sheep_api_promotion_combination = require("../../api/promotion/combination.js");
require("../../api/index.js");
require("../../api/distri/score.js");
require("../../request/index.js");
require("../../config/index.js");
require("../../store/index.js");
require("../../store/app.js");
require("../../api/promotion/diy.js");
require("../../platform/index.js");
require("../../platform/provider/wechat/index.js");
require("../../platform/provider/wechat/miniProgram.js");
require("../../api/member/auth.js");
require("../../api/member/social.js");
require("../../api/member/user.js");
require("../../platform/provider/apple/index.js");
require("../../platform/share.js");
require("../../router/index.js");
require("../../hooks/useModal.js");
require("../../helper/index.js");
require("../../helper/test.js");
require("../../helper/digit.js");
require("../../api/member/signin.js");
require("../../helper/throttle.js");
require("../../url/index.js");
require("../../platform/pay.js");
require("../../api/pay/order.js");
require("../../store/user.js");
require("../../store/cart.js");
require("../../api/trade/cart.js");
require("../../api/pay/wallet.js");
require("../../api/trade/order.js");
require("../../api/promotion/coupon.js");
require("../../store/sys.js");
require("../../store/modal.js");
require("../../api/distri/share.js");
require("../../api/distri/team.js");
require("../../api/infra/file.js");
require("../../api/member/address.js");
require("../../api/member/point.js");
require("../../api/migration/app.js");
require("../../api/migration/chat.js");
require("../../api/migration/index.js");
require("../../api/migration/third.js");
require("../../api/pay/channel.js");
require("../../api/product/category.js");
require("../../api/product/comment.js");
require("../../api/product/favorite.js");
require("../../api/product/history.js");
require("../../api/promotion/activity.js");
require("../../api/promotion/article.js");
require("../../api/promotion/bargain.js");
require("../../api/promotion/rewardActivity.js");
require("../../api/promotion/seckill.js");
require("../../api/system/area.js");
require("../../api/system/voice.js");
require("../../api/trade/afterSale.js");
require("../../api/trade/brokerage.js");
require("../../api/trade/config.js");
require("../../api/trade/delivery.js");
require("../../config/zIndex.js");
if (!Array) {
  const _easycom_s_goods_column2 = common_vendor.resolveComponent("s-goods-column");
  _easycom_s_goods_column2();
}
const _easycom_s_goods_column = () => "../s-goods-column/s-goods-column.js";
if (!Math) {
  _easycom_s_goods_column();
}
const _sfc_main = {
  __name: "s-groupon-block",
  props: {
    data: {
      type: Object,
      default() {
      }
    },
    styles: {
      type: Object,
      default() {
      }
    }
  },
  setup(__props) {
    const props = __props;
    let { layoutType, tagStyle, btnBuy, space } = props.data;
    props.styles;
    const buyStyle = common_vendor.computed(() => {
      let btnBuy2 = props.data.btnBuy;
      if ((btnBuy2 == null ? void 0 : btnBuy2.type) === "text") {
        return {
          background: `linear-gradient(to right, ${btnBuy2.bgBeginColor}, ${btnBuy2.bgEndColor})`
        };
      }
      if ((btnBuy2 == null ? void 0 : btnBuy2.type) === "img") {
        return {
          width: "54rpx",
          height: "54rpx",
          background: `url(${sheep_index.sheep.$url.cdn(btnBuy2.imgUrl)}) no-repeat`,
          backgroundSize: "100% 100%"
        };
      }
    });
    const productList = common_vendor.ref([]);
    common_vendor.onMounted(async () => {
      const { data: activity } = await sheep_api_promotion_combination.CombinationApi.getCombinationActivity(props.data.activityId);
      const { data: spu } = await sheep_api_product_spu.SpuApi.getSpuDetail(activity.spuId);
      productList.value = [spu];
    });
    return (_ctx, _cache) => {
      var _a;
      return common_vendor.e({
        a: common_vendor.unref(layoutType) === "threeCol"
      }, common_vendor.unref(layoutType) === "threeCol" ? {
        b: common_vendor.f(productList.value, (product, k0, i0) => {
          var _a2;
          return {
            a: common_vendor.o(($event) => common_vendor.unref(sheep_index.sheep).$router.go("/pages/goods/groupon", {
              id: product.id,
              activity_id: props.data.activityId
            }), product.id),
            b: "17051e0b-0-" + i0,
            c: common_vendor.p({
              size: "sm",
              goodsFields: __props.data.fields,
              tagStyle: common_vendor.unref(tagStyle),
              data: product,
              titleColor: (_a2 = __props.data.fields.name) == null ? void 0 : _a2.color,
              topRadius: __props.data.borderRadiusTop,
              bottomRadius: __props.data.borderRadiusBottom
            }),
            d: product.id
          };
        }),
        c: common_vendor.s({
          padding: __props.data.space + "rpx"
        }),
        d: common_vendor.s({
          margin: "-" + __props.data.space + "rpx"
        })
      } : {}, {
        e: common_vendor.unref(layoutType) === "oneCol"
      }, common_vendor.unref(layoutType) === "oneCol" ? {
        f: common_vendor.f(productList.value, (product, index, i0) => {
          var _a2, _b;
          return {
            a: common_vendor.o(($event) => common_vendor.unref(sheep_index.sheep).$router.go("/pages/goods/groupon", {
              id: product.id,
              activity_id: props.data.activityId
            }), index),
            b: "17051e0b-1-" + i0,
            c: common_vendor.p({
              size: "lg",
              goodsFields: __props.data.fields,
              tagStyle: common_vendor.unref(tagStyle),
              data: product,
              titleColor: (_a2 = __props.data.fields.name) == null ? void 0 : _a2.color,
              subTitleColor: (_b = __props.data.fields.introduction) == null ? void 0 : _b.color,
              topRadius: __props.data.borderRadiusTop,
              bottomRadius: __props.data.borderRadiusBottom
            }),
            d: index
          };
        }),
        g: common_vendor.t(((_a = common_vendor.unref(btnBuy)) == null ? void 0 : _a.type) === "text" ? common_vendor.unref(btnBuy).text : ""),
        h: common_vendor.s(buyStyle.value),
        i: common_vendor.s({
          marginBottom: common_vendor.unref(space) + "px"
        })
      } : {});
    };
  }
};
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-17051e0b"], ["__file", "D:/zx/mall-front-app/sheep/components/s-groupon-block/s-groupon-block.vue"]]);
wx.createComponent(Component);
