|
|
@@ -24,6 +24,7 @@
|
|
|
<script>
|
|
|
import Tabbar from '../../components/Tabbar.vue'
|
|
|
import AMapLoader from '@amap/amap-jsapi-loader'
|
|
|
+import { serverAPI } from '../../../../utils/vaildInterfacefn.js'
|
|
|
import { institutional, institutions_search } from '../../api/index.js'
|
|
|
window._AMapSecurityConfig = {
|
|
|
securityJsCode: process.env.VUE_APP_AMAP_SECURITY,
|
|
|
@@ -58,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) => {
|
|
|
@@ -106,7 +107,8 @@ export default {
|
|
|
|
|
|
},
|
|
|
async getInstitutional() {
|
|
|
- var institutionalData = await institutional()
|
|
|
+ var institutionalData = await serverAPI('zpsmzjylfwqfl',null,false) //使用爱山东封装的接口
|
|
|
+ // var institutionalData = await institutional()
|
|
|
// institutionalData.data.splice(0, 0, this.allInfo);
|
|
|
this.categorieList = institutionalData.data
|
|
|
this.clickTab(this.categorieList[0].id)
|
|
|
@@ -114,12 +116,26 @@ export default {
|
|
|
|
|
|
async getInstitutions_search() {
|
|
|
this.removeMarkers()
|
|
|
- var institutionSearch = await institutions_search({
|
|
|
- radius: radius,
|
|
|
- institutionalTypeList: this.categoryId,
|
|
|
- lat: this.latitude,
|
|
|
- lng: this.longitude,
|
|
|
- })
|
|
|
+ // 调用爱山东平台的接口方式
|
|
|
+ var institutionSearch = await serverAPI(
|
|
|
+ 'zpsmzjjgss',
|
|
|
+ {
|
|
|
+ radius: radius,
|
|
|
+ institutionalTypeList: this.categoryId,
|
|
|
+ lat: this.latitude,
|
|
|
+ lng: this.longitude,
|
|
|
+ },
|
|
|
+ false
|
|
|
+ )
|
|
|
+
|
|
|
+ // 调用自己平台的接口方式
|
|
|
+ // var institutionSearch = await institutions_search({
|
|
|
+ // radius: radius,
|
|
|
+ // institutionalTypeList: this.categoryId,
|
|
|
+ // lat: this.latitude,
|
|
|
+ // lng: this.longitude,
|
|
|
+ // })
|
|
|
+
|
|
|
let markersTemp = []
|
|
|
institutionSearch.rows.forEach((e, index) => {
|
|
|
markersTemp.push(this.formatData(e, index))
|