yanlu

fix: 早晚报问题

... ... @@ -13,6 +13,7 @@ import { image } from '@kit.ImageKit';
import { getPicture, imageNet2PixelMap } from '../../utils/ImageUtils';
import { effectKit } from '@kit.ArkGraphics2D';
import { window } from '@kit.ArkUI';
import DailyPaperTopicModel from '../../model/DailyPaperTopicModel'
const TAG = 'MorningEveningPaperComponent';
... ... @@ -111,12 +112,19 @@ export struct MorningEveningPaperComponent {
Logger.info(TAG, "currentTime = " + currentTime)
Logger.info(TAG, `currentTime = ${currentTime}`)
try {
let dailyPaperTopicBean = await DailyPaperTopicModel.getDailyPaperTopic()
if (dailyPaperTopicBean) {
dailyPaperTopicPageId = '' + dailyPaperTopicBean.id
Logger.info(TAG, "pageID = " + dailyPaperTopicPageId)
}
// let pageInfoBean = await MorningEveningViewModel.getMorningEveningPageInfo("" + this.dailyPaperTopicPageId)
let pageInfoBean = await MorningEveningViewModel.getMorningEveningPageInfo("" + dailyPaperTopicPageId) //"25091"
this.pageInfoBean = pageInfoBean;
this.title = this.pageInfoBean?.topicInfo?.title
let dateTime = DateTimeUtils.parseDate(this.pageInfoBean?.topicInfo?.topicDate ?? '', DateTimeUtils.PATTERN_DATE_HYPHEN);
this.subTitle = DateTimeUtils.formatDate(dateTime, PATTERN_DATE_CN_RN)
let dateTime = DateTimeUtils.parseDate(this.pageInfoBean?.topicInfo?.topicDate ?? '', DateTimeUtils.PATTERN_DATE_HYPHEN)
const dateShow = new Date(dateTime)
this.subTitle = `${dateShow.getFullYear()}年\n${(dateShow.getMonth() + 1)}月${dateShow.getDate()}日`
Logger.info(TAG, "pageInfoBean topicDate = " + this.pageInfoBean?.topicInfo?.topicDate)
Logger.info(TAG, "pageInfoBean title = " + this.pageInfoBean?.topicInfo?.title)
... ... @@ -166,6 +174,7 @@ export struct MorningEveningPaperComponent {
let color = colorPicker.getMainColorSync();
// 将取色器选取的color示例转换为十六进制颜色代码
this.mixedBgColor = "#" + color.alpha.toString(16) + color.red.toString(16) + color.green.toString(16) + color.blue.toString(16);
Logger.debug(TAG, "compInfoBean compStyle = " + this.mixedBgColor)
});
}
... ... @@ -218,7 +227,6 @@ export struct MorningEveningPaperComponent {
.margin({ left: 14, right: 14 })
}
.width('100%')
// .backgroundColor('#000080')
// .backgroundColor(Color.Black)
// .backgroundColor(this.pageInfoBean?.backgroundColor ?? Color.Black)
.backgroundColor(this.mixedBgColor ?? Color.Black)
... ...
import router from '@ohos.router';
import { ToastUtils } from 'wdKit';
/**
* 早晚报页面标题bar
... ... @@ -74,6 +75,9 @@ export struct PaperTitleComponent {
})
.id('img_share')
.margin({ right: 13 })
.onClick(() => {
ToastUtils.showToast('分享为公共方法,待开发', 1000)
})
}
.margin({ left: 14, right: 14 })
.height($r('app.float.top_bar_height'))
... ...
... ... @@ -101,8 +101,8 @@ export struct SingleColumn999Component {
.height(100)
.padding(9)
.fontColor(Color.White)
.fontSize($r('app.float.font_size_16'))
.fontWeight(FontWeight.Medium)
.fontSize($r('app.float.vp_14'))
.fontWeight(400)
.textAlign(TextAlign.Center)
.align(Alignment.Bottom)
.maxLines(1)
... ... @@ -130,8 +130,8 @@ export struct SingleColumn999Component {
.width("100%")// .height(100)
.padding(9)
.fontColor(Color.White)
.fontSize($r('app.float.font_size_16'))
.fontWeight(FontWeight.Medium)
.fontSize($r('app.float.font_size_14'))
.fontWeight(400)
.textAlign(TextAlign.Center)
.align(Alignment.Bottom)
.maxLines(1)
... ...
import { Action, ContentDTO, Params } from 'wdBean';
import { CommonConstants, ConfigConstants, ScreenType } from 'wdConstant';
import { Logger } from 'wdKit';
import { Logger, ToastUtils } from 'wdKit';
import { CompUtils } from '../../utils/CompUtils';
import { ProcessUtils, WDRouterRule } from 'wdRouter';
... ... @@ -475,7 +475,7 @@ export struct PaperSingleColumn999CardView {
}
.justifyContent(FlexAlign.Start)
Image($r('app.media.icon_forward'))
Image($r('app.media.icon_paper_share'))
.width(16)
.height(16)
.margin({ left: 10, right: 22, top: 10, bottom: 10 })
... ... @@ -483,6 +483,9 @@ export struct PaperSingleColumn999CardView {
center: { anchor: '__container__', align: VerticalAlign.Center },
right: { anchor: '__container__', align: HorizontalAlign.End }
})
.onClick(() => {
ToastUtils.showToast('分享为公共方法,待开发', 1000)
})
}.width(CommonConstants.FULL_PARENT)
.justifyContent(FlexAlign.SpaceBetween)
}
... ...