|
@@ -11,7 +11,7 @@
|
|
|
<text class="text-30 text-fore-subtitle">课程学习</text>
|
|
<text class="text-30 text-fore-subtitle">课程学习</text>
|
|
|
</template>
|
|
</template>
|
|
|
<template #value>
|
|
<template #value>
|
|
|
- <text v-if="form.courseTime" class="mr-10 text-30 text-fore-title">{{ form.courseTime }}课时</text>
|
|
|
|
|
|
|
+ <text v-if="form.videoTime" class="mr-10 text-30 text-fore-title">{{ form.videoTime }}课时</text>
|
|
|
<text v-else class="mr-10 text-30 text-fore-placeholder">去设置</text>
|
|
<text v-else class="mr-10 text-30 text-fore-placeholder">去设置</text>
|
|
|
</template>
|
|
</template>
|
|
|
</uv-cell>
|
|
</uv-cell>
|
|
@@ -21,7 +21,7 @@
|
|
|
<text class="text-30 text-fore-subtitle">题库练习</text>
|
|
<text class="text-30 text-fore-subtitle">题库练习</text>
|
|
|
</template>
|
|
</template>
|
|
|
<template #value>
|
|
<template #value>
|
|
|
- <text v-if="form.questionTime" class="mr-10 text-30 text-fore-title">{{ form.questionTime }}题</text>
|
|
|
|
|
|
|
+ <text v-if="form.questionCnt" class="mr-10 text-30 text-fore-title">{{ form.questionCnt }}题</text>
|
|
|
<text v-else class="mr-10 text-30 text-fore-placeholder">去设置</text>
|
|
<text v-else class="mr-10 text-30 text-fore-placeholder">去设置</text>
|
|
|
</template>
|
|
</template>
|
|
|
</uv-cell>
|
|
</uv-cell>
|
|
@@ -43,7 +43,8 @@ import { StudyPlan } from '@/types/study';
|
|
|
import CourseSetting from './components/course-setting.vue';
|
|
import CourseSetting from './components/course-setting.vue';
|
|
|
import QuestionSetting from './components/question-setting.vue';
|
|
import QuestionSetting from './components/question-setting.vue';
|
|
|
import { saveStudyPlan } from '@/api/modules/study';
|
|
import { saveStudyPlan } from '@/api/modules/study';
|
|
|
-// type SubmitStudyPlan = Omit<StudyPlan, 'id' | 'beginTime' | 'studentId' | 'status'>;
|
|
|
|
|
|
|
+import { useTransferPage } from '@/hooks/useTransferPage';
|
|
|
|
|
+const { prevData } = useTransferPage();
|
|
|
const cellStyle = {
|
|
const cellStyle = {
|
|
|
padding: '30rpx 40rpx'
|
|
padding: '30rpx 40rpx'
|
|
|
}
|
|
}
|
|
@@ -51,34 +52,43 @@ const rightIconStyle = {
|
|
|
fontSize: '14px'
|
|
fontSize: '14px'
|
|
|
}
|
|
}
|
|
|
const form = ref({
|
|
const form = ref({
|
|
|
- courseTime: null as number | null,
|
|
|
|
|
- questionTime: null as number | null
|
|
|
|
|
|
|
+ questionCnt: 0,
|
|
|
|
|
+ videoTime: 0
|
|
|
})
|
|
})
|
|
|
const courseStudySetting = ref();
|
|
const courseStudySetting = ref();
|
|
|
const questionStudySetting = ref();
|
|
const questionStudySetting = ref();
|
|
|
const handleCourseStudySetting = () => {
|
|
const handleCourseStudySetting = () => {
|
|
|
- courseStudySetting.value.open(form.value.courseTime, (time: number) => {
|
|
|
|
|
- form.value.courseTime = time;
|
|
|
|
|
|
|
+ courseStudySetting.value.open(form.value.videoTime, (time: number) => {
|
|
|
|
|
+ form.value.videoTime = time;
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
const handleQuestionStudySetting = () => {
|
|
const handleQuestionStudySetting = () => {
|
|
|
- questionStudySetting.value.open(form.value.questionTime, (time: number) => {
|
|
|
|
|
- form.value.questionTime = time;
|
|
|
|
|
|
|
+ questionStudySetting.value.open(form.value.questionCnt, (time: number) => {
|
|
|
|
|
+ form.value.questionCnt = time;
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
const handleConfirm = async () => {
|
|
const handleConfirm = async () => {
|
|
|
- const { courseTime, questionTime } = form.value;
|
|
|
|
|
- if (questionTime == null || courseTime == null) {
|
|
|
|
|
- uni.$ie.showToast('请设置题库学习计划');
|
|
|
|
|
|
|
+ const { questionCnt, videoTime } = form.value;
|
|
|
|
|
+ if (!questionCnt) {
|
|
|
|
|
+ uni.$ie.showToast('请设置题库练习计划');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- console.log(form.value);
|
|
|
|
|
- // await saveStudyPlan(form.value);
|
|
|
|
|
|
|
+ uni.$ie.showLoading();
|
|
|
|
|
+ await saveStudyPlan(form.value);
|
|
|
|
|
+ uni.$ie.hideLoading();
|
|
|
uni.$ie.showToast('保存成功');
|
|
uni.$ie.showToast('保存成功');
|
|
|
- uni.navigateBack();
|
|
|
|
|
- // uni.$ie.showToast('保存成功');
|
|
|
|
|
- // uni.navigateBack();
|
|
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ uni.navigateBack();
|
|
|
|
|
+ }, 500);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+onLoad(() => {
|
|
|
|
|
+ form.value = {
|
|
|
|
|
+ ...prevData.value,
|
|
|
|
|
+ questionCnt: prevData.value.questionCnt || 0,
|
|
|
|
|
+ videoTime: prevData.value.videoTime || 0
|
|
|
|
|
+ }
|
|
|
|
|
+});
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped></style>
|
|
<style lang="scss" scoped></style>
|