Skip to content

Commit c0ccdd3

Browse files
authored
Add BeianFooter component for备案信息 display
1 parent 5cc74c7 commit c0ccdd3

File tree

1 file changed

+81
-0
lines changed

1 file changed

+81
-0
lines changed

src/components/BeianFooter.vue

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
<template>
2+
<div class="beian-wrap">
3+
<span class="beian-row">
4+
<a
5+
class="beian-link"
6+
:href="`https://beian.mps.gov.cn/#/query/webSearch?code=${gaCode}`"
7+
target="_blank"
8+
rel="noopener noreferrer"
9+
>
10+
<img
11+
class="beian-icon"
12+
:src="policeIconSrc"
13+
alt="公安备案图标"
14+
/>
15+
<span>{{ provinceShort }}公网安备{{ gaCode }}号</span>
16+
</a>
17+
18+
<span class="beian-sep">|</span>
19+
20+
<a
21+
class="beian-link"
22+
href="https://beian.miit.gov.cn/"
23+
target="_blank"
24+
rel="noopener noreferrer"
25+
>
26+
{{ provinceShort }}ICP备{{ icp }}号
27+
</a>
28+
</span>
29+
</div>
30+
</template>
31+
32+
<script setup lang="ts">
33+
defineProps<{
34+
icp: string // 例:2025074193
35+
gaCode: string // 例:36012202000590
36+
provinceShort?: string // 例:赣、粤、京,默认“赣”
37+
policeIconSrc?: string // 图标地址,默认 /gongan.png(或外链)
38+
}>()
39+
40+
const props = withDefaults(defineProps<{
41+
icp: string
42+
gaCode: string
43+
provinceShort?: string
44+
policeIconSrc?: string
45+
}>(), {
46+
provinceShort: '',
47+
policeIconSrc: '/gongan.png' // 如果没有本地图标,可改为 'https://www.beian.gov.cn/img/ghs.png'
48+
})
49+
</script>
50+
51+
<style scoped lang="scss">
52+
.beian-wrap {
53+
display: flex;
54+
justify-content: center;
55+
flex-wrap: wrap;
56+
}
57+
.beian-row {
58+
display: inline-flex;
59+
align-items: center;
60+
gap: 8px;
61+
line-height: 1;
62+
}
63+
.beian-link {
64+
display: inline-flex;
65+
align-items: center;
66+
gap: 6px;
67+
color: inherit;
68+
text-decoration: none;
69+
line-height: 1;
70+
}
71+
.beian-icon {
72+
width: 16px;
73+
height: 16px;
74+
display: inline-block;
75+
margin: 0;
76+
}
77+
.beian-sep {
78+
color: #999;
79+
margin: 0 6px;
80+
}
81+
</style>

0 commit comments

Comments
 (0)