代码提交

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){ export function reciteClock(params){
return http.get("/clearance/recite", 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() { data() {
return { return {
loading: false, loading: false,
myExam: {
examName: '职业技能考试',
grade_id: 1,
subject_id: 7,
examTime: '2024-1-12',
examDays: 180,
},
indexMenu: [ indexMenu: [
{ menuName: '视频课', key: 'video' }, { menuName: '视频课', key: 'video' },
{ menuName: '直播课', key: 'live' }, { menuName: '直播课', key: 'live' },
@ -141,15 +134,7 @@ import store from "@/store";
return store.getters.position; return store.getters.position;
}, },
}, },
watch: { onShow() {
myExam: {
deep: true,
handler() {
this.getLearningData();
},
}
},
onLoad() {
this.getLearningData(); this.getLearningData();
}, },
onPageScroll(e) { onPageScroll(e) {
@ -167,7 +152,6 @@ import store from "@/store";
async getLearningData() { async getLearningData() {
try { try {
const { data } = await getLearningData({ const { data } = await getLearningData({
subject_id: this.myExam.subject_id,
city: this.position, city: this.position,
}); });
console.log(data); console.log(data);
@ -199,11 +183,11 @@ import store from "@/store";
toMoreCourse(key) { toMoreCourse(key) {
if (key === 'offline_courses') { if (key === 'offline_courses') {
uni.navigateTo({ 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 { } else {
uni.navigateTo({ 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) { toPractice(id) {
uni.navigateTo({ uni.navigateTo({
url: `/pages/topic/problem_index?id=${id}`, url: `/pages/special/question_index?id=${id}&is_analysis=${1}`,
}); });
} }
}, },

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

@ -35,7 +35,7 @@
</view> </view>
</view> </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">开始练习</view>
<view v-if="status === 1">再次练习</view> <view v-if="status === 1">再次练习</view>
<view v-if="status === 2">继续练习</view> <view v-if="status === 2">继续练习</view>
@ -68,14 +68,16 @@ export default {
return { return {
problem: {}, problem: {},
id: 0, id: 0,
type: 1,
status:-1 status:-1
}; };
}, },
onShow(){ onShow(){
this.getsituationRecord(); this.getsituationRecord();
}, },
onLoad({ id }) { onLoad({ id, type }) {
this.id = id; this.id = id;
this.type = type || 1;
this.init(); this.init();
}, },
methods: { methods: {

Loading…
Cancel
Save