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 {
}
export interface LiveRoomItemBean {
// 消息id
id: string
text: string
senderUserAvatarUrl: string
senderUserName: string
... ...
... ... @@ -10,7 +10,7 @@ import {
import { LiveMessageIsHistoryMessage } from 'wdBean/src/main/ets/bean/live/LiveRoomBean'
import { SpConstants } from 'wdConstant'
import { ContentDetailRequest } from 'wdDetailPlayApi/Index'
import { Logger, SPHelper } from 'wdKit/Index'
import { LazyDataSource, Logger, SPHelper } from 'wdKit/Index'
import { ToastUtils } from 'wdKit/src/main/ets/utils/ToastUtils'
import { HttpUtils, ResponseDTO } from 'wdNetwork/Index'
import { LiveModel } from './LiveModel'
... ... @@ -231,4 +231,15 @@ export class LiveViewModel {
}
return mySelf
}
getLiveRoomItemBeanIndex(liveRoomItemBean:LiveRoomItemBean, dataSource:LazyDataSource<LiveRoomItemBean>):number {
let index = 0
for (let i = dataSource.totalCount() - 1; i >= 0; i--) {
const currentLiveRoomBean = dataSource.get(i);
if (currentLiveRoomBean.id == liveRoomItemBean.id) {
index = i
}
}
return index
}
}
... ...
... ... @@ -37,11 +37,16 @@ export struct TabLiveComponent {
Logger.debug(TAG, "1显示评论》》》: " + JSON.stringify(this.lastInputedComment))
switch (this.lastInputedComment.optionType) {
case LiveMessageOptType.ZH_UPDATE_MSG: {
const index = this.liveViewModel.getLiveRoomItemBeanIndex(this.lastInputedComment,this.liveList)
this.liveList.updateItem(this.lastInputedComment,index)
return
} break
case LiveMessageOptType.ZH_DELETE_MSG: {
} break
const index = this.liveViewModel.getLiveRoomItemBeanIndex(this.lastInputedComment,this.liveList)
this.liveList.deleteItem(index);
return
}
break
case LiveMessageOptType.ZH_TOP_MSG: {
} break
... ...