eight.vue 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374
  1. <template>
  2. <div class="eight">
  3. <div class="comTit">{{ tit }}</div>
  4. <div class="comMani" :class="{swShow:!conShowLoad}">
  5. <div class="row" v-for="item in data" :key="item.id">
  6. <img :src="baseURL + imgSrc(item)" alt="" />
  7. <div class="rowRight">
  8. <div class="txt">
  9. <p :title="item.name"><span>建筑名称:</span>{{ item.name }}</p>
  10. <p :title="item.txt1"><span>产权归属:</span>{{ item.txt1 }}</p>
  11. <p :title="item.txt2"><span>占地面积:</span>{{ item.txt2 }}</p>
  12. </div>
  13. <div class="txt">
  14. <p :title="item.txt3"><span>建筑面积:</span>{{ item.txt3 }}</p>
  15. <p :title="item.txt4"><span>保护级别:</span>{{ item.txt4 }}</p>
  16. </div>
  17. </div>
  18. <!-- 详情按钮 -->
  19. <div class="detailBtn" @click="lookDetail(item)"></div>
  20. </div>
  21. </div>
  22. <!-- 点击详情出来的弹窗 -->
  23. <div class="detailBox" v-if="detailShow">
  24. <div class="detailMain">
  25. <div class="detailCon">
  26. <!-- 文字 -->
  27. <div class="detailTxt">
  28. <div class="detailTxtS">
  29. <p class="detailp" :title="detailData.name">
  30. <span class="detailSpan">建筑名称:</span>{{ detailData.name }}
  31. </p>
  32. <p class="detailp" :title="detailData.txt1">
  33. <span class="detailSpan">产权归属:</span>{{ detailData.txt1 }}
  34. </p>
  35. <p class="detailp" :title="detailData.txt2">
  36. <span class="detailSpan">占地面积:</span>{{ detailData.txt2 }}
  37. </p>
  38. </div>
  39. <div class="detailTxtS">
  40. <p class="detailp" :title="detailData.txt3">
  41. <span class="detailSpan">建筑面积:</span>{{ detailData.txt3 }}
  42. </p>
  43. <p class="detailp" :title="detailData.txt4">
  44. <span class="detailSpan">保护级别:</span>{{ detailData.txt4 }}
  45. </p>
  46. </div>
  47. <div class="detailPP">
  48. <span class="detailSpan">建筑概况:</span>{{ detailData.txt5 }}
  49. </div>
  50. </div>
  51. <!-- 图片 -->
  52. <div class="detailImg">
  53. <div class="swiper-container detailImgSon">
  54. <div class="swiper-wrapper detailImgSon">
  55. <div
  56. class="swiper-slide detailImgSon"
  57. v-for="item in detailData.imgList"
  58. :key="item.id"
  59. >
  60. <img
  61. class="detailImgSonImg"
  62. :src="baseURL + item.filePath"
  63. alt=""
  64. />
  65. </div>
  66. </div>
  67. <!-- Add Pagination -->
  68. <!-- <div class="swiper-pagination"></div> -->
  69. </div>
  70. </div>
  71. <!-- 关闭按钮 -->
  72. <div class="detailClose" @click="detailShow = false"></div>
  73. </div>
  74. </div>
  75. </div>
  76. <div class="comBs" @click="$emit('pageNext')"></div>
  77. <!-- 数据加载中 -->
  78. <div class="conShowLoad" v-show="conShowLoad">
  79. <img src="../assets/img/loading.gif" alt="" />
  80. </div>
  81. </div>
  82. </template>
  83. <script>
  84. import Swiper from "./data/swiper.js";
  85. // import "./data/swiper.css";
  86. import axios from "@/utils/request";
  87. export default {
  88. name: "eight",
  89. props: {
  90. tit: {
  91. type: String,
  92. },
  93. data: {
  94. type: Array,
  95. default: () => [],
  96. },
  97. },
  98. components: {},
  99. data() {
  100. //这里存放数据
  101. return {
  102. conShowLoad: true,
  103. baseURL: "",
  104. detailShow: false,
  105. detailData: {},
  106. };
  107. },
  108. //监听属性 类似于data概念
  109. computed: {},
  110. //监控data中的数据变化
  111. watch: {
  112. detailShow(val) {
  113. if (val) {
  114. this.$nextTick(() => {
  115. new Swiper(".detailImg .swiper-container", {
  116. slidesPerView: 3,
  117. spaceBetween: 0,
  118. centeredSlides: true,
  119. initialSlide: 1,
  120. // pagination: {
  121. // el: '.swiper-pagination',
  122. // clickable: true,
  123. // },
  124. });
  125. });
  126. }
  127. },
  128. },
  129. //方法集合
  130. methods: {
  131. imgSrc(item) {
  132. return item.imgList.find((v) => v.id === item.imgActive).filePath;
  133. },
  134. lookDetail(item) {
  135. this.detailData = item;
  136. this.detailShow = true;
  137. },
  138. },
  139. //生命周期 - 创建完成(可以访问当前this实例)
  140. created() {
  141. // 获取服务器前缀地址
  142. this.baseURL = axios.defaults.baseURL;
  143. },
  144. //生命周期 - 挂载完成(可以访问DOM元素)
  145. mounted() {
  146. this.$nextTick(() => {
  147. setTimeout(() => {
  148. this.conShowLoad = false;
  149. }, 1000);
  150. });
  151. },
  152. beforeCreate() {}, //生命周期 - 创建之前
  153. beforeMount() {}, //生命周期 - 挂载之前
  154. beforeUpdate() {}, //生命周期 - 更新之前
  155. updated() {}, //生命周期 - 更新之后
  156. beforeDestroy() {}, //生命周期 - 销毁之前
  157. destroyed() {}, //生命周期 - 销毁完成
  158. activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
  159. };
  160. </script>
  161. <style lang='less' scoped>
  162. @import "./data/swiper.css";
  163. .swiper-container {
  164. width: 100%;
  165. height: 100%;
  166. overflow: visible !important;
  167. }
  168. .swiper-slide img {
  169. width: 100%;
  170. height: 100%;
  171. object-fit: cover;
  172. }
  173. .swiper-slide {
  174. transition: all .3s;
  175. opacity: 0.5;
  176. }
  177. .swiper-slide-active {
  178. transform: scale(1.3);
  179. opacity: 1;
  180. z-index: 999;
  181. }
  182. .eight {
  183. position: relative;
  184. width: 100%;
  185. height: 100%;
  186. padding-top: 50px;
  187. .comMani::-webkit-scrollbar {
  188. /*滚动条整体样式*/
  189. width: 5px; /*高宽分别对应横竖滚动条的尺寸*/
  190. height: 1px;
  191. }
  192. .comMani::-webkit-scrollbar-thumb {
  193. /*滚动条里面小方块*/
  194. border-radius: 10px;
  195. -webkit-box-shadow: inset 0 0 5px transparent;
  196. background: #8a7351;
  197. }
  198. .comMani::-webkit-scrollbar-track {
  199. /*滚动条里面轨道*/
  200. -webkit-box-shadow: inset 0 0 5px transparent;
  201. border-radius: 10px;
  202. background: transparent;
  203. }
  204. .comMani {
  205. opacity: 0;
  206. overflow-y: auto;
  207. width: 100%;
  208. height: calc(100% - 155px);
  209. padding-right: 20px;
  210. .row {
  211. display: flex;
  212. align-items: center;
  213. position: relative;
  214. width: 100%;
  215. height: 180px;
  216. margin-bottom: 20px;
  217. padding-bottom: 20px;
  218. border-bottom: 1px solid #bfb094;
  219. & > img {
  220. width: 220px;
  221. height: 157px;
  222. object-fit: cover;
  223. margin-right: 40px;
  224. }
  225. .rowRight {
  226. flex: 1;
  227. .txt {
  228. color: #8a7351;
  229. display: flex;
  230. p {
  231. margin-right: 50px;
  232. cursor: pointer;
  233. width: 260px;
  234. overflow: hidden;
  235. text-overflow: ellipsis;
  236. white-space: nowrap;
  237. height: 60px;
  238. line-height: 60px;
  239. font-size: 24px;
  240. & > span {
  241. font-weight: 700;
  242. font-family: "思源宋体";
  243. font-size: 24px;
  244. }
  245. }
  246. }
  247. }
  248. .detailBtn {
  249. cursor: pointer;
  250. position: absolute;
  251. top: 0;
  252. right: 0;
  253. width: 46px;
  254. height: 44px;
  255. background: url("../assets/img/btnDe.png");
  256. background-size: 100% 100%;
  257. }
  258. }
  259. }
  260. .swShow{
  261. opacity: 1;
  262. }
  263. .detailBox {
  264. position: fixed;
  265. top: 0;
  266. left: 0;
  267. width: 100%;
  268. height: 100%;
  269. z-index: 999;
  270. padding-top: 100px;
  271. &::before {
  272. content: "";
  273. position: absolute;
  274. left: 0;
  275. top: 0;
  276. width: 100%;
  277. height: 100%;
  278. backdrop-filter: blur(20px);
  279. z-index: -2;
  280. }
  281. .detailMain {
  282. position: absolute;
  283. bottom: 0;
  284. left: 0;
  285. width: 100%;
  286. height: calc(100% - 100px);
  287. .detailCon {
  288. overflow: hidden;
  289. padding: 30px 60px;
  290. position: absolute;
  291. top: 50%;
  292. left: 50%;
  293. transform: translate(-50%, -50%);
  294. background-color: rgba(0, 0, 0, 0.8);
  295. width: 1300px;
  296. height: 700px;
  297. .detailClose {
  298. cursor: pointer;
  299. top: -7px;
  300. right: 104px;
  301. position: absolute;
  302. width: 66px;
  303. height: 105px;
  304. background: url("../assets/img/close.png");
  305. background-size: 100% 100%;
  306. }
  307. .detailTxt {
  308. color: #fff;
  309. font-size: 18px;
  310. .detailTxtS {
  311. display: flex;
  312. .detailp {
  313. margin-bottom: 12px;
  314. cursor: pointer;
  315. width: 300px;
  316. overflow: hidden;
  317. text-overflow: ellipsis;
  318. white-space: nowrap;
  319. margin-right: 50px;
  320. .detailSpan {
  321. font-family: "思源宋体";
  322. font-size: 20px;
  323. }
  324. }
  325. }
  326. .detailPP::-webkit-scrollbar {
  327. /*滚动条整体样式*/
  328. width: 5px; /*高宽分别对应横竖滚动条的尺寸*/
  329. height: 1px;
  330. }
  331. .detailPP::-webkit-scrollbar-thumb {
  332. /*滚动条里面小方块*/
  333. border-radius: 10px;
  334. -webkit-box-shadow: inset 0 0 5px transparent;
  335. background: #c7b080;
  336. }
  337. .detailPP::-webkit-scrollbar-track {
  338. /*滚动条里面轨道*/
  339. -webkit-box-shadow: inset 0 0 5px transparent;
  340. border-radius: 10px;
  341. background: transparent;
  342. }
  343. .detailPP {
  344. height: 200px;
  345. overflow-y: auto;
  346. .detailSpan {
  347. font-family: "思源宋体";
  348. font-size: 20px;
  349. }
  350. }
  351. }
  352. .detailImg {
  353. margin-top: 50px;
  354. height: 280px;
  355. }
  356. }
  357. }
  358. }
  359. .conShowLoad {
  360. z-index: 999;
  361. position: absolute;
  362. top: 0;
  363. left: 0;
  364. width: 100%;
  365. height: 100%;
  366. display: flex;
  367. justify-content: center;
  368. align-items: center;
  369. }
  370. }
  371. </style>