"use strict";
const common_vendor = require("../../common/vendor.js");
const API_api = require("../../API/api.js");
if (!Array) {
  const _easycom_uni_rate2 = common_vendor.resolveComponent("uni-rate");
  const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
  (_easycom_uni_rate2 + _easycom_uni_icons2)();
}
const _easycom_uni_rate = () => "../../uni_modules/uni-rate/components/uni-rate/uni-rate.js";
const _easycom_uni_icons = () => "../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
if (!Math) {
  (_easycom_uni_rate + _easycom_uni_icons)();
}
const _sfc_main = {
  __name: "recommend",
  setup(__props) {
    const historyList = common_vendor.ref([]);
    const fetchHistoryData = async () => {
      try {
        const res = await common_vendor.index.request({
          url: API_api.apiImageUrl + "/api/business/list",
          method: "POST"
        });
        if (res.data.code === 0) {
          console.log(res.data.data);
          historyList.value = res.data.data;
        }
      } catch (error) {
        console.error("Error fetching data:", error);
      }
    };
    common_vendor.onMounted(() => {
      fetchHistoryData();
    });
    const handleDonate = (item) => {
      if (!item || !item.hasOwnProperty("id")) {
        console.error("The 'item' variable is undefined or missing the 'id' property.");
        return;
      }
      const merchantId = item.id;
      common_vendor.index.navigateTo({
        url: `/pages/merchant/merchant?merchantId=${merchantId}`
      });
    };
    return (_ctx, _cache) => {
      return {
        a: common_vendor.f(historyList.value, (item, index, i0) => {
          return {
            a: item.businessAvatar,
            b: common_vendor.t(item.businessName),
            c: "0c6d1148-0-" + i0,
            d: "0c6d1148-1-" + i0,
            e: index,
            f: common_vendor.o(($event) => handleDonate(item))
          };
        }),
        b: common_vendor.p({
          readonly: true,
          value: 4,
          size: "12px"
        }),
        c: common_vendor.p({
          type: "paperplane-filled",
          color: "#e99e44"
        })
      };
    };
  }
};
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__file", "D:/111111000000/uniapp04/pages/recommend/recommend.vue"]]);
my.createComponent(Component);
