2024-08-05 16:16:08 +08:00
|
|
|
<template>
|
2024-08-13 09:36:13 +08:00
|
|
|
<div class="account_newFollow">
|
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-05 16:16:08 +08:00
|
|
|
</div>
|
2024-08-19 10:36:46 +08:00
|
|
|
<div class="account_generalMessage_center modal_title_text">
|
|
|
|
|
<div class="account_generalMessage_item" v-for="item in dataList" :key="item.id" @click="setRead(item)">
|
|
|
|
|
<a-badge :dot="item.isRead == 0"></a-badge>
|
|
|
|
|
<div class="account_generalMessage_item_right">
|
2024-08-23 10:19:02 +08:00
|
|
|
<div class="account_generalMessage_item_right_img" @click="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">
|
2025-06-26 15:41:08 +08:00
|
|
|
<div class="" style="font-size: 1.8rem;">{{ item.userName }}</div>
|
|
|
|
|
<div class="modal_title_text_intro" style="font-size: 1.6rem;">{{ item.createTime }} {{$t('account.followedYou')}}</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">
|
2024-08-23 10:19:02 +08:00
|
|
|
<div v-if="item?.isFollow == 0" @click.stop="setFollow(item)" >{{$t('newScaleImage.Follow')}}</div>
|
|
|
|
|
<div v-else @click.stop="setFollow(item)" >{{$t('newScaleImage.Unfollow')}}</div>
|
2024-08-13 09:36:13 +08:00
|
|
|
</div>
|
2024-08-05 16:16:08 +08:00
|
|
|
</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>
|
|
|
|
|
</div>
|
2024-08-05 16:16:08 +08:00
|
|
|
</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 { useStore } from "vuex";
|
|
|
|
|
import { useI18n } from 'vue-i18n'
|
|
|
|
|
export default defineComponent({
|
|
|
|
|
components:{
|
|
|
|
|
},
|
2024-08-23 10:19:02 +08:00
|
|
|
// emits:['setReadStatus','setAllmessage'],
|
|
|
|
|
props:['setReadStatus','setAllmessage','getHistory'],
|
2024-08-19 10:36:46 +08:00
|
|
|
setup(prop,{emit}) {
|
2024-08-05 16:16:08 +08:00
|
|
|
const router = useRouter()
|
|
|
|
|
const store = useStore();
|
|
|
|
|
let accountMessage = reactive({
|
|
|
|
|
activeKey: ref('1'),
|
2024-08-23 10:19:02 +08:00
|
|
|
dataList:[
|
2024-08-19 10:36:46 +08:00
|
|
|
|
2024-08-23 10:19:02 +08:00
|
|
|
],
|
|
|
|
|
page:1,
|
|
|
|
|
size:10,
|
|
|
|
|
isNoData: false,
|
|
|
|
|
isShowMark: false,
|
2024-08-05 16:16:08 +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
|
2024-10-02 11:33:14 +08:00
|
|
|
if(rv.content.length == 0) {
|
2024-08-23 10:19:02 +08:00
|
|
|
accountMessage.isNoData = true
|
|
|
|
|
return
|
|
|
|
|
}
|
2024-10-02 11:33:14 +08:00
|
|
|
accountMessage.dataList = rv.content
|
2024-08-23 10:19:02 +08:00
|
|
|
}).catch(() => {
|
|
|
|
|
accountMessage.isShowMark = false
|
|
|
|
|
accountMessage.isNoData = true
|
|
|
|
|
})
|
2024-08-19 10:36:46 +08:00
|
|
|
}
|
|
|
|
|
let setRead = (item:any)=>{
|
2024-08-23 10:19:02 +08:00
|
|
|
prop.setReadStatus(item).then((rv:any)=>{
|
|
|
|
|
item.isRead = 1
|
|
|
|
|
}).catch((err:any)=>{
|
|
|
|
|
})
|
2024-08-19 10:36:46 +08:00
|
|
|
}
|
|
|
|
|
let allRead = ()=>{
|
2024-08-23 10:19:02 +08:00
|
|
|
// emit('setAllmessage')
|
|
|
|
|
prop.setAllmessage().then(()=>{
|
2024-09-30 17:59:24 +08:00
|
|
|
accountMessage.dataList.forEach((item:any)=>{
|
|
|
|
|
item.isRead = 1
|
|
|
|
|
})
|
2024-08-23 10:19:02 +08:00
|
|
|
}).catch((err:any)=>{
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
let setFollow = (item:any) =>{
|
|
|
|
|
let url = Https.httpUrls.porfolioFollow
|
|
|
|
|
if(item.isFollow == 1)url = Https.httpUrls.porfolioCancelFollow
|
|
|
|
|
Https.axiosGet(url, {params:{followeeId:item.senderId}})
|
|
|
|
|
.then((rv) => {
|
|
|
|
|
if(item.isFollow == 1){
|
|
|
|
|
item.isFollow = 0
|
|
|
|
|
}else{
|
|
|
|
|
item.isFollow = 1
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
let openOtherUsers = (item:any)=>{
|
|
|
|
|
const routeUrl = router.resolve({
|
|
|
|
|
path:'/home/otherUsers',
|
|
|
|
|
query:{
|
|
|
|
|
userId:item.senderId
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
window.open(routeUrl.href,'_blank')
|
2024-08-19 10:36:46 +08:00
|
|
|
}
|
2024-08-05 16:16:08 +08:00
|
|
|
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-05 16:16:08 +08:00
|
|
|
})
|
|
|
|
|
return{
|
|
|
|
|
...toRefs(accountMessage),
|
2024-08-19 10:36:46 +08:00
|
|
|
setmessageList,
|
|
|
|
|
setRead,
|
2024-08-23 10:19:02 +08:00
|
|
|
allRead,
|
|
|
|
|
setFollow,
|
|
|
|
|
openOtherUsers,
|
|
|
|
|
loadingDom,
|
2024-08-05 16:16:08 +08:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
data(){
|
|
|
|
|
return{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
})
|
|
|
|
|
</script>
|
|
|
|
|
<style lang="less" scoped>
|
2024-08-13 09:36:13 +08:00
|
|
|
.account_newFollow{
|
2024-08-05 16:16:08 +08:00
|
|
|
width: 100%;
|
2024-08-19 10:36:46 +08:00
|
|
|
.account_generalMessage_center{
|
|
|
|
|
.account_generalMessage_item{
|
2025-09-01 14:03:30 +08:00
|
|
|
font-size: var(--aida-fsize1-6);
|
2024-08-19 10:36:46 +08:00
|
|
|
.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
|
|
|
.account_generalMessage_item_right_img{
|
2025-06-26 15:41:08 +08:00
|
|
|
width: 6rem;
|
|
|
|
|
height: 6rem;
|
2024-08-13 09:36:13 +08:00
|
|
|
margin-right: 2rem;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
img{
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 100%;
|
2024-09-30 15:43:37 +08:00
|
|
|
object-fit: contain;
|
2024-08-13 09:36:13 +08:00
|
|
|
border-radius: 50%;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-08-19 10:36:46 +08:00
|
|
|
.account_generalMessage_item_left{
|
2024-08-13 09:36:13 +08:00
|
|
|
div{
|
|
|
|
|
padding: .5rem 2rem;
|
|
|
|
|
border-radius: 4rem;
|
|
|
|
|
border: 2px solid #e9eaec;
|
|
|
|
|
cursor: pointer;
|
2025-06-26 15:41:08 +08:00
|
|
|
font-size: 1.8rem;
|
2024-08-13 09:36:13 +08:00
|
|
|
}
|
2024-08-05 16:16:08 +08:00
|
|
|
}
|
|
|
|
|
}
|
2024-08-19 10:36:46 +08:00
|
|
|
.account_generalMessage_item:last-child{
|
2024-08-13 09:36:13 +08:00
|
|
|
margin-bottom: 0;
|
|
|
|
|
border-bottom: none;
|
2024-08-05 16:16:08 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|