From cf066df178429e2764b9a479336405af7e947129 Mon Sep 17 00:00:00 2001 From: weiwei Date: Fri, 1 Aug 2025 10:23:54 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E9=82=80=E7=BA=A6=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 4 +- src/pages/invitation/detail.vue | 106 +++++++++++++++++++++++++- src/pages/tabbar/invitation.vue | 55 ++++++++++--- src/pages/tabbar/invitationRecord.vue | 58 +++++++++++--- src/sheep/api/invitation.ts | 9 ++- 5 files changed, 206 insertions(+), 26 deletions(-) diff --git a/src/App.vue b/src/App.vue index 3eba186..98f2e9a 100644 --- a/src/App.vue +++ b/src/App.vue @@ -95,8 +95,8 @@ const tabbar: TabbarItem[] = [ { pagePath: "pages/tabbar/invitationRecord", text: "邀约记录", - iconPath: "/static/tabbar/invitation.png", - selectedIconPath: "/static/tabbar/invitation-select.png", + iconPath: "/static/tabbar/order.png", + selectedIconPath: "/static/tabbar/order-select.png", launchParam: ["invitation"], auth: [], }, diff --git a/src/pages/invitation/detail.vue b/src/pages/invitation/detail.vue index a79b335..6516294 100644 --- a/src/pages/invitation/detail.vue +++ b/src/pages/invitation/detail.vue @@ -1,3 +1,105 @@ - + + + diff --git a/src/pages/tabbar/invitation.vue b/src/pages/tabbar/invitation.vue index 3d927be..eb2d551 100644 --- a/src/pages/tabbar/invitation.vue +++ b/src/pages/tabbar/invitation.vue @@ -51,7 +51,7 @@ - + - - + + @@ -90,20 +90,19 @@ import { onLoad } from "@dcloudio/uni-app" import { reactive, ref } from "vue" import { invitationApi } from "@/sheep/api/index" -const form = reactive({ +const form = reactive({ name: "", mobile: "", companyName: "", vStartDate: "", vEndDate: "", - deptId: "", reasonValue: "", + reasonText: "", isOtherPeople: true, isDrive: true, }) const _timestr = ref("2025-01-01") -const _pingtaistr = ref("") -const visitorReasonList = ref([]) +const visitorReasonList = ref<{ title: string; id: string }[]>([]) onLoad(() => { const app = getApp() @@ -116,35 +115,54 @@ onLoad(() => { const getVisitorReasonList = async () => { const { code, data } = await invitationApi.getDictListByType("1") if (code == 0 && data) { - visitorReasonList.value = data + visitorReasonList.value = data.map((item: any) => ({ title: item.label, id: item.value })) return } visitorReasonList.value = [] } +// 来访原因选择器确认 +const reasonPickerConfirm = (ids: string) => { + const reason = visitorReasonList.value.find((item) => item.id === ids[0]) + form.reasonText = reason?.title || "" + form.reasonValue = reason?.id || "" +} + const rules: Record = { name: [{ required: true, message: "姓名2到5个字符", rule: /^.{2,5}$/ }], mobile: [{ required: true, message: "请输入正确的手机号", rule: /^(?:(?:\+|00)86)?1\d{10}$/ }], companyName: [{ required: true, message: "请输入来访公司名称" }], vStartDate: [{ required: true, message: "请选择拜访开始时间" }], vEndDate: [{ required: true, message: "请选择拜访离开时间" }], - deptId: [{ required: true, message: "请选择拜访部门" }], reasonValue: [{ required: true, message: "请选择拜访原因" }], } // 表单提交 const onsubmit = (evt: TM.FORM_SUBMIT_RESULT) => { - console.log("校验结果:", evt) + // console.log("校验结果:", evt) if (!evt.isPass) return uni.showModal({ title: "提示", content: "确认提交吗?", confirmColor: "#0094ff", success: async () => { + if (form.isOtherPeople) { + form.isOtherPeople = "1" + } else { + form.isOtherPeople = "0" + } + + if (form.isDrive) { + form.isDrive = "1" + } else { + form.isDrive = "0" + } + try { const { code, data, msg } = await invitationApi.saveInvitation(form) if (code == 0) { uni.showToast({ title: "提交成功", icon: "success" }) + resetForm() uni.switchTab({ url: "/pages/tabbar/invitationRecord" }) return } @@ -155,4 +173,19 @@ const onsubmit = (evt: TM.FORM_SUBMIT_RESULT) => { }, }) } + +// 重置表单 +const resetForm = () => { + Object.assign(form, { + name: "", + mobile: "", + companyName: "", + vStartDate: "", + vEndDate: "", + reasonValue: "", + reasonText: "", + isOtherPeople: true, + isDrive: true, + }) +} diff --git a/src/pages/tabbar/invitationRecord.vue b/src/pages/tabbar/invitationRecord.vue index 4a22d0a..4ab4144 100644 --- a/src/pages/tabbar/invitationRecord.vue +++ b/src/pages/tabbar/invitationRecord.vue @@ -15,18 +15,32 @@ @scroll="pageHook.scroll" > diff --git a/src/sheep/api/invitation.ts b/src/sheep/api/invitation.ts index ef4bd87..19268bb 100644 --- a/src/sheep/api/invitation.ts +++ b/src/sheep/api/invitation.ts @@ -4,7 +4,7 @@ export default { // 获取拜访原因字典 getDictListByType: (type: number | string): Promise => request({ - url: `/integrated/app/visitor/getDictListByType?type=${type}`, + url: `/integrated/visitors/getDictListByType?type=${type}`, method: "GET", }), @@ -32,4 +32,11 @@ export default { method: "GET", params, }), + + // 查看邀约详情 + getInvitationDetail: (id: string): Promise => + request({ + url: `/integrated/visitors/${id}`, + method: "GET", + }), } From 3a0117f4ba2d0d24ebb639026c210b38bd2d5fad Mon Sep 17 00:00:00 2001 From: weiwei Date: Fri, 1 Aug 2025 14:41:14 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B2=A1=E5=A5=BD?= =?UTF-8?q?=E5=95=86=E5=9F=8E=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 2 +- src/pages.json | 4 +- src/pages/tabbar/index.vue | 2 +- src/pages/tabbar/my.vue | 2 +- .../{thirdAppList.vue => happyMall.vue} | 102 ++++++++++-------- src/static/page/happyMall.png | Bin 0 -> 111827 bytes 6 files changed, 62 insertions(+), 50 deletions(-) rename src/pages/thirdApp/{thirdAppList.vue => happyMall.vue} (54%) create mode 100644 src/static/page/happyMall.png diff --git a/src/App.vue b/src/App.vue index 98f2e9a..a1fc523 100644 --- a/src/App.vue +++ b/src/App.vue @@ -121,7 +121,7 @@ const tabbar: TabbarItem[] = [ text: "我的", iconPath: "/static/tabbar/my.png", selectedIconPath: "/static/tabbar/my-select.png", - launchParam: ["canteen", "selfMerchant", "onlineShop", "coopMerchant", "invitation"], + launchParam: ["canteen", "selfMerchant", "onlineShop", "coopMerchant"], auth: ["user", "merchant", "doorAdmin"], }, ] diff --git a/src/pages.json b/src/pages.json index 69fd36f..0579678 100644 --- a/src/pages.json +++ b/src/pages.json @@ -429,9 +429,9 @@ "root": "pages/thirdApp", "pages": [ { - "path": "thirdAppList", + "path": "happyMall", "style": { - "navigationBarTitleText": "第三方应用" + "navigationBarTitleText": "美好商城" } } ] diff --git a/src/pages/tabbar/index.vue b/src/pages/tabbar/index.vue index 7fe358c..5bcf43f 100644 --- a/src/pages/tabbar/index.vue +++ b/src/pages/tabbar/index.vue @@ -99,7 +99,7 @@ const jumpByParam = async () => { const userRole = uni.getStorageSync("userRole") // 获取用户角色 if (!launchParam) return uni.hideTabBar() - if (launchParam == "thirdApp") return uni.reLaunch({ url: "/pages/thirdApp/thirdAppList" }) + if (launchParam == "thirdApp") return uni.reLaunch({ url: "/pages/thirdApp/happyMall" }) switch (userRole) { case "merchant": diff --git a/src/pages/tabbar/my.vue b/src/pages/tabbar/my.vue index f1dece8..d713fe9 100644 --- a/src/pages/tabbar/my.vue +++ b/src/pages/tabbar/my.vue @@ -405,7 +405,7 @@ const initMenuConfig = () => { { text: "dev-外来人员就餐", icon: "/static/icon/service_1.png", router: "/pages/apply/foreign-list" }, { text: "dev-跨单位就餐", icon: "/static/icon/service_1.png", router: "/pages/apply/stride-list" }, { text: "dev-包厢预定", icon: "/static/icon/service_4.png", router: "/pages/boxes/apply-list" }, - { text: "dev-第三方应用", icon: "/static/icon/login.png", router: "/pages/thirdApp/thirdAppList" }, + { text: "dev-第三方应用", icon: "/static/icon/login.png", router: "/pages/thirdApp/happyMall" }, { text: "dev-登录", icon: "/static/icon/login.png", router: "/pages/user/login" }, { text: "dev-角色选择", icon: "/static/icon/login.png", router: "/pages/user/userRole" }, { text: "dev-意见反馈", icon: "/static/icon/service_5.png", router: "/pages/integrated/feedback/index" }, diff --git a/src/pages/thirdApp/thirdAppList.vue b/src/pages/thirdApp/happyMall.vue similarity index 54% rename from src/pages/thirdApp/thirdAppList.vue rename to src/pages/thirdApp/happyMall.vue index d1488a7..e86392a 100644 --- a/src/pages/thirdApp/thirdAppList.vue +++ b/src/pages/thirdApp/happyMall.vue @@ -1,6 +1,6 @@ - - \ No newline at end of file diff --git a/src/pages/integrated/visitor/detail.vue b/src/pages/integrated/visitor/detail.vue index 57368aa..6516294 100644 --- a/src/pages/integrated/visitor/detail.vue +++ b/src/pages/integrated/visitor/detail.vue @@ -1,236 +1,105 @@ - - \ No newline at end of file diff --git a/src/pages/integrated/visitor/index.vue b/src/pages/integrated/visitor/index.vue deleted file mode 100644 index e2fd1fe..0000000 --- a/src/pages/integrated/visitor/index.vue +++ /dev/null @@ -1,438 +0,0 @@ -