Merge remote-tracking branch 'origin/master'
This commit is contained in:
25
api/map.js
25
api/map.js
@@ -23,15 +23,22 @@ export const getcoder = (location, key, get_poi) => {
|
|||||||
reject(err)
|
reject(err)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
// return request({
|
}
|
||||||
// url: 'https://apis.map.qq.com/ws/geocoder/v1',
|
|
||||||
// method: 'get',
|
// 地名解析
|
||||||
// params: {
|
export const getAddresscoder = (params) => {
|
||||||
// location,
|
return new Promise((resolve, reject) => {
|
||||||
// key,
|
const paramsData = {
|
||||||
// get_poi
|
...params,
|
||||||
// }
|
output: 'jsonp'
|
||||||
// })
|
}
|
||||||
|
jsonp('https://apis.map.qq.com/ws/geocoder/v1', paramsData, 30000)
|
||||||
|
.then((response) => {
|
||||||
|
return response
|
||||||
|
}).catch(err => {
|
||||||
|
reject(err)
|
||||||
|
})
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/*关键词输入提示*/
|
/*关键词输入提示*/
|
||||||
|
|||||||
@@ -238,7 +238,7 @@
|
|||||||
latitude: res.latitude,
|
latitude: res.latitude,
|
||||||
longitude: res.longitude
|
longitude: res.longitude
|
||||||
}
|
}
|
||||||
that.getAddrByPoint(res);
|
// that.getAddrByPoint(res);
|
||||||
that.getNearList(that.currentPoint)
|
that.getNearList(that.currentPoint)
|
||||||
},
|
},
|
||||||
complete: function(e) {}
|
complete: function(e) {}
|
||||||
|
|||||||
@@ -254,7 +254,7 @@
|
|||||||
latitude: res.latitude,
|
latitude: res.latitude,
|
||||||
longitude: res.longitude
|
longitude: res.longitude
|
||||||
}
|
}
|
||||||
that.getAddrByPoint(res);
|
// that.getAddrByPoint(res);
|
||||||
that.getNearList(that.currentPoint)
|
that.getNearList(that.currentPoint)
|
||||||
},
|
},
|
||||||
complete: function(e) {}
|
complete: function(e) {}
|
||||||
|
|||||||
@@ -95,7 +95,7 @@
|
|||||||
公司地址:{{info.companyAddress || '暂无'}}
|
公司地址:{{info.companyAddress || '暂无'}}
|
||||||
</view> -->
|
</view> -->
|
||||||
<view class="prolist">
|
<view class="prolist">
|
||||||
工作地址:{{cityNamed || '暂无'}}
|
工作地址:{{info.jobAddress || cityNamed || '暂无'}}
|
||||||
</view>
|
</view>
|
||||||
<view class="prolist">
|
<view class="prolist">
|
||||||
详细地址:{{info.address || '暂无'}}
|
详细地址:{{info.address || '暂无'}}
|
||||||
@@ -209,6 +209,12 @@
|
|||||||
import uniMask from '@/components/uni-mask/mask.vue'
|
import uniMask from '@/components/uni-mask/mask.vue'
|
||||||
import uniPopup from '@/components/uni-popup/uni-popup.vue'
|
import uniPopup from '@/components/uni-popup/uni-popup.vue'
|
||||||
import validCode from '@/components/p-valid-code/p-valid-code.vue'
|
import validCode from '@/components/p-valid-code/p-valid-code.vue'
|
||||||
|
import {
|
||||||
|
AddressToLocation
|
||||||
|
} from '@/untils/addressToLocation.js'
|
||||||
|
import {
|
||||||
|
add
|
||||||
|
} from 'lodash';
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -220,8 +226,8 @@
|
|||||||
maskShow: false,
|
maskShow: false,
|
||||||
nextBtn: false,
|
nextBtn: false,
|
||||||
loading: false,
|
loading: false,
|
||||||
latitude: 39.909, //中心点
|
latitude: 31.126855, //中心点
|
||||||
longitude: 116.39742,
|
longitude: 104.397894,
|
||||||
covers: [{ //marker标记位置
|
covers: [{ //marker标记位置
|
||||||
id: 0,
|
id: 0,
|
||||||
latitude: 0,
|
latitude: 0,
|
||||||
@@ -301,10 +307,19 @@
|
|||||||
missionDetail(self.missionNo).then(res => {
|
missionDetail(self.missionNo).then(res => {
|
||||||
self.info = res.data.data;
|
self.info = res.data.data;
|
||||||
self.status = res.data.data.detailStatus;
|
self.status = res.data.data.detailStatus;
|
||||||
self.latitude = self.info.lat;
|
AddressToLocation({
|
||||||
self.longitude = self.info.lon;
|
smart_address: res.data.data.address
|
||||||
self.covers[0].latitude = self.info.lat;
|
}).then((result) => {
|
||||||
self.covers[0].longitude = self.info.lon;
|
console.log('result', result)
|
||||||
|
self.latitude = result.location.lat;
|
||||||
|
self.longitude = result.location.lon;
|
||||||
|
self.covers[0].latitude = result.location.lat;
|
||||||
|
self.covers[0].longitude = result.location.lon;
|
||||||
|
})
|
||||||
|
// self.latitude = self.info.lat;
|
||||||
|
// self.longitude = self.info.lon;
|
||||||
|
// self.covers[0].latitude = self.info.lat;
|
||||||
|
// self.covers[0].longitude = self.info.lon;
|
||||||
self.showDetail = true;
|
self.showDetail = true;
|
||||||
self.getCollectStatus();
|
self.getCollectStatus();
|
||||||
if (self.type === 1) {
|
if (self.type === 1) {
|
||||||
@@ -414,7 +429,8 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
cityNamed() {
|
cityNamed() {
|
||||||
if (this.info && typeof this.info.cityId !== 'undefined' && this.info.cityId !== -1 && this.area.dic) {
|
if (this.info && typeof this.info.cityId !== 'undefined' && this.info.cityId !== -1 && this.area
|
||||||
|
.dic) {
|
||||||
return this.area.dic[this.info.cityId].label
|
return this.area.dic[this.info.cityId].label
|
||||||
} else {
|
} else {
|
||||||
return '无'
|
return '无'
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<view v-if="showDetail">
|
<view v-if="showDetail">
|
||||||
<view class="head">
|
<view class="head">
|
||||||
<view class="proname">
|
<view class="proname">
|
||||||
{{info.missionTitle || '暂无'}}
|
{{info.jobName || '暂无'}}
|
||||||
</view>
|
</view>
|
||||||
<!-- <view class="prolist">
|
<!-- <view class="prolist">
|
||||||
任务编码:{{info.missionNo}}
|
任务编码:{{info.missionNo}}
|
||||||
@@ -95,7 +95,7 @@
|
|||||||
公司地址:{{info.companyAddress || '暂无'}}
|
公司地址:{{info.companyAddress || '暂无'}}
|
||||||
</view> -->
|
</view> -->
|
||||||
<view class="prolist">
|
<view class="prolist">
|
||||||
工作地址:{{cityNamed || '暂无'}}
|
工作地址:{{info.jobAddress || cityNamed || '暂无'}}
|
||||||
</view>
|
</view>
|
||||||
<view class="prolist">
|
<view class="prolist">
|
||||||
详细地址:{{info.address || '暂无'}}
|
详细地址:{{info.address || '暂无'}}
|
||||||
@@ -226,8 +226,8 @@
|
|||||||
maskShow: false,
|
maskShow: false,
|
||||||
nextBtn: false,
|
nextBtn: false,
|
||||||
loading: false,
|
loading: false,
|
||||||
latitude: 39.909, //中心点
|
latitude: 31.126855, //中心点
|
||||||
longitude: 116.39742,
|
longitude: 104.397894,
|
||||||
covers: [{ //marker标记位置
|
covers: [{ //marker标记位置
|
||||||
id: 0,
|
id: 0,
|
||||||
latitude: 0,
|
latitude: 0,
|
||||||
@@ -320,10 +320,10 @@
|
|||||||
self.info = resData.data.data;
|
self.info = resData.data.data;
|
||||||
self.status = resData.data.data.status;
|
self.status = resData.data.data.status;
|
||||||
self.missionNo = resData.data.data.missionNo;
|
self.missionNo = resData.data.data.missionNo;
|
||||||
self.latitude = self.info.lat;
|
// self.latitude = self.info.lat;
|
||||||
self.longitude = self.info.lon;
|
// self.longitude = self.info.lon;
|
||||||
self.covers[0].latitude = self.info.lat;
|
// self.covers[0].latitude = self.info.lat;
|
||||||
self.covers[0].longitude = self.info.lon;
|
// self.covers[0].longitude = self.info.lon;
|
||||||
self.showDetail = true;
|
self.showDetail = true;
|
||||||
if (!this.seeDeatil) {
|
if (!this.seeDeatil) {
|
||||||
self.getCollectStatus();
|
self.getCollectStatus();
|
||||||
@@ -426,11 +426,19 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters(['auth', 'autograph']),
|
...mapGetters(['auth', 'autograph', 'area']),
|
||||||
skillNames() {
|
skillNames() {
|
||||||
if (this.info.skillNames) {
|
if (this.info.skillNames) {
|
||||||
return this.info.skillNames.split(',')
|
return this.info.skillNames.split(',')
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
cityNamed() {
|
||||||
|
console.log('val', this.info, this.area.dic)
|
||||||
|
if (this.info && this.info.cityId !== -1 && this.area.dic) {
|
||||||
|
return this.area.dic[this.info.cityId].label
|
||||||
|
} else {
|
||||||
|
return '无'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -100,7 +100,7 @@
|
|||||||
座机号:{{info.callNumber}}
|
座机号:{{info.callNumber}}
|
||||||
</view> -->
|
</view> -->
|
||||||
<view class="prolist">
|
<view class="prolist">
|
||||||
工作地址:{{`${info.province}${info.city}${info.county}` || '暂无'}}
|
工作地址:{{`${info.province}${info.city}${info.county}` || info.jobAddress || '暂无'}}
|
||||||
</view>
|
</view>
|
||||||
<view class="prolist">
|
<view class="prolist">
|
||||||
详细地址:{{info.address || '暂无'}}
|
详细地址:{{info.address || '暂无'}}
|
||||||
@@ -231,8 +231,8 @@
|
|||||||
maskShow: false,
|
maskShow: false,
|
||||||
nextBtn: false,
|
nextBtn: false,
|
||||||
loading: false,
|
loading: false,
|
||||||
latitude: 39.909, //中心点
|
latitude: 31.126855, //中心点
|
||||||
longitude: 116.39742,
|
longitude: 104.397894,
|
||||||
covers: [{ //marker标记位置
|
covers: [{ //marker标记位置
|
||||||
id: 0,
|
id: 0,
|
||||||
latitude: 0,
|
latitude: 0,
|
||||||
@@ -325,10 +325,10 @@
|
|||||||
self.info = resData.data.data;
|
self.info = resData.data.data;
|
||||||
self.status = resData.data.data.status;
|
self.status = resData.data.data.status;
|
||||||
self.missionNo = resData.data.data.missionNo;
|
self.missionNo = resData.data.data.missionNo;
|
||||||
self.latitude = self.info.lat;
|
// self.latitude = self.info.lat;
|
||||||
self.longitude = self.info.lon;
|
// self.longitude = self.info.lon;
|
||||||
self.covers[0].latitude = self.info.lat;
|
// self.covers[0].latitude = self.info.lat;
|
||||||
self.covers[0].longitude = self.info.lon;
|
// self.covers[0].longitude = self.info.lon;
|
||||||
self.showDetail = true;
|
self.showDetail = true;
|
||||||
if (!this.seeDeatil) {
|
if (!this.seeDeatil) {
|
||||||
self.getCollectStatus();
|
self.getCollectStatus();
|
||||||
|
|||||||
@@ -100,7 +100,7 @@
|
|||||||
座机号:{{info.callNumber}}
|
座机号:{{info.callNumber}}
|
||||||
</view> -->
|
</view> -->
|
||||||
<view class="prolist">
|
<view class="prolist">
|
||||||
工作地址:{{`${info.province}${info.city}${info.county}` || '暂无'}}
|
工作地址:{{`${info.province}${info.city}${info.county}` || info.jobAddress || '暂无'}}
|
||||||
</view>
|
</view>
|
||||||
<view class="prolist">
|
<view class="prolist">
|
||||||
详细地址:{{info.address || '暂无'}}
|
详细地址:{{info.address || '暂无'}}
|
||||||
@@ -228,8 +228,8 @@
|
|||||||
maskShow: false,
|
maskShow: false,
|
||||||
nextBtn: false,
|
nextBtn: false,
|
||||||
loading: false,
|
loading: false,
|
||||||
latitude: 39.909, //中心点
|
latitude: 31.126855, //中心点
|
||||||
longitude: 116.39742,
|
longitude: 104.397894,
|
||||||
covers: [{ //marker标记位置
|
covers: [{ //marker标记位置
|
||||||
id: 0,
|
id: 0,
|
||||||
latitude: 0,
|
latitude: 0,
|
||||||
@@ -311,10 +311,10 @@
|
|||||||
self.info = res.data.data;
|
self.info = res.data.data;
|
||||||
self.status = res.data.data.status;
|
self.status = res.data.data.status;
|
||||||
self.missionNo = res.data.data.missionNo;
|
self.missionNo = res.data.data.missionNo;
|
||||||
self.latitude = self.info.lat;
|
// self.latitude = self.info.lat;
|
||||||
self.longitude = self.info.lon;
|
// self.longitude = self.info.lon;
|
||||||
self.covers[0].latitude = self.info.lat;
|
// self.covers[0].latitude = self.info.lat;
|
||||||
self.covers[0].longitude = self.info.lon;
|
// self.covers[0].longitude = self.info.lon;
|
||||||
self.showDetail = true;
|
self.showDetail = true;
|
||||||
self.getCollectStatus();
|
self.getCollectStatus();
|
||||||
if (self.type === 1) {
|
if (self.type === 1) {
|
||||||
|
|||||||
27
untils/addressToLocation.js
Normal file
27
untils/addressToLocation.js
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
import {
|
||||||
|
getAddresscoder
|
||||||
|
} from '@/api/map.js'
|
||||||
|
|
||||||
|
const key = 'FW3BZ-6JTK6-GCUS5-MZCRR-3GPR5-HJFEI'
|
||||||
|
|
||||||
|
export function AddressToLocation({
|
||||||
|
smart_address,
|
||||||
|
address = '',
|
||||||
|
get_poi = 0
|
||||||
|
}) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
let params = {
|
||||||
|
smart_address,
|
||||||
|
// address,
|
||||||
|
key: encodeURI(key),
|
||||||
|
get_poi
|
||||||
|
}
|
||||||
|
getAddresscoder(params).then((resData) => {
|
||||||
|
if (resData.status === 0) {
|
||||||
|
resolve(resData.result)
|
||||||
|
} else {
|
||||||
|
reject(false)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user