|
|
|
|
<template>
|
|
|
|
|
<div>
|
|
|
|
|
<ConversationList ref="contactList" />
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
|
|
import { ref, onMounted, computed, getCurrentInstance } from "vue";
|
|
|
|
|
import ConversationList from "../NEUIKit/pages/Conversation/conversation-list/index.vue";
|
|
|
|
|
import { trackInit } from "../NEUIKit/utils/reporter.ts";
|
|
|
|
|
import { onShow, onLoad } from "@dcloudio/uni-app";
|
|
|
|
|
import telPanel from "../NEUIKit/pages/Contact/contact-list/index.vue";
|
|
|
|
|
import chatPanel from "../NEUIKit/pages/Contact/BcFriend.vue";
|
|
|
|
|
const G = getCurrentInstance().appContext.app.config.globalProperties.G;
|
|
|
|
|
|
|
|
|
|
const globalData = ref(getApp().globalData);
|
|
|
|
|
const wyyxTabGroup = ref([]);
|
|
|
|
|
const corpUserFlag = ref(false);
|
|
|
|
|
const showService = ref(false);
|
|
|
|
|
const update = ref(1);
|
|
|
|
|
const contactList = ref(null);
|
|
|
|
|
const AIList = ref(null);
|
|
|
|
|
const cdnBaseImg = ref(G.store().cdnBaseImg);
|
|
|
|
|
|
|
|
|
|
const isLogin = ref(false);
|
|
|
|
|
// 回到顶部
|
|
|
|
|
const resetScroll = ref(0);
|
|
|
|
|
const tabbarHeight = ref(uni.getStorageSync("TABBAR_HEIGHT"));
|
|
|
|
|
const openTel2 = ref(null);
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
});
|
|
|
|
|
const sname = ref("");
|
|
|
|
|
const stel = ref("");
|
|
|
|
|
|
|
|
|
|
const current = ref(0);
|
|
|
|
|
const count = ref(0); // 系统消息未读
|
|
|
|
|
const messageId = ref("");
|
|
|
|
|
const userInfo = ref({});
|
|
|
|
|
|
|
|
|
|
onShow(() => {
|
|
|
|
|
isLogin.value = uni.getStorageSync("apply-token") ? true : false;
|
|
|
|
|
console.log("count.value", count.value);
|
|
|
|
|
corpUserFlag.value = uni.getStorageSync("apply-userinfo").corpUserFlag;
|
|
|
|
|
userInfo.value = uni.getStorageSync("apply-userinfo");
|
|
|
|
|
// 单独刷新系统通知
|
|
|
|
|
update.value++;
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
count.value = uni.getStorageSync("notice_info").count;
|
|
|
|
|
if (!isLogin.value) {
|
|
|
|
|
typeGroup.value = [
|
|
|
|
|
{
|
|
|
|
|
name: "系统通知",
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
} else {
|
|
|
|
|
typeGroup.value = [
|
|
|
|
|
{
|
|
|
|
|
name: "当前会话",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "系统通知",
|
|
|
|
|
count: count.value,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "通讯录",
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
}, 200);
|
|
|
|
|
|
|
|
|
|
if (isLogin.value && uni && uni.$UIKitStore) {
|
|
|
|
|
trackInit("ConversationUIKit");
|
|
|
|
|
// 重置选中会话
|
|
|
|
|
uni.$UIKitStore?.uiStore.selectConversation("");
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
const unread = uni.$UIKitNIM.V2NIMConversationService.getTotalUnreadCount();
|
|
|
|
|
if (unread === 0) {
|
|
|
|
|
uni.hideTabBarRedDot({
|
|
|
|
|
//隐藏数字
|
|
|
|
|
index: 3, //tabbar下标
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
uni.showTabBarRedDot({
|
|
|
|
|
index: 3, //tabbar下标
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}, 1000);
|
|
|
|
|
current.value = globalData.value.messageTab;
|
|
|
|
|
messageId.value = globalData.value.messageId;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
const goLogin = () => {
|
|
|
|
|
uni.reLaunch({
|
|
|
|
|
url: "/pages/login/index",
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
const goPage = ($path) => {
|
|
|
|
|
if ($path) {
|
|
|
|
|
uni.navigateTo({
|
|
|
|
|
url: $path,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const openTel = ($tel) => {
|
|
|
|
|
uni.makePhoneCall({
|
|
|
|
|
phoneNumber: $tel || "0371-6611 3723",
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const simage = ref("");
|
|
|
|
|
const serverPop = ref({
|
|
|
|
|
isShow: false,
|
|
|
|
|
});
|
|
|
|
|
const openServer = () => {
|
|
|
|
|
let image = uni.getStorageSync("bc-server-image");
|
|
|
|
|
if (image && !image.includes("https")) {
|
|
|
|
|
image = image.replace("http", "https");
|
|
|
|
|
}
|
|
|
|
|
simage.value = image;
|
|
|
|
|
serverPop.value.isShow = true;
|
|
|
|
|
};
|
|
|
|
|
let timeout = ref(null);
|
|
|
|
|
|
|
|
|
|
const getScrollInfo = (e) => {
|
|
|
|
|
resetScroll.value = 0;
|
|
|
|
|
if (!timeout.value) {
|
|
|
|
|
timeout.value = setTimeout(() => {
|
|
|
|
|
uni.$emit("pageScroll", e);
|
|
|
|
|
timeout.value = null;
|
|
|
|
|
}, 100);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const updateType = (e) => {
|
|
|
|
|
console.log(e);
|
|
|
|
|
resetScroll.value = 1;
|
|
|
|
|
globalData.value.messageTab = e;
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
|
@import "../NEUIKit/pages/styles/common.scss";
|
|
|
|
|
.i-items {
|
|
|
|
|
position: relative;
|
|
|
|
|
&:not(:first-child):after {
|
|
|
|
|
content: "";
|
|
|
|
|
display: block;
|
|
|
|
|
height: 1rpx;
|
|
|
|
|
width: calc(100% - 80px);
|
|
|
|
|
background: #eee;
|
|
|
|
|
position: absolute;
|
|
|
|
|
top: 0;
|
|
|
|
|
right: 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|