From a746c004819916425120cc7efd913df30ddae38b Mon Sep 17 00:00:00 2001 From: zsqtony <450952271@qq.com> Date: Wed, 16 Jul 2025 09:35:59 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E7=BB=91=E5=AE=9A=E6=88=BF?= =?UTF-8?q?=E5=B1=8B=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/dev/mp-weixin/INDEX/binding/index.js | 2 +- dist/dev/mp-weixin/INDEX/binding/method.js | 24 +++++++++++++++++-- .../mp-weixin/common/libraries/naviHelper.js | 8 +++++++ src/INDEX/binding/index.vue | 4 ++-- src/INDEX/binding/method.ts | 24 +++++++++++++++++-- src/common/libraries/naviHelper.ts | 8 +++++++ 6 files changed, 63 insertions(+), 7 deletions(-) diff --git a/dist/dev/mp-weixin/INDEX/binding/index.js b/dist/dev/mp-weixin/INDEX/binding/index.js index bec3719..b3e912a 100644 --- a/dist/dev/mp-weixin/INDEX/binding/index.js +++ b/dist/dev/mp-weixin/INDEX/binding/index.js @@ -120,7 +120,7 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({ }, common_vendor.unref(INDEX_binding_model.model).formData.value.is_live_in ? { B: common_vendor.o(($event) => common_vendor.unref(INDEX_binding_model.model).formData.value.move_in_date = $event), C: common_vendor.p({ - title: "入住时间", + title: "入住日期", borderTop: true, isLink: true, valueModel: common_vendor.unref(INDEX_binding_model.model).formData.value.move_in_date diff --git a/dist/dev/mp-weixin/INDEX/binding/method.js b/dist/dev/mp-weixin/INDEX/binding/method.js index e43a5e0..b1fcec3 100644 --- a/dist/dev/mp-weixin/INDEX/binding/method.js +++ b/dist/dev/mp-weixin/INDEX/binding/method.js @@ -9,6 +9,8 @@ const method = { var _a; if (e[3]) { INDEX_binding_model.model.formData.value.asset_houses_id = (_a = e[3]) == null ? void 0 : _a.id; + } else { + INDEX_binding_model.model.formData.value.asset_houses_id = ""; } console.log(e, "e"); }, @@ -18,8 +20,26 @@ const method = { console.log(e, "e"); }, handleSubmit: (e) => { - var _a; - console.log((_a = INDEX_binding_model.model) == null ? void 0 : _a.formData.value, "formData"); + var _a, _b, _c, _d, _e, _f; + if (!INDEX_binding_model.model.formData.value.asset_houses_id) { + return common_libraries_naviHelper.showToast("请先选择小区!"); + } + if (!INDEX_binding_model.model.formData.value.type) { + return common_libraries_naviHelper.showToast("请先选择身份!"); + } + if (!INDEX_binding_model.model.formData.value.name || !INDEX_binding_model.model.formData.value.phone) { + return common_libraries_naviHelper.showToast("请先设置姓名和手机号!"); + } + if (!((_a = INDEX_binding_model.model.formData.value.card_front_image) == null ? void 0 : _a.length) || !((_b = INDEX_binding_model.model.formData.value.card_back_image) == null ? void 0 : _b.length)) { + return common_libraries_naviHelper.showToast("请先上传身份证正反面!"); + } + if (INDEX_binding_model.model.formData.value.type === "Owner" && !((_d = (_c = INDEX_binding_model.model.formData.value) == null ? void 0 : _c.ownership_info) == null ? void 0 : _d.length)) { + return common_libraries_naviHelper.showToast("请先上传房产证!"); + } + if (INDEX_binding_model.model.formData.value.is_live_in && !((_e = INDEX_binding_model.model.formData.value) == null ? void 0 : _e.move_in_date)) { + return common_libraries_naviHelper.showToast("请选择入住日期!"); + } + console.log((_f = INDEX_binding_model.model) == null ? void 0 : _f.formData.value, "formData"); common_libraries_apiLoading.getApiLoading(gen_Apis.Apis.Archive.HouseRegisters.Store, { ...INDEX_binding_model.model.formData.value, customer_info: [INDEX_binding_model.model.formData.value] }).then((res) => { common_libraries_naviHelper.showToastBack("提交成功!", 1, true); console.log(res); diff --git a/dist/dev/mp-weixin/common/libraries/naviHelper.js b/dist/dev/mp-weixin/common/libraries/naviHelper.js index abde4d7..43d79c8 100644 --- a/dist/dev/mp-weixin/common/libraries/naviHelper.js +++ b/dist/dev/mp-weixin/common/libraries/naviHelper.js @@ -17,5 +17,13 @@ function showToastBack(label, delta = 1, back = true) { } }); } +function showToast(label) { + common_vendor.index.showToast({ + title: label || "提交成功!", + duration: 1e3, + icon: "none" + }); +} exports.goto = goto; +exports.showToast = showToast; exports.showToastBack = showToastBack; diff --git a/src/INDEX/binding/index.vue b/src/INDEX/binding/index.vue index 361266a..e1fb396 100644 --- a/src/INDEX/binding/index.vue +++ b/src/INDEX/binding/index.vue @@ -24,10 +24,10 @@ - + - + diff --git a/src/INDEX/binding/method.ts b/src/INDEX/binding/method.ts index 6a7c9d0..aab9cb5 100644 --- a/src/INDEX/binding/method.ts +++ b/src/INDEX/binding/method.ts @@ -2,19 +2,39 @@ import { ref } from "vue"; import model from "./model"; import { getApiLoading } from "@/common/libraries/apiLoading"; import { Apis } from "@/gen/Apis"; -import { showToastBack } from "@/common/libraries/naviHelper"; +import { showToastBack,showToast } from "@/common/libraries/naviHelper"; export default { handleSelectProject: (e:any) => { if(e[3]){ model.formData.value.asset_houses_id = e[3]?.id + } else { + model.formData.value.asset_houses_id = '' } console.log(e,'e') }, - handleIsLiveIn(e){ + handleIsLiveIn(e:any){ model.formData.value.is_live_in = e?.detail?.value console.log(e,'e') }, handleSubmit: (e:any) => { + if(!model.formData.value.asset_houses_id){ + return showToast('请先选择小区!') + } + if(!model.formData.value.type){ + return showToast('请先选择身份!') + } + if(!model.formData.value.name || !model.formData.value.phone){ + return showToast('请先设置姓名和手机号!') + } + if(!model.formData.value.card_front_image?.length || !model.formData.value.card_back_image?.length){ + return showToast('请先上传身份证正反面!') + } + if(model.formData.value.type === 'Owner' && !model.formData.value?.ownership_info?.length){ + return showToast('请先上传房产证!') + } + if(model.formData.value.is_live_in && !model.formData.value?.move_in_date){ + return showToast('请选择入住日期!') + } console.log(model?.formData.value,'formData') getApiLoading(Apis.Archive.HouseRegisters.Store, {...model.formData.value,customer_info:[model.formData.value]}).then(res => { showToastBack('提交成功!',1,true) diff --git a/src/common/libraries/naviHelper.ts b/src/common/libraries/naviHelper.ts index 3fe9c5d..3872962 100644 --- a/src/common/libraries/naviHelper.ts +++ b/src/common/libraries/naviHelper.ts @@ -16,3 +16,11 @@ export function showToastBack(label?: string, delta = 1, back = true) { } }) } + +export function showToast(label?: string) { + uni.showToast({ + title: label || '提交成功!', + duration: 1000, + icon: 'none', + }) +}