<!--packageI/groupWork/groupWorkMy/groupWorkMy.wxml-->
<view class="mygroups">
  <van-tabs active="{{activeName}}" bind:change="getTab" sticky swipeable>
    <van-tab title="{{item.title}}" wx:for="{{tabs}}" wx:for-index="index" wx:for-item="item">
      <block wx:if="{{dataList[index]}}">
        <my-group-cell wx:for="{{dataList[index].list}}" wx:for-index="indexChild" wx:for-item="itemChild"
          title="{{itemChild.title}}" price="{{itemChild.price}}" thumb="{{itemChild.thumb}}"
          time="{{itemChild.timeDifference}}" hidden-time="{{activeName == 0? false:true}}">
          <view slot="top">
            <view class="time_state">
              <view class="time">{{ itemChild.created_at }}</view>
              <view class="state" wx:if="{{activeName == 0}}">拼团中,还差{{ itemChild.disparity }}人</view>
              <view class="state" wx:if="{{activeName == 1}}">拼团成功 {{ itemChild.status == 2 ? '（抽中）' : "（未抽中）" }}</view>
              <view class="state" wx:if="{{activeName == 2}}">拼团失败</view>
            </view>
          </view>
          <view slot="bottom" class="allbt">
            <!--  -->
            <view wx:if="{{activeName == 1 && itemChild.status == 2&&!itemChild.order_id}}"
              data-activityid="{{itemChild.activity_id}}" data-specid="{{itemChild.spec_id}}" data-id="{{itemChild.id}}"
              catchtap="getGoods" class="groupDetail button">
              去下单
            </view>
            <view wx:if="{{activeName == 1 && itemChild.status == 2&&itemChild.order_id != 0}}"
              data-orderid="{{itemChild.order_id}}" catchtap="toOrder" class="groupDetail button">
              订单详情
            </view>
            <view data-allianceid="{{itemChild.alliance_id}}" data-id="{{itemChild.activity_id}}" catchtap="gotoDetail"
              class="groupDetail button">
              拼团详情
            </view>
          </view>
        </my-group-cell>

        <view wx:if="{{!networkLoading}}" class="loadingimg">
          <image src="https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/video-loading.gif" mode='aspectFill' />
        </view>

        <view wx:if="{{ networkLoading && dataList[index] && dataList[index].list==0}}" class="blank">
          <image src='https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/blank.png' mode='widthFix' />
        </view>
      </block>
    </van-tab>
  </van-tabs>

  <!-- 规格弹窗,关联层级 -->
  <yz_specs id='yzSpecs' goods="{{goods}}" good-specs="{{specs}}" disable-stepper-input options="{{options}}"
    show="{{popupSpecs}}" bind:sku-selected="skuSelected" bind:buy-clicked="buyClicked">
    <view slot='sku-body-bottom'>
      <view class="select_box noVantRadio" wx:if="groupLevel" style="padding-top: 0;">
        <van-radio-group value="{{groupModel}}" checked-color="#f15353" bind:change="selectGroup" class="select"
          style="padding-bottom: 0;">
          <van-radio class="vantRadioshow" wx:for="{{groupLevel}}" name="{{item.id}}">
            <view style="padding: 0.25rem 0.8rem;">
              <view>￥{{ item.min_price }} 起</view>
              <view>{{ item.person }}人团</view>
            </view>
          </van-radio>
        </van-radio-group>
      </view>
    </view>
  </yz_specs>
</view>