liyubing

Merge remote-tracking branch 'origin/main'

... ... @@ -60,12 +60,14 @@ export struct WdWebLocalComponent {
.imageAccess(true)
.mixedMode(MixedMode.All)
.onlineImageAccess(true)
.enableNativeEmbedMode(true)
.layoutMode(WebLayoutMode.FIT_CONTENT)
// .enableNativeEmbedMode(true)
// .layoutMode(WebLayoutMode.FIT_CONTENT)
.nestedScroll({
scrollForward: NestedScrollMode.SELF_FIRST,
scrollBackward: NestedScrollMode.PARENT_FIRST
})// .height(this.webHeight)
})
.width('100%')
.height(this.webHeight)
.onPageBegin((event) => {
this.onPageBegin(event?.url);
})
... ...
... ... @@ -63,6 +63,14 @@ export struct Card9Component {
this.textArr = titleInitRes.textArr;
}
formatTime(timeStamp: number) {
let todayDate = new Date().setHours(0,0,0,0);
let paramsDate = new Date(timeStamp).setHours(0,0,0,0);
let isToday = todayDate === paramsDate
let format: string = isToday ? 'HH:mm' : 'MM月dd日 HH:mm';
return DateTimeUtils.formatDate(timeStamp, format)
}
build() {
Column() {
// 顶部标题,最多两行
... ... @@ -208,7 +216,7 @@ export struct Card9Component {
.margin({ right: 5 })
.fillColor(item.newsTitleColor)
Text(DateTimeUtils.formatDate(item.publishTime, "MM月dd日 HH:mm"))
Text(this.formatTime(item.publishTime))
.fontSize($r('app.float.font_size_12'))
.fontColor($r('app.color.color_222222'))
.fontWeight(600)
... ...
... ... @@ -45,7 +45,7 @@ export struct ZhGridLayout02NewsContent {
buildItemCard(item: ContentDTO, index: number) {
Column() {
Stack({ alignContent: Alignment.BottomEnd }) {
Image(this.loadImg ? item == undefined ? '' : item.fullColumnImgUrls[0].url : '')
Image(this.loadImg ? item == undefined ? '' : item.fullColumnImgUrls?.[0]?.url : '')
.backgroundColor(0xf5f5f5)
.width('100%')
// .height(95)
... ...
... ... @@ -19,8 +19,8 @@ export struct ZhSingleRow02 {
@State pageId: string = '';
@State pageName: string = '';
@State compDTO: CompDTO = {} as CompDTO
@State initMoreWidth: number = 16;
@State moreWidth:number = 16
@State initMoreWidth: number = 22;
@State moreWidth:number = 22
@State moreTips: string = ''
scroller: Scroller = new Scroller()
... ... @@ -53,7 +53,7 @@ export struct ZhSingleRow02 {
resetEdgeAnimation() {
if (this.moreWidth > this.initMoreWidth) {
this.moreWidth = 16
this.moreWidth = 22
}
this.resetMoreTips()
}
... ...
... ... @@ -43,8 +43,8 @@ export struct ZhSingleRow03 {
// @State reserveStatus: reserveItem[] = []
@State reservedIds: string[] = [];
@State loadImg: boolean = false;
@State initMoreWidth: number = 16;
@State moreWidth:number = 16
@State initMoreWidth: number = 22;
@State moreWidth:number = 22
@State moreTips: string = ''
scroller: Scroller = new Scroller()
... ... @@ -78,7 +78,7 @@ export struct ZhSingleRow03 {
resetEdgeAnimation() {
if (this.moreWidth > this.initMoreWidth) {
this.moreWidth = 16
this.moreWidth = 22
}
this.resetMoreTips()
}
... ... @@ -260,7 +260,7 @@ export struct ZhSingleRow03 {
.fontSize(12)
.textAlign(TextAlign.Start)
.fontFamily('PingFang SC-Semibold')
.fontWeight(600)
.fontWeight(500)
Image($r('app.media.timeline_rect'))
.width(4)
.height(3)
... ... @@ -270,7 +270,7 @@ export struct ZhSingleRow03 {
.fontColor(0x000000)
.fontSize(12)
.fontFamily('PingFang SC-Semibold')
.fontWeight(600)
.fontWeight(500)
Text('开始直播')
.fontColor(0xC8C8C8)
.fontSize(12)
... ...
... ... @@ -681,15 +681,23 @@ export struct TopNavigationComponentNew {
} else {
ToastUtils.showToast('暂无早晚报信息', 1000)
}
let timer = setInterval(() => {
this.isClickMorningEveningPaper = false
clearInterval(timer);
}, 1000);
}).catch((err: string) => {
ToastUtils.showToast('暂无早晚报信息', 1000)
let timer = setInterval(() => {
this.isClickMorningEveningPaper = false
clearInterval(timer);
}, 1000);
})
} else {
ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000)
let timer = setInterval(() => {
this.isClickMorningEveningPaper = false
clearInterval(timer);
}, 1000);
}
}
... ...
... ... @@ -120,15 +120,15 @@ export struct PeopleShipHomePageNavComponent {
}
.height('100%')
Blank()
// 分享
Image((this.topOpacity > 0.5 ? $r('app.media.icon_forward') : $r('app.media.icon_share')))
.width('24vp')
.height('24vp')
.objectFit(ImageFit.Auto)
.margin({ right: '10vp' })
.onClick(() => {
ToastUtils.showToast('分享为公共方法,待开发', 1000);
})
// 分享 分享暂不展示
// Image((this.topOpacity > 0.5 ? $r('app.media.icon_forward') : $r('app.media.icon_share')))
// .width('24vp')
// .height('24vp')
// .objectFit(ImageFit.Auto)
// .margin({ right: '10vp' })
// .onClick(() => {
// ToastUtils.showToast('分享为公共方法,待开发', 1000);
// })
}
.width('100%')
.height('100%')
... ...
... ... @@ -9,8 +9,8 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
@State compDTO: CompDTO = {} as CompDTO
@State pageId: string = '';
@State pageName: string = '';
@State initMoreWidth: number = 16;
@State moreWidth:number = 16
@State initMoreWidth: number = 22;
@State moreWidth:number = 22
@State moreTips: string = ''
scroller: Scroller = new Scroller()
... ... @@ -44,7 +44,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
resetEdgeAnimation() {
if (this.moreWidth > this.initMoreWidth) {
this.moreWidth = 16
this.moreWidth = 22
}
this.resetMoreTips()
}
... ...
... ... @@ -18,8 +18,8 @@ export struct LiveHorizontalCardComponent {
@State pageName: string = '';
@State compDTO: CompDTO = {} as CompDTO
@State loadImg: boolean = false;
@State initMoreWidth: number = 16;
@State moreWidth:number = 16
@State initMoreWidth: number = 22;
@State moreWidth:number = 22
@State moreTips: string = ''
scroller: Scroller = new Scroller()
... ... @@ -53,7 +53,7 @@ export struct LiveHorizontalCardComponent {
resetEdgeAnimation() {
if (this.moreWidth > this.initMoreWidth) {
this.moreWidth = 16
this.moreWidth = 22
}
this.resetMoreTips()
}
... ...
... ... @@ -33,13 +33,11 @@ struct LoginProtocolWebview {
this.contentID = params.contentID
}
if (params.contentID == "1") { //"人民日报客户端网络服务使用协议"
this.webUrl = this.userProtocol
this.webUrl = await SPHelper.default.get(SpConstants.NET_SERVICE_PROTOCOL, this.userProtocol) as string
this.webUrl = SPHelper.default.getSync(SpConstants.NET_SERVICE_PROTOCOL, this.userProtocol) as string
} else if(params.contentID == "2"){ //"人民日报客户端用户隐私协议"
this.webUrl = this.privateProtocol
this.webUrl = await SPHelper.default.get(SpConstants.PRIVATE_PROTOCOL, this.privateProtocol) as string
this.webUrl = SPHelper.default.getSync(SpConstants.PRIVATE_PROTOCOL, this.privateProtocol) as string
}else if(params.contentID == "3"){ //注销协议
this.webUrl = await SPHelper.default.get(SpConstants.LOGOUT_PROTOCOL, this.logoutProtocol) as string
this.webUrl = SPHelper.default.getSync(SpConstants.LOGOUT_PROTOCOL, this.logoutProtocol) as string
} else if(params.contentID == "4"){ //华为用户认证协议
this.webUrl = this.huaweiAuthProtocol
} else if(params.contentID == "5"){ //收集个人信息明示清单
... ...
... ... @@ -21,7 +21,7 @@ export class PublicParams {
"isSign": AccountManagerUtils.isLoginSync() ? "1" : "0",
"environment": PublicParams.getEnv(),
"os": AppUtils.getOSName(),
"actionTime": new Date().getTime() * 0.001,
"actionTime": Math.log(new Date().getTime() / 1000),
"channel": AppUtils.getAppChannel(),
"version": AppUtils.getAppVersionName(),
"deviceId": DeviceUtil.clientId(),
... ...