Files
web_huangguo2_admin/src/components/PostDetailView/index.vue
T
2026-09-29 16:54:06 +08:00

374 lines
7.9 KiB
Vue

<template>
<el-dialog
:visible.sync="Visible"
@close="close"
center
class="ac-dialog"
width="390px">
<div class="itemData-main">
<header class="header">
<div class="title">{{ itemData.title }}</div>
<div class="info">
<a>{{ itemData.creatorName }} •</a>
{{ itemData.addedTime | BeiJingTime }}
<span v-for="(item, index) in itemData.categoryIds" :key="item">{{ item |
changeCategoryName(videoCategoryList)
}} <span v-if="index !== itemData.categoryIds.length - 1">•</span> </span>
</div>
</header>
<div class="postContent">
<div class="postBox" v-for="(item, index) in itemData.nodes" :key="index">
<p class="postTitle">{{ item.title }}</p>
<ShowImg v-for="(img, imgINdex) in item.images" :key="imgINdex" :urls="img" />
<span class="postText">{{ item.text }}</span>
</div>
</div>
<DPlayer
ref="player"
class="dplayerBox"
v-if="itemData.video && itemData.video.url"
:video="{
url: '/api/web/m3u8/' + filterM3u8(itemData.video.url),
type: 'hls',
pic: '',
}"
hotkey></DPlayer>
<div class="keywords">
关键词:
<span v-for="(keyName,keyIndex) in itemData.keyworld" :key="keyIndex">#{{keyName}} </span>
</div>
<div class="tagBox">
<p class="tagList" v-for="(tag,tagIndex) in itemData.tags" :key="tagIndex">
<span class="tagItem">{{tag | changeCategoryName(videoTagList)}}</span>
</p>
</div>
</div>
</el-dialog>
</template>
<script>
import ShowImg from '@/components/ShowImg/index.vue'
import DPlayer from '@/components/VueDplayerHls/index.vue'
export default {
props: ['itemData', 'videoCategoryList', 'videoTagList'],
components: {
ShowImg,
DPlayer
},
data() {
return {
Visible: true
}
},
async mounted() {
},
filters: {
changeCategoryName(v, list) {
let arr = []
if (v) {
arr = list.filter(item => {
return item.id === v
})
if (arr[0]) {
return arr[0].name
}
}
}
},
computed: {
},
methods: {
filterM3u8(v) {
return /\.m3u8/g.test(v) ? v : v + '.m3u8'
},
// 关闭编辑
close() {
this.$emit('close', false)
}
}
}
</script>
<style lang='scss' scoped>
.ac-dialog{
overflow: hidden;
::v-deep{
.el-dialog{
margin-top: 10px !important;
}
}
}
.itemData-main {
/* rem适配基础设置 */
font-size: 16px;
/* 基准字体大小 */
background: #000;
color: #fff;
height: 844px;
overflow-y: scroll;
padding: 10px;
a,
a:link,
a:visited,
a:hover,
a:active {
text-decoration: none;
color: inherit;
}
.topBox {
display: flex;
align-items: center;
justify-content: space-between;
padding: 8px 16px;
background: #212121;
position: fixed;
top: 0;
left: 0;
width: 100%;
z-index: 99;
/* display: none; */
}
.navBtn {
width: 51px;
height: 24px;
display: flex;
align-items: center;
justify-content: center;
font-size: 10px;
color: #E0E0E0;
border-radius: 6px;
background: rgba(255, 255, 255, 0.10);
}
.navBtn .moreIcon {
width: 16px;
height: 16px;
margin-right: 3px;
}
.logo {
width: 94px;
height: 32px;
}
.searchIcon {
width: 24px;
height: 24px;
margin-left: 27px;
}
.header {
width: 100%;
/* height: 159px; */
background: #212121;
padding: 12px 16px;
box-sizing: border-box;
margin-bottom: 20px;
}
.header .title {
text-align: center;
color: #BDBDBD;
font-size: 26px;
line-height: 32px;
margin-bottom: 14px;
}
.header .info {
font-size: 14px;
line-height: 20px;
color: rgba(255, 255, 255, 0.70);
display: flex;
align-items: center;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3;
text-overflow: ellipsis;
overflow: hidden;
}
.header .info a {
text-decoration-line: underline;
}
.main .lineBox {
padding: 0 16px;
box-sizing: border-box;
}
.main .lineBox .line {
width: 100%;
height: 1px;
background: rgba(255, 255, 255, 0.10);
margin: 18px 0;
}
.postContent {
margin: 36px 0 0;
}
.postBox {
color: #FAFAFA;
/* margin-bottom: 18px; */
}
.postTitle {
font-size: 24px;
font-weight: 600;
line-height: 32px;
margin-bottom: 28px;
padding: 0 16px;
box-sizing: border-box;
}
.postText {
color: #FAFAFA;
margin: 0 16px 36px;
font-size: 16px;
line-height: 22px;
}
.postimage {
width: 100%;
height: auto;
margin-bottom: 18px;
/* margin-bottom: 47px; */
}
.postDesc {
font-size: 16px;
color: #FAFAFA;
line-height: 22px;
padding: 0 16px;
box-sizing: border-box;
margin-bottom: 19px;
}
.postDesc span {
font-weight: 600;
}
.postLine {
margin: 0 16px;
border-bottom: 1px dashed rgba(255, 255, 255, 0.50);
}
.tagBox {
margin-bottom: 12px;
padding: 0 16px;
}
.tagBox .tagList {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 7px;
margin-bottom: 18px;
}
.tagBox .tagList .tagItem {
padding: 8px 16px;
box-sizing: border-box;
border-radius: 62px;
background: rgba(255, 255, 255, 0.05);
display: flex;
align-items: center;
justify-content: center;
font-size: 12px;
color: #BDBDBD;
}
.lastDay {
text-align: right;
color: #BDBDBD;
line-height: 20px;
font-size: 14px;
}
.copyBox {
color: #FFF;
text-align: center;
text-shadow: 0 0 20px #FF8400, 0 0 20px #FF8400;
font-family: "PingFang SC";
font-size: 20px;
font-style: normal;
font-weight: 500;
line-height: 28px;
/* 140% */
padding: 18px;
box-sizing: border-box;
margin-bottom: 18px;
}
.copySuccess {
color: #FFF;
text-align: center;
text-shadow: 0 0 20px #FF00B2, 0 0 20px #FF00B2;
font-family: "PingFang SC";
font-size: 20px;
font-style: normal;
font-weight: 500;
line-height: 28px;
/* 140% */
padding: 18px;
box-sizing: border-box;
margin-bottom: 18px;
}
.dplayerBox {
margin-bottom: 18px;
max-height: 300px;
}
.gridAdvBox {
margin: 0 16px 18px;
}
.gridAdvBox .gridAdvTitle {
padding: 0 16px;
box-sizing: border-box;
height: 49px;
display: flex;
align-items: center;
border-top: 1px solid rgba(255, 255, 255, 0.10);
background: rgba(255, 255, 255, 0.05);
font-size: 18px;
font-style: normal;
font-weight: 600;
line-height: 24px;
}
.keywords {
box-sizing: border-box;
font-size: 16px;
line-height: 22px;
color: #BDBDBD;
}
@media screen and (min-width: 768px) {
/* body {
margin-top: 140px;
} */
body main {
max-width: 720px;
margin: 0 auto;
}
.header {
max-width: 720px;
margin: 0 auto;
}
.topBox {
display: none;
}
}
}
</style>