From c3bb39a4cbd6f172884d4d8598554ab504ea0b0f Mon Sep 17 00:00:00 2001
From: 罗广辉 <guanghui.luo@foxmail.com>
Date: Mon, 26 Jan 2026 15:22:14 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
uniapps/work-app/src/pages/work/index.vue | 26 ++++++++++++
uniapps/work-app/src/api/map.js | 8 ++++
uniapps/work-app/src/pages/map/index.vue | 10 -----
uniapps/work-app/src/store/modules/location.js | 34 ++++++++++++++---
4 files changed, 61 insertions(+), 17 deletions(-)
diff --git a/uniapps/work-app/src/api/map.js b/uniapps/work-app/src/api/map.js
index 9e905bb..dbd1f17 100644
--- a/uniapps/work-app/src/api/map.js
+++ b/uniapps/work-app/src/api/map.js
@@ -7,3 +7,11 @@
data: { hidden_flag: 0, ...data },
})
}
+// 位置上报
+export const reportLocationApi = data => {
+ return request({
+ url: '/webservice/jaUserTrajectory/reportLocation',
+ method: 'post',
+ data,
+ })
+}
\ No newline at end of file
diff --git a/uniapps/work-app/src/pages/map/index.vue b/uniapps/work-app/src/pages/map/index.vue
index 2236da4..2ee54c8 100644
--- a/uniapps/work-app/src/pages/map/index.vue
+++ b/uniapps/work-app/src/pages/map/index.vue
@@ -1,13 +1,3 @@
-<!--
- * @Author : yuan
- * @Date : 2025-12-03 14:20:57
- * @LastEditors : yuan
- * @LastEditTime : 2025-12-20 16:49:02
- * @FilePath : \src\pages\map\index.vue
- * @Description :
- * Copyright 2025 OBKoro1, All Rights Reserved.
- * 2025-12-03 14:20:57
--->
<template>
<view class="page-wrap">
<WebViewPlus :src="`${viewUrl}`" @webMessage="onPostMessage" />
diff --git a/uniapps/work-app/src/pages/work/index.vue b/uniapps/work-app/src/pages/work/index.vue
index 7295f81..7cccdb0 100644
--- a/uniapps/work-app/src/pages/work/index.vue
+++ b/uniapps/work-app/src/pages/work/index.vue
@@ -2,7 +2,7 @@
<div class="eventTickets" :style="{ paddingTop: topMargin + 'px' }">
<div class="searchTop">
- <up-search placeholder="请输入关键字搜索" :animation="true" v-model="listParams.keyword" :show-action="false" @search="handleSearch"></up-search>
+ <up-search placeholder="请输入关键字搜索" :animation="true" v-model="listParams.keyword" :show-action="false" @search="handleSearch" @clear="handleClear"></up-search>
</div>
<div class="listBox">
<div class="tabs-container">
@@ -18,6 +18,11 @@
<div class="itemContent">{{formatDate(item.createTime) }}</div>
</div>
</div>
+ </div>
+
+ <!-- 暂无数据提示 -->
+ <div class="noData" v-if="!loading && dataList.length === 0">
+ <text>暂无数据</text>
</div>
<!-- 加载提示 -->
@@ -151,6 +156,15 @@
// 搜索功能
const handleSearch = () => {
+ listParams.value.current = 1
+ hasMore.value = true
+ dataList.value = []
+ getDataList()
+ getstatusCountData()
+}
+// 清除搜索
+const handleClear = () => {
+ listParams.value.keyword = ''
listParams.value.current = 1
hasMore.value = true
dataList.value = []
@@ -295,5 +309,15 @@
color: #999;
width: 100%;
}
+
+ .noData {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ height: 300rpx;
+ font-size: 28rpx;
+ color: #999;
+ width: 100%;
+ }
}
</style>
diff --git a/uniapps/work-app/src/store/modules/location.js b/uniapps/work-app/src/store/modules/location.js
index d0f6889..b68a86b 100644
--- a/uniapps/work-app/src/store/modules/location.js
+++ b/uniapps/work-app/src/store/modules/location.js
@@ -1,5 +1,6 @@
import { defineStore } from 'pinia'
import locationUtil from '@/utils/location.js'
+import { reportLocationApi } from '@/api/map.js'
const useLocationStore = defineStore('location', {
state: () => ({
@@ -12,7 +13,9 @@
// 位置更新间隔(毫秒)
updateInterval: 5000,
// 位置监听器ID
- watcherId: null
+ watcherId: null,
+ // 上次位置上报时间
+ lastReportTime: 0
}),
getters: {
@@ -115,13 +118,32 @@
},
/**
- * 位置信息上报(可根据实际需求实现)
+ * 位置信息上报
* @param {Object} location 位置信息
*/
- reportLocation(location) {
- // 这里可以添加位置信息上报到服务器的逻辑
- // 例如:api.uploadLocation(location)
- console.log('位置上报:', location);
+ async reportLocation(location) {
+
+ try {
+ const now = Date.now();
+ // 检查是否达到上报时间间隔(1分钟)
+ if (now - this.lastReportTime >= 60000) {
+ // 构造请求参数
+ const params = {
+ longitude: location.longitude,
+ latitude: location.latitude,
+ // reportTime: new Date().toISOString()
+ };
+
+ // 调用位置上报接口
+ const result = await reportLocationApi(params);
+ console.log('位置上报成功:', result);
+
+ // 更新上次上报时间
+ this.lastReportTime = now;
+ }
+ } catch (error) {
+ console.error('位置上报失败:', error);
+ }
},
/**
--
Gitblit v1.9.3