yanlu

fix:17441 无网络时-电子报_选择日期弹窗未全部置灰不可选择展示

... ... @@ -145,6 +145,7 @@ export struct ENewspaperPageComponent {
.onClick(() => {
this.calendarDialogShow = !this.calendarDialogShow
if (this.calendarDialogShow) {
this.calendarDialogController.open()
} else {
this.calendarDialogController.close()
... ...
... ... @@ -103,6 +103,10 @@ export struct RMCalendar {
nowFontColor: this.nowFontColor,
disableClick: (item: RMCalendarBean) => {
if (this.disableCellClick) {
if (!NetworkUtil.isNetConnected()) {
ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000)
return
}
this.disableCellClick(item)
}
},
... ...
import { RMCalendarBean } from './RMCalendarBean';
import font from '@ohos.font';
import { ToastUtils, NetworkUtil } from 'wdKit/Index';
@Component
export struct RMCalenderCell {
... ... @@ -38,6 +38,12 @@ export struct RMCalenderCell {
}
getItemColor() {
if (!NetworkUtil.isNetConnected()) {
if (this.selectItem && this.selectItem.time == this.item.time) {
return this.selectFontColor
}
return this.disabledFontColor
}
if (!this.isShowSelectBg() && this.item.isNow) {
return this.nowFontColor
} else if (this.item.isPre) {
... ... @@ -136,9 +142,11 @@ export struct RMCalenderCell {
return
// }
}
this.selectItem = this.item
if (this.cellClick) {
this.cellClick(this.item)
if (NetworkUtil.isNetConnected()) {
this.selectItem = this.item
if (this.cellClick) {
this.cellClick(this.item)
}
}
})
}
... ...
import { RMCalendar } from '../components/calendar/RMCalendar'
import { RMCalendarBean } from '../components/calendar/RMCalendarBean'
import { ToastUtils, NetworkUtil } from 'wdKit/Index';
@CustomDialog
export struct ENewspaperCalendarDialog {
... ... @@ -26,4 +27,9 @@ export struct ENewspaperCalendarDialog {
}
})
}
aboutToAppear(): void {
if (!NetworkUtil.isNetConnected()) {
ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000)
}
}
}
\ No newline at end of file
... ...