Showing
1 changed file
with
3 additions
and
65 deletions
| @@ -46,38 +46,12 @@ export struct LiveEmptyComponent { | @@ -46,38 +46,12 @@ export struct LiveEmptyComponent { | ||
| 46 | private timer: number = -1 | 46 | private timer: number = -1 |
| 47 | retry: () => void = () => { | 47 | retry: () => void = () => { |
| 48 | } | 48 | } |
| 49 | - | ||
| 50 | - createTimer() { | ||
| 51 | - if (this.emptyType === 8) { | ||
| 52 | - this.timer = setInterval(() => { | ||
| 53 | - this.timeNum--; | ||
| 54 | - if (this.timeNum === 0) { | ||
| 55 | - clearInterval(this.timer); | ||
| 56 | - } | ||
| 57 | - }, 1000); | ||
| 58 | - } | ||
| 59 | - } | ||
| 60 | - | ||
| 61 | - destroyTimer() { | ||
| 62 | - if (this.emptyType === 8) { | ||
| 63 | - clearInterval(this.timer); | ||
| 64 | - } | ||
| 65 | - } | ||
| 66 | - | ||
| 67 | - onPageShow(): void { | ||
| 68 | - this.createTimer() | ||
| 69 | - } | ||
| 70 | - | ||
| 71 | - aboutToAppear(): void { | ||
| 72 | - this.createTimer() | ||
| 73 | - } | ||
| 74 | - | ||
| 75 | onPageHide(): void { | 49 | onPageHide(): void { |
| 76 | - this.destroyTimer() | 50 | + |
| 77 | } | 51 | } |
| 78 | 52 | ||
| 79 | aboutToDisappear() { | 53 | aboutToDisappear() { |
| 80 | - this.destroyTimer() | 54 | + |
| 81 | } | 55 | } |
| 82 | 56 | ||
| 83 | build() { | 57 | build() { |
| @@ -98,7 +72,7 @@ export struct LiveEmptyComponent { | @@ -98,7 +72,7 @@ export struct LiveEmptyComponent { | ||
| 98 | // .width('this.EMPTY_IMAGE_WIDTH') | 72 | // .width('this.EMPTY_IMAGE_WIDTH') |
| 99 | // .height(this.EMPTY_IMAGE_HEIGHT) | 73 | // .height(this.EMPTY_IMAGE_HEIGHT) |
| 100 | 74 | ||
| 101 | - Text(this.emptyType !== 8 ? this.buildNoDataTip() : `${this.buildNoDataTip()}(${this.timeNum}s)`) | 75 | + Text(this.buildNoDataTip()) |
| 102 | .fontSize($r('app.float.font_size_14')) | 76 | .fontSize($r('app.float.font_size_14')) |
| 103 | .fontColor('#FF999999') | 77 | .fontColor('#FF999999') |
| 104 | .fontWeight(FontWeight.Normal) | 78 | .fontWeight(FontWeight.Normal) |
| @@ -107,42 +81,6 @@ export struct LiveEmptyComponent { | @@ -107,42 +81,6 @@ export struct LiveEmptyComponent { | ||
| 107 | .onClick((event: ClickEvent) => { | 81 | .onClick((event: ClickEvent) => { |
| 108 | Logger.info(TAG, `noProgrammeData onClick event?.source: ${event.source}`); | 82 | Logger.info(TAG, `noProgrammeData onClick event?.source: ${event.source}`); |
| 109 | }) | 83 | }) |
| 110 | - | ||
| 111 | - if (this.isShowButton()) { | ||
| 112 | - if (this.emptyType !== 15) { | ||
| 113 | - Button('点击重试') | ||
| 114 | - .type(ButtonType.Normal) | ||
| 115 | - .width(80) | ||
| 116 | - .height(28) | ||
| 117 | - .backgroundColor('#fffffff') | ||
| 118 | - .fontColor('#FF666666') | ||
| 119 | - .border({ width: 1 }) | ||
| 120 | - .borderColor('#FFEDEDED') | ||
| 121 | - .borderRadius(4) | ||
| 122 | - .fontSize($r('app.float.font_size_12')) | ||
| 123 | - .margin({ top: 16 }) | ||
| 124 | - .padding(0) | ||
| 125 | - .onClick(() => { | ||
| 126 | - this.retry() | ||
| 127 | - }) | ||
| 128 | - } else { | ||
| 129 | - Button('点击重试') | ||
| 130 | - .type(ButtonType.Normal) | ||
| 131 | - .width(80) | ||
| 132 | - .height(28) | ||
| 133 | - .backgroundColor(Color.Black) | ||
| 134 | - .fontColor('#FFCCCCCC') | ||
| 135 | - .border({ width: 1 }) | ||
| 136 | - .borderColor('#4DFFFFFF') | ||
| 137 | - .borderRadius(4) | ||
| 138 | - .fontSize($r('app.float.font_size_12')) | ||
| 139 | - .margin({ top: 16 }) | ||
| 140 | - .padding(0) | ||
| 141 | - .onClick(() => { | ||
| 142 | - this.retry() | ||
| 143 | - }) | ||
| 144 | - } | ||
| 145 | - } | ||
| 146 | } | 84 | } |
| 147 | .justifyContent(FlexAlign.Center) | 85 | .justifyContent(FlexAlign.Center) |
| 148 | .width(this.emptyWidth) | 86 | .width(this.emptyWidth) |
-
Please register or login to post a comment