From 539050b3dbf895663466359142578c37db59b020 Mon Sep 17 00:00:00 2001 From: liujiangyong Date: Wed, 2 Aug 2023 15:53:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9F=A5=E7=9C=8B=E5=B7=A1=E6=9F=A5/=E5=85=BB?= =?UTF-8?q?=E6=8A=A4=E4=B8=8A=E6=8A=A5=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- weapp/src/packages/patrol/index.jsx | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/weapp/src/packages/patrol/index.jsx b/weapp/src/packages/patrol/index.jsx index 2916ca25..fa5b153e 100644 --- a/weapp/src/packages/patrol/index.jsx +++ b/weapp/src/packages/patrol/index.jsx @@ -11,6 +11,7 @@ import { getState } from '../../store/globalState'; import { postReport, getReportList, getReportDetail, delReport, getRoadSection, postImage, getProject, postHandle } from '@/services/api'; import './index.scss'; import arrowIcon from '../../static/img/patrol/arrow-down.svg'; +import dayjs from 'dayjs'; const { baseUrl, imgUrl } = environment; @@ -197,6 +198,7 @@ const Index = () => { unit: '块', }, }) + const [isBeforeReport, setIsBeforeReport] = useState(false) // V1.1.0上报内容修改,查看时根据时间判断展示逻辑) const prjType = isAnomaly ? @@ -286,7 +288,7 @@ const Index = () => { setConserveUnderwayPic(data.conserveUnderwayPic ? data.conserveUnderwayPic.map(item => ({ url: imgUrl + item })) : []) setConserveAfterPic(data.conserveAfterPic ? data.conserveAfterPic.map(item => ({ url: imgUrl + item })) : []) setHandleId(data.id) - setVideo(data.videoUrl[0] ? imgUrl + data.videoUrl[0] : '') + setVideo((data.videoUrl && data.videoUrl[0]) ? imgUrl + data.videoUrl[0] : '') setRoadCodeHead(data.codeRoad ? data.codeRoad.slice(0, 1) : '') setRoadCodeEnd(data.codeRoad ? data.codeRoad.slice(1) : '') if (data.reportType === 'patrol') { @@ -314,6 +316,7 @@ const Index = () => { if (data.handleContent) { setHandleCenter(data.handleContent) } + setIsBeforeReport(dayjs(data.time).diff('2023-08-02', 'd') < 0) } else { Taro.showToast({ title: res.data.message || '请求出错', icon: 'none' }) } @@ -900,7 +903,7 @@ const Index = () => { { isPatrol ? <> - + {!(isView && isBeforeReport) && 线路编码: { setRoadCodeHead(e.detail.value[0]); @@ -917,13 +920,19 @@ const Index = () => { onInput={e => handleInput(e, 'roadCodeEnd')} disabled={isView} /> - + } 道路类型: { }} disabled={true} /> @@ -1004,7 +1013,7 @@ const Index = () => { /> : '' } { - isAnomaly ? + isAnomaly || (isView && isBeforeReport) ? { /> { - kind === 'patrol' && + (kind === 'patrol' && !(isView && isBeforeReport)) && 巡查内容 @@ -1160,7 +1169,7 @@ const Index = () => { } { - !isPatrol ?