panhui 5 gadi atpakaļ
vecāks
revīzija
34d7ff5c91

+ 0 - 8
src/main/map/.expo/settings.json

@@ -1,8 +0,0 @@
-{
-  "hostType": "lan",
-  "lanType": "ip",
-  "dev": true,
-  "minify": false,
-  "urlRandomness": null,
-  "https": false
-}

+ 27 - 29
src/main/map/src/views/Home.vue

@@ -2,6 +2,12 @@
     <div id="container"></div>
     <div id="container"></div>
 </template>
 </template>
 <script>
 <script>
+window.info = '';
+
+function getInfo(info) {
+    console.log(info);
+}
+window.getInfo = getInfo;
 import { mapState } from 'vuex';
 import { mapState } from 'vuex';
 import Marker from '../utils/Marker';
 import Marker from '../utils/Marker';
 import { getStatusInfo } from '../utils/OrderUtils';
 import { getStatusInfo } from '../utils/OrderUtils';
@@ -11,6 +17,8 @@ export default {
         return {
         return {
             map: null,
             map: null,
             orderInfo: null,
             orderInfo: null,
+            userLoaction: null,
+            merchantLoaction: null,
         };
         };
     },
     },
     computed: {
     computed: {
@@ -30,23 +38,6 @@ export default {
                 return { lat: 40.02906301748584, lng: 116.25499991104516 };
                 return { lat: 40.02906301748584, lng: 116.25499991104516 };
             }
             }
         },
         },
-        userLoaction() {
-            return this.orderInfo.location
-                ? {
-                      lat: this.orderInfo.location.split(',')[1],
-
-                      lng: this.orderInfo.location.split(',')[0],
-                  }
-                : null;
-        },
-        merchantLoaction() {
-            return this.orderInfo.merchant
-                ? {
-                      lng: this.orderInfo.merchant.longitude,
-                      lat: this.orderInfo.merchant.latitude,
-                  }
-                : null;
-        },
         userMarker() {
         userMarker() {
             if (this.map && this.userLoaction) {
             if (this.map && this.userLoaction) {
                 return new Marker({
                 return new Marker({
@@ -75,26 +66,33 @@ export default {
             }
             }
             return null;
             return null;
         },
         },
-
         nowStatus() {
         nowStatus() {
-            if (this.orderInfo) {
-                return getStatusInfo(this.orderInfo);
+            if (this.$route.query) {
+                return getStatusInfo(this.$route.query);
             } else {
             } else {
                 return null;
                 return null;
             }
             }
         },
         },
     },
     },
     mounted() {
     mounted() {
-        this.orderInfo = localStorage.getItem('orderInfo')
-            ? JSON.parse(localStorage.getItem('orderInfo'))
-            : {};
-        if (this.orderInfo.id) {
-            this.$nextTick(() => {
-                setTimeout(() => {
-                    this.initMap();
-                }, 1000);
-            });
+        if (this.$route.query.location) {
+            this.userLoaction = {
+                lat: this.$route.query.location.split(',')[1],
+                lng: this.$route.query.location.split(',')[0],
+            };
         }
         }
+        if (this.$route.query.merchantLocation) {
+            this.merchantLoaction = {
+                lat: this.$route.query.merchantLocation.split(',')[1],
+                lng: this.$route.query.merchantLocation.split(',')[0],
+            };
+        }
+
+        this.$nextTick(() => {
+            setTimeout(() => {
+                this.initMap();
+            }, 1000);
+        });
     },
     },
     methods: {
     methods: {
         initMap() {
         initMap() {

+ 28 - 0
src/main/map/src/views/MapDetail.vue

@@ -0,0 +1,28 @@
+<template>
+    <iframe
+        id="frame"
+        style="width:100vw;height:100vh"
+        src="http://dingdong.izouma.com/map/home"
+    >
+    </iframe>
+</template>
+<script>
+import { mapState } from 'vuex';
+export default {
+    name: '',
+    data() {
+        return {};
+    },
+    computed: {
+        ...mapState(['userInfo']),
+    },
+    mounted() {
+        setTimeout(() => {
+            console.log(document.getElementById('frame').contentWindow);
+            document.getElementById('frame').contentWindow.getInfo(1233);
+        }, 1000);
+    },
+};
+</script>
+<style lang='less' scoped>
+</style>