需新增:添加好友页面,优化各模块页面
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
@touchstart="handleTouchStart"
|
||||
@touchend="handleTouchEnd"
|
||||
>
|
||||
<ConversationHeader>
|
||||
<ConversationHeader :topCount="totalUnreadCount">
|
||||
<TUISearch searchType="global" />
|
||||
</ConversationHeader>
|
||||
<ConversationNetwork />
|
||||
@@ -28,7 +28,7 @@
|
||||
import ConversationList from './conversation-list/index.vue'
|
||||
import ConversationHeader from './conversation-header/index.vue'
|
||||
import ConversationNetwork from './conversation-network/index.vue'
|
||||
import { onHide } from '@dcloudio/uni-app'
|
||||
import { onHide, onShow } from '@dcloudio/uni-app'
|
||||
// #ifdef MP-WEIXIN
|
||||
// uniapp packaged mini-programs are integrated by default, and the default initialization entry file is imported here
|
||||
// TUIChatKit init needs to be encapsulated because uni vue2 will report an error when compiling H5 directly through conditional compilation
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
const emits = defineEmits(['handleSwitchConversation'])
|
||||
|
||||
const totalUnreadCount = ref(0)
|
||||
const totalUnreadCount = ref('')
|
||||
const headerRef = ref<typeof ConversationHeader>()
|
||||
const conversationListDomRef = ref<typeof ConversationList>()
|
||||
const touchX = ref<number>(0)
|
||||
@@ -117,24 +117,24 @@
|
||||
}
|
||||
}
|
||||
|
||||
TUIStore.watch(StoreName.CONV, {
|
||||
totalUnreadCount: (count: number) => {
|
||||
totalUnreadCount.value = count
|
||||
const tabBarIndex = getTabBarIndex() ?? -1
|
||||
if (tabBarIndex >= 0) {
|
||||
if (count > 0) {
|
||||
uni.setTabBarBadge({
|
||||
index: tabBarIndex,
|
||||
text: count > 99 ? '99+' : count.toString()
|
||||
})
|
||||
} else {
|
||||
uni.removeTabBarBadge({
|
||||
index: tabBarIndex
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
// TUIStore.watch(StoreName.CONV, {
|
||||
// totalUnreadCount: (count: number) => {
|
||||
// totalUnreadCount.value = count
|
||||
// const tabBarIndex = getTabBarIndex() ?? -1
|
||||
// if (tabBarIndex >= 0) {
|
||||
// if (count > 0) {
|
||||
// uni.setTabBarBadge({
|
||||
// index: tabBarIndex,
|
||||
// text: count > 99 ? '99+' : count.toString()
|
||||
// })
|
||||
// } else {
|
||||
// uni.removeTabBarBadge({
|
||||
// index: tabBarIndex
|
||||
// })
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
|
||||
TUIStore.watch(StoreName.CUSTOM, {
|
||||
isShowConversationHeader: (showStatus: boolean) => {
|
||||
@@ -198,6 +198,25 @@
|
||||
const getPassingRef = ref => {
|
||||
ref.value = conversationListDomRef.value
|
||||
}
|
||||
|
||||
onShow(async () => {
|
||||
TUIStore.watch(StoreName.CONV, {
|
||||
totalUnreadCount: (count: number) => {
|
||||
if (count > 0) {
|
||||
totalUnreadCount.value = count > 99 ? '99+' : String(count)
|
||||
uni.setTabBarBadge({
|
||||
index: 0,
|
||||
text: count > 99 ? '99+' : count.toString()
|
||||
})
|
||||
} else {
|
||||
totalUnreadCount.value = ''
|
||||
uni.removeTabBarBadge({
|
||||
index: 0
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped src="./style/index.scss"></style>
|
||||
|
||||
Reference in New Issue
Block a user