杂务:打包并提交当前改动

This commit is contained in:
xiaowang
2026-03-19 20:51:07 +08:00
parent de50394960
commit 8330ea1c83
47 changed files with 1190 additions and 450 deletions
+4 -2
View File
@@ -155,7 +155,7 @@
</template>
<script setup lang="ts">
import { ref, onMounted } from 'vue'
import { ref, onMounted, inject } from 'vue'
import { useRouter } from 'vue-router'
import {
LeftOutlined,
@@ -169,6 +169,7 @@ import { tagApi, type TagVO } from '@/api/tag'
import { cartApi } from '@/api/cart'
import { fileApi } from '@/api/file'
const updateCartCount = inject<() => Promise<void>>('updateCartCount', async () => {})
const router = useRouter()
@@ -298,6 +299,7 @@ const handleProductClick = (item: any) => {
const handleAddToCart = async (item: any) => {
try {
await cartApi.addToCart({ productId: item.id, quantity: 1 })
await updateCartCount()
message.success(`已将 ${item.title || item.name || '作品'} 添加到购物车`)
} catch (error) {
message.error('添加到购物车失败,请重试')
@@ -566,4 +568,4 @@ onMounted(async () => {
color: #999;
font-size: 14px;
}
</style>
</style>