<!--index.wxml-->
<import src="../../wxParse/wxParse.wxml" />
<view class="container">
  <view class="container-header">
    <view class="header">
      <!--<view class="searchbox2"> 
        <view class="logobox"><image src="../../images/logo2.png" /></view>
      </view>-->
      <view class="searchbox">
        <view class="icobox" bindtap="onsearch">
          <image src="../../images/searchto1.png" />
        </view>
        <view class="inpubox">
          <input type="text" placeholder="{{qkeyword}}" confirm-type="search" focus="{{getfocus}}"
            bindinput="getkeyword" bindconfirm="onsearch" placeholder-style="color:#bbb;" />
        </view>
        <view class="searchicobox" bindtap="onsearch">搜索</view>
        <view class="icobox0" bindtap="onCategory" data-id="购物车">
          <image src="../../images/cart0.png" />
        </view>
        <!---->

      </view>


    </view>

    <view wx:if="{{currentTab==0}}" class="container0">
      <view class="swiper">
        <swiper class="swiper_box" indicator-dots="{{indicatorDots}}" vertical="{{vertical}}" circular="true"
          autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}" bindchange="swiperchange">
          <block wx:for="{{images}}" wx:key="index">
            <swiper-item bindtap="onslide" data-id="{{item.url}}">
              <image src="{{item.img}}" class="slide-image" />
            </swiper-item>
          </block>
        </swiper>
      </view>
    </view>
  </view>
  <view class="notice_box">
    <view class="notice_title">
      <image src="../../images/notice_ico0.png"></image><text>最新公告</text>
    </view>
    <view class="notice_body">
      <swiper class="swiper_box0" indicator-dots="{{indicatorDots0}}" vertical="{{vertical0}}" circular="true"
        autoplay="{{autoplay}}" interval="{{interval0}}" duration="{{duration0}}" display-multiple-items="1"
        style="height: 70rpx; display: block; box-sizing: border-box">
        <swiper-item wx:for="{{news}}" wx:key="index" bindtap="onnotice" data-id="{{item.id}}">
          <image src="../../images/news-ico.png"></image>{{item.title}}
        </swiper-item>
      </swiper>
    </view>

  </view>


  <view class="mydata_box0" wx:if="{{IFCS==1}}">
    <view class="mydata_box0_bo">

      <view>
        <view wx:if='{{icon1===0}}' bindtap="onCategory" data-id="企业介绍">
          <image src='../../images/mydata0_ico0.png'></image>
          <text>企业介绍</text>
        </view>
        <!--
         <view  bindtap="onCategory" data-id="会客厅"> 
           <image src='../../images/mydata0_ico1.png'></image>
          <text>会客厅</text>
         </view>
-->

        <view wx:if='{{icon2===0}}' bindtap="onCategory" data-id="操作教程">
          <image src='../../images/mydata0_ico4.png'></image>
          <text>操作教程</text>
        </view>
        <view wx:if='{{icon3===0}}' bindtap="onCategory" data-id="发图素材">
          <image src='../../images/mydata0_ico2.png'></image>
          <text>发图素材</text>
        </view>
        <view wx:if='{{icon4===0}}' bindtap="onCategory" data-id="健康知识">
          <image src='../../images/mydata0_ico5.png'></image>
          <text>健康知识</text>
        </view>
        <view wx:if='{{icon5===0}}' bindtap="onCategory" data-id="客服专区">
          <image src='../../images/mydata0_ico3.png'></image>
          <text>客服专区</text>
        </view>
      </view>

      <view class="boview">
        <!--
         <view  bindtap="onCategory" data-id="助农专区"> 
           <image src='../../images/mydata0_ico5.png'></image>
          <text>助农专区</text>
         </view>
         <view  bindtap="onCategory" data-id="品牌展示">
           <image src='../../images/mydata0_ico6.png'></image>
          <text>品牌展示</text>
         </view>
         <view  bindtap="onCategory" data-id="体验区">
           <image src='../../images/mydata0_ico7.png'></image>
          <text>体验区</text>
         </view>
