【代码优化】进入分类页的时候,自动勾选左侧一级分类(比如从首页进入)

pull/75/MERGE
YunaiV 2024-08-10 10:25:51 +08:00
parent 92b9820f20
commit 51ba185e81
3 changed files with 7 additions and 12 deletions

View File

@ -157,7 +157,7 @@
items: [{ items: [{
skuId: e.id, skuId: e.id,
count: e.goods_num, count: e.goods_num,
categoryId: state.goodsInfo.categoryId categoryId: state.goodsInfo.categoryId
}] }]
}), }),
}); });

View File

@ -196,7 +196,7 @@
}); });
} }
// TODO //
const shareInfo = computed(() => { const shareInfo = computed(() => {
if (isEmpty(unref(activity))) return {}; if (isEmpty(unref(activity))) return {};
return sheep.$platform.share.getShareInfo( return sheep.$platform.share.getShareInfo(

View File

@ -133,16 +133,11 @@
onLoad(async (params) => { onLoad(async (params) => {
await getList(); await getList();
// //
const foundCategory = state.categoryList.find(category => category.id == params.id); const foundCategory = state.categoryList.find(category => category.id === params.id);
// onMenu onMenu(0) // onMenu onMenu(0)
onMenu(foundCategory ? state.categoryList.indexOf(foundCategory) : 0); onMenu(foundCategory ? state.categoryList.indexOf(foundCategory) : 0);
// first
if (state.style === 'first_one' || state.style === 'first_two') {
onMenu(0);
}
}); });
onReachBottom(() => { onReachBottom(() => {