"use strict";
const common_vendor = require("../../common/vendor.js");
const gen_Apis = require("../../gen/Apis.js");
const common_libraries_apiLoading = require("../../common/libraries/apiLoading.js");
const CUSTOMER_show_model = require("./model.js");
const common_libraries_sendWxWork = require("../../common/libraries/sendWxWork.js");
const getUserHoueInfo = (phone) => {
  common_libraries_apiLoading.getApiLoading(gen_Apis.Apis.Archive.HouseOccupants.GetHouseOccupantsByPhone, { phone }).then((res) => {
    CUSTOMER_show_model.useModel.userHouse.value = res == null ? void 0 : res.data;
    console.log(res);
  });
};
const getOccupantArrearageHouses = (phone) => {
  common_libraries_apiLoading.getApiLoading(gen_Apis.Apis.Bill.HouseBills.GetOccupantArrearageHouses, { phone }).then((res) => {
    CUSTOMER_show_model.useModel.arrearageHouses.value = res == null ? void 0 : res.data;
    console.log(res);
  });
};
const method = {
  handleMakePhoneCall() {
    var _a, _b;
    if ((_a = CUSTOMER_show_model.useModel.showData.value) == null ? void 0 : _a.phone) {
      common_vendor.index.makePhoneCall({
        phoneNumber: (_b = CUSTOMER_show_model.useModel.showData.value) == null ? void 0 : _b.phone
        //仅为示例，并非真实的电话号码
      });
    }
  },
  getShow(id) {
    common_libraries_apiLoading.getApiLoading(gen_Apis.Apis.Archive.HouseOccupants.Show, { id }).then((res) => {
      var _a, _b;
      CUSTOMER_show_model.useModel.showData.value = res == null ? void 0 : res.data;
      getUserHoueInfo((_a = res == null ? void 0 : res.data) == null ? void 0 : _a.phone);
      getOccupantArrearageHouses((_b = res == null ? void 0 : res.data) == null ? void 0 : _b.phone);
      console.log(res);
    });
  },
  shareBill() {
    common_libraries_sendWxWork.navigateToMiniProgram({
      path: "/pages/forward/index?source=OutstandingFeeList",
      envVersion: "develop",
      extraData: { source: "OutstandingFeeList" }
    });
  }
};
exports.method = method;
