1
This commit is contained in:
123
pages/schedule/schedule.wxml
Normal file
123
pages/schedule/schedule.wxml
Normal file
@@ -0,0 +1,123 @@
|
||||
<!--pages/schedule/schedule.wxml-->
|
||||
<view class="container">
|
||||
<view class="header">
|
||||
<view class="header-title">我的课程表</view>
|
||||
<view class="header-right">
|
||||
<view class="add-btn" bindtap="onAddCourse">
|
||||
<text class="add-icon">+</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 周次切换器 -->
|
||||
<view class="week-selector">
|
||||
<view class="week-btn" bindtap="onPrevWeek">
|
||||
<text class="week-arrow">◀</text>
|
||||
</view>
|
||||
<view class="week-display" bindtap="onCurrentWeek">
|
||||
<text class="week-text">第{{currentWeek}}周</text>
|
||||
<text class="week-hint">点击回到本周</text>
|
||||
</view>
|
||||
<view class="week-btn" bindtap="onNextWeek">
|
||||
<text class="week-arrow">▶</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="schedule-container">
|
||||
<view class="schedule-table">
|
||||
<!-- 表头 -->
|
||||
<view class="table-header">
|
||||
<view class="time-column header-cell">时间</view>
|
||||
<view class="day-column header-cell" wx:for="{{weekDays}}" wx:key="index">
|
||||
{{item}}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 课程格子 -->
|
||||
<view class="table-row" wx:for="{{scheduleData}}" wx:key="index" wx:for-item="row">
|
||||
<view class="time-column time-cell">{{row.period}}</view>
|
||||
<view
|
||||
class="day-column course-cell {{item.hasCourse ? 'has-course' : ''}}"
|
||||
wx:for="{{row.courses}}"
|
||||
wx:key="index"
|
||||
wx:for-item="item"
|
||||
data-day="{{item.day}}"
|
||||
data-period="{{row.period}}"
|
||||
data-course="{{item.course}}"
|
||||
bindtap="onCourseClick"
|
||||
bindlongpress="onCourseLongPress"
|
||||
>
|
||||
<block wx:if="{{item.course}}">
|
||||
<view class="course-name">{{item.course.name}}</view>
|
||||
<view class="course-location">{{item.course.location}}</view>
|
||||
</block>
|
||||
<view class="empty-hint" wx:else>
|
||||
<text class="hint-text">+</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 快捷操作按钮 -->
|
||||
<view class="action-buttons">
|
||||
<button class="action-btn copy-btn" bindtap="onCopySchedule">
|
||||
<text class="btn-icon">📋</text>
|
||||
<text class="btn-text">复制课表到其他周</text>
|
||||
</button>
|
||||
</view>
|
||||
|
||||
<view class="legend">
|
||||
<view class="legend-item">
|
||||
<view class="legend-color has-course"></view>
|
||||
<text class="legend-text">有课</text>
|
||||
</view>
|
||||
<view class="legend-item">
|
||||
<view class="legend-color"></view>
|
||||
<text class="legend-text">无课</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 添加/编辑课程弹窗 -->
|
||||
<view class="modal-mask" wx:if="{{showEditModal}}" bindtap="closeEditModal">
|
||||
<view class="modal-dialog" catchtap="doNothing">
|
||||
<view class="modal-header">
|
||||
<text class="modal-title">{{editMode === 'add' ? '添加课程' : '编辑课程'}}</text>
|
||||
<view class="modal-close" bindtap="closeEditModal">✕</view>
|
||||
</view>
|
||||
|
||||
<view class="modal-content">
|
||||
<view class="form-item">
|
||||
<text class="form-label">课程名称</text>
|
||||
<input
|
||||
class="form-input"
|
||||
placeholder="请输入课程名称"
|
||||
value="{{editCourse.name}}"
|
||||
bindinput="onCourseNameInput"
|
||||
/>
|
||||
</view>
|
||||
|
||||
<view class="form-item">
|
||||
<text class="form-label">上课地点</text>
|
||||
<input
|
||||
class="form-input"
|
||||
placeholder="请输入上课地点"
|
||||
value="{{editCourse.location}}"
|
||||
bindinput="onCourseLocationInput"
|
||||
/>
|
||||
</view>
|
||||
|
||||
<view class="form-item">
|
||||
<text class="form-label">上课时间</text>
|
||||
<view class="time-display">{{editDay}} {{editPeriod}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="modal-footer">
|
||||
<button class="modal-btn cancel-btn" bindtap="closeEditModal">取消</button>
|
||||
<button class="modal-btn delete-btn" wx:if="{{editMode === 'edit'}}" bindtap="onDeleteCourse">删除</button>
|
||||
<button class="modal-btn confirm-btn" bindtap="onSaveCourse">保存</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
Reference in New Issue
Block a user