diff --git a/weapp/src/packages/patrol/index.jsx b/weapp/src/packages/patrol/index.jsx
index 30b8767a..33d25597 100644
--- a/weapp/src/packages/patrol/index.jsx
+++ b/weapp/src/packages/patrol/index.jsx
@@ -57,6 +57,7 @@ const Index = () => {
const [handlePic, setHandlePic] = useState([])
const [handlePicPn, setHandlePicPn] = useState([])
const [handleId, setHandleId] = useState([])
+ const [video, setVideo] = useState('')
const prjType =
isAnomaly ?
@@ -241,7 +242,7 @@ const Index = () => {
])
}, [reportType])
- function report () {
+ function report() {
if (!canReport) { return }
if (
(isPatrol && (!projectType || !road))
@@ -317,7 +318,7 @@ const Index = () => {
})
}
- function deleteReport () {
+ function deleteReport() {
Taro.showModal({
title: '提示',
content: '确定删除吗?',
@@ -344,7 +345,7 @@ const Index = () => {
})
}
- function handleInput ({ detail: { value } }, type) {
+ function handleInput({ detail: { value } }, type) {
switch (type) {
case 'roadSectionStart':
setRoadSectionStart(value)
@@ -379,15 +380,15 @@ const Index = () => {
}
}
- function handleTypeChange (e) {
+ function handleTypeChange(e) {
setReportType(e.detail.value)
}
- function handleImgChange (files, operationType, index, type) {
+ function handleImgChange(files, operationType, index, type) {
if (operationType === 'remove') {
setImg(false)
}
- function setImg (isAdd, url) {
+ function setImg(isAdd, url) {
switch (type) {
case 'scenePic':
let nextImg = sceneImg
@@ -462,6 +463,7 @@ const Index = () => {
default:
break;
}
+ console.log(files, '==============');
for (i; i < files.length; i++) {
const tempFilePaths = files[i].url
let token = getState('token') || Taro.getStorageSync('token')
@@ -484,19 +486,19 @@ const Index = () => {
}
}
- function handleImgClick (index, file) {
+ function handleImgClick(index, file) {
Taro.previewImage({
urls: [file.url] // 需要预览的图片http链接列表
})
}
- function handleImgClicks (index, file) {
+ function handleImgClicks(index, file) {
Taro.previewImage({
urls: [file] // 需要预览的图片http链接列表
})
}
useEffect(() => {
if (!isView) {
- let newRoadList = roadList.filter(e => e?.routeName?.match(road))
+ let newRoadList = roadList.filter(e => e.routeName.match(road))
let codeRoadSel = []
if (newRoadList.length && road != '') {
newRoadList.forEach((e, index) => {
@@ -511,7 +513,7 @@ const Index = () => {
}
}
}, [road])
- function handleOk () {
+ function handleOk() {
if (!canReport) { return }
let str = handleCenter.trim()
if (!str) {
@@ -562,6 +564,36 @@ const Index = () => {
}
})
}
+ function addVideo() {
+ wx.chooseMedia({
+ count: 1,
+ mediaType: ['video'],
+ sourceType: ['album', 'camera'],
+ maxDuration: 15,
+ camera: 'back',
+ success(res) {
+ console.log(res, 'res');
+ const tempFilePaths = res.tempFiles[0].tempFilePath
+ let token = getState('token') || Taro.getStorageSync('token')
+ Taro.uploadFile({
+ url: `${baseUrl}${postImage()}?token=${token}`,
+ filePath: tempFilePaths,
+ name: 'file',
+ success: (ress) => {
+ console.log(ress, '上传成功');
+ Taro.hideLoading();
+ if (ress.statusCode == 200) {
+ setVideo(res.tempFiles[0].tempFilePath)
+ } else {
+ Taro.showToast({ title: '上传失败,请重试', icon: 'error' })
+ }
+ }
+ });
+ }
+ })
+ }
+ console.log(video, 'video');
+ console.log(scenePic, 'tupia');
return (
{/* {
@@ -600,7 +632,6 @@ const Index = () => {
onInput={setProjectType}
selector={prjTypeSelector}
isView={isView}
- onlySelect={true}
/> : ''
}
@@ -610,9 +641,7 @@ const Index = () => {
title='反馈类型:'
placeholder='请选择反馈类型'
value={projectType}
- onInput={(v) => {
- setProjectType(v)
- }}
+ onInput={setProjectType}
selector={prjTypeSelector}
isView={isView}
onlySelect={true}
@@ -861,6 +890,20 @@ const Index = () => {
}
}
+ {
+ video.length ? : ''
+ }
+
+ 添加视频
{
isView ?
isSuperAdmin &&
diff --git a/weapp/src/packages/patrolView/index.jsx b/weapp/src/packages/patrolView/index.jsx
index 86cb0b8f..de0b6d7b 100644
--- a/weapp/src/packages/patrolView/index.jsx
+++ b/weapp/src/packages/patrolView/index.jsx
@@ -40,6 +40,8 @@ function Index() {
Taro.setNavigationBarTitle({ title: '在建项目' })
} else if (isAnomaly) {
Taro.setNavigationBarTitle({ title: '异常反馈' })
+ }else if(ishandle){
+ Taro.setNavigationBarTitle({ title: '已办事项' })
} else if (kind == 'conserve') {
Taro.setNavigationBarTitle({ title: '养护上报' })
} else if (isWait) {
@@ -77,6 +79,7 @@ function Index() {
reportType: isWait || ishandle ? 'anomaly' : reportType,
userId: filter === 'my' ? userInfo.id : '',
handleState: isWait ? '待处理' : ishandle ? '已处理' : '',
+ performerId: isWait || ishandle ? userInfo.id : ''
}
request.get(getReportList(), data).then(res => {
Taro.hideLoading()