|
|
1 개월 전 | |
|---|---|---|
| .. | ||
| components | 1 개월 전 | |
| README.md | 1 개월 전 | |
| detail.vue | 1 개월 전 | |
| index.vue | 1 개월 전 | |
为买家端添加了店铺功能,包括店铺列表、搜索、店铺详情等核心功能。
pagesBuyer/shop/index.vue)pagesBuyer/shop/detail.vue)pagesBuyer/shop/
├── index.vue # 店铺列表页面
├── detail.vue # 店铺详情页面
└── README.md # 说明文档
const shops = ref([
{
id: 1,
name: "时尚潮流店",
description: "专注时尚潮流服饰,品质保证",
avatar: "/static/shop/shop1.png",
rating: 4.8,
sales: 1234,
distance: "1.2km",
status: "online",
tags: ["时尚", "潮流", "品质"]
},
// ... 更多店铺数据
]);
const shopInfo = ref({
id: 1,
name: "时尚潮流店",
description: "专注时尚潮流服饰,品质保证,为您提供最优质的商品和服务",
avatar: "/static/shop/shop1.png",
rating: 4.8,
sales: 1234,
distance: "1.2km",
status: "online",
tags: ["时尚", "潮流", "品质", "正品"]
});
const filteredShops = computed(() => {
if (!searchValue.value.trim()) {
return shops.value;
}
const keyword = searchValue.value.toLowerCase();
return shops.value.filter(shop =>
shop.name.toLowerCase().includes(keyword) ||
shop.description.toLowerCase().includes(keyword) ||
shop.tags.some(tag => tag.toLowerCase().includes(keyword))
);
});
const buyerNavList = ref([
{
name: "home",
title: "tabbar.首页",
img: home,
img_active: home_active,
num: 0,
},
{
name: "shop",
title: "tabbar.店铺",
img: shop,
img_active: shop_active,
num: 0,
},
{
name: "cart",
title: "tabbar.购物车",
img: cart,
img_active: cart_active,
num: cartNum.value,
},
{
name: "profile",
title: "tabbar.我的",
img: user,
img_active: user_active,
num: 0,
},
]);
{
"path": "pagesBuyer/shop/index"
},
{
"path": "pagesBuyer/shop/detail"
}
const toShopDetail = (shop) => {
uni.navigateTo({
url: `/pagesBuyer/shop/detail?id=${shop.id}&name=${shop.name}`
});
};
const toProductDetail = (product) => {
uni.navigateTo({
url: `/pagesBuyer/shop/product?id=${product.id}`
});
};