zhanglun_wd

Merge remote-tracking branch 'origin/main' into main

Showing 96 changed files with 1188 additions and 469 deletions
@@ -98,4 +98,8 @@ export class DeviceUtil { @@ -98,4 +98,8 @@ export class DeviceUtil {
98 static isTablet(): boolean { 98 static isTablet(): boolean {
99 return deviceInfo.deviceType == 'tablet'; 99 return deviceInfo.deviceType == 'tablet';
100 } 100 }
  101 +
  102 + static is2in1(): boolean {
  103 + return deviceInfo.deviceType == '2in1';
  104 + }
101 } 105 }
@@ -43,6 +43,9 @@ export class WindowModel { @@ -43,6 +43,9 @@ export class WindowModel {
43 return this.windowClass as window.Window 43 return this.windowClass as window.Window
44 } 44 }
45 45
  46 + /**
  47 + * @deprecated 应用整体全屏,不需要再设置全屏与否了。
  48 + */
46 setMainWindowFullScreen(fullScreen: boolean) { 49 setMainWindowFullScreen(fullScreen: boolean) {
47 if (deviceInfo.deviceType != "phone") { 50 if (deviceInfo.deviceType != "phone") {
48 return 51 return
@@ -132,6 +135,13 @@ export class WindowModel { @@ -132,6 +135,13 @@ export class WindowModel {
132 }) 135 })
133 } 136 }
134 137
  138 + /**
  139 + * 状态栏显示设置
  140 + */
  141 + setSpecificSystemBarEnabled(visible: boolean) {
  142 + this.windowClass?.setSpecificSystemBarEnabled('status', visible)
  143 + }
  144 +
135 setWindowSystemBarEnable(names: Array<'status' | 'navigation'>) { 145 setWindowSystemBarEnable(names: Array<'status' | 'navigation'>) {
136 this.windowClass?.setWindowSystemBarEnable(names) 146 this.windowClass?.setWindowSystemBarEnable(names)
137 } 147 }
@@ -140,6 +150,9 @@ export class WindowModel { @@ -140,6 +150,9 @@ export class WindowModel {
140 return this.windowClass?.getWindowProperties() 150 return this.windowClass?.getWindowProperties()
141 } 151 }
142 152
  153 + /**
  154 + * @deprecated 应用整体全屏,不需要再设置全屏与否了。
  155 + */
