wangliang_wd

feat:优化预约列表

... ... @@ -115,7 +115,6 @@ export struct WdWebLocalComponent {
}
.width(this.positionWidth)
.height(this.positionHeight)
.backgroundColor(Color.Red)
.alignRules({
top: { anchor: "__container__", align: VerticalAlign.Top },
})
... ...
... ... @@ -9,7 +9,9 @@ import { MyCustomDialog } from '../../reusable/MyCustomDialog'
export struct AppointmentListChildComponent {
@ObjectLink item: MineAppointmentItem
@State loadImg: boolean = false;
confirmCallback: (item: MineAppointmentItem) => void = () => {
}
async aboutToAppear(): Promise<void> {
this.loadImg = await onlyWifiLoadImg();
}
... ... @@ -29,6 +31,7 @@ export struct AppointmentListChildComponent {
})
build() {
// if (this.item.isAppointment){
Column() {
Stack() {
Image(this.loadImg ? this.item?.imageUrl[0] : '')
... ... @@ -184,6 +187,7 @@ export struct AppointmentListChildComponent {
}.margin({ left: 10, right: 10 })
.backgroundColor($r('app.color.white'))
.borderRadius('8lpx')
// }
}
onCancel() {
... ... @@ -200,8 +204,9 @@ export struct AppointmentListChildComponent {
MinePageDatasModel.getAppointmentOperation(item, getContext(this)).then((value) => {
if (value != null) {
if (value.code === 0 || value.code.toString() === "0") {
this.item.isAppointment = !this.item.isAppointment
// this.item.isAppointment = !this.item.isAppointment
this.confirmCallback(this.item)
if(!this.item.isAppointment){
TrackingButton.click("mySavedLivePageUnSubscribe",TrackConstants.PageName.My_Saved_Live,TrackConstants.PageName.My_Saved_Live)
}
... ...
... ... @@ -101,7 +101,10 @@ export struct AppointmentListUI {
List({ space:6,scroller: this.scroller }) {
LazyForEach(this.data, (item: MineAppointmentItem, index: number) => {
ListItem() {
AppointmentListChildComponent({ item: item })
AppointmentListChildComponent({ item: item,confirmCallback:((deleteItem) =>{
this.data.deleteItem(this.data.getIndexOf(deleteItem))
this.count = this.data.totalCount()
})})
}
.onClick(() => {
let contentDTO = getParams(item)
... ...