1
This commit is contained in:
@@ -22,7 +22,7 @@ class App extends Component<AppProps> {
|
||||
// 初始化字典数据
|
||||
this.initDictionaryData()
|
||||
this.getNavBarHeight()
|
||||
this.getLocation()
|
||||
// this.getLocation()
|
||||
}
|
||||
|
||||
componentDidShow() { }
|
||||
|
||||
@@ -21,8 +21,12 @@ export interface UserInfo {
|
||||
ntrp_level: string;
|
||||
phone?: string;
|
||||
gender?: string;
|
||||
|
||||
latitude?: number,
|
||||
longitude?: number,
|
||||
}
|
||||
|
||||
|
||||
// 用户信息卡片组件属性
|
||||
interface UserInfoCardProps {
|
||||
user_info: UserInfo;
|
||||
@@ -34,12 +38,12 @@ interface UserInfoCardProps {
|
||||
}
|
||||
|
||||
|
||||
// 处理编辑用户信息
|
||||
const on_edit = () => {
|
||||
// 处理编辑用户信息
|
||||
const on_edit = () => {
|
||||
Taro.navigateTo({
|
||||
url: '/pages/userInfo/edit/index'
|
||||
});
|
||||
};
|
||||
};
|
||||
// 用户信息卡片组件
|
||||
export const UserInfoCard: React.FC<UserInfoCardProps> = ({
|
||||
user_info,
|
||||
|
||||
@@ -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: '' // 需要从用户信息中获取
|
||||
|
||||
Reference in New Issue
Block a user