<!--components/cart-item/cart-item.wxml-->
<view class="item">
  <view class="left">
    <view class="pic">
      <image src="{{item.picUrl}}"></image>
    </view>
    <view class="delete">
      <view bind:tap="handleDelete" class="delete-button">
        删除
      </view>
    </view>
  </view>

  <view class="right">
    <view class="name">{{item.name}}</view>
    <view class="price">￥ {{item.price/100}} </view>
    <!-- 这里用计数器 -->
    <view class="count">
    <!-- max="{{showStock?checkItem ? checkItem.stock : skus[0].stock :99999}}" -->
      <van-stepper integer min="1" bind:change="handleCountChange" max="{{showStock?item.stock:99999}}" value="{{item.count}}"
        class="stepper"></van-stepper>
      <view class="unit">{{item.unit}}</view>
    </view>

    <view class="total-price">总金额:￥ {{item.price*item.count/100}}</view>

    <view class="stock" wx:if="{{showStock}}">库存：{{item.stock}}</view>

  </view>
</view>