陈冉 6 年前
父节点
当前提交
67f3616b76
共有 6 个文件被更改,包括 34 次插入25 次删除
  1. 1
    1
      src/config/apis.js
  2. 11
    3
      src/main.js
  3. 4
    3
      src/pages/building/buildingdetail.vue
  4. 16
    17
      src/pages/building/perimetertype.vue
  5. 1
    1
      src/store/getcode.js
  6. 1
    0
      src/store/map.js

+ 1
- 1
src/config/apis.js 查看文件

91
   //获取code
91
   //获取code
92
   getcode: {
92
   getcode: {
93
     get: {
93
     get: {
94
-      url: 'api/user/getUserInfo/:code',
94
+      url: 'api/wx/getUserInfo/:code',
95
       method: 'get',
95
       method: 'get',
96
     },
96
     },
97
   },
97
   },

+ 11
- 3
src/main.js 查看文件

17
 
17
 
18
 
18
 
19
 Vue.filter('moment', function (value, formatString) {
19
 Vue.filter('moment', function (value, formatString) {
20
-formatString = formatString || 'YYYY/MM/DD';
21
-return moment(value).format(formatString);
20
+  formatString = formatString || 'YYYY/MM/DD';
21
+  return moment(value).format(formatString);
22
 });
22
 });
23
 
23
 
24
+// AMap.initAMapApiLoader({
25
+//   key: 'f0d1d4f82432504003ebf46e5e36ff03',
26
+//   plugin: ['AMap.Autocomplete', 'AMap.PlaceSearch', 'AMap.Scale', 'AMap.OverView', 'AMap.ToolBar', 'AMap.MapType', 'AMap.PolyEditor', 'AMap.CircleEditor'],
27
+//   // 默认高德 sdk 版本为 1.4.4
28
+//   v: '1.4.4'
29
+// })
30
+
31
+
24
 // import './theme'
32
 // import './theme'
25
 // import './public/style/common.scss'
33
 // import './public/style/common.scss'
26
 // import AMap  from 'vue-amap'
34
 // import AMap  from 'vue-amap'
27
 
35
 
28
 Vue.use(Vant)
36
 Vue.use(Vant)
29
 Vue.use(AMap)
37
 Vue.use(AMap)
30
-Vue.use(VueAwesomeSwiper, /* { default global options } */)
38
+Vue.use(VueAwesomeSwiper)
31
 Vue.use(preview)
39
 Vue.use(preview)
32
 
40
 
33
 Vue.config.productionTip = false
41
 Vue.config.productionTip = false

+ 4
- 3
src/pages/building/buildingdetail.vue 查看文件

115
 
115
 
116
 <script>
116
 <script>
117
 import { createNamespacedHelpers } from "vuex";
117
 import { createNamespacedHelpers } from "vuex";
