2025-10-29 13:53:24 +08:00

38 lines
1.7 KiB
JavaScript

"use strict";
const common_vendor = require("../../common/vendor.js");
const common_libraries_naviHelper = require("../../common/libraries/naviHelper.js");
const CUSTOMER_bind_house_form_model = require("./model.js");
const gen_Apis = require("../../gen/Apis.js");
const common_libraries_apiLoading = require("../../common/libraries/apiLoading.js");
const method = {
handleSubmit() {
var _a, _b, _c, _d, _e;
let data = (_b = (_a = CUSTOMER_bind_house_form_model.useModel) == null ? void 0 : _a.formData) == null ? void 0 : _b.value;
if (!(data == null ? void 0 : data.name)) {
return common_libraries_naviHelper.showToast("请填写姓名");
}
if (!(data == null ? void 0 : data.phone)) {
return common_libraries_naviHelper.showToast("请填写手机号");
}
if (!(data == null ? void 0 : data.id_card)) {
return common_libraries_naviHelper.showToast("请填写身份证号");
}
if (!((_c = data == null ? void 0 : data.card_front_image) == null ? void 0 : _c.length) || !((_d = data == null ? void 0 : data.card_back_image) == null ? void 0 : _d.length)) {
return common_libraries_naviHelper.showToast("请上传身份证正反面");
}
if (!((_e = data == null ? void 0 : data.ownership_info) == null ? void 0 : _e.length)) {
return common_libraries_naviHelper.showToast("请上传房产证");
}
common_libraries_apiLoading.getApiLoading(gen_Apis.Apis.Archive.HouseRegisters.RegisterHouse, {
...data,
customer_info: [data]
}).then((res) => {
common_vendor.index.redirectTo({
url: "/CUSTOMER/bind_house_form/success"
});
console.log(res);
});
}
};
exports.method = method;