调整课表
This commit is contained in:
parent
de714aeb69
commit
d26a8fb38f
@ -5,15 +5,18 @@
|
||||
<uni-icons type="right" size="16" color="#fff"></uni-icons>
|
||||
</view>
|
||||
|
||||
<view class="date-tabs">
|
||||
<view class="date-tabs" v-if="rqList.length > 0">
|
||||
<view v-for="(day, index) in rqList" :key="index" :class="['date-tab-item', { active: curRqIndex === index }]"
|
||||
@click="selectDay(index)">
|
||||
<text class="weekday">{{ day.zjmc }}</text>
|
||||
<text class="date">{{ day.rqmc }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="no-course-notice" v-else>
|
||||
<text class="notice-text">本周处于节假日中,无课程信息</text>
|
||||
</view>
|
||||
|
||||
<view class="schedule-body">
|
||||
<view class="schedule-body" v-if="rqList.length > 0 && sjList.length > 0">
|
||||
<view v-for="(sj, index) in sjList" :key="index" class="schedule-row">
|
||||
<view class="time-slot">
|
||||
<text class="slot-name">{{ sj.mc }}</text>
|
||||
@ -88,7 +91,14 @@ const curRqIndex = ref(0)
|
||||
// 周次列表
|
||||
const zcList = ref<any>([])
|
||||
// 日期列表
|
||||
const rqList = ref<any>([])
|
||||
const rqList = computed(() => {
|
||||
if (!curZc.value || !curZc.value.drList || !curZc.value.drList.length) {
|
||||
return [];
|
||||
}
|
||||
return curZc.value.drList.filter((dr: any) => {
|
||||
return (!dr.holiday && dr.zj <= 5) || (dr.holiday && dr.holiday.type != 2);
|
||||
});
|
||||
});
|
||||
// 时间列表
|
||||
const sjList = ref<any>([])
|
||||
|
||||
@ -98,10 +108,8 @@ const isLoading = ref(false);
|
||||
const showWeekPicker = ref(false);
|
||||
const weekPopup = ref<any>(null);
|
||||
|
||||
const selectedWeekNumber = ref(0);
|
||||
const targetScrollTop = ref(0); // 新增:用于绑定 scroll-top
|
||||
|
||||
|
||||
// 打开周选择弹窗
|
||||
const openWeekPicker = async () => {
|
||||
showWeekPicker.value = true;
|
||||
@ -137,7 +145,6 @@ const selectWeek = (zc: any) => {
|
||||
}
|
||||
// 复制
|
||||
Object.assign(curZc.value, zc);
|
||||
Object.assign(rqList.value, curZc.value.drList);
|
||||
|
||||
// 关闭弹窗
|
||||
closeWeekPicker();
|
||||
@ -152,13 +159,21 @@ const selectDay = (index: number) => {
|
||||
if (!rqList.value.length) {
|
||||
return;
|
||||
}
|
||||
drpkkbApi({
|
||||
const params = {
|
||||
jsId: "",
|
||||
bjId: getCurXs.bjId,
|
||||
xqId: xqId,
|
||||
rq: rqList.value[index].rq, // 用于查询代课信息
|
||||
zj: rqList.value[index].zj
|
||||
}).then(res => {
|
||||
zj: rqList.value[index].zj,
|
||||
txDate: null
|
||||
};
|
||||
if (params.zj > 5) {
|
||||
const holiday = rqList.value[index].holiday || {};
|
||||
if (holiday && holiday.type === 3 && holiday.txDate) {
|
||||
params.txDate = holiday.txDate;
|
||||
}
|
||||
}
|
||||
drpkkbApi(params).then(res => {
|
||||
// 根据接口返回的result判断是否已报名
|
||||
if (res && res.resultCode === 1) {
|
||||
sjList.value = res.result;
|
||||
@ -185,10 +200,10 @@ const getCourseColorClass = (subject: string | undefined): string => {
|
||||
onMounted(async () => {
|
||||
const res = await dqpkApi();
|
||||
const result = res.result;
|
||||
dqZc = res.result.dqZc;
|
||||
xqId = res.result.dqXq.id;
|
||||
dqZc = res.result.zc;
|
||||
xqId = res.result.xq.id;
|
||||
zcList.value = result.zcList;
|
||||
sjList.value = result.sjList;
|
||||
sjList.value = [];
|
||||
|
||||
// 按当前日期定位到对应的周次和星期几
|
||||
const today = dayjs();
|
||||
@ -235,6 +250,7 @@ onMounted(async () => {
|
||||
display: flex;
|
||||
background-color: #4477ee;
|
||||
padding: 10px 15px 15px 15px;
|
||||
overflow-x: auto;
|
||||
gap: 10px;
|
||||
|
||||
.date-tab-item {
|
||||
@ -242,12 +258,13 @@ onMounted(async () => {
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 8px 5px;
|
||||
border-radius: 6px;
|
||||
padding: 16rpx 10rpx;
|
||||
border-radius: 12rpx;
|
||||
background-color: rgba(255, 255, 255, 0.1);
|
||||
color: #ffffff;
|
||||
flex: 1;
|
||||
min-width: 50px;
|
||||
min-width: 100rpx;
|
||||
max-width: 118rpx;
|
||||
cursor: pointer;
|
||||
transition: background-color 0.2s ease;
|
||||
|
||||
@ -476,4 +493,14 @@ onMounted(async () => {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.no-course-notice {
|
||||
margin: 15px;
|
||||
background-color: #fff;
|
||||
border-radius: 8px;
|
||||
padding: 50px 15px;
|
||||
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user