chat.wxml 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <wxs src="/utils/util.wxs" module="tools"></wxs>
  2. <view>
  3. <scroll-view bindtap="closeText" scroll-y scroll-into-view='{{toView}}' refresher-threshold="{{80}}" refresher-enabled refresher-triggered="{{refer}}" bindrefresherrefresh="bindscrolltoupper" style='height: calc({{scrollHeight}});'>
  4. <!-- <view class='scrollMsg'> -->
  5. <block wx:key="index" wx:for='{{msgList}}'>
  6. <!-- 单个消息1 客服发出(左) -->
  7. <view class="sendTime" wx:if="{{item.showTime}}">
  8. {{tools.getDateDiff(now,item.sendTime)}}
  9. </view>
  10. <view wx:if='{{item.sendID==userID}}' id='msg-{{index}}' style='display: flex; padding: 2vw 11vw 2vw 2vw;'>
  11. <view style='width: 11vw; height: 11vw;'>
  12. <image style='width: 11vw; height: 11vw; border-radius: 10rpx;' src='{{faceurl}}'></image>
  13. </view>
  14. <block wx:if="{{item.contentType==102}}">
  15. <view style='width: 4vw; height: 11vw; margin-left: 0.5vw; display: flex; align-items: center; z-index: 9;'>
  16. <image style='width: 4vw;' src='http://ro7r875ut.hn-bkt.clouddn.com/left.png' mode='widthFix'></image>
  17. </view>
  18. <image class='leftMsgPic' src="{{item.content.sourcePicture.url}}" mode="scaleToFill" data-src='{{item.content.sourcePicture.url}}' bindtap='previewImage' />
  19. </block>
  20. <block wx:else="">
  21. <view style='width: 4vw; height: 11vw; margin-left: 0.5vw; display: flex; align-items: center; z-index: 9;'>
  22. <image style='width: 4vw;' src='http://ro7r875ut.hn-bkt.clouddn.com/left.png' mode='widthFix'></image>
  23. </view>
  24. <view class='leftMsg'>{{item.content}}</view>
  25. </block>
  26. </view>
  27. <!-- 单个消息2 用户发出(右) -->
  28. <view wx:else id='msg-{{index}}' style='display: flex; justify-content: flex-end; padding: 2vw 2vw 2vw 11vw;'>
  29. <block wx:if="{{item.contentType==102}}">
  30. <image class='rightMsgPic' src="{{item.content.sourcePicture.url}}" mode="scaleToFill" data-src='{{item.content.sourcePicture.url}}' bindtap='previewImage' />
  31. <view style='width: 4vw; height: 11vw; margin-right: 0.5vw; display: flex; align-items: center; z-index: 9;'>
  32. <image style='width: 4vw;' src='http://ro7r875ut.hn-bkt.clouddn.com/right.png' mode='widthFix'></image>
  33. </view>
  34. </block>
  35. <block wx:elif="{{item.contentType==108}}">
  36. <view class="house_link rightMsgPic" data-data="{{item.content}}" bindtap="goHouse">
  37. <image class="house_link_pic" src="{{item.content.data[0].house_pic[0]}}" />
  38. <view class="house_link_box">
  39. <text class="garden_name">{{item.content.data[0].garden_name}}</text>
  40. <text class="areatext" space="nbsp">{{item.content.data[0].room_count}}室 {{item.content.data[0].hall_count}}厅 /{{item.content.data[0].room_area}}m² /{{direction[item.content.data[0].direction]}}</text>
  41. <text class="house_price">{{item.content.data[0].rent_price/100}}元</text>
  42. </view>
  43. </view>
  44. <view style='width: 4vw; height: 11vw; margin-right: 0.5vw; display: flex; align-items: center; z-index: 9;'>
  45. <image style='width: 4vw;' src='http://ro7r875ut.hn-bkt.clouddn.com/right.png' mode='widthFix'></image>
  46. </view>
  47. </block>
  48. <block wx:else="">
  49. <view class='rightMsg'>{{item.content}}</view>
  50. <view style='width: 4vw; height: 11vw; margin-right: 0.5vw; display: flex; align-items: center; z-index: 9;'>
  51. <image style='width: 4vw;' src='http://ro7r875ut.hn-bkt.clouddn.com/right.png' mode='widthFix'></image>
  52. </view>
  53. </block>
  54. <view style='width: 11vw; height: 11vw;'>
  55. <image style='width: 11vw; height: 11vw; border-radius: 10rpx;' src='{{avatar}}'></image>
  56. </view>
  57. </view>
  58. </block>
  59. <!-- </view> -->
  60. <!-- 占位 -->
  61. <!-- <view style='width: 100%; height: 18vw;'></view> -->
  62. </scroll-view>
  63. <view class='inputRoom' style='bottom: {{inputBottom}}rpx;height: calc(16vw + {{(lineCount-1)*9}}vw);'>
  64. <textarea show-confirm-bar="{{false}}" focus="{{focus}}" style="height: {{textareaHeight}}vw;" bindlinechange="bindlinechange" bindconfirm='sendClick' adjust-position='{{false}}' value='{{inputVal}}' confirm-type='send' bindfocus='focus' bindblur='blur' bindinput="bindinput" fixed></textarea>
  65. <block wx:if="{{isEmoji}}">
  66. <image style='width: 7vw; margin-left: 3.2vw;' src='/static/icon/icon_face.png' mode='widthFix' bindtap="openEmoji"></image>
  67. </block>
  68. <block wx:else="">
  69. <image style='width: 7vw; margin-left: 3.2vw;' src='/static/icon/icon_key.png' mode='widthFix' bindtap="closeEmoji"></image>
  70. </block>
  71. <block wx:if="{{inputVal}}">
  72. <text bindtap="sendClick" style='text-align: center;width: 12vw; margin-left: 2vw;padding: 1vw;background-color: #33b966;color: #fff;border-radius: 5px;'>发送</text>
  73. </block>
  74. <block wx:else="">
  75. <image style='width: 7vw; margin-left: 3.2vw;' src='/static/icon/icon_add.png' mode='widthFix' bindtap="{{isMore?'openMore':'closeMore'}}"></image>
  76. </block>
  77. </view>
  78. <view hidden="{{isEmoji}}">
  79. <scroll-view class='emoji_list' scroll-y="true" style="height: 200px;bottom: {{safeHeight}}rpx;">
  80. <text wx:for="{{emojiList}}" wx:key="index" class='emoji' bindtap="emojiInput" data-emoji="{{item}}">{{item}}</text>
  81. </scroll-view>
  82. </view>
  83. <view hidden="{{isMore}}">
  84. <view class="more_containt" style="height: 100px;bottom: {{safeHeight}}rpx;">
  85. <view class="more" bindtap="choicePhote">
  86. <view class="back">
  87. <image class="photoPic" src="/static/icon/icon_photo.png" />
  88. </view>
  89. <text class="back-font">照片</text>
  90. </view>
  91. <view class="more" bindtap="choiceCarema">
  92. <view class="back">
  93. <image class="photoPic" src="/static/icon/icon_camera.png" />
  94. </view>
  95. <text class="back-font">拍摄</text>
  96. </view>
  97. </view>
  98. </view>
  99. </view>