|
@@ -12,6 +12,8 @@
|
|
|
<!-- 引入组件库 -->
|
|
|
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
|
|
|
<link rel="stylesheet" href="swiper/swiper-bundle.css">
|
|
|
+ <!-- jquery-->
|
|
|
+ <script src="js/jquery-3.5.1.min.js"></script>
|
|
|
<style>
|
|
|
* {
|
|
|
padding: 0;
|
|
@@ -204,12 +206,8 @@
|
|
|
<span>重庆市南岸区人民政府</span>
|
|
|
</div>
|
|
|
<ul class="menu">
|
|
|
- <li class="active">茶园工业园</li>
|
|
|
- <li>先进汽车电子产业园</li>
|
|
|
- <li>长江绿色创新产业园</li>
|
|
|
- <li>南坪西区产业园</li>
|
|
|
- <li>迎龙创新港</li>
|
|
|
- <li>大学科技园</li>
|
|
|
+ <li :class="{ active: currentTab == tab.id }" v-for="(tab, index) in this.titleList" :key="index">
|
|
|
+ {{tab.title}}</li>
|
|
|
</ul>
|
|
|
</div>
|
|
|
<div class="content">
|
|
@@ -241,6 +239,8 @@
|
|
|
el: '#indexcygyy',
|
|
|
data: function () {
|
|
|
return {
|
|
|
+ currentTab: -1,
|
|
|
+ titleList: [],
|
|
|
swiperList: [
|
|
|
{
|
|
|
bgsrc: "images/slide1.png",
|
|
@@ -272,6 +272,38 @@
|
|
|
cheakmore() {
|
|
|
window.location.href = "syyggyy.html"
|
|
|
},
|
|
|
+ getParkData() {
|
|
|
+ let that = this;
|
|
|
+ $.ajax({
|
|
|
+ url: "http://172.16.99.105:8082/parkData/",
|
|
|
+ type: "get",
|
|
|
+ dataType: "json",
|
|
|
+ success: function (data) {
|
|
|
+ data.forEach(function (item) {
|
|
|
+ item.subtitleList = item.subtitle ? item.subtitle.split(",") : [];
|
|
|
+ })
|
|
|
+ that.titleList = data;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getDetailData(id) {
|
|
|
+ let that = this;
|
|
|
+ $.ajax({
|
|
|
+ url: "http://172.16.99.105:8082/parkData/" + id,
|
|
|
+ type: "get",
|
|
|
+ dataType: "json",
|
|
|
+ success: function (data) {
|
|
|
+ console.log(data)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ const url = new URL(window.location.href);
|
|
|
+ const id = url.searchParams.get('id');
|
|
|
+ this.currentTab = id;
|
|
|
+ this.getDetailData(id);
|
|
|
+ this.getParkData();
|
|
|
}
|
|
|
});
|
|
|
|