index.wxml 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <wxs module="_">
  2. module.exports.active = function (lastId, id) {
  3. return lastId === id;
  4. }
  5. module.exports.show = function (message, component) {
  6. return message && message.component === component;
  7. }
  8. </wxs>
  9. <!--module/chats/pages/index/index.wxml-->
  10. <view class="chats-container">
  11. <t-navbar title="对话管家" />
  12. <scroll-view
  13. id="scrollview"
  14. class="page-scroll__container"
  15. type="list"
  16. scroll-y
  17. enhanced="{{true}}"
  18. enable-passive
  19. scroll-into-view="{{lastId}}"
  20. scroll-into-view-alignment="end"
  21. style="height: calc(100vh - 180rpx); padding-bottom:{{paddingBottom}}rpx;"
  22. >
  23. <view class="system-wrapper">
  24. <view class="date">{{date}}</view>
  25. <view class="title">对话管家 已进入聊天</view>
  26. </view>
  27. <block wx:for="{{messages}}" wx:key="id">
  28. <chat-guide wx:if="{{(_.show(item, 'guide') && isShowGuide)}}" id="{{item.id}}" active="{{_.active(lastId, item.id)}}" bind:next="handle" bind:to="scrollIntoView" bind:nextType="nextType" bind:getCount="getCount" analysisCount="{{analysisCount}}" />
  29. <chat-questionnaire wx:if="{{_.show(item, 'questionnaire') && messageType}}" id="{{item.id}}" active="{{_.active(lastId, item.id)}}" bind:next="handle"
  30. bind:to="scrollIntoView" bind:nextType="nextType" messageType="{{messageType}}" workId="{{id}}" bind:boxBottom="boxBottom" />
  31. </block>
  32. <!-- 固定底部锚点,便于 lastId='bottom' 时稳定滚动到最底部 -->
  33. <view id="bottom" style="height: 1rpx;"></view>
  34. </scroll-view>
  35. <view class="tabbar-container">
  36. <tabbar tabbarValue="{{tabbarValue}}"></tabbar>
  37. </view>
  38. </view>