用户在线状态处理

This commit is contained in:
2025-10-19 13:40:20 +08:00
parent 39fa0b2d04
commit 118ec38550
7 changed files with 283 additions and 157 deletions

View File

@@ -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();