"use strict";
const common_vendor = require("../../common/vendor.js");
const common_libraries_apiLoading = require("../../common/libraries/apiLoading.js");
const common_libraries_naviHelper = require("../../common/libraries/naviHelper.js");
const common_libraries_sendWxWork = require("../../common/libraries/sendWxWork.js");
const gen_Apis = require("../../gen/Apis.js");
const CUSTOMER_house_Identity_model = require("./model.js");
const method = {
  handleBindHouse() {
    var _a, _b;
    let data = (_b = (_a = CUSTOMER_house_Identity_model.useModel) == null ? void 0 : _a.formData) == null ? void 0 : _b.value;
    if (!(data == null ? void 0 : data.residential_relation)) {
      return common_libraries_naviHelper.showToast("请选择身份！");
    }
    let house_info = [
      {
        asset_houses_id: data == null ? void 0 : data.asset_houses_id,
        residential_relation: data == null ? void 0 : data.residential_relation
      }
    ];
    common_libraries_apiLoading.getApiLoading(gen_Apis.Apis.Archive.HouseRegisters.Store, { ...data, house_info }).then(
      (res) => {
        common_vendor.index.reLaunch({
          url: `/CUSTOMER/house_Identity/success?asset_houses_id=${data == null ? void 0 : data.asset_houses_id}&name=${data == null ? void 0 : data.name}&phone=${data == null ? void 0 : data.phone}}`
        });
        console.log(res);
      }
    );
  },
  handleFindLinkClick(e) {
    var _a, _b, _c;
    if ((e == null ? void 0 : e.type) === "link") {
      common_vendor.index.navigateTo({
        url: `${e == null ? void 0 : e.url}?asset_houses_id=${(_a = CUSTOMER_house_Identity_model.useModel.formData.value) == null ? void 0 : _a.asset_houses_id}&name=${(_b = CUSTOMER_house_Identity_model.useModel.formData.value) == null ? void 0 : _b.name}&phone=${(_c = CUSTOMER_house_Identity_model.useModel.formData.value) == null ? void 0 : _c.phone}`
      });
    }
    if ((e == null ? void 0 : e.type) === "invitation") {
      common_libraries_sendWxWork.sendChatMessage({ page: "/INDEX/binding/index.html", title: "邀请你绑定房屋" });
    }
    console.log(e, "eee");
  }
};
exports.method = method;
