feat: 切换城市

This commit is contained in:
2025-10-15 20:34:08 +08:00
parent f63295db13
commit fcd9cc7d4c
13 changed files with 472 additions and 118 deletions

View File

@@ -48,8 +48,8 @@ export const getGamesIntegrateList = async (params?: Record<string, any>) => {
/**
* 获取列表数量
* @param params
* @returns
* @param params
* @returns
*/
export const getGamesCount = async (params?: Record<string, any>) => {
try {
@@ -79,7 +79,7 @@ export const getSearchHistory = async (params) => {
/**
* @description 清除搜索历史
* @returns
* @returns
*/
export const clearHistory = async (params) => {
try {
@@ -96,7 +96,7 @@ export const clearHistory = async (params) => {
/**
* @description 获取联想
* @param params 查询参数
* @returns
* @returns
*/
export const searchSuggestion = async (params) => {
try {
@@ -109,3 +109,26 @@ export const searchSuggestion = async (params) => {
throw error;
}
}
export const getCities = async () => {
try {
// 调用HTTP服务获取城市列表
return httpService.post('/cities/tree', {})
} catch (error) {
// 捕获并打印错误信息
console.error("城市列表获取失败:", error);
// 抛出错误以便上层处理
throw error;
}
}
export const getCityQrCode = async () => {
try {
// 调用HTTP服务获取城市二维码
return httpService.post('/hot_city_qr/list', {})
} catch (error) {
// 捕获并打印错误信息
console.error("城市二维码获取失败:", error);
// 抛出错误以便上层处理
throw error;
}
}