<!--pages/member/course/CourseIndex/CourseIndex.wxml-->
<view>
  <!-- 搜索框 -->
  <view class="search">
    <view class="searchBox">
      <input type="text" placeholder="搜索课程/讲师" data-type="all" disabled="true" bindtap="moreCourse" />
      <icon class="iconfont icon-sousuo"></icon>
    </view>
  </view>
  <!-- 轮播 -->
  <view class="swiperBox">
    <swiper style='height:{{Height}}' wx:if="{{imgUrls.length>0}}" indicator-dots="true" autoplay="true" interval="4000" duration="1000">
      <block wx:for="{{imgUrls}}" wx:key="{{item.id}}">
        <swiper-item>
          <image class="swiper-img" mode="widthFix" src="{{item.thumb}}" bindload='imgHeight' catchtap='tapNav' data-link="{{item.small_link}}"/>
        </swiper-item>
      </block>
    </swiper>
  </view>
  <!-- 导航 -->
  <view class="navList" wx:if="{{showCarousel}}">
    <view class="viewnav" wx:for='{{navigation}}' wx:key="index" catchtap='tapNav' data-link="{{item.small_link}}">
      <image src="{{item.thumb}}"></image>
      <view class="text_nav">{{item.navigation_name}}</view>
    </view>
  </view>
  <view wx:if="{{recGoodList.length>0}}">
    <!-- <van-cell title="推荐" value="更多" data-type="is_recommand" bindtap="moreCourse" is-link /> -->
    <view class="tagtitle">
      <view class="title_name">推荐</view>
      <view class="title_more" catchtap="gotoSearch" data-type="is_recommand">
        更多
        <van-icon name="arrow" size="32rpx" color="#999" />
      </view>
    </view>
    <view class="rec_swiperBox">
      <view class="ul"bindtouchstart="recommend_startBtn" bindtouchmove="recommend_moveBtn"     bindtouchend="recommend_endBtn" style="margin-left:-{{listMarginLeft}}rpx">
        <view class=" {{index == activeIndex?'act li':'li'}}" wx:for="{{recGoodList}}" wx:key="{{index}}" catchtap="toCourse" data-id="{{item.goods_id}}">
          <view class="recommend_List_top">
            <image src="{{item.thumb}}"></image>
          </view>
          <view class="recommend_List_bottom">
            <view class="top">{{ item.title }}</view>
            <view class="bottom">
              <view class="left" wx:if="{{item.has_one_lecturer}}">
                <icon class="iconfont icon-home-line5"></icon>
                <view class="name">{{item.has_one_lecturer.real_name}}</view>
              </view>
              <view class="right">{{language['money']}} {{ item.price }}</view>
            </view>
          </view>
        </view>
      </view>
    </view>
    <!-- <block wx:for="{{recGoodList}}" wx:key="{{item.goods_id}}">
      <view class="course" data-id="{{item.goods_id}}" catchtap='toCourse'>
        <view class="course-content">
          <view class="course-img">
            <image src="{{item.thumb}}"></image>
          </view>
          <view class="course-text">
            <view class="name">课程名称：{{item.title}}</view>
            <view class="time">共{{ item.course_chapter_num }}小节</view>
            <view>
              <view class="time" style="float:left;">讲师：{{ item.has_one_lecturer.real_name }}</view>
              <view class="money">{{language['money']}}
                <text wx:if="{{item.vip_level_status && item.vip_level_status.status == 1}}" class="s1">{{item.vip_level_status.word}}</text>
                <text class="s2" wx:else>{{item.price}}</text>
              </view>
            </view>
          </view>
          <view style="clear:both"></view>
          <view style="width: 100%;height:0.0625rem;background-color: rgb(235, 235, 235);margin-top: 0.625rem;transform: scaleY(0.5);"></view>
        </view>
      </view>
    </block> -->
  </view>
  <view class="space"></view>
  <view wx:if="{{hotGoodList.length>0}}">
    <view class="tagtitle">
      <view class="title_name">热卖</view>
      <view class="title_more" catchtap="gotoSearch" data-type="is_hot">
        更多
        <van-icon name="arrow" size="32rpx" color="#999" />
      </view>
    </view>
    <view class="hot_lsit ul" >
      <view class='li' wx:for="{{hotGoodList}}" wx:key="{{item.goods_id}}" data-id='{{item.goods_id}}' catchtap='toCourse'>
        <view class="hot_top">
          <image class="img" mode="widthFix" src="{{item.thumb}}"></image>
        </view>
        <view class="hot_bottom">
            <view class="top">{{ item.title }}</view>
            <view class="bottom">
              <view class="left" wx:if="{{item.vip_level_status && item.vip_level_status.status == 1}}">
                    {{language['money']}} <view class="cost2 span">{{ item.vip_level_status.word }}</view>
              </view>
              <view class="left" wx:else>{{language['money']}} {{ item.price }}</view>
              <view class="right">已购买{{item.total_sales}}</view>
            </view>
        </view>
      </view>
    </view>
  </view>

  <!-- <view class="space"></view> -->

  <view wx:if="{{newGoodList.length>0}}">
    <view class="tagtitle">
      <view class="title_name">全部</view>
      <view class="title_more" catchtap="gotoSearch" >
        更多
        <van-icon name="arrow" size="32rpx" color="#999" />
      </view>
    </view>
    <view class="quanBox">
      <block wx:for="{{newGoodList}}" wx:key="{{item.goods_id}}">
        <view class="quanlist" data-id="{{item.goods_id}}" catchtap='toCourse'>
          <view class="quan_left">
            <image src="{{item.thumb}}"></image>
          </view>
          <view class="quan_right">
            <view>
              <view class="video_title">{{item.title}}</view>
              <view class="pitch_number">共{{ item.course_chapter_num }}小节</view>
            </view>
            <view class="quan_bottom">
                <view class="master_name" wx:if="{{item.has_one_lecturer}}">讲师：{{ item.has_one_lecturer.real_name }}</view>
                <view class="price" wx:if="{{item.vip_level_status && item.vip_level_status.status == 1}}">
                  {{language['money']}} <view class="cost2">{{ item.vip_level_status.word }}</view>
                </view>
                <view class="price" wx:else>
                  {{language['money']}} {{ item.price == '0.00'?'免费':item.price }}
                </view>
            </view>
          </view>
        </view>
      </block>
    </view>

    <!-- <block wx:for="{{newGoodList}}" wx:key="{{item.goods_id}}">
      <view class="course" data-id="{{item.goods_id}}" catchtap='toCourse'>
        <view class="course-content">
          <view class="course-img">
            <image src="{{item.thumb}}"></image>
          </view>
          <view class="course-text">
            <view class="name">课程名称：{{item.title}}</view>
            <view class="time">共{{ item.course_chapter_num }}小节</view>
            <view>
              <view class="time" style="float:left;">讲师：{{ item.has_one_lecturer.real_name }}</view>
              <view class="money">{{language['money']}}
                <text wx:if="{{item.vip_level_status && item.vip_level_status.status == 1}}" class="s1">{{item.vip_level_status.word}}</text>
                <text class="s2" wx:else>{{item.price}}</text>
              </view>
            </view>
          </view>
          <view style="clear:both"></view>
          <view style="width: 100%;height:0.0625rem;background-color: rgb(235, 235, 235);margin-top: 0.625rem;transform: scaleY(0.5);"></view>
        </view>
      </view>
    </block> -->
  </view>

  <view class="more" data-type="getmore" bindtap="moreCourse">{{loading?'点击加载更多':'暂无更多'}}</view>

</view>
