"use strict";
const common_vendor = require("../../common/vendor.js");
const common_assets = require("../../common/assets.js");
const hooks_useToast = require("../../hooks/useToast.js");
if (!Array) {
  const _component_up_popup = common_vendor.resolveComponent("up-popup");
  _component_up_popup();
}
const _sfc_main = {
  __name: "index",
  props: {
    showPopup: {
      type: Boolean,
      default: false
    },
    openType: {
      type: Number,
      default: 0
    },
    coupon: {
      type: Object,
      default: () => ({})
    },
    orderShow: {
      type: String,
      default: ""
    }
  },
  emits: [
    "close",
    "ChangCouponsUseState",
    "ChangCoupons",
    "tabCouponType"
  ],
  setup(__props, { emit: __emit }) {
    hooks_useToast.useToast();
    const emit = __emit;
    const type = common_vendor.ref(1);
    function close() {
      type.value = 1;
      emit("close");
    }
    function setType(val) {
      type.value = val;
      emit("tabCouponType", val);
    }
    return (_ctx, _cache) => {
      return common_vendor.e({
        a: !__props.orderShow
      }, !__props.orderShow ? {
        b: common_vendor.n(type.value === 1 ? "on" : ""),
        c: common_vendor.o(($event) => setType(1))
      } : {}, {
        d: __props.coupon.list.length
      }, __props.coupon.list.length ? common_vendor.e({
        e: __props.coupon.list.length
      }, __props.coupon.list.length ? {
        f: common_vendor.f(__props.coupon.list, (item, index, i0) => {
          return common_vendor.e({
            a: common_vendor.t(item.money ? Number(item.money) : ""),
            b: common_vendor.t(item.minPrice),
            c: common_vendor.n(item.isUse ? "moneyGray" : ""),
            d: item.useType === 1
          }, item.useType === 1 ? {
            e: common_vendor.n(item.isUse ? "gray" : "")
          } : item.useType === 3 ? {
            g: common_vendor.n(item.isUse ? "gray" : "")
          } : {
            h: common_vendor.n(item.isUse ? "gray" : "")
          }, {
            f: item.useType === 3,
            i: common_vendor.t(item.name),
            j: item.day > 0
          }, item.day > 0 ? {
            k: common_vendor.t(item.day)
          } : {
            l: common_vendor.t(item.useStartTimeStr && item.useEndTimeStr ? item.useStartTimeStr + " - " + item.useEndTimeStr : "")
          }, {
            m: item.isUse
          }, item.isUse ? {
            n: common_vendor.t(item.use_title || "已领取")
          } : {
            o: common_vendor.t(__props.coupon.statusTile || "立即领取")
          }, {
            p: index
          });
        })
      } : {}) : {
        g: common_assets._imports_0$1
      }, {
        h: !__props.orderShow ? "0" : "50rpx",
        i: common_vendor.o(close),
        j: common_vendor.p({
          show: __props.showPopup,
          closeOnClickOverlay: true
        })
      });
    };
  }
};
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-915a5452"]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/components/couponListWindow/index.js.map
