panhui 5 лет назад
Родитель
Сommit
55a043bdc9
1 измененных файлов с 8 добавлено и 11 удалено
  1. 8 11
      src/main/map/src/views/Heat3D.vue

+ 8 - 11
src/main/map/src/views/Heat3D.vue

@@ -6,15 +6,7 @@
 <script>
 import { mapState } from 'vuex';
 import axios from 'axios';
-window.addEventListener(
-    'message',
-    event => {
-        if (window.ReactNativeWebView) {
-            window.ReactNativeWebView.postMessage(JSON.stringify(event));
-        }
-    },
-    false,
-);
+
 export default {
     name: '',
     data() {
@@ -27,11 +19,16 @@ export default {
     },
     mounted() {
         this.$nextTick(() => {
-            // this.getData();
-            // this.initMap();
+            window.draw = this.draw;
         });
     },
     methods: {
+        draw(list) {
+            if (window.ReactNativeWebView) {
+                window.ReactNativeWebView.postMessage(JSON.stringify(list));
+            }
+            this.initMap();
+        },
         getData() {
             axios.get('http://dingdong.izouma.com/merchant/heatMap', {
                 longitude: '118.734661',