<view class="main">
  <view class="goods-box">
    <!-- <image src="{{goods.image}}" class="goods-thumb"></image> -->
    <swiper class="banner" indicator-dots="true" autoplay="true" interval="{{interval}}" duration="{{duration}}" circular="true">
      <block wx:for="{{goods.image}}" wx:key="{{index}}">
        <swiper-item>
          <image src="{{item}}" class="slide-image" width="100%" />
        </swiper-item>
      </block>
    </swiper>
    <!-- <navigator open-type="switchTab" url="../cart/cart">
            <view class="carts-icon {{scaleCart?'on':''}}">
                <image src="/image/cart2.png"></image>
                <text class="carts-icon-num" wx:if="{{hasCarts}}">{{totalNum}}</text>
            </view>
        </navigator> -->

    <view class="goods-operation">
      <text class="goods-operation-add" bindtap="reduceCount">-</text>
      <text class="goods-operation-num">数量 {{num}}</text>
      <text class="goods-operation-add" bindtap="addCount">+</text>
      <navigator url="javascript:void(0);" open-type="false">
        <button class="goods-to-buy" bindtap="onBuyClick">购买</button>
      </navigator>
      <!-- <text class="goods-to-cart" bindtap="addToBuy">购买</text> -->
      <!-- <image src="/image/cart1.png"  class="goods-cart-img" bindtap="addToCart"></image> -->
    </view>
    <image wx:if="{{show}}" src="/image/cart1.png" class="to-carts-icon"></image>
    <!-- <view class="goods-stock">{{goods.stock}}</view> -->
    <view class="goods-title">{{goods.title}}</view>
    <view class="goods-price">￥ {{goods.price}}</view>
  </view>
  <view class="goods-tab-box">
    <view class="goods-tab-nav {{curIndex === 0 ?'on':''}}" bindtap="bindTap" data-index="0">商品详情</view>
    <view class="goods-tab-nav {{curIndex === 1 ?'on':''}}" bindtap="bindTap" data-index="1">产品参数</view>
    <view class="goods-tab-nav {{curIndex === 2 ?'on':''}}" bindtap="bindTap" data-index="2">售后保障</view>
    <view class="goods-content">
      <view wx:if="{{curIndex === 0}}">{{goods.detail}}</view>
      <view wx:if="{{curIndex === 1}}">{{goods.parameter}}</view>
      <view wx:if="{{curIndex === 2}}">{{goods.service}}</view>
    </view>
  </view>
</view>