wangyujian_wd

fix:

1)电子版-日历和期刊弹窗和联动优化;
... ... @@ -22,6 +22,8 @@ export struct ENewspaperPageComponent {
@State calendarDate: string = ''
private swiperController: SwiperController = new SwiperController()
@State swiperIndex: number = 0;
//当前选择的日期标记
@State selectDate: Date = new Date()
//watch监听报纸页码回调
onCurrentPageNumUpdated(): void {
... ... @@ -34,6 +36,7 @@ export struct ENewspaperPageComponent {
//日历选择弹框
calendarDialogController: CustomDialogController = new CustomDialogController({
builder: ENewspaperCalendarDialog({
selectDate: this.selectDate,
onDateChange: (date: RMCalendarBean) => {
console.log("onDateChange-日历选择弹框", "date:", JSON.stringify(date))
if (date.fullYear && date.month && date.date) {
... ... @@ -41,6 +44,7 @@ export struct ENewspaperPageComponent {
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)
}
}
}),
... ...
... ... @@ -6,11 +6,14 @@ export struct ENewspaperCalendarDialog {
calendarDialogController?: CustomDialogController
// 选择变化监听,
onDateChange?: (date: RMCalendarBean) => void
//当前选择的日期标记
@Prop selectDate: Date = new Date()
build() {
RMCalendar({
// 开始日期
startDate: new Date(2000, 1, 1),
selectDay: this.selectDate,
// 截止日期
endDate: new Date(),
// 日期选择变化监听
... ...
... ... @@ -32,8 +32,8 @@ export struct ENewspaperListDialog {
console.log("ENewspaperListDialog-onCurrentPageNumUpdated", "currentPageNum:", this.currentPageNum)
let _scrollIndex = Number.parseInt(this.currentPageNum)
console.log("ENewspaperListDialog-onCurrentPageNumUpdated", "_scrollIndex:", _scrollIndex)
this.scrollIndex = _scrollIndex > 0 ? _scrollIndex - 1 : _scrollIndex
this.listScroller.scrollToIndex(this.scrollIndex)
let scrollIndexEnd = _scrollIndex > 0 ? _scrollIndex - 1 : _scrollIndex
this.listScroller.scrollToIndex(scrollIndexEnd)
}
aboutToAppear(): void {
... ...