BUG 29414

This commit is contained in:
aixianling
2022-04-29 18:52:18 +08:00
parent 4f7d06ac5e
commit 6e5038e4c7

View File

@@ -1,128 +1,15 @@
<template>
<div class="news-detail" v-if="pageShow">
<!-- <div class="video" v-if="info.videoFile">
<video :src="info.videoFile.url" :poster="info.coverFile.url"></video>
</div> -->
<div class="detail-top" :class="[info.videoFile ? 'detail-top__active' : '']">
<h2>{{ info.title }}</h2>
<!-- <div class="detail-info">
<div class="left">{{ info.areaName }} {{ info.createTime ? info.createTime.split(' ')[0] : '' }} </div>
<div class="right">
<div class="right-item">
<i class="iconfont">{{ info.videoFile ? '&#xe6f9;' : '&#xe6fc;'}}</i>
<span>{{ info.viewCount }}</span>
</div>
<div class="right-item">
<i class="iconfont" :style="{color: info.nowUserStatus === '0' ? '#C41C19' : '#666'}">&#xe698;</i>
<span :style="{color: info.nowUserStatus === '0' ? '#C41C19' : '#666'}">{{ info.upCount }}</span>
</div>
</div>
</div> -->
<!-- <div class="detail-content" v-if="!info.videoFile">
<div v-html="info.content" class="articalContent"></div>
<image :src="info.coverFile.url" mode="widthFix" />
<AiWxparse :imageProp="imageProp" className="articalContent" :content="info.content"/>
<u-parse className="articalContent" :html="info.content"/>
</div> -->
<p><span>通知公告</span>{{ info.createTime.substring(0,10) }}</p>
<p><span>通知公告</span>{{ $dateFormat(info.createTime) }}</p>
<u-parse :html="info.content" style="margin-top: 20px;"/>
</div>
<!-- <div class="detail-comments">
<h2>全部评论({{ commentsTotal }})</h2>
<div class="comments-list">
<div class="item" v-for="(item, index) in commentList" :key="index">
<image :src="item.avatar" />
<div class="item-right">
<div class="item-right__top">
<h2>{{ item.name || '-' }}</h2>
<div class="item-right__top--right" @click="replySuport(item.id, index)">
<i class="iconfont" :style="{color: item.status === '0' ? '#C41C19' : '#666'}">&#xe698;</i>
<span :style="{color: item.status === '0' ? '#C41C19' : '#666'}">{{ item.supportedQuantity }}</span>
</div>
</div>
<div class="item-right__content">{{ item.content }}</div>
<div class="item-right__info">
<span>{{ item.name }} {{ item.commentTime.substring(0, 10)}} </span>
<i @click="reply(item.id, item.name)">回复TA</i>
</div>
<div class="item-replay" v-if="item.secondComments.length">
<div class="item-replay__item" v-for="(reply, i) in item.secondComments" :key="i" v-if="i < 2 || item.isShow === '1'">
<h3>{{ reply.name }}: </h3>
<span>{{ reply.content }}</span>
</div>
<div class="item-replay__more" v-if="item.secondComments.length > 2 && item.isShow !== '1'" @click="showMore(index)">
查看全部{{ item.secondComments.length }}条回复 >
</div>
</div>
</div>
</div>
<div class="no-more" v-if="!commentList.length">
<image src="https://cdn.cunwuyun.cn/img/Empty.png" />
<p>暂无评论</p>
</div>
</div>
</div> -->
<!-- <AiTransSpeech :src="info.speech"></AiTransSpeech> -->
<!-- <div class="footer-bar">
<input
:cursor-spacing="10"
:placeholder="focus ? '' : '我来说两句…'"
@confirm="onConfirm"
confirm-type="send"
:focus="focus"
:disabled="true"
@click="showComments"
@blur="focus = false, placeholder = '', commentId = ''">
<div class="footer-bar__right flex1">
<div class="count flex1" v-if="info.type === '0'">
<img src="https://cdn.cunwuyun.cn/components/comment/pinglun.png" alt="" class="icon-img">
<span>{{ commentsTotal }}</span>
</div>
<div class="flex1" v-if="info.type === '0'">
<img src="https://cdn.cunwuyun.cn/components/comment/tabdz.png" alt="" class="icon-img" @click="suport">
</div>
<button class="flex1" v-if="info.type === '0'" open-type="share" style="text-align: center">
<img src="https://cdn.cunwuyun.cn/components/comment/tabfx.png" alt="" class="icon-img">
</button>
<div class="video-item" v-if="info.type === '1'" @click="suport" :style="{color: info.nowUserStatus === '0' ? '#C41C19' : '#666'}">
<img src="https://cdn.cunwuyun.cn/components/comment/tabdz.png" alt="" class="icon-img">
<span></span>
</div>
<button open-type="share" class="video-item" v-if="info.type === '1'">
<img src="https://cdn.cunwuyun.cn/components/comment/tabfx.png" alt="" class="icon-img">
<span>分享</span>
</button>
</div>
</div> -->
<!-- <div class="comments" v-if="isShowComment" mode="bottom" @close="focus = false" :closeable="false">
<div class="mask" @click="isShowComment = false"></div>
<div class="comments-wrapper" :style="{bottom: bottom + 'px'}">
<div class="textarea">
<textarea
placeholder="我来说两句…"
:focus="focus"
:maxlength="1000"
fixed
@keyboardheightchange="keyboardheightchange"
:adjust-position="false"
:show-confirm-bar="false"
v-model="commnet">
</textarea>
<div class="textarea-bottom">
<span></span>
<div>字数{{ commnet.length }}/1000</div>
</div>
</div>
<div class="comments-bottom">
<span @click="commnet = ''">清空内容</span>
<div @click="onConfirm">发表</div>
</div>
</div>
</div> -->
<!-- <ai-login ref="login"></ai-login> -->
<div class="accessory-list" v-if="info.files.length">
<p><u-icon name="attach" color="#2979ff" size="28"></u-icon>附件</p>
<p>
<u-icon name="attach" color="#2979ff" size="28"></u-icon>
附件
</p>
<div class="card-list">
<div class="item" v-for="(item,index) in info.files" :key="index" @click="previewFile(item)">
<img src="./components/files.png" alt="">
@@ -134,16 +21,17 @@
</template>
<script>
import {mapState} from 'vuex'
export default {
import {mapState} from 'vuex'
export default {
name: 'newsDetail',
computed: {
...mapState(['token'])
},
data () {
data() {
return {
isShowComment: false,
info: {},
info: {files: []},
imageProp: {
mode: 'widthFix',
padding: 0,
@@ -165,7 +53,7 @@
}
},
onLoad (params) {
onLoad(params) {
this.id = params.id
this.$nextTick(() => {
this.getDetail()
@@ -174,75 +62,13 @@
},
methods: {
login() {
this.$refs.login.show()
},
keyboardheightchange (e) {
this.bottom = e.detail.height
},
showComments () {
if(!this.token) {
this.login()
return false
}
this.commnetId = ''
this.isShowComment = true
setTimeout(() => {
this.focus = true
}, 500)
},
reply (id, name) {
if(!this.token) {
this.login()
return false
}
this.isShowComment = true
this.commentId = id
setTimeout(() => {
this.focus = true
}, 800)
},
showMore (index) {
this.$set(this.commentList[index], 'isShow', '1')
},
// suport() {
// this.$instance.post('/app/appnewscenterinfo/suportFree?id=' + this.id).then(res => {
// if (res.code === 0) {
// this.$set(this.info, 'upCount', this.info.upCount + 1)
// this.$set(this.info, 'nowUserStatus', '0')
// this.$toast('点赞成功')
// }
// })
// },
replySuport (id, index) {
this.$instance.post('/app/appnewscentercommenthot/suportFree', {
commentId: id,
status: this.commentList[index].status === '0' ? '1' : '0'
}).then(res => {
if (res.code === 0) {
this.$set(this.commentList[index], 'supportedQuantity', this.commentList[index].supportedQuantity + 1)
this.$set(this.commentList[index], 'status', '0')
this.$toast('点赞成功')
}
})
},
getDetail() {
this.$http.post('/app/apppublicityinfo/queryDetailById',null,{
this.$http.post('/app/apppublicityinfo/queryDetailById', null, {
params: {
id: this.id
}
}).then(res => {
console.log(res);
if (res.code === 0) {
if (res?.data) {
this.info = res.data
this.$nextTick(() => {
this.pageShow = true
@@ -250,13 +76,12 @@
}
})
},
previewFile(file) {
let fileList = [{
index: 0,
url: file.accessUrl
}]
if(file.postfix == ".png" || file.postfix == ".jpg") {
if (file.postfix == ".png" || file.postfix == ".jpg") {
uni.previewImage({
urls: fileList.map(v => v.url),
current: file.accessUrl
@@ -278,11 +103,11 @@
}
},
onConfirm () {
onConfirm() {
if (!this.commnet) {
return this.$toast('评论不能为空')
}
this.$instance.post('/app/appnewscentercomment/addOrUpdateForWX', {
this.$http.post('/app/appnewscentercomment/addOrUpdateForWX', {
circleId: this.id,
content: this.commnet,
type: this.commentId ? 2 : 1,
@@ -311,8 +136,8 @@
},
getComments() {
this.$instance.post('/app/appnewscentercomment/listForWX?size=5&circleId=' + this.id + '&current=' + (this.current + 1)).then(res => {
if (res.code === 0) {
this.$http.post('/app/appnewscentercomment/listForWX?size=5&circleId=' + this.id + '&current=' + (this.current + 1)).then(res => {
if (res?.data) {
this.commentsTotal = res.data.total
if (this.current === 0) {
@@ -341,23 +166,23 @@
}
},
onReachBottom () {
onReachBottom() {
this.getComments()
},
onShareAppMessage () {
onShareAppMessage() {
return {
title: this.info.title,
imageUrl: this.info.coverFile.url,
path: `/subPages/live/newsDetail?id=${this.id}&areaId=${this.$areaId}`
}
}
}
}
</script>
<style lang="scss">
.news-detail {
padding-bottom: 120rpx;
.news-detail {
padding-bottom: 120px;
div {
box-sizing: border-box;
@@ -386,31 +211,31 @@
bottom: 0;
z-index: 1;
width: 100%;
padding: 32rpx 32rpx 16rpx;
padding: 32px 32px 16px;
background: #FFFFFF;
.textarea {
position: relative;
width: 100%;
margin-bottom: 24rpx;
padding: 16rpx;
margin-bottom: 24px;
padding: 16px;
background: #F7F7F7;
border-radius: 8px;
textarea {
width: 100%;
height: 94rpx;
height: 94px;
color: #666;
font-size: 26rpx;
font-size: 26px;
}
.textarea-bottom {
display: flex;
align-items: center;
justify-content: space-between;
padding: 16rpx;
padding: 16px;
color: #999999;
font-size: 26rpx;
font-size: 26px;
}
}
@@ -418,91 +243,95 @@
display: flex;
align-items: center;
justify-content: space-between;
padding-left: 16rpx;
padding-left: 16px;
span {
color: #666666;
font-size: 26rpx;
font-size: 26px;
}
div {
width: 144rpx;
height: 64rpx;
line-height: 64rpx;
width: 144px;
height: 64px;
line-height: 64px;
text-align: center;
color: #fff;
font-size: 28rpx;
font-size: 28px;
background: #135AB8;
border-radius: 32rpx;
border-radius: 32px;
}
}
}
.icon-img{
width: 32rpx;
height: 32rpx;
margin-right: 8rpx;
.icon-img {
width: 32px;
height: 32px;
margin-right: 8px;
}
.video-item {
display: flex;
align-items: center;
justify-content: center;
flex: 1;
color: #666;
font-size: 28rpx;
font-size: 28px;
i {
padding-right: 4rpx;
padding-right: 4px;
}
}
.detail-top__active {
padding-top: 30rpx;
padding-top: 30px;
h2 {
margin-bottom: 28rpx;
margin-bottom: 28px;
}
}
.video {
width: 100%;
height: 396rpx;
height: 396px;
video {
display: block;
width: 100%;
height: 396rpx;
height: 396px;
}
}
}
.no-more {
margin-top: 20rpx;
}
.no-more {
margin-top: 20px;
text-align: center;
color: #999;
image {
width: 400rpx;
height: 240rpx;
width: 400px;
height: 240px;
}
p {
text-align: center;
color: #999;
font-size: 28rpx;
}
font-size: 28px;
}
}
.detail-top {
padding: 10rpx 30rpx 26rpx;
.detail-top {
padding: 10px 30px 26px;
background: #fff;
& > h2 {
margin-bottom: 40rpx;
margin-bottom: 40px;
color: #333333;
font-size: 40px;
}
p {
font-size: 24px;
span {
margin-right: 15px;
}
@@ -513,7 +342,7 @@
align-items: center;
justify-content: space-between;
color: #333333;
font-size: 24rpx;
font-size: 24px;
.right {
display: flex;
@@ -524,37 +353,37 @@
align-items: center;
&:first-child {
margin-right: 60rpx;
margin-right: 60px;
}
}
i {
margin-right: 10rpx;
font-size: 32rpx;
margin-right: 10px;
font-size: 32px;
}
}
}
.detail-content {
margin-top: 46rpx;
margin-top: 46px;
image {
display: block;
width: 100%;
height: 400rpx;
height: 400px;
margin: 0 auto;
}
}
}
}
.detail-comments {
margin-top: 20rpx;
padding: 0 30rpx 20rpx;
.detail-comments {
margin-top: 20px;
padding: 0 30px 20px;
background: #fff;
& > h2 {
padding-top: 16rpx;
font-size: 30rpx;
padding-top: 16px;
font-size: 30px;
color: #333333;
}
@@ -565,10 +394,10 @@
image {
flex-shrink: 1;
width: 50rpx;
height: 50rpx;
width: 50px;
height: 50px;
border-radius: 50%;
margin-right: 22rpx;
margin-right: 22px;
}
.item-right {
@@ -577,81 +406,81 @@
.item-right__top {
display: flex;
justify-content: space-between;
height: 50rpx;
height: 50px;
.item-right__top--right {
display: flex;
align-items: center;
padding-left: 20rpx;
padding-left: 20px;
i {
margin-right: 10rpx;
margin-right: 10px;
color: #666;
font-size: 28rpx;
font-size: 28px;
}
span {
color: #333333;
font-size: 24rpx;
font-size: 24px;
}
}
}
.item-right__content {
line-height: 46rpx;
line-height: 46px;
color: #333333;
font-size: 28rpx;
font-size: 28px;
text-align: justify;
}
.item-right__info {
display: flex;
align-items: center;
margin: 10rpx 0;
margin: 10px 0;
span {
margin-right: 20rpx;
margin-right: 20px;
color: #999999;
font-size: 24rpx;
font-size: 24px;
}
i {
color: #333333;
font-size: 24rpx;
font-size: 24px;
}
}
.item-replay {
padding: 30rpx;
padding: 30px;
background: #F0F0F0;
.item-replay__item {
display: flex;
line-height: 1.3;
margin-bottom: 10rpx;
margin-bottom: 10px;
h3 {
color: #333333;
font-size: 26rpx;
font-size: 26px;
font-weight: 600;
}
span {
font-size: 26rpx;
font-size: 26px;
}
}
.item-replay__more {
color: #999999;
font-size: 26rpx;
}
font-size: 26px;
}
}
}
}
}
}
.footer-bar {
.footer-bar {
display: flex;
position: fixed;
align-items: center;
@@ -659,18 +488,18 @@
bottom: 0;
left: 0;
width: 100%;
height: 100rpx;
padding: 0 30rpx;
height: 100px;
padding: 0 30px;
box-sizing: border-box;
border-top: 1rpx solid rgba(0, 0, 0, 0.2);
border-top: 1px solid rgba(0, 0, 0, 0.2);
background: #fff;
input {
width: 460rpx;
height: 58rpx;
width: 460px;
height: 58px;
background: #F0F0F0;
border-radius: 30rpx;
font-size: 26rpx;
border-radius: 30px;
font-size: 26px;
text-align: center;
}
@@ -679,7 +508,7 @@
align-items: center;
i {
font-size: 30rpx;
font-size: 30px;
color: #666;
}
@@ -689,27 +518,27 @@
span {
position: absolute;
top: -18rpx;
right: -11rpx;
top: -18px;
right: -11px;
z-index: 21;
padding: 3rpx 7rpx;
font-size: 20rpx;
padding: 3px 7px;
font-size: 20px;
color: #fff;
border-radius: 12rpx;
border-radius: 12px;
background: #C41C19;
}
}
.count, & > i {
margin-right: 40rpx;
margin-right: 40px;
}
button {
padding: 0!important;
font-size: 26rpx!important;
color: #666!important;
line-height: 1!important;
background: transparent!important;
padding: 0 !important;
font-size: 26px !important;
color: #666 !important;
line-height: 1 !important;
background: transparent !important;
&::after {
border: none;
@@ -720,34 +549,38 @@
}
}
}
}
}
.accessory-list {
.accessory-list {
margin-top: 16px;
background: #FFF;
padding: 0 32px 30px 32px;
box-sizing: border-box;
p {
font-size: 32px;
height: 112px;
line-height: 112px;
}
.card-list {
.item{
.item {
padding: 16px;
border: 1px solid #CCCCCC;
border-radius: 8px;
display: flex;
margin-bottom: 32px;
img {
width: 96px;
height: 96px;
}
div {
align-self: center;
}
}
}
}
}
</style>