From dc3ff6de489c3ec8f24b5ebfe04152d07534939c Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Mon, 27 Dec 2021 09:23:16 +0800
Subject: [PATCH] +加入搜索

---
 src/components/mobileLeftNav/index.vue  |    4 -
 src/components/mobilePopupOur/index.vue |   44 ++++++++++++++++++++++
 src/api/mobile/search/index.js          |   18 +++++++++
 3 files changed, 63 insertions(+), 3 deletions(-)

diff --git a/src/api/mobile/search/index.js b/src/api/mobile/search/index.js
new file mode 100644
index 0000000..31aa607
--- /dev/null
+++ b/src/api/mobile/search/index.js
@@ -0,0 +1,18 @@
+/*
+ * @Author: Morpheus
+ * @Date: 2021-05-09 15:17:44
+ * @Last Modified by: liu
+ * @Last Modified time: 2021-12-27 09:12:24
+ */
+// 搜索
+import request from '@/router/axios'
+
+//出入-AED-停车场
+export const getListSearch = (params) => {
+    return request({
+        url: 'blade-architecture/architecture/selectLook',
+        method: 'get',
+        params: params
+    })
+}
+
diff --git a/src/components/mobileLeftNav/index.vue b/src/components/mobileLeftNav/index.vue
index 1d8a278..824e0a4 100644
--- a/src/components/mobileLeftNav/index.vue
+++ b/src/components/mobileLeftNav/index.vue
@@ -566,9 +566,7 @@
                 name:
                   data[k].mechanismname ||
                   data[k].roadname ||
-                  ourD.label == "监控"
-                    ? "监控"
-                    : "无显示名字",
+                  (ourD.label == "监控" ? "监控" : "无显示名字"),
                 bgImg: data[k].tpurl,
                 video: data[k].videourl || "",
                 from: "labels",
diff --git a/src/components/mobilePopupOur/index.vue b/src/components/mobilePopupOur/index.vue
index deb1d58..b236aae 100644
--- a/src/components/mobilePopupOur/index.vue
+++ b/src/components/mobilePopupOur/index.vue
@@ -81,6 +81,8 @@
 <script>
 import { getListarc } from "@/api/mobile/public/arc"; //头部下标签页数据
 import { mapGetters } from "vuex";
+//搜索
+import { getListSearch } from "@/api/mobile/search/index";
 export default {
   computed: {
     ...mapGetters(["mBigPopup", "popupOurOpenData"]),
@@ -108,6 +110,7 @@
       // console.log("查询搜索结果", this.mBigPopup.value);
       this.fullscreenLoading = false;
       this.choiceMain = "搜索";
+      this.getListSearchMethod(this.mBigPopup.value);
       return;
     }
     this.choiceMain = this.popupOurOpenData.qurey; // 进入的主题:列:机构单位,校园建筑
@@ -247,6 +250,47 @@
         that.tabTable[+campus - 1].child = outList;
       });
     },
+    //搜索请求
+    getListSearchMethod(name) {
+      let val = {
+          mechanismName: name,
+        },
+        that = this;
+      getListSearch(val).then((res) => {
+        const data = res.data.data;
+        //正常获取全部数据
+        let outList = [];
+        data.forEach((item) => {
+          let icon = item.list.tpurl.split(",");
+          let useData = {
+            name: item.list.mechanismname,
+            lntLat: [item.list.jd, item.list.wd],
+            alt: item.list.gd,
+            heading: item.list.heading,
+            pitch: item.list.pitch,
+            roll: item.list.roll,
+            bgImg: item.list.tpurl,
+            icon: icon,
+            icons: icon + item.list.mechanismname, //图片响应改变
+            from: this.choiceMain,
+            QRImg: item.list.codeurl,
+            websiteUrl: item.list.websiteurl,
+            telePhone: item.list.telephone,
+            address: item.list.address,
+            introduce: item.list.introduce,
+            video: item.list.videourl,
+            buts:
+              that.mBigPopup.name == "校园建筑" ||
+              that.mBigPopup.name == "文化风景"
+                ? ["定位", "实景", "图集"]
+                : ["定位"],
+          };
+          outList.push(useData);
+        });
+        that.fullscreenLoading = false;
+        that.onlyData = outList;
+      });
+    },
   },
 };
 </script>
\ No newline at end of file

--
Gitblit v1.9.3