去除所有的控制台日志日志
This commit is contained in:
@@ -196,7 +196,7 @@ const fetchTags = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 加载商品图片
|
||||
// 加载商品列表
|
||||
const loadImageUrls = async (productList: ProductVO[]) => {
|
||||
for (const product of productList) {
|
||||
if (product.imageFileIds) {
|
||||
@@ -243,16 +243,12 @@ const fetchProducts = async () => {
|
||||
response = await productApi.getProductsByTag(selectedCategory.value) as any
|
||||
}
|
||||
|
||||
console.log('Products response:', response)
|
||||
products.value = response || []
|
||||
|
||||
await loadImageUrls(products.value)
|
||||
|
||||
console.log('Processed products:', products.value)
|
||||
|
||||
hasMore.value = false
|
||||
} catch (error) {
|
||||
console.error('获取商品失败:', error)
|
||||
message.error('未登录,请先登录')
|
||||
} finally {
|
||||
loading.value = false
|
||||
@@ -263,13 +259,11 @@ const fetchProducts = async () => {
|
||||
|
||||
// 处理返回按钮点击
|
||||
const handleBackClick = () => {
|
||||
console.log('返回按钮被点击')
|
||||
router.push('/')
|
||||
}
|
||||
|
||||
// 处理分类点击
|
||||
const handleCategoryClick = (category: string) => {
|
||||
console.log('选择分类:', category)
|
||||
selectedCategory.value = category
|
||||
// 这里可以添加筛选逻辑
|
||||
fetchProducts()
|
||||
@@ -277,25 +271,21 @@ const handleCategoryClick = (category: string) => {
|
||||
|
||||
// 处理商品卡片点击
|
||||
const handleProductClick = (item: any) => {
|
||||
console.log('商品被点击:', item.name)
|
||||
router.push(`/product/${item.id}`)
|
||||
}
|
||||
|
||||
// 处理添加到购物车
|
||||
const handleAddToCart = async (item: any) => {
|
||||
console.log('添加到购物车:', item.title || item.name)
|
||||
try {
|
||||
await cartApi.addToCart({ productId: item.id, quantity: 1 })
|
||||
message.success(`已将 ${item.title || item.name || '商品'} 添加到购物车`)
|
||||
} catch (error) {
|
||||
console.error('添加到购物车失败:', error)
|
||||
message.error('添加到购物车失败,请重试')
|
||||
}
|
||||
}
|
||||
|
||||
// 处理加载更多
|
||||
const handleLoadMore = () => {
|
||||
console.log('加载更多商品')
|
||||
// 这里可以添加加载更多逻辑
|
||||
hasMore.value = false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user