Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
yanlu
2024-05-11 20:22:34 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
5e737ceb712990d8310054dd2bf44ea31d94924c
5e737ceb
1 parent
c0c9c41a
fix:17184 电子报-版面,无网络时,点击读报纸,缺少提示信息,不应该弹出
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
42 additions
and
18 deletions
sight_harmony/features/wdComponent/src/main/ets/components/ENewspaperPageComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/MorningEveningPaper/SingleColumn999Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/calendar/RMCalendar.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/CardView.ets
sight_harmony/features/wdComponent/src/main/ets/dialog/ENewspaperCalendarDialog.ets
sight_harmony/features/wdComponent/src/main/ets/components/ENewspaperPageComponent.ets
View file @
5e737ce
...
...
@@ -9,7 +9,7 @@ import font from '@ohos.font';
import { ENewspaperPageDialog } from '../dialog/ENewspaperPageDialog';
import { RMCalendarBean } from './calendar/RMCalendarBean';
import { newsSkeleton } from './skeleton/newsSkeleton';
import { Logger, ToastUtils } from 'wdKit/Index';
import { Logger, ToastUtils
, NetworkUtil
} from 'wdKit/Index';
@Component
export struct ENewspaperPageComponent {
...
...
@@ -82,6 +82,12 @@ export struct ENewspaperPageComponent {
this.screenWidth = this.displayTool.width
this.picWidth = this.screenWidth - vp2px(52)
this.picHeight = this.picWidth * 566 / 378
// 默认日期
const date = new Date()
const month = date.getMonth() + 1
const day = date.getDate()
this.calendarDate =
`${date.getFullYear()}-${month > 9 ? month : '0' + month}-${day > 9 ? day : '0' + day}`
//注册字体
font.registerFont({
familyName: 'BebasNeueBold',
...
...
@@ -135,12 +141,12 @@ export struct ENewspaperPageComponent {
})
.id('e_newspaper_date')
.onClick(() => {
this.calendarDialogShow = !this.calendarDialogShow
if (this.calendarDialogShow) {
this.calendarDialogController.open()
} else {
this.calendarDialogController.close()
}
this.calendarDialogShow = !this.calendarDialogShow
if (this.calendarDialogShow) {
this.calendarDialogController.open()
} else {
this.calendarDialogController.close()
}
})
Image($r('app.media.icon_share'))
...
...
@@ -260,11 +266,15 @@ export struct ENewspaperPageComponent {
})
.id('e_newspaper_page_num')
.onClick((event: ClickEvent) => {
this.pageDialogShow = !this.pageDialogShow
if (this.pageDialogShow) {
this.pageDialogController.open()
} else {
this.pageDialogController.close()
if (this.newspaperListBean.list && this.newspaperListBean.list.length > 0) {
this.pageDialogShow = !this.pageDialogShow
if (this.pageDialogShow) {
this.pageDialogController.open()
} else {
this.pageDialogController.close()
}
}else {
ToastUtils.showToast('暂无数据', 1000)
}
})
...
...
@@ -291,7 +301,11 @@ export struct ENewspaperPageComponent {
})
.id('e_newspaper_read')
.onClick((event: ClickEvent) => {
this.isOpenListDialog = true
if (this.newspaperListBean.list && this.newspaperListBean.list.length > 0) {
this.isOpenListDialog = true
}else {
ToastUtils.showToast('暂无数据', 1000)
}
})
}
.width('100%')
...
...
@@ -322,8 +336,12 @@ export struct ENewspaperPageComponent {
private async getNewspaperList() {
try {
let listBean = await NewspaperViewModel.getNewspaperList(this.calendarDate, this.picWidth + 'x' + this.picHeight)
this.newspaperListBean = listBean;
if (NetworkUtil.isNetConnected()) {
let listBean = await NewspaperViewModel.getNewspaperList(this.calendarDate, this.picWidth + 'x' + this.picHeight)
this.newspaperListBean = listBean;
} else {
ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000)
}
} catch (exception) {
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/MorningEveningPaper/SingleColumn999Component.ets
View file @
5e737ce
...
...
@@ -114,7 +114,7 @@ export struct SingleColumn999Component {
build() {
// if (this.compDTO && this.compDTO?.operDataList?.length > 0) {
if (this.compListItem && this.compListItem?.operDataList?.length > 0) {
List({
space: 2,
initialIndex: 0 }) {
List({ initialIndex: 0 }) {
// ListItemGroup({
// // footer: this.itemFooter("")
// }) {
...
...
sight_harmony/features/wdComponent/src/main/ets/components/calendar/RMCalendar.ets
View file @
5e737ce
import { RMCalendarBean } from './RMCalendarBean'
import { RMCalenderCell } from './RMCalendarCell'
import { ToastUtils, NetworkUtil } from 'wdKit/Index';
@Component
export struct RMCalendar {
...
...
@@ -166,6 +167,9 @@ export struct RMCalendar {
* 下一个月
*/
private nextMonth() {
if (!NetworkUtil.isNetConnected()) {
ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000)
}
// this.dates.slice(0, this.dates.length)
this.dates = []
const beforDate = new Date(this.selectDay.getFullYear(), this.selectDay.getMonth())
...
...
@@ -180,6 +184,9 @@ export struct RMCalendar {
* 上一个月
*/
private preMonth() {
if (!NetworkUtil.isNetConnected()) {
ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000)
}
// this.dates.slice(0, this.dates.length)
this.dates = []
const beforDate = new Date(this.selectDay.getFullYear(), this.selectDay.getMonth())
...
...
sight_harmony/features/wdComponent/src/main/ets/components/page/CardView.ets
View file @
5e737ce
...
...
@@ -517,7 +517,7 @@ export struct PaperSingleColumn999CardView {
}
}
.backgroundColor(Color.White)
.margin({ bottom: 1
4
, left: 12, right: 12 })
.margin({ bottom: 1
0
, left: 12, right: 12 })
.borderRadius(4)
.onClick(() => {
ProcessUtils.processPage(this.item)
...
...
sight_harmony/features/wdComponent/src/main/ets/dialog/ENewspaperCalendarDialog.ets
View file @
5e737ce
...
...
@@ -8,7 +8,6 @@ export struct ENewspaperCalendarDialog {
onDateChange?: (date: RMCalendarBean) => void
//当前选择的日期标记
@Prop selectDate: Date = new Date()
build() {
RMCalendar({
// 开始日期
...
...
Please
register
or
login
to post a comment