杂务:新增声明级注释覆盖率

This commit is contained in:
xiaowang
2026-05-23 18:44:57 +08:00
parent 8f038894e7
commit 844516988b
234 changed files with 8356 additions and 0 deletions
@@ -141,10 +141,22 @@ import {
} from '@ant-design/icons-vue'
import { message } from 'ant-design-vue'
import { cartApi } from '@/api/cart'
/**
* Purpose: CommentVO supports ProductDetailView.vue by holding or executing the comment vo page or API role.
* Usage: import, call, read, or update this type from the owning page/module while preserving the surrounding loading and permission flow.
*/
import { commentApi, type CommentVO } from '@/api/comment'
import { fileApi } from '@/api/file'
/**
* Purpose: ProductVO supports ProductDetailView.vue by holding or executing the product vo page or API role.
* Usage: import, call, read, or update this type from the owning page/module while preserving the surrounding loading and permission flow.
*/
import { productApi, type ProductVO } from '@/api/product'
import { productLikeApi } from '@/api/productLike'
/**
* Purpose: ShopVO supports ProductDetailView.vue by holding or executing the shop vo page or API role.
* Usage: import, call, read, or update this type from the owning page/module while preserving the surrounding loading and permission flow.
*/
import { shopApi, type ShopVO } from '@/api/shop'
import { wishlistApi } from '@/api/wishlist'
import { DEFAULT_PRODUCT_IMAGE } from '@/constants'
@@ -152,17 +164,53 @@ import type { IdType } from '@/utils/id'
import { toOptionalIdString } from '@/utils/id'
import { runWithGlobalLoading } from '@/utils/action-loading'
/**
* Purpose: route supports ProductDetailView.vue by holding or executing the route page or API role.
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
*/
const route = useRoute()
/**
* Purpose: router supports ProductDetailView.vue by holding or executing the router page or API role.
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
*/
const router = useRouter()
/**
* Purpose: updateCartCount supports ProductDetailView.vue by holding or executing the update cart count page or API role.
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
*/
const updateCartCount = inject<() => Promise<void>>('updateCartCount', async () => {})
/**
* Purpose: product supports ProductDetailView.vue by holding or executing the product page or API role.
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
*/
const product = ref<ProductVO>({} as ProductVO)
/**
* Purpose: shopInfo supports ProductDetailView.vue by holding or executing the shop info page or API role.
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
*/
const shopInfo = ref<ShopVO | null>(null)
/**
* Purpose: productImages supports ProductDetailView.vue by holding or executing the product images page or API role.
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
*/
const productImages = ref<string[]>([])
/**
* Purpose: imageIdCache supports ProductDetailView.vue by holding or executing the image id cache page or API role.
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
*/
const imageIdCache = ref<Record<string, string>>({})
/**
* Purpose: comments supports ProductDetailView.vue by holding or executing the comments page or API role.
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
*/
const comments = ref<CommentVO[]>([])
/** commentText is a reactive state variable used by the template and event handlers. */
const commentText = ref('')
/**
* Purpose: replyTarget supports ProductDetailView.vue by holding or executing the reply target page or API role.
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
*/
const replyTarget = ref<CommentVO | null>(null)
/** submittingComment is a reactive state variable used by the template and event handlers. */
const submittingComment = ref(false)
@@ -187,6 +235,10 @@ const artistCountText = computed(() => artistCount.value > 0 ? `${artistCount.va
/** earliestBookableText is a reactive state variable used by the template and event handlers. */
const earliestBookableText = computed(() => shopInfo.value?.businessHours || '以门店安排为准')
/**
* Purpose: copyShareLink supports ProductDetailView.vue by holding or executing the copy share link page or API role.
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
*/
const copyShareLink = async () => {
const url = `${window.location.origin}/product/${route.params.id}`
try {