<wxs module="m1">
  var getDateFormat = function(time) {
    var objectDate = getDate(+time) ;
    var time = objectDate.getMinutes().toString();
    var seconds = objectDate.getSeconds().toString();
    var hours = objectDate.getHours().toString();
    var day = objectDate.getDate().toString();
    var month = (objectDate.getMonth() + 1).toString();
    var year = objectDate.getFullYear().toString();
    return year + '/' + (month.length === 1 ? '0' : '') + month + '/' + (day.length === 1 ? '0' : '') + day + ' ' + (hours.length === 1 ? '0' : '') + hours + ':' + (time.length === 1 ? '0' : '') + time + ':' + (seconds.length === 1 ? '0' : '') + seconds;
  }
  module.exports.getDateFormat = getDateFormat;
</wxs>
<view class="volc-live-portrait-image-card {{useDarkTheme ? 'volc-live-portrait-image-card-dark' : ''}}">
  <view wx:if="{{!iconList.length}}" class="no-content-wrapper">
    <image class="no-content-image" src="{{useDarkTheme ? '../../assets/no_content_dark.svg' : '../../assets/no_content.svg'}}"></image>
    <view class="no-content-text">暂无内容</view>
  </view>
  <view wx:else>
    <view class="image-text-count">
      共
      <view class="image-text-number">{{iconList.length || 0}}</view>
      条直播内容
    </view>
    <view
      wx:for="{{iconList}}"
      wx:for-index="index"
      wx:for-item="message"
      wx:key="ImageTextId"
      class="image-text-message image-text-timeline-message {{index === iconList.length - 1 ? 'image-text-message-last' : ''}}"
    >
      <view class="image-text-circle"></view>
      <view class="image-text-line"></view>
      <view class="image-text-item">
        <view class="image-text-item-header">
          <view class="create-time">{{m1.getDateFormat(message.CreateTime)}}</view>
        </view>
        <view class="image-text-item-content">
          <view
            wx:for="{{message.Context || []}}"
            wx:for-index="index"
            wx:for-item="item"
            wx:key="index"
            class="image-text-message {{item.renderType === 'image' && item.multiImages ? 'image-text-message-image-grid' : ''}}"
          >
            <view wx:if="{{item.renderType === 'text'}}" class="image-text-item-text">
              <block
                wx:for="{{item.segments}}"
                wx:for-item="segment"
                wx:for-index="segmentIndex"
                wx:key="segmentIndex"
              >
                <text
                  wx:if="{{segment.type === 'link'}}"
                  class="image-text-item-link"
                  data-url="{{segment.url}}"
                  data-text="{{segment.text}}"
                  bindtap="onTextLinkClick"
                >{{segment.text}}</text>
                <text wx:else>{{segment.text}}</text>
              </block>
            </view>
            <view
              wx:elif="{{item.renderType === 'image'}}"
              class="image-text-item-image {{item.multiImages ? 'image-text-item-image-multi' : ''}}"
              data-src="{{item.src}}"
              data-images="{{item.images}}"
              data-image-index="{{item.imageIndex}}"
              bindtap="previewImage"
            >
              <image src="{{item.src}}" mode="{{item.multiImages ? 'aspectFill' : 'aspectFit'}}" />
            </view>
            <card-item
              wx:else
              data-item="{{item}}"
              bind:onClick="onClick"
              icon="{{item.icon}}"
              text="{{item.text}}"
              describeText="{{item.describeText}}"
              title="{{item.title}}"
              buttonText="{{item.buttonText}}"
              buttonType="{{item.buttonType}}"
              useDarkTheme="{{useDarkTheme}}"
              showCountDown="{{item.showCountDown}}"
              current="{{item.current}}"
            />
          </view>
        </view>
      </view>
    </view>
    <view class="image-text-divider">没有更多内容了</view>
  </view>
</view>
