wangliang_wd

Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool into main

* 'main' of http://192.168.1.42/developOne/harmonyPool:
  ref |> 对接直播编辑和删除直播间IM消息
@@ -7,6 +7,8 @@ export interface LiveRoomBean { @@ -7,6 +7,8 @@ export interface LiveRoomBean {
7 } 7 }
8 8
9 export interface LiveRoomItemBean { 9 export interface LiveRoomItemBean {
  10 + // 消息id
  11 + id: string
10 text: string 12 text: string
11 senderUserAvatarUrl: string 13 senderUserAvatarUrl: string
12 senderUserName: string 14 senderUserName: string
@@ -10,7 +10,7 @@ import { @@ -10,7 +10,7 @@ import {
10 import { LiveMessageIsHistoryMessage } from 'wdBean/src/main/ets/bean/live/LiveRoomBean' 10 import { LiveMessageIsHistoryMessage } from 'wdBean/src/main/ets/bean/live/LiveRoomBean'
11 import { SpConstants } from 'wdConstant' 11 import { SpConstants } from 'wdConstant'
12 import { ContentDetailRequest } from 'wdDetailPlayApi/Index' 12 import { ContentDetailRequest } from 'wdDetailPlayApi/Index'
13 -import { Logger, SPHelper } from 'wdKit/Index' 13 +import { LazyDataSource, Logger, SPHelper } from 'wdKit/Index'
14 import { ToastUtils } from 'wdKit/src/main/ets/utils/ToastUtils' 14 import { ToastUtils } from 'wdKit/src/main/ets/utils/ToastUtils'
15 import { HttpUtils, ResponseDTO } from 'wdNetwork/Index' 15 import { HttpUtils, ResponseDTO } from 'wdNetwork/Index'
16 import { LiveModel } from './LiveModel' 16 import { LiveModel } from './LiveModel'
@@ -231,4 +231,15 @@ export class LiveViewModel { @@ -231,4 +231,15 @@ export class LiveViewModel {
231 } 231 }
232 return mySelf 232 return mySelf
233 } 233 }
  234 +
  235 + getLiveRoomItemBeanIndex(liveRoomItemBean:LiveRoomItemBean, dataSource:LazyDataSource<LiveRoomItemBean>):number {
  236 + let index = 0
  237 + for (let i = dataSource.totalCount() - 1; i >= 0; i--) {
  238 + const currentLiveRoomBean = dataSource.get(i);
  239 + if (currentLiveRoomBean.id == liveRoomItemBean.id) {
  240 + index = i
  241 + }
  242 + }
  243 + return index
  244 + }
234 } 245 }
@@ -37,11 +37,16 @@ export struct TabLiveComponent { @@ -37,11 +37,16 @@ export struct TabLiveComponent {
37 Logger.debug(TAG, "1显示评论》》》: " + JSON.stringify(this.lastInputedComment)) 37 Logger.debug(TAG, "1显示评论》》》: " + JSON.stringify(this.lastInputedComment))
38 switch (this.lastInputedComment.optionType) { 38 switch (this.lastInputedComment.optionType) {
39 case LiveMessageOptType.ZH_UPDATE_MSG: { 39 case LiveMessageOptType.ZH_UPDATE_MSG: {
40 - 40 + const index = this.liveViewModel.getLiveRoomItemBeanIndex(this.lastInputedComment,this.liveList)
  41 + this.liveList.updateItem(this.lastInputedComment,index)
  42 + return
41 } break 43 } break
42 case LiveMessageOptType.ZH_DELETE_MSG: { 44 case LiveMessageOptType.ZH_DELETE_MSG: {
43 -  
44 - } break 45 + const index = this.liveViewModel.getLiveRoomItemBeanIndex(this.lastInputedComment,this.liveList)
  46 + this.liveList.deleteItem(index);
  47 + return
  48 + }
  49 + break
45 case LiveMessageOptType.ZH_TOP_MSG: { 50 case LiveMessageOptType.ZH_TOP_MSG: {
46 51
47 } break 52 } break