陈剑华

Merge remote-tracking branch 'origin/main'

Showing 52 changed files with 909 additions and 1048 deletions
@@ -207,6 +207,11 @@ export class HttpUrlUtils { @@ -207,6 +207,11 @@ export class HttpUrlUtils {
207 * 直播详情-大家聊列表 207 * 直播详情-大家聊列表
208 */ 208 */
209 static readonly LIVE_CHAT_LIST_PATH: string = "/api/live-center-message/zh/a/live/message/chat/list"; 209 static readonly LIVE_CHAT_LIST_PATH: string = "/api/live-center-message/zh/a/live/message/chat/list";
  210 +
  211 + /**
  212 + * C端评论列表 竖屏直播间
  213 + */
  214 + static readonly LIVE_COMMENTS_LIST_PATH: string = "/api/live-center-message/zh/a/live/message/comments/list";
210 /** 215 /**
211 * 直播详情-直播数据 216 * 直播详情-直播数据
212 */ 217 */
@@ -655,6 +660,16 @@ export class HttpUrlUtils { @@ -655,6 +660,16 @@ export class HttpUrlUtils {
655 let url = HttpUrlUtils.getHost() + HttpUrlUtils.LIVE_CHAT_LIST_PATH 660 let url = HttpUrlUtils.getHost() + HttpUrlUtils.LIVE_CHAT_LIST_PATH
656 return url 661 return url
657 } 662 }
  663 +
  664 + /**
  665 + * 竖屏直播间 聊天信息接口
  666 + * @returns
  667 + */
  668 + static getLiveCommentListUrl() {
  669 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.LIVE_COMMENTS_LIST_PATH
  670 + return url
  671 + }
  672 +
658 // 直播详情-直播数据 673 // 直播详情-直播数据
659 static getLiveRoomDataUrl() { 674 static getLiveRoomDataUrl() {
660 let url = HttpUrlUtils.getHost() + HttpUrlUtils.LIVE_ROOM_DATA_PATH 675 let url = HttpUrlUtils.getHost() + HttpUrlUtils.LIVE_ROOM_DATA_PATH
@@ -295,6 +295,10 @@ export class ProcessUtils { @@ -295,6 +295,10 @@ export class ProcessUtils {
295 Logger.debug(TAG, `gotoVod, ${content.objectId}`); 295 Logger.debug(TAG, `gotoVod, ${content.objectId}`);
296 } 296 }
297 297
  298 + /**
  299 + * 进入直播详情页面
  300 + * @param content
  301 + */
298 public static async gotoLive(content: ContentDTO) { 302 public static async gotoLive(content: ContentDTO) {
299 let taskAction: Action = { 303 let taskAction: Action = {
300 type: 'JUMP_DETAIL_PAGE', 304 type: 'JUMP_DETAIL_PAGE',
@@ -4,6 +4,7 @@ import { TopNavDTO } from './TopNavDTO'; @@ -4,6 +4,7 @@ import { TopNavDTO } from './TopNavDTO';
4 * 底导(包含顶导列表)数据 4 * 底导(包含顶导列表)数据
5 */ 5 */
6 export interface BottomNavDTO { 6 export interface BottomNavDTO {
  7 + pageName: string;
7 backgroundUrl: string; // 迭代四:页面背景图 8 backgroundUrl: string; // 迭代四:页面背景图
8 channelChooseActionUrl: string; // 迭代四:频道选中下划线动画 9 channelChooseActionUrl: string; // 迭代四:频道选中下划线动画
9 channelChooseCColor: string; // 迭代四:频道未选中颜色 10 channelChooseCColor: string; // 迭代四:频道未选中颜色
@@ -14,8 +14,6 @@ export { PageComponent } from "./src/main/ets/components/page/PageComponent" @@ -14,8 +14,6 @@ export { PageComponent } from "./src/main/ets/components/page/PageComponent"
14 14
15 export { LikeComponent } from "./src/main/ets/components/view/LikeComponent" 15 export { LikeComponent } from "./src/main/ets/components/view/LikeComponent"
16 16
17 -export { TopNavigationComponent } from "./src/main/ets/components/page/TopNavigationComponent"  
18 -  
19 export { TopNavigationComponentNew } from "./src/main/ets/components/page/TopNavigationComponentNew" 17 export { TopNavigationComponentNew } from "./src/main/ets/components/page/TopNavigationComponentNew"
20 18
21 export { LabelComponent } from "./src/main/ets/components/view/LabelComponent" 19 export { LabelComponent } from "./src/main/ets/components/view/LabelComponent"
@@ -44,6 +44,7 @@ export struct CompParser { @@ -44,6 +44,7 @@ export struct CompParser {
44 aboutToAppear(): void { 44 aboutToAppear(): void {
45 45
46 46
  47 +
47 console.log('CompParser-compDTO', JSON.stringify(this.compDTO)) 48 console.log('CompParser-compDTO', JSON.stringify(this.compDTO))
48 // 轮播图屏蔽音频类型稿件 49 // 轮播图屏蔽音频类型稿件
49 if (this.compDTO.compStyle === CompStyle.Zh_Carousel_Layout_01) { 50 if (this.compDTO.compStyle === CompStyle.Zh_Carousel_Layout_01) {
@@ -93,7 +94,7 @@ export struct CompParser { @@ -93,7 +94,7 @@ export struct CompParser {
93 this.compDTO.imageScale === 2) { // && compDTO.name ==="横划卡" 94 this.compDTO.imageScale === 2) { // && compDTO.name ==="横划卡"
94 95
95 LiveHorizontalCardComponent({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName }) 96 LiveHorizontalCardComponent({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName })
96 - Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) 97 + Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
97 } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_01 && this.compDTO.imageScale === 3) { 98 } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_01 && this.compDTO.imageScale === 3) {
98 if (this.compDTO.operDataList.length > 1) { 99 if (this.compDTO.operDataList.length > 1) {
99 HorizontalStrokeCardThreeTwoRadioForMoreComponent({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName }) 100 HorizontalStrokeCardThreeTwoRadioForMoreComponent({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName })
@@ -103,7 +104,7 @@ export struct CompParser { @@ -103,7 +104,7 @@ export struct CompParser {
103 Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) 104 Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
104 } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_02) { 105 } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_02) {
105 ZhSingleRow02({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName }) 106 ZhSingleRow02({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName })
106 - Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) 107 + Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
107 } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_03) { 108 } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_03) {
108 ZhSingleRow03({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName }) 109 ZhSingleRow03({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName })
109 Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) 110 Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
@@ -34,11 +34,10 @@ export struct ENewspaperItemComponent { @@ -34,11 +34,10 @@ export struct ENewspaperItemComponent {
34 .visibility(this.isShowSkeleton ? Visibility.Visible : Visibility.None) 34 .visibility(this.isShowSkeleton ? Visibility.Visible : Visibility.None)
35 Image(this.newspaperListItemBean.pagePic) 35 Image(this.newspaperListItemBean.pagePic)
36 .width('100%') 36 .width('100%')
37 - .aspectRatio(378 / 566)  
38 - .objectFit(ImageFit.Fill)  
39 .onComplete(() => { 37 .onComplete(() => {
40 this.isShowSkeleton = false 38 this.isShowSkeleton = false
41 }) 39 })
  40 + .objectFit(ImageFit.Contain)
42 .visibility(this.isShowSkeleton ? Visibility.None : Visibility.Visible) 41 .visibility(this.isShowSkeleton ? Visibility.None : Visibility.Visible)
43 42
44 Canvas(this.context) 43 Canvas(this.context)
@@ -49,7 +48,7 @@ export struct ENewspaperItemComponent { @@ -49,7 +48,7 @@ export struct ENewspaperItemComponent {
49 48
50 }) 49 })
51 } 50 }
52 - .padding({ top: 16, right: 16, bottom: 16, left: 16 }) 51 + .padding({ top:14, right: 10, bottom: 14, left: 10 })
53 .margin({ left: 10, right: 10 }) 52 .margin({ left: 10, right: 10 })
54 .backgroundColor(Color.White) 53 .backgroundColor(Color.White)
55 .width('100%') 54 .width('100%')
@@ -28,6 +28,8 @@ export struct ENewspaperPageComponent { @@ -28,6 +28,8 @@ export struct ENewspaperPageComponent {
28 @State swiperIndex: number = 0; 28 @State swiperIndex: number = 0;
29 //当前选择的日期标记 29 //当前选择的日期标记
30 @State selectDate: Date = new Date() 30 @State selectDate: Date = new Date()
  31 + @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
  32 + @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
31 33
32 //watch监听报纸页码回调 34 //watch监听报纸页码回调
33 onCurrentPageNumUpdated(): void { 35 onCurrentPageNumUpdated(): void {
@@ -102,7 +104,10 @@ export struct ENewspaperPageComponent { @@ -102,7 +104,10 @@ export struct ENewspaperPageComponent {
102 //获取宽高尺寸 104 //获取宽高尺寸
103 this.screenWidth = this.displayTool.width 105 this.screenWidth = this.displayTool.width
104 this.picWidth = this.screenWidth - vp2px(52) 106 this.picWidth = this.screenWidth - vp2px(52)
105 - this.picHeight = this.picWidth * 566 / 378 107 + let screenHeight = this.displayTool.height;
  108 + // bottomSafeHeight 底导高度 topSafeHeight 顶导高度 44 顶部高度 60 底部高度
  109 + let height = screenHeight -this.bottomSafeHeight - this.topSafeHeight - vp2px(44) - vp2px(60)
  110 + this.picHeight = height
106 // 默认日期 111 // 默认日期
107 const date = new Date() 112 const date = new Date()
108 const month = date.getMonth() + 1 113 const month = date.getMonth() + 1
@@ -213,10 +218,11 @@ export struct ENewspaperPageComponent { @@ -213,10 +218,11 @@ export struct ENewspaperPageComponent {
213 } 218 }
214 .index(this.swiperIndex) 219 .index(this.swiperIndex)
215 .width('100%') 220 .width('100%')
216 - .height(px2vp(this.picHeight) + 32) 221 + // newspaper_shadow 44 高度 e_newspaper_content 35 margin top
  222 + .height(px2vp(this.picHeight) - 44 - 35)
217 .vertical(true) 223 .vertical(true)
218 .autoPlay(false) 224 .autoPlay(false)
219 - .cachedCount(3) 225 + .cachedCount(1)
220 .indicator(false) 226 .indicator(false)
221 .loop(false) 227 .loop(false)
222 .displayCount(1) 228 .displayCount(1)
@@ -234,6 +240,7 @@ export struct ENewspaperPageComponent { @@ -234,6 +240,7 @@ export struct ENewspaperPageComponent {
234 240
235 Image($r('app.media.newspaper_shadow')) 241 Image($r('app.media.newspaper_shadow'))
236 .height($r('app.float.vp_12')) 242 .height($r('app.float.vp_12'))
  243 + .width('100%')
237 .margin({ left: 10, right: 10, top: -1 }) 244 .margin({ left: 10, right: 10, top: -1 })
238 .objectFit(ImageFit.Contain) 245 .objectFit(ImageFit.Contain)
239 .alignRules({ 246 .alignRules({
@@ -11,6 +11,7 @@ import { router } from '@kit.ArkUI'; @@ -11,6 +11,7 @@ import { router } from '@kit.ArkUI';
11 import { CommonConstants } from 'wdConstant/Index'; 11 import { CommonConstants } from 'wdConstant/Index';
12 import { ProcessUtils } from 'wdRouter/Index'; 12 import { ProcessUtils } from 'wdRouter/Index';
13 import { TrackConstants, TrackingButton, TrackingPageBrowse } from 'wdTracking/Index'; 13 import { TrackConstants, TrackingButton, TrackingPageBrowse } from 'wdTracking/Index';
  14 +import inputMethod from '@ohos.inputMethod';
14 15
15 const TAG = 'FeedBackActivity' 16 const TAG = 'FeedBackActivity'
16 17
@@ -23,14 +24,15 @@ const TAG = 'FeedBackActivity' @@ -23,14 +24,15 @@ const TAG = 'FeedBackActivity'
23 export struct FeedBackActivity { 24 export struct FeedBackActivity {
24 pageShowTime:number = 0; 25 pageShowTime:number = 0;
25 @State canSubmit: boolean = false; 26 @State canSubmit: boolean = false;
26 - @State textNumLabel: string = '0/500';  
27 - contact: string = ""; 27 + @State textNumLabel: number = 0;
28 email: string = ""; 28 email: string = "";
29 //UI 29 //UI
30 scroller: Scroller = new Scroller(); 30 scroller: Scroller = new Scroller();
31 31
32 @State isNetConnected: boolean = true 32 @State isNetConnected: boolean = true
33 33
  34 + @State editValue: FeedbackTypeBean = {classifyName:''} as FeedbackTypeBean
  35 +
34 @State feedbackTypeBeans: FeedbackTypeBean[] = [] as FeedbackTypeBean[] 36 @State feedbackTypeBeans: FeedbackTypeBean[] = [] as FeedbackTypeBean[]
35 //添加图片 37 //添加图片
36 addPic: PhotoListBean = {itemType:1} as PhotoListBean 38 addPic: PhotoListBean = {itemType:1} as PhotoListBean
@@ -65,16 +67,9 @@ export struct FeedBackActivity { @@ -65,16 +67,9 @@ export struct FeedBackActivity {
65 GridCol({ 67 GridCol({
66 }) { 68 }) {
67 Row(){ 69 Row(){
68 - Toggle({ type: ToggleType.Checkbox, isOn: feedbackTypeBean.isSelect })  
69 - .onChange((select) => {  
70 - feedbackTypeBean.isSelect = select  
71 - this.canSubmit = this.checkSubmit()  
72 -  
73 - TrackingButton.click('submit_feedback',TrackConstants.PageName.FeedbackPage,TrackConstants.PageName.FeedbackPage,{  
74 - 'feedback_type':feedbackTypeBean.id+''  
75 - })  
76 -  
77 - }) 70 + Image(feedbackTypeBean.isSelect ? $r('app.media.checkbox_true') : $r('app.media.checkbox_false'))
  71 + .width(17)
  72 + .height(17)
78 Text(feedbackTypeBean.classifyName) 73 Text(feedbackTypeBean.classifyName)
79 .fontColor($r('app.color.color_222222')) 74 .fontColor($r('app.color.color_222222'))
80 .fontSize($r('app.float.font_size_14')) 75 .fontSize($r('app.float.font_size_14'))
@@ -84,6 +79,21 @@ export struct FeedBackActivity { @@ -84,6 +79,21 @@ export struct FeedBackActivity {
84 .height($r('app.float.vp_22')) 79 .height($r('app.float.vp_22'))
85 .margin({bottom:$r('app.float.margin_16')}) 80 .margin({bottom:$r('app.float.margin_16')})
86 .backgroundColor($r('app.color.color_fff')) 81 .backgroundColor($r('app.color.color_fff'))
  82 + .onClick(() => {
  83 + let temp = {} as FeedbackTypeBean
  84 + temp.id = feedbackTypeBean.id
  85 + temp.classifyName = feedbackTypeBean.classifyName
  86 + if(feedbackTypeBean.isSelect){
  87 + temp.isSelect = false
  88 + }else{
  89 + temp.isSelect = true
  90 + }
  91 + this.feedbackTypeBeans[index] = temp
  92 + this.canSubmit = this.checkSubmit()
  93 + TrackingButton.click('submit_feedback',TrackConstants.PageName.FeedbackPage,TrackConstants.PageName.FeedbackPage,{
  94 + 'feedback_type':feedbackTypeBean.id+''
  95 + })
  96 + })
87 } 97 }
88 }) 98 })
89 } 99 }
@@ -99,7 +109,7 @@ export struct FeedBackActivity { @@ -99,7 +109,7 @@ export struct FeedBackActivity {
99 .width(CommonConstants.FULL_WIDTH) 109 .width(CommonConstants.FULL_WIDTH)
100 .margin({ left: 24, top: $r('app.float.vp_12') }) 110 .margin({ left: 24, top: $r('app.float.vp_12') })
101 Stack({ alignContent: Alignment.BottomEnd }) { 111 Stack({ alignContent: Alignment.BottomEnd }) {
102 - TextArea({ placeholder: $r('app.string.feedback_comments') }) 112 + TextArea({ placeholder: $r('app.string.feedback_comments'),text: this.editValue.classifyName})
103 .width(CommonConstants.FULL_WIDTH) 113 .width(CommonConstants.FULL_WIDTH)
104 .height(CommonConstants.FULL_HEIGHT) 114 .height(CommonConstants.FULL_HEIGHT)
105 .fontColor($r('app.color.color_222222')) 115 .fontColor($r('app.color.color_222222'))
@@ -108,12 +118,20 @@ export struct FeedBackActivity { @@ -108,12 +118,20 @@ export struct FeedBackActivity {
108 .placeholderFont({size:$r('app.float.font_size_13_2')}) 118 .placeholderFont({size:$r('app.float.font_size_13_2')})
109 .padding({bottom:96}) 119 .padding({bottom:96})
110 .backgroundColor($r('app.color.color_F5F5F5')) 120 .backgroundColor($r('app.color.color_F5F5F5'))
  121 + .outlineColor($r('app.color.color_F5F5F5'))
111 .align(Alignment.TopStart) 122 .align(Alignment.TopStart)
112 - .maxLength(500)  
113 .onChange((value) => { 123 .onChange((value) => {
114 - // Logger.debug(TAG, "onChange" + value + "/" + this.passwordContent)  
115 - this.contact = value  
116 - this.textNumLabel = value.length+"/500" 124 + if(value.length> 500){
  125 + //隐藏键盘
  126 + inputMethod.getController().stopInputSession();
  127 + ToastUtils.shortToast($r('app.string.res_feedback_commentsFail'))
  128 + // Logger.debug(TAG, "onChange > 500 " + value)
  129 + this.editValue = {classifyName:value.substring(0,500)} as FeedbackTypeBean
  130 + }else{
  131 + this.editValue.classifyName = value
  132 + }
  133 + // Logger.debug(TAG, "onChange " + value)
  134 + this.textNumLabel = value.length
117 this.canSubmit = this.checkSubmit() 135 this.canSubmit = this.checkSubmit()
118 }) 136 })
119 GridRow({ 137 GridRow({
@@ -177,9 +195,17 @@ export struct FeedBackActivity { @@ -177,9 +195,17 @@ export struct FeedBackActivity {
177 }) 195 })
178 } 196 }
179 .margin({bottom: $r('app.float.vp_12'), right: $r('app.float.vp_12'),left: $r('app.float.vp_12')}) 197 .margin({bottom: $r('app.float.vp_12'), right: $r('app.float.vp_12'),left: $r('app.float.vp_12')})
180 - Text(this.textNumLabel) 198 + Text(){
  199 + ContainerSpan(){
  200 + if(this.textNumLabel<500){
  201 + Span(this.textNumLabel+'/500').fontColor($r('app.color.color_999999'))
  202 + }else{
  203 + Span(this.textNumLabel+'').fontColor($r('app.color.color_ED2800'))
  204 + Span('/500').fontColor($r('app.color.color_999999'))
  205 + }
  206 + }
  207 + }
181 .margin({bottom: $r('app.float.vp_12'), right: $r('app.float.vp_11')}) 208 .margin({bottom: $r('app.float.vp_12'), right: $r('app.float.vp_11')})
182 - .fontColor($r('app.color.color_999999'))  
183 .fontSize($r('app.float.font_size_13_5')) 209 .fontSize($r('app.float.font_size_13_5'))
184 } 210 }
185 .height(200) 211 .height(200)
@@ -271,7 +297,7 @@ export struct FeedBackActivity { @@ -271,7 +297,7 @@ export struct FeedBackActivity {
271 * */ 297 * */
272 checkSubmit(): boolean { 298 checkSubmit(): boolean {
273 299
274 - if(StringUtils.isEmpty(this.contact) || this.contact.length < 10){ 300 + if(StringUtils.isEmpty(this.editValue.classifyName) || this.editValue.classifyName.length < 10){
275 return false 301 return false
276 } 302 }
277 303
@@ -387,7 +413,7 @@ export struct FeedBackActivity { @@ -387,7 +413,7 @@ export struct FeedBackActivity {
387 return 413 return
388 } 414 }
389 //内容必填 415 //内容必填
390 - if(StringUtils.isEmpty(this.contact) || this.contact.length < 10 || this.contact.length>500){ 416 + if(StringUtils.isEmpty(this.editValue.classifyName) || this.editValue.classifyName.length < 10 || this.editValue.classifyName.length>500){
391 ToastUtils.shortToast($r('app.string.res_feedback_commentsFail')) 417 ToastUtils.shortToast($r('app.string.res_feedback_commentsFail'))
392 return 418 return
393 } 419 }
@@ -395,7 +421,7 @@ export struct FeedBackActivity { @@ -395,7 +421,7 @@ export struct FeedBackActivity {
395 try { 421 try {
396 let feedBackParams: FeedBackParams = { 422 let feedBackParams: FeedBackParams = {
397 //反馈内容 423 //反馈内容
398 - "content": this.contact, 424 + "content": this.editValue.classifyName,
399 //投诉类型 id 425 //投诉类型 id
400 "classifyFlagIds": selectType, 426 "classifyFlagIds": selectType,
401 //设备 427 //设备
@@ -89,72 +89,77 @@ export struct CardMediaInfo { @@ -89,72 +89,77 @@ export struct CardMediaInfo {
89 Row() { 89 Row() {
90 // 搜索接口没有返回liveInfo字段所以得做个区分 90 // 搜索接口没有返回liveInfo字段所以得做个区分
91 if (this.contentDTO && this.contentDTO.liveInfo && JSON.stringify(this.contentDTO.liveInfo) === '{}') { 91 if (this.contentDTO && this.contentDTO.liveInfo && JSON.stringify(this.contentDTO.liveInfo) === '{}') {
92 - // 当liveInfo不存在的时候  
93 - if (this.contentDTO?.liveType === 'wait') {  
94 - Image($r('app.media.card_wait'))  
95 - .mediaLogo()  
96 - Text('预约')  
97 - .mediaText()  
98 - } else if (this.contentDTO?.liveType === 'running') {  
99 - LottieView({  
100 - name: 'live_status_wait',  
101 - path: "lottie/live_detail_living.json",  
102 - lottieWidth: 14,  
103 - lottieHeight: 14,  
104 - autoplay: true,  
105 - loop: true,  
106 - })  
107 - .margin({  
108 - right: '2vp' 92 + // 当liveInfo不存在的时候
  93 + if (this.contentDTO?.liveType === 'wait') {
  94 + Image($r('app.media.card_wait'))
  95 + .mediaLogo()
  96 + Text('预约')
  97 + .mediaText()
  98 + } else if (this.contentDTO?.liveType === 'running') {
  99 + LottieView({
  100 + name: 'live_status_wait',
  101 + path: "lottie/live_detail_living.json",
  102 + lottieWidth: 14,
  103 + lottieHeight: 14,
  104 + autoplay: true,
  105 + loop: true,
109 }) 106 })
110 - // Image($r('app.media.card_live'))  
111 - // .mediaLogo()  
112 - Text('直播中')  
113 - .mediaText()  
114 - } else if (this.contentDTO?.liveType === 'end' && this.contentDTO?.linkUrl) {  
115 - Image($r('app.media.card_play'))  
116 - .mediaLogo()  
117 - Text('回看')  
118 - .mediaText()  
119 - }else if(this.contentDTO?.liveInfo?.liveState === 'end' && !this.contentDTO?.linkUrl){  
120 - Text('已结束')  
121 - .mediaText()  
122 - } 107 + .margin({
  108 + right: '2vp'
  109 + })
  110 + Text('直播中')
  111 + .mediaText()
  112 + } else if (this.contentDTO?.liveType === 'end' && this.contentDTO?.linkUrl) {
  113 + Image($r('app.media.card_play'))
  114 + .mediaLogo()
  115 + Text('回看')
  116 + .mediaText()
  117 + }else if(this.contentDTO?.liveType === 'end' && !this.contentDTO?.linkUrl){
  118 + Text('已结束')
  119 + .mediaText()
  120 + }else if(!this.contentDTO?.liveType && this.contentDTO?.linkUrl){
  121 + // 加个防护,生产有出现这样的特例
  122 + Image($r('app.media.card_play'))
  123 + .mediaLogo()
  124 + Text('回看')
  125 + .mediaText()
  126 + }
  127 +
123 }else { 128 }else {
124 // 当liveInfo存在时后 129 // 当liveInfo存在时后
125 130
126 - if (this.contentDTO?.liveInfo?.liveState === 'wait') {  
127 - Image($r('app.media.card_wait'))  
128 - .mediaLogo()  
129 - Text('预约')  
130 - .mediaText()  
131 - } else if (this.contentDTO?.liveInfo?.liveState === 'running') {  
132 - LottieView({  
133 - name: 'live_status_wait',  
134 - path: "lottie/live_detail_living.json",  
135 - lottieWidth: 14,  
136 - lottieHeight: 14,  
137 - autoplay: true,  
138 - loop: true,  
139 - })  
140 - .margin({  
141 - right: '2vp'  
142 - })  
143 - // Image($r('app.media.card_live'))  
144 - // .mediaLogo()  
145 - Text('直播中')  
146 - .mediaText()  
147 - } else if (this.contentDTO?.liveInfo?.liveState === 'end' && this.contentDTO?.liveInfo?.replayUri) {  
148 - Image($r('app.media.card_play'))  
149 - .mediaLogo()  
150 - Text('回看')  
151 - .mediaText()  
152 - }else if(this.contentDTO?.liveInfo?.liveState === 'end' && !this.contentDTO?.liveInfo  
153 - ?.replayUri){  
154 - Text('已结束')  
155 - .mediaText()  
156 - }  
157 - 131 + if (this.contentDTO?.liveInfo?.liveState === 'wait') {
  132 + Image($r('app.media.card_wait'))
  133 + .mediaLogo()
  134 + Text('预约')
  135 + .mediaText()
  136 + } else if (this.contentDTO?.liveInfo?.liveState === 'running') {
  137 + Row(){
  138 + LottieView({
  139 + name: 'live_status_wait',
  140 + path: "lottie/live_detail_living.json",
  141 + lottieWidth: 14,
  142 + lottieHeight: 14,
  143 + autoplay: true,
  144 + loop: true,
  145 + }).margin({
  146 + right: '2vp'
  147 + })
  148 + Text('直播中')
  149 + .mediaText()
  150 +
  151 + }
  152 +
  153 + } else if (this.contentDTO?.liveInfo?.liveState === 'end' && this.contentDTO?.liveInfo?.replayUri) {
  154 + Image($r('app.media.card_play'))
  155 + .mediaLogo()
  156 + Text('回看')
  157 + .mediaText()
  158 + }else if(this.contentDTO?.liveInfo?.liveState === 'end' && !this.contentDTO?.liveInfo
  159 + ?.replayUri){
  160 + Text('已结束')
  161 + .mediaText()
  162 + }
158 } 163 }
159 // 备注直播间观看人数在轮播图卡不显示 164 // 备注直播间观看人数在轮播图卡不显示
160 if(this.beused !== 'Zh_Carousel_Layout_01'){ 165 if(this.beused !== 'Zh_Carousel_Layout_01'){
@@ -165,15 +170,6 @@ export struct CardMediaInfo { @@ -165,15 +170,6 @@ export struct CardMediaInfo {
165 .mediaText() 170 .mediaText()
166 } 171 }
167 } 172 }
168 -  
169 -  
170 - // } else if (this.contentDTO?.liveInfo?.liveState === 'end' && this.contentDTO?.liveInfo  
171 - // ?.replayUri) {  
172 - // // Image($r('app.media.card_live'))  
173 - // // .mediaLogo()  
174 - // Text('直播结束')  
175 - // .mediaText()  
176 - // }  
177 } 173 }
178 } else if (this.contentDTO.objectType === '9') { 174 } else if (this.contentDTO.objectType === '9') {
179 // 显示组图;图片数量 175 // 显示组图;图片数量
@@ -229,7 +225,7 @@ export struct CardMediaInfo { @@ -229,7 +225,7 @@ export struct CardMediaInfo {
229 @Extend(Text) 225 @Extend(Text)
230 function mediaText() { 226 function mediaText() {
231 .fontColor($r('app.color.color_fff')) 227 .fontColor($r('app.color.color_fff'))
232 - .fontSize($r('app.float.font_size_14')) 228 + .fontSize($r('app.float.font_size_13'))
233 .lineHeight(18) 229 .lineHeight(18)
234 .textShadow({ 230 .textShadow({
235 radius: 2, 231 radius: 2,
@@ -18,6 +18,7 @@ const TAG: string = 'Card6Component-Card13Component'; @@ -18,6 +18,7 @@ const TAG: string = 'Card6Component-Card13Component';
18 @Component 18 @Component
19 export struct Card6Component { 19 export struct Card6Component {
20 @State pageId: string = ''; 20 @State pageId: string = '';
  21 + @State textHeight: number = 0 ; //获取文本的高度
21 @State pageName: string = ''; 22 @State pageName: string = '';
22 @State loadImg: boolean = false; 23 @State loadImg: boolean = false;
23 @State clicked: boolean = false; 24 @State clicked: boolean = false;
@@ -66,7 +67,9 @@ export struct Card6Component { @@ -66,7 +67,9 @@ export struct Card6Component {
66 } 67 }
67 } 68 }
68 69
69 - Text() { 70 + Text()
  71 + {
  72 +
70 if (this.titleMarked) { 73 if (this.titleMarked) {
71 ForEach(this.textArr, (textItem: textItem) => { 74 ForEach(this.textArr, (textItem: textItem) => {
72 if (textItem.isRed) { 75 if (textItem.isRed) {
@@ -80,11 +83,12 @@ export struct Card6Component { @@ -80,11 +83,12 @@ export struct Card6Component {
80 Span(this.contentDTO.newsTitle) 83 Span(this.contentDTO.newsTitle)
81 } 84 }
82 } 85 }
  86 +
83 .fontColor(this.clicked ? 0x848484 : 0x222222) 87 .fontColor(this.clicked ? 0x848484 : 0x222222)
84 .fontSize(18) 88 .fontSize(18)
85 .lineHeight(27) 89 .lineHeight(27)
86 .fontWeight(FontWeight.Normal) 90 .fontWeight(FontWeight.Normal)
87 - .maxLines(3) 91 + .maxLines(2)
88 .alignSelf(ItemAlign.Start) 92 .alignSelf(ItemAlign.Start)
89 .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。 93 .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。
90 .textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 && 94 .textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 &&
@@ -92,7 +96,7 @@ export struct Card6Component { @@ -92,7 +96,7 @@ export struct Card6Component {
92 ((this.contentDTO.newTags?.length > 0 || this.contentDTO.seoTags?.length > 0) || this.contentDTO.objectType == '5' || this.contentDTO.top === 1) ? 35 : 96 ((this.contentDTO.newTags?.length > 0 || this.contentDTO.seoTags?.length > 0) || this.contentDTO.objectType == '5' || this.contentDTO.top === 1) ? 35 :
93 0 ) 97 0 )
94 }.alignContent(Alignment.TopStart) 98 }.alignContent(Alignment.TopStart)
95 - // .height(this.contentDTO.appStyle === CompStyle.Card_13 ? 60: 156) 99 +
96 100
97 } 101 }
98 .justifyContent(FlexAlign.Start) 102 .justifyContent(FlexAlign.Start)
@@ -101,8 +105,12 @@ export struct Card6Component { @@ -101,8 +105,12 @@ export struct Card6Component {
101 CardSourceInfo({ compDTO: this.compDTO, contentDTO: this.contentDTO }) 105 CardSourceInfo({ compDTO: this.compDTO, contentDTO: this.contentDTO })
102 106
103 } 107 }
  108 +
104 .alignItems(HorizontalAlign.Start) 109 .alignItems(HorizontalAlign.Start)
105 - .justifyContent(FlexAlign.Start) 110 + .height(this.contentDTO.appStyle === CompStyle.Card_13 ? 78: 156)
  111 +
  112 +
  113 + .justifyContent(FlexAlign.SpaceBetween)
106 .width('64%') 114 .width('64%')
107 115
108 116
@@ -135,3 +143,4 @@ export struct Card6Component { @@ -135,3 +143,4 @@ export struct Card6Component {
135 .alignItems(VerticalAlign.Top) 143 .alignItems(VerticalAlign.Top)
136 } 144 }
137 } 145 }
  146 +
@@ -6,24 +6,25 @@ import { TrackingButton, TrackConstants } from 'wdTracking/Index'; @@ -6,24 +6,25 @@ import { TrackingButton, TrackConstants } from 'wdTracking/Index';
6 @Component 6 @Component
7 export default struct MinePageMoreFunctionUI { 7 export default struct MinePageMoreFunctionUI {
8 @Link moreData: MinePageMoreFunctionModel[] 8 @Link moreData: MinePageMoreFunctionModel[]
  9 + @Link percent:number
9 10
10 build() { 11 build() {
11 Column() { 12 Column() {
12 Column() { 13 Column() {
13 Text("更多功能") 14 Text("更多功能")
14 .fontColor($r('app.color.color_222222')) 15 .fontColor($r('app.color.color_222222'))
15 - .fontSize('29lpx')  
16 - .margin({ left: "31lpx" })  
17 - .lineHeight('46lpx') 16 + .fontSize(`${this.calcHeight(29)}lpx`)
  17 + .margin({ left: `${this.calcHeight(31)}lpx` })
  18 + .lineHeight(`${this.calcHeight(46)}lpx`)
18 .fontWeight(FontWeight.Bold) 19 .fontWeight(FontWeight.Bold)
19 - }.height('92lpx') 20 + }.height(`${this.calcHeight(92)}lpx`)
20 .width('100%') 21 .width('100%')
21 .justifyContent(FlexAlign.Center) 22 .justifyContent(FlexAlign.Center)
22 .alignItems(HorizontalAlign.Start) 23 .alignItems(HorizontalAlign.Start)
23 24
24 Text().backgroundColor($r('app.color.color_F5F5F5')) 25 Text().backgroundColor($r('app.color.color_F5F5F5'))
25 .width('100%') 26 .width('100%')
26 - .height('1lpx') 27 + .height(`${this.calcHeight(1)}lpx`)
27 28
28 List() { 29 List() {
29 ForEach(this.moreData, (item: MinePageMoreFunctionModel, index: number) => { 30 ForEach(this.moreData, (item: MinePageMoreFunctionModel, index: number) => {
@@ -31,39 +32,42 @@ export default struct MinePageMoreFunctionUI { @@ -31,39 +32,42 @@ export default struct MinePageMoreFunctionUI {
31 Column() { 32 Column() {
32 Column() { 33 Column() {
33 Row() { 34 Row() {
34 - if (item.imgSrc) {  
35 - Image(item.imgSrc)  
36 - .width('38lpx')  
37 - .height('38lpx')  
38 - .margin({ right: '15lpx' })  
39 - .objectFit(ImageFit.Auto)  
40 - .interpolation(ImageInterpolation.High)  
41 - }  
42 - Text(`${item.msg}`)  
43 - .width('456lpx')  
44 - .height('38lpx')  
45 - .fontColor($r('app.color.color_666666'))  
46 - .fontSize('29lpx')  
47 - .fontWeight(400) 35 + Row(){
  36 + if (item.imgSrc) {
  37 + Image(item.imgSrc)
  38 + .width(`${this.calcHeight(38)}lpx`)
  39 + .height(`${this.calcHeight(38)}lpx`)
  40 + .margin({ right: `${this.calcHeight(15)}lpx` })
  41 + .objectFit(ImageFit.Auto)
  42 + .interpolation(ImageInterpolation.High)
  43 + }
  44 + Text(`${item.msg}`)
  45 + .height(`${this.calcHeight(38)}lpx`)
  46 + .fontColor($r('app.color.color_666666'))
  47 + .fontSize(`${this.calcHeight(29)}lpx`)
  48 + .fontWeight(400)
  49 + }.alignItems(VerticalAlign.Center)
  50 + .justifyContent(FlexAlign.Start)
48 51
49 - Blank()  
50 Image($r('app.media.mine_user_arrow_2')) 52 Image($r('app.media.mine_user_arrow_2'))
51 - .width('27lpx')  
52 - .height('27lpx') 53 + .width(`${this.calcHeight(27)}lpx`)
  54 + .height(`${this.calcHeight(27)}lpx`)
53 .objectFit(ImageFit.Auto) 55 .objectFit(ImageFit.Auto)
54 .interpolation(ImageInterpolation.High) 56 .interpolation(ImageInterpolation.High)
55 - .margin({ left: '81lpx', right: '29lpx' }) 57 + .margin({ left: `${this.calcHeight(81)}lpx`, right: `${this.calcHeight(29)}lpx` })
56 }.alignItems(VerticalAlign.Center) 58 }.alignItems(VerticalAlign.Center)
57 - .justifyContent(FlexAlign.Center)  
58 - }.height('108lpx') 59 + .justifyContent(FlexAlign.SpaceBetween)
  60 + .width("100%")
  61 +
  62 + }.height(`${this.calcHeight(108)}lpx`)
59 .justifyContent(FlexAlign.Center) 63 .justifyContent(FlexAlign.Center)
60 - .alignItems(HorizontalAlign.Start)  
61 - .padding({ left: '27lpx' }) 64 + .padding({ left: `${this.calcHeight(27)}lpx` })
  65 + .width("100%")
62 66
63 if (index != this.moreData.length - 1) { 67 if (index != this.moreData.length - 1) {
64 Text().backgroundColor($r('app.color.color_F5F5F5')) 68 Text().backgroundColor($r('app.color.color_F5F5F5'))
65 - .width('612lpx')  
66 - .height('1lpx') 69 + .width(`612lpx`)
  70 + .height(`${this.calcHeight(1)}lpx`)
67 } 71 }
68 } 72 }
69 } 73 }
@@ -83,15 +87,21 @@ export default struct MinePageMoreFunctionUI { @@ -83,15 +87,21 @@ export default struct MinePageMoreFunctionUI {
83 ProcessUtils.gotoFeedBackActivity() 87 ProcessUtils.gotoFeedBackActivity()
84 } 88 }
85 }) 89 })
86 - .height('117lpx') 90 + .height(`${this.calcHeight(117)}lpx`)
  91 + .width("100%")
87 }) 92 })
88 }.onScrollFrameBegin((offset, state) => { 93 }.onScrollFrameBegin((offset, state) => {
89 return { offsetRemain: 0 } 94 return { offsetRemain: 0 }
90 }) 95 })
  96 + .width("100%")
91 } 97 }
92 .backgroundColor($r('app.color.white')) 98 .backgroundColor($r('app.color.white'))
93 .borderRadius(8) 99 .borderRadius(8)
94 - .margin({ left: '23lpx', right: '23lpx', top: "19lpx" }) 100 + .margin({ left: `${this.calcHeight(23)}lpx`, right: `${this.calcHeight(23)}lpx`, top: `${this.calcHeight(19)}lpx` })
  101 + }
  102 +
  103 + calcHeight(value:number): number{
  104 + return value * this.percent
95 } 105 }
96 } 106 }
97 107
@@ -11,12 +11,13 @@ const TAG = "MinePagePersonFunctionUI" @@ -11,12 +11,13 @@ const TAG = "MinePagePersonFunctionUI"
11 export default struct MinePagePersonFunctionUI { 11 export default struct MinePagePersonFunctionUI {
12 @Link personalData:MinePagePersonalFunctionsItem[] 12 @Link personalData:MinePagePersonalFunctionsItem[]
13 @Prop isLogin:boolean 13 @Prop isLogin:boolean
  14 + @Link percent:number
14 15
15 build() { 16 build() {
16 Grid(){ 17 Grid(){
17 ForEach(this.personalData,(item:MinePagePersonalFunctionsItem,index:number)=>{ 18 ForEach(this.personalData,(item:MinePagePersonalFunctionsItem,index:number)=>{
18 GridItem(){ 19 GridItem(){
19 - PagePersonFunction({ item: item, noDivider : (index % 5 < 4 && index != this.personalData.length-1) ? false : true}) 20 + PagePersonFunction({ item: item, noDivider : (index % 5 < 4 && index != this.personalData.length-1) ? false : true,percent:$percent})
20 }.onClick(()=>{ 21 }.onClick(()=>{
21 console.log(index+"") 22 console.log(index+"")
22 switch (item.msg){ 23 switch (item.msg){
@@ -77,14 +78,14 @@ export default struct MinePagePersonFunctionUI { @@ -77,14 +78,14 @@ export default struct MinePagePersonFunctionUI {
77 break; 78 break;
78 } 79 }
79 } 80 }
80 - }).width('142lpx')  
81 - .height('117lpx') 81 + })/*.width(`${this.calcHeight(142)}lpx`)*/
  82 + .height(`${this.calcHeight(117)}lpx`)
82 }) 83 })
83 } 84 }
84 .rowsTemplate('1fr') 85 .rowsTemplate('1fr')
85 .columnsTemplate('1fr 1fr 1fr 1fr 1fr') 86 .columnsTemplate('1fr 1fr 1fr 1fr 1fr')
86 - .height('117lpx')  
87 - .margin({top:'31lpx'}) 87 + .height(`${this.calcHeight(117)}lpx`)
  88 + .margin({top:`${this.calcHeight(31)}lpx`})
88 } 89 }
89 90
90 messageClick(){ 91 messageClick(){
@@ -94,6 +95,10 @@ export default struct MinePagePersonFunctionUI { @@ -94,6 +95,10 @@ export default struct MinePagePersonFunctionUI {
94 console.log(TAG, JSON.stringify(err)) 95 console.log(TAG, JSON.stringify(err))
95 }) 96 })
96 } 97 }
  98 +
  99 + calcHeight(value:number): number{
  100 + return value * this.percent
  101 + }
97 } 102 }
98 103
99 function trackButtonClick(buttonName: string){ 104 function trackButtonClick(buttonName: string){
@@ -13,6 +13,7 @@ export default struct MinePageUserSimpleInfoUI { @@ -13,6 +13,7 @@ export default struct MinePageUserSimpleInfoUI {
13 userType:string = "1" 13 userType:string = "1"
14 @State levelHead:string = "" 14 @State levelHead:string = ""
15 @State levelId:number = 0 15 @State levelId:number = 0
  16 + @Link percent:number
16 17
17 loginStateChange(){ 18 loginStateChange(){
18 if(this.isLogin){ 19 if(this.isLogin){
@@ -29,20 +30,20 @@ export default struct MinePageUserSimpleInfoUI { @@ -29,20 +30,20 @@ export default struct MinePageUserSimpleInfoUI {
29 Stack(){ 30 Stack(){
30 Image(this.headPhotoUrl==""?$r('app.media.default_head'):this.headPhotoUrl) 31 Image(this.headPhotoUrl==""?$r('app.media.default_head'):this.headPhotoUrl)
31 .alt($r('app.media.default_head')) 32 .alt($r('app.media.default_head'))
32 - .width('100lpx')  
33 - .height('100lpx') 33 + .width(`${this.calcHeight(100)}lpx`)
  34 + .height(`${this.calcHeight(100)}lpx`)
34 .objectFit(ImageFit.Cover) 35 .objectFit(ImageFit.Cover)
35 .borderRadius(50) 36 .borderRadius(50)
36 37
37 if(StringUtils.isNotEmpty(this.levelHead)){ 38 if(StringUtils.isNotEmpty(this.levelHead)){
38 Image(this.levelHead) 39 Image(this.levelHead)
39 - .width('130lpx')  
40 - .height('130lpx') 40 + .width(`${this.calcHeight(130)}lpx`)
  41 + .height(`${this.calcHeight(130)}lpx`)
41 .objectFit(ImageFit.Cover) 42 .objectFit(ImageFit.Cover)
42 .borderRadius(50) 43 .borderRadius(50)
43 } 44 }
44 - }.width('130lpx')  
45 - .height('130lpx') 45 + }.width(`${this.calcHeight(130)}lpx`)
  46 + .height(`${this.calcHeight(130)}lpx`)
46 .alignContent(Alignment.Center) 47 .alignContent(Alignment.Center)
47 .onClick(()=>{ 48 .onClick(()=>{
48 this.jumpLogin() 49 this.jumpLogin()
@@ -58,13 +59,13 @@ export default struct MinePageUserSimpleInfoUI { @@ -58,13 +59,13 @@ export default struct MinePageUserSimpleInfoUI {
58 .maxLines(1) 59 .maxLines(1)
59 .fontWeight(FontWeight.Bold) 60 .fontWeight(FontWeight.Bold)
60 .textOverflow({ overflow: TextOverflow.Ellipsis }) 61 .textOverflow({ overflow: TextOverflow.Ellipsis })
61 - .fontSize('33lpx')  
62 - .lineHeight("46lpx") 62 + .fontSize(`${this.calcHeight(33)}lpx`)
  63 + .lineHeight(`${this.calcHeight(46)}lpx`)
63 64
64 Image($r('app.media.mine_user_edit')) 65 Image($r('app.media.mine_user_edit'))
65 - .width('27lpx')  
66 - .height('27lpx')  
67 - .margin({left:'15lpx'}) 66 + .width(`${this.calcHeight(27)}lpx`)
  67 + .height(`${this.calcHeight(27)}lpx`)
  68 + .margin({left:`${this.calcHeight(15)}lpx`})
68 .objectFit(ImageFit.Cover) 69 .objectFit(ImageFit.Cover)
69 Blank() 70 Blank()
70 }.width('100%') 71 }.width('100%')
@@ -75,39 +76,39 @@ export default struct MinePageUserSimpleInfoUI { @@ -75,39 +76,39 @@ export default struct MinePageUserSimpleInfoUI {
75 76
76 Stack(){ 77 Stack(){
77 Image($r('app.media.mine_grade_bg')) 78 Image($r('app.media.mine_grade_bg'))
78 - .width('84lpx')  
79 - .height('29lpx') 79 + .width(`${this.calcHeight(84)}lpx`)
  80 + .height(`${this.calcHeight(29)}lpx`)
80 .objectFit(ImageFit.Auto) 81 .objectFit(ImageFit.Auto)
81 Text(`等级${this.levelId}`) 82 Text(`等级${this.levelId}`)
82 .textAlign(TextAlign.Center) 83 .textAlign(TextAlign.Center)
83 .fontColor($r('app.color.white')) 84 .fontColor($r('app.color.white'))
84 - .fontSize('19lpx')  
85 - .width('50lpx')  
86 - .height('29lpx')  
87 - }.margin({top:'15lpx'}) 85 + .fontSize(`${this.calcHeight(19)}lpx`)
  86 + .width(`${this.calcHeight(50)}lpx`)
  87 + .height(`${this.calcHeight(29)}lpx`)
  88 + }.margin({top:'`${this.calcHeight(15)}lpx`'})
88 }.alignItems(HorizontalAlign.Start) 89 }.alignItems(HorizontalAlign.Start)
89 - .margin({top:'12lpx',left:'23lpx'})  
90 - .width('352lpx') 90 + .margin({top:`${this.calcHeight(12)}lpx`,left:`${this.calcHeight(23)}lpx`})
  91 + .width(`${this.calcHeight(352)}lpx`)
91 }else{ 92 }else{
92 Row(){ 93 Row(){
93 Text("登录注册") 94 Text("登录注册")
94 .fontColor($r('app.color.color_222222')) 95 .fontColor($r('app.color.color_222222'))
95 - .fontSize('38lpx')  
96 - .lineHeight("46lpx") 96 + .fontSize(`${this.calcHeight(38)}lpx`)
  97 + .lineHeight(`${this.calcHeight(46)}lpx`)
97 .fontWeight(600) 98 .fontWeight(600)
98 99
99 Image($r('app.media.mine_user_edit')) 100 Image($r('app.media.mine_user_edit'))
100 - .width('11lpx')  
101 - .height('20lpx')  
102 - .margin({left:'15lpx'}) 101 + .width(`${this.calcHeight(11)}lpx`)
  102 + .height(`${this.calcHeight(20)}lpx`)
  103 + .margin({left:`${this.calcHeight(15)}lpx`})
103 .objectFit(ImageFit.Cover) 104 .objectFit(ImageFit.Cover)
104 Blank() 105 Blank()
105 }.onClick(()=>{ 106 }.onClick(()=>{
106 this.jumpLogin() 107 this.jumpLogin()
107 trackButtonClick("myPageUserLogin") 108 trackButtonClick("myPageUserLogin")
108 }) 109 })
109 - .margin({top:'11lpx',left:'23lpx'})  
110 - .width('352lpx') 110 + .margin({top:`${this.calcHeight(11)}lpx`,left:`${this.calcHeight(23)}lpx`})
  111 + .width(`${this.calcHeight(352)}lpx`)
111 } 112 }
112 113
113 Blank() 114 Blank()
@@ -116,15 +117,15 @@ export default struct MinePageUserSimpleInfoUI { @@ -116,15 +117,15 @@ export default struct MinePageUserSimpleInfoUI {
116 Text("签到") 117 Text("签到")
117 .textAlign(TextAlign.Start) 118 .textAlign(TextAlign.Start)
118 .width('108lpx') 119 .width('108lpx')
119 - .height('46lpx') 120 + .height(`${this.calcHeight(46)}lpx`)
120 .fontColor($r('app.color.color_AD6000')) 121 .fontColor($r('app.color.color_AD6000'))
121 .backgroundColor($r('app.color.color_FFC460')) 122 .backgroundColor($r('app.color.color_FFC460'))
122 .fontWeight(500) 123 .fontWeight(500)
123 .position({x:'23lpx'}) 124 .position({x:'23lpx'})
124 .padding({left:'35lpx'}) 125 .padding({left:'35lpx'})
125 Image($r("app.media.mine_sign_icon")) 126 Image($r("app.media.mine_sign_icon"))
126 - .width('50lpx')  
127 - .height('50lpx') 127 + .width(`${this.calcHeight(50)}lpx`)
  128 + .height(`${this.calcHeight(50)}lpx`)
128 }.width('131lpx') 129 }.width('131lpx')
129 .visibility(Visibility.Hidden) 130 .visibility(Visibility.Hidden)
130 }.backgroundColor($r('app.color.white')) 131 }.backgroundColor($r('app.color.white'))
@@ -201,6 +202,10 @@ export default struct MinePageUserSimpleInfoUI { @@ -201,6 +202,10 @@ export default struct MinePageUserSimpleInfoUI {
201 WDRouterRule.jumpWithPage(WDRouterPage.mineHomePage) 202 WDRouterRule.jumpWithPage(WDRouterPage.mineHomePage)
202 } 203 }
203 } 204 }
  205 +
  206 + calcHeight(value:number): number{
  207 + return value * this.percent
  208 + }
204 } 209 }
205 210
206 function trackButtonClick(buttonName: string){ 211 function trackButtonClick(buttonName: string){
@@ -4,6 +4,7 @@ import MinePagePersonalFunctionsItem from '../../viewmodel/MinePagePersonalFunct @@ -4,6 +4,7 @@ import MinePagePersonalFunctionsItem from '../../viewmodel/MinePagePersonalFunct
4 export struct PagePersonFunction{ 4 export struct PagePersonFunction{
5 @ObjectLink item: MinePagePersonalFunctionsItem 5 @ObjectLink item: MinePagePersonalFunctionsItem
6 @State noDivider:boolean = false 6 @State noDivider:boolean = false
  7 + @Link percent:number
7 8
8 build() { 9 build() {
9 Row(){ 10 Row(){
@@ -15,18 +16,18 @@ export struct PagePersonFunction{ @@ -15,18 +16,18 @@ export struct PagePersonFunction{
15 if (this.item.isShowRedPoint) { 16 if (this.item.isShowRedPoint) {
16 Button() 17 Button()
17 .type(ButtonType.Circle) 18 .type(ButtonType.Circle)
18 - .width("12lpx")  
19 - .height("12lpx") 19 + .width(`${this.calcHeight(12)}lpx`)
  20 + .height(`${this.calcHeight(12)}lpx`)
20 .backgroundColor($r('app.color.color_ED2800')) 21 .backgroundColor($r('app.color.color_ED2800'))
21 } 22 }
22 - }.width('46lpx')  
23 - .height('46lpx') 23 + }.width(`${this.calcHeight(46)}lpx`)
  24 + .height(`${this.calcHeight(46)}lpx`)
24 25
25 Text(`${this.item.msg}`) 26 Text(`${this.item.msg}`)
26 - .margin({top:'8lpx'})  
27 - .height('23lpx') 27 + .margin({top:`${this.calcHeight(8)}lpx`})
  28 + .height(`${this.calcHeight(23)}lpx`)
28 .fontColor($r('app.color.color_222222')) 29 .fontColor($r('app.color.color_222222'))
29 - .fontSize('23lpx') 30 + .fontSize(`${this.calcHeight(23)}lpx`)
30 } 31 }
31 .alignItems(HorizontalAlign.Center) 32 .alignItems(HorizontalAlign.Center)
32 .width('100%') 33 .width('100%')
@@ -35,10 +36,13 @@ export struct PagePersonFunction{ @@ -35,10 +36,13 @@ export struct PagePersonFunction{
35 if(!this.noDivider){ 36 if(!this.noDivider){
36 Text().backgroundColor($r('app.color.color_222222')) 37 Text().backgroundColor($r('app.color.color_222222'))
37 .opacity(0.1) 38 .opacity(0.1)
38 - .width('2lpx')  
39 - .height('29lpx') 39 + .width(`${this.calcHeight(2)}lpx`)
  40 + .height(`${this.calcHeight(29)}lpx`)
40 } 41 }
41 } 42 }
42 } 43 }
43 44
  45 + calcHeight(value:number): number{
  46 + return value * this.percent
  47 + }
44 } 48 }
@@ -11,6 +11,14 @@ import { FollowOperationRequestItem } from '../../../viewmodel/FollowOperationRe @@ -11,6 +11,14 @@ import { FollowOperationRequestItem } from '../../../viewmodel/FollowOperationRe
11 export struct FollowChildComponent{ 11 export struct FollowChildComponent{
12 @ObjectLink data: FollowListDetailItem 12 @ObjectLink data: FollowListDetailItem
13 @State type:number = 0 13 @State type:number = 0
  14 + @State columnHeight:number = 202
  15 +
  16 +
  17 + aboutToAppear(): void {
  18 + if(this.type == 0 && StringUtils.isEmpty(this.data.introduction)){
  19 + this.columnHeight = 202 - 31
  20 + }
  21 + }
14 22
15 build() { 23 build() {
16 if(this.type == 0 ){ 24 if(this.type == 0 ){
@@ -82,6 +90,7 @@ export struct FollowChildComponent{ @@ -82,6 +90,7 @@ export struct FollowChildComponent{
82 .justifyContent(FlexAlign.Center) 90 .justifyContent(FlexAlign.Center)
83 .width('100lpx') 91 .width('100lpx')
84 .backgroundColor($r("app.color.color_F5F5F5")) 92 .backgroundColor($r("app.color.color_F5F5F5"))
  93 + .borderRadius("6lpx")
85 .height('46lpx') 94 .height('46lpx')
86 .onClick(()=>{ 95 .onClick(()=>{
87 this.followOperation() 96 this.followOperation()
@@ -114,7 +123,7 @@ export struct FollowChildComponent{ @@ -114,7 +123,7 @@ export struct FollowChildComponent{
114 .justifyContent(FlexAlign.SpaceBetween) 123 .justifyContent(FlexAlign.SpaceBetween)
115 .alignItems(VerticalAlign.Top) 124 .alignItems(VerticalAlign.Top)
116 125
117 - }.height('202lpx') 126 + }.height(`${this.columnHeight}lpx`)
118 .justifyContent(FlexAlign.Start) 127 .justifyContent(FlexAlign.Start)
119 128
120 Divider() 129 Divider()
@@ -198,6 +207,7 @@ export struct FollowChildComponent{ @@ -198,6 +207,7 @@ export struct FollowChildComponent{
198 } 207 }
199 .backgroundColor($r("app.color.color_F5F5F5")) 208 .backgroundColor($r("app.color.color_F5F5F5"))
200 .justifyContent(FlexAlign.Center) 209 .justifyContent(FlexAlign.Center)
  210 + .borderRadius("6lpx")
201 .width('100lpx') 211 .width('100lpx')
202 .height('46lpx') 212 .height('46lpx')
203 .onClick(()=>{ 213 .onClick(()=>{
@@ -10,7 +10,10 @@ const TAG = "FollowFirstTabsComponent" @@ -10,7 +10,10 @@ const TAG = "FollowFirstTabsComponent"
10 export struct FollowFirstTabsComponent{ 10 export struct FollowFirstTabsComponent{
11 @State currentIndex: number = 0 11 @State currentIndex: number = 0
12 @Prop changeIndex: number 12 @Prop changeIndex: number
13 - private controller: TabsController = new TabsController() 13 +
  14 + private swiperController: SwiperController = new SwiperController()
  15 + private listScroller: Scroller = new Scroller()
  16 +
14 @State data:FollowListItem[] = [] 17 @State data:FollowListItem[] = []
15 fontColor: string = '#999999' 18 fontColor: string = '#999999'
16 selectedFontColor: string = '#000000' 19 selectedFontColor: string = '#000000'
@@ -20,7 +23,7 @@ export struct FollowFirstTabsComponent{ @@ -20,7 +23,7 @@ export struct FollowFirstTabsComponent{
20 this.getFollowTabList() 23 this.getFollowTabList()
21 24
22 EmitterUtils.receiveEvent(EmitterEventId.MY_FOLLOW_EMPTY, (() => { 25 EmitterUtils.receiveEvent(EmitterEventId.MY_FOLLOW_EMPTY, (() => {
23 - if(this.controller != null && this.data.length>1 ){ 26 + if(this.swiperController != null && this.data.length>1 ){
24 this.jumpFollowNextPage() 27 this.jumpFollowNextPage()
25 } 28 }
26 })) 29 }))
@@ -33,7 +36,7 @@ export struct FollowFirstTabsComponent{ @@ -33,7 +36,7 @@ export struct FollowFirstTabsComponent{
33 this.data.push(element) 36 this.data.push(element)
34 }) 37 })
35 38
36 - if(this.controller != null && this.data.length>1 && this.changeIndex === 1){ 39 + if(this.swiperController != null && this.data.length>1 && this.changeIndex === 1){
37 this.jumpFollowNextPage() 40 this.jumpFollowNextPage()
38 } 41 }
39 }).catch((err:Error)=>{ 42 }).catch((err:Error)=>{
@@ -45,7 +48,7 @@ export struct FollowFirstTabsComponent{ @@ -45,7 +48,7 @@ export struct FollowFirstTabsComponent{
45 //个人主页 跳转 关注页 tab 2 48 //个人主页 跳转 关注页 tab 2
46 let intervalID = setInterval(() => { 49 let intervalID = setInterval(() => {
47 this.currentIndex = 1 50 this.currentIndex = 1
48 - this.controller.changeIndex(this.currentIndex) 51 + this.swiperController.changeIndex(this.currentIndex)
49 clearInterval(intervalID); 52 clearInterval(intervalID);
50 }, 500); 53 }, 500);
51 } 54 }
@@ -70,7 +73,8 @@ export struct FollowFirstTabsComponent{ @@ -70,7 +73,8 @@ export struct FollowFirstTabsComponent{
70 } 73 }
71 }.onClick(()=>{ 74 }.onClick(()=>{
72 this.currentIndex = index 75 this.currentIndex = index
73 - this.controller.changeIndex(this.currentIndex) 76 + this.swiperController.changeIndex(this.currentIndex)
  77 + this.listScroller.scrollToIndex(index, true, ScrollAlign.CENTER)
74 trackTabFirstClick(item.directoryName) 78 trackTabFirstClick(item.directoryName)
75 }) 79 })
76 .height('100%') 80 .height('100%')
@@ -90,28 +94,38 @@ export struct FollowFirstTabsComponent{ @@ -90,28 +94,38 @@ export struct FollowFirstTabsComponent{
90 .layoutWeight(1) 94 .layoutWeight(1)
91 .width('100%') 95 .width('100%')
92 }else{ 96 }else{
93 - Tabs({ barPosition: BarPosition.Start, controller: this.controller }) {  
94 - ForEach(this.data, (item: FollowListItem, index: number ) => {  
95 - TabContent(){ 97 + Column(){
  98 + List({ scroller: this.listScroller }){
  99 + ForEach(this.data, (item: FollowListItem, index: number ) => {
  100 + ListItem(){
  101 + this.TabBuilder(index,item)
  102 + }
  103 + }, (item: FollowListItem, index: number) => index.toString())
  104 + }.listDirection(Axis.Horizontal)
  105 + .backgroundColor($r('app.color.white'))
  106 + .width("100%")
  107 + .height("84lpx")
  108 + .edgeEffect(EdgeEffect.None)
  109 + .scrollBar(BarState.Off)
  110 +
  111 + Swiper(this.swiperController){
  112 + ForEach(this.data, (item: FollowListItem, index: number ) => {
96 FollowSecondTabsComponent({data:$data,firstIndex:index}) 113 FollowSecondTabsComponent({data:$data,firstIndex:index})
97 - }.tabBar(this.TabBuilder(index,item))  
98 - .backgroundColor($r('app.color.white'))  
99 - .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])  
100 - }, (item: FollowListItem, index: number) => index.toString())  
101 - }  
102 - .vertical(false)  
103 - .barMode(BarMode.Scrollable)  
104 - .barWidth('100%')  
105 - .barBackgroundColor($r('app.color.white'))  
106 - .barHeight('84lpx')  
107 - .animationDuration(0)  
108 - .onChange((index: number) => {  
109 - this.currentIndex = index  
110 - trackTabFirstClick(this.data[index].directoryName)  
111 - })  
112 - .width('100%')  
113 - .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])  
114 - .layoutWeight(1) 114 + .backgroundColor($r('app.color.white'))
  115 + }, (item: FollowListItem, index: number) => index.toString())
  116 + }
  117 + .onChange((index: number) => {
  118 + this.currentIndex = index
  119 + trackTabFirstClick(this.data[index].directoryName)
  120 + this.listScroller.scrollToIndex(index, true, ScrollAlign.CENTER)
  121 + })
  122 + .width('100%')
  123 + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
  124 + .layoutWeight(1)
  125 + .loop(false)
  126 + .indicator(false)
  127 + .effectMode(EdgeEffect.None)
  128 + }.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
115 } 129 }
116 }.width('100%') 130 }.width('100%')
117 .height("100%") 131 .height("100%")
@@ -98,6 +98,7 @@ export struct FollowListDetailUI { @@ -98,6 +98,7 @@ export struct FollowListDetailUI {
98 ListItem() { 98 ListItem() {
99 ListHasNoMoreDataUI() 99 ListHasNoMoreDataUI()
100 } 100 }
  101 + .margin({bottom:"40lpx"})
101 } 102 }
102 } 103 }
103 .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM]) 104 .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
@@ -143,13 +144,11 @@ export struct FollowListDetailUI { @@ -143,13 +144,11 @@ export struct FollowListDetailUI {
143 value.list.forEach((value) => { 144 value.list.forEach((value) => {
144 let fansNum: number = value.fansNum 145 let fansNum: number = value.fansNum
145 let fansNumString = "" 146 let fansNumString = ""
146 - if (fansNum > 10000) {  
147 - let temp = (fansNum / 10000) + ""  
148 - let index = temp.indexOf('.')  
149 - if (index != -1) {  
150 - temp = temp.substring(0, index + 2)  
151 - } else {  
152 - temp = temp 147 +
  148 + if (fansNum >= 10000) {
  149 + let temp = (fansNum / 10000) .toFixed(1)
  150 + if (Number(temp.substring(temp.length-1)) == 0) {
  151 + temp = temp.substring(0, temp.length-2)
153 } 152 }
154 fansNumString = temp + "万" 153 fansNumString = temp + "万"
155 } else { 154 } else {
@@ -7,7 +7,7 @@ export struct FollowSecondTabsComponent{ @@ -7,7 +7,7 @@ export struct FollowSecondTabsComponent{
7 @Link data:FollowListItem[] 7 @Link data:FollowListItem[]
8 @State firstIndex:number = 0 8 @State firstIndex:number = 0
9 @State currentIndex: number = 0 9 @State currentIndex: number = 0
10 - private controller: TabsController = new TabsController() 10 + private swiperController: SwiperController = new SwiperController()
11 fontColor: string = '#000000' 11 fontColor: string = '#000000'
12 selectedFontColor: string = '#ED2800' 12 selectedFontColor: string = '#ED2800'
13 13
@@ -77,20 +77,16 @@ export struct FollowSecondTabsComponent{ @@ -77,20 +77,16 @@ export struct FollowSecondTabsComponent{
77 .alignItems(VerticalAlign.Top) 77 .alignItems(VerticalAlign.Top)
78 .height('100%') 78 .height('100%')
79 79
80 - Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { 80 + Swiper(this.swiperController ) {
81 ForEach(this.data[this.firstIndex].children, (item: FollowSecondListItem, index: number ) => { 81 ForEach(this.data[this.firstIndex].children, (item: FollowSecondListItem, index: number ) => {
82 - TabContent(){  
83 - FollowThirdTabsComponent({data:$data,firstIndex:$firstIndex,secondIndex:index})  
84 - }.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM]) 82 + FollowThirdTabsComponent({data:$data,firstIndex:$firstIndex,secondIndex:index})
85 }, (item: FollowListItem, index: number) => index.toString()) 83 }, (item: FollowListItem, index: number) => index.toString())
86 } 84 }
  85 + .loop(false)
87 .vertical(true) 86 .vertical(true)
88 - .barMode(BarMode.Scrollable)  
89 - .animationDuration(0)  
90 - .onChange((index: number) => {  
91 - this.currentIndex = index  
92 - })  
93 - .barWidth(0) 87 + .indicator(false)
  88 + .disableSwipe(true)
  89 + .effectMode(EdgeEffect.None)
94 .height('100%') 90 .height('100%')
95 .layoutWeight(1) 91 .layoutWeight(1)
96 .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM]) 92 .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
@@ -110,7 +106,7 @@ export struct FollowSecondTabsComponent{ @@ -110,7 +106,7 @@ export struct FollowSecondTabsComponent{
110 } 106 }
111 .onClick(()=>{ 107 .onClick(()=>{
112 this.currentIndex = index 108 this.currentIndex = index
113 - this.controller.changeIndex(this.currentIndex) 109 + this.swiperController.changeIndex(this.currentIndex)
114 }) 110 })
115 .justifyContent(FlexAlign.Center) 111 .justifyContent(FlexAlign.Center)
116 .height('84lpx') 112 .height('84lpx')
@@ -10,8 +10,8 @@ export struct FollowThirdTabsComponent{ @@ -10,8 +10,8 @@ export struct FollowThirdTabsComponent{
10 @Link firstIndex: number 10 @Link firstIndex: number
11 @State secondIndex:number = -1 11 @State secondIndex:number = -1
12 12
13 -  
14 - private controller: TabsController = new TabsController() 13 + private swiperController: SwiperController = new SwiperController()
  14 + private listScroller: Scroller = new Scroller()
15 fontColor: string = '#666666' 15 fontColor: string = '#666666'
16 selectedFontColor: string = '#222222' 16 selectedFontColor: string = '#222222'
17 17
@@ -50,7 +50,8 @@ export struct FollowThirdTabsComponent{ @@ -50,7 +50,8 @@ export struct FollowThirdTabsComponent{
50 } 50 }
51 .onClick(()=>{ 51 .onClick(()=>{
52 this.currentIndex = index 52 this.currentIndex = index
53 - this.controller.changeIndex(this.currentIndex) 53 + this.swiperController.changeIndex(this.currentIndex)
  54 + this.listScroller.scrollToIndex(index, true, ScrollAlign.CENTER)
54 }) 55 })
55 .offset({x:index === 0?"0lpx":"-5lpx"}) 56 .offset({x:index === 0?"0lpx":"-5lpx"})
56 .height('80lpx') 57 .height('80lpx')
@@ -62,31 +63,47 @@ export struct FollowThirdTabsComponent{ @@ -62,31 +63,47 @@ export struct FollowThirdTabsComponent{
62 @Builder FollowThirdUI(){ 63 @Builder FollowThirdUI(){
63 64
64 Column(){ 65 Column(){
65 - Column() {  
66 - // 页签  
67 - Row() {  
68 - Scroll() {  
69 - Row() {  
70 - ForEach(this.data[this.firstIndex].children[this.secondIndex].children, (item: FollowThirdListItem, index: number ) => {  
71 - this.TabBuilder(index,item)  
72 - })  
73 - }  
74 - .justifyContent(FlexAlign.Start) 66 +
  67 + List({ scroller: this.listScroller }){
  68 + ForEach(this.data[this.firstIndex].children[this.secondIndex].children, (item: FollowThirdListItem, index: number ) => {
  69 + ListItem(){
  70 + this.TabBuilder(index,item)
75 } 71 }
76 - .align(Alignment.Start)  
77 - .scrollable(ScrollDirection.Horizontal)  
78 - .scrollBar(BarState.Off)  
79 - .width('100%')  
80 - .padding({left:'31lpx',right:'48lpx'})  
81 - }  
82 - .alignItems(VerticalAlign.Bottom)  
83 - .width('100%') 72 + })
84 } 73 }
85 .backgroundColor($r('app.color.white')) 74 .backgroundColor($r('app.color.white'))
86 - .alignItems(HorizontalAlign.Start) 75 + .edgeEffect(EdgeEffect.None)
  76 + .scrollBar(BarState.Off)
  77 + .listDirection(Axis.Horizontal)
87 .width('100%') 78 .width('100%')
  79 + .height("84lpx")
  80 + .padding({left:'31lpx',right:'48lpx'})
  81 +
  82 + // Column() {
  83 + // // 页签
  84 + // Row() {
  85 + // Scroll() {
  86 + // Row() {
  87 + // ForEach(this.data[this.firstIndex].children[this.secondIndex].children, (item: FollowThirdListItem, index: number ) => {
  88 + // this.TabBuilder(index,item)
  89 + // })
  90 + // }
  91 + // .justifyContent(FlexAlign.Start)
  92 + // }
  93 + // .align(Alignment.Start)
  94 + // .scrollable(ScrollDirection.Horizontal)
  95 + // .scrollBar(BarState.Off)
  96 + // .width('100%')
  97 + // .padding({left:'31lpx',right:'48lpx'})
  98 + // }
  99 + // .alignItems(VerticalAlign.Bottom)
  100 + // .width('100%')
  101 + // }
  102 + // .backgroundColor($r('app.color.white'))
  103 + // .alignItems(HorizontalAlign.Start)
  104 + // .width('100%')
88 105
89 - Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { 106 + Swiper(this.swiperController ) {
90 ForEach(this.data[this.firstIndex].children[this.secondIndex].children, (item: FollowThirdListItem, index: number ) => { 107 ForEach(this.data[this.firstIndex].children[this.secondIndex].children, (item: FollowThirdListItem, index: number ) => {
91 TabContent(){ 108 TabContent(){
92 Column(){ 109 Column(){
@@ -96,12 +113,12 @@ export struct FollowThirdTabsComponent{ @@ -96,12 +113,12 @@ export struct FollowThirdTabsComponent{
96 .backgroundColor($r('app.color.white')) 113 .backgroundColor($r('app.color.white'))
97 }, (item: FollowListItem, index: number) => index.toString()) 114 }, (item: FollowListItem, index: number) => index.toString())
98 } 115 }
99 - .barHeight(0)  
100 - .vertical(false)  
101 - .barMode(BarMode.Scrollable)  
102 - .animationDuration(0) 116 + .loop(false)
  117 + .indicator(false)
  118 + .disableSwipe(true)
  119 + .effectMode(EdgeEffect.None)
103 .onChange((index: number) => { 120 .onChange((index: number) => {
104 - this.currentIndex = index 121 + // this.currentIndex = index
105 }) 122 })
106 .width('100%') 123 .width('100%')
107 .layoutWeight(1) 124 .layoutWeight(1)
@@ -5,7 +5,7 @@ import MinePageDatasModel from '../../model/MinePageDatasModel' @@ -5,7 +5,7 @@ import MinePageDatasModel from '../../model/MinePageDatasModel'
5 import MinePageUserSimpleInfoUI from '../mine/MinePageUserSimpleInfoUI' 5 import MinePageUserSimpleInfoUI from '../mine/MinePageUserSimpleInfoUI'
6 import MinePagePersonFunctionUI from '../mine/MinePagePersonFunctionUI' 6 import MinePagePersonFunctionUI from '../mine/MinePagePersonFunctionUI'
7 import MinePageMoreFunctionUI from '../mine/MinePageMoreFunctionUI' 7 import MinePageMoreFunctionUI from '../mine/MinePageMoreFunctionUI'
8 -import { DateTimeUtils, SPHelper, StringUtils } from 'wdKit' 8 +import { BreakpointSystem, DateTimeUtils, SPHelper, StringUtils } from 'wdKit'
9 import { SpConstants } from 'wdConstant' 9 import { SpConstants } from 'wdConstant'
10 import dataPreferences from '@ohos.data.preferences'; 10 import dataPreferences from '@ohos.data.preferences';
11 import { MergeRecordDialog } from '../../dialog/MergeRecordDialog' 11 import { MergeRecordDialog } from '../../dialog/MergeRecordDialog'
@@ -59,6 +59,20 @@ export struct MinePageComponent { @@ -59,6 +59,20 @@ export struct MinePageComponent {
59 pageHideTime:number = 0; 59 pageHideTime:number = 0;
60 pageFirstCreateTime:number = 0; 60 pageFirstCreateTime:number = 0;
61 @Prop isMinePage:boolean = false; 61 @Prop isMinePage:boolean = false;
  62 + @StorageProp('currentBreakpoint') @Watch("currentChanged")currentBreakpoint: string = 'sm';
  63 + private breakpointSystem = new BreakpointSystem();
  64 + @State percent:number = 1
  65 +
  66 + currentChanged(){
  67 + if(this.currentBreakpoint == "md" || this.currentBreakpoint == "lg"){
  68 + //大屏幕 折叠屏 或者ipad
  69 + this.percent = 0.7
  70 + }else {
  71 + this.percent = 1
  72 + }
  73 + console.log(TAG,"currentBreakpoint==>"+this.percent)
  74 + }
  75 +
62 76
63 //第一次还没创建时候 pageShow 接收不到监听 77 //第一次还没创建时候 pageShow 接收不到监听
64 async pageShowForUpdateData() { 78 async pageShowForUpdateData() {
@@ -85,11 +99,14 @@ export struct MinePageComponent { @@ -85,11 +99,14 @@ export struct MinePageComponent {
85 } 99 }
86 100
87 aboutToAppear(){ 101 aboutToAppear(){
  102 + this.breakpointSystem.register();
88 this.pageFirstCreateTime = DateTimeUtils.getTimeStamp() 103 this.pageFirstCreateTime = DateTimeUtils.getTimeStamp()
89 104
90 this.getFunctionData() 105 this.getFunctionData()
91 this.getUserLogin() 106 this.getUserLogin()
92 this.addLoginStatusObserver() 107 this.addLoginStatusObserver()
  108 + console.log(TAG,"currentBreakpoint==>"+this.currentBreakpoint)
  109 + this.currentChanged()
93 } 110 }
94 111
95 getMessageData(){ 112 getMessageData(){
@@ -119,6 +136,7 @@ export struct MinePageComponent { @@ -119,6 +136,7 @@ export struct MinePageComponent {
119 } 136 }
120 137
121 aboutToDisappear(): void { 138 aboutToDisappear(): void {
  139 + this.breakpointSystem.unregister();
122 if(this.preferences){ 140 if(this.preferences){
123 this.preferences.off('change', this.observer); 141 this.preferences.off('change', this.observer);
124 } 142 }
@@ -139,7 +157,7 @@ export struct MinePageComponent { @@ -139,7 +157,7 @@ export struct MinePageComponent {
139 Stack(){ 157 Stack(){
140 Image($r('app.media.mine_head_bg')) 158 Image($r('app.media.mine_head_bg'))
141 .width('100%') 159 .width('100%')
142 - .height('657lpx') 160 + .height(`${657 * this.percent}lpx`)
143 .objectFit(ImageFit.Auto) 161 .objectFit(ImageFit.Auto)
144 this.MinePageUI() 162 this.MinePageUI()
145 } 163 }
@@ -155,16 +173,16 @@ export struct MinePageComponent { @@ -155,16 +173,16 @@ export struct MinePageComponent {
155 @Builder MinePageUI(){ 173 @Builder MinePageUI(){
156 Column(){ 174 Column(){
157 //头像层 175 //头像层
158 - MinePageUserSimpleInfoUI({isLogin:this.isLogin}) 176 + MinePageUserSimpleInfoUI({isLogin:this.isLogin,percent:$percent})
159 //Grid 区域 177 //Grid 区域
160 - MinePagePersonFunctionUI({personalData:$personalData,isLogin:this.isLogin}) 178 + MinePagePersonFunctionUI({personalData:$personalData,isLogin:this.isLogin,percent:$percent})
161 //Card 179 //Card
162 //MinePageCardUI() 180 //MinePageCardUI()
163 //创作者区域 181 //创作者区域
164 182
165 //MinePageCreatorFunctionUI({creatorData:$creatorData}) 183 //MinePageCreatorFunctionUI({creatorData:$creatorData})
166 //更多功能 184 //更多功能
167 - MinePageMoreFunctionUI({moreData:$moreData}) 185 + MinePageMoreFunctionUI({moreData:$moreData,percent:$percent})
168 }.width('100%') 186 }.width('100%')
169 .height('100%') 187 .height('100%')
170 .justifyContent(FlexAlign.Start) 188 .justifyContent(FlexAlign.Start)
1 -import { BottomNavDTO, CompDTO, TopNavDTO } from 'wdBean';  
2 -import { SpConstants } from 'wdConstant';  
3 -import { DisplayUtils, LazyDataSource, Logger, NetworkUtil, SPHelper, ToastUtils } from 'wdKit';  
4 -import { ProcessUtils, WDRouterPage, WDRouterRule } from 'wdRouter';  
5 -import { PageComponent } from './PageComponent';  
6 -import { ChannelSubscriptionLayout } from './ChannelSubscriptionLayout';  
7 -import { FirstTabTopSearchComponent } from '../search/FirstTabTopSearchComponent';  
8 -import { AssignChannelParam } from 'wdRouter/src/main/ets/utils/HomeChannelUtils';  
9 -import { PeopleShipMainComponent } from '../peopleShip/PeopleShipMainComponent';  
10 -import { channelSkeleton } from '../skeleton/channelSkeleton';  
11 -import { TrackingButton, TrackConstants } from 'wdTracking/Index';  
12 -  
13 -const TAG = 'TopNavigationComponent';  
14 -  
15 -PersistentStorage.persistProp('channelIds', '');  
16 -PersistentStorage.persistProp('indexSettingChannelId', 2002);  
17 -  
18 -const storage = LocalStorage.getShared();  
19 -  
20 -/**  
21 - * 顶部页签导航栏/顶导  
22 - */  
23 -@Entry(storage)  
24 -@Component  
25 -export struct TopNavigationComponent {  
26 - private groupId: number = 0  
27 - private currentBottomNavName: string = ''  
28 - private tabsController: TabsController = new TabsController()  
29 - @Consume isLayoutFullScreen: boolean  
30 - @Consume bottomRectHeight: number  
31 - @Consume topRectHeight: number  
32 - @Consume currentBottomNavInfo: BottomNavDTO // 当前底导信息  
33 - @Consume barBackgroundColor: Color  
34 - @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0  
35 - @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0  
36 - @Link _currentNavIndex?: number;  
37 - // 顶导当前选中/焦点下标  
38 - @State currentTopNavSelectedIndex: number = 0;  
39 - /**  
40 - * @deprecated TODO,没地方用到,是否弃用  
41 - */  
42 - @State currentTopNavName: string = '';  
43 - @State currentTopNavItem: TopNavDTO = {} as TopNavDTO  
44 - // 顶导数据  
45 - @State @Watch('onTopNavigationDataUpdated') topNavList: TopNavDTO[] = []  
46 - @State compList: LazyDataSource<CompDTO> = new LazyDataSource();  
47 - @StorageProp('indexSettingChannelId') indexSettingChannelId: number = 2002  
48 - //我的频道id列表  
49 - @State channelIds: number[] = []  
50 - //本地缓存频道id列表  
51 - @StorageProp('channelIds') storageChannelIds: string = ''  
52 - @State homeChannelList: TopNavDTO[] = []  
53 - // 我的频道列表  
54 - @State myChannelList: TopNavDTO[] = []  
55 - // 更多频道列表  
56 - @State moreChannelList: TopNavDTO[] = []  
57 - // 地方频道列表  
58 - @State localChannelList: TopNavDTO[] = []  
59 - readonly MAX_LINE: number = 1;  
60 - @ObjectLink @Watch('onAssignChannelChange') assignChannel: AssignChannelParam  
61 - // 底导传递过来的自动刷新通知  
62 - @Prop @Watch('onAutoRefresh') autoRefresh: number = 0  
63 - // 传递给page的自动刷新通知  
64 - @State autoRefresh2Page: number = 0  
65 - // 当前底导index  
66 - @State navIndex: number = 0  
67 - @State animationDuration: number = 0  
68 - @State indicatorLeftMargin: number = 0  
69 - @State indicatorWidth: number = 0  
70 - private tabsWidth: number = 0  
71 - // 标识,是否为点击触发的tab切换,临时变量  
72 - private changeByClick: boolean = false  
73 -  
74 - //处理新闻tab顶导频道数据  
75 - topNavListHandle() {  
76 - let cityName = SPHelper.default.getSync(SpConstants.LOCATION_CITY_NAME, '') as string  
77 -  
78 - let _channelIds: number [] = []  
79 - let _myChannelList: TopNavDTO [] = []  
80 - let _storageChannelIds: string [] = [] //list1  
81 - let defaultMyChannelList: TopNavDTO[] = []  
82 - let defaultList = [...this.topNavList]  
83 - defaultList.sort((a, b) => {  
84 - return a.num - b.num;  
85 - });  
86 -  
87 - //defaultMyChannelList  
88 - defaultList.forEach(item => {  
89 - if (item.defaultPermitted === 1 || item.movePermitted === 0 || item.delPermitted === 0 ||  
90 - item.headlinesOn === 1) {  
91 - defaultMyChannelList.push(item);  
92 - }  
93 - if (item.defaultPermitted === 1) {  
94 - this.homeChannelList.push(item)  
95 - }  
96 - })  
97 -  
98 - //有缓存频道id  
99 - if (this.storageChannelIds) {  
100 - _storageChannelIds = this.storageChannelIds.split(',')  
101 - }  
102 -  
103 - defaultMyChannelList.forEach(item => {  
104 - item.myChannel = '1'  
105 - if (item.defaultPermitted === 1) {  
106 - item.homeChannel = '1'  
107 - }  
108 - let index = defaultList.findIndex(_item => _item.channelId === item.channelId)  
109 - if (index !== -1) {  
110 - defaultList.splice(index, 1)  
111 - }  
112 - })  
113 - defaultList.unshift(...defaultMyChannelList)  
114 -  
115 - defaultList.forEach((item, index) => {  
116 - if (this.storageChannelIds && _storageChannelIds.includes(String(item.channelId))) {  
117 - item.myChannel = '1'  
118 - }  
119 - if (item.channelType === 2) {  
120 - if (cityName.includes(item.name)) {  
121 - item.myChannel = '1'  
122 - }  
123 - item.localChannel = '1'  
124 - }  
125 - if (index >= 11) {  
126 - if (item.channelType === 1) {  
127 - item.moreChannel = '1'  
128 - }  
129 - } else {  
130 - if (item.channelType === 1 && item.myChannel !== '1') {  
131 - item.moreChannel = '1'  
132 - }  
133 - }  
134 -  
135 - //频道分类  
136 - if (item.name !== '播报') { //暂时隐藏播报  
137 - if (item.myChannel === '1') {  
138 - _myChannelList.push(item)  
139 - _channelIds.push(item.channelId)  
140 - } else if (item.moreChannel === '1') {  
141 - this.moreChannelList.push(item)  
142 - } else if (item.localChannel === '1' && item.myChannel !== '1') {  
143 - this.localChannelList.push(item)  
144 - }  
145 - }  
146 -  
147 - })  
148 -  
149 - if (cityName) {  
150 - let index = _myChannelList.findIndex(ele => cityName.includes(ele.name))  
151 - const localChannelitem = _myChannelList.splice(index, 1)[0];  
152 - // 将当前地区频道插入到第四个  
153 - _myChannelList.splice(3, 0, localChannelitem);  
154 - }  
155 -  
156 - this.channelIds = _channelIds  
157 - this.myChannelList = _myChannelList  
158 -  
159 - // 崩溃  
160 - // this.currentTopNavName = this._currentNavIndex === 0 ? this.myChannelList[0].name : this.topNavList[0].name  
161 - if (this._currentNavIndex === 0 && this.myChannelList && this.myChannelList.length > 0 && this.myChannelList[0] &&  
162 - this.myChannelList[0].name) {  
163 - this.currentTopNavName = this.myChannelList[0].name  
164 - } else if (this._currentNavIndex != 0 && this.topNavList && this.topNavList.length > 0 && this.topNavList[0].name) {  
165 - this.currentTopNavName = this.topNavList[0].name  
166 - }  
167 -  
168 - //缓存首页频道  
169 - let index = this.myChannelList.findIndex(_item => _item?.channelId === this.indexSettingChannelId)  
170 - if (index > -1) {  
171 - this.currentTopNavSelectedIndex = index  
172 - this.currentTopNavName = this.myChannelList[index].name  
173 - }  
174 - this.currentTopNavItem = this.myChannelList[this.currentTopNavSelectedIndex]  
175 - }  
176 -  
177 - isBroadcast(item?: TopNavDTO) {  
178 - // TODO 用id channelId = '2066'  
179 - return item?.name === '播报'  
180 - }  
181 -  
182 - isLayout(item?: TopNavDTO) {  
183 - // TODO 用id channelId = '2006'  
184 - return item?.name === '版面'  
185 - }  
186 -  
187 - isSpecialChannel(item?: TopNavDTO) {  
188 - // 版面、播报,可以用这个判断  
189 - return item?.channelType === 3  
190 - }  
191 -  
192 -  
193 - build() {  
194 - Column() {  
195 - // 顶部搜索、日报logo、早晚报  
196 - Column() {  
197 - Row() {  
198 - FirstTabTopSearchComponent()  
199 -  
200 - Image($r('app.media.icon_ren_min_ri_bao'))  
201 - .width(72)  
202 - .height(29)  
203 - .onClick(() => {  
204 - ProcessUtils.gotoENewsPaper()  
205 - })  
206 - Stack({ alignContent: Alignment.Center }) {  
207 - Image($r('app.media.background_read_paper_home'))  
208 - .width('100%')  
209 - .height('100%')  
210 - .objectFit(ImageFit.Contain)  
211 - Row() {  
212 - Image($r('app.media.icon_read_paper_home'))  
213 - .width(18)  
214 - .height(18)  
215 - Text('早晚报')  
216 - .fontColor("#666666")  
217 - .fontSize($r('app.float.font_size_13'))  
218 - }  
219 - .alignItems(VerticalAlign.Center)  
220 - .justifyContent(FlexAlign.Center)  
221 - }  
222 - .height(30)  
223 - .width(124)  
224 - .onClick(() => {  
225 - if (NetworkUtil.isNetConnected()) {  
226 - ProcessUtils.gotoMorningEveningPaper()  
227 - } else {  
228 - ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000)  
229 - }  
230 - })  
231 - }.width('100%')  
232 - .justifyContent(FlexAlign.SpaceBetween)  
233 - }  
234 - .width('100%')  
235 - .height(40)  
236 - .padding({ top: 10 })  
237 - .backgroundColor($r('app.color.white'))  
238 - .visibility(this._currentNavIndex == 0 ? Visibility.Visible : Visibility.None)  
239 -  
240 - // 频道分类list  
241 - Stack({ alignContent: Alignment.TopEnd }) {  
242 - Tabs({ index: this.currentTopNavSelectedIndex, controller: this.tabsController }) {  
243 - ForEach(this.currentBottomNavName === '新闻' ? this.myChannelList : this.topNavList,  
244 - (navItem: TopNavDTO, index: number) => {  
245 - TabContent() {  
246 - if (this.currentBottomNavName === '人民号' && navItem.name === '关注') {  
247 - PeopleShipMainComponent({  
248 - currentTopNavSelectedIndex: $currentTopNavSelectedIndex,  
249 - navIndex: index,  
250 - pageId: navItem.pageId + '',  
251 - channelId: navItem.channelId + '',  
252 - })  
253 - } else  
254 - if (!this.isBroadcast(navItem) && !this.isLayout(navItem)) {  
255 - PageComponent({  
256 - currentTopNavSelectedIndex: $currentTopNavSelectedIndex,  
257 - navIndex: index,  
258 - pageId: navItem.pageId + '',  
259 - channelId: navItem.channelId + '',  
260 - autoRefresh: this.autoRefresh2Page  
261 - })  
262 - } else {  
263 - channelSkeleton()  
264 - }  
265 - }  
266 - .tabBar(this.tabBarBuilder(navItem, index))  
267 -  
268 - }, (navItem: TopNavDTO) => JSON.stringify(navItem));  
269 - }  
270 - .barHeight($r('app.float.top_tab_bar_height'))  
271 - .height(this._currentNavIndex == 0 ? DisplayUtils.getDeviceHeight() - vp2px(48.3) :  
272 - '100%')  
273 - .barMode(BarMode.Scrollable)  
274 - .vertical(false)  
275 - .barBackgroundColor(this.barBackgroundColor)  
276 - .onAreaChange((oldValue: Area, newValue: Area) => {  
277 - let width = Number.parseFloat(newValue.width.toString())  
278 - this.tabsWidth = Number.isNaN(width) ? 0 : width  
279 - })  
280 - .onChange((index: number) => {  
281 - this.currentTopNavName =  
282 - this._currentNavIndex === 0 ? this.myChannelList[index].name : this.topNavList[index].name  
283 - Logger.info(TAG, `onChange index : ${index}`);  
284 - if (!this.isBroadcast(this._currentNavIndex === 0 ? this.myChannelList[index] : this.topNavList[index]) &&  
285 - !this.isLayout(this._currentNavIndex === 0 ? this.myChannelList[index] : this.topNavList[index])  
286 - ) {  
287 - //在 tab 切换之前意图共享  
288 - // this.topNavInsightIntentShare(this.currentTopNavItem)  
289 -  
290 - this.currentTopNavSelectedIndex = index;  
291 - this.currentTopNavItem = this.myChannelList[index]  
292 - }  
293 - if (this.isBroadcast(this._currentNavIndex === 0 ? this.myChannelList[index] : this.topNavList[index])) {  
294 - // 跳转到播报页面  
295 - ProcessUtils.gotoBroadcastPage(this.myChannelList[index].pageId)  
296 - this.tabsController.changeIndex(this.currentTopNavSelectedIndex)  
297 - }  
298 - if (this.isLayout(this._currentNavIndex === 0 ? this.myChannelList[index] : this.topNavList[index])) {  
299 - ProcessUtils.gotoENewsPaper()  
300 - if (!this.changeByClick) {  
301 - // 识别左滑右滑,跳过版面,到下一个  
302 - let nextIndex = this.currentTopNavSelectedIndex > index ? index - 1 : index + 1  
303 - this.tabsController.changeIndex(nextIndex)  
304 - } else {  
305 - this.tabsController.changeIndex(this.currentTopNavSelectedIndex)  
306 - // 重置标识  
307 - this.changeByClick = false  
308 - }  
309 - }  
310 - })  
311 - // .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => {  
312 - // if (!this.isBroadcast(this._currentNavIndex === 0 ? this.myChannelList[index] : this.topNavList[index]) &&  
313 - // !this.isLayout(this._currentNavIndex === 0 ? this.myChannelList[index] : this.topNavList[index])  
314 - // ) {  
315 - // return  
316 - // }  
317 - // this.currentTopNavSelectedIndex = targetIndex  
318 - // // 切换动画开始时触发该回调。下划线跟着页面一起滑动,同时宽度渐变。  
319 - // let targetIndexInfo = this.getTextInfo(targetIndex)  
320 - // this.startAnimateTo(this.animationDuration, targetIndexInfo.left, targetIndexInfo.width)  
321 - // })  
322 - // .onAnimationEnd((index: number, event: TabsAnimationEvent) => {  
323 - // if (!this.isBroadcast(this._currentNavIndex === 0 ? this.myChannelList[index] : this.topNavList[index]) &&  
324 - // !this.isLayout(this._currentNavIndex === 0 ? this.myChannelList[index] : this.topNavList[index])  
325 - // ) {  
326 - // return  
327 - // }  
328 - // // 切换动画结束时触发该回调。下划线动画停止。  
329 - // let currentIndicatorInfo = this.getCurrentIndicatorInfo(index, event)  
330 - // this.startAnimateTo(0, currentIndicatorInfo.left, currentIndicatorInfo.width)  
331 - // })  
332 - // .onGestureSwipe((index: number, event: TabsAnimationEvent) => {  
333 - // if (!this.isBroadcast(this._currentNavIndex === 0 ? this.myChannelList[index] : this.topNavList[index]) &&  
334 - // !this.isLayout(this._currentNavIndex === 0 ? this.myChannelList[index] : this.topNavList[index])  
335 - // ) {  
336 - // return  
337 - // }  
338 - // // 在页面跟手滑动过程中,逐帧触发该回调。  
339 - // let currentIndicatorInfo = this.getCurrentIndicatorInfo(index, event)  
340 - // this.currentTopNavSelectedIndex = currentIndicatorInfo.index  
341 - // this.indicatorLeftMargin = currentIndicatorInfo.left  
342 - // this.indicatorWidth = currentIndicatorInfo.width  
343 - // })  
344 -  
345 - // 分类列表最右侧频道设置  
346 - if (this._currentNavIndex === 0) {  
347 - ChannelSubscriptionLayout({  
348 - currentTopNavSelectedIndex: $currentTopNavSelectedIndex,  
349 - indexSettingChannelId: this.indexSettingChannelId,  
350 - homeChannelList: this.homeChannelList,  
351 - myChannelList: $myChannelList,  
352 - moreChannelList: $moreChannelList,  
353 - localChannelList: $localChannelList,  
354 - channelIds: $channelIds,  
355 - changeTab: (index) => {  
356 - this.tabsController.changeIndex(index)  
357 - }  
358 - })  
359 - } else {  
360 - Row() {  
361 - Image($r('app.media.icon_search'))  
362 - .width('24vp')  
363 - .height('24vp')  
364 - }  
365 - .height('40vp')  
366 - .width('40vp')  
367 - .margin({ right: 10 })  
368 - .alignItems(VerticalAlign.Center)  
369 - .justifyContent(FlexAlign.Center)  
370 - .onClick(() => {  
371 - WDRouterRule.jumpWithPage(WDRouterPage.searchPage)  
372 - })  
373 - }  
374 - }  
375 - }  
376 - }  
377 -  
378 - @Builder  
379 - tabBarBuilder(item: TopNavDTO, index: number) {  
380 - Column() {  
381 - Text(item?.name)  
382 - .fontSize($r('app.float.selected_text_size'))  
383 - .fontWeight(this.currentTopNavSelectedIndex === index ? FontWeight.Bold : FontWeight.Normal)  
384 - .fontColor(this.currentTopNavSelectedIndex === index ? Color.Black : "#999999")  
385 - .padding({ top: $r('app.float.top_tab_item_padding_top'), bottom: $r('app.float.top_tab_item_padding_bottom') })  
386 - .maxLines(this.MAX_LINE)  
387 - .id(index.toString())  
388 - .onAreaChange((oldValue: Area, newValue: Area) => {  
389 - if (this.currentTopNavSelectedIndex === index &&  
390 - (this.indicatorLeftMargin === 0 || this.indicatorWidth === 0)) {  
391 - if (newValue.position.x != undefined) {  
392 - let positionX = Number.parseFloat(newValue.position.x.toString())  
393 - this.indicatorLeftMargin = Number.isNaN(positionX) ? 0 : positionX  
394 - }  
395 - let width = Number.parseFloat(newValue.width.toString())  
396 - this.indicatorWidth = Number.isNaN(width) ? 0 : width  
397 - }  
398 - })  
399 - // .backgroundImage(this.currentTopNavSelectedIndex === index ? item.iconCUrl : item.iconUrl)  
400 - if (this.currentTopNavSelectedIndex === index) {  
401 - Row()  
402 - .width(20)  
403 - .height(3)  
404 - .backgroundImage($r('app.media.icon_channel_active'), ImageRepeat.NoRepeat)  
405 - .backgroundImageSize(ImageSize.Contain)  
406 - }  
407 - }  
408 - .hoverEffect(HoverEffect.Highlight)  
409 - .constraintSize({  
410 - minWidth: $r('app.float.top_tab_item_min_width'),  
411 - maxWidth: $r('app.float.top_tab_item_max_width')  
412 - })  
413 - // .backgroundColor(Color.Transparent)  
414 - .padding({  
415 - left: $r('app.float.top_tab_item_padding_horizontal'),  
416 - right: $r('app.float.top_tab_item_padding_horizontal'),  
417 - })  
418 - .id(`col_tabBar${index}`)  
419 - .margin({ right: this.myChannelList.length === index + 1 ? 36 : 0 })  
420 - .onClick(() => {  
421 - Logger.debug(TAG, `onClick, index: ${index}`);  
422 - if (this.currentTopNavSelectedIndex === index) {  
423 - // 当前tab,单击事件  
424 - this.doAutoRefresh()  
425 - } else {  
426 - this.changeByClick = true  
427 - this.tabsController.changeIndex(index)  
428 - }  
429 -  
430 - })  
431 - }  
432 -  
433 -  
434 - aboutToAppear() {  
435 - //处理新闻tab顶导频道数据  
436 - this.topNavListHandle()  
437 - }  
438 -  
439 - aboutToDisappear() {  
440 - AppStorage.set('channelIds', this.channelIds.join(','))  
441 - }  
442 -  
443 - onTopNavigationDataUpdated() {  
444 - Logger.info(TAG,  
445 - `onTopNavigationDataUpdated currentTopNavIndex: ${this.currentTopNavSelectedIndex},topNavList.length:${this.topNavList.length}`);  
446 - }  
447 -  
448 - onAutoRefresh() {  
449 - if (this.navIndex != this._currentNavIndex) {  
450 - return  
451 - }  
452 - // 通知page刷新  
453 - this.autoRefresh2Page++  
454 - }  
455 -  
456 - private doAutoRefresh() {  
457 - // 通知page刷新  
458 - this.autoRefresh2Page++  
459 - }  
460 -  
461 - /**  
462 - * 判断是否当前页面处理逻辑,如消息通知,只需要切换到当前底导的处理,过滤掉非当前。  
463 - */  
464 - private isCurrentPage(): boolean {  
465 - return this._currentNavIndex === this.navIndex  
466 - }  
467 -  
468 - /**  
469 - * 频道id变化,即指定频道跳转场景  
470 - */  
471 - onAssignChannelChange() {  
472 - if (!this.isCurrentPage()) {  
473 - return  
474 - }  
475 - let channelId = this.assignChannel.channelId  
476 - let index = -1  
477 - if (this._currentNavIndex === 0) {  
478 - // 第一个,新闻,先拿我的,再拿其他  
479 - index = this.getChannelByMine(channelId)  
480 - if (index == -1) {  
481 - // 不在我的里,需要临时新增频道展示  
482 - let channel = this.getChannelByOthers(channelId)  
483 - if (channel) {  
484 - this.myChannelList.push(channel)  
485 - setTimeout(() => {  
486 - this.tabsController.changeIndex(this.myChannelList.length - 1)  
487 - }, 20)  
488 - }  
489 - } else {  
490 - // 直接切换  
491 - this.tabsController.changeIndex(index)  
492 - }  
493 - } else {  
494 - index = this.getChannelByTopNav(channelId)  
495 - if (index > -1) {  
496 - // 找到了,直接切换,否则不处理  
497 - this.tabsController.changeIndex(index)  
498 - }  
499 - }  
500 -  
501 - }  
502 -  
503 - /**  
504 - * 非新闻,从topNav里拿数据  
505 - */  
506 - private getChannelByTopNav(channelId: string) {  
507 - for (let i = 0; i < this.topNavList.length; i++) {  
508 - let topNavDTO: TopNavDTO = this.topNavList[i]  
509 - if (topNavDTO.channelId.toString() === channelId) {  
510 - return i  
511 - }  
512 - }  
513 - return -1  
514 - }  
515 -  
516 - /**  
517 - * 新闻,从myChannelList里拿数据  
518 - */  
519 - private getChannelByMine(channelId: string) {  
520 - for (let i = 0; i < this.myChannelList.length; i++) {  
521 - let topNavDTO: TopNavDTO = this.myChannelList[i]  
522 - if (topNavDTO.channelId.toString() === channelId) {  
523 - return i  
524 - }  
525 - }  
526 - return -1  
527 - }  
528 -  
529 - /**  
530 - * 新闻,从其他里拿数据  
531 - */  
532 - private getChannelByOthers(channelId: string) {  
533 - for (let i = 0; i < this.moreChannelList.length; i++) {  
534 - let topNavDTO: TopNavDTO = this.moreChannelList[i]  
535 - if (topNavDTO.channelId.toString() === channelId) {  
536 - return topNavDTO  
537 - }  
538 - }  
539 - for (let j = 0; j < this.localChannelList.length; j++) {  
540 - let topNavDTO: TopNavDTO = this.localChannelList[j]  
541 - if (topNavDTO.channelId.toString() === channelId) {  
542 - return topNavDTO  
543 - }  
544 - }  
545 - return null  
546 - }  
547 -  
548 - // private getTextInfo(index: number): Record<string, number> {  
549 - // let strJson = getInspectorByKey(index.toString())  
550 - // try {  
551 - // let obj: Record<string, string> = JSON.parse(strJson)  
552 - // let rectInfo: number[][] = JSON.parse('[' + obj.$rect + ']')  
553 - // return { 'left': px2vp(rectInfo[0][0]), 'width': px2vp(rectInfo[1][0] - rectInfo[0][0]) }  
554 - // } catch (error) {  
555 - // return { 'left': 0, 'width': 0 }  
556 - // }  
557 - // }  
558 - //  
559 - // private getCurrentIndicatorInfo(index: number, event: TabsAnimationEvent): Record<string, number> {  
560 - // let nextIndex = index  
561 - // if (index > 0 && event.currentOffset > 0) {  
562 - // nextIndex--  
563 - // } else if (index < 3 && event.currentOffset < 0) {  
564 - // nextIndex++  
565 - // }  
566 - // let indexInfo = this.getTextInfo(index)  
567 - // let nextIndexInfo = this.getTextInfo(nextIndex)  
568 - // let swipeRatio = Math.abs(event.currentOffset / this.tabsWidth)  
569 - // let currentIndex = swipeRatio > 0.5 ? nextIndex : index // 页面滑动超过一半,tabBar切换到下一页。  
570 - // let currentLeft = indexInfo.left + (nextIndexInfo.left - indexInfo.left) * swipeRatio  
571 - // let currentWidth = indexInfo.width + (nextIndexInfo.width - indexInfo.width) * swipeRatio  
572 - // return { 'index': currentIndex, 'left': currentLeft, 'width': currentWidth }  
573 - // }  
574 -  
575 - // private startAnimateTo(duration: number, leftMargin: number, width: number) {  
576 - // animateTo({  
577 - // duration: duration, // 动画时长  
578 - // curve: Curve.Linear, // 动画曲线  
579 - // iterations: 1, // 播放次数  
580 - // playMode: PlayMode.Normal, // 动画模式  
581 - // onFinish: () => {  
582 - // console.info('play end')  
583 - // }  
584 - // }, () => {  
585 - // this.indicatorLeftMargin = leftMargin  
586 - // this.indicatorWidth = width  
587 - // })  
588 - // }  
589 -}  
@@ -10,6 +10,7 @@ import { PeopleShipMainComponent } from '../peopleShip/PeopleShipMainComponent'; @@ -10,6 +10,7 @@ import { PeopleShipMainComponent } from '../peopleShip/PeopleShipMainComponent';
10 import { channelSkeleton } from '../skeleton/channelSkeleton'; 10 import { channelSkeleton } from '../skeleton/channelSkeleton';
11 import { TrackConstants, TrackingButton } from 'wdTracking/Index'; 11 import { TrackConstants, TrackingButton } from 'wdTracking/Index';
12 import DailyPaperTopicModel from '../../model/DailyPaperTopicModel' 12 import DailyPaperTopicModel from '../../model/DailyPaperTopicModel'
  13 +import { ParamType, Tracking } from 'wdTracking/Index';
13 14
14 const TAG = 'TopNavigationComponent'; 15 const TAG = 'TopNavigationComponent';
15 16
@@ -29,6 +30,8 @@ export struct TopNavigationComponentNew { @@ -29,6 +30,8 @@ export struct TopNavigationComponentNew {
29 * @deprecated TODO type判断 30 * @deprecated TODO type判断
30 */ 31 */
31 private currentBottomNavName: string = '' 32 private currentBottomNavName: string = ''
  33 + private pageName: string = ''
  34 + private pageId: number = 0
32 private swiperController: SwiperController = new SwiperController() 35 private swiperController: SwiperController = new SwiperController()
33 private listScroller: Scroller = new Scroller() 36 private listScroller: Scroller = new Scroller()
34 @Consume barBackgroundColor: Color 37 @Consume barBackgroundColor: Color
@@ -110,6 +113,21 @@ export struct TopNavigationComponentNew { @@ -110,6 +113,21 @@ export struct TopNavigationComponentNew {
110 }) 113 })
111 .onChange((index) => { 114 .onChange((index) => {
112 Logger.info(TAG, `onChange index : ${index}`); 115 Logger.info(TAG, `onChange index : ${index}`);
  116 +
  117 + // 顶部tab埋点
  118 + if(this.currentBottomNavName === '新闻') {
  119 + const tab = this.myChannelList[index]
  120 + Logger.info(TAG, `顶部tab : ${JSON.stringify(tab)}`);
  121 +
  122 + const params: ParamType = {
  123 + "pageName": tab.name,
  124 + "tabName": tab.name,
  125 + "pageId": tab.pageId,
  126 + }
  127 + Tracking.event("home_page_tab_click ", params)
  128 + }
  129 +
  130 +
113 if (this.isBroadcastByIndex(index)) { 131 if (this.isBroadcastByIndex(index)) {
114 // 跳转到播报页面 132 // 跳转到播报页面
115 ProcessUtils.gotoBroadcastPage(this.myChannelList[index].pageId) 133 ProcessUtils.gotoBroadcastPage(this.myChannelList[index].pageId)
@@ -166,6 +184,14 @@ export struct TopNavigationComponentNew { @@ -166,6 +184,14 @@ export struct TopNavigationComponentNew {
166 .height(30) 184 .height(30)
167 .width(124) 185 .width(124)
168 .onClick(() => { 186 .onClick(() => {
  187 +
  188 + // 早晚报埋点
  189 + const params: ParamType = {
  190 + "pageName": this.pageName,
  191 + "pageId": this.pageId,
  192 + }
  193 + Tracking.event("morning_evening_news_click", params)
  194 +
169 this.clickMorningEveningPaper() 195 this.clickMorningEveningPaper()
170 }) 196 })
171 }.width('100%') 197 }.width('100%')
@@ -11,7 +11,6 @@ import { @@ -11,7 +11,6 @@ import {
11 import { LiveInfoDTO } from 'wdBean/src/main/ets/bean/detail/LiveInfoDTO' 11 import { LiveInfoDTO } from 'wdBean/src/main/ets/bean/detail/LiveInfoDTO'
12 import { VoiceInfoDTO } from 'wdBean/src/main/ets/bean/detail/VoiceInfoDTO' 12 import { VoiceInfoDTO } from 'wdBean/src/main/ets/bean/detail/VoiceInfoDTO'
13 import { LazyDataSource, StringUtils, UserDataLocal } from 'wdKit/Index' 13 import { LazyDataSource, StringUtils, UserDataLocal } from 'wdKit/Index'
14 -import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'  
15 import MinePageDatasModel from '../../model/MinePageDatasModel' 14 import MinePageDatasModel from '../../model/MinePageDatasModel'
16 import SearcherAboutDataModel from '../../model/SearcherAboutDataModel' 15 import SearcherAboutDataModel from '../../model/SearcherAboutDataModel'
17 import { CreatorDetailRequestItem } from '../../viewmodel/CreatorDetailRequestItem' 16 import { CreatorDetailRequestItem } from '../../viewmodel/CreatorDetailRequestItem'
@@ -30,6 +29,7 @@ import { SearchCreatorComponent } from './SearchCreatorComponent' @@ -30,6 +29,7 @@ import { SearchCreatorComponent } from './SearchCreatorComponent'
30 import { JSON } from '@kit.ArkTS' 29 import { JSON } from '@kit.ArkTS'
31 import { MoreComponent } from '../cardview/MoreComponent' 30 import { MoreComponent } from '../cardview/MoreComponent'
32 import { Card9Component } from '../cardview/Card9Component' 31 import { Card9Component } from '../cardview/Card9Component'
  32 +import { WDRouterRule, WDRouterPage } from 'wdRouter/Index'
33 33
34 const TAG = "SearchResultContentComponent" 34 const TAG = "SearchResultContentComponent"
35 35
@@ -46,6 +46,12 @@ export struct SearchResultContentComponent { @@ -46,6 +46,12 @@ export struct SearchResultContentComponent {
46 curPageNum: number = 1; 46 curPageNum: number = 1;
47 @State bean: FollowListDetailItem = new FollowListDetailItem("", "", "", "", "", "", "", "", "", -1, -1, "") 47 @State bean: FollowListDetailItem = new FollowListDetailItem("", "", "", "", "", "", "", "", "", -1, -1, "")
48 scroller: Scroller = new Scroller() 48 scroller: Scroller = new Scroller()
  49 + private scroller2: Scroller = new Scroller()
  50 + @State ellipseW: number = 0
  51 + @State moreWidth:number = 20
  52 + @State listLeft: number = 0
  53 + @State isEnd: boolean = false
  54 +
49 55
50 aboutToAppear(): void { 56 aboutToAppear(): void {
51 if (this.searchType == "全部") { 57 if (this.searchType == "全部") {
@@ -243,7 +249,7 @@ export struct SearchResultContentComponent { @@ -243,7 +249,7 @@ export struct SearchResultContentComponent {
243 if (this.count == 0) { 249 if (this.count == 0) {
244 ListHasNoMoreDataUI({ style: 2 }) 250 ListHasNoMoreDataUI({ style: 2 })
245 } else { 251 } else {
246 - List() { 252 + List({scroller:this.scroller2}) {
247 if (this.data_rmh != null && this.data_rmh.length > 0){ 253 if (this.data_rmh != null && this.data_rmh.length > 0){
248 if (this.data_rmh.length === 1){ 254 if (this.data_rmh.length === 1){
249 ListItem(){ 255 ListItem(){
@@ -306,44 +312,70 @@ export struct SearchResultContentComponent { @@ -306,44 +312,70 @@ export struct SearchResultContentComponent {
306 312
307 @Builder 313 @Builder
308 SearchListUI() { 314 SearchListUI() {
309 - List({space:'8lpx'}) {  
310 - ForEach(this.data_rmh, (item: SearchRmhDescription, index: number) => {  
311 - ListItem() {  
312 - SearchCreatorComponent({item:item})  
313 - }  
314 - .width('150lpx')  
315 - .height('100%')  
316 - }) 315 + List({initialIndex: 0,space:'8lpx',scroller: this.scroller}) {
  316 + ListItemGroup(){
  317 + ForEach(this.data_rmh, (item: SearchRmhDescription, index: number) => {
  318 + ListItem() {
  319 + SearchCreatorComponent({item:item})
  320 + }
  321 + .width('150lpx')
  322 + .height('100%')
  323 + })
  324 + }.offset({ left: this.listLeft })
317 325
318 ListItem(){ 326 ListItem(){
319 - Column(){  
320 - Text("查看更多")  
321 - .width('19lpx')  
322 - .fontSize('19lpx')  
323 - .fontWeight('400lpx')  
324 - .lineHeight('27lpx')  
325 - .fontColor($r('app.color.color_9E9E9E'))  
326 - }.borderRadius({topLeft:'4lpx',bottomLeft:'4lpx'})  
327 - .height('180lpx')  
328 - .width('77lpx')  
329 - .backgroundColor($r('app.color.color_EDEDED'))  
330 - .justifyContent(FlexAlign.Center)  
331 - 327 + this.itemEnd()
332 }.height('100%') 328 }.height('100%')
333 .margin({left:'23lpx'}) 329 .margin({left:'23lpx'})
334 - .onClick(()=>{  
335 - let params: Params = {  
336 - pageID: this.keywords  
337 - }  
338 - WDRouterRule.jumpWithPage(WDRouterPage.searchCreatorPage,params)  
339 - })  
340 } 330 }
341 - .cachedCount(6)  
342 .edgeEffect(EdgeEffect.None) 331 .edgeEffect(EdgeEffect.None)
343 .scrollBar(BarState.Off) 332 .scrollBar(BarState.Off)
344 .listDirection(Axis.Horizontal) 333 .listDirection(Axis.Horizontal)
345 .width('100%') 334 .width('100%')
346 .height('219lpx') 335 .height('219lpx')
  336 + .onReachEnd(() => {
  337 + this.isEnd = true
  338 + console.log(TAG,'is end')
  339 + })
  340 + .onScrollFrameBegin((offset: number, state: ScrollState) => {
  341 + console.log(TAG,'offset', offset)
  342 + if (!this.scroller.isAtEnd()) {
  343 + this.isEnd = false
  344 + }
  345 + if (this.ellipseW > 0) {
  346 + return { offsetRemain: 0 }
  347 + }
  348 + return { offsetRemain: offset }
  349 + })
  350 + .parallelGesture(
  351 + PanGesture({ direction: PanDirection.Horizontal, distance: 1 })
  352 + .onActionStart((event: GestureEvent) => {
  353 + console.info(TAG,'Pan start')
  354 + })
  355 + .onActionUpdate((event: GestureEvent) => {
  356 + if (event && this.isEnd) {
  357 + // console.log('event.offsetX',event.offsetX)
  358 + this.listLeft = event.offsetX < -60 ? -60 : event.offsetX > 0 ? 0 : event.offsetX
  359 + this.ellipseW = (-this.listLeft) / 1.5
  360 +
  361 + console.log(TAG,"this.ellipseW==>" + this.ellipseW)
  362 + }
  363 + })
  364 + .onActionEnd((event: GestureEvent) => {
  365 + console.info(TAG,'Pan end')
  366 + this.listLeft = 0
  367 + // this.moreWidth = 20
  368 +
  369 + if (event.offsetX < 0 && this.ellipseW >=20) {
  370 + console.log(TAG,'跳转')
  371 + let params: Params = {
  372 + pageID: this.keywords
  373 + }
  374 + WDRouterRule.jumpWithPage(WDRouterPage.searchCreatorPage,params)
  375 + }
  376 + this.ellipseW = 0
  377 + })
  378 + )
347 379
348 Divider() 380 Divider()
349 .width('100%') 381 .width('100%')
@@ -352,6 +384,32 @@ export struct SearchResultContentComponent { @@ -352,6 +384,32 @@ export struct SearchResultContentComponent {
352 .strokeWidth('12lpx') 384 .strokeWidth('12lpx')
353 } 385 }
354 386
  387 +
  388 + @Builder
  389 + itemEnd() {
  390 + Row() {
  391 + Ellipse()
  392 + .width(2* this.ellipseW)
  393 + .height('100%')
  394 + .fill('rgb(240,235,238)')
  395 + .position({ left: -this.ellipseW, top: 0 })
  396 +
  397 + Column(){
  398 + Text(this.ellipseW === 0 ? '' : this.ellipseW < 20? '查看更多' : '松手查看')
  399 + .width('19lpx')
  400 + .fontSize('19lpx')
  401 + .fontWeight('400lpx')
  402 + .lineHeight('27lpx')
  403 + .fontColor("#9E9E9E")
  404 + }
  405 + .height('100%')
  406 + .width(this.moreWidth)
  407 + .backgroundColor("#EDEDED")
  408 + .justifyContent(FlexAlign.Center)
  409 + }
  410 + .height('100%')
  411 + }
  412 +
355 private dataTransform(rem:CreatorDetailResponseItem[],value: SearchResultContentItem, photos: FullColumnImgUrlDTO[]): ContentDTO { 413 private dataTransform(rem:CreatorDetailResponseItem[],value: SearchResultContentItem, photos: FullColumnImgUrlDTO[]): ContentDTO {
356 let rmhInfo = this.getRmhInfo(rem,value) 414 let rmhInfo = this.getRmhInfo(rem,value)
357 console.log('获取photos',JSON.stringify(photos)) 415 console.log('获取photos',JSON.stringify(photos))
1 import { Action, CompDTO, ContentDTO, Params } from 'wdBean' 1 import { Action, CompDTO, ContentDTO, Params } from 'wdBean'
2 -import { WDRouterRule } from 'wdRouter/Index' 2 +import { ProcessUtils, WDRouterRule } from 'wdRouter/Index'
3 import { Logger } from 'wdKit/Index' 3 import { Logger } from 'wdKit/Index'
4 import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO' 4 import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO'
5 import { LiveModel } from '../../viewmodel/LiveModel' 5 import { LiveModel } from '../../viewmodel/LiveModel'
@@ -69,24 +69,9 @@ export struct HorizontalStrokeCardThreeTwoRadioForOneComponent { @@ -69,24 +69,9 @@ export struct HorizontalStrokeCardThreeTwoRadioForOneComponent {
69 .onClick(() => { 69 .onClick(() => {
70 InfomationCardClick.track(this.compDTO, this.compDTO.operDataList[0], this.pageId, this.pageName) 70 InfomationCardClick.track(this.compDTO, this.compDTO.operDataList[0], this.pageId, this.pageName)
71 this.clicked = true; 71 this.clicked = true;
72 - this.gotoLive(this.compDTO?.operDataList[0]) 72 + ProcessUtils.gotoLive(this.compDTO?.operDataList[0])
73 }) 73 })
74 } 74 }
75 75
76 - async gotoLive(content: ContentDTO) {  
77 76
78 - let taskAction: Action = {  
79 - type: 'JUMP_DETAIL_PAGE',  
80 - params: {  
81 - detailPageType: 2,  
82 - contentID: content?.objectId,  
83 - extra: {  
84 - relType: content?.relType,  
85 - relId: content?.relId,  
86 - } as ExtraDTO  
87 - } as Params,  
88 - };  
89 - WDRouterRule.jumpWithAction(taskAction)  
90 - // Logger.debug(TAG, `gotoLive, ${content.objectId}`);  
91 - }  
92 } 77 }
@@ -5,7 +5,7 @@ import { CommonConstants } from 'wdConstant' @@ -5,7 +5,7 @@ import { CommonConstants } from 'wdConstant'
5 import { StringUtils } from 'wdKit/Index' 5 import { StringUtils } from 'wdKit/Index'
6 import { CardMediaInfo } from '../cardCommon/CardMediaInfo' 6 import { CardMediaInfo } from '../cardCommon/CardMediaInfo'
7 import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO' 7 import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO'
8 -import { WDRouterPage, WDRouterRule } from 'wdRouter/Index' 8 +import { ProcessUtils, WDRouterPage, WDRouterRule } from 'wdRouter/Index'
9 9
10 @Component 10 @Component
11 export struct LiveHorizontalReservationComponent { 11 export struct LiveHorizontalReservationComponent {
@@ -76,7 +76,7 @@ export struct LiveHorizontalReservationComponent { @@ -76,7 +76,7 @@ export struct LiveHorizontalReservationComponent {
76 .onClick(() => { 76 .onClick(() => {
77 if (item.objectType != '0') { 77 if (item.objectType != '0') {
78 console.log(item.objectId) 78 console.log(item.objectId)
79 - this.gotoLive(item) 79 + ProcessUtils.gotoLive(item)
80 } 80 }
81 }) 81 })
82 }) 82 })
@@ -107,20 +107,5 @@ export struct LiveHorizontalReservationComponent { @@ -107,20 +107,5 @@ export struct LiveHorizontalReservationComponent {
107 WDRouterRule.jumpWithPage(WDRouterPage.reserveMorePage) 107 WDRouterRule.jumpWithPage(WDRouterPage.reserveMorePage)
108 } 108 }
109 109
110 - async gotoLive(content: ContentDTO) {  
111 110
112 - let taskAction: Action = {  
113 - type: 'JUMP_DETAIL_PAGE',  
114 - params: {  
115 - detailPageType: 2,  
116 - contentID: content?.objectId,  
117 - extra: {  
118 - relType: content?.relType,  
119 - relId: content?.relId,  
120 - } as ExtraDTO  
121 - } as Params,  
122 - };  
123 - WDRouterRule.jumpWithAction(taskAction)  
124 - // Logger.debug(TAG, `gotoLive, ${content.objectId}`);  
125 - }  
126 } 111 }
@@ -15,6 +15,7 @@ @@ -15,6 +15,7 @@
15 "wdBean": "file:../../features/wdBean", 15 "wdBean": "file:../../features/wdBean",
16 "wdConstant": "file:../../commons/wdConstant", 16 "wdConstant": "file:../../commons/wdConstant",
17 "wdDetailPlayApi": "file:../../features/wdDetailPlayApi", 17 "wdDetailPlayApi": "file:../../features/wdDetailPlayApi",
18 - "wdRouter": "file:../../commons/wdRouter" 18 + "wdRouter": "file:../../commons/wdRouter",
  19 + "wdTracking": "file:../../features/wdTracking"
19 } 20 }
20 } 21 }
@@ -4,8 +4,10 @@ import router from '@ohos.router'; @@ -4,8 +4,10 @@ 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 { Logger } from 'wdKit/Index'; 7 +import { DateTimeUtils, Logger, ToastUtils } 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';
  10 +import { TrackConstants, TrackingButton, TrackingPageBrowse } from 'wdTracking/Index';
9 11
10 const TAG = 'DetailPlayLiveCommon' 12 const TAG = 'DetailPlayLiveCommon'
11 13
@@ -21,6 +23,7 @@ const TAG = 'DetailPlayLiveCommon' @@ -21,6 +23,7 @@ const TAG = 'DetailPlayLiveCommon'
21 @Component 23 @Component
22 export struct DetailPlayLiveCommon { 24 export struct DetailPlayLiveCommon {
23 private liveViewModel: LiveViewModel = new LiveViewModel() 25 private liveViewModel: LiveViewModel = new LiveViewModel()
  26 + pageShowTime:number = 0;
24 @Provide relId: string = '' 27 @Provide relId: string = ''
25 @Provide contentId: string = '' 28 @Provide contentId: string = ''
26 @Provide relType: string = '' 29 @Provide relType: string = ''
@@ -36,6 +39,8 @@ export struct DetailPlayLiveCommon { @@ -36,6 +39,8 @@ export struct DetailPlayLiveCommon {
36 // 横屏或竖屏 general-竖屏,news-横屏 39 // 横屏或竖屏 general-竖屏,news-横屏
37 @State liveLandscape: string = '' 40 @State liveLandscape: string = ''
38 41
  42 + @State isLoading: boolean = false
  43 +
39 async aboutToAppear(): Promise<void> { 44 async aboutToAppear(): Promise<void> {
40 const par: Action = router.getParams() as Action; 45 const par: Action = router.getParams() as Action;
41 const params = par?.params; 46 const params = par?.params;
@@ -46,6 +51,12 @@ export struct DetailPlayLiveCommon { @@ -46,6 +51,12 @@ export struct DetailPlayLiveCommon {
46 51
47 } 52 }
48 53
  54 + aboutToDisappear(): void {
  55 + console.error("XXXXZZZZ", '---aboutToDisappear------------')
  56 +
  57 + }
  58 +
  59 +
49 build() { 60 build() {
50 Column() { 61 Column() {
51 // 直播预约或横屏直播统一进横屏直播 62 // 直播预约或横屏直播统一进横屏直播
@@ -55,6 +66,8 @@ export struct DetailPlayLiveCommon { @@ -55,6 +66,8 @@ export struct DetailPlayLiveCommon {
55 } else if (this.liveLandscape === 'general') { 66 } else if (this.liveLandscape === 'general') {
56 // 沉浸式直播 67 // 沉浸式直播
57 DetailPlayVLivePage() 68 DetailPlayVLivePage()
  69 + }else {
  70 + PictureLoading().visibility(this.isLoading ? Visibility.None : Visibility.Visible)
58 } 71 }
59 } 72 }
60 .height('100%') 73 .height('100%')
@@ -71,7 +84,6 @@ export struct DetailPlayLiveCommon { @@ -71,7 +84,6 @@ export struct DetailPlayLiveCommon {
71 .then(async (data: Array<ContentDetailDTO>) => { 84 .then(async (data: Array<ContentDetailDTO>) => {
72 console.log(TAG, '查询视频详情用于评论展示 getContentDetail:', JSON.stringify(data)) 85 console.log(TAG, '查询视频详情用于评论展示 getContentDetail:', JSON.stringify(data))
73 if (data) { 86 if (data) {
74 -  
75 let detailData = data[0] 87 let detailData = data[0]
76 //人民号类型单独获取直播地址 88 //人民号类型单独获取直播地址
77 if (detailData.rmhPlatform === 1) { 89 if (detailData.rmhPlatform === 1) {
@@ -116,36 +128,35 @@ export struct DetailPlayLiveCommon { @@ -116,36 +128,35 @@ export struct DetailPlayLiveCommon {
116 this.playUrl = detailData.liveInfo.vlive[0].replayUri 128 this.playUrl = detailData.liveInfo.vlive[0].replayUri
117 } 129 }
118 130
119 - 131 + } else {
  132 + this.isLoading
  133 + ToastUtils.shortToast('内容不存在')
  134 + router.back()
120 } 135 }
  136 + },()=>{
  137 + this.isLoading
  138 + ToastUtils.shortToast('内容不存在')
  139 + router.back()
  140 +
121 }) 141 })
122 } 142 }
123 143
124 - // /**  
125 - // *  
126 - // * @returns true : 沉浸式;false : 非沉浸式  
127 - // */  
128 - // isImmersionLive(): boolean {  
129 - //  
130 - // let flag = false  
131 - //  
132 - // if (this.liveState === 'wait' || this.liveLandscape === 'news') {  
133 - // flag = false  
134 - // } else if (this.liveLandscape === 'general') {  
135 - // flag = true  
136 - // }  
137 - //  
138 - // return flag  
139 - // } 144 +
140 145
141 onPageShow() { 146 onPageShow() {
142 this.pageShow = Math.random() 147 this.pageShow = Math.random()
143 Logger.info(TAG, 'onPageShow') 148 Logger.info(TAG, 'onPageShow')
  149 + this.pageShowTime = DateTimeUtils.getTimeStamp()
144 } 150 }
145 151
146 onPageHide() { 152 onPageHide() {
147 this.pageHide = Math.random() 153 this.pageHide = Math.random()
148 Logger.info(TAG, 'onPageHide') 154 Logger.info(TAG, 'onPageHide')
  155 + console.error("XXXXZZZZ", '---onPageHide------------')
  156 + //页面浏览
  157 + TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Live_Detail,TrackConstants.PageName.Live_Detail
  158 + ,Math.floor((DateTimeUtils.getTimeStamp() - this.pageShowTime)/1000))
  159 +
149 } 160 }
150 161
151 onBackPress(): boolean | void { 162 onBackPress(): boolean | void {
@@ -93,10 +93,11 @@ export struct DetailPlayVLivePage { @@ -93,10 +93,11 @@ export struct DetailPlayVLivePage {
93 .aspectRatio(1) 93 .aspectRatio(1)
94 .visibility(this.swiperIndex === 0 ? Visibility.Visible : Visibility.Hidden) 94 .visibility(this.swiperIndex === 0 ? Visibility.Visible : Visibility.Hidden)
95 .position({ x: '100%', y: '100%' }) 95 .position({ x: '100%', y: '100%' })
96 - .markAnchor({ x: 56, y: 56 }) 96 + .markAnchor({ x: 56, y: this.bottomSafeHeight })
97 .onClick(() => { 97 .onClick(() => {
98 this.swiperController.showNext() 98 this.swiperController.showNext()
99 }) 99 })
  100 +
100 } 101 }
101 } 102 }
102 .height('100%') 103 .height('100%')
@@ -10,6 +10,7 @@ import { SpConstants } from 'wdConstant/Index'; @@ -10,6 +10,7 @@ import { SpConstants } from 'wdConstant/Index';
10 const TAG = 'LiveModel' 10 const TAG = 'LiveModel'
11 11
12 export class LiveModel { 12 export class LiveModel {
  13 +
13 getContentDetail(contentId: string, relId: string, relType: string) { 14 getContentDetail(contentId: string, relId: string, relType: string) {
14 return new Promise<Array<ContentDetailDTO>>((success, fail) => { 15 return new Promise<Array<ContentDetailDTO>>((success, fail) => {
15 ContentDetailRequest.getContentDetail({ 16 ContentDetailRequest.getContentDetail({
@@ -19,9 +20,14 @@ export class LiveModel { @@ -19,9 +20,14 @@ export class LiveModel {
19 }).then(async (resDTO: ResponseDTO<ContentDetailDTO[]>) => { 20 }).then(async (resDTO: ResponseDTO<ContentDetailDTO[]>) => {
20 console.log(TAG, 'getContentDetail:', JSON.stringify(resDTO.data)) 21 console.log(TAG, 'getContentDetail:', JSON.stringify(resDTO.data))
21 if (resDTO.data) { 22 if (resDTO.data) {
  23 + //console.error("XXXXZZZZ", '---getContentDetail-0---1------------')
22 success(resDTO.data) 24 success(resDTO.data)
  25 + }else {
  26 + // console.error("XXXXZZZZ", '---getContentDetail-0--2----1--------')
  27 + fail("数据为空")
23 } 28 }
24 }).catch(() => { 29 }).catch(() => {
  30 + // console.error("XXXXZZZZ", '---getContentDetail-0--2----2--------')
25 fail("数据为空") 31 fail("数据为空")
26 }) 32 })
27 33
@@ -127,6 +133,42 @@ export class LiveModel { @@ -127,6 +133,42 @@ export class LiveModel {
127 }) 133 })
128 } 134 }
129 135
  136 +
  137 + /**
  138 + * C端评论列表 竖屏直播间
  139 + * @param pageNum
  140 + * @param mLiveId
  141 + * @param liveId
  142 + * @param pageSize
  143 + * @returns
  144 + */
  145 + getLiveCommentList(pageNum: number, mLiveId: string, liveId: string, pageSize: number) {
  146 + let params: Record<string, string> = {};
  147 + params['pageNum'] = pageNum + ''
  148 + params['mLiveId'] = mLiveId
  149 + params['liveId'] = liveId
  150 + params['pageSize'] = pageSize + ''
  151 + return new Promise<LiveRoomBean>((success, fail) => {
  152 + HttpRequest.post<ResponseDTO<LiveRoomBean>>(
  153 + HttpUrlUtils.getLiveCommentListUrl(),
  154 + params,
  155 + ).then((data: ResponseDTO<LiveRoomBean>) => {
  156 + if (!data || !data.data) {
  157 + fail("数据为空")
  158 + return
  159 + }
  160 + if (data.code != 0) {
  161 + fail(data.message)
  162 + return
  163 + }
  164 + success(data.data)
  165 + }, (error: Error) => {
  166 + fail(error.message)
  167 + Logger.debug(TAG + ":error ", error.toString())
  168 + })
  169 + })
  170 + }
  171 +
130 /** 172 /**
131 * 获取直播数据 173 * 获取直播数据
132 * @param liveId 174 * @param liveId
@@ -22,8 +22,10 @@ export class LiveViewModel { @@ -22,8 +22,10 @@ export class LiveViewModel {
22 getContentDetail(contentId: string, relId: string, relType: string) { 22 getContentDetail(contentId: string, relId: string, relType: string) {
23 return new Promise<Array<ContentDetailDTO>>((success, fail) => { 23 return new Promise<Array<ContentDetailDTO>>((success, fail) => {
24 this.liveModel.getContentDetail(contentId, relId, relType).then((data) => { 24 this.liveModel.getContentDetail(contentId, relId, relType).then((data) => {
  25 + //console.error("XXXXZZZZ", '---getContentDetail---1------------')
25 success(data) 26 success(data)
26 }).catch((message: string) => { 27 }).catch((message: string) => {
  28 + // console.error("XXXXZZZZ", '----getContentDetail--2------------')
27 fail(message) 29 fail(message)
28 }) 30 })
29 }) 31 })
@@ -79,6 +81,17 @@ export class LiveViewModel { @@ -79,6 +81,17 @@ export class LiveViewModel {
79 }) 81 })
80 } 82 }
81 83
  84 + //C端评论列表 竖屏直播间
  85 + getLiveCommentList(pageNum: number, mLiveId: string, liveId: string, pageSize: number) {
  86 + return new Promise<LiveRoomBean>((success, fail) => {
  87 + this.liveModel.getLiveCommentList(pageNum, mLiveId, liveId, pageSize).then((data) => {
  88 + success(data)
  89 + }).catch((message: string) => {
  90 + fail(message)
  91 + })
  92 + })
  93 + }
  94 +
82 //直播详情直播间数据 95 //直播详情直播间数据
83 getLiveRoomData(liveId: string) { 96 getLiveRoomData(liveId: string) {
84 return new Promise<LiveRoomDataBean>((success, fail) => { 97 return new Promise<LiveRoomDataBean>((success, fail) => {
@@ -12,56 +12,33 @@ export struct TabComponent { @@ -12,56 +12,33 @@ export struct TabComponent {
12 @State fontColor: string = '#999999' 12 @State fontColor: string = '#999999'
13 @State selectedFontColor: string = '#222222' 13 @State selectedFontColor: string = '#222222'
14 @State currentIndex: number = 0 14 @State currentIndex: number = 0
15 - private controller: TabsController = new TabsController() 15 + // private controller: TabsController = new TabsController()
  16 + private swiperController: SwiperController = new SwiperController()
16 @Prop tabs: string[] = [] 17 @Prop tabs: string[] = []
17 - @Prop lastInputedLiveComment: LiveRoomItemBean // 上次输入的直播间消息  
18 - @Prop lastInputedChatComment: LiveRoomItemBean // 上次输入的大家聊消息 18 + @Prop lastInputedLiveComment: LiveRoomItemBean // 上次输入的直播间消息
  19 + @Prop lastInputedChatComment: LiveRoomItemBean // 上次输入的大家聊消息
19 20
20 aboutToAppear(): void { 21 aboutToAppear(): void {
21 22
22 } 23 }
  24 +
23 /** 25 /**
24 * 评论切换到大家聊 26 * 评论切换到大家聊
25 */ 27 */
26 changeToChart() { 28 changeToChart() {
27 const index = this.tabs.findIndex(item => item === '大家聊') 29 const index = this.tabs.findIndex(item => item === '大家聊')
28 if (index !== -1) { 30 if (index !== -1) {
29 - this.controller.changeIndex(index) 31 + this.swiperController.changeIndex(index)
30 } 32 }
31 } 33 }
32 34
33 build() { 35 build() {
34 - Stack({alignContent: Alignment.TopStart}) {  
35 - Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) {  
36 - ForEach(this.tabs, (item: string, index: number) => {  
37 - TabContent() {  
38 - if ('简介' === item) {  
39 - TabInfoComponent()  
40 - } else if ('直播间' === item) {  
41 - TabLiveComponent({lastInputedComment: this.lastInputedLiveComment})  
42 - } else if ('大家聊' === item) {  
43 - TabChatComponent({lastInputedComment: this.lastInputedChatComment})  
44 - }  
45 - }  
46 - .backgroundColor('#F5F5F5')  
47 - }, (item: string, index: number) => {  
48 - return item + index  
49 - })  
50 - }  
51 - .layoutWeight(1)  
52 - .vertical(false)  
53 - .barMode(BarMode.Fixed)  
54 - .barHeight(48)  
55 - .animationDuration(100)  
56 - .onChange((index: number) => {  
57 - this.currentIndex = index  
58 - })  
59 - .backgroundColor(Color.White) 36 + Column() {
60 37
61 // 页签 38 // 页签
62 Row() { 39 Row() {
63 Scroll() { 40 Scroll() {
64 - Row({space: '24vp'}) { 41 + Row({ space: '24vp' }) {
65 ForEach(this.tabs, (item: string, index: number) => { 42 ForEach(this.tabs, (item: string, index: number) => {
66 this.tabBuilder(index, item) 43 this.tabBuilder(index, item)
67 }) 44 })
@@ -79,8 +56,33 @@ export struct TabComponent { @@ -79,8 +56,33 @@ export struct TabComponent {
79 .height('48vp') 56 .height('48vp')
80 .alignItems(VerticalAlign.Bottom) 57 .alignItems(VerticalAlign.Bottom)
81 .width('100%') 58 .width('100%')
82 - }.layoutWeight(1)  
83 59
  60 + Swiper(this.swiperController) {
  61 + ForEach(this.tabs, (item: string, index: number) => {
  62 + if ('简介' === item) {
  63 + TabInfoComponent().backgroundColor('#F5F5F5')
  64 + } else if ('直播间' === item) {
  65 + TabLiveComponent({ lastInputedComment: this.lastInputedLiveComment }).backgroundColor('#F5F5F5')
  66 + } else if ('大家聊' === item) {
  67 + TabChatComponent({ lastInputedComment: this.lastInputedChatComment }).backgroundColor('#F5F5F5')
  68 + }
  69 +
  70 + }, (item: string, index: number) => {
  71 + return item + index
  72 + })
  73 + }
  74 + .layoutWeight(1)
  75 + .vertical(false)
  76 + .indicator(false)
  77 + .loop(false)
  78 + .alignSelf(ItemAlign.Start)
  79 + .effectMode(EdgeEffect.None)
  80 + .onChange((index: number) => {
  81 + this.currentIndex = index
  82 + })
  83 + .backgroundColor(Color.White)
  84 +
  85 + }.layoutWeight(1)
84 86
85 } 87 }
86 88
@@ -102,7 +104,7 @@ export struct TabComponent { @@ -102,7 +104,7 @@ export struct TabComponent {
102 .constraintSize({ minWidth: 35 }) 104 .constraintSize({ minWidth: 35 })
103 .height('48vp') 105 .height('48vp')
104 .onClick(() => { 106 .onClick(() => {
105 - this.controller.changeIndex(index) 107 + this.swiperController.changeIndex(index)
106 this.currentIndex = index 108 this.currentIndex = index
107 }) 109 })
108 } 110 }
@@ -3,6 +3,7 @@ import { Logger, StringUtils } from 'wdKit/Index'; @@ -3,6 +3,7 @@ import { Logger, StringUtils } from 'wdKit/Index';
3 import { PlayerConstants, WDAliPlayerController, WDPlayerRenderLiveView } from 'wdPlayer/Index'; 3 import { PlayerConstants, WDAliPlayerController, WDPlayerRenderLiveView } from 'wdPlayer/Index';
4 import { PlayUIComponent } from './PlayUIComponent'; 4 import { PlayUIComponent } from './PlayUIComponent';
5 import { PictureLoading } from '../../vertical/PictureLoading'; 5 import { PictureLoading } from '../../vertical/PictureLoading';
  6 +import { ParamType, TrackConstants } from 'wdTracking/Index';
6 7
7 const TAG: string = 'TopPlayComponent' 8 const TAG: string = 'TopPlayComponent'
8 9
@@ -31,11 +32,11 @@ export struct TopPlayComponent { @@ -31,11 +32,11 @@ export struct TopPlayComponent {
31 @Provide playSourceState: number = 0 32 @Provide playSourceState: number = 0
32 private playUrl: string = "" 33 private playUrl: string = ""
33 private xComponentIsLoaded: boolean = false 34 private xComponentIsLoaded: boolean = false
  35 + pageParam: ParamType = {}
34 36
35 aboutToAppear(): void { 37 aboutToAppear(): void {
36 if (this.playerController) { 38 if (this.playerController) {
37 this.playerController.onCanplay = () => { 39 this.playerController.onCanplay = () => {
38 - Logger.debug(TAG, 'onCanplay==>')  
39 this.isCanPlay = true 40 this.isCanPlay = true
40 this.isLoading = true 41 this.isLoading = true
41 this.playerController?.play() 42 this.playerController?.play()
@@ -95,28 +96,32 @@ export struct TopPlayComponent { @@ -95,28 +96,32 @@ export struct TopPlayComponent {
95 } 96 }
96 } 97 }
97 98
98 -  
99 this.isEnd = this.contentDetailData?.liveInfo?.liveState === 'end' && 99 this.isEnd = this.contentDetailData?.liveInfo?.liveState === 'end' &&
100 StringUtils.isEmpty(this.contentDetailData?.liveInfo?.vlive[0]?.replayUri) 100 StringUtils.isEmpty(this.contentDetailData?.liveInfo?.vlive[0]?.replayUri)
101 101
102 - Logger.debug(TAG, `---0------>` + this.isWait + ' ->' + this.isLoading + ' ->' + this.isEnd)  
103 - if (!this.isWait && this.contentDetailData.liveInfo && this.contentDetailData.liveInfo.vlive.length > 0) {  
104 - let playUrl = ''  
105 - if (this.contentDetailData.liveInfo.liveState == 'running') {  
106 - playUrl = this.contentDetailData.liveInfo.vlive[0].liveUrl  
107 - } else if (this.contentDetailData.liveInfo.liveState == 'end') {  
108 - playUrl = this.contentDetailData.liveInfo.vlive[0].replayUri  
109 - } 102 + // Logger.debug(TAG, `---0------>` + this.isWait + ' ->' + this.isLoading + ' ->' + this.isEnd)
  103 + if (!this.isWait) {
  104 + if (this.contentDetailData.liveInfo && this.contentDetailData.liveInfo.vlive.length > 0) {
  105 + let playUrl = ''
  106 + if (this.contentDetailData.liveInfo.liveState == 'running') {
  107 + playUrl = this.contentDetailData.liveInfo.vlive[0].liveUrl
  108 + } else if (this.contentDetailData.liveInfo.liveState == 'end') {
  109 + playUrl = this.contentDetailData.liveInfo.vlive[0].replayUri
  110 + }
110 111
111 - if (this.isVideoSource) {  
112 - this.playUrl = this.previewUrl  
113 - this.tryToPlay()  
114 - } else {  
115 - Logger.debug(TAG, `---0------>${playUrl}`)  
116 - if (StringUtils.isNotEmpty(playUrl)) {  
117 - this.playUrl = playUrl 112 + if (this.isVideoSource) {
  113 + this.playUrl = this.previewUrl
118 this.tryToPlay() 114 this.tryToPlay()
  115 + } else {
  116 + Logger.debug(TAG, `---0------>${playUrl}`)
  117 + if (StringUtils.isNotEmpty(playUrl)) {
  118 + this.playUrl = playUrl
  119 + this.tryToPlay()
  120 + }
119 } 121 }
  122 + } else {
  123 + this.isWait = true
  124 + this.isLoading = true
120 } 125 }
121 } 126 }
122 127
@@ -143,7 +148,16 @@ export struct TopPlayComponent { @@ -143,7 +148,16 @@ export struct TopPlayComponent {
143 Logger.debug(TAG, "播放地址为空") 148 Logger.debug(TAG, "播放地址为空")
144 return 149 return
145 } 150 }
146 - this.playerController?.firstPlay(this.playUrl); 151 + this.contentTrackingDict()
  152 + this.playerController?.firstPlay(this.playUrl, TrackConstants.PageName.Live_Detail, this.pageParam);
  153 + }
  154 +
  155 + contentTrackingDict() {
  156 + this.pageParam = {
  157 + 'contentType': `${this.contentDetailData.newsType}`,
  158 + 'contentId': `${this.contentDetailData.newsId}`,
  159 + 'contentName': `${this.contentDetailData.newsTitle || ''}`,
  160 + }
147 } 161 }
148 162
149 build() { 163 build() {
@@ -13,7 +13,9 @@ import { router } from '@kit.ArkUI' @@ -13,7 +13,9 @@ import { router } from '@kit.ArkUI'
13 import { EmitterEventId, EmitterUtils, Logger, SPHelper, WindowModel } from 'wdKit/Index' 13 import { EmitterEventId, EmitterUtils, Logger, SPHelper, WindowModel } from 'wdKit/Index'
14 14
15 const TAG = "PlayerCommentComponent" 15 const TAG = "PlayerCommentComponent"
16 - 16 +/**
  17 + * 沉浸式直播--- 聊天区域
  18 + */
17 @Component 19 @Component
18 export struct PlayerCommentComponent { 20 export struct PlayerCommentComponent {
19 liveViewModel: LiveViewModel = new LiveViewModel() 21 liveViewModel: LiveViewModel = new LiveViewModel()
@@ -46,7 +48,7 @@ export struct PlayerCommentComponent { @@ -46,7 +48,7 @@ export struct PlayerCommentComponent {
46 48
47 getLiveChatList() { 49 getLiveChatList() {
48 this.pageModel.currentPage = 1 50 this.pageModel.currentPage = 1
49 - this.liveViewModel.getLiveChatList( 51 + this.liveViewModel.getLiveCommentList(
50 1, 52 1,
51 this.contentDetailData?.liveInfo?.mlive?.mliveId, 53 this.contentDetailData?.liveInfo?.mlive?.mliveId,
52 this.contentDetailData?.newsId+'', 54 this.contentDetailData?.newsId+'',
1 import { ContentDetailDTO } from 'wdBean/Index'; 1 import { ContentDetailDTO } from 'wdBean/Index';
2 import { AliPlayerRenderView, WDAliPlayerController, WDPlayerRenderVLiveView } from 'wdPlayer/Index'; 2 import { AliPlayerRenderView, WDAliPlayerController, WDPlayerRenderVLiveView } from 'wdPlayer/Index';
  3 +import { ParamType, TrackConstants } from 'wdTracking/Index';
3 import { PictureLoading } from './PictureLoading'; 4 import { PictureLoading } from './PictureLoading';
4 5
5 const TAG = 'PlayerComponent' 6 const TAG = 'PlayerComponent'
6 7
7 @Component 8 @Component
8 export struct PlayerComponent { 9 export struct PlayerComponent {
9 - @Prop playerController: WDAliPlayerController; 10 + private playerController?: WDAliPlayerController
10 @Consume @Watch('updateData') contentDetailData: ContentDetailDTO 11 @Consume @Watch('updateData') contentDetailData: ContentDetailDTO
11 @Consume @Watch('pageShowChange') pageShow: number 12 @Consume @Watch('pageShowChange') pageShow: number
12 @Consume @Watch('pageHideChange') pageHide: number 13 @Consume @Watch('pageHideChange') pageHide: number
@@ -20,6 +21,7 @@ export struct PlayerComponent { @@ -20,6 +21,7 @@ export struct PlayerComponent {
20 @State liveStreamType: number | null = -1 21 @State liveStreamType: number | null = -1
21 @State playUrl: string = '' 22 @State playUrl: string = ''
22 @State isCanplay: boolean = false 23 @State isCanplay: boolean = false
  24 + pageParam: ParamType = {}
23 25
24 pageShowChange() { 26 pageShowChange() {
25 this.playerController?.play() 27 this.playerController?.play()
@@ -75,8 +77,8 @@ export struct PlayerComponent { @@ -75,8 +77,8 @@ export struct PlayerComponent {
75 playerController: this.playerController, 77 playerController: this.playerController,
76 onLoad: () => { 78 onLoad: () => {
77 this.isCanplay = true 79 this.isCanplay = true
78 - console.error("XXXXZZZZ", '------2------------')  
79 - this.playerController?.firstPlay(this.playUrl); 80 + this.contentTrackingDict()
  81 + this.playerController?.firstPlay(this.playUrl, TrackConstants.PageName.Live_Detail, this.pageParam);
80 } 82 }
81 }) 83 })
82 } else if (this.liveStreamType == 0) { 84 } else if (this.liveStreamType == 0) {
@@ -84,8 +86,8 @@ export struct PlayerComponent { @@ -84,8 +86,8 @@ export struct PlayerComponent {
84 playerController: this.playerController, 86 playerController: this.playerController,
85 onLoad: () => { 87 onLoad: () => {
86 this.isCanplay = true 88 this.isCanplay = true
87 - console.error('XXXXZZZZ', '------1------------')  
88 - this.playerController?.firstPlay(this.playUrl); 89 + this.contentTrackingDict()
  90 + this.playerController?.firstPlay(this.playUrl, TrackConstants.PageName.Live_Detail, this.pageParam);
89 } 91 }
90 }).margin({ top: 195 }).height(211) 92 }).margin({ top: 195 }).height(211)
91 } 93 }
@@ -107,4 +109,12 @@ export struct PlayerComponent { @@ -107,4 +109,12 @@ export struct PlayerComponent {
107 .height('100%') 109 .height('100%')
108 .width('100%') 110 .width('100%')
109 } 111 }
  112 +
  113 + contentTrackingDict() {
  114 + this.pageParam = {
  115 + 'contentType': `${this.contentDetailData.newsType}`,
  116 + 'contentId': `${this.contentDetailData.newsId}`,
  117 + 'contentName': `${this.contentDetailData.newsTitle || ''}`,
  118 + }
  119 + }
110 } 120 }
1 -import { WDAliPlayerController, WDPlayerController } from 'wdPlayer/Index' 1 +import { WDAliPlayerController } from 'wdPlayer/Index'
2 import { PlayerUIComponent } from './PlayerUIComponent' 2 import { PlayerUIComponent } from './PlayerUIComponent'
3 3
4 @Component 4 @Component
@@ -3,10 +3,12 @@ import { ContentDetailDTO, LiveDetailsBean, LiveRoomDataBean } from 'wdBean/Inde @@ -3,10 +3,12 @@ import { ContentDetailDTO, LiveDetailsBean, LiveRoomDataBean } from 'wdBean/Inde
3 import { LiveFollowComponent, LottieView } from 'wdComponent/Index' 3 import { LiveFollowComponent, LottieView } from 'wdComponent/Index'
4 import { NumberFormatterUtils } from 'wdKit/Index' 4 import { NumberFormatterUtils } from 'wdKit/Index'
5 5
  6 +/**
  7 + * 沉浸式直播--- 头部标题
  8 + */
6 @Preview 9 @Preview
7 @Component 10 @Component
8 export struct PlayerTitleComponent { 11 export struct PlayerTitleComponent {
9 -// @Consume liveDetailsBean: LiveDetailsBean  
10 @Consume liveRoomDataBean: LiveRoomDataBean 12 @Consume liveRoomDataBean: LiveRoomDataBean
11 @Consume liveState: string 13 @Consume liveState: string
12 @Consume contentDetailData: ContentDetailDTO 14 @Consume contentDetailData: ContentDetailDTO
1 -import { ContentDetailDTO } from 'wdBean/Index';  
2 -import { WDAliPlayerController, WDPlayerController } from 'wdPlayer/Index'; 1 +import { WDAliPlayerController } from 'wdPlayer/Index';
3 import { PlayerCommentComponent } from './PlayerCommentComponent'; 2 import { PlayerCommentComponent } from './PlayerCommentComponent';
4 import { PlayerTitleComponent } from './PlayerTitleComponent'; 3 import { PlayerTitleComponent } from './PlayerTitleComponent';
5 import { PlayerVideoControlComponent } from './PlayerVideoControlComponent'; 4 import { PlayerVideoControlComponent } from './PlayerVideoControlComponent';
6 5
  6 +/**
  7 + * 沉浸直播 --- 横滑展示组件
  8 + */
7 @Component 9 @Component
8 export struct PlayerUIComponent { 10 export struct PlayerUIComponent {
9 private playerController?: WDAliPlayerController 11 private playerController?: WDAliPlayerController
@@ -12,10 +14,6 @@ export struct PlayerUIComponent { @@ -12,10 +14,6 @@ export struct PlayerUIComponent {
12 build() { 14 build() {
13 Stack() { 15 Stack() {
14 PlayerTitleComponent() 16 PlayerTitleComponent()
15 - // Row() {  
16 - // // 全屏与暂停按钮  
17 - // }.layoutWeight(1)  
18 -  
19 17
20 PlayerCommentComponent() 18 PlayerCommentComponent()
21 .visibility(this.isShowControl ? Visibility.Hidden : Visibility.Visible) 19 .visibility(this.isShowControl ? Visibility.Hidden : Visibility.Visible)
@@ -292,12 +292,15 @@ export struct DetailPlayShortVideoPage { @@ -292,12 +292,15 @@ export struct DetailPlayShortVideoPage {
292 playerCoverBuilder() { 292 playerCoverBuilder() {
293 // 问题:画面会闪一下 293 // 问题:画面会闪一下
294 Image(this.contentDetailData?.firstFrameImageUri) 294 Image(this.contentDetailData?.firstFrameImageUri)
295 - .width('100%')  
296 - .height(this.windowWidth / this.ratio + 'px')  
297 - .opacity(this.imageVisible ? 0.8 : 0)  
298 - .animation({  
299 - duration: 350, curve: Curve.EaseInOut  
300 - }) 295 + .width(this.playerWidth)
  296 + .height(this.playerHeight)// .opacity(this.imageVisible ? 0.7 : 0)
  297 + // .animation({
  298 + // // duration: 350,
  299 + // curve: Curve.EaseInOut,
  300 + // expectedFrameRateRange: { min: 30, max: 120, expected: 60 }
  301 + // })
  302 + .visibility(this.imageVisible ? Visibility.Visible : Visibility.None)
  303 +
301 } 304 }
302 305
303 @Builder 306 @Builder
@@ -8,10 +8,14 @@ import PushManager, { @@ -8,10 +8,14 @@ import PushManager, {
8 import { AppUtils, DeviceUtil, EmitterEventId, EmitterUtils, Logger, SPHelper } from 'wdKit/Index'; 8 import { AppUtils, DeviceUtil, EmitterEventId, EmitterUtils, Logger, SPHelper } from 'wdKit/Index';
9 import { HostEnum, HostManager, HttpBizUtil, HttpUrlUtils, HttpUtils, ResponseDTO } from 'wdNetwork/Index'; 9 import { HostEnum, HostManager, HttpBizUtil, HttpUrlUtils, HttpUtils, ResponseDTO } from 'wdNetwork/Index';
10 import { notificationManager } from '@kit.NotificationKit'; 10 import { notificationManager } from '@kit.NotificationKit';
11 -import { BusinessError } from '@kit.BasicServicesKit'; 11 +import { AsyncCallback, BusinessError } from '@kit.BasicServicesKit';
12 import { SpConstants } from 'wdConstant/Index'; 12 import { SpConstants } from 'wdConstant/Index';
13 import { PushContentBean, PushContentParser } from './PushContentParser'; 13 import { PushContentBean, PushContentParser } from './PushContentParser';
14 import { ParamType, Tracking } from 'wdTracking/Index'; 14 import { ParamType, Tracking } from 'wdTracking/Index';
  15 +import { PushTransmitMessageBean, PushTransmitMessagePayloadBean } from './PushTransmitMessageBean';
  16 +import { JSON } from '@kit.ArkTS';
  17 +import wantAgent from '@ohos.app.ability.wantAgent';
  18 +import { WantAgent } from '@ohos.app.ability.wantAgent';
15 19
16 const TAG = "GetuiPush" 20 const TAG = "GetuiPush"
17 21
@@ -209,7 +213,11 @@ export class GetuiPush { @@ -209,7 +213,11 @@ export class GetuiPush {
209 return 213 return
210 } 214 }
211 if (this.lastPushContent.online) { 215 if (this.lastPushContent.online) {
212 - if (this.lastPushContent.want) { 216 + if (this.lastPushContent.localNotify == true) {
  217 + Logger.debug(TAG, "推送 回执???: " + this.lastPushContent.want)
  218 + let gtactionid = 60002;//gtactionid传⼊60002表示个推渠道消息点击了
  219 + PushManager.sendFeedbackMessage(this.lastPushContent.messageId || "", this.lastPushContent.taskId || "", gtactionid)
  220 + } else if (this.lastPushContent.want) {
213 Logger.debug(TAG, "推送 回执: " + this.lastPushContent.want) 221 Logger.debug(TAG, "推送 回执: " + this.lastPushContent.want)
214 PushManager.setClickWant(this.lastPushContent.want) 222 PushManager.setClickWant(this.lastPushContent.want)
215 } 223 }
@@ -325,6 +333,81 @@ export class GetuiPush { @@ -325,6 +333,81 @@ export class GetuiPush {
325 // */ 333 // */
326 // int gtactionid = 60002;//gtactionid传⼊60002表示个推渠道消息点击了 334 // int gtactionid = 60002;//gtactionid传⼊60002表示个推渠道消息点击了
327 // boolean result = PushManager.sendFeedbackMessage(taskid, messageid, gtactionid); 335 // boolean result = PushManager.sendFeedbackMessage(taskid, messageid, gtactionid);
  336 + this.sendLocalNotification(message)
  337 + }
  338 +
  339 + private sendLocalNotification(message: GTTransmitMessage) {
  340 + let jsonMsgObj = JSON.parse(message.payload) as PushTransmitMessageBean
  341 + if (!jsonMsgObj) {
  342 + return
  343 + }
  344 + if (jsonMsgObj && jsonMsgObj.payload) {
  345 + jsonMsgObj.payloadObj = JSON.parse(jsonMsgObj.payload) as PushTransmitMessagePayloadBean
  346 + }
  347 +
  348 + let pushLink = jsonMsgObj.payloadObj?.pushLink || ""
  349 +
  350 + let params: Record<string, string> = {
  351 + "title": jsonMsgObj.title,
  352 + "content": jsonMsgObj.body,
  353 + "pushLink": pushLink,
  354 + "taskid": message.taskId,
  355 + "messageId": message.messageId,
  356 + "gtTransmitMsgLocalNotify": "1",
  357 + }
  358 +
  359 + this.getWantAgent(params, (error, want) => {
  360 + if (error) {
  361 + return
  362 + }
  363 + let notificationRequest: notificationManager.NotificationRequest = {
  364 + id: Date.now(),
  365 + content: {
  366 + notificationContentType: notificationManager.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
  367 + normal: {
  368 + title: jsonMsgObj.title,
  369 + text: jsonMsgObj.body,
  370 + }
  371 + },
  372 + notificationSlotType: notificationManager.SlotType.CONTENT_INFORMATION,
  373 + wantAgent:want,
  374 + };
  375 + notificationManager.publish(notificationRequest).then(() => {
  376 + Logger.debug(TAG, "本地发送系统通知完成")
  377 + }).catch((err: BusinessError) => {
  378 + Logger.debug(TAG, "本地发送系统通知失败:" + JSON.stringify(err))
  379 + });
  380 + })
  381 + }
  382 +
  383 + private getWantAgent(parameters:Record<string, string>, callback: AsyncCallback<WantAgent>) {
  384 +
  385 + // 通过WantAgentInfo的operationType设置动作类型
  386 + let wantAgentInfo:wantAgent.WantAgentInfo = {
  387 + wants: [
  388 + {
  389 + deviceId: '',
  390 + bundleName: 'com.peopledailychina.hosactivity',
  391 + abilityName: 'EntryAbility',
  392 + action: 'com.test.pushaction',
  393 + entities: [],
  394 + uri: "rmrbapp://rmrb.app:8080/openwith",
  395 + parameters: parameters
  396 + }
  397 + ],
  398 + operationType: wantAgent.OperationType.START_ABILITY,
  399 + requestCode: 0,
  400 + wantAgentFlags:[wantAgent.WantAgentFlags.CONSTANT_FLAG]
  401 + };
  402 +
  403 + wantAgent.getWantAgent(wantAgentInfo, (err:BusinessError, data:WantAgent) => {
  404 + if (err) {
  405 + Logger.error(TAG, `Failed to get want agent. Code is ${err.code}, message is ${err.message}`)
  406 + }
  407 + if (callback) {
  408 + callback(err, data)
  409 + }
  410 + });
328 } 411 }
329 412
330 private uploadPushInfo(cid: string) { 413 private uploadPushInfo(cid: string) {
@@ -11,6 +11,12 @@ export interface PushContentBean { @@ -11,6 +11,12 @@ export interface PushContentBean {
11 pushLink?: string // 解析want,对应pushLink参数 11 pushLink?: string // 解析want,对应pushLink参数
12 notifyTitle?: string 12 notifyTitle?: string
13 notifyContent?: string 13 notifyContent?: string
  14 +
  15 +
  16 + // 透传消息发送的本地测试通知
  17 + localNotify?:boolean
  18 + taskId?: string
  19 + messageId?: string
14 } 20 }
15 21
16 /* 22 /*
@@ -18,6 +24,8 @@ export interface PushContentBean { @@ -18,6 +24,8 @@ export interface PushContentBean {
18 * */ 24 * */
19 export class PushContentParser { 25 export class PushContentParser {
20 26
  27 +
  28 + private static LAUNCH_PARAM_GETUI_TRANSMIT_MSG_LOCAL_NOTIFY = "gtTransmitMsgLocalNotify"
21 private static LAUNCH_PARAM_GETUI_DATA = "gtdata" 29 private static LAUNCH_PARAM_GETUI_DATA = "gtdata"
22 private static LAUNCH_PARAM_GETUI_TASKID = "taskid" 30 private static LAUNCH_PARAM_GETUI_TASKID = "taskid"
23 private static LAUNCH_PARAM_GETUI_NOTIFYID = "_push_notifyid" 31 private static LAUNCH_PARAM_GETUI_NOTIFYID = "_push_notifyid"
@@ -116,6 +124,21 @@ export class PushContentParser { @@ -116,6 +124,21 @@ export class PushContentParser {
116 } 124 }
117 } 125 }
118 126
  127 +
  128 + // 本地发送的测试通知
  129 + if (want && want.parameters && want.parameters[PushContentParser.LAUNCH_PARAM_GETUI_TRANSMIT_MSG_LOCAL_NOTIFY]) {
  130 + if (want.parameters[PushContentParser.PUSH_PARAM_PUSH_LINK]) {
  131 + let pushLink = want.parameters[PushContentParser.PUSH_PARAM_PUSH_LINK] as string
  132 + return {
  133 + isPush: true, online: true, pushLink: pushLink, want: want,
  134 + notifyTitle: want.parameters["title"] as string,
  135 + notifyContent: want.parameters["content"] as string,
  136 + localNotify: true,
  137 + taskId: want.parameters["taskId"] as string,
  138 + messageId: want.parameters["messageId"] as string,
  139 + }
  140 + }
  141 + }
119 return { 142 return {
120 isPush: false, online: false 143 isPush: false, online: false
121 } 144 }
  1 +export interface PushTransmitMessageBean {
  2 + body: string
  3 + title: string
  4 + clickType: string
  5 + payload: string
  6 +
  7 + payloadObj?: PushTransmitMessagePayloadBean
  8 +}
  9 +
  10 +export interface PushTransmitMessagePayloadBean {
  11 + pushLink: string
  12 +}
@@ -13,7 +13,8 @@ import { @@ -13,7 +13,8 @@ import {
13 import { initGlobalPlayerSettings, setupPlayerConfig } from '../utils/GlobalSetting'; 13 import { initGlobalPlayerSettings, setupPlayerConfig } from '../utils/GlobalSetting';
14 import prompt from '@ohos.promptAction'; 14 import prompt from '@ohos.promptAction';
15 import { PlayerConstants, AVPlayerStatus, Events } from '../constants/PlayerConstants'; 15 import { PlayerConstants, AVPlayerStatus, Events } from '../constants/PlayerConstants';
16 -import { Logger, StringUtils } from 'wdKit/Index'; 16 +import { DateTimeUtils, Logger, StringUtils } from 'wdKit/Index';
  17 +import { ParamType, TrackingPlay } from 'wdTracking/Index';
17 18
18 const TAG = "WDAliPlayerController" 19 const TAG = "WDAliPlayerController"
19 20
@@ -50,6 +51,11 @@ export class WDAliPlayerController { @@ -50,6 +51,11 @@ export class WDAliPlayerController {
50 public onCanplay?: () => void; 51 public onCanplay?: () => void;
51 public onStatusChange?: (status: number) => void; 52 public onStatusChange?: (status: number) => void;
52 public onFirstFrameDisplay?: () => void 53 public onFirstFrameDisplay?: () => void
  54 + // 埋点字段
  55 + private creatStartTime: number = 0; //开始加载时间
  56 + private creatEndTime: number = 0; //加载完成时间
  57 + private pageParam: ParamType = {}
  58 + private pageName: string = ''
53 59
54 constructor() { 60 constructor() {
55 Logger.info(TAG, "初始化") 61 Logger.info(TAG, "初始化")
@@ -102,11 +108,29 @@ export class WDAliPlayerController { @@ -102,11 +108,29 @@ export class WDAliPlayerController {
102 if (this.onFirstFrameDisplay) { 108 if (this.onFirstFrameDisplay) {
103 this.onFirstFrameDisplay() 109 this.onFirstFrameDisplay()
104 } 110 }
  111 +
  112 +
  113 + if (this.pageParam) {
  114 + console.log('播放视频pageParam', JSON.stringify(this.pageParam))
  115 + // 播放埋点
  116 + TrackingPlay.videoPositivePlay(Math.floor((DateTimeUtils.getTimeStamp() - this.creatStartTime) / 1000),
  117 + this.pageName, this.pageName, this.pageParam)
  118 + }
  119 +
105 } 120 }
106 }); 121 });
107 this.avPlayer?.setOnCompletionListener({ 122 this.avPlayer?.setOnCompletionListener({
108 onCompletion: () => { 123 onCompletion: () => {
109 Logger.debug(TAG, "播放完成") 124 Logger.debug(TAG, "播放完成")
  125 +
  126 + if (this.pageParam) {
  127 + let initDuration = Math.floor(Number(this.duration) / 1000)
  128 + let currentPlayTime: number = Math.floor((DateTimeUtils.getTimeStamp() - this.creatStartTime) / 1000) //当前播放时间
  129 + console.log('播放结束')
  130 + // 播放结束埋点
  131 + TrackingPlay.videoPlayEnd(currentPlayTime, initDuration, currentPlayTime, this.pageName, this.pageName,
  132 + this.pageParam)
  133 + }
110 } 134 }
111 }); 135 });
112 this.avPlayer?.setOnInfoListener({ 136 this.avPlayer?.setOnInfoListener({
@@ -197,6 +221,9 @@ export class WDAliPlayerController { @@ -197,6 +221,9 @@ export class WDAliPlayerController {
197 this.errorMesage = errorInfo.getMsg() 221 this.errorMesage = errorInfo.getMsg()
198 this.status = PlayerConstants.STATUS_ERROR; 222 this.status = PlayerConstants.STATUS_ERROR;
199 this.watchStatus(); 223 this.watchStatus();
  224 +
  225 + console.log('播放错误',JSON.stringify(error))
  226 + TrackingPlay.videoPlayError(errorInfo.getMsg(), this.pageName, this.pageName, this.pageParam)
200 } 227 }
201 }); 228 });
202 this.avPlayer?.setOnLoadingStatusListener({ 229 this.avPlayer?.setOnLoadingStatusListener({
@@ -265,12 +292,20 @@ export class WDAliPlayerController { @@ -265,12 +292,20 @@ export class WDAliPlayerController {
265 } 292 }
266 } 293 }
267 294
268 - async firstPlay(url: string) { 295 + async firstPlay(url: string, pageName?: string, pageParam?: ParamType) {
269 if (StringUtils.isEmpty(url)) { 296 if (StringUtils.isEmpty(url)) {
270 Logger.error(TAG, "播放链接为空") 297 Logger.error(TAG, "播放链接为空")
271 return 298 return
272 } 299 }
273 300
  301 + this.creatStartTime = DateTimeUtils.getTimeStamp()
  302 + if (pageName) {
  303 + this.pageName = pageName
  304 + }
  305 + if (pageParam) {
  306 + this.pageParam = pageParam
  307 + }
  308 +
274 this.url = url; 309 this.url = url;
275 if (this.avPlayer == null) { 310 if (this.avPlayer == null) {
276 Logger.info(TAG, "等待播放器初始化") 311 Logger.info(TAG, "等待播放器初始化")
@@ -457,11 +492,7 @@ export class WDAliPlayerController { @@ -457,11 +492,7 @@ export class WDAliPlayerController {
457 if (this.onStatusChange) { 492 if (this.onStatusChange) {
458 this.onStatusChange(this.status) 493 this.onStatusChange(this.status)
459 } 494 }
460 - // if (this.status === PlayConstants.STATUS_START) {  
461 - // globalThis.windowClass.setWindowKeepScreenOn(true);  
462 - // } else {  
463 - // globalThis.windowClass.setWindowKeepScreenOn(false);  
464 - // } 495 +
465 } 496 }
466 497
467 playError(msg?: string) { 498 playError(msg?: string) {
@@ -59,7 +59,8 @@ export struct WDPlayerRenderVLiveView { @@ -59,7 +59,8 @@ export struct WDPlayerRenderVLiveView {
59 59
60 this.playerController.onVideoSizeChange = (width: number, height: number) => { 60 this.playerController.onVideoSizeChange = (width: number, height: number) => {
61 // console.log(`WDPlayerRenderView onVideoSizeChange width:${width} videoTop:${height}`) 61 // console.log(`WDPlayerRenderView onVideoSizeChange width:${width} videoTop:${height}`)
62 - Logger.info(TAG, ` onVideoSizeChange width:${width} videoTop:${height}`) 62 + // Logger.info(TAG, ` onVideoSizeChange width:${width} videoTop:${height}`)
  63 + console.error(TAG, ` onVideoSizeChange width:${width} videoTop:${height}`)
63 this.videoWidth = width; 64 this.videoWidth = width;
64 this.videoHeight = height; 65 this.videoHeight = height;
65 this.updateLayout() 66 this.updateLayout()
@@ -62,5 +62,6 @@ struct ENewspaper { @@ -62,5 +62,6 @@ struct ENewspaper {
62 62
63 onBackPress() { 63 onBackPress() {
64 Logger.info(TAG, 'onBackPress'); 64 Logger.info(TAG, 'onBackPress');
  65 + return true
65 } 66 }
66 } 67 }
@@ -4,10 +4,11 @@ import { EmitterEventId, EmitterUtils, Logger, StringUtils } from 'wdKit'; @@ -4,10 +4,11 @@ import { EmitterEventId, EmitterUtils, Logger, StringUtils } from 'wdKit';
4 import { HttpUtils } from 'wdNetwork/Index'; 4 import { HttpUtils } from 'wdNetwork/Index';
5 import HomeChannelUtils, { AssignChannelParam } from 'wdRouter/Index'; 5 import HomeChannelUtils, { AssignChannelParam } from 'wdRouter/Index';
6 import { MinePageComponent } from 'wdComponent/src/main/ets/components/page/MinePageComponent'; 6 import { MinePageComponent } from 'wdComponent/src/main/ets/components/page/MinePageComponent';
7 -import { CompUtils, TopNavigationComponent, TopNavigationComponentNew } from 'wdComponent/Index'; 7 +import { CompUtils, TopNavigationComponentNew } from 'wdComponent/Index';
8 import { VideoChannelPage } from './VideoChannelPage'; 8 import { VideoChannelPage } from './VideoChannelPage';
9 import ChannelViewModel from 'wdComponent/src/main/ets/viewmodel/ChannelViewModel'; 9 import ChannelViewModel from 'wdComponent/src/main/ets/viewmodel/ChannelViewModel';
10 -import { ImageKnifeComponent, ImageKnifeOption, NONE } from '@ohos/imageknife'; 10 +import { ALL, ImageKnifeComponent, ImageKnifeOption, NONE } from '@ohos/imageknife';
  11 +import { ParamType, Tracking } from 'wdTracking/Index';
11 12
12 const TAG = 'BottomNavigationComponent'; 13 const TAG = 'BottomNavigationComponent';
13 PersistentStorage.persistProp('channelIds', ''); 14 PersistentStorage.persistProp('channelIds', '');
@@ -21,7 +22,6 @@ let storage = LocalStorage.getShared(); @@ -21,7 +22,6 @@ let storage = LocalStorage.getShared();
21 @Entry(storage) 22 @Entry(storage)
22 @Component 23 @Component
23 export struct BottomNavigationComponent { 24 export struct BottomNavigationComponent {
24 - private isNewTopPage = true // TODO 顶导重构页面开关,false,则用原来的顶导  
25 @Provide bottomRectHeight: number = 0 25 @Provide bottomRectHeight: number = 0
26 @Provide topRectHeight: number = 0 26 @Provide topRectHeight: number = 0
27 @Provide isLayoutFullScreen: boolean = false 27 @Provide isLayoutFullScreen: boolean = false
@@ -87,28 +87,15 @@ export struct BottomNavigationComponent { @@ -87,28 +87,15 @@ export struct BottomNavigationComponent {
87 autoRefresh: this.autoRefresh 87 autoRefresh: this.autoRefresh
88 }) 88 })
89 } else { 89 } else {
90 - if (this.isNewTopPage) {  
91 - TopNavigationComponentNew({  
92 - groupId: navItem.id,  
93 - topNavList: navItem.topNavChannelList.filter(item => item.channelId != 2073),  
94 - _currentNavIndex: $currentNavIndex,  
95 - bottomNavIndex: index,  
96 - currentBottomNavName: navItem.name,  
97 - assignChannel: this.assignChannel,  
98 - autoRefresh: this.autoRefresh  
99 - })  
100 - } else {  
101 - TopNavigationComponent({  
102 - groupId: navItem.id,  
103 - topNavList: navItem.topNavChannelList.filter(item => item.channelId != 2073),  
104 - _currentNavIndex: $currentNavIndex,  
105 - navIndex: index,  
106 - currentBottomNavName: navItem.name,  
107 - assignChannel: this.assignChannel,  
108 - autoRefresh: this.autoRefresh  
109 - })  
110 - }  
111 - 90 + TopNavigationComponentNew({
  91 + groupId: navItem.id,
  92 + topNavList: navItem.topNavChannelList.filter(item => item.channelId != 2073),
  93 + _currentNavIndex: $currentNavIndex,
  94 + bottomNavIndex: index,
  95 + currentBottomNavName: navItem.name,
  96 + assignChannel: this.assignChannel,
  97 + autoRefresh: this.autoRefresh
  98 + })
112 } 99 }
113 } 100 }
114 .tabBar(this.tabBarBuilder(navItem, index)) 101 .tabBar(this.tabBarBuilder(navItem, index))
@@ -171,6 +158,14 @@ export struct BottomNavigationComponent { @@ -171,6 +158,14 @@ export struct BottomNavigationComponent {
171 // .hitTestBehavior(HitTestMode.Block) 158 // .hitTestBehavior(HitTestMode.Block)
172 .onClick(() => { 159 .onClick(() => {
173 Logger.info(TAG, `onChange, index: ${index}`); 160 Logger.info(TAG, `onChange, index: ${index}`);
  161 + Logger.info(TAG, `onChange, navItem: ${JSON.stringify(navItem)}`);
  162 + // 底部bar埋点
  163 + const params: ParamType = {
  164 + "pageName": navItem.pageName,
  165 + "pageId": navItem.id,
  166 + }
  167 + Tracking.event("bar_click", params)
  168 +
174 this.onBottomNavigationIndexChange(navItem, index) 169 this.onBottomNavigationIndexChange(navItem, index)
175 }) 170 })
176 171
@@ -188,8 +183,8 @@ export struct BottomNavigationComponent { @@ -188,8 +183,8 @@ export struct BottomNavigationComponent {
188 errorholderSrc: defaultIcon, 183 errorholderSrc: defaultIcon,
189 // 是否开启一级内存缓存 184 // 是否开启一级内存缓存
190 isCacheable: true, 185 isCacheable: true,
191 - // 磁盘缓存none  
192 - strategy: new NONE() 186 + // 磁盘缓存
  187 + strategy: new ALL()
193 }; 188 };
194 return imageKnifeOption 189 return imageKnifeOption
195 } 190 }
@@ -263,6 +258,7 @@ export struct BottomNavigationComponent { @@ -263,6 +258,7 @@ export struct BottomNavigationComponent {
263 } 258 }
264 259
265 onBottomNavigationDataUpdated() { 260 onBottomNavigationDataUpdated() {
  261 + Logger.error('yyyy','onBottomNavigationDataUpdated '+JSON.stringify(this.bottomNavList))
266 // Logger.info(TAG, `onBottomNavigationDataUpdated currentNavIndex: ${this.currentNavIndex},length:${this.bottomNavItemList.length}`); 262 // Logger.info(TAG, `onBottomNavigationDataUpdated currentNavIndex: ${this.currentNavIndex},length:${this.bottomNavItemList.length}`);
267 } 263 }
268 264
@@ -367,6 +363,15 @@ export struct BottomNavigationComponent { @@ -367,6 +363,15 @@ export struct BottomNavigationComponent {
367 Logger.info(TAG, `setData, bottomNav.length: ${list.length}`); 363 Logger.info(TAG, `setData, bottomNav.length: ${list.length}`);
368 // 使用filter方法移除name为'服务'的项 364 // 使用filter方法移除name为'服务'的项
369 list = list.filter(item => item.name !== '服务'); 365 list = list.filter(item => item.name !== '服务');
  366 + list.forEach(item => {
  367 + switch (item.name) {
  368 + case '新闻': item.pageName = 'NEWS'; break;
  369 + case '人民号': item.pageName = 'PEOPLE'; break;
  370 + case '视频': item.pageName = 'VIDEOS'; break;
  371 + case '我的': item.pageName = 'MY'; break;
  372 + default : item.pageName = 'NEWS'; break;
  373 + }
  374 + })
370 this.bottomNavList = list 375 this.bottomNavList = list
371 } 376 }
372 } 377 }
@@ -30,7 +30,6 @@ export struct VideoChannelPage { @@ -30,7 +30,6 @@ export struct VideoChannelPage {
30 @State indicatorWidth: number = 0 30 @State indicatorWidth: number = 0
31 // 传递给page的自动刷新通知 31 // 传递给page的自动刷新通知
32 @State autoRefresh2Page: number = 0 32 @State autoRefresh2Page: number = 0
33 -  
34 aboutToAppear(): void { 33 aboutToAppear(): void {
35 this.setBarBackgroundColor() 34 this.setBarBackgroundColor()
36 console.log(TAG, 'aboutToAppear') 35 console.log(TAG, 'aboutToAppear')
@@ -131,14 +130,14 @@ export struct VideoChannelPage { @@ -131,14 +130,14 @@ export struct VideoChannelPage {
131 .onClick(() => { 130 .onClick(() => {
132 TrackingButton.searchClick(TrackConstants.PageName.Search, "VIDEOS") 131 TrackingButton.searchClick(TrackConstants.PageName.Search, "VIDEOS")
133 let params = { 'tabName': "VIDEOS" } as Record<string, string> 132 let params = { 'tabName': "VIDEOS" } as Record<string, string>
134 - WDRouterRule.jumpWithPage(WDRouterPage.searchPage,params) 133 + WDRouterRule.jumpWithPage(WDRouterPage.searchPage, params)
135 }) 134 })
136 .backgroundColor(Color.Transparent) 135 .backgroundColor(Color.Transparent)
137 136
138 } 137 }
139 .zIndex(20) 138 .zIndex(20)
140 .height($r('app.float.top_tab_bar_height_common')) 139 .height($r('app.float.top_tab_bar_height_common'))
141 - .margin({top:10}) 140 + .margin({ top: 10 })
142 .visibility(this.displayDirection === DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) 141 .visibility(this.displayDirection === DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None)
143 142
144 } 143 }
@@ -174,6 +173,7 @@ export struct VideoChannelPage { @@ -174,6 +173,7 @@ export struct VideoChannelPage {
174 .width('100%') 173 .width('100%')
175 .height('100%') 174 .height('100%')
176 .cachedCount(-1) 175 .cachedCount(-1)
  176 + .disableSwipe(this.displayDirection === DisplayDirection.VERTICAL ? false : true)
177 .displayCount(1, true) 177 .displayCount(1, true)
178 .alignSelf(ItemAlign.Start) 178 .alignSelf(ItemAlign.Start)
179 .effectMode(EdgeEffect.None) 179 .effectMode(EdgeEffect.None)
@@ -17,7 +17,7 @@ @@ -17,7 +17,7 @@
17 "name": "EntryAbility", // 这里不能改动,和后台推送有绑定 17 "name": "EntryAbility", // 这里不能改动,和后台推送有绑定
18 "srcEntry": "./ets/entryability/EntryAbility.ets", 18 "srcEntry": "./ets/entryability/EntryAbility.ets",
19 "description": "$string:EntryAbility_desc", 19 "description": "$string:EntryAbility_desc",
20 - "icon": "$media:app_icon", 20 + "icon": "$media:app_icon_layer",
21 "label": "$string:EntryAbility_label", 21 "label": "$string:EntryAbility_label",
22 "startWindowIcon": "$media:app_icon", 22 "startWindowIcon": "$media:app_icon",
23 "startWindowBackground": "$color:start_window_background", 23 "startWindowBackground": "$color:start_window_background",
  1 +{
  2 + "layered-image":
  3 + {
  4 + "background" : "$media:app_icon_background",
  5 + "foreground" : "$media:app_icon_foreground"
  6 + }
  7 +}