12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. import { Image } from '@tarojs/components'
  2. import Taro from '@tarojs/taro'
  3. import '@/assets/css/iconfont.css'
  4. import './index.scss'
  5. const TipsList = [
  6. {name: '官方保障', icon: 'icon-baozhang'},
  7. {name: '免费咨询', icon: 'icon-zixun'},
  8. {name: '户型解读', icon: 'icon-jiedu'},
  9. {name: '贴心服务', icon: 'icon-tiexin'}
  10. ]
  11. export default function PropertyConsultant (props) {
  12. const { Info } = props
  13. const List = Info?.consultants || []
  14. const CallPhone = (phone) => { // 拨打电话
  15. Taro.makePhoneCall({ phoneNumber: phone })
  16. }
  17. const handleMore = () => {
  18. Taro.navigateTo({
  19. url: `/pages/index/buildingPropertyConsultant/index?buildingId=${Info?.buildingId}`
  20. })
  21. }
  22. const handleChat = (item) => {
  23. Taro.navigateTo({
  24. url: `/pages/chat/chatDetail/index?friend=${item.id}`
  25. })
  26. }
  27. const gotoDetail = (item) => {
  28. Taro.navigateTo({
  29. url: `/subpackages/pages/consultant/myHomepage/index?id=${item.id}`
  30. })
  31. }
  32. return List.length > 0 ? (
  33. <view className='components PropertyConsultant'>
  34. <view className='Title flex-h'>
  35. <view className='flex-item'>
  36. <text>置业顾问</text>
  37. </view>
  38. <text onClick={handleMore}>更多</text>
  39. <text className='iconfont icon-jiantouright'></text>
  40. </view>
  41. <view className='TipsList flex-h'>
  42. {
  43. TipsList.map((item, index) => (
  44. <view className='flex-item' key={`TipsItem-${index}`}>
  45. <text className={`iconfont ${item.icon}`}></text>
  46. <text>{item.name}</text>
  47. </view>
  48. ))
  49. }
  50. </view>
  51. <view className='PersonList'>
  52. {
  53. List.map((item, index) => (
  54. <view key={`PersonItem-${index}`} className='flex-h'>
  55. <view className='Icon' onClick={() => gotoDetail(item)}>
  56. <Image mode='aspectFill' src={item.photo || item.avatarurl || item.avatar || item.picture}></Image>
  57. </view>
  58. <view className='flex-item' onClick={() => gotoDetail(item)}>
  59. <text>{item.userName}</text>
  60. <text>{item.description || ''}</text>
  61. </view>
  62. <text className='iconfont icon-liaotian Chat' onClick={() => handleChat(item)}></text>
  63. <text className='iconfont icon-dianhua Phone' onClick={() => CallPhone(item.phone || item.tel)}></text>
  64. </view>
  65. ))
  66. }
  67. </view>
  68. </view>
  69. ) : null
  70. }