pull/12/head
xiaozhiyong 1 year ago
parent 20728f6e13
commit 3d13ebb01d
  1. 1
      BagStation/pages/newRoutePlanning/components/footerScroll.vue
  2. 103
      BagStation/pages/newRoutePlanning/newRoutePlanning.vue
  3. 1
      BagStation/pages/newRoutePlanning/siteList.vue

@ -152,7 +152,6 @@
},
methods: {
showSite() {
console.log('footerScroll this.markers',this.markers)
let markers = encodeURIComponent(JSON.stringify(this.markers))
uni.navigateTo({
url:`/BagStation/pages/newRoutePlanning/siteList?markers=${markers}`

@ -7,8 +7,8 @@
:selePrice='selePrice' @dragMap='dragMap' :details='details' :polyline="polyline"
@mapEventListeners='mapEventListeners' :markers="markers" />
<view class="map_body">
<map @bindregionchange='bindregionchange' @tap='poitap' @updated='mapUpdated' :scale='mapScale'
@callouttap='callouttap' :enable-scroll='enableScroll' @markertap='markertap' :polyline="polyline"
<map @tap='poitap' @updated='mapUpdated' :scale='mapScale' @callouttap='callouttap'
:enable-scroll='enableScroll' @markertap='markertap' :polyline="polyline"
subkey="UTXBZ-BUH6D-TQD44-HCEG4-UKOFT-U2BDN" layer-style='2' id="map_Id" :show-location="true"
:markers="markers" class="map_xx" :latitude="coordinate.latitude" :longitude="coordinate.longitude">
<cover-view slot="callout">
@ -72,7 +72,8 @@
details: {},
spareMarkers: [],
selePrice: null,
mapScale: 16
mapScale: 16,
firstLocation: {}
}
},
onLoad(e) {
@ -92,21 +93,18 @@
perspectives(item) {
let {
latitude,
longitude
longitude,
siteId
} = item
setTimeout(() => {
this.newMapMoveToLocation(longitude, latitude, 'reset')
}, 500)
},
bindregionchange(e) {
console.log(e, '***********')
},
mapUpdated(e) {
let that = this
console.log('更新', e);
that.mapContext.getScale({
this.mapContext.getScale({
success: function(e) {
console.log(e, '当前缩放比例')
console.log('地图渲染回调,当前缩放系数:', e)
}
})
},
@ -147,6 +145,7 @@
this.spareMarkers = this.locationProcessing(markerList);
this.markers = await this.filterMarkers(JSON.parse(JSON.stringify(this.spareMarkers)));
this.mapScale = 10
break;
case 'localScreen':
//
@ -179,7 +178,6 @@
this.markers = this.filterMarkers(this.markers,this.$refs.footerScroll.filter());
},0)
*/
break;
case 'MoveToLocation':
arguments[1] ? (this.newMapMoveToLocation(this.Route.start.longitude, this.Route.start
@ -198,7 +196,7 @@
// 线
async mapRoutePlanning(start = this.Route.start, end = this.Route.end, strategy = 'LEAST_TIME') {
//
let res = await this.getMapRoutePlanning(start, end, strategy);
let res = await this.getMapRoutePlanning(start, end);
//
this.polyline = this.RoutePlanningHandle(res);
//
@ -266,7 +264,11 @@
})
},
//线
getMapRoutePlanning(start, end, strategy = 'LEAST_TIME') {
getMapRoutePlanning(start, end) {
let {
seleIndex
} = this.$refs.footerScroll.$data
var _this = this;
return new Promise(function(res, rej) {
_this.TXSDK.direction({
@ -274,7 +276,7 @@
mode: 'driving',
from: start,
to: end,
policy: strategy,
policy: seleIndex || 'LEAST_TIME',
success: function(e) {
console.log('获取路线规划成功')
res(e)
@ -324,12 +326,6 @@
zoomRoutePlanning(points, padding) {
let that = this
let system = uni.getSystemInfoSync().platform;
// setTimeout(()=>{
// uni.showToast({
// title: system,
// icon: 'none'
// })
// },1000)
try {
let paddingTop = this.$refs.addressSelector.getElement();
this.mapContext.includePoints({
@ -361,14 +357,20 @@
},
//markers
async mapUpdateMarkers(points = this.polyline[0].points, oilProductCode = '0#', juLi = '5', siteChannel = '') {
//
let {
latitude,
longitude
} = this.firstLocation
let data = {
geoList: points,
oilProductCode: oilProductCode ? oilProductCode : '0#',
juLi: juLi ? juLi : '5',
siteChannel: siteChannel,
countJuLi: points[0].distance,
latitude: this.coordinate.latitude,
longitude: this.coordinate.longitude
latitude: latitude || this.coordinate.latitude,
longitude: longitude || this.coordinate.longitude
}
let taht = this;
return new Promise(function(re, rj) {
@ -393,11 +395,10 @@
},
//
locationProcessing(markerList) {
// console.log(markerList, '----')
markerList.forEach((item, index) => {
let configure = {
siteId: item.id,
id: Number(`${index}`),
id: Number(`${index}`), //2023.08.30 bid
imgCustomCallout: this.olitype(item.siteChannel),
iconPath: '../../static/img/tt.png',
width: 5,
@ -417,13 +418,11 @@
//
async callouttap(e) {
let seleMark = this.markers.filter(item => item.id == e.detail.markerId);
// this.enableScroll = true
let details = await oilSiteApi.getSiteDetails({
latitude: String(this.coordinate.latitude),
longitude: String(this.coordinate.longitude),
latitude: String(this.firstLocation.latitude),
longitude: String(this.firstLocation.longitude),
siteId: seleMark[0].siteId
});
// console.log(details, '***')
if (details.code !== 20000) {
uni.showToast({
title: details.msg,
@ -441,16 +440,25 @@
},
//
getCurrentLocation() {
let that = this
// let that = this
uni.getLocation({
type: 'gcj02',
success: function(res) {
({
latitude: that.coordinate.latitude,
longitude: that.coordinate.longitude
} = res);
that.myLocation = res;
that.Route.start = Object.assign(that.Route.start, that.coordinate);
success: (res) => {
// ({
// latitude: that.coordinate.latitude,
// longitude: that.coordinate.longitude
// } = res);
let {
latitude,
longitude
} = res
this.coordinate.latitude = latitude
this.firstLocation.latitude = latitude
this.coordinate.longitude = longitude
this.firstLocation.longitude = longitude
this.myLocation = res;
this.Route.start = Object.assign(this.Route.start, this.coordinate);
}
});
},
@ -460,19 +468,18 @@
this.mapContext.moveToLocation({
longitude: longitude,
latitude: latitude,
success(e) {
success: (e) => {
console.log(`移动 坐标→ ${longitude}-${latitude}`);
if (type) {
that.coordinate.latitude = latitude
that.coordinate.longitude = longitude
that.mapContext.getScale({
success: function(e) {
setTimeout(() => {
that.mapScale = e.scale;
setTimeout(() => {
that.mapScale = 13
}, 500)
}, 500)
this.coordinate.latitude = latitude
this.coordinate.longitude = longitude
this.mapContext.getScale({
success: res => {
this.mapScale = res.scale
this.$nextTick(() => {
this.mapScale = 13
})
}
})
}

@ -36,7 +36,6 @@
if (!options.markers) return
let markers = JSON.parse(decodeURIComponent(options.markers))
this.siteList = markers
console.log('site markers', markers)
},
filters: {
adjust(val) {

Loading…
Cancel
Save