小牛集卡web 客户端
chenwei
2021-06-08 e41faf1640e2e71febf4ba347a301e0c043b6ce9
src/components/agopage/map/AiAdress.vue
@@ -2,12 +2,12 @@
  <div class="form-input enter-text">
    <el-input
      v-model="mapVal"
      @focus="mapAdre"
      id="tipinput"
      clearable
      @input="test"
    ></el-input>
    <!-- <map-poi v-if="isMap"></map-poi> -->
    <div id="container" style="display: none"></div>
  </div>
</template>
@@ -24,7 +24,7 @@
  methods: {
    test(){
        console.log(this.mapVal);
         var map = new AMap.Map("container", {
        resizeEnable: true,
      });
@@ -32,45 +32,21 @@
      var auto = new AMap.Autocomplete({
        input: "tipinput",
      });
      console.log(78);
      // var placeSearch = new AMap.PlaceSearch({
      //   map: map,
      // });
      //构造地点查询类
      //注册监听,当选中某条记录时会触发
       var _this = this;
      AMap.event.addListener(auto, "select", select);
         function select(e) {
        console.log(456)
           _this.mapVal =e.poi.district+e.poi.name
           _this.$emit('platfrom',e)
              console.log(e);
      }
      //注册监听,当选中某条记录时会触发
      var $this = this;
      console.log(910);
   
    },
    mapAdre() {
      console.log(this.mapVal);
      // console.log(456);
      // var map = new AMap.Map("container", {
      //   resizeEnable: true,
      // });
      // //输入提示
      // var auto = new AMap.Autocomplete({
      //   input: "tipinput",
      // });
      // console.log(78);
      // var placeSearch = new AMap.PlaceSearch({
      //   map: map,
      // }); //构造地点查询类
      // AMap.event.addListener(auto, "select", select);
      // //注册监听,当选中某条记录时会触发
      // var $this = this;
      // console.log(910);
      // function select(e) {
      //   console.log(e.poi);
      // }
      // console.log(11);
    },
  },
};
</script>