This commit is contained in:
张成
2025-09-07 22:52:13 +08:00
parent 446c7564a7
commit 50982b7c02
3 changed files with 25 additions and 21 deletions

View File

@@ -40,8 +40,8 @@ interface UpdateUserParams {
avatar_url: string;
gender: string;
phone: string;
latitude: number;
longitude: number;
latitude?: number;
longitude?: number;
city: string;
province: string;
country: string;
@@ -379,17 +379,17 @@ export class UserService {
static async save_user_info(user_info: Partial<UserInfo> & { phone?: string; gender?: string }): Promise<boolean> {
try {
// 获取当前位置信息
const location = await Taro.getLocation({
type: 'wgs84'
});
// const location = await Taro.getLocation({
// type: 'wgs84'
// });
const updateParams: UpdateUserParams = {
nickname: user_info.nickname || '',
avatar_url: user_info.avatar || '',
gender: user_info.gender || '',
phone: user_info.phone || '',
latitude: location.latitude,
longitude: location.longitude,
latitude: user_info.latitude||'',
longitude: user_info.longitude||'',
city: user_info.location || '',
province: '', // 需要从用户信息中获取
country: '' // 需要从用户信息中获取