北京经济技术开发区经开区虚拟城市项目-【前端】-移动端Web
lixuliang
2024-05-08 f5233339920a59103d53e8efadc6f3f5d0b64f31
src/components/leftMenu/sousuo2.vue
@@ -1,11 +1,14 @@
<template>
  <div id="sousuo" class="sousuo">
    <!-- 搜索框 -->
    <div class="ssk" v-show="ssk.show">
    <div class="ssk" v-if="ssk.show">
      <span
        @click="ssjmxs"
        style="float: left; height: 100%; width: 80%; overflow: hidden"
        ><i class="el-icon-search" style="padding: 0px 15px 0px 20px"></i
        ><i
          class="el-icon-search"
          style="padding: 0px 15px 0px 20px; font-size: 0.15rem"
        ></i
        >{{ syssval }}</span
      >
      <span
@@ -32,9 +35,9 @@
      </span> -->
    </div>
    <!-- 搜索界面 -->
    <div class="ssjm" v-show="ssjm">
    <div class="ssjm" v-if="ssjm">
      <!-- 搜索框 -->
      <div class="search-container" style="margin: 0.1rem 0">
      <div class="search-container">
        <div class="back" @click="cancless"></div>
        <el-input
          placeholder="输入关键字搜索地图"
@@ -80,12 +83,6 @@
  </div>
</template>
<style scoped>
/* 搜索按钮的样式 */
.iszd {
  position: absolute;
  left: 0.2rem;
  top: 0.3rem;
}
/* 搜索框的样式 */
.ssk {
@@ -98,7 +95,7 @@
  height: 0.4rem;
  line-height: 0.4rem;
  background: #fff;
  border-radius: 0.15rem;
  border-radius: 0.14rem;
  color: black;
  font-size: 0.14rem;
}
@@ -111,8 +108,9 @@
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background-color: #f3f3f3;
  z-index: 99;
  z-index: 1099;
}
.search-container {
  /* background-color: #fff; */
@@ -142,12 +140,13 @@
.el-input /deep/ .el-input__inner {
  border: none;
  font-weight: 500;
  font-size: 17px;
  font-size: 0.14rem;
  color: #3e3d3d;
}
.el-select {
  width: 80px;
  width: 0.8rem;
  position: relative;
  font-size: 0.14rem;
}
.el-select:after {
  content: "";
@@ -163,14 +162,11 @@
  padding-right: 25px;
}
.el-input /deep/ .el-input-group__append .el-button {
  font-size: 15px;
  font-size: 0.14rem;
  color: #ffffff;
  line-height: 17px;
  background: #2477ff;
  border-radius: 13px;
  padding: 10px;
  width: 62px;
  height: 33px;
}
.el-scrollbar .hover {
@@ -209,7 +205,7 @@
  line-height: 20px;
}
.ssjg .addressBox {
  text-indent: 27px;
  margin-left: 27px;
  margin-top: 5px;
  color: #000;
  font-weight: 500;
@@ -349,7 +345,7 @@
      rectangle.maxy > 31.182515322 && (rectangle.maxy = 31.182515322);
      return `RECT(${rectangle.minx} ${rectangle.miny},${rectangle.maxx} ${rectangle.maxy})`;
    },
    getPoi() {
    getGdPoi() {
      axios
        .get(common.poiserve, {
          params: {
@@ -362,8 +358,6 @@
          },
        })
        .then((res) => {
          // 高德
          console.log("poiserve");
          if (res.data.status == "1") {
            res.data.pois &&
              res.data.pois
@@ -395,6 +389,49 @@
                    pname: val.province,
                    type: val.type,
                    typecode: val.typecode,
                  };
                  Allresults.push(obj);
                });
          }
          this.total = Allresults.length;
          this.poiList = Allresults;
          this.showList = true;
        });
    },
    getBdPoi() {
      axios
        .get(common.poiserve, {
          params: {
            request: "bdPoi",
            query: this.poi_text,
            output: "json",
            coord: "cgcs2000",
            page_num: 1,
            page_size: 30,
          },
        })
        .then((res) => {
          console.log(res);
          if (res.data.status == 0) {
            res.data.results &&
              res.data.results
                .filter((item) => {
                  var reg = new RegExp("[\\u4E00-\\u9FFF]+", "g");
                  return (
                    item.city.includes("北京") &&
                    item.name.includes(this.poi_text)
                  );
                })
                .forEach((val) => {
                  let obj = {
                    address: val.address,
                    adname: val.area,
                    cityname: val.city,
                    id: val.uid,
                    lat: parseFloat(val.location.lat),
                    lng: parseFloat(val.location.lng),
                    name: val.name,
                    pname: val.province,
                  };
                  Allresults.push(obj);
                });
@@ -454,7 +491,7 @@
        this.poiList = [];
        switch (this.select) {
          case "全部":
            this.getPoi();
            this.getBdPoi();
            this.getData();
            // axios
            //   .all([
@@ -580,7 +617,7 @@
            //   );
            break;
          case "POI":
            this.getPoi();
            this.getBdPoi();
            break;
          case "地块":
            this.getData();