代码提交

feature/v-xuexi
wangdong 10 months ago
parent f8ce62bb55
commit 1cdd79cf9d
  1. 15
      pages/index/index.vue
  2. 10
      pages/learning/index.vue

@ -567,6 +567,7 @@ import SquareStyleCourse from '@/components/Course/squareStyleCourse.vue';
import Advert from '@/components/Advert/index.vue'; import Advert from '@/components/Advert/index.vue';
import { SET_POSITION } from "@/store/types/muations-types"; import { SET_POSITION } from "@/store/types/muations-types";
import { getLocation } from './getLocation.js'; import { getLocation } from './getLocation.js';
import { changeCategory } from '@/api/learning';
const QQMapWx = require('../../libs/qqmap-wx-jssdk.min.js'); const QQMapWx = require('../../libs/qqmap-wx-jssdk.min.js');
@ -794,7 +795,7 @@ export default {
return `/pages/index/unified_list?type=${item.type}&title=${item.title}&recommend_id=${item.id}`; return `/pages/index/unified_list?type=${item.type}&title=${item.title}&recommend_id=${item.id}`;
} }
}, },
getNavHrefTaber(item, bo) { async getNavHrefTaber(item, bo) {
if (item.type === 1) { if (item.type === 1) {
uni.navigateTo({ uni.navigateTo({
url: `/pages/activity/event?id=${this.id}`, url: `/pages/activity/event?id=${this.id}`,
@ -804,7 +805,17 @@ export default {
uni.switchTab({ uni.switchTab({
url: `/pages/course/special_cate` url: `/pages/course/special_cate`
}); });
} else { } else if (item.link.indexOf('/learning/index') > -1) {
const subject_id = item.link.split('=')[1];
try {
const { data } = await changeCategory({ subject_id: subject_id});
uni.switchTab({
url: item.link
});
} catch (err) {
console.log(err);
}
} else {
uni.navigateTo({ uni.navigateTo({
url: item.link url: item.link
}); });

@ -127,6 +127,7 @@ import store from "@/store";
], ],
learningData: {}, learningData: {},
scrollTop: 0, scrollTop: 0,
subject_id: 0
}; };
}, },
computed: { computed: {
@ -151,10 +152,15 @@ import store from "@/store";
methods: { methods: {
async getLearningData() { async getLearningData() {
try { try {
const { data } = await getLearningData({ const params = {
city: this.position, city: this.position,
}); };
if (this.subject_id) {
params.subject_id = this.subject_id;
}
const { data } = await getLearningData(params);
console.log(data); console.log(data);
uni.setStorageSync('subject_id', '');
this.learningData = { ...data }; this.learningData = { ...data };
} catch (err) { } catch (err) {
console.log(err); console.log(err);

Loading…
Cancel
Save