"use strict";
const common_vendor = require("../../../../common/vendor.js");
const sheep_index = require("../../../../sheep/index.js");
const sheep_hooks_useGoods = require("../../../../sheep/hooks/useGoods.js");
const sheep_api_promotion_combination = require("../../../../sheep/api/promotion/combination.js");
require("../../../../sheep/api/index.js");
require("../../../../sheep/api/distri/score.js");
require("../../../../sheep/request/index.js");
require("../../../../sheep/config/index.js");
require("../../../../sheep/store/index.js");
require("../../../../sheep/store/app.js");
require("../../../../sheep/api/promotion/diy.js");
require("../../../../sheep/platform/index.js");
require("../../../../sheep/platform/provider/wechat/index.js");
require("../../../../sheep/platform/provider/wechat/miniProgram.js");
require("../../../../sheep/api/member/auth.js");
require("../../../../sheep/api/member/social.js");
require("../../../../sheep/api/member/user.js");
require("../../../../sheep/platform/provider/apple/index.js");
require("../../../../sheep/platform/share.js");
require("../../../../sheep/router/index.js");
require("../../../../sheep/hooks/useModal.js");
require("../../../../sheep/helper/index.js");
require("../../../../sheep/helper/test.js");
require("../../../../sheep/helper/digit.js");
require("../../../../sheep/api/member/signin.js");
require("../../../../sheep/helper/throttle.js");
require("../../../../sheep/url/index.js");
require("../../../../sheep/platform/pay.js");
require("../../../../sheep/api/pay/order.js");
require("../../../../sheep/store/user.js");
require("../../../../sheep/store/cart.js");
require("../../../../sheep/api/trade/cart.js");
require("../../../../sheep/api/pay/wallet.js");
require("../../../../sheep/api/trade/order.js");
require("../../../../sheep/api/promotion/coupon.js");
require("../../../../sheep/store/sys.js");
require("../../../../sheep/store/modal.js");
require("../../../../sheep/api/distri/share.js");
require("../../../../sheep/api/distri/team.js");
require("../../../../sheep/api/infra/file.js");
require("../../../../sheep/api/member/address.js");
require("../../../../sheep/api/member/point.js");
require("../../../../sheep/api/migration/app.js");
require("../../../../sheep/api/migration/chat.js");
require("../../../../sheep/api/migration/index.js");
require("../../../../sheep/api/migration/third.js");
require("../../../../sheep/api/pay/channel.js");
require("../../../../sheep/api/product/category.js");
require("../../../../sheep/api/product/comment.js");
require("../../../../sheep/api/product/favorite.js");
require("../../../../sheep/api/product/history.js");
require("../../../../sheep/api/product/spu.js");
require("../../../../sheep/api/promotion/activity.js");
require("../../../../sheep/api/promotion/article.js");
require("../../../../sheep/api/promotion/bargain.js");
require("../../../../sheep/api/promotion/rewardActivity.js");
require("../../../../sheep/api/promotion/seckill.js");
require("../../../../sheep/api/system/area.js");
require("../../../../sheep/api/system/voice.js");
require("../../../../sheep/api/trade/afterSale.js");
require("../../../../sheep/api/trade/brokerage.js");
require("../../../../sheep/api/trade/config.js");
require("../../../../sheep/api/trade/delivery.js");
require("../../../../sheep/config/zIndex.js");
require("../../../../sheep/util/index.js");
const _sfc_main = {
  __name: "groupon-card-list",
  props: {
    modelValue: {
      type: Object,
      default() {
      }
    }
  },
  emits: ["join"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const state = common_vendor.reactive({
      list: []
    });
    const emits = __emit;
    function onJoinGroupon(record) {
      emits("join", record);
    }
    function endTime(time) {
      const durationTime = sheep_hooks_useGoods.useDurationTime(time);
      if (durationTime.ms <= 0) {
        return "该团已解散";
      }
      let timeText = "剩余 ";
      timeText += `${durationTime.h}时`;
      timeText += `${durationTime.m}分`;
      timeText += `${durationTime.s}秒`;
      return timeText;
    }
    common_vendor.onMounted(async () => {
      const { data } = await sheep_api_promotion_combination.CombinationApi.getHeadCombinationRecordList(props.modelValue.id, 0, 10);
      state.list = data;
    });
    return (_ctx, _cache) => {
      return common_vendor.e({
        a: state.list.length > 0
      }, state.list.length > 0 ? {
        b: common_vendor.t(state.list.length),
        c: common_vendor.f(state.list, (record, index, i0) => {
          return {
            a: common_vendor.unref(sheep_index.sheep).$url.cdn(record.avatar),
            b: common_vendor.t(record.nickname),
            c: common_vendor.t(record.userSize - record.userCount),
            d: common_vendor.t(endTime(record.expireTime)),
            e: common_vendor.o(($event) => onJoinGroupon(record), index),
            f: common_vendor.o(($event) => common_vendor.unref(sheep_index.sheep).$router.go("/pages/activity/groupon/detail", {
              id: record.id
            }), index),
            g: index
          };
        })
      } : {});
    };
  }
};
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-2bb0fe2d"], ["__file", "D:/zx/mall-front-app/pages/goods/components/groupon/groupon-card-list.vue"]]);
wx.createComponent(Component);
