index.jsx 754B

12345678910111213141516171819202122232425
  1. import { Video } from '@tarojs/components';
  2. import { compressImage } from '@/utils'
  3. import './style.less'
  4. export default (props) => {
  5. const { item } = props
  6. return (
  7. <>
  8. {
  9. item.contentType == 'image' ?
  10. <image src={compressImage(item.content)} mode='widthFix' style={{ width: '100%' }} className='image-content' /> :
  11. item.contentType == 'text' ?
  12. <view style={{ marginBottom: '5px' }}>
  13. <view className='storezn'>{item.content}</view>
  14. </view>
  15. :
  16. <Video
  17. controls
  18. autoplay={false}
  19. loop={false}
  20. muted={false} style={{ width: "100%", height: '200px' }} src={item.content}></Video>
  21. }
  22. </>
  23. )
  24. }