<!--index.wxml-->
<scroll-view scroll-y style='height:100vh;' bindscroll="getService">
  <!--banner-->
  <swiper indicator-dots="{{indicatorDots}}"
  autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}" style='height: 640rpx;'>
    <block wx:for="{{Swiper}}" wx:key="{{index}}">
      <swiper-item>
        <image src="{{imgUrlBefore+item.img}}" class="slide-image" style='width: 100vw;height: 100%;'/>
      </swiper-item>
    </block>
  </swiper>
  <!-- search -->
  <view class="search" bindtap='goSearch'>
    <text class="search-icon iconfont icon-cx"></text>
    <text class="search-text">可以查询商品名字</text>
  </view>
  <!-- kind  -->
  <view class="kind" wx:if="{{kindStatus == '1'}}">
    <view class="kind-item flex-row flex-wrap">
       <view class="kind-detail flex-column a-center"  data-key="seckill" bindtap="goKind" wx:if="{{swtich[1].status=='1'}}">
        <image class="kind-icon" src='/images/seckill.png'></image>
        <text class="kind-text">限时秒杀</text>
      </view> 
      <view class="kind-detail flex-column a-center"  data-key="bargain" bindtap="goKind" wx:if="{{swtich[2].status=='1'}}">
        <image class="kind-icon" src='/images/bargain.png'></image>
        <text class="kind-text">好友砍价</text>
      </view>
      <view class="kind-detail flex-column a-center"  data-key="group" bindtap="goKind" wx:if="{{swtich[3].status=='1'}}">
        <image class="kind-icon" src='/images/group.png'></image>
        <text class="kind-text">拼团活动</text>
      </view>
      <view class="kind-detail flex-column a-center"  data-key="nearby" bindtap="goKind" wx:if="{{swtich[4].status=='1'}}">
        <image class="kind-icon" src='/images/nearby.png'></image>
        <text class="kind-text">附近门店</text>
      </view>
   
      <view class="kind-detail flex-column a-center"  data-key="integral" bindtap="goKind" wx:if="{{swtich[5].status=='1'}}">
        <image class="kind-icon" src='/images/integral.png'></image>
        <text class="kind-text">积分兑换</text>
      </view>
      <view class="kind-detail flex-column a-center"  data-key="about" bindtap="goKind" wx:if="{{swtich[6].status=='1'}}">
        <image class="kind-icon" src='/images/about.png'></image>
        <text class="kind-text">品牌故事</text>
      </view>
      <view class="kind-detail flex-column a-center"  data-key="DistributeCenter" data-share_status="{{userInfo.share_status}}"  data-index="0" bindtap='seeDownLine' wx:if="{{swtich[7].status=='1'}}">
        <image class="kind-icon" src='/images/DistributeCenter.png'></image>
        <text class="kind-text">{{userInfo.share_status == 1 ? '分销中心' : '申请分销'}}</text>
      </view>
      <view class="kind-detail flex-column a-center"  data-key="information" bindtap="goKind" wx:if="{{swtich[8].status=='1'}}">
        <image class="kind-icon" src='/images/information.png'></image>
        <text class="kind-text">活动资讯</text>
      </view>
       <view class="kind-detail flex-column a-center"  data-key="coupon" bindtap="goKind" wx:if="{{swtich[9].status=='1'}}">
        <image class="kind-icon" src='/images/coupon.png'></image>
        <text class="kind-text">优惠券</text>
      </view>
      <view class="kind-detail flex-column a-center"  data-key="tuike" bindtap="goKind" wx:if="{{swtich[10].status=='1'}}">
        <image class="kind-icon" src='/images/tuike.png'></image>
        <text class="kind-text">客推客</text>
      </view>
      <view class="kind-detail flex-column a-center"  data-key="sign" bindtap="goKind" wx:if="{{swtich[11].status=='1'}}">
        <image class="kind-icon" src='/images/sign.png'></image>
        <text class="kind-text">签到</text>
      </view>
      <view class="kind-detail flex-column a-center"  data-key="pay" bindtap="goKind" wx:if="{{swtich[12].status=='1'}}">
        <image class="kind-icon" src='/images/pay.png'></image>
        <text class="kind-text">优惠买单</text>
      </view>
    </view>
  </view>
  <!-- coupon  -->
  <view class="couponList pad30">
     <scroll-view scroll-x  >
    <view class="coupon-item" style="background: url('../../images/couponbg.png'); background-repeat: no-repeat;background-size: 70vw 200rpx;" >
    <view class="flex-row a-center j-around coupon-box" style="height:100%;">
      <view class="coupon-left" >
        <view>￥<text class="coupon-sale">10</text></view>
        <text class="coupon-text">优惠券</text>
      </view>
      <view class="coupon-right" bindtap="goKind" data-key="coupon">
        <view class="coupon-text">立即领取</view>
      </view> 
    </view>    
  </view>
  </scroll-view>
  </view>
  <!-- video  -->
  <view class="video"  wx:if="{{videotatus == '1'}}">
    <video id="my-video" src="{{imgUrlBefore + swtich[14].video}}">
    </video>
  </view>
  <!-- 首页分类  -->
  <view class="kind" wx:if="{{swtich[13].status=='1'}}">
    <view class="kind-item flex-row flex-wrap">
       <view class="kind-detail flex-column a-center"   bindtap="goCate" data-id="{{item.id}}" wx:for="{{indexCat}}" wx:key="unique">
        <image class="kind-icon" src='{{imgUrlBefore + item.img}}'></image>
        <text class="kind-text">{{item.title}}</text>
      </view> 
    </view>
  </view>
  <!-- form -->
  <view class="form" wx:if="{{ibookStatus == '1'}}">
  <!-- rush  -->
  <view class="rush margin_b20">
    <image src="{{imgUrlBefore + swtich[15].img}}"></image>
  </view>
    <form bindsubmit="submit">
      <view class="form-item">
        <text class="form-icon iconfont icon-ren"></text>
        <input type="text" name="name" value="{{name}}" placeholder="请输入您的姓名"></input>
      </view>
      <view class="form-item m-top20">
        <text class="form-icon iconfont icon-weibiaoti-"></text>
        <input type="number" name="phone" value="{{phone}}"  placeholder="请输入您的电话"></input>
      </view>
      <button class="m-top50" form-type="submit" type="warn">立即预约</button>
    </form>
  </view>
  <!-- rush  -->
  <view class="rush margin_t30">
    <image src="{{imgUrlBefore + swtich[17].img}}"></image>
    <view class="groupList">
      <view class="groupList-title flex-column a-center">
        <view class="rpx36 price-red margin_b10">
          <text class="iconfont icon-mg-limit margin_r20"></text>
          <text>限时拼团</text>
        </view>
        <text class="rpx24">爱购好货 拼团特卖</text>
      </view>
      <view class="groupGoods flex-row flex-wrap j-around">
        <view class="groupGoods-item" wx:for="{{goodsList[1].goods}}" wx:for-item="goods" wx:key="unique">
          <view class="groupGoods-main">
            <view class="groupGoods-img">
              <image src="{{imgUrlBefore+goods.img}}"></image>
            </view>
            <view class="groupGoods-detail">
              <view class="groupGoods-describe">{{goods.title}}</view>
              <view class="m-top20 flex-row j-between a-end">
                <text class="groupGoods-price">￥{{goods.price}}</text>
                <text class="groupGoods-oldpric">￥{{goods.price}}</text>
              </view>
            </view>
          </view>
        </view>
      </view>
    </view>
  </view>
  <!-- seckill  -->
  <view class="rush"   wx:if="{{isckillStatus == '1'}}">
    <image src="{{imgUrlBefore + swtich[16].img}}"></image>
      <view class="groupList">
      <view class="groupList-title flex-column a-center">
        <view class="rpx36 price-red margin_b10">
          <text class="iconfont icon-mg-limit margin_r20"></text>
          <text>限时秒杀</text>
        </view>
        <text class="rpx24">全球尖货 低价抢购</text>
      </view>
      <view class="groupGoods flex-row flex-wrap j-around">
        <view class="groupGoods-item" wx:for="{{goodsList[1].goods}}" wx:for-item="goods" wx:key="unique">
          <view class="groupGoods-main">
            <view class="groupGoods-img">
              <image src="{{imgUrlBefore+goods.img}}"></image>
            </view>
            <view class="groupGoods-detail">
              <view class="groupGoods-describe">{{goods.title}}</view>
              <view class="m-top20 flex-row j-between a-end">
                <text class="groupGoods-price">￥{{goods.price}}</text>
                <text class="groupGoods-oldpric">￥{{goods.price}}</text>
              </view>
            </view>
          </view>
        </view>
      </view>
    </view>
  </view>

  <!-- goods  -->
  <view class="goods">
    <view class="goods-item m-top50" wx:for="{{goodsList}}" wx:key="{{index}}">
      <view class="goods-title goods-base" data-id="{{item.id}}" bindtap="goCate">
        <text class="goods-text position">{{item.title}}</text>
        <text class="goods-icon icon-arrow-circle-o-right iconfont position"></text> 
        <view class="title-bc goods-base"></view>
      </view>
      <view class="goods-main" wx:for="{{item.goods}}"  wx:for-index="gindex" wx:for-item="goods" wx:key="{{gindex}}">
        <view class="goods-img">
          <image src="{{imgUrlBefore+goods.img}}"></image>
        </view>
        <view class="goods-detail">
          <view class="goods-describe">{{goods.title}}</view>
          <view class="m-top20 flex-row j-between a-end">
            <text class="goods-price">￥{{goods.price}}</text>
            <text class="goods-buy" bindtap="goGoodsDetails" data-id="{{goods.id}}">立即购买</text>
          </view>
        </view>
      </view>
    </view>
  </view>
  <!-- service  -->
  <view class="service" wx:if="{{serviceFlag}}">
    <button class="service-pc service-base">
      <image src="/images/kefu.png"></image>
    </button>
    <view class="service-phone service-base" bindtap="callPhone">
      <image src="/images/phone.png"></image>
    </view>
  </view> 
</scroll-view>

<view class='modal' wx:if="{{showApply}}">
    <view class='apply-wrap white-bg rpx28'>
        <view class='apply-item-wrap'>
            <view class='flex-row a-center apply-item'>
                <view class='apply-item-left'>姓名：</view>
                <input type='text' placeholder='请输入你的姓名' bindinput='getName'></input>
            </view>
            <view class='flex-row a-center apply-item'>
                <view class='apply-item-left'>电话：</view>
                <input type='text' placeholder='请输入您的手机号码' bindinput='getPhone'></input>
            </view>
        </view>
        <view class='flex-row a-center'>
            <button class='cancle-apply-btn' data-kind="cancle" bindtap='whetherApply'>取消</button>
            <button class='sure-apply-btn main-bg white' data-kind="sure" bindtap='whetherApply'>提交申请</button>
        </view>
    </view>
</view>