商品增加分类
This commit is contained in:
@@ -7,6 +7,6 @@ const url = ref<string>('');
|
|||||||
|
|
||||||
onLoad((params: any) => {
|
onLoad((params: any) => {
|
||||||
if(params.url)
|
if(params.url)
|
||||||
url.value = decodeURIComponent(params.url);
|
url.value = params.url;
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
@@ -87,8 +87,8 @@ onLoad(() => {
|
|||||||
const fetchCategoryList = async () => {
|
const fetchCategoryList = async () => {
|
||||||
if(companyConfigInfo.value.mallopen == 1) {
|
if(companyConfigInfo.value.mallopen == 1) {
|
||||||
const list = await getCategoryList();
|
const list = await getCategoryList();
|
||||||
list.unshift({ typeName: '上新精选', typeId: '0' });
|
list.unshift({ typeName: '上新精选', typeId: '2' });
|
||||||
list.unshift({ typeName: '热销商品', typeId: '0' });
|
list.unshift({ typeName: '热销商品', typeId: '1' });
|
||||||
list.unshift({ typeName: '全部分类', typeId: '0' });
|
list.unshift({ typeName: '全部分类', typeId: '0' });
|
||||||
categoryList.value = list;
|
categoryList.value = list;
|
||||||
await changeCategory(0);
|
await changeCategory(0);
|
||||||
@@ -102,13 +102,27 @@ const changeCategory = async (index: number) => {
|
|||||||
|
|
||||||
const fetchGoodsList = async (refresh: boolean = true) => {
|
const fetchGoodsList = async (refresh: boolean = true) => {
|
||||||
currentPageNum.value = refresh ? 1 : currentPageNum.value + 1;
|
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({
|
const { rows } = await getGoodsList({
|
||||||
page: {
|
page: {
|
||||||
pageNum: currentPageNum.value,
|
pageNum: currentPageNum.value,
|
||||||
pageSize: 30,
|
pageSize: 30,
|
||||||
bean: {
|
bean: {
|
||||||
keyword: '',
|
keyword: '',
|
||||||
typeIds: [categoryList.value[categorySelectedIndex.value].typeId]
|
typeIds: typeId,
|
||||||
|
sort: sort
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@@ -148,21 +148,7 @@ onShow(async () => {
|
|||||||
|
|
||||||
const openCard = () => {
|
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';
|
// 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)}`);
|
goPath(`/pages/common/webview/index?url=${cardLink.value}`);
|
||||||
// uni.openCard({
|
|
||||||
// cardList: [{
|
|
||||||
// cardId: 'pzCtO1PD40kHdvcAU8kTfVILoebE',
|
|
||||||
// code: '261422541418'
|
|
||||||
// }
|
|
||||||
// // {
|
|
||||||
// // cardId: '',
|
|
||||||
// // code: ''
|
|
||||||
// // }
|
|
||||||
// ],
|
|
||||||
// success(res) {
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const gotoPath = (path: string) => {
|
const gotoPath = (path: string) => {
|
||||||
|
Reference in New Issue
Block a user