Showing
2 changed files
with
8 additions
and
6 deletions
| @@ -9,11 +9,13 @@ import { MyCustomDialog } from '../../reusable/MyCustomDialog' | @@ -9,11 +9,13 @@ import { MyCustomDialog } from '../../reusable/MyCustomDialog' | ||
| 9 | export struct AppointmentListChildComponent { | 9 | export struct AppointmentListChildComponent { |
| 10 | @ObjectLink item: MineAppointmentItem | 10 | @ObjectLink item: MineAppointmentItem |
| 11 | @Prop loadImg: boolean = true; | 11 | @Prop loadImg: boolean = true; |
| 12 | + @State isAppointment: boolean = true; | ||
| 12 | confirmCallback: (item: MineAppointmentItem) => void = () => { | 13 | confirmCallback: (item: MineAppointmentItem) => void = () => { |
| 13 | 14 | ||
| 14 | } | 15 | } |
| 15 | async aboutToAppear(): Promise<void> { | 16 | async aboutToAppear(): Promise<void> { |
| 16 | // this.loadImg = await onlyWifiLoadImg(); | 17 | // this.loadImg = await onlyWifiLoadImg(); |
| 18 | + this.isAppointment = this.item.isAppointment | ||
| 17 | } | 19 | } |
| 18 | 20 | ||
| 19 | dialogController: CustomDialogController = new CustomDialogController({ | 21 | dialogController: CustomDialogController = new CustomDialogController({ |
| @@ -23,7 +25,7 @@ export struct AppointmentListChildComponent { | @@ -23,7 +25,7 @@ export struct AppointmentListChildComponent { | ||
| 23 | this.onAccept() | 25 | this.onAccept() |
| 24 | }, | 26 | }, |
| 25 | title: "提示", | 27 | title: "提示", |
| 26 | - tipValue: '是否确认取消预约' | 28 | + tipValue: this.isAppointment?'是否确认取消预约':'是否确认预约' |
| 27 | }), | 29 | }), |
| 28 | autoCancel: true, | 30 | autoCancel: true, |
| 29 | alignment: DialogAlignment.Center, | 31 | alignment: DialogAlignment.Center, |
| @@ -215,8 +217,8 @@ export struct AppointmentListChildComponent { | @@ -215,8 +217,8 @@ export struct AppointmentListChildComponent { | ||
| 215 | MinePageDatasModel.getAppointmentOperation(item, getContext(this)).then((value) => { | 217 | MinePageDatasModel.getAppointmentOperation(item, getContext(this)).then((value) => { |
| 216 | if (value != null) { | 218 | if (value != null) { |
| 217 | if (value.code === 0 || value.code.toString() === "0") { | 219 | if (value.code === 0 || value.code.toString() === "0") { |
| 218 | - // this.item.isAppointment = !this.item.isAppointment | ||
| 219 | - | 220 | + this.item.isAppointment = !this.item.isAppointment |
| 221 | + this.isAppointment = this.item.isAppointment | ||
| 220 | this.confirmCallback(this.item) | 222 | this.confirmCallback(this.item) |
| 221 | if(!this.item.isAppointment){ | 223 | if(!this.item.isAppointment){ |
| 222 | TrackingButton.click("mySavedLivePageUnSubscribe",TrackConstants.PageName.My_Saved_Live,TrackConstants.PageName.My_Saved_Live) | 224 | TrackingButton.click("mySavedLivePageUnSubscribe",TrackConstants.PageName.My_Saved_Live,TrackConstants.PageName.My_Saved_Live) |
| @@ -102,9 +102,9 @@ export struct AppointmentListUI { | @@ -102,9 +102,9 @@ export struct AppointmentListUI { | ||
| 102 | LazyForEach(this.data, (item: MineAppointmentItem, index: number) => { | 102 | LazyForEach(this.data, (item: MineAppointmentItem, index: number) => { |
| 103 | ListItem() { | 103 | ListItem() { |
| 104 | AppointmentListChildComponent({ item: item,confirmCallback:((deleteItem) =>{ | 104 | AppointmentListChildComponent({ item: item,confirmCallback:((deleteItem) =>{ |
| 105 | - ToastUtils.shortToast('取消预约成功') | ||
| 106 | - this.data.deleteItem(this.data.getIndexOf(deleteItem)) | ||
| 107 | - this.count = this.data.totalCount() | 105 | + ToastUtils.shortToast(deleteItem.isAppointment?'预约成功':'取消预约成功') |
| 106 | + // this.data.deleteItem(this.data.getIndexOf(deleteItem)) | ||
| 107 | + // this.count = this.data.totalCount() | ||
| 108 | })}) | 108 | })}) |
| 109 | } | 109 | } |
| 110 | .onClick(() => { | 110 | .onClick(() => { |
-
Please register or login to post a comment