yanlu

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

@@ -145,6 +145,7 @@ export struct ENewspaperPageComponent { @@ -145,6 +145,7 @@ export struct ENewspaperPageComponent {
145 .onClick(() => { 145 .onClick(() => {
146 this.calendarDialogShow = !this.calendarDialogShow 146 this.calendarDialogShow = !this.calendarDialogShow
147 if (this.calendarDialogShow) { 147 if (this.calendarDialogShow) {
  148 +
148 this.calendarDialogController.open() 149 this.calendarDialogController.open()
149 } else { 150 } else {
150 this.calendarDialogController.close() 151 this.calendarDialogController.close()
@@ -103,6 +103,10 @@ export struct RMCalendar { @@ -103,6 +103,10 @@ export struct RMCalendar {
103 nowFontColor: this.nowFontColor, 103 nowFontColor: this.nowFontColor,
104 disableClick: (item: RMCalendarBean) => { 104 disableClick: (item: RMCalendarBean) => {
105 if (this.disableCellClick) { 105 if (this.disableCellClick) {
  106 + if (!NetworkUtil.isNetConnected()) {
  107 + ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000)
  108 + return
  109 + }
106 this.disableCellClick(item) 110 this.disableCellClick(item)
107 } 111 }
108 }, 112 },
1 import { RMCalendarBean } from './RMCalendarBean'; 1 import { RMCalendarBean } from './RMCalendarBean';
2 -import font from '@ohos.font'; 2 +import { ToastUtils, NetworkUtil } from 'wdKit/Index';
3 3
4 @Component 4 @Component
5 export struct RMCalenderCell { 5 export struct RMCalenderCell {
@@ -38,6 +38,12 @@ export struct RMCalenderCell { @@ -38,6 +38,12 @@ export struct RMCalenderCell {
38 } 38 }
39 39
40 getItemColor() { 40 getItemColor() {
  41 + if (!NetworkUtil.isNetConnected()) {
  42 + if (this.selectItem && this.selectItem.time == this.item.time) {
  43 + return this.selectFontColor
  44 + }
  45 + return this.disabledFontColor
  46 + }
41 if (!this.isShowSelectBg() && this.item.isNow) { 47 if (!this.isShowSelectBg() && this.item.isNow) {
42 return this.nowFontColor 48 return this.nowFontColor
43 } else if (this.item.isPre) { 49 } else if (this.item.isPre) {
@@ -136,10 +142,12 @@ export struct RMCalenderCell { @@ -136,10 +142,12 @@ export struct RMCalenderCell {
136 return 142 return
137 // } 143 // }
138 } 144 }
  145 + if (NetworkUtil.isNetConnected()) {
139 this.selectItem = this.item 146 this.selectItem = this.item
140 if (this.cellClick) { 147 if (this.cellClick) {
141 this.cellClick(this.item) 148 this.cellClick(this.item)
142 } 149 }
  150 + }
143 }) 151 })
144 } 152 }
145 153
1 import { RMCalendar } from '../components/calendar/RMCalendar' 1 import { RMCalendar } from '../components/calendar/RMCalendar'
2 import { RMCalendarBean } from '../components/calendar/RMCalendarBean' 2 import { RMCalendarBean } from '../components/calendar/RMCalendarBean'
  3 +import { ToastUtils, NetworkUtil } from 'wdKit/Index';
3 4
4 @CustomDialog 5 @CustomDialog
5 export struct ENewspaperCalendarDialog { 6 export struct ENewspaperCalendarDialog {
@@ -26,4 +27,9 @@ export struct ENewspaperCalendarDialog { @@ -26,4 +27,9 @@ export struct ENewspaperCalendarDialog {
26 } 27 }
27 }) 28 })
28 } 29 }
  30 + aboutToAppear(): void {
  31 + if (!NetworkUtil.isNetConnected()) {
  32 + ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000)
  33 + }
  34 + }
29 } 35 }