<wxs module="_">
  module.exports.active = function (lastId, id) {
    return lastId === id;
  }
  module.exports.show = function (message, type) {
    return message && message.type === type
  }
</wxs>
<!--module/chats/components/questionnaire/questionnaire.wxml-->
<block wx:for="{{messages}}" wx:key="id">
  <message-system wx:if="{{_.show(item,'system')}}" active="{{_.active(lastId,item.id)}}" id="{{item.id}}" payload="{{item.payload}}" bind:next="handle" />
  <message-analysis wx:if="{{_.show(item,'analysis')}}" active="{{_.active(lastId,item.id)}}" id="{{item.id}}" payload="{{item.payload}}" bind:next="handle" />
  <message-select wx:elif="{{_.show(item,'select')}}" active="{{_.active(lastId,item.id)}}" id="{{item.id}}" payload="{{item.payload}}" bind:next="handle" />
  <message-text wx:elif="{{_.show(item,'text')}}" active="{{_.active(lastId,item.id)}}" id="{{item.id}}" payload="{{item.payload}}" bind:next="handle" />
  <message-report wx:elif="{{_.show(item,'report')}}" active="{{_.active(lastId,item.id)}}" id="{{item.id}}" payload="{{item.payload}}" bind:next="handle" />
</block>