index.jsx 2.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. import '@/assets/css/iconfont.css'
  2. import Taro from '@tarojs/taro'
  3. import { Image } from '@tarojs/components'
  4. import { getImgURL } from '@/utils/image'
  5. import './index.scss'
  6. export default function ProjectListItem (props) {
  7. const { Data = {}, ShowImgIcon = true } = props
  8. const { uvList = [] } = Data
  9. return (
  10. <view className='components ProjectListItem flex-h' onClick={() => { Taro.navigateTo({ url: `/pages/index/buildingDetail/index?id=${Data.buildingId || Data.targetId}` }) }}>
  11. <view className='Img'>
  12. <view>
  13. <Image mode='aspectFill' className='centerLabel' src={getImgURL((Data?.buildingListImg || []).length ? Data.buildingListImg[0].url : Data.activityImg || null)} />
  14. {
  15. (Data?.panoramaList || []).length > 0 && ShowImgIcon &&
  16. <Image mode='heightFix' className='Tips Vr' src={require('@/assets/index-icon18.png')} />
  17. }
  18. {
  19. Data.videoUrl !== null && ShowImgIcon &&
  20. <Image mode='heightFix' className='Tips Video' src={require('@/assets/index-icon19.png')} />
  21. }
  22. </view>
  23. </view>
  24. <view className='flex-item'>
  25. <view className='Name flex-h'>
  26. <view className='flex-item'>
  27. <text>{Data.buildingName}</text>
  28. </view>
  29. <text></text>
  30. </view>
  31. <text className='Price'>{Data.price}</text>
  32. <text className='Address'>{Data.address}</text>
  33. <view className='Tags'>
  34. {
  35. (Data.buildingTag || []).map((item, index) => (
  36. <text key={`Tags-${index}`}>{item.tagName}</text>
  37. ))
  38. }
  39. </view>
  40. <view className='ShareInfo'>
  41. <text className='iconfont icon-fenxiang'></text>
  42. <text>{299 + (Data.shareNum || 0)}次分享</text>
  43. <view className='Users'>
  44. {
  45. (uvList?.records || []).slice(0, 3).map((item, index) => (
  46. <view key={`uv-${index}`}>
  47. <Image mode='aspectFill' className='centerLabel' src={item.photoOravatar} />
  48. </view>
  49. ))
  50. }
  51. </view>
  52. <text>{(uvList?.records || []).length > 0 ? '...' : ''}{299 + (Data.pvNum || 0)}人围观</text>
  53. </view>
  54. </view>
  55. </view>
  56. )
  57. }