feat: 优化首页和搜索页面样式及功能

1. 修复了搜索页面中的类型错误和构建问题
   - 修复了 v-model 的类型断言问题
   - 优化了搜索关键字的处理逻辑

2. 优化了首页布局和样式
   - 添加了渐变背景样式
   - 调整了搜索栏和轮播图的间距
   - 优化了卡片圆角和边距

3. 改进了广告页面(AD)的UI
   - 优化了布局和样式
   - 添加了响应式设计
   - 改进了按钮样式和交互

4. 重构了主题和样式
   - 提取了常用样式到 theme.scss
   - 使用 SCSS 变量管理颜色和尺寸
   - 优化了组件间的样式复用

5. 修复了路由和布局问题
   - 更新了路由配置
   - 优化了重定向布局
   - 修复了导航栏显示问题
This commit is contained in:
Huangzhe
2025-05-18 17:50:11 +08:00
parent 51a9fd085e
commit 6852188cf1
23 changed files with 228 additions and 78 deletions

View File

@@ -7,10 +7,10 @@ const option = {
// tooltip: {
// trigger: 'item'
// },
// legend: {
// orient: 'vertical',
// left: 'left'
// },
legend: {
orient: 'horizontal',
bottom: 'left'
},
label: {
formatter: '{b},{c}'
},

View File

@@ -0,0 +1,4 @@
### 作用
这个文件夹是用来获取异步数据内容的,由于之前异步获取的变量都在 hooks 方法外的定义,相当于 pinia 的定义变量。
没有规范好,所以有了这个文件夹,异步获取的数据在这里重新定义使用。后续会持续更改重复请求到这里的。

View File

@@ -0,0 +1,40 @@
import { getSurveysDetail } from '@/api/design';
import { getSurveysPage } from '@/api/home';
import { ref, type Ref } from 'vue';
// 异步函数获取数据
function fetchSurveys({ page = 1, perPage = 3 } = {}) {
const surveys = ref<SurveyItem[]>([]);
const params = {
page: page,
per_page: perPage,
group_id: 0
};
getSurveysPage(params).then(({ data }) => {
if (data.code !== 0) return;
surveys.value = data.data;
});
return {
surveys
};
}
/**
* 通过 sn 获取单个问卷的数据
* @param sn {string}
* @returns { {currentSurvey: Ref<SurveyItem> }}
*/
function fetchSingleSurvey(sn: string) {
const currentSurvey = ref<SurveyItem>();
getSurveysDetail(sn).then(({ data }) => {
if (data.code !== 0) return;
currentSurvey.value = data.data;
});
return { currentSurvey };
}
export { fetchSurveys, fetchSingleSurvey };