liyubing

Merge remote-tracking branch 'origin/main'

1 import { url } from '@kit.ArkTS' 1 import { url } from '@kit.ArkTS'
2 import App from '@system.app' 2 import App from '@system.app'
  3 +import { Action, Params } from 'wdBean/Index'
  4 +import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO'
3 import { Logger } from 'wdKit/Index' 5 import { Logger } from 'wdKit/Index'
  6 +import { WDRouterRule } from '../router/WDRouterRule'
  7 +import { ProcessUtils } from './ProcessUtils'
4 8
5 const TAG = "AppInnerLink" 9 const TAG = "AppInnerLink"
6 10
@@ -8,7 +12,7 @@ export class AppInnerLink { @@ -8,7 +12,7 @@ export class AppInnerLink {
8 12
9 static readonly INNER_LINK_PROTCOL = "rmrbapp:" 13 static readonly INNER_LINK_PROTCOL = "rmrbapp:"
10 static readonly INNER_LINK_HOSTNAME = "rmrb.app" 14 static readonly INNER_LINK_HOSTNAME = "rmrb.app"
11 - static readonly INNER_LINK_PATHNAME = "openwith" 15 + static readonly INNER_LINK_PATHNAME = "/openwith"
12 16
13 // 内链跳转 17 // 内链跳转
14 // 内链地址例如:rmrbapp://rmrb.app/openwith?type=article&subType=h5_template_article&contentId=30000762651&relId=500000038702&skipType=1&relType=1 18 // 内链地址例如: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 { @@ -48,19 +52,110 @@ export class AppInnerLink {
48 } 52 }
49 53
50 private static jumpParams(params: InnerLinkParam) { 54 private static jumpParams(params: InnerLinkParam) {
  55 + if (!AppInnerLink.validTypes(params.type)) {
  56 + return
  57 + }
  58 +
  59 + const contentType = AppInnerLink.contentTypeWithType(params.type)
  60 +
  61 + if (params.type == "article") {
  62 + let taskAction: Action = {
  63 + type: 'JUMP_INNER_NEW_PAGE',
  64 + params: {
  65 + contentID: params.contentId,
  66 + pageID: 'IMAGE_TEXT_DETAIL',
  67 + extra: {
  68 + relType: params.relType,
  69 + relId: params.relId,
  70 + sourcePage: '5', // ???
  71 + } as ExtraDTO
  72 + } as Params,
  73 + };
  74 + WDRouterRule.jumpWithAction(taskAction)
  75 + return
  76 + }
  77 +
  78 + if (params.type == "video"
  79 + || params.type == "dynamic"
  80 + || params.type == "live"
  81 + || params.type == "audio"
  82 + || params.type == "picture") {
  83 + let taskAction: Action = {
  84 + type: 'JUMP_DETAIL_PAGE',
  85 + params: {
  86 + detailPageType: contentType,
  87 + contentID: params.contentId,
  88 + extra: {
  89 + relType: params.relType,
  90 + relId: params.relId,
  91 + } as ExtraDTO
  92 + } as Params,
  93 + };
  94 + WDRouterRule.jumpWithAction(taskAction)
  95 + return
  96 + }
  97 +
  98 + if (params.type == "owner_page" && params.creatorId) {
  99 + ProcessUtils.gotoPeopleShipHomePage(params.creatorId)
  100 + return
  101 + }
  102 +
  103 + if (params.type == "topic") {
  104 +
  105 + }
  106 +
  107 + if (params.type == "channel") {
  108 +
  109 + }
51 110
52 } 111 }
  112 + private static contentTypeWithType(type?: string) : number | undefined {
  113 + switch (type) {
  114 + case "video": return 1
  115 + case "dynamic": return 14
  116 + case "live": return 2
  117 + case "audio": return 13
  118 + case "picture": return 9
  119 + case "article": return 8
  120 + case "ask": return 16
  121 + }
  122 + return
  123 + }
  124 + private static validTypes(type?: string) : boolean {
  125 + if (!type) {
  126 + return false
  127 + }
  128 + let typeArray = ["article", "dynamic", "live", "video", "topic", "audio", "ask", "picture", "owner_page", "topic", "channel"]
  129 + return typeArray.indexOf(type) != -1
  130 + }
  131 +
