
<page-meta>
  <navigation-bar title="{{'商品套餐'}}" />
</page-meta>
<loading hidden="{{loadingHidden}}">加载中...</loading>
<view class="swiper" wx:if="{{carousels.length>0}}">
  <swiper autoplay="{{true}}" interval="{{3000}}" duration="{{300}}" circular="{{true}}" indicator-dots="{{true}}"
    indicator-active-color="#fff">
    <swiper-item wx:for="{{carousels}}" style="height: 200rpx;" catchtap="link" data-item="{{item}}" wx:key="index">
      <image src="{{item.carousel_thumb}}" style="width: 100%;height: 100%;"></image>
    </swiper-item>
  </swiper>
</view>
<div class="time" wx:if="{{time_over}}">
  <view>
    <image style="width: 22.5px;height: 38px;" src="../../image/rob-time.png"></image>
  </view>
  <view style="margin:0 100rpx 0 20rpx;">
    <view>限时</view>
    <view>购买</view>
  </view>
  <view style="display: flex;">
    <text>截至倒计时：</text>
    <van-count-down use-slot time="{{end_time}}" format="DD 天 HH 时 mm 分 ss 秒" bind:change="count_down"
      bind:finish="finish">
      <text class="item">{{end_time_obj.days||0}}天</text>
      <text style="opacity: 0;">：</text>
      <text class="item">{{end_time_obj.hours||"00"}}</text>
      <text style="color: #fff;">：</text>
      <text class="item">{{end_time_obj.minutes||"00"}}</text>
      <text style="color: #fff;">：</text>
      <text class="item">{{end_time_obj.seconds||"00"}}</text>
    </van-count-down>
  </view>
</div>
<view class="Package">{{title}}</view>
<view class="info" wx:if="{{description_thumb || description_title || description_desc}}">
  <view class="user">
    <image src="{{description_thumb}}"></image>
    <view class="text">{{description_title}}</view>
  </view>
  <view class="desc">{{description_desc}}</view>
</view>
<view class="order-list">
  <van-sticky wx:if="{{order_list.length>1}}">
    <van-tabs active="{{order_active}}" color="{{'#ee0a24'}}" title-active-color="{{'#323233'}}" bind:click="change">
      <van-tab title="{{item.category_name}}" wx:for="{{order_list}}" wx:key="index"></van-tab>
    </van-tabs>
  </van-sticky>
  <view>
    <view class="list-item" wx:for="{{order_list}}" wx:key="index">
      <view class="title-box">
        <view class="line"></view>
        <view style="font-size: 18px;font-weight: 600;">{{item.category_names}}</view>
        <view class="line line-right"></view>
      </view>
      <block wx:for="{{item.goods_list}}" wx:for-item="items" wx:key="c_index" wx:for-index="c_index">
        <view class="list-item-item">
          <view class="goods_box">
            <view style="margin-right: 20rpx;">
              <van-checkbox checked-color="#f15353" bind:change="shopChange" data-c_index="{{c_index}}"
                data-i="{{index}}" value="{{items.check}}">
              </van-checkbox>
            </view>
            <view style="flex: 1;">
              <view style="display: flex;">
                <view class="thumb-box" bindtap="todetail" data-id="{{items.id}}">
                  <image src="{{items.thumb}}" style="width: 100%;max-height: 100%;"></image>
                </view>
                <view style="flex: 1;">
                  <view bindtap="todetail" data-id="{{items.id}}">{{items.title}}</view>
                  <view bindtap="todetail" data-id="{{items.id}}">
                    <text class="price">¥{{items.price||"0.00"}}</text>
                    <text class="market_price" wx:if="{{items.market_price>0}}">
                      ¥{{items.market_price}}
                    </text>
                  </view>
                  <view class="member">
                    <view>数量</view>
                    <view style="flex: 1;"></view>
                    <van-stepper theme="round" value="{{items.count}}" integer button-size="24px" min="1"
                      max="{{items.stock}}" bind:change="shopChange" data-i="{{index}}" data-c_index="{{c_index}}"
                      data-count="{{items.count}}" />
                  </view>
                </view>
              </view>
              <block wx:if="{{items.has_option==1}}">
                <view class="spe_a" wx:for="{{items.has_many_specs}}" wx:for-index="spe_index" wx:key="spe_index"
                  wx:for-item="spe">
                  <view>{{spe.title}}</view>
                  <view style="display: flex;flex-wrap: wrap;">
                    <view class="{{items.check_spe[spe_index] == spe_item_index?'cur check-cur':'cur'}}"
                      wx:for="{{spe.specitem}}" wx:for-index="spe_item_index" wx:key="index" wx:for-item="spe_item"
                      data-i="{{index}}" data-c_index="{{c_index}}" data-spe_index="{{spe_index}}"
                      data-spe_item_index="{{spe_item_index}}" bindtap="tapSpe">
                      {{spe_item.title}} {{items.has_option}}
                    </view>
                  </view>
                </view>
              </block>
            </view>
          </view>
        </view>
      </block>
    </view>
  </view>
  <view wx:if="{{other_packages.length>0}}" style="background-color: #fff;">
    <view class="other_packages-title">其他推荐</view>
    <view class="d_box">
      <block wx:for="{{other_packages}}" wx:key="index">
        <view class="goods_box" bindtap="gopackgoods" data-id="{{item.id}}" >
          <view class="img">
            <image src="{{item.thumb}}" />
          </view>
          <view class="infos">
            <view class="info_a">{{ item.title }}</view>
            <view class="info_b">推荐价：￥{{ item.price_sum }}</view>
          </view>
        </view>
      </block>
    </view>
  </view>
  <view style="height: 140rpx;"></view>
  <view class="fixed">
    <view style="margin: 0 10rpx;" wx:if="{{isDiscount}}">已优惠：<text style="color: #f15353;">¥{{on_sale_price}}</text>
    </view>
    <view style="flex: 1;"></view>
    <view>
      <text>合计：</text>
      <text class="price">¥{{total ||"0.00"}}</text>
    </view>
    <view bindtap="settlement" class="settlement">立即购买</view>
  </view>
</view>