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

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
@@ -101,13 +101,33 @@ import { useRoute, useRouter } from 'vue-router'
import { CopyOutlined, LeftOutlined, ShopOutlined } from '@ant-design/icons-vue'
import { message } from 'ant-design-vue'
import { fileApi } from '@/api/file'
/**
* Purpose: ShopVO supports ShopDetailView.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'
/**
* Purpose: ContactInfoVO supports ShopDetailView.vue by holding or executing the contact info 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 { userApi, type ContactInfoVO } from '@/api/user'
import { toOptionalIdString } from '@/utils/id'
/**
* Purpose: router supports ShopDetailView.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: route supports ShopDetailView.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: shopInfo supports ShopDetailView.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>({
id: '',
shopName: '',
@@ -122,31 +142,83 @@ const shopInfo = ref<ShopVO>({
updateTime: ''
})
/**
* Purpose: shopImages supports ShopDetailView.vue by holding or executing the shop 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 shopImages = ref<string[]>([])
/**
* Purpose: imageModalVisible supports ShopDetailView.vue by holding or executing the image modal visible 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 imageModalVisible = ref(false)
/**
* Purpose: selectedImage supports ShopDetailView.vue by holding or executing the selected image 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 selectedImage = ref('')
/**
* Purpose: contactOpen supports ShopDetailView.vue by holding or executing the contact open 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 contactOpen = ref(false)
/**
* Purpose: contactInfo supports ShopDetailView.vue by holding or executing the contact 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 contactInfo = ref<ContactInfoVO>({})
/**
* Purpose: mapOpen supports ShopDetailView.vue by holding or executing the map open 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 mapOpen = ref(false)
/**
* Purpose: distanceText supports ShopDetailView.vue by holding or executing the distance text 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 distanceText = ref('')
/**
* Purpose: hasLocation supports ShopDetailView.vue by holding or executing the has location 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 hasLocation = computed(() => Boolean(shopInfo.value.longitude && shopInfo.value.latitude))
/**
* Purpose: mapPreviewUrl supports ShopDetailView.vue by holding or executing the map preview url 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 mapPreviewUrl = computed(() => shopInfo.value.navigationUrls?.BROWSER || shopInfo.value.navigationUrls?.TENCENT || '')
/**
* Purpose: handleBackClick supports ShopDetailView.vue by holding or executing the handle back click 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 handleBackClick = () => {
router.back()
}
/**
* Purpose: showImageModal supports ShopDetailView.vue by holding or executing the show image modal 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 showImageModal = (imageUrl: string) => {
selectedImage.value = imageUrl
imageModalVisible.value = true
}
/**
* Purpose: handleImageCancel supports ShopDetailView.vue by holding or executing the handle image cancel 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 handleImageCancel = () => {
imageModalVisible.value = false
selectedImage.value = ''
}
/**
* Purpose: openManagerContact supports ShopDetailView.vue by holding or executing the open manager contact 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 openManagerContact = async () => {
try {
contactInfo.value = await userApi.getShopManagerContact(shopInfo.value.id)
@@ -156,6 +228,10 @@ const openManagerContact = async () => {
}
}
/**
* Purpose: openMapPreview supports ShopDetailView.vue by holding or executing the open map preview 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 openMapPreview = () => {
if (!mapPreviewUrl.value) {
message.warning('店铺暂未设置地图位置')
@@ -164,6 +240,10 @@ const openMapPreview = () => {
mapOpen.value = true
}
/**
* Purpose: openNavigation supports ShopDetailView.vue by holding or executing the open navigation 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 openNavigation = (provider: 'TENCENT' | 'AMAP') => {
const url = shopInfo.value.navigationUrls?.[provider]
if (!url) {
@@ -173,6 +253,10 @@ const openNavigation = (provider: 'TENCENT' | 'AMAP') => {
window.open(url, '_blank')
}
/**
* Purpose: calculateDistanceText supports ShopDetailView.vue by holding or executing the calculate distance text 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 calculateDistanceText = (currentLat: number, currentLng: number) => {
const shopLat = Number(shopInfo.value.latitude)
const shopLng = Number(shopInfo.value.longitude)
@@ -190,6 +274,10 @@ const calculateDistanceText = (currentLat: number, currentLng: number) => {
distanceText.value = meters >= 1000 ? `距你约 ${(meters / 1000).toFixed(1)} km` : `距你约 ${Math.round(meters)} m`
}
/**
* Purpose: loadCurrentDistance supports ShopDetailView.vue by holding or executing the load current distance 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 loadCurrentDistance = () => {
if (!hasLocation.value || !navigator.geolocation) return
navigator.geolocation.getCurrentPosition(
@@ -201,6 +289,10 @@ const loadCurrentDistance = () => {
)
}
/**
* Purpose: copyToClipboard supports ShopDetailView.vue by holding or executing the copy to clipboard 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 copyToClipboard = async (text: string, type: string) => {
if (!text) return
try {
@@ -211,6 +303,10 @@ const copyToClipboard = async (text: string, type: string) => {
}
}
/**
* Purpose: loadShopImages supports ShopDetailView.vue by holding or executing the load shop 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 loadShopImages = async () => {
try {
const imageFileIds = shopInfo.value.imageFileIds
@@ -226,6 +322,10 @@ const loadShopImages = async () => {
}
}
/**
* Purpose: fetchShopDetail supports ShopDetailView.vue by holding or executing the fetch shop detail 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 fetchShopDetail = async () => {
try {
const shopId = toOptionalIdString(route.params.id || localStorage.getItem('userShopId'))