53 private static jumpNoParams(params: InnerLinkParam) { 132 private static jumpNoParams(params: InnerLinkParam) {
  133 + if (!params.type || params.type != "app" || !params.subType) {
  134 + return
  135 + }
  136 + if (params.subType == "login") {
  137 + ProcessUtils.gotoLoginPage();
  138 + } else if (params.subType == "search") {
  139 +
  140 + } else if (params.subType == "home") {
  141 +
  142 + } else if (params.subType == "mine") {
54 143
55 } 144 }
56 - private static jumpAppH5(params: InnerLinkParam) { 145 + }
57 146
  147 + private static jumpAppH5(params: InnerLinkParam) {
  148 + if (params.type && params.type == "h5" && params.url) {
  149 + ProcessUtils.gotoDefaultWebPage(params.url);
  150 + }
58 } 151 }
59 private static jumpOutH5(params: InnerLinkParam) { 152 private static jumpOutH5(params: InnerLinkParam) {
60 - 153 + if (params.type && params.type == "h5" && params.url) {
  154 + ProcessUtils.jumpExternalWebPage(params.url);
  155 + }
61 } 156 }
62 private static jumpThirdApp(params: InnerLinkParam) { 157 private static jumpThirdApp(params: InnerLinkParam) {
63 - 158 + //TODO:
64 } 159 }
65 160
66 static parseParams(link: string) : InnerLinkParam | undefined { 161 static parseParams(link: string) : InnerLinkParam | undefined {
@@ -114,7 +114,7 @@ export { ShareInfo } from './src/main/ets/bean/morningevening/ShareInfo'; @@ -114,7 +114,7 @@ export { ShareInfo } from './src/main/ets/bean/morningevening/ShareInfo';
114 114
115 export { slideShows } from './src/main/ets/bean/morningevening/slideShows'; 115 export { slideShows } from './src/main/ets/bean/morningevening/slideShows';
116 116
117 -export { LiveDetailsBean } from './src/main/ets/bean/live/LiveDetailsBean'; 117 +export { LiveDetailsBean, joinPeopleNum } from './src/main/ets/bean/live/LiveDetailsBean';
118 118
119 export { ArticleListDTO } from './src/main/ets/bean/component/ArticleListDTO'; 119 export { ArticleListDTO } from './src/main/ets/bean/component/ArticleListDTO';
120 120
@@ -208,3 +208,11 @@ export interface Vlive { @@ -208,3 +208,11 @@ export interface Vlive {
208 export interface ReLInfo { 208 export interface ReLInfo {
209 relId: string 209 relId: string
210 } 210 }
  211 +
  212 +export interface joinPeopleNum {
  213 + barrageNum: number,
  214 + likeNum: number,
  215 + liveId: number,
  216 + pv: number,
  217 + subscribeNum: number
  218 +}
@@ -7,17 +7,20 @@ import { TopNavDTO } from './TopNavDTO'; @@ -7,17 +7,20 @@ import { TopNavDTO } from './TopNavDTO';
7 export class NavigationBodyDTO { 7 export class NavigationBodyDTO {
8 backgroundColor: string = ''; // 迭代二新增-底部导航背景色(信息流频道) 8 backgroundColor: string = ''; // 迭代二新增-底部导航背景色(信息流频道)
9 bottomNavList: BottomNavDTO[] = []; 9 bottomNavList: BottomNavDTO[] = [];
10 - // greyBottomNav: GreyBottomNav; // 灰度皮肤  
11 immersiveBackgroundColor: string = ''; // 迭代二新增-底部导航背景色(沉浸式频道) 10 immersiveBackgroundColor: string = ''; // 迭代二新增-底部导航背景色(沉浸式频道)
12 nightBackgroundColor: string = ''; // 迭代三新增-底部导航背景色(夜间模式) 11 nightBackgroundColor: string = ''; // 迭代三新增-底部导航背景色(夜间模式)
13 - 12 + greyBottomNav?: GreyBottomNavBean; // 灰度皮肤
14 md5: string = '' 13 md5: string = ''
15 } 14 }
16 15
  16 +export class GreyBottomNavBean {
  17 + bottomNavList: BottomNavDTO[] = [];
  18 + greyUserList: string[] = [];
  19 +}
  20 +
17 export class NavigationDetailDTO { 21 export class NavigationDetailDTO {
18 id: string = ''; // 迭代二新增-底部导航背景色(信息流频道) 22 id: string = ''; // 迭代二新增-底部导航背景色(信息流频道)
19 bottomNavCompList: BottomNavCompDTO[] = []; 23 bottomNavCompList: BottomNavCompDTO[] = [];
20 topNavChannelList: TopNavDTO[] = []; 24 topNavChannelList: TopNavDTO[] = [];
21 -  
22 md5: string = '' 25 md5: string = ''
23 } 26 }
@@ -258,7 +258,7 @@ export struct MorningEveningPaperComponent { @@ -258,7 +258,7 @@ export struct MorningEveningPaperComponent {
258 }) 258 })
259 } 259 }
260 } 260 }
261 - .height(`calc(100% - ${this.bottomSafeHeight + this.topSafeHeight + 'vp'})`) 261 + .height(`calc(100% - ${this.bottomSafeHeight + this.topSafeHeight + 'vp'})`).scrollBar(BarState.Off)
262 262
263 PaperTitleComponent() 263 PaperTitleComponent()
264 } 264 }
1 -import { ContentDTO } from 'wdBean/Index' 1 +import { ContentDTO, joinPeopleNum } from 'wdBean/Index'
2 import { DateTimeUtils } from 'wdKit/Index' 2 import { DateTimeUtils } from 'wdKit/Index'
  3 +import { LottieView } from '../../components/lottie/LottieView';
  4 +import { LiveModel } from '../../viewmodel/LiveModel'
  5 +import font from '@ohos.font';
