<ep-navBar title="购买记录" background='linear-gradient(270deg,#f9c706 0%,#feb600 100%)' back="{{true}}" iconTheme='white' color='#fff' bindback="handlerGobackClick"/>
<view>
  <view class="goodsInfo">
    <i-img class="goodsImg" defaultImage="../../images/placeholder-refund.png" height="90" iClass="img-class" loadImage="{{goods.one_image}}" width="90"></i-img>
    <view class="goodsDetail">
      <view class="detailTop">
        <view class="detailTopInfo">
          <view class="goodsName">{{goods.goodsname}}</view>
          <view class="purchasing" wx:if="{{goods.one_limit_count > 0 || goods.total_limit_count > 0}}">
            <text wx:if="{{goods.total_limit_count > 0}}">每人限购{{goods.total_limit_count}}份</text>
            <text wx:if="{{goods.one_limit_count > 0}}"> 每单限购{{goods.one_limit_count}}份</text>
          </view>
          <view class="saleNum">已售{{goods.seller_count}}{{goods_sale_unit}}，剩余{{goods.total}}{{goods_sale_unit}}</view>
        </view>
        <button class="shareBtn" hoverClass="none" openType="share">
          <image class="shareImg" src="../../images/shareImg.png"></image>
        </button>
      </view>
      <view class="detailBottom">
        <view class="price">￥
          <text class="salePrice">{{goods.price_front}}</text>.{{goods.price_after}}</view>
        <view class="time">
          <text wx:if="{{goods.over_type == 1}}">距结束</text>
          <text class="endAct" wx:if="{{goods.over_type == 0}}">距开始</text>
          <text class="endAct" wx:if="{{goods.over_type == 2}}">结束时间</text>
          <text class="endAct" wx:if="{{goods.over_type == 2}}">{{goods.end_date}}</text>
          <view class="countdown-class i-count-down" wx:else>
            <em wx:if="{{endtime.days > 0}}">{{endtime.days}}天</em>
            <span class="item-class">{{endtime.hours}}</span>:
            <span class="item-class">{{endtime.minutes}}</span>:
            <span class="item-class">{{endtime.seconds}}</span>
          </view>


        </view>
      </view>
    </view>
  </view>

  <view class="noBuyList" style="height:{{containerHeight}}px" wx:if="{{rushList.length===0}}">
    <view class="noBuyListCon">
      <image class="noBuyListImg" src="../../images/noData.png"></image>
      <view class="noBuyListTit">还没有人购买哦</view>
    </view>
  </view>
  <view class="buyRecords" wx:if="{{rushList.length>0}}">
    <view class="buyListCon">
      <i-card>
        <view class="buyList" slot="content">
          <view class="buyListInfo" wx:for="{{rushList}}" wx:key="key">
            <i-img data-index="{{index}}" defaultImage="../../images/head-bitmap.png" height="36" iClass="userImg" imgType="5" loadImage="{{item.avatar}}" width="36"></i-img>
            <view class="userName">{{item.username}}</view>
            <view class="buyNum">买了
              <text>{{item.quantity}}</text>份</view>
            <view class="buyTime">{{item.pay_time}}</view>
          </view>
        </view>
      </i-card>
      <i-load-more iClass="loadMore" loading="{{loadMore}}" tip="{{loadText}}" wx:if="{{loadMore}}"></i-load-more>
    </view>
  </view>

  <!--底部按钮begin-->
  <view class='i-fixed-bottom'>
    <view class="goods-bottom-bar">
      <view class="leftBtn">
        <navigator hoverClass="none" openType="switchTab" url="/eaterplanet_ecommerce/pages/index/index">
          <view class="bar-item back-to-index">
            <image class="icon" src="{{iconArr.home}}"></image>
            回首页
          </view>
        </navigator>
        <navigator hoverClass="none" openType="switchTab" url="/eaterplanet_ecommerce/pages/order/shopCart">
          <view class="bar-item shop-cart">
            <view class="icon">
              <image src="{{iconArr.car}}"></image>
              <view class="cart-num" wx:if="{{cartNum}}">{{cartNum}}</view>
            </view>
            购物车
          </view>
        </navigator>
      </view>

      <view class="goodsStatus" wx:if="{{goods.total<=0}}">已抢光</view>
      <view class="goodsStatus" wx:elif="{{goods.total > 0 && goods.over_type ==2}}">已结束</view>
      <view class="goodsStatus" wx:elif="{{goods.grounding != 1}}">已下架</view>
      <view class="goodsStatus" wx:elif="{{goods.over_type == 0}}">即将开抢</view>
      <view class="goodsStatus" wx:elif="{{is_comunity_rest == 1}}">团长休息中</view>
      <view class="gobuy" wx:else>
        <form bindsubmit="addToCart" reportSubmit="true">
          <view class="bar-item add-to-cart" style='background: {{goodsdetails_addcart_bg_color}}'>加入购物车</view>
          <button class="btn" formType="submit"></button>
        </form>
        <form bindsubmit="submit" reportSubmit="true">
          <button hidden formType="submit" id="formId"></button>
        </form>
        <label class="balanceBtn" for="formId">
          <view bindtap="balance" class="bar-item balance" style='background: {{goodsdetails_buy_bg_color}}'>立即购买</view>
        </label>

      </view>
    </view>
  </view>
  <!--底部按钮end-->

  <view class="mask" bindtap='closeSku' hidden="{{!visible}}"></view>
  <!---规格选择begin-->
  <view bind:cancel="close" class='sku-content' scrollUp="{{true}}" hidden="{{!visible}}">
    <view class="sku-card">
      <view bindtap="closeSku" class="close">
        <image src="../../images/icon-sku-close.png"></image>
      </view>
      <view class="sku-header">

        <image src='{{cur_sku_arr.skuImage}}' style="width:80px;height:80px;" class='sku-img'></image>
        <view class="sku-desc">
          <view class="sku-title">
            <span>{{cur_sku_arr.spuName}}</span>
          </view>
          <view class="sku-price">
            <view class="sale-price">
              ¥
              <span>{{cur_sku_arr.actPrice[0]}}</span>.{{cur_sku_arr.actPrice[1]}}
            </view>
            <view class="market-price">¥{{cur_sku_arr.marketPrice[0]}}.{{cur_sku_arr.marketPrice[1]}}</view>
          </view>
          <view class="sku-switch-on" wx:if="{{cur_sku_arr.spec}}">已选择：{{cur_sku_arr.spec}}</view>
        </view>
      </view>

      <view class="sku-spec" wx:for="{{skuList.list}}" wx:key="{{index}}">
        <view class="title">{{item.name}}</view>
        <view class="spec-list">
          <span bindtap="selectSku" class="{{idx==sku[index]['idx']?'on':''}}" data-disabled="{{item.canBuyNum-value<0}}" data-type="{{index}}_{{idx}}_{{value.option_value_id}}_{{value.name}}" wx:for-index="idx" data-idx="{{idx}}" wx:for="{{item.option_value}}"
            wx:for-item="value">{{value.name}}</span>
        </view>
      </view>
      <view class="sku-num-content">
        <view class="title">数量</view>

        <view class="i-class i-input-number i-input-number-size-{{size}}">
          <view bindtap="setNum" data-type="decrease" class="i-input-number-minus {{value<=min?'i-input-number-disabled':''}}">
            <image src="../../images/icon-input-reduce.png"></image>
          </view>
          <input bindblur="handleBlur" bindfocus="handleFocus" class="i-input-number-text {{min>=max?'i-input-number-disabled':''}}" disabled="true" type="number" value="{{sku_val}}"></input>
          <view bindtap="setNum" data-type="add" class="i-input-number-plus {{value>=max?'i-input-number-disabled':''}}">
            <image src="../../images/icon-input-add.png"></image>
          </view>
        </view>
        <view class="msg" wx:if="{{skuList[current].isLimit}}">
          <span wx:if="{{skuList[current].limitMemberNum>-1}}">每人限{{skuList[current].limitMemberNum}}单</span>
          <span wx:if="{{skuList[current].limitOrderNum>-1}}">每单限{{skuList[current].limitOrderNum}}份</span>
          <span></span>
        </view>
        <view class="even-num" wx:elif="{{!skuList[current].isLimit&&skuList[current].canBuyNum-value<=10&&skuList[current].canBuyNum-value>-1}}">还可以购买 {{skuList[current].canBuyNum-value}} 件</view>
      </view>
      <form bindsubmit="gocarfrom" report-submit="true">
        <button formType="submit" class="sku-confirm" disabled='{{cur_sku_arr.stock==0 ? true : false}}'>
          <view>{{cur_sku_arr.stock==0?"已抢光":"确定"}}</view>
        </button>
      </form>
    </view>
  </view>
  <!---规格选择end-->
</view>

<i-new-auth needAuth="{{needAuth&&showAuthModal}}" bind:authSuccess="authSuccess" bind:cancel="authModal" needPosition="{{needPosition}}"></i-new-auth>

<i-vip-modal visible="{{showVipModal}}" imgUrl="{{pop_vipmember_buyimage}}" />
