yangchenggong1_wd

fix:bug[17984,18069] 消息中的预约消息预约已开始和预约已结束的状态鸿蒙与安卓状态不一致, 预约列表鸿蒙版缺少下拉刷新

@@ -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,9 +38,40 @@ export struct AppointmentListUI { @@ -35,9 +38,40 @@ export struct AppointmentListUI {
35 } 38 }
36 39
37 } else { 40 } else {
38 - //刷新控件 TODO  
39 - //List  
40 - List({ space: '6lpx' }) { 41 +
  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()
  63 + }
  64 + }
  65 + })
  66 + }
  67 + }
  68 + .backgroundColor($r('app.color.color_F9F9F9'))
  69 + .height('100%')
  70 + .width('100%')
  71 + }
  72 +
  73 + @Builder ListLayout(){
  74 + List({ space:6,scroller: this.scroller }) {
41 LazyForEach(this.data, (item: MineAppointmentItem, index: number) => { 75 LazyForEach(this.data, (item: MineAppointmentItem, index: number) => {
42 ListItem() { 76 ListItem() {
43 AppointmentListChildComponent({ item: item }) 77 AppointmentListChildComponent({ item: item })
@@ -62,25 +96,14 @@ export struct AppointmentListUI { @@ -62,25 +96,14 @@ export struct AppointmentListUI {
62 if (!this.hasMore) { 96 if (!this.hasMore) {
63 ListItem() { 97 ListItem() {
64 ListHasNoMoreDataUI() 98 ListHasNoMoreDataUI()
65 - } 99 + }.padding({bottom:px2vp(this.bottomSafeHeight) + 20})
66 } 100 }
67 } 101 }
68 .cachedCount(4) 102 .cachedCount(4)
69 .scrollBar(BarState.Off) 103 .scrollBar(BarState.Off)
70 - .margin({ top: '23lpx', left: '23lpx', right: '23lpx' }) 104 + .edgeEffect(EdgeEffect.None)
  105 + .margin({ top: '23lpx', left: '23lpx', right: '23lpx'})
71 .layoutWeight(1) 106 .layoutWeight(1)
72 - .onReachEnd(() => {  
73 - console.log(TAG, "触底了");  
74 - if (!this.isLoading) {  
75 - //加载分页数据  
76 - this.getNewPageData()  
77 - }  
78 - })  
79 - }  
80 - }  
81 - .backgroundColor($r('app.color.color_F9F9F9'))  
82 - .height('100%')  
83 - .width('100%')  
84 } 107 }
85 108
86 getNewPageData() { 109 getNewPageData() {