|
|
@ -1,6 +1,6 @@ |
|
|
|
import React, { useState, useEffect } from 'react'; |
|
|
|
import Taro, { useRouter } from '@tarojs/taro'; |
|
|
|
import { View, RadioGroup, Radio, Image, Input, Picker } from '@tarojs/components'; |
|
|
|
import { View, RadioGroup, Radio, Image, Input, Picker, Video } from '@tarojs/components'; |
|
|
|
import { AtButton, AtTextarea, AtImagePicker } from 'taro-ui'; |
|
|
|
import InputPicker from '../components/inputPicker'; |
|
|
|
import VideoUpload from '../../components/uploads' |
|
|
@ -75,6 +75,12 @@ const Index = () => { |
|
|
|
]) |
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
if (isRoad) { |
|
|
|
Taro.setNavigationBarTitle({ title: '在建道路' }) |
|
|
|
} if (isAnomaly) { |
|
|
|
Taro.setNavigationBarTitle({ title: '异常反馈' }) |
|
|
|
} |
|
|
|
|
|
|
|
if (isView) { // 查看 |
|
|
|
Taro.showLoading({ title: '加载中' }) |
|
|
|
request.get(getReportDetail(router.params.id)).then(res => { |
|
|
@ -558,17 +564,46 @@ const Index = () => { |
|
|
|
onImageClick={handleImgClick} |
|
|
|
/> |
|
|
|
} |
|
|
|
{/* <VideoUpload isUpload={true} /> |
|
|
|
<AtButton onClick={() => { |
|
|
|
Taro.chooseVideo({ |
|
|
|
sourceType: ['album', 'camera'], |
|
|
|
maxDuration: 60, |
|
|
|
|
|
|
|
{/* <Video |
|
|
|
id='video' |
|
|
|
src='https://wxsnsdy.tc.qq.com/105/20210/snsdyvideodownload?filekey=30280201010421301f0201690402534804102ca905ce620b1241b726bc41dcff44e00204012882540400&bizid=1023&hy=SH&fileparam=302c020101042530230204136ffd93020457e3c4ff02024ef202031e8d7f02030f42400204045a320a0201000400' |
|
|
|
poster='../../static/img/date.png' |
|
|
|
initialTime={0} |
|
|
|
controls={true} |
|
|
|
autoplay={false} |
|
|
|
loop={false} |
|
|
|
muted={false} |
|
|
|
/> */} |
|
|
|
|
|
|
|
{/* <AtButton onClick={() => { |
|
|
|
Taro.chooseMedia({ |
|
|
|
sourceType: ['album', 'camera'], mediaType: ['image', 'video'], |
|
|
|
camera: 'back', |
|
|
|
success: function (res) { |
|
|
|
console.log(res.tempFilePath) |
|
|
|
Taro.showLoading({ title: '上传中' }) |
|
|
|
const tempFilePaths = res.tempFilePath |
|
|
|
let token = getState('token') || Taro.getStorageSync('token') |
|
|
|
Taro.uploadFile({ |
|
|
|
url: `${baseUrl}${postImage()}?token=${token}`, |
|
|
|
filePath: tempFilePaths, |
|
|
|
name: 'file', |
|
|
|
success: (res) => { |
|
|
|
console.log(res); |
|
|
|
Taro.hideLoading(); |
|
|
|
if (res.statusCode == 200) { |
|
|
|
// setImg(true, JSON.parse(res.data).key) |
|
|
|
} else { |
|
|
|
Taro.showToast({ title: '上传失败,请重试', icon: 'error' }) |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}) |
|
|
|
}}>v</AtButton> */} |
|
|
|
}}> |
|
|
|
添加视频 |
|
|
|
</AtButton> */} |
|
|
|
</View> : |
|
|
|
<View className='conserve-img'> |
|
|
|
养护图片: |
|
|
|