| | |
| | | <view class="content"> |
| | | <u-top-tips ref="uTips"></u-top-tips> |
| | | <map style="width: 100%; height: 30vh;" scale="14" :latitude="latitude" :longitude="longitude" |
| | | :polyline="polyline" show-location="true"> |
| | | <cover-view class="dingwBut" @click="getSelfLocation"> |
| | | |
| | | <cover-image src="../../static/images/taskinfo/map/img/dingwei.png" @click="getSelfLocation"> |
| | | </cover-image> |
| | | </cover-view> |
| | | :polyline="polyline"> |
| | | <!-- <cover-view class="dingwBut" @click="getSelfLocation"> |
| | | <cover-image src="../../static/images/taskinfo/map/img/dingwei.png"></cover-image> |
| | | </cover-view> --> |
| | | </map> |
| | | <view id="Umain" style="height: 71%;z-index: 9999;"> |
| | | <view class="once-b"> |
| | |
| | | 巡查标题 |
| | | </span> |
| | | <span class="once-right"> |
| | | {{data.title}} |
| | | {{taskinfoData.title}} |
| | | </span> |
| | | </view> |
| | | <view class="once"> |
| | |
| | | 巡查内容 |
| | | </span> |
| | | <span class="once-right"> |
| | | {{data.content}} |
| | | {{taskinfoData.content}} |
| | | </span> |
| | | </view> |
| | | <view class="once"> |
| | |
| | | 开始时间 |
| | | </span> |
| | | <span class="once-right"> |
| | | {{data.startTime}} |
| | | {{taskinfoData.startTime}} |
| | | </span> |
| | | </view> |
| | | <view class="once"> |
| | |
| | | 预计结束 |
| | | </span> |
| | | <span class="once-right"> |
| | | {{data.endTime}} |
| | | {{taskinfoData.endTime}} |
| | | </span> |
| | | </view> |
| | | <view class="once"> |
| | |
| | | 状态 |
| | | </span> |
| | | <span class="once-right"> |
| | | {{data.state == 0?'待开始':data.state == 1?'正在进行':'已完成'}} |
| | | {{taskinfoData.state == 0?'待开始':taskinfoData.state == 1?'正在进行':'已完成'}} |
| | | </span> |
| | | </view> |
| | | <view class="once-c"> |
| | |
| | | <script> |
| | | import { |
| | | getDetail |
| | | } from "@/api/taskinfo/taskinfo"; |
| | | } from "@/api/taskinfo/taskinfo" |
| | | export default { |
| | | data() { |
| | | return { |
| | | id: 0, |
| | | data: {}, |
| | | latitude: 28.6741777439167, |
| | | longitude: 115.91024735502, |
| | | taskinfoData: {}, |
| | | latitude: '', |
| | | longitude: '', |
| | | polyline: [{ |
| | | // LINESTRING(115.91024735502 28.6783047633229, 115.916073731654 28.6741777439167, |
| | | // 115.908426611165 28.6739956695312) |
| | | points: [{ |
| | | latitude: 28.6783047633229, |
| | | longitude: 115.91024735502 |
| | | }, |
| | | { |
| | | latitude: 28.6741777439167, |
| | | longitude: 115.916073731654 |
| | | }, |
| | | { |
| | | latitude: 28.6739956695312, |
| | | longitude: 115.908426611165 |
| | | } |
| | | points: [ |
| | | // { |
| | | // latitude: 28.6783047633229, |
| | | // longitude: 115.91024735502 |
| | | // }, |
| | | // { |
| | | // latitude: 28.6741777439167, |
| | | // longitude: 115.916073731654 |
| | | // }, |
| | | // { |
| | | // latitude: 28.6739956695312, |
| | | // longitude: 115.908426611165 |
| | | // } |
| | | ], |
| | | color: "#10a4ff", //线的颜色 |
| | | width: 10, //线的宽度 |
| | |
| | | }, |
| | | methods: { |
| | | getSelfLocation() { |
| | | // var that = this; |
| | | // uni.getLocation({ |
| | | // type: 'gcj02', |
| | | // isHighAccuracy: true, |
| | | // success(res) { |
| | | // that.latitude = res.latitude |
| | | // that.longitude = res.longitude |
| | | // } |
| | | // }) |
| | | }, |
| | | getDetail() { |
| | | getDetail(this.id).then(res => { |
| | | this.data = res.data; |
| | | var that = this; |
| | | uni.getLocation({ |
| | | type: 'gcj02', |
| | | isHighAccuracy: true, |
| | | success(res) { |
| | | that.latitude = res.latitude |
| | | that.longitude = res.longitude |
| | | } |
| | | }) |
| | | }, |
| | | getTaskinfoDetail() { |
| | | var _that = this |
| | | getDetail(_that.id).then(res => { |
| | | _that.taskinfoData = res.data; |
| | | //处理地图路线 // |
| | | let routeRange = _that.taskinfoData.routeRange.replace('LINESTRING', '') |
| | | .replace('\(', '').replace('\)', '') |
| | | let ranges = routeRange.split(',') |
| | | for (var i = 0; i < ranges.length; i++) { |
| | | let postion = ranges[i].split(' ') |
| | | _that.polyline[0].points.push({ |
| | | longitude: postion[0], |
| | | latitude: postion[1] |
| | | }) |
| | | } |
| | | _that.longitude = _that.polyline[0].points[0].longitude |
| | | _that.latitude = _that.polyline[0].points[0].latitude |
| | | }) |
| | | |
| | | } |
| | | }, |
| | | onLoad: function(options) { |
| | | if (options.id) { |
| | | this.id = options.id |
| | | this.getDetail() |
| | | this.getTaskinfoDetail() |
| | | } |
| | | } |
| | | } |