3 6
4 /** 7 /**
5 * 这里是样式卡中,右下角显示的音视频信息 8 * 这里是样式卡中,右下角显示的音视频信息
@@ -10,10 +13,55 @@ import { DateTimeUtils } from 'wdKit/Index' @@ -10,10 +13,55 @@ import { DateTimeUtils } from 'wdKit/Index'
10 @Component 13 @Component
11 export struct CardMediaInfo { 14 export struct CardMediaInfo {
12 @State contentDTO: ContentDTO = new ContentDTO() // 如果有duraion,代表点播,显示时长;如果不传或者传0,显示直播中 15 @State contentDTO: ContentDTO = new ContentDTO() // 如果有duraion,代表点播,显示时长;如果不传或者传0,显示直播中
13 - 16 + @State joinPeopleNum: number = 0;
14 // objectType 0:不跳转 1:点播,2:直播,3:活动,4:广告,5:专题,6:链接,7:榜单,8:图文,9:组图,10:H5新闻,11:频道,12:组件,13:音频, 17 // objectType 0:不跳转 1:点播,2:直播,3:活动,4:广告,5:专题,6:链接,7:榜单,8:图文,9:组图,10:H5新闻,11:频道,12:组件,13:音频,
15 // 14动态图文,15动态视频16问政;100人民号,101标签 18 // 14动态图文,15动态视频16问政;100人民号,101标签
16 19
  20 + aboutToAppear(): void {
  21 + this.getJoinPeopleNum();
  22 +
  23 + font.registerFont({
  24 + familyName: 'BebasNeue',
  25 + familySrc: $rawfile('font/BebasNeue.ttf')
  26 + })
  27 + }
  28 +
  29 + /**
  30 + * 全域数字显示规则
  31 + * 1、当数量为千位以內时,显示数字,不保留小数点,比如 4585
  32 + * 2、当数量为万位~1亿时,显示xx 万,保留小数点后一位,比如1517.9w、2.9w
  33 + * 3、当数量为1亿~千亿时,显示XX 亿,保留小数点后一位,比如1517.9亿、2.9亿
  34 + * 4、不进行四舍五入
  35 + * 5、0 和空 不显示
  36 + */
  37 + handlerNum(number: string) {
  38 + const num = number??'0';
  39 + if (Number.parseInt(num) <= 9999) {
  40 + return Number.parseInt(num).toString()
  41 + } else if (Number.parseInt(num) > 9999 && Number.parseInt(num) <= 99999999) {
  42 + const num1: string = num.slice(0, -4); // 万
  43 + const num2: string = num.slice(-4, -3); // 千
  44 + return num2 === '0' ? num1 +'万' : num1 + '.' + num2 + '万'
  45 + } else if (Number.parseInt(num) > 99999999) {
  46 + const num1: string = num.slice(0, -8); // 亿
  47 + const num2: string = num.slice(-8, -7);
  48 + return num2 === '0' ? num1 +'亿' : num1 + '.' + num2 + '亿'
  49 + }
  50 + return num
  51 + }
  52 +
  53 + //
  54 + /**
  55 + * 获取直播节目参与人数
  56 + */
  57 + async getJoinPeopleNum() {
  58 + if (this.contentDTO.objectType !== '2') return;
  59 + console.log('getJoinPeopleNum-ContentDTO', JSON.stringify(this.contentDTO.objectId))
  60 + let liveIdList: string = this.contentDTO.objectId
  61 + let data: joinPeopleNum[] = await LiveModel.getJoinPeopleNum(liveIdList)
  62 + this.joinPeopleNum = data[0].pv;
  63 + }
  64 +
