陈剑华

Merge remote-tracking branch 'origin/main'

Showing 46 changed files with 686 additions and 227 deletions
... ... @@ -163,7 +163,7 @@ function buildErrorMsg(httpStatus: number): string {
if(httpStatus != undefined){
message = `连接出错(${httpStatus})!`;
}else{
message = `连接出错!`;
message = `网络出小差了,请检查网络后重试`;
}
}
... ...
... ... @@ -15,3 +15,5 @@ export { AssignChannelParam } from './src/main/ets/utils/HomeChannelUtils';
export { RouterJumpInterceptor, JumpInterceptorAction } from './src/main/ets/router/RouterJumpInterceptor'
export { AppInnerLink } from './src/main/ets/utils/AppInnerLink'
export { ContentType } from './src/main/ets/common/ContentType'
\ No newline at end of file
... ...
export enum ContentType {
/// 不跳转
Unknown = 0,
///点播
Video = 1,
///直播
Live = 2,
///活动
Activity = 3,
///信息流广告
InfoflowAD = 4,
///专题
Subject = 5,
///链接
Link = 6,
///榜单
RankList = 7,
/// 图文
ImageText = 8,
/// 组图
Pictures = 9,
/// H5新闻 (仅海外版存在,视界和中文端无此类型。中文端按照图文8类型+link)
H5News = 10,
/// 频道
Channel = 11,
///组件
Module = 12,
///音频
Audio = 13,
///动态图文
DynamicImageText = 14,
///动态视频
DynamicVideo = 15,
///问政留言
Ask = 16,
/// 金刚位
KeyPosition = 30,
/// 合集
Serials = 101,
}
\ No newline at end of file
... ...
... ... @@ -39,6 +39,8 @@ export interface ShareContentLink {
desc?: string
link: string
icon?: string
deeplink: string // 根据内容详情,生成的深度链接 如:rmrbapp://rmrb.app/openwith?type=article&subType=h5_template_article&contentId=30000762651&relId=500000038702&skipType=1&relType=1
}
export type ShareContent = ShareContentText | ShareContentImageAndText | ShareContentLink
... ...
... ... @@ -6,6 +6,9 @@ import { AsyncCallback } from '@kit.BasicServicesKit';
import { common } from '@kit.AbilityKit';
import { systemShare } from '@kit.ShareKit';
import { uniformTypeDescriptor as utd } from '@kit.ArkData';
import { JSON } from '@kit.ArkTS';
const TAG = "WDSystemShare"
export class WDSystemShare implements WDShareInterface {
... ... @@ -14,7 +17,8 @@ export class WDSystemShare implements WDShareInterface {
return new Promise((resolve, fail) => {
try {
let controller: systemShare.ShareController = new systemShare.ShareController(this.getShareData(content, contentType));
let data = this.getShareData(content, contentType)
let controller: systemShare.ShareController = new systemShare.ShareController(data);
let context: common.UIAbilityContext = getContext(this) as common.UIAbilityContext
controller.on('dismiss', () => {
... ... @@ -53,7 +57,7 @@ export class WDSystemShare implements WDShareInterface {
});
data.addRecord({
utd: utd.UniformDataType.PNG,
uri: imageAndText.imgURI
uri: imageAndText.imgURI // 这里必须为本地连接
});
return data
}
... ... @@ -64,12 +68,35 @@ export class WDSystemShare implements WDShareInterface {
utd: utd.UniformDataType.PLAIN_TEXT,
content: link.title
});
let shareLink = this.generateShareLink(link)
console.log("分享 shareLink ==> " + shareLink)
data.addRecord({
utd: utd.UniformDataType.HYPERLINK,
uri: link.link
// uri: link.link // SDK 设计 不能传这里
content: link.link
});
return data
}
generateShareLink(shareContent: ShareContentLink) {
let link = "https://peopledailychinahosactivity.drcn.agconnect.link?deeplink=" + encodeURIComponent(shareContent.deeplink)
link += "&harmonyos_deeplink=" + encodeURIComponent(shareContent.deeplink)
link += "&harmonyos_package_name=com.peopledailychina.hosactivity"
link += "&harmonyos_fallback_url=" + encodeURIComponent(shareContent.link)
// link += "&android_deeplink=" + encodeURIComponent(shareContent.deeplink)
// link += "&android_fallback_url=" + encodeURIComponent(shareContent.link)
//
// link += "&ios_link=" + encodeURIComponent(shareContent.deeplink)
// link += "&ios_fallback_url=" + encodeURIComponent(shareContent.link)
link += "&preview_type=1"
link += "&landing_page_type=1"
// link += "&social_desc=" + encodeURIComponent(shareContent.desc || " ")
// link += "&social_image=" + encodeURIComponent(shareContent.icon || " ")
// link += "&social_title=" + encodeURIComponent(shareContent.title)
link += "&region_id=0"
return link
}
}
\ No newline at end of file
... ...
import { CompStyle } from 'wdConstant';
import { CompDTO, ContentDTO } from 'wdBean';
import { Card2Component } from './cardview/Card2Component';
// import { Card3Component } from './cardview/Card3Component';
import { Card3Component } from './cardview/Card3Component';
import { Card4Component } from './cardview/Card4Component';
import { Card5Component } from './cardview/Card5Component';
import { Card6Component } from './cardview/Card6Component';
... ... @@ -60,11 +60,13 @@ export struct CardParser {
} else {
if (contentDTO.appStyle === CompStyle.Card_02) {
Card2Component({ compDTO: this.compDTO, contentDTO, pageId: this.pageId, pageName: this.pageName })
} else if (contentDTO.appStyle === CompStyle.Card_04) {
} else if (contentDTO.appStyle === CompStyle.Card_03) {
Card3Component({ compDTO: this.compDTO, contentDTO, pageId: this.pageId, pageName: this.pageName })
}else if (contentDTO.appStyle === CompStyle.Card_04) {
Card4Component({ compDTO: this.compDTO, contentDTO, pageId: this.pageId, pageName: this.pageName })
} else if (contentDTO.appStyle === CompStyle.Card_05) {
Card5Component({ compDTO: this.compDTO, contentDTO, titleShowPolicy: this.compDTO.titleShowPolicy, pageId: this.pageId, pageName: this.pageName})
} else if (contentDTO.appStyle === CompStyle.Card_06 ) {
} else if (contentDTO.appStyle === CompStyle.Card_06 || contentDTO.appStyle === CompStyle.Card_13 ) {
Card6Component({ compDTO: this.compDTO, contentDTO: this.contentDTO, pageId: this.pageId, pageName: this.pageName })
} else if (contentDTO.appStyle === CompStyle.Card_10) {
Card10Component({ compDTO: this.compDTO, contentDTO, pageId: this.pageId, pageName: this.pageName })
... ...
... ... @@ -442,7 +442,7 @@ export struct DynamicDetailComponent {
this.contentDetailData.fullColumnImgUrls.length > 0 &&
!StringUtils.isEmpty(this.contentDetailData.fullColumnImgUrls[0].url) ?
this.contentDetailData.fullColumnImgUrls[0].url :
this.contentDetailData.videoInfo[0].firstFrameImageUri)
this.contentDetailData.firstFrameImageUri)
.width(DisplayUtils.getDeviceWidth() - 32)
.height((DisplayUtils.getDeviceWidth() - 32) * 9 / 16)
.borderRadius($r('app.float.image_border_radius'))
... ... @@ -460,7 +460,7 @@ export struct DynamicDetailComponent {
this.contentDetailData.fullColumnImgUrls.length > 0 &&
!StringUtils.isEmpty(this.contentDetailData.fullColumnImgUrls[0].url) ?
this.contentDetailData.fullColumnImgUrls[0].url :
this.contentDetailData.videoInfo[0].firstFrameImageUri)
this.contentDetailData.firstFrameImageUri)
.width(DisplayUtils.getDeviceWidth() / 2)
.height(DisplayUtils.getDeviceWidth() / 2 * 4 / 3)
.borderRadius($r('app.float.image_border_radius'))
... ...
... ... @@ -10,7 +10,7 @@ import { ENewspaperPageDialog } from '../dialog/ENewspaperPageDialog';
import { RMCalendarBean } from './calendar/RMCalendarBean';
import { newsSkeleton } from './skeleton/newsSkeleton';
import { Logger, ToastUtils, NetworkUtil, CustomToast } from 'wdKit/Index';
import { TrackingContent,TrackConstants, TrackingButton } from 'wdTracking/Index';
import { TrackingContent, TrackConstants, TrackingButton } from 'wdTracking/Index';
import { WDShare } from 'wdShare/Index';
import { window } from '@kit.ArkUI';
import { WindowModel } from 'wdKit';
... ... @@ -32,29 +32,29 @@ export struct ENewspaperPageComponent {
@State swiperIndex: number = 0;
//当前选择的日期标记
@State selectDate: Date = new Date()
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
@Provide bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
@State ratio: string = '100%'
@State toastText:ResourceStr = ""
@State toastText: ResourceStr = ""
dialogToast: CustomDialogController = new CustomDialogController({
builder: CustomToast({
bgColor:$r("app.color.color_B3000000"),
opacityValue:1,
fontSizeValue:"25lpx",
lineHeightValue:"36lpx",
bgColor: $r("app.color.color_B3000000"),
opacityValue: 1,
fontSizeValue: "25lpx",
lineHeightValue: "36lpx",
msg: this.toastText,
}),
autoCancel: false,
alignment: DialogAlignment.Center,
customStyle: true,
maskColor:"#00000000"
maskColor: "#00000000"
})
showToastTip(msg:ResourceStr){
showToastTip(msg: ResourceStr) {
this.toastText = msg
this.dialogToast.open()
}
//watch监听报纸页码回调
onCurrentPageNumUpdated(): void {
console.log("ENewspaperPageComponent-onCurrentPageNumUpdated", "currentPageNum:", this.currentPageNum)
... ... @@ -63,12 +63,13 @@ export struct ENewspaperPageComponent {
this.swiperIndex = _swiperIndex > 0 ? _swiperIndex - 1 : _swiperIndex
//电子报--版面序号选择点击
TrackingContent.clickWithEvent('panel_number_selection_click',TrackConstants.PageName.NewsPaperPage,TrackConstants.PageName.NewsPaperPage
,{
'panelNumber':this.newspaperListBean?.list[this.swiperIndex].pageNum,
'panelName':this.newspaperListBean?.list[this.swiperIndex].pageName,
'currentPanelDate':this.selectDate.toDateString(),
'currentNumber':this.swiperIndex,
TrackingContent.clickWithEvent('panel_number_selection_click', TrackConstants.PageName.NewsPaperPage,
TrackConstants.PageName.NewsPaperPage
, {
'panelNumber': this.newspaperListBean?.list[this.swiperIndex].pageNum,
'panelName': this.newspaperListBean?.list[this.swiperIndex].pageName,
'currentPanelDate': this.selectDate.toDateString(),
'currentNumber': this.swiperIndex,
})
}
... ... @@ -88,12 +89,13 @@ export struct ENewspaperPageComponent {
new Date(date.fullYear ? date.fullYear : 0, date.month ? date.month : 0, date.date ? date.date : 0)
}
//日历选择点击
TrackingContent.clickWithEvent('date_selection_click',TrackConstants.PageName.NewsPaperPage,TrackConstants.PageName.NewsPaperPage
,{
'panelNumber':this.newspaperListBean?.list[this.swiperIndex].pageNum,
'panelName':this.newspaperListBean?.list[this.swiperIndex].pageName,
'currentPanelDate':this.selectDate.toDateString(),
'currentNumber':this.swiperIndex,
TrackingContent.clickWithEvent('date_selection_click', TrackConstants.PageName.NewsPaperPage,
TrackConstants.PageName.NewsPaperPage
, {
'panelNumber': this.newspaperListBean?.list[this.swiperIndex].pageNum,
'panelName': this.newspaperListBean?.list[this.swiperIndex].pageName,
'currentPanelDate': this.selectDate.toDateString(),
'currentNumber': this.swiperIndex,
})
}
}),
... ... @@ -134,7 +136,7 @@ export struct ENewspaperPageComponent {
this.picWidth = this.screenWidth - vp2px(52)
let screenHeight = this.displayTool.height;
// bottomSafeHeight 底导高度 topSafeHeight 顶导高度 44 顶部高度 60 底部高度
let height = screenHeight -this.bottomSafeHeight - this.topSafeHeight - vp2px(44) - vp2px(60)
let height = screenHeight - this.bottomSafeHeight - this.topSafeHeight - vp2px(44) - vp2px(60)
this.picHeight = height
// 默认日期
const date = new Date()
... ... @@ -213,6 +215,7 @@ export struct ENewspaperPageComponent {
this.calendarDialogController.close()
}
})
if (this.newspaperListBean && this.newspaperListBean.list && this.newspaperListBean.list.length > 0) {
Image($r('app.media.icon_share'))
.height($r('app.float.top_arrow_size'))
... ... @@ -227,7 +230,7 @@ export struct ENewspaperPageComponent {
})
}
}
.margin({ left: $r('app.float.margin_16'), right: $r('app.float.margin_16') })
.margin({ left: $r('app.float.margin_16'), right: $r('app.float.margin_16'), top: this.topSafeHeight + 'px' })
.height($r('app.float.top_bar_height'))
.alignRules({
top: { anchor: '__container__', align: VerticalAlign.Top },
... ... @@ -251,7 +254,7 @@ export struct ENewspaperPageComponent {
if (this.newspaperListBean && this.newspaperListBean.list && this.newspaperListBean.list.length > 0) {
Swiper(this.swiperController) {
ForEach(this.newspaperListBean?.list, (item: NewspaperListItemBean, index: number) => {
ENewspaperItemComponent({ newspaperListItemBean: item})
ENewspaperItemComponent({ newspaperListItemBean: item })
})
}
.itemSpace(10)
... ... @@ -277,12 +280,13 @@ export struct ENewspaperPageComponent {
this.swiperIndex = index
})
Row() {
Image($r('app.media.newspaper_shadow'))
.height($r('app.float.vp_12'))
.width('100%')
.margin({ left: 10, right: 10, top: -1 })
.objectFit(ImageFit.Contain)
.alignRules({
}.margin({ top: -1,left: 10, right: 10 }).alignRules({
top: { anchor: "e_newspaper_content", align: VerticalAlign.Bottom },
// left: { anchor: 'e_newspaper_content', align: HorizontalAlign.Start },
// right: { anchor: 'e_newspaper_content', align: HorizontalAlign.End }
... ... @@ -310,10 +314,11 @@ export struct ENewspaperPageComponent {
.onClick((event: ClickEvent) => {
this.swiperController.showNext()
// 电子报--滑动查看下一版
TrackingButton.click('panelPageViewNextPanel',TrackConstants.PageName.NewsPaperPage,TrackConstants.PageName.NewsPaperPage
,{
'panelNumber':this.newspaperListBean?.list[this.swiperIndex].pageNum,
'panelName':this.newspaperListBean?.list[this.swiperIndex].pageName,
TrackingButton.click('panelPageViewNextPanel', TrackConstants.PageName.NewsPaperPage,
TrackConstants.PageName.NewsPaperPage
, {
'panelNumber': this.newspaperListBean?.list[this.swiperIndex].pageNum,
'panelName': this.newspaperListBean?.list[this.swiperIndex].pageName,
})
})
}
... ... @@ -341,7 +346,7 @@ export struct ENewspaperPageComponent {
})
.id('e_newspaper_page_num')
.onClick((event: ClickEvent) => {
if(!NetworkUtil.isNetConnected()){
if (!NetworkUtil.isNetConnected()) {
this.showToastTip('网络出小差了,请检查网络后重试')
return
}
... ... @@ -352,7 +357,7 @@ export struct ENewspaperPageComponent {
} else {
this.pageDialogController.close()
}
}else {
} else {
this.showToastTip('暂无数据')
}
})
... ... @@ -380,21 +385,22 @@ export struct ENewspaperPageComponent {
})
.id('e_newspaper_read')
.onClick((event: ClickEvent) => {
if(!NetworkUtil.isNetConnected()){
if (!NetworkUtil.isNetConnected()) {
this.showToastTip('网络出小差了,请检查网络后重试')
return
}
if (this.newspaperListBean.list && this.newspaperListBean.list.length > 0) {
this.isOpenListDialog = true
//电子报--读报纸点击
TrackingContent.clickWithEvent('read_newspaper_click',TrackConstants.PageName.NewsPaperPage,TrackConstants.PageName.NewsPaperPage
,{
'panelNumber':this.newspaperListBean?.list[this.swiperIndex].pageNum,
'panelName':this.newspaperListBean?.list[this.swiperIndex].pageName,
'currentPanelDate':this.selectDate.toDateString(),
'currentNumber':this.swiperIndex,
TrackingContent.clickWithEvent('read_newspaper_click', TrackConstants.PageName.NewsPaperPage,
TrackConstants.PageName.NewsPaperPage
, {
'panelNumber': this.newspaperListBean?.list[this.swiperIndex].pageNum,
'panelName': this.newspaperListBean?.list[this.swiperIndex].pageName,
'currentPanelDate': this.selectDate.toDateString(),
'currentNumber': this.swiperIndex,
})
}else {
} else {
this.showToastTip('暂无数据')
}
})
... ... @@ -402,7 +408,7 @@ export struct ENewspaperPageComponent {
.width('100%')
.height('100%')
.backgroundColor($r('app.color.color_80000000'))
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
// .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
.id('e_newspaper_container')
if (this.isOpenListDialog) {
... ... @@ -430,7 +436,8 @@ export struct ENewspaperPageComponent {
private async getNewspaperList() {
try {
if (NetworkUtil.isNetConnected()) {
let listBean = await NewspaperViewModel.getNewspaperList(this.calendarDate, this.picWidth + 'x' + this.picHeight)
let listBean =
await NewspaperViewModel.getNewspaperList(this.calendarDate, this.picWidth + 'x' + this.picHeight)
this.newspaperListBean = listBean;
} else {
this.showToastTip('网络出小差了,请检查网络后重试')
... ... @@ -442,21 +449,22 @@ export struct ENewspaperPageComponent {
share() {
let contentDetailData: ContentDetailDTO = {
shareInfo:{
shareTitle:this.newspaperListBean?.list[this.swiperIndex].pageName,
appCustomPublishTime:this.newspaperListBean?.list[this.swiperIndex].periodNum,
appCustomImageUrl:this.newspaperListBean?.list[this.swiperIndex].pagePic,
shareUrl:this.newspaperListBean?.list[this.swiperIndex].sharePagePic.shareUrl,
sharePosterCoverUrl:this.newspaperListBean?.list[this.swiperIndex].sharePagePic.sharePosterCoverUrl,
appCustomShowReport:false,
appCustomShowLike:-1,
shareOpen:1,
sharePosterOpen:1,
appCustomPosterShareControl:'-1',
appCustomShowPoster:-1,
appCustomShowPosterType:4,
shareInfo: {
shareTitle: this.newspaperListBean?.list[this.swiperIndex].pageName,
appCustomPublishTime: this.newspaperListBean?.list[this.swiperIndex].periodNum,
appCustomImageUrl: this.newspaperListBean?.list[this.swiperIndex].pagePic,
shareUrl: this.newspaperListBean?.list[this.swiperIndex].sharePagePic.shareUrl,
sharePosterCoverUrl: this.newspaperListBean?.list[this.swiperIndex].sharePagePic.sharePosterCoverUrl,
appCustomShowReport: false,
appCustomShowLike: -1,
shareOpen: 1,
sharePosterOpen: 1,
appCustomPosterShareControl: '-1',
appCustomShowPoster: -1,
appCustomShowPosterType: 4,
}
} as ContentDetailDTO
WDShare.shareContent(contentDetailData,TrackConstants.PageName.NewsPaperPage,TrackConstants.PageName.NewsPaperPage)
WDShare.shareContent(contentDetailData, TrackConstants.PageName.NewsPaperPage,
TrackConstants.PageName.NewsPaperPage)
}
}
\ No newline at end of file
... ...
... ... @@ -61,6 +61,7 @@ export struct ImageAndTextPageComponent {
@State likeNum: number = 0
@State reachEndIncreament: number = 0
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
@State isScrollTop: boolean = true
@State offsetY: number = 0
pageShowTime:number = 0;
... ... @@ -88,7 +89,7 @@ export struct ImageAndTextPageComponent {
action: this.action,
isPageEnd: $isPageEnd
})
.padding({ top: 15, bottom: 10 })
.padding({ bottom: 10 })
Column() {
// 点赞
if (this.contentDetailData?.openLikes && this.contentDetailData?.likesStyle !== 4) {
... ... @@ -159,8 +160,8 @@ export struct ImageAndTextPageComponent {
}
.id('imgTextContainer')
}
.padding({bottom: 44})
.width(CommonConstants.FULL_WIDTH)
.height(CommonConstants.FULL_HEIGHT)
.scrollBar(BarState.Off)
.align(Alignment.Top)
.onReachEnd(() => {
... ... @@ -174,10 +175,10 @@ export struct ImageAndTextPageComponent {
retry: () => {
this.getDetail()
}
}).padding({ bottom: 200 })
}).padding({ bottom: 44 })
} else {
if (!this.isPageEnd) {
detailedSkeleton().padding({ bottom: this.bottomSafeHeight })
detailedSkeleton().padding({ bottom: 44 })
}
}
// 底部交互区
... ... @@ -206,12 +207,10 @@ export struct ImageAndTextPageComponent {
this.isScrollTop = !this.isScrollTop
}
})
.position({ y: '100%' })
}
.margin({top: `${this.topSafeHeight}px`, bottom: `${this.bottomSafeHeight}px`})
.width(CommonConstants.FULL_WIDTH)
.height(CommonConstants.FULL_HEIGHT)
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
.padding({ top: 38 })
// .height(CommonConstants.FULL_HEIGHT)
// 发布时间
Column() {
... ... @@ -242,6 +241,7 @@ export struct ImageAndTextPageComponent {
.backgroundColor(Color.White)
}.backgroundColor(Color.White)
}
.margin({top: `${this.topSafeHeight}px`, bottom: `${this.bottomSafeHeight}px`})
.width(CommonConstants.FULL_WIDTH)
.height(CommonConstants.FULL_HEIGHT)
.backgroundColor(Color.White)
... ...
... ... @@ -86,7 +86,7 @@ export struct MorningEveningPaperComponent {
offset: { dx: 12, dy: -150 },
})
// private AudioSuspension = new AudioSuspensionModel()
private AudioSuspension = new AudioSuspensionModel()
onCancel() {
Logger.info(TAG, "cj2024 onCancel = ")
... ... @@ -149,19 +149,22 @@ export struct MorningEveningPaperComponent {
Logger.info(TAG, "pageInfoBean dateTime = " + dateTime)
Logger.info(TAG, "pageInfoBean subTitle = " + this.subTitle)
Logger.info(TAG, "this.pageInfoBean = " + JSON.stringify(this.pageInfoBean))
this.isHasTopView = this.pageInfoBean?.topicInfo?.frontLinkObject?true:false
let coverUrl = this.isHasTopView?this.pageInfoBean?.topicInfo?.frontLinkObject?.coverUrl as string :''
this.setComponentBgColor(coverUrl)
let compInfoBean = await MorningEveningViewModel.getMorningEveningCompInfo(pageInfoBean?.id, pageInfoBean?.groups[0]?.id, currentTime + "", pageInfoBean?.topicInfo?.topicId)
// this.compInfoBean = compInfoBean
Logger.info(TAG, "compInfoBean = " + JSON.stringify(compInfoBean))
if (compInfoBean?.compList[0]) {
this.compListItem = compInfoBean?.compList[0]
Logger.debug(TAG, '获取评论数据' + `${this.compListItem.operDataList.length}`)
if (this.compListItem.operDataList && this.compListItem.operDataList.length > 0) {
this.getAllContentInteractData(this.compListItem.operDataList)
}
Logger.debug('compInfoBean?.compList[0].audioDataList', JSON.stringify(compInfoBean?.compList[0].audioDataList))
Logger.debug(TAG, 'compInfoBean?.compList[0].audioDataList', JSON.stringify(compInfoBean?.compList[0].audioDataList))
if (compInfoBean?.compList[0].audioDataList) {
this.audioPlayUrl = compInfoBean?.compList[0].audioDataList[0].audioUrl
this.audioTitle = compInfoBean?.compList[0].audioDataList[0].title
... ... @@ -258,12 +261,11 @@ export struct MorningEveningPaperComponent {
topicInfoView({ frontLinkObject: this.pageInfoBean?.topicInfo?.frontLinkObject })
}
//暂时不展示音频播报
// if (this.audioPlayUrl.length > 0){
// ListItem() {
// this.AudioBarView(this.simpleAudioDialog)
// }
// }
if (this.audioPlayUrl !== ""){
ListItem() {
this.AudioBarView()
}
}
}
ListItem() {
... ... @@ -307,7 +309,7 @@ export struct MorningEveningPaperComponent {
}
@Builder
AudioBarView(dialog: CustomDialogController) {
AudioBarView() {
Row() {
Stack({ alignContent: Alignment.Start }) {
Image($r('app.media.listen_left_bg'))
... ... @@ -320,7 +322,7 @@ export struct MorningEveningPaperComponent {
.margin({ left: 10 })
.alignSelf(ItemAlign.Start)
Text('晚上好, 请收听今日新闻播报')
Text(`${this.pageInfoBean.topicInfo.topicPattern === 1 ? '早上好' : this.pageInfoBean.topicInfo.topicPattern === 2 ? '中午好' : '晚上好'}, 请收听今日新闻播报`)
.fontSize(14)
.margin({ left: 50 })
.fontColor(Color.Black)
... ... @@ -345,7 +347,7 @@ export struct MorningEveningPaperComponent {
Logger.info("TAG", "cj compInfoBean onClick1 = " + this.isAudioPlaying)
// dialog.open()
// this.playerController.firstPlay(this.audioPlayUrl, this.audioTitle)
// this.AudioSuspension.setPlayerUrl(this.audioPlayUrl, this.audioTitle)
this.AudioSuspension.setPlayerUrl(this.audioPlayUrl, this.audioTitle)
Logger.info(TAG, "this.audioPlayUrl = " + this.audioPlayUrl)
Logger.info("TAG", "cj compInfoBean onClick2 = " + this.isAudioPlaying)
})
... ...
... ... @@ -216,7 +216,7 @@ export struct SpacialTopicPageComponent {
aboutToAppear() {
if (!this.action?.params?.backVisibility) {
WindowModel.shared.setWindowLayoutFullScreen(true)
// WindowModel.shared.setWindowLayoutFullScreen(true)
}
this.webUrl = this.action?.params?.url || ''
this.getDetail()
... ... @@ -224,7 +224,7 @@ export struct SpacialTopicPageComponent {
aboutToDisappear() {
if (!this.action?.params?.backVisibility) {
WindowModel.shared.setWindowLayoutFullScreen(false)
// WindowModel.shared.setWindowLayoutFullScreen(false)
}
}
}
... ...
... ... @@ -112,13 +112,12 @@ export struct QualityCommentsComponent {
Image($r('app.media.comment_img_banner')).width('100%')
.height(283)
// .aspectRatio(375 / 283);
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
}
.onAreaChange((oldValue: Area, newValue: Area) => {
if (Number(oldValue.globalPosition.y) == 0 && Number(newValue.globalPosition.y) > 30) {
this.firstPositionY = Number(newValue.globalPosition.y)
return
}
// if (Number(oldValue.globalPosition.y) == 0 && Number(newValue.globalPosition.y) > 30) {
// this.firstPositionY = Number(newValue.globalPosition.y)
// return
// }
Logger.debug(TAG, "oldValue.globalPosition.y : " + oldValue.globalPosition.y)
Logger.debug(TAG,
"newValue.globalPosition.y : " + newValue.globalPosition.y + `,this.topSafeHeight : ` + this.topSafeHeight)
... ... @@ -128,9 +127,16 @@ export struct QualityCommentsComponent {
persent = 1
}
this.tileOpacity = persent
this.topOpacityChange()
})
}
topOpacityChange(){
if(this.tileOpacity > 0.8){
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', })
}else{
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff'})
}
}
/*透明导航栏*/
@Builder
... ... @@ -164,16 +170,20 @@ export struct QualityCommentsComponent {
@Builder
TabbarNormal() {
Stack({ alignContent: Alignment.Top }) {
//// 默认显示的白色返回按钮
Row() {
}
.width('100%')
.height(px2vp(this.topSafeHeight))
.backgroundColor($r('app.color.white'))
.opacity(this.tileOpacity)
.visibility(this.tileOpacity > 0 ? 0 : 1)
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
Image($r('app.media.icon_arrow_left_white'))
.width(24).height(24)
.objectFit(ImageFit.Auto)
.margin({ left: 16, top: px2vp(this.topSafeHeight) + (44 - 24)/2})
.onClick(() => {
router.back()
})
}.width('100%').height(px2vp(this.topSafeHeight) + 44)
.opacity(1- this.tileOpacity)
Stack({ alignContent: Alignment.Start }) {
//// 上滑显示的黑色按钮和标题
Stack({ alignContent: Alignment.Top }) {
Row() {
Text('精选评论')// .height('42lpx')
.maxLines(1)
... ... @@ -182,25 +192,25 @@ export struct QualityCommentsComponent {
.fontWeight(400)
.fontColor($r('app.color.color_222222'))
.lineHeight('42lpx')
.visibility(this.tileOpacity < 0.8 ? 1 : 0)
}
.height(44)
.width('100%')
.height(44).width('100%')
.justifyContent(FlexAlign.Center)
.alignItems(VerticalAlign.Center)
.opacity(this.tileOpacity)
.backgroundColor($r('app.color.white'))
Image(this.tileOpacity < 0.8 ? $r('app.media.icon_arrow_left_white') : $r('app.media.icon_arrow_left'))
.width(24)
.height(24)
Row() {
Image($r('app.media.icon_arrow_left'))
.width(24).height(24)
.objectFit(ImageFit.Auto)
.margin({ left: 16 })
.margin({ left: 16, top: (44-24)/2})
.onClick(() => {
router.back()
})
}.height(44).width('100%')
}
.width('100%').height(px2vp(this.topSafeHeight) + 44)
.backgroundColor($r('app.color.white'))
.opacity(this.tileOpacity)
.padding({top:px2vp(this.topSafeHeight)})
}
}
... ...
... ... @@ -19,7 +19,8 @@ struct EditUserInfoPage {
@State headerImg: string = ''
@State dataSource: AreaListModel[] = []
@State currentUserInfo: editModel = new editModel()
@State bottomSafeHeight: number = 0;
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
dialogController: CustomDialogController = new CustomDialogController({
builder: AreaPickerDialog({dataSource:this.dataSource,
... ... @@ -34,10 +35,7 @@ struct EditUserInfoPage {
}),
alignment: DialogAlignment.Bottom,
customStyle: true,
offset: {
dx: 0,
dy: -this.bottomSafeHeight
},
closeAnimation:{duration:0}
})
dateDialogController: CustomDialogController = new CustomDialogController({
... ... @@ -53,10 +51,7 @@ struct EditUserInfoPage {
}),
alignment: DialogAlignment.Bottom,
customStyle: true,
offset: {
dx: 0,
dy: -this.bottomSafeHeight
},
closeAnimation:{duration:0}
})
sexDialogController: CustomDialogController = new CustomDialogController({
... ... @@ -69,15 +64,10 @@ struct EditUserInfoPage {
}),
alignment: DialogAlignment.Bottom,
customStyle: true,
offset: {
dx: 0,
dy: -this.bottomSafeHeight
},
closeAnimation:{duration:0}
})
async aboutToAppear() {
let windowHight: window.Window = await window.getLastWindow(getContext(this));
this.bottomSafeHeight = px2vp(windowHight.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM).bottomRect.height)
aboutToAppear() {
this.getAccountOwnerInfo()
this.getAreaList()
}
... ... @@ -142,6 +132,7 @@ struct EditUserInfoPage {
}
.width('100%')
.height('100%')
.padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)})
}
@Builder
... ...
... ... @@ -9,6 +9,8 @@ struct EditUserIntroductionPage {
@State textColor : string = '#222222'
@State introduction: string = ''
@State params:editModelParams = router.getParams() as editModelParams;
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
build() {
Column(){
CustomTitleUI({titleName:'修改简介'})
... ... @@ -63,6 +65,7 @@ struct EditUserIntroductionPage {
this.updateEditModel()
})
}
.padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)})
}
... ...
... ... @@ -12,6 +12,8 @@ struct EditUserNikeNamePage {
@State textColor : string = '#222222'
@State nikeName: string = ''
@State params:editModelParams = router.getParams() as editModelParams;
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
build() {
Column(){
CustomTitleUI({titleName:'修改昵称'})
... ... @@ -66,7 +68,7 @@ struct EditUserNikeNamePage {
///内部更新
this.updateEditModel()
})
}
}.padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)})
}
async updateEditModel(){
... ...
... ... @@ -20,6 +20,8 @@ struct InteractMessagePage {
private scroller: Scroller = new Scroller();
@State likeNum: number = 0
@State currentPage: number = 1;
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
aboutToAppear(){
this.getData()
... ... @@ -58,6 +60,8 @@ struct InteractMessagePage {
}
.width(CommonConstants.FULL_WIDTH)
.height(CommonConstants.FULL_HEIGHT)
.padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)})
}
@Builder ListLayout() {
... ...
... ... @@ -34,6 +34,8 @@ struct MyCollectionListPage {
@State currentPage: number = 1;
private scroller: Scroller = new Scroller();
emptyType: WDViewDefaultType = WDViewDefaultType.WDViewDefaultType_Default
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
dialogController: CustomDialogController = new CustomDialogController({
builder: MyCustomDialog({
... ... @@ -120,6 +122,8 @@ struct MyCollectionListPage {
.backgroundColor('#FFFFFF')
.width(CommonConstants.FULL_WIDTH)
.height(CommonConstants.FULL_HEIGHT)
.padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)})
}
@Builder ListLayout() {
... ... @@ -149,16 +153,14 @@ struct MyCollectionListPage {
selectCallback:(isOn)=>{
this.addCompDTO(isOn,compDTO)
}
})
.margin({left:16})
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 });
}).margin({left:16})
}
Column() {
BigPicCardComponent({compDTO:new CompDTO,contentDTO:compDTO,pageId:TrackConstants.PageName.My_Collect,pageName:TrackConstants.PageName.My_Collect})
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 });
}
}.onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => {
if (isVisible) {
if (isVisible && !this.isEditState) {
TrackingContent.common(TrackConstants.EventType.Show, TrackConstants.PageName.My_Collect,TrackConstants.PageName.My_Collect, TrackParamConvert.program(compDTO))
}
})
... ... @@ -291,6 +293,7 @@ struct MyCollectionListPage {
compDTO.interactData = this.commentList[index]
datas.push(compDTO)
}
this.allDatas = []
this.allDatas.push(...datas)
} catch (exception) {
}
... ...
... ... @@ -113,9 +113,11 @@ export struct TopNavigationComponentNew {
'middle': { 'anchor': '__container__', 'align': HorizontalAlign.Center },
'bottom': { 'anchor': '__container__', 'align': VerticalAlign.Bottom }
})
.onChange((index) => {
Logger.info(TAG, `onChange index : ${index}`);
.onAnimationStart((curIndex: number, index: number)=>{
Logger.info(TAG, `onAnimationStart ${curIndex} ${index}`);
if (curIndex === index) {
return
}
if (this.isBroadcastByIndex(index)) {
// 跳转到播报页面
ProcessUtils.gotoBroadcastPage(this.myChannelList[index].pageId)
... ... @@ -133,7 +135,12 @@ export struct TopNavigationComponentNew {
this.currentTopNavSelectedIndex = index;
this.changePage(this.currentTopNavSelectedIndex)
}
})
// .onAnimationEnd((index: number)=>{
// Logger.info(TAG, `onAnimationEnd ${index}`);
// })
.onChange((index) => {
Logger.info(TAG, `onChange index : ${index}`);
})
}
.width('100%')
... ...
import router from '@ohos.router'
import { BreakpointSystem, NetworkUtil, StringUtils, ToastUtils } from 'wdKit'
import { BreakpointSystem, DateTimeUtils, NetworkUtil, StringUtils, ToastUtils } from 'wdKit'
import { ParamType, TrackConstants, Tracking } from 'wdTracking/Index'
import SearcherAboutDataModel from '../../model/SearcherAboutDataModel'
import { SearchHistoryItem } from '../../viewmodel/SearchHistoryItem'
... ... @@ -32,6 +32,7 @@ export struct SearchComponent {
@State count:string[] = []
@State isGetRequest:boolean = false
@Link fromTabName: string
@State sameSearch:number = 0 //再次搜索
@StorageProp('currentBreakpoint') @Watch("currentChanged")currentBreakpoint: string = 'sm';
private breakpointSystem = new BreakpointSystem();
... ... @@ -175,7 +176,7 @@ export struct SearchComponent {
this.getSearchHistoryData()
this.getSearchInputResData(this.searchText)
}
},percent:this.percent})
},percent:this.percent,sameSearch:this.sameSearch})
} else {
//联想搜索
SearchRelatedComponent({relatedSearchContentData:$relatedSearchContentsData,onGetSearchRes: (item): void => this.getSearchRelatedResData(item),searchText:this.searchText,percent:this.percent})
... ... @@ -402,6 +403,7 @@ export struct SearchComponent {
}
this.isGetRequest = true
this.resetSearch()
this.sameSearch = DateTimeUtils.getTimeStamp()
}).catch((err: Error) => {
console.log(TAG, JSON.stringify(err))
this.isGetRequest = true
... ...
... ... @@ -30,7 +30,7 @@ export struct SearchCreatorComponent{
.fontSize('25lpx')
.fontWeight('400lpx')
.lineHeight('35lpx')
.constraintSize({maxWidth:'150lpx'})
.constraintSize({maxWidth:'125lpx'})
.maxLines(1)
.textOverflow({ overflow: TextOverflow.Ellipsis })
}.alignItems(HorizontalAlign.Center)
... ...
... ... @@ -29,6 +29,8 @@ export struct SearchResultComponent {
onClickTryAgain?: () => void;
@State isConnectNetwork : boolean = NetworkUtil.isNetConnected()
@Prop percent:number = 1
@Prop sameSearch:number = 0
aboutToAppear(): void {
if (this.count.length === 0 && this.isGetRequest == true) {
... ... @@ -137,7 +139,7 @@ export struct SearchResultComponent {
Tabs({ barPosition: BarPosition.Start, controller: this.controller }) {
ForEach(this.count, (item: string, index: number) => {
TabContent() {
SearchResultContentComponent({ keywords: this.searchText, searchType: item })
SearchResultContentComponent({ keywords: this.searchText, searchType: item ,sameSearch:this.sameSearch,isCurrentShow:this.currentIndex === index})
}.tabBar(this.TabBuilder(index, item))
.layoutWeight(1)
}, (item: string, index: number) => index.toString())
... ...
... ... @@ -51,7 +51,22 @@ export struct SearchResultContentComponent {
@State moreWidth:number = 20
@State listLeft: number = 0
@State isEnd: boolean = false
@Watch('updateData') @Prop sameSearch:number = 0
@Prop isCurrentShow:boolean = false;
updateData(){
if(this.isCurrentShow){
this.data_rmh = []
this.data.clearAllData()
this.curPageNum = 1
this.hasMore = true
this.isLoading = false
this.getNewSearchResultData()
}
}
aboutToAppear(): void {
if (this.searchType == "全部") {
... ...
... ... @@ -241,7 +241,7 @@ export struct OperRowListView {
.padding({
top: 10,
// bottom: 10
bottom: `${this.bottomSafeHeight}px`
bottom: px2vp(this.bottomSafeHeight)
// bottom: 50
})
}
... ...
... ... @@ -18,6 +18,7 @@ export struct ENewspaperListDialog {
private listScroller: Scroller = new Scroller()
@State scrollOffset: number = 0
@State isCurrentViewOpen: boolean = false
@Consume bottomSafeHeight:number
//文字版选择弹框
pageListDialogController: CustomDialogController = new CustomDialogController({
builder: ENewspaperPageDialog({
... ... @@ -266,13 +267,13 @@ export struct ENewspaperListDialog {
left: 15,
right: 15,
// top: 16,
bottom: 16
// bottom: 16
})
.margin({
bottom: 85
})
.scrollBar(BarState.Off)
.edgeEffect(EdgeEffect.None)
.edgeEffect(EdgeEffect.Spring)
.onScrollIndex((firstIndex: number, lastIndex: number, centerIndex: number) => {
console.info('ENewspaperListDialog::first' + firstIndex)
console.info('ENewspaperListDialog::last' + lastIndex)
... ... @@ -288,19 +289,14 @@ export struct ENewspaperListDialog {
// }
})
}
// .margin({ top: 124 })
.margin({ top: this.topHeight })
.width('100%')
.backgroundColor(Color.White)
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
.onClick(() => {
})
}.width('100%')
.height('100%')
.backgroundColor('#80000000')
.margin({bottom:44})
.margin({bottom:50})
.onClick(() => {
if (this.closeDialog) {
this.closeDialog()
... ...
... ... @@ -214,12 +214,7 @@ struct MineHomePage {
.fontWeight('400lpx')
.fontColor(this.isHasIntroduction?$r('app.color.color_222222'):$r('app.color.color_999999'))
.textAlign(TextAlign.Start)
.onClick(()=>{
let params: editModelParams = {
editContent: this.isHasIntroduction?this.desc:''
}
WDRouterRule.jumpWithPage(WDRouterPage.editUserIntroductionPage,params)
})
if(!this.isHasIntroduction){
Image($r('app.media.user_info_edit_icon'))
.width('27lpx')
... ... @@ -227,7 +222,12 @@ struct MineHomePage {
.interpolation(ImageInterpolation.High)
.objectFit(ImageFit.Auto)
}
}.onClick(()=>{
let params: editModelParams = {
editContent: this.isHasIntroduction?this.desc:''
}
WDRouterRule.jumpWithPage(WDRouterPage.editUserIntroductionPage,params)
})
Text(`来到人民日报${this.registerTimeForDay}天`)
... ...
... ... @@ -221,6 +221,8 @@ export class PageHelper {
// let pageDto = page
let index = pageInfo.groups.indexOf(group)
Logger.debug(TAG, 'yyyy parseGroup print')
this.printComp(pageDto)
// 解析楼层组件
this.analysisPageGroupCompData(pageDto, pageInfo)
... ... @@ -293,7 +295,8 @@ export class PageHelper {
if (pageDto.compAdList != null) {
pageInfo.pageAdList.push(...pageDto.compAdList)
}
// TODO 待删除
Logger.debug(TAG, 'yyyy analysisPageGroupCompData size, '+pageInfo?.oneRequestPageGroupCompList?.length)
}
}
... ... @@ -340,6 +343,8 @@ export class PageHelper {
pageModel.currentPage++;
pageModel.hasMore = true;
Logger.debug(TAG, 'yyyy compLoadMore print')
this.printComp(data)
//移除音频 和 活动
this.loadMorePageComp(pageModel, data)
// 参与批查
... ... @@ -366,6 +371,8 @@ export class PageHelper {
pageCompList.forEach((comp: CompDTO) => {
pageModel.pageInfo.oneRequestPageGroupCompList.add(comp)
})
// TODO 待删除
Logger.debug(TAG, 'yyyy loadMorePageComp size, ' + pageModel.pageInfo.oneRequestPageGroupCompList?.length)
// 记录
pageModel.pageTotalCompSize = pageCompList.length + pageModel.pageTotalCompSize
... ... @@ -843,6 +850,31 @@ export class PageHelper {
// 从第二页开始删
pageModel.compList.deleteItems(pageModel.firstPageEndIndex + 1)
}
/**
* 临时打印comp相关信息,用于问题定位。TODO 待删除
*/
private printComp(pageDto: PageDTO) {
Logger.debug(TAG, 'yyyy printComp pageDto.compList.size: ' + pageDto?.compList?.length)
new Promise<void>(() => {
let tmpCompList: CompDTO[] = Array.from(pageDto.compList)
tmpCompList.forEach((v, k) => {
if (v && v.operDataList) {
Logger.warn(TAG, 'yyyy printComp comp forEach, ' + v.compStyle)
v.operDataList.forEach((cv, ci) => {
if (cv) {
Logger.debug(TAG, 'yyyy printComp ContentDTO print, ' + v.compStyle)
Logger.debug(TAG, 'yyyy printComp ContentDTO xxxx newsTitle, ' + cv.newsTitle)
} else {
Logger.warn(TAG, 'yyyy printComp ContentDTO is null, ' + v.compStyle)
}
})
} else {
Logger.warn(TAG, 'yyyy printComp comp is null or operDataList is empty, ' + v?.compStyle)
}
})
})
}
}
... ...
... ... @@ -7,10 +7,9 @@ import mediaquery from '@ohos.mediaquery';
import { Logger, WindowModel } from 'wdKit/Index';
import { router, window } from '@kit.ArkUI';
import { WDAliPlayerController } from 'wdPlayer/Index';
import { LiveEmptyComponent, LiveOperRowListView } from 'wdComponent';
import { LiveOperRowListView } from 'wdComponent';
import { publishCommentModel } from 'wdComponent/src/main/ets/components/comment/model/PublishCommentModel';
import { TrackConstants, TrackingContent, TrackParamConvert } from 'wdTracking/Index';
import { LiveDetailPageLogic } from '../viewModel/LiveDetailPageLogic';
let TAG: string = 'DetailPlayLivePage';
... ... @@ -57,7 +56,6 @@ export struct DetailPlayLivePage {
this.getLiveDetails()
this.getLiveRoomData()
console.error(TAG, 'this.publishCommentModel', this.publishCommentModel.targetId)
}
async aboutToDisappear() {
... ...
... ... @@ -306,12 +306,13 @@ export struct PlayUIComponent {
.width(24)
.height(24)
.onClick(() => {
WindowModel.shared.setSpecificSystemBarEnabled(false)
this.displayDirection =
this.displayDirection == DisplayDirection.VERTICAL ? DisplayDirection.VIDEO_HORIZONTAL :
DisplayDirection.VERTICAL
WindowModel.shared.setSpecificSystemBarEnabled(false)
WindowModel.shared.setPreferredOrientation(this.displayDirection == DisplayDirection.VERTICAL ?
window.Orientation.PORTRAIT :
window.Orientation.LANDSCAPE_INVERTED)
... ...
... ... @@ -35,6 +35,17 @@ export struct TopPlayComponent {
private playUrl: string = ""
private xComponentIsLoaded: boolean = false
@Consume liveDetailPageLogic: LiveDetailPageLogic
@Consume @Watch('pageShowChange') pageShow: number
@Consume @Watch('pageHideChange') pageHide: number
init: boolean = false
pageShowChange() {
this.playerController?.play()
}
pageHideChange() {
this.playerController?.pause()
}
aboutToAppear(): void {
if (this.playerController) {
... ... @@ -71,7 +82,7 @@ export struct TopPlayComponent {
updateData() {
// 检测垫片
if (this.liveDetailPageLogic.showPad){
if (this.liveDetailPageLogic.showPad) {
this.isHideLoading = true
this.isWait = true
this.previewUrl = this.liveDetailPageLogic.imgUrl
... ...
... ... @@ -281,7 +281,7 @@ export struct DetailPlayShortVideoPage {
publishCommentModel: this.publishCommentModel,
showCommentIcon: false,
onBack: () => {
WindowModel.shared.setWindowLayoutFullScreen(false)
// WindowModel.shared.setWindowLayoutFullScreen(false)
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', })
}
})
... ...
... ... @@ -96,7 +96,7 @@ export struct DetailVideoListPage {
*/
openFullScreen() {
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', })
WindowModel.shared.setWindowLayoutFullScreen(true)
// WindowModel.shared.setWindowLayoutFullScreen(true)
// WindowModel.shared.setWindowSystemBarEnable([])
}
... ... @@ -106,7 +106,7 @@ export struct DetailVideoListPage {
*/
closeFullScreen() {
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', })
WindowModel.shared.setWindowLayoutFullScreen(false)
// WindowModel.shared.setWindowLayoutFullScreen(false)
// WindowModel.shared.setWindowSystemBarEnable(['status', 'navigation'])
}
... ...
... ... @@ -11,7 +11,9 @@ export struct PlayerProgressView {
@Consume isDragging: boolean
@Consume status: number
@State videoDuration: number = this.contentDetailData?.videoInfo?.[0]?.videoDuration || 1
@State loadingTop: number = 10
@State loadingWidth: number | string = 1
@State showLoading: boolean = false
aboutToAppear() {
if (this.playerController) {
this.playerController.onStatusChange = (status: number) => {
... ... @@ -20,10 +22,48 @@ export struct PlayerProgressView {
this.playerController.onSeekDone = (status: number) => {
this.playerController?.play()
}
this.playerController.onLoaded = (loaded: number) => {
if(loaded == 1) {
this.loadingWidth = '95%'
this.showLoading = true
} else {
this.loadingWidth = 1
this.showLoading = false
}
}
}
}
/**
*
* loading 动效
*/
@Builder
playerLoadingBuilder() {
Flex({
direction: FlexDirection.Row,
justifyContent: FlexAlign.Center,
alignItems: ItemAlign.End
}) {
Text('')
.backgroundColor(Color.Gray)
.width(this.loadingWidth)
.height(1)
.animation({ duration: 500, curve: Curve.Ease, iterations: -1, playMode: PlayMode.Normal })
}
.width('100%')
.zIndex(2000)
.visibility(this.showLoading ? Visibility.Visible: Visibility.Hidden)
.margin({ bottom: 10 })
// .markAnchor({ x: 0, y: '100%' })
}
build() {
Stack() {
this.playerLoadingBuilder()
if(!this.showLoading) {
Column() {
Text() {
Span(DateTimeUtils.secondToTime(Math.floor(this.progressVal / 100 * this.videoDuration)))
... ... @@ -71,4 +111,6 @@ export struct PlayerProgressView {
}
.visibility(this.isOpenDetail ? Visibility.None : Visibility.Visible)
}
}
}
}
\ No newline at end of file
... ...
import { CommonConstants } from 'wdConstant';
import { Logger } from 'wdKit';
const TAG = 'EmptyComponent';
/**
* WDViewDefaultType 缺省页 无网络
*/
export const enum WDViewDefaultType {
/// 0.默认
WDViewDefaultType_Default,
/// 1.无网
WDViewDefaultType_NoNetwork,
}
/**
* 空数据/无数据
*/
@Preview
@Component
export struct EmptyComponent {
@State emptyWidth: string | number = CommonConstants.FULL_PARENT;
@State emptyHeight: string | number = CommonConstants.FULL_PARENT;
@State emptyType: number = WDViewDefaultType.WDViewDefaultType_NoNetwork; // 缺省图类型,传枚举
@State emptyButton: boolean = false
@State timeNum: number = 10
/**
* The empty image width percentage setting.
*/
readonly EMPTY_IMAGE_WIDTH: string = '15%';
/**
* The empty image height percentage setting.
*/
readonly EMPTY_IMAGE_HEIGHT: string = '15%';
/**
* The empty data text component margin top.
*/
readonly EMPTY_TIP_TEXT_MARGIN_TOP: string = '10';
/**
* The empty data text opacity.
*/
readonly TEXT_OPACITY: number = 0.4;
private timer: number = -1
retry: () => void = () => {
}
build() {
this.noProgrammeData();
}
/**
* 无数据,空白view组件
*/
@Builder
noProgrammeData() {
Column() {
Image(this.buildNoDataTipImage())
.width(160)
.height(112)
.objectFit(ImageFit.Contain)
Text(this.emptyType !== 8 ? this.buildNoDataTip() : `${this.buildNoDataTip()}(${this.timeNum}s)`)
.fontSize($r('app.float.font_size_14'))// .fontColor('#FF999999')
.fontWeight(FontWeight.Normal)
.opacity(this.TEXT_OPACITY)
.margin({ top: this.EMPTY_TIP_TEXT_MARGIN_TOP })
.onClick((event: ClickEvent) => {
Logger.info(TAG, `noProgrammeData onClick event?.source: ${event.source}`);
})
if (this.isShowButton()) {
if (this.emptyType !== 15) {
Button('点击重试')
.type(ButtonType.Normal)
.width(80)
.height(28)
.backgroundColor('#fffffff')
.fontColor('#FF666666')
.border({ width: 1 })
.borderColor('#FFEDEDED')
.borderRadius(4)
.fontSize($r('app.float.font_size_12'))
.margin({ top: 16 })
.padding(0)
.onClick(() => {
this.retry()
})
} else {
Button('点击重试')
.type(ButtonType.Normal)
.width(80)
.height(28)
.backgroundColor(Color.Black)
.fontColor('#FFCCCCCC')
.border({ width: 1 })
.borderColor('#4DFFFFFF')
.borderRadius(4)
.fontSize($r('app.float.font_size_12'))
.margin({ top: 16 })
.padding(0)
.onClick(() => {
this.retry()
})
}
}
}
.justifyContent(FlexAlign.Center)
.width(this.emptyWidth)
.height(this.emptyHeight)
}
buildNoDataTip(): string {
Logger.info(TAG, "buildNoDataTip");
let contentString: string = '暂无内容'
if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoNetwork) {
contentString = '网络出小差了,请检查网络后重试'
}
return contentString
}
buildNoDataTipImage(): Resource | string {
Logger.info(TAG, "buildNoDataTip");
let imageString: Resource | string = ""
if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoNetwork) {
imageString = $r('app.media.icon_no_net1')
}
return imageString
}
isShowButton() {
if (this.emptyType === 1 || this.emptyType === 9 || this.emptyType === 15) {
return true
} else {
return false
}
}
}
... ...
import router from '@ohos.router';
import webview from '@ohos.web.webview';
import { SpConstants } from 'wdConstant/Index';
import { Logger, SPHelper } from 'wdKit';
import { Logger, NetworkUtil, SPHelper } from 'wdKit';
import { Params } from '../../../../../../../commons/wdRouter/oh_modules/wdBean/src/main/ets/bean/content/Params';
import { EmptyComponent } from './EmptyComponent';
const TAG = 'LoginProtocolWebview';
... ... @@ -12,7 +13,7 @@ const TAG = 'LoginProtocolWebview';
struct LoginProtocolWebview {
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
webUrl: string = ''
@State webUrl: string = ''
webviewController: webview.WebviewController = new webview.WebviewController()
userProtocol = "https://cdnpeoplefrontuat.aikan.pdnews.cn/rmrb/rmrb-protocol-zh-web/0.0.1/app/protocol-1005.html"
privateProtocol = 'https://cdnpeoplefrontuat.aikan.pdnews.cn/rmrb/rmrb-protocol-zh-web/0.0.1/app/protocol-1001.html'
... ... @@ -22,6 +23,7 @@ struct LoginProtocolWebview {
collectionProtocol = 'https://cdnpeoplefront.aikan.pdnews.cn/rmrb/rmrb-protocol-zh-web/0.0.1/app/protocol-1002.html'//收集个人信息明示清单
thirdVendorProtocol = 'https://cdnpeoplefront.aikan.pdnews.cn/rmrb/rmrb-protocol-zh-web/0.0.1/app/protocol-1004.html'//第三方信息共享清单
@State contentID:string = "0"
@State isConnectNetwork : boolean = NetworkUtil.isNetConnected()
async aboutToAppear() {
if (router.getParams()) {
... ... @@ -33,24 +35,17 @@ struct LoginProtocolWebview {
if (params.contentID == "1") { //"人民日报客户端网络服务使用协议"
this.webUrl = this.userProtocol
this.webUrl = await SPHelper.default.get(SpConstants.NET_SERVICE_PROTOCOL, this.userProtocol) as string
this.webviewController.loadUrl(this.webUrl)
} else if(params.contentID == "2"){ //"人民日报客户端用户隐私协议"
this.webUrl = this.privateProtocol
this.webUrl = await SPHelper.default.get(SpConstants.PRIVATE_PROTOCOL, this.privateProtocol) as string
this.webviewController.loadUrl(this.webUrl)
}else if(params.contentID == "3"){ //注销协议
this.webUrl = await SPHelper.default.get(SpConstants.LOGOUT_PROTOCOL, this.logoutProtocol) as string
this.webviewController.loadUrl(this.webUrl)
} else if(params.contentID == "4"){ //华为用户认证协议
this.webUrl = this.huaweiAuthProtocol
this.webviewController.loadUrl(this.webUrl)
} else if(params.contentID == "5"){ //收集个人信息明示清单
this.webUrl = this.collectionProtocol
this.webviewController.loadUrl(this.webUrl)
} else if(params.contentID == "6"){ //第三方信息共享清单
this.webUrl = this.thirdVendorProtocol
this.webviewController.loadUrl(this.webUrl)
}
}
... ... @@ -75,7 +70,7 @@ struct LoginProtocolWebview {
.alignItems(VerticalAlign.Center)
.width('100%')
.height(44)
if(this.isConnectNetwork){
Web({ src: this.webUrl, controller: this.webviewController })
.domStorageAccess(true)
.databaseAccess(true)
... ... @@ -89,6 +84,13 @@ struct LoginProtocolWebview {
Logger.info(TAG, 'onHttpErrorReceive event.response.getResponseCode:' + event?.response.getResponseCode());
})
.padding({bottom:this.contentID === "2" ? "40lpx" : 0 })
}else{
EmptyComponent({ emptyType: 1,emptyHeight:"100%" ,retry: () => {
this.isConnectNetwork = NetworkUtil.isNetConnected()
}})
.layoutWeight(1)
.width('100%')
}
}
}.width("100%")
.height("100%")
... ...
... ... @@ -13,6 +13,7 @@ const TAG = "OneKeyLoginPage"
@Entry
@Component
struct OneKeyLoginPage {
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
anonymousPhone: string = ''
@State agreeProtocol: boolean = false
viewModel: LoginViewModel = new LoginViewModel()
... ... @@ -121,6 +122,7 @@ struct OneKeyLoginPage {
})
}
.backgroundColor("#FFFFFF")
.padding({top: `${this.topSafeHeight}px`})
}
@Builder ProtocolRow() {
... ...
... ... @@ -27,6 +27,7 @@ export class WDPlayerController {
private prepareTime:number = 0; //加载时间
private currentPlayTime:number = 0; //当前播放时间
public onVideoSizeChange?: (width: number, height: number) => void;
public onLoaded?: (loaded: number) => void;
public onTimeUpdate?: (position: number, duration: number) => void;
public onVolumeUpdate?: (volume: number) => void;
public continue?: () => void;
... ... @@ -86,6 +87,9 @@ export class WDPlayerController {
if (this.surfaceId) {
this.avPlayer.surfaceId = this.surfaceId;
}
if(this.onLoaded) {
this.onLoaded(1)
}
this.avPlayer?.prepare();
break;
... ... @@ -101,6 +105,9 @@ export class WDPlayerController {
}
break;
case AVPlayerStatus.PLAYING:
if(this.onLoaded) {
this.onLoaded(2)
}
this.setBright();
this.status = PlayerConstants.STATUS_START;
this.avPlayer!.videoScaleType = media.VideoScaleType.VIDEO_SCALE_TYPE_FIT
... ...
... ... @@ -43,22 +43,26 @@ export struct WDPlayerRenderLiveView {
private playerController?: WDAliPlayerController;
private xComponentController: XComponentController = new XComponentController();
onLoad?: ((event?: object) => void);
videoWidth: number = 0
videoHeight: number = 0
@State videoWidth: number = 0
@State videoHeight: number = 0
@State videoRatio: number = 16 / 9
@State selfSize: Size = new Size('100%', '100%');
private insId: string = "WDPlayerRenderLiveView" + insIndex;
aboutToAppear() {
MGPlayRenderViewIns.add();
insIndex++;
if (!this.playerController) {
return
}
//this.init = true
this.playerController.onVideoSizeChange = (width: number, height: number) => {
// console.log(`WDPlayerRenderView onVideoSizeChange width:${width} videoTop:${height}`)
this.videoWidth = width;
this.videoHeight = height;
this.videoRatio = width / height
this.updateLayout()
}
}
... ... @@ -80,9 +84,9 @@ export struct WDPlayerRenderLiveView {
.onLoad(async (event) => {
Logger.info(TAG, 'onLoad')
let surfaceId = this.xComponentController.getXComponentSurfaceId()
this.xComponentController.setXComponentSurfaceSize({
surfaceWidth: 1920,
surfaceHeight: 720
this.xComponentController.setXComponentSurfaceRect({
surfaceWidth: this.videoWidth,
surfaceHeight: this.videoHeight
});
if (enableAliPlayer) {
this.playerController?.setSurfaceId(this.insId)
... ... @@ -93,8 +97,8 @@ export struct WDPlayerRenderLiveView {
this.onLoad(event)
}
})
.width(this.selfSize.width)
.height(this.selfSize.height)
// .width(this.selfSize.width)
// .height(this.selfSize.height)
}
.id(this.insId)
.onAreaChange(() => {
... ... @@ -107,15 +111,40 @@ export struct WDPlayerRenderLiveView {
}
updateLayout() {
let info = componentUtils.getRectangleById(this.insId);
if (info.size.width > 0 && info.size.height > 0 && this.videoHeight > 0 && this.videoWidth > 0) {
if (info.size.width / info.size.height > this.videoWidth / this.videoHeight) {
let scale = info.size.height / this.videoHeight;
this.selfSize = new Size((this.videoWidth * scale / info.size.width) * 100 + "%", '100%');
} else {
let scale = info.size.width / this.videoWidth;
this.selfSize = new Size('100%', (this.videoHeight * scale / info.size.height) * 100 + "%");
Logger.debug(TAG, "播放器区域变化: " + JSON.stringify(info))
Logger.debug(TAG, "xComponent rect: " + JSON.stringify(this.xComponentController.getXComponentSurfaceRect()))
if (info.size.width > 0 && info.size.height > 0) {
// 竖屏
if (this.videoHeight > 0 && this.videoWidth > 0 && this.videoWidth < this.videoHeight) {
let ratio = this.videoWidth / this.videoHeight
const height = info.size.width / ratio
// 竖屏,缩放高度大于 视频区域高度
if (height > info.size.height) {
Logger.debug(TAG, "ratio = " + ratio + " ==> new height = " + height)
Logger.debug(TAG, "高度固定,求宽度: " + info.size.height * ratio)
this.xComponentController.setXComponentSurfaceRect({
surfaceWidth: info.size.height * ratio,
surfaceHeight: info.size.height
});
return
}
}
this.xComponentController.setXComponentSurfaceRect({
surfaceWidth: info.size.width,
surfaceHeight: info.size.height
});
}
}
}
\ No newline at end of file
... ...
... ... @@ -2,6 +2,7 @@ import { ContentDetailDTO, ContentDTO, PageInfoDTO, ShareInfoDTO, TopicInfo } fr
import { SharePosterItemBean } from 'wdBean/src/main/ets/bean/detail/SharePosterItemBean';
import { ShareScene, ShareType, WDShareBase } from 'wdShareBase/Index';
import { ShareContentType } from 'wdShareBase/src/main/ets/Constant';
import { DeepLinkUtil } from './utils/DeepLinkUtil';
export class WDShare {
... ... @@ -17,6 +18,7 @@ export class WDShare {
title: content.shareInfo.shareTitle,
desc: content.shareInfo.shareSummary,
link: content.shareInfo.shareUrl,
deeplink:DeepLinkUtil.generateDeepLinkWithConent(content),
}
})
}
... ... @@ -32,6 +34,7 @@ export class WDShare {
title: program.shareInfo.shareTitle,
desc: program.shareInfo.shareSummary,
link: program.shareInfo.shareUrl,
deeplink:DeepLinkUtil.generateDeepLinkWithProgram(program),
}
})
}
... ...
import { ContentDetailDTO, ContentDTO } from 'wdBean/Index';
import { BreakpointSystem } from 'wdKit/Index';
import { ContentType } from 'wdRouter/Index';
export class DeepLinkUtil {
private static DEEP_LINK_PREFIX = "rmrbapp:rmrb.app/openwith"
static generateDeepLinkWithConent(content: ContentDetailDTO): string {
return DeepLinkUtil.generate(content.newsType, content.newsId +'', content.reLInfo?.relId, content.newsLinkUrl)
}
static generateDeepLinkWithProgram(content: ContentDTO) {
return DeepLinkUtil.generate(Number(content.objectType), content.objectId +'', content.relId, content.linkUrl)
}
private static generate(contentType: number, contentId?: string, relId?: string, link?: string): string {
let deeplink = DeepLinkUtil.DEEP_LINK_PREFIX
let pubParam = `&contentId=${contentId}}&relId=${relId}&skipType=1`
let type: ContentType = Number(contentType)
switch (type) {
case ContentType.Video:
deeplink += "?type=video&subType=vod_video"
break
case ContentType.Live:
deeplink += "?type=live"
break
case ContentType.ImageText:
if (link && link.length) {
deeplink += "?type=article&subType=h5"
deeplink += "&url=" + encodeURIComponent(link)
} else {
deeplink += "type=article&subType=h5_template_article"
}
break
case ContentType.DynamicImageText:
deeplink += "?type=dynamic"
break
case ContentType.DynamicVideo:
deeplink += "?type=dynamic"
break
case ContentType.Pictures:
deeplink += "?type=picture"
break
case ContentType.Audio:
deeplink += "?type=audio"
break
case ContentType.Ask:
deeplink += "?type=ask"
break
default:
pubParam = ""
break;
}
deeplink += pubParam
return deeplink
}
}
\ No newline at end of file
... ...
... ... @@ -32,7 +32,6 @@ struct MultiPictureDetailPage {
relType: this.relType
})
}
.padding({top: `${this.topSafeHeight}px`,bottom:`${this.bottomSafeHeight}px`})
}
.backgroundColor(Color.Black)
... ...
... ... @@ -115,7 +115,7 @@ struct LaunchAdvertisingPage {
if (this.defaultModel.linkUrl.length > 0 || this.defaultModel.objectId.length > 0){
Button(){
Row(){
Text('点击跳转至详情')
Text(this.defaultModel.isAd == '1'?'点击跳转至详情或第三方应用':'点击跳转至详情')
.fontSize('31lpx')
.fontColor(Color.White)
.margin({
... ...
... ... @@ -3,9 +3,10 @@ import { WDRouterRule } from 'wdRouter';
import { WDRouterPage } from 'wdRouter';
import { SPHelper } from 'wdKit/Index';
import { SpConstants } from 'wdConstant/Index';
import { CustomToast} from 'wdKit'
import { ButtonOptions, promptAction, window } from '@kit.ArkUI';
import { ParamType, TrackConstants, TrackingContent } from 'wdTracking/Index';
import { ImageKnifeComponent } from '@ohos/imageknife';
import { ImageKnifeComponent,ScaleType } from '@ohos/imageknife';
@Entry
@Component
... ... @@ -13,6 +14,18 @@ struct LaunchInterestsHobbiesPage {
@State message: string = 'Hello World'
@State selectCount: number = 0
@State interestsArray: InterestsList[] = []
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
dialogToast: CustomDialogController = new CustomDialogController({
builder: CustomToast({
msg: '请先选择您感兴趣的内容哦',
}),
autoCancel: false,
alignment: DialogAlignment.Center,
customStyle: true,
maskColor:"#00000000"
})
aboutToAppear(){
//请求接口,获取兴趣偏好数据
... ... @@ -39,6 +52,7 @@ struct LaunchInterestsHobbiesPage {
this.trackingLaunchJumpOver(false)
})
}
.margin({top:px2vp(this.topSafeHeight)})
.width('100%')
.justifyContent(FlexAlign.End)
... ... @@ -62,7 +76,7 @@ struct LaunchInterestsHobbiesPage {
ForEach(this.interestsArray,(item:InterestsList,index:number)=>{
GridItem(){
Stack({alignContent:Alignment.TopStart}){
ImageKnifeComponent({imageKnifeOption:{loadSrc:item.pic}})
ImageKnifeComponent({imageKnifeOption:{loadSrc:item.pic?item.pic:'',mainScaleType:ScaleType.FIT_XY}})
.width('100%')
.height('100%')
.backgroundColor(Color.White)
... ... @@ -98,7 +112,7 @@ struct LaunchInterestsHobbiesPage {
Image(item.choose ? $r('app.media.interestsSelected') : $r('app.media.interestsSelectNot'))
.height('32lpx')
.width('32lpx')
.margin({top:'80lpx',left:'110lpx'})
.margin({top:'80lpx',left:'120lpx'})
}.justifyContent(FlexAlign.Start)
}
... ... @@ -118,8 +132,7 @@ struct LaunchInterestsHobbiesPage {
})
}
.width('90%')
// .height('70%')
.margin({top:'61lpx',bottom:'240lpx'})
.margin({top:'61lpx',bottom:'300lpx'})
.columnsTemplate('1fr 1fr 1fr')
.columnsGap('23lpx')
.rowsGap('23lpx')
... ... @@ -129,7 +142,7 @@ struct LaunchInterestsHobbiesPage {
.height('100%')
}
.width('100%')
.height(`calc(100% - ${108 + 'lpx'})`)
.height(`calc(100% - ${158 + 'lpx'})`)
// .backgroundColor(Color.Red)
Stack({alignContent:Alignment.Center}){
... ... @@ -151,11 +164,7 @@ struct LaunchInterestsHobbiesPage {
.borderRadius('10lpx')
.onClick(()=>{
if (this.selectCount == 0) {
promptAction.showToast({
message : '请先选择您感兴趣的内容哦',
duration: 2000,
bottom: '50%',
})
this.dialogToast.open()
return
}
this.saveTagIds()
... ...
... ... @@ -123,30 +123,16 @@ export struct BottomNavigationComponent {
@Builder
tabBarBuilder(navItem: BottomNavDTO, index: number) {
Stack({ alignContent: Alignment.Bottom }) {
// Image(this.getBottomIcon(navItem, this.currentNavIndex === index))
// .height(CommonConstants.FULL_PARENT)
// .padding({
// bottom: 15,
// left: 10,
// right: 10,
// top: 2
// })
// .aspectRatio(this.ASPECT_RATIO_1_1)
// .alt(this.getBottomLocalIcon(navItem, this.currentNavIndex === index))
Column() {
ImageKnifeComponent({ imageKnifeOption: this.getBottomImageKnifeOption(navItem, this.currentNavIndex === index) })
.padding({
bottom: 15,
left: 10,
right: 10,
top: 2
})
.width('100%')
.height('100%')
.padding(1)
.margin({ top: 2 })
.width(32)
.height(32)
.enabled(false)
Text(navItem.name)
.margin({ bottom: $r('app.float.bottom_navigation_margin_bottom') })
.margin({ top: 2 })
.fontWeight(this.currentNavIndex === index ? FontWeight.Bold : FontWeight.Normal)
.textAlign(TextAlign.Center)
.fontSize($r('app.float.font_size_10'))// .fontColor(this.currentNavIndex === index ? Color.Red : Color.Gray)
... ... @@ -154,6 +140,7 @@ export struct BottomNavigationComponent {
.opacity(this.currentNavIndex === index ? this.FULL_OPACITY : this.SIXTY_OPACITY)
}
.zIndex(10)
.width('100%')
.height($r('app.float.bottom_navigation_barHeight'))
.hoverEffect(HoverEffect.Highlight)
.visibility(this.displayDirection === DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None)
... ...
... ... @@ -45,8 +45,8 @@ export struct MultiPictureDetailPageComponent {
@Provide contentDetailData: ContentDetailDTO = {} as ContentDetailDTO
@Provide windowWidth: number = AppStorage.get<number>('windowWidth') || 0
@Provide windowHeight: number = AppStorage.get<number>('windowHeight') || 0
@Provide bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
@Provide topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
@Consume bottomSafeHeight: number
@Consume topSafeHeight: number
@Provide @Watch('onCurrentPageNumUpdated') currentPageNum: string = '01'
private swiperController: SwiperController = new SwiperController()
private swiperControllerItem: SwiperController = new SwiperController()
... ... @@ -119,7 +119,7 @@ export struct MultiPictureDetailPageComponent {
currentIndex: $currentIndex,
showCommentList: $showCommentList,
publishCommentModel: $publishCommentModel,
interactData:$interactData
interactData: this.interactData
})
}
... ...