<view class="mygroups">
  <view class="content">
    <view class="headTop" wx:if="{{ is_frequency == 1 }}">
      <view class="imgbox">
        <image src="{{member.avatar_image}}" ></image>
      </view>
      <view class="rightBox">
        <view style="margin-bottom: 14rpx;">{{ member.nickname }}</view>
        <view>剩余开团次数：{{ frequency ? frequency : 0 }}</view>
      </view>
    </view>
    <van-tabs active="{{active}}" bind:change="changeData" wx:if="{{type=='group'}}">
      <van-tab title="正在拼团">
        <view class="list_box">
          <view class="list" wx:for="{{info}}" wx:key="index">
            <view class="store-box" wx:if="{{item.has_one_store.id}}" bindtap="toStore"
              data-id="{{item.has_one_store.id}}">
              <image src="{{item.has_one_store.thumb}}" alt="" />
              <view class="store-name">{{ item.has_one_store.store_name }}</view>
              <icon class="iconfont icon-advertise-next"></icon>
            </view>
            <view class="time_state">
              <view class="time span">开团: {{item.has_one_team.start_time}}</view>
              <view class="state span">
                拼单中,还差{{item.has_one_level.member_num -item.has_one_team.has_many_success_member_count}}人
              </view>
            </view>
            <view class="goods_box">
              <view class="goods_img">
                <image src="{{item.has_one_goods.thumb}}" mode="widthFix" />
              </view>
              <view class="goods_name ul">
                <view class="name_price li">
                  <view class="name h2" style="-webkit-box-orient: vertical;">
                    {{item.has_one_goods.title}}
                  </view>
                </view>
                <view class="option li">
                  <view class="span">{{language['money']}}{{item.total_price}}</view>
                  <view class="{{item.isShowtime==true?'mt-span span':'span mr-span'}}" style="color:#000000;">
                    还剩:
                  </view>
                  <view class='tui-countdown-content' style="text-align:center;" wx:if="{{item.isShowtime}}">
                    <text class='tui-conutdown-box'>{{item.obj.day}}</text> 天
                    <text class='tui-conutdown-box'>{{item.obj.hou}}</text> 时
                    <text class='tui-conutdown-box'>{{item.obj.min}}</text> 分
                    <text class='tui-conutdown-box tui-countdown-bg'>{{item.obj.sec}}</text> 秒
                  </view>
                  <view wx:if="{{!item.isShowtime}}" style="color:#000000;">已结束</view>
                </view>
              </view>
            </view>
            <view class="allbt">
              <view class="button" data-id="{{item.order_id}}" catchtap="gotoOrder">订单详情</view>
              <view class="button" data-item="{{item}}" catchtap="gotoGroup">拼团详情</view>
            </view>
          </view>
        </view>
      </van-tab>
      <van-tab title="拼团成功">
        <view class="list_box">
          <view class="list" wx:for="{{info}}" wx:key="index">
            <view class="store-box" wx:if="{{item.has_one_store.id}}" bindtap="toStore"
              data-id="{{item.has_one_store.id}}">
              <image src="{{item.has_one_store.thumb}}" alt="" />
              <view class="store-name">{{ item.has_one_store.store_name }}</view>
              <icon class="iconfont icon-advertise-next"></icon>
            </view>
            <view class="time_state">
              <view class="time span">开团： {{item.has_one_team.start_time}}</view>
              <view class="state span">拼团成功 <text wx:if="{{item.is_win}}">（{{item.is_win == 1?'抽中':'未抽中'}}）</text>
              </view>
            </view>
            <view class="goods_box">
              <view class="goods_img">
                <image src="{{item.has_one_goods.thumb}}" mode="widthFix" />
              </view>
              <view class="goods_name ul">
                <view class="name_price li">
                  <view class="name h2" style="-webkit-box-orient: vertical;">
                    {{item.has_one_goods.title}}
                  </view>
                </view>
                <view class="option li">
                  <text class="span">{{language['money']}}{{item.total_price}}</text>
                </view>
              </view>
            </view>
            <view class="allbt">

              <view class="button" data-id="{{item.order_id}}" catchtap="gotoOrder">订单详情</view>
              <view class="button" data-item="{{item}}" catchtap="gotoGroup">拼团详情</view>
            </view>
          </view>
        </view>
      </van-tab>
      <van-tab title="拼团失败">
        <view class="list_box">
          <view class="list" wx:for="{{info}}" wx:key="index">
            <view class="store-box" wx:if="{{item.has_one_store.id}}" bindtap="toStore"
              data-id="{{item.has_one_store.id}}">
              <image src="{{item.has_one_store.thumb}}" alt="" />
              <view class="store-name">{{ item.has_one_store.store_name }}</view>
              <icon class="iconfont icon-advertise-next"></icon>
            </view>
            <view class="time_state">
              <view class="time span">开团： {{item.has_one_team.start_time}}</view>
              <view class="state span">拼团失败</view>
            </view>
            <view class="goods_box">
              <view class="goods_img">
                <image src="{{item.has_one_goods.thumb}}" mode="widthFix" />
              </view>
              <view class="goods_name ul">
                <view class="name_price li">
                  <view class="name h2" style="-webkit-box-orient: vertical;">
                    {{item.has_one_goods.title}}
                  </view>
                </view>
                <view class="option li">
                  <text class="span">{{language['money']}}{{item.total_price}}</text>
                </view>
              </view>
            </view>
            <view class="allbt">
              <view class="button" data-id="{{item.order_id}}" catchtap="gotoOrder">订单详情</view>
              <view class="button" data-item="{{item}}" catchtap="gotoGroup">拼团详情</view>
            </view>
          </view>
        </view>
      </van-tab>
    </van-tabs>
    <van-tabs id="tabs" active="{{active}}" bind:change="changeData" wx:if="{{type == 'zhpGroup'&&zhpObj.length>0}}">
      <block wx:for="{{zhpObj}}" wx:key="index">
        <van-tab title="{{item}}" name='{{index}}'></van-tab>
      </block>
      <view class="list_box">
        <view class="list" wx:for="{{info}}" wx:key="index">
          <view class="time_state">
            <view class="time span">参团: {{item.created_at}}</view>
            <!-- <view class="state span">
              拼单中,还差{{item.has_one_level.member_num -item.has_one_team.has_many_success_member_count}}人
            </view> -->
            <view class="state span" wx:if="{{active == 2}}">抽奖失败</view>
          </view>
          <view class="goods_box">
            <view class="goods_img">
              <image src="{{item.thumb}}" mode="widthFix" />
            </view>
            <view class="goods_name ul">
              <view class="name_price li">
                <view class="name h2" style="-webkit-box-orient: vertical;">
                  {{item.goods_title}}
                </view>
              </view>
              <view class="option li">
                <view class="span">{{language['money']}}{{item.order_price}}</view>
                <view style="display: flex;" >
                  <view wx:if="{{item.timeDifference > 0}}"  style="color:#000000;">
                    还剩:
                  </view>
                  <van-count-down time="{{item.timeDifference}}" format="DD天HH时mm分ss秒" wx:if="{{item.timeDifference > 0}}" />
                  <!-- <van-count-down use-slot time="{{ item.timeDifference }}" bind:change="onChange" class="tui-countdown-content" style="text-align:center;display: flex;" wx:if="{{item.timeDifference > 0}}">
                    <text class="tui-conutdown-box">{{ timeData.days < 10 ? '0' + timeData.days : timeData.days }}</text><view class="txtTa">天</view>
                    <text class="tui-conutdown-box">{{ timeData.hours < 10 ? '0' + timeData.hours : timeData.hours }}</text><view class="txtTa">时</view>
                    <text class="tui-conutdown-box">{{ timeData.minutes < 10 ? '0' + timeData.minutes : timeData.minutes}}</text><view class="txtTa">分</view>
                    <text class="tui-conutdown-box">{{ timeData.seconds < 10 ? '0' + timeData.seconds : timeData.seconds }}</text><view class="txtTa">秒</view>
                  </van-count-down> -->
                  <view wx:if="{{item.timeDifference == 0 && active == 0 }}" style="color:#000000;">00天00时00分00秒</view>
                </view>
              </view>
            </view>
          </view>
          <view class="allbt">
            <!-- <view class="button botton-Popover" catchtap="showPopover" data-index="{{index}}" wx:if="{{active == 1&&(item.nex_lottery == 0||item.barter_status!=2)}}">
              更多
              <view wx:if="{{item.showPopover}}" class="botton-Popover-main">
                <block wx:if="{{item.nex_lottery == 0}}">
                  <view class="button" data-item="{{item}}" data-key="join" catchtap="goZhpUrl">继续参团</view>
                  <view class="button" data-item="{{item}}" data-key="quit" catchtap="goZhpUrl">取消参团</view>
                </block>
              </view>
            </view> -->
            <block wx:if="{{active == 1}}">
              <view class="button" wx:if="{{item.nex_lottery == 0}}" data-item="{{item}}" data-key="join" catchtap="goZhpUrl">继续参团</view>
              <view class="button" wx:if="{{item.nex_lottery == 0}}" data-item="{{item}}" data-key="quit" catchtap="goZhpUrl">取消参团</view>
              <view class="button" wx:if="{{item.barter_status == 1}}">已易兑</view>
              <view class="button" data-id="{{item.id}}" catchtap="zhpYh" wx:if="{{item.barter_status == 0}}">易兑</view>
              <view class="button" data-id="{{item.id}}" catchtap="zhpSendAction" wx:if="{{item.barter_status == 0}}">发货</view>
            </block>
            <view class="button" data-id="{{item.order_id}}" data-key="order" catchtap="goZhpUrl">订单详情</view>
            <!-- <view class="button" data-item="{{item}}" data-key="detail" catchtap="goZhpUrl">参团详情</view> -->
            <view class="button" data-item="{{item}}" data-key="detail" catchtap="cancelTap" wx:if="{{item.refund_button}}">退出拼团</view>
          </view>
        </view>
      </view>
    </van-tabs>
  </view>
</view>
<!-- 易货start -->
<van-popup show="{{yhShow}}" overlay="{{true}}" custom-style="width:80%;border-radius: 38rpx;">
  <view class="boxYh">
    <view style="margin-bottom: 40rpx;">易货兑换</view>
    <view style="margin-bottom: 30rpx;">是否确认易货兑换</view>
    <text style="margin-bottom: 20rpx;">订单编号：{{barter_order_sn}}</text>
    <text style="margin-bottom: 20rpx;">可易货兑换{{barter_value}}{{barter_plugin_name}}</text>
    <view class="btn">
      <view class="cancelBtn" catchtap="cancelyh">取消</view>
      <view class="submitBtn" catchtap="submityh">兑换</view>
    </view>
  </view>
</van-popup>
<!-- 易货end -->