+
liuyg
2022-02-21 4f4bb2969db450d51df6aee53ff8955276fadf3f
leafletMapOur/grabOrdersMap/js/vueMain.js
@@ -39,8 +39,19 @@
      onPosition: false, //持续定位指示
   },
   methods: {
      setUniAppMsg(data) {
         window.parent.hBackMsg(data)
      setUniAppMsg(state, data) {
         let that = this;
         state == "hBackMsg" ? window.parent.hBackMsg(data);
         state == "setIntLat" ? window.parent.setIntLat({
            rid: that.data.id,
            fn: (out) => {
               // console.log(out,"1111");
               // that.addIcon(out);
               that.addIcon([out[1], out[0]]);
            }
         });
         state == "showTip" ? that.parent.showTip("获取定位失败");
      },
      openAPP(type) {
         // console.log(type)
@@ -361,14 +372,7 @@
                     if (typeof res.intlat === "string") {
                        // that.parent.showTip("获取定位失败")
                        //向uniapp传值
                        uni.postMessage({
                           data: {
                              action: 'message'
                           }
                        });
                        uni.getEnv(function(res) {
                           console.log('当前环境:' + JSON.stringify(res));
                        });
                     } else {
                        that.addIcon([res.intlat[1], res.intlat[0]]);
                     }
@@ -673,14 +677,26 @@
      });
      this.domMove.init();
      // console.log(window.parent.setIntLat)
      window.parent.setIntLat({
         rid: this.data.id,
         fn: (out) => {
            // console.log(out,"1111");
            // that.addIcon(out);
            that.addIcon([out[1], out[0]]);
         }
      })
      // window.parent.setIntLat({
      //    rid: this.data.id,
      //    fn: (out) => {
      //       // console.log(out,"1111");
      //       // that.addIcon(out);
      //       that.addIcon([out[1], out[0]]);
      //    }
      // })
      window.addEventListener('message', e => {
         console.log(e, 'HTML 接受APP发送过来的消息 (H5端)');
         app.dataList = JSON.parse(e.data.data).navigation
         console.log(app.dataList, '+++++++++');
      }, false)
      // HTML 接受APP发送过来的消息 (APP端)
      function requestData(data) {
         console.log(JSON.stringify(data), 'HTML 接受APP发送过来的消息 (APP端)');
         app.dataList = data.navigation // 赋值
      }
   },
   wacth: {}
})