<wxs module="_">
  module.exports.active = function (lastId, id) {
    return lastId === id;
  }
  module.exports.show = function (message, component) {
    return message && message.component === component;
  }
</wxs>
<!--module/chats/pages/index/index.wxml-->
<t-navbar title="对话管家" left-arrow />
<scroll-view id="scrollview" class="page-scroll__container" style="{{containerStyle}}" type="list" scroll-y enhanced="{{true}}" enable-passive scroll-into-view="{{lastId}}" scroll-into-view-alignment="end">
  <block wx:for="{{messages}}" wx:key="id">
    <chat-guide wx:if="{{_.show(item, 'guide')}}" id="{{item.id}}" active="{{_.active(lastId, item.id)}}" bind:next="handle" bind:to="scrollIntoView" />
    <chat-questionnaire wx:if="{{_.show(item, 'questionnaire')}}" id="{{item.id}}" active="{{_.active(lastId, item.id)}}" bind:next="handle" bind:to="scrollIntoView" />
  </block>
</scroll-view>