"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_assets_model = require("./model.js");
const getUserHoueInfo = (phone) => {
  common_libraries_apiLoading.getApiLoading(gen_Apis.Apis.Archive.HouseOccupants.GetCustomerHouse, { phone }).then((res) => {
    CUSTOMER_assets_model.useModel.userHouse.value = res == null ? void 0 : res.data;
    console.log(res);
  });
};
const method = {
  getUserHoueInfo,
  handleUnbind(e) {
    common_vendor.index.showModal({
      title: "再次确认",
      content: "房屋人员解绑申请！此操作需后台审核，结果会以系统通知告知，敬请留意～",
      success: function(res) {
        if (res.confirm) {
          common_libraries_apiLoading.getApiLoading(gen_Apis.Apis.Archive.HouseRegisters.RemoveOwner, {
            house_occupants_id: e == null ? void 0 : e.id
          }).then((res2) => {
            var _a, _b, _c;
            getUserHoueInfo((_c = (_b = (_a = CUSTOMER_assets_model.useModel) == null ? void 0 : _a.formData) == null ? void 0 : _b.value) == null ? void 0 : _c.phone);
            console.log(res2);
          });
          console.log("用户点击确定");
        } else if (res.cancel) {
          console.log("用户点击取消");
        }
      }
    });
  },
  handleBindHouse() {
    var _a, _b, _c, _d, _e, _f;
    common_vendor.index.navigateTo({
      url: `/CUSTOMER/bind_house/index?phone=${(_c = (_b = (_a = CUSTOMER_assets_model.useModel) == null ? void 0 : _a.formData) == null ? void 0 : _b.value) == null ? void 0 : _c.phone}&name=${(_f = (_e = (_d = CUSTOMER_assets_model.useModel) == null ? void 0 : _d.formData) == null ? void 0 : _e.value) == null ? void 0 : _f.name}`
    });
  }
};
exports.method = method;
