提交 9fdd7a96 authored 作者: lihuihui's avatar lihuihui

update

上级 c556bad4
...@@ -5,17 +5,12 @@ export function getUser() { ...@@ -5,17 +5,12 @@ export function getUser() {
return httpRequest.get('/api/passport/account/get-user-info') return httpRequest.get('/api/passport/account/get-user-info')
} }
// 获取首页信息 // 获取消息列表
export function getHomeInfo(params) { export function getList(params) {
return httpRequest.get('/api/road/v1/frontend/index/index', { params }) return httpRequest.get('/api/road/v1/frontend/index/messages', { params })
}
// 获取页面列表
export function getPageList(params) {
return httpRequest.get('/api/road/v1/frontend/index/page-view', { params })
} }
// 获取列表详情 // 获取列表详情
export function getDocDetails(params) { export function getDocDetails(params) {
return httpRequest.get('/api/road/v1/frontend/index/doc-view', { params }) return httpRequest.get('/api/road/v1/frontend/index/message-view', { params })
} }
...@@ -2,6 +2,11 @@ const routes = [ ...@@ -2,6 +2,11 @@ const routes = [
{ {
path: '/message', path: '/message',
component: () => import('./views/Index.vue') component: () => import('./views/Index.vue')
},
// 详情页
{
path: '/message/details',
component: () => import('./views/Details.vue')
} }
] ]
......
<template>
<div class="main">
<HeadBack title="详情"></HeadBack>
<div class="main_content">
<div class="show_content">
<div class="show_content_img" v-html="data.content"></div>
</div>
</div>
</div>
</template>
<script>
import { getDocDetails } from '../api'
import HeadBack from '@/components/HeadBack.vue'
export default {
components: {
HeadBack
},
data() {
return {
data: {}
}
},
methods: {
getDocDetails() {
getDocDetails({ id: this.$route.query.id }).then(res => {
this.data = res.data
})
}
},
mounted() {
this.getDocDetails()
}
}
</script>
<style lang="scss" scoped>
.main {
.main_content {
padding: 1.2rem 0.32rem;
.show_content {
.show_content_img {
// width: 6.9rem;
::v-deep {
p {
font-size: 0.24rem;
}
}
}
}
}
}
::v-deep {
.show_content_img p img {
// width: 6.9rem;
// height: 100%;
width: 100%;
margin: 0 auto;
// border-radius: 0.1rem;
}
}
</style>
...@@ -8,16 +8,10 @@ ...@@ -8,16 +8,10 @@
</div> </div>
</div> </div>
<div class="msg-list"> <div class="msg-list">
<div class="item-card"> <div @click="goPage(item)" class="item-card" v-for="(item, index) in msg.list" :key="index">
<div class="title">矩形顶管机掘进技术交流会</div> <div class="title">{{ item.title }}</div>
<div class="desc"> <div class="desc">
2022年8月4日“矩形顶管机掘进技术交流会”在北京市轨道交通昌平线南延工程土建施工06合同段上清桥站项目部举办。 {{ item.remark }}
</div>
</div>
<div class="item-card">
<div class="title">矩形顶管机掘进技术交流会</div>
<div class="desc">
2022年8月4日“矩形顶管机掘进技术交流会”在北京市轨道交通昌平线南延工程土建施工06合同段上清桥站项目部举办。
</div> </div>
</div> </div>
</div> </div>
...@@ -27,10 +21,34 @@ ...@@ -27,10 +21,34 @@
</template> </template>
<script> <script>
import { getList } from '../api'
import Foot from '@/components/Foot.vue' import Foot from '@/components/Foot.vue'
export default { export default {
components: { components: {
Foot Foot
},
data() {
return {
msg: {}
}
},
methods: {
goPage(item) {
if (item.url !== '') {
window.location.href = item.url
} else {
console.log(111)
this.$router.push({
path: '/message/details',
query: { id: item.id }
})
}
}
},
mounted() {
getList().then(res => {
this.msg = res.data
})
} }
} }
</script> </script>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论