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
wangyujian_wd
2024-05-06 21:47:14 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
326d242dfe846ca91350c8d1586c41d492f84330
326d242d
1 parent
044461e8
fix:1)电子报样式修改优化
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
51 additions
and
18 deletions
sight_harmony/features/wdComponent/src/main/ets/components/ENewspaperPageComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/calendar/RMCalendar.ets
sight_harmony/features/wdComponent/src/main/ets/dialog/ENewspaperListDialog.ets
sight_harmony/products/phone/src/main/ets/pages/ENewspaper.ets
sight_harmony/products/phone/src/main/ets/pages/MainPage.ets
sight_harmony/features/wdComponent/src/main/ets/components/ENewspaperPageComponent.ets
View file @
326d242
...
...
@@ -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') })
...
...
sight_harmony/features/wdComponent/src/main/ets/components/calendar/RMCalendar.ets
View file @
326d242
...
...
@@ -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
...
...
sight_harmony/features/wdComponent/src/main/ets/dialog/ENewspaperListDialog.ets
View file @
326d242
...
...
@@ -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
}
// 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 })
...
...
sight_harmony/products/phone/src/main/ets/pages/ENewspaper.ets
View file @
326d242
...
...
@@ -31,10 +31,10 @@ struct ENewspaper {
pageTransition() {
// 定义页面进入时的效果,从底侧滑入
PageTransitionEnter({ type: RouteType.
None, duration: 3
00 })
PageTransitionEnter({ type: RouteType.
Push, duration: 4
00 })
.slide(SlideEffect.Bottom)
// 定义页面退出时的效果,向底侧滑出
PageTransitionExit({ type: RouteType.
None, duration: 3
00 })
PageTransitionExit({ type: RouteType.
Pop, duration: 4
00 })
.slide(SlideEffect.Bottom)
}
...
...
sight_harmony/products/phone/src/main/ets/pages/MainPage.ets
View file @
326d242
...
...
@@ -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');
...
...
Please
register
or
login
to post a comment