<!--index.wxml-->
<navigation-bar title="首页" back="{{false}}" color="black" background="#FFF"></navigation-bar>
<view class="page-wrapper">
  <scroll-view class="scrollarea" scroll-y type="list">
    <!-- 轮播图部分 -->
    <view class="swiper-container">
      <swiper 
        class="banner" 
        indicator-dots="{{true}}" 
        indicator-color="rgba(255,255,255,0.5)"
        indicator-active-color="#ffffff"
        autoplay="{{true}}" 
        interval="{{3000}}" 
        duration="{{500}}" 
        circular="{{true}}">
        <block wx:for="{{bannerList}}" wx:key="index">
          <swiper-item>
            <image 
              class="banner-image" 
              lazy-load="{{true}}" 
              src="{{item.imageUrl}}" 
              mode="aspectFill" 
              binderror="onImageError" 
              data-index="{{index}}">
            </image>
            <!-- 轮播图标题 -->
            <view class="banner-title">{{item.title || '轮播图 ' + (index + 1)}}</view>
          </swiper-item>
        </block>
      </swiper>
    </view>
    <view class="container">
      <!-- 单篇文章展示 -->
      <view class="article-section">
        <view class="article-header">
          <text class="article-title">{{article.title}}</text>
          <text class="article-time">{{formatDate}}</text>
        </view>
        <view class="article-content">
          <rich-text nodes="{{article.content}}"></rich-text>
        </view>
      </view>      </view>
  </scroll-view>
</view>
