代码提交

feature/v-xuexi
wangdong 9 months ago
parent a0851c6ee2
commit 6166717459
  1. 20
      pages/index/index.vue
  2. 27
      pages/store/goodsCate.vue

@ -818,15 +818,17 @@ export default {
url: `/pages/course/special_cate`
});
} 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);
}
uni.navigateTo({
url: `/pages/store/goodsCate?type=learning&cate=${item.title}`
})
// try {
// const { data } = await changeCategory({ subject_id: subject_id});
// uni.switchTab({
// url: item.link
// });
// } catch (err) {
// console.log(err);
// }
} else {
uni.navigateTo({
url: item.link

@ -7,7 +7,7 @@
{{ item.name }}
</view>
</view>
<view v-if="bigCate" class="cate-list-right">
<view v-if="bigCate && goodsCateList.length > 0" class="cate-list-right">
<!-- <view v-for="(item, index) in goodsCateList.filter(item => item.name === bigCate)[0].list" class="small-cate-content"> -->
<view class="small-cate-content">
<!-- <view class="small-cate-title">{{ bigCate }} + {{ item.title }}</view> -->
@ -38,8 +38,10 @@
type: '',
};
},
onLoad(options) {
this.type = options.type;
onLoad({type, cate}) {
this.type = type;
this.bigCate = cate || '';
console.log(type, cate);
if (this.type === 'store') {
this.getGoodsCateList();
} else {
@ -59,7 +61,7 @@
children: data.recommend,
},
].concat(data.category_list);
this.bigCate = '特别推荐';
this.bigCate = this.bigCate || '特别推荐';
console.log(this.goodsCateList);
} catch (err) { }
},
@ -74,7 +76,7 @@
children: data.recommend,
},
].concat(data.category_list);
this.bigCate = '特别推荐';
this.bigCate = this.bigCate || '特别推荐';
console.log(this.goodsCateList);
} catch (err) {
console.log(err);
@ -95,12 +97,15 @@
case 'learning':
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();
// 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();
uni.switchTab({
url: '/pages/learning/index',
});
} catch (err) {
console.log(err);
}

Loading…
Cancel
Save