陈剑华

Merge remote-tracking branch 'origin/main'

1 import MinePageDatasModel from '../../../model/MinePageDatasModel' 1 import MinePageDatasModel from '../../../model/MinePageDatasModel'
  2 +import { onlyWifiLoadImg } from '../../../utils/lazyloadImg'
2 import { AppointmentOperationRequestItem } from '../../../viewmodel/AppointmentOperationRequestItem' 3 import { AppointmentOperationRequestItem } from '../../../viewmodel/AppointmentOperationRequestItem'
3 import { MineAppointmentItem } from '../../../viewmodel/MineAppointmentItem' 4 import { MineAppointmentItem } from '../../../viewmodel/MineAppointmentItem'
4 import { MyCustomDialog } from '../../reusable/MyCustomDialog' 5 import { MyCustomDialog } from '../../reusable/MyCustomDialog'
5 6
6 @Component 7 @Component
7 -export struct AppointmentListChildComponent{ 8 +export struct AppointmentListChildComponent {
8 @ObjectLink item: MineAppointmentItem 9 @ObjectLink item: MineAppointmentItem
  10 + @State loadImg: boolean = false;
  11 +
  12 + async aboutToAppear(): Promise<void> {
  13 + this.loadImg = await onlyWifiLoadImg();
  14 + }
  15 +
9 dialogController: CustomDialogController = new CustomDialogController({ 16 dialogController: CustomDialogController = new CustomDialogController({
10 builder: MyCustomDialog({ 17 builder: MyCustomDialog({
11 cancel: this.onCancel, 18 cancel: this.onCancel,
@@ -20,18 +27,20 @@ export struct AppointmentListChildComponent{ @@ -20,18 +27,20 @@ export struct AppointmentListChildComponent{
20 customStyle: true 27 customStyle: true
21 }) 28 })
22 29
23 -  
24 build() { 30 build() {
25 - Column(){  
26 - Stack(){  
27 - Image(this.item?.imageUrl[0]) 31 + Column() {
  32 + Stack() {
  33 + Image(this.loadImg ? this.item?.imageUrl[0] : '')
  34 + .backgroundColor(this.loadImg ? $r('app.color.color_B0B0B0') : 0xf5f5f5)
  35 + .width('100%')
  36 + .aspectRatio(16 / 9)
28 .objectFit(ImageFit.Auto) 37 .objectFit(ImageFit.Auto)
29 .interpolation(ImageInterpolation.High) 38 .interpolation(ImageInterpolation.High)
30 39
31 40
32 - if(this.item.relType === 1){  
33 - Row(){  
34 - Row(){ 41 + if (this.item.relType === 1) {
  42 + Row() {
  43 + Row() {
35 Image($r('app.media.reserve_icon')) 44 Image($r('app.media.reserve_icon'))
36 .width('42lpx') 45 .width('42lpx')
37 .height('35lpx') 46 .height('35lpx')
@@ -47,7 +56,7 @@ export struct AppointmentListChildComponent{ @@ -47,7 +56,7 @@ export struct AppointmentListChildComponent{
47 .layoutWeight(1) 56 .layoutWeight(1)
48 .textAlign(TextAlign.Center) 57 .textAlign(TextAlign.Center)
49 }.width('94lpx') 58 }.width('94lpx')
50 - .margin({bottom:'15lpx',right:'15lpx'}) 59 + .margin({ bottom: '15lpx', right: '15lpx' })
51 }.width('100%') 60 }.width('100%')
52 .height('100%') 61 .height('100%')
53 .alignItems(VerticalAlign.Bottom) 62 .alignItems(VerticalAlign.Bottom)
@@ -56,7 +65,7 @@ export struct AppointmentListChildComponent{ @@ -56,7 +65,7 @@ export struct AppointmentListChildComponent{
56 }.width('100%') 65 }.width('100%')
57 .height('376lpx') 66 .height('376lpx')
58 67
59 - Column(){ 68 + Column() {
60 Text(this.item.title) 69 Text(this.item.title)
61 .fontWeight('400lpx') 70 .fontWeight('400lpx')
62 .fontSize('33lpx') 71 .fontSize('33lpx')
@@ -64,28 +73,28 @@ export struct AppointmentListChildComponent{ @@ -64,28 +73,28 @@ export struct AppointmentListChildComponent{
64 .lineHeight('48lpx') 73 .lineHeight('48lpx')
65 .maxLines(2) 74 .maxLines(2)
66 .textOverflow({ overflow: TextOverflow.Ellipsis }) 75 .textOverflow({ overflow: TextOverflow.Ellipsis })
67 - .margin({bottom:'23lpx'}) 76 + .margin({ bottom: '23lpx' })
68 .textAlign(TextAlign.Start) 77 .textAlign(TextAlign.Start)
69 .width('100%') 78 .width('100%')
70 - Row(){  
71 - Row(){  
72 - if(this.item.relType === 2){ 79 + Row() {
  80 + Row() {
  81 + if (this.item.relType === 2) {
73 Image($r('app.media.play_status_history_icon')) 82 Image($r('app.media.play_status_history_icon'))
74 .objectFit(ImageFit.Auto) 83 .objectFit(ImageFit.Auto)
75 .interpolation(ImageInterpolation.High) 84 .interpolation(ImageInterpolation.High)
76 .width('38lpx') 85 .width('38lpx')
77 .height('38lpx') 86 .height('38lpx')
78 - .margin({right:'12lpx'}) 87 + .margin({ right: '12lpx' })
79 Text('已结束').fontColor($r('app.color.color_999999')) 88 Text('已结束').fontColor($r('app.color.color_999999'))
80 .fontWeight('500lpx') 89 .fontWeight('500lpx')
81 .fontSize('23lpx') 90 .fontSize('23lpx')
82 - }else { 91 + } else {
83 Image($r('app.media.play_status_icon')) 92 Image($r('app.media.play_status_icon'))
84 .objectFit(ImageFit.Auto) 93 .objectFit(ImageFit.Auto)
85 .interpolation(ImageInterpolation.High) 94 .interpolation(ImageInterpolation.High)
86 .width('38lpx') 95 .width('38lpx')
87 .height('38lpx') 96 .height('38lpx')
88 - .margin({right:'12lpx'}) 97 + .margin({ right: '12lpx' })
89 Text(this.item.timePre).fontColor($r('app.color.color_ED2800')) 98 Text(this.item.timePre).fontColor($r('app.color.color_ED2800'))
90 .fontWeight('500lpx') 99 .fontWeight('500lpx')
91 .fontSize('23lpx') 100 .fontSize('23lpx')
@@ -94,35 +103,37 @@ export struct AppointmentListChildComponent{ @@ -94,35 +103,37 @@ export struct AppointmentListChildComponent{
94 .interpolation(ImageInterpolation.High) 103 .interpolation(ImageInterpolation.High)
95 .width('12lpx') 104 .width('12lpx')
96 .height('31lpx') 105 .height('31lpx')
97 - .margin({right:'4lpx'}) 106 + .margin({ right: '4lpx' })
98 Text(`${this.item.timeBack}开始`).fontColor($r('app.color.color_ED2800')) 107 Text(`${this.item.timeBack}开始`).fontColor($r('app.color.color_ED2800'))
99 .fontWeight('500lpx') 108 .fontWeight('500lpx')
100 .fontSize('23lpx') 109 .fontSize('23lpx')
101 .lineHeight('31lpx') 110 .lineHeight('31lpx')
102 } 111 }
103 - }.padding({left:'19lpx',right:'19lpx'}) 112 + }
  113 + .padding({ left: '19lpx', right: '19lpx' })
104 .height('46lpx') 114 .height('46lpx')
105 .alignItems(VerticalAlign.Center) 115 .alignItems(VerticalAlign.Center)
106 .backgroundColor($r('app.color.color_F5F5F5')) 116 .backgroundColor($r('app.color.color_F5F5F5'))
107 .borderRadius('4lpx') 117 .borderRadius('4lpx')
  118 +
108 Blank() 119 Blank()
109 .layoutWeight(1) 120 .layoutWeight(1)
110 - if(this.item.relType === 1){  
111 - Text(this.item.isAppointment?"已预约":"预约") 121 + if (this.item.relType === 1) {
  122 + Text(this.item.isAppointment ? "已预约" : "预约")
112 .fontWeight(400) 123 .fontWeight(400)
113 .fontSize('23lpx') 124 .fontSize('23lpx')
114 - .backgroundColor(this.item.isAppointment?$r('app.color.color_F5F5F5'):$r('app.color.color_ED2800'))  
115 - .fontColor(this.item.isAppointment?$r('app.color.color_CCCCCC'):$r('app.color.white')) 125 + .backgroundColor(this.item.isAppointment ? $r('app.color.color_F5F5F5') : $r('app.color.color_ED2800'))
  126 + .fontColor(this.item.isAppointment ? $r('app.color.color_CCCCCC') : $r('app.color.white'))
116 .lineHeight('31lpx') 127 .lineHeight('31lpx')
117 .textAlign(TextAlign.Center) 128 .textAlign(TextAlign.Center)
118 .width('100lpx') 129 .width('100lpx')
119 .height('46lpx') 130 .height('46lpx')
120 .borderRadius('6lpx') 131 .borderRadius('6lpx')
121 - .onClick(()=>{ 132 + .onClick(() => {
122 this.dialogController.open() 133 this.dialogController.open()
123 }) 134 })
124 - }else {  
125 - Text(this.item.relType === 2?"去观看":"看回放") 135 + } else {
  136 + Text(this.item.relType === 2 ? "去观看" : "看回放")
126 .fontWeight(400) 137 .fontWeight(400)
127 .fontSize('23lpx') 138 .fontSize('23lpx')
128 .backgroundColor($r('app.color.color_ED2800')) 139 .backgroundColor($r('app.color.color_ED2800'))
@@ -135,7 +146,12 @@ export struct AppointmentListChildComponent{ @@ -135,7 +146,12 @@ export struct AppointmentListChildComponent{
135 } 146 }
136 } 147 }
137 } 148 }
138 - .padding({left:'23lpx',right:'23lpx',top:'15lpx',bottom:'23lpx'}) 149 + .padding({
  150 + left: '23lpx',
  151 + right: '23lpx',
  152 + top: '15lpx',
  153 + bottom: '23lpx'
  154 + })
139 }.margin({ left: 10, right: 10 }) 155 }.margin({ left: 10, right: 10 })
140 .backgroundColor($r('app.color.white')) 156 .backgroundColor($r('app.color.white'))
141 .borderRadius('8lpx') 157 .borderRadius('8lpx')
@@ -145,20 +161,19 @@ export struct AppointmentListChildComponent{ @@ -145,20 +161,19 @@ export struct AppointmentListChildComponent{
145 console.info('Callback when the first button is clicked') 161 console.info('Callback when the first button is clicked')
146 } 162 }
147 163
148 - onAccept(){ 164 + onAccept() {
149 console.info('Callback when the second button is clicked') 165 console.info('Callback when the second button is clicked')
150 this.appointmentOperation() 166 this.appointmentOperation()
151 } 167 }
152 168
153 - appointmentOperation(){  
154 - let item = new AppointmentOperationRequestItem(this.item.relId,this.item.liveId+"",!this.item.isAppointment)  
155 - MinePageDatasModel.getAppointmentOperation(item,getContext(this)).then((value)=>{  
156 - if(value!=null){ 169 + appointmentOperation() {
  170 + let item = new AppointmentOperationRequestItem(this.item.relId, this.item.liveId + "", !this.item.isAppointment)
  171 + MinePageDatasModel.getAppointmentOperation(item, getContext(this)).then((value) => {
  172 + if (value != null) {
157 if (value.code === 0 || value.code.toString() === "0") { 173 if (value.code === 0 || value.code.toString() === "0") {
158 this.item.isAppointment = !this.item.isAppointment 174 this.item.isAppointment = !this.item.isAppointment
159 } 175 }
160 } 176 }
161 }) 177 })
162 } 178 }
163 -  
164 } 179 }
@@ -12,6 +12,7 @@ import LoadMoreLayout from '../page/LoadMoreLayout'; @@ -12,6 +12,7 @@ import LoadMoreLayout from '../page/LoadMoreLayout';
12 import { LottieView } from '../../components/lottie/LottieView'; 12 import { LottieView } from '../../components/lottie/LottieView';
13 import dataPreferences from '@ohos.data.preferences'; 13 import dataPreferences from '@ohos.data.preferences';
14 import { BusinessError } from '@ohos.base'; 14 import { BusinessError } from '@ohos.base';
  15 +import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
15 16
16 const TAG: string = 'LiveMorePage'; 17 const TAG: string = 'LiveMorePage';
17 18
@@ -45,8 +46,12 @@ struct LiveMorePage { @@ -45,8 +46,12 @@ struct LiveMorePage {
45 // 点击过的数据 46 // 点击过的数据
46 @State clickDatas: Array<string> = [] 47 @State clickDatas: Array<string> = []
47 48
48 - async aboutToAppear() { 49 + @State loadImg: boolean = false;
  50 +
  51 +
  52 + async aboutToAppear() : Promise<void>{
49 await this.getPreferencesFromStorage() 53 await this.getPreferencesFromStorage()
  54 + this.loadImg = await onlyWifiLoadImg();
50 this.getLivMoreClickPreference() 55 this.getLivMoreClickPreference()
51 Logger.debug(TAG, '数据:' + JSON.stringify(this.clickDatas)) 56 Logger.debug(TAG, '数据:' + JSON.stringify(this.clickDatas))
52 this.currentPage = 1 57 this.currentPage = 1
@@ -155,9 +160,10 @@ struct LiveMorePage { @@ -155,9 +160,10 @@ struct LiveMorePage {
155 .fontColor(this.isClicked(item.objectId) ? $r('app.color.color_848484') : $r('app.color.color_222222')) 160 .fontColor(this.isClicked(item.objectId) ? $r('app.color.color_848484') : $r('app.color.color_222222'))
156 Stack() { 161 Stack() {
157 if (item.fullColumnImgUrls && item.fullColumnImgUrls.length > 0) { 162 if (item.fullColumnImgUrls && item.fullColumnImgUrls.length > 0) {
158 - Image(item.fullColumnImgUrls[0].url) 163 + Image(this.loadImg?item.fullColumnImgUrls[0].url:'')
  164 + .backgroundColor(this.loadImg ? $r('app.color.color_B0B0B0') : 0xf5f5f5)
159 .width('100%') 165 .width('100%')
160 - .height(196) 166 + .aspectRatio(16 / 9)
161 .borderRadius(4) 167 .borderRadius(4)
162 } 168 }
163 this.LiveImage(item) 169 this.LiveImage(item)
@@ -13,6 +13,7 @@ import { HttpUtils } from 'wdNetwork/Index'; @@ -13,6 +13,7 @@ import { HttpUtils } from 'wdNetwork/Index';
13 import { WDRouterPage, WDRouterRule } from 'wdRouter' 13 import { WDRouterPage, WDRouterRule } from 'wdRouter'
14 import { LazyDataSource } from 'wdKit/Index'; 14 import { LazyDataSource } from 'wdKit/Index';
15 import LoadMoreLayout from '../page/LoadMoreLayout' 15 import LoadMoreLayout from '../page/LoadMoreLayout'
  16 +import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
16 17
17 const TAG: string = 'ReserveMorePage'; 18 const TAG: string = 'ReserveMorePage';
18 19
@@ -45,9 +46,10 @@ struct ReserveMorePage { @@ -45,9 +46,10 @@ struct ReserveMorePage {
45 @State isShow: boolean = false 46 @State isShow: boolean = false
46 @State private liveId: string = '' 47 @State private liveId: string = ''
47 @State isLoadingAttention: boolean = false 48 @State isLoadingAttention: boolean = false
  49 + @State loadImg: boolean = false;
48 50
49 build() { 51 build() {
50 - Column(){ 52 + Column() {
51 this.TabbarNormal() 53 this.TabbarNormal()
52 if (this.viewType == ViewType.LOADING) { 54 if (this.viewType == ViewType.LOADING) {
53 this.LoadingLayout() 55 this.LoadingLayout()
@@ -85,7 +87,7 @@ struct ReserveMorePage { @@ -85,7 +87,7 @@ struct ReserveMorePage {
85 87
86 @Builder 88 @Builder
87 ListLayout() { 89 ListLayout() {
88 - List({scroller: this.scroller}) { 90 + List({ scroller: this.scroller }) {
89 // 下拉刷新 91 // 下拉刷新
90 LazyForEach(this.data, (contentDTO: ContentDTO, index: number) => { 92 LazyForEach(this.data, (contentDTO: ContentDTO, index: number) => {
91 ListItem() { 93 ListItem() {
@@ -110,7 +112,7 @@ struct ReserveMorePage { @@ -110,7 +112,7 @@ struct ReserveMorePage {
110 .height('calc(100% - 44vp)') 112 .height('calc(100% - 44vp)')
111 .onReachEnd(() => { 113 .onReachEnd(() => {
112 Logger.debug(TAG, "触底了"); 114 Logger.debug(TAG, "触底了");
113 - if(!this.isLoading && this.hasMore){ 115 + if (!this.isLoading && this.hasMore) {
114 //加载分页数据 116 //加载分页数据
115 this.currentPage++; 117 this.currentPage++;
116 this.getData() 118 this.getData()
@@ -127,9 +129,13 @@ struct ReserveMorePage { @@ -127,9 +129,13 @@ struct ReserveMorePage {
127 buildItem(item: ContentDTO, index: number) { 129 buildItem(item: ContentDTO, index: number) {
128 Column() { 130 Column() {
129 Stack() { 131 Stack() {
130 - Image(item.fullColumnImgUrls[0]?.url) 132 + Image(this.loadImg ? item.fullColumnImgUrls[0]?.url : '')
131 .width('100%') 133 .width('100%')
  134 + .aspectRatio(16 / 9)
  135 + .backgroundColor(this.loadImg ? $r('app.color.color_B0B0B0') : $r('app.color.color_33A3A3A3'))
132 .objectFit(ImageFit.Contain) 136 .objectFit(ImageFit.Contain)
  137 + .borderWidth(0.5)
  138 + .borderColor($r('app.color.color_0D000000'))
133 .borderRadius({ 139 .borderRadius({
134 topLeft: '4vp', 140 topLeft: '4vp',
135 topRight: '4vp' 141 topRight: '4vp'
@@ -152,7 +158,12 @@ struct ReserveMorePage { @@ -152,7 +158,12 @@ struct ReserveMorePage {
152 Image($r('app.media.reserve_play_icon')) 158 Image($r('app.media.reserve_play_icon'))
153 .width(20) 159 .width(20)
154 .height(20) 160 .height(20)
155 - .margin({ left: 10, top: 2, bottom: 2, right: 6 }) 161 + .margin({
  162 + left: 10,
  163 + top: 2,
  164 + bottom: 2,
  165 + right: 6
  166 + })
156 167
157 Text(this.getReserveDate(item.liveInfo.liveStartTime, 1)) 168 Text(this.getReserveDate(item.liveInfo.liveStartTime, 1))
158 .fontSize(12) 169 .fontSize(12)
@@ -190,7 +201,8 @@ struct ReserveMorePage { @@ -190,7 +201,8 @@ struct ReserveMorePage {
190 .width(20) 201 .width(20)
191 .height(20) 202 .height(20)
192 .color(!this.isReserved(item) ? $r('app.color.color_fff') : $r('app.color.color_CCCCCC')) 203 .color(!this.isReserved(item) ? $r('app.color.color_fff') : $r('app.color.color_CCCCCC'))
193 - .visibility((this.isLoadingAttention && this.liveId == item.objectId) ? Visibility.Visible : Visibility.None) 204 + .visibility((this.isLoadingAttention && this.liveId == item.objectId) ? Visibility.Visible :
  205 + Visibility.None)
194 206
195 Text(!this.isReserved(item) ? '预约' : '已预约') 207 Text(!this.isReserved(item) ? '预约' : '已预约')
196 .fontSize($r('app.float.vp_12')) 208 .fontSize($r('app.float.vp_12'))
@@ -199,14 +211,21 @@ struct ReserveMorePage { @@ -199,14 +211,21 @@ struct ReserveMorePage {
199 .width('100%') 211 .width('100%')
200 .height('100%') 212 .height('100%')
201 .textAlign(TextAlign.Center) 213 .textAlign(TextAlign.Center)
202 - .visibility((this.isLoadingAttention && this.liveId == item.objectId) ? Visibility.None : Visibility.Visible) 214 + .visibility((this.isLoadingAttention && this.liveId == item.objectId) ? Visibility.None :
  215 + Visibility.Visible)
203 .margin({ 216 .margin({
204 right: '10vp' 217 right: '10vp'
205 }) 218 })
  219 + .textShadow({
  220 + radius: 2,
  221 + color: 'rgba(0,0,0,0.3)',
  222 + offsetY: 2
  223 + })
206 .backgroundColor(!this.isReserved(item) ? $r('app.color.color_ED2800') : $r('app.color.color_F5F5F5')) 224 .backgroundColor(!this.isReserved(item) ? $r('app.color.color_ED2800') : $r('app.color.color_F5F5F5'))
207 .borderRadius(3) 225 .borderRadius(3)
208 226
209 - }.onClick(() => { 227 + }
  228 + .onClick(() => {
210 this.bookAndCancel(item) 229 this.bookAndCancel(item)
211 }) 230 })
212 .justifyContent(FlexAlign.Center) 231 .justifyContent(FlexAlign.Center)
@@ -214,7 +233,7 @@ struct ReserveMorePage { @@ -214,7 +233,7 @@ struct ReserveMorePage {
214 .borderRadius(3) 233 .borderRadius(3)
215 .width('52vp') 234 .width('52vp')
216 .height('24vp') 235 .height('24vp')
217 - .margin({right: 12}) 236 + .margin({ right: 12 })
218 237
219 } 238 }
220 .width('100%') 239 .width('100%')
@@ -285,12 +304,18 @@ struct ReserveMorePage { @@ -285,12 +304,18 @@ struct ReserveMorePage {
285 .fontSize('12vp') 304 .fontSize('12vp')
286 .fontWeight(400) 305 .fontWeight(400)
287 .fontColor(Color.White) 306 .fontColor(Color.White)
  307 + .textShadow({
  308 + radius: 2,
  309 + color: 'rgba(0,0,0,0.3)',
  310 + offsetY: 2
  311 + })
288 } 312 }
289 .backgroundColor(Color.Transparent) 313 .backgroundColor(Color.Transparent)
290 .margin({ right: 8, bottom: 8 }) 314 .margin({ right: 8, bottom: 8 })
291 } 315 }
292 316
293 async aboutToAppear(): Promise<void> { 317 async aboutToAppear(): Promise<void> {
  318 + this.loadImg = await onlyWifiLoadImg();
294 // PageViewModel.get 319 // PageViewModel.get
295 this.currentPage = 1 320 this.currentPage = 1
296 this.getData() 321 this.getData()
@@ -306,19 +331,19 @@ struct ReserveMorePage { @@ -306,19 +331,19 @@ struct ReserveMorePage {
306 if (str) { 331 if (str) {
307 // 跳转指定频道场景,传参底导id、频道id 332 // 跳转指定频道场景,传参底导id、频道id
308 const model: ReserveItemBean = JSON.parse(str) 333 const model: ReserveItemBean = JSON.parse(str)
309 - Logger.debug(TAG,'是否关注元数据0:' +` ${model.liveId}`) 334 + Logger.debug(TAG, '是否关注元数据0:' + ` ${model.liveId}`)
310 if (model && model.liveId && this.reserveList) { 335 if (model && model.liveId && this.reserveList) {
311 // 修改源数据 336 // 修改源数据
312 this.reserveList.forEach((element) => { 337 this.reserveList.forEach((element) => {
313 if (element.liveId == model.liveId) { 338 if (element.liveId == model.liveId) {
314 if (element && element.subscribe != model.subscribe) { 339 if (element && element.subscribe != model.subscribe) {
315 - Logger.debug(TAG,'是否关注元数据2:' +` ${JSON.stringify(element.subscribe)}`) 340 + Logger.debug(TAG, '是否关注元数据2:' + ` ${JSON.stringify(element.subscribe)}`)
316 element.subscribe = !element.subscribe 341 element.subscribe = !element.subscribe
317 - Logger.debug(TAG,'是否关注元数据3:' +` ${JSON.stringify(element.subscribe)}`) 342 + Logger.debug(TAG, '是否关注元数据3:' + ` ${JSON.stringify(element.subscribe)}`)
318 this.isShow = true 343 this.isShow = true
319 if (element.subscribe) { 344 if (element.subscribe) {
320 this.reservedIds.push(element.liveId.toString()) 345 this.reservedIds.push(element.liveId.toString())
321 - }else { 346 + } else {
322 const num = this.reservedIds.indexOf(element.liveId.toString()) 347 const num = this.reservedIds.indexOf(element.liveId.toString())
323 if (num >= 0 && num < this.reservedIds.length) { 348 if (num >= 0 && num < this.reservedIds.length) {
324 this.reservedIds.splice(num, 1) 349 this.reservedIds.splice(num, 1)
@@ -371,7 +396,7 @@ struct ReserveMorePage { @@ -371,7 +396,7 @@ struct ReserveMorePage {
371 if (liveReviewDTO.list.length == 0 && this.currentPage == 1) { 396 if (liveReviewDTO.list.length == 0 && this.currentPage == 1) {
372 this.viewType = ViewType.EMPTY 397 this.viewType = ViewType.EMPTY
373 } 398 }
374 - }catch (exception) { 399 + } catch (exception) {
375 this.resolveEnd(false, resolve) 400 this.resolveEnd(false, resolve)
376 } 401 }
377 // PageViewModel.getLiveMoreUrl(this.type, this.currentPage, this.pageSize).then(async (liveReviewDTO) => { 402 // PageViewModel.getLiveMoreUrl(this.type, this.currentPage, this.pageSize).then(async (liveReviewDTO) => {
@@ -387,7 +412,7 @@ struct ReserveMorePage { @@ -387,7 +412,7 @@ struct ReserveMorePage {
387 if (resolve) { 412 if (resolve) {
388 if (this.currentPage == 1 && isTop) { 413 if (this.currentPage == 1 && isTop) {
389 resolve('已更新至最新') 414 resolve('已更新至最新')
390 - }else { 415 + } else {
391 resolve('') 416 resolve('')
392 } 417 }
393 } 418 }
@@ -402,9 +427,9 @@ struct ReserveMorePage { @@ -402,9 +427,9 @@ struct ReserveMorePage {
402 async getAppointmentInfo(list: ContentDTO[]) { 427 async getAppointmentInfo(list: ContentDTO[]) {
403 if (HttpUtils.getUserId()) { 428 if (HttpUtils.getUserId()) {
404 const reserveBean = this.transformToLiveDetailsBeans(list) 429 const reserveBean = this.transformToLiveDetailsBeans(list)
405 - Logger.debug(TAG,'是否预约数据:' +` ${JSON.stringify(reserveBean)}`) 430 + Logger.debug(TAG, '是否预约数据:' + ` ${JSON.stringify(reserveBean)}`)
406 LiveModel.getAppointmentStatus(reserveBean).then((result) => { 431 LiveModel.getAppointmentStatus(reserveBean).then((result) => {
407 - Logger.debug(TAG,'是否预约数据:' +` ${JSON.stringify(result)}`) 432 + Logger.debug(TAG, '是否预约数据:' + ` ${JSON.stringify(result)}`)
408 if (result && result.length > 0) { 433 if (result && result.length > 0) {
409 this.reserveList.push(...result) 434 this.reserveList.push(...result)
410 // this.reserveStatus = res; 435 // this.reserveStatus = res;
@@ -414,10 +439,10 @@ struct ReserveMorePage { @@ -414,10 +439,10 @@ struct ReserveMorePage {
414 } 439 }
415 }) 440 })
416 } 441 }
417 - }).catch(() =>{ 442 + }).catch(() => {
418 // this.data.push(...list) 443 // this.data.push(...list)
419 }) 444 })
420 - }else { 445 + } else {
421 // this.data.push(...list) 446 // this.data.push(...list)
422 447
423 } 448 }
@@ -463,18 +488,19 @@ struct ReserveMorePage { @@ -463,18 +488,19 @@ struct ReserveMorePage {
463 this.isLoadingAttention = true 488 this.isLoadingAttention = true
464 this.liveId = reserveItem.liveId.toString() 489 this.liveId = reserveItem.liveId.toString()
465 try { 490 try {
466 - const res = await LiveModel.liveAppointment(reserveItem.relationId, reserveItem.liveId.toString(), !reserveItem.subscribe); 491 + const res = await LiveModel.liveAppointment(reserveItem.relationId, reserveItem.liveId.toString(),
  492 + !reserveItem.subscribe);
467 if (res.code == 0) { 493 if (res.code == 0) {
468 ToastUtils.shortToast(!reserveItem.subscribe ? '预约成功' : '取消预约成功') 494 ToastUtils.shortToast(!reserveItem.subscribe ? '预约成功' : '取消预约成功')
469 // 修改源数据 495 // 修改源数据
470 this.reserveList.forEach((element) => { 496 this.reserveList.forEach((element) => {
471 if (element.liveId.toString() == item.objectId) { 497 if (element.liveId.toString() == item.objectId) {
472 - Logger.debug(TAG,'是否关注元数据:' +` ${JSON.stringify(element.subscribe)}`) 498 + Logger.debug(TAG, '是否关注元数据:' + ` ${JSON.stringify(element.subscribe)}`)
473 element.subscribe = !element.subscribe 499 element.subscribe = !element.subscribe
474 - Logger.debug(TAG,'是否关注元数据1:' +` ${JSON.stringify(element.subscribe)}`) 500 + Logger.debug(TAG, '是否关注元数据1:' + ` ${JSON.stringify(element.subscribe)}`)
475 if (element.subscribe) { 501 if (element.subscribe) {
476 this.reservedIds.push(element.liveId.toString()) 502 this.reservedIds.push(element.liveId.toString())
477 - }else { 503 + } else {
478 const num = this.reservedIds.indexOf(element.liveId.toString()) 504 const num = this.reservedIds.indexOf(element.liveId.toString())
479 if (num >= 0 && num < this.reservedIds.length) { 505 if (num >= 0 && num < this.reservedIds.length) {
480 this.reservedIds.splice(num, 1) 506 this.reservedIds.splice(num, 1)
@@ -490,7 +516,7 @@ struct ReserveMorePage { @@ -490,7 +516,7 @@ struct ReserveMorePage {
490 this.liveId = '' 516 this.liveId = ''
491 this.isLoadingAttention = false 517 this.isLoadingAttention = false
492 } 518 }
493 - }else { 519 + } else {
494 this.liveId = '' 520 this.liveId = ''
495 this.isLoadingAttention = false 521 this.isLoadingAttention = false
496 } 522 }
@@ -509,7 +535,7 @@ struct ReserveMorePage { @@ -509,7 +535,7 @@ struct ReserveMorePage {
509 535
510 if (type === 1) { 536 if (type === 1) {
511 // 如果是今天 537 // 如果是今天
512 - if (eventDateTime.setHours(0,0,0,0) === currentDateTime.setHours(0,0,0,0)) { 538 + if (eventDateTime.setHours(0, 0, 0, 0) === currentDateTime.setHours(0, 0, 0, 0)) {
513 return `今天`; 539 return `今天`;
514 } else { 540 } else {
515 // 如果事件不在今天 541 // 如果事件不在今天
@@ -521,6 +547,4 @@ struct ReserveMorePage { @@ -521,6 +547,4 @@ struct ReserveMorePage {
521 return `${eventTimeStr}`; 547 return `${eventTimeStr}`;
522 } 548 }
523 } 549 }
524 -  
525 -  
526 } 550 }
@@ -409,6 +409,8 @@ export class PageHelper { @@ -409,6 +409,8 @@ export class PageHelper {
409 // 批查直播观看人数 409 // 批查直播观看人数
410 this.getLiveRoomDataInfo(compList) 410 this.getLiveRoomDataInfo(compList)
411 411
  412 + //
  413 +
412 414
413 // 测试数据 415 // 测试数据
414 // setTimeout(() => { 416 // setTimeout(() => {
@@ -177,6 +177,7 @@ @@ -177,6 +177,7 @@
177 { 177 {
178 "name": "color_848484", 178 "name": "color_848484",
179 "value": "#848484" 179 "value": "#848484"
180 - } 180 + },
  181 + {"name": "color_33A3A3A3","value": "#33A3A3A3"}
181 ] 182 ]
182 } 183 }