|
|
@@ -49,7 +49,7 @@ export default {
|
|
|
dictType: 'cms_institutional_nature',
|
|
|
},
|
|
|
categorieList: [],
|
|
|
- latitude: 36.86295, // 22.5436,
|
|
|
+ latitude: 36.86295, // 22.5436,
|
|
|
longitude: 117.74307, //114.057999,
|
|
|
institutionList: [], //获取的机构
|
|
|
markers: [],
|
|
|
@@ -59,21 +59,21 @@ export default {
|
|
|
async mounted() {
|
|
|
let that = this
|
|
|
//1. 调用爱山东获取经纬度
|
|
|
- // lightAppJssdk.map.getLocation({
|
|
|
- // success: function (data) {
|
|
|
- // //成功
|
|
|
- // that.latitude = String(data.latitude)
|
|
|
- // that.longitude = String(data.longitude)
|
|
|
- // that.mapInit()
|
|
|
- // },
|
|
|
- // fail: function (err) {
|
|
|
- // //错误
|
|
|
- // that.mapInit()
|
|
|
- // },
|
|
|
- // })
|
|
|
+ lightAppJssdk.map.getLocation({
|
|
|
+ success: function (data) {
|
|
|
+ //成功
|
|
|
+ that.latitude = String(data.latitude)
|
|
|
+ that.longitude = String(data.longitude)
|
|
|
+ that.mapInit()
|
|
|
+ },
|
|
|
+ fail: function (err) {
|
|
|
+ //错误
|
|
|
+ that.mapInit()
|
|
|
+ },
|
|
|
+ })
|
|
|
|
|
|
// 2. 开发使用
|
|
|
- that.mapInit()
|
|
|
+ // that.mapInit()
|
|
|
},
|
|
|
created() {
|
|
|
window.jumpDetailTap = (id) => {
|
|
|
@@ -84,30 +84,30 @@ export default {
|
|
|
},
|
|
|
watch: {
|
|
|
$route: {
|
|
|
- handler: function(val, oldVal){
|
|
|
- if(val.name != 'circleHome') {
|
|
|
+ handler: function (val, oldVal) {
|
|
|
+ if (val.name != 'circleHome') {
|
|
|
// 离开当前页
|
|
|
- map && map.destroy();
|
|
|
- }else {
|
|
|
+ map && map.destroy()
|
|
|
+ } else {
|
|
|
// 进入当前页
|
|
|
- this.mapInit()
|
|
|
- }
|
|
|
+ this.mapInit()
|
|
|
+ }
|
|
|
},
|
|
|
// 深度观察监听
|
|
|
- deep: true
|
|
|
- }
|
|
|
+ deep: true,
|
|
|
+ },
|
|
|
},
|
|
|
methods: {
|
|
|
- mapComplete() { //地图资源加载完成后
|
|
|
- if (this.categorieList.length>0) {
|
|
|
+ mapComplete() {
|
|
|
+ //地图资源加载完成后
|
|
|
+ if (this.categorieList.length > 0) {
|
|
|
this.addMarkers()
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
this.getInstitutional()
|
|
|
}
|
|
|
-
|
|
|
},
|
|
|
async getInstitutional() {
|
|
|
- var institutionalData = await serverAPI('zpsmzjylfwqfl',null,false) //使用爱山东封装的接口
|
|
|
+ var institutionalData = await serverAPI('zpsmzjylfwqfl', null, false) //使用爱山东封装的接口
|
|
|
// var institutionalData = await institutional()
|
|
|
// institutionalData.data.splice(0, 0, this.allInfo);
|
|
|
this.categorieList = institutionalData.data
|
|
|
@@ -116,7 +116,7 @@ export default {
|
|
|
|
|
|
async getInstitutions_search() {
|
|
|
this.removeMarkers()
|
|
|
- // 调用爱山东平台的接口方式
|
|
|
+ // 调用爱山东平台的接口方式
|
|
|
var institutionSearch = await serverAPI(
|
|
|
'zpsmzjjgss',
|
|
|
{
|
|
|
@@ -135,7 +135,7 @@ export default {
|
|
|
// lat: this.latitude,
|
|
|
// lng: this.longitude,
|
|
|
// })
|
|
|
-
|
|
|
+
|
|
|
let markersTemp = []
|
|
|
institutionSearch.rows.forEach((e, index) => {
|
|
|
markersTemp.push(this.formatData(e, index))
|