<view class="container">
  <view class="cart-panel" wx:if="{{footCart.goodsCount>0}}">
    <view class="cart-icon">
      <navigator class="nav-cell" open-type='switchTab' url="/pages/cart/cart">
        <image src="../../static/images/cart-fixed.png">
        </image>
      </navigator>
      <view class="cart-num" bindtap="switchNav" data-name="cart">{{footCart.goodsCount}}</view>
    </view>
    <view class="cart-body" bindtap="switchNav" data-name="cart">￥{{footCart.checkedGoodsAmount}}</view>
    <navigator class="nav-cell" open-type='switchTab' url="/pages/cart/cart">
      <view class="cart-pay">去结算 > </view>
    </navigator>
  </view>
  <view wx:if="{{showNavList}}" class="modal-wrap"></view>
  <view class="fast-nav">
    <contact-button wx:if="{{!showNavList}}" class="contact" size="25" type="primary" session-from="weapp">
      <text>找客服</text>
    </contact-button>
    <view wx:if="{{!showNavList}}" class="nav" bindtap="toggleNav">
      <text>快捷</text>
      <text>导航</text>
    </view>
    <view class="nav-list" wx:if="{{showNavList}}">
      <view class="nav-item">
        <text class="nav-text">首页</text>
        <view class="nav-cell" bindtap="switchNav" data-name="index">
          <image src="../../static/images/nav-1.png"></image>
        </view>
      </view>
      <view class="nav-item">
        <text class="nav-text">足迹</text>
        <navigator class="nav-cell" url="../ucenter/footprint/footprint">
          <image src="../../static/images/nav-2.png"></image>
        </navigator>
      </view>
      <view class="nav-item">
        <text class="nav-text">搜索</text>
        <navigator class="nav-cell" url="../search/search">
          <image src="../../static/images/nav-3.png"></image>
        </navigator>
      </view>
      <view class="nav-item">
        <text class="nav-text">购物车</text>
        <view class="nav-cell" bindtap="switchNav" data-name="cart">
          <image src="../../static/images/nav-4.png"></image>
        </view>
      </view>
    </view>
    <view wx:if="{{showNavList}}" class="close" bindtap="toggleNav">X</view>
  </view>
  <view class="cate-nav">
    <scroll-view scroll-x="true" class="cate-nav-body" style="width: 750rpx;" scroll-left="{{scrollLeft}}">
      <view wx:for="{{navList}}" class="item {{ id == item.id ? 'active' : ''}}" data-current="{{index}}" data-id="{{item.id}}" bindtap="switchCate" wx:key="{{index}}">
        <view class="name">{{item.name}}</view>
      </view>
    </scroll-view>
  </view>

  <swiper class="" current="{{currentTab}}" bindchange="switchTab" scroll-top="{{scrollTop}}" style="height:{{scrollHeight}}px;">
    <swiper-item wx:for="{{navList}}"  wx:key="{{navIndex}}">
      <scroll-view scroll-y="true" class="cate-item">
        <view class="h">
          <text class="name">{{currentCategory.name}}</text>
          <text class="desc">{{currentCategory.front_name}}</text>
        </view>
        <view class="b">
          <block wx:for="{{goodsList}}" wx:for-index="iindex" wx:for-item="iitem" wx:key="unique">
            <view class="item {{iindex % 2 == 0 ? 'item-b' : '' }}">

              <navigator url="../goods/goods?id={{iitem.id}}">
                <image class="img" src="{{iitem.list_pic_url}}" background-size="cover"></image>
                <text class="name">{{iitem.name}}</text>
              </navigator>

              <view class="price">￥{{iitem.retail_price == null?'':iitem.retail_price}}
                <image class="cart" src="/static/images/cart.png" data-goods-id="{{iitem.id}}" data-product-id="{{iitem.product_id}}" bindtap='addCart' background-size="cover"></image>
              </view>
            </view>
          </block>
        </view>
      </scroll-view>


    </swiper-item>

  </swiper>

   <view wx:if="{{openAttr}}" class="attr-pop">
          <view class="attr-close" bindtap="switchAttrPop">X</view>
          <view class="img-info">
            <image class="img" src="{{goodsVo.list_pic_url}}"></image>
            <view class="info">
              <view class="c">
                <view class="p">价格：￥{{checkedProduct[0].retail_price}}</view>
                <view class="a" wx:if="{{productList.length>0}}">已选择：{{checkedSpecText}}</view>
              </view>
            </view>
          </view>
          <view class="spec-con">
            <view class="spec-item" wx:for="{{specificationList}}" wx:key="{{item.specification_id}}" wx:for-index="itemIndex">
              <view class="name">{{item.name}}</view>
              <view class="values">
                <view class="value {{vitem.checked ? 'selected' : ''}}" bindtap="clickSkuValue" wx:for="{{item.valueList}}" wx:for-item="vitem" wx:key="{{vitem.id}}" data-index="{{itemIndex}}" data-value-id="{{vitem.id}}" data-name-id="{{vitem.specification_id}}">{{vitem.value}}</view>
              </view>
            </view>

            <view class="number-item">
              <view class="name">数量</view>
              <view class="selnum">
                <view class="cut" bindtap="cutNumber">-</view>
                <input value="{{number}}" class="number" disabled="true" type="number" />
                <view class="add" bindtap="addNumber">+</view>
              </view>
            </view>
          </view>
          <view class="bottom-btn">
            <view class="r" bindtap="addToCart">加入购物车</view>
          </view>
        </view>
</view>