<!--packageC/o2o/openGroupList/openGroupList.wxml-->
<wxs src="../../../utils/timeTranslate.wxs" module="timeTranslate"></wxs>
<view id="open_group_list">
  <van-nav-bar title="开团列表" right-text="筛选"  bind:click-right="onClickRight" />
  <view class="list">
    <view class="list-child" wx:for="{{list}}">
      <view class="top-box">
        <view class="Numbering">编号：{{ item.id }}</view>
        <view class="status-name">{{ item.status_message }}</view>
      </view>
      <view class="member-info">
        <image src="{{item.avatar}}" alt="" class="avtor" />
        <view class="member-name">{{ item.nickname }}</view>
      </view>
      <view class="activity-time">起止时间：{{ timeTranslate.timestampToTime(item.start_time) }} 至
        {{ timeTranslate.timestampToTime(item.end_time) }}</view>
      <view class="grouping">
        <view class="buy-info" bindtap="toDetail" data-id="{{item.id}}">
          <view class="buy-img" wx:for="{{item.has_many_team_member}}" wx:for-item="itemName">
            <image src="{{itemName.has_one_member.avatar_image}}" alt="" />
          </view>
          {{ item.member_num }}人团 还差<em
            style="color:#f14e4e">{{item.member_num-item.has_many_success_member_count}}</em>人 <icon
            class="iconfont icon-member_right"></icon>
        </view>
        <view class="group-countDown">剩余：
          <van-count-down time="{{ timeTranslate.timestampToDIF(item.end_time)}}" format="DD 天 HH 时 mm 分 ss 秒" />
        </view>
      </view>
      <view class="operate-box" wx:if="{{item.status != 3}}">
        <view class="operate-child" bindtap="clickShare" data-id="{{ item.id }}" data-title="{{ item.has_one_group.title }}" data-img="{{ item.has_one_group.has_one_goods.thumb }}">
          <icon class="iconfont icon-share"></icon>
          分享好友
        </view>
        <view class="operate-child line" wx:if="{{item.status == 0 || item.status == 1}}" bindtap="changeEndTime" data-id="{{item.id}}" data-endtime="{{item.end_time}}">
          <icon class="iconfont icon-seller-time"></icon>
          修改时间
        </view>
        <view class="operate-child line" bindtap="virtualTeam" data-id="{{item.id}}" wx:if="{{item.status == 0 || item.status == 1}}">
          <icon class="iconfont icon-fontclass-kehu"></icon>
          虚拟成团
        </view>
      </view>
    </view>
    <view wx:if="{{list.length==0}}" class="blank">暂无数据...</view>
  </view>

  <van-popup show="{{ showFilter }}" position="right" custom-style="height: 100%;width:70%;">
    <view class="filter-box">
      <van-search value="{{ leader_name }}" bind:search="confirm" bind:change="onChange" shape="round" background="#fff"
        placeholder="搜索团长昵称" />
      <view class="condition-name">层级</view>
      <view class="condition-list">
        <view class="condition-child {{member_num == item.member_num ? 'active-filter' : ''}}" wx:for="{{levels}}"
          wx:key='*this' data-num="{{item.member_num}}" bindtap="setMember_num">
          {{ item.member_num }}人团</view>
      </view>
      <view class="condition-name">拼团状态</view>
      <view class="condition-list">
        <view class="condition-child {{status === item.id ? 'active-filter' : ''}}" wx:for="{{statuslist}}"
          wx:key='{{item.id}}' bindtap="setStatus" data-id="{{item.id}}">
          {{item.name}}</view>
      </view>

      <view class="filter-submit-box">
        <view class="filter-btn" bindtap="onClickRight">取消</view>
        <view class="filter-btn ok-bg" bindtap="confirm">确定</view>
      </view>
    </view>
  </van-popup>
  <van-popup show="{{ showDatetime }}" position="bottom" custom-style="">
    <van-datetime-picker
      type="datetime"
      value="{{ currentDate }}"
      bind:input="onInput"
      bind:confirm="confirmDate"
    />
  </van-popup>
  <van-share-sheet
    show="{{ showShare }}"
    title="分享好友"
    options="{{ options }}"
    bind:select="onSelect"
    bind:close="onClose"
  />
</view>