ztcrlist.html 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573
  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. <!-- 引入 Vue -->
  9. <script src="js/vue.min.js"></script>
  10. <!-- 引入样式 -->
  11. <link rel="stylesheet" href="css/index.css">
  12. <!-- 引入组件库 -->
  13. <script src="js/index.js"></script>
  14. <script src="js/jquery-3.5.1.min.js"></script>
  15. <script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak=7XivTux4H2e1ifKLjvEhxfuayDYxAluq">
  16. </script>
  17. <script src="js/urljson.js"></script>
  18. <style>
  19. ul {
  20. padding: 0;
  21. margin: 0;
  22. }
  23. .contentleft {
  24. width: 50%;
  25. min-width: 841px;
  26. background-color: #EDF5FF;
  27. font-size: 20px;
  28. color: #333;
  29. padding: 15px 30px;
  30. box-sizing: border-box;
  31. font-family: Microsoft YaHei;
  32. }
  33. .term {
  34. display: flex;
  35. align-items: flex-start;
  36. font-size: 16px;
  37. margin-top: 15px;
  38. }
  39. .term .name {
  40. color: #666666;
  41. white-space: nowrap;
  42. margin-right: 20px;
  43. line-height: 30px;
  44. }
  45. .term .item {
  46. display: flex;
  47. flex-wrap: wrap;
  48. }
  49. .term .item li {
  50. color: #333;
  51. cursor: pointer;
  52. padding: 0 18px;
  53. width: auto;
  54. height: 30px;
  55. line-height: 30px;
  56. white-space: nowrap;
  57. }
  58. .term .item li:first-child {
  59. width: auto !important;
  60. }
  61. .term .item li.active {
  62. background: #DEEDFF;
  63. border: 1px solid #4B98F6;
  64. color: #4B98F6;
  65. text-align: center;
  66. cursor: pointer;
  67. }
  68. .contentleft>.content {
  69. width: 100%;
  70. margin: auto;
  71. height: calc(100% - 238px);
  72. overflow-y: scroll;
  73. margin-top: 30px;
  74. }
  75. .contentleft>.content::-webkit-scrollbar {
  76. width: 0px;
  77. height: 0px;
  78. }
  79. .contentleft .content {
  80. display: flex;
  81. flex-wrap: wrap;
  82. }
  83. .contentleft .content ul {
  84. list-style-type: none;
  85. display: flex;
  86. flex-direction: column;
  87. padding: 0;
  88. }
  89. .contentleft .content ul li {
  90. margin-bottom: 15px;
  91. }
  92. .contentleft .content .list {
  93. width: 49%;
  94. height: 455px;
  95. background: #FFFFFF;
  96. display: flex;
  97. margin-bottom: 30px;
  98. cursor: pointer;
  99. display: flex;
  100. flex-direction: column;
  101. margin-right: 1%;
  102. }
  103. .contentleft .content .list .left {
  104. width: 100%;
  105. height: 231px;
  106. }
  107. .contentleft .content .list .left img {
  108. width: 100%;
  109. height: 231px;
  110. }
  111. .contentleft .content .list .right {
  112. width: 100%;
  113. height: calc(100% - 231px);
  114. display: flex;
  115. justify-content: space-between;
  116. padding: 20px 15px;
  117. box-sizing: border-box;
  118. }
  119. .contentleft .content .tjzb {
  120. width: 86px;
  121. height: 98px;
  122. background-image: url(images/znxzlogo.png);
  123. background-size: 100% 100%;
  124. font-size: 16px;
  125. color: #FFFFFF;
  126. display: flex;
  127. flex-direction: column;
  128. justify-content: center;
  129. align-items: center;
  130. }
  131. .contentright {
  132. width: 50vw;
  133. height: 1384px;
  134. }
  135. #znxz>.top {
  136. display: flex;
  137. justify-content: space-between;
  138. align-items: center;
  139. border-bottom: 1px solid #B7C7DC;
  140. background: #FFFFFF;
  141. }
  142. .zwsj {
  143. width: 100%;
  144. height: 100%;
  145. display: flex;
  146. align-items: center;
  147. font-size: 20px;
  148. color: #999999;
  149. flex-direction: column;
  150. }
  151. .iconzb {
  152. width: 100px;
  153. height: 37px;
  154. line-height: 37px;
  155. background: #E3F5E7;
  156. border-radius: 4px;
  157. border: 1px solid #4BB664;
  158. font-size: 20px;
  159. color: #4BB664;
  160. text-align: center;
  161. margin-right: 9px;
  162. }
  163. </style>
  164. </head>
  165. <body>
  166. <div style="width:100%;height:570px" class="header"></div>
  167. <div id="znxz">
  168. <div class="top">
  169. <div class="toplogo">
  170. <img src="images/gyylogo.png" alt="">
  171. <span>载体服务</span>
  172. </div>
  173. <div class="backbutton" @click="window.history.go(-1)">
  174. <img src="images/back1.png" alt="">
  175. <span>返回</span>
  176. </div>
  177. </div>
  178. <div style="display: flex;">
  179. <div class="contentleft">
  180. <div class="title">
  181. <img src="images/gyy-gk.png" alt="">
  182. <span>条件筛选</span>
  183. </div>
  184. <div class="term">
  185. <div class="name">片区</div>
  186. <ul class="item">
  187. <li v-for="(item,index) in pqList" :class="{ active: currentPq == item.id }" :key="index"
  188. @click="handleParkChange(item)">{{item.title}}</li>
  189. </ul>
  190. </div>
  191. <div class="term">
  192. <div class="name">面积</div>
  193. <ul class="item">
  194. <li v-for="(item,index) in mjList" :class="{ active: currentmj == item.id }" :key="index"
  195. @click="handleSpaceChange(item)">{{item.name}}</li>
  196. </ul>
  197. </div>
  198. <div class="term">
  199. <div class="name">用途</div>
  200. <ul class="item">
  201. <li v-for="(item,index) in ytList" :class="{ active: currentyt == item.id }" :key="index"
  202. @click="handleUseChange(item)">{{item.name}}</li>
  203. </ul>
  204. </div>
  205. <div class="content">
  206. <div class="zwsj" v-if="!this.contentList.length"><img src="images/zwsj.png"
  207. alt=""><span>暂无数据</span></div>
  208. <div class="list" v-for="(item,index) in contentList" @click="goDeteil(item.id)">
  209. <div class="left">
  210. <img :src="item.imgUrl ? item.imgUrl.split(',')[0] : backgroundImage" alt="">
  211. </div>
  212. <div class="right">
  213. <ul class="item">
  214. <li style="display: flex;">
  215. <div class="iconzb"
  216. v-for="(iteml,indexl) in (item.complement?item.complement.split(','):[])">
  217. {{iteml}}</div>
  218. </li>
  219. <li><span>载体名称:</span><span>{{item.carrierName}}</span></li>
  220. <li><span>可用面积:</span><span>{{item.area}}㎡</span></li>
  221. <li><span>所属园区:</span><span>{{item.parkData?item.parkData.title:''}}</span></li>
  222. </ul>
  223. </div>
  224. </div>
  225. </div>
  226. </div>
  227. <div class="contentright" id="mapcontainer"></div>
  228. </div>
  229. </div>
  230. <div style="width:100%;" class="footer"></div>
  231. </body>
  232. <script>
  233. $(function () {
  234. /*公共部分
  235. * 导航栏
  236. * footer CopyRight
  237. */
  238. $(".header").load('https://www.cqna.gov.cn/ggbf_search/top/top_style.html');
  239. $(".footer").load('https://www.cqna.gov.cn/ggbf_search/ggyr/2022foot/bottomBlack.html');
  240. });
  241. </script>
  242. <script>
  243. new Vue({
  244. el: '#znxz',
  245. data: function () {
  246. return {
  247. reqPtah: '',
  248. pageSize: 10000,
  249. parkMap: {},
  250. maptitle: '',
  251. pointList: [],
  252. currSpace: '',
  253. currUse: '',
  254. currentPq: -1,
  255. currentmj: 1,
  256. currentyt: 1,
  257. pqList: [],
  258. mjList: [
  259. {
  260. id: 1,
  261. name: "全部",
  262. value: "-1"
  263. },
  264. {
  265. id: 2,
  266. name: "0-1000m²",
  267. value: "1,1000"
  268. },
  269. {
  270. id: 3,
  271. name: "1001-5000m²",
  272. value: "1001,5000"
  273. },
  274. {
  275. id: 4,
  276. name: "5001-10000m²",
  277. value: "5001,10000"
  278. },
  279. {
  280. id: 5,
  281. name: "10000以上m²",
  282. value: "10000"
  283. }
  284. ],
  285. ytList: [
  286. {
  287. id: 1,
  288. name: "全部"
  289. },
  290. {
  291. id: 2,
  292. name: "办公楼宇"
  293. },
  294. {
  295. id: 3,
  296. name: "库房"
  297. },
  298. {
  299. id: 4,
  300. name: "厂房"
  301. },
  302. {
  303. id: 5,
  304. name: "医药库房"
  305. },
  306. {
  307. id: 6,
  308. name: "宿舍"
  309. },
  310. {
  311. id: 7,
  312. name: "商业"
  313. },
  314. {
  315. id: 8,
  316. name: "底商"
  317. }
  318. ],
  319. contentList: [],
  320. backgroundImage: 'images/indexsyyg.png',
  321. }
  322. },
  323. mounted() {
  324. const url = new URL(window.location.href);
  325. const id = url.searchParams.get('id');
  326. this.currentPq = id;
  327. this.getParkData();
  328. this.getParkDetail();
  329. this.getSellBuild();
  330. if (this.id == 4) {
  331. this.backgroundImage = 'image/ztnp.webp';
  332. } else if (this.id == 6) {
  333. this.backgroundImage = 'image/ztdx.webp';
  334. } else if (this.id == 5) {
  335. this.backgroundImage = 'image/ztyl.webp';
  336. } else if (this.id == 3) {
  337. this.backgroundImage = 'image/ztcjcx.webp';
  338. } else if (this.id == 2) {
  339. this.backgroundImage = 'image/ztxj.webp';
  340. } else {
  341. this.backgroundImage = 'image/ztcy.webp';
  342. }
  343. },
  344. methods: {
  345. backIndex() {
  346. window.history.go(-1)
  347. },
  348. handleParkChange(data) {
  349. this.currentPq = data.id;
  350. this.getSellBuild();
  351. this.getParkDetail();
  352. },
  353. handleSpaceChange(data) {
  354. this.currentmj = data.id;
  355. this.currSpace = data.value;
  356. this.getSellBuild();
  357. },
  358. handleUseChange(data) {
  359. this.currentyt = data.id;
  360. this.currUse = data.name;
  361. this.getSellBuild();
  362. },
  363. goDeteil(id) {
  364. if (id) {
  365. window.location.href = "ztcrdetail.html?ztid=" + id;
  366. }
  367. },
  368. getParkDetail() {
  369. let that = this;
  370. $.ajax({
  371. url: conpath + "/parkData/" + that.currentPq,
  372. type: "get",
  373. dataType: "json",
  374. success: function (data) {
  375. that.maptitle = data.title;
  376. }
  377. });
  378. },
  379. // loadAllMap(allpoints) {
  380. // let that = this;
  381. // that.parkMap = new BMap.Map("mapcontainer");
  382. // that.parkMap.enableScrollWheelZoom();// 启用滚轮缩放
  383. // that.parkMap.enableDragging(); // 启用拖拽功能
  384. // that.parkMap.centerAndZoom(new BMap.Point(106.651444, 29.48682), 14);
  385. // that.parkMap.setMapType(BMAP_NORMAL_MAP);
  386. // var allpointList = allpoints.split('?');
  387. // for (var i = 0; i < allpointList.length; i++) {
  388. // let pointList = allpointList[i].split('@');
  389. // let result = [];
  390. // pointList.forEach(function (point) {
  391. // let arr = point.split(',');
  392. // result.push(new BMap.Point(arr[0], arr[1]));
  393. // });
  394. // // 创建多边形
  395. // let polygon = new BMap.Polygon(result, {
  396. // strokeColor: "#FFD119",
  397. // strokeWeight: 4,
  398. // strokeOpacity: 1,
  399. // strokeStyle: "solid",
  400. // fillColor: "transparent",
  401. // fillOpacity: 0.3
  402. // });
  403. // // 将多边形添加到地图中
  404. // that.parkMap.addOverlay(polygon);
  405. // }
  406. // },
  407. loadMap(points) {
  408. let that = this;
  409. that.parkMap = new BMap.Map("mapcontainer");
  410. that.parkMap.enableScrollWheelZoom();// 启用滚轮缩放
  411. that.parkMap.enableDragging(); // 启用拖拽功能
  412. const id = that.currentPq;
  413. // 设定中心点和地图级别
  414. // that.parkMap.centerAndZoom(new BMap.Point(106.651444, 29.48682), 15);
  415. if (id == 1) {
  416. that.parkMap.centerAndZoom(new BMap.Point(106.651444, 29.45682), 14);
  417. } else if (id == 2) {
  418. that.parkMap.centerAndZoom(new BMap.Point(106.76723874457288, 29.573276880811712), 14);
  419. } else if (id == 3) {
  420. that.parkMap.centerAndZoom(new BMap.Point(106.69517131217539, 29.51577313312822), 15);
  421. } else if (id == 4) {
  422. that.parkMap.centerAndZoom(new BMap.Point(106.559829995157, 29.501581648208534), 15);
  423. } else if (id == 5) {
  424. that.parkMap.centerAndZoom(new BMap.Point(106.72194027111843, 29.513690776940248), 16);
  425. } else if (id == 6) {
  426. that.parkMap.centerAndZoom(new BMap.Point(106.70580793222035, 29.514020426917684), 16);
  427. } else {
  428. that.parkMap.centerAndZoom(new BMap.Point(106.651444, 29.48682), 14);
  429. }
  430. that.parkMap.setMapType(BMAP_NORMAL_MAP);
  431. if (!points.length) return;
  432. // let pointList = points.split('@');
  433. // let result = [];
  434. // pointList.forEach(function (point) {
  435. // let arr = point.split(',');
  436. // result.push(new BMap.Point(arr[0], arr[1]));
  437. // });
  438. // // 创建多边形
  439. // let polygon = new BMap.Polygon(result, {
  440. // strokeColor: "red",
  441. // strokeWeight: 4,
  442. // strokeOpacity: 1,
  443. // strokeStyle: "solid",
  444. // fillColor: "transparent",
  445. // fillOpacity: 0.3
  446. // });
  447. // // 将多边形添加到地图中
  448. // that.parkMap.addOverlay(polygon);
  449. console.log(points)
  450. points.forEach(function (d) {
  451. let pList = d.point.split('@');
  452. pList.forEach(function (point) {
  453. let arr = point.split(',');
  454. let p = new BMap.Point(arr[0], arr[1]);
  455. let marker = new BMap.Marker(p);
  456. var opts = {
  457. position: new BMap.Point(arr[0], arr[1]), // 指定文本标签所在的地理位置
  458. offset: new BMap.Size(10, 10) // 设置文本偏移量
  459. };
  460. // 创建文本标注对象
  461. var label = new BMap.Label(d.carrierName, opts);
  462. label.setStyle({
  463. color: "#186FF0",
  464. border: "0",
  465. padding: "0",
  466. display: "none",
  467. background: "transparent",
  468. fontWeight: 'bold',
  469. backgroundColor: 'transparent',
  470. textShadow: '0 0 4px #4B97F5',
  471. textStrokeColor: "#4B97F5", // 文本描边颜色
  472. textStrokeWidth: "4px", // 文本描边宽度
  473. fontSize: "18px",
  474. height: "20px",
  475. lineHeight: "20px",
  476. fontFamily: "微软雅黑"
  477. });
  478. marker.setLabel(label);
  479. marker.addEventListener("mouseover", function (e) {
  480. var label = this.getLabel()
  481. label.setStyle({ display: "block" });
  482. });
  483. marker.addEventListener("mouseout", function (e) {
  484. var label = this.getLabel()
  485. label.setStyle({ display: "none" });
  486. });
  487. that.parkMap.addOverlay(marker);
  488. marker.addEventListener('click', function () {
  489. var id = d.id;
  490. window.location.href = 'ztcrdetail.html?ztid=' + id;
  491. });
  492. });
  493. });
  494. },
  495. getParkData() {
  496. let that = this;
  497. that.pqList = [];
  498. that.pqList.push({
  499. id: -1,
  500. title: "全部"
  501. });
  502. $.ajax({
  503. url: conpath + "/parkData",
  504. type: "get",
  505. dataType: "json",
  506. success: function (data) {
  507. data.forEach(function (d) {
  508. that.pqList.push(d);
  509. });
  510. }
  511. });
  512. },
  513. getSellBuild() {
  514. let that = this;
  515. $.ajax({
  516. url: conpath + "/sellBuild",
  517. type: "post",
  518. contentType: 'application/json',
  519. data: JSON.stringify({
  520. "currentPage": 1,
  521. "pageSize": that.pageSize,
  522. "parkId": that.currentPq == -1 ? null : that.currentPq,
  523. "space1": that.currSpace == '-1' ? null : that.currSpace,
  524. "application": that.currUse == '全部' ? null : that.currUse
  525. }),
  526. dataType: "json",
  527. success: function (data) {
  528. let dataList = data.list;
  529. that.contentList = dataList;
  530. that.pointList = [];
  531. dataList.forEach(function (d) {
  532. // 添加选择地址
  533. if (!d.point) return;
  534. let pList = d.point.split('@');
  535. pList.forEach(function (point) {
  536. that.pointList.push(d);
  537. });
  538. });
  539. that.loadMap(that.pointList);
  540. }
  541. });
  542. },
  543. }
  544. })
  545. </script>
  546. </html>