index.vue
5.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
<script lang="ts" setup>
import { getAppList, getAllApp } from "~/api/app";
import type { webSiteType } from "~/api/types/webSite";
import { getAdList } from "~/api/ad";
const webSite = useState<webSiteType>("webSite");
const route = useRoute();
console.log(route);
const { data: adList } = await useAsyncData(
"adList",
async () => {
const res = await getAdList();
return res[0] || null;
},
{
server: true,
lazy: false,
},
);
const { data: recommendList } = await useAsyncData(
"recommendList",
async () => {
const res = await getAppList({
pageSize: 10,
pageNum: 1,
isRecommend: "1",
});
return res.rows || [];
},
{
server: true,
lazy: false,
},
);
const { data: appList } = await useAsyncData(
"appList",
async () => {
const res = await getAllApp();
return res.data || [];
},
{
server: true,
lazy: false,
},
);
onMounted(() => {
let toggleChineseTraditional = document.getElementById(
"toogle-chinese-traditional",
);
if (toggleChineseTraditional) {
// 自动点击
toggleChineseTraditional.click();
}
});
useHead({
title: webSite.value.webname,
meta: [
{ name: "description", content: webSite.value.webdescription },
{ name: "keywords", content: webSite.value.webkeywords },
{ name: "format-detection", content: "telephone=no" },
{ name: "referrer", content: "origin-when-cross-origin" },
{
name: "robots",
content:
"follow, index, max-snippet:-1, max-video-preview:-1, max-image-preview:large",
},
{ property: "og:locale", content: "zh_CN" },
{
property: "og:title",
content: "AI工具盒 - 優質 AI 工具集合、AI 資源網站、AI 導航平台",
},
{
property: "og:description",
content:
"專業 AI 工具導全网優質全网優質 AI 工具,包含 AI 写作、AI 绘画、AI 视频、AI 对话、AI 代码、AI 设计、AI 办公等各类 AI 資源,快速找到好用的 AI 工具。",
},
{ property: "og:url", content: "https://aiboxgo.com/" },
{ property: "og:site_name", content: "AI工具盒" },
{ property: "og:type", content: "website" },
{ property: "twitter:card", content: "summary_large_image" },
{
property: "twitter:title",
content: "AI工具盒 - 優質 AI 工具集合、AI 資源網站、AI 導航平台",
},
{
property: "twitter:description",
content:
"專業 AI 工具導全网優質全网優質 AI 工具,包含 AI 写作、AI 绘画、AI 视频、AI 对话、AI 代码、AI 设计、AI 办公等各类 AI 資源,快速找到好用的 AI 工具。",
},
],
script: [
{
type: "application/ld+json",
children: JSON.stringify({
"@context": "https://schema.org",
"@graph": [
{
"@type": "WebSite",
"@id": "https://aiboxgo.com/#website",
url: "https://aiboxgo.com/",
name: webSite.value.webname,
description: webSite.value.webdescription,
inLanguage: "zh-CN",
potentialAction: {
"@type": "SearchAction",
target: {
"@type": "EntryPoint",
urlTemplate:
"https://aiboxgo.com/search?keyword={search_term_string}",
},
"query-input": "required name=search_term_string",
},
},
{
"@type": "Organization",
"@id": "https://aiboxgo.com/#organization",
name: webSite.value.webname,
url: "https://aiboxgo.com/",
logo: {
"@type": "ImageObject",
url: "https://aiboxgo.com/favicon.ico",
},
sameAs: [],
},
{
"@type": "CollectionPage",
"@id": "https://aiboxgo.com/",
url: "https://aiboxgo.com/",
name: webSite.value.webname,
description: webSite.value.webdescription,
isPartOf: {
"@id": "https://aiboxgo.com/#website",
},
about: {
"@id": "https://aiboxgo.com/#organization",
},
},
],
}),
},
],
});
</script>
<template>
<div
class="flex flex-col min-h-screen bg-white dark:bg-[#1a1b1d] transition-colors duration-300"
>
<a
id="toogle-chinese-traditional"
href="javascript:translate.changeLanguage('chinese_traditional');"
class="ignore"
></a>
<main
class="flex-grow md:p-6 p-2 bg-white dark:bg-[#1a1b1d] transition-colors duration-300"
>
<ADSwiperCarousel v-if="adList" :adSwiperList="adList" />
<HomeBanner />
<section class="md:mb-12 mb-6">
<HomeRecommend
v-if="recommendList && recommendList.length > 0"
:recommendList="recommendList"
navTitle="推薦工具"
navIcon="star"
routePath="/hktw"
/>
<div
v-for="appItem in appList"
:key="appItem?.id"
class="md:mb-12 mb-6"
>
<HomeContent :appData="appItem" routePath="/hktw" />
</div>
</section>
</main>
</div>
</template>