fix:bug[17984,18069] 消息中的预约消息预约已开始和预约已结束的状态鸿蒙与安卓状态不一致, 预约列表鸿蒙版缺少下拉刷新
Showing
5 changed files
with
97 additions
and
46 deletions
| @@ -38,25 +38,32 @@ export struct AppointmentListChildComponent { | @@ -38,25 +38,32 @@ export struct AppointmentListChildComponent { | ||
| 38 | .interpolation(ImageInterpolation.High) | 38 | .interpolation(ImageInterpolation.High) |
| 39 | 39 | ||
| 40 | 40 | ||
| 41 | - if (this.item.relType === 1) { | 41 | + if (this.item.status == "wait") { |
| 42 | Row() { | 42 | Row() { |
| 43 | Row() { | 43 | Row() { |
| 44 | Image($r('app.media.reserve_icon')) | 44 | Image($r('app.media.reserve_icon')) |
| 45 | - .width('42lpx') | ||
| 46 | - .height('35lpx') | 45 | + .width('27lpx') |
| 46 | + .height('27lpx') | ||
| 47 | .objectFit(ImageFit.Auto) | 47 | .objectFit(ImageFit.Auto) |
| 48 | .interpolation(ImageInterpolation.High) | 48 | .interpolation(ImageInterpolation.High) |
| 49 | + .margin({right:"6lpx"}) | ||
| 49 | 50 | ||
| 50 | Text("预约") | 51 | Text("预约") |
| 51 | .fontWeight(400) | 52 | .fontWeight(400) |
| 52 | - .fontSize('21lpx') | ||
| 53 | - .backgroundColor($r('app.color.color_4D000000')) | 53 | + .fontSize('23lpx') |
| 54 | + .textShadow({ | ||
| 55 | + radius: 2, | ||
| 56 | + color: `rgba(0,0,0,0.3)`, | ||
| 57 | + offsetY:2, | ||
| 58 | + offsetX:0 | ||
| 59 | + }) | ||
| 54 | .fontColor($r('app.color.white')) | 60 | .fontColor($r('app.color.white')) |
| 55 | .lineHeight('31lpx') | 61 | .lineHeight('31lpx') |
| 56 | .layoutWeight(1) | 62 | .layoutWeight(1) |
| 57 | - .textAlign(TextAlign.Center) | 63 | + .textAlign(TextAlign.Start) |
| 58 | }.width('94lpx') | 64 | }.width('94lpx') |
| 59 | .margin({ bottom: '15lpx', right: '15lpx' }) | 65 | .margin({ bottom: '15lpx', right: '15lpx' }) |
| 66 | + .alignItems(VerticalAlign.Center) | ||
| 60 | }.width('100%') | 67 | }.width('100%') |
| 61 | .height('100%') | 68 | .height('100%') |
| 62 | .alignItems(VerticalAlign.Bottom) | 69 | .alignItems(VerticalAlign.Bottom) |
| @@ -78,7 +85,7 @@ export struct AppointmentListChildComponent { | @@ -78,7 +85,7 @@ export struct AppointmentListChildComponent { | ||
| 78 | .width('100%') | 85 | .width('100%') |
| 79 | Row() { | 86 | Row() { |
| 80 | Row() { | 87 | Row() { |
| 81 | - if (this.item.relType === 2) { | 88 | + if (this.item.status == "end") { |
| 82 | Image($r('app.media.play_status_history_icon')) | 89 | Image($r('app.media.play_status_history_icon')) |
| 83 | .objectFit(ImageFit.Auto) | 90 | .objectFit(ImageFit.Auto) |
| 84 | .interpolation(ImageInterpolation.High) | 91 | .interpolation(ImageInterpolation.High) |
| @@ -88,6 +95,16 @@ export struct AppointmentListChildComponent { | @@ -88,6 +95,16 @@ export struct AppointmentListChildComponent { | ||
| 88 | Text('已结束').fontColor($r('app.color.color_999999')) | 95 | Text('已结束').fontColor($r('app.color.color_999999')) |
| 89 | .fontWeight('500lpx') | 96 | .fontWeight('500lpx') |
| 90 | .fontSize('23lpx') | 97 | .fontSize('23lpx') |
| 98 | + }else if(this.item.status == "running"){ | ||
| 99 | + Image($r('app.media.play_status_icon')) | ||
| 100 | + .objectFit(ImageFit.Auto) | ||
| 101 | + .interpolation(ImageInterpolation.High) | ||
| 102 | + .width('38lpx') | ||
| 103 | + .height('38lpx') | ||
| 104 | + .margin({ right: '12lpx' }) | ||
| 105 | + Text('已开始').fontColor($r('app.color.color_999999')) | ||
| 106 | + .fontWeight('500lpx') | ||
| 107 | + .fontSize('23lpx') | ||
| 91 | } else { | 108 | } else { |
| 92 | Image($r('app.media.play_status_icon')) | 109 | Image($r('app.media.play_status_icon')) |
| 93 | .objectFit(ImageFit.Auto) | 110 | .objectFit(ImageFit.Auto) |
| @@ -118,7 +135,7 @@ export struct AppointmentListChildComponent { | @@ -118,7 +135,7 @@ export struct AppointmentListChildComponent { | ||
| 118 | 135 | ||
| 119 | Blank() | 136 | Blank() |
| 120 | .layoutWeight(1) | 137 | .layoutWeight(1) |
| 121 | - if (this.item.relType === 1) { | 138 | + if (this.item.status === "wait") { |
| 122 | Text(this.item.isAppointment ? "已预约" : "预约") | 139 | Text(this.item.isAppointment ? "已预约" : "预约") |
| 123 | .fontWeight(400) | 140 | .fontWeight(400) |
| 124 | .fontSize('23lpx') | 141 | .fontSize('23lpx') |
| @@ -132,8 +149,19 @@ export struct AppointmentListChildComponent { | @@ -132,8 +149,19 @@ export struct AppointmentListChildComponent { | ||
| 132 | .onClick(() => { | 149 | .onClick(() => { |
| 133 | this.dialogController.open() | 150 | this.dialogController.open() |
| 134 | }) | 151 | }) |
| 152 | + }else if(this.item.status == "running"){ | ||
| 153 | + Text("去观看" ) | ||
| 154 | + .fontWeight(400) | ||
| 155 | + .fontSize('23lpx') | ||
| 156 | + .backgroundColor($r('app.color.color_ED2800')) | ||
| 157 | + .fontColor($r('app.color.white')) | ||
| 158 | + .lineHeight('31lpx') | ||
| 159 | + .textAlign(TextAlign.Center) | ||
| 160 | + .width('100lpx') | ||
| 161 | + .height('46lpx') | ||
| 162 | + .borderRadius('6lpx') | ||
| 135 | } else { | 163 | } else { |
| 136 | - Text(this.item.relType === 2 ? "去观看" : "看回放") | 164 | + Text("看回放") |
| 137 | .fontWeight(400) | 165 | .fontWeight(400) |
| 138 | .fontSize('23lpx') | 166 | .fontSize('23lpx') |
| 139 | .backgroundColor($r('app.color.color_ED2800')) | 167 | .backgroundColor($r('app.color.color_ED2800')) |
| @@ -7,17 +7,20 @@ import MinePageDatasModel from '../../../model/MinePageDatasModel'; | @@ -7,17 +7,20 @@ import MinePageDatasModel from '../../../model/MinePageDatasModel'; | ||
| 7 | import { EmptyComponent } from '../../view/EmptyComponent'; | 7 | import { EmptyComponent } from '../../view/EmptyComponent'; |
| 8 | import { Action } from 'wdBean/Index'; | 8 | import { Action } from 'wdBean/Index'; |
| 9 | import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; | 9 | import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; |
| 10 | +import { CustomPullToRefresh } from '../../reusable/CustomPullToRefresh'; | ||
| 10 | 11 | ||
| 11 | const TAG = "AppointmentListUI" | 12 | const TAG = "AppointmentListUI" |
| 12 | 13 | ||
| 13 | @Component | 14 | @Component |
| 14 | export struct AppointmentListUI { | 15 | export struct AppointmentListUI { |
| 15 | @State data: LazyDataSource<MineAppointmentItem> = new LazyDataSource(); | 16 | @State data: LazyDataSource<MineAppointmentItem> = new LazyDataSource(); |
| 17 | + @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 | ||
| 16 | @State count: number = 0; | 18 | @State count: number = 0; |
| 17 | @State isLoading: boolean = false | 19 | @State isLoading: boolean = false |
| 18 | @State hasMore: boolean = true | 20 | @State hasMore: boolean = true |
| 19 | curPageNum: number = 1; | 21 | curPageNum: number = 1; |
| 20 | @State isGetRequest: boolean = false | 22 | @State isGetRequest: boolean = false |
| 23 | + private scroller: Scroller = new Scroller(); | ||
| 21 | 24 | ||
| 22 | aboutToAppear() { | 25 | aboutToAppear() { |
| 23 | this.getNewPageData() | 26 | this.getNewPageData() |
| @@ -35,45 +38,29 @@ export struct AppointmentListUI { | @@ -35,45 +38,29 @@ export struct AppointmentListUI { | ||
| 35 | } | 38 | } |
| 36 | 39 | ||
| 37 | } else { | 40 | } else { |
| 38 | - //刷新控件 TODO | ||
| 39 | - //List | ||
| 40 | - List({ space: '6lpx' }) { | ||
| 41 | - LazyForEach(this.data, (item: MineAppointmentItem, index: number) => { | ||
| 42 | - ListItem() { | ||
| 43 | - AppointmentListChildComponent({ item: item }) | ||
| 44 | - } | ||
| 45 | - .onClick(() => { | ||
| 46 | - //TODO 跳转 | ||
| 47 | - let action = { | ||
| 48 | - type:"2", | ||
| 49 | - params:{ | ||
| 50 | - extra:{ | ||
| 51 | - relId:item.relId, | ||
| 52 | - relType:item.relType.toString() | ||
| 53 | - }, | ||
| 54 | - contentID:item.liveId.toString() | ||
| 55 | - } | ||
| 56 | - } as Action | ||
| 57 | - WDRouterRule.jumpWithPage(WDRouterPage.detailPlayLiveCommon, action) | ||
| 58 | - }) | ||
| 59 | - }, (item: MineAppointmentItem, index: number) => index.toString()) | ||
| 60 | 41 | ||
| 61 | - //没有更多数据 显示提示 | ||
| 62 | - if (!this.hasMore) { | ||
| 63 | - ListItem() { | ||
| 64 | - ListHasNoMoreDataUI() | 42 | + CustomPullToRefresh({ |
| 43 | + alldata:this.data, | ||
| 44 | + scroller:this.scroller, | ||
| 45 | + customList:()=>{ | ||
| 46 | + this.ListLayout() | ||
| 47 | + }, | ||
| 48 | + onRefresh:(resolve)=>{ | ||
| 49 | + this.curPageNum = 1; | ||
| 50 | + this.hasMore = true | ||
| 51 | + this.isGetRequest = false | ||
| 52 | + this.data.clear() | ||
| 53 | + | ||
| 54 | + if (!this.isLoading){ | ||
| 55 | + this.getNewPageData() | ||
| 56 | + if(resolve) resolve('刷新成功') | ||
| 57 | + } | ||
| 58 | + }, | ||
| 59 | + onLoadMore:(resolve)=> { | ||
| 60 | + if (!this.isLoading) { | ||
| 61 | + this.isLoading = true | ||
| 62 | + this.getNewPageData() | ||
| 65 | } | 63 | } |
| 66 | - } | ||
| 67 | - } | ||
| 68 | - .cachedCount(4) | ||
| 69 | - .scrollBar(BarState.Off) | ||
| 70 | - .margin({ top: '23lpx', left: '23lpx', right: '23lpx' }) | ||
| 71 | - .layoutWeight(1) | ||
| 72 | - .onReachEnd(() => { | ||
| 73 | - console.log(TAG, "触底了"); | ||
| 74 | - if (!this.isLoading) { | ||
| 75 | - //加载分页数据 | ||
| 76 | - this.getNewPageData() | ||
| 77 | } | 64 | } |
| 78 | }) | 65 | }) |
| 79 | } | 66 | } |
| @@ -83,6 +70,42 @@ export struct AppointmentListUI { | @@ -83,6 +70,42 @@ export struct AppointmentListUI { | ||
| 83 | .width('100%') | 70 | .width('100%') |
| 84 | } | 71 | } |
| 85 | 72 | ||
| 73 | + @Builder ListLayout(){ | ||
| 74 | + List({ space:6,scroller: this.scroller }) { | ||
| 75 | + LazyForEach(this.data, (item: MineAppointmentItem, index: number) => { | ||
| 76 | + ListItem() { | ||
| 77 | + AppointmentListChildComponent({ item: item }) | ||
| 78 | + } | ||
| 79 | + .onClick(() => { | ||
| 80 | + //TODO 跳转 | ||
| 81 | + let action = { | ||
| 82 | + type:"2", | ||
| 83 | + params:{ | ||
| 84 | + extra:{ | ||
| 85 | + relId:item.relId, | ||
| 86 | + relType:item.relType.toString() | ||
| 87 | + }, | ||
| 88 | + contentID:item.liveId.toString() | ||
| 89 | + } | ||
| 90 | + } as Action | ||
| 91 | + WDRouterRule.jumpWithPage(WDRouterPage.detailPlayLiveCommon, action) | ||
| 92 | + }) | ||
| 93 | + }, (item: MineAppointmentItem, index: number) => index.toString()) | ||
| 94 | + | ||
| 95 | + //没有更多数据 显示提示 | ||
| 96 | + if (!this.hasMore) { | ||
| 97 | + ListItem() { | ||
| 98 | + ListHasNoMoreDataUI() | ||
| 99 | + }.padding({bottom:px2vp(this.bottomSafeHeight) + 20}) | ||
| 100 | + } | ||
| 101 | + } | ||
| 102 | + .cachedCount(4) | ||
| 103 | + .scrollBar(BarState.Off) | ||
| 104 | + .edgeEffect(EdgeEffect.None) | ||
| 105 | + .margin({ top: '23lpx', left: '23lpx', right: '23lpx'}) | ||
| 106 | + .layoutWeight(1) | ||
| 107 | + } | ||
| 108 | + | ||
| 86 | getNewPageData() { | 109 | getNewPageData() { |
| 87 | this.isLoading = true | 110 | this.isLoading = true |
| 88 | if (this.hasMore) { | 111 | if (this.hasMore) { |
-
Please register or login to post a comment