From 05ceacffd2da471be1c30d1ffa89b7bac777b2f4 Mon Sep 17 00:00:00 2001 From: liujiangyong Date: Thu, 23 Feb 2023 16:04:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E6=9F=A5=E7=9C=8B?= =?UTF-8?q?=E5=B7=A1=E6=A3=80=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inspectionRecordDetail.js | 43 +++++----- .../inspectionRecordDetail.json | 6 +- .../inspectionRecordDetail.wxml | 78 ++++++++----------- .../inspectionRecordDetail.wxss | 10 ++- 4 files changed, 63 insertions(+), 74 deletions(-) diff --git a/weapp/package/polling/inspectionRecordDetail/inspectionRecordDetail.js b/weapp/package/polling/inspectionRecordDetail/inspectionRecordDetail.js index de30c5a..249cf3c 100644 --- a/weapp/package/polling/inspectionRecordDetail/inspectionRecordDetail.js +++ b/weapp/package/polling/inspectionRecordDetail/inspectionRecordDetail.js @@ -6,20 +6,26 @@ Page({ */ data: { dataList: '', - imgUrl: getApp().globalData.imgUrl + imgUrl: getApp().globalData.imgUrl, + activeValues: [] + }, + + handleChange(e) { + this.setData({ + activeValues: e.detail.value, + }); }, // 预览图片 previewImg: function (e) { - //获取当前图片的下标 - var index = e.currentTarget.dataset.index; - //所有图片 - var imgs = this.data.dataList.imgs; + // 获取当前图片的下标 + const index = e.currentTarget.dataset.index; + // 所有图片 + const imgs = this.data.dataList.points.inspectContent[e.currentTarget.dataset.key].imgs; + const newImgs = imgs.map(i => this.data.imgUrl + i); wx.previewImage({ - //当前显示图片 - current: imgs[index], - //所有图片 - urls: imgs + current: newImgs[index], + urls: newImgs }) }, @@ -27,22 +33,9 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad(options) { - let that = this; - let data = JSON.parse(decodeURIComponent(options.data)) - if (data.points.imgs != undefined) { - let newArr = data.points.imgs.map(e => { - e = that.data.imgUrl + e; - return e; - }) - that.setData({ - dataList: { ...data, imgs: newArr } - }) - } else { - that.setData({ - dataList: data - }) - } - + const that = this; + const data = JSON.parse(decodeURIComponent(options.data)) + that.setData({ dataList: data }) }, /** diff --git a/weapp/package/polling/inspectionRecordDetail/inspectionRecordDetail.json b/weapp/package/polling/inspectionRecordDetail/inspectionRecordDetail.json index aa08bbe..a69b43b 100644 --- a/weapp/package/polling/inspectionRecordDetail/inspectionRecordDetail.json +++ b/weapp/package/polling/inspectionRecordDetail/inspectionRecordDetail.json @@ -2,5 +2,9 @@ "navigationBarBackgroundColor": "#1979ff", "navigationBarTextStyle": "white", "navigationBarTitleText": "巡检记录详情", - "enablePullDownRefresh": false + "enablePullDownRefresh": false, + "usingComponents": { + "t-collapse": "tdesign-miniprogram/collapse/collapse", + "t-collapse-panel": "tdesign-miniprogram/collapse-panel/collapse-panel" + } } \ No newline at end of file diff --git a/weapp/package/polling/inspectionRecordDetail/inspectionRecordDetail.wxml b/weapp/package/polling/inspectionRecordDetail/inspectionRecordDetail.wxml index 4e94f7b..7012486 100644 --- a/weapp/package/polling/inspectionRecordDetail/inspectionRecordDetail.wxml +++ b/weapp/package/polling/inspectionRecordDetail/inspectionRecordDetail.wxml @@ -1,77 +1,61 @@ - + 结构物名称: - - {{dataList.points.project.name}} - + {{dataList.points.project.name}} 巡检人: - - {{dataList.points.user.name}} - + {{dataList.points.user.name}} 巡检单位: - - {{dataList.points.user.department.name}} - + {{dataList.points.user.department.name}} 巡检频次: - - {{dataList.points.frequency}} - + {{dataList.points.frequency}} 上次巡检日期: - - {{dataList.lastInspectionTime}} - + {{dataList.lastInspectionTime}} 本次巡检日期: - - {{dataList.inspectionTime}} - + {{dataList.inspectionTime}} 巡检结果: - - {{dataList.alarm ? '异常' : '正常'}} - + {{dataList.alarm ? '异常' : '正常'}} 当前点位: - - {{dataList.points.itemData.name}} - + {{dataList.points.itemData.name}} 当前位置: - - {{dataList.points.address}} - - - - 巡检详情: - - {{dataList.points.msgInp || '--'}} - - - - 异常等级: - - {{dataList.points.changeThree || '--'}} - - - - - - - - + {{dataList.points.address}} + + + + + + 描述: + {{value.msgInp || '--'}} + + + 异常等级: + {{value.level || '--'}} + + 巡检图片: + + + + + + + + \ No newline at end of file diff --git a/weapp/package/polling/inspectionRecordDetail/inspectionRecordDetail.wxss b/weapp/package/polling/inspectionRecordDetail/inspectionRecordDetail.wxss index dc028ca..76419af 100644 --- a/weapp/package/polling/inspectionRecordDetail/inspectionRecordDetail.wxss +++ b/weapp/package/polling/inspectionRecordDetail/inspectionRecordDetail.wxss @@ -41,10 +41,18 @@ page { box-shadow: 0rpx 0rpx 16rpx #ccc; } +.item-key { + margin-right: 30rpx; +} + +.abnormal-ctx { + padding-left: 20rpx; +} + .content { width: 100%; overflow: hidden; - margin: 30rpx auto; + margin-bottom: 30rpx; } .title {