Browse Source

(*)添加视频

dev
ww664853070 2 years ago
parent
commit
40a49100b2
  1. 21
      weapp/src/packages/patrol/index.jsx

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

@ -571,7 +571,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}`,
@ -580,7 +583,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' })
}
@ -589,6 +592,7 @@ const Index = () => {
}
})
}
console.log(isView, '============');
return (
<View className='patrol'>
{/* {
@ -885,10 +889,11 @@ const Index = () => {
}
</View>
}
{/* {
{
videoShow ? '' :
<view>
<Video
{
video != '' ? <Video
style={{ width: '90%', marginLeft: '-45%', left: '50%', marginBottom: 20 }}
src={video}
poster='../../static/img/date.png'
@ -897,11 +902,15 @@ const Index = () => {
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 &&

Loading…
Cancel
Save