"use strict"; const common_vendor = require("../../common/vendor.js"); const common_assets = require("../../common/assets.js"); const pages_addjigou_api_addjigou = require("./api/addjigou.js"); if (!Array) { const _easycom_u_modal2 = common_vendor.resolveComponent("u-modal"); _easycom_u_modal2(); } const _easycom_u_modal = () => "../../uni_modules/vk-uview-ui/components/u-modal/u-modal.js"; if (!Math) { _easycom_u_modal(); } const _sfc_main = { __name: "where", setup(__props) { const show = common_vendor.ref(false); const content = common_vendor.ref(""); const jigouweizhi = common_vendor.ref(""); const form = common_vendor.reactive({ orgLeader: "", orgLeaderPhone: "", orgBuildingNumber: "", orgPropertyType: "", orgBuildingArea: "", orgAddress: "", orgCoordinateLo: "", orgCoordinateLa: "", id: common_vendor.index.getStorageSync("specicalid") || "", tel: common_vendor.index.getStorageSync("tel") }); common_vendor.ref(""); common_vendor.ref(""); common_vendor.ref(""); const openLook = (res) => { if (res) { content.value = res; show.value = true; } }; const next = () => { const allNonEmpty = form.orgLeader && form.orgLeaderPhone && form.orgBuildingNumber && form.orgPropertyType && form.orgBuildingArea && form.orgAddress && form.orgCoordinateLo && form.orgCoordinateLa; 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" }); } }; const goBack = () => { common_vendor.index.navigateBack(); }; const jumpToMap = () => { common_vendor.index.navigateTo({ url: "/pages/map/index" }); }; common_vendor.onShow(() => { const data = common_vendor.index.getStorageSync("dingwei"); if (data) { common_vendor.index.__f__("log", "at pages/addjigou/where.vue:158", "data", data); jigouweizhi.value = data.name; form.orgAddress = data.name; form.orgCoordinateLo = data.lng; form.orgCoordinateLa = data.lat; common_vendor.index.removeStorageSync("dingwei"); } }); return (_ctx, _cache) => { return { a: common_vendor.o(($event) => show.value = $event), b: common_vendor.p({ content: content.value, modelValue: show.value }), c: common_vendor.t(jigouweizhi.value ? jigouweizhi.value : `请选择机构位置`), d: common_vendor.o(($event) => openLook(jigouweizhi.value)), e: common_assets._imports_0$5, f: common_vendor.o(jumpToMap), g: form.orgLeader, h: common_vendor.o(($event) => form.orgLeader = $event.detail.value), i: form.orgLeaderPhone, j: common_vendor.o(($event) => form.orgLeaderPhone = $event.detail.value), k: form.orgBuildingNumber, l: common_vendor.o(($event) => form.orgBuildingNumber = $event.detail.value), m: form.orgPropertyType, n: common_vendor.o(($event) => form.orgPropertyType = $event.detail.value), o: form.orgBuildingArea, p: common_vendor.o(($event) => form.orgBuildingArea = $event.detail.value), q: common_vendor.o(goBack), r: common_vendor.o(next) }; }; } }; 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