|
|
@@ -0,0 +1,322 @@
|
|
|
+<template>
|
|
|
+ <div class="six">
|
|
|
+ <div class="comTit">
|
|
|
+ <img src="../assets/img/comBs1.png" alt="" />
|
|
|
+ <span>{{ tit }}</span>
|
|
|
+ <img src="../assets/img/comBs2.png" alt="" />
|
|
|
+ </div>
|
|
|
+ <div class="main" :class="{ opcBase: conShowLoad }">
|
|
|
+ <div class="mainSm" :style="`height:${domHei}px`"></div>
|
|
|
+ <div class="row" v-for="item in data" :key="item.id">
|
|
|
+ <img :src="baseURL + imgSrc(item)" alt="" />
|
|
|
+ <div class="txtBox">
|
|
|
+ <div class="txt">
|
|
|
+ <p><span>建筑名称:</span>{{ item.name }}</p>
|
|
|
+ <p><span>产权归属:</span>{{ item.txt1 }}</p>
|
|
|
+ </div>
|
|
|
+ <div class="txt">
|
|
|
+ <p><span>占地面积:</span>{{ item.txt2 }}</p>
|
|
|
+ <p><span>建筑面积:</span>{{ item.txt3 }}</p>
|
|
|
+ </div>
|
|
|
+ <div class="txt">
|
|
|
+ <p class="lastP"><span>保护级别:</span>{{ item.txt4 }}</p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- 详情按钮 -->
|
|
|
+ <div class="detailBtn" @click="lookDetail(item)"></div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- 点击详情出来的弹窗 -->
|
|
|
+ <div class="detailBox" v-if="detailShow">
|
|
|
+ <div class="detailMain">
|
|
|
+ <!-- 标题 -->
|
|
|
+ <h3 class="detailTit">建筑信息</h3>
|
|
|
+ <!-- 文字信息 -->
|
|
|
+ <div class="detailRow">
|
|
|
+ <p>
|
|
|
+ <span>建筑名称:</span><i>{{ detailData.name }}</i>
|
|
|
+ </p>
|
|
|
+ <p>
|
|
|
+ <span>产权归属:</span><i>{{ detailData.txt1 }}</i>
|
|
|
+ </p>
|
|
|
+ <p>
|
|
|
+ <span>占地面积:</span><i>{{ detailData.txt2 }}</i>
|
|
|
+ </p>
|
|
|
+ <p>
|
|
|
+ <span>建筑面积:</span><i>{{ detailData.txt3 }}</i>
|
|
|
+ </p>
|
|
|
+ <p>
|
|
|
+ <span>保护级别:</span><i>{{ detailData.txt4 }}</i>
|
|
|
+ </p>
|
|
|
+ <p>
|
|
|
+ <span>建筑概况:</span><i>{{ detailData.txt5 }}</i>
|
|
|
+ </p>
|
|
|
+ </div>
|
|
|
+ <!-- 轮播图 -->
|
|
|
+ <!-- 图片 -->
|
|
|
+ <div class="detailImg">
|
|
|
+ <div class="swiper-container detailImgSon">
|
|
|
+ <div class="swiper-wrapper detailImgSon">
|
|
|
+ <div
|
|
|
+ class="swiper-slide detailImgSon"
|
|
|
+ v-for="item in detailData.imgList"
|
|
|
+ :key="item.id"
|
|
|
+ >
|
|
|
+ <img
|
|
|
+ class="detailImgSonImg"
|
|
|
+ :src="baseURL + item.filePath"
|
|
|
+ alt=""
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- 关闭按钮 -->
|
|
|
+ <div class="detailClose" @click="detailShow = false"></div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- 切换下一页 -->
|
|
|
+ <div class="comBs" @click="$emit('pageNext')"></div>
|
|
|
+ <!-- 数据加载中 -->
|
|
|
+ <div class="conShowLoad" v-show="conShowLoad">
|
|
|
+ <img src="../assets/img/loading.gif" alt="" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import Swiper from "@/assets/swiper/swiper.js";
|
|
|
+import axios from "@/utils/request";
|
|
|
+export default {
|
|
|
+ name: "six",
|
|
|
+ props: {
|
|
|
+ tit: {
|
|
|
+ type: String,
|
|
|
+ },
|
|
|
+ data: {
|
|
|
+ type: Array,
|
|
|
+ default: () => [],
|
|
|
+ },
|
|
|
+ },
|
|
|
+ components: {},
|
|
|
+ data() {
|
|
|
+ //这里存放数据
|
|
|
+ return {
|
|
|
+ conShowLoad: true,
|
|
|
+ baseURL: "",
|
|
|
+ detailData: {},
|
|
|
+ detailShow: false,
|
|
|
+ domHei:0
|
|
|
+ };
|
|
|
+ },
|
|
|
+ //监听属性 类似于data概念
|
|
|
+ computed: {},
|
|
|
+ //监控data中的数据变化
|
|
|
+ watch: {
|
|
|
+ detailShow(val) {
|
|
|
+ if (val) {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ new Swiper(".six .swiper-container", {
|
|
|
+ slidesPerView: 1.2,
|
|
|
+ spaceBetween: 10,
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
+ //方法集合
|
|
|
+ methods: {
|
|
|
+ imgSrc(item) {
|
|
|
+ return item.imgList.find((v) => v.id === item.imgActive).filePath;
|
|
|
+ },
|
|
|
+ lookDetail(item) {
|
|
|
+ this.detailData = item;
|
|
|
+ this.detailShow = true;
|
|
|
+ },
|
|
|
+ },
|
|
|
+ //生命周期 - 创建完成(可以访问当前this实例)
|
|
|
+ created() {
|
|
|
+ // 获取服务器前缀地址
|
|
|
+ this.baseURL = axios.defaults.baseURL;
|
|
|
+ },
|
|
|
+ //生命周期 - 挂载完成(可以访问DOM元素)
|
|
|
+ mounted() {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ setTimeout(() => {
|
|
|
+ this.conShowLoad = false;
|
|
|
+ // 获取主容器滚动高度
|
|
|
+ let dom =document.querySelector('.main')
|
|
|
+ this.domHei=dom.scrollHeight
|
|
|
+ }, 1000);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ beforeCreate() {}, //生命周期 - 创建之前
|
|
|
+ beforeMount() {}, //生命周期 - 挂载之前
|
|
|
+ beforeUpdate() {}, //生命周期 - 更新之前
|
|
|
+ updated() {}, //生命周期 - 更新之后
|
|
|
+ beforeDestroy() {}, //生命周期 - 销毁之前
|
|
|
+ destroyed() {}, //生命周期 - 销毁完成
|
|
|
+ activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
|
|
|
+};
|
|
|
+</script>
|
|
|
+<style lang='less' scoped>
|
|
|
+@import "../assets/swiper/swiper.css";
|
|
|
+.six {
|
|
|
+ position: relative;
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ .main {
|
|
|
+ position: relative;
|
|
|
+ width: 100%;
|
|
|
+ height: calc(100% - 130px);
|
|
|
+ overflow-y: auto;
|
|
|
+ padding: 0 18px;
|
|
|
+ .mainSm {
|
|
|
+ pointer-events: none;
|
|
|
+ position: absolute;
|
|
|
+ top: 0;
|
|
|
+ left: 0;
|
|
|
+ width: 100%;
|
|
|
+ min-height: 100%;
|
|
|
+ z-index: 1;
|
|
|
+ background-image: linear-gradient(
|
|
|
+ rgba(255, 255, 255, 0.0),
|
|
|
+ rgba(255, 245, 228, .5)
|
|
|
+ );
|
|
|
+ }
|
|
|
+ .row {
|
|
|
+ display: flex;
|
|
|
+ position: relative;
|
|
|
+ width: 100%;
|
|
|
+ height: 95px;
|
|
|
+ margin-bottom: 15px;
|
|
|
+ padding-bottom: 15px;
|
|
|
+ border-bottom: 1px solid #bfb094;
|
|
|
+ & > img {
|
|
|
+ width: 90px;
|
|
|
+ height: 80px;
|
|
|
+ object-fit: cover;
|
|
|
+ margin-right: 10px;
|
|
|
+ }
|
|
|
+ .txtBox {
|
|
|
+ width: calc(100% - 100px);
|
|
|
+ height: 100%;
|
|
|
+ }
|
|
|
+ .txt {
|
|
|
+ font-size: 14px;
|
|
|
+ color: #8a7351;
|
|
|
+ display: flex;
|
|
|
+ p {
|
|
|
+ width: 50%;
|
|
|
+ overflow: hidden;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ white-space: nowrap;
|
|
|
+ margin-bottom: 5px;
|
|
|
+ & > span {
|
|
|
+ font-weight: 700;
|
|
|
+ font-family: "SYST";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .lastP {
|
|
|
+ width: 80%;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .detailBtn {
|
|
|
+ position: absolute;
|
|
|
+ bottom: 10px;
|
|
|
+ right: 8px;
|
|
|
+ width: 30px;
|
|
|
+ height: 30px;
|
|
|
+ background: url("../assets/img/btnDe.png");
|
|
|
+ background-size: 100% 100%;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 点击详情出来的弹窗
|
|
|
+ .detailBox {
|
|
|
+ position: fixed;
|
|
|
+ top: 0;
|
|
|
+ left: 0;
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ z-index: 999;
|
|
|
+ &::before {
|
|
|
+ content: "";
|
|
|
+ position: absolute;
|
|
|
+ left: 0;
|
|
|
+ top: 0;
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ backdrop-filter: blur(20px);
|
|
|
+ z-index: -2;
|
|
|
+ }
|
|
|
+ .detailMain {
|
|
|
+ color: #fff;
|
|
|
+ border-radius: 5px;
|
|
|
+ position: absolute;
|
|
|
+ top: 50%;
|
|
|
+ transform: translate(-50%, -50%);
|
|
|
+ left: 50%;
|
|
|
+ width: calc(100% - 24px);
|
|
|
+ height: calc(100% - 60px);
|
|
|
+ background-color: rgba(0, 0, 0, 0.8);
|
|
|
+ padding: 0 25px;
|
|
|
+
|
|
|
+ .detailClose {
|
|
|
+ position: absolute;
|
|
|
+ right: 16px;
|
|
|
+ top: -4px;
|
|
|
+ width: 35px;
|
|
|
+ height: 60px;
|
|
|
+ background: url("../assets/img/close.png");
|
|
|
+ background-size: 100% 100%;
|
|
|
+ }
|
|
|
+ .detailTit {
|
|
|
+ font-family: "SYST";
|
|
|
+ letter-spacing: 5px;
|
|
|
+ text-align: center;
|
|
|
+ font-size: 24px;
|
|
|
+ height: 60px;
|
|
|
+ line-height: 60px;
|
|
|
+ }
|
|
|
+ .detailRow {
|
|
|
+ height: calc(100% - 400px);
|
|
|
+ overflow-y: auto;
|
|
|
+ & > p {
|
|
|
+ margin: 5px 0;
|
|
|
+ display: flex;
|
|
|
+ span {
|
|
|
+ width: 80px;
|
|
|
+ font-family: "SYST";
|
|
|
+ }
|
|
|
+ i {
|
|
|
+ flex: 1;
|
|
|
+ font-style: normal;
|
|
|
+ }
|
|
|
+ &:last-child {
|
|
|
+ display: block;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .detailImg {
|
|
|
+ margin-top: 20px;
|
|
|
+ width: 100%;
|
|
|
+ height: 300px;
|
|
|
+ .swiper-container {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ .swiper-slide {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ img {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ object-fit: cover;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|