-->
      </view>
    </view>
  </view>
  <view class="menudata_box">

  </view>
  <view class="container_box">
    <view class="container_box_to">
      <view class="choice_text">
        <view class="line_flag"></view>
        <text>热卖推荐</text>

      </view>
      <view class="choice_box">
        <view class="choice_list">
          <block wx:for="{{products}}" wx:for-item="cell" wx:for-index="index0">
            <view class='block {{products.length > 1 ? "block0" : ""}} {{products.length > 1 && index0 % 2 == 0 ? "l" : ""}} {{products.length > 1 && index0 % 2 == 1 ? "r" : ""}}' bindtap="gotodetail" data-id="{{cell._id}}">
              <view class='choice_item'>
                <view class='choice_item_image'>
                  <image src="{{cell.image}}" />
                </view>
                <view class='choice_item_font'>
                  <view class="title">{{cell.name}}</view>
                  <view class="price">零售价：￥{{cell.scje}}</view>
                  <view class="price">会员价：￥{{cell.hyje}}</view>
                  <view wx:if="{{products.length == 1}}" class="right_button">
                    <view>立即购买</view>
                  </view>
                </view>
              </view>
            </view>
          </block>
        </view>
      </view>
    </view>
    <view class="container_box_to" style="margin-bottom: 6em;">
      <view class="choice_text">
        <view class="line_flag"></view>
        <text>兑换商城</text>

      </view>
      <!-- tab导航栏 -->
      <!--<scroll-view scroll-x="true" class="tab-h" scroll-left="{{scrollLeft}}">
    <view wx:for="{{navData}}" class="tab-item {{currentTab == index ? 'tab-active' : ''}}" data-current="{{index}}" bindtap="switchTab">{{item.label}}</view>
  </scroll-view>-->
      <view class="choice_box">
        <view class="choice_list">
          <block wx:for="{{products0}}" wx:for-item="cell" wx:for-index="index0">
            <view class='block {{products0.length > 1 ? "block0" : ""}} {{products0.length > 1 && index0 % 2 == 0 ? "l" : ""}} {{products0.length > 1 && index0 % 2 == 1 ? "r" : ""}}' bindtap="gotoPointDetail" data-id="{{cell._id}}">
              <view class='choice_item'>
                <view class='choice_item_image'>
                  <image src="{{cell.image}}" />
                </view>
                <view class='choice_item_font'>
                  <view class="title">{{cell.name}}</view>
                  <view class="price" style="display:none;">零售价：￥{{cell.scje}}</view>
                  <view class="price">兑换券：{{cell.hyje}}</view>
                  <view wx:if="{{products0.length == 1}}" class="right_button">
                    <view>立即购买</view>
                  </view>
                </view>
              </view>
            </view>
          </block>
        </view>
      </view>
    </view>
  </view>
</view>

<view class="Hidden_box" hidden="{{addcartHidden}}" bindtap="closeaddcart">
  <view class="Hidden_box_to addcart_box" catchtap="inaddcart">
    <view class="close" bindtap="closeaddcart">
      <image src="../../images/close.png" />
    </view>
    <view class="select_box_pic" bindtap="viewimages">
      <image src="{{showimage}}"></image>
    </view>
    <view class="select_box_title">
      <!--<view class="price"><text id="minprice">￥{{minprice}}</text></view>-->
      <view class="selguige">
        <text class="selguige_font">{{selguige_font}}</text>
        <text class="selguige_title">{{selguige_title}}</text>
      </view>
    </view>
    <view class="select_box_selguige" id="guiges" hidden="{{guigesHidden}}">

      <view class="selguige_box" wx:for="{{selguiges}}">
        <view class="selguige_item {{(item.selectednum>0?'hover':'')}}" data-id="{{index}}">
          <view class="select_name">{{item.gg}}
            <view>￥{{item.jg}}</view>
          </view>
          <view class="select_colors" wx:if='{{item.colors!=""}}' bindtap="showcolor" data-id="{{index}}">
            <view>{{item.selectedcolor==""?"选择颜色":item.selectedcolor}}</view>
          </view>
          <view class="select_box_selnum">
            <view class="select_box_selnum_box">
              <view class="num">数量</view>
              <view class="addcart_input">
                <text class="num_del" bindtap="decrement" data-id="{{index}}"></text>
                <input name="product_amount" id="product_amount" type="text" class="input_text" bindinput="inputOnlyNum"
                  value="{{item.selectednum}}" data-id="{{index}}" />
                <text class="num_add" bindtap="increment" data-id="{{index}}"></text>
              </view>
            </view>
            <view class="productkc">库存：{{item.kc}}</view>
          </view>

        </view>
      </view>
    </view>




    <view class="select_box_btn">
      <button bindtap="qyaddcart" value="{{qyaddcart}}">{{qyaddcart}}</button>
    </view>
  </view>
