ztcrdetail.html 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>载体服务</title>
  7. <link rel="stylesheet" href="css/mapcon.css">
  8. <link rel="stylesheet" href="swiper/swiper-bundle.css">
  9. <!-- 引入 Vue -->
  10. <script src="https://www.cqna.gov.cn/syygapi/naxsb/js/vue.min.js"></script>
  11. <!-- 引入样式 -->
  12. <link rel="stylesheet" href="https://www.cqna.gov.cn/syygapi/naxsb/css/index.css">
  13. <!-- 引入组件库 -->
  14. <script src="https://www.cqna.gov.cn/syygapi/naxsb/js/index.js"></script>
  15. <script src="https://www.cqna.gov.cn/syygapi/naxsb/js/jquery-3.5.1.min.js"></script>
  16. <script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak=7XivTux4H2e1ifKLjvEhxfuayDYxAluq">
  17. </script>
  18. <script src="https://www.cqna.gov.cn/syygapi/naxsb/js/jquery-3.5.1.min.js"></script>
  19. <script src="https://www.cqna.gov.cn/syygapi/naxsb/js/urljson.js"></script>
  20. <style>
  21. .contentleft {
  22. width: 50%;
  23. min-width: 841px;
  24. background-color: #EDF5FF;
  25. font-size: 20px;
  26. color: #333;
  27. padding: 15px 30px;
  28. box-sizing: border-box;
  29. font-family: Microsoft YaHei;
  30. height: auto;
  31. }
  32. .itemname .topicon {
  33. width: 134px;
  34. height: 37px;
  35. line-height: 37px;
  36. background: #D8E9FE;
  37. border-radius: 10px;
  38. font-size: 20px;
  39. color: #4B98F6;
  40. text-align: center;
  41. margin-left: 10px;
  42. margin-top: 10px;
  43. }
  44. .swiperimg {
  45. display: flex;
  46. justify-content: space-between;
  47. position: relative;
  48. }
  49. .swiper {
  50. width: 20%;
  51. min-width: 170px;
  52. height: 320px;
  53. margin: auto 0;
  54. }
  55. .swiper-slide {
  56. width: 100%;
  57. text-align: center;
  58. font-size: 18px;
  59. background: #fff;
  60. display: flex;
  61. justify-content: center;
  62. align-items: center;
  63. }
  64. .swiper-slide img {
  65. width: 100%;
  66. height: 104px;
  67. cursor: pointer;
  68. }
  69. .swiper-button-next,
  70. .swiper-button-prev {
  71. /* 移除所有样式 */
  72. all: unset;
  73. position: absolute;
  74. z-index: 20;
  75. color: #666;
  76. transform: translateY(-50%) rotate(270deg);
  77. width: 27px;
  78. height: 187px;
  79. right: 82px;
  80. background: #FFFFFF;
  81. display: flex;
  82. align-items: center;
  83. background-size: 100% 100%;
  84. background-position: center;
  85. display: flex;
  86. align-items: center;
  87. justify-content: center;
  88. opacity: 1;
  89. padding-top: 5px;
  90. box-sizing: border-box;
  91. }
  92. .swiper-button-next {
  93. top: 10px;
  94. }
  95. .swiper-button-next img {
  96. transform: translateY(-50%) rotate(270deg);
  97. }
  98. .swiper-button-prev {
  99. top: 382px;
  100. }
  101. .swiper-button-prev img {
  102. transform: translateY(-50%) rotate(270deg);
  103. }
  104. .swiper-button-prev:after,
  105. .swiper-rtl .swiper-button-next:after {
  106. content: '';
  107. }
  108. .swiper-button-next:after,
  109. .swiper-rtl .swiper-button-prev:after {
  110. content: '';
  111. }
  112. .swiper-button-prev.swiper-button-disabled,
  113. .swiper-button-next.swiper-button-disabled {
  114. display: flex;
  115. align-items: center;
  116. justify-content: center;
  117. /* opacity: 1; */
  118. padding-top: 5px;
  119. box-sizing: border-box;
  120. }
  121. .contentleft {
  122. height: 1000px;
  123. }
  124. .contentright {
  125. width: 50vw;
  126. height: 1000px;
  127. }
  128. #ztcr>.top {
  129. display: flex;
  130. justify-content: space-between;
  131. align-items: center;
  132. border-bottom: 1px solid #B7C7DC;
  133. background: #FFFFFF;
  134. }
  135. .iconzb {
  136. width: 100px;
  137. height: 37px;
  138. line-height: 37px;
  139. background: #E3F5E7;
  140. border-radius: 4px;
  141. border: 1px solid #4BB664;
  142. font-size: 20px;
  143. color: #4BB664;
  144. text-align: center;
  145. margin-right: 9px;
  146. }
  147. @media screen and (min-width:1860px) and (max-width:1920px) {
  148. .swiper-button-next,
  149. .swiper-button-prev {
  150. height: 177px;
  151. right: 74px;
  152. }
  153. }
  154. @media screen and (min-width:1600px) and (max-width:1900px) {
  155. .swiper-button-next,
  156. .swiper-button-prev {
  157. height: 170px;
  158. right: 71px;
  159. }
  160. }
  161. @media screen and (max-width:1600px) {
  162. .swiper-button-next,
  163. .swiper-button-prev {
  164. height: 170px;
  165. right: 71px;
  166. }
  167. }
  168. .contentleft>.list {
  169. justify-content: flex-start;
  170. }
  171. .contentleft>.list .listitm {
  172. margin-right: 20px;
  173. }
  174. </style>
  175. </head>
  176. <body>
  177. <div style="width:100%;" class="header"></div>
  178. <div id="ztcr">
  179. <div class="top">
  180. <div class="toplogo">
  181. <img src="images/gyylogo.png" alt="">
  182. <span>载体服务</span>
  183. </div>
  184. <div class="backbutton" @click="window.history.go(-1)">
  185. <img src="images/back1.png" alt="">
  186. <span>返回</span>
  187. </div>
  188. </div>
  189. <div style="display: flex;">
  190. <div class="contentleft">
  191. <div class="itemname">
  192. <div>{{ztcrDetail.carrierName}}</div>
  193. <div style="display: flex;">
  194. <div class="topicon" v-for="(item,index) in (ztcrDetail.tag?ztcrDetail.tag.split(','):[])">
  195. {{item}}</div>
  196. </div>
  197. </div>
  198. <div class="swiperimg">
  199. <img :src="imgUrl" alt="" style="width: 75%;height: 394px;">
  200. <div class="swiper-button-prev"><img src="images/toparrow.png" alt=""></div>
  201. <div class="swiper mySwiper">
  202. <div class="swiper-wrapper">
  203. <div class="swiper-slide list" v-for="(item,index) in swiperList" @click="imgDetail(item)">
  204. <img :src="item" alt="">
  205. </div>
  206. </div>
  207. </div>
  208. <div class="swiper-button-next"><img src="images/bottomarrow.png" alt=""></div>
  209. </div>
  210. <div class="list">
  211. <div class="listitm" style="background-color: #4EB2AD;">
  212. <span>招商面积</span>
  213. <span>{{ztcrDetail.space?ztcrDetail.space:'-'}}㎡</span>
  214. </div>
  215. <!-- <div class="listitm" style="background-color: #4BB664;">
  216. <span>出售价格</span>
  217. <span>{{ztcrDetail.sellingPrice?ztcrDetail.sellingPrice:'-'}}</span>
  218. </div> -->
  219. <div class="listitm"
  220. style="background-color: #DFC483;width: auto;min-width: 23.5%;padding: 0 10px;">
  221. <span>载体类型</span>
  222. <span>{{ztcrDetail.application?ztcrDetail.application:'-'}}</span>
  223. </div>
  224. </div>
  225. <div class="text">
  226. <div style="" v-if="ztcrDetail.productModule">
  227. <span>主导产业:</span>
  228. <div class="icon"
  229. v-for="(item,index) in (ztcrDetail.productModule?ztcrDetail.productModule.split('、'):[])">
  230. {{item}}</div>
  231. </div>
  232. <div style="" v-if="ztcrDetail.complement">
  233. <span>周边配套:</span>
  234. <div class="iconzb"
  235. v-for="(item,index) in (ztcrDetail.complement?ztcrDetail.complement.split(','):[])">
  236. {{item}}</div>
  237. </div>
  238. <div v-if="ztcrDetail.addr"><span>详细地址:</span><span>{{ztcrDetail.addr?ztcrDetail.addr:'-'}}</span>
  239. </div>
  240. <div v-if="ztcrDetail.contactName">
  241. <span>联系方式:</span><span>{{ztcrDetail.contactName?ztcrDetail.contactName:'-'}}&nbsp;&nbsp;{{ztcrDetail.contactPhone}}</span>
  242. </div>
  243. </div>
  244. </div>
  245. <div class="contentright" id="mapcontainer"></div>
  246. </div>
  247. </div>
  248. <div style="width:100%;" class="footer"></div>
  249. </body>
  250. <script>
  251. $(function () {
  252. /*公共部分
  253. * 导航栏
  254. * footer CopyRight
  255. */
  256. $(".header").load('https://www.cqna.gov.cn/syygapi/naxsb/top/top_style.html');
  257. $(".footer").load('https://www.cqna.gov.cn/syygapi/naxsb/footer/footer.html');
  258. });
  259. </script>
  260. <script src="https://www.cqna.gov.cn/syygapi/naxsb/swiper/swiper-bundle.js"></script>
  261. <script>
  262. </script>
  263. <script>
  264. new Vue({
  265. el: '#ztcr',
  266. data: function () {
  267. return {
  268. reqPtah: '',
  269. ztcrDetail: {},
  270. imgUrl: 'https://www.cqna.gov.cn/syygapi/naxsb/images/slide1.png',
  271. swiperList: [],
  272. backgroundImage: '',
  273. znptList: '学校,轻轨,公交车站'
  274. }
  275. },
  276. mounted() {
  277. const url = new URL(window.location.href);
  278. const id = url.searchParams.get('ztid');
  279. this.getBuildDetail(id);
  280. this.$nextTick(() => {
  281. var swiper = new Swiper(".mySwiper", {
  282. observer: true,
  283. observeParents: true,
  284. direction: "vertical",
  285. slidesPerView: 3,
  286. navigation: {
  287. nextEl: '.swiper-button-next',
  288. prevEl: '.swiper-button-prev',
  289. },
  290. spaceBetween: 10
  291. });
  292. })
  293. },
  294. methods: {
  295. backIndex() {
  296. window.history.go(-1)
  297. },
  298. imgDetail(imgurl) {
  299. if (imgurl == "https://www.cqna.gov.cn/syygapi/naxsb/images/tdcr0.png") {
  300. return
  301. }
  302. this.imgUrl = imgurl;
  303. },
  304. getBuildDetail(id) {
  305. let that = this;
  306. $.ajax({
  307. url: conpath + "/sellBuild/" + id,
  308. type: "get",
  309. dataType: "json",
  310. success: function (data) {
  311. let mdata = data.data;
  312. mdata.tags = mdata.tag ? mdata.tag.split(",") : []
  313. that.ztcrDetail = mdata;
  314. var yqid = mdata.parkData.id;
  315. if (yqid == 4) {
  316. that.backgroundImage = 'https://www.cqna.gov.cn/syygapi/naxsb/image/npxq.webp';
  317. } else if (yqid == 6) {
  318. that.backgroundImage = 'https://www.cqna.gov.cn/syygapi/naxsb/image/dxkjy.webp';
  319. } else if (yqid == 5) {
  320. that.backgroundImage = 'https://www.cqna.gov.cn/syygapi/naxsb/image/ylcxg.png';
  321. } else if (yqid == 3) {
  322. that.backgroundImage = 'https://www.cqna.gov.cn/syygapi/naxsb/image/cjls.webp';
  323. } else if (yqid == 2) {
  324. that.backgroundImage = 'https://www.cqna.gov.cn/syygapi/naxsb/image/xjcy.webp';
  325. } else if (yqid == 1) {
  326. that.backgroundImage = 'https://www.cqna.gov.cn/syygapi/naxsb/image/cygyy.webp';
  327. } else {
  328. that.backgroundImage = 'https://www.cqna.gov.cn/syygapi/naxsb/image/cygyy.webp';
  329. }
  330. that.swiperList = mdata.imgUrl ? mdata.imgUrl.split(",") : [];
  331. if (!that.swiperList.length) {
  332. that.swiperList.push(that.backgroundImage)
  333. }
  334. that.imgUrl = that.swiperList[0];
  335. let points = mdata.parkData.addr;
  336. that.loadMap(points, mdata.point, mdata.namePoint, mdata.centerPoint);
  337. }
  338. });
  339. },
  340. loadMap(points, currPoints, namePoint, centerPoint) {
  341. let map = new BMap.Map("mapcontainer");
  342. map.enableScrollWheelZoom();// 启用滚轮缩放
  343. map.enableDragging(); // 启用拖拽功能
  344. //设定中心点和地图级别
  345. if (!currPoints) { map.centerAndZoom(new BMap.Point(106.6438551, 29.480752), 17); } else {
  346. let pList = currPoints.split('@');
  347. pList.forEach(function (point) {
  348. let arr = point.split(',');
  349. map.centerAndZoom(new BMap.Point(arr[0], arr[1]), 17);
  350. });
  351. }
  352. // map.centerAndZoom(new BMap.Point(106.761208, 29.598238), 17);
  353. map.setMapType(BMAP_NORMAL_MAP);
  354. // if (!points) return;
  355. // let pointList = points.split('@');
  356. // let result = [];
  357. // pointList.forEach(function (point) {
  358. // let arr = point.split(',');
  359. // result.push(new BMap.Point(arr[0], arr[1]));
  360. // });
  361. // // 创建多边形
  362. // let polygon = new BMap.Polygon(result, {
  363. // strokeColor: "blue",
  364. // strokeWeight: 4,
  365. // strokeOpacity: 0.5,
  366. // strokeStyle: "solid",
  367. // fillColor: "#4B98F6",
  368. // fillOpacity: 0.3
  369. // });
  370. // // 将多边形添加到地图中
  371. // map.addOverlay(polygon);
  372. // 添加选择地址
  373. if (!currPoints) return;
  374. let pList = currPoints.split('@');
  375. pList.forEach(function (point) {
  376. let arr = point.split(',');
  377. let p = new BMap.Point(arr[0], arr[1]);
  378. let marker = new BMap.Marker(p);
  379. map.addOverlay(marker);
  380. });
  381. // 创建文本标签
  382. if (!namePoint) return;
  383. let namearr = namePoint.split(',');
  384. var opts = {
  385. position: new BMap.Point(namearr[0], namearr[1]), // 指定文本标签所在的地理位置
  386. offset: new BMap.Size(10, 10) // 设置文本偏移量
  387. };
  388. // var opts = {
  389. // position: new BMap.Point(106.761208, 29.600238), // 指定文本标签所在的地理位置
  390. // offset: new BMap.Size(10, 10) // 设置文本偏移量
  391. // };
  392. // 创建文本标签对象,并添加到地图
  393. var label = new BMap.Label(this.ztcrDetail.carrierName, opts);
  394. // 自定义文本标签样式
  395. label.setStyle({
  396. color: "#186FF0",
  397. fontSize: "18px",
  398. height: "auto",
  399. lineHeight: "20px",
  400. fontFamily: "微软雅黑",
  401. fontWeight: 'bold',
  402. backgroundColor: 'transparent',
  403. border: 'none',
  404. textShadow: '0 0 4px #4B97F5',
  405. textStrokeColor: "#4B97F5", // 文本描边颜色
  406. textStrokeWidth: "4px", // 文本描边宽度
  407. });
  408. map.addOverlay(label);
  409. },
  410. }
  411. })
  412. </script>
  413. </html>