<!--shoppingGuid/page/pages/home/home.wxml-->
<!-- 常用工具 -->
<view class='top-items'>
  <view class='header'>常用工具</view>
  <view class='tools-items'>
    <view class='tools-item' bindtap='onTapToMall'>
      <image src='https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/7_3_0/icon_mall.png' mode='aspectFit'></image>
      <view class='tool-name'>官方商城</view>
    </view>
    <view class='tools-item' bindtap='onTapToTaskCenter'>
      <image src='https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/7_3_0/icon_task.png' mode='aspectFit'></image>
      <view class='tool-name'>任务中心</view>
    </view>
    <view class='tools-item' bindtap='onTapToMember'>
      <image src='https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/7_3_0/icon_member_center.png' mode='aspectFit'></image>
      <view class='tool-name'>会员中心</view>
    </view>
    <view class='tools-item' bindtap='onTapScanQrcode'>
      <image src='https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/7_3_0/icon_scan_qrcode.jpg' mode='aspectFit'></image>
      <view class='tool-name'>扫码核销</view>
    </view>
  </view>
</view>
<!-- 整体布局 -->
<view class='main-container'>
  <!-- 优惠券 -->
  <view class='mg-b-40'>
    <view class='header'>优惠券</view>
    <view class='status-bar'>
      <view class='status-items'>
        <view 
        class='status-bar-item {{item.active ? "active" : ""}}'
        wx:for="{{coupon.couponTypeArr}}"
        wx:for-item="item"
        bindtap='onTapChangeCouponType'
        wx:for-index="idx"
        wx:key="coupon{{idx}}"
        data-index="{{idx}}">{{item.name}}</view>
      </view>
      <view class='more-data' bindtap='onTapToCouponList'>
        <label>更多</label>
        <image src='/assets/imgs/arrow-right-sku.png' mode='aspectFit'></image>
      </view>
    </view>
    <!-- list -->
    <view class='coupon-list' wx:if="{{coupon.couponList.length > 0}}">
      <view class='coupon-list-item' 
      wx:for="{{coupon.couponList}}"
      wx:for-index="idx"
      wx:for-item="item"
      wx:key="coupon{{idx}}">
        <view class='top'>
          <image src='{{item.couponBg}}' mode='aspectFit' data-item="{{item}}" bindtap='onTapShowQrcode'></image>
          <view class='coupon-name'>{{item.title}}</view>
        </view>
        <view class='center' data-item="{{item}}" bindtap='onTapToSendConpon'>定向发券</view>
        <view class='bottom' data-item="{{item}}" bindtap='onTapToSendByGroup'>群发推荐</view>
      </view>
    </view>

    <!-- empty -->
    <!-- <view class='empty' wx:if="{{coupon.couponList.length == 0}}">商家还未设置优惠券哦~</view> -->
    <empty text="商家还未设置优惠券哦~" wx:else/>

  </view>
  <!-- 爆款推荐 -->
  <view class='mg-b-40'>
    <view class='header'>爆款推荐</view>
    <view class='status-bar'>
      <view class='status-items'>
        <view class='status-bar-item {{item.active ? "active" : ""}}'
        wx:for="{{goods.goodsTypeArr}}"
        wx:for-item="item"
        bindtap='onTapChangeGoodsType'
        wx:for-index="idx"
        wx:key="goods{{idx}}"
        data-index="{{idx}}">{{item.name}}</view>
      </view>
      <view class='more-data' bindtap='onTapToMoreProducts'>
        <label>更多</label>
        <image src='/assets/imgs/arrow-right-sku.png' mode='aspectFit'></image>
      </view>
    </view>
    <!-- list -->
    <view class='goods-list' wx:if="{{goods.goodsList.length > 0}}">
      <view class='goods-item'
      wx:for="{{goods.goodsList}}"
      wx:for-item="item"
      wx:for-index="idx"
      wx:key="goodslist{{idx}}"
      data-index="{{idx}}">
        <image class='goods-lf-icon' src='{{item.productImgUrl}}' mode='aspectFit'></image>
        <view class='goods-rg-info'>
          <view class='goods-title'>{{item.productName}}</view>
          <view class='goods-second-title'>这个是商品的描述</view>
          <view class='goods-price'>
            <view class='price'>
              <view class='plus'>
                <image src='/assets/imgs/point.png' mode='aspectFit'></image>
                <text>{{item.point}}</text>
              </view>
              <view class='original-price'>￥126.08</view>
            </view>
            <view class='goods-share'>
              <view class='send-coupon' data-item="{{item}}" bindtap='onTapToShare'>定向发送</view>
              <view class='send-coupon' data-item="{{item}}" bindtap='onTapToRecommandProduct'>群发推荐</view>
            </view>
          </view>
        </view>
      </view>
    </view>
    <empty text="商家暂无推荐商品~" wx:else/>
  </view>
  <!-- 招募榜 -->
  <view class='rank-container'>
    <view class='top-filter'>
      <view class='half-item {{item.isActive ? "active" : ""}}' 
      wx:for="{{navBar}}"
      wx:for-item="item"
      wx:key="topbar{{idx}}"
      wx:for-index="idx"
      bindtap='onTopBarTap'
      data-index="{{idx}}"
      data-item="{{item}}"
      >{{item.name}}</view>
    </view>
    <view class='rank-title'>
      <image class='top20' src='/assets/imgs/shoppingGuide/home_top20.png' mode='aspectFit'></image>
      <!-- <view class='rank-more'>更多点击查看更多></view> -->
    </view>
    <!-- 招募榜 -->
    <view wx:if="{{current == 1}}">
      <view class='rank-list' wx:if="{{rankList.length}}">
        <block wx:for="{{rankList}}" wx:key="{{index}}" wx:for-item="item">
          <view class='rank-item'>
            <image class='u-logo' src='{{item.member.avatar? item.member.avatar : defaultAvatar}}' mode='aspectFit'></image>
            <view class='rank-u-info'>
              <text>{{item.member.qiyeInfo.name}}</text>
              <view>已招募<label class='main-color'>{{item.recruitCount}}</label>位</view>
            </view>
          </view>
        </block>
      </view>
      <empty text="{{loadingText}}" wx:else/>
      <!-- <view class="no-list" wx:else>{{loadingText}}</view> -->
    </view>
    <!-- 门店榜 -->
    <view wx:if="{{current == 2}}">
      <view class='rank-list' wx:if="{{storeList.length}}">
        <block wx:for="{{storeList}}" wx:key="{{index}}" wx:for-item="item">
          <view class='rank-item'>
            <image class='u-logo' src='{{item.member.avatar? item.member.avatar : defaultAvatar}}' mode='aspectFit'></image>
            <view class='rank-u-info'>
              <text>{{item.store.name}}</text>
              <view>已招募<label class='main-color'>{{item.recruitCount}}</label>位</view>
            </view>
          </view>
        </block>
      </view>
      <empty text="{{loadingText}}" wx:else/>
      <!-- <view class="no-list" wx:else>{{loadingText}}</view> -->
    </view>
  </view>
</view>
<!-- 分享 -->
<!-- 分享好友 -->
<view class='bg' style='display:{{showModal ? "block" : "none"}}' bindtap='onTapCancelShare'></view>
<view class='share-container {{showModal ? "sliderUp" : ""}}'>
  <button open-type="share">
    <view class='share-item'>
        <image src='/assets/imgs/7_1_0/wx-icon.png' mode='aspectFit'></image>
        <text>微信好友</text>
    </view>
  </button>
</view>
<!-- 整体布局 -->
<!-- tabbar -->
<tab-bar index="{{2}}" />