118
+// import { lazyAmapApiLoaderInstanse } from "vue-amap";
119
+
118
 const {
120
 const {
119
   mapState: mapbuildState,
121
   mapState: mapbuildState,
120
   mapActions: mapbuildActions
122
   mapActions: mapbuildActions
249
     //浏览人数
251
     //浏览人数
250
     addvistornum(element) {
252
     addvistornum(element) {
251
       let self = this;
253
       let self = this;
252
-      if (!self.isopen) {
254
+      if (!this.isopen) {
253
         this.postVisitors({
255
         this.postVisitors({
254
           id: element.id,
256
           id: element.id,
255
           browsingnu: element.browsingnum + 1
257
           browsingnu: element.browsingnum + 1
257
           self.numadd({ id: element.id });
259
           self.numadd({ id: element.id });
258
         });
260
         });
259
       }
261
       }
260
-      self.isopen = !this.isopen;
262
+      this.isopen = !this.isopen;
261
     },
263
     },
262
 
264
 
263
     //周边配套信息
265
     //周边配套信息
264
     perimeterinformation(element, tag) {
266
     perimeterinformation(element, tag) {
265
-      // let self = this;
266
       this.getMap({
267
       this.getMap({
267
         id: element.buildingid,
268
         id: element.buildingid,
268
         buildingname: element.buildingname,
269
         buildingname: element.buildingname,

+ 16
- 17
src/pages/building/perimetertype.vue 查看文件

2
     <div class="context" >
2
     <div class="context" >
3
             <vue-headful title="周边配套"  />
3
             <vue-headful title="周边配套"  />
4
           <!-- <div class="mapId">
4
           <!-- <div class="mapId">
5
-            <el-amap ref="map" :events="events" :center="mapCenter" :zoom="12" id='mapcointainer' vid="amapDemo" >
6
-              <el-amap-marker v-for="(item,index) in markers" :key="index" :position="item" />
7
-            </el-amap>
5
+            <el-amap vid="amapDemo" :zoom="zoom" :center="center" id='mapcointainer'></el-amap>
8
           </div> -->
6
           </div> -->
9
             <div class="mapId">
7
             <div class="mapId">
10
-                <div id='mapcointainer'></div>
8
+                <div id="mapcointainer"></div>
11
             </div>
9
             </div>
12
              <van-row class="user-links">
10
              <van-row class="user-links">
13
           <van-col span="6" >
11
           <van-col span="6" >
40
 </template>
38
 </template>
41
 
39
 
42
 <script>
40
 <script>
43
-import { lazyAmapApiLoaderInstanse } from "vue-amap";
41
+
42
+// import { lazyAmapApiLoaderInstanse } from "vue-amap";
44
 
43
 
45
 let map;
44
 let map;
46
 let routerParams;
45
 let routerParams;
50
   data(){
49
   data(){
51
       return{
50
       return{
52
           keyword:String,
51
           keyword:String,
53
-          shows:false
52
+          shows:false,
54
       }
53
       }
55
   },
54
   },
56
   components: {
55
   components: {
84
       });
83
       });
85
       this.searchAround(routerParams.tag);
84
       this.searchAround(routerParams.tag);
86
         if(routerParams.tag=="学校"){
85
         if(routerParams.tag=="学校"){
87
-           this.shows = 1;
86
+          this.shows = 1;
88
         }else if(routerParams.tag=="医院"){
87
         }else if(routerParams.tag=="医院"){
89
-         this.shows = 2;
88
+          this.shows = 2;
90
         }else if(routerParams.tag=="交通"){
89
         }else if(routerParams.tag=="交通"){
91
-         this.shows = 3;
90
+          this.shows = 3;
92
         }else if(routerParams.tag=="商业"){
91
         }else if(routerParams.tag=="商业"){
93
-         this.shows = 4;
92
+          this.shows = 4;
94
         }
93
         }
95
     },
94
     },
96
 
95
 
118
       });
117
       });
119
        AMap.plugin(['AMap.ToolBar','AMap.Scale'],
118
        AMap.plugin(['AMap.ToolBar','AMap.Scale'],
120
          ()=>{
119
          ()=>{
121
-             map.addControl(new AMap.ToolBar());
122
-           map.addControl(new AMap.Scale());
120
+          map.addControl(new AMap.ToolBar());
121
+          map.addControl(new AMap.Scale());
123
         });
122
         });
124
-      marker = new AMap.Marker({
125
-        position: [routerParams.lng, routerParams.lat],
126
-        title: "routerParams.buildingname",
127
-        map: map
128
-      });
123
+      // marker = new AMap.Marker({
124
+      //   position: [routerParams.lng, routerParams.lat],
125
+      //   title: "routerParams.buildingname",
126
+      //   map: map
127
+      // });
129
         this.searchAround(val);
128
         this.searchAround(val);
130
         if(val=="学校"){
129
         if(val=="学校"){
131
            this.shows = 1;
130
            this.shows = 1;

+ 1
- 1
src/store/getcode.js 查看文件

12
       }
12
       }
13
     },
13
     },
14
     actions: {
14
     actions: {
15
-        getGetCode({ commit }, params) {  
15
+        getGetCode({ commit }, params) { 
16
         return new Promise((resolve, reject) => {
16
         return new Promise((resolve, reject) => {
17
           request({ ...getAPI('getcode.get',{code: params.usercode}) }).then((data) => {
17
           request({ ...getAPI('getcode.get',{code: params.usercode}) }).then((data) => {
18
             commit('updateGetCode', data)
18
             commit('updateGetCode', data)

+ 1
- 0
src/store/map.js 查看文件

13
     },
13
     },
14
     actions: {
14
     actions: {
15
       getMap({ commit }, params) {
15
       getMap({ commit }, params) {
16
+        // debugger
16
         return new Promise((resolve, reject) => {
17
         return new Promise((resolve, reject) => {
17
           request({ ...getAPI('map.getmapinformation',{ buildingid: params.id }) }).then((data) => {
18
           request({ ...getAPI('map.getmapinformation',{ buildingid: params.id }) }).then((data) => {
18
             commit('updateMap', data)
19
             commit('updateMap', data)