104 lines
1.8 KiB
Vue
104 lines
1.8 KiB
Vue
<template lang="pug">
|
|
.news
|
|
top
|
|
.news-content
|
|
.news-title {{NewsList.title}}
|
|
.news-date
|
|
span {{NewsList.create_time}}
|
|
span {{NewsList.viewer_count}}
|
|
|
|
div(v-html="NewsList.content" :class="isMore ? 'news-body' : ''")
|
|
|
|
.show( @click="isMore = !isMore" v-if="isMore")
|
|
img(src='/static/img/select-down.png' class='select')
|
|
button 打开APP阅读全文
|
|
recommend(:relevant="relevant",:vertical="vertical")
|
|
comment
|
|
</template>
|
|
<script>
|
|
export default {
|
|
data() {
|
|
return {
|
|
isMore: true,
|
|
NewsList: [],
|
|
relevant: [],
|
|
vertical:true
|
|
}
|
|
},
|
|
created () {
|
|
this.getVideoDetail()
|
|
},
|
|
methods: {
|
|
async getVideoDetail () {
|
|
let res = await this.$http.index.newsDetail({
|
|
id: "461"
|
|
})
|
|
this.NewsList = res.detail
|
|
this.relevant = res.recommend
|
|
console.log(res)
|
|
}
|
|
},
|
|
}
|
|
</script>
|
|
|
|
<style scoped lang="less">
|
|
.news-content {
|
|
padding-left: 23rpx;
|
|
padding-right: 25rpx;
|
|
|
|
.news-title {
|
|
font-size: 40rpx;
|
|
margin-bottom: 38rpx;
|
|
}
|
|
|
|
.news-date {
|
|
font-size: 24rpx;
|
|
|
|
span {
|
|
margin-left: 22rpx;
|
|
color: #999999;
|
|
}
|
|
}
|
|
|
|
.news-body {
|
|
height: 1131rpx;
|
|
margin-top: 38rpx;
|
|
font-size: 32rpx;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.show {
|
|
//position: relative;
|
|
display: block;
|
|
margin-top: 22rpx;
|
|
text-align: center;
|
|
|
|
.select {
|
|
width: 52rpx;
|
|
}
|
|
|
|
.back {
|
|
position: absolute;
|
|
top: 0;
|
|
left: 350rpx;
|
|
z-index: -1;
|
|
opacity: 0.5;
|
|
width: 52rpx;
|
|
height: 40rpx;
|
|
}
|
|
|
|
button {
|
|
width: 702rpx;
|
|
height: 88rpx;
|
|
background-color: #d0302c;
|
|
border-radius: 8rpx;
|
|
font-size: 28rpx;
|
|
color: #ffffff;
|
|
border: none;
|
|
}
|
|
}
|
|
|
|
}
|
|
</style>
|
|
|