feat: 增加机器位置手动编辑功能及公开查看界面

This commit is contained in:
2026-07-11 15:43:17 +08:00
parent becd8f0e20
commit 84dbdf58c4
13 changed files with 316 additions and 51 deletions
+17 -16
View File
@@ -776,23 +776,24 @@ local function backgroundTicketUploadTask()
end
local function backgroundLocationSyncTask()
while true do
if gps and type(gps.locate) == "function" then
local x, y, z = gps.locate(2)
if x and y and z then
local payload = {
device_id = currentDeviceId(),
type = "TicketMachine",
station = (CFG.current_station and (CFG.current_station.en_name or CFG.current_station.name)) or state.stationName,
station_code = state.stationCode or CURRENT_STATION_CODE,
x = x,
y = y,
z = z
}
postJSONResult(API_BASE .. '/machine-location', payload)
end
sleep(5)
if gps and type(gps.locate) == "function" then
local x, y, z = gps.locate(2)
if x and y and z then
local payload = {
device_id = currentDeviceId(),
type = "TicketMachine",
station = (CFG.current_station and (CFG.current_station.en_name or CFG.current_station.name)) or state.stationName,
station_code = state.stationCode or CURRENT_STATION_CODE,
x = x,
y = y,
z = z
}
postJSONResult(API_BASE .. '/machine-location', payload)
end
sleep(60)
end
while true do
sleep(86400)
end
end