"use strict";
const common_vendor = require("../../../common/vendor.js");
const sheep_index = require("../../index.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");
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-discount-list",
  props: {
    promoInfo: {
      type: Array,
      default: () => []
    },
    goodsList: {
      type: Array,
      default: () => []
    },
    modelValue: {
      type: Object,
      default() {
      }
    },
    show: {
      type: Boolean,
      default: false
    }
  },
  emits: ["close"],
  setup(__props, { emit: emits }) {
    const props = __props;
    const state = common_vendor.reactive({
      orderInfo: common_vendor.computed(() => props.modelValue)
    });
    const getGoodsImg = (e) => {
      let goodsImg = "";
      state.orderInfo.goods_list.forEach((i) => {
        if (e == i.goods_id) {
          goodsImg = i.goods.image;
        }
      });
      return goodsImg;
    };
    return (_ctx, _cache) => {
      return {
        a: common_vendor.f(state.orderInfo.promo_infos, (item, index, i0) => {
          return common_vendor.e({
            a: common_vendor.t(item.goods_ids.length),
            b: item.activity_type === "full_discount"
          }, item.activity_type === "full_discount" ? {
            c: common_vendor.t(item.discount_rule.full),
            d: common_vendor.t(item.discount_rule.discount)
          } : {}, {
            e: item.activity_type === "full_gift"
          }, item.activity_type === "full_gift" ? {} : {}, {
            f: item.activity_type === "full_reduce"
          }, item.activity_type === "full_reduce" ? {
            g: common_vendor.t(item.discount_rule.full),
            h: common_vendor.t(item.discount_rule.discount)
          } : {}, {
            i: common_vendor.t(item.promo_discount_money || "0.00"),
            j: common_vendor.f(item.goods_ids, (i, k1, i1) => {
              return {
                a: common_vendor.unref(sheep_index.sheep).$url.cdn(getGoodsImg(i)),
                b: i
              };
            }),
            k: index
          });
        }),
        b: common_vendor.o(($event) => emits("close")),
        c: common_vendor.o(($event) => emits("close")),
        d: common_vendor.p({
          show: __props.show,
          type: "bottom",
          round: "20",
          showClose: true,
          backgroundColor: "#f2f2f2"
        })
      };
    };
  }
};
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-8a1f672f"], ["__file", "/Users/RuHu.Xu/Desktop/mall-newfeifan-zx-app/sheep/components/s-discount-list/s-discount-list.vue"]]);
wx.createComponent(Component);
