56 lines
1.9 KiB
JavaScript
56 lines
1.9 KiB
JavaScript
"use strict";
|
|
const common_vendor = require("../vendor.js");
|
|
require("./request.js");
|
|
const common_store_useWeAppAuthStore = require("../store/useWeAppAuthStore.js");
|
|
require("../store/useWorkStore.js");
|
|
const auth = common_store_useWeAppAuthStore.useWeAppAuthStore();
|
|
const getIsHouseExist = () => {
|
|
var _a, _b, _c, _d, _e;
|
|
if (!((_a = auth == null ? void 0 : auth.data) == null ? void 0 : _a.user)) {
|
|
common_vendor.index.navigateTo({
|
|
url: "/pages/login"
|
|
});
|
|
return false;
|
|
}
|
|
if (!((_b = auth == null ? void 0 : auth.data) == null ? void 0 : _b.house_occupant) && !((_c = auth == null ? void 0 : auth.data) == null ? void 0 : _c.house_register)) {
|
|
common_vendor.index.showModal({
|
|
title: "提示",
|
|
content: "未绑定房屋,请先绑定房屋!",
|
|
confirmText: "去绑定",
|
|
confirmColor: "#0082FA",
|
|
success: function(res) {
|
|
if (res.confirm) {
|
|
common_vendor.index.navigateTo({
|
|
url: "/INDEX/binding/index"
|
|
});
|
|
console.log("用户点击确定");
|
|
} else if (res.cancel) {
|
|
console.log("用户点击取消");
|
|
}
|
|
}
|
|
});
|
|
return false;
|
|
}
|
|
if (!((_d = auth == null ? void 0 : auth.data) == null ? void 0 : _d.house_occupant) && ((_e = auth == null ? void 0 : auth.data) == null ? void 0 : _e.house_register)) {
|
|
common_vendor.index.showModal({
|
|
title: "提示",
|
|
content: "房屋还在审核中,暂不能操作!",
|
|
confirmText: "去查看",
|
|
confirmColor: "#0082FA",
|
|
success: function(res) {
|
|
if (res.confirm) {
|
|
common_vendor.index.navigateTo({
|
|
url: "/INDEX/asset_houses/index?type=1"
|
|
});
|
|
console.log("用户点击确定");
|
|
} else if (res.cancel) {
|
|
console.log("用户点击取消");
|
|
}
|
|
}
|
|
});
|
|
return false;
|
|
}
|
|
return true;
|
|
};
|
|
exports.getIsHouseExist = getIsHouseExist;
|