商品增加分类

This commit is contained in:
2024-04-19 13:44:31 +08:00
parent 7b3676eda7
commit 634e801eb5
3 changed files with 19 additions and 19 deletions

View File

@@ -7,6 +7,6 @@ const url = ref<string>('');
onLoad((params: any) => {
if(params.url)
url.value = decodeURIComponent(params.url);
url.value = params.url;
});
</script>

View File

@@ -87,8 +87,8 @@ onLoad(() => {
const fetchCategoryList = async () => {
if(companyConfigInfo.value.mallopen == 1) {
const list = await getCategoryList();
list.unshift({ typeName: '上新精选', typeId: '0' });
list.unshift({ typeName: '热销商品', typeId: '0' });
list.unshift({ typeName: '上新精选', typeId: '2' });
list.unshift({ typeName: '热销商品', typeId: '1' });
list.unshift({ typeName: '全部分类', typeId: '0' });
categoryList.value = list;
await changeCategory(0);
@@ -102,13 +102,27 @@ const changeCategory = async (index: number) => {
const fetchGoodsList = async (refresh: boolean = true) => {
currentPageNum.value = refresh ? 1 : currentPageNum.value + 1;
let typeId = [categoryList.value[categorySelectedIndex.value].typeId];
let sort = undefined;
if(typeId[0] === '0') {
typeId = [];
sort = undefined;
} else if(typeId[0] === '1') {
typeId = [];
sort = 'good_num DESC';
} else if(typeId[0] === '2') {
typeId = [];
sort = 'update_time DESC';
}
const { rows } = await getGoodsList({
page: {
pageNum: currentPageNum.value,
pageSize: 30,
bean: {
keyword: '',
typeIds: [categoryList.value[categorySelectedIndex.value].typeId]
typeIds: typeId,
sort: sort
}
}
});

View File

@@ -148,21 +148,7 @@ onShow(async () => {
const openCard = () => {
// const url = 'https://mp.weixin.qq.com/bizmall/activatemembercard?action=preshow&&encrypt_card_id=LI%2FNyDp0x3z8XXorvvrHzSR4VUPa2vlioBg2xkDT3HqybiAFNsNgjH7pBpyKGrSA&outer_str=1702887425732870145&biz=MzU2MTg5MjgxMg%3D%3D#wechat_redirect';
goPath(`/pages/common/webview/index?url=${encodeURIComponent(cardLink.value)}`);
// uni.openCard({
// cardList: [{
// cardId: 'pzCtO1PD40kHdvcAU8kTfVILoebE',
// code: '261422541418'
// }
// // {
// // cardId: '',
// // code: ''
// // }
// ],
// success(res) {
//
// }
// });
goPath(`/pages/common/webview/index?url=${cardLink.value}`);
};
const gotoPath = (path: string) => {