1
This commit is contained in:
@@ -22,7 +22,7 @@ class App extends Component<AppProps> {
|
|||||||
// 初始化字典数据
|
// 初始化字典数据
|
||||||
this.initDictionaryData()
|
this.initDictionaryData()
|
||||||
this.getNavBarHeight()
|
this.getNavBarHeight()
|
||||||
this.getLocation()
|
// this.getLocation()
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidShow() { }
|
componentDidShow() { }
|
||||||
|
|||||||
@@ -21,8 +21,12 @@ export interface UserInfo {
|
|||||||
ntrp_level: string;
|
ntrp_level: string;
|
||||||
phone?: string;
|
phone?: string;
|
||||||
gender?: string;
|
gender?: string;
|
||||||
|
|
||||||
|
latitude?: number,
|
||||||
|
longitude?: number,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 用户信息卡片组件属性
|
// 用户信息卡片组件属性
|
||||||
interface UserInfoCardProps {
|
interface UserInfoCardProps {
|
||||||
user_info: UserInfo;
|
user_info: UserInfo;
|
||||||
|
|||||||
@@ -40,8 +40,8 @@ interface UpdateUserParams {
|
|||||||
avatar_url: string;
|
avatar_url: string;
|
||||||
gender: string;
|
gender: string;
|
||||||
phone: string;
|
phone: string;
|
||||||
latitude: number;
|
latitude?: number;
|
||||||
longitude: number;
|
longitude?: number;
|
||||||
city: string;
|
city: string;
|
||||||
province: string;
|
province: string;
|
||||||
country: 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> {
|
static async save_user_info(user_info: Partial<UserInfo> & { phone?: string; gender?: string }): Promise<boolean> {
|
||||||
try {
|
try {
|
||||||
// 获取当前位置信息
|
// 获取当前位置信息
|
||||||
const location = await Taro.getLocation({
|
// const location = await Taro.getLocation({
|
||||||
type: 'wgs84'
|
// type: 'wgs84'
|
||||||
});
|
// });
|
||||||
|
|
||||||
const updateParams: UpdateUserParams = {
|
const updateParams: UpdateUserParams = {
|
||||||
nickname: user_info.nickname || '',
|
nickname: user_info.nickname || '',
|
||||||
avatar_url: user_info.avatar || '',
|
avatar_url: user_info.avatar || '',
|
||||||
gender: user_info.gender || '',
|
gender: user_info.gender || '',
|
||||||
phone: user_info.phone || '',
|
phone: user_info.phone || '',
|
||||||
latitude: location.latitude,
|
latitude: user_info.latitude||'',
|
||||||
longitude: location.longitude,
|
longitude: user_info.longitude||'',
|
||||||
city: user_info.location || '',
|
city: user_info.location || '',
|
||||||
province: '', // 需要从用户信息中获取
|
province: '', // 需要从用户信息中获取
|
||||||
country: '' // 需要从用户信息中获取
|
country: '' // 需要从用户信息中获取
|
||||||
|
|||||||
Reference in New Issue
Block a user