From 4134c92dafac807179139900f0367470b23d46a9 Mon Sep 17 00:00:00 2001 From: liujiangyong Date: Sat, 23 Jul 2022 10:50:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A1=E6=9F=A5=E5=85=BB=E6=8A=A4=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- weapp/src/packages/patrol/index.jsx | 100 +++++++++++++++++++-------- weapp/src/packages/patrol/index.scss | 67 +++++++++++++++++- 2 files changed, 136 insertions(+), 31 deletions(-) diff --git a/weapp/src/packages/patrol/index.jsx b/weapp/src/packages/patrol/index.jsx index d8e594da..fa27ad47 100644 --- a/weapp/src/packages/patrol/index.jsx +++ b/weapp/src/packages/patrol/index.jsx @@ -1,4 +1,5 @@ import React, { useState, useEffect } from 'react'; +import Taro from '@tarojs/taro'; import { View, RadioGroup, @@ -37,7 +38,7 @@ const Index = () => { ] useEffect(() => { - const prjTypeSelector = ['道路', '桥梁', '涵洞'] + const prjTypeSelector = ['道路', '桥梁', '涵洞', '其他'] const roadSelector = ['富山一路', '金沙大道', '玉湖路'] setPrjTypeSelector(prjTypeSelector) setRoadSelector(roadSelector) @@ -66,10 +67,19 @@ const Index = () => { setProjectType(selector[e.detail.value]) } - function onImgPickerChange() { - + function onImgPickerChange(files) { + setimages(files) + } + function onImageClick(index, file) { + Taro.previewImage({ + urls: [file.url] // 需要预览的图片http链接列表 + }) } + useEffect(() => { + console.log(images); + }, [images]) + return ( @@ -142,14 +152,16 @@ const Index = () => { - + + + { // value={this.state.value} // onChange={this.handleChange.bind(this, 'value')} /> - + + + - - - + + { isPatrol ? - + 现场图片: = 3 ? false : true} files={images} onChange={onImgPickerChange} + onImageClick={onImageClick} /> : - + 养护图片: - - + + + 养护前 + + + + + 养护中 + + + + + 养护后 + + } diff --git a/weapp/src/packages/patrol/index.scss b/weapp/src/packages/patrol/index.scss index 44aa32e2..b7338b0f 100644 --- a/weapp/src/packages/patrol/index.scss +++ b/weapp/src/packages/patrol/index.scss @@ -40,12 +40,77 @@ } } - .img-picker { + .patrol-picker { background-color: #fff; + padding: 20px; } + .conserve-picker { + background-color: #fff; + padding: 20px; + + .horizontal-line { + height: 30px; + width: 100%; + display: flex; + justify-content: left; + align-items: center; + + .circle { + margin-left: 4px; + width: 22px; + height: 22px; + background-color: #fff; + border-radius: 50%; + } + + .text { + margin-left: 46px; + font-size: 24px; + } + } + .hl-one { + background-color: #DFDFDF; + + .c-one { + border: solid 4px #999999; + } + + .t-one { + color: #999999; + } + } + .hl-two { + background-color: #f7d3a5; + + .c-two { + border: solid 4px #FE9B1C; + } + + .t-two { + color: #FE9B1C; + } + } + .hl-three { + background-color: #a0f3a4; + + .c-three { + border: solid 4px #08D514; + } + + .t-three { + color: #08D514; + } + } + + .img-picker { + margin: 20px; + } + } + .sub-btn { width: 70%; + margin-top: 100px; } } \ No newline at end of file