From 6cbd3bc0767c632c9202542d5caf58c875577e12 Mon Sep 17 00:00:00 2001 From: xiaowang Date: Thu, 5 Mar 2026 16:08:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=BF=E6=8D=A2=E5=95=86=E5=93=81=E4=B8=BA?= =?UTF-8?q?=E4=BD=9C=E5=93=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Frontend/src/api/cart.ts | 6 ++-- Frontend/src/api/coupon.ts | 2 +- Frontend/src/components/BottomNav.vue | 4 +-- Frontend/src/views/CartView.vue | 30 ++++++++-------- Frontend/src/views/HomeView.vue | 32 ++++++++--------- Frontend/src/views/OrderView.vue | 4 +-- Frontend/src/views/ProductDetailView.vue | 14 ++++---- Frontend/src/views/ProductListView.vue | 32 ++++++++--------- Frontend/src/views/WishlistView.vue | 2 +- Frontend/src/views/admin/AdminLayout.vue | 2 +- Frontend/src/views/admin/DashboardView.vue | 4 +-- Frontend/src/views/admin/HomeView.vue | 2 +- Frontend/src/views/admin/NailArtistsView.vue | 12 +++---- Frontend/src/views/admin/OrdersView.vue | 6 ++-- Frontend/src/views/admin/PermissionsView.vue | 6 ++-- Frontend/src/views/admin/ProductsView.vue | 38 ++++++++++---------- 16 files changed, 98 insertions(+), 98 deletions(-) diff --git a/Frontend/src/api/cart.ts b/Frontend/src/api/cart.ts index 0839dad8..338b28d0 100644 --- a/Frontend/src/api/cart.ts +++ b/Frontend/src/api/cart.ts @@ -6,17 +6,17 @@ interface CartItem { } export const cartApi = { - // 添加商品到购物车 + // 添加作品到购物车 addToCart: (item: CartItem) => { return api.post('/cart/add', item) }, - // 从购物车移除商品 + // 从购物车移除作品 removeFromCart: (productId: number) => { return api.delete(`/cart/remove/${productId}`) }, - // 更新购物车商品数量 + // 更新购物车作品数量 updateCartQuantity: (item: CartItem) => { return api.put('/cart/update', item) }, diff --git a/Frontend/src/api/coupon.ts b/Frontend/src/api/coupon.ts index 83adcb2c..92388865 100644 --- a/Frontend/src/api/coupon.ts +++ b/Frontend/src/api/coupon.ts @@ -134,7 +134,7 @@ export const couponApi = { }) }, - // 获取商品可用的优惠券 + // 获取作品可用的优惠券 getAvailableCoupons: (productTags: string, productPrice: number) => { return request({ url: '/coupon/available', diff --git a/Frontend/src/components/BottomNav.vue b/Frontend/src/components/BottomNav.vue index 318efea1..c2521959 100644 --- a/Frontend/src/components/BottomNav.vue +++ b/Frontend/src/components/BottomNav.vue @@ -11,14 +11,14 @@ 首页 - + diff --git a/Frontend/src/views/CartView.vue b/Frontend/src/views/CartView.vue index 39387acd..f6f3d1c2 100644 --- a/Frontend/src/views/CartView.vue +++ b/Frontend/src/views/CartView.vue @@ -12,7 +12,7 @@ - +
去逛逛 @@ -29,7 +29,7 @@ - +
@@ -37,7 +37,7 @@ {{ item.productTitle[0] }}
- +

{{ item.productTitle }}

¥{{ item.price.toFixed(2) }}

@@ -62,7 +62,7 @@
- 商品数量 + 作品数量 {{ totalQuantity }} 件
@@ -288,7 +288,7 @@ interface CartItem { const router = useRouter() -// 购物车商品数据 +// 购物车作品数据 const cartItems = ref([]) // 图片缓存 @@ -318,7 +318,7 @@ const loadCartItems = async () => { } } -// 加载商品图片 +// 加载作品图片 const loadProductImages = async (items: CartItem[]) => { for (const item of items) { if (item.originalProductImage) { @@ -383,12 +383,12 @@ const loadAvailableCoupons = async () => { } } -// 计算选中的商品数量 +// 计算选中的作品数量 const selectedCount = computed(() => { return cartItems.value.filter(item => item.selected).length }) -// 计算商品总数量 +// 计算作品总数量 const totalQuantity = computed(() => { return cartItems.value.reduce((sum, item) => sum + item.quantity, 0) }) @@ -478,21 +478,21 @@ const handleIncreaseQuantity = async (item: CartItem) => { } } -// 处理删除商品 +// 处理删除作品 const handleDeleteItem = async (item: CartItem) => { try { await cartApi.removeFromCart(item.productId) const index = cartItems.value.findIndex(i => i.id === item.id) if (index > -1) { cartItems.value.splice(index, 1) - message.success('商品已删除') + message.success('作品已删除') // 重新加载可用优惠券 await loadAvailableCoupons() // 更新购物车数量 await updateCartCount() } } catch (error) { - message.error('删除商品失败') + message.error('删除作品失败') } } @@ -500,7 +500,7 @@ const handleProductClick = (item: CartItem) => { router.push(`/product/${item.productId}`) } -// 处理浏览商品 +// 处理浏览作品 const handleBrowseProducts = () => { router.push('/products') } @@ -589,7 +589,7 @@ const loadAvailableArtists = async () => { const handleCheckout = async () => { const selectedItems = cartItems.value.filter(item => item.selected) if (selectedItems.length === 0) { - message.warning('请先选择要结算的商品') + message.warning('请先选择要结算的作品') return } @@ -682,7 +682,7 @@ const toggleArtistSelection = (artist: any) => { } } -// 监听选中商品变化,重新加载可用优惠券 +// 监听选中作品变化,重新加载可用优惠券 watch( () => cartItems.value.map(item => ({ id: item.id, selected: item.selected, quantity: item.quantity })), async () => { diff --git a/Frontend/src/views/HomeView.vue b/Frontend/src/views/HomeView.vue index 1b5a9e15..ce4380b3 100644 --- a/Frontend/src/views/HomeView.vue +++ b/Frontend/src/views/HomeView.vue @@ -25,7 +25,7 @@
@@ -61,10 +61,10 @@
- +
-

精选商品

+

精选作品

查看全部
@@ -87,10 +87,10 @@
- +
@@ -162,10 +162,10 @@ const searchQuery = ref('') // Banner图片数据 const bannerImages = ref([]) -// 精选商品数据 +// 精选作品数据 const featuredItems = ref([]) -// 热门商品数据 +// 热门作品数据 const popularItems = ref([]) const loading = ref(false) const hasMore = ref(true) @@ -224,7 +224,7 @@ const loadBannerImages = async () => { } } -// 加载精选商品 +// 加载精选作品 const loadFeaturedProducts = async () => { try { const response = await productApi.getProductsByTag('精选') as any @@ -238,11 +238,11 @@ const loadFeaturedProducts = async () => { bgColor: getRandomColor() })) } catch (error) { - console.error('获取精选商品失败:', error) + console.error('获取精选作品失败:', error) } } -// 加载热门商品 +// 加载热门作品 const loadPopularProducts = async (loadMore = false) => { if (loading.value || !hasMore.value) return @@ -280,7 +280,7 @@ const loadPopularProducts = async (loadMore = false) => { } } } catch (error) { - console.error('获取热门商品失败:', error) + console.error('获取热门作品失败:', error) } finally { loading.value = false } @@ -344,7 +344,7 @@ const handleSeeAll = (type: string) => { router.push('/products') } -// 处理商品卡片点击 +// 处理作品卡片点击 const handleProductClick = (item: any) => { router.push(`/product/${item.id}`) } diff --git a/Frontend/src/views/OrderView.vue b/Frontend/src/views/OrderView.vue index 00268c90..a4ce74c3 100644 --- a/Frontend/src/views/OrderView.vue +++ b/Frontend/src/views/OrderView.vue @@ -84,7 +84,7 @@ const loadOrders = async () => { } } -// 加载商品图片 +// 加载作品图片 const loadProductImages = async (orders: any[]) => { for (const order of orders) { if (order.items && order.items.length > 0) { @@ -136,7 +136,7 @@ const handleBackClick = () => { router.back() } -// 处理浏览商品 +// 处理浏览作品 const handleBrowseProducts = () => { router.push('/products') } diff --git a/Frontend/src/views/ProductDetailView.vue b/Frontend/src/views/ProductDetailView.vue index b4e94693..e322dc54 100644 --- a/Frontend/src/views/ProductDetailView.vue +++ b/Frontend/src/views/ProductDetailView.vue @@ -6,7 +6,7 @@
-

{{ product.name || '商品详情' }}

+

{{ product.name || '作品详情' }}

@@ -152,7 +152,7 @@ const productImages = ref([]) const imageIdCache = ref>({}) const DEFAULT_PRODUCT_IMAGE = 'data:image/svg+xml;base64,PHN2ZyB3aW0dPSJodHRwOi8vd3d3Lm9yZy8yMDAwL3N2ZyI+Pjwvc3ZnPg==' -// 从后端获取商品详情 +// 从后端获取作品详情 const fetchProductDetail = async () => { const productId = route.params.id @@ -168,7 +168,7 @@ const fetchProductDetail = async () => { } } -// 检查商品是否在收藏列表中 +// 检查作品是否在收藏列表中 const checkWishlistStatus = async () => { if (product.value.id) { const token = localStorage.getItem('accessToken') || sessionStorage.getItem('accessToken') @@ -187,7 +187,7 @@ const checkWishlistStatus = async () => { } } -// 检查用户是否已点赞商品 +// 检查用户是否已点赞作品 const checkLikeStatus = async () => { if (product.value.id) { const token = localStorage.getItem('accessToken') || sessionStorage.getItem('accessToken') @@ -206,7 +206,7 @@ const checkLikeStatus = async () => { } } -// 加载商品图片 +// 加载作品图片 const loadProductImages = async () => { if (product.value.imageFileIds) { const ids = product.value.imageFileIds.split(',') @@ -309,7 +309,7 @@ const handleAddToCart = async () => { try { await cartApi.addToCart({ productId: product.value.id, quantity: 1 }) await updateCartCount() - ElMessage.success(`已将 ${product.value.title || product.value.name || '商品'} 添加到购物车`) + ElMessage.success(`已将 ${product.value.title || product.value.name || '作品'} 添加到购物车`) } catch (error) { console.error('添加到购物车失败:', error) ElMessage.error('添加到购物车失败,请重试') @@ -327,7 +327,7 @@ const handleBuyNow = async () => { } } -// 页面挂载时获取商品详情 +// 页面挂载时获取作品详情 onMounted(() => { fetchProductDetail() }) diff --git a/Frontend/src/views/ProductListView.vue b/Frontend/src/views/ProductListView.vue index d51e5b95..ea0e71e2 100644 --- a/Frontend/src/views/ProductListView.vue +++ b/Frontend/src/views/ProductListView.vue @@ -6,11 +6,11 @@ -

商品列表

+

作品列表

- +
- +
- +
- +

{{ item.title || item.name }}

@@ -139,7 +139,7 @@
- 商家暂未上架更多商品 + 商家暂未上架更多作品
@@ -147,7 +147,7 @@ 加载更多 - 没有更多商品了 + 没有更多作品了
@@ -195,7 +195,7 @@ const selectedCategory = ref('全部') // 分类列表(动态从标签获取) const categories = ref(['全部']) -// 商品数据 +// 作品数据 const products = ref([]) // 是否还有更多数据 @@ -225,7 +225,7 @@ const fetchTags = async () => { } } -// 加载商品列表 +// 加载作品列表 const loadImageUrls = async (productList: ProductVO[]) => { for (const product of productList) { if (product.imageFileIds) { @@ -258,7 +258,7 @@ const getProductImages = (product: ProductVO): string[] => { return imageUrls.value[product.id] || [DEFAULT_PRODUCT_IMAGE] } -// 从后端获取商品数据 +// 从后端获取作品数据 const fetchProducts = async () => { if (loading.value) return @@ -300,7 +300,7 @@ const handleCategoryClick = (category: string) => { fetchProducts() } -// 处理商品卡片点击 +// 处理作品卡片点击 const handleProductClick = (item: any) => { router.push(`/product/${item.id}`) } @@ -309,7 +309,7 @@ const handleProductClick = (item: any) => { const handleAddToCart = async (item: any) => { try { await cartApi.addToCart({ productId: item.id, quantity: 1 }) - message.success(`已将 ${item.title || item.name || '商品'} 添加到购物车`) + message.success(`已将 ${item.title || item.name || '作品'} 添加到购物车`) } catch (error) { message.error('添加到购物车失败,请重试') } @@ -327,7 +327,7 @@ const toggleSearch = () => { if (!showSearch.value) { searchKeyword.value = '' isSearching.value = false - fetchProducts() // 重置为默认商品列表 + fetchProducts() // 重置为默认作品列表 } } @@ -352,7 +352,7 @@ const handleSearch = async () => { } } -// 页面挂载时获取标签和商品数据 +// 页面挂载时获取标签和作品数据 onMounted(async () => { await fetchTags() fetchProducts() @@ -445,7 +445,7 @@ onMounted(async () => { font-weight: 600; } -/* 右侧商品区域 */ +/* 右侧作品区域 */ .product-section { flex: 1; overflow-y: auto; diff --git a/Frontend/src/views/WishlistView.vue b/Frontend/src/views/WishlistView.vue index cde05092..4c241769 100644 --- a/Frontend/src/views/WishlistView.vue +++ b/Frontend/src/views/WishlistView.vue @@ -39,7 +39,7 @@

收藏列表为空

- 浏览商品 + 浏览作品
diff --git a/Frontend/src/views/admin/AdminLayout.vue b/Frontend/src/views/admin/AdminLayout.vue index bbd12a6f..53d6a6a1 100644 --- a/Frontend/src/views/admin/AdminLayout.vue +++ b/Frontend/src/views/admin/AdminLayout.vue @@ -130,7 +130,7 @@ const menuItems = [ { key: '/admin/products', icon: ShopOutlined, - label: '商品管理', + label: '作品管理', permissionCode: 'product:view' }, { diff --git a/Frontend/src/views/admin/DashboardView.vue b/Frontend/src/views/admin/DashboardView.vue index 81e7aa8c..221957b9 100644 --- a/Frontend/src/views/admin/DashboardView.vue +++ b/Frontend/src/views/admin/DashboardView.vue @@ -20,7 +20,7 @@ - +