"use strict";
const common_vendor = require("../../../common/vendor.js");
const gen_Enums = require("../../../gen/Enums.js");
const common_libraries_getPageConfig = require("../../../common/libraries/getPageConfig.js");
const INDEX_owner_audit_list_model = require("../model.js");
const common_libraries_apiLoading = require("../../../common/libraries/apiLoading.js");
const gen_Apis = require("../../../gen/Apis.js");
const common_libraries_public = require("../../../common/libraries/public.js");
require("../../../common/store/useWeAppAuthStore.js");
require("../../../common/libraries/setTabBar.js");
require("../../../common/libraries/request.js");
require("../../../common/store/useWorkStore.js");
if (!Array) {
  const _easycom_hs_enum_tag2 = common_vendor.resolveComponent("hs-enum-tag");
  const _easycom_up_steps_item2 = common_vendor.resolveComponent("up-steps-item");
  const _easycom_up_steps2 = common_vendor.resolveComponent("up-steps");
  const _easycom_hs_button2 = common_vendor.resolveComponent("hs-button");
  const _easycom_hs_popup_custom2 = common_vendor.resolveComponent("hs-popup-custom");
  (_easycom_hs_enum_tag2 + _easycom_up_steps_item2 + _easycom_up_steps2 + _easycom_hs_button2 + _easycom_hs_popup_custom2)();
}
const _easycom_hs_enum_tag = () => "../../../components/hs-enum-tag/hs-enum-tag.js";
const _easycom_up_steps_item = () => "../../../node-modules/uview-plus/components/u-steps-item/u-steps-item.js";
const _easycom_up_steps = () => "../../../node-modules/uview-plus/components/u-steps/u-steps.js";
const _easycom_hs_button = () => "../../../components/hs-button/hs-button.js";
const _easycom_hs_popup_custom = () => "../../../components/hs-popup-custom/hs-popup-custom.js";
if (!Math) {
  (_easycom_hs_enum_tag + _easycom_up_steps_item + _easycom_up_steps + _easycom_hs_button + _easycom_hs_popup_custom)();
}
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
  __name: "HouseRegistersList",
  setup(__props) {
    const show = common_vendor.ref(false);
    const stepCurrent = common_vendor.ref(0);
    const stepList = common_vendor.ref([]);
    const handleCopyPhone = (phone) => {
      if (phone) {
        common_vendor.index.makePhoneCall({
          phoneNumber: phone
          //仅为示例，并非真实的电话号码
        });
      }
    };
    const handleShowPopup = (e) => {
      var _a;
      show.value = true;
      common_libraries_apiLoading.getApiLoading(gen_Apis.Apis.Grid.Grids.GetHousekeeper, { asset_houses_id: (_a = e == null ? void 0 : e.asset_house) == null ? void 0 : _a.id }).then(
        (res) => {
          var _a2, _b;
          if ((e == null ? void 0 : e.type) === "AddOccupant") {
            if ((e == null ? void 0 : e.status) === "Approved" && (e == null ? void 0 : e.approval_owner_status) === "Pending") {
              stepCurrent.value = 1;
            }
            if ((e == null ? void 0 : e.status) === "Approved" && (e == null ? void 0 : e.approval_owner_status) === "Approved") {
              stepCurrent.value = 2;
            }
            stepList.value = [
              {
                label: "第一步：后台初步审核",
                content: `如需加快进度，可联系社区管家催审 管家电话：`,
                phone: (_a2 = res == null ? void 0 : res.data) == null ? void 0 : _a2.phone,
                status: e == null ? void 0 : e.status
              },
              {
                label: "第二步：业主确认审核",
                content: `如需加快进度，可联系社区管家催审 管家电话：`,
                phone: e == null ? void 0 : e.apply_customer_phone,
                status: e == null ? void 0 : e.approval_owner_status
              }
            ];
          }
          if ((e == null ? void 0 : e.type) === "AddOwner") {
            stepList.value = [
              {
                content: "如需加快进度，可联系社区管家催审",
                phone_text: `管家电话：`,
                phone: (_b = res == null ? void 0 : res.data) == null ? void 0 : _b.phone
              }
            ];
          }
          console.log(res);
        }
      );
      console.log(e, "e");
    };
    const handleClosePopup = () => {
      show.value = false;
    };
    const getStatus = (e) => {
      if ((e == null ? void 0 : e.type) === "AddOwner") {
        return e == null ? void 0 : e.status;
      } else {
        if ((e == null ? void 0 : e.status) === "Approved" && (e == null ? void 0 : e.approval_owner_status) === "Approved") {
          return "Approved";
        }
        if ((e == null ? void 0 : e.status) === "Pending" || (e == null ? void 0 : e.approval_owner_status) === "Pending") {
          return "Pending";
        }
        if ((e == null ? void 0 : e.status) === "Rejected" || (e == null ? void 0 : e.approval_owner_status) === "Rejected") {
          return "Rejected";
        }
      }
    };
    return (_ctx, _cache) => {
      var _a, _b, _c, _d, _e, _f;
      return common_vendor.e({
        a: common_vendor.f((_b = (_a = common_vendor.unref(INDEX_owner_audit_list_model.useModel)) == null ? void 0 : _a.dataList) == null ? void 0 : _b.value, (i, index, i0) => {
          var _a2;
          return {
            a: common_vendor.t((_a2 = i == null ? void 0 : i.asset_house) == null ? void 0 : _a2.full_name),
            b: "eabdb0ff-0-" + i0,
            c: common_vendor.p({
              value: (i == null ? void 0 : i.approval_owner_status) || (i == null ? void 0 : i.status),
              Enums: common_vendor.unref(gen_Enums.HouseRegistersStatusEnum)
            }),
            d: common_vendor.n(`status_tab status_${getStatus(i)}`),
            e: common_vendor.f(i == null ? void 0 : i.customer_info, (k, idx, i1) => {
              return common_vendor.e({
                a: (k == null ? void 0 : k.house_relation) === "NonOwner"
              }, (k == null ? void 0 : k.house_relation) === "NonOwner" ? {
                b: "eabdb0ff-1-" + i0 + "-" + i1,
                c: common_vendor.p({
                  value: k == null ? void 0 : k.residential_relation,
                  Enums: common_vendor.unref(gen_Enums.HouseOccupantsResidentialRelationEnum)
                })
              } : {
                d: "eabdb0ff-2-" + i0 + "-" + i1,
                e: common_vendor.p({
                  value: k == null ? void 0 : k.house_relation,
                  Enums: common_vendor.unref(gen_Enums.HouseOccupantsHouseRelationEnum)
                })
              }, {
                f: `f_item_${index}_${idx}`
              });
            }),
            f: common_vendor.o(($event) => handleShowPopup(i), `item_${index}`),
            g: `item_${index}`
          };
        }),
        b: common_vendor.s(common_vendor.unref(common_libraries_getPageConfig.getStyleColorInfo)()),
        c: ((_c = stepList.value) == null ? void 0 : _c.length) > 1
      }, ((_d = stepList.value) == null ? void 0 : _d.length) > 1 ? {
        d: common_vendor.f(stepList.value, (i, index, i0) => {
          return common_vendor.e({
            a: common_vendor.t(i == null ? void 0 : i.label),
            b: stepCurrent.value === index && (i == null ? void 0 : i.status) === "Pending"
          }, stepCurrent.value === index && (i == null ? void 0 : i.status) === "Pending" ? {
            c: common_vendor.n(`text_${i == null ? void 0 : i.status}`)
          } : {}, {
            d: stepCurrent.value === index && (i == null ? void 0 : i.status) === "Approved"
          }, stepCurrent.value === index && (i == null ? void 0 : i.status) === "Approved" ? {
            e: common_vendor.n(`text_${i == null ? void 0 : i.status}`)
          } : {}, {
            f: stepCurrent.value === index && (i == null ? void 0 : i.status) === "Rejected"
          }, stepCurrent.value === index && (i == null ? void 0 : i.status) === "Rejected" ? {
            g: common_vendor.n(`text_${i == null ? void 0 : i.status}`)
          } : {}, {
            h: common_vendor.t(i == null ? void 0 : i.content),
            i: common_vendor.t(common_vendor.unref(common_libraries_public.formatPhoneNumber)(i == null ? void 0 : i.phone)),
            j: common_vendor.o(($event) => handleCopyPhone(i == null ? void 0 : i.phone), `step_${index}`),
            k: `step_${index}`,
            l: "eabdb0ff-5-" + i0 + ",eabdb0ff-4"
          });
        }),
        e: common_vendor.p({
          direction: "column",
          dot: true,
          current: stepCurrent.value
        })
      } : {}, {
        f: ((_e = stepList.value) == null ? void 0 : _e.length) === 1
      }, ((_f = stepList.value) == null ? void 0 : _f.length) === 1 ? {
        g: common_vendor.f(stepList.value, (i, index, i0) => {
          return common_vendor.e({
            a: common_vendor.t(i == null ? void 0 : i.content),
            b: i == null ? void 0 : i.phone
          }, (i == null ? void 0 : i.phone) ? {
            c: common_vendor.t(i == null ? void 0 : i.phone_text),
            d: common_vendor.t(common_vendor.unref(common_libraries_public.formatPhoneNumber)(i == null ? void 0 : i.phone))
          } : {}, {
            e: `step_${index}`
          });
        })
      } : {}, {
        h: common_vendor.o(handleClosePopup),
        i: common_vendor.p({
          label: "我知道了",
          size: "md",
          type: "primary"
        }),
        j: common_vendor.p({
          show: show.value,
          mode: "center",
          title: "房屋审核进度"
        })
      });
    };
  }
});
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-eabdb0ff"], ["__file", "/Users/zsq/Sources/github/2025property-pay/pay-customer/src/INDEX/owner_audit_list/components/HouseRegistersList.vue"]]);
wx.createComponent(Component);
