2025-06-09 17:33:50 +08:00
|
|
|
"use strict";
|
|
|
|
const common_vendor = require("../../common/vendor.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");
|
2025-06-23 17:31:43 +08:00
|
|
|
const _easycom_u_select2 = common_vendor.resolveComponent("u-select");
|
|
|
|
(_easycom_u_modal2 + _easycom_u_popup2 + _easycom_u_select2)();
|
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-23 17:31:43 +08:00
|
|
|
const _easycom_u_select = () => "../../uni_modules/vk-uview-ui/components/u-select/u-select.js";
|
2025-06-09 17:33:50 +08:00
|
|
|
if (!Math) {
|
2025-06-23 17:31:43 +08:00
|
|
|
(_easycom_u_modal + _easycom_u_popup + _easycom_u_select)();
|
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
|
|
|
const popupshow = common_vendor.ref(false);
|
|
|
|
const list = common_vendor.ref([]);
|
2025-06-23 17:31:43 +08:00
|
|
|
const showselect = common_vendor.ref(false);
|
|
|
|
const showlist = common_vendor.reactive(
|
|
|
|
// [{
|
|
|
|
// value: `租赁`,
|
|
|
|
// },
|
|
|
|
// {
|
|
|
|
// value: `自由产权`,
|
|
|
|
// },
|
|
|
|
// {
|
|
|
|
// value: `合作使用`,
|
|
|
|
// } ,{
|
|
|
|
// value: `其它`,
|
|
|
|
// }
|
|
|
|
// ]
|
|
|
|
[
|
|
|
|
{
|
|
|
|
value: 1,
|
|
|
|
label: "租赁"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
value: 2,
|
|
|
|
label: "自由产权"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
value: 3,
|
|
|
|
label: "合作使用"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
value: 4,
|
|
|
|
label: "其它"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
);
|
|
|
|
function onSelect1(arr) {
|
|
|
|
form.orgPropertyType = arr[0].label;
|
|
|
|
}
|
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: "",
|
2025-06-23 17:31:43 +08:00
|
|
|
// orgAddress: "",
|
2025-06-11 17:33:34 +08:00
|
|
|
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-23 17:31:43 +08:00
|
|
|
common_vendor.index.__f__("log", "at pages/addjigou/where.vue:232", "删除了", 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({
|
2025-06-20 17:32:20 +08:00
|
|
|
url: `/pages/login/threeselectone`
|
2025-06-11 17:33:34 +08:00
|
|
|
});
|
|
|
|
} else {
|
|
|
|
common_vendor.index.setStorageSync("specicalid", res.result.id);
|
|
|
|
common_vendor.index.reLaunch({
|
2025-06-20 17:32:20 +08:00
|
|
|
url: `/pages/login/threeselectone`
|
2025-06-11 17:33:34 +08:00
|
|
|
});
|
|
|
|
}
|
|
|
|
} 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 = () => {
|
2025-06-23 17:31:43 +08:00
|
|
|
if (form.address) {
|
|
|
|
let data = common_vendor.index.getStorageSync("backhuancun");
|
|
|
|
data.address = form.address;
|
|
|
|
data.orgProvince = form.orgProvince;
|
|
|
|
data.orgCity = form.orgCity;
|
|
|
|
data.orgDistrict = form.orgDistrict;
|
|
|
|
data.orgAddress = form.orgAddress;
|
|
|
|
data.orgLeader = form.orgLeader;
|
|
|
|
data.orgLeaderPhone = form.orgLeaderPhone;
|
|
|
|
data.orgPropertyType = form.orgPropertyType;
|
|
|
|
data.orgBuildingArea = form.orgBuildingArea;
|
|
|
|
common_vendor.index.setStorageSync("backhuancun", data);
|
|
|
|
}
|
2025-06-09 17:33:50 +08:00
|
|
|
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) => {
|
2025-06-19 17:03:31 +08:00
|
|
|
var _a, _b;
|
|
|
|
form[key] = ((_a = address.value[idx]) == null ? void 0 : _a.id) ? (_b = address.value[idx]) == null ? void 0 : _b.id : "";
|
2025-06-13 13:42:14 +08:00
|
|
|
});
|
|
|
|
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-23 17:31:43 +08:00
|
|
|
common_vendor.index.__f__("log", "at pages/addjigou/where.vue:330", "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)) {
|
2025-06-23 17:31:43 +08:00
|
|
|
return {
|
|
|
|
...item,
|
|
|
|
firstLetter: ""
|
|
|
|
};
|
2025-06-13 13:42:14 +08:00
|
|
|
} else {
|
|
|
|
seen.add(letter);
|
|
|
|
return item;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
common_vendor.onLoad(() => {
|
|
|
|
pages_addjigou_api_addjigou.getdate(`xzqhdm`).then((res) => {
|
|
|
|
list.value = dedupeFirstLetter(res.result);
|
|
|
|
});
|
2025-06-23 17:31:43 +08:00
|
|
|
if (common_vendor.index.getStorageSync("backhuancun").address) {
|
|
|
|
let data = common_vendor.index.getStorageSync("backhuancun");
|
|
|
|
form.address = data.address;
|
|
|
|
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;
|
|
|
|
} else if (common_vendor.index.getStorageSync("baddata")) {
|
2025-06-13 13:42:14 +08:00
|
|
|
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-19 17:03:31 +08:00
|
|
|
c: common_vendor.o(($event) => popupshow.value = false),
|
|
|
|
d: common_vendor.f(address.value, (item, index, i0) => {
|
2025-06-13 13:42:14 +08:00
|
|
|
return {
|
|
|
|
a: common_vendor.t(item.name),
|
|
|
|
b: common_vendor.o(($event) => deleteUP(index))
|
|
|
|
};
|
|
|
|
}),
|
2025-06-19 17:03:31 +08:00
|
|
|
e: common_vendor.f(address.value, (item, k0, i0) => {
|
2025-06-13 13:42:14 +08:00
|
|
|
return {};
|
|
|
|
}),
|
2025-06-19 17:03:31 +08:00
|
|
|
f: common_vendor.f(list.value, (item, index, i0) => {
|
2025-06-13 13:42:14 +08:00
|
|
|
return {
|
|
|
|
a: common_vendor.t(item.firstLetter),
|
|
|
|
b: common_vendor.t(item.name),
|
|
|
|
c: index,
|
|
|
|
d: common_vendor.o(($event) => clickcard(item), index)
|
|
|
|
};
|
|
|
|
}),
|
2025-06-19 17:03:31 +08:00
|
|
|
g: common_vendor.o(($event) => popupshow.value = $event),
|
|
|
|
h: common_vendor.p({
|
2025-06-13 13:42:14 +08:00
|
|
|
mode: "bottom",
|
|
|
|
["border-radius"]: "20",
|
|
|
|
height: "600px",
|
|
|
|
modelValue: popupshow.value
|
|
|
|
}),
|
2025-06-23 17:31:43 +08:00
|
|
|
i: common_vendor.o(goBack),
|
|
|
|
j: form.address,
|
|
|
|
k: common_vendor.o(($event) => form.address = $event.detail.value),
|
|
|
|
l: common_vendor.o(openpopupshow),
|
|
|
|
m: form.orgAddress,
|
|
|
|
n: common_vendor.o(($event) => form.orgAddress = $event.detail.value),
|
|
|
|
o: form.orgLeader,
|
|
|
|
p: common_vendor.o(($event) => form.orgLeader = $event.detail.value),
|
|
|
|
q: form.orgLeaderPhone,
|
|
|
|
r: common_vendor.o(($event) => form.orgLeaderPhone = $event.detail.value),
|
|
|
|
s: form.orgPropertyType,
|
|
|
|
t: common_vendor.o(($event) => form.orgPropertyType = $event.detail.value),
|
|
|
|
v: common_vendor.o(($event) => showselect.value = true),
|
|
|
|
w: common_vendor.o(onSelect1),
|
|
|
|
x: common_vendor.o(($event) => showselect.value = $event),
|
|
|
|
y: common_vendor.p({
|
|
|
|
list: showlist,
|
|
|
|
modelValue: showselect.value
|
|
|
|
}),
|
|
|
|
z: form.orgBuildingArea,
|
|
|
|
A: common_vendor.o(($event) => form.orgBuildingArea = $event.detail.value),
|
|
|
|
B: common_vendor.o(goBack),
|
|
|
|
C: 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
|