diff --git a/pages/xcrw/detail/dbForm.vue b/pages/xcrw/detail/dbForm.vue
index d0237cc..49e1b95 100644
--- a/pages/xcrw/detail/dbForm.vue
+++ b/pages/xcrw/detail/dbForm.vue
@@ -60,7 +60,7 @@
- {
diff --git a/pages/xcrw/detail/index.vue b/pages/xcrw/detail/index.vue
index f40e1a1..2aa6f52 100644
--- a/pages/xcrw/detail/index.vue
+++ b/pages/xcrw/detail/index.vue
@@ -90,17 +90,17 @@
// 开始巡查
async startXc(){
try {
- if(status == 0){
+ if(this.status == 0){
const {data} = await uni.$http.get(`/gunshiApp/xyt/inspect/task/startInspect/${this.id}`)
if(data.code == 200){
this.btnStatus = 1;
this.getXjItem(this.id)
}
- }else if(status == 1){
+ }else if(this.status == 1){
this.btnStatus = 1;
this.getXjItem(this.id)
}
-
+ this.getLocationWithInterval();
} catch (error) {
uni.$showMsg();
@@ -117,15 +117,52 @@
uni.$showMsg();
}
},
+
+ getLocationWithInterval() {
+ this.getLocation(); // 首次获取经纬度信息
+ // 设置定时器,每隔5秒获取一次经纬度信息
+ let timer= setInterval(() => {
+ this.getLocation();
+ }, 300000); // 五分钟
+ uni.setStorageSync("timer", timer);
+ },
+ // 获取经纬度
+ getLocation() {
+ uni.getLocation({
+ type: 'gcj02',
+ success: (res) => {
+ this.latitude = res.latitude;
+ this.longitude = res.longitude;
+ this.sendLocation(res.latitude,res.longitude)
+ },
+ fail: (err) => {
+ console.log('Failed to get location:', err);
+ }
+ });
+ },
+ // 将经纬度传给服务器
+ async sendLocation(latitude, longitude) {
+ try {
+ const { data } = await uni.$http.post(`/gunshiApp/xyt/inspectTaskTrack/insert`, {
+ taskId: this.id,
+ lttd: latitude,
+ lgtd: longitude
+ })
+ if (data.code == 200) {
+ console.log('Location sent successfully')
+ }
+ } catch (error) {
+ uni.$showMsg();
+ }
+ }
},
onLoad(option){
this.taskTitle = option.taskTitle
this.taskType = option.taskType
- this.taskContent = option.taskContent
+ this.taskContent = option.taskContent== "null" ? null:option.taskContent
this.startDate = (option.startDate)
this.endDate = option.endDate == "null" ? "" : option.endDate
-
this.status = option.status
this.id = option.id
}
diff --git a/pages/xcrw/index.vue b/pages/xcrw/index.vue
index a071958..12e76f7 100644
--- a/pages/xcrw/index.vue
+++ b/pages/xcrw/index.vue
@@ -129,6 +129,13 @@
url:`/pages/xcrw/detail/index?taskTitle=${record.taskTitle}&taskType=${record.taskType}&taskContent=${record.taskContent}&startDate=${record.startDate}&endDate=${record.endDate}&status=${record.status}&id=${record.id}`
})
}
+ },
+ onShow(){
+ const timer =uni.getStorageSync('timer');
+ if(timer){
+ clearInterval(timer);
+ uni.removeStorageSync('timer');
+ }
}
}
diff --git a/pages/ylzList/index.vue b/pages/ylzList/index.vue
index f2fc9a8..3088436 100644
--- a/pages/ylzList/index.vue
+++ b/pages/ylzList/index.vue
@@ -39,7 +39,6 @@
h12:22,
h24:35,
},
- ylzList:[]
}
},
methods:{
@@ -60,27 +59,14 @@
// #eb20f5 100-250
// #761e50 >=250
},
- // 获取雨量站
- async getYlzData(){
- try {
- const {data} = await uni.$http.post(
- "/gunshiApp/xyt/stPptnRReal/list")
- if(data.code == 200){
- this.ylzList = [...data.data];
- }
- } catch (error) {
- uni.$showMsg();
- }
- },
+
toDetail(){
uni.navigateTo({
url:`/pages/ylzList/detail/index?stnm=${this.item.stnm}`
})
},
},
- mounted() {
- this.getYlzData();
- },
+
}
diff --git a/static/images/info.png b/static/images/info.png
index 40c7fda..69e2537 100644
Binary files a/static/images/info.png and b/static/images/info.png differ
diff --git a/static/images/password.png b/static/images/password.png
index 1d5261d..a6a4eac 100644
Binary files a/static/images/password.png and b/static/images/password.png differ