Kaynağa Gözat

Merge remote-tracking branch 'origin/master'

licailing 5 yıl önce
ebeveyn
işleme
42110f4413

+ 9 - 25
src/main/map/src/views/ChooseLocation.vue

@@ -1,5 +1,5 @@
 <template>
-    <iframe id="iframe" frameborder="0" scrolling="no" :src="src"> </iframe>
+    <iframe id="iframe" ref="iframe" frameborder="0" scrolling="no"> </iframe>
 </template>
 <script>
 window.addEventListener(
@@ -7,7 +7,6 @@ window.addEventListener(
     function(event) {
         if (event.origin === 'https://3gimg.qq.com') {
             var loc = event.data;
-            console.log(loc);
             if (window.ReactNativeWebView) {
                 window.ReactNativeWebView.postMessage(JSON.stringify(loc));
             }
@@ -16,29 +15,14 @@ window.addEventListener(
     false,
 );
 export default {
-    name: '',
-    data() {
-        return {
-            location: '',
-        };
-    },
-    computed: {
-        src() {
-            if (this.location) {
-                return (
-                    'https://apis.map.qq.com/tools/locpicker?search=1&type=1&zoom=18&key=GLFBZ-ZR2W6-76XSA-MF7CQ-GDJ6Z-6FB5K&referer=Dingdong&coord=' +
-                    this.location
-                );
-            } else {
-                return '';
-            }
-        },
-    },
-    created() {
-        if (this.$route.query.location) {
-            this.location = this.$route.query.location;
-        }
-    },
+		mounted(){
+				window.setLocation=this.setLocation
+		},
+		methods:{
+			setLocation(location){
+				this.$refs.iframe.src='https://apis.map.qq.com/tools/locpicker?search=1&type=1&zoom=18&key=GLFBZ-ZR2W6-76XSA-MF7CQ-GDJ6Z-6FB5K&referer=Dingdong&coord=' +location
+			}
+		}
 };
 </script>
 <style lang='less' scoped>

+ 3 - 11
src/main/map/src/views/Tim.vue

@@ -23,7 +23,8 @@ export default {
         ...mapState(['userInfo']),
     },
     mounted() {
-        window.chatLogin = this.chatLogin;
+				window.chatLogin = this.chatLogin;
+				window.sendMessage=this.sendMessage;
     },
     methods: {
         chatLogin(userID, userSig) {
@@ -95,15 +96,11 @@ export default {
                 }
             });
 
+            // eslint-disable-next-line no-unused-vars
             this.tim.on(TIM.EVENT.GROUP_LIST_UPDATED, (event)=>{
                 // 收到群组列表更新通知,可通过遍历 event.data 获取群组列表数据并渲染到页面
                 // event.name - TIM.EVENT.GROUP_LIST_UPDATED
                 // event.data - 存储 Group 对象的数组 - [Group]
-                if (window.ReactNativeWebView) {
-                    window.ReactNativeWebView.postMessage(
-                        JSON.stringify(event.data)
-                    );
-                }
             });
 
             // eslint-disable-next-line no-unused-vars
@@ -126,11 +123,6 @@ export default {
                 // event.name - TIM.EVENT.ERROR
                 // event.data.code - 错误码
                 // event.data.message - 错误信息
-                if (window.ReactNativeWebView) {
-                    window.ReactNativeWebView.postMessage(
-                        JSON.stringify(event)
-                    );
-                }
             });
 
             // eslint-disable-next-line no-unused-vars