diff --git a/pages.json b/pages.json index 413d923..92ec95c 100644 --- a/pages.json +++ b/pages.json @@ -128,37 +128,37 @@ } }, { - "path": "pages/mypage/compents/wtcl/index",//问题处理 + "path": "pages/mypage/compents/wtcl/index", "style": { "navigationBarTitleText": "" } }, { - "path": "pages/mypage/compents/wxyh/index",//问题处理 + "path": "pages/mypage/compents/wxyh/index", "style": { "navigationBarTitleText": "" } }, { - "path": "pages/mypage/compents/wxyh/formZdy/index",//问题处理 + "path": "pages/mypage/compents/wxyh/formZdy/index", "style": { "navigationBarTitleText": "" } }, { - "path": "pages/mypage/compents/xcrw/index",//问题处理 + "path": "pages/mypage/compents/xcrw/index", "style": { "navigationBarTitleText": "" } }, { - "path": "pages/mypage/compents/wtcl/detail/index",//问题处理 + "path": "pages/mypage/compents/wtcl/detail/index", "style": { "navigationBarTitleText": "" } }, { - "path": "pages/mypage/compents/xcrw/detail/index",//巡查任务 + "path": "pages/mypage/compents/xcrw/detail/index", "style": { "navigationBarTitleText": "" } diff --git a/pages/homeIndex/index.vue b/pages/homeIndex/index.vue index 8e1be6a..603746b 100644 --- a/pages/homeIndex/index.vue +++ b/pages/homeIndex/index.vue @@ -29,8 +29,8 @@ @@ -54,6 +54,10 @@ @@ -262,11 +335,13 @@ text-align: left; margin-bottom: 12rpx; } + .info_24 { - padding: 15px; + // padding: 15px; background-color: #fff; - margin-bottom: 12rpx; + // margin-bottom: 12rpx; } + .title .line { border: 2px solid #3380ff; border-radius: 3rpx; diff --git a/pages/login/login.vue b/pages/login/login.vue index 33d6cef..944ade7 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -4,9 +4,9 @@ - 用户登录 + 用户登录 - + @@ -26,7 +26,6 @@ @@ -149,10 +152,10 @@ const imgUrl = uni.getStorageSync("imgUrl"); } .img { - - width: 100vw; + + width: 100vw; height: 40vh; - margin-top: 0vh; + margin-top: 0vh; /* background-color: red; */ } @@ -166,27 +169,24 @@ const imgUrl = uni.getStorageSync("imgUrl"); .user-title { position: relative; - padding: 4px; - text-align: center; - display: flex; - flex-direction: column; - .sub{ - font-size: 28px; - color: #000; - } - .line{ + padding: 4px; + text-align: center; + display: flex; + flex-direction: column; + + .sub { + font-size: 28px; + color: #000; + } + + .line { position: absolute; width: 80px; height: 5px; - left:20px; + left: 20px; bottom: -10px; background-color: #00a8ff; border-radius: 15%; } - } - - - - - + } \ No newline at end of file diff --git a/pages/mypage/compents/xcrw/detail/index.vue b/pages/mypage/compents/xcrw/detail/index.vue index a1f96c6..175e26f 100644 --- a/pages/mypage/compents/xcrw/detail/index.vue +++ b/pages/mypage/compents/xcrw/detail/index.vue @@ -5,8 +5,9 @@ fontSize:'18px' }" :height='44' :safeAreaInsetTop=true leftIconSize='20' leftIconColor='rgb(153, 153, 153)'> - - + + @@ -14,7 +15,7 @@ - + 任务标题1 {{taskTitle}} @@ -35,13 +36,13 @@ {{endDate}} - + - - + + 巡检项 @@ -50,7 +51,7 @@ - + @@ -59,22 +60,22 @@ import moment from 'moment' import DbForm from './dbForm.vue' export default { - components:{ + components: { DbForm }, data() { return { - taskTitle:'', - taskType:'', - taskContent:'', - startDate:'', - endDate:'', - status:'', - id:'', + taskTitle: '', + taskType: '', + taskContent: '', + startDate: '', + endDate: '', + status: '', + id: '', btnStatus: 0, - xjItem:[], - list:["正常","异常"], - current:3 + xjItem: [], + list: ["正常", "异常"], + current: 3 }; }, mounted() { @@ -82,7 +83,7 @@ }, methods: { // 开始巡查 - async startXc(){ + async startXc() { try { this.btnStatus = 1; this.getXjItem(this.id) @@ -90,25 +91,27 @@ uni.$showMsg(); } }, - // 获取巡查项 - async getXjItem(id){ + // 获取巡查项 + async getXjItem(id) { try { - const {data} = await uni.$http.get(`/gunshiApp/xyt/inspect/detail/info?taskId=${this.id}`) - if(data.code == 200){ + const { + data + } = await uni.$http.get(`/gunshiApp/xyt/inspect/detail/info?taskId=${this.id}`) + if (data.code == 200) { this.xjItem = data.data } } catch (error) { uni.$showMsg(); } }, - change(e){ - this.current = e; + change(e) { + this.current = e; } }, - onLoad(option){ + 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 @@ -133,17 +136,19 @@ } .item { - + padding-bottom: 10px; display: flex; align-items: center; + // justify-content: space-between; - .blueTiao{ + .blueTiao { background-color: #007aff; width: 5px; height: 16px; margin-right: 10px; } + .title { border-width: 0px; font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑', sans-serif; @@ -155,6 +160,7 @@ .titleRight { display: flex; + .border { border-width: 0px; background-color: rgba(236, 245, 255, 1); @@ -172,8 +178,9 @@ } } - .contentItem{ - .itemC{ + + .contentItem { + .itemC { display: flex; justify-content: space-between; display: flex; @@ -181,21 +188,24 @@ padding: 10px; border-bottom: 1px solid #f0f0f0; } - .itemNo{ + + .itemNo { color: #666666; padding: 10px; } } - .circle-btn{ + + .circle-btn { width: 120px; height: 120px; background-color: #007aff; border-radius: 50%; - color:#fff; + color: #fff; text-align: center; line-height: 120px; } - .yuandian{ + + .yuandian { display: inline-block; width: 10px; height: 10px; @@ -203,15 +213,18 @@ border-radius: 50%; margin-right: 10px; } - .xj-content{ + + .xj-content { height: 300px; overflow-y: auto; } - .xj-text{ + + .xj-text { margin-left: 10%; margin-top: 2%; } - .subsectioin{ + + .subsectioin { display: flex; column-gap: 10px; align-items: center; diff --git a/pages/mypage/mypage.vue b/pages/mypage/mypage.vue index a9cf404..a3c1a6b 100644 --- a/pages/mypage/mypage.vue +++ b/pages/mypage/mypage.vue @@ -13,7 +13,7 @@
-
+
@@ -25,7 +25,7 @@ 历史记录 - +
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