@@ -38,12 +38,12 @@
useGetUserAddressList();
const router = useRouter();
const filterList = [
- { id: 0, name: "推荐", icon: "/images/shop/recommend.png" },
- { id: 1, name: "居家安全", icon: "/images/shop/wheelchair.png" },
+ { id: 1, name: "推荐", icon: "/images/shop/recommend.png" },
+ { id: 2, name: "居家安全", icon: "/images/shop/wheelchair.png" },
{ id: 3, name: "出行助理", icon: "/images/shop/travel.png" },
{ id: 4, name: "洗护用品", icon: "/images/shop/toiletries.png" },
];
- const activeMenu = ref(0);
+ const activeMenu = ref(1);
const useProductCategory = () => {
getRequest(getProductCategory()).then((_resp) => {});
@@ -52,7 +52,7 @@
const products = ref
([]);
const useProducts = () => {
- getRequest(getMallRecommend()).then((resp) => {
+ getRequest(getMallRecommend(),{type:activeMenu.value}).then((resp) => {
products.value = (resp.result as { products: any[] }).products;
});
};
@@ -65,4 +65,9 @@
const toProductInfo = (product: any) => {
router.push({ path: "/shop/product", query: { id: product.id } });
};
+
+ const handleChange = (id: number) => {
+ activeMenu.value = id;
+ useProducts();
+ };