</view>

<view class="Hidden_box" hidden="{{colorHidden}}" bindtap="closecolor">
  <view class="Hidden_box_to" catchtap="incolor">
    <view class="title">点击下面颜色</view>
    <view class="close" bindtap="closecolor">
      <image src="../../images/close.png" />
    </view>
    <view class="body">

      <view class="select_box_selcolor" wx:for="{{selguiges[currentindex].colors}}">
        <view bindtap="selcolor"
          class="selguige_item {{selguiges[currentindex].selectedcolor==item.color?'selected':''}}" data-id="{{index}}">
          <text></text>
          <view class="guigetit">{{item.color}}</view>
        </view>
      </view>

    </view>
  </view>
</view>




<loading hidden="{{loadingHidden}}">
  加载中...
</loading>

<view class="Hidden_box" hidden="{{authorizeHidden}}" bindtap="closeauth">
  <view class="Hidden_box_to" catchtap="inauth">
    <view class="title">微信授权</view>
    <view class="close" bindtap="closeauth">
      <image src="../../images/close.png" />
    </view>
    <view class="body">
      <view>为了给您提供更好的服务，需要获取您的微信头像和昵称</view>
      <button wx:if="{{canIUseGetUserProfile}}" bindtap="getUserProfile">{{onauthorizetitle}}</button>
      <button wx:else id="getUserInfo" open-type="getUserInfo"
        bindgetuserinfo="onauthorize">{{onauthorizetitle}}</button>
    </view>
  </view>
</view>
<view class="Hidden_box" hidden="{{authorizeHidden0}}">
  <view class="Hidden_box_to" catchtap="inauth">
    <view class="title">绑定手机号码</view>
    <view class="close" bindtap="closeauth0">
      <image src="../../images/close.png" />
    </view>
    <view class="body">
      <view>为了给您提供更好的服务，需要绑定您的手机号码</view>
      <view class="frombody" wx:if="{{!bindPhoneHidden}}">
        <form bindsubmit='bindPhone'>

          <view>
            <text>手机号码：</text><input name="phone" type="text" bindinput="inputphone" placeholder="填写手机号"
              value="{{phone}}" /><button id="getPhoneNumber" open-type="getPhoneNumber"
              bindgetphonenumber="getPhoneNumber">{{onauthorizetitle0}}</button>
          </view>
          <view>
            <text>手机验证码：</text><input name="code" class="code" type="text" placeholder="填写验证码" value="" /> <button
              bindtap="getcode0">{{getcode0}}</button>
          </view>

          <view class="button">
            <button class="qx" bindtap="closeauth0">取消</button><button form-type="submit">{{savebutton0}}</button>

          </view>
        </form>
      </view>
    </view>
  </view>
</view>
<view class="Hidden_box" hidden="{{closenoticeHidden}}" bindtap="closeauth">
  <view class="Hidden_box_to" catchtap="inauth">
    <view class="title">{{showtitle}}</view>
    <view class="close" bindtap="closeauth">
      <image src="../../images/close.png" />
    </view>
    <view class="body">
      <view class="wxParse">
        <template is="wxParse" data="{{wxParseData:body.nodes}}" />
      </view>
      <button bindtap="closenotice">知道了，关闭</button>

    </view>
  </view>
</view>
<block wx:for="{{myAudios}}">
  <audio id="myAudio" src="audioUrl" autoplay="false" loop=""></audio>
</block>