国产亚洲精品福利在线无卡一,国产精久久一区二区三区,亚洲精品无码国模,精品久久久久久无码专区不卡

當前位置: 首頁 > news >正文

記事本做網(wǎng)站怎么不行啦網(wǎng)站建站價格

記事本做網(wǎng)站怎么不行啦,網(wǎng)站建站價格,做網(wǎng)站的支付,農(nóng)業(yè)機械網(wǎng)站模板鴻蒙開發(fā)融云demo消息未讀數(shù) 跟著我一步步搭建帶界面的融云demo,這次是要顯示未讀數(shù),未讀數(shù)有兩個,一個是消息列表的未讀數(shù),一個是主頁消息tab上的未讀數(shù)。 一、消息列表的未讀數(shù) 先看下效果圖: 關(guān)鍵代碼如下&#…
鴻蒙開發(fā)融云demo消息未讀數(shù)

跟著我一步步搭建帶界面的融云demo,這次是要顯示未讀數(shù),未讀數(shù)有兩個,一個是消息列表的未讀數(shù),一個是主頁消息tab上的未讀數(shù)。

一、消息列表的未讀數(shù)

先看下效果圖:

在這里插入圖片描述
關(guān)鍵代碼如下:

if (this.chatItem.unreadMessageCount > 0 || this.customUnReadCount > 0) { // 紅點消息大于0條時渲染紅點Row() {Text(this.chatItem.unreadMessageCount > 0?`${this.chatItem.unreadMessageCount}`:`${this.customUnReadCount}`).borderRadius($r('app.integer.layout_8')).constraintSize({minWidth: $r('app.integer.opt_layout_chat_view_red_dot_width')}).height($r('app.integer.opt_layout_chat_view_red_dot_height')).backgroundColor($r('app.color.color_red')).fontSize($r('app.integer.text_font_10')).textAlign(TextAlign.Center).fontColor(Color.White)}.alignItems(VerticalAlign.Center).justifyContent(FlexAlign.Center).borderRadius($r('app.integer.layout_10')).margin({ top: $r('app.integer.layout_minus_8'), left: $r('app.integer.layout_24') }).constraintSize({minWidth: $r('app.integer.opt_layout_chat_view_red_dot_container_width')}).height($r('app.integer.opt_layout_chat_view_red_dot_container_height')).backgroundColor(Color.White).alignRules({top: { anchor: '__container__', align: VerticalAlign.Top },left: { anchor: '__container__', align: HorizontalAlign.Start }}).opacity((this.chatItem.unreadMessageCount > 0 || this.customUnReadCount > 0) ? 1 : 0).id('badge')}
二、主頁消息tab的未讀數(shù):

先看下效果圖:
在這里插入圖片描述
關(guān)鍵代碼如下:

public static getPrivateUnReadCount(unreadCountCallback: (unreadCount: number) => void) {let unreadCount = 0let conTypeList = new List<ConversationType>();conTypeList.add(ConversationType.Private);let isContainBlocked = false;IMEngine.getInstance().getUnreadCountByTypes(conTypeList, isContainBlocked).then(result => {if (EngineError.Success !== result.code) {// 獲取未讀數(shù)失敗return;}if (!result.data) {// 未讀數(shù)為 nullreturn;}unreadCount = result.data as number;unreadCountCallback(unreadCount )});}
@BuilderTabBottom(item: TabItem, index: number) {Column() {// 發(fā)現(xiàn)在TabBottom傳值改變不了,就用要顯示未讀數(shù)加上位置判斷,用if else顯示組件,這樣不用算badge的size// 規(guī)則:字符串’-1‘代表的是紅點,其他字符串數(shù)字為數(shù)字紅點if ((isNotEmptyString(this.unreadNumHome) && index === 0) ||(isNotEmptyString(this.unreadNumMsg) && index === 1) ||(isNotEmptyString(this.unreadNumMine) && index === 2)) {Badge({value: index === 0 ? (this.unreadNumHome === '-1' ? '' : this.unreadNumHome) :index === 1 ? (this.unreadNumMsg === '-1' ? '' : this.unreadNumMsg) :(this.unreadNumMine === '-1' ? '' : this.unreadNumMine), // 設(shè)置 badge 的顯示文本position: BadgePosition.RightTop, // 設(shè)置 badge 顯示在右上角style: index === 0 || index === 1 ? { badgeColor: $r('app.color.color_red') } :{ badgeSize: 9, badgeColor: $r('app.color.color_red') }// 設(shè)置 badge 的顯示樣式,首頁和消息不用限制大小,讓它自適應(yīng)}) {Column() {Image(this.selectedIndex === index ? item.imageActivated : item.imageOriginal).height($r('app.float.tab_image_size')).width($r('app.float.tab_image_size'))}.padding({ left: 10, right: 10, })}.margin({ top: 5, bottom: 5 })} else {Column() {Image(this.selectedIndex === index ? item.imageActivated : item.imageOriginal).height($r('app.float.tab_image_size')).width($r('app.float.tab_image_size'))}.padding({ left: 10, right: 10, }).margin({ top: 5, bottom: 5 })}Text(item.title).fontSize($r('app.float.tab_text_font_size')).fontWeight(500).fontColor(this.selectedIndex === index ? $r('app.color.color_main') : Color.White).textAlign(TextAlign.Center).margin({bottom: $r('app.float.tab_text_margin_bottom')})}.justifyContent(FlexAlign.Center).height('100%').width('100%').backgroundColor($r("app.color.color_black")).onClick(() => {this.selectedIndex = index})}
整個鴻蒙融云demo項目結(jié)構(gòu)圖:

在這里插入圖片描述
有問題或者需要完整源碼的私信我

http://m.aloenet.com.cn/news/39739.html

相關(guān)文章:

  • 龍華網(wǎng)站建設(shè)多少錢外貿(mào)營銷型網(wǎng)站制作公司
  • 遵義公司網(wǎng)站搭建多少錢北京seo招聘信息
  • web開發(fā)是做網(wǎng)站搜索引擎推廣培訓
  • magento做預訂類網(wǎng)站免費做網(wǎng)站的平臺
  • 網(wǎng)站開發(fā)常去的論壇寧波網(wǎng)站推廣網(wǎng)站優(yōu)化
  • 花生殼做網(wǎng)站速度個人網(wǎng)站推廣怎么做
  • 電子商務(wù)網(wǎng)站開發(fā)與建設(shè)試卷網(wǎng)絡(luò)廣告推廣
  • 電子商務(wù)網(wǎng)站建設(shè)屬性百度互聯(lián)網(wǎng)營銷是什么
  • 手機網(wǎng)站開發(fā) caso平臺
  • 網(wǎng)站全程設(shè)計技術(shù)百度一下打開網(wǎng)頁
  • 合肥大建設(shè)優(yōu)化seo設(shè)置
  • 自己做頭像的網(wǎng)站非流光全網(wǎng)推廣平臺
  • 昆明網(wǎng)站建設(shè)開發(fā)制作全國分站seo
  • 愛網(wǎng)站網(wǎng)站查詢鄭州seo課程
  • 購物網(wǎng)站建設(shè)教程關(guān)鍵詞推廣效果
  • 天津個人網(wǎng)站建設(shè)廊坊seo優(yōu)化排名
  • 志愿者管理網(wǎng)站開發(fā)的需求分析 基于 java廣告接單平臺有哪些
  • 南沙網(wǎng)站建設(shè)小說搜索風云榜
  • 懷集建設(shè)房管部門網(wǎng)站淘寶美工培訓
  • 江西景德鎮(zhèn)建設(shè)廳網(wǎng)站seo行業(yè)崗位
  • 江西會昌建設(shè)局網(wǎng)站建站軟件可以不通過網(wǎng)絡(luò)建設(shè)嗎
  • 網(wǎng)站管理系統(tǒng)后臺不能發(fā)布文章了網(wǎng)絡(luò)營銷顧問
  • 石家莊網(wǎng)站制作公司最大的中文搜索引擎
  • 網(wǎng)站設(shè)計制作系統(tǒng)哪個好搜索引擎優(yōu)化的根本目的
  • 制作網(wǎng)站哪里好廣告投放方案
  • 網(wǎng)站 切圖中國疫情最新情況
  • 工業(yè)設(shè)計和產(chǎn)品設(shè)計哪個好seo關(guān)鍵詞優(yōu)化軟件合作
  • 如何查公司的工商注冊信息網(wǎng)站推廣與優(yōu)化方案
  • 深圳企業(yè)網(wǎng)站制作哪家好百度搜索引擎收錄
  • 做網(wǎng)站人太原網(wǎng)站建設(shè)制作