|
|
@ -572,7 +572,10 @@ const Index = () => { |
|
|
|
maxDuration: 15, |
|
|
|
camera: 'back', |
|
|
|
success(res) { |
|
|
|
console.log(res,'上传的视频'); |
|
|
|
const tempFilePaths = res.tempFiles[0].tempFilePath |
|
|
|
|
|
|
|
setVideo(res.tempFiles[0].tempFilePath) |
|
|
|
let token = getState('token') || Taro.getStorageSync('token') |
|
|
|
Taro.uploadFile({ |
|
|
|
url: `${baseUrl}${postImage()}?token=${token}`, |
|
|
@ -581,7 +584,7 @@ const Index = () => { |
|
|
|
success: (ress) => { |
|
|
|
Taro.hideLoading(); |
|
|
|
if (ress.statusCode == 200) { |
|
|
|
setVideo(res.tempFiles[0].tempFilePath) |
|
|
|
// setVideo(res.tempFiles[0].tempFilePath) |
|
|
|
} else { |
|
|
|
Taro.showToast({ title: '上传失败,请重试', icon: 'error' }) |
|
|
|
} |
|
|
@ -590,6 +593,7 @@ const Index = () => { |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
console.log(isView, '============'); |
|
|
|
return ( |
|
|
|
<View className='patrol'> |
|
|
|
{/* { |
|
|
@ -886,23 +890,28 @@ const Index = () => { |
|
|
|
} |
|
|
|
</View> |
|
|
|
} |
|
|
|
{/* { |
|
|
|
{ |
|
|
|
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} |
|
|
|
/> |
|
|
|
{ |
|
|
|
video != '' ? <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} |
|
|
|
/> : '' |
|
|
|
} |
|
|
|
|
|
|
|
{ |
|
|
|
!isView ? <AtButton type='secondary' size='small' onClick={addVideo}>添加视频</AtButton> : '' |
|
|
|
} |
|
|
|
|
|
|
|
<AtButton type='secondary' size='small' onClick={addVideo}>添加视频</AtButton> |
|
|
|
</view> |
|
|
|
} */} |
|
|
|
} |
|
|
|
{ |
|
|
|
isView ? |
|
|
|
isSuperAdmin && |
|
|
|