wangyujian_wd

fix:1)电子报样式修改优化

... ... @@ -42,10 +42,12 @@ export struct ENewspaperPageComponent {
console.log("onDateChange-日历选择弹框", "date:", JSON.stringify(date))
if (date.fullYear && date.month && date.date) {
let month: number = date.month + 1
this.calendarDate = `${date.fullYear}-${month > 9 ? month : '0' + month}-${date.date > 9 ? date.date : '0' + date.date}`
this.calendarDate =
`${date.fullYear}-${month > 9 ? month : '0' + month}-${date.date > 9 ? date.date : '0' + date.date}`
this.getNewspaperTime()
this.getNewspaperList()
this.selectDate = new Date(date.fullYear ? date.fullYear : 0, date.month ? date.month : 0, date.date ? date.date : 0)
this.selectDate =
new Date(date.fullYear ? date.fullYear : 0, date.month ? date.month : 0, date.date ? date.date : 0)
}
}
}),
... ... @@ -148,6 +150,7 @@ export struct ENewspaperPageComponent {
center: { anchor: "__container__", align: VerticalAlign.Center }
})
.id('e_newspaper_share')
.visibility(Visibility.Hidden)
}
.margin({ left: $r('app.float.margin_16'), right: $r('app.float.margin_16') })
.height($r('app.float.top_bar_height'))
... ... @@ -208,13 +211,15 @@ export struct ENewspaperPageComponent {
.id('e_newspaper_shadow')
Row() {
Text(this.swiperIndex + 1 == this.newspaperListBean?.list?.length ? '已到底部,可以选择其他日期' : '滑动查看下一版')
Text(this.swiperIndex + 1 == this.newspaperListBean?.list?.length ? '已到底部,可以选择其他日期' :
'滑动查看下一版')
.fontColor(Color.White)
.fontSize($r('app.float.font_size_14'))
Image($r('app.media.icon_next_page'))
.width($r('app.float.vp_16'))
.height($r('app.float.vp_16'))
.visibility(this.swiperIndex + 1 == this.newspaperListBean?.list?.length ? Visibility.None : Visibility.Visible)
.visibility(this.swiperIndex + 1 == this.newspaperListBean?.list?.length ? Visibility.None :
Visibility.Visible)
}
.justifyContent(FlexAlign.Center)
.margin({ top: $r('app.float.margin_16') })
... ...
... ... @@ -110,7 +110,7 @@ export struct RMCalendar {
if (this.onDateChange) {
this.onDateChange(item)
if (item.fullYear && item.month) {
this.title = `${item.fullYear}年${item.month + 1}月`
this.title = `${item.fullYear}年${this.getMonthStr(item.month + 1)}月`
}
}
}
... ... @@ -191,18 +191,20 @@ export struct RMCalendar {
*/
private calcData() {
this.title = `${this.selectDay.getFullYear()}年${this.selectDay.getMonth() + 1}月`
this.title = `${this.selectDay.getFullYear()}年${this.getMonthStr(this.selectDay.getMonth() + 1)}月`
this.selectDay.setDate(1)
if (this.selectDay.getFullYear() < this.startDate.getFullYear()
|| (this.selectDay.getFullYear() == this.startDate.getFullYear() && this.selectDay.getMonth() <= this.startDate.getMonth())) {
|| (this.selectDay.getFullYear() == this.startDate.getFullYear() &&
this.selectDay.getMonth() <= this.startDate.getMonth())) {
this.hasPre = false
} else {
this.hasPre = true
}
if (this.selectDay.getFullYear() > this.endDate.getFullYear()
|| (this.selectDay.getFullYear() == this.endDate.getFullYear() && this.selectDay.getMonth() >= this.endDate.getMonth())) {
|| (this.selectDay.getFullYear() == this.endDate.getFullYear() &&
this.selectDay.getMonth() >= this.endDate.getMonth())) {
this.hasNext = false
} else {
this.hasNext = true
... ... @@ -274,7 +276,8 @@ export struct RMCalendar {
Text(this.title)
.fontSize(this.titleFontSize)
.fontColor(this.titleFontColor)
.fontWeight(this.titleFontWeight)
.fontWeight(600)
.fontFamily('PingFang SC-Semibold')
}
Blank()
... ... @@ -318,7 +321,22 @@ export struct RMCalendar {
left: 35,
right: 35
})
.padding(
{ bottom: 20 })
.border({ radius: 4 })
}
}
getMonthStr(month?: number): string {
if (!month) {
return ''
}
if (month <= 0) {
return ''
}
if (month <= 9) {
return '0' + month
}
return month + ''
}
}
\ No newline at end of file
... ...
... ... @@ -13,7 +13,8 @@ export struct ENewspaperListDialog {
@State pageDialogShow: boolean = false
@State scrollIndex: number = 0
@Prop @Watch('updateRecordsData') newspaperListBean: NewspaperListBean = {} as NewspaperListBean
private listScroller: Scroller = new Scroller();
private listScroller: Scroller = new Scroller()
@State scrollOffset: number = 0
//文字版选择弹框
pageListDialogController: CustomDialogController = new CustomDialogController({
builder: ENewspaperPageDialog({
... ... @@ -229,18 +230,24 @@ export struct ENewspaperListDialog {
.scrollBar(BarState.Off)
.onScrollIndex((firstIndex: number, lastIndex: number, centerIndex: number) => {
console.info('ENewspaperListDialog::first' + firstIndex)
console.info('ENewspaperListDialog::last' + lastIndex)
console.info('ENewspaperListDialog::center' + centerIndex)
// console.info('ENewspaperListDialog::first' + firstIndex)
// console.info('ENewspaperListDialog::last' + lastIndex)
// console.info('ENewspaperListDialog::center' + centerIndex)
// this.updateCurrentPageNum(firstIndex)
// const tempIndex = this.findClassIndex(firstIndex)
if (firstIndex !== centerIndex) {
return
}
this.currentPageNum = `${centerIndex < 9 ? '0' + (centerIndex + 1) : centerIndex + 1}`
// console.info(`this.scrollOffset:` + this.scrollOffset)
// if (this.scrollOffset == 0) {
this.currentPageNum = `${centerIndex < 9 ? '0' + (centerIndex + 1) : centerIndex + 1}`
// }
})
.onScroll((scrollOffset: number, scrollState: ScrollState) => {
console.info(`onScroll scrollState = ScrollState` + scrollState + `, scrollOffset = ` + scrollOffset)
// console.info(`onScroll scrollState = ScrollState` + scrollState + `, scrollOffset = ` + scrollOffset)
// if (this.scrollOffset == 0) {
// this.scrollOffset = 0
// }
})
}
.margin({ top: 124 })
... ...
... ... @@ -31,10 +31,10 @@ struct ENewspaper {
pageTransition() {
// 定义页面进入时的效果,从底侧滑入
PageTransitionEnter({ type: RouteType.None, duration: 300 })
PageTransitionEnter({ type: RouteType.Push, duration: 400 })
.slide(SlideEffect.Bottom)
// 定义页面退出时的效果,向底侧滑出
PageTransitionExit({ type: RouteType.None, duration: 300 })
PageTransitionExit({ type: RouteType.Pop, duration: 400 })
.slide(SlideEffect.Bottom)
}
... ...
... ... @@ -2,8 +2,6 @@ import { BottomNavigationComponent, LogoutViewModel, PermissionDesComponent } fr
import { BreakpointConstants } from 'wdConstant';
import { BreakpointSystem, EmitterEventId, EmitterUtils, Logger } from 'wdKit';
import router from '@ohos.router';
import { promptAction } from '@kit.ArkUI';
import { HWLocationUtils, WDPushNotificationManager } from 'wdHwAbility/Index';
import { common } from '@kit.AbilityKit';
... ... @@ -44,6 +42,11 @@ struct MainPage {
})
}
pageTransition() {
PageTransitionEnter({ type: RouteType.None, duration: 0 })
PageTransitionExit({ type: RouteType.None, duration: 0 })
}
aboutToDisappear() {
this.breakpointSystem.unregister()
Logger.info(TAG, 'aboutToDisappear');
... ...