前端补正

This commit is contained in:
xvv 2024-07-29 16:15:31 +08:00
parent b5a4a41b99
commit 1c5c9b9811
5 changed files with 59 additions and 34 deletions

View File

@ -8,7 +8,7 @@ export function getTab(query) {
params: query params: query
}) })
} }
// 获取一级
export function getbanner(data) { export function getbanner(data) {
return request({ return request({
url: '/api/category', url: '/api/category',
@ -16,6 +16,14 @@ export function getbanner(data) {
data data
}) })
} }
// 获取二级内容
export function getinfo(data) {
return request({
url: '/api/category/content',
method: 'post',
data
})
}
export function getBaseInfo(){ export function getBaseInfo(){
return request({ return request({

View File

@ -339,7 +339,7 @@ export default {
} }
}, },
mounted() { mounted() {
console.log(this.$route.params.id) console.log(this.$route.query.id)
// //
this.tabLsit(); this.tabLsit();
this.getWebBaseInfo() this.getWebBaseInfo()

View File

@ -61,10 +61,9 @@ export default {
methods:{ methods:{
tabClick(url,id){ tabClick(url,id){
console.log(url,id) console.log(url,id)
this.$router.push({ this.$router.push({
name: url, name: url,
params:{ id: id } query:{ id: id }
}); });
}, },

View File

@ -11,7 +11,7 @@
<div class="navigation"> <div class="navigation">
<div class="content"> <div class="content">
<div class="left"> <img src="../../assets/gw/home.png" alt=""> <div class="left"> <img src="../../assets/gw/home.png" alt="">
<p><span href="/">首页</span><i class="el-icon-arrow-right"></i> <span href="">中心简介</span></p> <p><span href="/">首页</span><i class="el-icon-arrow-right"></i> <span href="">合作企业</span></p>
</div> </div>
</div> </div>
@ -41,6 +41,7 @@ import { Swiper, SwiperSlide } from "vue-awesome-swiper";
import "swiper/css/swiper.min.css"; import "swiper/css/swiper.min.css";
import headers from '@/views/officialWebsite/Components/header.vue' import headers from '@/views/officialWebsite/Components/header.vue'
import footers from '@/views/officialWebsite/Components/footer.vue' import footers from '@/views/officialWebsite/Components/footer.vue'
import {getTab, getbanner, getinfo} from "@/api/gw/home";
export default { export default {
components: { components: {
Swiper, Swiper,
@ -81,8 +82,25 @@ export default {
computed: { computed: {
}, },
mounted() {
console.log(this.$route.query.id)
this.getInfo()
},
methods: { methods: {
getInfo() {
let data = {
categoryId: this.$route.query.id,
pageNum:1,
pageSize:10
}
getbanner(data).then(res => {
console.log(res)
})
},
// //
getCurrentActive(value) { getCurrentActive(value) {
if (this.currentActive == value) { if (this.currentActive == value) {

View File

@ -2,42 +2,25 @@
<div class="container"> <div class="container">
<div class="top-box"> <div class="top-box">
<headers></headers> <headers></headers>
<div class="ny-banner"> <div class="ny-banner">
<img src="../../assets/gw/ny-banner.jpg" alt=""> <img src="../../assets/gw/ny-banner.jpg" alt="">
</div> </div>
</div> </div>
<div class="navigation"> <div class="navigation">
<div class="content"> <div class="content">
<div class="left"> <img src="../../assets/gw/home.png" alt=""> <div class="left"> <img src="../../assets/gw/home.png" alt="">
<p><span href="/">首页</span><i class="el-icon-arrow-right"></i> <span href="">中心简介</span></p> <p><span href="/">首页</span><i class="el-icon-arrow-right"></i> <span href="">联系我们</span></p>
</div> </div>
</div> </div>
</div> </div>
<div class="contact"> <div class="contact">
<div class="info"> <div class="info">
<div class="info-item"> <div class="info-item" v-for="(item,index) in fourlist" :key="index">
<img src="../../assets/gw/Group780.png" alt=""> <img :src=" imgurl + item.contentImg " alt="">
<div class="p">中心地址</div> <div class="p">{{item.contentTitle}}</div>
<div class="desc">黑龙江省哈尔滨市南岗区西大直街92号</div> <div class="desc" v-html="item.contentDetail"></div>
</div>
<div class="info-item">
<img src="../../assets/gw/Group783.png" alt="">
<div class="p">电话</div>
<div class="desc">0451-86686666</div>
</div>
<div class="info-item">
<img src="../../assets/gw/Group781.png" alt="">
<div class="p">邮箱</div>
<div class="desc">186841613@QQ.COM</div>
</div>
<div class="info-item">
<img src="../../assets/gw/Group782.png" alt="">
<div class="p">传真</div>
<div class="desc">0451-86686666</div>
</div> </div>
</div> </div>
<div class="map"> <div class="map">
<img src="../../assets/gw/Snipaste_2024-07-24_22-28-43.jpg" alt=""> <img src="../../assets/gw/Snipaste_2024-07-24_22-28-43.jpg" alt="">
@ -48,6 +31,7 @@
</template> </template>
<script> <script>
import {getTab, getbanner, getinfo} from "@/api/gw/home";
import { Swiper, SwiperSlide } from "vue-awesome-swiper"; import { Swiper, SwiperSlide } from "vue-awesome-swiper";
import "swiper/css/swiper.min.css"; import "swiper/css/swiper.min.css";
import footers from '@/views/officialWebsite/Components/footer.vue' import footers from '@/views/officialWebsite/Components/footer.vue'
@ -65,6 +49,7 @@ export default {
}, },
data() { data() {
return { return {
imgurl:process.env.VUE_APP_BASE_API,
tablist: [ tablist: [
{ name: '首页' }, { name: '首页' },
{ name: '中心概括' }, { name: '中心概括' },
@ -79,21 +64,36 @@ export default {
{ name: '合作企业' }, { name: '合作企业' },
{ name: '联系我们' }, { name: '联系我们' },
], ],
nav: [ nav: [
{ name: '教学团队' }, { name: '教学团队' },
{ name: '教学成果' }, { name: '教学成果' },
], ],
fourlist:[],
currentActive: 0, currentActive: 0,
isMounted: false, isMounted: false,
} }
}, },
computed: { computed: {
}, },
mounted() {
console.log(this.$route.query.id)
this.getInfo()
},
methods: { methods: {
getInfo() {
let data = {
categoryId: this.$route.query.id,
pageNum:1,
pageSize:10
}
getbanner(data).then(res => {
console.log(res.data[0].children.list)
this.fourlist = res.data[0].children.list
})
},
// //
getCurrentActive(value) { getCurrentActive(value) {
if (this.currentActive == value) { if (this.currentActive == value) {
@ -348,7 +348,7 @@ export default {
font-size: 14px; font-size: 14px;
color: #999999; color: #999999;
margin-top: 20px; margin-top: 20px;
margin-bottom: 20px;
} }
.contact .info .info-item .desc { .contact .info .info-item .desc {