From 058d9e7c07e057e069e52a4b903de4490e56aa06 Mon Sep 17 00:00:00 2001 From: SelfRidicule Date: Sun, 10 Mar 2024 17:58:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=8F=E8=BF=B0:=E9=A2=84=E7=BA=A6=E8=AF=A6?= =?UTF-8?q?=E7=BB=86=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../visitorIinvitation/detail/detail.js | 97 ++++++++++++++++++- .../visitorIinvitation/detail/detail.json | 4 +- .../visitorIinvitation/detail/detail.wxml | 24 +++-- .../visitorIinvitation/detail/detail.wxss | 31 ++++++ 4 files changed, 146 insertions(+), 10 deletions(-) diff --git a/miniprogram/pages/meeting/visitorIinvitation/detail/detail.js b/miniprogram/pages/meeting/visitorIinvitation/detail/detail.js index 5bae5fd..f4438df 100644 --- a/miniprogram/pages/meeting/visitorIinvitation/detail/detail.js +++ b/miniprogram/pages/meeting/visitorIinvitation/detail/detail.js @@ -8,7 +8,8 @@ import { import { visitorPersonRq, - selectVisitorRecordByIdRq + selectVisitorRecordByIdRq, + updateVisitorPersonStatusRq } from "../../../../api/meeting/visitorIinvitation.js" @@ -22,6 +23,8 @@ Page({ id: null, title: null, type: null, + submitShow: false, + verifyShow: false, userDetail: {}, idcardTypeShow: false, idcardTypeList: [{ @@ -49,7 +52,11 @@ Page({ visitContent: null, // 来访事由 photo: null, // 头像-相对路径 url: null, // 人脸设备图片-全路径 - } + }, + // 审核 + dialogShow: false, + dialogId: null, + dialogContent: null, }, /** @@ -76,6 +83,16 @@ Page({ wx.setNavigationBarTitle({ title: options.title }) + // 根据类型 判断显示 + if (options.type == 'add') { + _this.setData({ + submitShow: true + }) + } else if (options.type == 'verify') { + + } else if (options.type == 'detail') { + + } // 有id查询详情 if (options.id) { // 获取详情 @@ -89,6 +106,12 @@ Page({ selectVisitorRecordByIdRq(_this.data.id).then(res => { console.log('selectVisitorRecordByIdRq', res); let detail = res.data; + // 是点击审核菜单或按钮并且是未审核的数据 + if (_this.data.type == 'verify' && detail.status == 0) { + _this.setData({ + verifyShow: true + }) + } _this.setData({ detail, fileList: [{ @@ -332,6 +355,13 @@ Page({ // 添加数据 visitorPersonRq(detail).then(res => { console.log('visitorPersonRq', res); + // 刷新上个页面参数 + let pages = getCurrentPages(); //获取page + let prevPage = pages[pages.length - 2]; //上一个页面(父页面) + prevPage.setData({ + changeData: true + }) + // if (res.code == 0) { wx.navigateBack() } else { @@ -340,6 +370,69 @@ Page({ }) }, + // 显示-弹出框 + showDialog(e) { + console.log('showDialog', e); + let _this = this + _this.setData({ + dialogShow: true, + dialogId: e.currentTarget.dataset.id, + dialogContent: null + }) + }, + + // 弹出框-审核 + dialogVerify(e) { + console.log('dialogSuccess', e); + let status = e.currentTarget.dataset.status; + let _this = this + // 驳回 需要输入描述信息 + if (status == 2 && !_this.data.dialogContent) { + Notify({ + type: 'danger', + message: '请输入描述信息!' + }); + return + } + updateVisitorPersonStatusRq({ + id: _this.data.dialogId, + status, + rejectContent: _this.data.dialogContent, + }).then(res => { + console.log('updateVisitorPersonStatusRq', res); + // 刷新上个页面参数 + let pages = getCurrentPages(); //获取page + let prevPage = pages[pages.length - 2]; //上一个页面(父页面) + prevPage.setData({ + changeData: true + }) + // + _this.setData({ + dialogShow: false, + }) + if (res.code == 0) { + _this.setData({ + verifyShow: false + }) + } else { + Notify({ + type: 'danger', + message: res.msg + }); + } + }) + }, + + // 弹出框-输入框:输入内容时触发 + dialogInput(e) { + let _this = this + console.log('dialogInput', e.detail); + _this.setData({ + dialogContent: e.detail, + }) + }, + + // 显示错误消息 showErrMsg(msg) { Notify({ diff --git a/miniprogram/pages/meeting/visitorIinvitation/detail/detail.json b/miniprogram/pages/meeting/visitorIinvitation/detail/detail.json index c9be960..e6ab339 100644 --- a/miniprogram/pages/meeting/visitorIinvitation/detail/detail.json +++ b/miniprogram/pages/meeting/visitorIinvitation/detail/detail.json @@ -6,7 +6,9 @@ "van-uploader": "@vant/weapp/uploader/index", "van-datetime-picker": "@vant/weapp/datetime-picker/index", "van-notify": "@vant/weapp/notify/index", - "van-action-sheet": "@vant/weapp/action-sheet/index" + "van-action-sheet": "@vant/weapp/action-sheet/index", + "van-dialog": "@vant/weapp/dialog/index" + } } \ No newline at end of file diff --git a/miniprogram/pages/meeting/visitorIinvitation/detail/detail.wxml b/miniprogram/pages/meeting/visitorIinvitation/detail/detail.wxml index 0b4a8a9..be0ee15 100644 --- a/miniprogram/pages/meeting/visitorIinvitation/detail/detail.wxml +++ b/miniprogram/pages/meeting/visitorIinvitation/detail/detail.wxml @@ -21,7 +21,7 @@ 手机号码 - + 身份证类型 @@ -29,7 +29,7 @@ 身份证号 - + 到访时间 @@ -42,7 +42,7 @@ 来访事由 - + @@ -53,13 +53,14 @@ - + 提示:请保持五官清晰,以方便系统精准识 - 提交 - + 提交 + + 审核 @@ -77,4 +78,13 @@ - \ No newline at end of file + + + + + + + 驳回 + 通过 + + \ No newline at end of file diff --git a/miniprogram/pages/meeting/visitorIinvitation/detail/detail.wxss b/miniprogram/pages/meeting/visitorIinvitation/detail/detail.wxss index c375b1c..5aeef18 100644 --- a/miniprogram/pages/meeting/visitorIinvitation/detail/detail.wxss +++ b/miniprogram/pages/meeting/visitorIinvitation/detail/detail.wxss @@ -79,4 +79,35 @@ color: white; font-size: 30rpx; text-align: center; +} + + +.textarea { + height: 300rpx !important; + border: 1px solid rgb(126, 126, 126, 0.2) !important; + padding: 20rpx !important; +} + +.dialogBtnView { + display: flex; + justify-content: space-between; + align-items: center; + border-top: 1px solid rgb(126, 126, 126, 0.2); +} + +.dialogBtnView .rejectBtn, +.dialogBtnView .successBtn { + width: 50%; + text-align: center; + padding: 30rpx 0; + font-size: 32rpx; +} + +.dialogBtnView .rejectBtn { + border-right: 1px solid rgb(126, 126, 126, 0.2); + color: red; +} + +.dialogBtnView .successBtn { + color: #4e96f8; } \ No newline at end of file