chenquansheng

fix |> 在直播预约详情页面点击直播预约后返回直播频道列表预约状态没有更新

@@ -4,9 +4,8 @@ import { postInteractAccentionOperateParams } from 'wdBean'; @@ -4,9 +4,8 @@ import { postInteractAccentionOperateParams } from 'wdBean';
4 import { PageRepository } from '../../repository/PageRepository'; 4 import { PageRepository } from '../../repository/PageRepository';
5 import { ProcessUtils } from 'wdRouter'; 5 import { ProcessUtils } from 'wdRouter';
6 import { HttpUtils } from 'wdNetwork/Index'; 6 import { HttpUtils } from 'wdNetwork/Index';
7 -import { DateTimeUtils, SPHelper } from 'wdKit'; 7 +import { DateTimeUtils, SPHelper,Logger, ToastUtils,EmitterUtils,EmitterEventId } from 'wdKit';
8 import { LiveModel } from '../../viewmodel/LiveModel' 8 import { LiveModel } from '../../viewmodel/LiveModel'
9 -import { Logger, ToastUtils } from 'wdKit';  
10 import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; 9 import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
11 import { SpConstants } from 'wdConstant/Index' 10 import { SpConstants } from 'wdConstant/Index'
12 import { InfomationCardClick } from '../../utils/infomationCardClick'; 11 import { InfomationCardClick } from '../../utils/infomationCardClick';
@@ -94,6 +93,31 @@ export struct ZhSingleRow03 { @@ -94,6 +93,31 @@ export struct ZhSingleRow03 {
94 this.getReserveState(); 93 this.getReserveState();
95 } 94 }
96 this.loadImg = await onlyWifiLoadImg(); 95 this.loadImg = await onlyWifiLoadImg();
  96 +
  97 + // 获取预约
  98 + EmitterUtils.receiveEvent(EmitterEventId.LIVE_ROOM_SUBSCRIBE, (str?: string) => {
  99 + Logger.debug(TAG, 'receiveEvent LIVE_ROOM_SUBSCRIBE: ' + str)
  100 + if (str) {
  101 + // 跳转指定频道场景,传参底导id、频道id
  102 + const model: ReserveItemBean = JSON.parse(str)
  103 + for (let contentItem of this.compDTO.operDataList) {
  104 + let liveStr = new String(model.liveId)
  105 + if (contentItem.objectId == liveStr) {
  106 + if (model.subscribe){
  107 + this.reservedIds.push(contentItem.objectId.toString())
  108 + }else {
  109 + let index = this.reservedIds.findIndex(item => item == contentItem.objectId);
  110 + if (index > -1) {
  111 + this.reservedIds.splice(index, 1);
  112 + }
  113 + }
  114 + let time = DateTimeUtils.getTimeStamp().toString()
  115 + this.compDTO.timestamp = time
  116 + return
  117 + }
  118 + }
  119 + }
  120 + })
97 } 121 }
98 122
99 123