<!--packageI/warehouseFarm/warehouseFarmIndex/warehouseFarmIndex.wxml-->
<view id="warehouse-farm-index">
  <view class="main">
    <view class="member-info absolute-cell " wx:if="{{info.name}}">
      <image src="{{info.name.avatar || ''}}" alt=""></image>
      <view class="nickname">{{ info.name.nickname || "" }}</view>
    </view>
    <!-- 右侧侧边栏 -->
    <view class="right-nav-list absolute-cell flex-column">
      <view class="nav-item-img" catchtap="openPopup" data-tag="showDynamic" data-set="true">
        <image src="https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/warehouse-farm/dynamic.png" alt="" mode="widthFix" />
        <view class="text">动态</view>
      </view>
      <view class="nav-item-img" catchtap="openPopup" data-tag="showRank" data-set="true">
        <image src="https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/warehouse-farm/rank.png" alt="" mode="widthFix" />
        <view class="text">好友排行</view>
      </view>
      <view class="nav-item-img" catchtap="toUrl"
        data-url="/packageA/member/myOrder_v2/myOrder_v2" data-status="0" data-orderType="warehouseTakeDelivery">
        <image src="https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/warehouse-farm/record.png" alt="" mode="widthFix" />
        <view class="text">提货记录</view>
      </view>
    </view>
    <!-- 左侧侧边栏 -->
    <view class="left-nav-list absolute-cell flex-column">
      <view class="nav-item-img" catchtap="openPopup" data-tag="showAnnouncement" data-set="true">
        <image src="https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/warehouse-farm/announcement.png" alt="" mode="widthFix" />
        <view class="text">公告</view>
      </view>
    </view>
    <!-- 底部侧边栏 -->
    <view class="bottom-nav-list">
      <view class="nav-item-img" catchtap="toUrl"
        data-url="/packageI/warehouseFarm/warehouseFarmBuyGift/warehouseFarmBuyGift">
        <image src="https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/warehouse-farm/Gift-box.png" alt="" mode="widthFix" />
        <view class="text text-color-1">买礼盒</view>
      </view>
      <view class="nav-item-img" catchtap="toUrl"
        data-url="/packageI/warehouseFarm/warehouseFarmGift/warehouseFarmGift">
        <image src="https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/warehouse-farm/gift.png" alt="" mode="widthFix" />
        <view class="text text-color-2">送礼物</view>
      </view>
      <view class="nav-item-img" catchtap="toUrl"
        data-url="/packageI/warehouseFarm/warehouseFarmExtract/warehouseFarmExtract">
        <image src="https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/warehouse-farm/receive.png" alt="" mode="widthFix" />
        <view class="text text-color-3">提礼物</view>
      </view>
    </view>
    <!-- 栏杆、房屋背景 -->
    <!-- <view class="railing-bg left-railing absolute-cell"></view>
    <view class="railing-bg right-railing absolute-cell"></view> -->
    <!--  -->
    <view class="icon-box" wx:for="{{iconOption}}"
      style=" bottom: {{item.bottom}}; left: {{item.left}}; right: {{item.right}};" catchtap="toUrl"
      data-url="/packageI/warehouseFarm/warehouseFarmBuyGift/warehouseFarmBuyGift" data-id="{{info.types[index].id}}">
      <image src="{{item.icon}}" alt="" style=" width: {{ item.width }}" mode="widthFix" />
      <view class="text-box" wx:if="{{info.types && info.types[index]}}"
        style="top: {{ item.text == 'top' ? item.textTop : 'auto'}}; bottom: {{ item.text == 'bottom' ? '-0.5rem' : 'auto' }}">
        <view class="name">{{ info.types[index].name }}库存</view>
        <view class="num" wx:if="{{info.types[index].nums_all > 0}}">{{ info.types[index].nums_all }}</view>
      </view>
    </view>
  </view>

  <van-popup show="{{showAnnouncement}}" round closeable close-icon="close" bind:close="openPopup"
    data-tag="showAnnouncement" data-set="{{false}}">
    <view class="announcement-box">
      <view class="title">公告</view>
      <block wx:if="{{!info.announcement}}">暂无公告内容 ~</block>
      <view class="content"><mp-html content="{{info.announcement}}" /></view>
    </view>
  </van-popup>
  <van-popup show="{{showDynamic}}" bind:close="openPopup" data-tag="showDynamic" data-set="{{false}}" closeable
    close-icon="close" position="bottom" custom-style="background-color: transparent">
    <view class="dynamic-box">
      <view class="title">动态</view>
      <view class="content">
        <scroll-view scroll-y='true' refresher-triggered='{{dynamic_refreshing}}' data-tag="dynamic_"
          style="height:380px" refresher-enabled='{{true}}' bindrefresherrefresh='RefreshList'
          bindscrolltolower='LoadList'>
          <view class="dynamic-list flex-column" wx:for="{{dynamic_list}}">
            <view class="time">{{ item.created_at }}</view>
            <view class="text">{{ item.dynamic_state }}</view>
          </view>
          <view class="circle-left todayDynamic-box" wx:if="{{todayDynamic.length > 0}}">
            <view class="data-circle">今天</view>
            <view class="dynamic-list flex-column" wx:for="{{todayDynamic}}">
              <view class="time">{{ item.created_at }}</view>
              <view class="text">{{ item.dynamic_state }}</view>
              <view class="chip"></view>
            </view>
          </view>
          <view class="circle-left beforeDynamic-box">
            <view class="data-circle">更早</view>
            <view class="dynamic-list flex-column" wx:for="{{beforeDynamic}}">
              <view class="time">{{ item.created_at }}</view>
              <view class="text">{{ item.dynamic_state }}</view>
              <view class="chip"></view>
            </view>
          </view>
          <view wx:if="{{beforeDynamic.length==0&&todayDynamic.length==0}}" style="padding: 50px 0;">暂无数据 ~</view>
        </scroll-view>
      </view>
    </view>
  </van-popup>
  <van-popup show="{{showRank}}" bind:close="openPopup" data-tag="showRank" data-set="{{false}}" closeable
    close-icon="close" position="bottom" custom-style="background-color: transparent">
    <view class="rank-box">
      <view class="title">好友排行</view>
      <view class="content">
        <scroll-view scroll-y='true' refresher-triggered='{{rank_refreshing}}' data-tag="rank_" style="height:380px"
          refresher-enabled='{{true}}' bindrefresherrefresh='RefreshList' bindscrolltolower='LoadList'>
          <view class="rank-list self-bg-color" wx:if="{{rank_self}}">
            <view class="rank-num">
              <view>{{ rank_self.rank }}</view>
            </view>
            <view class="rank-conten">
              <view class="img">
                <image src="{{rank_self.avatar}}" alt="" />
              </view>
              <view class="member-info flex-column">
                <view class="nickname">自己</view>
                <view class="total">总库存：{{ rank_self.stock || "0" }}</view>
              </view>
            </view>
          </view>
          <view class="rank-list " wx:for="{{rank_list}}">
            <view class="rank-num">
              <view wx:if="{{index == 0}}">
                <image class="medal" mode="widthFix" src="https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/gold_medal.png" alt="" />
              </view>
              <view wx:if="{{index == 1}}">
                <image class="medal" mode="widthFix" src="https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/silver_medal.png" alt="" />
              </view>
              <view wx:if="{{index == 2}}">
                <image class="medal" mode="widthFix" src="https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/copper_medal.png" alt="" />
              </view>
              <view wx:if="{{index > 2}}">{{ index + 1 }}</view>
            </view>
            <view class="rank-conten">
              <view class="img">
                <image src="{{item.avatar}}" alt="" />
              </view>
              <view class="member-info flex-column">
                <view class="nickname">{{ item.nickname }}</view>
                <view class="total">总库存：{{ item.nums }}</view>
              </view>
            </view>
          </view>
          <view wx:if="{{rank_list.length==0}}" style="padding: 50px 0;">暂无数据 ~</view>
        </scroll-view>
      </view>
    </view>
  </van-popup>

  <van-popup show="{{showReward}}" class="van-popup-transparent" close-on-click-overlay="{{false}}"
    custom-style='background-color: transparent'>
    <view class="reward-box rollback" wx:if="{{showReward}}">
      <image class="avatar" src="{{gift.avatar || ''}}" alt="" />
      <view class="nickname">{{ gift.nickname || "---" }}</view>
      <view class="reward-text">{{ gift.msg ? gift.msg : "给你发来了一个" }}</view>
      <image wx:if="{{!gift.msg}}" class="open-reward" data-url="/packageI/warehouseFarm/warehouseFarmGiftDetail/warehouseFarmGiftDetail"
        data-mode="give" data-id="{{markid}}" catchtap="toUrl"
        src="https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/warehouse-farm/open-reward.png" alt="" />
    </view>
    <view class="iconfont icon-close11 clone-reward-btn" catchtap="cloneReward"></view>
  </van-popup>
</view>