<view class="container">
  <!-- 首页顶部通知消息 -->
  <van-notice-bar scrollable="true" text="目前上架的商品均可直接下单购买，欢迎大家购买支持我的工作！" />

  <view class="HotName">今日推荐
    <text></text>
  </view>
  <view class="HotMark">唯爱与美食不可辜负</view>

  <view class="HotSwiper" style="margin-top:{{windowHeight/45}}px">
    <swiper circular="true" autoplay="true" interval="6000" duration="500" previous-margin="{{windowWidth/3.8}}rpx" next-margin="{{windowWidth/3.8}}rpx">
      <block wx:for-items="{{hotGoods}}" wx:key="{{id}}">
        <navigator url="/pages/goods/goods?id={{item.id}}">
          <swiper-item>
            <view class="swiper-box">
              <form bindsubmit="saveFormId" report-submit='true' class='form_class'>
                <button formType="submit" class='form_button'>
                  <image src="{{item.picUrl}}" mode="aspectFill" data-id="{{item.id}}" />
                </button>
              </form>
              <view class="swiper-box-info">
                <view class="name">{{item.name}}</view>
                <view class="price">
                  <view class="counterPrice" wx:if="{{item.counterPrice > item.retailPrice}}">原价：￥{{item.counterPrice}}</view>
                  <view class="retailPrice">现价：￥{{item.retailPrice}}</view>
                </view>
                <view class="capsule-tag" wx:if="{{item.isNew == true}}">
                  <zan-capsule color="#a78845" leftText="N" rightText="新 品" />
                </view>
                <view class="capsule-tag" wx:if="{{item.counterPrice > item.retailPrice}}">
                  <zan-capsule color="#b4282d" leftText="H" rightText="折 扣" />
                </view>
              </view>
            </view>
          </swiper-item>
        </navigator>
      </block>
    </swiper>
  </view>

  <view class="a-section a-groupon" wx:if="{{groupons.length > 0}}">
    <view class="h">
      <view class="title">
        <view>
          <navigator url="/pages/groupon/grouponList/grouponList">
            <text class="txt">优惠专区</text>
          </navigator>
        </view>
      </view>
    </view>
    <view class="b">
      <view class="item" wx:for="{{groupons}}" wx:for-index="index" wx:for-item="item" wx:key="id">
        <navigator url="/pages/goods/goods?id={{item.id}}">
          <image class="img" src="{{item.picUrl}}" background-size="cover"></image>
          <view class="right">
            <view class="text">
              <view class="header">
                <text class="name">{{item.name}}</text>
                <view class="capsule-tag">
                  <zan-capsule color="#a78845" leftText="{{item.grouponMember}}人成团" rightText="立减{{item.grouponDiscount}}" />
                </view>
              </view>
              <text class="desc">{{item.brief}}</text>
              <view class="price">
                <view class="counterPrice">原价：￥{{item.retailPrice}}</view>
                <view class="retailPrice">团购价：￥{{item.grouponPrice}}</view>
              </view>
            </view>
          </view>
        </navigator>
      </view>
    </view>
  </view>

  <view class="a-section a-new" wx:if="{{newGoods.length > 0}}">
    <view class="h">
      <view class="title">
        <navigator url="../newGoods/newGoods">
          <text class="txt">新品首发</text>
        </navigator>
      </view>
    </view>
    <goodList goods="{{newGoods}}"></goodList>
  </view>

  <view class="a-section a-brand">
    <view class="h">
      <view class="title">
        <navigator url="../brand/brand">
          <text class="txt">品牌制造商直供</text>
        </navigator>
      </view>
    </view>
    <view class="b">
      <view class="item item-1" wx:for="{{brands}}" wx:key="id">
        <navigator url="/pages/brandDetail/brandDetail?id={{item.id}}">
          <view class="wrap">
            <image class="img" src="{{item.picUrl}}" mode="aspectFill"></image>
            <view class="mt">
              <text class="brand">{{item.name}}</text>
            </view>
          </view>
        </navigator>
      </view>
    </view>
  </view>

  <view class="good-grid" wx:for="{{floorGoods}}" wx:key="id">
    <navigator url="/pages/category/category?id={{item.id}}" class="more-a">
      <view class="h" wx:if="{{item.goodsList.length > 0}}">
        <text>{{item.name}}</text>
      </view>
    </navigator>
    <goodList goods="{{item.goodsList}}"></goodList>
  </view>

  <view class="a-section a-topic" wx:if="topics.length > 0">
    <view class="h">
      <view class="title">
        <navigator url="/pages/topic/topic">
          <text class="txt">专题精选</text>
        </navigator>
      </view>
    </view>
    <view class="b">
      <scroll-view scroll-x class="list">
        <view class="item" wx:for="{{topics}}" wx:for-index="index" wx:for-item="item" wx:key="id">
          <navigator url="../topicDetail/topicDetail?id={{item.id}}">
            <image class="img" src="{{item.picUrl}}" background-size="cover"></image>
            <view class="np">
              <text class="name">{{item.title}}</text>
            </view>
            <text class="desc">{{item.subtitle}}</text>
          </navigator>
        </view>
      </scroll-view>
    </view>
  </view>

</view>