Files
aida_front/src/component/Account/accountFollowFans.vue

159 lines
3.7 KiB
Vue
Raw Normal View History

2024-08-05 16:16:08 +08:00
<template>
2024-08-23 10:19:02 +08:00
<div class="account_followFans">
2024-12-11 16:26:36 +08:00
<!-- <div class="account_followFans_title modal_title_text">
2024-08-05 16:16:08 +08:00
<div class="">
2024-09-03 16:39:06 +08:00
{{$t('account.Interact')}}
2024-08-05 16:16:08 +08:00
</div>
2024-12-11 16:26:36 +08:00
<div class="account_followFans_title_setting">设置</div>
</div> -->
2024-08-23 10:19:02 +08:00
<a-tabs class="account_followFans_body" v-model:activeKey="activeKey" @change="changeTabs">
<a-tab-pane v-for="item in messageList" :key="item.key">
<follow v-if="item.key == 'follow'" :ref="item.key"></follow>
<fans v-if="item.key == 'fans'" :ref="item.key"></fans>
<template #tab>
2024-10-02 12:27:58 +08:00
<span>{{item.title}}</span>
<!--
2024-08-23 10:19:02 +08:00
<a-badge :count="messageSystem.messageType[item.key]" >
<span>{{item.title}}</span>
2024-10-02 12:27:58 +08:00
</a-badge> -->
2024-08-23 10:19:02 +08:00
</template>
</a-tab-pane>
<!--
<a-tab-pane key="1" tab="系统消息">
<system ref="system"></system>
</a-tab-pane>
<a-tab-pane key="3" tab="评论">
<comment></comment>
</a-tab-pane>
<a-tab-pane key="4" tab="点赞">
<likeMessage></likeMessage>
</a-tab-pane>
<a-tab-pane key="6" tab="新增粉丝">
<newFollow ref="newFollow"></newFollow>
</a-tab-pane>
<a-tab-pane key="5" tab="客服">Content of Tab Pane 3</a-tab-pane> -->
2024-08-05 16:16:08 +08:00
</a-tabs>
</div>
</template>
<script lang="ts">
2024-08-23 10:19:02 +08:00
import { defineComponent,computed,ref,reactive,nextTick,toRefs,createVNode, onMounted} from 'vue'
2024-08-05 16:16:08 +08:00
import { Https } from "@/tool/https";
import { useRouter,useRoute } from 'vue-router'
import { Modal,message } from 'ant-design-vue';
import { useStore } from "vuex";
2024-08-23 10:19:02 +08:00
import follow from '@/component/Account/followFans/follow.vue'
import fans from '@/component/Account/followFans/fans.vue'
2024-08-05 16:16:08 +08:00
import { useI18n } from 'vue-i18n'
export default defineComponent({
components:{
2024-08-23 10:19:02 +08:00
follow,
fans,
2024-08-05 16:16:08 +08:00
},
setup() {
const router = useRouter()
const store = useStore();
2024-09-03 16:39:06 +08:00
const {t} = useI18n()
2024-08-05 16:16:08 +08:00
let accountMessage = reactive({
2024-08-23 10:19:02 +08:00
messageList:[
{
2024-09-03 16:39:06 +08:00
title:t('account.Follow'),
2024-08-23 10:19:02 +08:00
key:'follow',
},
{
2024-09-03 16:39:06 +08:00
title:t('account.Fans'),
2024-08-23 10:19:02 +08:00
key:'fans',
},
],
activeKey: '',
2024-08-05 16:16:08 +08:00
})
2024-08-23 10:19:02 +08:00
let domRefs:any = reactive({
follow:ref(null),
fans:ref(null),
})
let messageSystem = computed(()=>{
return store.state.UserHabit.messageSystem
})
let changeTabs = (key:any)=>{
}
let setReadStatus = (value:any)=>{
return new Promise((resolve,reject)=>{
if(value.isRead == 1)return reject('')
let data = {
type:accountMessage.activeKey,
notificationIdList:value.id
}
Https.axiosPost(Https.httpUrls.setReadStatus,'',{params:data}).then((rv)=>{
if(rv){
resolve(rv)
// store.commit('setMessageSystem',rv)
}
}).catch((err)=>{
reject(err)
})
})
2024-08-05 16:16:08 +08:00
}
2024-08-23 10:19:02 +08:00
onMounted(()=>{
let key = accountMessage.messageList[0].key
accountMessage.activeKey = key
})
2024-08-05 16:16:08 +08:00
return{
...toRefs(accountMessage),
2024-08-23 10:19:02 +08:00
...toRefs(domRefs),
messageSystem,
setReadStatus,
changeTabs,
2024-08-05 16:16:08 +08:00
}
},
data(){
return{
}
},
})
</script>
<style lang="less" scoped>
2024-08-23 10:19:02 +08:00
.account_followFans{
2024-08-05 16:16:08 +08:00
width: 100%;
2024-08-23 10:19:02 +08:00
.account_followFans_title{
2024-08-05 16:16:08 +08:00
display: flex;
align-items: center;
justify-content: space-between;
padding: 2rem 5rem;
border-bottom: 1px solid #e9eaec;
2024-08-23 10:19:02 +08:00
.account_followFans_title_setting{
2024-08-05 16:16:08 +08:00
cursor: pointer;
}
}
2024-08-23 10:19:02 +08:00
.account_followFans_body{
padding-bottom: 3rem;
2024-09-27 16:31:33 +08:00
:deep(.ant-badge){
font-size: var(--aida-fsize2);
}
2024-08-05 16:16:08 +08:00
:deep(.ant-tabs-nav){
2024-08-23 10:19:02 +08:00
padding: 0rem 5rem;
2024-12-11 16:26:36 +08:00
&::before{
display: none;
}
2024-08-05 16:16:08 +08:00
.ant-tabs-nav-wrap{
2024-08-23 10:19:02 +08:00
.ant-tabs-tab-btn{
2024-12-11 16:26:36 +08:00
color: #000;
2024-08-23 10:19:02 +08:00
font-size: 2.4rem;
}
2024-08-05 16:16:08 +08:00
.ant-tabs-tab-active{
.ant-tabs-tab-btn{
font-weight: 900;
}
}
}
.ant-tabs-ink-bar{
2024-12-11 16:26:36 +08:00
background: #000;
2024-08-05 16:16:08 +08:00
}
}
}
}
2024-08-23 10:19:02 +08:00
</style>