代码提交

feature/v-xuexi
wangdong 10 months ago
parent 032d3160e1
commit b898d79f8d
  1. 4
      api/learning.js
  2. 24
      pages/learning/index.vue
  3. 20
      pages/store/goodsCate.vue
  4. 6
      pages/topic/problem_index.vue

@ -22,4 +22,8 @@ export function getDateRecordList(params){
export function reciteClock(params){
return http.get("/clearance/recite", params)
}
export function changeCategory(params){
return http.get("/clearance/study", params)
}

@ -120,13 +120,6 @@ import store from "@/store";
data() {
return {
loading: false,
myExam: {
examName: '职业技能考试',
grade_id: 1,
subject_id: 7,
examTime: '2024-1-12',
examDays: 180,
},
indexMenu: [
{ menuName: '视频课', key: 'video' },
{ menuName: '直播课', key: 'live' },
@ -141,15 +134,7 @@ import store from "@/store";
return store.getters.position;
},
},
watch: {
myExam: {
deep: true,
handler() {
this.getLearningData();
},
}
},
onLoad() {
onShow() {
this.getLearningData();
},
onPageScroll(e) {
@ -167,7 +152,6 @@ import store from "@/store";
async getLearningData() {
try {
const { data } = await getLearningData({
subject_id: this.myExam.subject_id,
city: this.position,
});
console.log(data);
@ -199,11 +183,11 @@ import store from "@/store";
toMoreCourse(key) {
if (key === 'offline_courses') {
uni.navigateTo({
url: `/pages/activity/activity_list?gradeId=${this.myExam.gradeId}&subjectId=${this.myExam.subjectId}`
url: `/pages/activity/activity_list?gradeId=${this.learningData.exam.gradeId}&subjectId=${this.learningData.exam.subjectId}`
});
} else {
uni.navigateTo({
url: `/pages/special/search?gradeId=${this.myExam.grade_id}&subjectId=${this.myExam.subject_id}&specialType=${ key === 'live' ? 4 : 3}`
url: `/pages/special/search?gradeId=${this.learningData.exam.grade_id}&subjectId=${this.learningData.exam.subject_id}&specialType=${ key === 'live' ? 4 : 3}`
})
}
},
@ -219,7 +203,7 @@ import store from "@/store";
},
toPractice(id) {
uni.navigateTo({
url: `/pages/topic/problem_index?id=${id}`,
url: `/pages/special/question_index?id=${id}&is_analysis=${1}`,
});
}
},

@ -28,6 +28,7 @@
<script>
import { getGoodsCateList, getGoodsList, getIndexData } from "@/api/store";
import { getSpecialSubject } from '@/api/special';
import { changeCategory } from '@/api/learning';
export default {
data() {
@ -79,7 +80,7 @@
console.log(err);
}
},
toList(con) {
async toList(con) {
switch (this.type){
case 'store':
uni.navigateTo({
@ -92,12 +93,17 @@
});
break;
case 'learning':
let pages = getCurrentPages();
let prevPage = pages[pages.length - 2];
prevPage.$vm.learningData.exam.name = con.name;
prevPage.$vm.learningData.exam.grade_id = con.grade_id;
prevPage.$vm.learningData.exam.subject_id = con.id;
uni.navigateBack();
try {
const { data } = await changeCategory({ subject_id: con.id});
let pages = getCurrentPages();
let prevPage = pages[pages.length - 2];
prevPage.$vm.learningData.exam.name = con.name;
prevPage.$vm.learningData.exam.grade_id = con.grade_id;
prevPage.$vm.learningData.exam.subject_id = con.id;
uni.navigateBack();
} catch (err) {
console.log(err);
}
break;
default:
break;

@ -35,7 +35,7 @@
</view>
</view>
<view>
<navigator :url="`/pages/topic/problem_detail?type=1&test_id=${id}`">
<navigator :url="`/pages/topic/problem_detail?type=${type}&test_id=${id}`">
<view v-if="!status">开始练习</view>
<view v-if="status === 1">再次练习</view>
<view v-if="status === 2">继续练习</view>
@ -68,14 +68,16 @@ export default {
return {
problem: {},
id: 0,
type: 1,
status:-1
};
},
onShow(){
this.getsituationRecord();
},
onLoad({ id }) {
onLoad({ id, type }) {
this.id = id;
this.type = type || 1;
this.init();
},
methods: {

Loading…
Cancel
Save