Showing
5 changed files
with
24 additions
and
9 deletions
| @@ -13,6 +13,7 @@ import { image } from '@kit.ImageKit'; | @@ -13,6 +13,7 @@ import { image } from '@kit.ImageKit'; | ||
| 13 | import { getPicture, imageNet2PixelMap } from '../../utils/ImageUtils'; | 13 | import { getPicture, imageNet2PixelMap } from '../../utils/ImageUtils'; |
| 14 | import { effectKit } from '@kit.ArkGraphics2D'; | 14 | import { effectKit } from '@kit.ArkGraphics2D'; |
| 15 | import { window } from '@kit.ArkUI'; | 15 | import { window } from '@kit.ArkUI'; |
| 16 | +import DailyPaperTopicModel from '../../model/DailyPaperTopicModel' | ||
| 16 | 17 | ||
| 17 | const TAG = 'MorningEveningPaperComponent'; | 18 | const TAG = 'MorningEveningPaperComponent'; |
| 18 | 19 | ||
| @@ -111,12 +112,19 @@ export struct MorningEveningPaperComponent { | @@ -111,12 +112,19 @@ export struct MorningEveningPaperComponent { | ||
| 111 | Logger.info(TAG, "currentTime = " + currentTime) | 112 | Logger.info(TAG, "currentTime = " + currentTime) |
| 112 | Logger.info(TAG, `currentTime = ${currentTime}`) | 113 | Logger.info(TAG, `currentTime = ${currentTime}`) |
| 113 | try { | 114 | try { |
| 115 | + let dailyPaperTopicBean = await DailyPaperTopicModel.getDailyPaperTopic() | ||
| 116 | + if (dailyPaperTopicBean) { | ||
| 117 | + dailyPaperTopicPageId = '' + dailyPaperTopicBean.id | ||
| 118 | + Logger.info(TAG, "pageID = " + dailyPaperTopicPageId) | ||
| 119 | + } | ||
| 120 | + | ||
| 114 | // let pageInfoBean = await MorningEveningViewModel.getMorningEveningPageInfo("" + this.dailyPaperTopicPageId) | 121 | // let pageInfoBean = await MorningEveningViewModel.getMorningEveningPageInfo("" + this.dailyPaperTopicPageId) |
| 115 | let pageInfoBean = await MorningEveningViewModel.getMorningEveningPageInfo("" + dailyPaperTopicPageId) //"25091" | 122 | let pageInfoBean = await MorningEveningViewModel.getMorningEveningPageInfo("" + dailyPaperTopicPageId) //"25091" |
| 116 | this.pageInfoBean = pageInfoBean; | 123 | this.pageInfoBean = pageInfoBean; |
| 117 | this.title = this.pageInfoBean?.topicInfo?.title | 124 | this.title = this.pageInfoBean?.topicInfo?.title |
| 118 | - let dateTime = DateTimeUtils.parseDate(this.pageInfoBean?.topicInfo?.topicDate ?? '', DateTimeUtils.PATTERN_DATE_HYPHEN); | ||
| 119 | - this.subTitle = DateTimeUtils.formatDate(dateTime, PATTERN_DATE_CN_RN) | 125 | + let dateTime = DateTimeUtils.parseDate(this.pageInfoBean?.topicInfo?.topicDate ?? '', DateTimeUtils.PATTERN_DATE_HYPHEN) |
| 126 | + const dateShow = new Date(dateTime) | ||
| 127 | + this.subTitle = `${dateShow.getFullYear()}年\n${(dateShow.getMonth() + 1)}月${dateShow.getDate()}日` | ||
| 120 | Logger.info(TAG, "pageInfoBean topicDate = " + this.pageInfoBean?.topicInfo?.topicDate) | 128 | Logger.info(TAG, "pageInfoBean topicDate = " + this.pageInfoBean?.topicInfo?.topicDate) |
| 121 | Logger.info(TAG, "pageInfoBean title = " + this.pageInfoBean?.topicInfo?.title) | 129 | Logger.info(TAG, "pageInfoBean title = " + this.pageInfoBean?.topicInfo?.title) |
| 122 | 130 | ||
| @@ -166,6 +174,7 @@ export struct MorningEveningPaperComponent { | @@ -166,6 +174,7 @@ export struct MorningEveningPaperComponent { | ||
| 166 | let color = colorPicker.getMainColorSync(); | 174 | let color = colorPicker.getMainColorSync(); |
| 167 | // 将取色器选取的color示例转换为十六进制颜色代码 | 175 | // 将取色器选取的color示例转换为十六进制颜色代码 |
| 168 | this.mixedBgColor = "#" + color.alpha.toString(16) + color.red.toString(16) + color.green.toString(16) + color.blue.toString(16); | 176 | this.mixedBgColor = "#" + color.alpha.toString(16) + color.red.toString(16) + color.green.toString(16) + color.blue.toString(16); |
| 177 | + Logger.debug(TAG, "compInfoBean compStyle = " + this.mixedBgColor) | ||
| 169 | }); | 178 | }); |
| 170 | 179 | ||
| 171 | } | 180 | } |
| @@ -218,7 +227,6 @@ export struct MorningEveningPaperComponent { | @@ -218,7 +227,6 @@ export struct MorningEveningPaperComponent { | ||
| 218 | .margin({ left: 14, right: 14 }) | 227 | .margin({ left: 14, right: 14 }) |
| 219 | } | 228 | } |
| 220 | .width('100%') | 229 | .width('100%') |
| 221 | - // .backgroundColor('#000080') | ||
| 222 | // .backgroundColor(Color.Black) | 230 | // .backgroundColor(Color.Black) |
| 223 | // .backgroundColor(this.pageInfoBean?.backgroundColor ?? Color.Black) | 231 | // .backgroundColor(this.pageInfoBean?.backgroundColor ?? Color.Black) |
| 224 | .backgroundColor(this.mixedBgColor ?? Color.Black) | 232 | .backgroundColor(this.mixedBgColor ?? Color.Black) |
| 1 | import router from '@ohos.router'; | 1 | import router from '@ohos.router'; |
| 2 | +import { ToastUtils } from 'wdKit'; | ||
| 2 | 3 | ||
| 3 | /** | 4 | /** |
| 4 | * 早晚报页面标题bar | 5 | * 早晚报页面标题bar |
| @@ -74,6 +75,9 @@ export struct PaperTitleComponent { | @@ -74,6 +75,9 @@ export struct PaperTitleComponent { | ||
| 74 | }) | 75 | }) |
| 75 | .id('img_share') | 76 | .id('img_share') |
| 76 | .margin({ right: 13 }) | 77 | .margin({ right: 13 }) |
| 78 | + .onClick(() => { | ||
| 79 | + ToastUtils.showToast('分享为公共方法,待开发', 1000) | ||
| 80 | + }) | ||
| 77 | } | 81 | } |
| 78 | .margin({ left: 14, right: 14 }) | 82 | .margin({ left: 14, right: 14 }) |
| 79 | .height($r('app.float.top_bar_height')) | 83 | .height($r('app.float.top_bar_height')) |
| @@ -101,8 +101,8 @@ export struct SingleColumn999Component { | @@ -101,8 +101,8 @@ export struct SingleColumn999Component { | ||
| 101 | .height(100) | 101 | .height(100) |
| 102 | .padding(9) | 102 | .padding(9) |
| 103 | .fontColor(Color.White) | 103 | .fontColor(Color.White) |
| 104 | - .fontSize($r('app.float.font_size_16')) | ||
| 105 | - .fontWeight(FontWeight.Medium) | 104 | + .fontSize($r('app.float.vp_14')) |
| 105 | + .fontWeight(400) | ||
| 106 | .textAlign(TextAlign.Center) | 106 | .textAlign(TextAlign.Center) |
| 107 | .align(Alignment.Bottom) | 107 | .align(Alignment.Bottom) |
| 108 | .maxLines(1) | 108 | .maxLines(1) |
| @@ -130,8 +130,8 @@ export struct SingleColumn999Component { | @@ -130,8 +130,8 @@ export struct SingleColumn999Component { | ||
| 130 | .width("100%")// .height(100) | 130 | .width("100%")// .height(100) |
| 131 | .padding(9) | 131 | .padding(9) |
| 132 | .fontColor(Color.White) | 132 | .fontColor(Color.White) |
| 133 | - .fontSize($r('app.float.font_size_16')) | ||
| 134 | - .fontWeight(FontWeight.Medium) | 133 | + .fontSize($r('app.float.font_size_14')) |
| 134 | + .fontWeight(400) | ||
| 135 | .textAlign(TextAlign.Center) | 135 | .textAlign(TextAlign.Center) |
| 136 | .align(Alignment.Bottom) | 136 | .align(Alignment.Bottom) |
| 137 | .maxLines(1) | 137 | .maxLines(1) |
| 1 | import { Action, ContentDTO, Params } from 'wdBean'; | 1 | import { Action, ContentDTO, Params } from 'wdBean'; |
| 2 | import { CommonConstants, ConfigConstants, ScreenType } from 'wdConstant'; | 2 | import { CommonConstants, ConfigConstants, ScreenType } from 'wdConstant'; |
| 3 | -import { Logger } from 'wdKit'; | 3 | +import { Logger, ToastUtils } from 'wdKit'; |
| 4 | import { CompUtils } from '../../utils/CompUtils'; | 4 | import { CompUtils } from '../../utils/CompUtils'; |
| 5 | import { ProcessUtils, WDRouterRule } from 'wdRouter'; | 5 | import { ProcessUtils, WDRouterRule } from 'wdRouter'; |
| 6 | 6 | ||
| @@ -475,7 +475,7 @@ export struct PaperSingleColumn999CardView { | @@ -475,7 +475,7 @@ export struct PaperSingleColumn999CardView { | ||
| 475 | } | 475 | } |
| 476 | .justifyContent(FlexAlign.Start) | 476 | .justifyContent(FlexAlign.Start) |
| 477 | 477 | ||
| 478 | - Image($r('app.media.icon_forward')) | 478 | + Image($r('app.media.icon_paper_share')) |
| 479 | .width(16) | 479 | .width(16) |
| 480 | .height(16) | 480 | .height(16) |
| 481 | .margin({ left: 10, right: 22, top: 10, bottom: 10 }) | 481 | .margin({ left: 10, right: 22, top: 10, bottom: 10 }) |
| @@ -483,6 +483,9 @@ export struct PaperSingleColumn999CardView { | @@ -483,6 +483,9 @@ export struct PaperSingleColumn999CardView { | ||
| 483 | center: { anchor: '__container__', align: VerticalAlign.Center }, | 483 | center: { anchor: '__container__', align: VerticalAlign.Center }, |
| 484 | right: { anchor: '__container__', align: HorizontalAlign.End } | 484 | right: { anchor: '__container__', align: HorizontalAlign.End } |
| 485 | }) | 485 | }) |
| 486 | + .onClick(() => { | ||
| 487 | + ToastUtils.showToast('分享为公共方法,待开发', 1000) | ||
| 488 | + }) | ||
| 486 | }.width(CommonConstants.FULL_PARENT) | 489 | }.width(CommonConstants.FULL_PARENT) |
| 487 | .justifyContent(FlexAlign.SpaceBetween) | 490 | .justifyContent(FlexAlign.SpaceBetween) |
| 488 | } | 491 | } |
-
Please register or login to post a comment