17 build() { 65 build() {
18 Row() { 66 Row() {
19 if (this.contentDTO?.objectType === '1' || this.contentDTO?.objectType === '15') { 67 if (this.contentDTO?.objectType === '1' || this.contentDTO?.objectType === '15') {
@@ -24,6 +72,7 @@ export struct CardMediaInfo { @@ -24,6 +72,7 @@ export struct CardMediaInfo {
24 if (this.contentDTO.videoInfo != null) { 72 if (this.contentDTO.videoInfo != null) {
25 Text(DateTimeUtils.getFormattedDuration(this.contentDTO.videoInfo.videoDuration * 1000)) 73 Text(DateTimeUtils.getFormattedDuration(this.contentDTO.videoInfo.videoDuration * 1000))
26 .mediaText() 74 .mediaText()
  75 + .fontFamily('BebasNeue')
27 } 76 }
28 } 77 }
29 } else if (this.contentDTO.objectType === '2') { 78 } else if (this.contentDTO.objectType === '2') {
@@ -36,8 +85,19 @@ export struct CardMediaInfo { @@ -36,8 +85,19 @@ export struct CardMediaInfo {
36 Text('预约') 85 Text('预约')
37 .mediaText() 86 .mediaText()
38 } else if (this.contentDTO?.liveInfo?.liveState === 'running') { 87 } else if (this.contentDTO?.liveInfo?.liveState === 'running') {
39 - Image($r('app.media.card_live'))  
40 - .mediaLogo() 88 + LottieView({
  89 + name: 'live_status_wait',
  90 + path: "lottie/live_detail_living.json",
  91 + lottieWidth: 14,
  92 + lottieHeight: 14,
  93 + autoplay: true,
  94 + loop: true,
  95 + })
  96 + .margin({
  97 + right: '2vp'
  98 + })
  99 + // Image($r('app.media.card_live'))
  100 + // .mediaLogo()
41 Text('直播中') 101 Text('直播中')
42 .mediaText() 102 .mediaText()
43 } else if (this.contentDTO?.liveInfo?.liveState === 'end' && this.contentDTO?.liveInfo?.replayUri) { 103 } else if (this.contentDTO?.liveInfo?.liveState === 'end' && this.contentDTO?.liveInfo?.replayUri) {
@@ -50,6 +110,12 @@ export struct CardMediaInfo { @@ -50,6 +110,12 @@ export struct CardMediaInfo {
50 Text('已结束') 110 Text('已结束')
51 .mediaText() 111 .mediaText()
52 } 112 }
  113 + if (!!this.joinPeopleNum) {
  114 + Text(' | ')
  115 + .mediaText()
  116 + Text(`${this.handlerNum(this.joinPeopleNum.toString())}人参加`)
  117 + .mediaText()
  118 + }
53 // } else if (this.contentDTO?.liveInfo?.liveState === 'end' && this.contentDTO?.liveInfo 119 // } else if (this.contentDTO?.liveInfo?.liveState === 'end' && this.contentDTO?.liveInfo
54 // ?.replayUri) { 120 // ?.replayUri) {
55 // // Image($r('app.media.card_live')) 121 // // Image($r('app.media.card_live'))
@@ -73,6 +139,7 @@ export struct CardMediaInfo { @@ -73,6 +139,7 @@ export struct CardMediaInfo {
73 .mediaLogo() 139 .mediaLogo()
74 Text(DateTimeUtils.getFormattedDuration(this.contentDTO.voiceInfo.voiceDuration * 1000)) 140 Text(DateTimeUtils.getFormattedDuration(this.contentDTO.voiceInfo.voiceDuration * 1000))
75 .mediaText() 141 .mediaText()
  142 + .fontFamily('BebasNeue')
76 } 143 }
77 } else if (this.contentDTO.objectType === '4') {//广告标签 144 } else if (this.contentDTO.objectType === '4') {//广告标签
78 Text($r('app.string.comp_advertisement')) 145 Text($r('app.string.comp_advertisement'))
@@ -422,12 +422,13 @@ struct footerExpandedView { @@ -422,12 +422,13 @@ struct footerExpandedView {
422 build() { 422 build() {
423 Row() { 423 Row() {
424 if (this.item.expanded) { 424 if (this.item.expanded) {
425 - if (this.item.childsHasMore) {  
426 Row() { 425 Row() {
427 Text().backgroundColor($r('app.color.color_EDEDED')).width(24).height(1) 426 Text().backgroundColor($r('app.color.color_EDEDED')).width(24).height(1)
428 - Text('查看更多回复').fontColor($r('app.color.color_222222')).fontSize(14).margin({ left: 6 }) 427 + if (this.item.childsHasMore) {
  428 + Row() {
  429 + Text('查看更多回复').fontColor($r('app.color.color_222222')).fontSize(14)
429 Image($r('app.media.comment_unfold')).width(12).height(12) 430 Image($r('app.media.comment_unfold')).width(12).height(12)
430 - }.margin({ left: 53 }) 431 + }.margin({ left: 6 })
431 .onClick(() => { 432 .onClick(() => {
432 if (this.item.isLoading) { 433 if (this.item.isLoading) {
433 return 434 return
@@ -439,13 +440,14 @@ struct footerExpandedView { @@ -439,13 +440,14 @@ struct footerExpandedView {
439 Row() { 440 Row() {
440 Text('收起').fontColor($r('app.color.color_222222')).fontSize(14) 441 Text('收起').fontColor($r('app.color.color_222222')).fontSize(14)
441 Image($r('app.media.comment_pickUp')).width(12).height(12) 442 Image($r('app.media.comment_pickUp')).width(12).height(12)
442 - }.margin({ left: this.item.childsHasMore ? 32 : 213 }) 443 + }.margin({ left: 6 })
443 .onClick(() => { 444 .onClick(() => {
444 this.item.pageNum = 1 445 this.item.pageNum = 1
445 this.item.expanded = false 446 this.item.expanded = false
446 this.item.childComments = [] 447 this.item.childComments = []
447 this.item.childCommentsLazyDataSource.clear() 448 this.item.childCommentsLazyDataSource.clear()
448 }) 449 })
  450 + }.margin({ left: 53 })
449 } else { 451 } else {
450 Row() { 452 Row() {
451 Text().backgroundColor($r('app.color.color_EDEDED')).width(24).height(1) 453 Text().backgroundColor($r('app.color.color_EDEDED')).width(24).height(1)
@@ -568,6 +570,7 @@ struct commentHeaderView { @@ -568,6 +570,7 @@ struct commentHeaderView {
568 publishCommentModel: this.publishCommentModel 570 publishCommentModel: this.publishCommentModel
569 }).margin({ left: 59, right: 16 }) 571 }).margin({ left: 59, right: 16 })
570 }.alignItems(HorizontalAlign.Start) 572 }.alignItems(HorizontalAlign.Start)
  573 + .padding({bottom: 8})
571 } 574 }
572 575
573 replyComment() { 576 replyComment() {
@@ -129,8 +129,10 @@ export struct CommentText { @@ -129,8 +129,10 @@ export struct CommentText {
129 // Stack({ alignContent: Alignment.BottomEnd }) { 129 // Stack({ alignContent: Alignment.BottomEnd }) {
130 Text(this.longMessage) { 130 Text(this.longMessage) {
131 Span(this.expandedStates ? this.longMessage : this.maxLineMesssage) 131 Span(this.expandedStates ? this.longMessage : this.maxLineMesssage)
  132 + .lineHeight(this.lineHeight)
132 Span(this.collapseText) 133 Span(this.collapseText)
133 .fontColor("#999999") 134 .fontColor("#999999")
  135 + .lineHeight(this.lineHeight)
134 .onClick(() => { 136 .onClick(() => {
135 if (this.collapseText == collapseString) { 137 if (this.collapseText == collapseString) {
136 this.collapseText = uncollapseString; 138 this.collapseText = uncollapseString;
@@ -171,6 +173,7 @@ export struct CommentText { @@ -171,6 +173,7 @@ export struct CommentText {
171 else { 173 else {
172 Text(this.longMessage) 174 Text(this.longMessage)
173 .width('100%') 175 .width('100%')
  176 + .lineHeight(this.lineHeight)
174 .fontSize(this.fontSize) 177 .fontSize(this.fontSize)
175 .fontWeight(this.fontWeight) 178 .fontWeight(this.fontWeight)
176 .fontColor(this.fontColor) 179 .fontColor(this.fontColor)
1 import { BottomNavi, CommonConstants } from 'wdConstant'; 1 import { BottomNavi, CommonConstants } from 'wdConstant';
2 -import { BottomNavDTO, NavigationBodyDTO, TopNavDTO } from 'wdBean';  
3 -import { EmitterEventId, EmitterUtils, Logger } from 'wdKit'; 2 +import { BottomNavDTO, NavigationBodyDTO, NavigationDetailDTO, TopNavDTO } from 'wdBean';
  3 +import { EmitterEventId, EmitterUtils, Logger, StringUtils } from 'wdKit';
4 import { TopNavigationComponent } from './TopNavigationComponent'; 4 import { TopNavigationComponent } from './TopNavigationComponent';
5 import { MinePageComponent } from './MinePageComponent'; 5 import { MinePageComponent } from './MinePageComponent';
6 import { CompUtils } from '../../utils/CompUtils'; 6 import { CompUtils } from '../../utils/CompUtils';
7 import ChannelViewModel from '../../viewmodel/ChannelViewModel'; 7 import ChannelViewModel from '../../viewmodel/ChannelViewModel';
8 import HomeChannelUtils, { AssignChannelParam } from 'wdRouter'; 8 import HomeChannelUtils, { AssignChannelParam } from 'wdRouter';
9 import { VideoChannelPage } from './VideoChannelPage'; 9 import { VideoChannelPage } from './VideoChannelPage';
  10 +import { HttpUtils } from 'wdNetwork/Index';
10 11
11 const TAG = 'BottomNavigationComponent'; 12 const TAG = 'BottomNavigationComponent';
12 let storage = LocalStorage.getShared(); 13 let storage = LocalStorage.getShared();
@@ -225,7 +226,7 @@ export struct BottomNavigationComponent { @@ -225,7 +226,7 @@ export struct BottomNavigationComponent {
225 } 226 }
226 227
227 private getBottomDetail() { 228 private getBottomDetail() {
228 - // 1、获取顶导缓存数据 229 + // // 1、获取顶导缓存数据
229 // this.bottomNavList.forEach((value) => { 230 // this.bottomNavList.forEach((value) => {
230 // // 先用底导带回的list初始化 231 // // 先用底导带回的list初始化
231 // this.topNavMap[value.id] = value.topNavChannelList 232 // this.topNavMap[value.id] = value.topNavChannelList
@@ -249,11 +250,32 @@ export struct BottomNavigationComponent { @@ -249,11 +250,32 @@ export struct BottomNavigationComponent {
249 250
250 private setData(data: NavigationBodyDTO) { 251 private setData(data: NavigationBodyDTO) {
251 Logger.debug(TAG, 'setData') 252 Logger.debug(TAG, 'setData')
252 - if (data && data.bottomNavList != null) {  
253 - Logger.info(TAG, `setData, bottomNav.length: ${data.bottomNavList.length}`); 253 + if (data == null) {
  254 + return
  255 + }
  256 + let list: BottomNavDTO[] = []
  257 + let userId: string = HttpUtils.getUserId()
  258 + // 先匹配换肤
  259 + if (data.greyBottomNav != null && data.greyBottomNav.greyUserList != null &&
  260 + data.greyBottomNav.greyUserList.length > 0) {
  261 + // data.greyBottomNav.greyUserList.includes(userId)不生效,直接用循环匹配
  262 + for (let i = 0; i < data.greyBottomNav.greyUserList.length; i++) {
  263 + let id = data.greyBottomNav.greyUserList[i]
  264 + if (id == userId) {
  265 + list = data.greyBottomNav.bottomNavList
  266 + break
  267 + }
  268 + }
  269 + }
  270 + // 没有匹配到换肤,则直接用data.bottomNavList
  271 + if (list.length <= 0) {
  272 + list = data.bottomNavList
  273 + }
  274 + if (list.length > 0) {
  275 + Logger.info(TAG, `setData, bottomNav.length: ${list.length}`);
254 // 使用filter方法移除name为'服务'的项 276 // 使用filter方法移除name为'服务'的项
255 - data.bottomNavList = data.bottomNavList.filter(item => item.name !== '服务');  
256 - this.bottomNavList = data.bottomNavList 277 + list = list.filter(item => item.name !== '服务');
  278 + this.bottomNavList = list
257 } 279 }
258 } 280 }
259 } 281 }
@@ -412,7 +412,7 @@ export struct PaperSingleColumn999CardView { @@ -412,7 +412,7 @@ export struct PaperSingleColumn999CardView {
412 } else if (hours < 24) { 412 } else if (hours < 24) {
413 result = `${hours}小时前`; 413 result = `${hours}小时前`;
414 } else { 414 } else {
415 - result = `${days}天前`; 415 + result = '';
416 } 416 }
417 417
418 console.log(result); 418 console.log(result);
@@ -422,12 +422,13 @@ export struct PaperSingleColumn999CardView { @@ -422,12 +422,13 @@ export struct PaperSingleColumn999CardView {
422 build() { 422 build() {
423 Column() { 423 Column() {
424 Text(this.item?.newsTitle) 424 Text(this.item?.newsTitle)
  425 + .fontColor('#222222')
425 .fontSize(16) 426 .fontSize(16)
426 .fontWeight(FontWeight.Bold) 427 .fontWeight(FontWeight.Bold)
427 .alignSelf(ItemAlign.Start) 428 .alignSelf(ItemAlign.Start)
428 .maxLines(3) 429 .maxLines(3)
429 .textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。 430 .textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。
430 - .margin({ left: 22, right: 22, top: 28 }) 431 + .margin({ left: 16, right: 16, top: 16 })
431 if (this.item?.coverUrl) { 432 if (this.item?.coverUrl) {
432 Stack({ alignContent: Alignment.BottomEnd }) { 433 Stack({ alignContent: Alignment.BottomEnd }) {
433 Image(this.item?.coverUrl) 434 Image(this.item?.coverUrl)
@@ -462,35 +463,36 @@ export struct PaperSingleColumn999CardView { @@ -462,35 +463,36 @@ export struct PaperSingleColumn999CardView {
462 .width(CommonConstants.FULL_PARENT) 463 .width(CommonConstants.FULL_PARENT)
463 .justifyContent(FlexAlign.End) 464 .justifyContent(FlexAlign.End)
464 } 465 }
465 - }.margin({ left: 22, right: 22 }) 466 + }.margin({ left: 16, right: 16 })
466 } 467 }
467 if (this.item?.newsSummary) { 468 if (this.item?.newsSummary) {
468 Text(this.item?.newsSummary) 469 Text(this.item?.newsSummary)
  470 + .fontColor('#6666666')
469 .fontSize(14) 471 .fontSize(14)
470 .padding({ top: 10 }) 472 .padding({ top: 10 })
471 .alignSelf(ItemAlign.Start) 473 .alignSelf(ItemAlign.Start)
472 .maxLines(3) 474 .maxLines(3)
473 .textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。 475 .textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。
474 - .margin({ left: 22, right: 22 }) 476 + .margin({ left: 16, right: 16 })
475 } 477 }
476 if (this.item) { 478 if (this.item) {
477 Row() { 479 Row() {
478 Row() { 480 Row() {
479 Text(this.item?.source) 481 Text(this.item?.source)
480 .fontSize(12) 482 .fontSize(12)
481 - .fontColor(Color.Gray)  
482 - .margin({ left: 22 }) 483 + .fontColor('#B0B0B0')
  484 + .margin({ left: 16 })
483 Image($r('app.media.point')) 485 Image($r('app.media.point'))
484 .width(16) 486 .width(16)
485 .height(16) 487 .height(16)
486 .margin({ top: 10, bottom: 10 }) 488 .margin({ top: 10, bottom: 10 })
487 Text(this.getPublishTime()) 489 Text(this.getPublishTime())
488 .fontSize(12) 490 .fontSize(12)
489 - .fontColor(Color.Gray)  
490 - if (this.interactData && this.interactData.commentNum && Number(this.interactData.collectNum) > 0) { 491 + .fontColor('#B0B0B0')
  492 + if (this.item.objectType != '2' && this.interactData && this.interactData.commentNum && Number(this.interactData.collectNum) > 0) {
491 Text(this.interactData.commentNum + "评") 493 Text(this.interactData.commentNum + "评")
492 .fontSize(12) 494 .fontSize(12)
493 - .fontColor(Color.Gray) 495 + .fontColor('#B0B0B0')
494 .margin({ left: 6 }) 496 .margin({ left: 6 })
495 } 497 }
496 } 498 }
@@ -12,7 +12,7 @@ export default struct NoMoreLayout { @@ -12,7 +12,7 @@ export default struct NoMoreLayout {
12 Text($r('app.string.footer_text')) 12 Text($r('app.string.footer_text'))
13 .fontSize(RefreshConstants.NoMoreLayoutConstant_TITLE_FONT) 13 .fontSize(RefreshConstants.NoMoreLayoutConstant_TITLE_FONT)
14 .textAlign(TextAlign.Center) 14 .textAlign(TextAlign.Center)
15 - .fontColor('#CCCCCC') 15 + .fontColor('#999999')
16 .margin({bottom:40}) 16 .margin({bottom:40})
17 } 17 }
18 .width(RefreshConstants.FULL_WIDTH) 18 .width(RefreshConstants.FULL_WIDTH)
1 import { HttpUrlUtils, ResponseDTO } from 'wdNetwork'; 1 import { HttpUrlUtils, ResponseDTO } from 'wdNetwork';
2 import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest'; 2 import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest';
3 import { Logger, ToastUtils, EmitterEventId, EmitterUtils } from 'wdKit'; 3 import { Logger, ToastUtils, EmitterEventId, EmitterUtils } from 'wdKit';
4 -import { LiveDetailsBean, ReserveBean, ReserveItemBean } from 'wdBean/Index'; 4 +import { LiveDetailsBean, ReserveBean, ReserveItemBean, joinPeopleNum } from 'wdBean/Index';
5 5
6 const TAG = 'LiveModel' 6 const TAG = 'LiveModel'
7 7
@@ -105,5 +105,34 @@ export class LiveModel { @@ -105,5 +105,34 @@ export class LiveModel {
105 }) 105 })
106 }) 106 })
107 } 107 }
  108 +
  109 + /**
  110 + * 查询直播参与人数
  111 + */
  112 + static getJoinPeopleNum(liveIdList: string) {
  113 + return new Promise<Array<joinPeopleNum>>((success, fail) => {
  114 + HttpRequest.get<ResponseDTO<Array<joinPeopleNum>>>(
  115 + HttpUrlUtils.getJoinPeopleNum() + `?liveIdList=${liveIdList}`,
  116 + ).then((data: ResponseDTO<Array<joinPeopleNum>>) => {
  117 + Logger.debug(TAG, 'getJoinPeopleNum:' + `${JSON.stringify(data)}`)
  118 + Logger.debug(TAG, 'liveIdList:' + liveIdList)
  119 + if (!data || !data.data) {
  120 + fail("数据为空")
  121 + return
  122 + }
  123 + if (data.code != 0) {
  124 + fail(data.message)
  125 + ToastUtils.shortToast(data.message)
  126 + return
  127 + }
  128 + success(data.data)
  129 + Logger.info('getJoinPeopleNum', JSON.stringify(data.data))
  130 + }, (error: Error) => {
  131 + fail(error.message)
  132 + Logger.debug(TAG + ":error ", JSON.stringify(error))
  133 + })
  134 + })
  135 + }
  136 +
108 } 137 }
109 138
@@ -149,6 +149,9 @@ export class GetuiPush { @@ -149,6 +149,9 @@ export class GetuiPush {
149 } 149 }
150 150
151 setAlias(bind: boolean, alias: string, sn: string = this.ALIAS_SN_USERID) { 151 setAlias(bind: boolean, alias: string, sn: string = this.ALIAS_SN_USERID) {
  152 + if (typeof alias == "number") {
  153 + alias = `${alias}`
  154 + }
152 if (!this.initialed) { return } 155 if (!this.initialed) { return }
153 if (bind) { 156 if (bind) {
154 Logger.debug(TAG, "推送 绑定别名 " + alias) 157 Logger.debug(TAG, "推送 绑定别名 " + alias)
@@ -56,9 +56,15 @@ export class PushContentParser { @@ -56,9 +56,15 @@ export class PushContentParser {
56 },*/ 56 },*/
57 let gtData = want.parameters[PushContentParser.LAUNCH_PARAM_GETUI_DATA] as Record<string, string | number | object> 57 let gtData = want.parameters[PushContentParser.LAUNCH_PARAM_GETUI_DATA] as Record<string, string | number | object>
58 if (gtData[PushContentParser.LAUNCH_PARAM_GETUI_TASKID] != undefined) { 58 if (gtData[PushContentParser.LAUNCH_PARAM_GETUI_TASKID] != undefined) {
59 - let json = JSON.parse(gtData["wantUri"] as string) as Record<string, string | number>  
60 - if (json && json[PushContentParser.PUSH_PARAM_PUSH_LINK] != null) {  
61 - const pushLink = json[PushContentParser.PUSH_PARAM_PUSH_LINK] as string 59 + // let json = JSON.parse(gtData["wantUri"] as string) as Record<string, string | number>
  60 + // if (json && json[PushContentParser.PUSH_PARAM_PUSH_LINK] != null) {
  61 + // const pushLink = json[PushContentParser.PUSH_PARAM_PUSH_LINK] as string
  62 + // return {
  63 + // isPush: true, online: true, pushLink: pushLink, want: want
  64 + // }
  65 + // }
  66 + if (want.parameters[PushContentParser.PUSH_PARAM_PUSH_LINK]) {
  67 + let pushLink = want.parameters[PushContentParser.PUSH_PARAM_PUSH_LINK] as string
62 return { 68 return {
63 isPush: true, online: true, pushLink: pushLink, want: want 69 isPush: true, online: true, pushLink: pushLink, want: want
64 } 70 }
@@ -29,12 +29,15 @@ struct MultiPictureDetailPage { @@ -29,12 +29,15 @@ struct MultiPictureDetailPage {
29 .backgroundColor(Color.Black) 29 .backgroundColor(Color.Black)
30 } 30 }
31 31
32 - pageTransition(){  
33 - // 定义页面进入时的效果,从右边侧滑入  
34 - PageTransitionEnter({ type: RouteType.None, duration: 300 }) 32 + pageTransition() {
  33 + // 为目标页面时,进入:从右边侧滑入,退出:是右侧划出;跳转别的页面:左侧划出,返回:左侧划入。
  34 + PageTransitionEnter({ type: RouteType.Push, duration: 300 })
35 .slide(SlideEffect.Right) 35 .slide(SlideEffect.Right)
36 - // 定义页面退出时的效果,向右边侧滑出  
37 - PageTransitionExit({ type: RouteType.None, duration: 300 }) 36 + PageTransitionEnter({ type: RouteType.Pop, duration: 300 })
  37 + .slide(SlideEffect.Left)
  38 + PageTransitionExit({ type: RouteType.Push, duration: 300 })
  39 + .slide(SlideEffect.Left)
  40 + PageTransitionExit({ type: RouteType.Pop, duration: 300 })
38 .slide(SlideEffect.Right) 41 .slide(SlideEffect.Right)
39 } 42 }
40 43
@@ -62,6 +65,17 @@ struct MultiPictureDetailPage { @@ -62,6 +65,17 @@ struct MultiPictureDetailPage {
62 this.closeFullScreen() 65 this.closeFullScreen()
63 } 66 }
64 67
  68 + onPageShow(): void {
  69 + console.log(TAG, 'onPageShow')
  70 + this.openFullScreen()
  71 +
  72 + }
  73 +
  74 + onPageHide(): void {
  75 + console.log(TAG, 'onPageHide')
  76 + this.closeFullScreen()
  77 + }
  78 +
65 /** 79 /**
66 * 开启沉浸式 80 * 开启沉浸式
67 * TODO:颜色待根据业务接口修改 81 * TODO:颜色待根据业务接口修改