2024-08-13 09:36:13 +08:00
|
|
|
<template>
|
|
|
|
|
<div class="account_comment">
|
2024-08-19 10:36:46 +08:00
|
|
|
<div class="account_generalMessage_title modal_title_text">
|
2024-08-23 10:19:02 +08:00
|
|
|
<!-- <span>收到的评论</span> -->
|
2024-09-03 16:39:06 +08:00
|
|
|
<div class="account_generalMessage_title_setting" @click="allRead">{{$t('account.AllRead')}}</div>
|
2024-08-13 09:36:13 +08:00
|
|
|
</div>
|
2024-08-19 10:36:46 +08:00
|
|
|
<div class="account_generalMessage_center modal_title_text">
|
|
|
|
|
|
2024-08-23 10:19:02 +08:00
|
|
|
<div class="account_generalMessage_item" v-for="item in dataList" @click="setRead(item)">
|
|
|
|
|
<a-badge :dot="item.isRead == 0"></a-badge>
|
2024-08-19 10:36:46 +08:00
|
|
|
<div class="account_generalMessage_item_right">
|
2024-08-23 10:19:02 +08:00
|
|
|
<div class="account_generalMessage_item_right_img" @click.stop="openOtherUsers(item)">
|
|
|
|
|
<img :src="item.avatar" alt="">
|
2024-08-13 09:36:13 +08:00
|
|
|
</div>
|
2024-08-19 10:36:46 +08:00
|
|
|
<div class="account_generalMessage_item_right_title">
|
2024-09-03 16:39:06 +08:00
|
|
|
<div class="account_generalMessage_item_right_title_name">{{ item.userName }} <span>{{$t('account.reply')}}</span></div>
|
2024-08-23 10:19:02 +08:00
|
|
|
<div class="account_generalMessage_item_right_title_center modal_title_text_assistant">{{ item.content }}</div>
|
|
|
|
|
<div class="account_generalMessage_item_right_works modal_title_text_intro" @click.stop="openOtherWork(item)">{{ item.portfolioName }}</div>
|
2024-08-13 09:36:13 +08:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2024-08-19 10:36:46 +08:00
|
|
|
<div class="account_generalMessage_item_left">
|
|
|
|
|
<div class="account_generalMessage_item_left_delete modal_title_text_intro">
|
2024-08-13 09:36:13 +08:00
|
|
|
<span class="icon iconfont icon-shanchu operate_icon"></span>
|
|
|
|
|
</div>
|
2024-08-23 10:19:02 +08:00
|
|
|
<div class="modal_title_text_intro">{{ item.createTime }}</div>
|
2024-08-13 09:36:13 +08:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2024-08-23 10:19:02 +08:00
|
|
|
<div class="account_generalMessage_item" style="justify-content: center;" v-if="dataList.length == 0 && isNoData">
|
2024-09-03 16:39:06 +08:00
|
|
|
{{$t('account.dataNull')}}
|
2024-08-23 10:19:02 +08:00
|
|
|
</div>
|
|
|
|
|
<div class="page_loading_box" v-show="!isNoData">
|
|
|
|
|
<span class="page_loading" ref="loadingDom" v-show="!isShowMark"></span>
|
|
|
|
|
<span v-show="isShowMark">
|
|
|
|
|
<a-spin size="large" />
|
|
|
|
|
</span>
|
2024-08-13 09:36:13 +08:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<script lang="ts">
|
|
|
|
|
import { defineComponent,computed,ref,reactive,nextTick,toRefs,createVNode, onMounted} from 'vue'
|
|
|
|
|
import { Https } from "@/tool/https";
|
|
|
|
|
import { useRouter,useRoute } from 'vue-router'
|
|
|
|
|
import { Modal,message } from 'ant-design-vue';
|
|
|
|
|
import { useStore } from "vuex";
|
|
|
|
|
import { setCookie, getCookie, WriteCookie } from "@/tool/cookie";
|
|
|
|
|
import { useI18n } from 'vue-i18n'
|
|
|
|
|
export default defineComponent({
|
|
|
|
|
components:{
|
|
|
|
|
},
|
2024-08-23 10:19:02 +08:00
|
|
|
props:['setReadStatus','setAllmessage','getHistory'],
|
|
|
|
|
setup(prop,{emit}) {
|
|
|
|
|
|
2024-08-13 09:36:13 +08:00
|
|
|
const router = useRouter()
|
|
|
|
|
const store = useStore();
|
|
|
|
|
let accountMessage = reactive({
|
|
|
|
|
activeKey: ref('1'),
|
2024-08-23 10:19:02 +08:00
|
|
|
dataList:[
|
|
|
|
|
],
|
|
|
|
|
page:1,
|
|
|
|
|
size:10,
|
|
|
|
|
isNoData: false,
|
|
|
|
|
isShowMark: false,
|
2024-08-13 09:36:13 +08:00
|
|
|
})
|
2024-08-23 10:19:02 +08:00
|
|
|
let loadingDom:any = ref(null)
|
|
|
|
|
let setmessageList = ()=>{
|
|
|
|
|
accountMessage.isShowMark = true
|
|
|
|
|
let data = {
|
|
|
|
|
page: accountMessage.page,
|
|
|
|
|
size: accountMessage.size,
|
|
|
|
|
}
|
|
|
|
|
prop.getHistory(data).then((rv:any)=>{
|
|
|
|
|
accountMessage.isShowMark = false
|
|
|
|
|
if(rv.content.length == 0) {
|
|
|
|
|
accountMessage.isNoData = true
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
accountMessage.dataList = rv.content
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
accountMessage.isShowMark = false
|
|
|
|
|
accountMessage.isNoData = true
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
let setRead = (item:any)=>{
|
|
|
|
|
prop.setReadStatus(item).then((rv:any)=>{
|
|
|
|
|
item.isRead = 1
|
|
|
|
|
}).catch((err:any)=>{
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
let allRead = ()=>{
|
|
|
|
|
// emit('setAllmessage')
|
|
|
|
|
prop.setAllmessage().then(()=>{
|
|
|
|
|
}).catch((err:any)=>{
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
let openOtherUsers = (item:any)=>{
|
2024-08-13 09:36:13 +08:00
|
|
|
const routeUrl = router.resolve({
|
|
|
|
|
path:'/home/otherUsers',
|
|
|
|
|
query:{
|
2024-08-23 10:19:02 +08:00
|
|
|
userId:item.senderId
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
window.open(routeUrl.href,'_blank')
|
|
|
|
|
}
|
|
|
|
|
let openOtherWork = (item:any)=>{
|
|
|
|
|
const routeUrl = router.resolve({
|
|
|
|
|
path:'/home/works',
|
|
|
|
|
query:{
|
|
|
|
|
workId:item.portfolioId
|
2024-08-13 09:36:13 +08:00
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
window.open(routeUrl.href,'_blank')
|
|
|
|
|
}
|
|
|
|
|
onMounted (()=>{
|
2024-08-23 10:19:02 +08:00
|
|
|
accountMessage.isNoData = false
|
|
|
|
|
accountMessage.page = 0
|
|
|
|
|
let imgParent:any = document.querySelector('.account_systemMessage .page_loading')
|
|
|
|
|
new IntersectionObserver(
|
|
|
|
|
(entries, observer) => {
|
|
|
|
|
// 如果不是相交,则直接返回
|
|
|
|
|
// console.log(entries[0]);
|
|
|
|
|
if (!entries[0].intersectionRatio) return;
|
|
|
|
|
accountMessage.page+=1
|
|
|
|
|
setmessageList()
|
|
|
|
|
},
|
|
|
|
|
// { root:worksPage }
|
|
|
|
|
).observe(loadingDom.value);
|
2024-08-13 09:36:13 +08:00
|
|
|
})
|
|
|
|
|
return{
|
|
|
|
|
...toRefs(accountMessage),
|
2024-08-23 10:19:02 +08:00
|
|
|
setmessageList,
|
|
|
|
|
setRead,
|
|
|
|
|
allRead,
|
2024-08-13 09:36:13 +08:00
|
|
|
openOtherUsers,
|
2024-08-23 10:19:02 +08:00
|
|
|
openOtherWork,
|
|
|
|
|
loadingDom,
|
2024-08-13 09:36:13 +08:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
data(){
|
|
|
|
|
return{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
})
|
|
|
|
|
</script>
|
|
|
|
|
<style lang="less" scoped>
|
|
|
|
|
.account_comment{
|
|
|
|
|
width: 100%;
|
2024-08-19 10:36:46 +08:00
|
|
|
.account_generalMessage_item{
|
|
|
|
|
.account_generalMessage_item_right{
|
2024-08-13 09:36:13 +08:00
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
2024-08-19 10:36:46 +08:00
|
|
|
margin-right: 1rem;
|
|
|
|
|
.account_generalMessage_item_right_works{
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
}
|
|
|
|
|
.account_generalMessage_item_right_works:hover{
|
|
|
|
|
text-decoration: underline;
|
|
|
|
|
}
|
|
|
|
|
.account_generalMessage_item_right_img{
|
|
|
|
|
width: 8rem;
|
|
|
|
|
height: 8rem;
|
|
|
|
|
margin-right: 2rem;
|
|
|
|
|
flex-shrink: 0;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
img{
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 100%;
|
2024-09-30 15:43:37 +08:00
|
|
|
object-fit: contain;
|
2024-08-19 10:36:46 +08:00
|
|
|
border-radius: 50%;
|
2024-08-13 09:36:13 +08:00
|
|
|
}
|
2024-08-19 10:36:46 +08:00
|
|
|
}
|
|
|
|
|
.account_generalMessage_item_right_title{
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
align-items: flex-start;
|
|
|
|
|
.account_generalMessage_item_right_title_center{
|
|
|
|
|
display: -webkit-box;
|
|
|
|
|
-webkit-box-orient: vertical;
|
|
|
|
|
-webkit-line-clamp: 2;
|
|
|
|
|
overflow: hidden;
|
2024-08-13 09:36:13 +08:00
|
|
|
}
|
2024-08-19 10:36:46 +08:00
|
|
|
.account_generalMessage_item_right_title_name{
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
color: #000;
|
|
|
|
|
span{
|
2024-08-13 09:36:13 +08:00
|
|
|
font-weight: 500;
|
2024-08-19 10:36:46 +08:00
|
|
|
color: #9999aa;
|
2024-08-13 09:36:13 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-08-19 10:36:46 +08:00
|
|
|
}
|
|
|
|
|
.account_generalMessage_item_left{
|
|
|
|
|
text-align: right;
|
|
|
|
|
flex-shrink: 0;
|
|
|
|
|
.account_generalMessage_item_left_delete{
|
|
|
|
|
span{
|
|
|
|
|
cursor: pointer;
|
2024-08-13 09:36:13 +08:00
|
|
|
}
|
|
|
|
|
}
|
2024-08-19 10:36:46 +08:00
|
|
|
div{
|
|
|
|
|
padding: .5rem 2rem;
|
|
|
|
|
border-radius: 4rem;
|
|
|
|
|
}
|
2024-08-13 09:36:13 +08:00
|
|
|
}
|
2024-08-19 10:36:46 +08:00
|
|
|
}
|
|
|
|
|
.account_generalMessage_item:last-child{
|
|
|
|
|
margin-bottom: 0;
|
|
|
|
|
border-bottom: none;
|
2024-08-13 09:36:13 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|