用户在线状态处理
This commit is contained in:
@@ -193,8 +193,24 @@ export class LoginModule {
|
||||
title: '签到中...',
|
||||
});
|
||||
|
||||
// 调用实际的签到接口
|
||||
const signInResult = await userService.signIn();
|
||||
// 先获取地图位置和当前时间
|
||||
let initialLocation: { latitude: number; longitude: number; timestamp: number };
|
||||
try {
|
||||
const location = await locationTrackingService.getCurrentLocation();
|
||||
// 使用秒级时间戳(除以1000取整)
|
||||
initialLocation = {
|
||||
latitude: location.latitude,
|
||||
longitude: location.longitude,
|
||||
timestamp: Math.floor(Date.now() / 1000)
|
||||
};
|
||||
console.log('获取到签到位置数据:', initialLocation);
|
||||
} catch (error) {
|
||||
console.error('获取位置失败:', error);
|
||||
throw new Error('获取位置失败,请检查位置权限设置');
|
||||
}
|
||||
|
||||
// 调用实际的签到接口,传递位置数据
|
||||
const signInResult = await userService.signIn(initialLocation);
|
||||
|
||||
wx.hideLoading();
|
||||
|
||||
|
Reference in New Issue
Block a user