中文亚洲精品无码_熟女乱子伦免费_人人超碰人人爱国产_亚洲熟妇女综合网

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

網(wǎng)站開發(fā)知識體系推廣普通話的意義簡短

網(wǎng)站開發(fā)知識體系,推廣普通話的意義簡短,dedecms 營銷網(wǎng)站模板,怎樣才能建一個網(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://www.risenshineclean.com/news/47010.html

相關(guān)文章:

  • 尋花問柳專注做一家男人愛的網(wǎng)站百度云網(wǎng)盤資源搜索
  • 網(wǎng)絡(luò)營銷做私活網(wǎng)站智慧軟文發(fā)稿平臺官網(wǎng)
  • asp.net 網(wǎng)站備份免費域名注冊網(wǎng)站
  • 做網(wǎng)站抄代碼免費seo軟件
  • 建設(shè)網(wǎng)站制作網(wǎng)站營銷方案模板
  • 大連今天最新通知電商運營seo
  • 哈爾濱網(wǎng)站設(shè)計有哪些步驟寧波網(wǎng)站推廣聯(lián)系方式
  • 企業(yè)網(wǎng)站基本信息早教優(yōu)化深圳seo
  • 福建省做鞋批發(fā)網(wǎng)站百度開放云平臺
  • 官方網(wǎng)站首頁在線seo推廣軟件
  • php怎么做多個網(wǎng)站網(wǎng)站關(guān)鍵詞快速排名技術(shù)
  • 河北建設(shè)集團官網(wǎng)如何做好seo基礎(chǔ)優(yōu)化
  • 一級a做片性視頻.網(wǎng)站在線觀看鄭州seo排名第一
  • 寵物寄養(yǎng)網(wǎng)站畢業(yè)設(shè)計重慶百度關(guān)鍵詞優(yōu)化軟件
  • 網(wǎng)站建設(shè)公司排名搜索大全
  • 鄂州做網(wǎng)站報價谷歌搜索引擎免費入口鏡像
  • 廈門企業(yè)網(wǎng)站建設(shè)補貼百度官網(wǎng)首頁網(wǎng)址
  • 團購網(wǎng)站app制作seo網(wǎng)站的優(yōu)化方案
  • 微信公眾號搭建網(wǎng)站seo外推軟件
  • 網(wǎng)站建設(shè)代碼上傳廣州seo服務(wù)公司
  • c 做的web網(wǎng)站怎么發(fā)布網(wǎng)站推廣排名服務(wù)
  • 適合小學(xué)生的最新新聞湖北seo服務(wù)
  • 稅務(wù)網(wǎng)站建設(shè)建議深圳高端網(wǎng)站建設(shè)公司
  • 華夏名網(wǎng)修改網(wǎng)站信息網(wǎng)絡(luò)推廣員的前景
  • 上海網(wǎng)站建設(shè)怎么列舉五種網(wǎng)絡(luò)營銷模式
  • thinkphp 網(wǎng)站開發(fā)衡陽有實力seo優(yōu)化
  • 做公司網(wǎng)站聯(lián)系公司培訓(xùn)課程
  • 網(wǎng)站建設(shè)外包名詞解釋在線優(yōu)化工具
  • 大型網(wǎng)站制作建網(wǎng)站專業(yè)
  • 武漢網(wǎng)站開發(fā)建設(shè)湖北seo