|
|
@ -19,7 +19,7 @@ const Index = () => { |
|
|
|
const isSuperAdmin = userInfo && userInfo.username === 'SuperAdmin' ? true : false |
|
|
|
|
|
|
|
const router = useRouter() |
|
|
|
const { params: { type, kind, wait, handle } } = router |
|
|
|
const { params: { type, kind, wait, handle, videoShow } } = router |
|
|
|
const isView = type === 'view' ? true : false |
|
|
|
const isPatrol = kind === 'patrol' || kind == 'conserve' ? true : false |
|
|
|
const isRoad = kind === 'road' ? true : false |
|
|
@ -105,8 +105,10 @@ const Index = () => { |
|
|
|
useEffect(() => { |
|
|
|
if (isRoad) { |
|
|
|
Taro.setNavigationBarTitle({ title: '在建项目' }) |
|
|
|
} else if (wait == 'wait' || handle == 'handle') { |
|
|
|
} else if (wait == 'wait') { |
|
|
|
Taro.setNavigationBarTitle({ title: '待办事项' }) |
|
|
|
} else if (handle == 'handle') { |
|
|
|
Taro.setNavigationBarTitle({ title: '已办事项' }) |
|
|
|
} else if (isAnomaly) { |
|
|
|
Taro.setNavigationBarTitle({ title: '异常反馈' }) |
|
|
|
} else if (kind == 'conserve') { |
|
|
@ -138,6 +140,7 @@ const Index = () => { |
|
|
|
setAddress(data.address) |
|
|
|
setContent(data.content) |
|
|
|
setScenePic(data.scenePic ? data.scenePic.map(item => ({ url: imgUrl + item })) : []) |
|
|
|
setHandlePic(data.handlePic ? data.handlePic.map(item => ({ url: imgUrl + item })) : []) |
|
|
|
setConserveBeforePic(data.conserveBeforePic ? data.conserveBeforePic.map(item => ({ url: imgUrl + item })) : []) |
|
|
|
setConserveUnderwayPic(data.conserveUnderwayPic ? data.conserveUnderwayPic.map(item => ({ url: imgUrl + item })) : []) |
|
|
|
setConserveAfterPic(data.conserveAfterPic ? data.conserveAfterPic.map(item => ({ url: imgUrl + item })) : []) |
|
|
@ -145,9 +148,6 @@ const Index = () => { |
|
|
|
if (data.handleContent) { |
|
|
|
setHandleCenter(data.handleContent) |
|
|
|
} |
|
|
|
if (data.handlePic.length) { |
|
|
|
setHandlePic(data.handlePic) |
|
|
|
} |
|
|
|
} else { |
|
|
|
Taro.showToast({ title: res.data.message || '请求出错', icon: 'none' }) |
|
|
|
} |
|
|
@ -454,6 +454,9 @@ const Index = () => { |
|
|
|
case 'scenePic': |
|
|
|
i = scenePic.length |
|
|
|
break; |
|
|
|
case 'wait': |
|
|
|
i = handlePic.length |
|
|
|
break; |
|
|
|
case 'conserveBeforePic': |
|
|
|
i = conserveBeforePic.length |
|
|
|
break; |
|
|
@ -526,15 +529,9 @@ const Index = () => { |
|
|
|
Taro.showToast({ title: '内容字数不能超过50', icon: 'none' }) |
|
|
|
return |
|
|
|
} |
|
|
|
let handlePicList = [] |
|
|
|
if (handlePic.length) { |
|
|
|
handlePic.forEach(e => { |
|
|
|
handlePicList.push(e.url) |
|
|
|
}) |
|
|
|
} |
|
|
|
let data = { |
|
|
|
handleContent: str, |
|
|
|
handlePic: handlePicList, |
|
|
|
handlePic: handlePicPn, |
|
|
|
handleState: '已处理' |
|
|
|
} |
|
|
|
Taro.showModal({ |
|
|
@ -574,7 +571,6 @@ const Index = () => { |
|
|
|
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({ |
|
|
@ -582,7 +578,6 @@ const Index = () => { |
|
|
|
filePath: tempFilePaths, |
|
|
|
name: 'file', |
|
|
|
success: (ress) => { |
|
|
|
console.log(ress, '上传成功'); |
|
|
|
Taro.hideLoading(); |
|
|
|
if (ress.statusCode == 200) { |
|
|
|
setVideo(res.tempFiles[0].tempFilePath) |
|
|
@ -890,20 +885,23 @@ const Index = () => { |
|
|
|
} |
|
|
|
</View> |
|
|
|
} |
|
|
|
{ |
|
|
|
video.length ? <Video |
|
|
|
style={{ width: '90%', marginLeft: '-45%', left: '50%', marginBottom: 20 }} |
|
|
|
src={video} |
|
|
|
poster='../../static/img/date.png' |
|
|
|
initialTime={0} |
|
|
|
controls={true} |
|
|
|
autoplay={false} |
|
|
|
loop={false} |
|
|
|
muted={false} |
|
|
|
/> : '' |
|
|
|
} |
|
|
|
{/* { |
|
|
|
videoShow ? '' : |
|
|
|
<view> |
|
|
|
<Video |
|
|
|
style={{ width: '90%', marginLeft: '-45%', left: '50%', marginBottom: 20 }} |
|
|
|
src={video} |
|
|
|
poster='../../static/img/date.png' |
|
|
|
initialTime={0} |
|
|
|
controls={true} |
|
|
|
autoplay={false} |
|
|
|
loop={false} |
|
|
|
muted={false} |
|
|
|
/> |
|
|
|
|
|
|
|
<AtButton type='secondary' size='small' onClick={addVideo}>添加视频</AtButton> |
|
|
|
<AtButton type='secondary' size='small' onClick={addVideo}>添加视频</AtButton> |
|
|
|
</view> |
|
|
|
} */} |
|
|
|
{ |
|
|
|
isView ? |
|
|
|
isSuperAdmin && |
|
|
@ -928,7 +926,7 @@ const Index = () => { |
|
|
|
handle == 'handle' ? |
|
|
|
<View className='img-box'> |
|
|
|
{handlePic.map(item => ( |
|
|
|
<Image className='img' src={item} onClick={() => handleImgClicks(undefined, item)} /> |
|
|
|
<Image className='img' src={item.url} onClick={() => handleImgClicks(undefined, item)} /> |
|
|
|
))} |
|
|
|
</View> : |
|
|
|
<AtImagePicker |
|
|
|