Browse Source

(fixed)11730 小程序待办事项-待办事项展示了未指派的数据

dev
ww664853070 2 years ago
parent
commit
966ff06798
  1. 53
      weapp/src/packages/patrol/index.jsx
  2. 3
      weapp/src/packages/patrolView/index.jsx

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

@ -57,6 +57,7 @@ const Index = () => {
const [handlePic, setHandlePic] = useState([]) const [handlePic, setHandlePic] = useState([])
const [handlePicPn, setHandlePicPn] = useState([]) const [handlePicPn, setHandlePicPn] = useState([])
const [handleId, setHandleId] = useState([]) const [handleId, setHandleId] = useState([])
const [video, setVideo] = useState('')
const prjType = const prjType =
isAnomaly ? isAnomaly ?
@ -462,6 +463,7 @@ const Index = () => {
default: default:
break; break;
} }
console.log(files, '==============');
for (i; i < files.length; i++) { for (i; i < files.length; i++) {
const tempFilePaths = files[i].url const tempFilePaths = files[i].url
let token = getState('token') || Taro.getStorageSync('token') let token = getState('token') || Taro.getStorageSync('token')
@ -496,7 +498,7 @@ const Index = () => {
} }
useEffect(() => { useEffect(() => {
if (!isView) { if (!isView) {
let newRoadList = roadList.filter(e => e?.routeName?.match(road)) let newRoadList = roadList.filter(e => e.routeName.match(road))
let codeRoadSel = [] let codeRoadSel = []
if (newRoadList.length && road != '') { if (newRoadList.length && road != '') {
newRoadList.forEach((e, index) => { newRoadList.forEach((e, index) => {
@ -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 ( return (
<View className='patrol'> <View className='patrol'>
{/* { {/* {
@ -600,7 +632,6 @@ const Index = () => {
onInput={setProjectType} onInput={setProjectType}
selector={prjTypeSelector} selector={prjTypeSelector}
isView={isView} isView={isView}
onlySelect={true}
/> : '' /> : ''
} }
@ -610,9 +641,7 @@ const Index = () => {
title='反馈类型:' title='反馈类型:'
placeholder='请选择反馈类型' placeholder='请选择反馈类型'
value={projectType} value={projectType}
onInput={(v) => { onInput={setProjectType}
setProjectType(v)
}}
selector={prjTypeSelector} selector={prjTypeSelector}
isView={isView} isView={isView}
onlySelect={true} onlySelect={true}
@ -861,6 +890,20 @@ const Index = () => {
} }
</View> </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}
/> : ''
}
<AtButton type='secondary' size='small' onClick={addVideo}>添加视频</AtButton>
{ {
isView ? isView ?
isSuperAdmin && isSuperAdmin &&

3
weapp/src/packages/patrolView/index.jsx

@ -40,6 +40,8 @@ function Index() {
Taro.setNavigationBarTitle({ title: '在建项目' }) Taro.setNavigationBarTitle({ title: '在建项目' })
} else if (isAnomaly) { } else if (isAnomaly) {
Taro.setNavigationBarTitle({ title: '异常反馈' }) Taro.setNavigationBarTitle({ title: '异常反馈' })
}else if(ishandle){
Taro.setNavigationBarTitle({ title: '已办事项' })
} else if (kind == 'conserve') { } else if (kind == 'conserve') {
Taro.setNavigationBarTitle({ title: '养护上报' }) Taro.setNavigationBarTitle({ title: '养护上报' })
} else if (isWait) { } else if (isWait) {
@ -77,6 +79,7 @@ function Index() {
reportType: isWait || ishandle ? 'anomaly' : reportType, reportType: isWait || ishandle ? 'anomaly' : reportType,
userId: filter === 'my' ? userInfo.id : '', userId: filter === 'my' ? userInfo.id : '',
handleState: isWait ? '待处理' : ishandle ? '已处理' : '', handleState: isWait ? '待处理' : ishandle ? '已处理' : '',
performerId: isWait || ishandle ? userInfo.id : ''
} }
request.get(getReportList(), data).then(res => { request.get(getReportList(), data).then(res => {
Taro.hideLoading() Taro.hideLoading()

Loading…
Cancel
Save