wangliang_wd

Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool into main

* 'main' of http://192.168.1.42/developOne/harmonyPool:
  详情页与安卓保持一致
  fix: 语音播报早晚报文章时,进入列表中的视频稿件,然后再退出后,没有对语音播报暂停(安卓是会暂停的)
  fix: MainPage.ets, 国殇代码容错处理
  fix: MainPage.ets, 国殇代码容错处理
  feat: 视频详情页,未展示发稿时间
... ... @@ -38,6 +38,7 @@ export class DateTimeUtils {
// 日期+时间格式
static readonly PATTERN_DATE_TIME_DEFAULT: string = 'yyyyMMddHHmmss'; // 年月日时分秒
static readonly PATTERN_DATE_TIME_HYPHEN: string = 'yyyy-MM-dd HH:mm:ss'; // 日期中包含连字符/中划线(HYPHEN),时间是以冒号(Colon)分割
static readonly PATTERN_DATE_TIME_HYPHEN_MM: string = 'yyyy-MM-dd HH:mm'; // 日期中包含连字符/中划线(HYPHEN),时间是以冒号(Colon)分割
static readonly PATTERN_DATE_TIME_HYPHEN_MS: string = 'yyyy-MM-dd HH:mm:ss.SSS'; // 日期中包含连字符/中划线(HYPHEN),时间是以冒号(Colon)分割
static readonly PATTERN_DATE_TIME_SLASH: string = 'yyyy/MM/dd HH:mm:ss'; // 日期中包含正斜杠(forward slash '/')
static readonly PATTERN_DATE_TIME_BACK_SLASH: string = 'yyyy\\MM\\dd HH:mm:ss'; // 日期中包含反斜杠(back slash '\')
... ...
... ... @@ -119,7 +119,6 @@ export struct DetailVideoListPage {
console.info(TAG, 'this.isShowAudioCom: ' + this.isShowAudioCom);
if (this.isShowAudioCom) {
this.AudioSuspension.showWindow()
this.AudioSuspension.playerController.get()?.play();
this.isShowAudioCom = false
}
}
... ...
... ... @@ -43,7 +43,8 @@ export struct DetailDialog {
.height(200)
Row() {
Image($r("app.media.ic_close_white"))
Image($r("app.media.icon_arrow_left_white"))
.rotate({ angle: -90, centerX: '50%', centerY: '50%' })
.height(24).margin({ top: 20 }).onClick(() => {
this.controller.close()
if (this.isOpenDetail) {
... ...
... ... @@ -38,6 +38,7 @@ export struct PlayerProgressView {
ToastUtils.shortToast('网络出小差了,请检查下网络')
}, 10000)
} else {
// console.log("PlayerProgressView22", this.timer)
clearTimeout(this.timer)
this.loadingWidth = 1
this.showLoading = false
... ...
... ... @@ -2,6 +2,7 @@ import measure from '@ohos.measure'
import { ContentDetailDTO } from 'wdBean/Index'
import { DetailDialog } from './DetailDialog'
import { componentUtils } from '@kit.ArkUI'
import { DateTimeUtils } from 'wdKit'
const TAG = 'PlayerTitleView';
@Preview
... ... @@ -131,34 +132,33 @@ export struct PlayerTitleView {
.fontWeight(600)
.fontFamily('PingFang SC-Regular')
.textOverflow({ overflow: TextOverflow.Ellipsis })
.margin({ bottom: 8 })
.margin({ bottom: 2 }) //8
/**
* 标题大于三行或存在简介显示查看详情按钮
*/
if (this.rmhPlatform == 1) {
if (this.titleHeight > 200 || this.summary) {
Text('查看详情 > ')
.padding({
left: 6,
right: 6,
top: 4,
bottom: 4
})
.borderRadius(2)
.backgroundColor('#99636363')
.fontFamily('PingFang SC-Regular')
.fontColor(Color.White)
.fontSize(12)
.lineHeight(14)
.fontWeight(400)
.margin({ bottom: 8 })
.onClick(() => {
this.isOpenDetail = true
this.dialogController?.open()
})
}
} else {
// if (this.rmhPlatform == 1) {
// if (this.titleHeight > 200 || this.summary) {
// Text('查看详情 > ')
// .padding({
// left: 6,
// right: 6,
// top: 4,
// bottom: 4
// })
// .borderRadius(2)
// .backgroundColor('#99636363')
// .fontFamily('PingFang SC-Regular')
// .fontColor(Color.White)
// .fontSize(12)
// .lineHeight(14)
// .fontWeight(400)
// .onClick(() => {
// this.isOpenDetail = true
// this.dialogController?.open()
// })
// }
// } else {
if(this.summary) {
Text() {
Span(this.clipText(this.summary, 14, 3, this.windowWidth - 150 - vp2px(50)))
... ... @@ -181,10 +181,11 @@ export struct PlayerTitleView {
.width(14)
.height(14)
.objectFit(ImageFit.Fill)
.verticalAlign(ImageSpanAlignment.CENTER)
.padding({
bottom: 4
})
.verticalAlign(ImageSpanAlignment.BOTTOM)
.margin({bottom:1})
// .padding({
// bottom: 4
// })
.onClick(() => {
this.isOpenDetail = true
this.dialogController?.open()
... ... @@ -193,14 +194,22 @@ export struct PlayerTitleView {
}
}
.padding({
left: 6,
left: 0,//6
right: 6,
top: 4,
top: 0,//4
bottom: 4
})
.margin({ bottom: 8 })
}
}
// }
Text(DateTimeUtils.formatDate(new Date(this.contentDetailData?.publishTime).getTime(), DateTimeUtils.PATTERN_DATE_TIME_HYPHEN_MM))
.fontSize(12)
.fontColor(Color.White)
.opacity(0.7)
.lineHeight(16)
.fontWeight(400)
.fontFamily('PingFang SC-Regular')
.margin({ top: 8, bottom: 8 })
}
.width(this.windowWidth - 150 + 'px')
... ...
... ... @@ -12,6 +12,7 @@ import { StartupManager } from '../startupmanager/StartupManager';
import { BusinessError } from '@kit.BasicServicesKit';
import { BottomNavigationComponent } from './view/BottomNavigationComponent';
import LaunchDataModel from './viewModel/LaunchDataModel';
import { LaunchPageModel } from './viewModel/LaunchPageModel';
const TAG = 'MainPage';
... ... @@ -44,6 +45,13 @@ struct MainPage {
})
let dataModelStr : string = SPHelper.default.getSync(SpConstants.APP_LAUNCH_PAGE_DATA_MODEL,'') as string
if (!dataModelStr) {
//请求启动页相关接口数据并保存
let launchPageModel = new LaunchPageModel()
launchPageModel.getLaunchPageData()
dataModelStr = SPHelper.default.getSync(SpConstants.APP_LAUNCH_PAGE_DATA_MODEL,'') as string
}
let dataModel : LaunchDataModel = JSON.parse(dataModelStr)
console.log(dataModelStr)
// 处理国殇模式数据
... ...
... ... @@ -278,7 +278,6 @@ export struct BottomNavigationComponent {
console.info(TAG, 'this.isShowAudioCom: ' + this.isShowAudioCom);
if (this.isShowAudioCom) {
this.AudioSuspension.showWindow()
this.AudioSuspension.playerController.get()?.play();
this.isShowAudioCom = false
}
}
... ...