<!--packageC/o2o/o2oGroupActivitylist/o2oGroupActivitylist.wxml-->
<view id="o2oGroup_activitylist">
  <van-search value="{{ keywords }}" bind:search="onSearch"  bind:change="onChange" shape="round" background="#fff" placeholder="搜索活动标题" />
  <van-tabs active="{{ activeName }}" bind:click="tabClick">
    <van-tab title="{{items}}" wx:for="{{titleArr}}" wx:for-index="ind" wx:for-item="items">
      <view class="content" wx:if="{{dataList[ind].list.length>0}}">
        <view wx:for="{{dataList[ind].list}}"  bindtap="" class="li">
          <view class="list" >
            <view class="top-box">
              <view class="avtive-name" style="background-color:{{item.status == 1 ?'#ff9454':(item.status == 0 ? '#1bc187':'#949494')}}">{{ item.status == 0 ? '未开始' : item.status == 1 ? '活动中' : '已结束' }}</view>
              <view class="Numbering">编号：{{ item.id }}</view>
              <view class="edit-btn"  wx:if="{{item.status != 2}}" bindtap="editActivity" data-id="{{item.id}}"><icon class="iconfont icon-appointment_edite"></icon> 编辑</view>
            </view>
            <view class="activity">
              <view class="activity-title">{{ item.title }}</view>
              <view class="activity-box">
                <view class="activity-time">开始时间：{{ item.start_time }}</view>
                <view class="activity-end-btn" wx:if="{{item.status != 2}}" bindtap="endGrouplist" data-item="{{item}}" data-index="{{index}}">手动结束</view>
              </view>
            </view>
            <view class="goods-box">
              <image src="{{item.has_one_goods.thumb}}" alt="" />
              <view class="good-title">{{ item.has_one_goods.title }}</view>
            </view>
            <view class="operate-box">
              <view class="operate-child" bindtap="clickShare" data-item="{{ item }}">
                <icon class="iconfont icon-share"></icon>
                活动推广
              </view>
              <view class="operate-child line" bindtap="toDataStatistics" data-id="{{item.id}}">
                <icon class="iconfont icon-fontclass-shujutongji"></icon>
                数据统计
              </view>
              <view class="operate-child" bindtap="toOpenGroupList" data-id="{{item.id}}">
                <icon class="iconfont icon-fontclass-shangpindingdan"></icon>
                开团列表
              </view>
            </view>
          </view>
        </view>
      </view>
      <view wx:else class="blank">暂无开团数据...</view>
    </van-tab>
  </van-tabs>
  <van-popup show="{{ showEndP }}" bind:close="onClose" custom-style="background:none;width:90%;padding-bottom:60px;">
    <view class="EndP-box">
        <view class="EndP-box-title" style="font-size:14px;">
          <view class="EndP-box-title-child">拼团层级</view>
          <view class="EndP-box-title-child">成员时间</view>
          <view class="EndP-box-title-child">状态</view>
          <view class="EndP-box-title-child">操作</view>
        </view>
        <view class="EndP-box-main">
          <view class="EndP-box-title" wx:for="{{has_many_level}}" >
            <view class="EndP-box-title-child">{{ item.member_num }}人团</view>
            <view class="EndP-box-title-child">{{ item.expire_in }}小时</view>
            <view class="EndP-box-title-child">
              {{ item.status == 0 ? '未开始' : item.status == 1 ? '活动中' : '已结束' }}
            </view>
            <view
              class="EndP-box-title-child end-btn"
              wx:if="{{item.status != 2}}"
              bindtap="closelevel"
              data-num="{{item.member_num}}"
              data-id="{{item.id}}"
              data-index="{{index}}"
            >
              手动结束
            </view>
            <view class="EndP-box-title-child end-btn" style="background-color:#949494" wx:if="{{item.status == 2}}">
              已结束
            </view>
          </view>
        </view>
      </view>
      <view class="close-btn" bindtap="closeEndP">
        <icon class="iconfont icon-adsystem_icon_cancle"></icon>
      </view>
  </van-popup>
  <van-share-sheet
    show="{{ showShare }}"
    title="活动推广"
    options="{{ options }}"
    bind:select="onSelect"
    bind:close="onClose"
  />
  <view class="fixed-btn" bindtap="createActivity">
      <icon class="iconfont icon-life-game-plus"></icon>
      <view class="">
        创建
      </view>
    </view>
  <o2ogroup-qrcode isshow="{{posterShow}}" activeID="{{activeID}}" store_id="{{store_id}}"  ></o2ogroup-qrcode>
</view>