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: 18091 健康频道>轮播图卡配置为投票活动交互问题
  fix: 19530 【UI走查-卡片】折叠屏展开-人民号无图卡
  fix:   动态详情点赞,返回信息流列表页,点赞效果未回显
  fix |> 通过桌面组件进入早晚报详情页后返回上一级未能返回到早晚报专题页
  fix |> 稿件详情页面,下方的推荐阅读和最新评论, 没有与内容左对齐
  fix |> 桌面组件--早晚报中含有专题页内容时桌面组件无法跳转对应的专题页
  ref |> 消息推送--uat环境app的消息数量阅读后数量一直不变
  fix |> 稿件详情,热门评论与最新评论的分割线高度不够,较细
  ref |> 修复点击文字直播进入直播详情提示内容不存在问题
  fix:  进入动态视频详情页,播放视频,实际播放视频非对应动态的视频
  fix |> 【8.0新需求】设备拉黑功能未实现;
Showing 21 changed files with 175 additions and 66 deletions
... ... @@ -14,6 +14,9 @@ export class AppUtils {
AppUtils.buildVersion = BuildProfile.BUILD_VERSION;
}
// 全局应用context
public static gotApplicationContextFunc?: () => common.UIAbilityContext
/**
* 获取应用名称
* 即:人民日报
... ...
... ... @@ -49,5 +49,8 @@ export enum EmitterEventId {
// 全屏
FULL_SCREEN = 14,
// 图文详情页点赞状态
LIKE_CHANGE_STATUS = 15,
}
... ...
... ... @@ -6,6 +6,7 @@ import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO'
import { Logger } from 'wdKit/Index'
import { ContentType } from '../common/ContentType'
import { WDRouterRule } from '../router/WDRouterRule'
import HomeChannelUtils from './HomeChannelUtils'
import { ProcessUtils } from './ProcessUtils'
const TAG = "AppInnerLink"
... ... @@ -123,8 +124,18 @@ export class AppInnerLink {
WDRouterRule.jumpWithAction(taskAction)
}
if (params.type == "channel") {
if (params.type == "topic" && params.subType == "audio_news") {
}
if (params.type == "topic" && params.subType == "moring_evening_news") {
ProcessUtils.gotoMorningEveningPaper()
}
if (params.type == "channel") {
if (params.subType == "electronic_newspapers") {
ProcessUtils.gotoENewsPaper();
return
}
HomeChannelUtils.jumpChannelTab(params.firstChannelId ?? "", params.pageId ?? "", "")
}
}
... ...
... ... @@ -12,14 +12,16 @@ export class AppInnerLinkGenerator {
static generateDeepLinkWithProgram(content: ContentDTO) {
return AppInnerLinkGenerator.generate(Number(content.objectType), content.objectId +'', content.relId, content.linkUrl)
return AppInnerLinkGenerator.generate(Number(content.objectType), content.objectId +'', content.relId
, content.linkUrl, content.pageId, Number(content.objectLevel))
}
static generateDeepLinkWithFrontObjectLink(content: FrontLinkObject) {
return AppInnerLinkGenerator.generate(Number(content.newsType), content.newsId +'', content.newsRelId + '', content.linkUrl)
return AppInnerLinkGenerator.generate(Number(content.newsType), content.newsId +''
, content.newsRelId + '', content.linkUrl, content.newsPageId, Number(content.newsLevel))
}
static generate(contentType: number, contentId?: string, relId?: string, link?: string): string {
static generate(contentType: number, contentId?: string, relId?: string, link?: string, pageId?: string, objectLevel?: number): string {
let deeplink = AppInnerLinkGenerator.DEEP_LINK_PREFIX
let pubParam = `&contentId=${contentId ?? ""}&relId=${relId ?? ""}&skipType=1`
... ... @@ -55,6 +57,20 @@ export class AppInnerLinkGenerator {
case ContentType.Ask:
deeplink += "?type=ask"
break
case ContentType.Subject:
if (objectLevel && objectLevel == 25) { // 早晚报专题
deeplink += `?type=topic&subType=moring_evening_news&pageId=${pageId}&relId=${relId}&skipType=1`
return deeplink
}
if (objectLevel && objectLevel == 22) { // 音频专题
deeplink += `?type=topic&subType=audio_news&pageId=${pageId}&relId=${relId}&skipType=1`
return deeplink
}
if (link) {
deeplink += `?type=topic&subType=h5&pageId=${pageId}&relId=&url=${encodeURIComponent(link)}&skipType=1`
return deeplink
}
break
default:
pubParam = ""
break;
... ...
... ... @@ -4,9 +4,9 @@ export interface FrontLinkObject {
linkUrl: string;
newsId: string;
newsLevel: string;
// newsPageId?: any;
newsPageId: string;
newsRelId: number;
// newsRelType?: any;
newsRelType: string;
newsType: number;
publishTime: string;
source: string;
... ...
import { SPHelper, Logger, ToastUtils } from 'wdKit';
import { SPHelper, Logger, ToastUtils, EmitterUtils, EmitterEventId } from 'wdKit';
import { ContentDetailDTO, Action, ContentDTO, batchLikeAndCollectResult } from 'wdBean';
import { ProcessUtils } from 'wdRouter';
import router from '@ohos.router';
... ... @@ -11,6 +11,11 @@ import { TrackConstants } from 'wdTracking/Index';
const TAG = 'CarderInteraction'
interface parsedObj {
contentId: string,
likeStatus: string
}
/**
* 卡片 分享、评论、点赞公用组件
*/
... ... @@ -47,6 +52,25 @@ export struct CarderInteraction {
// console.log(TAG, 'this.isShowComment', this.isShowComment)
// console.log(TAG, 'this.isShowLike', this.isShowLike)
// console.log(TAG, 'router.getState().name', router.getState().name)
EmitterUtils.receiveEvent(EmitterEventId.LIKE_CHANGE_STATUS, (val: string | undefined) => {
// console.log(TAG,'val点赞', val)
if (val === undefined) {
console.error('Value is undefined');
return;
}
try {
const parsedVal: parsedObj = JSON.parse(val);
if (parsedVal.contentId === this.contentDetailData.newsId + '') {
// console.log(TAG,'params点赞状态', parsedVal.likeStatus)
this.likeBean['likeStatus'] = parsedVal.likeStatus
// console.log(TAG,'this.likeBean点赞状态', this.likeBean['likeStatus'])
}
} catch (error) {
console.error('Error parsing JSON:', error);
}
});
}
... ...
... ... @@ -53,6 +53,11 @@ import { onlyWifiLoadImg } from '../utils/lazyloadImg';
const TAG = 'DynamicDetailComponent'
const PATTERN_DATE_CN_RN: string = 'yyyy年MM月dd日 HH:mm';
interface parsedObj {
contentId: string,
likeStatus: string
}
/**
* 动态详情页UI
... ... @@ -641,7 +646,7 @@ export struct DynamicDetailComponent {
// 评论
if (this.contentDetailData?.openComment) {
Divider().strokeWidth(6).color('#f5f5f5').margin({ top: $r('app.float.margin_24') })
Divider().strokeWidth(8).color('#f5f5f5').margin({ top: $r('app.float.margin_24') })
CommentComponent({
publishCommentModel: this.publishCommentModel
})
... ... @@ -782,11 +787,11 @@ export struct DynamicDetailComponent {
}
]
}
console.error(TAG, JSON.stringify(this.contentDetailData))
// console.error(TAG,'CarderInteraction', JSON.stringify(params.contentList))
let data = await MultiPictureDetailViewModel.getInteractDataStatus(params)
console.error(TAG, '查询用户对作品点赞、收藏状态', JSON.stringify(data))
// console.error(TAG, 'CarderInteraction 查询用户对作品点赞、收藏状态', JSON.stringify(data))
this.newsStatusOfUser = data[0];
Logger.info(TAG, `newsStatusOfUser:${JSON.stringify(this.newsStatusOfUser)}`)
// Logger.info(TAG, `newsStatusOfUser:${JSON.stringify(this.newsStatusOfUser)}`)
} catch (exception) {
console.error(TAG, JSON.stringify(exception))
}
... ... @@ -808,7 +813,7 @@ export struct DynamicDetailComponent {
}
let data = await MultiPictureDetailViewModel.getBatchAttentionStatus(params)
this.followStatus = data[0]?.status;
Logger.info(TAG, `followStatus:${JSON.stringify(this.followStatus)}`)
// Logger.info(TAG, `followStatus:${JSON.stringify(this.followStatus)}`)
} catch (exception) {
this.followStatus = '0';
}
... ... @@ -882,7 +887,7 @@ export struct DynamicDetailComponent {
status: this.followStatus == '0' ? 1 : 0,
}
ContentDetailRequest.postInteractAccentionOperate(params2).then(res => {
console.log('关注号主==', JSON.stringify(res.data))
// console.log('关注号主==', JSON.stringify(res.data))
if (this.followStatus == '1') {
this.followStatus = '0'
TrackingContent.follow(true,this.contentDetailData.rmhInfo == null ?"":this.contentDetailData.rmhInfo.rmhId,this.contentDetailData.rmhInfo == null ?"":this.contentDetailData.rmhInfo.rmhName,TrackConstants.PageName.DynamicDetail,TrackConstants.PageName.DynamicDetail,this.pageParam)
... ... @@ -915,7 +920,14 @@ export struct DynamicDetailComponent {
} else {
this.interactDataDTO.likeNum = Number(this.interactDataDTO.likeNum) - 1
}
console.log('点赞、取消点赞==', this.newsStatusOfUser?.likeStatus, this.interactDataDTO?.likeNum)
let parsedVal: parsedObj = {
contentId: params.contentId,
likeStatus: this.newsStatusOfUser.likeStatus
}
EmitterUtils.sendEvent(EmitterEventId.LIKE_CHANGE_STATUS, JSON.stringify(parsedVal))
// console.log(TAG, 'CarderInteraction 点赞parsedVal', JSON.stringify(parsedVal))
// console.log('点赞、取消点赞==', this.newsStatusOfUser?.likeStatus, this.interactDataDTO?.likeNum)
//内容点赞、取消点赞Tracking 1点赞 0取消点赞
TrackingContent.like(this.newsStatusOfUser?.likeStatus == '1', TrackConstants.PageName.DynamicDetail, TrackConstants.PageName.DynamicDetail,
... ...
... ... @@ -190,12 +190,12 @@ export struct ImageAndTextPageComponent {
.justifyContent(FlexAlign.Center)
}
if (this.recommendList.length > 0) {
Divider().strokeWidth(6).color('#f5f5f5')
Divider().strokeWidth(8).color('#f5f5f5')
RecommendList({ recommendList: this.recommendList })
}
// 评论
if (this.contentDetailData?.openComment) {
Divider().strokeWidth(6).color('#f5f5f5')
Divider().strokeWidth(8).color('#f5f5f5')
CommentComponent({
publishCommentModel: this.publishCommentModel,
fixedHeightMode: false,
... ... @@ -440,10 +440,10 @@ export struct ImageAndTextPageComponent {
userName:this.contentDetailData?.userInfo?.userName || '' + '',
channelId:String(this.contentDetailData?.reLInfo?.channelId) || '' + ''
}
console.log(TAG, '点赞、取消点赞params', JSON.stringify(params))
// console.log(TAG, '点赞、取消点赞params', JSON.stringify(params))
PageRepository.postExecuteLike(params).then(res => {
// console.log(TAG, '点赞、res', JSON.stringify(res))
console.log(TAG, '点赞、取消点赞 this.newsStatusOfUser', JSON.stringify(this.newsStatusOfUser))
// console.log(TAG, '点赞、取消点赞 this.newsStatusOfUser', JSON.stringify(this.newsStatusOfUser))
if (this.newsStatusOfUser) {
//内容点赞、取消点赞Tracking 1点赞 0取消点赞
this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus == '1' ? '0' : '1'
... ... @@ -452,7 +452,7 @@ export struct ImageAndTextPageComponent {
} else {
this.likeNum = Number(this.likeNum) - 1
}
console.log(TAG, '点赞newsStatusOfUser.likeStatus ', this.newsStatusOfUser.likeStatus)
// console.log(TAG, '点赞newsStatusOfUser.likeStatus ', this.newsStatusOfUser.likeStatus)
// this.queryContentInteractCount()
TrackingContent.like(this.newsStatusOfUser?.likeStatus == '1', TrackConstants.PageName.My, TrackConstants.PageName.My)
} else {
... ...
... ... @@ -131,11 +131,11 @@ export struct RmhTitle {
build() {
Flex() {
Stack() {
Image(this.loadImg ? this.rmhInfo?.rmhHeadUrl : this.rmhInfo.userType == '1'?$r('app.media.default_head_userPage'):$r('app.media.comment_rmh_tag'))
.alt(this.rmhInfo.userType == '1'?$r('app.media.default_head_userPage'):$r('app.media.comment_rmh_tag'))
Image(this.loadImg ? this.rmhInfo?.rmhHeadUrl : this.rmhInfo.userType == '1'?$r('app.media.default_head_userPage'):$r('app.media.AccountOwner_DefaultIcon'))
.alt(this.rmhInfo.userType == '1'?$r('app.media.default_head_userPage'):$r('app.media.AccountOwner_DefaultIcon'))
.width(36)
.height(36)
.borderRadius(50)
.borderRadius(18)
.border({
width: 0.5,
color: '#0D000000', // 5% 透明度的黑色
... ...
... ... @@ -28,7 +28,7 @@ export struct Card19Component {
this.titleInit();
const curRouter = router.getState().name;
this.clicked = hasClicked(this.contentDTO.objectId, curRouter)
console.log('card19',JSON.stringify(this.contentDTO))
// console.log('card19',JSON.stringify(this.contentDTO))
}
titleInit() {
... ...
... ... @@ -132,7 +132,7 @@ export struct CommentComponent {
Column() {
if (showGapLine) {
Blank().height(12)
Divider().strokeWidth(6).color('#f5f5f5')
Divider().strokeWidth(8).color('#f5f5f5')
}
Row() {
... ... @@ -427,7 +427,7 @@ struct ChildCommentItem {
@Link dialogController: CustomDialogController | null
@ObjectLink item: commentItemModel
@Consume contentDetailData: ContentDetailDTO
private leftGap: number = 95 + 4
@Consume inDialog: boolean
private dialogBeforeJumpOtherPageAction: () => void = () => {}
... ... @@ -490,14 +490,14 @@ struct ChildCommentItem {
fontWeight: FontWeight.Regular,
marginWidth: (95 + 16)
})
.margin({ left: 95, right: 16, top: -15 })
.margin({ left: this.leftGap, right: 16, top: -15 })
.onClick(() => {
this.replyComment()
})
if (this.item.commentPics.length > 0) {
Image(this.item.commentPics)
.width(88).height(88)
.margin({top: 6 + (this.item.commentContent.length > 0 ? 0 : 15), left: 95})
.margin({top: 6 + (this.item.commentContent.length > 0 ? 0 : 15), left: this.leftGap})
}
commentFooterView({
... ... @@ -505,7 +505,7 @@ struct ChildCommentItem {
dialogController: this.dialogController,
publishCommentModel: this.publishCommentModel,
dialogBeforeJumpOtherPageAction: this.dialogBeforeJumpOtherPageAction
}).margin({ left: 95, right: 16 })
}).margin({ left: this.leftGap, right: 16 })
}.alignItems(HorizontalAlign.Start)
.width('100%')
}
... ... @@ -540,7 +540,7 @@ struct ChildCommentItem {
}
}
.width(48).height(48)
.margin({ left: 47 })
.margin({ left: 47 + 4 })
.alignContent(Alignment.Center)
.onClick(() => {
... ... @@ -628,6 +628,7 @@ struct footerExpandedView {
}.height(20)
// .backgroundColor(Color.Green)
}.height(24)
.padding({left: 4})
.alignItems(VerticalAlign.Top)
// .backgroundColor(Color.Gray)
}
... ... @@ -663,6 +664,7 @@ struct commentHeaderView {
@Consume inDialog: boolean
private dialogBeforeJumpOtherPageAction: () => void = () => {}
private leftGap: number = 64
build() {
Column() {
... ... @@ -712,7 +714,7 @@ struct commentHeaderView {
fontWeight: FontWeight.Regular,
marginWidth: (59 + 16)
})
.margin({ left: 60, right: 16,top:-15 })
.margin({ left: this.leftGap, right: 16,top:-12 })
.onClick(() => {
this.replyComment()
})
... ... @@ -720,7 +722,7 @@ struct commentHeaderView {
if (this.item.commentPics.length > 0) {
Image(this.item.commentPics)
.width(88).height(88)
.margin({top: 6 + (this.item.commentContent.length > 0 ? 0 : 15), left: 60})
.margin({top: 6 + (this.item.commentContent.length > 0 ? 0 : 15), left: this.leftGap})
}
commentFooterView({
... ... @@ -728,7 +730,7 @@ struct commentHeaderView {
dialogController: this.dialogController,
publishCommentModel: this.publishCommentModel,
dialogBeforeJumpOtherPageAction: this.dialogBeforeJumpOtherPageAction
}).margin({ left: 60, right: 16 })
}).margin({ left: this.leftGap, right: 16 })
}.alignItems(HorizontalAlign.Start)
.padding({bottom: 0})
}
... ... @@ -763,7 +765,7 @@ struct commentHeaderView {
}
}
.width(48).height(48)
.margin({ left: 8 })
.margin({ left: 8 + 4 })
.alignContent(Alignment.Center)
.onClick(() => {
... ...
... ... @@ -65,7 +65,7 @@ export struct ZhCarouselLayout01 {
Logger.info(TAG,
`aboutToAppear, beanList:${this.compDTO?.operDataList?.length}, currentBreakpoint:${this.currentBreakpoint}`);
let list: number[] = []
for (let i = 1; i <= this.compDTO?.operDataList?.length; i++) {
for (let i = 1; i <= this.filterAtv()?.length; i++) {
list.push(i);
}
this.data = new MyDataSource(list)
... ... @@ -84,17 +84,23 @@ export struct ZhCarouselLayout01 {
}
}
filterAtv() {
return this.compDTO.operDataList.filter(((item: ContentDTO) => {
return !item.linkUrl.includes('/h/atv')
}))
}
build() {
if (this.compDTO?.operDataList?.length) {
if (this.compDTO?.operDataList.length > 1) {
Stack() {
Swiper() {
ForEach(this.compDTO?.operDataList, (item: ContentDTO, index: number) => {
ForEach(this.filterAtv(), (item: ContentDTO, index: number) => {
CarouselLayout01CardView({
item: item,
length: this.compDTO.operDataList.length,
showPicBorderRadius: this.compDTO.operDataList.length == 1
length: this.filterAtv().length,
showPicBorderRadius: this.filterAtv().length == 1
})
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName)
... ... @@ -172,13 +178,13 @@ export struct ZhCarouselLayout01 {
.width(CommonConstants.FULL_WIDTH)
} else {
CarouselLayout01CardView({
item: this.compDTO.operDataList[0],
item: this.filterAtv()[0],
length: 1,
showPicBorderRadius: this.compDTO.operDataList.length == 1
showPicBorderRadius: this.filterAtv().length == 1
})
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.compDTO.operDataList[0], this.pageId, this.pageName)
ProcessUtils.processPage(this.compDTO.operDataList[0])
InfomationCardClick.track(this.compDTO, this.filterAtv()[0], this.pageId, this.pageName)
ProcessUtils.processPage(this.filterAtv()[0])
})
.padding({
left: 10,
... ...
... ... @@ -19,6 +19,10 @@ interface ILikeStyleResp {
url: Resource;
name: string;
}
interface parsedObj {
contentId: string,
likeStatus: string
}
@Component
export struct LikeComponent {
... ... @@ -59,18 +63,18 @@ export struct LikeComponent {
this.likesStyle = this.contentDetailData.likesStyle
this.openLikes = this.contentDetailData.openLikes == 1 ? true : false
}
console.log(TAG, 'this.contentDetailData', JSON.stringify(this.contentDetailData))
console.log(TAG, 'this.componentType', this.componentType)
console.log(TAG, 'this.likesStyle', this.likesStyle)
console.log(TAG, 'this.openLikes', this.openLikes)
// console.log(TAG, 'this.contentDetailData', JSON.stringify(this.contentDetailData))
// console.log(TAG, 'this.componentType', this.componentType)
// console.log(TAG, 'this.likesStyle', this.likesStyle)
// console.log(TAG, 'this.openLikes', this.openLikes)
this.onDataUpdated()
this.contentTrackingDict()
}
onDataUpdated() {
console.log(TAG, '点赞点击')
if (this.data) {
if (this.data['contentType'] !== undefined ) {
console.log(TAG, 'CarderInteraction 点赞点击')
//获取点赞状态
this.getLikeStatus()
//获取点赞数
... ... @@ -458,6 +462,7 @@ export struct LikeComponent {
this.likeCount--
TrackingContent.like(false,this.pageId,this.pageName,this.pageParam)
}
}
if (this.likeCount <= 0) {
... ... @@ -479,19 +484,25 @@ export struct LikeComponent {
{
contentId: this.data['contentId'],
contentType: this.data['contentType'],
contentRelId: this.data['contentRelId'] || '' + '',
contentRelId: this.data['contentRelId'] == "0" ? '' : this.data['contentRelId'] || '' + '',
}
]
}
console.log(TAG, "查询点赞状态params", JSON.stringify(params))
// console.log(TAG, "CarderInteraction 查询点赞状态params", JSON.stringify(params))
ContentDetailRequest.postBatchLikeAndCollectStatus(params).then(res => {
console.log(TAG, '查询点赞、收藏状态==', JSON.stringify(res.data))
// console.log(TAG, 'CarderInteraction 查询点赞、收藏状态==', JSON.stringify(res.data))
if (res.data) {
if(res.data[0].likeStatus) {
this.likeStatus = res.data[0].likeStatus ? true : false
} else {
this.likeStatus = false
}
// CarderInteraction组件交互
if (this.data['likeStatus'] == "1") {
this.likeStatus = true
} else if (this.data['likeStatus'] == "0") {
this.likeStatus = false
}
}
}).catch(() => {
this.likeStatus = false
... ...
... ... @@ -30,7 +30,7 @@ export struct RecommendList {
ForEach(this.recommendList, (item: ContentDTO, index: number) => {
Row() {
CardParser({ compDTO:new CompDTO,contentDTO: item });
}
}.padding({ left: 6, right: 6 })
if (this.recommendList.length !== index + 1) {
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
}
... ...
... ... @@ -102,9 +102,10 @@ export struct DetailPlayLiveCommon {
}
const detailData = data[0];
///直播方式 0 视频直播 1 文字直播
const liveWay = detailData.liveInfo?.liveWay as number;
// 人民号类型单独获取直播地址
if (detailData.rmhPlatform === 1 && detailData.liveInfo?.liveState === 'running') {
if (detailData.rmhPlatform === 1 && detailData.liveInfo?.liveState === 'running' && liveWay == 0) {
const vliveId = detailData.liveInfo.vlive[0].vliveId as string;
const pullStreamAddressData = await this.liveViewModel.getLiveRoomPullAddress(vliveId) as GetPullAddressBean;
... ... @@ -135,13 +136,14 @@ export struct DetailPlayLiveCommon {
publishCommentModel.commentContent = '';
this.liveStyle = detailData.liveInfo?.liveStyle;
if (detailData.liveInfo?.liveState === 'end') {
if (detailData.liveInfo?.liveState === 'end' && liveWay == 0) {
this.playUrl = detailData.liveInfo.vlive[0].replayUri;
}
resolve();
})
.catch(() => {
.catch((error:Error) => {
Logger.debug(TAG + "error",error.message,error.name)
this.isHideLoading = true;
ToastUtils.shortToast('内容不存在');
router.back();
... ...
... ... @@ -79,9 +79,10 @@ export class LiveDetailPageLogic {
// 只有直播中的才会有垫片
if(this.liveState === 'running'){
if (this.contentDetailData.liveInfo.vlive.count > 0) {
this.showPad = this.contentDetailData.liveInfo.vlive[index].showPad
}
}
}
... ...
... ... @@ -99,7 +99,7 @@ export struct DetailVideoListPage {
aboutToAppear() {
// 在视频详情页
this.peopleShipHomeCreatorId = AppStorage.get<string>('peopleShipHomeCreatorId') || '';
// console.info(TAG, `cj2024 peopleShipHomeCreatorId = ${this.peopleShipHomeCreatorId}`)
console.info(TAG, `cj2024 peopleShipHomeCreatorId = ${this.peopleShipHomeCreatorId}`)
if (this.peopleShipHomeCreatorId) {
// 从人民号号主传过来的
this.getPeopleShipHomeDetail(this.peopleShipHomeCreatorId);
... ... @@ -120,13 +120,16 @@ export struct DetailVideoListPage {
if (action) {
this.contentId = action.params?.contentID || '';
if (action.params && action.params.extra) {
this.relId = action.params.extra.relId || '';
this.relType = action.params.extra.relType || '';
this.relId = action.params.extra.relId != "undefined" && action.params.extra.relId != '' ? action.params.extra.relId : '';
this.relType = action.params.extra.relType != "undefined" && action.params.extra.relType != '' ? action.params.extra.relType : '';
}
// console.info(TAG, `cj2024 getPeopleShipHomeDetail contentId = ${this.contentId}`)
// console.info(TAG, `cj2024 getPeopleShipHomeDetail relId = ${this.relId}`)
// console.info(TAG, `cj2024 getPeopleShipHomeDetail relType = ${this.relType}`)
await this.getRmhContentDetail(this.contentId, this.relId, this.relType)
this.getRmhPublishNexts(peopleShipHomeCreatorId, this.contentId, 1, 1, 10, systemDateTime.getTime(false));
}
// console.log(TAG, 'aboutToAppear', JSON.stringify(action.params))
} else {
// 无网络
this.netStatus = 1
... ...
... ... @@ -71,6 +71,8 @@ export class GetuiPush {
Logger.error(TAG, "个推SDK初始化失败,error = " + error)
}
})
this.setBadgeNumber(0)
}
async requestEnableNotifications(context: common.UIAbilityContext) : Promise<boolean> {
... ... @@ -120,6 +122,9 @@ export class GetuiPush {
this.setAlias(false, this.currentUserId)
}
})
EmitterUtils.receiveEvent(EmitterEventId.APP_ENTER_FOREGROUD, () => {
this.setBadgeNumber(0)
})
PushManager.setPushCallback({
// cid
... ... @@ -387,6 +392,7 @@ export class GetuiPush {
},
notificationSlotType: notificationManager.SlotType.CONTENT_INFORMATION,
wantAgent:want,
badgeNumber:1
};
notificationManager.publish(notificationRequest).then(() => {
Logger.debug(TAG, "本地发送系统通知完成")
... ...
import { Logger } from 'wdKit/src/main/ets/utils/Logger'
import { LoginModel } from './LoginModel'
import { LoginBean } from './LoginBean'
import { EmitterEventId, EmitterUtils, SPHelper, StringUtils, UserDataLocal } from 'wdKit'
import { AppUtils, EmitterEventId, EmitterUtils, SPHelper, StringUtils, UserDataLocal } from 'wdKit'
import { CheckVerifyBean } from './CheckVerifyBean'
import cryptoFramework from '@ohos.security.cryptoFramework'
import buffer from '@ohos.buffer'
... ... @@ -105,7 +105,7 @@ export class LoginViewModel {
SPHelper.default.saveSync(SpConstants.USER_NAME, data.userName ?? "")
EmitterUtils.sendEmptyEvent(EmitterEventId.LOGIN_SUCCESS)
LoginModule.reportDeviceInfo()
LoginModule.reportDeviceInfo(AppUtils.gotApplicationContextFunc!())
}
async appLoginByPassword(phone: string, loginType: number, password: string, oldPassword: string) {
... ...
... ... @@ -5,6 +5,8 @@ import { NewspaperWidgetCommon } from "../common/NewspaperWidgetCommon"
const TAG = "DailyNewspaperWidgetCard"
let storageWidgetImageUpdate = new LocalStorage();
const DAILY_NEWSPAPER_DEEP_LINK = "rmrbapp://rmrb.app/openwith?type=topic&subType=moring_evening_news&pageId=&relId=&skipType=1"
@Entry(storageWidgetImageUpdate)
@Component
struct DailyNewspaperWidgetCard {
... ... @@ -12,8 +14,6 @@ struct DailyNewspaperWidgetCard {
@LocalStorageProp('paperInfo') paperInfo: FormNewspaperPaperInfo = {} as FormNewspaperPaperInfo;
@LocalStorageProp('paperContents') paperContents: FormNewspaperPaperContent[] = [];
private DAILY_NEWSPAPER_DEEP_LINK = "rmrbapp://rmrb.app/openwith?type=topic&subType=moring_evening_news&pageId=&relId=&skipType=1"
build() {
Column() {
... ... @@ -23,7 +23,7 @@ struct DailyNewspaperWidgetCard {
.width("100%").height(36)
// .margin({top: 3})
.onClick(() => {
jumpWithDeepLink(this.DAILY_NEWSPAPER_DEEP_LINK, this)
jumpWithDeepLink(DAILY_NEWSPAPER_DEEP_LINK, this)
})
Row() {
... ... @@ -51,7 +51,8 @@ struct DailyNewspaperWidgetCard {
.autoResize(true)
.borderRadius(6)
.onClick(() => {
jumpWithDeepLink(this.paperInfo.leftDeepLink || "", this)
// jumpWithDeepLink(this.paperInfo.leftDeepLink || "", this)
jumpWithDeepLink(DAILY_NEWSPAPER_DEEP_LINK, this)
})
Text(this.paperInfo.leftTitle)
... ... @@ -123,7 +124,8 @@ struct ContentCellView {
}
.justifyContent(FlexAlign.Start)
.onClick(() => {
jumpWithDeepLink(this.content.deepLink || "", this)
// jumpWithDeepLink(this.content.deepLink || "", this)
jumpWithDeepLink(DAILY_NEWSPAPER_DEEP_LINK, this)
})
}
}
... ...
import { AbilityConstant, common, Want } from '@kit.AbilityKit'
import { DeviceUtil,
import {
AppUtils,
DeviceUtil,
EmitterEventId,
EmitterUtils,
KVStoreHelper,
... ... @@ -58,6 +60,11 @@ export class StartupManager {
// 路由注册
registerRouter();
// 设置全局context
AppUtils.gotApplicationContextFunc = () => {
return this.context!
}
// 网络模块
NetworkManager.getInstance().init()
... ...