<view class="container">
  <auth bindlogin="onShow" />
  <lip-sync />
  <!-- <view class="service-policy">
    <view class="item">30天无忧退货</view>
    <view class="item">48小时快速退款</view>
    <view class="item">满88元免邮费</view>
  </view> -->
  <view class="no-cart" wx:if="{{cartGoods.length <= 0}}">
    <view class="c">
      <view class="title-box">
        购物车空空如也～
      </view>
      <view class="to-index-btn" bindtap="toIndexPage">
        去逛逛
      </view>
    </view>
  </view>
  <view class="cart-view" wx:if="{{cartGoods.length > 0}}">
    <view class="list">
      <view class="group-item">
        <view class="goods">
          <view class="item {{isEditCart ? 'edit' : ''}}" bindtap="checkedItem" data-item-index="{{index}}" wx:for="{{cartGoods}}" wx:key="{{item.id}}">
            <image src="{{item.checked ?  '../../static/images/icon-normal_checkbox-checked.png' :'../../static/images/icon-normal_checkbox.png' }}" class="checkbox"></image>
            <view class="cart-goods">
              <image mode="aspectFit" class="img" src="{{item.list_pic_url}}"></image>
              <view class="info">
                <view class="t">
                  <text class="name">{{item.goods_name}}</text>
                  <text class="num">x{{item.number}}</text>
                </view>
                <view class="attr">{{ isEditCart ? '已选择:' : ''}}{{item.goods_specifition_name_value||''}}</view>
                <view class="b">
                  <text class="price">￥{{item.retail_product_price || item.retail_price}}</text>
                  <view class="selnum">
                    <view class="cut" catchtap="cutNumber" data-item-index="{{index}}">-</view>
                    <input value="{{item.number}}" class="number" disabled="true" type="number" />
                    <view class="add" catchtap="addNumber" data-item-index="{{index}}">+</view>
                  </view>
                </view>
              </view>
            </view>
          </view>
        </view>
      </view>

      <!--<view class="group-item">
                <view class="header">
                    <view class="promotion">
                        <text class="tag">满赠</text>
                        <text class="txt">再加26元, 3件赠1件蔓越莓干</text>
                        <image class="icon" src="http://nos.netease.com/mailpub/hxm/yanxuan-wap/p/20150730/style/img/icon-normal/go-b67cb9718d.png"></image>
                    </view>
                    <view class="get">领赠品</view>                
                </view>
                <view class="goods">
                    <view class="item">
                        <view class="checkbox" ></view>
                        <view class="cart-goods">
                            <image class="img" src="http://yanxuan.nosdn.127.net/04e05e9de3a471b1f6479dd137b459a8.png"></image>
                            <view class="info">
                                <view class="t">
                                    <text class="name">秋冬保暖加厚细羊毛被</text>
                                    <text class="num">x1</text>
                                </view>
                                <view class="attr">220*240cm</view>
                                <view class="b">
                                    <text class="price">￥199.99</text>
                                    <view class="open">优惠活动</view>
                                </view>
                            </view>
                        </view>
                    </view>
                </view>
            </view>-->
    </view>
    <view class="cart-bottom">
      <view class="checkbox {{checkedAllStatus ? 'checked' : ''}}" bindtap="checkedAll">
        <image src="{{checkedAllStatus ?  '../../static/images/icon-normal_checkbox-checked.png' :'../../static/images/icon-normal_checkbox.png' }}" ></image>

        全选 ({{cartTotal.checkedGoodsCount}})
      </view>
      <view class="total">{{!isEditCart ? '￥'+cartTotal.checkedGoodsAmount : ''}}</view>
      <view class="delete" bindtap="editCart">{{!isEditCart ? '编辑' : '完成'}}</view>
      <view class="checkout" bindtap="deleteCart" wx:if="{{isEditCart}}">删除所选</view>
      <view class="checkout" bindtap="checkoutOrder" wx:if="{{!isEditCart}}">下单</view>
    </view>
  </view>
</view>