From bf58722dfd03ea1513f3acc7331d4d4403fca76e Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Fri, 18 Mar 2022 11:48:37 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.105:10010/r/school-web
---
src/components/mobilePopupOur/index.vue | 170 +++++++++++++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 154 insertions(+), 16 deletions(-)
diff --git a/src/components/mobilePopupOur/index.vue b/src/components/mobilePopupOur/index.vue
index 0c89a11..b0e91c2 100644
--- a/src/components/mobilePopupOur/index.vue
+++ b/src/components/mobilePopupOur/index.vue
@@ -7,7 +7,7 @@
<div class="m_p_h_center">
<div>
<div v-if="mBigPopup.search" style="color: #fff">
- 查询结果{{ searchLabel ? "--" + searchLabel : "" }}
+ 查询结果{{ searchLabel ? " -- " + searchLabel : "" }}
</div>
<el-dropdown trigger="click" @command="choiceIt" v-else>
<span class="el-dropdown-link">
@@ -37,7 +37,7 @@
></el-empty>
<mobilePopupOurOnce
v-for="(citem, cindex) in onlyData"
- :key="citem.bgImg + ''"
+ :key="citem.name + cindex"
:ends="onlyData.length - 1 == cindex"
:onceData="citem"
></mobilePopupOurOnce>
@@ -61,10 +61,11 @@
></el-empty>
<mobilePopupOurOnce
v-for="(citem, cindex) in item.child"
- :key="citem.icon + ''"
+ :key="citem.icons"
:ends="item.child.length - 1 == cindex"
:onceData="citem"
></mobilePopupOurOnce>
+ <!-- {{ citem.icon }} -->
<div v-show="item.child.length != 0">
<el-divider content-position="left">
<i class="el-icon-s-promotion"></i> 暂无更多
@@ -80,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"]),
@@ -107,9 +110,10 @@
// console.log("查询搜索结果", this.mBigPopup.value);
this.fullscreenLoading = false;
this.choiceMain = "搜索";
+ this.getListSearchMethod(this.mBigPopup.value);
return;
}
- this.choiceMain = this.popupOurOpenData.qurey; // 进入的主题:列:机构单位,校园建筑
+ this.choiceMain = this.popupOurOpenData.qurey; // 进入的主题:列:机构单位,校区建筑
this.choiceData = this.popupOurOpenData.main; //带入数据 包括name、type、method
this.choiceValue = this.popupOurOpenData.main[0].name;
@@ -119,6 +123,13 @@
this.$store.commit("MSET_BIGPOPUPAFTER", false); //关闭前一个弹窗
// console.log("请求对应街道接口", this.popupOurOpenData);
this.getDataHeardDown();
+ },
+ watch: {
+ fullscreenLoading() {
+ if (this.fullscreenLoading) {
+ this.notLine();
+ }
+ },
},
methods: {
handleClick(tab, event) {
@@ -139,9 +150,13 @@
this.$store.commit("MSET_BIGPOPUP", false);
},
getDataHeardDown() {
- if (this.choiceMain == "机构单位") {
+ if (this.choiceMain == "活动") {
//不请求头部标签页数据
- this.getOutList(this.activeName, this.choiceKey);
+ this.getOutList(this.choiceKey);
+ return;
+ }
+ if (this.choiceMain == "机构单位") {
+ this.getOutList("", this.choiceKey);
return;
}
//获取头下部标签页
@@ -161,31 +176,98 @@
},
//请求
getOutList(campus, type) {
+ // console.log(this.choiceMain, campus, type, "see");
let that = this;
- this.choiceMethod({ campus: campus, type: type }).then((res) => {
+ let d;
+ if (this.choiceMain == "机构单位") {
+ // 不传标签页
+ d = {
+ type: type,
+ };
+ } else if (
+ this.choiceMain == "生活设施" ||
+ this.choiceMain == "出入口" ||
+ this.choiceMain == "停车场"
+ ) {
+ // 改变传入属性
+ d = {
+ campus: campus,
+ lifetype: type,
+ };
+ } else {
+ d = {
+ campus: campus,
+ type: type,
+ };
+ }
+ this.choiceMethod(d).then((res) => {
const data = res.data.data;
let outList = [];
- if (this.choiceMain == "校园建筑") {
- // 校园建筑使用该id获取具体信息
+ if (
+ this.mBigPopup.name == "校区建筑" ||
+ this.mBigPopup.name == "文化风景"
+ ) {
+ // 校区建筑使用该id获取具体信息
data.forEach((item) => {
- let icon = item.tpurl.split(",");
+ let icon = item.tpurl ? item.tpurl.split(",") : item.id;
outList.push({
id: item.id,
name: item.mechanismname,
icon: icon,
+ icons: icon + item.mechanismname, //图片响应改变
from: this.choiceMain,
+ video: item.videourl,
buts:
- this.mBigPopup.name == "校园建筑" ||
+ this.mBigPopup.name == "校区建筑" ||
this.mBigPopup.name == "文化风景"
? ["定位", "实景", "图集"]
: ["定位"],
});
});
+ } else if (this.mBigPopup.name == "活动") {
+ // 校区建筑使用该id获取具体信息
+ data.records.forEach((item) => {
+ let icon = item.tpurl.split(",");
+ let useData = {
+ name: item.hdname,
+ // lntLat: [item.jd, item.wd],
+ // alt: item.gd,
+ // heading: item.heading,
+ // pitch: item.pitch,
+ // roll: item.roll,
+ bgImg: item.tpurl,
+ icon: icon,
+ icons: icon + item.hdname, //图片响应改变
+ from: this.choiceMain,
+ // QRImg: item.codeurl,
+ websiteUrl: item.websiteurl,
+ telePhone: item.telephone,
+ // address: item.address,
+ introduce: item.context,
+ video: item.videourl,
+ buts:
+ that.mBigPopup.name == "校区建筑" ||
+ that.mBigPopup.name == "文化风景"
+ ? ["定位", "实景", "图集"]
+ : ["定位"],
+ //活动添加的字段
+ addressname: item.addressname.split(";"),
+ address: item.address.split(";"),
+ lxname: item.lxname.split(";"),
+ lx: item.lx.split(";"),
+ lntLat: [
+ item.address.split(";")[0].split(",")[0],
+ item.address.split(";")[0].split(",")[1],
+ ],
+ panoramaurl: item.panoramaurl, //全景
+ };
+ outList.push(useData);
+ });
} else {
//正常获取全部数据
data.records.forEach((item) => {
let icon = item.tpurl.split(",");
- outList.push({
+ let useData = {
name: item.mechanismname,
lntLat: [item.jd, item.wd],
alt: item.gd,
@@ -194,28 +276,84 @@
roll: item.roll,
bgImg: item.tpurl,
icon: icon,
+ icons: icon + item.mechanismname, //图片响应改变
from: this.choiceMain,
QRImg: item.codeurl,
websiteUrl: item.websiteurl,
telePhone: item.telephone,
address: item.address,
introduce: item.introduce,
+ video: item.videourl,
buts:
- that.mBigPopup.name == "校园建筑" ||
+ that.mBigPopup.name == "校区建筑" ||
that.mBigPopup.name == "文化风景"
? ["定位", "实景", "图集"]
: ["定位"],
- });
+ panoramaurl: item.panoramaurl, //全景
+ };
+ outList.push(useData);
});
}
that.fullscreenLoading = false;
- if (this.choiceMain == "机构单位") {
+ if (this.choiceMain == "机构单位" || this.choiceMain == "活动") {
that.onlyData = outList;
return;
}
that.tabTable[+campus - 1].child = outList;
});
},
+ //搜索请求
+ getListSearchMethod(name) {
+ let val = {
+ mechanismName: name,
+ },
+ that = this;
+ getListSearch(val).then((res) => {
+ if (res.data.code != 200) {
+ return;
+ }
+ const data = res.data.data;
+ //正常获取全部数据
+ let outList = [];
+ data.forEach((item) => {
+ let icon = item.tpurl.split(",");
+ let useData = {
+ name: item.mechanismname,
+ lntLat: [item.jd, item.wd],
+ alt: item.gd,
+ heading: item.heading,
+ pitch: item.pitch,
+ roll: item.roll,
+ bgImg: item.tpurl,
+ icon: icon,
+ icons: icon + item.mechanismname, //图片响应改变
+ from: this.choiceMain,
+ QRImg: item.codeurl,
+ websiteUrl: item.websiteurl,
+ telePhone: item.telephone,
+ address: item.address,
+ introduce: item.introduce,
+ video: item.videourl,
+ buts:
+ that.mBigPopup.name == "校区建筑" ||
+ that.mBigPopup.name == "文化风景"
+ ? ["定位", "实景", "图集"]
+ : ["定位"],
+ panoramaurl: item.panoramaurl, //全景
+ };
+ outList.push(useData);
+ });
+ that.fullscreenLoading = false;
+ that.onlyData = outList;
+ });
+ },
+ notLine() {
+ console.log("等待关闭");
+ setTimeout(() => {
+ this.fullscreenLoading = false;
+ console.log("关闭dolog");
+ }, 5000);
+ },
},
};
-</script>
\ No newline at end of file
+</script>
--
Gitblit v1.9.3