Browse Source

(*)注释视频上传

dev
ww664853070 2 years ago
parent
commit
8ea807f602
  1. 28
      weapp/src/packages/patrol/index.jsx

28
weapp/src/packages/patrol/index.jsx

@ -20,7 +20,6 @@ const Index = () => {
const router = useRouter() const router = useRouter()
const { params: { type, kind, wait, handle, videoShow } } = router const { params: { type, kind, wait, handle, videoShow } } = router
console.log(router);
const isView = type === 'view' ? true : false const isView = type === 'view' ? true : false
const isPatrol = kind === 'patrol' || kind == 'conserve' ? true : false const isPatrol = kind === 'patrol' || kind == 'conserve' ? true : false
const isRoad = kind === 'road' ? true : false const isRoad = kind === 'road' ? true : false
@ -108,7 +107,7 @@ const Index = () => {
Taro.setNavigationBarTitle({ title: '在建项目' }) Taro.setNavigationBarTitle({ title: '在建项目' })
} else if (wait == 'wait') { } else if (wait == 'wait') {
Taro.setNavigationBarTitle({ title: '待办事项' }) Taro.setNavigationBarTitle({ title: '待办事项' })
}else if (handle == 'handle') { } else if (handle == 'handle') {
Taro.setNavigationBarTitle({ title: '已办事项' }) Taro.setNavigationBarTitle({ title: '已办事项' })
} else if (isAnomaly) { } else if (isAnomaly) {
Taro.setNavigationBarTitle({ title: '异常反馈' }) Taro.setNavigationBarTitle({ title: '异常反馈' })
@ -141,6 +140,7 @@ const Index = () => {
setAddress(data.address) setAddress(data.address)
setContent(data.content) setContent(data.content)
setScenePic(data.scenePic ? data.scenePic.map(item => ({ url: imgUrl + item })) : []) 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 })) : []) setConserveBeforePic(data.conserveBeforePic ? data.conserveBeforePic.map(item => ({ url: imgUrl + item })) : [])
setConserveUnderwayPic(data.conserveUnderwayPic ? data.conserveUnderwayPic.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 })) : []) setConserveAfterPic(data.conserveAfterPic ? data.conserveAfterPic.map(item => ({ url: imgUrl + item })) : [])
@ -148,9 +148,6 @@ const Index = () => {
if (data.handleContent) { if (data.handleContent) {
setHandleCenter(data.handleContent) setHandleCenter(data.handleContent)
} }
if (data.handlePic.length) {
setHandlePic(data.handlePic)
}
} else { } else {
Taro.showToast({ title: res.data.message || '请求出错', icon: 'none' }) Taro.showToast({ title: res.data.message || '请求出错', icon: 'none' })
} }
@ -395,6 +392,7 @@ const Index = () => {
setImg(false) setImg(false)
} }
function setImg(isAdd, url) { function setImg(isAdd, url) {
console.log(url, '图片地址');
switch (type) { switch (type) {
case 'scenePic': case 'scenePic':
let nextImg = sceneImg let nextImg = sceneImg
@ -457,6 +455,9 @@ const Index = () => {
case 'scenePic': case 'scenePic':
i = scenePic.length i = scenePic.length
break; break;
case 'wait':
i = handlePic.length
break;
case 'conserveBeforePic': case 'conserveBeforePic':
i = conserveBeforePic.length i = conserveBeforePic.length
break; break;
@ -529,17 +530,12 @@ const Index = () => {
Taro.showToast({ title: '内容字数不能超过50', icon: 'none' }) Taro.showToast({ title: '内容字数不能超过50', icon: 'none' })
return return
} }
let handlePicList = []
if (handlePic.length) {
handlePic.forEach(e => {
handlePicList.push(e.url)
})
}
let data = { let data = {
handleContent: str, handleContent: str,
handlePic: handlePicList, handlePic: handlePicPn,
handleState: '已处理' handleState: '已处理'
} }
console.log(data, 'data');
Taro.showModal({ Taro.showModal({
title: '提示', title: '提示',
content: '您要进行处理提交吗?', content: '您要进行处理提交吗?',
@ -598,7 +594,7 @@ const Index = () => {
}) })
} }
console.log(scenePic, '现场图片'); console.log(scenePic, '现场图片');
console.log(videoShow, 'videoShow'); console.log(handlePic, '处理图片');
return ( return (
<View className='patrol'> <View className='patrol'>
{/* { {/* {
@ -895,7 +891,7 @@ const Index = () => {
} }
</View> </View>
} }
{ {/* {
videoShow ? '' : videoShow ? '' :
<view> <view>
<Video <Video
@ -911,7 +907,7 @@ const Index = () => {
<AtButton type='secondary' size='small' onClick={addVideo}>添加视频</AtButton> <AtButton type='secondary' size='small' onClick={addVideo}>添加视频</AtButton>
</view> </view>
} } */}
{ {
isView ? isView ?
isSuperAdmin && isSuperAdmin &&
@ -936,7 +932,7 @@ const Index = () => {
handle == 'handle' ? handle == 'handle' ?
<View className='img-box'> <View className='img-box'>
{handlePic.map(item => ( {handlePic.map(item => (
<Image className='img' src={item} onClick={() => handleImgClicks(undefined, item)} /> <Image className='img' src={item.url} onClick={() => handleImgClicks(undefined, item)} />
))} ))}
</View> : </View> :
<AtImagePicker <AtImagePicker

Loading…
Cancel
Save