From 35459256327b64da4bc01343b7e4146832b2d223 Mon Sep 17 00:00:00 2001 From: duanliangtao <48194157+duanliangtao@users.noreply.github.com> Date: Thu, 15 Aug 2024 18:14:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E7=AE=A1=E7=90=86=E7=9A=8408?= =?UTF-8?q?15=E6=97=A5=E7=A6=85=E9=81=93=E5=86=85=E5=AE=B9=E7=9A=84?= =?UTF-8?q?=E6=94=B9=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dissatisfied/demandCheck/demandCheck.js | 61 ++++++++++++++++++- .../dissatisfied/demandCheck/demandCheck.wxml | 41 ++++++++++++- .../dissatisfied/demandCheck/demandCheck.wxss | 31 +++++++++- .../myTroubleshootDemand/pages/event/event.js | 59 ++++++++++++------ .../pages/event/event.wxml | 2 +- .../pages/index/index.wxml | 4 +- .../pages/index/index.wxss | 4 +- 7 files changed, 171 insertions(+), 31 deletions(-) diff --git a/subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.js b/subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.js index ac778b3..faa146a 100644 --- a/subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.js +++ b/subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.js @@ -676,7 +676,7 @@ formatTimestamp(timestamp) { 'fmData.responsibleUnit': 'yes' }) }else{ - his.setData({ + this.setData({ 'fmData.responsibleUnit': 'no' }) } @@ -752,7 +752,9 @@ formatTimestamp(timestamp) { }) }) setTimeout(function () { - wx.hideLoading() + wx.navigateBack({ + delta: 1 + }) }, 1000) }, // 个性服务提交 @@ -1222,6 +1224,13 @@ formatTimestamp(timestamp) { resiMobile: resiDetail.resiMobile }) } + console.log("on Show:"+this.data.optionsId) + if(this.data.optionsId){ + icEventOldProcess({icEventId: this.data.optionsId}).then(res => { + this.getProcess(res.data); + }) + } + }, /** @@ -1731,4 +1740,52 @@ formatTimestamp(timestamp) { url: `/subpages/myTroubleshootDemand/pages/event/event?id=${this.data.optionsId}&categoryIds=${this.data.categoryIds}`, }) }, + previewImage(e) { + const currentUrl = e.currentTarget.dataset.url; + const urls = this.data.item.internalFile + .filter(file => file.attachmentType === 'image') + .map(file => file.attachmentUrl); + + wx.previewImage({ + current: currentUrl, // 当前显示图片的http链接 + urls: urls // 需要预览的图片http链接列表 + }); + }, + downloadFile: function (event) { + const url = event.currentTarget.dataset.url; + + wx.downloadFile({ + url: url, + success: function (res) { + if (res.statusCode === 200) { + wx.saveFile({ + tempFilePath: res.tempFilePath, + success: function (res) { + wx.showToast({ + title: '下载成功', + icon: 'success' + }); + }, + fail: function () { + wx.showToast({ + title: '保存失败', + icon: 'none' + }); + } + }); + } else { + wx.showToast({ + title: '下载失败', + icon: 'none' + }); + } + }, + fail: function () { + wx.showToast({ + title: '下载失败', + icon: 'none' + }); + } + }); + }, }) \ No newline at end of file diff --git a/subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.wxml b/subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.wxml index 69750bd..cb2e268 100644 --- a/subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.wxml +++ b/subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.wxml @@ -227,7 +227,24 @@ 办结时限: - {{ item.timeLimit }} + {{ item.limitTime }} + + + + 附件: + + + + + + + + + @@ -247,7 +264,25 @@ 办结时限: - {{ item.timeLimit }} + {{ item.limitTime }} + + + + + 附件: + + + + + + + + + + 下载附件 + + + @@ -265,7 +300,7 @@ - + diff --git a/subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.wxss b/subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.wxss index ab4edbe..e479819 100644 --- a/subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.wxss +++ b/subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.wxss @@ -1016,9 +1016,19 @@ background: rgb(175, 1, 1); } .bto_btn{ - display: flex; + /* display: flex; margin-top: 20rpx; - padding: 0 20rpx 30rpx; + padding: 0 20rpx 30rpx; */ + display: flex; + justify-content: space-between; + padding: 10rpx 20rpx; + position: fixed; + bottom: 50rpx; /* 调整为20rpx,距离底部20rpx */ + left: 0; + width: 100%; + background-color: #ffffff; + box-shadow: 0 -5rpx 10rpx rgba(0, 0, 0, 0.1); + z-index: 1000; } .btn_blue , .btn_yellow, @@ -1110,4 +1120,21 @@ background: rgb(175, 1, 1); flex-direction: row; align-items: center; /* 垂直居中对齐 */ margin-top: 35rpx; +} + +.download-link { + color: #007aff; /* 下载链接颜色 */ +} + +.image-row { + display: flex; + justify-content: space-between; + align-items: center; /* 保证图片垂直居中 */ +} +.image-row image { + flex: 1; + margin: 0 5px; /* 控制图片之间的间距 */ + max-width: 100%; /* 防止图片过大 */ + max-height: 150px; /* 设置图片最大高度 */ + object-fit: cover; /* 保持图片比例 */ } \ No newline at end of file diff --git a/subpages/myTroubleshootDemand/pages/event/event.js b/subpages/myTroubleshootDemand/pages/event/event.js index 19a8877..6ce7aa3 100644 --- a/subpages/myTroubleshootDemand/pages/event/event.js +++ b/subpages/myTroubleshootDemand/pages/event/event.js @@ -254,7 +254,7 @@ Page({ this.setData({ "form.deptId": params.agencyId, "form.deptName": params.agencyName, - "form.orgType": params.level + "form.level": params.level }) this.setData({orgName: data.selectedOptions.map(item => item.agencyName).join('/')}) }, @@ -265,33 +265,44 @@ Page({ this.setData({ "form.deptId": params.agencyId, "form.deptName": params.agencyName, - "form.orgType": params.level, + "form.level": params.level, visible2: false }) this.setData({orgName: data.selectedOptions.map(item => item.agencyName).join('/')}) }, afterRead(event) { - const {file} = event.detail; - // 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式 - wx.uploadFile({ - url: `${config.BASEURL()}oss/file/uploadvariedfile`, - name: 'file', - header: { - 'Content-type': 'application/json;charset=UTF-8', - 'Authorization': wx.getStorageSync('token') - }, - filePath: file.url, - success: (res) => { - let data = JSON.parse(res.data) - console.log("data:"+JSON.stringify(file)); - const fileList = this.data.fileList; - fileList.push({...file, attachmentUrl: data.data.url,attachmentName:file.name,attachmentFormat:file.type,attachmentType:file.type}); - console.log(fileList) - this.setData({fileList}); - }, + const { file } = event.detail; + // 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式 + const files = Array.isArray(file) ? file : [file]; + + files.forEach(fileItem => { + wx.uploadFile({ + url: `${config.BASEURL()}oss/file/uploadvariedfile`, + name: 'file', + header: { + 'Content-type': 'application/json;charset=UTF-8', + 'Authorization': wx.getStorageSync('token') + }, + filePath: fileItem.url, + success: (res) => { + let data = JSON.parse(res.data); + console.log("data:" + JSON.stringify(fileItem)); + const fileList = this.data.fileList; + fileList.push({ + ...fileItem, + attachmentUrl: data.data.url, + attachmentName: fileItem.url.split('/').pop(), + attachmentFormat: fileItem.type, + attachmentType: fileItem.type + }); + console.log(fileList); + this.setData({ fileList }); + }, + }); }); }, + deleteFile(e) { console.log(e) @@ -392,6 +403,14 @@ Page({ close() { this.triggerEvent('close') + + + setTimeout(() => { + //返回上一级,关闭当前页面 + wx.navigateBack({ + delta: 1 + }) + }, 1000); // 1000毫秒 = 1秒 }, // 代码简化,弹窗统一封装 diff --git a/subpages/myTroubleshootDemand/pages/event/event.wxml b/subpages/myTroubleshootDemand/pages/event/event.wxml index 2309473..388a5b9 100644 --- a/subpages/myTroubleshootDemand/pages/event/event.wxml +++ b/subpages/myTroubleshootDemand/pages/event/event.wxml @@ -57,7 +57,7 @@ 附件 - + diff --git a/subpages/myTroubleshootDemand/pages/index/index.wxml b/subpages/myTroubleshootDemand/pages/index/index.wxml index 05a4f87..3a9cbe6 100644 --- a/subpages/myTroubleshootDemand/pages/index/index.wxml +++ b/subpages/myTroubleshootDemand/pages/index/index.wxml @@ -32,13 +32,13 @@ {{item.type == 'event'?'事件':item.type == 'chengguan'?'城管':'需求'}} {{item.name}} {{item.mobile}} - {{item.status == 'processing'?'处理中':'已完成'}} {{item.content}} - {{item.time}} + {{item.time}} + {{item.status == 'processing'?'处理中':'已完成'}} diff --git a/subpages/myTroubleshootDemand/pages/index/index.wxss b/subpages/myTroubleshootDemand/pages/index/index.wxss index 6f1fbcb..5499288 100644 --- a/subpages/myTroubleshootDemand/pages/index/index.wxss +++ b/subpages/myTroubleshootDemand/pages/index/index.wxss @@ -21,7 +21,9 @@ page { background-color: #4f94ff; } .blue_small, - .red_small{ + .red_small, + .green_small, + .gray_small{ font-size: 26rpx; width: fit-content; padding: 8rpx 16rpx;