2025-06-09 17:33:50 +08:00
|
|
|
"use strict";
|
|
|
|
const common_vendor = require("../../common/vendor.js");
|
|
|
|
const common_assets = require("../../common/assets.js");
|
2025-06-11 17:33:34 +08:00
|
|
|
const pages_addjigou_api_addjigou = require("./api/addjigou.js");
|
2025-06-09 17:33:50 +08:00
|
|
|
if (!Array) {
|
|
|
|
const _easycom_u_modal2 = common_vendor.resolveComponent("u-modal");
|
2025-06-13 13:42:14 +08:00
|
|
|
const _easycom_u_popup2 = common_vendor.resolveComponent("u-popup");
|
|
|
|
(_easycom_u_modal2 + _easycom_u_popup2)();
|
2025-06-09 17:33:50 +08:00
|
|
|
}
|
|
|
|
const _easycom_u_modal = () => "../../uni_modules/vk-uview-ui/components/u-modal/u-modal.js";
|
2025-06-13 13:42:14 +08:00
|
|
|
const _easycom_u_popup = () => "../../uni_modules/vk-uview-ui/components/u-popup/u-popup.js";
|
2025-06-09 17:33:50 +08:00
|
|
|
if (!Math) {
|
2025-06-13 13:42:14 +08:00
|
|
|
(_easycom_u_modal + _easycom_u_popup)();
|
2025-06-09 17:33:50 +08:00
|
|
|
}
|
|
|
|
const _sfc_main = {
|
|
|
|
__name: "where",
|
|
|
|
setup(__props) {
|
2025-06-13 13:42:14 +08:00
|
|
|
const address = common_vendor.ref([]);
|
2025-06-09 17:33:50 +08:00
|
|
|
const show = common_vendor.ref(false);
|
|
|
|
const content = common_vendor.ref("");
|
2025-06-11 17:33:34 +08:00
|
|
|
const jigouweizhi = common_vendor.ref("");
|
2025-06-13 13:42:14 +08:00
|
|
|
common_vendor.ref(false);
|
|
|
|
const popupshow = common_vendor.ref(false);
|
|
|
|
const list = common_vendor.ref([]);
|
2025-06-09 17:33:50 +08:00
|
|
|
const form = common_vendor.reactive({
|
|
|
|
orgLeader: "",
|
|
|
|
orgLeaderPhone: "",
|
2025-06-13 13:42:14 +08:00
|
|
|
orgAddress: "",
|
2025-06-09 17:33:50 +08:00
|
|
|
orgPropertyType: "",
|
2025-06-11 17:33:34 +08:00
|
|
|
orgBuildingArea: "",
|
|
|
|
orgAddress: "",
|
|
|
|
orgCoordinateLo: "",
|
|
|
|
orgCoordinateLa: "",
|
|
|
|
id: common_vendor.index.getStorageSync("specicalid") || "",
|
2025-06-13 13:42:14 +08:00
|
|
|
tel: common_vendor.index.getStorageSync("tel"),
|
|
|
|
status: "1"
|
2025-06-09 17:33:50 +08:00
|
|
|
});
|
|
|
|
common_vendor.ref("");
|
|
|
|
common_vendor.ref("");
|
|
|
|
common_vendor.ref("");
|
2025-06-13 13:42:14 +08:00
|
|
|
function takeFirst(arr, num) {
|
|
|
|
const count = Math.max(0, Math.min(num, arr.length));
|
|
|
|
return arr.slice(0, count);
|
|
|
|
}
|
|
|
|
const deleteUP = (index) => {
|
|
|
|
address.value = takeFirst(address.value, index);
|
|
|
|
if (index) {
|
|
|
|
clickcard(list.value[index - 1]);
|
|
|
|
} else {
|
|
|
|
list.value = [];
|
|
|
|
pages_addjigou_api_addjigou.getdate(`xzqhdm`).then((res) => {
|
|
|
|
list.value = dedupeFirstLetter(res.result);
|
|
|
|
});
|
2025-06-11 17:33:34 +08:00
|
|
|
}
|
2025-06-13 13:42:14 +08:00
|
|
|
common_vendor.index.__f__("log", "at pages/addjigou/where.vue:178", "删除了", index);
|
2025-06-11 17:33:34 +08:00
|
|
|
};
|
2025-06-09 17:33:50 +08:00
|
|
|
const next = () => {
|
2025-06-13 13:42:14 +08:00
|
|
|
const allNonEmpty = form.orgLeader && form.orgLeaderPhone && form.orgAddress && form.orgPropertyType && form.orgBuildingArea;
|
2025-06-11 17:33:34 +08:00
|
|
|
if (allNonEmpty) {
|
|
|
|
pages_addjigou_api_addjigou.changemessage(form).then((res) => {
|
|
|
|
if (res.success) {
|
|
|
|
if (res.message == `保存成功!`) {
|
|
|
|
common_vendor.index.setStorageSync("specicalid", "");
|
|
|
|
common_vendor.index.reLaunch({
|
|
|
|
url: `/pages/login/workjoin?type=1`
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
common_vendor.index.setStorageSync("specicalid", res.result.id);
|
|
|
|
common_vendor.index.reLaunch({
|
|
|
|
url: `/pages/login/workjoin?type=1`
|
|
|
|
});
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
common_vendor.index.showToast({
|
|
|
|
title: res.message,
|
|
|
|
icon: "error"
|
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
common_vendor.index.showToast({
|
|
|
|
title: "请完善信息",
|
|
|
|
icon: "error"
|
|
|
|
});
|
|
|
|
}
|
2025-06-09 17:33:50 +08:00
|
|
|
};
|
|
|
|
const goBack = () => {
|
|
|
|
common_vendor.index.navigateBack();
|
|
|
|
};
|
2025-06-13 13:42:14 +08:00
|
|
|
const clickcard = (element) => {
|
|
|
|
if (address.value.length < 3) {
|
|
|
|
list.value = [];
|
|
|
|
address.value.push(element);
|
|
|
|
pages_addjigou_api_addjigou.getdate(element.id).then((res) => {
|
|
|
|
if (res.result.length) {
|
|
|
|
list.value = dedupeFirstLetter(res.result);
|
|
|
|
} else {
|
|
|
|
popupshow.value = false;
|
|
|
|
form.address = "";
|
|
|
|
address.value.forEach((res2) => {
|
|
|
|
form.address += res2.name;
|
|
|
|
});
|
|
|
|
const keys = ["orgProvince", "orgCity", "orgDistrict"];
|
|
|
|
keys.forEach((key, idx) => {
|
|
|
|
var _a;
|
|
|
|
form[key] = ((_a = address.value[idx]) == null ? void 0 : _a.id) ?? "";
|
|
|
|
});
|
|
|
|
address.value = [];
|
|
|
|
list.value = [];
|
|
|
|
pages_addjigou_api_addjigou.getdate(`xzqhdm`).then((res2) => {
|
|
|
|
list.value = dedupeFirstLetter(res2.result);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|
|
|
|
const openpopupshow = () => {
|
|
|
|
popupshow.value = true;
|
2025-06-09 17:33:50 +08:00
|
|
|
};
|
2025-06-11 17:33:34 +08:00
|
|
|
common_vendor.onShow(() => {
|
|
|
|
const data = common_vendor.index.getStorageSync("dingwei");
|
|
|
|
if (data) {
|
2025-06-13 13:42:14 +08:00
|
|
|
common_vendor.index.__f__("log", "at pages/addjigou/where.vue:261", "data", data);
|
2025-06-11 17:33:34 +08:00
|
|
|
jigouweizhi.value = data.name;
|
|
|
|
form.orgAddress = data.name;
|
|
|
|
form.orgCoordinateLo = data.lng;
|
|
|
|
form.orgCoordinateLa = data.lat;
|
|
|
|
common_vendor.index.removeStorageSync("dingwei");
|
|
|
|
}
|
|
|
|
});
|
2025-06-13 13:42:14 +08:00
|
|
|
function dedupeFirstLetter(arr) {
|
|
|
|
const seen = /* @__PURE__ */ new Set();
|
|
|
|
return arr.map((item) => {
|
|
|
|
const letter = item.firstLetter;
|
|
|
|
if (!letter || seen.has(letter)) {
|
|
|
|
return { ...item, firstLetter: "" };
|
|
|
|
} else {
|
|
|
|
seen.add(letter);
|
|
|
|
return item;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
common_vendor.onLoad(() => {
|
|
|
|
pages_addjigou_api_addjigou.getdate(`xzqhdm`).then((res) => {
|
|
|
|
list.value = dedupeFirstLetter(res.result);
|
|
|
|
});
|
|
|
|
if (common_vendor.index.getStorageSync("baddata")) {
|
|
|
|
let data = common_vendor.index.getStorageSync("baddata");
|
|
|
|
if (data.orgProvince_dictText) {
|
|
|
|
form.address = data.orgProvince_dictText + data.orgCity_dictText + data.orgDistrict_dictText;
|
|
|
|
}
|
|
|
|
form.orgProvince = data.orgProvince;
|
|
|
|
form.orgCity = data.orgCity;
|
|
|
|
form.orgDistrict = data.orgDistrict;
|
|
|
|
form.orgAddress = data.orgAddress;
|
|
|
|
form.orgLeader = data.orgLeader;
|
|
|
|
form.orgLeaderPhone = data.orgLeaderPhone;
|
|
|
|
form.orgPropertyType = data.orgPropertyType;
|
|
|
|
form.orgBuildingArea = data.orgBuildingArea;
|
|
|
|
}
|
|
|
|
});
|
2025-06-09 17:33:50 +08:00
|
|
|
return (_ctx, _cache) => {
|
|
|
|
return {
|
|
|
|
a: common_vendor.o(($event) => show.value = $event),
|
|
|
|
b: common_vendor.p({
|
|
|
|
content: content.value,
|
|
|
|
modelValue: show.value
|
|
|
|
}),
|
2025-06-13 13:42:14 +08:00
|
|
|
c: common_assets._imports_0$2,
|
|
|
|
d: common_vendor.o(($event) => popupshow.value = false),
|
|
|
|
e: common_vendor.f(address.value, (item, index, i0) => {
|
|
|
|
return {
|
|
|
|
a: common_vendor.t(item.name),
|
|
|
|
b: common_vendor.o(($event) => deleteUP(index))
|
|
|
|
};
|
|
|
|
}),
|
|
|
|
f: common_assets._imports_0$2,
|
|
|
|
g: common_vendor.f(address.value, (item, k0, i0) => {
|
|
|
|
return {};
|
|
|
|
}),
|
|
|
|
h: common_vendor.f(list.value, (item, index, i0) => {
|
|
|
|
return {
|
|
|
|
a: common_vendor.t(item.firstLetter),
|
|
|
|
b: common_vendor.t(item.name),
|
|
|
|
c: index,
|
|
|
|
d: common_vendor.o(($event) => clickcard(item), index)
|
|
|
|
};
|
|
|
|
}),
|
|
|
|
i: common_vendor.o(($event) => popupshow.value = $event),
|
|
|
|
j: common_vendor.p({
|
|
|
|
mode: "bottom",
|
|
|
|
["border-radius"]: "20",
|
|
|
|
height: "600px",
|
|
|
|
modelValue: popupshow.value
|
|
|
|
}),
|
|
|
|
k: form.address,
|
|
|
|
l: common_vendor.o(($event) => form.address = $event.detail.value),
|
|
|
|
m: common_vendor.o(openpopupshow),
|
|
|
|
n: form.orgAddress,
|
|
|
|
o: common_vendor.o(($event) => form.orgAddress = $event.detail.value),
|
|
|
|
p: form.orgLeader,
|
|
|
|
q: common_vendor.o(($event) => form.orgLeader = $event.detail.value),
|
|
|
|
r: form.orgLeaderPhone,
|
|
|
|
s: common_vendor.o(($event) => form.orgLeaderPhone = $event.detail.value),
|
|
|
|
t: form.orgPropertyType,
|
|
|
|
v: common_vendor.o(($event) => form.orgPropertyType = $event.detail.value),
|
|
|
|
w: form.orgBuildingArea,
|
|
|
|
x: common_vendor.o(($event) => form.orgBuildingArea = $event.detail.value),
|
|
|
|
y: common_vendor.o(goBack),
|
|
|
|
z: common_vendor.o(next)
|
2025-06-09 17:33:50 +08:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
};
|
|
|
|
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-549d1cee"]]);
|
|
|
|
wx.createPage(MiniProgramPage);
|
|
|
|
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/addjigou/where.js.map
|