You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
3.1 KiB

<view class="container">
<!-- tab导航栏 -->
<!-- scroll-left属性可以控制滚动条位置 -->
<!-- scroll-with-animation滚动添加动画过渡 -->
<scroll-view scroll-x="true" class="nav" scroll-left="{{navScrollLeft}}" scroll-with-animation="{{true}}">
<block wx:for="{{navData}}" wx:for-index="idx" wx:for-item="navItem" wx:key="idx">
<view class="nav-item {{currentTab == idx ?'active':''}}" data-current="{{idx}}" bindtap="switchNav">
<text>{{navItem.text}}</text>
</view>
</block>
</scroll-view>
<!-- 页面内容 -->
<swiper class="tab-box" current="{{currentTab}}" duration="300" bindchange="switchTab">
<block wx:for="{{navData}}" wx:for-item="navItem" wx:key="exercise_status">
<swiper-item class="tab-content">
<view class="no-content" wx:if="{{exercises.length==0&&!loading}}" class="no-content">
<image class="no-content" src="../../images/none.png" mode="aspectFit"></image>
</view>
<view class="require-login" wx:if="{{loading && require_login}}">
<text class="hint">登陆后查看详情</text>
<navigator url="/pages/login/login">
<text class="tappable">点击登陆</text>
</navigator>
</view>
<block wx:for="{{exercises}}" wx:for-item="exercise" wx:key="id">
<view class="exercise" wx:if="{{exercise.exercise_status==navItem.exercise_status||navItem.exercise_status=='all'}}" class="exercise" catchtap="see_grade" bindlongpress="enter_exercise" data-exercise_id="{{exercise.id}}">
<view class="exercise-name">
<text class="exercise-name" data-exercise_id="{{exercise.id}}" catchtap="exercise_result">{{exercise.exercise_name}}</text>
</view>
<view class="exercise-info flex-wrap">
<text class="hint" wx:if="{{exercise.exercise_status!=3&&(exercise.current_status==0 || exercise.current_status==2)}}">还有{{exercise.exercise_left_time||' '}}截止</text>
<block wx:for="{{exercise.exercise_tips}}" wx:for-item="exercise_tip">
<text class="exercise-tip">{{exercise_tip}}</text>
</block>
<text wx:if="{{exercise.exercise_status!=3&&(exercise.current_status==0 || exercise.current_status==2)}}" class="start-answer tappable" catchtap="enter_exercise" data-exercise_id="{{exercise.id}}">进入答题</text>
<text wx:if="{{(exercise.current_status==1 || exercise.exercise_status==3)&&exercise.current_status!=3}}" class="start-answer tappable" catchtap="see_exercise" data-exercise_id="{{exercise.id}}">查看答题</text>
<text wx:if="{{exercise.current_status==3&&(exercise.exercise_status==1||exercise.exercise_status==2)}}" class="edit-exercise tappable" data-exercise_id="{{exercise.id}}" catchtap="edit_exercise">编辑</text>
</view>
</view>
</block>
<button type="primary" wx:if="{{course.is_admin}}" bindtap="create_exercise">发布试卷</button>
</swiper-item>
</block>
</swiper>
</view>