studyCenter.wxml 7.05 KB
<!--packageStudyCenter/pages/studyCenter/studyCenter.wxml-->
<block wx:if="{{showScreen}}">
  <navigation-bar showBack bindnavbarReady="navbarReady" class="navigation-header" bindback="containerBack" navStyle="background-color:#fff;box-shadow:none;">筛选</navigation-bar>
</block>
<block wx:elif="{{showCategory}}">
  <navigation-bar showBack bindnavbarReady="navbarReady" class="navigation-header" bindback="containerCategoryBack" navStyle="background-color:#fff;box-shadow:none;">全部课程</navigation-bar>
</block>
<block wx:else>
  <navigation-bar class="navigation-header" showBack bindnavbarReady="navbarReady" bindback="back" navStyle="background-color:#fff;box-shadow:none;">
    <view>学习中心</view>
  </navigation-bar>
</block>
<scroll-view scroll-y bindscroll="onPageScroll" scroll-top="{{setScrollTop}}" enhanced="{{true}}" show-scrollbar="{{false}}" class="container" bindscrolltolower="scrollonReachBottom" style="margin-top: {{navBarHeight}}px;height: calc(100vh - {{navBarHeight}}px);">
  <view class="box top-box">
    <view class="title">我的学习时长</view>
    <view class="time-box">
      <view class="item">
        <view class="tap">累计</view>
        <view class="time-content">
          <view class="time">{{statisticsData.totalHour != null ? statisticsData.totalHour : '-'}}<text class="unit">小时</text></view>
        </view>
      </view>
      <view class="item">
        <view class="tap">本月</view>
        <view class="time-content">
          <view class="time">{{statisticsData.monHour != null ? statisticsData.monHour : '-'}}<text class="unit">小时</text></view>
          <view class="ring">
            对比上月
            <block wx:if="{{statisticsData.monHourRatio != null}}">
              <view class="rate {{statisticsData.monHourRatio > 0 ? 'up' : statisticsData.monHourRatio < 0 ? 'down' : ''}}">
                {{statisticsData._monHourRatio}}%
              </view>
            </block>
            <block wx:else>
              <view class="rate">-</view>
            </block>
            <image class="icon" src="{{IMG_URL}}studyCenter/{{statisticsData.monHourRatio > 0 ? 'up' : statisticsData.monHourRatio < 0 ? 'down' : 'stay'}}.png" mode=""/>
          </view>
        </view>
      </view>
    </view>
  </view>
  <view class="box menu">
    <view class="menu-item" wx:for="{{menuList}}" wx:key="index" bindtap="navGo" data-item="{{item}}">
      <view class="icon">
        <image src="{{ IMG_URL}}studyCenter/{{item.icon}}.png" />
      </view>
      <view class="text">{{item.name}}</view>
      <view class="hot_icon" wx:if="{{ item.tipsFlag && statisticsData.unReadCount }}"></view>
    </view>
  </view>
  <view class="ing-box">
    <view class="title">
      正在学习
      <view class="text-btn" bindtap="goPage">
        查看全部
        <image class="icon" src="{{IMG_URL}}studyCenter/arrow-right.png" mode=""/>
      </view>
    </view>
    <view class="tips-box">
      本周学习时长{{statisticsData.weekHour != null ? statisticsData.weekHour : '-'}}小时
    </view>
    <block wx:if="{{myCourseList.length}}">
      <scroll-view scroll-x enhanced="{{true}}" show-scrollbar="{{false}}">
        <view class="studying-box">
          <view class="studying-item" bindtap="goBeisenDetail" data-target="{{item}}" wx:for="{{myCourseList}}" wx:key="index">
            <card-item infoData="{{item}}" formItems="{{formItems}}"></card-item>
          </view>
        </view>
      </scroll-view>
    </block>
    <block wx:else>
      <view class="nothing">
        <image class="icon" src="{{IMG_URL}}studyCenter/empty_data.png" />
        暂无数据
      </view>
    </block>
  </view>
  <view class="all-box">
    <view class="sticky-box">
      <view class="title">全部课程</view>
      <view class="search-box">
        <view class="search-input">
          <view class="placeholder-area" wx:if="{{!searchTitle}}">
            <image 
              src="{{IMG_URL}}studyCenter/search-icon.png" 
              class="search-icon" 
            />
            <text class="placeholder-text">搜索课程</text>
          </view>
          <input
            type="text"
            class="input"
            value="{{searchTitle}}"
            placeholder-class="input-placeholder"
            bindinput="searchInput"
            bindconfirm="search" />
          <block wx:if="{{ searchTitle }}">
            <image src="{{ IMG_URL }}images/clear.png" class="search-clear" bindtap="clear" />
          </block>
        </view>
      </view>
      <view class="screen-box">
        <view class="left">
          <view class="item" bindtap="handleSort">
            <view class="text">{{sortObj.id !== '' ? sortObj.label : '最多人学'}}</view>
            <image class="icon" src="{{IMG_URL}}studyCenter/arrow-down.png" mode=""/>
          </view>
          <view class="item" bindtap="handleCategory">
            <view class="text">{{categoryObj.label || '全部课程'}}</view>
            <image class="icon" src="{{IMG_URL}}studyCenter/arrow-down.png" mode=""/>
          </view>
          <view class="item" bindtap="handleScreen">
            <view class="text">筛选</view>
            <image class="icon" src="{{IMG_URL}}studyCenter/screen-icon.png" mode=""/>
          </view>
        </view>
        <view class="total">共{{total}}门课程</view>
      </view>
    </view>
    <view class="all-list" style="min-height: calc(100vh - {{fixedHeight}}px - {{navBarHeight}}px);">
      <block wx:if="{{allList.length}}">
        <view class="list-box">
          <block wx:for="{{allList}}" wx:key="index">
            <view class="all-item" bindtap="goBeisenDetail" data-target="{{item}}">
              <card-item infoData="{{item}}" formItems="{{allFormItems}}"></card-item>
            </view>
          </block>
        </view>
      </block>
      <block wx:else>
        <view class="nothing" style="height: calc(100vh - {{fixedHeight}}px - {{navBarHeight}}px);">
          <image class="icon" src="{{IMG_URL}}studyCenter/empty_data.png" />
          暂无数据
        </view>
      </block>
      <block>
        <view class="end-text" wx:if="{{loadingList}}">更多课程加载中...</view>
        <view class="end-text" wx:if="{{nothing && allList.length && !loading}}">更多课程即将上架,敬请期待</view>
      </block>
    </view>
  </view>
</scroll-view>
<sort-popup show="{{showSortPopup}}" title="综合排序" bindconfirm="sortConfirm" bindcancel="sortCancel" activeId="{{sortObj.id}}"></sort-popup>
<page-container show="{{ showCategory || showScreen }}" duration="{{ 0 }}" overlay="{{ false }}">
  <view wx:if="{{ showCategory }}">
    <category-screen show="{{ showCategory }}" activeId="{{categoryObj.id}}" navBarHeight="{{ navBarHeight }}" bindconfirm="searchCategoryScreen" />
  </view>
  <view wx:if="{{ showScreen }}">
    <list-screen show="{{ showScreen }}" navBarHeight="{{ navBarHeight }}" screenObj="{{screenObj}}" bindconfirm="searchScreen" />
  </view>
</page-container>
<study-permission-modal id="customModal" />
<exam-submit-popup id="examPopup" bindcancel="examHandleCancel" bindconfirm="examHandleConfirm" examSubmitText="{{examSubmitText}}" />