"use strict";
const common_vendor = require("../../../common/vendor.js");
const sheep_index = require("../../index.js");
const sheep_api_promotion_rewardActivity = require("../../api/promotion/rewardActivity.js");
const sheep_hooks_useGoods = require("../../hooks/useGoods.js");
require("../../url/index.js");
require("../../store/index.js");
require("../../store/app.js");
require("../../api/promotion/diy.js");
require("../../request/index.js");
require("../../config/index.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("../../helper/throttle.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("../../config/zIndex.js");
require("../../util/index.js");
if (!Array) {
  const _easycom_su_popup2 = common_vendor.resolveComponent("su-popup");
  _easycom_su_popup2();
}
const _easycom_su_popup = () => "../../ui/su-popup/su-popup.js";
if (!Math) {
  _easycom_su_popup();
}
const _sfc_main = {
  __name: "s-activity-pop",
  props: {
    modelValue: {
      type: Object,
      default() {
      }
    },
    show: {
      type: Boolean,
      default: false
    }
  },
  emits: ["close"],
  setup(__props, { emit: emits }) {
    const props = __props;
    const state = common_vendor.reactive({
      activityInfo: common_vendor.computed(() => props.modelValue),
      activityMap: {}
    });
    common_vendor.watch(
      () => props.show,
      () => {
        var _a;
        if (props.show) {
          (_a = state.activityInfo) == null ? void 0 : _a.forEach((activity) => {
            sheep_api_promotion_rewardActivity.RewardActivityApi.getRewardActivity(activity.id).then((res) => {
              if (res.code !== 0) {
                return;
              }
              state.activityMap[activity.id] = res.data;
            });
          });
        }
      }
    );
    function onGoodsList(e) {
      sheep_index.sheep.$router.go("/pages/activity/index", {
        activityId: e.id
      });
    }
    return (_ctx, _cache) => {
      return {
        a: common_vendor.f(state.activityInfo, (item, k0, i0) => {
          var _a;
          return {
            a: common_vendor.f((_a = state.activityMap[item.id]) == null ? void 0 : _a.rules, (rule, k1, i1) => {
              return {
                a: common_vendor.t(common_vendor.unref(sheep_hooks_useGoods.formatRewardActivityRule)(state.activityMap[item.id], rule)),
                b: rule
              };
            }),
            b: common_vendor.o(($event) => onGoodsList(item), item.id),
            c: item.id
          };
        }),
        b: common_vendor.o(($event) => emits("close")),
        c: common_vendor.p({
          show: __props.show,
          type: "bottom",
          round: "20",
          showClose: true
        })
      };
    };
  }
};
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-c5b2a531"], ["__file", "/Users/RuHu.Xu/Desktop/mall-newfeifan-zx-app/sheep/components/s-activity-pop/s-activity-pop.vue"]]);
wx.createComponent(Component);
