diff --git a/src/game_pages/list/index.tsx b/src/game_pages/list/index.tsx index 74c49db..f422e52 100644 --- a/src/game_pages/list/index.tsx +++ b/src/game_pages/list/index.tsx @@ -163,11 +163,11 @@ const ListPage = () => { Taro.stopPullDownRefresh(); // 显示刷新成功提示 - Taro.showToast({ - title: "刷新成功", - icon: "success", - duration: 1000, - }); + // Taro.showToast({ + // title: "刷新成功", + // icon: "success", + // duration: 1000, + // }); } catch (error) { // 刷新失败时也停止动画 Taro.stopPullDownRefresh(); @@ -207,7 +207,7 @@ const ListPage = () => { updateFilterOptions(params); }; - const handleSearchChange = () => { }; + const handleSearchChange = () => { }; // 距离筛选 const handleDistanceOrQuickChange = (name, value) => { @@ -228,8 +228,8 @@ const ListPage = () => { }); }; - // 初始化字典数据 - const initDictionaryData = async () => { + // 初始化字典数据 + const initDictionaryData = async () => { try { const { fetchDictionary } = useDictionaryStore.getState(); await fetchDictionary(); @@ -238,9 +238,9 @@ const ListPage = () => { } } - useEffect(() => { - initDictionaryData() - }, []); + useEffect(() => { + initDictionaryData() + }, []); return ( <> @@ -255,21 +255,21 @@ const ListPage = () => { {/* 列表内容 */} {/* 综合筛选 */} - {isShowFilterPopup && ( - - - - )} + {isShowFilterPopup && ( + + + + )} diff --git a/src/services/demoApi.ts b/src/services/demoApi.ts deleted file mode 100644 index 543edb7..0000000 --- a/src/services/demoApi.ts +++ /dev/null @@ -1,134 +0,0 @@ -import httpService from './httpService' -import type { ApiResponse } from './httpService' - -// 用户信息接口 -export interface UserProfile { - id: string - nickname: string - avatar?: string - age?: number - gender: 'male' | 'female' - interests: string[] - acceptNotification: boolean -} - -// 反馈评价接口 -export interface Feedback { - id: string - matchId: string - userId: string - photos: string[] - rating: number - recommend: 'yes' | 'no' | 'neutral' - aspects: string[] - comments: string - createdAt: string -} - -// DynamicFormDemo页面API服务类 -class DemoApiService { - // ==================== 用户信息相关接口 ==================== - - // 获取用户信息 - async getUserProfile(): Promise> { - return httpService.get('/user/profile') - } - - // 更新用户信息 - async updateUserProfile(data: Partial): Promise> { - return httpService.put('/user/profile', data, { - showLoading: true, - loadingText: '保存中...' - }) - } - - // 上传头像 - async uploadAvatar(filePath: string): Promise> { - return httpService.post('/user/avatar', { filePath }, { - showLoading: true, - loadingText: '上传头像中...' - }) - } - - // ==================== 反馈评价相关接口 ==================== - - // 提交活动评价 - async submitFeedback(data: { - matchId: string - photos?: string[] - rating: number - recommend: 'yes' | 'no' | 'neutral' - aspects: string[] - comments: string - }): Promise> { - return httpService.post('/feedback', data, { - showLoading: true, - loadingText: '提交评价中...' - }) - } - - // 获取我的评价列表 - async getMyFeedbacks(params?: { - page?: number - limit?: number - }): Promise> { - return httpService.get('/feedback/my', params) - } - - // 获取活动的所有评价 - async getMatchFeedbacks(matchId: string, params?: { - page?: number - limit?: number - }): Promise> { - return httpService.get(`/feedback/match/${matchId}`, params) - } - - // ==================== 通用表单提交接口 ==================== - - // 提交表单数据(通用接口) - async submitForm(formType: string, formData: any[]): Promise> { - return httpService.post('/forms/submit', { - type: formType, - data: formData - }, { - showLoading: true, - loadingText: '提交中...' - }) - } - - // 保存表单草稿 - async saveFormDraft(formType: string, formData: any[]): Promise> { - return httpService.post('/forms/draft', { - type: formType, - data: formData - }, { - showLoading: true, - loadingText: '保存中...' - }) - } - - // 获取表单草稿 - async getFormDrafts(formType: string): Promise> { - return httpService.get('/forms/drafts', { type: formType }) - } - - // 删除表单草稿 - async deleteFormDraft(id: string): Promise> { - return httpService.delete(`/forms/draft/${id}`) - } - - // ==================== 兴趣爱好相关接口 ==================== - - // 获取兴趣爱好选项 - async getInterestOptions(): Promise> { - return httpService.get('/interests') - } - - // 获取推荐的兴趣爱好 - async getRecommendedInterests(): Promise> { - return httpService.get('/interests/recommended') - } -} - -// 导出API服务实例 -export default new DemoApiService() \ No newline at end of file diff --git a/src/services/followService.ts b/src/services/followService.ts index 094d1ea..acf6e3f 100644 --- a/src/services/followService.ts +++ b/src/services/followService.ts @@ -139,7 +139,7 @@ export class FollowService { API_CONFIG.USER.FOLLOW, { following_id: user_id }, { - showLoading: true, + showLoading: false, loadingText: '关注中...' } ); @@ -162,7 +162,7 @@ export class FollowService { API_CONFIG.USER.UNFOLLOW, { following_id: user_id }, { - showLoading: true, + showLoading: false, loadingText: '取消关注中...' } ); diff --git a/src/services/listApi.ts b/src/services/listApi.ts index 84692c5..2104ed4 100644 --- a/src/services/listApi.ts +++ b/src/services/listApi.ts @@ -53,7 +53,7 @@ export const getGamesIntegrateList = async (params?: Record) => { */ export const getGamesCount = async (params?: Record) => { try { - return httpService.post('/games/count', params, { showLoading: true }) + return httpService.post('/games/count', params, { showLoading: false }) } catch (error) { console.error("列表数量获取失败:", error); throw error; @@ -68,7 +68,7 @@ export const getGamesCount = async (params?: Record) => { export const getSearchHistory = async (params) => { try { // 调用HTTP服务获取搜索历史记录 - return httpService.post('/games/search_history', params, { showLoading: true }) + return httpService.post('/games/search_history', params, { showLoading: false }) } catch (error) { // 捕获并打印错误信息 console.error("历史记录获取失败:", error); @@ -84,7 +84,7 @@ export const getSearchHistory = async (params) => { export const clearHistory = async (params) => { try { // 调用HTTP服务清除搜索历史记录 - return httpService.post('/games/search_history/delete_all', params, { showLoading: true }) + return httpService.post('/games/search_history/delete_all', params, { showLoading: false }) } catch (error) { // 捕获并打印错误信息 console.error("清除历史记录失败:", error); diff --git a/src/services/noticeService.ts b/src/services/noticeService.ts index eb67009..b5d2b1c 100644 --- a/src/services/noticeService.ts +++ b/src/services/noticeService.ts @@ -40,23 +40,23 @@ export interface UnreadMountResponse { class NoticeService { // 获取用户消息通知列表 async getNotificationList({ notification_type, is_read }: NoticeListParams): Promise> { - return httpService.post("/notifications/list", { notification_type, is_read }, { showLoading: true }); + return httpService.post("/notifications/list", { notification_type, is_read }, { showLoading: false }); } // 获取消息通知详情 async getNotificationDetail(notification_id: number): Promise> { - return httpService.post("/notifications/detail", { notification_id }, { showLoading: true }); + return httpService.post("/notifications/detail", { notification_id }, { showLoading: false }); } // 标记消息为已读 async markNotificationRead({ notification_ids, mark_all }: MarkReadParams): Promise> { - return httpService.post("/notifications/mark_read", { notification_ids, mark_all }, { showLoading: true }); + return httpService.post("/notifications/mark_read", { notification_ids, mark_all }, { showLoading: false }); } // 删除消息通知 async delNotification({ notification_ids, delete_all }: DeleteParams): Promise> { - return httpService.post("/notifications/delete", { notification_ids, delete_all }, { showLoading: true }); + return httpService.post("/notifications/delete", { notification_ids, delete_all }, { showLoading: false }); } // 获取未读消息数量 async getNotificationUnreadCount(): Promise> { - return httpService.post("/notifications/unread_count", {}, { showLoading: true }); + return httpService.post("/notifications/unread_count", {}, { showLoading: false }); } }