|
|
<!--index.wxml-->
|
|
|
<view class="container">
|
|
|
<!-- 页面标题 -->
|
|
|
<view class="page-header">
|
|
|
<text class="page-title">我的课程表</text>
|
|
|
<view class="week-selector">
|
|
|
<text class="week-btn" bindtap="onPrevWeek">‹</text>
|
|
|
<text class="current-week">第{{currentWeek}}周</text>
|
|
|
<text class="week-btn" bindtap="onNextWeek">›</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
<!-- 星期标题栏 -->
|
|
|
<view class="week-header">
|
|
|
<view class="time-header">节次</view>
|
|
|
<view class="week-item" wx:for="{{weekDays}}" wx:key="index">
|
|
|
<text class="week-day">{{item.name}}</text>
|
|
|
<text class="week-date">{{item.date}}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
<!-- 课程表内容 -->
|
|
|
<scroll-view class="schedule-content" scroll-y="true">
|
|
|
<view wx:if="{{scheduleGrid.length > 0}}" class="schedule-grid">
|
|
|
<!-- 课程表行 -->
|
|
|
<view class="schedule-row" wx:for="{{scheduleGrid}}" wx:key="index" wx:for-item="row" wx:for-index="rowIndex">
|
|
|
<!-- 时间段列 -->
|
|
|
<view class="time-slot-cell">
|
|
|
<text class="time-slot-name">{{row.timeSlotName}}</text>
|
|
|
<text class="time-slot-time">{{row.timeSlotTime}}</text>
|
|
|
</view>
|
|
|
|
|
|
<!-- 课程列 -->
|
|
|
<view class="course-cell" wx:for="{{row.courses}}" wx:key="index" wx:for-item="course" wx:for-index="dayIndex">
|
|
|
<view wx:if="{{course}}"
|
|
|
class="course-item"
|
|
|
bindtap="onCourseItemTap"
|
|
|
bindlongpress="onCourseItemLongPress"
|
|
|
data-course="{{course}}">
|
|
|
<text class="course-name">{{course.courseName}}</text>
|
|
|
<text class="course-location">{{course.classroom}}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
<!-- 空状态 -->
|
|
|
<view wx:else class="empty-state">
|
|
|
<image class="empty-icon" src="/images/empty-schedule.png" mode="aspectFit"></image>
|
|
|
<text class="empty-text">还没有课程安排</text>
|
|
|
<text class="empty-tip">点击下方按钮添加课程或使用OCR导入</text>
|
|
|
</view>
|
|
|
</scroll-view>
|
|
|
|
|
|
<!-- 底部操作按钮 -->
|
|
|
<view class="bottom-actions">
|
|
|
<button class="action-btn primary" bindtap="onAddCourseTap">
|
|
|
<text class="btn-text">添加课程</text>
|
|
|
</button>
|
|
|
<button class="action-btn secondary" bindtap="onOcrImportTap">
|
|
|
<text class="btn-text">OCR导入</text>
|
|
|
</button>
|
|
|
</view>
|
|
|
|
|
|
<!-- 课程详情弹窗 -->
|
|
|
<view wx:if="{{showCourseDetail}}" class="course-detail-modal" bindtap="onCloseDetailModal">
|
|
|
<view class="course-detail-content" catchtap="onStopPropagation">
|
|
|
<view class="detail-header">
|
|
|
<text class="detail-title">课程详情</text>
|
|
|
<view class="close-btn" bindtap="onCloseDetailModal">×</view>
|
|
|
</view>
|
|
|
|
|
|
<view class="detail-body">
|
|
|
<view class="detail-item">
|
|
|
<text class="detail-label">课程名称</text>
|
|
|
<text class="detail-value">{{selectedCourse.courseName}}</text>
|
|
|
</view>
|
|
|
|
|
|
<view class="detail-item">
|
|
|
<text class="detail-label">上课地点</text>
|
|
|
<text class="detail-value">{{selectedCourse.classroom}}</text>
|
|
|
</view>
|
|
|
|
|
|
<view class="detail-item" wx:if="{{selectedCourse.teacherName}}">
|
|
|
<text class="detail-label">任课教师</text>
|
|
|
<text class="detail-value">{{selectedCourse.teacherName}}</text>
|
|
|
</view>
|
|
|
|
|
|
<view class="detail-item">
|
|
|
<text class="detail-label">上课时间</text>
|
|
|
<text class="detail-value">{{selectedCourse.startTime}} - {{selectedCourse.endTime}}</text>
|
|
|
</view>
|
|
|
|
|
|
<view class="detail-item" wx:if="{{selectedCourse.formattedWeeks}}">
|
|
|
<text class="detail-label">周次</text>
|
|
|
<text class="detail-value">{{selectedCourse.formattedWeeks}}</text>
|
|
|
</view>
|
|
|
|
|
|
<view class="detail-item" wx:if="{{selectedCourse.notes}}">
|
|
|
<text class="detail-label">备注</text>
|
|
|
<text class="detail-value">{{selectedCourse.notes}}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
<view class="detail-actions">
|
|
|
<button class="detail-btn edit" bindtap="onEditCourse">编辑</button>
|
|
|
<button class="detail-btn delete" bindtap="onDeleteCourse">删除</button>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|