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-07 15:56:33 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
2dd345a413b2ee602038724c0620e84ce3fdc82d
2dd345a4
1 parent
b45124d6
fix: 早晚报问题
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
9 deletions
sight_harmony/features/wdComponent/src/main/ets/components/MorningEveningPaper/MorningEveningPaperComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/MorningEveningPaper/PaperTitleComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/MorningEveningPaper/SingleColumn999Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/CardView.ets
sight_harmony/features/wdComponent/src/main/resources/base/media/icon_paper_share.png
sight_harmony/features/wdComponent/src/main/ets/components/MorningEveningPaper/MorningEveningPaperComponent.ets
View file @
2dd345a
...
...
@@ -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)
...
...
sight_harmony/features/wdComponent/src/main/ets/components/MorningEveningPaper/PaperTitleComponent.ets
View file @
2dd345a
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'))
...
...
sight_harmony/features/wdComponent/src/main/ets/components/MorningEveningPaper/SingleColumn999Component.ets
View file @
2dd345a
...
...
@@ -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)
...
...
sight_harmony/features/wdComponent/src/main/ets/components/page/CardView.ets
View file @
2dd345a
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)
}
...
...
sight_harmony/features/wdComponent/src/main/resources/base/media/icon_paper_share.png
0 → 100644
View file @
2dd345a
2.11 KB
Please
register
or
login
to post a comment