|
56 | 56 | </n-card> |
57 | 57 | </n-flex> |
58 | 58 | </div> |
| 59 | + <div class="set-list"> |
| 60 | + <n-h3 prefix="bar"> 开发人员 </n-h3> |
| 61 | + <n-flex :size="12" class="link"> |
| 62 | + <n-card |
| 63 | + v-for="(item, index) in developers" |
| 64 | + :key="index" |
| 65 | + class="link-item" |
| 66 | + hoverable |
| 67 | + @click="openLink(item.url)" |
| 68 | + > |
| 69 | + <n-flex align="center"> |
| 70 | + <n-avatar round :size="40" :src="item.avatar" fallback-src="/images/avatar.jpg?asset" /> |
| 71 | + <n-flex vertical :gap="4"> |
| 72 | + <n-text class="name" strong> {{ item.name }} </n-text> |
| 73 | + <n-text class="tip" :depth="3" style="font-size: 12px"> |
| 74 | + {{ item.role }} |
| 75 | + </n-text> |
| 76 | + </n-flex> |
| 77 | + </n-flex> |
| 78 | + </n-card> |
| 79 | + </n-flex> |
| 80 | + </div> |
| 81 | + <Transition name="fade" mode="out-in"> |
| 82 | + <div v-if="allContributors.length > 0" class="set-list"> |
| 83 | + <n-collapse arrow-placement="right"> |
| 84 | + <n-collapse-item title="更多贡献者" name="1"> |
| 85 | + <n-flex :size="12" class="link"> |
| 86 | + <n-card |
| 87 | + v-for="(item, index) in allContributors" |
| 88 | + :key="index" |
| 89 | + class="link-item" |
| 90 | + hoverable |
| 91 | + @click="openLink(item.url)" |
| 92 | + > |
| 93 | + <n-flex align="center"> |
| 94 | + <n-avatar round :size="40" :src="item.avatar" fallback-src="/images/avatar.jpg?asset" /> |
| 95 | + <n-flex vertical :gap="4"> |
| 96 | + <n-text class="name" strong> {{ item.name }} </n-text> |
| 97 | + <n-text class="tip" :depth="3" style="font-size: 12px"> |
| 98 | + {{ item.role }} |
| 99 | + </n-text> |
| 100 | + </n-flex> |
| 101 | + </n-flex> |
| 102 | + </n-card> |
| 103 | + </n-flex> |
| 104 | + </n-collapse-item> |
| 105 | + </n-collapse> |
| 106 | + </div> |
| 107 | + </Transition> |
59 | 108 | <div class="set-list"> |
60 | 109 | <n-h3 prefix="bar"> 社区与资讯 </n-h3> |
61 | 110 | <n-flex :size="12" class="link"> |
@@ -110,6 +159,42 @@ const statusStore = useStatusStore(); |
110 | 159 | // 开发者模式点击次数 |
111 | 160 | const developerModeClickCount = ref(0); |
112 | 161 |
|
| 162 | +// 开发人员 |
| 163 | +type DeveloperType = { |
| 164 | + name: string; |
| 165 | + role: string; |
| 166 | + url: string; |
| 167 | + avatar: string; |
| 168 | +}; |
| 169 | +
|
| 170 | +const developers = ref<DeveloperType[]>([]); |
| 171 | +const allContributors = ref<DeveloperType[]>([]); |
| 172 | +
|
| 173 | +// 获取贡献者 |
| 174 | +const getContributors = async () => { |
| 175 | + try { |
| 176 | + const response = await fetch( |
| 177 | + "https://api.github.com/repos/imsyy/SPlayer/contributors?per_page=100&anon=true", |
| 178 | + ); |
| 179 | + const data = await response.json(); |
| 180 | + if (Array.isArray(data)) { |
| 181 | + const list = data |
| 182 | + .filter((item: any) => item.login !== "type-bot" && item.type !== "Bot") |
| 183 | + .map((item: any) => ({ |
| 184 | + name: item.login || item.name, |
| 185 | + role: item.login === "imsyy" ? "Owner / Full Stack" : "Contributor", |
| 186 | + url: item.html_url || "", |
| 187 | + avatar: item.avatar_url || "/images/avatar.jpg?asset", |
| 188 | + })); |
| 189 | + developers.value = list.slice(0, 6); |
| 190 | + allContributors.value = list.slice(6); |
| 191 | + } |
| 192 | + } catch (error) { |
| 193 | + console.error("Failed to fetch contributors:", error); |
| 194 | + // Fallback or empty state handling if needed, currently just empty |
| 195 | + } |
| 196 | +}; |
| 197 | +
|
113 | 198 | // 特别鸣谢 |
114 | 199 | const contributors = [ |
115 | 200 | { |
@@ -215,7 +300,10 @@ const openDeveloperMode = useThrottleFn(() => { |
215 | 300 | } |
216 | 301 | }, 100); |
217 | 302 |
|
218 | | -onMounted(getUpdateData); |
| 303 | +onMounted(() => { |
| 304 | + getUpdateData(); |
| 305 | + getContributors(); |
| 306 | +}); |
219 | 307 | </script> |
220 | 308 |
|
221 | 309 | <style lang="scss" scoped> |
|
0 commit comments