|
@@ -208,13 +208,17 @@
|
|
|
</view>
|
|
|
<view class="class_item_title" v-if="isAfterDayClass">课程完成</view>
|
|
|
<view class="tag" style="margin: 0;">
|
|
|
- <view class="tag_text" v-if="!isAfterDayClass">{{classList.length === 0 ? '无课' : '下课'}}</view>
|
|
|
+ <view class="tag_text" v-if="!isAfterDayClass">
|
|
|
+ {{classList.length === 0 ? '无课' : '下课'}}
|
|
|
+ </view>
|
|
|
<view class="tag_text" v-if="isAfterDayClass">放学</view>
|
|
|
</view>
|
|
|
- <view class="class_item_subtitle" style="font-weight: 400;font-size: 26rpx;" v-if="!isAfterDayClass">
|
|
|
+ <view class="class_item_subtitle" style="font-weight: 400;font-size: 26rpx;"
|
|
|
+ v-if="!isAfterDayClass">
|
|
|
{{classList.length === 0 ? '合理规划' : '预习下节'}}
|
|
|
</view>
|
|
|
- <view class="class_item_subtitle" style="font-weight: 400;font-size: 26rpx;" v-if="isAfterDayClass">巩固所学</view>
|
|
|
+ <view class="class_item_subtitle" style="font-weight: 400;font-size: 26rpx;"
|
|
|
+ v-if="isAfterDayClass">巩固所学</view>
|
|
|
<view class="flex_row" @click="navClassDetail">
|
|
|
<view class="t-icon t-icon-fenlei"></view>
|
|
|
<view class="class_item_title" style="color: #4169E1;margin-left: 10rpx;">课程列表
|
|
@@ -340,7 +344,7 @@
|
|
|
<view class="flex_row" style="width: 70%;"></view>
|
|
|
</view>
|
|
|
<scroll-view class="scroll_view_bottom" scroll-x="true" :scroll-with-animation="true" scroll-left="0">
|
|
|
- <view class="_item_box" v-for="(item,index) in classData" :key="index">
|
|
|
+ <view class="_item_box" v-for="(item,index) in classData" :key="index" @click="navRecommendInfo(index)">
|
|
|
|
|
|
<view class="column_item_box" v-for="(classItem,i) in item" :key="i">
|
|
|
<view style="display: flex; width: 100%;height: 100%;">
|
|
@@ -513,34 +517,49 @@
|
|
|
let classIndex = -100
|
|
|
//完成课程数目
|
|
|
let finishNum = -100
|
|
|
+ //是否在课堂中
|
|
|
+ let isInClass = false
|
|
|
//判断是否在课程中,若是则赋值为当前课程索引
|
|
|
- this.classList.forEach((item, index) => {
|
|
|
+ this.classList.some((item, index) => {
|
|
|
let timeArr = item.time.split("-")
|
|
|
//在课堂中
|
|
|
let res = CompareDate(timeArr[0], timeArr[1])
|
|
|
if (res) {
|
|
|
classIndex = index + 1
|
|
|
finishNum = index + 1
|
|
|
- }
|
|
|
- //没在课堂中
|
|
|
- let value = CompareDateStart(timeArr[0])
|
|
|
- //课间时间
|
|
|
- if (value) {
|
|
|
- classIndex = -1
|
|
|
- finishNum = index - 1
|
|
|
- } else {
|
|
|
- //放学时间(有课程但已上完状态)
|
|
|
- this.isAfterDayClass = true
|
|
|
- classIndex = -1
|
|
|
- finishNum = this.classList.length
|
|
|
+ return isInClass = true
|
|
|
}
|
|
|
})
|
|
|
- //当前课程赋值
|
|
|
- this.classCurrent = classIndex
|
|
|
- //已上课程赋值
|
|
|
- this.finishClassNum = finishNum
|
|
|
+ if (isInClass) {
|
|
|
+ //当前课程赋值
|
|
|
+ this.classCurrent = classIndex
|
|
|
+ //已上课程赋值
|
|
|
+ this.finishClassNum = finishNum
|
|
|
+ } else {
|
|
|
+ //是否放学
|
|
|
+ this.classList.some((item, index) => {
|
|
|
+ let timeArr = item.time.split("-")
|
|
|
+ //没在课堂中
|
|
|
+ let value = CompareDateStart(timeArr[0])
|
|
|
+ //课间时间
|
|
|
+ if (value) {
|
|
|
+ classIndex = -1
|
|
|
+ finishNum = index - 1
|
|
|
+ return this.isAfterDayClass = false
|
|
|
+ } else {
|
|
|
+ //放学时间(有课程但已上完状态)
|
|
|
+ classIndex = -1
|
|
|
+ finishNum = this.classList.length
|
|
|
+ return this.isAfterDayClass = true
|
|
|
+ }
|
|
|
+ })
|
|
|
+ //当前课程赋值
|
|
|
+ this.classCurrent = classIndex
|
|
|
+ //已上课程赋值
|
|
|
+ this.finishClassNum = finishNum
|
|
|
+ }
|
|
|
//无课程,放假时间
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
//当前课程赋值
|
|
|
this.classCurrent = -1
|
|
|
//已上课程赋值
|
|
@@ -664,6 +683,11 @@
|
|
|
uni.navigateTo({
|
|
|
url: '/subpkg/statslist/clockstats'
|
|
|
})
|
|
|
+ },
|
|
|
+ navRecommendInfo(index){
|
|
|
+ uni.navigateTo({
|
|
|
+ url: `/subpkg/home/recommendinfo?index=${index}`
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
}
|