123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>智能选址</title>
- <link rel="stylesheet" href="css/mapcon.css">
- <!-- 引入 Vue -->
- <script src="js/vue.min.js"></script>
- <!-- 引入样式 -->
- <link rel="stylesheet" href="css/index.css">
- <!-- 引入组件库 -->
- <script src="js/index.js"></script>
- <script type="text/javascript"
- src="https://api.map.baidu.com/api?v=2.0&ak=7XivTux4H2e1ifKLjvEhxfuayDYxAluq"></script>
- <!-- jquery-->
- <script src="js/jquery-3.5.1.min.js"></script>
- <script src="js/urljson.js"></script>
- <style>
- .contentleft {
- width: 50%;
- min-width: 841px;
- background-color: #EDF5FF;
- font-size: 20px;
- color: #333;
- padding: 15px 30px;
- box-sizing: border-box;
- }
- .choseButton {
- width: 223px;
- height: 69px;
- background: #4B98F6;
- border-radius: 10px;
- text-align: center;
- line-height: 69px;
- color: #FFFFFF;
- cursor: pointer;
- margin-right: 20px;
- }
- .content {
- width: 100%;
- margin: auto;
- background: #FFFFFF;
- padding: 10px 20px;
- box-sizing: border-box;
- margin-top: 25px;
- }
- .contentleft>.content {
- width: 100%;
- height: 1000px;
- overflow-y: scroll;
- }
- .contentleft>.content::-webkit-scrollbar {
- width: 0px;
- height: 0px;
- }
- #znxz>.top {
- display: flex;
- justify-content: space-between;
- align-items: center;
- border-bottom: 1px solid #B7C7DC;
- background: #FFFFFF;
- }
- .typetitle {
- margin: 10px auto;
- }
- .fwhy {
- display: flex;
- flex-wrap: wrap;
- }
- .fwhy .list {
- width: 199px;
- height: 52px;
- line-height: 52px;
- text-align: center;
- background: #DEEDFF;
- border-radius: 10px;
- border: 1px solid #4B98F6;
- font-size: 20px;
- color: #4B98F6;
- margin-left: 10px;
- margin-bottom: 19px;
- cursor: pointer;
- word-break: break-all;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- }
- .fwhy .list.active {
- background: #4B98F6;
- color: #FFFFFF;
- }
- </style>
- </head>
- <body>
- <div style="width:100%;height:570px" class="header"></div>
- <div id="znxz">
- <div class="top">
- <div class="toplogo">
- <img src="images/gyylogo.png" alt="">
- <span>智能选址</span>
- </div>
- <div class="backbutton" @click="window.history.go(-1)">
- <img src="images/back1.png" alt="">
- <span>返回</span>
- </div>
- </div>
- <div style="display: flex;">
- <div class="contentleft" id="">
- <div style="color: #4B98F6;">我们将根据您的条件为您推荐最合适的企业选址</div>
- <div class="content" style="position: relative;">
- <div v-show="currtype==1">
- <div class="typetitle">1.请选择您的服务行业</div>
- <div class="fwhy" id="fwhy">
- <div class="list" :class="getClassfwhy(item.name)" :key="index"
- v-for="(item,index) in fwhyList" :data-tab-target="item.name">{{item.name}}</div>
- <div class="list fwhybx" data-tab-target="不限">不限</div>
- </div>
- </div>
- <div v-show="currtype==2">
- <div class="typetitle">2.请选择您的载体类型</div>
- <div class="fwhy" id="ztlx">
- <div class="list" :class="getClassztlx(item)" :key="index" v-for="(item,index) in ztlxList"
- :data-tab-target="item">{{item}}</div>
- <div class="list ztlxbx" data-tab-target="不限">不限</div>
- </div>
- </div>
- <div v-show="currtype==3">
- <div class="typetitle">3.请选择您的租赁情况</div>
- <div class="fwhy" id="zlqk">
- <div class="list" :class="getClasszlqk(item.name)" :key="index"
- v-for="(item,index) in zlqklist" :data-tab-target="item.name">{{item.name}}</div>
- <div class="list zlqkbx" data-tab-target="不限">不限</div>
- </div>
- </div>
- <div v-show="currtype==4">
- <div class="typetitle">4.请选择您的所属园区</div>
- <div class="fwhy" id="ssyq">
- <div class="list" :class="getClassssyq(item.title)" :key="index"
- v-for="(item,index) in titleList" :data-tab-target="item.id" :data-title="item.title"
- :title="item.title">
- {{item.title}}</div>
- <div class="list ssyqbx" data-tab-target="不限" data-title="不限">不限</div>
- </div>
- </div>
- <div style="display: flex;margin-top: 100px;position: absolute;top: 300px;left: 25px;">
- <div class="choseButton" style="color: #4B98F6;background: #FFFFFF;border: 2px solid #4B98F6;"
- @click="newChoice">
- 重新选择</div>
- <div class="choseButton" style="
- box-shadow: 0px 13px 9px 0px rgba(24,111,240,0.31);" @click="currtype=currtype-1"
- v-if="currtype!=1">上一步</div>
- <div class="choseButton" style="
- box-shadow: 0px 13px 9px 0px rgba(24,111,240,0.31);" @click="nextChoice">下一步
- </div>
- </div>
- </div>
- </div>
- <div class="contentright" id="mapcontainer"></div>
- </div>
- </div>
- <div style="width:100%;" class="footer"></div>
- </body>
- <script>
- $(function () {
- /*公共部分
- * 导航栏
- * footer CopyRight
- */
- $(".header").load('https://www.cqna.gov.cn/ggbf_search/top/top_style.html');
- $(".footer").load('https://www.cqna.gov.cn/ggbf_search/ggyr/2022foot/bottomBlack.html');
- });
- </script>
- <script>
- var nowDiv = new Vue({
- el: '#znxz',
- data: function () {
- return {
- reqPtah: '',
- currtype: 1,
- currfwhy: '',
- currztlx: '',
- currzlqk: '',
- currssyq: '',
- currssyqtitle: '',
- fwhyList: [
- {
- id: 1,
- name: "软信服务业"
- },
- {
- id: 2,
- name: "工业用地"
- },
- {
- id: 3,
- name: "制造业"
- },
- {
- id: 4,
- name: "商业"
- },
- {
- id: 5,
- name: "商贸流通业"
- },
- {
- id: 6,
- name: "医药流通"
- },
- {
- id: 7,
- name: "电子信息"
- },
- {
- id: 8,
- name: "医疗器械"
- }
- ],
- ztlxList: [],
- zlqklist: [
- {
- id: 1,
- name: '租赁'
- },
- {
- id: 2,
- name: '出让'
- }
- ],
- titleList: [
- ],
- }
- },
- computed: {
- getClasses() {
- return this.getClassfwhy();
- return this.getClassztlx();
- return this.getClasszlqk();
- return this.getClassssyq();
- }
- },
- methods: {
- backIndex() {
- window.history.go(-1)
- },
- getParkData() {
- let that = this;
- $.ajax({
- url: conpath + "/parkData/",
- type: "get",
- dataType: "json",
- async: false,
- success: function (data) {
- that.titleList = data;
- }
- })
- },
- newChoice() {
- this.currtype = 1;
- },
- nextChoice() {
- var znxz = {
- "productModule": this.currfwhy,
- "application": this.currztlx,
- "rent": this.currzlqk,
- "belong": this.currssyq,
- "currentPage": 1,
- "pageSize": 100000
- }
- if (this.currtype == 4) {
- var selectTabs = '';
- if (this.currfwhy && this.currfwhy != "不限") {
- selectTabs = this.currfwhy
- }
- if (this.currztlx && this.currztlx != "不限") {
- if (selectTabs) {
- selectTabs = selectTabs + ',' + this.currztlx
- } else {
- selectTabs = this.currztlx;
- }
- }
- if (this.currzlqk && this.currzlqk != "不限") {
- if (selectTabs) {
- selectTabs = selectTabs + ',' + this.currzlqk
- } else {
- selectTabs = this.currzlqk;
- }
- }
- if (this.currssyq && this.currssyq != "不限") {
- if (selectTabs) {
- selectTabs = selectTabs + ',' + this.currssyqtitle
- } else {
- selectTabs = this.currssyqtitle;
- }
- }
- const znxzString = JSON.stringify(znxz);
- sessionStorage.setItem('znxztabs', selectTabs);
- sessionStorage.setItem('znxz', znxzString);
- window.location.href = "znxz.html"
- } else {
- var znxz = {
- "productModule": this.currfwhy,
- "application": this.currztlx,
- "rent": this.currzlqk,
- "belong": this.currssyq
- }
- this.getListData(znxz);
- this.currtype = this.currtype + 1;
- }
- },
- getListData(json) {
- let that = this;
- let dataList;
- that.getParkData();
- $.ajax({
- url: conpath + "/sellBuild/newQueryOne",
- type: "post",
- contentType: 'application/json',
- data: JSON.stringify(json),
- dataType: "json",
- async: false,
- success: function (data) {
- that.ztlxList = data.data.applications;
- var alltitle = that.titleList;
- var parkdata = data.data.parkId;
- var nowtitle = [];
- for (var i = 0; i < alltitle.length; i++) {
- for (var j = 0; j < parkdata.length; j++) {
- if (alltitle[i].id == parkdata[j]) {
- nowtitle.push(alltitle[i]);
- }
- }
- }
- that.titleList = nowtitle;
- }
- });
- return dataList;
- },
- getClassfwhy(name) {
- var flag = false;
- if (this.currfwhy) {
- var currfwhy = this.currfwhy.split(',');
- for (var i = 0; i < currfwhy; i++) {
- if (currfwhy[i] == name) {
- flag = true;
- }
- }
- }
- return flag ? 'active' : '';
- },
- getClassztlx(name) {
- var flag = false;
- if (this.currztlx) {
- var currztlx = this.currztlx.split(',');
- for (var i = 0; i < currztlx; i++) {
- if (currztlx[i] == name) {
- flag = true;
- }
- }
- }
- return flag ? 'active' : '';
- },
- getClassssyq(name) {
- var flag = false;
- if (this.currssyqtitle) {
- var currssyqtitle = this.currssyqtitle.split(',');
- for (var i = 0; i < currssyqtitle; i++) {
- if (currssyqtitle[i] == name) {
- flag = true;
- }
- }
- }
- return flag ? 'active' : '';
- },
- getClasszlqk(name) {
- var flag = false;
- if (this.currzlqk) {
- var currzlqk = this.currzlqk.split(',');
- for (var i = 0; i < currzlqk; i++) {
- if (currzlqk[i] == name) {
- flag = true;
- }
- }
- }
- return flag ? 'active' : '';
- },
- loadMap(points) {
- let that = this;
- that.parkMap = new BMap.Map("mapcontainer");
- that.parkMap.enableScrollWheelZoom();// 启用滚轮缩放
- that.parkMap.enableDragging(); // 启用拖拽功能
- const addr = new URL(window.location.href);
- const id = addr.searchParams.get('id');
- // 设定中心点和地图级别
- if (id == 1) {
- that.parkMap.centerAndZoom(new BMap.Point(106.651444, 29.45682), 14);
- } else if (id == 2) {
- that.parkMap.centerAndZoom(new BMap.Point(106.76723874457288, 29.573276880811712), 14);
- } else if (id == 3) {
- that.parkMap.centerAndZoom(new BMap.Point(106.69517131217539, 29.51577313312822), 15);
- } else if (id == 4) {
- that.parkMap.centerAndZoom(new BMap.Point(106.559829995157, 29.501581648208534), 15);
- } else if (id == 5) {
- that.parkMap.centerAndZoom(new BMap.Point(106.72194027111843, 29.513690776940248), 16);
- } else if (id == 6) {
- that.parkMap.centerAndZoom(new BMap.Point(106.70580793222035, 29.514020426917684), 16);
- } else {
- that.parkMap.centerAndZoom(new BMap.Point(106.651444, 29.48682), 14);
- }
- that.parkMap.setMapType(BMAP_NORMAL_MAP);
- if (!points) return;
- let pointList = points.split('@');
- let result = [];
- pointList.forEach(function (point) {
- let arr = point.split(',');
- result.push(new BMap.Point(arr[0], arr[1]));
- });
- // 创建多边形
- let polygon = new BMap.Polygon(result, {
- strokeColor: "blue",
- strokeWeight: 4,
- strokeOpacity: 0.5,
- strokeStyle: "solid",
- fillColor: "#4B98F6",
- fillOpacity: 0.3
- });
- // 将多边形添加到地图中
- that.parkMap.addOverlay(polygon);
- // pointList.forEach(function (point) {
- // let arr = point.split(',');
- // let p = new BMap.Point(arr[0], arr[1]);
- // let marker = new BMap.Marker(p);
- // that.parkMap.addOverlay(marker);
- // });
- }
- },
- mounted() {
- }
- })
- </script>
- <script type="text/javascript" src="js/rightmap.js"></script>
- <script>
- var that = this;
- document.addEventListener('DOMContentLoaded', function () {
- //获取服务类型tab
- var tabsContainer = document.getElementById('fwhy');
- var fwhyselectedTabs = []; // 用于存储选中的Tab
- tabsContainer.addEventListener('click', function (event) {
- if (event.target.matches('.list')) {
- var tabTarget = event.target.getAttribute('data-tab-target');
- if (fwhyselectedTabs.includes(tabTarget) && tabTarget != "不限") {
- // 移除已选中的Tab
- fwhyselectedTabs = fwhyselectedTabs.filter(function (selectedTab) {
- return selectedTab !== tabTarget;
- });
- event.target.classList.remove('active');
- }
- else {
- // 添加新选中的Tab
- fwhyselectedTabs.push(tabTarget);
- if (tabTarget != "不限") {
- event.target.classList.add('active');
- $('#fwhy .fwhybx').removeClass('active');
- } else {
- $('#fwhy .list').removeClass('active')
- event.target.classList.add('active');
- fwhyselectedTabs = ['不限']
- }
- }
- // 更新界面以反映当前选中的Tab
- // 输出选中的Tab数组
- if (fwhyselectedTabs[0] == "不限") {
- fwhyselectedTabs = [];
- that.nowDiv.currfwhy = '';
- } else {
- that.nowDiv.currfwhy = fwhyselectedTabs.join(',');
- }
- }
- });
- //获取载体类型tab
- var tabsContainerztlx = document.getElementById('ztlx');
- var ztlxselectedTabs = [];
- tabsContainerztlx.addEventListener('click', function (event) {
- if (event.target.matches('.list')) {
- var tabTarget = event.target.getAttribute('data-tab-target');
- if (ztlxselectedTabs.includes(tabTarget) && tabTarget != "不限") {
- ztlxselectedTabs = ztlxselectedTabs.filter(function (selectedTab) {
- return selectedTab !== tabTarget;
- });
- event.target.classList.remove('active');
- } else {
- ztlxselectedTabs.push(tabTarget);
- if (tabTarget != "不限") {
- event.target.classList.add('active');
- $('#ztlx .ztlxbx').removeClass('active');
- } else {
- $('#ztlx .list').removeClass('active')
- event.target.classList.add('active');
- ztlxselectedTabs = ['不限']
- }
- }
- if (ztlxselectedTabs[0] == "不限") {
- ztlxselectedTabs = [];
- that.nowDiv.currztlx = '';
- } else {
- that.nowDiv.currztlx = ztlxselectedTabs.join(',');
- }
- }
- });
- //获取租赁类型tab
- var tabsContainerzlqk = document.getElementById('zlqk');
- var zlqkselectedTabs = [];
- tabsContainerzlqk.addEventListener('click', function (event) {
- if (event.target.matches('.list')) {
- var tabTarget = event.target.getAttribute('data-tab-target');
- if (zlqkselectedTabs.includes(tabTarget) && tabTarget != "不限") {
- zlqkselectedTabs = zlqkselectedTabs.filter(function (selectedTab) {
- return selectedTab !== tabTarget;
- });
- event.target.classList.remove('active');
- } else {
- zlqkselectedTabs.push(tabTarget);
- if (tabTarget != "不限") {
- event.target.classList.add('active');
- $('#zlqk .zlqkbx').removeClass('active');
- } else {
- $('#zlqk .list').removeClass('active')
- event.target.classList.add('active');
- zlqkselectedTabs = ['不限']
- }
- }
- if (zlqkselectedTabs[0] == "不限") {
- zlqkselectedTabs = [];
- that.nowDiv.currzlqk = '';
- } else {
- that.nowDiv.currzlqk = zlqkselectedTabs.join(',');
- }
- }
- });
- //获取所属园区tab
- var tabsContainerssyq = document.getElementById('ssyq');
- var ssyqselectedTabs = [];
- var ssyqtitle = [];
- tabsContainerssyq.addEventListener('click', function (event) {
- if (event.target.matches('.list')) {
- var tabTarget = event.target.getAttribute('data-tab-target');
- var titleTarget = event.target.getAttribute('data-title');
- if (ssyqselectedTabs.includes(tabTarget) && tabTarget != "不限") {
- ssyqselectedTabs = ssyqselectedTabs.filter(function (selectedTab) {
- return selectedTab !== tabTarget;
- });
- event.target.classList.remove('active');
- } else {
- ssyqselectedTabs.push(tabTarget);
- ssyqtitle.push(titleTarget);
- if (tabTarget != "不限") {
- event.target.classList.add('active');
- $('#ssyq .ssyqbx').removeClass('active');
- } else {
- $('#ssyq .list').removeClass('active')
- event.target.classList.add('active');
- ssyqselectedTabs = ['不限']
- ssyqtitle = ['不限'];
- }
- }
- if (ssyqselectedTabs[0] == "不限") {
- ssyqselectedTabs = [];
- that.nowDiv.currssyq = '';
- that.nowDiv.currssyqtitle = '';
- } else {
- that.nowDiv.currssyq = ssyqselectedTabs.join(',');
- that.nowDiv.currssyqtitle = ssyqtitle.join(',');
- }
- }
- });
- });
- </script>
- </html>
|