陈剑华

Merge remote-tracking branch 'origin/main'

# Conflicts:
#	sight_harmony/features/wdComponent/src/main/ets/components/cardCommon/CardMediaInfo.ets
Showing 17 changed files with 243 additions and 60 deletions
import { url } from '@kit.ArkTS'
import App from '@system.app'
import { Action, Params } from 'wdBean/Index'
import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO'
import { Logger } from 'wdKit/Index'
import { WDRouterRule } from '../router/WDRouterRule'
import { ProcessUtils } from './ProcessUtils'
const TAG = "AppInnerLink"
... ... @@ -8,7 +12,7 @@ export class AppInnerLink {
static readonly INNER_LINK_PROTCOL = "rmrbapp:"
static readonly INNER_LINK_HOSTNAME = "rmrb.app"
static readonly INNER_LINK_PATHNAME = "openwith"
static readonly INNER_LINK_PATHNAME = "/openwith"
// 内链跳转
// 内链地址例如:rmrbapp://rmrb.app/openwith?type=article&subType=h5_template_article&contentId=30000762651&relId=500000038702&skipType=1&relType=1
... ... @@ -48,19 +52,110 @@ export class AppInnerLink {
}
private static jumpParams(params: InnerLinkParam) {
if (!AppInnerLink.validTypes(params.type)) {
return
}
const contentType = AppInnerLink.contentTypeWithType(params.type)
if (params.type == "article") {
let taskAction: Action = {
type: 'JUMP_INNER_NEW_PAGE',
params: {
contentID: params.contentId,
pageID: 'IMAGE_TEXT_DETAIL',
extra: {
relType: params.relType,
relId: params.relId,
sourcePage: '5', // ???
} as ExtraDTO
} as Params,
};
WDRouterRule.jumpWithAction(taskAction)
return
}
if (params.type == "video"
|| params.type == "dynamic"
|| params.type == "live"
|| params.type == "audio"
|| params.type == "picture") {
let taskAction: Action = {
type: 'JUMP_DETAIL_PAGE',
params: {
detailPageType: contentType,
contentID: params.contentId,
extra: {
relType: params.relType,
relId: params.relId,
} as ExtraDTO
} as Params,
};
WDRouterRule.jumpWithAction(taskAction)
return
}
if (params.type == "owner_page" && params.creatorId) {
ProcessUtils.gotoPeopleShipHomePage(params.creatorId)
return
}
if (params.type == "topic") {
}
if (params.type == "channel") {
}
}
private static contentTypeWithType(type?: string) : number | undefined {
switch (type) {
case "video": return 1
case "dynamic": return 14
case "live": return 2
case "audio": return 13
case "picture": return 9
case "article": return 8
case "ask": return 16
}
return
}
private static validTypes(type?: string) : boolean {
if (!type) {
return false
}
let typeArray = ["article", "dynamic", "live", "video", "topic", "audio", "ask", "picture", "owner_page", "topic", "channel"]
return typeArray.indexOf(type) != -1
}
private static jumpNoParams(params: InnerLinkParam) {
if (!params.type || params.type != "app" || !params.subType) {
return
}
if (params.subType == "login") {
ProcessUtils.gotoLoginPage();
} else if (params.subType == "search") {
} else if (params.subType == "home") {
} else if (params.subType == "mine") {
}
private static jumpAppH5(params: InnerLinkParam) {
}
private static jumpAppH5(params: InnerLinkParam) {
if (params.type && params.type == "h5" && params.url) {
ProcessUtils.gotoDefaultWebPage(params.url);
}
}
private static jumpOutH5(params: InnerLinkParam) {
if (params.type && params.type == "h5" && params.url) {
ProcessUtils.jumpExternalWebPage(params.url);
}
}
private static jumpThirdApp(params: InnerLinkParam) {
//TODO:
}
static parseParams(link: string) : InnerLinkParam | undefined {
... ...
... ... @@ -7,17 +7,20 @@ import { TopNavDTO } from './TopNavDTO';
export class NavigationBodyDTO {
backgroundColor: string = ''; // 迭代二新增-底部导航背景色(信息流频道)
bottomNavList: BottomNavDTO[] = [];
// greyBottomNav: GreyBottomNav; // 灰度皮肤
immersiveBackgroundColor: string = ''; // 迭代二新增-底部导航背景色(沉浸式频道)
nightBackgroundColor: string = ''; // 迭代三新增-底部导航背景色(夜间模式)
greyBottomNav?: GreyBottomNavBean; // 灰度皮肤
md5: string = ''
}
export class GreyBottomNavBean {
bottomNavList: BottomNavDTO[] = [];
greyUserList: string[] = [];
}
export class NavigationDetailDTO {
id: string = ''; // 迭代二新增-底部导航背景色(信息流频道)
bottomNavCompList: BottomNavCompDTO[] = [];
topNavChannelList: TopNavDTO[] = [];
md5: string = ''
}
... ...
... ... @@ -258,7 +258,7 @@ export struct MorningEveningPaperComponent {
})
}
}
.height(`calc(100% - ${this.bottomSafeHeight + this.topSafeHeight + 'vp'})`)
.height(`calc(100% - ${this.bottomSafeHeight + this.topSafeHeight + 'vp'})`).scrollBar(BarState.Off)
PaperTitleComponent()
}
... ...
import { ContentDTO, joinPeopleNum } from 'wdBean/Index'
import { DateTimeUtils } from 'wdKit/Index'
import { LottieView } from '../../components/lottie/LottieView';
import { LiveModel } from '../../viewmodel/LiveModel'
/**
... ... @@ -78,8 +79,19 @@ export struct CardMediaInfo {
Text('预约')
.mediaText()
} else if (this.contentDTO?.liveInfo?.liveState === 'running') {
Image($r('app.media.card_live'))
.mediaLogo()
LottieView({
name: 'live_status_wait',
path: "lottie/live_detail_living.json",
lottieWidth: 14,
lottieHeight: 14,
autoplay: true,
loop: true,
})
.margin({
right: '2vp'
})
// Image($r('app.media.card_live'))
// .mediaLogo()
Text('直播中')
.mediaText()
} else if (this.contentDTO?.liveInfo?.liveState === 'end' && this.contentDTO?.liveInfo?.replayUri) {
... ...
... ... @@ -124,7 +124,7 @@ export struct CardAdvGanMiComponent {
})
// 更多按钮
commonButton(this.advExtraData)
this.commonButton()
}
.width(CommonConstants.FULL_WIDTH)
... ... @@ -134,19 +134,19 @@ export struct CardAdvGanMiComponent {
})
}
}
/*
/*
标题样式
*/
@Builder
function commonButton(advExtraData: AdvExtraData) {
@Builder
commonButton() {
Row() {
Row() {
Blank()
Text(advExtraData.itemMore.title == null ? $r('app.string.look_more') : advExtraData.itemMore.title)
Text(this.advExtraData.itemMore == undefined ? $r('app.string.look_more') :
this.advExtraData.itemMore.title == undefined ? $r('app.string.look_more') : this.advExtraData.itemMore.title)
.fontColor('#222222')
.fontSize('14fp')
Image($r('app.media.icon_comp_more_right_red')).width(16).height(16)
... ... @@ -158,11 +158,14 @@ function commonButton(advExtraData: AdvExtraData) {
.borderRadius(3)
.padding({ top: 10, bottom: 10, })
.onClick(() => {
if (this.advExtraData.itemMore != undefined) {
let matInfo: CompAdvMatInfoBean = {
linkUrl: advExtraData.itemMore.linkUrl,
linkType: advExtraData.itemMore.linkType
linkUrl: this.advExtraData.itemMore.linkUrl,
linkType: this.advExtraData.itemMore.linkType
} as CompAdvMatInfoBean;
ProcessUtils.openAdvDetail(matInfo)
}
})
}.width('100%').padding({
left: $r('app.float.card_comp_pagePadding_lf'),
... ... @@ -170,4 +173,6 @@ function commonButton(advExtraData: AdvExtraData) {
})
}
}
... ...
... ... @@ -49,6 +49,10 @@ export struct CardAdvVideoExComponent {
.borderRadius(4)
.borderWidth(0.5)
.borderColor($r('app.color.color_0D000000'))
.onClick(() => {
ProcessUtils.openAdvDetail(this.compDTO.matInfo)
})
CardAdvTop({ pageModel: this.pageModel, compDTO: this.compDTO })
}
... ... @@ -76,7 +80,7 @@ export struct CardAdvVideoExComponent {
}.width('100%').listDirection(Axis.Vertical).margin({ top: 10, bottom: 10 })
// 更多按钮
commonButton(this.advExtraData)
this.commonButton()
}
.width(CommonConstants.FULL_WIDTH)
... ... @@ -88,14 +92,12 @@ export struct CardAdvVideoExComponent {
})
}
}
/*
/*
标题样式
*/
@Builder
function commonButton(advExtraData: AdvExtraData) {
@Builder
commonButton() {
Row() {
Blank()
... ... @@ -110,9 +112,11 @@ function commonButton(advExtraData: AdvExtraData) {
.padding({ top: 10, bottom: 10, })
.onClick(() => {
let matInfo: CompAdvMatInfoBean = {
linkUrl: advExtraData.itemMore.linkUrl,
linkType: advExtraData.itemMore.linkType
linkUrl: this.advExtraData.itemMore.linkUrl,
linkType: this.advExtraData.itemMore.linkType
} as CompAdvMatInfoBean;
ProcessUtils.openAdvDetail(matInfo)
})
}
}
... ...
... ... @@ -422,12 +422,13 @@ struct footerExpandedView {
build() {
Row() {
if (this.item.expanded) {
if (this.item.childsHasMore) {
Row() {
Text().backgroundColor($r('app.color.color_EDEDED')).width(24).height(1)
Text('查看更多回复').fontColor($r('app.color.color_222222')).fontSize(14).margin({ left: 6 })
if (this.item.childsHasMore) {
Row() {
Text('查看更多回复').fontColor($r('app.color.color_222222')).fontSize(14)
Image($r('app.media.comment_unfold')).width(12).height(12)
}.margin({ left: 53 })
}.margin({ left: 6 })
.onClick(() => {
if (this.item.isLoading) {
return
... ... @@ -439,13 +440,14 @@ struct footerExpandedView {
Row() {
Text('收起').fontColor($r('app.color.color_222222')).fontSize(14)
Image($r('app.media.comment_pickUp')).width(12).height(12)
}.margin({ left: this.item.childsHasMore ? 32 : 213 })
}.margin({ left: 6 })
.onClick(() => {
this.item.pageNum = 1
this.item.expanded = false
this.item.childComments = []
this.item.childCommentsLazyDataSource.clear()
})
}.margin({ left: 53 })
} else {
Row() {
Text().backgroundColor($r('app.color.color_EDEDED')).width(24).height(1)
... ... @@ -568,6 +570,7 @@ struct commentHeaderView {
publishCommentModel: this.publishCommentModel
}).margin({ left: 59, right: 16 })
}.alignItems(HorizontalAlign.Start)
.padding({bottom: 8})
}
replyComment() {
... ...
... ... @@ -129,8 +129,10 @@ export struct CommentText {
// Stack({ alignContent: Alignment.BottomEnd }) {
Text(this.longMessage) {
Span(this.expandedStates ? this.longMessage : this.maxLineMesssage)
.lineHeight(this.lineHeight)
Span(this.collapseText)
.fontColor("#999999")
.lineHeight(this.lineHeight)
.onClick(() => {
if (this.collapseText == collapseString) {
this.collapseText = uncollapseString;
... ... @@ -171,6 +173,7 @@ export struct CommentText {
else {
Text(this.longMessage)
.width('100%')
.lineHeight(this.lineHeight)
.fontSize(this.fontSize)
.fontWeight(this.fontWeight)
.fontColor(this.fontColor)
... ...
... ... @@ -63,8 +63,8 @@ export struct MessageListUI {
item.unReadCount = value.activeCount
}
if (value.activeInfo != null) {
if (value.activeInfo.message) {
item.desc = value.activeInfo.message
if (value.activeInfo.title) {
item.desc = value.activeInfo.title.replace("null","")
}
if (value.activeInfo.time) {
item.time = this.getPublishTime(value.subscribeInfo.time,DateTimeUtils.getDateTimestamp(value.activeInfo.time) + "")
... ...
import { BottomNavi, CommonConstants } from 'wdConstant';
import { BottomNavDTO, NavigationBodyDTO, TopNavDTO } from 'wdBean';
import { EmitterEventId, EmitterUtils, Logger } from 'wdKit';
import { BottomNavDTO, NavigationBodyDTO, NavigationDetailDTO, TopNavDTO } from 'wdBean';
import { EmitterEventId, EmitterUtils, Logger, StringUtils } from 'wdKit';
import { TopNavigationComponent } from './TopNavigationComponent';
import { MinePageComponent } from './MinePageComponent';
import { CompUtils } from '../../utils/CompUtils';
import ChannelViewModel from '../../viewmodel/ChannelViewModel';
import HomeChannelUtils, { AssignChannelParam } from 'wdRouter';
import { VideoChannelPage } from './VideoChannelPage';
import { HttpUtils } from 'wdNetwork/Index';
const TAG = 'BottomNavigationComponent';
let storage = LocalStorage.getShared();
... ... @@ -225,7 +226,7 @@ export struct BottomNavigationComponent {
}
private getBottomDetail() {
// 1、获取顶导缓存数据
// // 1、获取顶导缓存数据
// this.bottomNavList.forEach((value) => {
// // 先用底导带回的list初始化
// this.topNavMap[value.id] = value.topNavChannelList
... ... @@ -249,11 +250,32 @@ export struct BottomNavigationComponent {
private setData(data: NavigationBodyDTO) {
Logger.debug(TAG, 'setData')
if (data && data.bottomNavList != null) {
Logger.info(TAG, `setData, bottomNav.length: ${data.bottomNavList.length}`);
if (data == null) {
return
}
let list: BottomNavDTO[] = []
let userId: string = HttpUtils.getUserId()
// 先匹配换肤
if (data.greyBottomNav != null && data.greyBottomNav.greyUserList != null &&
data.greyBottomNav.greyUserList.length > 0) {
// data.greyBottomNav.greyUserList.includes(userId)不生效,直接用循环匹配
for (let i = 0; i < data.greyBottomNav.greyUserList.length; i++) {
let id = data.greyBottomNav.greyUserList[i]
if (id == userId) {
list = data.greyBottomNav.bottomNavList
break
}
}
}
// 没有匹配到换肤,则直接用data.bottomNavList
if (list.length <= 0) {
list = data.bottomNavList
}
if (list.length > 0) {
Logger.info(TAG, `setData, bottomNav.length: ${list.length}`);
// 使用filter方法移除name为'服务'的项
data.bottomNavList = data.bottomNavList.filter(item => item.name !== '服务');
this.bottomNavList = data.bottomNavList
list = list.filter(item => item.name !== '服务');
this.bottomNavList = list
}
}
}
\ No newline at end of file
... ...
... ... @@ -412,7 +412,7 @@ export struct PaperSingleColumn999CardView {
} else if (hours < 24) {
result = `${hours}小时前`;
} else {
result = `${days}天前`;
result = '';
}
console.log(result);
... ... @@ -422,12 +422,13 @@ export struct PaperSingleColumn999CardView {
build() {
Column() {
Text(this.item?.newsTitle)
.fontColor('#222222')
.fontSize(16)
.fontWeight(FontWeight.Bold)
.alignSelf(ItemAlign.Start)
.maxLines(3)
.textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。
.margin({ left: 22, right: 22, top: 28 })
.margin({ left: 16, right: 16, top: 16 })
if (this.item?.coverUrl) {
Stack({ alignContent: Alignment.BottomEnd }) {
Image(this.item?.coverUrl)
... ... @@ -462,35 +463,36 @@ export struct PaperSingleColumn999CardView {
.width(CommonConstants.FULL_PARENT)
.justifyContent(FlexAlign.End)
}
}.margin({ left: 22, right: 22 })
}.margin({ left: 16, right: 16 })
}
if (this.item?.newsSummary) {
Text(this.item?.newsSummary)
.fontColor('#6666666')
.fontSize(14)
.padding({ top: 10 })
.alignSelf(ItemAlign.Start)
.maxLines(3)
.textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。
.margin({ left: 22, right: 22 })
.margin({ left: 16, right: 16 })
}
if (this.item) {
Row() {
Row() {
Text(this.item?.source)
.fontSize(12)
.fontColor(Color.Gray)
.margin({ left: 22 })
.fontColor('#B0B0B0')
.margin({ left: 16 })
Image($r('app.media.point'))
.width(16)
.height(16)
.margin({ top: 10, bottom: 10 })
Text(this.getPublishTime())
.fontSize(12)
.fontColor(Color.Gray)
if (this.interactData && this.interactData.commentNum && Number(this.interactData.collectNum) > 0) {
.fontColor('#B0B0B0')
if (this.item.objectType != '2' && this.interactData && this.interactData.commentNum && Number(this.interactData.collectNum) > 0) {
Text(this.interactData.commentNum + "评")
.fontSize(12)
.fontColor(Color.Gray)
.fontColor('#B0B0B0')
.margin({ left: 6 })
}
}
... ...
... ... @@ -12,7 +12,7 @@ export default struct NoMoreLayout {
Text($r('app.string.footer_text'))
.fontSize(RefreshConstants.NoMoreLayoutConstant_TITLE_FONT)
.textAlign(TextAlign.Center)
.fontColor('#CCCCCC')
.fontColor('#999999')
.margin({bottom:40})
}
.width(RefreshConstants.FULL_WIDTH)
... ...
... ... @@ -149,6 +149,9 @@ export class GetuiPush {
}
setAlias(bind: boolean, alias: string, sn: string = this.ALIAS_SN_USERID) {
if (typeof alias == "number") {
alias = `${alias}`
}
if (!this.initialed) { return }
if (bind) {
Logger.debug(TAG, "推送 绑定别名 " + alias)
... ...
... ... @@ -56,9 +56,15 @@ export class PushContentParser {
},*/
let gtData = want.parameters[PushContentParser.LAUNCH_PARAM_GETUI_DATA] as Record<string, string | number | object>
if (gtData[PushContentParser.LAUNCH_PARAM_GETUI_TASKID] != undefined) {
let json = JSON.parse(gtData["wantUri"] as string) as Record<string, string | number>
if (json && json[PushContentParser.PUSH_PARAM_PUSH_LINK] != null) {
const pushLink = json[PushContentParser.PUSH_PARAM_PUSH_LINK] as string
// let json = JSON.parse(gtData["wantUri"] as string) as Record<string, string | number>
// if (json && json[PushContentParser.PUSH_PARAM_PUSH_LINK] != null) {
// const pushLink = json[PushContentParser.PUSH_PARAM_PUSH_LINK] as string
// return {
// isPush: true, online: true, pushLink: pushLink, want: want
// }
// }
if (want.parameters[PushContentParser.PUSH_PARAM_PUSH_LINK]) {
let pushLink = want.parameters[PushContentParser.PUSH_PARAM_PUSH_LINK] as string
return {
isPush: true, online: true, pushLink: pushLink, want: want
}
... ...
... ... @@ -117,6 +117,12 @@ export default class EntryAbility extends UIAbility {
return;
}
console.info('floatWindowClass Succeeded in loading the content.');
let color: string = 'rgba(0,0,0,0)';
try {
(floatWindowClass as window.Window).setWindowBackgroundColor(color);
} catch (exception) {
console.error('Failed to set the background color. Cause: ' + JSON.stringify(exception));
};
});
floatWindowClass.on('windowEvent', (data) => {
... ...
... ... @@ -29,12 +29,15 @@ struct MultiPictureDetailPage {
.backgroundColor(Color.Black)
}
pageTransition(){
// 定义页面进入时的效果,从右边侧滑入
PageTransitionEnter({ type: RouteType.None, duration: 300 })
pageTransition() {
// 为目标页面时,进入:从右边侧滑入,退出:是右侧划出;跳转别的页面:左侧划出,返回:左侧划入。
PageTransitionEnter({ type: RouteType.Push, duration: 300 })
.slide(SlideEffect.Right)
// 定义页面退出时的效果,向右边侧滑出
PageTransitionExit({ type: RouteType.None, duration: 300 })
PageTransitionEnter({ type: RouteType.Pop, duration: 300 })
.slide(SlideEffect.Left)
PageTransitionExit({ type: RouteType.Push, duration: 300 })
.slide(SlideEffect.Left)
PageTransitionExit({ type: RouteType.Pop, duration: 300 })
.slide(SlideEffect.Right)
}
... ... @@ -62,6 +65,17 @@ struct MultiPictureDetailPage {
this.closeFullScreen()
}
onPageShow(): void {
console.log(TAG, 'onPageShow')
this.openFullScreen()
}
onPageHide(): void {
console.log(TAG, 'onPageHide')
this.closeFullScreen()
}
/**
* 开启沉浸式
* TODO:颜色待根据业务接口修改
... ...
... ... @@ -88,7 +88,6 @@ struct Index {
.height(20)
.fontColor('#222222')
.fontSize(14)
.margin({ top: 10, left: 10 })
.alignSelf(ItemAlign.Start)
.onStart(() => {
console.info('Marquee animation complete onStart')
... ... @@ -115,7 +114,7 @@ struct Index {
}
.width("100%")
.height(16)
.margin({ top: 4, left: 10 })
.margin({ top: 4})
Progress({ value: this.progressVal, total: 100, type: ProgressType.Capsule })
.color("#ED2800")
... ... @@ -194,7 +193,13 @@ struct Index {
)
.width('100%')
.height('100%')
.borderRadius(4)
.padding({
top: 10,
bottom: 10,
left: 10,
right: 0
})
.backgroundColor(Color.White)
.borderRadius(2)
}
}
\ No newline at end of file
... ...