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.
37 lines
2.3 KiB
37 lines
2.3 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>
|
|
<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" bindlongpress="enter_exercise" data-exercise_id="{{exercise.id}}">
|
|
<view class="exercise-name">
|
|
<text class="exercise-name">{{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>
|
|
<text class="exercise-tip">{{exercise.exercise_tips[0]}}</text>
|
|
<text wx:if="{{exercise.exercise_status!=3&&(exercise.current_status==0 || exercise.current_status==2)}}" class="start-answer tappable" bindtap="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" bindtap="see_exercise" data-exercise_id="{{exercise.id}}">查看答题</text>
|
|
</view>
|
|
</view>
|
|
</block>
|
|
</swiper-item>
|
|
</block>
|
|
</swiper>
|
|
</view>
|
|
|