diff --git a/api/tools.js b/api/tools.js
index 38656e0..ddf0a31 100644
--- a/api/tools.js
+++ b/api/tools.js
@@ -3,7 +3,7 @@ export default ($axios) => ({
return $axios.get('/tool', { params })
},
getCategoryList(params) {
- return $axios.get('/category', { params })
+ return $axios.get('/category/tree', { params })
},
getToolByCategory(params) {
return $axios.get('/tool/group', { params })
@@ -19,5 +19,5 @@ export default ($axios) => ({
},
searchToolByWord(word) {
return $axios.get('/tool/search', { params:{q: word, limit:50}})
- }
+ },
})
diff --git a/components/Footer.vue b/components/Footer.vue
index 61b4e0b..540605c 100644
--- a/components/Footer.vue
+++ b/components/Footer.vue
@@ -44,13 +44,14 @@ export default {
name: "Footer",
data() {
return {
- first: [{
- name: 'Home',
- path: '/home/list',
- meta: {
- parent: 'Home',
+ first: [
+ {
+ name: 'Home',
+ path: '/home/list',
+ meta: {
+ parent: 'Home',
+ },
},
- },
{
name: 'AI Daily News',
path: '/dailyNews',
@@ -59,15 +60,10 @@ export default {
},
},
{
- name: 'AI Hub',
+ name: 'AI Launches',
+ path: '/launches',
meta: {
- parent: 'Hub',
- }
- },
- {
- name: 'Learn',
- meta: {
- parent: 'Learn',
+ parent: 'Launches',
}
},
{
@@ -99,11 +95,6 @@ export default {
goto(path) {
this.$router.push(path);
},
- /**
- * 判断当前导航项是否应该被选中
- * @param {Object} item 导航项
- * @returns {Boolean} 是否选中
- */
isParentMatch(item) {
// 首先检查路径匹配逻辑,保持向后兼容性
const pathMatch = item.path && item.path === this.$route.path;
@@ -159,7 +150,7 @@ export default {
font-size: $larg-font-size;
color: $main-color;
font-weight: bold;
- font-family: 'Poppins-Bold', serif;
+ font-family: 'Poppins-Bold';
}
}
@@ -172,14 +163,14 @@ export default {
.bottom-span {
color: $grey-color;
- font-family: 'Poppins-Regular', serif;
+ font-family: 'Poppins-Regular';
}
.navigation-bottom {
margin-bottom: 14px;
span {
display: inline-block;
- font-family: 'Poppins-Medium', serif;
+ font-family: 'Poppins-Medium';
cursor: pointer;
margin-left: 30px;
&:hover {
diff --git a/components/GlobalLoading.vue b/components/GlobalLoading.vue
index 5c46e11..4cedf37 100644
--- a/components/GlobalLoading.vue
+++ b/components/GlobalLoading.vue
@@ -61,7 +61,7 @@ export default {
.loading-text {
margin-top: 15px;
- font-family: 'Poppins-Medium', serif;
+ font-family: 'Poppins-Medium';
color: #7B61FF;
}
diff --git a/components/Header.vue b/components/Header.vue
index 582e03b..6181e49 100644
--- a/components/Header.vue
+++ b/components/Header.vue
@@ -9,16 +9,19 @@
- {{
- item.meta.navigationName }}
-
-
+ {{item.meta.navigationName }}
+
+
@@ -122,11 +125,13 @@ export default {
diff --git a/components/HorizontalDateList.vue b/components/HorizontalDateList.vue
index 09e78ec..c6f49e2 100644
--- a/components/HorizontalDateList.vue
+++ b/components/HorizontalDateList.vue
@@ -147,12 +147,11 @@ export default {
width: 100%;
.nav-button {
- width: 44px;
- height: 44px;
+ width: 36px;
+ height: 36px;
cursor: pointer;
- background-color: #FFFFFF;
+ background: transparent !important;
border-radius: 4px;
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
flex-shrink: 0;
display: flex;
align-items: center;
@@ -163,8 +162,8 @@ export default {
}
img {
- width: 44px;
- height: 44px;
+ width: 36px;
+ height: 36px;
}
&.disabled {
diff --git a/components/MyTabs/MyTabs.vue b/components/MyTabs/MyTabs.vue
index 73610c4..02c7425 100644
--- a/components/MyTabs/MyTabs.vue
+++ b/components/MyTabs/MyTabs.vue
@@ -151,7 +151,7 @@ export default {
.my-tabs__item.is-disabled {
color: #1e293b;
cursor: not-allowed;
- font-family: 'Poppins-Regular', serif;
+ font-family: 'Poppins-Regular';
}
.my-tabs__close { margin-left: 6px; color: #999; }
.my-tabs__close:hover { color: #f56c6c; }
diff --git a/components/Pagination.vue b/components/Pagination.vue
index e93b2e3..085d09d 100644
--- a/components/Pagination.vue
+++ b/components/Pagination.vue
@@ -84,6 +84,7 @@
background-color: $white;
color: $main-font-color;
cursor: pointer;
+ font-weight: 'Poppins-Regular';
}
.pagination-number {
diff --git a/components/Rate.vue b/components/Rate.vue
index 2e03a67..093c6c7 100644
--- a/components/Rate.vue
+++ b/components/Rate.vue
@@ -34,7 +34,7 @@ export default {
:size="24"
:disabled="readonly">
-
{{ value }}
+
{{ (value).toFixed(1) }}
@@ -46,7 +46,7 @@ export default {
}
}
.rate-num {
- width: 28px;
+ width: 36px;
height: 28px;
line-height: 28px;
text-align: center;
@@ -54,7 +54,7 @@ export default {
color: #fff;
border-radius: 12px;
margin-left: 8px;
- font-family: 'Poppins-Regular', serif;
+ font-family: 'Poppins-Regular';
}
.gradient-box {
background: $header-backgroungd;
diff --git a/components/SearchSelectInput.vue b/components/SearchSelectInput.vue
index 9b88ab1..6756e5c 100644
--- a/components/SearchSelectInput.vue
+++ b/components/SearchSelectInput.vue
@@ -1,5 +1,5 @@
-
+
-
-
-
![]()
-
{{ item.name || '' }}
+
+
+
+
![]()
+
{{ item.name || '' }}
+
+
+
+
+

+
No relevant content was found
-
-
-
-
-

-
No relevant content was found
@@ -52,11 +53,32 @@ export default {
return this.searchResults && this.searchResults.length > 0;
}
},
+ mounted() {
+ // 添加点击事件监听
+ document.addEventListener('click', this.handleDocumentClick);
+ },
+ beforeDestroy() {
+ // 移除事件监听,避免内存泄漏
+ document.removeEventListener('click', this.handleDocumentClick);
+ },
methods: {
+ handleDocumentClick(event) {
+ // 判断点击是否在搜索容器内部
+ const searchContainer = this.$refs.searchContainer;
+ if (searchContainer && !searchContainer.contains(event.target)) {
+ // 点击在搜索容器外部,清空搜索状态
+ this.clearSearchState();
+ }
+ },
+
+ clearSearchState() {
+ this.searched = false;
+ this.searchResults = [];
+ },
+
async handleSearch(value) {
if (!value) {
- this.searched = false;
- this.searchResults = [];
+ this.clearSearchState();
return;
}
@@ -73,8 +95,7 @@ export default {
},
selectItem(item) {
- this.searched = false;
- this.searchResults = [];
+ this.clearSearchState();
this.jumpToToolDetail(item);
},
@@ -112,6 +133,7 @@ export default {
}
.results-list {
+ position: absolute;
padding: 30px 20px;
margin-top: 10px;
border-radius: 12px;
@@ -119,6 +141,8 @@ export default {
overflow-y: auto;
background: white;
box-shadow: 0 10px 30px #0000000d;
+ width: 100%;
+ z-index: 999;
.result-item {
padding: 20px 30px;
@@ -147,14 +171,16 @@ export default {
.no-results {
gap: 30px;
- padding: 10px 16px;
- text-align: center;
- border-radius: 8px;
- margin: 16px auto 0;
color: #1E293B;
- font-family: 'Poppins-SemiBold', serif;
- @include gradient-border($linear-gradient-start, $linear-gradient-end);
- width: fit-content; // 改为自适应内容宽度
+ font-family: 'Poppins-SemiBold';
+ width: 100%;
+ cursor: pointer;
+ padding: 20px 30px;
+
+ &:hover {
+ color: #7C62FF;
+ background: #F5F6F9;
+ }
img {
width: 24px;
diff --git a/layouts/default.vue b/layouts/default.vue
index 9414044..d4be3a6 100644
--- a/layouts/default.vue
+++ b/layouts/default.vue
@@ -3,7 +3,10 @@
-
+
+
+
+
@@ -59,7 +62,6 @@ export default {
#home-container {
width: 100%;
- // min-height: 100vh;
background-color: $background-color;
}
diff --git a/nuxt.config.js b/nuxt.config.js
index 7d2f7f2..6f1cd93 100644
--- a/nuxt.config.js
+++ b/nuxt.config.js
@@ -57,9 +57,9 @@ export default {
'normalize.css/normalize.css', // 引入
'@/styles/index.scss', //引入全局样式
'@/styles/text.scss',
- '@/styles/font.scss',
'@/styles/flex.scss',
'@/styles/article.scss',
+ '@/styles/font.scss',
],
// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
@@ -100,6 +100,24 @@ export default {
// Build Configuration: https://go.nuxtjs.dev/config-build
build: {
+ postcss: {
+ plugins: {
+ 'postcss-px-to-viewport': {
+ unitToConvert: 'px', // 需要转换的单位
+ viewportWidth: 1920, // 设计稿基准宽度(1470px)
+ unitPrecision: 5, // 转换后的小数位数
+ propList: ['*'], // 转换所有属性
+ viewportUnit: 'vw', // 转换后的单位
+ fontViewportUnit: 'vw', // 字体单位也使用 vw
+ selectorBlackList: [], // 不转换的选择器
+ minPixelValue: 1, // 小于等于 1px 不转换
+ mediaQuery: false, // 不转换媒体查询中的 px
+ replace: true, // 直接替换原属性
+ exclude: [/node_modules/], // 忽略 node_modules
+ landscape: false // 不生成横屏适配
+ }
+ }
+ }
},
axios: {
diff --git a/package.json b/package.json
index 44fdac4..f51818c 100644
--- a/package.json
+++ b/package.json
@@ -18,9 +18,11 @@
"axios": "^1.12.2",
"cookie-universal-nuxt": "^2.2.2",
"core-js": "^3.25.3",
+ "dayjs": "^1.11.19",
"element-ui": "^2.15.14",
"normalize.css": "^8.0.1",
"nuxt": "^2.15.8",
+ "postcss-px-to-viewport": "^1.1.1",
"vue": "^2.7.10",
"vue-server-renderer": "^2.7.10",
"vue-template-compiler": "^2.7.10"
diff --git a/pages/AIHub/AITools.vue b/pages/AIHub/AITools.vue
index 8c141ca..3f385b9 100644
--- a/pages/AIHub/AITools.vue
+++ b/pages/AIHub/AITools.vue
@@ -79,14 +79,14 @@
display: flex;
justify-content: flex-end;
.input-container {
- margin-top: 100px;
- margin-bottom: 60px;
+ margin-top: 30px;
+ margin-bottom: 30px;
}
}
.list {
display: flex;
flex-direction: column;
gap: 30px;
- margin-bottom: 60px;
+ margin-bottom: 40px;
}
diff --git a/pages/AIHub/AIToolsDetail.vue b/pages/AIHub/AIToolsDetail.vue
index 3f052b8..75d1895 100644
--- a/pages/AIHub/AIToolsDetail.vue
+++ b/pages/AIHub/AIToolsDetail.vue
@@ -2,19 +2,24 @@
+
{{ newsDetail.title || '' }}