143 setWindowLayoutFullScreen(isFullScreen: boolean) { 156 setWindowLayoutFullScreen(isFullScreen: boolean) {
144 this.isFullScreen = isFullScreen 157 this.isFullScreen = isFullScreen
145 this.windowClass?.setWindowLayoutFullScreen(isFullScreen) 158 this.windowClass?.setWindowLayoutFullScreen(isFullScreen)
@@ -15,3 +15,5 @@ export { AssignChannelParam } from './src/main/ets/utils/HomeChannelUtils'; @@ -15,3 +15,5 @@ export { AssignChannelParam } from './src/main/ets/utils/HomeChannelUtils';
15 export { RouterJumpInterceptor, JumpInterceptorAction } from './src/main/ets/router/RouterJumpInterceptor' 15 export { RouterJumpInterceptor, JumpInterceptorAction } from './src/main/ets/router/RouterJumpInterceptor'
16 16
17 export { AppInnerLink } from './src/main/ets/utils/AppInnerLink' 17 export { AppInnerLink } from './src/main/ets/utils/AppInnerLink'
  18 +
  19 +export { ContentType } from './src/main/ets/common/ContentType'
  1 +export enum ContentType {
  2 +
  3 + /// 不跳转
  4 + Unknown = 0,
  5 + ///点播
  6 + Video = 1,
  7 +
  8 + ///直播
  9 + Live = 2,
  10 +
  11 + ///活动
  12 + Activity = 3,
  13 +
  14 + ///信息流广告
  15 + InfoflowAD = 4,
  16 +
  17 + ///专题
  18 + Subject = 5,
  19 +
  20 + ///链接
  21 + Link = 6,
  22 +
  23 + ///榜单
  24 + RankList = 7,
  25 +
  26 + /// 图文
  27 + ImageText = 8,
  28 + /// 组图
  29 + Pictures = 9,
  30 +
  31 + /// H5新闻 (仅海外版存在,视界和中文端无此类型。中文端按照图文8类型+link)
  32 + H5News = 10,
  33 + /// 频道
  34 + Channel = 11,
  35 + ///组件
  36 + Module = 12,
  37 + ///音频
  38 + Audio = 13,
  39 + ///动态图文
  40 + DynamicImageText = 14,
  41 +
  42 + ///动态视频
  43 + DynamicVideo = 15,
  44 +
  45 + ///问政留言
  46 + Ask = 16,
  47 +
  48 + /// 金刚位
  49 + KeyPosition = 30,
  50 +
  51 + /// 合集
  52 + Serials = 101,
  53 +
  54 +
  55 +
  56 +}
@@ -106,10 +106,11 @@ export class ProcessUtils { @@ -106,10 +106,11 @@ export class ProcessUtils {
106 case ContentConstants.TYPE_AUDIO: 106 case ContentConstants.TYPE_AUDIO:
107 ProcessUtils.gotoAudio(content) 107 ProcessUtils.gotoAudio(content)
108 break; 108 break;
109 - case ContentConstants.TYPE_TELETEXT:case ContentConstants.TYPE_Activity: 109 + case ContentConstants.TYPE_TELETEXT:
  110 + case ContentConstants.TYPE_Activity:
110 // 图文详情,跳转h5 111 // 图文详情,跳转h5
111 if (content?.linkUrl) { //有 linkUrl 走专题页展示逻辑 112 if (content?.linkUrl) { //有 linkUrl 走专题页展示逻辑
112 - ProcessUtils.gotoSpecialTopic(content,true) 113 + ProcessUtils.gotoSpecialTopic(content, true)
113 } else { 114 } else {
114 ProcessUtils.gotoWeb(content); 115 ProcessUtils.gotoWeb(content);
115 } 116 }
@@ -171,17 +172,17 @@ export class ProcessUtils { @@ -171,17 +172,17 @@ export class ProcessUtils {
171 let relIndex = 0; 172 let relIndex = 0;
172 for (let index = 0; index < photoList.length; index++) { 173 for (let index = 0; index < photoList.length; index++) {
173 const element = photoList[index]; 174 const element = photoList[index];
174 - if(!StringUtils.isEmpty(element.picPath)){  
175 - relIndex = relIndex+1 175 + if (!StringUtils.isEmpty(element.picPath)) {
  176 + relIndex = relIndex + 1
176 } 177 }
177 } 178 }
178 tempP.length = relIndex 179 tempP.length = relIndex
179 relIndex = 0 180 relIndex = 0
180 for (let index = 0; index < photoList.length; index++) { 181 for (let index = 0; index < photoList.length; index++) {
181 const element = photoList[index]; 182 const element = photoList[index];
182 - if(!StringUtils.isEmpty(element.picPath)){ 183 + if (!StringUtils.isEmpty(element.picPath)) {
183 tempP[relIndex] = element 184 tempP[relIndex] = element
184 - relIndex = relIndex+1 185 + relIndex = relIndex + 1
185 } 186 }
186 } 187 }
187 photoList.length = tempP.length 188 photoList.length = tempP.length
@@ -243,7 +244,7 @@ export class ProcessUtils { @@ -243,7 +244,7 @@ export class ProcessUtils {
243 public static gotoDefaultWeb(content: ContentDTO) { 244 public static gotoDefaultWeb(content: ContentDTO) {
244 245
245 // 内链 246 // 内链
246 - if(content.openType == '1'){ 247 + if (content.openType == '1') {
247 let taskAction: Action = { 248 let taskAction: Action = {
248 type: 'JUMP_H5_BY_WEB_VIEW', 249 type: 'JUMP_H5_BY_WEB_VIEW',
249 params: { 250 params: {
@@ -251,10 +252,10 @@ export class ProcessUtils { @@ -251,10 +252,10 @@ export class ProcessUtils {
251 } as Params, 252 } as Params,
252 }; 253 };
253 WDRouterRule.jumpWithAction(taskAction) 254 WDRouterRule.jumpWithAction(taskAction)
254 - }else if(content.openType == '2') { 255 + } else if (content.openType == '2') {
255 // 外链 256 // 外链
256 ProcessUtils.jumpExternalWebPage(content.linkUrl); 257 ProcessUtils.jumpExternalWebPage(content.linkUrl);
257 - }else { 258 + } else {
258 // 无需跳转 259 // 无需跳转
259 260
260 } 261 }
@@ -476,9 +477,14 @@ export class ProcessUtils { @@ -476,9 +477,14 @@ export class ProcessUtils {
476 477
477 /** 478 /**
478 * 跳转人民号主页 479 * 跳转人民号主页
479 - * @params creatorId 创作者id 480 + * @param creatorId 创作者id
  481 + * @param banControl 是否封禁可以查看号主页 0 可以,1不可以
  482 + * @param mainControl 中文端账号是否拥有主页展示权限:0-未拥有,1-拥有
  483 + * @param userId 用户id
  484 + * @param userType 用户类型 1: 普通用户,2: 创作者 3: 矩阵号 4:运营子账号 5:内容源账号
480 */ 485 */
481 - public static gotoPeopleShipHomePage(creatorId: string) { 486 + public static gotoPeopleShipHomePage(creatorId: string, banControl?: number, mainControl?: number, userId?: string,
  487 + userType?: string) {
482 let params = { 'creatorId': creatorId } as Record<string, string>; 488 let params = { 'creatorId': creatorId } as Record<string, string>;
483 WDRouterRule.jumpWithPage(WDRouterPage.peopleShipHomePage, params) 489 WDRouterRule.jumpWithPage(WDRouterPage.peopleShipHomePage, params)
484 } 490 }
@@ -39,6 +39,8 @@ export interface ShareContentLink { @@ -39,6 +39,8 @@ export interface ShareContentLink {
39 desc?: string 39 desc?: string
40 link: string 40 link: string
41 icon?: string 41 icon?: string
  42 + deeplink: string // 根据内容详情,生成的深度链接 如:rmrbapp://rmrb.app/openwith?type=article&subType=h5_template_article&contentId=30000762651&relId=500000038702&skipType=1&relType=1
  43 +
42 } 44 }
43 45
44 export type ShareContent = ShareContentText | ShareContentImageAndText | ShareContentLink 46 export type ShareContent = ShareContentText | ShareContentImageAndText | ShareContentLink
@@ -6,6 +6,9 @@ import { AsyncCallback } from '@kit.BasicServicesKit'; @@ -6,6 +6,9 @@ import { AsyncCallback } from '@kit.BasicServicesKit';
6 import { common } from '@kit.AbilityKit'; 6 import { common } from '@kit.AbilityKit';
7 import { systemShare } from '@kit.ShareKit'; 7 import { systemShare } from '@kit.ShareKit';
8 import { uniformTypeDescriptor as utd } from '@kit.ArkData'; 8 import { uniformTypeDescriptor as utd } from '@kit.ArkData';
  9 +import { JSON } from '@kit.ArkTS';
  10 +
  11 +const TAG = "WDSystemShare"
9 12
10 export class WDSystemShare implements WDShareInterface { 13 export class WDSystemShare implements WDShareInterface {
11 14
@@ -14,7 +17,8 @@ export class WDSystemShare implements WDShareInterface { @@ -14,7 +17,8 @@ export class WDSystemShare implements WDShareInterface {
14 return new Promise((resolve, fail) => { 17 return new Promise((resolve, fail) => {
15 try { 18 try {
16 19
17 - let controller: systemShare.ShareController = new systemShare.ShareController(this.getShareData(content, contentType)); 20 + let data = this.getShareData(content, contentType)
  21 + let controller: systemShare.ShareController = new systemShare.ShareController(data);
18 let context: common.UIAbilityContext = getContext(this) as common.UIAbilityContext 22 let context: common.UIAbilityContext = getContext(this) as common.UIAbilityContext
19 23
20 controller.on('dismiss', () => { 24 controller.on('dismiss', () => {
@@ -53,7 +57,7 @@ export class WDSystemShare implements WDShareInterface { @@ -53,7 +57,7 @@ export class WDSystemShare implements WDShareInterface {
53 }); 57 });
54 data.addRecord({ 58 data.addRecord({
55 utd: utd.UniformDataType.PNG, 59 utd: utd.UniformDataType.PNG,
56 - uri: imageAndText.imgURI 60 + uri: imageAndText.imgURI // 这里必须为本地连接
57 }); 61 });
58 return data 62 return data
59 } 63 }
@@ -64,12 +68,35 @@ export class WDSystemShare implements WDShareInterface { @@ -64,12 +68,35 @@ export class WDSystemShare implements WDShareInterface {
64 utd: utd.UniformDataType.PLAIN_TEXT, 68 utd: utd.UniformDataType.PLAIN_TEXT,
65 content: link.title 69 content: link.title
66 }); 70 });
  71 + let shareLink = this.generateShareLink(link)
  72 + console.log("分享 shareLink ==> " + shareLink)
67 data.addRecord({ 73 data.addRecord({
68 utd: utd.UniformDataType.HYPERLINK, 74 utd: utd.UniformDataType.HYPERLINK,
69 - uri: link.link 75 + // uri: link.link // SDK 设计 不能传这里
  76 + content: link.link
70 }); 77 });
71 return data 78 return data
72 } 79 }
73 80
  81 + generateShareLink(shareContent: ShareContentLink) {
  82 + let link = "https://peopledailychinahosactivity.drcn.agconnect.link?deeplink=" + encodeURIComponent(shareContent.deeplink)
  83 +
  84 + link += "&harmonyos_deeplink=" + encodeURIComponent(shareContent.deeplink)
  85 + link += "&harmonyos_package_name=com.peopledailychina.hosactivity"
  86 + link += "&harmonyos_fallback_url=" + encodeURIComponent(shareContent.link)
74 87
  88 + // link += "&android_deeplink=" + encodeURIComponent(shareContent.deeplink)
  89 + // link += "&android_fallback_url=" + encodeURIComponent(shareContent.link)
  90 + //
  91 + // link += "&ios_link=" + encodeURIComponent(shareContent.deeplink)
  92 + // link += "&ios_fallback_url=" + encodeURIComponent(shareContent.link)
  93 +
  94 + link += "&preview_type=1"
  95 + link += "&landing_page_type=1"
  96 + // link += "&social_desc=" + encodeURIComponent(shareContent.desc || " ")
  97 + // link += "&social_image=" + encodeURIComponent(shareContent.icon || " ")
  98 + // link += "&social_title=" + encodeURIComponent(shareContent.title)
  99 + link += "&region_id=0"
  100 + return link
  101 + }
75 } 102 }
@@ -62,12 +62,11 @@ export struct CardParser { @@ -62,12 +62,11 @@ export struct CardParser {
62 Card2Component({ compDTO: this.compDTO, contentDTO, pageId: this.pageId, pageName: this.pageName }) 62 Card2Component({ compDTO: this.compDTO, contentDTO, pageId: this.pageId, pageName: this.pageName })
63 } else if (contentDTO.appStyle === CompStyle.Card_03) { 63 } else if (contentDTO.appStyle === CompStyle.Card_03) {
64 Card3Component({ compDTO: this.compDTO, contentDTO, pageId: this.pageId, pageName: this.pageName }) 64 Card3Component({ compDTO: this.compDTO, contentDTO, pageId: this.pageId, pageName: this.pageName })
65 - } else if (contentDTO.appStyle === CompStyle.Card_04) { 65 + }else if (contentDTO.appStyle === CompStyle.Card_04) {
66 Card4Component({ compDTO: this.compDTO, contentDTO, pageId: this.pageId, pageName: this.pageName }) 66 Card4Component({ compDTO: this.compDTO, contentDTO, pageId: this.pageId, pageName: this.pageName })
67 } else if (contentDTO.appStyle === CompStyle.Card_05) { 67 } else if (contentDTO.appStyle === CompStyle.Card_05) {
68 Card5Component({ compDTO: this.compDTO, contentDTO, titleShowPolicy: this.compDTO.titleShowPolicy, pageId: this.pageId, pageName: this.pageName}) 68 Card5Component({ compDTO: this.compDTO, contentDTO, titleShowPolicy: this.compDTO.titleShowPolicy, pageId: this.pageId, pageName: this.pageName})
69 - } else if (contentDTO.appStyle === CompStyle.Card_06 || contentDTO.appStyle === CompStyle  
70 - .Card_13) { 69 + } else if (contentDTO.appStyle === CompStyle.Card_06 || contentDTO.appStyle === CompStyle.Card_13 ) {
71 Card6Component({ compDTO: this.compDTO, contentDTO: this.contentDTO, pageId: this.pageId, pageName: this.pageName }) 70 Card6Component({ compDTO: this.compDTO, contentDTO: this.contentDTO, pageId: this.pageId, pageName: this.pageName })
72 } else if (contentDTO.appStyle === CompStyle.Card_10) { 71 } else if (contentDTO.appStyle === CompStyle.Card_10) {
73 Card10Component({ compDTO: this.compDTO, contentDTO, pageId: this.pageId, pageName: this.pageName }) 72 Card10Component({ compDTO: this.compDTO, contentDTO, pageId: this.pageId, pageName: this.pageName })
@@ -60,12 +60,12 @@ export struct CarderInteraction { @@ -60,12 +60,12 @@ export struct CarderInteraction {
60 }) 60 })
61 } 61 }
62 62
63 - if(this.contentDetailData.rmhInfo != null){  
64 - if(this.contentDetailData.shareInfo != null && 1 == this.contentDetailData.shareInfo.shareOpen && 1 == this.contentDetailData.rmhInfo.cnShareControl){  
65 - this.shareLayout() 63 + if(this.contentDTO.rmhInfo != null){
  64 + if(this.contentDTO.shareInfo != null && 1 == this.contentDTO.shareInfo.shareOpen && 1 == this.contentDTO.rmhInfo.cnShareControl){
  65 + this.commentLayout()
66 } 66 }
67 }else{ 67 }else{
68 - this.shareLayout() 68 + this.commentLayout()
69 } 69 }
70 70
71 this.builderLike() 71 this.builderLike()
@@ -81,7 +81,7 @@ export struct CarderInteraction { @@ -81,7 +81,7 @@ export struct CarderInteraction {
81 } 81 }
82 82
83 @Builder 83 @Builder
84 - shareLayout() { 84 + commentLayout() {
85 Row() { 85 Row() {
86 Image($r('app.media.CarderInteraction_comment')) 86 Image($r('app.media.CarderInteraction_comment'))
87 .width(18) 87 .width(18)
@@ -4,7 +4,9 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; @@ -4,7 +4,9 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
4 import PageModel from '../viewmodel/PageModel'; 4 import PageModel from '../viewmodel/PageModel';
5 import { CardParser } from './CardParser'; 5 import { CardParser } from './CardParser';
6 import { Card2Component } from './cardview/Card2Component'; 6 import { Card2Component } from './cardview/Card2Component';
  7 +import { Card3Component } from './cardview/Card3Component';
7 import { Card9Component } from './cardview/Card9Component'; 8 import { Card9Component } from './cardview/Card9Component';
  9 +import { Card6Component } from './cardview/Card6Component';
8 import { Card5Component } from './cardview/Card5Component'; 10 import { Card5Component } from './cardview/Card5Component';
9 import { AdvCardParser } from './cardViewAdv/AdvCardParser'; 11 import { AdvCardParser } from './cardViewAdv/AdvCardParser';
10 import { ZhCarouselLayout01 } from './compview/ZhCarouselLayout01'; 12 import { ZhCarouselLayout01 } from './compview/ZhCarouselLayout01';
@@ -71,6 +73,7 @@ export struct CompParser { @@ -71,6 +73,7 @@ export struct CompParser {
71 73
72 build() { 74 build() {
73 Column() { 75 Column() {
  76 + //Text(JSON.stringify(this.compDTO.compStyle))
74 this.componentBuilder(); 77 this.componentBuilder();
75 } 78 }
76 } 79 }
@@ -82,7 +85,6 @@ export struct CompParser { @@ -82,7 +85,6 @@ export struct CompParser {
82 85
83 if (this.compDTO.operDataList[0]?.objectType !== '3' && 86 if (this.compDTO.operDataList[0]?.objectType !== '3' &&
84 this.compDTO.operDataList[0]?.objectType !== '13') { //暂时屏蔽活动和音频详情入口 87 this.compDTO.operDataList[0]?.objectType !== '13') { //暂时屏蔽活动和音频详情入口
85 -  
86 if (this.compDTO.compStyle === CompStyle.Label_03) { 88 if (this.compDTO.compStyle === CompStyle.Label_03) {
87 LabelComponent({ compDTO: this.compDTO }) 89 LabelComponent({ compDTO: this.compDTO })
88 Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) 90 Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
@@ -108,7 +110,7 @@ export struct CompParser { @@ -108,7 +110,7 @@ export struct CompParser {
108 Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) 110 Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
109 } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_03) { 111 } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_03) {
110 ZhSingleRow03({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName }) 112 ZhSingleRow03({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName })
111 - Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) 113 + Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
112 } else if (this.compDTO.compStyle === CompStyle.Zh_Grid_Layout_02) { //双列流小视频,一行两图卡 ->标题 114 } else if (this.compDTO.compStyle === CompStyle.Zh_Grid_Layout_02) { //双列流小视频,一行两图卡 ->标题
113 //ZhGridLayout02({ compDTO: this.compDTO }) 115 //ZhGridLayout02({ compDTO: this.compDTO })
114 CompNormalTitle({ compDTO: this.compDTO }) 116 CompNormalTitle({ compDTO: this.compDTO })
@@ -136,12 +138,18 @@ export struct CompParser { @@ -136,12 +138,18 @@ export struct CompParser {
136 } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_03) { 138 } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_03) {
137 // 大图卡 139 // 大图卡
138 Card2Component({ compDTO: this.compDTO, contentDTO: this.compDTO.operDataList[0], pageId: this.pageId, pageName: this.pageName }) 140 Card2Component({ compDTO: this.compDTO, contentDTO: this.compDTO.operDataList[0], pageId: this.pageId, pageName: this.pageName })
139 - Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) 141 + Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
140 } else if (this.compDTO.compStyle === CompStyle.Card_09) { 142 } else if (this.compDTO.compStyle === CompStyle.Card_09) {
141 //时间链卡 143 //时间链卡
142 Card9Component({ compDTO: this.compDTO, contentDTO:this.compDTO.operDataList[0], pageId: this.pageId, pageName: this.pageName }) 144 Card9Component({ compDTO: this.compDTO, contentDTO:this.compDTO.operDataList[0], pageId: this.pageId, pageName: this.pageName })
143 Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) 145 Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
144 - } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_04) { 146 + } else if(this.compDTO.compStyle === CompStyle.Card_13){
  147 + Card6Component({ compDTO: this.compDTO, contentDTO: this.compDTO.operDataList[0], pageId: this.pageId, pageName: this.pageName })
  148 + Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
  149 + } else if(this.compDTO.compStyle === CompStyle.Card_03){
  150 + Card3Component({ compDTO: this.compDTO, contentDTO: this.compDTO.operDataList[0], pageId: this.pageId, pageName: this.pageName })
  151 + Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
  152 + }else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_04) {
145 ZhSingleColumn04({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName }) 153 ZhSingleColumn04({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName })
146 Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) 154 Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
147 } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_05) { 155 } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_05) {
@@ -82,6 +82,9 @@ export struct DynamicDetailComponent { @@ -82,6 +82,9 @@ export struct DynamicDetailComponent {
82 @State openLikes: boolean = false // 是否可以点赞 1:可以 0:不可以 82 @State openLikes: boolean = false // 是否可以点赞 1:可以 0:不可以
83 83
84 pageParam: ParamType = {} 84 pageParam: ParamType = {}
  85 +
  86 + // @Provide bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
  87 + @Provide topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
85 async aboutToAppear() { 88 async aboutToAppear() {
86 await this.getContentDetailData() 89 await this.getContentDetailData()
87 // 内容用 点赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空 90 // 内容用 点赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空
@@ -112,7 +115,7 @@ export struct DynamicDetailComponent { @@ -112,7 +115,7 @@ export struct DynamicDetailComponent {
112 .width('100%') 115 .width('100%')
113 .alignItems(VerticalAlign.Bottom) 116 .alignItems(VerticalAlign.Bottom)
114 .padding({ bottom: 5 }) 117 .padding({ bottom: 5 })
115 - 118 + .margin({top: `${this.topSafeHeight}px`})
116 //分割线 119 //分割线
117 Image($r('app.media.ic_news_detail_division')) 120 Image($r('app.media.ic_news_detail_division'))
118 .width('100%') 121 .width('100%')
@@ -439,7 +442,7 @@ export struct DynamicDetailComponent { @@ -439,7 +442,7 @@ export struct DynamicDetailComponent {
439 this.contentDetailData.fullColumnImgUrls.length > 0 && 442 this.contentDetailData.fullColumnImgUrls.length > 0 &&
440 !StringUtils.isEmpty(this.contentDetailData.fullColumnImgUrls[0].url) ? 443 !StringUtils.isEmpty(this.contentDetailData.fullColumnImgUrls[0].url) ?
441 this.contentDetailData.fullColumnImgUrls[0].url : 444 this.contentDetailData.fullColumnImgUrls[0].url :
442 - this.contentDetailData.videoInfo[0].firstFrameImageUri) 445 + this.contentDetailData.firstFrameImageUri)
443 .width(DisplayUtils.getDeviceWidth() - 32) 446 .width(DisplayUtils.getDeviceWidth() - 32)
444 .height((DisplayUtils.getDeviceWidth() - 32) * 9 / 16) 447 .height((DisplayUtils.getDeviceWidth() - 32) * 9 / 16)
445 .borderRadius($r('app.float.image_border_radius')) 448 .borderRadius($r('app.float.image_border_radius'))
@@ -457,7 +460,7 @@ export struct DynamicDetailComponent { @@ -457,7 +460,7 @@ export struct DynamicDetailComponent {
457 this.contentDetailData.fullColumnImgUrls.length > 0 && 460 this.contentDetailData.fullColumnImgUrls.length > 0 &&
458 !StringUtils.isEmpty(this.contentDetailData.fullColumnImgUrls[0].url) ? 461 !StringUtils.isEmpty(this.contentDetailData.fullColumnImgUrls[0].url) ?
459 this.contentDetailData.fullColumnImgUrls[0].url : 462 this.contentDetailData.fullColumnImgUrls[0].url :
460 - this.contentDetailData.videoInfo[0].firstFrameImageUri) 463 + this.contentDetailData.firstFrameImageUri)
461 .width(DisplayUtils.getDeviceWidth() / 2) 464 .width(DisplayUtils.getDeviceWidth() / 2)
462 .height(DisplayUtils.getDeviceWidth() / 2 * 4 / 3) 465 .height(DisplayUtils.getDeviceWidth() / 2 * 4 / 3)
463 .borderRadius($r('app.float.image_border_radius')) 466 .borderRadius($r('app.float.image_border_radius'))
@@ -570,6 +573,7 @@ export struct DynamicDetailComponent { @@ -570,6 +573,7 @@ export struct DynamicDetailComponent {
570 }) 573 })
571 .height(100) 574 .height(100)
572 } 575 }
  576 + .margin({bottom: 65})
573 } 577 }
574 .alignSelf(ItemAlign.Start) 578 .alignSelf(ItemAlign.Start)
575 .backgroundColor('#FFFFFFFF') 579 .backgroundColor('#FFFFFFFF')
@@ -86,7 +86,7 @@ export struct MorningEveningPaperComponent { @@ -86,7 +86,7 @@ export struct MorningEveningPaperComponent {
86 offset: { dx: 12, dy: -150 }, 86 offset: { dx: 12, dy: -150 },
87 87
88 }) 88 })
89 - // private AudioSuspension = new AudioSuspensionModel() 89 + private AudioSuspension = new AudioSuspensionModel()
90 90
91 onCancel() { 91 onCancel() {
92 Logger.info(TAG, "cj2024 onCancel = ") 92 Logger.info(TAG, "cj2024 onCancel = ")
@@ -149,19 +149,22 @@ export struct MorningEveningPaperComponent { @@ -149,19 +149,22 @@ export struct MorningEveningPaperComponent {
149 Logger.info(TAG, "pageInfoBean dateTime = " + dateTime) 149 Logger.info(TAG, "pageInfoBean dateTime = " + dateTime)
150 Logger.info(TAG, "pageInfoBean subTitle = " + this.subTitle) 150 Logger.info(TAG, "pageInfoBean subTitle = " + this.subTitle)
151 151
  152 + Logger.info(TAG, "this.pageInfoBean = " + JSON.stringify(this.pageInfoBean))
  153 +
152 this.isHasTopView = this.pageInfoBean?.topicInfo?.frontLinkObject?true:false 154 this.isHasTopView = this.pageInfoBean?.topicInfo?.frontLinkObject?true:false
153 let coverUrl = this.isHasTopView?this.pageInfoBean?.topicInfo?.frontLinkObject?.coverUrl as string :'' 155 let coverUrl = this.isHasTopView?this.pageInfoBean?.topicInfo?.frontLinkObject?.coverUrl as string :''
154 this.setComponentBgColor(coverUrl) 156 this.setComponentBgColor(coverUrl)
155 157
156 let compInfoBean = await MorningEveningViewModel.getMorningEveningCompInfo(pageInfoBean?.id, pageInfoBean?.groups[0]?.id, currentTime + "", pageInfoBean?.topicInfo?.topicId) 158 let compInfoBean = await MorningEveningViewModel.getMorningEveningCompInfo(pageInfoBean?.id, pageInfoBean?.groups[0]?.id, currentTime + "", pageInfoBean?.topicInfo?.topicId)
157 // this.compInfoBean = compInfoBean 159 // this.compInfoBean = compInfoBean
  160 + Logger.info(TAG, "compInfoBean = " + JSON.stringify(compInfoBean))
158 if (compInfoBean?.compList[0]) { 161 if (compInfoBean?.compList[0]) {
159 this.compListItem = compInfoBean?.compList[0] 162 this.compListItem = compInfoBean?.compList[0]
160 Logger.debug(TAG, '获取评论数据' + `${this.compListItem.operDataList.length}`) 163 Logger.debug(TAG, '获取评论数据' + `${this.compListItem.operDataList.length}`)
161 if (this.compListItem.operDataList && this.compListItem.operDataList.length > 0) { 164 if (this.compListItem.operDataList && this.compListItem.operDataList.length > 0) {
162 this.getAllContentInteractData(this.compListItem.operDataList) 165 this.getAllContentInteractData(this.compListItem.operDataList)
163 } 166 }
164 - Logger.debug('compInfoBean?.compList[0].audioDataList', JSON.stringify(compInfoBean?.compList[0].audioDataList)) 167 + Logger.debug(TAG, 'compInfoBean?.compList[0].audioDataList', JSON.stringify(compInfoBean?.compList[0].audioDataList))
165 if (compInfoBean?.compList[0].audioDataList) { 168 if (compInfoBean?.compList[0].audioDataList) {
166 this.audioPlayUrl = compInfoBean?.compList[0].audioDataList[0].audioUrl 169 this.audioPlayUrl = compInfoBean?.compList[0].audioDataList[0].audioUrl
167 this.audioTitle = compInfoBean?.compList[0].audioDataList[0].title 170 this.audioTitle = compInfoBean?.compList[0].audioDataList[0].title
@@ -258,12 +261,11 @@ export struct MorningEveningPaperComponent { @@ -258,12 +261,11 @@ export struct MorningEveningPaperComponent {
258 topicInfoView({ frontLinkObject: this.pageInfoBean?.topicInfo?.frontLinkObject }) 261 topicInfoView({ frontLinkObject: this.pageInfoBean?.topicInfo?.frontLinkObject })
259 } 262 }
260 263
261 - //暂时不展示音频播报  
262 - // if (this.audioPlayUrl.length > 0){  
263 - // ListItem() {  
264 - // this.AudioBarView(this.simpleAudioDialog)  
265 - // }  
266 - // } 264 + if (this.audioPlayUrl !== ""){
  265 + ListItem() {
  266 + this.AudioBarView()
  267 + }
  268 + }
267 } 269 }
268 270
269 ListItem() { 271 ListItem() {
@@ -307,7 +309,7 @@ export struct MorningEveningPaperComponent { @@ -307,7 +309,7 @@ export struct MorningEveningPaperComponent {
307 } 309 }
308 310
309 @Builder 311 @Builder
310 - AudioBarView(dialog: CustomDialogController) { 312 + AudioBarView() {
311 Row() { 313 Row() {
312 Stack({ alignContent: Alignment.Start }) { 314 Stack({ alignContent: Alignment.Start }) {
313 Image($r('app.media.listen_left_bg')) 315 Image($r('app.media.listen_left_bg'))
@@ -320,7 +322,7 @@ export struct MorningEveningPaperComponent { @@ -320,7 +322,7 @@ export struct MorningEveningPaperComponent {
320 .margin({ left: 10 }) 322 .margin({ left: 10 })
321 .alignSelf(ItemAlign.Start) 323 .alignSelf(ItemAlign.Start)
322 324
323 - Text('晚上好, 请收听今日新闻播报') 325 + Text(`${this.pageInfoBean.topicInfo.topicPattern === 1 ? '早上好' : this.pageInfoBean.topicInfo.topicPattern === 2 ? '中午好' : '晚上好'}, 请收听今日新闻播报`)
324 .fontSize(14) 326 .fontSize(14)
325 .margin({ left: 50 }) 327 .margin({ left: 50 })
326 .fontColor(Color.Black) 328 .fontColor(Color.Black)
@@ -345,7 +347,7 @@ export struct MorningEveningPaperComponent { @@ -345,7 +347,7 @@ export struct MorningEveningPaperComponent {
345 Logger.info("TAG", "cj compInfoBean onClick1 = " + this.isAudioPlaying) 347 Logger.info("TAG", "cj compInfoBean onClick1 = " + this.isAudioPlaying)
346 // dialog.open() 348 // dialog.open()
347 // this.playerController.firstPlay(this.audioPlayUrl, this.audioTitle) 349 // this.playerController.firstPlay(this.audioPlayUrl, this.audioTitle)
348 - // this.AudioSuspension.setPlayerUrl(this.audioPlayUrl, this.audioTitle) 350 + this.AudioSuspension.setPlayerUrl(this.audioPlayUrl, this.audioTitle)
349 Logger.info(TAG, "this.audioPlayUrl = " + this.audioPlayUrl) 351 Logger.info(TAG, "this.audioPlayUrl = " + this.audioPlayUrl)
350 Logger.info("TAG", "cj compInfoBean onClick2 = " + this.isAudioPlaying) 352 Logger.info("TAG", "cj compInfoBean onClick2 = " + this.isAudioPlaying)
351 }) 353 })
@@ -17,7 +17,7 @@ export struct topicInfoView { @@ -17,7 +17,7 @@ export struct topicInfoView {
17 // } as FrontLinkObject 17 // } as FrontLinkObject
18 18
19 frontLinkObject: FrontLinkObject = {} as FrontLinkObject 19 frontLinkObject: FrontLinkObject = {} as FrontLinkObject
20 - 20 + @State isExpansion:boolean = false
21 aboutToAppear() { 21 aboutToAppear() {
22 } 22 }
23 23
@@ -32,10 +32,10 @@ export struct topicInfoView { @@ -32,10 +32,10 @@ export struct topicInfoView {
32 }) 32 })
33 .id('img_cover') 33 .id('img_cover')
34 34
35 - if (this.frontLinkObject.linkUrl.length > 0) { 35 + if (this.frontLinkObject.linkUrl.length > 0 || this.frontLinkObject?.newsId.length > 0) {
36 Row() { 36 Row() {
37 Text("查看详情") 37 Text("查看详情")
38 - .fontSize(14) 38 + .fontSize(12)
39 .fontColor($r('app.color.white')) 39 .fontColor($r('app.color.white'))
40 .maxLines(1) 40 .maxLines(1)
41 .borderRadius(2) 41 .borderRadius(2)
@@ -54,10 +54,12 @@ export struct topicInfoView { @@ -54,10 +54,12 @@ export struct topicInfoView {
54 contentDTO.objectType = this.frontLinkObject?.newsType.toString() 54 contentDTO.objectType = this.frontLinkObject?.newsType.toString()
55 contentDTO.objectId = this.frontLinkObject?.newsId 55 contentDTO.objectId = this.frontLinkObject?.newsId
56 contentDTO.linkUrl = this.frontLinkObject?.linkUrl 56 contentDTO.linkUrl = this.frontLinkObject?.linkUrl
  57 + contentDTO.relId = this.frontLinkObject?.newsRelId.toString()
  58 + contentDTO.relType = this.frontLinkObject?.newsType.toString()
57 ProcessUtils.processPage(contentDTO) 59 ProcessUtils.processPage(contentDTO)
58 60
59 }) 61 })
60 - .width(80) 62 + .width(70)
61 .alignRules({ 63 .alignRules({
62 left: { anchor: "__container__", align: HorizontalAlign.Start }, 64 left: { anchor: "__container__", align: HorizontalAlign.Start },
63 bottom: { anchor: "__container__", align: VerticalAlign.Bottom } 65 bottom: { anchor: "__container__", align: VerticalAlign.Bottom }
@@ -65,17 +67,25 @@ export struct topicInfoView { @@ -65,17 +67,25 @@ export struct topicInfoView {
65 .id('row_detail') 67 .id('row_detail')
66 } 68 }
67 69
  70 +
  71 + Row(){
68 Text(this.frontLinkObject?.summary ?? "") 72 Text(this.frontLinkObject?.summary ?? "")
69 - .margin({ top: 10 })  
70 .fontSize(14) 73 .fontSize(14)
71 - .fontColor($r('app.color.white'))  
72 - .maxLines(3) 74 + .fontColor('#CCFFFFFF')
  75 + .maxLines(this.isExpansion?999:3)
73 .textOverflow({ overflow: TextOverflow.Ellipsis }) 76 .textOverflow({ overflow: TextOverflow.Ellipsis })
  77 +
  78 + Text(this.isExpansion?'收起':'展开').onClick(()=>{
  79 + this.isExpansion = !this.isExpansion
  80 + })
  81 + .fontSize(14)
  82 + .fontColor($r('app.color.white'))
  83 + }.alignItems(VerticalAlign.Bottom)
74 .alignRules({ 84 .alignRules({
75 left: { anchor: "__container__", align: HorizontalAlign.Start }, 85 left: { anchor: "__container__", align: HorizontalAlign.Start },
76 - bottom: this.frontLinkObject.linkUrl.length > 0?{ anchor: "row_detail", align: VerticalAlign.Top }:{ anchor: "__container__", align: VerticalAlign.Bottom } 86 + bottom: this.frontLinkObject.linkUrl.length > 0 || this.frontLinkObject?.newsId.length > 0 ?{ anchor: "row_detail", align: VerticalAlign.Top }:{ anchor: "__container__", align: VerticalAlign.Bottom }
77 }) 87 })
78 - .margin({ left: 16, right: 16, bottom: this.frontLinkObject.linkUrl.length > 0?0:16}) 88 + .margin({top: 10 , left: 16, right: 16, bottom: this.frontLinkObject.linkUrl.length > 0 || this.frontLinkObject?.newsId.length > 0 ?10:16})
79 .id('txt_summary') 89 .id('txt_summary')
80 90
81 Text(this.frontLinkObject?.title ?? "") 91 Text(this.frontLinkObject?.title ?? "")
@@ -93,7 +93,8 @@ export struct CardMediaInfo { @@ -93,7 +93,8 @@ export struct CardMediaInfo {
93 .fontFamily('BebasNeue') 93 .fontFamily('BebasNeue')
94 94
95 } 95 }
96 - } .margin({ left: 68,top: 135}) 96 + }
  97 + // .margin({ left: 68,top: 135})
97 } else if (this.contentDTO.objectType === '2') { 98 } else if (this.contentDTO.objectType === '2') {
98 // liveInfo.liveState 直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停 99 // liveInfo.liveState 直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停
99 // 显示直播信息 100 // 显示直播信息
@@ -191,7 +192,7 @@ export struct CardMediaInfo { @@ -191,7 +192,7 @@ export struct CardMediaInfo {
191 .mediaTextImgtype() 192 .mediaTextImgtype()
192 .fontFamily('BebasNeue') 193 .fontFamily('BebasNeue')
193 } 194 }
194 - .margin({ left: 80,top: 55}) 195 + // .margin({ left: 80,top: 55})
195 196
196 } else if (this.contentDTO.objectType === '13') { 197 } else if (this.contentDTO.objectType === '13') {
197 // 显示音频信息 198 // 显示音频信息
@@ -9,7 +9,7 @@ import { RmhInfoDTO, CompDTO, ContentDTO } from 'wdBean' @@ -9,7 +9,7 @@ import { RmhInfoDTO, CompDTO, ContentDTO } from 'wdBean'
9 import { CommonConstants } from 'wdConstant/Index'; 9 import { CommonConstants } from 'wdConstant/Index';
10 import { DateTimeUtils, SPHelper, Logger, ToastUtils } from 'wdKit'; 10 import { DateTimeUtils, SPHelper, Logger, ToastUtils } from 'wdKit';
11 import { SpConstants } from 'wdConstant/Index' 11 import { SpConstants } from 'wdConstant/Index'
12 -import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; 12 +import { ProcessUtils, WDRouterPage, WDRouterRule } from 'wdRouter/Index';
13 import router from '@ohos.router' 13 import router from '@ohos.router'
14 import { postBatchAttentionStatusParams } from 'wdBean/Index'; 14 import { postBatchAttentionStatusParams } from 'wdBean/Index';
15 import { MultiPictureDetailViewModel } from '../../viewmodel/MultiPictureDetailViewModel' 15 import { MultiPictureDetailViewModel } from '../../viewmodel/MultiPictureDetailViewModel'
@@ -180,5 +180,11 @@ export struct RmhTitle { @@ -180,5 +180,11 @@ export struct RmhTitle {
180 } 180 }
181 .width(CommonConstants.FULL_WIDTH) 181 .width(CommonConstants.FULL_WIDTH)
182 .margin({ bottom: 10 }) 182 .margin({ bottom: 10 })
  183 + .onClick(()=>{
  184 +
  185 + // 跳转号主
  186 + ProcessUtils.gotoPeopleShipHomePage( this.rmhInfo?.rmhId,this.rmhInfo?.banControl,this.rmhInfo?.cnMainControl,this.rmhInfo?.userId,this.rmhInfo?.userType)
  187 +
  188 + })
183 } 189 }
184 } 190 }
@@ -86,9 +86,14 @@ export struct Card10Component { @@ -86,9 +86,14 @@ export struct Card10Component {
86 Column() { 86 Column() {
87 ForEach(this.contentDTO.slideShows, (item: slideShows, index: number) => { 87 ForEach(this.contentDTO.slideShows, (item: slideShows, index: number) => {
88 this.timelineItem(item, index) 88 this.timelineItem(item, index)
  89 + if (index < this.contentDTO.slideShows.length - 1) {
  90 + // 在不是最后一个元素的情况下添加分隔符
  91 + Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 0, right: 0 });
  92 + }
89 }) 93 })
90 } 94 }
91 95
  96 +
92 // 底部-查看更多。根据接口返回的isMore判断是否显示查看更多 97 // 底部-查看更多。根据接口返回的isMore判断是否显示查看更多
93 if (this.contentDTO.hasMore == 1) { 98 if (this.contentDTO.hasMore == 1) {
94 Row() { 99 Row() {
@@ -112,6 +112,8 @@ interface picProps { @@ -112,6 +112,8 @@ interface picProps {
112 struct createImg { 112 struct createImg {
113 @Prop fullColumnImgUrls: FullColumnImgUrlDTO[] 113 @Prop fullColumnImgUrls: FullColumnImgUrlDTO[]
114 @State loadImg: boolean = false; 114 @State loadImg: boolean = false;
  115 + @State onePicW: number = 0; // 只有一张图时候图片的宽度
  116 + @State onePicH: number = 0; // 只有一张图时候图片的高度
115 117
116 async aboutToAppear(): Promise<void> { 118 async aboutToAppear(): Promise<void> {
117 if (this.fullColumnImgUrls.length === 4) { // 为了使用栅格布局以便于占用三分之二的宽度,加一个占位 119 if (this.fullColumnImgUrls.length === 4) { // 为了使用栅格布局以便于占用三分之二的宽度,加一个占位
@@ -177,7 +179,7 @@ struct createImg { @@ -177,7 +179,7 @@ struct createImg {
177 Image(this.loadImg ? item.fullUrl || item.url : '') 179 Image(this.loadImg ? item.fullUrl || item.url : '')
178 .backgroundColor(0xf5f5f5) 180 .backgroundColor(0xf5f5f5)
179 .width('100%') 181 .width('100%')
180 - .height(172) 182 + .height(198)
181 .autoResize(true) 183 .autoResize(true)
182 .borderRadius(this.caclImageRadius(index)) 184 .borderRadius(this.caclImageRadius(index))
183 } else if (this.getPicType(item.weight, item.height) === 2) { 185 } else if (this.getPicType(item.weight, item.height) === 2) {
@@ -215,14 +217,20 @@ struct createImg { @@ -215,14 +217,20 @@ struct createImg {
215 } 217 }
216 } else { 218 } else {
217 GridCol({ 219 GridCol({
218 - span: item.landscape === 1 ? 12 : 8 220 + span: this.onePicW > this.onePicH ? 12 : 8
219 }) { 221 }) {
220 Image(this.loadImg ? item.fullUrl : '') 222 Image(this.loadImg ? item.fullUrl : '')
221 .backgroundColor(0xf5f5f5) 223 .backgroundColor(0xf5f5f5)
222 - .aspectRatio(item.landscape === 1 ? 343 / 172 : 228 / 305) 224 + // .aspectRatio(this.onePicW > this.onePicH ? 343 / 198 : 228 / 305)
  225 + .width('100%')
  226 + .autoResize(true)
223 .autoResize(true) 227 .autoResize(true)
224 .borderRadius(this.caclImageRadius(index)) 228 .borderRadius(this.caclImageRadius(index))
225 .opacity(!item.weight && !item.height ? 0 : 1) 229 .opacity(!item.weight && !item.height ? 0 : 1)
  230 + .onComplete((event?) => {
  231 + this.onePicW = event?.width || 0;
  232 + this.onePicH = event?.height || 0;
  233 + })
226 } 234 }
227 } 235 }
228 } else if (this.fullColumnImgUrls.length === 4) { 236 } else if (this.fullColumnImgUrls.length === 4) {
@@ -273,6 +281,8 @@ struct createImg { @@ -273,6 +281,8 @@ struct createImg {
273 .backgroundColor(0xf5f5f5) 281 .backgroundColor(0xf5f5f5)
274 .aspectRatio(1) 282 .aspectRatio(1)
275 .borderRadius(this.caclImageRadius(index)) 283 .borderRadius(this.caclImageRadius(index))
  284 + .width('100%')
  285 + .autoResize(true)
276 if (this.getPicType(item.weight, item.height) !== 3) { 286 if (this.getPicType(item.weight, item.height) !== 3) {
277 Flex({ direction: FlexDirection.Row }) { 287 Flex({ direction: FlexDirection.Row }) {
278 Image($r('app.media.icon_long_pic')) 288 Image($r('app.media.icon_long_pic'))
@@ -53,7 +53,7 @@ export struct Card5Component { @@ -53,7 +53,7 @@ export struct Card5Component {
53 } 53 }
54 ) 54 )
55 .aspectRatio(343 / 225) 55 .aspectRatio(343 / 225)
56 - if (this.titleShowPolicy === 1 || this.titleShowPolicy === null || this.titleShowPolicy === '') { 56 + if (!!this.titleShowPolicy) {
57 Row() 57 Row()
58 .borderRadius( 58 .borderRadius(
59 { 59 {
@@ -88,7 +88,7 @@ export struct Card6Component { @@ -88,7 +88,7 @@ export struct Card6Component {
88 .fontSize(18) 88 .fontSize(18)
89 .lineHeight(27) 89 .lineHeight(27)
90 .fontWeight(FontWeight.Normal) 90 .fontWeight(FontWeight.Normal)
91 - .maxLines(this.contentDTO.appStyle === '6' ? 4 : 2) 91 + .maxLines(this.contentDTO.appStyle === '6' ? 4 : 3)
92 .alignSelf(ItemAlign.Start) 92 .alignSelf(ItemAlign.Start)
93 .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。 93 .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。
94 .textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 && 94 .textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 &&
@@ -107,7 +107,7 @@ export struct Card6Component { @@ -107,7 +107,7 @@ export struct Card6Component {
107 } 107 }
108 108
109 .alignItems(HorizontalAlign.Start) 109 .alignItems(HorizontalAlign.Start)
110 - .height(this.contentDTO.appStyle === CompStyle.Card_13 ? 78 : 156) 110 + .height(this.contentDTO.appStyle === CompStyle.Card_13 ? '' : 156)
111 111
112 112
113 .justifyContent(FlexAlign.SpaceBetween) 113 .justifyContent(FlexAlign.SpaceBetween)
@@ -138,7 +138,8 @@ export struct Card6Component { @@ -138,7 +138,8 @@ export struct Card6Component {
138 }) 138 })
139 139
140 .width(CommonConstants.FULL_WIDTH) 140 .width(CommonConstants.FULL_WIDTH)
141 - .height(this.contentDTO.appStyle === CompStyle.Card_13 ? 106 : 184) .justifyContent(FlexAlign.SpaceBetween) 141 + .height(this.contentDTO.appStyle === CompStyle.Card_13 ? '' : 184)
  142 + .justifyContent(FlexAlign.SpaceBetween)
142 .alignItems(VerticalAlign.Top) 143 .alignItems(VerticalAlign.Top)
143 } 144 }
144 } 145 }
@@ -112,13 +112,12 @@ export struct QualityCommentsComponent { @@ -112,13 +112,12 @@ export struct QualityCommentsComponent {
112 Image($r('app.media.comment_img_banner')).width('100%') 112 Image($r('app.media.comment_img_banner')).width('100%')
113 .height(283) 113 .height(283)
114 // .aspectRatio(375 / 283); 114 // .aspectRatio(375 / 283);
115 - .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])  
116 } 115 }
117 .onAreaChange((oldValue: Area, newValue: Area) => { 116 .onAreaChange((oldValue: Area, newValue: Area) => {
118 - if (Number(oldValue.globalPosition.y) == 0 && Number(newValue.globalPosition.y) > 30) {  
119 - this.firstPositionY = Number(newValue.globalPosition.y)  
120 - return  
121 - } 117 + // if (Number(oldValue.globalPosition.y) == 0 && Number(newValue.globalPosition.y) > 30) {
  118 + // this.firstPositionY = Number(newValue.globalPosition.y)
  119 + // return
  120 + // }
122 Logger.debug(TAG, "oldValue.globalPosition.y : " + oldValue.globalPosition.y) 121 Logger.debug(TAG, "oldValue.globalPosition.y : " + oldValue.globalPosition.y)
123 Logger.debug(TAG, 122 Logger.debug(TAG,
124 "newValue.globalPosition.y : " + newValue.globalPosition.y + `,this.topSafeHeight : ` + this.topSafeHeight) 123 "newValue.globalPosition.y : " + newValue.globalPosition.y + `,this.topSafeHeight : ` + this.topSafeHeight)
@@ -128,9 +127,16 @@ export struct QualityCommentsComponent { @@ -128,9 +127,16 @@ export struct QualityCommentsComponent {
128 persent = 1 127 persent = 1
129 } 128 }
130 this.tileOpacity = persent 129 this.tileOpacity = persent
131 - 130 + this.topOpacityChange()
132 }) 131 })
133 } 132 }
  133 + topOpacityChange(){
  134 + if(this.tileOpacity > 0.8){
  135 + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', })
  136 + }else{
  137 + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff'})
  138 + }
  139 + }
134 140
135 /*透明导航栏*/ 141 /*透明导航栏*/
136 @Builder 142 @Builder
@@ -164,16 +170,20 @@ export struct QualityCommentsComponent { @@ -164,16 +170,20 @@ export struct QualityCommentsComponent {
164 @Builder 170 @Builder
165 TabbarNormal() { 171 TabbarNormal() {
166 Stack({ alignContent: Alignment.Top }) { 172 Stack({ alignContent: Alignment.Top }) {
  173 + //// 默认显示的白色返回按钮
167 Row() { 174 Row() {
168 - }  
169 - .width('100%')  
170 - .height(px2vp(this.topSafeHeight))  
171 - .backgroundColor($r('app.color.white'))  
172 - .opacity(this.tileOpacity)  
173 - .visibility(this.tileOpacity > 0 ? 0 : 1)  
174 - .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP]) 175 + Image($r('app.media.icon_arrow_left_white'))
  176 + .width(24).height(24)
  177 + .objectFit(ImageFit.Auto)
  178 + .margin({ left: 16, top: px2vp(this.topSafeHeight) + (44 - 24)/2})
  179 + .onClick(() => {
  180 + router.back()
  181 + })
  182 + }.width('100%').height(px2vp(this.topSafeHeight) + 44)
  183 + .opacity(1- this.tileOpacity)
175 184
176 - Stack({ alignContent: Alignment.Start }) { 185 + //// 上滑显示的黑色按钮和标题
  186 + Stack({ alignContent: Alignment.Top }) {
177 Row() { 187 Row() {
178 Text('精选评论')// .height('42lpx') 188 Text('精选评论')// .height('42lpx')
179 .maxLines(1) 189 .maxLines(1)
@@ -182,25 +192,25 @@ export struct QualityCommentsComponent { @@ -182,25 +192,25 @@ export struct QualityCommentsComponent {
182 .fontWeight(400) 192 .fontWeight(400)
183 .fontColor($r('app.color.color_222222')) 193 .fontColor($r('app.color.color_222222'))
184 .lineHeight('42lpx') 194 .lineHeight('42lpx')
185 - .visibility(this.tileOpacity < 0.8 ? 1 : 0)  
186 } 195 }
187 - .height(44)  
188 - .width('100%') 196 + .height(44).width('100%')
189 .justifyContent(FlexAlign.Center) 197 .justifyContent(FlexAlign.Center)
190 .alignItems(VerticalAlign.Center) 198 .alignItems(VerticalAlign.Center)
191 - .opacity(this.tileOpacity)  
192 - .backgroundColor($r('app.color.white'))  
193 199
194 - Image(this.tileOpacity < 0.8 ? $r('app.media.icon_arrow_left_white') : $r('app.media.icon_arrow_left'))  
195 - .width(24)  
196 - .height(24) 200 + Row() {
  201 + Image($r('app.media.icon_arrow_left'))
  202 + .width(24).height(24)
197 .objectFit(ImageFit.Auto) 203 .objectFit(ImageFit.Auto)
198 - .margin({ left: 16 }) 204 + .margin({ left: 16, top: (44-24)/2})
199 .onClick(() => { 205 .onClick(() => {
200 router.back() 206 router.back()
201 }) 207 })
202 - 208 + }.height(44).width('100%')
203 } 209 }
  210 + .width('100%').height(px2vp(this.topSafeHeight) + 44)
  211 + .backgroundColor($r('app.color.white'))
  212 + .opacity(this.tileOpacity)
  213 + .padding({top:px2vp(this.topSafeHeight)})
204 } 214 }
205 215
206 } 216 }
@@ -74,6 +74,10 @@ export struct ZhSingleRow02 { @@ -74,6 +74,10 @@ export struct ZhSingleRow02 {
74 } 74 }
75 } 75 }
76 76
  77 + showMore() {
  78 + return !!this.compDTO.dataSourceType || !(this.compDTO?.objectType === '0' || this.compDTO?.objectType === '')
  79 + }
  80 +
77 build() { 81 build() {
78 Column() { 82 Column() {
79 //顶部 83 //顶部
@@ -93,7 +97,7 @@ export struct ZhSingleRow02 { @@ -93,7 +97,7 @@ export struct ZhSingleRow02 {
93 .margin({ right: 8 }) 97 .margin({ right: 8 })
94 }) 98 })
95 } 99 }
96 - if (this.compDTO.operDataList.length >= 2 && !(this.compDTO?.objectType === '0' || this.compDTO?.objectType === '')) { 100 + if (this.compDTO.operDataList.length >= 2 && this.showMore()) {
97 Row() { 101 Row() {
98 Ellipse() 102 Ellipse()
99 .width(2* (this.moreWidth - this.initMoreWidth - 1)) 103 .width(2* (this.moreWidth - this.initMoreWidth - 1))
@@ -104,7 +108,7 @@ export struct ZhSingleRow02 { @@ -104,7 +108,7 @@ export struct ZhSingleRow02 {
104 Column() { 108 Column() {
105 if (this.moreWidth > this.initMoreWidth + 2) { 109 if (this.moreWidth > this.initMoreWidth + 2) {
106 Text(this.moreTips) 110 Text(this.moreTips)
107 - .fontSize(8) 111 + .fontSize(9)
108 .fontColor(0x858585) 112 .fontColor(0x858585)
109 .width(8) 113 .width(8)
110 } 114 }
@@ -182,7 +186,7 @@ export struct ZhSingleRow02 { @@ -182,7 +186,7 @@ export struct ZhSingleRow02 {
182 .padding({ 186 .padding({
183 right: $r('app.float.card_comp_pagePadding_lf'), 187 right: $r('app.float.card_comp_pagePadding_lf'),
184 }) 188 })
185 - .visibility(this.compDTO?.objectType === '0' || this.compDTO?.objectType === '' ? Visibility.None : Visibility.Visible) 189 + .visibility(this.showMore() ? Visibility.Visible : Visibility.None)
186 .onClick(() => { 190 .onClick(() => {
187 if (this.compDTO?.objectType === '11') { 191 if (this.compDTO?.objectType === '11') {
188 ProcessUtils.jumpChannelTab(this.compDTO.objectId, this.compDTO.pageId as string, this.compDTO.objectTitle) 192 ProcessUtils.jumpChannelTab(this.compDTO.objectId, this.compDTO.pageId as string, this.compDTO.objectTitle)
@@ -150,7 +150,10 @@ export struct ZhSingleRow03 { @@ -150,7 +150,10 @@ export struct ZhSingleRow03 {
150 return str.slice(0) 150 return str.slice(0)
151 } 151 }
152 } 152 }
  153 + }
153 154
  155 + showMore() {
  156 + return !!this.compDTO.dataSourceType || !(this.compDTO?.objectType === '0' || this.compDTO?.objectType === '')
154 } 157 }
155 158
156 build() { 159 build() {
@@ -165,7 +168,7 @@ export struct ZhSingleRow03 { @@ -165,7 +168,7 @@ export struct ZhSingleRow03 {
165 this.ItemCard(item) 168 this.ItemCard(item)
166 }) 169 })
167 } 170 }
168 - if (this.compDTO.operDataList.length >= 2 && !(this.compDTO?.objectType === '0' || this.compDTO?.objectType === '')) { 171 + if (this.compDTO.operDataList.length >= 2 && this.showMore()) {
169 Row() { 172 Row() {
170 Ellipse() 173 Ellipse()
171 .width(2* (this.moreWidth - this.initMoreWidth - 1)) 174 .width(2* (this.moreWidth - this.initMoreWidth - 1))
@@ -176,7 +179,7 @@ export struct ZhSingleRow03 { @@ -176,7 +179,7 @@ export struct ZhSingleRow03 {
176 Column() { 179 Column() {
177 if (this.moreWidth > this.initMoreWidth + 2) { 180 if (this.moreWidth > this.initMoreWidth + 2) {
178 Text(this.moreTips) 181 Text(this.moreTips)
179 - .fontSize(8) 182 + .fontSize(9)
180 .fontColor(0x858585) 183 .fontColor(0x858585)
181 .width(8) 184 .width(8)
182 } 185 }
@@ -401,7 +404,7 @@ export struct ZhSingleRow03 { @@ -401,7 +404,7 @@ export struct ZhSingleRow03 {
401 .fontWeight(600) 404 .fontWeight(600)
402 } 405 }
403 406
404 - if (!(this.compDTO?.objectType === '0' || this.compDTO?.objectType === '')) { 407 + if (this.showMore()) {
405 Row() { 408 Row() {
406 Text("更多") 409 Text("更多")
407 .fontSize($r("app.float.font_size_14")) 410 .fontSize($r("app.float.font_size_14"))
@@ -44,10 +44,14 @@ export struct ZhSingleRow04 { @@ -44,10 +44,14 @@ export struct ZhSingleRow04 {
44 .onClick(() => { 44 .onClick(() => {
45 if (this.compDTO?.objectType === '11') { 45 if (this.compDTO?.objectType === '11') {
46 ProcessUtils.jumpChannelTab(this.compDTO.objectId, this.compDTO.pageId as string, this.compDTO.objectTitle) 46 ProcessUtils.jumpChannelTab(this.compDTO.objectId, this.compDTO.pageId as string, this.compDTO.objectTitle)
47 - } else if (this.compDTO?.objectType === '5') {  
48 - ProcessUtils._gotoSpecialTopic(this.compDTO.linkUrl)  
49 - } else if (this.compDTO?.objectType === '6') {  
50 - ProcessUtils._gotoDefaultWeb(this.compDTO.linkUrl) 47 + } else {
  48 + const contentDTO: ContentDTO = {
  49 + objectId: this.compDTO.objectId,
  50 + objectType: this.compDTO.objectType,
  51 + linkUrl: this.compDTO.linkUrl,
  52 + pageId: this.compDTO.pageId
  53 + } as ContentDTO
  54 + ProcessUtils.processPage(contentDTO)
51 } 55 }
52 }) 56 })
53 } 57 }
@@ -84,6 +88,7 @@ export struct ZhSingleRow04 { @@ -84,6 +88,7 @@ export struct ZhSingleRow04 {
84 .scrollBar(BarState.Off) 88 .scrollBar(BarState.Off)
85 .width(CommonConstants.FULL_PARENT) 89 .width(CommonConstants.FULL_PARENT)
86 .height(166) 90 .height(166)
  91 + .edgeEffect(EdgeEffect.None)
87 } 92 }
88 .width(CommonConstants.FULL_WIDTH) 93 .width(CommonConstants.FULL_WIDTH)
89 .backgroundColor($r("app.color.white")) 94 .backgroundColor($r("app.color.white"))
@@ -63,7 +63,6 @@ export struct AppointmentListUI { @@ -63,7 +63,6 @@ export struct AppointmentListUI {
63 .width("100%") 63 .width("100%")
64 .height("100%") 64 .height("100%")
65 .backgroundColor($r('app.color.color_F9F9F9')) 65 .backgroundColor($r('app.color.color_F9F9F9'))
66 - .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])  
67 CustomPullToRefresh({ 66 CustomPullToRefresh({
68 alldata:this.data, 67 alldata:this.data,
69 scroller:this.scroller, 68 scroller:this.scroller,
@@ -120,12 +120,11 @@ export struct FollowFirstTabsComponent{ @@ -120,12 +120,11 @@ export struct FollowFirstTabsComponent{
120 this.listScroller.scrollToIndex(index, true, ScrollAlign.CENTER) 120 this.listScroller.scrollToIndex(index, true, ScrollAlign.CENTER)
121 }) 121 })
122 .width('100%') 122 .width('100%')
123 - .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])  
124 .layoutWeight(1) 123 .layoutWeight(1)
125 .loop(false) 124 .loop(false)
126 .indicator(false) 125 .indicator(false)
127 .effectMode(EdgeEffect.None) 126 .effectMode(EdgeEffect.None)
128 - }.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM]) 127 + }
129 } 128 }
130 }.width('100%') 129 }.width('100%')
131 .height("100%") 130 .height("100%")
@@ -101,7 +101,6 @@ export struct FollowListDetailUI { @@ -101,7 +101,6 @@ export struct FollowListDetailUI {
101 .margin({bottom:"40lpx"}) 101 .margin({bottom:"40lpx"})
102 } 102 }
103 } 103 }
104 - .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])  
105 .edgeEffect(EdgeEffect.None) 104 .edgeEffect(EdgeEffect.None)
106 .cachedCount(5) 105 .cachedCount(5)
107 .padding({ left: '31lpx', right: '31lpx' }) 106 .padding({ left: '31lpx', right: '31lpx' })
@@ -27,7 +27,6 @@ export struct FollowSecondTabsComponent{ @@ -27,7 +27,6 @@ export struct FollowSecondTabsComponent{
27 .width("100%") 27 .width("100%")
28 .height("100%") 28 .height("100%")
29 .backgroundColor($r('app.color.color_transparent')) 29 .backgroundColor($r('app.color.color_transparent'))
30 - .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])  
31 30
32 FollowListDetailUI({creatorDirectoryId:this.data[this.firstIndex].id,type:1}) 31 FollowListDetailUI({creatorDirectoryId:this.data[this.firstIndex].id,type:1})
33 .height("100%") 32 .height("100%")
@@ -40,7 +39,6 @@ export struct FollowSecondTabsComponent{ @@ -40,7 +39,6 @@ export struct FollowSecondTabsComponent{
40 .width("100%") 39 .width("100%")
41 .height("100%") 40 .height("100%")
42 .backgroundColor($r('app.color.color_transparent')) 41 .backgroundColor($r('app.color.color_transparent'))
43 - .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])  
44 42
45 this.FollowSecondUI() 43 this.FollowSecondUI()
46 }.width("100%") 44 }.width("100%")
@@ -50,7 +48,6 @@ export struct FollowSecondTabsComponent{ @@ -50,7 +48,6 @@ export struct FollowSecondTabsComponent{
50 } 48 }
51 .width('100%') 49 .width('100%')
52 .layoutWeight(1) 50 .layoutWeight(1)
53 - .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])  
54 } 51 }
55 52
56 @Builder FollowSecondUI(){ 53 @Builder FollowSecondUI(){
@@ -89,7 +86,6 @@ export struct FollowSecondTabsComponent{ @@ -89,7 +86,6 @@ export struct FollowSecondTabsComponent{
89 .effectMode(EdgeEffect.None) 86 .effectMode(EdgeEffect.None)
90 .height('100%') 87 .height('100%')
91 .layoutWeight(1) 88 .layoutWeight(1)
92 - .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])  
93 }.width('100%') 89 }.width('100%')
94 } 90 }
95 91
@@ -122,7 +122,6 @@ export struct FollowThirdTabsComponent{ @@ -122,7 +122,6 @@ export struct FollowThirdTabsComponent{
122 }) 122 })
123 .width('100%') 123 .width('100%')
124 .layoutWeight(1) 124 .layoutWeight(1)
125 - .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])  
126 } 125 }
127 } 126 }
128 127
1 -import { DateTimeUtils, StringUtils, ToastUtils } from 'wdKit/Index' 1 +import { DateTimeUtils } from 'wdKit/Index'
2 import { WDRouterPage, WDRouterRule } from 'wdRouter/Index' 2 import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'
3 import { Remark, WDMessageCenterMessageType } from '../../../model/InteractMessageModel' 3 import { Remark, WDMessageCenterMessageType } from '../../../model/InteractMessageModel'
4 import MinePageDatasModel from '../../../model/MinePageDatasModel' 4 import MinePageDatasModel from '../../../model/MinePageDatasModel'
@@ -7,7 +7,6 @@ import { CustomPullToRefresh } from '../../reusable/CustomPullToRefresh' @@ -7,7 +7,6 @@ import { CustomPullToRefresh } from '../../reusable/CustomPullToRefresh'
7 import { CustomTitleUI } from '../../reusable/CustomTitleUI' 7 import { CustomTitleUI } from '../../reusable/CustomTitleUI'
8 import { MessageListItemUI } from './MessageListItemUI' 8 import { MessageListItemUI } from './MessageListItemUI'
9 import {TrackingButton,TrackConstants}from 'wdTracking/Index' 9 import {TrackingButton,TrackConstants}from 'wdTracking/Index'
10 -import TrackingPageBrowseUtils from '../../../utils/TrackingPageBrowseUtils'  
11 10
12 const TAG = "MessageListUI" 11 const TAG = "MessageListUI"
13 12
@@ -57,6 +57,12 @@ export struct SubscribeMessageComponent{ @@ -57,6 +57,12 @@ export struct SubscribeMessageComponent{
57 } 57 }
58 } 58 }
59 } else { 59 } else {
  60 + Stack(){
  61 + Row()
  62 + .width("100%")
  63 + .height("100%")
  64 + .backgroundColor($r('app.color.color_F9F9F9'))
  65 +
60 CustomPullToRefresh({ 66 CustomPullToRefresh({
61 alldata:this.data, 67 alldata:this.data,
62 scroller:this.scroller, 68 scroller:this.scroller,
@@ -83,7 +89,8 @@ export struct SubscribeMessageComponent{ @@ -83,7 +89,8 @@ export struct SubscribeMessageComponent{
83 .width('100%') 89 .width('100%')
84 } 90 }
85 } 91 }
86 - .backgroundColor($r('app.color.color_F9F9F9')) 92 + }
  93 + .backgroundColor($r('app.color.color_transparent'))
87 .height('100%') 94 .height('100%')
88 .width('100%') 95 .width('100%')
89 } 96 }
@@ -9,6 +9,9 @@ const TAG = "AppointmentListPage" @@ -9,6 +9,9 @@ const TAG = "AppointmentListPage"
9 struct AppointmentListPage { 9 struct AppointmentListPage {
10 pageShowTime:number = 0; 10 pageShowTime:number = 0;
11 pageHideTime:number = 0; 11 pageHideTime:number = 0;
  12 + @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
  13 + @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
  14 +
12 15
13 onPageShow() { 16 onPageShow() {
14 this.pageShowTime = DateTimeUtils.getTimeStamp() 17 this.pageShowTime = DateTimeUtils.getTimeStamp()
@@ -23,7 +26,12 @@ struct AppointmentListPage { @@ -23,7 +26,12 @@ struct AppointmentListPage {
23 26
24 build() { 27 build() {
25 Column(){ 28 Column(){
  29 + Column(){
26 AppointmentListUI() 30 AppointmentListUI()
27 } 31 }
  32 + }.width("100%")
  33 + .height("100%")
  34 + .padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)})
  35 +
28 } 36 }
29 } 37 }
@@ -7,6 +7,7 @@ import { TrackConstants, @@ -7,6 +7,7 @@ import { TrackConstants,
7 TrackingButton, 7 TrackingButton,
8 TrackingContent, TrackingPageBrowse, TrackParamConvert } from 'wdTracking/Index'; 8 TrackingContent, TrackingPageBrowse, TrackParamConvert } from 'wdTracking/Index';
9 import { WDShare } from 'wdShare/Index'; 9 import { WDShare } from 'wdShare/Index';
  10 +import { hasClicked, persistentStorage } from '../../utils/persistentStorage';
10 11
11 const TAG: string = 'CardView'; 12 const TAG: string = 'CardView';
12 13
@@ -393,6 +394,7 @@ export struct MasonryLayout01CardView { @@ -393,6 +394,7 @@ export struct MasonryLayout01CardView {
393 export struct PaperSingleColumn999CardView { 394 export struct PaperSingleColumn999CardView {
394 private item: ContentDTO = new ContentDTO(); 395 private item: ContentDTO = new ContentDTO();
395 private index: number = -1; 396 private index: number = -1;
  397 + @State isRead: boolean = false;//已读状态
396 @State interactData: InteractDataDTO = {} as InteractDataDTO; 398 @State interactData: InteractDataDTO = {} as InteractDataDTO;
397 @Consume @Watch('onChangeCommentList') commentList: InteractDataDTO[] 399 @Consume @Watch('onChangeCommentList') commentList: InteractDataDTO[]
398 400
@@ -533,7 +535,7 @@ export struct PaperSingleColumn999CardView { @@ -533,7 +535,7 @@ export struct PaperSingleColumn999CardView {
533 } 535 }
534 if (this.item?.newsSummary) { 536 if (this.item?.newsSummary) {
535 Text(this.item?.newsSummary) 537 Text(this.item?.newsSummary)
536 - .fontColor('#6666666') 538 + .fontColor(this.isRead ? 0x848484 : '#222222')
537 .fontSize(14) 539 .fontSize(14)
538 .padding({ top: 10 }) 540 .padding({ top: 10 })
539 .alignSelf(ItemAlign.Start) 541 .alignSelf(ItemAlign.Start)
@@ -599,6 +601,8 @@ export struct PaperSingleColumn999CardView { @@ -599,6 +601,8 @@ export struct PaperSingleColumn999CardView {
599 .margin({ bottom: 10, left: 12, right: 12 }) 601 .margin({ bottom: 10, left: 12, right: 12 })
600 .borderRadius(4) 602 .borderRadius(4)
601 .onClick(() => { 603 .onClick(() => {
  604 + this.isRead = true
  605 + persistentStorage(this.item.objectId);
602 ProcessUtils.processPage(this.item) 606 ProcessUtils.processPage(this.item)
603 TrackingContent.common(TrackConstants.EventType.Click,TrackConstants.SummaryType.MorningAndEveningNews,TrackConstants.SummaryType.MorningAndEveningNews,TrackParamConvert.program(this.item)) 607 TrackingContent.common(TrackConstants.EventType.Click,TrackConstants.SummaryType.MorningAndEveningNews,TrackConstants.SummaryType.MorningAndEveningNews,TrackParamConvert.program(this.item))
604 }).onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => { 608 }).onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => {
@@ -610,6 +614,7 @@ export struct PaperSingleColumn999CardView { @@ -610,6 +614,7 @@ export struct PaperSingleColumn999CardView {
610 614
611 aboutToAppear(): void { 615 aboutToAppear(): void {
612 this.onChangeCommentList() 616 this.onChangeCommentList()
  617 + this.isRead = hasClicked(this.item.objectId)
613 } 618 }
614 619
615 onChangeCommentList() { 620 onChangeCommentList() {
@@ -19,7 +19,8 @@ struct EditUserInfoPage { @@ -19,7 +19,8 @@ struct EditUserInfoPage {
19 @State headerImg: string = '' 19 @State headerImg: string = ''
20 @State dataSource: AreaListModel[] = [] 20 @State dataSource: AreaListModel[] = []
21 @State currentUserInfo: editModel = new editModel() 21 @State currentUserInfo: editModel = new editModel()
22 - @State bottomSafeHeight: number = 0; 22 + @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
  23 + @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
23 24
24 dialogController: CustomDialogController = new CustomDialogController({ 25 dialogController: CustomDialogController = new CustomDialogController({
25 builder: AreaPickerDialog({dataSource:this.dataSource, 26 builder: AreaPickerDialog({dataSource:this.dataSource,
@@ -34,10 +35,7 @@ struct EditUserInfoPage { @@ -34,10 +35,7 @@ struct EditUserInfoPage {
34 }), 35 }),
35 alignment: DialogAlignment.Bottom, 36 alignment: DialogAlignment.Bottom,
36 customStyle: true, 37 customStyle: true,
37 - offset: {  
38 - dx: 0,  
39 - dy: -this.bottomSafeHeight  
40 - }, 38 + closeAnimation:{duration:0}
41 }) 39 })
42 40
43 dateDialogController: CustomDialogController = new CustomDialogController({ 41 dateDialogController: CustomDialogController = new CustomDialogController({
@@ -53,10 +51,7 @@ struct EditUserInfoPage { @@ -53,10 +51,7 @@ struct EditUserInfoPage {
53 }), 51 }),
54 alignment: DialogAlignment.Bottom, 52 alignment: DialogAlignment.Bottom,
55 customStyle: true, 53 customStyle: true,
56 - offset: {  
57 - dx: 0,  
58 - dy: -this.bottomSafeHeight  
59 - }, 54 + closeAnimation:{duration:0}
60 }) 55 })
61 56
62 sexDialogController: CustomDialogController = new CustomDialogController({ 57 sexDialogController: CustomDialogController = new CustomDialogController({
@@ -69,15 +64,10 @@ struct EditUserInfoPage { @@ -69,15 +64,10 @@ struct EditUserInfoPage {
69 }), 64 }),
70 alignment: DialogAlignment.Bottom, 65 alignment: DialogAlignment.Bottom,
71 customStyle: true, 66 customStyle: true,
72 - offset: {  
73 - dx: 0,  
74 - dy: -this.bottomSafeHeight  
75 - }, 67 + closeAnimation:{duration:0}
76 }) 68 })
77 69
78 - async aboutToAppear() {  
79 - let windowHight: window.Window = await window.getLastWindow(getContext(this));  
80 - this.bottomSafeHeight = px2vp(windowHight.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM).bottomRect.height) 70 + aboutToAppear() {
81 this.getAccountOwnerInfo() 71 this.getAccountOwnerInfo()
82 this.getAreaList() 72 this.getAreaList()
83 } 73 }
@@ -142,6 +132,7 @@ struct EditUserInfoPage { @@ -142,6 +132,7 @@ struct EditUserInfoPage {
142 } 132 }
143 .width('100%') 133 .width('100%')
144 .height('100%') 134 .height('100%')
  135 + .padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)})
145 } 136 }
146 137
147 @Builder 138 @Builder
@@ -9,6 +9,8 @@ struct EditUserIntroductionPage { @@ -9,6 +9,8 @@ struct EditUserIntroductionPage {
9 @State textColor : string = '#222222' 9 @State textColor : string = '#222222'
10 @State introduction: string = '' 10 @State introduction: string = ''
11 @State params:editModelParams = router.getParams() as editModelParams; 11 @State params:editModelParams = router.getParams() as editModelParams;
  12 + @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
  13 + @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
12 build() { 14 build() {
13 Column(){ 15 Column(){
14 CustomTitleUI({titleName:'修改简介'}) 16 CustomTitleUI({titleName:'修改简介'})
@@ -63,6 +65,7 @@ struct EditUserIntroductionPage { @@ -63,6 +65,7 @@ struct EditUserIntroductionPage {
63 this.updateEditModel() 65 this.updateEditModel()
64 }) 66 })
65 } 67 }
  68 + .padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)})
66 } 69 }
67 70
68 71
@@ -12,6 +12,8 @@ struct EditUserNikeNamePage { @@ -12,6 +12,8 @@ struct EditUserNikeNamePage {
12 @State textColor : string = '#222222' 12 @State textColor : string = '#222222'
13 @State nikeName: string = '' 13 @State nikeName: string = ''
14 @State params:editModelParams = router.getParams() as editModelParams; 14 @State params:editModelParams = router.getParams() as editModelParams;
  15 + @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
  16 + @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
15 build() { 17 build() {
16 Column(){ 18 Column(){
17 CustomTitleUI({titleName:'修改昵称'}) 19 CustomTitleUI({titleName:'修改昵称'})
@@ -66,7 +68,7 @@ struct EditUserNikeNamePage { @@ -66,7 +68,7 @@ struct EditUserNikeNamePage {
66 ///内部更新 68 ///内部更新
67 this.updateEditModel() 69 this.updateEditModel()
68 }) 70 })
69 - } 71 + }.padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)})
70 } 72 }
71 73
72 async updateEditModel(){ 74 async updateEditModel(){
@@ -11,6 +11,8 @@ struct FollowListPage { @@ -11,6 +11,8 @@ struct FollowListPage {
11 @State curIndex: string = '0'; 11 @State curIndex: string = '0';
12 pageShowTime:number = 0; 12 pageShowTime:number = 0;
13 pageHideTime:number = 0; 13 pageHideTime:number = 0;
  14 + @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
  15 + @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
14 16
15 onPageShow() { 17 onPageShow() {
16 this.curIndex = this.params?.['index']; 18 this.curIndex = this.params?.['index'];
@@ -25,6 +27,7 @@ struct FollowListPage { @@ -25,6 +27,7 @@ struct FollowListPage {
25 } 27 }
26 28
27 build() { 29 build() {
  30 + Column(){
28 Column() { 31 Column() {
29 //Tab 详情 32 //Tab 详情
30 FollowFirstTabsComponent({changeIndex:Number(this.curIndex)}) 33 FollowFirstTabsComponent({changeIndex:Number(this.curIndex)})
@@ -32,5 +35,8 @@ struct FollowListPage { @@ -32,5 +35,8 @@ struct FollowListPage {
32 .backgroundColor($r('app.color.white')) 35 .backgroundColor($r('app.color.white'))
33 .height('100%') 36 .height('100%')
34 .width('100%') 37 .width('100%')
  38 + }.width("100%")
  39 + .height("100%")
  40 + .padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)})
35 } 41 }
36 } 42 }
@@ -20,6 +20,8 @@ struct InteractMessagePage { @@ -20,6 +20,8 @@ struct InteractMessagePage {
20 private scroller: Scroller = new Scroller(); 20 private scroller: Scroller = new Scroller();
21 @State likeNum: number = 0 21 @State likeNum: number = 0
22 @State currentPage: number = 1; 22 @State currentPage: number = 1;
  23 + @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
  24 + @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
23 25
24 aboutToAppear(){ 26 aboutToAppear(){
25 this.getData() 27 this.getData()
@@ -58,6 +60,8 @@ struct InteractMessagePage { @@ -58,6 +60,8 @@ struct InteractMessagePage {
58 } 60 }
59 .width(CommonConstants.FULL_WIDTH) 61 .width(CommonConstants.FULL_WIDTH)
60 .height(CommonConstants.FULL_HEIGHT) 62 .height(CommonConstants.FULL_HEIGHT)
  63 + .padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)})
  64 +
61 } 65 }
62 66
63 @Builder ListLayout() { 67 @Builder ListLayout() {
@@ -62,6 +62,8 @@ export struct MinePageComponent { @@ -62,6 +62,8 @@ export struct MinePageComponent {
62 @StorageProp('currentBreakpoint') @Watch("currentChanged")currentBreakpoint: string = 'sm'; 62 @StorageProp('currentBreakpoint') @Watch("currentChanged")currentBreakpoint: string = 'sm';
63 private breakpointSystem = new BreakpointSystem(); 63 private breakpointSystem = new BreakpointSystem();
64 @State percent:number = 1 64 @State percent:number = 1
  65 + @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
  66 + @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
65 67
66 currentChanged(){ 68 currentChanged(){
67 if(this.currentBreakpoint == "md" || this.currentBreakpoint == "lg"){ 69 if(this.currentBreakpoint == "md" || this.currentBreakpoint == "lg"){
@@ -153,6 +155,7 @@ export struct MinePageComponent { @@ -153,6 +155,7 @@ export struct MinePageComponent {
153 } 155 }
154 156
155 build() { 157 build() {
  158 + Column(){
156 Scroll(this.scroller){ 159 Scroll(this.scroller){
157 Stack(){ 160 Stack(){
158 Image($r('app.media.mine_head_bg')) 161 Image($r('app.media.mine_head_bg'))
@@ -167,6 +170,10 @@ export struct MinePageComponent { @@ -167,6 +170,10 @@ export struct MinePageComponent {
167 .backgroundColor($r('app.color.color_F9F9F9')) 170 .backgroundColor($r('app.color.color_F9F9F9'))
168 .scrollable(ScrollDirection.Vertical) 171 .scrollable(ScrollDirection.Vertical)
169 .scrollBar(BarState.Off) 172 .scrollBar(BarState.Off)
  173 +
  174 + }.width("100%")
  175 + .height("100%")
  176 + .padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)})
170 } 177 }
171 178
172 179
@@ -34,6 +34,8 @@ struct MyCollectionListPage { @@ -34,6 +34,8 @@ struct MyCollectionListPage {
34 @State currentPage: number = 1; 34 @State currentPage: number = 1;
35 private scroller: Scroller = new Scroller(); 35 private scroller: Scroller = new Scroller();
36 emptyType: WDViewDefaultType = WDViewDefaultType.WDViewDefaultType_Default 36 emptyType: WDViewDefaultType = WDViewDefaultType.WDViewDefaultType_Default
  37 + @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
  38 + @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
37 39
38 dialogController: CustomDialogController = new CustomDialogController({ 40 dialogController: CustomDialogController = new CustomDialogController({
39 builder: MyCustomDialog({ 41 builder: MyCustomDialog({
@@ -120,6 +122,8 @@ struct MyCollectionListPage { @@ -120,6 +122,8 @@ struct MyCollectionListPage {
120 .backgroundColor('#FFFFFF') 122 .backgroundColor('#FFFFFF')
121 .width(CommonConstants.FULL_WIDTH) 123 .width(CommonConstants.FULL_WIDTH)
122 .height(CommonConstants.FULL_HEIGHT) 124 .height(CommonConstants.FULL_HEIGHT)
  125 + .padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)})
  126 +
123 } 127 }
124 128
125 @Builder ListLayout() { 129 @Builder ListLayout() {
@@ -132,6 +136,7 @@ struct MyCollectionListPage { @@ -132,6 +136,7 @@ struct MyCollectionListPage {
132 // 加载更多 136 // 加载更多
133 ListItem() { 137 ListItem() {
134 if (this.browSingModel.hasMore === false) NoMoreLayout() 138 if (this.browSingModel.hasMore === false) NoMoreLayout()
  139 + //Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 0, right: 0 });
135 } 140 }
136 } 141 }
137 .scrollBar(BarState.Off) 142 .scrollBar(BarState.Off)
@@ -148,17 +153,18 @@ struct MyCollectionListPage { @@ -148,17 +153,18 @@ struct MyCollectionListPage {
148 selectCallback:(isOn)=>{ 153 selectCallback:(isOn)=>{
149 this.addCompDTO(isOn,compDTO) 154 this.addCompDTO(isOn,compDTO)
150 } 155 }
151 - })  
152 - .margin({left:16}) 156 + }).margin({left:16})
153 } 157 }
154 Column() { 158 Column() {
155 BigPicCardComponent({compDTO:new CompDTO,contentDTO:compDTO,pageId:TrackConstants.PageName.My_Collect,pageName:TrackConstants.PageName.My_Collect}) 159 BigPicCardComponent({compDTO:new CompDTO,contentDTO:compDTO,pageId:TrackConstants.PageName.My_Collect,pageName:TrackConstants.PageName.My_Collect})
  160 + Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 });
156 } 161 }
157 }.onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => { 162 }.onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => {
158 - if (isVisible) { 163 + if (isVisible && !this.isEditState) {
159 TrackingContent.common(TrackConstants.EventType.Show, TrackConstants.PageName.My_Collect,TrackConstants.PageName.My_Collect, TrackParamConvert.program(compDTO)) 164 TrackingContent.common(TrackConstants.EventType.Show, TrackConstants.PageName.My_Collect,TrackConstants.PageName.My_Collect, TrackParamConvert.program(compDTO))
160 } 165 }
161 }) 166 })
  167 +
162 } 168 }
163 169
164 170
@@ -287,6 +293,7 @@ struct MyCollectionListPage { @@ -287,6 +293,7 @@ struct MyCollectionListPage {
287 compDTO.interactData = this.commentList[index] 293 compDTO.interactData = this.commentList[index]
288 datas.push(compDTO) 294 datas.push(compDTO)
289 } 295 }
  296 + this.allDatas = []
290 this.allDatas.push(...datas) 297 this.allDatas.push(...datas)
291 } catch (exception) { 298 } catch (exception) {
292 } 299 }
@@ -76,7 +76,6 @@ export struct PageComponent { @@ -76,7 +76,6 @@ export struct PageComponent {
76 onActionEnd(this.pageModel, this.pageAdvModel) 76 onActionEnd(this.pageModel, this.pageAdvModel)
77 }) 77 })
78 ) 78 )
79 - .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])  
80 79
81 } 80 }
82 81
@@ -47,7 +47,7 @@ struct PeopleShipHomePage { @@ -47,7 +47,7 @@ struct PeopleShipHomePage {
47 } 47 }
48 48
49 onPageHide(): void { 49 onPageHide(): void {
50 - WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', }) 50 + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000'})
51 } 51 }
52 52
53 topOpacityChange(){ 53 topOpacityChange(){
@@ -70,7 +70,6 @@ struct PeopleShipHomePage { @@ -70,7 +70,6 @@ struct PeopleShipHomePage {
70 .objectRepeat(ImageRepeat.NoRepeat) 70 .objectRepeat(ImageRepeat.NoRepeat)
71 .backgroundColor(Color.White) 71 .backgroundColor(Color.White)
72 .visibility(this.isLoading ? Visibility.None : Visibility.Visible) 72 .visibility(this.isLoading ? Visibility.None : Visibility.Visible)
73 - .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])  
74 73
75 Row() 74 Row()
76 .height(px2vp(this.topSafeHeight)) 75 .height(px2vp(this.topSafeHeight))
@@ -78,7 +77,6 @@ struct PeopleShipHomePage { @@ -78,7 +77,6 @@ struct PeopleShipHomePage {
78 .backgroundColor($r('app.color.white')) 77 .backgroundColor($r('app.color.white'))
79 .visibility(this.topOpacity > 0 ? Visibility.Visible : Visibility.None) 78 .visibility(this.topOpacity > 0 ? Visibility.Visible : Visibility.None)
80 .opacity(this.topOpacity ) 79 .opacity(this.topOpacity )
81 - .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])  
82 } 80 }
83 81
84 Column(){ 82 Column(){
@@ -141,10 +139,10 @@ struct PeopleShipHomePage { @@ -141,10 +139,10 @@ struct PeopleShipHomePage {
141 }) 139 })
142 } 140 }
143 } 141 }
144 - .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])  
145 .alignItems(HorizontalAlign.Start) 142 .alignItems(HorizontalAlign.Start)
146 .justifyContent(FlexAlign.Start) 143 .justifyContent(FlexAlign.Start)
147 .width('100%') 144 .width('100%')
  145 + .margin({top:px2vp(this.topSafeHeight)})
148 } 146 }
149 .width('100%') 147 .width('100%')
150 }else{ 148 }else{
@@ -165,7 +163,6 @@ struct PeopleShipHomePage { @@ -165,7 +163,6 @@ struct PeopleShipHomePage {
165 } 163 }
166 164
167 aboutToAppear() { 165 aboutToAppear() {
168 - WindowModel.shared.setWindowLayoutFullScreen(false)  
169 this.getData() 166 this.getData()
170 } 167 }
171 168
@@ -22,6 +22,8 @@ export struct PrivacySettingPage { @@ -22,6 +22,8 @@ export struct PrivacySettingPage {
22 @StorageProp('currentBreakpoint') @Watch("currentChanged")currentBreakpoint: string = 'sm'; 22 @StorageProp('currentBreakpoint') @Watch("currentChanged")currentBreakpoint: string = 'sm';
23 private breakpointSystem = new BreakpointSystem(); 23 private breakpointSystem = new BreakpointSystem();
24 @State percent:number = 1 24 @State percent:number = 1
  25 + @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
  26 + @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
25 27
26 currentChanged(){ 28 currentChanged(){
27 if(this.currentBreakpoint == "md" || this.currentBreakpoint == "lg"){ 29 if(this.currentBreakpoint == "md" || this.currentBreakpoint == "lg"){
@@ -76,6 +78,7 @@ export struct PrivacySettingPage { @@ -76,6 +78,7 @@ export struct PrivacySettingPage {
76 78
77 build() { 79 build() {
78 Column(){ 80 Column(){
  81 + Column(){
79 TitleBackComponent({title:"隐私设置"}) 82 TitleBackComponent({title:"隐私设置"})
80 83
81 //滑动区域 84 //滑动区域
@@ -83,6 +86,9 @@ export struct PrivacySettingPage { @@ -83,6 +86,9 @@ export struct PrivacySettingPage {
83 }.backgroundColor('#F8F8F8') 86 }.backgroundColor('#F8F8F8')
84 .width("100%") 87 .width("100%")
85 .height("100%") 88 .height("100%")
  89 + }.width("100%")
  90 + .height("100%")
  91 + .padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)})
86 92
87 } 93 }
88 94
@@ -7,6 +7,8 @@ import { AboutPageUI } from '../setting/AboutPageUI'; @@ -7,6 +7,8 @@ import { AboutPageUI } from '../setting/AboutPageUI';
7 struct SettingAboutPage { 7 struct SettingAboutPage {
8 pageShowTime:number = 0; 8 pageShowTime:number = 0;
9 pageHideTime:number = 0; 9 pageHideTime:number = 0;
  10 + @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
  11 + @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
10 12
11 onPageShow() { 13 onPageShow() {
12 this.pageShowTime = DateTimeUtils.getTimeStamp() 14 this.pageShowTime = DateTimeUtils.getTimeStamp()
@@ -22,7 +24,12 @@ struct SettingAboutPage { @@ -22,7 +24,12 @@ struct SettingAboutPage {
22 24
23 build() { 25 build() {
24 Column(){ 26 Column(){
  27 + Column(){
25 AboutPageUI() 28 AboutPageUI()
26 }.backgroundColor($r('app.color.white')) 29 }.backgroundColor($r('app.color.white'))
  30 + }.width("100%")
  31 + .height("100%")
  32 + .padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)})
  33 +
27 } 34 }
28 } 35 }
@@ -16,6 +16,8 @@ struct SettingPage { @@ -16,6 +16,8 @@ struct SettingPage {
16 16
17 pageShowSettingTime:number = 0; 17 pageShowSettingTime:number = 0;
18 pageHideSettingTime:number = 0; 18 pageHideSettingTime:number = 0;
  19 + @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
  20 + @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
19 21
20 22
21 onPageShow() { 23 onPageShow() {
@@ -44,6 +46,7 @@ struct SettingPage { @@ -44,6 +46,7 @@ struct SettingPage {
44 } 46 }
45 47
46 build() { 48 build() {
  49 + Column(){
47 Column() { 50 Column() {
48 if (this.pageType == 'mainSetting') { 51 if (this.pageType == 'mainSetting') {
49 MineSettingComponent() 52 MineSettingComponent()
@@ -52,6 +55,10 @@ struct SettingPage { @@ -52,6 +55,10 @@ struct SettingPage {
52 } 55 }
53 }.setFullWidth() 56 }.setFullWidth()
54 .backgroundColor($r("app.color.white")) 57 .backgroundColor($r("app.color.white"))
  58 + }.width("100%")
  59 + .height("100%")
  60 + .padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)})
  61 +
55 } 62 }
56 63
57 // 私有方法 64 // 私有方法
@@ -22,6 +22,7 @@ const storage = LocalStorage.getShared(); @@ -22,6 +22,7 @@ const storage = LocalStorage.getShared();
22 @Entry(storage) 22 @Entry(storage)
23 @Component 23 @Component
24 export struct TopNavigationComponentNew { 24 export struct TopNavigationComponentNew {
  25 + private topRectHeight: string = AppStorage.get<number>('topSafeHeight') + 'px';
25 /** 26 /**
26 * @deprecated 27 * @deprecated
27 */ 28 */
@@ -85,6 +86,7 @@ export struct TopNavigationComponentNew { @@ -85,6 +86,7 @@ export struct TopNavigationComponentNew {
85 navIndex: index, 86 navIndex: index,
86 pageId: navItem?.pageId + '', 87 pageId: navItem?.pageId + '',
87 channelId: navItem?.channelId + '', 88 channelId: navItem?.channelId + '',
  89 + autoRefresh: this.autoRefresh2Page
88 }) 90 })
89 } else 91 } else
90 if (!this.isBroadcast(navItem) && !this.isLayout(navItem)) { 92 if (!this.isBroadcast(navItem) && !this.isLayout(navItem)) {
@@ -111,9 +113,11 @@ export struct TopNavigationComponentNew { @@ -111,9 +113,11 @@ export struct TopNavigationComponentNew {
111 'middle': { 'anchor': '__container__', 'align': HorizontalAlign.Center }, 113 'middle': { 'anchor': '__container__', 'align': HorizontalAlign.Center },
112 'bottom': { 'anchor': '__container__', 'align': VerticalAlign.Bottom } 114 'bottom': { 'anchor': '__container__', 'align': VerticalAlign.Bottom }
113 }) 115 })
114 - .onChange((index) => {  
115 - Logger.info(TAG, `onChange index : ${index}`);  
116 - 116 + .onAnimationStart((curIndex: number, index: number)=>{
  117 + Logger.info(TAG, `onAnimationStart ${curIndex} ${index}`);
  118 + if (curIndex === index) {
  119 + return
  120 + }
117 if (this.isBroadcastByIndex(index)) { 121 if (this.isBroadcastByIndex(index)) {
118 // 跳转到播报页面 122 // 跳转到播报页面
119 ProcessUtils.gotoBroadcastPage(this.myChannelList[index].pageId) 123 ProcessUtils.gotoBroadcastPage(this.myChannelList[index].pageId)
@@ -131,12 +135,19 @@ export struct TopNavigationComponentNew { @@ -131,12 +135,19 @@ export struct TopNavigationComponentNew {
131 this.currentTopNavSelectedIndex = index; 135 this.currentTopNavSelectedIndex = index;
132 this.changePage(this.currentTopNavSelectedIndex) 136 this.changePage(this.currentTopNavSelectedIndex)
133 } 137 }
134 - 138 + })
  139 + // .onAnimationEnd((index: number)=>{
  140 + // Logger.info(TAG, `onAnimationEnd ${index}`);
  141 + // })
  142 + .onChange((index) => {
  143 + Logger.info(TAG, `onChange index : ${index}`);
135 }) 144 })
136 } 145 }
137 .width('100%') 146 .width('100%')
138 .height('100%') 147 .height('100%')
139 } 148 }
  149 + // 预留状态栏
  150 + .margin({ top: this.topRectHeight })
140 } 151 }
141 152
142 @Builder 153 @Builder
@@ -14,7 +14,6 @@ import { @@ -14,7 +14,6 @@ import {
14 import { ViewType } from 'wdConstant/src/main/ets/enum/ViewType'; 14 import { ViewType } from 'wdConstant/src/main/ets/enum/ViewType';
15 import { channelSkeleton } from '../skeleton/channelSkeleton' 15 import { channelSkeleton } from '../skeleton/channelSkeleton'
16 import { EmptyComponent } from '../view/EmptyComponent'; 16 import { EmptyComponent } from '../view/EmptyComponent';
17 -import { ErrorComponent } from '../view/ErrorComponent';  
18 import { WDRouterPage, WDRouterRule } from 'wdRouter/Index' 17 import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'
19 import MinePageDatasModel from '../../model/MinePageDatasModel'; 18 import MinePageDatasModel from '../../model/MinePageDatasModel';
20 import { FollowListDetailRequestItem } from '../../viewmodel/FollowListDetailRequestItem'; 19 import { FollowListDetailRequestItem } from '../../viewmodel/FollowListDetailRequestItem';
@@ -26,13 +25,14 @@ import PageHelper from '../../viewmodel/PageHelper'; @@ -26,13 +25,14 @@ import PageHelper from '../../viewmodel/PageHelper';
26 import { PeopleShipAttentionContentListTopComponent } from './PeopleShipAttentionContentListTopComponent' 25 import { PeopleShipAttentionContentListTopComponent } from './PeopleShipAttentionContentListTopComponent'
27 import { CardParser } from '../CardParser' 26 import { CardParser } from '../CardParser'
28 import { PeopleShipNoMoreData } from '../reusable/PeopleShipNoMoreData'; 27 import { PeopleShipNoMoreData } from '../reusable/PeopleShipNoMoreData';
29 - 28 +const TAG = 'PeopleShipMainComponent';
30 @Preview 29 @Preview
31 @Component 30 @Component
32 export struct PeopleShipMainComponent { 31 export struct PeopleShipMainComponent {
33 @State private pageModel: PageModel = new PageModel(); 32 @State private pageModel: PageModel = new PageModel();
34 @State private pageAdvModel: PageAdModel = new PageAdModel(); 33 @State private pageAdvModel: PageAdModel = new PageAdModel();
35 - 34 + // 自动刷新通知
  35 + @Prop @Watch('onAutoRefresh') autoRefresh: number = 0
36 navIndex: number = 0; 36 navIndex: number = 0;
37 pageId: string = ""; 37 pageId: string = "";
38 channelId: string = ""; 38 channelId: string = "";
@@ -416,4 +416,13 @@ export struct PeopleShipMainComponent { @@ -416,4 +416,13 @@ export struct PeopleShipMainComponent {
416 } 416 }
417 } 417 }
418 418
  419 + onAutoRefresh(changedPropertyName: string) {
  420 + if (this.navIndex != this.currentTopNavSelectedIndex) {
  421 + return
  422 + }
  423 + // 当前页面,自动刷新数据
  424 + Logger.debug(TAG, 'page onAutoRefresh ' + this.autoRefresh)
  425 + this.currentPage = 1
  426 + this.getData()
  427 + }
419 } 428 }
@@ -206,6 +206,7 @@ export struct PeopleShipHomeArticleListComponent { @@ -206,6 +206,7 @@ export struct PeopleShipHomeArticleListComponent {
206 } 206 }
207 for (const element of listData.list) { 207 for (const element of listData.list) {
208 let contentDTO = new ContentDTO() 208 let contentDTO = new ContentDTO()
  209 + console.info(TAG, 'element.appStyle'+`${element.appStyle}`)
209 contentDTO.appStyle = this.changeCommon(element.appStyle) 210 contentDTO.appStyle = this.changeCommon(element.appStyle)
210 contentDTO.newsTitle = element.title; 211 contentDTO.newsTitle = element.title;
211 contentDTO.newsSummary = element.description; 212 contentDTO.newsSummary = element.description;
@@ -30,7 +30,7 @@ export struct SearchCreatorComponent{ @@ -30,7 +30,7 @@ export struct SearchCreatorComponent{
30 .fontSize('25lpx') 30 .fontSize('25lpx')
31 .fontWeight('400lpx') 31 .fontWeight('400lpx')
32 .lineHeight('35lpx') 32 .lineHeight('35lpx')
33 - .constraintSize({maxWidth:'150lpx'}) 33 + .constraintSize({maxWidth:'125lpx'})
34 .maxLines(1) 34 .maxLines(1)
35 .textOverflow({ overflow: TextOverflow.Ellipsis }) 35 .textOverflow({ overflow: TextOverflow.Ellipsis })
36 }.alignItems(HorizontalAlign.Center) 36 }.alignItems(HorizontalAlign.Center)
@@ -167,7 +167,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent { @@ -167,7 +167,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
167 Column() { 167 Column() {
168 if (this.moreWidth > this.initMoreWidth + 2) { 168 if (this.moreWidth > this.initMoreWidth + 2) {
169 Text(this.moreTips) 169 Text(this.moreTips)
170 - .fontSize(8) 170 + .fontSize(9)
171 .fontColor(0x858585) 171 .fontColor(0x858585)
172 .width(8) 172 .width(8)
173 } 173 }
@@ -190,7 +190,7 @@ export struct LiveHorizontalCardComponent { @@ -190,7 +190,7 @@ export struct LiveHorizontalCardComponent {
190 Column() { 190 Column() {
191 if (this.moreWidth > this.initMoreWidth + 2) { 191 if (this.moreWidth > this.initMoreWidth + 2) {
192 Text(this.moreTips) 192 Text(this.moreTips)
193 - .fontSize(8) 193 + .fontSize(9)
194 .fontColor(0x858585) 194 .fontColor(0x858585)
195 .width(8) 195 .width(8)
196 } 196 }
@@ -158,6 +158,7 @@ export struct OperRowListView { @@ -158,6 +158,7 @@ export struct OperRowListView {
158 console.info(TAG, 'contentDetailData----', JSON.stringify(this.contentDetailData)) 158 console.info(TAG, 'contentDetailData----', JSON.stringify(this.contentDetailData))
159 console.info(TAG, 'likeBean----', JSON.stringify(this.likeBean)) 159 console.info(TAG, 'likeBean----', JSON.stringify(this.likeBean))
160 console.info(TAG, 'this.operationButtonList', JSON.stringify(this.operationButtonList)) 160 console.info(TAG, 'this.operationButtonList', JSON.stringify(this.operationButtonList))
  161 +
161 // 评论需要数据 162 // 评论需要数据
162 /* this.publishCommentModel.targetId = this.contentDetailData.newsId + '' 163 /* this.publishCommentModel.targetId = this.contentDetailData.newsId + ''
163 this.publishCommentModel.targetRelId = this.contentDetailData.reLInfo?.relId + '' 164 this.publishCommentModel.targetRelId = this.contentDetailData.reLInfo?.relId + ''
@@ -240,7 +241,7 @@ export struct OperRowListView { @@ -240,7 +241,7 @@ export struct OperRowListView {
240 .padding({ 241 .padding({
241 top: 10, 242 top: 10,
242 // bottom: 10 243 // bottom: 10
243 - bottom: `${this.bottomSafeHeight}px` 244 + bottom: px2vp(this.bottomSafeHeight)
244 // bottom: 50 245 // bottom: 50
245 }) 246 })
246 } 247 }
1 import router from '@ohos.router' 1 import router from '@ohos.router'
2 -import { DateTimeUtils, NetworkUtil, StringUtils } from 'wdKit'; 2 +import { DateTimeUtils, NetworkUtil, StringUtils, WindowModel } from 'wdKit';
3 import { WDRouterPage, WDRouterRule } from 'wdRouter'; 3 import { WDRouterPage, WDRouterRule } from 'wdRouter';
4 import { editModelParams } from '../model/EditInfoModel'; 4 import { editModelParams } from '../model/EditInfoModel';
5 import { HomePageBottomCommentComponent } from '../components/mine/home/HomePageBottomCommentComponent'; 5 import { HomePageBottomCommentComponent } from '../components/mine/home/HomePageBottomCommentComponent';
@@ -14,7 +14,7 @@ const TAG = "MineHomePage" @@ -14,7 +14,7 @@ const TAG = "MineHomePage"
14 @Entry 14 @Entry
15 @Component 15 @Component
16 struct MineHomePage { 16 struct MineHomePage {
17 - @State tileOpacity: number = 0; 17 + @Watch('topOpacityChange') @State tileOpacity: number = 0;
18 firstPositionY:number = 0; 18 firstPositionY:number = 0;
19 fontColor: string = '#999999' 19 fontColor: string = '#999999'
20 selectedFontColor: string = '#000000' 20 selectedFontColor: string = '#000000'
@@ -38,10 +38,12 @@ struct MineHomePage { @@ -38,10 +38,12 @@ struct MineHomePage {
38 @State isCommentEnter:string = ""; 38 @State isCommentEnter:string = "";
39 @State isConnectNetwork : boolean = NetworkUtil.isNetConnected() 39 @State isConnectNetwork : boolean = NetworkUtil.isNetConnected()
40 @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 40 @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
  41 + @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
41 pageShowTime:number = 0; 42 pageShowTime:number = 0;
42 pageHideTime:number = 0; 43 pageHideTime:number = 0;
43 44
44 onPageShow(): void { 45 onPageShow(): void {
  46 + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff'})
45 this.pageShowTime = DateTimeUtils.getTimeStamp() 47 this.pageShowTime = DateTimeUtils.getTimeStamp()
46 this.getUserInfo() 48 this.getUserInfo()
47 49
@@ -54,7 +56,16 @@ struct MineHomePage { @@ -54,7 +56,16 @@ struct MineHomePage {
54 }, 200); 56 }, 200);
55 } 57 }
56 58
  59 + topOpacityChange(){
  60 + if(this.tileOpacity > 0.8){
  61 + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000'})
  62 + }else{
  63 + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff'})
  64 + }
  65 + }
  66 +
57 onPageHide(): void { 67 onPageHide(): void {
  68 + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000'})
58 this.pageHideTime = DateTimeUtils.getTimeStamp() 69 this.pageHideTime = DateTimeUtils.getTimeStamp()
59 let duration = 0 70 let duration = 0
60 duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000) 71 duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000)
@@ -69,7 +80,6 @@ struct MineHomePage { @@ -69,7 +80,6 @@ struct MineHomePage {
69 .width('100%') 80 .width('100%')
70 .height('355lpx') 81 .height('355lpx')
71 .objectFit(ImageFit.Cover) 82 .objectFit(ImageFit.Cover)
72 - .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])  
73 83
74 Row() 84 Row()
75 .height(px2vp(this.topSafeHeight)) 85 .height(px2vp(this.topSafeHeight))
@@ -77,7 +87,6 @@ struct MineHomePage { @@ -77,7 +87,6 @@ struct MineHomePage {
77 .backgroundColor($r('app.color.white')) 87 .backgroundColor($r('app.color.white'))
78 .visibility(this.tileOpacity > 0 ? 0 : 1) 88 .visibility(this.tileOpacity > 0 ? 0 : 1)
79 .opacity(this.tileOpacity ) 89 .opacity(this.tileOpacity )
80 - .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])  
81 } 90 }
82 91
83 Column(){ 92 Column(){
@@ -133,6 +142,7 @@ struct MineHomePage { @@ -133,6 +142,7 @@ struct MineHomePage {
133 .backgroundImageSize(ImageSize.Cover) 142 .backgroundImageSize(ImageSize.Cover)
134 .padding({left:"17lpx",right:"8lpx"}) 143 .padding({left:"17lpx",right:"8lpx"})
135 .height('35lpx') 144 .height('35lpx')
  145 + .borderRadius({topRight:2,bottomRight:2})
136 } 146 }
137 147
138 Blank() 148 Blank()
@@ -286,8 +296,10 @@ struct MineHomePage { @@ -286,8 +296,10 @@ struct MineHomePage {
286 .scrollBar(BarState.Off) 296 .scrollBar(BarState.Off)
287 .width('100%') 297 .width('100%')
288 .layoutWeight(1) 298 .layoutWeight(1)
289 - }.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM]) 299 + }
  300 + .margin({top:px2vp(this.topSafeHeight)})
290 }.width('100%') 301 }.width('100%')
  302 + .padding({bottom:px2vp(this.bottomSafeHeight)})
291 .layoutWeight(1) 303 .layoutWeight(1)
292 }else{ 304 }else{
293 Column(){ 305 Column(){
@@ -4,6 +4,8 @@ import TrackingPageBrowseUtils from '../utils/TrackingPageBrowseUtils' @@ -4,6 +4,8 @@ import TrackingPageBrowseUtils from '../utils/TrackingPageBrowseUtils'
4 @Entry 4 @Entry
5 @Component 5 @Component
6 struct MineMessagePage { 6 struct MineMessagePage {
  7 + @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
  8 + @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
7 9
8 onPageShow(): void { 10 onPageShow(): void {
9 TrackingPageBrowseUtils.TrackingPageBrowseExposureStart() 11 TrackingPageBrowseUtils.TrackingPageBrowseExposureStart()
@@ -15,7 +17,12 @@ struct MineMessagePage { @@ -15,7 +17,12 @@ struct MineMessagePage {
15 17
16 build() { 18 build() {
17 Column(){ 19 Column(){
  20 + Column(){
18 MessageListUI() 21 MessageListUI()
19 } 22 }
  23 + }.width("100%")
  24 + .height("100%")
  25 + .padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)})
  26 +
20 } 27 }
21 } 28 }
@@ -3,7 +3,6 @@ import { display, router } from '@kit.ArkUI'; @@ -3,7 +3,6 @@ import { display, router } from '@kit.ArkUI';
3 import { ImageItemView } from '../components/view/ImageItemView'; 3 import { ImageItemView } from '../components/view/ImageItemView';
4 import { ImageDownloadComponent } from '../components/ImageDownloadComponent'; 4 import { ImageDownloadComponent } from '../components/ImageDownloadComponent';
5 import { Action } from 'wdBean'; 5 import { Action } from 'wdBean';
6 -import { WindowModel } from 'wdKit/Index';  
7 6
8 const TAG = 'MultiPictureListPage'; 7 const TAG = 'MultiPictureListPage';
9 8
@@ -20,11 +19,11 @@ export struct MultiPictureListPage { @@ -20,11 +19,11 @@ export struct MultiPictureListPage {
20 @State picHeight: number = 0 19 @State picHeight: number = 0
21 @State isEnableSwipe: boolean = true; 20 @State isEnableSwipe: boolean = true;
22 @State currentUrl: string = '' 21 @State currentUrl: string = ''
23 - 22 + @Provide bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
  23 + @Provide topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
24 // @Provide bgc: Color = Color.White; 24 // @Provide bgc: Color = Color.White;
25 25
26 aboutToAppear(): void { 26 aboutToAppear(): void {
27 - this.openFullScreen()  
28 //获取宽高尺寸 27 //获取宽高尺寸
29 this.screenWidth = this.displayTool.width 28 this.screenWidth = this.displayTool.width
30 // this.picWidth = this.screenWidth - vp2px(52) 29 // this.picWidth = this.screenWidth - vp2px(52)
@@ -57,7 +56,6 @@ export struct MultiPictureListPage { @@ -57,7 +56,6 @@ export struct MultiPictureListPage {
57 if (this.photoList && this.photoList?.length > 0) { 56 if (this.photoList && this.photoList?.length > 0) {
58 Swiper(this.swiperController) { 57 Swiper(this.swiperController) {
59 ForEach(this.photoList, (item: PhotoListBean) => { 58 ForEach(this.photoList, (item: PhotoListBean) => {
60 - // MultiPictureDetailItemComponent({ MultiPictureDetailItem: item })  
61 ImageItemView({ MultiPictureDetailItem: item, isEnableSwipe: this.isEnableSwipe }) 59 ImageItemView({ MultiPictureDetailItem: item, isEnableSwipe: this.isEnableSwipe })
62 }) 60 })
63 } 61 }
@@ -135,37 +133,13 @@ export struct MultiPictureListPage { @@ -135,37 +133,13 @@ export struct MultiPictureListPage {
135 } 133 }
136 .width('100%') 134 .width('100%')
137 .height('100%') 135 .height('100%')
138 - // .padding({top:$r('app.float.margin_44')}) 136 + .padding({top: `${this.topSafeHeight}px`,bottom:`${this.bottomSafeHeight}px`})
139 .backgroundColor(Color.Black) 137 .backgroundColor(Color.Black)
140 .id('e_picture_container') 138 .id('e_picture_container')
141 - // 设置顶部绘制延伸到状态栏  
142 - // 设置底部绘制延伸到导航条  
143 - .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])  
144 - }  
145 -  
146 - /**  
147 - * 开启沉浸式  
148 - * TODO:颜色待根据业务接口修改  
149 - */  
150 - openFullScreen() {  
151 - WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', })  
152 - // WindowModel.shared.setWindowLayoutFullScreen(true)  
153 - // WindowModel.shared.setWindowSystemBarEnable([])  
154 } 139 }
155 140
156 aboutToDisappear(): void { 141 aboutToDisappear(): void {
157 console.log(TAG, 'aboutToDisappear') 142 console.log(TAG, 'aboutToDisappear')
158 - this.closeFullScreen()  
159 - }  
160 -  
161 - /**  
162 - * 关闭沉浸式  
163 - * TODO:颜色待根据业务接口修改  
164 - */  
165 - closeFullScreen() {  
166 - WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', })  
167 - // WindowModel.shared.setWindowLayoutFullScreen(false)  
168 - // WindowModel.shared.setWindowSystemBarEnable(['status', 'navigation'])  
169 } 143 }
170 144
171 onBackPress(): boolean | void { 145 onBackPress(): boolean | void {
@@ -173,7 +147,5 @@ export struct MultiPictureListPage { @@ -173,7 +147,5 @@ export struct MultiPictureListPage {
173 } 147 }
174 148
175 private onBack() { 149 private onBack() {
176 - // 提前设置,否则返回的页面展示有问题(有时延)  
177 - this.closeFullScreen()  
178 } 150 }
179 } 151 }
@@ -70,7 +70,6 @@ struct OtherNormalUserHomePage { @@ -70,7 +70,6 @@ struct OtherNormalUserHomePage {
70 .width('100%') 70 .width('100%')
71 .height('355lpx') 71 .height('355lpx')
72 .objectFit(ImageFit.Cover) 72 .objectFit(ImageFit.Cover)
73 - .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])  
74 73
75 Row() 74 Row()
76 .height(px2vp(this.topSafeHeight)) 75 .height(px2vp(this.topSafeHeight))
@@ -78,7 +77,6 @@ struct OtherNormalUserHomePage { @@ -78,7 +77,6 @@ struct OtherNormalUserHomePage {
78 .backgroundColor($r('app.color.white')) 77 .backgroundColor($r('app.color.white'))
79 .visibility(this.tileOpacity > 0 ? 0 : 1) 78 .visibility(this.tileOpacity > 0 ? 0 : 1)
80 .opacity(this.tileOpacity ) 79 .opacity(this.tileOpacity )
81 - .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])  
82 } 80 }
83 81
84 Column(){ 82 Column(){
@@ -254,7 +252,7 @@ struct OtherNormalUserHomePage { @@ -254,7 +252,7 @@ struct OtherNormalUserHomePage {
254 .scrollBar(BarState.Off) 252 .scrollBar(BarState.Off)
255 .width('100%') 253 .width('100%')
256 .layoutWeight(1) 254 .layoutWeight(1)
257 - }.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM]) 255 + }
258 }.width('100%') 256 }.width('100%')
259 .layoutWeight(1) 257 .layoutWeight(1)
260 }else{ 258 }else{
@@ -10,6 +10,8 @@ struct SearchPage { @@ -10,6 +10,8 @@ struct SearchPage {
10 @State fromTabName: string = 'NEWS'; 10 @State fromTabName: string = 'NEWS';
11 pageShowTime:number = 0; 11 pageShowTime:number = 0;
12 pageHideTime:number = 0; 12 pageHideTime:number = 0;
  13 + @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
  14 + @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
13 15
14 onPageShow() { 16 onPageShow() {
15 this.fromTabName = this.params?.['tabName']; 17 this.fromTabName = this.params?.['tabName'];
@@ -25,9 +27,13 @@ struct SearchPage { @@ -25,9 +27,13 @@ struct SearchPage {
25 27
26 build() { 28 build() {
27 Column(){ 29 Column(){
  30 + Column(){
28 SearchComponent({fromTabName:$fromTabName}) 31 SearchComponent({fromTabName:$fromTabName})
29 }.height('100%') 32 }.height('100%')
30 .width('100%') 33 .width('100%')
31 .backgroundColor($r('app.color.white')) 34 .backgroundColor($r('app.color.white'))
  35 + }.width("100%")
  36 + .height("100%")
  37 + .padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)})
32 } 38 }
33 } 39 }
@@ -5,11 +5,19 @@ const TAG = "SubscribeMessagePage" @@ -5,11 +5,19 @@ const TAG = "SubscribeMessagePage"
5 @Entry 5 @Entry
6 @Component 6 @Component
7 struct SubscribeMessagePage { 7 struct SubscribeMessagePage {
  8 + @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
  9 + @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
  10 +
8 11
9 build() { 12 build() {
10 Column(){ 13 Column(){
  14 + Column(){
11 SubscribeMessageComponent() 15 SubscribeMessageComponent()
12 }.height("100%") 16 }.height("100%")
13 .width("100%") 17 .width("100%")
  18 + }.width("100%")
  19 + .height("100%")
  20 + .padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)})
  21 +
14 } 22 }
15 } 23 }
@@ -16,6 +16,7 @@ import { CommentListItem } from '../viewmodel/CommentListItem'; @@ -16,6 +16,7 @@ import { CommentListItem } from '../viewmodel/CommentListItem';
16 struct VisitorCommentPage { 16 struct VisitorCommentPage {
17 @State data: LazyDataSource<CommentListItem> = new LazyDataSource(); 17 @State data: LazyDataSource<CommentListItem> = new LazyDataSource();
18 @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 18 @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
  19 + @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
19 @State count: number = 0; 20 @State count: number = 0;
20 @State isLoading: boolean = false 21 @State isLoading: boolean = false
21 @State hasMore: boolean = true 22 @State hasMore: boolean = true
@@ -35,13 +36,14 @@ struct VisitorCommentPage { @@ -35,13 +36,14 @@ struct VisitorCommentPage {
35 } 36 }
36 37
37 build() { 38 build() {
  39 + Column(){
38 Column() { 40 Column() {
39 //标题栏目 41 //标题栏目
40 CustomTitleUI({ titleName: "评论列表" }) 42 CustomTitleUI({ titleName: "评论列表" })
41 if (this.count == 0) { 43 if (this.count == 0) {
42 if (this.isGetRequest == true) { 44 if (this.isGetRequest == true) {
43 if(this.isConnectNetwork){ 45 if(this.isConnectNetwork){
44 - EmptyComponent({ emptyType: 10 }) 46 + EmptyComponent({ emptyType: 11 })
45 .height('100%') 47 .height('100%')
46 .width('100%') 48 .width('100%')
47 }else{ 49 }else{
@@ -68,7 +70,6 @@ struct VisitorCommentPage { @@ -68,7 +70,6 @@ struct VisitorCommentPage {
68 .width("100%") 70 .width("100%")
69 .height("100%") 71 .height("100%")
70 .backgroundColor($r('app.color.white')) 72 .backgroundColor($r('app.color.white'))
71 - .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])  
72 CustomPullToRefresh({ 73 CustomPullToRefresh({
73 alldata:this.data, 74 alldata:this.data,
74 scroller:this.scroller, 75 scroller:this.scroller,
@@ -99,6 +100,10 @@ struct VisitorCommentPage { @@ -99,6 +100,10 @@ struct VisitorCommentPage {
99 .backgroundColor($r('app.color.color_transparent')) 100 .backgroundColor($r('app.color.color_transparent'))
100 .height('100%') 101 .height('100%')
101 .width('100%') 102 .width('100%')
  103 + }.width("100%")
  104 + .height("100%")
  105 + .padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)})
  106 +
102 } 107 }
103 108
104 @Builder ListLayout(){ 109 @Builder ListLayout(){
@@ -221,6 +221,8 @@ export class PageHelper { @@ -221,6 +221,8 @@ export class PageHelper {
221 // let pageDto = page 221 // let pageDto = page
222 let index = pageInfo.groups.indexOf(group) 222 let index = pageInfo.groups.indexOf(group)
223 223
  224 + Logger.debug(TAG, 'yyyy parseGroup print')
  225 + this.printComp(pageDto)
224 // 解析楼层组件 226 // 解析楼层组件
225 this.analysisPageGroupCompData(pageDto, pageInfo) 227 this.analysisPageGroupCompData(pageDto, pageInfo)
226 228
@@ -293,7 +295,8 @@ export class PageHelper { @@ -293,7 +295,8 @@ export class PageHelper {
293 if (pageDto.compAdList != null) { 295 if (pageDto.compAdList != null) {
294 pageInfo.pageAdList.push(...pageDto.compAdList) 296 pageInfo.pageAdList.push(...pageDto.compAdList)
295 } 297 }
296 - 298 + // TODO 待删除
  299 + Logger.debug(TAG, 'yyyy analysisPageGroupCompData size, '+pageInfo?.oneRequestPageGroupCompList?.length)
297 } 300 }
298 301
299 } 302 }
@@ -340,6 +343,8 @@ export class PageHelper { @@ -340,6 +343,8 @@ export class PageHelper {
340 pageModel.currentPage++; 343 pageModel.currentPage++;
341 pageModel.hasMore = true; 344 pageModel.hasMore = true;
342 345
  346 + Logger.debug(TAG, 'yyyy compLoadMore print')
  347 + this.printComp(data)
343 //移除音频 和 活动 348 //移除音频 和 活动
344 this.loadMorePageComp(pageModel, data) 349 this.loadMorePageComp(pageModel, data)
345 // 参与批查 350 // 参与批查
@@ -366,6 +371,8 @@ export class PageHelper { @@ -366,6 +371,8 @@ export class PageHelper {
366 pageCompList.forEach((comp: CompDTO) => { 371 pageCompList.forEach((comp: CompDTO) => {
367 pageModel.pageInfo.oneRequestPageGroupCompList.add(comp) 372 pageModel.pageInfo.oneRequestPageGroupCompList.add(comp)
368 }) 373 })
  374 + // TODO 待删除
  375 + Logger.debug(TAG, 'yyyy loadMorePageComp size, ' + pageModel.pageInfo.oneRequestPageGroupCompList?.length)
369 376
370 // 记录 377 // 记录
371 pageModel.pageTotalCompSize = pageCompList.length + pageModel.pageTotalCompSize 378 pageModel.pageTotalCompSize = pageCompList.length + pageModel.pageTotalCompSize
@@ -843,6 +850,31 @@ export class PageHelper { @@ -843,6 +850,31 @@ export class PageHelper {
843 // 从第二页开始删 850 // 从第二页开始删
844 pageModel.compList.deleteItems(pageModel.firstPageEndIndex + 1) 851 pageModel.compList.deleteItems(pageModel.firstPageEndIndex + 1)
845 } 852 }
  853 +
  854 + /**
  855 + * 临时打印comp相关信息,用于问题定位。TODO 待删除
  856 + */
  857 + private printComp(pageDto: PageDTO) {
  858 + Logger.debug(TAG, 'yyyy printComp pageDto.compList.size: ' + pageDto?.compList?.length)
  859 + new Promise<void>(() => {
  860 + let tmpCompList: CompDTO[] = Array.from(pageDto.compList)
  861 + tmpCompList.forEach((v, k) => {
  862 + if (v && v.operDataList) {
  863 + Logger.warn(TAG, 'yyyy printComp comp forEach, ' + v.compStyle)
  864 + v.operDataList.forEach((cv, ci) => {
  865 + if (cv) {
  866 + Logger.debug(TAG, 'yyyy printComp ContentDTO print, ' + v.compStyle)
  867 + Logger.debug(TAG, 'yyyy printComp ContentDTO xxxx newsTitle, ' + cv.newsTitle)
  868 + } else {
  869 + Logger.warn(TAG, 'yyyy printComp ContentDTO is null, ' + v.compStyle)
  870 + }
  871 + })
  872 + } else {
  873 + Logger.warn(TAG, 'yyyy printComp comp is null or operDataList is empty, ' + v?.compStyle)
  874 + }
  875 + })
  876 + })
  877 + }
846 } 878 }
847 879
848 880
@@ -4,7 +4,7 @@ import router from '@ohos.router'; @@ -4,7 +4,7 @@ import router from '@ohos.router';
4 4
5 import { DetailPlayLivePage } from './DetailPlayLivePage'; 5 import { DetailPlayLivePage } from './DetailPlayLivePage';
6 import { DetailPlayVLivePage } from './DetailPlayVLivePage'; 6 import { DetailPlayVLivePage } from './DetailPlayVLivePage';
7 -import { DateTimeUtils, Logger, ToastUtils } from 'wdKit/Index'; 7 +import { DateTimeUtils, Logger, ToastUtils, WindowModel } from 'wdKit/Index';
8 import { publishCommentModel } from 'wdComponent/src/main/ets/components/comment/model/PublishCommentModel'; 8 import { publishCommentModel } from 'wdComponent/src/main/ets/components/comment/model/PublishCommentModel';
9 import { PictureLoading } from '../widgets/vertical/PictureLoading'; 9 import { PictureLoading } from '../widgets/vertical/PictureLoading';
10 import { TrackConstants, TrackingPageBrowse } from 'wdTracking/Index'; 10 import { TrackConstants, TrackingPageBrowse } from 'wdTracking/Index';
@@ -26,6 +26,8 @@ export struct DetailPlayLiveCommon { @@ -26,6 +26,8 @@ export struct DetailPlayLiveCommon {
26 private liveViewModel: LiveViewModel = new LiveViewModel() 26 private liveViewModel: LiveViewModel = new LiveViewModel()
27 pageShowTime: number = 0; 27 pageShowTime: number = 0;
28 28
  29 + @Provide topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
  30 + @Provide bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
29 @Provide relId: string = '' 31 @Provide relId: string = ''
30 @Provide contentId: string = '' 32 @Provide contentId: string = ''
31 @Provide relType: string = '' 33 @Provide relType: string = ''
@@ -83,7 +85,7 @@ export struct DetailPlayLiveCommon { @@ -83,7 +85,7 @@ export struct DetailPlayLiveCommon {
83 .height('100%') 85 .height('100%')
84 .width('100%') 86 .width('100%')
85 .backgroundColor(Color.Black) 87 .backgroundColor(Color.Black)
86 - .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP]) 88 + // .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
87 } 89 }
88 90
89 /** 91 /**
@@ -153,9 +155,11 @@ export struct DetailPlayLiveCommon { @@ -153,9 +155,11 @@ export struct DetailPlayLiveCommon {
153 this.pageShow = Math.random() 155 this.pageShow = Math.random()
154 Logger.info(TAG, 'onPageShow') 156 Logger.info(TAG, 'onPageShow')
155 this.pageShowTime = DateTimeUtils.getTimeStamp() 157 this.pageShowTime = DateTimeUtils.getTimeStamp()
  158 + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff'})
156 } 159 }
157 160
158 onPageHide() { 161 onPageHide() {
  162 + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000'})
159 this.pageHide = Math.random() 163 this.pageHide = Math.random()
160 Logger.info(TAG, 'onPageHide') 164 Logger.info(TAG, 'onPageHide')
161 //页面浏览 165 //页面浏览
@@ -166,6 +170,7 @@ export struct DetailPlayLiveCommon { @@ -166,6 +170,7 @@ export struct DetailPlayLiveCommon {
166 } 170 }
167 171
168 onBackPress(): boolean | void { 172 onBackPress(): boolean | void {
  173 +
169 this.pageBackPress = Math.random() 174 this.pageBackPress = Math.random()
170 Logger.info(TAG, 'onBackPress') 175 Logger.info(TAG, 'onBackPress')
171 return true 176 return true
@@ -7,10 +7,9 @@ import mediaquery from '@ohos.mediaquery'; @@ -7,10 +7,9 @@ import mediaquery from '@ohos.mediaquery';
7 import { Logger, WindowModel } from 'wdKit/Index'; 7 import { Logger, WindowModel } from 'wdKit/Index';
8 import { router, window } from '@kit.ArkUI'; 8 import { router, window } from '@kit.ArkUI';
9 import { WDAliPlayerController } from 'wdPlayer/Index'; 9 import { WDAliPlayerController } from 'wdPlayer/Index';
10 -import { LiveEmptyComponent, LiveOperRowListView } from 'wdComponent'; 10 +import { LiveOperRowListView } from 'wdComponent';
11 import { publishCommentModel } from 'wdComponent/src/main/ets/components/comment/model/PublishCommentModel'; 11 import { publishCommentModel } from 'wdComponent/src/main/ets/components/comment/model/PublishCommentModel';
12 import { TrackConstants, TrackingContent, TrackParamConvert } from 'wdTracking/Index'; 12 import { TrackConstants, TrackingContent, TrackParamConvert } from 'wdTracking/Index';
13 -import { LiveDetailPageLogic } from '../viewModel/LiveDetailPageLogic';  
14 13
15 let TAG: string = 'DetailPlayLivePage'; 14 let TAG: string = 'DetailPlayLivePage';
16 15
@@ -39,8 +38,8 @@ export struct DetailPlayLivePage { @@ -39,8 +38,8 @@ export struct DetailPlayLivePage {
39 // 尽量不要动属性。用来作为输入了评论之后,值传递 38 // 尽量不要动属性。用来作为输入了评论之后,值传递
40 @State lastInputedLiveComment: LiveRoomItemBean = {} as LiveRoomItemBean // 上次输入的直播间消息 39 @State lastInputedLiveComment: LiveRoomItemBean = {} as LiveRoomItemBean // 上次输入的直播间消息
41 @State lastInputedChatComment: LiveRoomItemBean = {} as LiveRoomItemBean // 上次输入的大家聊消息 40 @State lastInputedChatComment: LiveRoomItemBean = {} as LiveRoomItemBean // 上次输入的大家聊消息
42 -  
43 - 41 + // 顶部状态栏高度
  42 + @Consume topSafeHeight: number
44 43
45 aboutToAppear(): void { 44 aboutToAppear(): void {
46 Logger.info(TAG, `wyj-aboutToAppear`) 45 Logger.info(TAG, `wyj-aboutToAppear`)
@@ -52,12 +51,11 @@ export struct DetailPlayLivePage { @@ -52,12 +51,11 @@ export struct DetailPlayLivePage {
52 } else { 51 } else {
53 this.displayDirection = DisplayDirection.VERTICAL 52 this.displayDirection = DisplayDirection.VERTICAL
54 } 53 }
55 - WindowModel.shared.setMainWindowFullScreen(this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL) 54 + // WindowModel.shared.setMainWindowFullScreen(this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL)
56 }) 55 })
57 this.getLiveDetails() 56 this.getLiveDetails()
58 this.getLiveRoomData() 57 this.getLiveRoomData()
59 58
60 - console.error(TAG, 'this.publishCommentModel', this.publishCommentModel.targetId)  
61 } 59 }
62 60
63 async aboutToDisappear() { 61 async aboutToDisappear() {
@@ -68,10 +66,11 @@ export struct DetailPlayLivePage { @@ -68,10 +66,11 @@ export struct DetailPlayLivePage {
68 66
69 build() { 67 build() {
70 Column() { 68 Column() {
71 -  
72 TopPlayComponent({ playerController: this.playerController }) 69 TopPlayComponent({ playerController: this.playerController })
73 .height(this.displayDirection == DisplayDirection.VERTICAL ? 211 : '100%') 70 .height(this.displayDirection == DisplayDirection.VERTICAL ? 211 : '100%')
74 - 71 + .margin({
  72 + top: this.displayDirection == DisplayDirection.VERTICAL ? px2vp(this.topSafeHeight) : 0
  73 + })
75 74
76 TabComponent({ 75 TabComponent({
77 tabs: this.tabs, 76 tabs: this.tabs,
@@ -117,7 +116,6 @@ export struct DetailPlayLivePage { @@ -117,7 +116,6 @@ export struct DetailPlayLivePage {
117 .height('100%') 116 .height('100%')
118 .width('100%') 117 .width('100%')
119 118
120 - // 设置底部绘制延伸到导航条  
121 } 119 }
122 120
123 onPageShowCus(): void { 121 onPageShowCus(): void {
1 -import { LiveRoomDataBean } from 'wdBean/Index'; 1 +import { ContentDetailDTO, LiveRoomDataBean } from 'wdBean/Index';
2 import { LiveViewModel } from '../viewModel/LiveViewModel'; 2 import { LiveViewModel } from '../viewModel/LiveViewModel';
3 import { WindowModel } from 'wdKit/Index'; 3 import { WindowModel } from 'wdKit/Index';
4 import { PlayerComponent } from '../widgets/vertical/PlayerComponent'; 4 import { PlayerComponent } from '../widgets/vertical/PlayerComponent';
@@ -22,8 +22,9 @@ export struct DetailPlayVLivePage { @@ -22,8 +22,9 @@ export struct DetailPlayVLivePage {
22 private liveViewModel: LiveViewModel = new LiveViewModel() 22 private liveViewModel: LiveViewModel = new LiveViewModel()
23 private playerController: WDAliPlayerController = new WDAliPlayerController(); 23 private playerController: WDAliPlayerController = new WDAliPlayerController();
24 private swiperController: SwiperController = new SwiperController() 24 private swiperController: SwiperController = new SwiperController()
25 - @Provide bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0  
26 - @Provide topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 25 + @Consume contentDetailData: ContentDetailDTO
  26 + @Consume bottomSafeHeight: number
  27 + @Consume topSafeHeight: number
27 @Provide liveRoomDataBean: LiveRoomDataBean = {} as LiveRoomDataBean 28 @Provide liveRoomDataBean: LiveRoomDataBean = {} as LiveRoomDataBean
28 @Provide isShowControl: boolean = false 29 @Provide isShowControl: boolean = false
29 @Provide displayDirection: DisplayDirection = DisplayDirection.VERTICAL //横竖屏,默认竖屏 30 @Provide displayDirection: DisplayDirection = DisplayDirection.VERTICAL //横竖屏,默认竖屏
@@ -36,6 +37,9 @@ export struct DetailPlayVLivePage { @@ -36,6 +37,9 @@ export struct DetailPlayVLivePage {
36 @Consume contentId: string 37 @Consume contentId: string
37 @State swiperIndex: number = 1 38 @State swiperIndex: number = 1
38 @Consume liveDetailPageLogic: LiveDetailPageLogic 39 @Consume liveDetailPageLogic: LiveDetailPageLogic
  40 + //播放错误
  41 + @State isPlayerError: boolean = false
  42 + @State isCanplay: boolean = false
39 43
40 aboutToAppear(): void { 44 aboutToAppear(): void {
41 this.openFullScreen() 45 this.openFullScreen()
@@ -49,14 +53,16 @@ export struct DetailPlayVLivePage { @@ -49,14 +53,16 @@ export struct DetailPlayVLivePage {
49 53
50 openFullScreen() { 54 openFullScreen() {
51 console.log(TAG, 'openFullScreen') 55 console.log(TAG, 'openFullScreen')
52 - WindowModel.shared.setWindowLayoutFullScreen(true)  
53 - WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', }) 56 + // WindowModel.shared.setWindowLayoutFullScreen(true)
  57 + // WindowModel.shared.setSpecificSystemBarEnabled()
  58 + // WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', })
54 } 59 }
55 60
56 closeFullScreen() { 61 closeFullScreen() {
57 console.log(TAG, 'closeFullScreen') 62 console.log(TAG, 'closeFullScreen')
58 - WindowModel.shared.setWindowLayoutFullScreen(false)  
59 - WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', }) 63 + // WindowModel.shared.setWindowLayoutFullScreen(false)
  64 + // WindowModel.shared.setSpecificSystemBarEnabled(true)
  65 + // WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', })
60 } 66 }
61 67
62 build() { 68 build() {
@@ -68,7 +74,6 @@ export struct DetailPlayVLivePage { @@ -68,7 +74,6 @@ export struct DetailPlayVLivePage {
68 .width('100%') 74 .width('100%')
69 .blur(100) 75 .blur(100)
70 .renderFit(RenderFit.RESIZE_COVER) 76 .renderFit(RenderFit.RESIZE_COVER)
71 - .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])  
72 // 直播结束且无回看 77 // 直播结束且无回看
73 if (this.liveState === 'end' && !this.playUrl) { 78 if (this.liveState === 'end' && !this.playUrl) {
74 PlayerEndView() 79 PlayerEndView()
@@ -78,28 +83,27 @@ export struct DetailPlayVLivePage { @@ -78,28 +83,27 @@ export struct DetailPlayVLivePage {
78 LiveEmptyComponent({ 83 LiveEmptyComponent({
79 emptyType: WDLiveViewDefaultType.WDViewDefaultType_NoLiveSuspend 84 emptyType: WDLiveViewDefaultType.WDViewDefaultType_NoLiveSuspend
80 }) 85 })
81 - .height('30%').margin({top:this.topSafeHeight }) 86 + .height('40%').margin({ top: this.topSafeHeight })
82 } else { 87 } else {
83 88
84 if (this.liveDetailPageLogic.showPad) { 89 if (this.liveDetailPageLogic.showPad) {
85 // 有垫片 90 // 有垫片
86 - if(this.liveDetailPageLogic.padImageUri.length > 0){ 91 + if (this.liveDetailPageLogic.padImageUri.length > 0) {
87 // 配置了垫片资源 92 // 配置了垫片资源
88 Image(this.liveDetailPageLogic.padImageUri).objectFit(ImageFit.Fill).width('100%').height('100%') 93 Image(this.liveDetailPageLogic.padImageUri).objectFit(ImageFit.Fill).width('100%').height('100%')
89 94
90 - }else { 95 + } else {
91 // 没有配置垫片资源 96 // 没有配置垫片资源
92 LiveEmptyComponent({ 97 LiveEmptyComponent({
93 emptyType: WDLiveViewDefaultType.WDViewDefaultType_NoLiveSuspend 98 emptyType: WDLiveViewDefaultType.WDViewDefaultType_NoLiveSuspend
94 }) 99 })
95 - .height('30%').margin({top:this.topSafeHeight }) 100 + .height('40%').margin({ top: this.topSafeHeight })
96 } 101 }
97 102
98 -  
99 } else { 103 } else {
100 // 播放器 104 // 播放器
101 PlayerComponent({ 105 PlayerComponent({
102 - playerController: this.playerController 106 + playerController: this.playerController, isPlayerError: this.isPlayerError, isCanplay: this.isCanplay
103 }) 107 })
104 } 108 }
105 } 109 }
@@ -110,6 +114,44 @@ export struct DetailPlayVLivePage { @@ -110,6 +114,44 @@ export struct DetailPlayVLivePage {
110 swiperController: this.swiperController, 114 swiperController: this.swiperController,
111 swiperIndex: $swiperIndex 115 swiperIndex: $swiperIndex
112 }) 116 })
  117 +
  118 + // 直播资源加载失败
  119 + Column() {
  120 + Text('直播加载中,请稍候重试')
  121 + .fontSize('20fp')
  122 + .fontWeight(500)
  123 + .margin({ top: 16 })
  124 + .fontColor(Color.White)
  125 +
  126 + Button('点击重试')
  127 + .type(ButtonType.Normal)
  128 + .width(80)
  129 + .height(28)
  130 + .backgroundColor(Color.Transparent)
  131 + .fontColor('#ffcccccc')
  132 + .border({ width: 1 })
  133 + .borderColor('#4dffffff')
  134 + .borderRadius(4)
  135 + .fontSize($r('app.float.font_size_12'))
  136 + .margin({ top: 16 })
  137 + .padding(0)
  138 + .onClick(() => {
  139 +
  140 + this.isCanplay = false
  141 + this.isPlayerError = false
  142 + this.playerController?.firstPlay(this.playUrl, TrackConstants.PageName.Live_Detail, {
  143 + 'contentType': `${this.contentDetailData.newsType}`,
  144 + 'contentId': `${this.contentDetailData.newsId}`,
  145 + 'contentName': `${this.contentDetailData.newsTitle || ''}`,
  146 + });
  147 + })
  148 + }
  149 + .width('100%')
  150 + .margin({ top: 195 })
  151 + .justifyContent(FlexAlign.Center)
  152 + .visibility(this.isPlayerError ? Visibility.Visible :
  153 + Visibility.None)
  154 +
113 // 清屏按钮 155 // 清屏按钮
114 Image($r('app.media.icon_live_more')) 156 Image($r('app.media.icon_live_more'))
115 .width(40) 157 .width(40)
@@ -101,9 +101,8 @@ export struct PlayUIComponent { @@ -101,9 +101,8 @@ export struct PlayUIComponent {
101 WindowModel.shared.setPreferredOrientation(this.displayDirection == DisplayDirection.VERTICAL ? 101 WindowModel.shared.setPreferredOrientation(this.displayDirection == DisplayDirection.VERTICAL ?
102 window.Orientation.PORTRAIT : 102 window.Orientation.PORTRAIT :
103 window.Orientation.LANDSCAPE_INVERTED) 103 window.Orientation.LANDSCAPE_INVERTED)
104 - // devicePLSensorManager.devicePLSensorOn(this.displayDirection == DisplayDirection.VERTICAL ?  
105 - // window.Orientation.PORTRAIT :  
106 - // window.Orientation.LANDSCAPE); 104 + WindowModel.shared.setSpecificSystemBarEnabled(true)
  105 +
107 }) 106 })
108 if (this.contentDetailData.liveInfo?.liveState != 'wait') { 107 if (this.contentDetailData.liveInfo?.liveState != 'wait') {
109 Text(this.contentDetailData.newsTitle) 108 Text(this.contentDetailData.newsTitle)
@@ -307,15 +306,18 @@ export struct PlayUIComponent { @@ -307,15 +306,18 @@ export struct PlayUIComponent {
307 .width(24) 306 .width(24)
308 .height(24) 307 .height(24)
309 .onClick(() => { 308 .onClick(() => {
  309 +
  310 + WindowModel.shared.setSpecificSystemBarEnabled(false)
  311 +
310 this.displayDirection = 312 this.displayDirection =
311 this.displayDirection == DisplayDirection.VERTICAL ? DisplayDirection.VIDEO_HORIZONTAL : 313 this.displayDirection == DisplayDirection.VERTICAL ? DisplayDirection.VIDEO_HORIZONTAL :
312 DisplayDirection.VERTICAL 314 DisplayDirection.VERTICAL
  315 +
313 WindowModel.shared.setPreferredOrientation(this.displayDirection == DisplayDirection.VERTICAL ? 316 WindowModel.shared.setPreferredOrientation(this.displayDirection == DisplayDirection.VERTICAL ?
314 window.Orientation.PORTRAIT : 317 window.Orientation.PORTRAIT :
315 window.Orientation.LANDSCAPE_INVERTED) 318 window.Orientation.LANDSCAPE_INVERTED)
316 - // devicePLSensorManager.devicePLSensorOn(this.displayDirection == DisplayDirection.VERTICAL ?  
317 - // window.Orientation.PORTRAIT :  
318 - // window.Orientation.LANDSCAPE); 319 +
  320 +
319 }) 321 })
320 .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) 322 .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None)
321 } 323 }
@@ -25,7 +25,7 @@ export struct TopPlayComponent { @@ -25,7 +25,7 @@ export struct TopPlayComponent {
25 //已结束直播 25 //已结束直播
26 @State isEnd: boolean = false 26 @State isEnd: boolean = false
27 //播放错误 27 //播放错误
28 - @State isError: boolean = false 28 + @State isPlayerError: boolean = false
29 // loading 控制字段 29 // loading 控制字段
30 @State isHideLoading: boolean = false 30 @State isHideLoading: boolean = false
31 // 获取播放资源能播放了 31 // 获取播放资源能播放了
@@ -35,6 +35,17 @@ export struct TopPlayComponent { @@ -35,6 +35,17 @@ export struct TopPlayComponent {
35 private playUrl: string = "" 35 private playUrl: string = ""
36 private xComponentIsLoaded: boolean = false 36 private xComponentIsLoaded: boolean = false
37 @Consume liveDetailPageLogic: LiveDetailPageLogic 37 @Consume liveDetailPageLogic: LiveDetailPageLogic
  38 + @Consume @Watch('pageShowChange') pageShow: number
  39 + @Consume @Watch('pageHideChange') pageHide: number
  40 + init: boolean = false
  41 +
  42 + pageShowChange() {
  43 + this.playerController?.play()
  44 + }
  45 +
  46 + pageHideChange() {
  47 + this.playerController?.pause()
  48 + }
38 49
39 aboutToAppear(): void { 50 aboutToAppear(): void {
40 if (this.playerController) { 51 if (this.playerController) {
@@ -50,14 +61,14 @@ export struct TopPlayComponent { @@ -50,14 +61,14 @@ export struct TopPlayComponent {
50 this.playSourceState = status 61 this.playSourceState = status
51 Logger.debug(TAG, 'status==>' + status) 62 Logger.debug(TAG, 'status==>' + status)
52 if (status === PlayerConstants.STATUS_ERROR) { 63 if (status === PlayerConstants.STATUS_ERROR) {
53 - this.isError = true 64 + this.isPlayerError = true
54 this.isHideLoading = true 65 this.isHideLoading = true
55 this.isCanPlay = false 66 this.isCanPlay = false
56 } else if (status === PlayerConstants.STATUS_COMPLETION) { 67 } else if (status === PlayerConstants.STATUS_COMPLETION) {
57 // 播放完成 68 // 播放完成
58 69
59 } else { 70 } else {
60 - this.isError = false 71 + this.isPlayerError = false
61 } 72 }
62 73
63 } 74 }
@@ -71,7 +82,7 @@ export struct TopPlayComponent { @@ -71,7 +82,7 @@ export struct TopPlayComponent {
71 updateData() { 82 updateData() {
72 83
73 // 检测垫片 84 // 检测垫片
74 - if (this.liveDetailPageLogic.showPad){ 85 + if (this.liveDetailPageLogic.showPad) {
75 this.isHideLoading = true 86 this.isHideLoading = true
76 this.isWait = true 87 this.isWait = true
77 this.previewUrl = this.liveDetailPageLogic.imgUrl 88 this.previewUrl = this.liveDetailPageLogic.imgUrl
@@ -178,7 +189,6 @@ export struct TopPlayComponent { @@ -178,7 +189,6 @@ export struct TopPlayComponent {
178 189
179 if (this.liveDetailPageLogic.showPad) { 190 if (this.liveDetailPageLogic.showPad) {
180 191
181 -  
182 } else { 192 } else {
183 // 视频资源播放 193 // 视频资源播放
184 WDPlayerRenderLiveView({ 194 WDPlayerRenderLiveView({
@@ -186,7 +196,7 @@ export struct TopPlayComponent { @@ -186,7 +196,7 @@ export struct TopPlayComponent {
186 onLoad: async () => { 196 onLoad: async () => {
187 if (StringUtils.isNotEmpty(this.playUrl)) { 197 if (StringUtils.isNotEmpty(this.playUrl)) {
188 this.isHideLoading = false 198 this.isHideLoading = false
189 - this.isError = false 199 + this.isPlayerError = false
190 this.xComponentIsLoaded = true 200 this.xComponentIsLoaded = true
191 Logger.debug(TAG, `---onLoad------>`) 201 Logger.debug(TAG, `---onLoad------>`)
192 this.tryToPlay() 202 this.tryToPlay()
@@ -265,12 +275,12 @@ export struct TopPlayComponent { @@ -265,12 +275,12 @@ export struct TopPlayComponent {
265 .padding(0) 275 .padding(0)
266 .onClick(() => { 276 .onClick(() => {
267 this.isHideLoading = false 277 this.isHideLoading = false
268 - this.isError = false 278 + this.isPlayerError = false
269 this.xComponentIsLoaded = true 279 this.xComponentIsLoaded = true
270 this.tryToPlay() 280 this.tryToPlay()
271 281
272 }) 282 })
273 - }.width('100%').visibility(this.isError ? Visibility.Visible : 283 + }.width('100%').visibility(this.isPlayerError ? Visibility.Visible :
274 Visibility.None) 284 Visibility.None)
275 285
276 } 286 }
@@ -14,6 +14,7 @@ import { EmitterEventId, EmitterUtils, Logger, SPHelper, WindowModel } from 'wdK @@ -14,6 +14,7 @@ import { EmitterEventId, EmitterUtils, Logger, SPHelper, WindowModel } from 'wdK
14 import { TrackConstants, TrackingContent, TrackParamConvert } from 'wdTracking/Index' 14 import { TrackConstants, TrackingContent, TrackParamConvert } from 'wdTracking/Index'
15 15
16 const TAG = "PlayerCommentComponent" 16 const TAG = "PlayerCommentComponent"
  17 +
17 /** 18 /**
18 * 沉浸式直播--- 聊天区域 19 * 沉浸式直播--- 聊天区域
19 */ 20 */
@@ -52,7 +53,7 @@ export struct PlayerCommentComponent { @@ -52,7 +53,7 @@ export struct PlayerCommentComponent {
52 this.liveViewModel.getLiveCommentList( 53 this.liveViewModel.getLiveCommentList(
53 1, 54 1,
54 this.contentDetailData?.liveInfo?.mlive?.mliveId, 55 this.contentDetailData?.liveInfo?.mlive?.mliveId,
55 - this.contentDetailData?.newsId+'', 56 + this.contentDetailData?.newsId + '',
56 20,) 57 20,)
57 .then( 58 .then(
58 (data) => { 59 (data) => {
@@ -82,6 +83,7 @@ export struct PlayerCommentComponent { @@ -82,6 +83,7 @@ export struct PlayerCommentComponent {
82 83
83 build() { 84 build() {
84 Column() { 85 Column() {
  86 + Stack({ alignContent: Alignment.BottomStart }) {
85 List({ scroller: this.scroller }) { 87 List({ scroller: this.scroller }) {
86 // 主持人 88 // 主持人
87 if (this.contentDetailData.oldNewsId) { 89 if (this.contentDetailData.oldNewsId) {
@@ -93,10 +95,10 @@ export struct PlayerCommentComponent { @@ -93,10 +95,10 @@ export struct PlayerCommentComponent {
93 } 95 }
94 }) 96 })
95 } 97 }
96 - .height(280)  
97 .width('80%') 98 .width('80%')
98 .scrollBar(BarState.Off) 99 .scrollBar(BarState.Off)
99 - .margin({ bottom: 20 }) 100 +
  101 + }.height(280)
100 102
101 // 收藏、分享、点赞是否需要根据字段显隐 103 // 收藏、分享、点赞是否需要根据字段显隐
102 LiveOperRowListView({ 104 LiveOperRowListView({
@@ -126,7 +128,7 @@ export struct PlayerCommentComponent { @@ -126,7 +128,7 @@ export struct PlayerCommentComponent {
126 } 128 }
127 }, 129 },
128 onBack: () => { 130 onBack: () => {
129 - WindowModel.shared.setWindowLayoutFullScreen(false) 131 + // WindowModel.shared.setWindowLayoutFullScreen(false)
130 WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', }) 132 WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', })
131 } 133 }
132 }) 134 })
1 import { ContentDetailDTO } from 'wdBean/Index'; 1 import { ContentDetailDTO } from 'wdBean/Index';
2 -import { AliPlayerRenderView, WDAliPlayerController, WDPlayerRenderVLiveView } from 'wdPlayer/Index'; 2 +import { AliPlayerRenderView, PlayerConstants, WDAliPlayerController, WDPlayerRenderVLiveView } from 'wdPlayer/Index';
3 import { ParamType, TrackConstants } from 'wdTracking/Index'; 3 import { ParamType, TrackConstants } from 'wdTracking/Index';
4 import { PictureLoading } from './PictureLoading'; 4 import { PictureLoading } from './PictureLoading';
5 5
@@ -20,8 +20,10 @@ export struct PlayerComponent { @@ -20,8 +20,10 @@ export struct PlayerComponent {
20 // 0-横屏流画面,1-竖屏幕流画面 20 // 0-横屏流画面,1-竖屏幕流画面
21 @State liveStreamType: number | null = -1 21 @State liveStreamType: number | null = -1
22 @State playUrl: string = '' 22 @State playUrl: string = ''
23 - @State isCanplay: boolean = false  
24 pageParam: ParamType = {} 23 pageParam: ParamType = {}
  24 + // 播放失败
  25 + @Link isPlayerError: boolean
  26 + @Link isCanplay: boolean
25 27
26 pageShowChange() { 28 pageShowChange() {
27 this.playerController?.play() 29 this.playerController?.play()
@@ -31,10 +33,33 @@ export struct PlayerComponent { @@ -31,10 +33,33 @@ export struct PlayerComponent {
31 this.playerController?.pause() 33 this.playerController?.pause()
32 } 34 }
33 35
34 - async aboutToAppear(): Promise<void> { 36 + aboutToAppear(){
  37 +
  38 + if (this.playerController) {
  39 + this.playerController.onCanplay = () => {
  40 + this.isCanplay = true
  41 + this.playerController?.play()
  42 + }
  43 + this.playerController.onStatusChange = (status: number) => {
  44 + if (status === PlayerConstants.STATUS_ERROR) {
  45 + this.isPlayerError = true
  46 + this.isCanplay = true
  47 + } else if (status === PlayerConstants.STATUS_COMPLETION) {
  48 + // 播放完成
  49 +
  50 + } else {
  51 + //this.isPlayerError = false
  52 + }
  53 +
  54 + }
  55 + }
  56 +
  57 +
35 setTimeout(() => { 58 setTimeout(() => {
36 this.updateData() 59 this.updateData()
37 }, 10) 60 }, 10)
  61 +
  62 +
38 } 63 }
39 64
40 async aboutToDisappear(): Promise<void> { 65 async aboutToDisappear(): Promise<void> {
@@ -65,17 +90,16 @@ export struct PlayerComponent { @@ -65,17 +90,16 @@ export struct PlayerComponent {
65 this.liveStreamType = liveStreamType 90 this.liveStreamType = liveStreamType
66 this.playUrl = playUrl 91 this.playUrl = playUrl
67 } 92 }
68 - console.error("XXXXZZZZ", 'updateData ----liveState==>' + this.playUrl)  
69 } 93 }
70 94
71 build() { 95 build() {
72 - Column() {  
73 Stack() { 96 Stack() {
74 // TODO:判断横竖屏,liveStreamType=1竖屏铺满屏幕,裁剪不拉伸,liveStreamType=0横屏正常展示 97 // TODO:判断横竖屏,liveStreamType=1竖屏铺满屏幕,裁剪不拉伸,liveStreamType=0横屏正常展示
75 if (this.liveStreamType == null || this.liveStreamType == 1) { 98 if (this.liveStreamType == null || this.liveStreamType == 1) {
76 WDPlayerRenderVLiveView({ 99 WDPlayerRenderVLiveView({
77 playerController: this.playerController, 100 playerController: this.playerController,
78 onLoad: () => { 101 onLoad: () => {
  102 + console.error("XXXXZZZZ", '-------------1--------' + this.playUrl)
79 this.isCanplay = true 103 this.isCanplay = true
80 this.contentTrackingDict() 104 this.contentTrackingDict()
81 this.playerController?.firstPlay(this.playUrl, TrackConstants.PageName.Live_Detail, this.pageParam); 105 this.playerController?.firstPlay(this.playUrl, TrackConstants.PageName.Live_Detail, this.pageParam);
@@ -94,21 +118,14 @@ export struct PlayerComponent { @@ -94,21 +118,14 @@ export struct PlayerComponent {
94 118
95 PictureLoading().visibility(this.isCanplay ? Visibility.None : Visibility.Visible) 119 PictureLoading().visibility(this.isCanplay ? Visibility.None : Visibility.Visible)
96 120
  121 +
97 } 122 }
98 .height('100%') 123 .height('100%')
99 .width('100%') 124 .width('100%')
100 .align(Alignment.Top) 125 .align(Alignment.Top)
101 .alignContent(Alignment.Top) 126 .alignContent(Alignment.Top)
102 - .onClick(() => {  
103 - if (this.liveState === 'end') {  
104 - this.isShowControl = !this.isShowControl  
105 - }  
106 - })  
107 127
108 } 128 }
109 - .height('100%')  
110 - .width('100%')  
111 - }  
112 129
113 contentTrackingDict() { 130 contentTrackingDict() {
114 this.pageParam = { 131 this.pageParam = {
@@ -13,6 +13,7 @@ export struct PlayerUIComponent { @@ -13,6 +13,7 @@ export struct PlayerUIComponent {
13 13
14 build() { 14 build() {
15 Stack() { 15 Stack() {
  16 + // 标题
16 PlayerTitleComponent() 17 PlayerTitleComponent()
17 18
18 PlayerCommentComponent() 19 PlayerCommentComponent()
@@ -172,6 +172,7 @@ export struct DetailPlayShortVideoPage { @@ -172,6 +172,7 @@ export struct DetailPlayShortVideoPage {
172 this.queryNewsInfoOfUser() 172 this.queryNewsInfoOfUser()
173 173
174 this.contentTrackingDict() 174 this.contentTrackingDict()
  175 + this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '')
175 } 176 }
176 177
177 contentTrackingDict() { 178 contentTrackingDict() {
@@ -45,7 +45,7 @@ export struct VideoChannelDetail { @@ -45,7 +45,7 @@ export struct VideoChannelDetail {
45 @Prop @Watch('autoRefreshChange') autoRefresh: number = 0 45 @Prop @Watch('autoRefreshChange') autoRefresh: number = 0
46 @Consume barBackgroundColor: Color 46 @Consume barBackgroundColor: Color
47 private swiperController: SwiperController = new SwiperController() 47 private swiperController: SwiperController = new SwiperController()
48 - @Provide showComment: boolean = false 48 + @Consume showComment: boolean
49 @Provide windowWidth: number = AppStorage.get<number>('windowWidth') || 0 49 @Provide windowWidth: number = AppStorage.get<number>('windowWidth') || 0
50 @Provide windowHeight: number = AppStorage.get<number>('windowHeight') || 0 50 @Provide windowHeight: number = AppStorage.get<number>('windowHeight') || 0
51 @Provide bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 51 @Provide bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
@@ -311,8 +311,6 @@ export struct VideoChannelDetail { @@ -311,8 +311,6 @@ export struct VideoChannelDetail {
311 .curve(Curves.initCurve(Curve.EaseIn)) 311 .curve(Curves.initCurve(Curve.EaseIn))
312 .width('100%') 312 .width('100%')
313 .height('100%') 313 .height('100%')
314 - // 扩展至所有非安全区域  
315 - .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])  
316 .onChange((index: number) => { 314 .onChange((index: number) => {
317 this.currentIndex = index 315 this.currentIndex = index
318 console.info('onChange==', index.toString()) 316 console.info('onChange==', index.toString())
1 -@Entry  
2 -@Component  
3 -struct Index {  
4 - @State message: string = 'Hello World';  
5 -  
6 - build() {  
7 - Row() {  
8 - Column() {  
9 - Text(this.message)  
10 - .fontSize(50)  
11 - .fontWeight(FontWeight.Bold)  
12 - }  
13 - .width('100%')  
14 - }  
15 - .height('100%')  
16 - }  
17 -}  
@@ -24,6 +24,8 @@ struct ChangeBindPhonePage { @@ -24,6 +24,8 @@ struct ChangeBindPhonePage {
24 lastTime: number = 0 24 lastTime: number = 0
25 pageShowTime:number = 0; 25 pageShowTime:number = 0;
26 pageHideTime:number = 0; 26 pageHideTime:number = 0;
  27 + @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
  28 + @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
27 29
28 30
29 onPageShow() { 31 onPageShow() {
@@ -58,6 +60,7 @@ struct ChangeBindPhonePage { @@ -58,6 +60,7 @@ struct ChangeBindPhonePage {
58 60
59 61
60 build() { 62 build() {
  63 + Column(){
61 Column() { 64 Column() {
62 Image($r('app.media.login_back_icon')).width(24).height(24).margin({ left: 15, top: 10 }).onClick(() => { 65 Image($r('app.media.login_back_icon')).width(24).height(24).margin({ left: 15, top: 10 }).onClick(() => {
63 router.back() 66 router.back()
@@ -138,15 +141,16 @@ struct ChangeBindPhonePage { @@ -138,15 +141,16 @@ struct ChangeBindPhonePage {
138 Row() { 141 Row() {
139 Text("确认") 142 Text("确认")
140 .layoutWeight(1) 143 .layoutWeight(1)
141 - .fontColor(this.isSubmit ?"#FFFFFFFF":"#66FFFFFF") 144 + .fontColor("#FFFFFF")
142 .borderRadius(4) 145 .borderRadius(4)
143 .fontSize(18) 146 .fontSize(18)
144 .textAlign(TextAlign.Center) 147 .textAlign(TextAlign.Center)
145 .fontWeight(FontWeight.Medium) 148 .fontWeight(FontWeight.Medium)
146 .margin({ top: 26 }) 149 .margin({ top: 26 })
147 .height(44) 150 .height(44)
148 - .backgroundColor(this.isSubmit ?"#ED2800":"#99ED2800") 151 + .backgroundColor("#ED2800")
149 .enabled(this.isSubmit ? true : false) 152 .enabled(this.isSubmit ? true : false)
  153 + .opacity(this.isSubmit ? 1: 0.6)
150 .onClick(() => { 154 .onClick(() => {
151 TrackingButton.click("changePhoneNumberPageConfirm",TrackConstants.PageName.Change_PhoneNum,TrackConstants.PageName.Change_PhoneNum) 155 TrackingButton.click("changePhoneNumberPageConfirm",TrackConstants.PageName.Change_PhoneNum,TrackConstants.PageName.Change_PhoneNum)
152 this.changeBindPhone() 156 this.changeBindPhone()
@@ -155,6 +159,10 @@ struct ChangeBindPhonePage { @@ -155,6 +159,10 @@ struct ChangeBindPhonePage {
155 .padding({ left: 25, right: 25 }) 159 .padding({ left: 25, right: 25 })
156 160
157 }.width('100%').height('100%').alignItems(HorizontalAlign.Start) 161 }.width('100%').height('100%').alignItems(HorizontalAlign.Start)
  162 + }.width("100%")
  163 + .height("100%")
  164 + .padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)})
  165 +
158 } 166 }
159 167
160 //发送验证码 168 //发送验证码
  1 +import { CommonConstants } from 'wdConstant';
  2 +import { Logger } from 'wdKit';
  3 +
  4 +const TAG = 'EmptyComponent';
  5 +
  6 +/**
  7 + * WDViewDefaultType 缺省页 无网络
  8 + */
  9 +export const enum WDViewDefaultType {
  10 + /// 0.默认
  11 + WDViewDefaultType_Default,
  12 + /// 1.无网
  13 + WDViewDefaultType_NoNetwork,
  14 +}
  15 +
  16 +/**
  17 + * 空数据/无数据
  18 + */
  19 +@Preview
  20 +@Component
  21 +export struct EmptyComponent {
  22 + @State emptyWidth: string | number = CommonConstants.FULL_PARENT;
  23 + @State emptyHeight: string | number = CommonConstants.FULL_PARENT;
  24 + @State emptyType: number = WDViewDefaultType.WDViewDefaultType_NoNetwork; // 缺省图类型,传枚举
  25 + @State emptyButton: boolean = false
  26 + @State timeNum: number = 10
  27 + /**
  28 + * The empty image width percentage setting.
  29 + */
  30 + readonly EMPTY_IMAGE_WIDTH: string = '15%';
  31 + /**
  32 + * The empty image height percentage setting.
  33 + */
  34 + readonly EMPTY_IMAGE_HEIGHT: string = '15%';
  35 + /**
  36 + * The empty data text component margin top.
  37 + */
  38 + readonly EMPTY_TIP_TEXT_MARGIN_TOP: string = '10';
  39 + /**
  40 + * The empty data text opacity.
  41 + */
  42 + readonly TEXT_OPACITY: number = 0.4;
  43 + private timer: number = -1
  44 + retry: () => void = () => {
  45 + }
  46 +
  47 + build() {
  48 + this.noProgrammeData();
  49 + }
  50 +
  51 + /**
  52 + * 无数据,空白view组件
  53 + */
  54 + @Builder
  55 + noProgrammeData() {
  56 + Column() {
  57 + Image(this.buildNoDataTipImage())
  58 + .width(160)
  59 + .height(112)
  60 + .objectFit(ImageFit.Contain)
  61 +
  62 + Text(this.emptyType !== 8 ? this.buildNoDataTip() : `${this.buildNoDataTip()}(${this.timeNum}s)`)
  63 + .fontSize($r('app.float.font_size_14'))// .fontColor('#FF999999')
  64 + .fontWeight(FontWeight.Normal)
  65 + .opacity(this.TEXT_OPACITY)
  66 + .margin({ top: this.EMPTY_TIP_TEXT_MARGIN_TOP })
  67 + .onClick((event: ClickEvent) => {
  68 + Logger.info(TAG, `noProgrammeData onClick event?.source: ${event.source}`);
  69 + })
  70 +
  71 + if (this.isShowButton()) {
  72 + if (this.emptyType !== 15) {
  73 + Button('点击重试')
  74 + .type(ButtonType.Normal)
  75 + .width(80)
  76 + .height(28)
  77 + .backgroundColor('#fffffff')
  78 + .fontColor('#FF666666')
  79 + .border({ width: 1 })
  80 + .borderColor('#FFEDEDED')
  81 + .borderRadius(4)
  82 + .fontSize($r('app.float.font_size_12'))
  83 + .margin({ top: 16 })
  84 + .padding(0)
  85 + .onClick(() => {
  86 + this.retry()
  87 + })
  88 + } else {
  89 + Button('点击重试')
  90 + .type(ButtonType.Normal)
  91 + .width(80)
  92 + .height(28)
  93 + .backgroundColor(Color.Black)
  94 + .fontColor('#FFCCCCCC')
  95 + .border({ width: 1 })
  96 + .borderColor('#4DFFFFFF')
  97 + .borderRadius(4)
  98 + .fontSize($r('app.float.font_size_12'))
  99 + .margin({ top: 16 })
  100 + .padding(0)
  101 + .onClick(() => {
  102 + this.retry()
  103 + })
  104 + }
  105 + }
  106 + }
  107 + .justifyContent(FlexAlign.Center)
  108 + .width(this.emptyWidth)
  109 + .height(this.emptyHeight)
  110 + }
  111 +
  112 + buildNoDataTip(): string {
  113 + Logger.info(TAG, "buildNoDataTip");
  114 + let contentString: string = '暂无内容'
  115 + if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoNetwork) {
  116 + contentString = '网络出小差了,请检查网络后重试'
  117 + }
  118 + return contentString
  119 + }
  120 +
  121 + buildNoDataTipImage(): Resource | string {
  122 + Logger.info(TAG, "buildNoDataTip");
  123 + let imageString: Resource | string = ""
  124 + if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoNetwork) {
  125 + imageString = $r('app.media.icon_no_net1')
  126 + }
  127 + return imageString
  128 + }
  129 +
  130 + isShowButton() {
  131 + if (this.emptyType === 1 || this.emptyType === 9 || this.emptyType === 15) {
  132 + return true
  133 + } else {
  134 + return false
  135 + }
  136 + }
  137 +}
  138 +
@@ -23,6 +23,8 @@ struct ForgetPasswordPage { @@ -23,6 +23,8 @@ struct ForgetPasswordPage {
23 @State pageTitle:string = '找回密码'; 23 @State pageTitle:string = '找回密码';
24 @State isForgetPassword: number = 0 //是否是登录页忘记密码过来的,标题不一样 24 @State isForgetPassword: number = 0 //是否是登录页忘记密码过来的,标题不一样
25 @State codeStateSuccess:boolean=false 25 @State codeStateSuccess:boolean=false
  26 + @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
  27 + @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
26 onCodeSend() { 28 onCodeSend() {
27 if (this.isCodeSend) { 29 if (this.isCodeSend) {
28 this.sendVerifyCode() 30 this.sendVerifyCode()
@@ -43,6 +45,7 @@ struct ForgetPasswordPage { @@ -43,6 +45,7 @@ struct ForgetPasswordPage {
43 45
44 46
45 build() { 47 build() {
  48 + Column(){
46 Column() { 49 Column() {
47 Image($r('app.media.login_back_icon')).width(24).height(24).margin({ left: 15, top: 10 }).onClick(() => { 50 Image($r('app.media.login_back_icon')).width(24).height(24).margin({ left: 15, top: 10 }).onClick(() => {
48 router.back() 51 router.back()
@@ -60,21 +63,30 @@ struct ForgetPasswordPage { @@ -60,21 +63,30 @@ struct ForgetPasswordPage {
60 Row() { 63 Row() {
61 Text("确认") 64 Text("确认")
62 .layoutWeight(1) 65 .layoutWeight(1)
63 - .fontColor(this.isSubmit ?"#FFFFFFFF":"#66FFFFFF") 66 + .fontColor("#FFFFFF")
64 .borderRadius(4) 67 .borderRadius(4)
65 .fontSize(18) 68 .fontSize(18)
66 .textAlign(TextAlign.Center) 69 .textAlign(TextAlign.Center)
67 .fontWeight(FontWeight.Medium) 70 .fontWeight(FontWeight.Medium)
68 .margin({ top: 26 }) 71 .margin({ top: 26 })
69 .height(44) 72 .height(44)
70 - .backgroundColor(this.isSubmit ?"#ED2800":"#99ED2800") 73 + .backgroundColor("#ED2800")
71 .enabled(this.isSubmit ? true : false) 74 .enabled(this.isSubmit ? true : false)
  75 + .opacity(this.isSubmit ? 1: 0.6)
72 .onClick(() => { 76 .onClick(() => {
73 this.checkVerifyCode() 77 this.checkVerifyCode()
74 }) 78 })
75 }.padding({ left: 25, right: 25 }).width('100%') 79 }.padding({ left: 25, right: 25 }).width('100%')
76 80
77 - }.width('100%').height('100%').alignItems(HorizontalAlign.Start) 81 + }.width('100%')
  82 + .height('100%')
  83 + .alignItems(HorizontalAlign.Start)
  84 + .backgroundColor(Color.White)
  85 +
  86 + }.width("100%")
  87 + .height("100%")
  88 + .padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)})
  89 +
78 } 90 }
79 91
80 aboutToAppear() { 92 aboutToAppear() {
@@ -27,6 +27,8 @@ const TAG = "LoginPage" @@ -27,6 +27,8 @@ const TAG = "LoginPage"
27 @Entry 27 @Entry
28 @Component 28 @Component
29 struct LoginPage { 29 struct LoginPage {
  30 + @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
  31 + @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
30 @State codeBtnState: boolean = false 32 @State codeBtnState: boolean = false
31 @State timeCount: number = 60 33 @State timeCount: number = 60
32 phoneController: TextInputController = new TextInputController() 34 phoneController: TextInputController = new TextInputController()
@@ -104,6 +106,7 @@ struct LoginPage { @@ -104,6 +106,7 @@ struct LoginPage {
104 } 106 }
105 107
106 build() { 108 build() {
  109 + Column(){
107 Stack() { 110 Stack() {
108 RelativeContainer() { 111 RelativeContainer() {
109 112
@@ -161,7 +164,7 @@ struct LoginPage { @@ -161,7 +164,7 @@ struct LoginPage {
161 Row() { 164 Row() {
162 Text("登录") 165 Text("登录")
163 .borderRadius(4) 166 .borderRadius(4)
164 - .fontColor(this.isSubmit ? "#FFFFFFFF" : "#66FFFFFF") 167 + .fontColor("#FFFFFF")
165 .fontSize(`${this.calcHeight(31)}lpx`) 168 .fontSize(`${this.calcHeight(31)}lpx`)
166 .fontWeight(400) 169 .fontWeight(400)
167 .margin({ top: `${this.calcHeight(20)}` }) 170 .margin({ top: `${this.calcHeight(20)}` })
@@ -169,7 +172,8 @@ struct LoginPage { @@ -169,7 +172,8 @@ struct LoginPage {
169 .height(44) 172 .height(44)
170 .textAlign(TextAlign.Center) 173 .textAlign(TextAlign.Center)
171 .width("100%") 174 .width("100%")
172 - .backgroundColor(this.isSubmit ? "#FFED2800" : "#99ED2800") 175 + .backgroundColor("#ED2800")
  176 + .opacity(this.isSubmit ? 1: 0.6)
173 .onClick(() => { 177 .onClick(() => {
174 if (!this.isSubmit) { 178 if (!this.isSubmit) {
175 return 179 return
@@ -241,7 +245,12 @@ struct LoginPage { @@ -241,7 +245,12 @@ struct LoginPage {
241 .visibility(this.isProtocol ? Visibility.Visible : Visibility.None) 245 .visibility(this.isProtocol ? Visibility.Visible : Visibility.None)
242 246
243 }.width('100%') 247 }.width('100%')
244 - .height('100%').backgroundColor(Color.White) 248 + .height("100%")
  249 + .backgroundColor(Color.White)
  250 + }.width("100%")
  251 + .height("100%")
  252 + .padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)})
  253 +
245 } 254 }
246 255
247 @Builder 256 @Builder
@@ -280,6 +289,7 @@ struct LoginPage { @@ -280,6 +289,7 @@ struct LoginPage {
280 .width('100%') 289 .width('100%')
281 }.padding({ left: 25, right: 25 }).width('100%').margin({ top: 36 }) 290 }.padding({ left: 25, right: 25 }).width('100%').margin({ top: 36 })
282 .visibility(this.checkCodePage ? Visibility.None : Visibility.Visible) 291 .visibility(this.checkCodePage ? Visibility.None : Visibility.Visible)
  292 + .backgroundColor(Color.White)
283 293
284 } 294 }
285 295
1 import router from '@ohos.router'; 1 import router from '@ohos.router';
2 import webview from '@ohos.web.webview'; 2 import webview from '@ohos.web.webview';
3 import { SpConstants } from 'wdConstant/Index'; 3 import { SpConstants } from 'wdConstant/Index';
4 -import { Logger, SPHelper } from 'wdKit'; 4 +import { Logger, NetworkUtil, SPHelper } from 'wdKit';
5 import { Params } from '../../../../../../../commons/wdRouter/oh_modules/wdBean/src/main/ets/bean/content/Params'; 5 import { Params } from '../../../../../../../commons/wdRouter/oh_modules/wdBean/src/main/ets/bean/content/Params';
  6 +import { EmptyComponent } from './EmptyComponent';
6 7
7 8
8 const TAG = 'LoginProtocolWebview'; 9 const TAG = 'LoginProtocolWebview';
@@ -10,7 +11,9 @@ const TAG = 'LoginProtocolWebview'; @@ -10,7 +11,9 @@ const TAG = 'LoginProtocolWebview';
10 @Entry 11 @Entry
11 @Component 12 @Component
12 struct LoginProtocolWebview { 13 struct LoginProtocolWebview {
13 - webUrl: string = '' 14 + @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
  15 + @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
  16 + @State webUrl: string = ''
14 webviewController: webview.WebviewController = new webview.WebviewController() 17 webviewController: webview.WebviewController = new webview.WebviewController()
15 userProtocol = "https://cdnpeoplefrontuat.aikan.pdnews.cn/rmrb/rmrb-protocol-zh-web/0.0.1/app/protocol-1005.html" 18 userProtocol = "https://cdnpeoplefrontuat.aikan.pdnews.cn/rmrb/rmrb-protocol-zh-web/0.0.1/app/protocol-1005.html"
16 privateProtocol = 'https://cdnpeoplefrontuat.aikan.pdnews.cn/rmrb/rmrb-protocol-zh-web/0.0.1/app/protocol-1001.html' 19 privateProtocol = 'https://cdnpeoplefrontuat.aikan.pdnews.cn/rmrb/rmrb-protocol-zh-web/0.0.1/app/protocol-1001.html'
@@ -20,6 +23,7 @@ struct LoginProtocolWebview { @@ -20,6 +23,7 @@ struct LoginProtocolWebview {
20 collectionProtocol = 'https://cdnpeoplefront.aikan.pdnews.cn/rmrb/rmrb-protocol-zh-web/0.0.1/app/protocol-1002.html'//收集个人信息明示清单 23 collectionProtocol = 'https://cdnpeoplefront.aikan.pdnews.cn/rmrb/rmrb-protocol-zh-web/0.0.1/app/protocol-1002.html'//收集个人信息明示清单
21 thirdVendorProtocol = 'https://cdnpeoplefront.aikan.pdnews.cn/rmrb/rmrb-protocol-zh-web/0.0.1/app/protocol-1004.html'//第三方信息共享清单 24 thirdVendorProtocol = 'https://cdnpeoplefront.aikan.pdnews.cn/rmrb/rmrb-protocol-zh-web/0.0.1/app/protocol-1004.html'//第三方信息共享清单
22 @State contentID:string = "0" 25 @State contentID:string = "0"
  26 + @State isConnectNetwork : boolean = NetworkUtil.isNetConnected()
23 27
24 async aboutToAppear() { 28 async aboutToAppear() {
25 if (router.getParams()) { 29 if (router.getParams()) {
@@ -31,31 +35,24 @@ struct LoginProtocolWebview { @@ -31,31 +35,24 @@ struct LoginProtocolWebview {
31 if (params.contentID == "1") { //"人民日报客户端网络服务使用协议" 35 if (params.contentID == "1") { //"人民日报客户端网络服务使用协议"
32 this.webUrl = this.userProtocol 36 this.webUrl = this.userProtocol
33 this.webUrl = await SPHelper.default.get(SpConstants.NET_SERVICE_PROTOCOL, this.userProtocol) as string 37 this.webUrl = await SPHelper.default.get(SpConstants.NET_SERVICE_PROTOCOL, this.userProtocol) as string
34 - this.webviewController.loadUrl(this.webUrl)  
35 -  
36 } else if(params.contentID == "2"){ //"人民日报客户端用户隐私协议" 38 } else if(params.contentID == "2"){ //"人民日报客户端用户隐私协议"
37 this.webUrl = this.privateProtocol 39 this.webUrl = this.privateProtocol
38 this.webUrl = await SPHelper.default.get(SpConstants.PRIVATE_PROTOCOL, this.privateProtocol) as string 40 this.webUrl = await SPHelper.default.get(SpConstants.PRIVATE_PROTOCOL, this.privateProtocol) as string
39 - this.webviewController.loadUrl(this.webUrl)  
40 }else if(params.contentID == "3"){ //注销协议 41 }else if(params.contentID == "3"){ //注销协议
41 this.webUrl = await SPHelper.default.get(SpConstants.LOGOUT_PROTOCOL, this.logoutProtocol) as string 42 this.webUrl = await SPHelper.default.get(SpConstants.LOGOUT_PROTOCOL, this.logoutProtocol) as string
42 - this.webviewController.loadUrl(this.webUrl)  
43 } else if(params.contentID == "4"){ //华为用户认证协议 43 } else if(params.contentID == "4"){ //华为用户认证协议
44 this.webUrl = this.huaweiAuthProtocol 44 this.webUrl = this.huaweiAuthProtocol
45 - this.webviewController.loadUrl(this.webUrl)  
46 } else if(params.contentID == "5"){ //收集个人信息明示清单 45 } else if(params.contentID == "5"){ //收集个人信息明示清单
47 this.webUrl = this.collectionProtocol 46 this.webUrl = this.collectionProtocol
48 - this.webviewController.loadUrl(this.webUrl)  
49 } else if(params.contentID == "6"){ //第三方信息共享清单 47 } else if(params.contentID == "6"){ //第三方信息共享清单
50 this.webUrl = this.thirdVendorProtocol 48 this.webUrl = this.thirdVendorProtocol
51 - this.webviewController.loadUrl(this.webUrl)  
52 } 49 }
53 } 50 }
54 51
55 } 52 }
56 53
57 build() { 54 build() {
58 - 55 + Column(){
59 Column() { 56 Column() {
60 Row() { 57 Row() {
61 Image($r("app.media.login_back_icon")) 58 Image($r("app.media.login_back_icon"))
@@ -73,7 +70,7 @@ struct LoginProtocolWebview { @@ -73,7 +70,7 @@ struct LoginProtocolWebview {
73 .alignItems(VerticalAlign.Center) 70 .alignItems(VerticalAlign.Center)
74 .width('100%') 71 .width('100%')
75 .height(44) 72 .height(44)
76 - 73 + if(this.isConnectNetwork){
77 Web({ src: this.webUrl, controller: this.webviewController }) 74 Web({ src: this.webUrl, controller: this.webviewController })
78 .domStorageAccess(true) 75 .domStorageAccess(true)
79 .databaseAccess(true) 76 .databaseAccess(true)
@@ -87,6 +84,17 @@ struct LoginProtocolWebview { @@ -87,6 +84,17 @@ struct LoginProtocolWebview {
87 Logger.info(TAG, 'onHttpErrorReceive event.response.getResponseCode:' + event?.response.getResponseCode()); 84 Logger.info(TAG, 'onHttpErrorReceive event.response.getResponseCode:' + event?.response.getResponseCode());
88 }) 85 })
89 .padding({bottom:this.contentID === "2" ? "40lpx" : 0 }) 86 .padding({bottom:this.contentID === "2" ? "40lpx" : 0 })
  87 + }else{
  88 + EmptyComponent({ emptyType: 1,emptyHeight:"100%" ,retry: () => {
  89 + this.isConnectNetwork = NetworkUtil.isNetConnected()
  90 + }})
  91 + .layoutWeight(1)
  92 + .width('100%')
  93 + }
90 } 94 }
  95 + }.width("100%")
  96 + .height("100%")
  97 + .padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)})
  98 +
91 } 99 }
92 } 100 }
@@ -12,6 +12,8 @@ import { TrackingPageBrowse, TrackConstants, TrackingButton } from 'wdTracking/I @@ -12,6 +12,8 @@ import { TrackingPageBrowse, TrackConstants, TrackingButton } from 'wdTracking/I
12 @Entry 12 @Entry
13 @Component 13 @Component
14 struct ModifyPasswordPage { 14 struct ModifyPasswordPage {
  15 + @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
  16 + @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
15 password_old: string = ''; 17 password_old: string = '';
16 password_new: string = ''; 18 password_new: string = '';
17 password_new_repeat: string = ''; 19 password_new_repeat: string = '';
@@ -64,9 +66,13 @@ struct ModifyPasswordPage { @@ -64,9 +66,13 @@ struct ModifyPasswordPage {
64 66
65 build() { 67 build() {
66 Column(){ 68 Column(){
  69 + Column(){
67 this.TitleBackComponent('') 70 this.TitleBackComponent('')
68 this.ModifyPasswordLayout() 71 this.ModifyPasswordLayout()
69 } 72 }
  73 + }.width("100%")
  74 + .height("100%")
  75 + .padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)})
70 76
71 } 77 }
72 78
@@ -189,30 +195,30 @@ struct ModifyPasswordPage { @@ -189,30 +195,30 @@ struct ModifyPasswordPage {
189 .height(`${this.calcHeight(85)}lpx`) 195 .height(`${this.calcHeight(85)}lpx`)
190 .alignItems(HorizontalAlign.Start) 196 .alignItems(HorizontalAlign.Start)
191 197
  198 +
192 Row() { 199 Row() {
193 - Button( { type: ButtonType.Normal, stateEffect: true }){  
194 Text("确认") 200 Text("确认")
195 - .fontColor("#fff")  
196 - .fontSize(`${this.calcHeight(35)}lpx`)  
197 - .lineHeight(`${this.calcHeight(50)}lpx`)  
198 - .opacity(this.btnStatus ?1:0.5)  
199 - }  
200 - .width('100%')  
201 - .height(`${this.calcHeight(80)}lpx`)  
202 - .backgroundColor(this.btnStatus ? '#ED2800' : '#99ED2800')  
203 - .enabled(this.btnStatus ?true:false)  
204 - .borderRadius('4vp') 201 + .layoutWeight(1)
  202 + .fontColor("#FFFFFF")
  203 + .borderRadius(4)
  204 + .fontSize(18)
  205 + .textAlign(TextAlign.Center)
  206 + .fontWeight(FontWeight.Medium)
  207 + .margin({ top: 26 })
  208 + .height(44)
  209 + .backgroundColor("#ED2800")
  210 + .enabled(this.btnStatus ? true : false)
  211 + .opacity(this.btnStatus ? 1: 0.6)
205 .onClick(() => { 212 .onClick(() => {
206 if(this.btnStatus){ 213 if(this.btnStatus){
207 TrackingButton.click("changePasswordPageConfirm",TrackConstants.PageName.Change_Passwd,TrackConstants.PageName.Change_Passwd) 214 TrackingButton.click("changePasswordPageConfirm",TrackConstants.PageName.Change_Passwd,TrackConstants.PageName.Change_Passwd)
208 this.submit() 215 this.submit()
209 } 216 }
210 }) 217 })
211 - } 218 + }.width('100%')
212 .padding({top:`${this.calcHeight(25)}lpx`}) 219 .padding({top:`${this.calcHeight(25)}lpx`})
213 .alignItems(VerticalAlign.Center) 220 .alignItems(VerticalAlign.Center)
214 .width('100%') 221 .width('100%')
215 - .height(`${this.calcHeight(120)}lpx`)  
216 222
217 Column() { 223 Column() {
218 Text("忘记密码").fontSize(12).maxLines(3).fontColor(0x999999).padding({top:`${this.calcHeight(10)}lpx`}) 224 Text("忘记密码").fontSize(12).maxLines(3).fontColor(0x999999).padding({top:`${this.calcHeight(10)}lpx`})
@@ -13,6 +13,7 @@ const TAG = "OneKeyLoginPage" @@ -13,6 +13,7 @@ const TAG = "OneKeyLoginPage"
13 @Entry 13 @Entry
14 @Component 14 @Component
15 struct OneKeyLoginPage { 15 struct OneKeyLoginPage {
  16 + @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
16 anonymousPhone: string = '' 17 anonymousPhone: string = ''
17 @State agreeProtocol: boolean = false 18 @State agreeProtocol: boolean = false
18 viewModel: LoginViewModel = new LoginViewModel() 19 viewModel: LoginViewModel = new LoginViewModel()
@@ -121,6 +122,7 @@ struct OneKeyLoginPage { @@ -121,6 +122,7 @@ struct OneKeyLoginPage {
121 }) 122 })
122 } 123 }
123 .backgroundColor("#FFFFFF") 124 .backgroundColor("#FFFFFF")
  125 + .padding({top: `${this.topSafeHeight}px`})
124 } 126 }
125 127
126 @Builder ProtocolRow() { 128 @Builder ProtocolRow() {
@@ -2,7 +2,7 @@ import ArrayList from '@ohos.util.ArrayList'; @@ -2,7 +2,7 @@ import ArrayList from '@ohos.util.ArrayList';
2 import { Params } from '../../../../../../../commons/wdRouter/oh_modules/wdBean/Index'; 2 import { Params } from '../../../../../../../commons/wdRouter/oh_modules/wdBean/Index';
3 import router from '@ohos.router'; 3 import router from '@ohos.router';
4 import { LoginViewModel } from './LoginViewModel'; 4 import { LoginViewModel } from './LoginViewModel';
5 -import { CustomToast, DateTimeUtils, Logger, SPHelper, ToastUtils } from 'wdKit'; 5 +import { BreakpointSystem, CustomToast, DateTimeUtils, Logger, SPHelper, ToastUtils } from 'wdKit';
6 import { 6 import {
7 SpConstants 7 SpConstants
8 } from '../../../../../../../commons/wdNetwork/oh_modules/wdConstant/src/main/ets/constants/SpConstants' 8 } from '../../../../../../../commons/wdNetwork/oh_modules/wdConstant/src/main/ets/constants/SpConstants'
@@ -74,6 +74,19 @@ export struct SettingPasswordPage { @@ -74,6 +74,19 @@ export struct SettingPasswordPage {
74 pageHideResetTime:number = 0; 74 pageHideResetTime:number = 0;
75 pageShowSetTime:number = 0; 75 pageShowSetTime:number = 0;
76 pageHideSetTime:number = 0; 76 pageHideSetTime:number = 0;
  77 + @StorageProp('currentBreakpoint') @Watch("currentChanged")currentBreakpoint: string = 'sm';
  78 + private breakpointSystem = new BreakpointSystem();
  79 + @State percent:number = 1
  80 + @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
  81 + @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
  82 +
  83 + currentChanged(){
  84 + if(this.currentBreakpoint == "md" || this.currentBreakpoint == "lg"){
  85 + this.percent = 0.7
  86 + }else {
  87 + this.percent = 1
  88 + }
  89 + }
77 90
78 onPageShow(): void { 91 onPageShow(): void {
79 if (this.pageType === 0){//重置密码 92 if (this.pageType === 0){//重置密码
@@ -83,6 +96,10 @@ export struct SettingPasswordPage { @@ -83,6 +96,10 @@ export struct SettingPasswordPage {
83 } 96 }
84 } 97 }
85 98
  99 + calcHeight(value:number): number{
  100 + return value * this.percent
  101 + }
  102 +
86 onPageHide(): void { 103 onPageHide(): void {
87 if (this.pageType === 0){ 104 if (this.pageType === 0){
88 this.pageHideResetTime = DateTimeUtils.getTimeStamp() 105 this.pageHideResetTime = DateTimeUtils.getTimeStamp()
@@ -104,7 +121,13 @@ export struct SettingPasswordPage { @@ -104,7 +121,13 @@ export struct SettingPasswordPage {
104 } 121 }
105 } 122 }
106 123
  124 + aboutToDisappear(): void {
  125 + this.breakpointSystem.unregister();
  126 + }
  127 +
107 aboutToAppear() { 128 aboutToAppear() {
  129 + this.breakpointSystem.register();
  130 + this.currentChanged()
108 let params:SettingPasswordParams = router.getParams() as SettingPasswordParams; 131 let params:SettingPasswordParams = router.getParams() as SettingPasswordParams;
109 this.pageId = parseInt(params.pageID); 132 this.pageId = parseInt(params.pageID);
110 this.getPageListData(this.pageId) 133 this.getPageListData(this.pageId)
@@ -147,10 +170,48 @@ export struct SettingPasswordPage { @@ -147,10 +170,48 @@ export struct SettingPasswordPage {
147 } 170 }
148 171
149 build() { 172 build() {
150 - Navigation() { 173 + Column(){
  174 + Column(){
  175 + this.TitleBackComponent('')
151 this.settingList() //滑动区域 176 this.settingList() //滑动区域
152 - }.titleMode(NavigationTitleMode.Mini)  
153 - .title('') 177 + }
  178 + }.width("100%")
  179 + .height("100%")
  180 + .padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)})
  181 +
  182 + }
  183 +
  184 + @Builder TitleBackComponent(title:string){
  185 + RelativeContainer() {
  186 + Text(title)
  187 + .fontColor('#FF333333')
  188 + .fontSize(`${this.calcHeight(18)}`)
  189 + .textAlign(TextAlign.Center)
  190 + .height(`${this.calcHeight(44)}`)
  191 + .alignRules({
  192 + top: { anchor: "__container__", align: VerticalAlign.Top },
  193 + left: { anchor: "__container__", align: HorizontalAlign.Start },
  194 + right: { anchor: "__container__", align: HorizontalAlign.End },
  195 +
  196 + })
  197 + .id('titleContent')
  198 + Image($r("app.media.login_back_icon"))
  199 + .objectFit(ImageFit.Auto)
  200 + .height(`${this.calcHeight(24)}`)
  201 + .width(`${this.calcHeight(24)}`)
  202 + .margin({
  203 + left: `${this.calcHeight(16)}`, top: `${this.calcHeight(8)}`
  204 + })
  205 + .alignRules({
  206 + top: { anchor: "__container__", align: VerticalAlign.Top },
  207 + left: { anchor: "__container__", align: HorizontalAlign.Start },
  208 + })
  209 + .onClick(() => {
  210 + router.back()
  211 + })
  212 + .id('backImage')
  213 +
  214 + }.height(`${this.calcHeight(44)}`)
154 } 215 }
155 216
156 // 页面布局 217 // 页面布局
@@ -176,7 +237,7 @@ export struct SettingPasswordPage { @@ -176,7 +237,7 @@ export struct SettingPasswordPage {
176 }) 237 })
177 } 238 }
178 }.width('100%') 239 }.width('100%')
179 - .padding({ left:"31lpx",right:"31lpx",top:"131lpx" }) 240 + .padding({ left:`${this.calcHeight(31)}lpx`,right:`${this.calcHeight(31)}lpx`,top:`${this.calcHeight(131)}lpx` })
180 .height('100%') 241 .height('100%')
181 } 242 }
182 243
@@ -185,10 +246,10 @@ export struct SettingPasswordPage { @@ -185,10 +246,10 @@ export struct SettingPasswordPage {
185 // 标题 246 // 标题
186 @Builder getTitleCell(item: AccoutPageDataModel, alignTitle: HorizontalAlign) { 247 @Builder getTitleCell(item: AccoutPageDataModel, alignTitle: HorizontalAlign) {
187 Column() { 248 Column() {
188 - Text(item.compTitle).fontWeight(FontWeight.Bold).fontSize(20).maxLines(1) 249 + Text(item.compTitle).fontWeight(FontWeight.Bold).fontSize(`${this.calcHeight(20)}`).maxLines(1)
189 } 250 }
190 .width('100%') 251 .width('100%')
191 - .height('75lpx') 252 + .height(`${this.calcHeight(75)}lpx`)
192 .alignItems(alignTitle) 253 .alignItems(alignTitle)
193 } 254 }
194 255
@@ -210,12 +271,12 @@ export struct SettingPasswordPage { @@ -210,12 +271,12 @@ export struct SettingPasswordPage {
210 }) 271 })
211 } 272 }
212 .alignItems(VerticalAlign.Center) 273 .alignItems(VerticalAlign.Center)
213 - .height('80lpx') 274 + .height(`${this.calcHeight(80)}lpx`)
214 .backgroundColor('#f5f5f5') 275 .backgroundColor('#f5f5f5')
215 - .borderRadius('4vp') 276 + .borderRadius(`${this.calcHeight(4)}`)
216 } 277 }
217 .width('100%') 278 .width('100%')
218 - .height('110lpx') 279 + .height(`${this.calcHeight(110)}lpx`)
219 .backgroundColor(0xffffff0) 280 .backgroundColor(0xffffff0)
220 .alignItems(VerticalAlign.Center) 281 .alignItems(VerticalAlign.Center)
221 } 282 }
@@ -235,12 +296,12 @@ export struct SettingPasswordPage { @@ -235,12 +296,12 @@ export struct SettingPasswordPage {
235 }) 296 })
236 } 297 }
237 .alignItems(VerticalAlign.Center) 298 .alignItems(VerticalAlign.Center)
238 - .height('80lpx') 299 + .height(`${this.calcHeight(80)}lpx`)
239 .backgroundColor('#f5f5f5') 300 .backgroundColor('#f5f5f5')
240 - .borderRadius('4vp') 301 + .borderRadius(`${this.calcHeight(4)}`)
241 } 302 }
242 .width('100%') 303 .width('100%')
243 - .height('110lpx') 304 + .height(`${this.calcHeight(110)}lpx`)
244 .backgroundColor(0xffffff0) 305 .backgroundColor(0xffffff0)
245 .alignItems(VerticalAlign.Center) 306 .alignItems(VerticalAlign.Center)
246 } 307 }
@@ -249,7 +310,7 @@ export struct SettingPasswordPage { @@ -249,7 +310,7 @@ export struct SettingPasswordPage {
249 @Builder getCodeCell(item: AccoutPageDataModel) { 310 @Builder getCodeCell(item: AccoutPageDataModel) {
250 Row() { 311 Row() {
251 Stack() { 312 Stack() {
252 - Image($r('app.media.get_code_bg')).width('100%').borderRadius('4vp') 313 + Image($r('app.media.get_code_bg')).width('100%').borderRadius(`${this.calcHeight(4)}`)
253 Row() { 314 Row() {
254 TextInput({ placeholder: item.inputPlacholder }) 315 TextInput({ placeholder: item.inputPlacholder })
255 .placeholderColor("#CCCCCC") 316 .placeholderColor("#CCCCCC")
@@ -264,10 +325,10 @@ export struct SettingPasswordPage { @@ -264,10 +325,10 @@ export struct SettingPasswordPage {
264 .fontColor('#da3e22') 325 .fontColor('#da3e22')
265 } 326 }
266 .width('100%') 327 .width('100%')
267 - }.height('80lpx') 328 + }.height(`${this.calcHeight(80)}lpx`)
268 } 329 }
269 .width('100%') 330 .width('100%')
270 - .height('110lpx') 331 + .height(`${this.calcHeight(110)}lpx`)
271 .backgroundColor(0xffffff0) 332 .backgroundColor(0xffffff0)
272 .alignItems(VerticalAlign.Center) 333 .alignItems(VerticalAlign.Center)
273 } 334 }
@@ -275,7 +336,7 @@ export struct SettingPasswordPage { @@ -275,7 +336,7 @@ export struct SettingPasswordPage {
275 // desc 336 // desc
276 @Builder getDescCell(item: AccoutPageDataModel, alignTitle: HorizontalAlign) { 337 @Builder getDescCell(item: AccoutPageDataModel, alignTitle: HorizontalAlign) {
277 Column() { 338 Column() {
278 - Text(item.compDesc).fontSize(12).maxLines(3).fontColor(0x999999).padding({top:'10lpx'}) 339 + Text(item.compDesc).fontSize(`${this.calcHeight(12)}`).maxLines(3).fontColor(0x999999).padding({top:`${this.calcHeight(10)}lpx`})
279 .onClick(()=>{ 340 .onClick(()=>{
280 if (item.compDesc == '忘记密码') { 341 if (item.compDesc == '忘记密码') {
281 this.showToastTip('密码不符合密码规范') 342 this.showToastTip('密码不符合密码规范')
@@ -283,37 +344,39 @@ export struct SettingPasswordPage { @@ -283,37 +344,39 @@ export struct SettingPasswordPage {
283 }) 344 })
284 } 345 }
285 .width('100%') 346 .width('100%')
286 - .height('85lpx') 347 + .height(`${this.calcHeight(85)}lpx`)
287 .alignItems(alignTitle) 348 .alignItems(alignTitle)
288 } 349 }
289 350
290 // 按钮 351 // 按钮
291 @Builder getButtonCell(item: AccoutPageDataModel) { 352 @Builder getButtonCell(item: AccoutPageDataModel) {
292 Row() { 353 Row() {
293 - Button(item.compButtonTitle, { type: ButtonType.Normal, stateEffect: true })  
294 - .width('100%')  
295 - .height('80lpx')  
296 - .backgroundColor(this.btnStatus ? '#da3e22' : '#e5856d')  
297 - .enabled(this.btnStatus ?true:false)  
298 - .fontColor('#fff')  
299 - .borderRadius('4vp') 354 + Text(item.compButtonTitle)
  355 + .layoutWeight(1)
  356 + .fontColor("#FFFFFF")
  357 + .borderRadius(`${this.calcHeight(4)}`)
  358 + .fontSize(`${this.calcHeight(18)}`)
  359 + .textAlign(TextAlign.Center)
  360 + .fontWeight(FontWeight.Medium)
  361 + .margin({ top: `${this.calcHeight(26)}` })
  362 + .height(`${this.calcHeight(44)}`)
  363 + .backgroundColor("#ED2800")
  364 + .enabled(this.btnStatus ? true : false)
  365 + .opacity(this.btnStatus ? 1: 0.6)
300 .onClick(() => { 366 .onClick(() => {
301 this.buttonClick() 367 this.buttonClick()
302 }) 368 })
303 - }  
304 - .padding({top:'25lpx'})  
305 - .alignItems(VerticalAlign.Center) 369 + }.padding({top:`${this.calcHeight(25)}lpx`})
306 .width('100%') 370 .width('100%')
307 - .height('120lpx')  
308 } 371 }
309 372
310 // 标题 373 // 标题
311 @Builder getLogoCell(item: AccoutPageDataModel) { 374 @Builder getLogoCell(item: AccoutPageDataModel) {
312 Column() { 375 Column() {
313 - Image(item.compLogo).height('150lpx').width('150lpx') 376 + Image(item.compLogo).height(`${this.calcHeight(150)}lpx`).width(`${this.calcHeight(150)}lpx`)
314 } 377 }
315 .width('100%') 378 .width('100%')
316 - .height('200lpx') 379 + .height(`${this.calcHeight(200)}lpx`)
317 } 380 }
318 381
319 /***************************** 事件处理 ******************************************/ 382 /***************************** 事件处理 ******************************************/
@@ -24,6 +24,8 @@ struct VerifyPhoneNumberPage { @@ -24,6 +24,8 @@ struct VerifyPhoneNumberPage {
24 isFirst:boolean=true//是否第一次获取验证码 24 isFirst:boolean=true//是否第一次获取验证码
25 pageShowTime:number = 0; 25 pageShowTime:number = 0;
26 pageHideTime:number = 0; 26 pageHideTime:number = 0;
  27 + @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
  28 + @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
27 29
28 onCodeSend() { 30 onCodeSend() {
29 if (this.isCodeSend) { 31 if (this.isCodeSend) {
@@ -60,6 +62,7 @@ struct VerifyPhoneNumberPage { @@ -60,6 +62,7 @@ struct VerifyPhoneNumberPage {
60 62
61 63
62 build() { 64 build() {
  65 + Column(){
63 Column() { 66 Column() {
64 Image($r('app.media.login_back_icon')).width(24).height(24).margin({ left: 15, top: 10 }).onClick(() => { 67 Image($r('app.media.login_back_icon')).width(24).height(24).margin({ left: 15, top: 10 }).onClick(() => {
65 router.back() 68 router.back()
@@ -155,6 +158,9 @@ struct VerifyPhoneNumberPage { @@ -155,6 +158,9 @@ struct VerifyPhoneNumberPage {
155 }.padding({ left: 25, right: 25 }).width('100%') 158 }.padding({ left: 25, right: 25 }).width('100%')
156 159
157 }.width('100%').height('100%').alignItems(HorizontalAlign.Start) 160 }.width('100%').height('100%').alignItems(HorizontalAlign.Start)
  161 + }.width("100%")
  162 + .height("100%")
  163 + .padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)})
158 } 164 }
159 165
160 //发送验证码 166 //发送验证码
1 { 1 {
2 "src": [ 2 "src": [
3 - "pages/Index",  
4 "pages/login/LoginPage", 3 "pages/login/LoginPage",
5 "pages/login/ForgetPasswordPage", 4 "pages/login/ForgetPasswordPage",
6 "pages/login/LoginProtocolWebview", 5 "pages/login/LoginProtocolWebview",
@@ -43,22 +43,26 @@ export struct WDPlayerRenderLiveView { @@ -43,22 +43,26 @@ export struct WDPlayerRenderLiveView {
43 private playerController?: WDAliPlayerController; 43 private playerController?: WDAliPlayerController;
44 private xComponentController: XComponentController = new XComponentController(); 44 private xComponentController: XComponentController = new XComponentController();
45 onLoad?: ((event?: object) => void); 45 onLoad?: ((event?: object) => void);
46 - videoWidth: number = 0  
47 - videoHeight: number = 0 46 + @State videoWidth: number = 0
  47 + @State videoHeight: number = 0
  48 + @State videoRatio: number = 16 / 9
48 @State selfSize: Size = new Size('100%', '100%'); 49 @State selfSize: Size = new Size('100%', '100%');
49 private insId: string = "WDPlayerRenderLiveView" + insIndex; 50 private insId: string = "WDPlayerRenderLiveView" + insIndex;
50 51
  52 +
  53 +
51 aboutToAppear() { 54 aboutToAppear() {
52 MGPlayRenderViewIns.add(); 55 MGPlayRenderViewIns.add();
53 insIndex++; 56 insIndex++;
54 if (!this.playerController) { 57 if (!this.playerController) {
55 return 58 return
56 } 59 }
57 - 60 + //this.init = true
58 this.playerController.onVideoSizeChange = (width: number, height: number) => { 61 this.playerController.onVideoSizeChange = (width: number, height: number) => {
59 // console.log(`WDPlayerRenderView onVideoSizeChange width:${width} videoTop:${height}`) 62 // console.log(`WDPlayerRenderView onVideoSizeChange width:${width} videoTop:${height}`)
60 this.videoWidth = width; 63 this.videoWidth = width;
61 this.videoHeight = height; 64 this.videoHeight = height;
  65 + this.videoRatio = width / height
62 this.updateLayout() 66 this.updateLayout()
63 } 67 }
64 } 68 }
@@ -80,9 +84,9 @@ export struct WDPlayerRenderLiveView { @@ -80,9 +84,9 @@ export struct WDPlayerRenderLiveView {
80 .onLoad(async (event) => { 84 .onLoad(async (event) => {
81 Logger.info(TAG, 'onLoad') 85 Logger.info(TAG, 'onLoad')
82 let surfaceId = this.xComponentController.getXComponentSurfaceId() 86 let surfaceId = this.xComponentController.getXComponentSurfaceId()
83 - this.xComponentController.setXComponentSurfaceSize({  
84 - surfaceWidth: 1920,  
85 - surfaceHeight: 720 87 + this.xComponentController.setXComponentSurfaceRect({
  88 + surfaceWidth: this.videoWidth,
  89 + surfaceHeight: this.videoHeight
86 }); 90 });
87 if (enableAliPlayer) { 91 if (enableAliPlayer) {
88 this.playerController?.setSurfaceId(this.insId) 92 this.playerController?.setSurfaceId(this.insId)
@@ -93,8 +97,8 @@ export struct WDPlayerRenderLiveView { @@ -93,8 +97,8 @@ export struct WDPlayerRenderLiveView {
93 this.onLoad(event) 97 this.onLoad(event)
94 } 98 }
95 }) 99 })
96 - .width(this.selfSize.width)  
97 - .height(this.selfSize.height) 100 + // .width(this.selfSize.width)
  101 + // .height(this.selfSize.height)
98 } 102 }
99 .id(this.insId) 103 .id(this.insId)
100 .onAreaChange(() => { 104 .onAreaChange(() => {
@@ -107,15 +111,40 @@ export struct WDPlayerRenderLiveView { @@ -107,15 +111,40 @@ export struct WDPlayerRenderLiveView {
107 } 111 }
108 112
109 updateLayout() { 113 updateLayout() {
  114 +
110 let info = componentUtils.getRectangleById(this.insId); 115 let info = componentUtils.getRectangleById(this.insId);
111 - if (info.size.width > 0 && info.size.height > 0 && this.videoHeight > 0 && this.videoWidth > 0) {  
112 - if (info.size.width / info.size.height > this.videoWidth / this.videoHeight) {  
113 - let scale = info.size.height / this.videoHeight;  
114 - this.selfSize = new Size((this.videoWidth * scale / info.size.width) * 100 + "%", '100%');  
115 - } else {  
116 - let scale = info.size.width / this.videoWidth;  
117 - this.selfSize = new Size('100%', (this.videoHeight * scale / info.size.height) * 100 + "%"); 116 + Logger.debug(TAG, "播放器区域变化: " + JSON.stringify(info))
  117 +
  118 + Logger.debug(TAG, "xComponent rect: " + JSON.stringify(this.xComponentController.getXComponentSurfaceRect()))
  119 +
  120 + if (info.size.width > 0 && info.size.height > 0) {
  121 +
  122 + // 竖屏
  123 + if (this.videoHeight > 0 && this.videoWidth > 0 && this.videoWidth < this.videoHeight) {
  124 + let ratio = this.videoWidth / this.videoHeight
  125 + const height = info.size.width / ratio
  126 +
  127 + // 竖屏,缩放高度大于 视频区域高度
  128 + if (height > info.size.height) {
  129 +
  130 + Logger.debug(TAG, "ratio = " + ratio + " ==> new height = " + height)
  131 +
  132 + Logger.debug(TAG, "高度固定,求宽度: " + info.size.height * ratio)
  133 +
  134 + this.xComponentController.setXComponentSurfaceRect({
  135 + surfaceWidth: info.size.height * ratio,
  136 + surfaceHeight: info.size.height
  137 + });
  138 + return
118 } 139 }
119 } 140 }
  141 +
  142 + this.xComponentController.setXComponentSurfaceRect({
  143 + surfaceWidth: info.size.width,
  144 + surfaceHeight: info.size.height
  145 + });
  146 + }
120 } 147 }
  148 +
  149 +
121 } 150 }
@@ -2,6 +2,7 @@ import { ContentDetailDTO, ContentDTO, PageInfoDTO, ShareInfoDTO, TopicInfo } fr @@ -2,6 +2,7 @@ import { ContentDetailDTO, ContentDTO, PageInfoDTO, ShareInfoDTO, TopicInfo } fr
2 import { SharePosterItemBean } from 'wdBean/src/main/ets/bean/detail/SharePosterItemBean'; 2 import { SharePosterItemBean } from 'wdBean/src/main/ets/bean/detail/SharePosterItemBean';
3 import { ShareScene, ShareType, WDShareBase } from 'wdShareBase/Index'; 3 import { ShareScene, ShareType, WDShareBase } from 'wdShareBase/Index';
4 import { ShareContentType } from 'wdShareBase/src/main/ets/Constant'; 4 import { ShareContentType } from 'wdShareBase/src/main/ets/Constant';
  5 +import { DeepLinkUtil } from './utils/DeepLinkUtil';
5 6
6 export class WDShare { 7 export class WDShare {
7 8
@@ -17,6 +18,7 @@ export class WDShare { @@ -17,6 +18,7 @@ export class WDShare {
17 title: content.shareInfo.shareTitle, 18 title: content.shareInfo.shareTitle,
18 desc: content.shareInfo.shareSummary, 19 desc: content.shareInfo.shareSummary,
19 link: content.shareInfo.shareUrl, 20 link: content.shareInfo.shareUrl,
  21 + deeplink:DeepLinkUtil.generateDeepLinkWithConent(content),
20 } 22 }
21 }) 23 })
22 } 24 }
@@ -32,6 +34,7 @@ export class WDShare { @@ -32,6 +34,7 @@ export class WDShare {
32 title: program.shareInfo.shareTitle, 34 title: program.shareInfo.shareTitle,
33 desc: program.shareInfo.shareSummary, 35 desc: program.shareInfo.shareSummary,
34 link: program.shareInfo.shareUrl, 36 link: program.shareInfo.shareUrl,
  37 + deeplink:DeepLinkUtil.generateDeepLinkWithProgram(program),
35 } 38 }
36 }) 39 })
37 } 40 }
  1 +import { ContentDetailDTO, ContentDTO } from 'wdBean/Index';
  2 +import { BreakpointSystem } from 'wdKit/Index';
  3 +import { ContentType } from 'wdRouter/Index';
  4 +
  5 +export class DeepLinkUtil {
  6 +
  7 + private static DEEP_LINK_PREFIX = "rmrbapp:rmrb.app/openwith"
  8 +
  9 + static generateDeepLinkWithConent(content: ContentDetailDTO): string {
  10 +
  11 + return DeepLinkUtil.generate(content.newsType, content.newsId +'', content.reLInfo?.relId, content.newsLinkUrl)
  12 + }
  13 +
  14 + static generateDeepLinkWithProgram(content: ContentDTO) {
  15 +
  16 + return DeepLinkUtil.generate(Number(content.objectType), content.objectId +'', content.relId, content.linkUrl)
  17 + }
  18 +
  19 + private static generate(contentType: number, contentId?: string, relId?: string, link?: string): string {
  20 + let deeplink = DeepLinkUtil.DEEP_LINK_PREFIX
  21 +
  22 + let pubParam = `&contentId=${contentId}}&relId=${relId}&skipType=1`
  23 +
  24 + let type: ContentType = Number(contentType)
  25 + switch (type) {
  26 + case ContentType.Video:
  27 + deeplink += "?type=video&subType=vod_video"
  28 + break
  29 + case ContentType.Live:
  30 + deeplink += "?type=live"
  31 + break
  32 + case ContentType.ImageText:
  33 + if (link && link.length) {
  34 + deeplink += "?type=article&subType=h5"
  35 + deeplink += "&url=" + encodeURIComponent(link)
  36 + } else {
  37 + deeplink += "type=article&subType=h5_template_article"
  38 + }
  39 + break
  40 + case ContentType.DynamicImageText:
  41 + deeplink += "?type=dynamic"
  42 + break
  43 + case ContentType.DynamicVideo:
  44 + deeplink += "?type=dynamic"
  45 + break
  46 + case ContentType.Pictures:
  47 + deeplink += "?type=picture"
  48 + break
  49 + case ContentType.Audio:
  50 + deeplink += "?type=audio"
  51 + break
  52 + case ContentType.Ask:
  53 + deeplink += "?type=ask"
  54 + break
  55 + default:
  56 + pubParam = ""
  57 + break;
  58 + }
  59 +
  60 + deeplink += pubParam
  61 + return deeplink
  62 + }
  63 +
  64 +
  65 +}
1 import AbilityConstant from '@ohos.app.ability.AbilityConstant'; 1 import AbilityConstant from '@ohos.app.ability.AbilityConstant';
2 import app from '@system.app'; 2 import app from '@system.app';
3 -import hilog from '@ohos.hilog';  
4 import UIAbility from '@ohos.app.ability.UIAbility'; 3 import UIAbility from '@ohos.app.ability.UIAbility';
5 import Want from '@ohos.app.ability.Want'; 4 import Want from '@ohos.app.ability.Want';
6 import window from '@ohos.window'; 5 import window from '@ohos.window';
7 import { BusinessError } from '@ohos.base'; 6 import { BusinessError } from '@ohos.base';
8 -import { DeviceUtil, EmitterEventId, EmitterUtils, WindowModel } from 'wdKit'; 7 +import { DeviceUtil, EmitterEventId, EmitterUtils, Logger, SPHelper, WindowModel } from 'wdKit';
9 import { ConfigurationConstant } from '@kit.AbilityKit'; 8 import { ConfigurationConstant } from '@kit.AbilityKit';
10 import { StartupManager } from '../startupmanager/StartupManager'; 9 import { StartupManager } from '../startupmanager/StartupManager';
11 -import { UIContext } from '@ohos.arkui.UIContext';  
12 10
13 let floatWindowClass: window.Window | null = null; 11 let floatWindowClass: window.Window | null = null;
  12 +const TAG = 'EntryAbility'
14 13
15 export default class EntryAbility extends UIAbility { 14 export default class EntryAbility extends UIAbility {
16 onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { 15 onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void {
17 StartupManager.sharedInstance().appOnCreate(want, launchParam, this.context) 16 StartupManager.sharedInstance().appOnCreate(want, launchParam, this.context)
18 - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); 17 + if (SPHelper.default.getSync('isPrivacy', true)) {
  18 + // 同意隐私协议,这里直接初始化。TODO 耗时梳理
  19 + StartupManager.sharedInstance().appAgreedProtocol()
  20 + }
  21 + Logger.info(TAG, 'Ability onCreate');
19 22
20 // 还没深色模式需求,暂直接不跟随系统。 23 // 还没深色模式需求,暂直接不跟随系统。
21 this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_LIGHT); 24 this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_LIGHT);
@@ -32,13 +35,13 @@ export default class EntryAbility extends UIAbility { @@ -32,13 +35,13 @@ export default class EntryAbility extends UIAbility {
32 } 35 }
33 36
34 onDestroy(): void { 37 onDestroy(): void {
35 - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); 38 + Logger.info(TAG, 'Ability onDestroy');
36 StartupManager.sharedInstance().appOnDestory() 39 StartupManager.sharedInstance().appOnDestory()
37 } 40 }
38 41
39 onWindowStageCreate(windowStage: window.WindowStage): void { 42 onWindowStageCreate(windowStage: window.WindowStage): void {
40 // Main window is created, set main page for this ability 43 // Main window is created, set main page for this ability
41 - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); 44 + Logger.info(TAG, 'Ability onWindowStageCreate');
42 WindowModel.shared.setWindowStage(windowStage); 45 WindowModel.shared.setWindowStage(windowStage);
43 // 2. 获取布局避让遮挡的区域 46 // 2. 获取布局避让遮挡的区域
44 const windowClass: window.Window = windowStage.getMainWindowSync(); // 获取应用主窗口 47 const windowClass: window.Window = windowStage.getMainWindowSync(); // 获取应用主窗口
@@ -57,72 +60,50 @@ export default class EntryAbility extends UIAbility { @@ -57,72 +60,50 @@ export default class EntryAbility extends UIAbility {
57 // 音频悬浮窗初始移动位置604为ui高度 60 // 音频悬浮窗初始移动位置604为ui高度
58 let initMoveY = vp2px(604) 61 let initMoveY = vp2px(604)
59 62
60 -  
61 - // 在普通phone/折叠屏/tablet设备上以沉浸式(全屏)启动  
62 - if (DeviceUtil.isPhone() || DeviceUtil.isTablet()) {  
63 - // 设置窗口的布局是否为沉浸式布局  
64 - // 沉浸式布局是指布局不避让状态栏与导航栏,组件可能产生与其重叠的情况。  
65 - // 非沉浸式布局是指布局避让状态栏与导航栏,组件不会与其重叠。  
66 - // windowClass.setWindowLayoutFullScreen(true)  
67 - // 设置窗口全屏模式时窗口内导航栏、状态栏的属性  
68 - // windowClass.setWindowSystemBarProperties({  
69 - // statusBarContentColor: "#FFFFFF"  
70 - // })  
71 -  
72 - // 设置启动时窗口的显示方向属性,  
73 - // 普通phone以PORTRAIT/竖屏显示模式启动  
74 - // 折叠屏和tablet是以AUTO_ROTATION_RESTRICTED/受开关控制的自动旋转模式启动  
75 - WindowModel.shared.setPreferredOrientation(window.Orientation.PORTRAIT)  
76 - .then(() => {  
77 - hilog.info(0x0000, 'testTag', 'setPreferredOrientation Succeeded');  
78 - })  
79 - .catch((err: Error) => {  
80 - hilog.error(0x0000, 'testTag',  
81 - `setPreferredOrientation catch, error error.name : ${err.name}, error.message:${err.message}`);  
82 - })  
83 - } 63 + this.onWindowSetup(windowClass)
84 64
85 //../../../../../../features/wdLogin/src/main/ets/pages/launchPage/LaunchPage 65 //../../../../../../features/wdLogin/src/main/ets/pages/launchPage/LaunchPage
86 windowStage.loadContent('pages/launchPage/LaunchPage', (err, data) => { 66 windowStage.loadContent('pages/launchPage/LaunchPage', (err, data) => {
87 if (err.code) { 67 if (err.code) {
88 - hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); 68 + Logger.error(TAG, 'Failed to load the content. Cause: ' + JSON.stringify(err) ?? '');
89 return; 69 return;
90 } 70 }
91 - hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? ''); 71 + Logger.info(TAG, 'Succeeded in loading the content. Data: ' + JSON.stringify(data) ?? '');
92 }); 72 });
93 // 1.创建悬浮窗 73 // 1.创建悬浮窗
94 windowStage.createSubWindow('subWindow', (err: BusinessError, data) => { 74 windowStage.createSubWindow('subWindow', (err: BusinessError, data) => {
95 let errCode: number = err.code; 75 let errCode: number = err.code;
96 if (errCode) { 76 if (errCode) {
97 - console.error('floatWindowClass Failed to create the subwindow. Cause: ' + JSON.stringify(err)); 77 + Logger.error('floatWindowClass Failed to create the subwindow. Cause: ' + JSON.stringify(err));
98 return; 78 return;
99 } 79 }
100 - console.info('floatWindowClass Succeeded in creating the subwindow. Data: ' + JSON.stringify(data)); 80 + Logger.info('floatWindowClass Succeeded in creating the subwindow. Data: ' + JSON.stringify(data));
101 floatWindowClass = data; 81 floatWindowClass = data;
102 AppStorage.setOrCreate('floatWindowClass', floatWindowClass); 82 AppStorage.setOrCreate('floatWindowClass', floatWindowClass);
103 // 2.悬浮窗窗口创建成功后,设置悬浮窗的位置、大小及相关属性等。 83 // 2.悬浮窗窗口创建成功后,设置悬浮窗的位置、大小及相关属性等。
104 floatWindowClass.moveWindowTo(0, initMoveY, (err: BusinessError) => { 84 floatWindowClass.moveWindowTo(0, initMoveY, (err: BusinessError) => {
105 let errCode: number = err.code; 85 let errCode: number = err.code;
106 if (errCode) { 86 if (errCode) {
107 - console.error('floatWindowClass Failed to move the window. Cause:' + JSON.stringify(err)); 87 + Logger.error('floatWindowClass Failed to move the window. Cause:' + JSON.stringify(err));
108 return; 88 return;
109 } 89 }
110 - console.info('floatWindowClass Succeeded in moving the window.'); 90 + Logger.info('floatWindowClass Succeeded in moving the window.');
111 }); 91 });
112 // 3.为悬浮窗加载对应的目标页面。 92 // 3.为悬浮窗加载对应的目标页面。
113 floatWindowClass.setUIContent("pages/view/AudioComponent", (err: BusinessError) => { 93 floatWindowClass.setUIContent("pages/view/AudioComponent", (err: BusinessError) => {
114 let errCode: number = err.code; 94 let errCode: number = err.code;
115 if (errCode) { 95 if (errCode) {
116 - console.error('floatWindowClass Failed to load the content. Cause:' + JSON.stringify(err)); 96 + Logger.error('floatWindowClass Failed to load the content. Cause:' + JSON.stringify(err));
117 return; 97 return;
118 } 98 }
119 - console.info('floatWindowClass Succeeded in loading the content.'); 99 + Logger.info('floatWindowClass Succeeded in loading the content.');
120 let color: string = 'rgba(0,0,0,0)'; 100 let color: string = 'rgba(0,0,0,0)';
121 try { 101 try {
122 (floatWindowClass as window.Window).setWindowBackgroundColor(color); 102 (floatWindowClass as window.Window).setWindowBackgroundColor(color);
123 } catch (exception) { 103 } catch (exception) {
124 - console.error('Failed to set the background color. Cause: ' + JSON.stringify(exception));  
125 - }; 104 + Logger.error('Failed to set the background color. Cause: ' + JSON.stringify(exception));
  105 + }
  106 + ;
126 }); 107 });
127 108
128 floatWindowClass.on('windowEvent', (data) => { 109 floatWindowClass.on('windowEvent', (data) => {
@@ -132,33 +113,68 @@ export default class EntryAbility extends UIAbility { @@ -132,33 +113,68 @@ export default class EntryAbility extends UIAbility {
132 }); 113 });
133 } 114 }
134 115
  116 + public async onWindowSetup(mainWindow: window.Window) {
  117 + // 在普通phone/折叠屏/tablet设备上以沉浸式(全屏)启动
  118 + if (DeviceUtil.isPhone() || DeviceUtil.isTablet()) {
  119 + // 设置窗口的布局是否为沉浸式布局
  120 + // 沉浸式布局是指布局不避让状态栏与导航栏,组件可能产生与其重叠的情况。
  121 + // 非沉浸式布局是指布局避让状态栏与导航栏,,组件不会与其重叠
  122 + mainWindow.setWindowLayoutFullScreen(true)
  123 + //设置窗口全屏模式时窗口内导航栏、状态栏的属性
  124 + mainWindow.setWindowSystemBarProperties({
  125 + //statusBarColor:'#000000'
  126 + statusBarContentColor: '#FFFFFF'
  127 + })
  128 + mainWindow.setSpecificSystemBarEnabled('status', true)
  129 +
  130 + // 设置启动时窗口的显示方向属性,
  131 + // 普通phone以PORTRAIT/竖屏显示模式启动
  132 + // 折叠屏和tablet是以AUTO_ROTATION_RESTRICTED/受开关控制的自动旋转模式启动
  133 + WindowModel.shared.setPreferredOrientation(window.Orientation.PORTRAIT)
  134 + .then(() => {
  135 + Logger.info(TAG, 'setPreferredOrientation Succeeded');
  136 + })
  137 + .catch((err: Error) => {
  138 + Logger.info(TAG,
  139 + `setPreferredOrientation catch, error error.name : ${err.name}, error.message:${err.message}`);
  140 + })
  141 + } else if (DeviceUtil.is2in1()) {
  142 + // 2in1(PC)设备不支持旋转(无横竖屏模式),会以默认窗口(非全屏)显示模式启动Logger.info(TAG,`start at 2in1 window device )
  143 + Logger.info(TAG, 'start at 2in1 window device')
  144 + } else {
  145 + // 轻量级智能穿戴/lite wearable device
  146 + Logger.info(TAG, 'start at other type device')
  147 + }
  148 +
  149 + }
  150 +
135 destroyFloatWindow() { 151 destroyFloatWindow() {
136 (floatWindowClass as window.Window).destroyWindow((err: BusinessError) => { 152 (floatWindowClass as window.Window).destroyWindow((err: BusinessError) => {
137 let errCode: number = err.code; 153 let errCode: number = err.code;
138 if (errCode) { 154 if (errCode) {
139 - console.error('floatWindowClass Failed to destroy the window. Cause: ' + JSON.stringify(err)); 155 + Logger.error('floatWindowClass Failed to destroy the window. Cause: ' + JSON.stringify(err));
140 return; 156 return;
141 } 157 }
142 - console.info('floatWindowClass Succeeded in destroying the window.'); 158 + Logger.info('floatWindowClass Succeeded in destroying the window.');
143 }); 159 });
144 } 160 }
145 161
146 onWindowStageDestroy(): void { 162 onWindowStageDestroy(): void {
147 // Main window is destroyed, release UI related resources 163 // Main window is destroyed, release UI related resources
148 this.destroyFloatWindow() 164 this.destroyFloatWindow()
149 - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); 165 + Logger.info(TAG, 'Ability onWindowStageDestroy');
150 } 166 }
151 167
152 onForeground(): void { 168 onForeground(): void {
153 // Ability has brought to foreground 169 // Ability has brought to foreground
154 - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); 170 + Logger.info(TAG, 'Ability onForeground');
155 171
156 EmitterUtils.sendEmptyEvent(EmitterEventId.APP_ENTER_FOREGROUD) 172 EmitterUtils.sendEmptyEvent(EmitterEventId.APP_ENTER_FOREGROUD)
157 } 173 }
158 174
159 onBackground(): void { 175 onBackground(): void {
160 // Ability has back to background 176 // Ability has back to background
161 - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); 177 + Logger.info(TAG, 'Ability onBackground');
162 178
163 EmitterUtils.sendEmptyEvent(EmitterEventId.APP_ENTER_BACKGROUD) 179 EmitterUtils.sendEmptyEvent(EmitterEventId.APP_ENTER_BACKGROUD)
164 } 180 }
@@ -23,7 +23,7 @@ struct MorningEveningPaperPage { @@ -23,7 +23,7 @@ struct MorningEveningPaperPage {
23 PageTransitionEnter({ type: RouteType.Push, duration: 300 }) 23 PageTransitionEnter({ type: RouteType.Push, duration: 300 })
24 .slide(SlideEffect.Bottom).onEnter((type: RouteType, progress: number) => { 24 .slide(SlideEffect.Bottom).onEnter((type: RouteType, progress: number) => {
25 if (progress >= 0.99) { 25 if (progress >= 0.99) {
26 - WindowModel.shared.setWindowLayoutFullScreen(true) 26 + // WindowModel.shared.setWindowLayoutFullScreen(true)
27 WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', }) 27 WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', })
28 } 28 }
29 }) 29 })
@@ -43,14 +43,14 @@ struct MorningEveningPaperPage { @@ -43,14 +43,14 @@ struct MorningEveningPaperPage {
43 onPageShow() { 43 onPageShow() {
44 Logger.info(TAG, 'onPageShow'); 44 Logger.info(TAG, 'onPageShow');
45 if (this.isPageShow) { 45 if (this.isPageShow) {
46 - WindowModel.shared.setWindowLayoutFullScreen(true) 46 + // WindowModel.shared.setWindowLayoutFullScreen(true)
47 WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', }) 47 WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', })
48 } 48 }
49 this.pageShowTime = DateTimeUtils.getTimeStamp() 49 this.pageShowTime = DateTimeUtils.getTimeStamp()
50 } 50 }
51 51
52 onPageHide() { 52 onPageHide() {
53 - WindowModel.shared.setWindowLayoutFullScreen(false) 53 + // WindowModel.shared.setWindowLayoutFullScreen(false)
54 WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', }) 54 WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', })
55 this.isPageShow = true 55 this.isPageShow = true
56 Logger.info(TAG, 'onPageHide'); 56 Logger.info(TAG, 'onPageHide');
@@ -21,7 +21,8 @@ struct MultiPictureDetailPage { @@ -21,7 +21,8 @@ struct MultiPictureDetailPage {
21 pageHideTime:number = 0; 21 pageHideTime:number = 0;
22 @Provide pageId: string = TrackConstants.PageName.Atlas_Detail 22 @Provide pageId: string = TrackConstants.PageName.Atlas_Detail
23 @Provide pageName: string = TrackConstants.PageName.Atlas_Detail 23 @Provide pageName: string = TrackConstants.PageName.Atlas_Detail
24 - 24 + @Provide bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
  25 + @Provide topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
25 build() { 26 build() {
26 Row() { 27 Row() {
27 Column() { 28 Column() {
@@ -31,6 +32,7 @@ struct MultiPictureDetailPage { @@ -31,6 +32,7 @@ struct MultiPictureDetailPage {
31 relType: this.relType 32 relType: this.relType
32 }) 33 })
33 } 34 }
  35 +
34 } 36 }
35 .backgroundColor(Color.Black) 37 .backgroundColor(Color.Black)
36 } 38 }
@@ -48,7 +50,6 @@ struct MultiPictureDetailPage { @@ -48,7 +50,6 @@ struct MultiPictureDetailPage {
48 } 50 }
49 51
50 aboutToAppear() { 52 aboutToAppear() {
51 - this.openFullScreen()  
52 53
53 Logger.info(TAG, 'aboutToDisappear'); 54 Logger.info(TAG, 'aboutToDisappear');
54 55
@@ -68,41 +69,22 @@ struct MultiPictureDetailPage { @@ -68,41 +69,22 @@ struct MultiPictureDetailPage {
68 69
69 aboutToDisappear(): void { 70 aboutToDisappear(): void {
70 console.log(TAG, 'aboutToDisappear') 71 console.log(TAG, 'aboutToDisappear')
71 - this.closeFullScreen()  
72 } 72 }
73 73
74 onPageShow(): void { 74 onPageShow(): void {
75 console.log(TAG, 'onPageShow') 75 console.log(TAG, 'onPageShow')
76 this.pageShowTime = DateTimeUtils.getTimeStamp() 76 this.pageShowTime = DateTimeUtils.getTimeStamp()
77 - this.openFullScreen()  
78 - 77 + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff'})
79 } 78 }
80 79
81 onPageHide(): void { 80 onPageHide(): void {
82 console.log(TAG, 'onPageHide') 81 console.log(TAG, 'onPageHide')
  82 + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000'})
83 this.pageHideTime = DateTimeUtils.getTimeStamp() 83 this.pageHideTime = DateTimeUtils.getTimeStamp()
84 let duration = 0 84 let duration = 0
85 duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000) 85 duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000)
86 TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Atlas_Detail,TrackConstants.PageName.Atlas_Detail,duration) 86 TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Atlas_Detail,TrackConstants.PageName.Atlas_Detail,duration)
87 - this.closeFullScreen()  
88 - }  
89 -  
90 - /**  
91 - * 开启沉浸式  
92 - * TODO:颜色待根据业务接口修改  
93 - */  
94 - openFullScreen() {  
95 - WindowModel.shared.setWindowLayoutFullScreen(true)  
96 - WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', })  
97 } 87 }
98 88
99 - /**  
100 - * 关闭沉浸式  
101 - * TODO:颜色待根据业务接口修改  
102 - */  
103 - closeFullScreen() {  
104 - WindowModel.shared.setWindowLayoutFullScreen(false)  
105 - WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', })  
106 - }  
107 89
108 } 90 }
@@ -7,6 +7,7 @@ import LaunchDataModel, { defaultLaunchModel } from '../viewModel/LaunchDataMode @@ -7,6 +7,7 @@ import LaunchDataModel, { defaultLaunchModel } from '../viewModel/LaunchDataMode
7 7
8 import { ParamType, TrackConstants, TrackingButton, TrackingContent } from 'wdTracking/Index'; 8 import { ParamType, TrackConstants, TrackingButton, TrackingContent } from 'wdTracking/Index';
9 import { ContentDTO } from 'wdBean/Index'; 9 import { ContentDTO } from 'wdBean/Index';
  10 +import { Core } from '@ohos/hypium';
10 11
11 12
12 @Entry 13 @Entry
@@ -62,7 +63,7 @@ struct LaunchAdvertisingPage { @@ -62,7 +63,7 @@ struct LaunchAdvertisingPage {
62 }else { 63 }else {
63 //显示图片 64 //显示图片
64 Image(this.defaultModel.bootScreenUrl) 65 Image(this.defaultModel.bootScreenUrl)
65 - .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM]) 66 + // .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
66 .width('100%') 67 .width('100%')
67 .height('100%') 68 .height('100%')
68 } 69 }
@@ -74,11 +75,10 @@ struct LaunchAdvertisingPage { @@ -74,11 +75,10 @@ struct LaunchAdvertisingPage {
74 bottom: 0 75 bottom: 0
75 }) 76 })
76 77
77 -  
78 Stack(){ 78 Stack(){
79 Column(){ 79 Column(){
80 Row(){ 80 Row(){
81 - if (this.defaultModel.isAd === '1') { 81 + if (this.defaultModel.isAd == '1') {
82 Text('广告') 82 Text('广告')
83 .fontColor(Color.White) 83 .fontColor(Color.White)
84 .textAlign(TextAlign.Center) 84 .textAlign(TextAlign.Center)
@@ -108,7 +108,7 @@ struct LaunchAdvertisingPage { @@ -108,7 +108,7 @@ struct LaunchAdvertisingPage {
108 this.trackingLaunchJumpOver() 108 this.trackingLaunchJumpOver()
109 }).margin({right:16}) 109 }).margin({right:16})
110 110
111 - }.margin({top:10}).width('100%').height('56lpx') 111 + }.margin({top:50}).width('100%').height('56lpx')
112 112
113 Blank() 113 Blank()
114 114
@@ -132,18 +132,21 @@ struct LaunchAdvertisingPage { @@ -132,18 +132,21 @@ struct LaunchAdvertisingPage {
132 .margin({ 132 .margin({
133 bottom: '51lpx' 133 bottom: '51lpx'
134 }) 134 })
  135 + .borderWidth(1)
  136 + .borderColor(Color.White)
135 .backgroundColor('#80000000') 137 .backgroundColor('#80000000')
136 .onClick(()=>{ 138 .onClick(()=>{
137 this.action() 139 this.action()
138 }) 140 })
139 } 141 }
140 - if(this.defaultModel.screenType === '1') { 142 + if(this.defaultModel.screenType == '1') {
141 Column(){ 143 Column(){
142 Image($r('app.media.LaunchPage_logo')) 144 Image($r('app.media.LaunchPage_logo'))
143 .width('278lpx') 145 .width('278lpx')
144 .height('154lpx') 146 .height('154lpx')
145 .margin({top:20}) 147 .margin({top:20})
146 - }.width('100%').height('16%').backgroundColor(Color.White).expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM]) 148 + }.width('100%').height('16%').backgroundColor(Color.White)
  149 + // .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
147 } 150 }
148 } 151 }
149 .width('100%') 152 .width('100%')
@@ -157,7 +160,7 @@ struct LaunchAdvertisingPage { @@ -157,7 +160,7 @@ struct LaunchAdvertisingPage {
157 .height('100%') 160 .height('100%')
158 .margin({top:'0'}) 161 .margin({top:'0'})
159 } 162 }
160 - .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM]) 163 + // .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
161 .width('100%') 164 .width('100%')
162 .height('100%') 165 .height('100%')
163 .backgroundColor(Color.White) 166 .backgroundColor(Color.White)
@@ -176,7 +179,7 @@ struct LaunchAdvertisingPage { @@ -176,7 +179,7 @@ struct LaunchAdvertisingPage {
176 if (this.defaultModel.openType == '2') { 179 if (this.defaultModel.openType == '2') {
177 //端外打开 180 //端外打开
178 ProcessUtils.jumpExternalWebPage(this.defaultModel.linkUrl) 181 ProcessUtils.jumpExternalWebPage(this.defaultModel.linkUrl)
179 - }else { 182 + }else if(this.defaultModel.openType == '1'){
180 //端内打开 183 //端内打开
181 ProcessUtils.gotoDefaultWebPage(this.defaultModel.linkUrl) 184 ProcessUtils.gotoDefaultWebPage(this.defaultModel.linkUrl)
182 } 185 }
@@ -212,7 +215,7 @@ struct LaunchAdvertisingPage { @@ -212,7 +215,7 @@ struct LaunchAdvertisingPage {
212 this.defaultModel.screenName = dataModel.launchAdInfo[0].matInfo.advTitle 215 this.defaultModel.screenName = dataModel.launchAdInfo[0].matInfo.advTitle
213 this.defaultModel.durations = dataModel.launchAdInfo[0].displayDuration 216 this.defaultModel.durations = dataModel.launchAdInfo[0].displayDuration
214 this.defaultModel.linkUrl = dataModel.launchAdInfo[0].matInfo.linkUrl 217 this.defaultModel.linkUrl = dataModel.launchAdInfo[0].matInfo.linkUrl
215 - if (dataModel.launchAdInfo[0].matInfo.startStyle === '1') { 218 + if (dataModel.launchAdInfo[0].matInfo.startStyle == '1') {
216 this.defaultModel.screenType = '2' 219 this.defaultModel.screenType = '2'
217 }else { 220 }else {
218 this.defaultModel.screenType = '1' 221 this.defaultModel.screenType = '1'
@@ -222,6 +225,7 @@ struct LaunchAdvertisingPage { @@ -222,6 +225,7 @@ struct LaunchAdvertisingPage {
222 this.defaultModel.bootVideoUrl = dataModel.launchAdInfo[0].matInfo.matVideoUrl 225 this.defaultModel.bootVideoUrl = dataModel.launchAdInfo[0].matInfo.matVideoUrl
223 this.defaultModel.showType = dataModel.launchAdInfo[0].matInfo.matType 226 this.defaultModel.showType = dataModel.launchAdInfo[0].matInfo.matType
224 this.defaultModel.isAd = '1' 227 this.defaultModel.isAd = '1'
  228 + this.defaultModel.openType = dataModel.launchAdInfo[0].matInfo.openType
225 } 229 }
226 } 230 }
227 231
@@ -5,7 +5,7 @@ import { SPHelper } from 'wdKit/Index'; @@ -5,7 +5,7 @@ import { SPHelper } from 'wdKit/Index';
5 import { SpConstants } from 'wdConstant/Index'; 5 import { SpConstants } from 'wdConstant/Index';
6 import { ButtonOptions, promptAction, window } from '@kit.ArkUI'; 6 import { ButtonOptions, promptAction, window } from '@kit.ArkUI';
7 import { ParamType, TrackConstants, TrackingContent } from 'wdTracking/Index'; 7 import { ParamType, TrackConstants, TrackingContent } from 'wdTracking/Index';
8 -import { ImageKnifeComponent } from '@ohos/imageknife'; 8 +import { ImageKnifeComponent,ScaleType } from '@ohos/imageknife';
9 9
10 @Entry 10 @Entry
11 @Component 11 @Component
@@ -13,6 +13,8 @@ struct LaunchInterestsHobbiesPage { @@ -13,6 +13,8 @@ struct LaunchInterestsHobbiesPage {
13 @State message: string = 'Hello World' 13 @State message: string = 'Hello World'
14 @State selectCount: number = 0 14 @State selectCount: number = 0
15 @State interestsArray: InterestsList[] = [] 15 @State interestsArray: InterestsList[] = []
  16 + @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
  17 + @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
16 18
17 aboutToAppear(){ 19 aboutToAppear(){
18 //请求接口,获取兴趣偏好数据 20 //请求接口,获取兴趣偏好数据
@@ -39,6 +41,7 @@ struct LaunchInterestsHobbiesPage { @@ -39,6 +41,7 @@ struct LaunchInterestsHobbiesPage {
39 this.trackingLaunchJumpOver(false) 41 this.trackingLaunchJumpOver(false)
40 }) 42 })
41 } 43 }
  44 + .margin({top:px2vp(this.topSafeHeight)})
42 .width('100%') 45 .width('100%')
43 .justifyContent(FlexAlign.End) 46 .justifyContent(FlexAlign.End)
44 47
@@ -62,7 +65,7 @@ struct LaunchInterestsHobbiesPage { @@ -62,7 +65,7 @@ struct LaunchInterestsHobbiesPage {
62 ForEach(this.interestsArray,(item:InterestsList,index:number)=>{ 65 ForEach(this.interestsArray,(item:InterestsList,index:number)=>{
63 GridItem(){ 66 GridItem(){
64 Stack({alignContent:Alignment.TopStart}){ 67 Stack({alignContent:Alignment.TopStart}){
65 - ImageKnifeComponent({imageKnifeOption:{loadSrc:item.pic}}) 68 + ImageKnifeComponent({imageKnifeOption:{loadSrc:item.pic?item.pic:'',mainScaleType:ScaleType.FIT_XY}})
66 .width('100%') 69 .width('100%')
67 .height('100%') 70 .height('100%')
68 .backgroundColor(Color.White) 71 .backgroundColor(Color.White)
@@ -98,7 +101,7 @@ struct LaunchInterestsHobbiesPage { @@ -98,7 +101,7 @@ struct LaunchInterestsHobbiesPage {
98 Image(item.choose ? $r('app.media.interestsSelected') : $r('app.media.interestsSelectNot')) 101 Image(item.choose ? $r('app.media.interestsSelected') : $r('app.media.interestsSelectNot'))
99 .height('32lpx') 102 .height('32lpx')
100 .width('32lpx') 103 .width('32lpx')
101 - .margin({top:'80lpx',left:'110lpx'}) 104 + .margin({top:'80lpx',left:'120lpx'})
102 105
103 }.justifyContent(FlexAlign.Start) 106 }.justifyContent(FlexAlign.Start)
104 } 107 }
@@ -118,8 +121,7 @@ struct LaunchInterestsHobbiesPage { @@ -118,8 +121,7 @@ struct LaunchInterestsHobbiesPage {
118 }) 121 })
119 } 122 }
120 .width('90%') 123 .width('90%')
121 - // .height('70%')  
122 - .margin({top:'61lpx',bottom:'240lpx'}) 124 + .margin({top:'61lpx',bottom:'300lpx'})
123 .columnsTemplate('1fr 1fr 1fr') 125 .columnsTemplate('1fr 1fr 1fr')
124 .columnsGap('23lpx') 126 .columnsGap('23lpx')
125 .rowsGap('23lpx') 127 .rowsGap('23lpx')
@@ -129,7 +131,7 @@ struct LaunchInterestsHobbiesPage { @@ -129,7 +131,7 @@ struct LaunchInterestsHobbiesPage {
129 .height('100%') 131 .height('100%')
130 } 132 }
131 .width('100%') 133 .width('100%')
132 - .height(`calc(100% - ${108 + 'lpx'})`) 134 + .height(`calc(100% - ${158 + 'lpx'})`)
133 // .backgroundColor(Color.Red) 135 // .backgroundColor(Color.Red)
134 136
135 Stack({alignContent:Alignment.Center}){ 137 Stack({alignContent:Alignment.Center}){
@@ -97,8 +97,8 @@ struct LaunchPage { @@ -97,8 +97,8 @@ struct LaunchPage {
97 this.dialogController.open(); 97 this.dialogController.open();
98 // } 98 // }
99 } else { 99 } else {
100 -  
101 - StartupManager.sharedInstance().appAgreedProtocol() 100 + // 挪到ability里处理了。
  101 + // StartupManager.sharedInstance().appAgreedProtocol()
102 102
103 //需要根据请求数据判断是否需要进入广告页,广告数据为nil则直接跳转到首页 103 //需要根据请求数据判断是否需要进入广告页,广告数据为nil则直接跳转到首页
104 //获取本地存储的启动页数据 104 //获取本地存储的启动页数据
@@ -23,6 +23,7 @@ let storage = LocalStorage.getShared(); @@ -23,6 +23,7 @@ let storage = LocalStorage.getShared();
23 @Component 23 @Component
24 export struct BottomNavigationComponent { 24 export struct BottomNavigationComponent {
25 @Provide bottomRectHeight: number = 0 25 @Provide bottomRectHeight: number = 0
  26 + private bottomRectHeight1: string = AppStorage.get<number>('bottomSafeHeight') + 'px';
26 @Provide topRectHeight: number = 0 27 @Provide topRectHeight: number = 0
27 @Provide isLayoutFullScreen: boolean = false 28 @Provide isLayoutFullScreen: boolean = false
28 @Provide displayDirection: DisplayDirection = DisplayDirection.VERTICAL 29 @Provide displayDirection: DisplayDirection = DisplayDirection.VERTICAL
@@ -73,6 +74,7 @@ export struct BottomNavigationComponent { @@ -73,6 +74,7 @@ export struct BottomNavigationComponent {
73 } 74 }
74 75
75 build() { 76 build() {
  77 + Column() {
76 Tabs({ barPosition: BarPosition.End, index: this.currentNavIndex, controller: this.navController }) { 78 Tabs({ barPosition: BarPosition.End, index: this.currentNavIndex, controller: this.navController }) {
77 ForEach(this.bottomNavList, (navItem: BottomNavDTO, index: number) => { 79 ForEach(this.bottomNavList, (navItem: BottomNavDTO, index: number) => {
78 TabContent() { 80 TabContent() {
@@ -100,7 +102,7 @@ export struct BottomNavigationComponent { @@ -100,7 +102,7 @@ export struct BottomNavigationComponent {
100 } 102 }
101 .tabBar(this.tabBarBuilder(navItem, index)) 103 .tabBar(this.tabBarBuilder(navItem, index))
102 104
103 - .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP]) 105 + // .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
104 }); 106 });
105 107
106 } 108 }
@@ -112,39 +114,25 @@ export struct BottomNavigationComponent { @@ -112,39 +114,25 @@ export struct BottomNavigationComponent {
112 .barMode(BarMode.Fixed) 114 .barMode(BarMode.Fixed)
113 .barBackgroundColor(this.barBackgroundColor) 115 .barBackgroundColor(this.barBackgroundColor)
114 // 备注:鸿蒙目前只有修改三线导航背景方法,对于全面屏导航条手机需要设置背景色并使其扩散到导航区域 116 // 备注:鸿蒙目前只有修改三线导航背景方法,对于全面屏导航条手机需要设置背景色并使其扩散到导航区域
115 - .backgroundColor(this.barBackgroundColor)  
116 - .expandSafeArea([SafeAreaType.SYSTEM])  
117 -  
118 - // .padding({ bottom: this.bottomRectHeight + 'px', top: this.topRectHeight + 'px' }) // 此处margin具体数值在实际中应与导航条区域高度保持一致 117 + // .backgroundColor(this.barBackgroundColor)
  118 + .layoutWeight(1)
119 119
  120 + Blank().width('100%').height(this.bottomRectHeight1).backgroundColor(this.barBackgroundColor)
  121 + }.height('100%').width('100%')
120 } 122 }
121 123
122 @Builder 124 @Builder
123 tabBarBuilder(navItem: BottomNavDTO, index: number) { 125 tabBarBuilder(navItem: BottomNavDTO, index: number) {
124 - Stack({ alignContent: Alignment.Bottom }) {  
125 - // Image(this.getBottomIcon(navItem, this.currentNavIndex === index))  
126 - // .height(CommonConstants.FULL_PARENT)  
127 - // .padding({  
128 - // bottom: 15,  
129 - // left: 10,  
130 - // right: 10,  
131 - // top: 2  
132 - // })  
133 - // .aspectRatio(this.ASPECT_RATIO_1_1)  
134 - // .alt(this.getBottomLocalIcon(navItem, this.currentNavIndex === index)) 126 + Column() {
135 ImageKnifeComponent({ imageKnifeOption: this.getBottomImageKnifeOption(navItem, this.currentNavIndex === index) }) 127 ImageKnifeComponent({ imageKnifeOption: this.getBottomImageKnifeOption(navItem, this.currentNavIndex === index) })
136 - .padding({  
137 - bottom: 15,  
138 - left: 10,  
139 - right: 10,  
140 - top: 2  
141 - })  
142 - .width('100%')  
143 - .height('100%') 128 + .padding(1)
  129 + .margin({ top: 2 })
  130 + .width(32)
  131 + .height(32)
144 .enabled(false) 132 .enabled(false)
145 133
146 Text(navItem.name) 134 Text(navItem.name)
147 - .margin({ bottom: $r('app.float.bottom_navigation_margin_bottom') }) 135 + .margin({ top: 2 })
148 .fontWeight(this.currentNavIndex === index ? FontWeight.Bold : FontWeight.Normal) 136 .fontWeight(this.currentNavIndex === index ? FontWeight.Bold : FontWeight.Normal)
149 .textAlign(TextAlign.Center) 137 .textAlign(TextAlign.Center)
150 .fontSize($r('app.float.font_size_10'))// .fontColor(this.currentNavIndex === index ? Color.Red : Color.Gray) 138 .fontSize($r('app.float.font_size_10'))// .fontColor(this.currentNavIndex === index ? Color.Red : Color.Gray)
@@ -45,8 +45,8 @@ export struct MultiPictureDetailPageComponent { @@ -45,8 +45,8 @@ export struct MultiPictureDetailPageComponent {
45 @Provide contentDetailData: ContentDetailDTO = {} as ContentDetailDTO 45 @Provide contentDetailData: ContentDetailDTO = {} as ContentDetailDTO
46 @Provide windowWidth: number = AppStorage.get<number>('windowWidth') || 0 46 @Provide windowWidth: number = AppStorage.get<number>('windowWidth') || 0
47 @Provide windowHeight: number = AppStorage.get<number>('windowHeight') || 0 47 @Provide windowHeight: number = AppStorage.get<number>('windowHeight') || 0
48 - @Provide bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0  
49 - @Provide topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 48 + @Consume bottomSafeHeight: number
  49 + @Consume topSafeHeight: number
50 @Provide @Watch('onCurrentPageNumUpdated') currentPageNum: string = '01' 50 @Provide @Watch('onCurrentPageNumUpdated') currentPageNum: string = '01'
51 private swiperController: SwiperController = new SwiperController() 51 private swiperController: SwiperController = new SwiperController()
52 private swiperControllerItem: SwiperController = new SwiperController() 52 private swiperControllerItem: SwiperController = new SwiperController()
@@ -119,7 +119,7 @@ export struct MultiPictureDetailPageComponent { @@ -119,7 +119,7 @@ export struct MultiPictureDetailPageComponent {
119 currentIndex: $currentIndex, 119 currentIndex: $currentIndex,
120 showCommentList: $showCommentList, 120 showCommentList: $showCommentList,
121 publishCommentModel: $publishCommentModel, 121 publishCommentModel: $publishCommentModel,
122 - interactData:$interactData 122 + interactData: this.interactData
123 }) 123 })
124 124
125 } 125 }
@@ -214,6 +214,17 @@ export struct MultiPictureDetailPageComponent { @@ -214,6 +214,17 @@ export struct MultiPictureDetailPageComponent {
214 left: 16, 214 left: 16,
215 right: 0 215 right: 0
216 }) 216 })
  217 + .onClick(() => {
  218 + if (this.contentDetailData.rmhInfo?.cnMainControl === 1) {
  219 + // 号主页
  220 + const params: Params = {
  221 + creatorId: this.contentDetailData.rmhInfo.rmhId,
  222 + pageID: ''
  223 + }
  224 + WDRouterRule.jumpWithPage(WDRouterPage.peopleShipHomePage, params)
  225 + }
  226 +
  227 + })
217 228
218 Row() { 229 Row() {
219 if (this.followStatus == '0') { 230 if (this.followStatus == '0') {
@@ -32,6 +32,8 @@ export struct VideoChannelPage { @@ -32,6 +32,8 @@ export struct VideoChannelPage {
32 @State indicatorWidth: number = 0 32 @State indicatorWidth: number = 0
33 // 传递给page的自动刷新通知 33 // 传递给page的自动刷新通知
34 @State autoRefresh2Page: number = 0 34 @State autoRefresh2Page: number = 0
  35 + @Provide showComment: boolean = false
  36 + @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
35 aboutToAppear(): void { 37 aboutToAppear(): void {
36 this.setBarBackgroundColor() 38 this.setBarBackgroundColor()
37 console.log(TAG, 'aboutToAppear') 39 console.log(TAG, 'aboutToAppear')
@@ -70,7 +72,6 @@ export struct VideoChannelPage { @@ -70,7 +72,6 @@ export struct VideoChannelPage {
70 } 72 }
71 .width('100%') 73 .width('100%')
72 .height('100%') 74 .height('100%')
73 - .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])  
74 } 75 }
75 76
76 @Builder 77 @Builder
@@ -150,7 +151,9 @@ export struct VideoChannelPage { @@ -150,7 +151,9 @@ export struct VideoChannelPage {
150 } 151 }
151 .zIndex(20) 152 .zIndex(20)
152 .height($r('app.float.top_tab_bar_height_common')) 153 .height($r('app.float.top_tab_bar_height_common'))
153 - .margin({ top: 10 }) 154 + .margin({
  155 + top: px2vp(this.topSafeHeight)
  156 + })
154 .visibility(this.displayDirection === DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) 157 .visibility(this.displayDirection === DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None)
155 158
156 } 159 }
@@ -179,7 +182,7 @@ export struct VideoChannelPage { @@ -179,7 +182,7 @@ export struct VideoChannelPage {
179 channelId: item.channelId + '', 182 channelId: item.channelId + '',
180 autoRefresh: this.autoRefresh 183 autoRefresh: this.autoRefresh
181 }) 184 })
182 - .padding({ top: 55 }) 185 + .padding({ top: px2vp(this.topSafeHeight) + 55 })
183 .backgroundColor(Color.White) 186 .backgroundColor(Color.White)
184 } 187 }
185 }, (item: TopNavDTO) => item.channelId + '') 188 }, (item: TopNavDTO) => item.channelId + '')
@@ -90,13 +90,14 @@ export class StartupManager { @@ -90,13 +90,14 @@ export class StartupManager {
90 Logger.debug(TAG, "App 已同意隐私等协议,开始必要初始化") 90 Logger.debug(TAG, "App 已同意隐私等协议,开始必要初始化")
91 this.initCheckDeviceId() 91 this.initCheckDeviceId()
92 92
  93 + this.initNetwork()
  94 +
93 this.initMpaas() 95 this.initMpaas()
  96 +
94 this.initSensorData() 97 this.initSensorData()
95 98
96 this.initTingyun() 99 this.initTingyun()
97 100
98 - this.initNetwork()  
99 -  
100 this.initGeTuiPush() 101 this.initGeTuiPush()
101 102
102 this.initUmengStat() 103 this.initUmengStat()
1 import { insightIntent, InsightIntentExecutor } from '@kit.AbilityKit'; 1 import { insightIntent, InsightIntentExecutor } from '@kit.AbilityKit';
2 import { window } from '@kit.ArkUI'; 2 import { window } from '@kit.ArkUI';
3 import { BusinessError } from '@kit.BasicServicesKit'; 3 import { BusinessError } from '@kit.BasicServicesKit';
  4 +import { NetworkUtil, SPHelper, ToastUtils } from 'wdKit';
4 import { ProcessUtils } from 'wdRouter'; 5 import { ProcessUtils } from 'wdRouter';
  6 +import DailyPaperTopicModel from 'wdComponent/src/main/ets/model/DailyPaperTopicModel'
  7 +
5 /** 8 /**
6 * 意图调用 9 * 意图调用
7 */ 10 */
@@ -19,7 +22,7 @@ export default class InsightIntentExecutorImpl extends InsightIntentExecutor { @@ -19,7 +22,7 @@ export default class InsightIntentExecutorImpl extends InsightIntentExecutor {
19 */ 22 */
20 onExecuteInUIAbilityForegroundMode(name: string, param: Record<string, Object>, pageLoader: window.WindowStage): 23 onExecuteInUIAbilityForegroundMode(name: string, param: Record<string, Object>, pageLoader: window.WindowStage):
21 Promise<insightIntent.ExecuteResult> { 24 Promise<insightIntent.ExecuteResult> {
22 - console.log('yzl onExecuteInUIAbilityForegroundMode',name,JSON.stringify(param)) 25 + console.log('yzl onExecuteInUIAbilityForegroundMode', name, JSON.stringify(param))
23 // 根据意图名称分发处理逻辑 26 // 根据意图名称分发处理逻辑
24 switch (name) { 27 switch (name) {
25 case InsightIntentExecutorImpl.ViewBlog: 28 case InsightIntentExecutorImpl.ViewBlog:
@@ -36,19 +39,19 @@ export default class InsightIntentExecutorImpl extends InsightIntentExecutor { @@ -36,19 +39,19 @@ export default class InsightIntentExecutorImpl extends InsightIntentExecutor {
36 } 39 }
37 } as insightIntent.ExecuteResult) 40 } as insightIntent.ExecuteResult)
38 } 41 }
  42 +
39 /** 43 /**
40 * 实现习惯推荐功能 44 * 实现习惯推荐功能
41 * @param param 意图参数 45 * @param param 意图参数
42 * @param pageLoader 窗口 46 * @param pageLoader 窗口
43 */ 47 */
44 - private jumpToViewBlog(param: Record<string, Object>, pageLoader: window.WindowStage): Promise<insightIntent.ExecuteResult> {  
45 - console.log('yzl jumpToView',JSON.stringify(param)) 48 + private jumpToViewBlog(param: Record<string, Object>,
  49 + pageLoader: window.WindowStage): Promise<insightIntent.ExecuteResult> {
  50 + console.log('yzl jumpToView', JSON.stringify(param))
46 return new Promise((resolve, reject) => { 51 return new Promise((resolve, reject) => {
47 - // TODO 实现意图调用,loadContent的入参为歌曲落地页路径,例如:pages/SongPage  
48 // TODO 热启动是否切到主页 52 // TODO 热启动是否切到主页
49 pageLoader.loadContent('pages/MainPage') 53 pageLoader.loadContent('pages/MainPage')
50 .then(() => { 54 .then(() => {
51 -  
52 resolve({ 55 resolve({
53 code: 0, 56 code: 0,
54 result: { 57 result: {
@@ -72,12 +75,26 @@ export default class InsightIntentExecutorImpl extends InsightIntentExecutor { @@ -72,12 +75,26 @@ export default class InsightIntentExecutorImpl extends InsightIntentExecutor {
72 * @param param 意图参数 75 * @param param 意图参数
73 * @param pageLoader 窗口 76 * @param pageLoader 窗口
74 */ 77 */
75 - private jumpToViewColumnUpdate(param: Record<string, Object>, pageLoader: window.WindowStage): Promise<insightIntent.ExecuteResult> {  
76 - console.log('yzl jumpToViewColum',JSON.stringify(param)) 78 + private jumpToViewColumnUpdate(param: Record<string, Object>,
  79 + pageLoader: window.WindowStage): Promise<insightIntent.ExecuteResult> {
77 return new Promise((resolve, reject) => { 80 return new Promise((resolve, reject) => {
78 pageLoader.loadContent('pages/MainPage') 81 pageLoader.loadContent('pages/MainPage')
79 .then(() => { 82 .then(() => {
80 - ProcessUtils.gotoMorningEveningPaper() 83 + if (NetworkUtil.isNetConnected()) {
  84 + DailyPaperTopicModel.getDailyPaperTopic().then(dailyPaperTopicBean => {
  85 + if (dailyPaperTopicBean && dailyPaperTopicBean.id > 0) {
  86 + SPHelper.default.saveSync('dailyPaperTopicPageId', dailyPaperTopicBean.id);
  87 + ProcessUtils.gotoMorningEveningPaper() //跳转至早晚报页面
  88 + } else {
  89 + ToastUtils.showToast('暂无早晚报信息', 1000)
  90 + }
  91 + }).catch((err: string) => {
  92 + console.log('yzlerr',JSON.stringify(err))
  93 + ToastUtils.showToast('暂无早晚报信息', 1000)
  94 + })
  95 + } else {
  96 + ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000)
  97 + }
81 resolve({ 98 resolve({
82 code: 0, 99 code: 0,
83 result: { 100 result: {