refactor:优化移动端页面

This commit is contained in:
jiangrui
2025-03-05 12:29:47 +08:00
parent 680108f499
commit 604ba2eec6
12 changed files with 793 additions and 309 deletions

View File

@@ -5,6 +5,7 @@ import { ElMessage } from "element-plus";
interface StoreType {
hotList: HotListItem[];
loading: boolean;
currentParams: CurrentParams;
}
@@ -16,6 +17,7 @@ interface CurrentParams {
export const useDoubanStore = defineStore("douban", {
state: (): StoreType => ({
hotList: [],
loading: false,
currentParams: {
type: "movie",
tag: "热门",
@@ -24,6 +26,7 @@ export const useDoubanStore = defineStore("douban", {
actions: {
async getHotList() {
this.loading = true;
try {
const params = {
type: this.currentParams.type,
@@ -40,6 +43,8 @@ export const useDoubanStore = defineStore("douban", {
}
} catch (error) {
ElMessage.error(error || "获取热门列表失败");
} finally {
this.loading = false;
}
},
setCurrentParams(currentParams: CurrentParams) {