xugenyuan

ref |> 修复直播频道预告卡上预约状态在登录和退出时未刷新问题

Signed-off-by: xugenyuan <xugenyuan@wondertek.com.cn>
@@ -46,6 +46,7 @@ export struct ZhSingleRow03 { @@ -46,6 +46,7 @@ export struct ZhSingleRow03 {
46 @State moreWidth:number = 22 46 @State moreWidth:number = 22
47 @State moreTips: string = '' 47 @State moreTips: string = ''
48 scroller: Scroller = new Scroller() 48 scroller: Scroller = new Scroller()
  49 + @Consume @Watch('pageShowForUpdateData') pageShow :number
49 50
50 resetMoreTips() { 51 resetMoreTips() {
51 console.log('resetMoreTips', this.moreWidth, this.initMoreWidth) 52 console.log('resetMoreTips', this.moreWidth, this.initMoreWidth)
@@ -89,7 +90,7 @@ export struct ZhSingleRow03 { @@ -89,7 +90,7 @@ export struct ZhSingleRow03 {
89 } 90 }
90 91
91 async aboutToAppear(): Promise<void> { 92 async aboutToAppear(): Promise<void> {
92 - if (HttpUtils.getUserId()) { 93 + if (HttpUtils.isLogin()) {
93 this.getReserveState(); 94 this.getReserveState();
94 } 95 }
95 this.loadImg = await onlyWifiLoadImg(); 96 this.loadImg = await onlyWifiLoadImg();
@@ -118,11 +119,23 @@ export struct ZhSingleRow03 { @@ -118,11 +119,23 @@ export struct ZhSingleRow03 {
118 } 119 }
119 } 120 }
120 }) 121 })
  122 +
  123 + // 可能有被动强制退出清空
  124 + EmitterUtils.receiveEvent(EmitterEventId.FORCE_USER_LOGIN_OUT, () => {
  125 + this.getReserveState()
  126 + })
121 } 127 }
122 128
  129 + pageShowForUpdateData() {
  130 + this.getReserveState()
  131 + }
123 132
124 // 请求所有预约状态 133 // 请求所有预约状态
125 async getReserveState() { 134 async getReserveState() {
  135 + if (false == HttpUtils.isLogin()) {
  136 + this.reservedIds = []
  137 + return
  138 + }
126 const reserveBean: reserveReqItem[] = this.compDTO.operDataList.map((item: ContentDTO) => { 139 const reserveBean: reserveReqItem[] = this.compDTO.operDataList.map((item: ContentDTO) => {
127 const reqItem: reserveReqItem = { 140 const reqItem: reserveReqItem = {
128 liveId: item.objectId.toString(), 141 liveId: item.objectId.toString(),