1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. import Taro from '@tarojs/taro'
  2. import { Image } from '@tarojs/components'
  3. import { getImgURL } from '@/utils/image'
  4. import './style.scss'
  5. export default (props) => {
  6. const { Data = {} } = props
  7. const goto = (it) => {
  8. Taro.navigateTo({
  9. url: `/pages/index/buildingDetail/index?id=${it.buildingId}`
  10. })
  11. }
  12. return (
  13. <view className='components ProjectItemCard'>
  14. <view className='Img' onClick={() => goto(Data)}>
  15. <Image mode='scaleToFill' src={getImgURL(Data?.buildingListImg?.length ? Data.buildingListImg[0].url : null)} className='centerLabel'></Image>
  16. {
  17. Data.panoramaList.length > 0 &&
  18. <Image mode='heightFix' className='Tips Vr' src={require('@/assets/index-icon18.png')} />
  19. }
  20. {
  21. Data.videoUrl !== null &&
  22. <Image mode='heightFix' className='Tips Video' src={require('@/assets/index-icon19.png')} />
  23. }
  24. </view>
  25. <view className='Name flex-h' onClick={() => goto(Data)}>
  26. <view className='flex-item'>
  27. <text>{Data.buildingName}</text>
  28. </view>
  29. <text></text>
  30. <text>{Data.price || '价格待定'}</text>
  31. </view>
  32. <text className='Address' onClick={() => goto(Data)}>{Data.address}</text>
  33. <view className='Tag' onClick={() => goto(Data)}>
  34. {
  35. (Data.buildingTag || []).map(x => x.tagName).slice(0, 6).map((x) => (<text key={x}>{x}</text>))
  36. }
  37. </view>
  38. <view className='Views flex-h' onClick={() => goto(Data)}>
  39. <view className='flex-item'>
  40. <text className='iconfont icon-fenxiang'></text>
  41. <text>{`${Data.shareList?.total || 0} 次分享`}</text>
  42. </view>
  43. {
  44. (Data.uvList?.length || 0) > 0 && (
  45. <view className='Icons'>
  46. {
  47. Data.uvList.map((x) => (
  48. <view key={x.uvId}>
  49. <Image mode='scaleToFill' src={getImgURL(x.photoOravatar)} className='centerLabel'></Image>
  50. </view>
  51. ))
  52. }
  53. </view>
  54. )
  55. }
  56. <text>{`...${Data.uvList?.length || 0}人围观`}</text>
  57. </view>
  58. {props.children}
  59. </view>
  60. )
  61. }