chengen02

Merge remote-tracking branch 'origin/main'

# Conflicts:
#	sight_harmony/products/phone/src/main/ets/pages/SpacialTopicPage.ets
Showing 78 changed files with 965 additions and 468 deletions
@@ -8,6 +8,7 @@ @@ -8,6 +8,7 @@
8 "tablet", 8 "tablet",
9 "2in1" 9 "2in1"
10 ], 10 ],
  11 + "compressNativeLibs": true,
11 "deliveryWithInstall": true 12 "deliveryWithInstall": true
12 } 13 }
13 } 14 }
@@ -3,10 +3,13 @@ export struct CustomToast { @@ -3,10 +3,13 @@ export struct CustomToast {
3 public static LENGTH_LONG = 4000; 3 public static LENGTH_LONG = 4000;
4 public static LENGTH_SHORT = 2000; 4 public static LENGTH_SHORT = 2000;
5 5
6 - @State msg: string = "" 6 + @State msg: ResourceStr = ""
7 @State duration: number = CustomToast.LENGTH_SHORT 7 @State duration: number = CustomToast.LENGTH_SHORT
8 @State bgBorderRadius: number = 10 8 @State bgBorderRadius: number = 10
9 - 9 + opacityValue: number = 0.7
  10 + bgColor: ResourceColor = $r("app.color.black")
  11 + fontSizeValue :number | string | Resource = "27lpx"
  12 + lineHeightValue :number | string | Resource = "38lpx"
10 controller: CustomDialogController 13 controller: CustomDialogController
11 14
12 dismiss: () => void = () => { 15 dismiss: () => void = () => {
@@ -27,13 +30,13 @@ export struct CustomToast { @@ -27,13 +30,13 @@ export struct CustomToast {
27 Text(this.msg) 30 Text(this.msg)
28 .fontWeight(FontWeight.Regular) 31 .fontWeight(FontWeight.Regular)
29 .fontColor($r('app.color.white')) 32 .fontColor($r('app.color.white'))
30 - .fontSize("27lpx")  
31 - .lineHeight("38lpx") 33 + .fontSize(this.fontSizeValue)
  34 + .lineHeight(this.lineHeightValue)
32 .textAlign(TextAlign.Center) 35 .textAlign(TextAlign.Center)
33 }.borderRadius(`${this.bgBorderRadius}lpx`) 36 }.borderRadius(`${this.bgBorderRadius}lpx`)
34 .constraintSize({maxWidth:"86%"}) 37 .constraintSize({maxWidth:"86%"})
35 .padding({top:"23lpx",bottom:'23lpx',left:"35lpx",right:"35lpx"}) 38 .padding({top:"23lpx",bottom:'23lpx',left:"35lpx",right:"35lpx"})
36 - .backgroundColor($r("app.color.black"))  
37 - .opacity(0.7) 39 + .backgroundColor(this.bgColor)
  40 + .opacity(this.opacityValue)
38 } 41 }
39 } 42 }
@@ -8,6 +8,7 @@ @@ -8,6 +8,7 @@
8 "tablet", 8 "tablet",
9 "2in1" 9 "2in1"
10 ], 10 ],
  11 + "compressNativeLibs": true,
11 "deliveryWithInstall": true, 12 "deliveryWithInstall": true,
12 "requestPermissions": [ 13 "requestPermissions": [
13 { 14 {
@@ -21,7 +21,7 @@ export enum HostEnum { @@ -21,7 +21,7 @@ export enum HostEnum {
21 * 环境host管理工具类 21 * 环境host管理工具类
22 */ 22 */
23 export class HostManager { 23 export class HostManager {
24 - private static _hostUrl: HostEnum = HostEnum.HOST_UAT; 24 + private static _hostUrl: HostEnum = HostEnum.HOST_PRODUCT;
25 25
26 static changeHost(host: HostEnum) { 26 static changeHost(host: HostEnum) {
27 HostManager._hostUrl = host; 27 HostManager._hostUrl = host;
@@ -8,6 +8,7 @@ @@ -8,6 +8,7 @@
8 "tablet", 8 "tablet",
9 "2in1" 9 "2in1"
10 ], 10 ],
  11 + "compressNativeLibs": true,
11 "deliveryWithInstall": true, 12 "deliveryWithInstall": true,
12 "requestPermissions": [ 13 "requestPermissions": [
13 { 14 {
@@ -8,6 +8,7 @@ @@ -8,6 +8,7 @@
8 "tablet", 8 "tablet",
9 "2in1" 9 "2in1"
10 ], 10 ],
  11 + "compressNativeLibs": true,
11 "deliveryWithInstall": true 12 "deliveryWithInstall": true
12 } 13 }
13 } 14 }
@@ -8,6 +8,7 @@ @@ -8,6 +8,7 @@
8 "tablet", 8 "tablet",
9 "2in1" 9 "2in1"
10 ], 10 ],
  11 + "compressNativeLibs": true,
11 "deliveryWithInstall": true, 12 "deliveryWithInstall": true,
12 "pages": "$profile:main_pages" 13 "pages": "$profile:main_pages"
13 } 14 }
@@ -8,6 +8,7 @@ @@ -8,6 +8,7 @@
8 "tablet", 8 "tablet",
9 "2in1" 9 "2in1"
10 ], 10 ],
  11 + "compressNativeLibs": true,
11 "deliveryWithInstall": true 12 "deliveryWithInstall": true
12 } 13 }
13 } 14 }
@@ -173,6 +173,7 @@ export { CreatorsBean } from './src/main/ets/bean/content/CreatorsBean'; @@ -173,6 +173,7 @@ export { CreatorsBean } from './src/main/ets/bean/content/CreatorsBean';
173 export { MasterDetailRes } from './src/main/ets/bean/user/MasterDetailRes'; 173 export { MasterDetailRes } from './src/main/ets/bean/user/MasterDetailRes';
174 174
175 export { ReserveItemBean } from './src/main/ets/bean/live/ReserveItemBean'; 175 export { ReserveItemBean } from './src/main/ets/bean/live/ReserveItemBean';
  176 +export { PageTrackBean } from './src/main/ets/bean/component/PageTrackBean';
176 177
177 178
178 179
  1 +/**
  2 + * pageinfo数据,仅埋点用
  3 + */
  4 +export class PageTrackBean {
  5 + pageId: string = ''; // 页面id
  6 + pageName: string = ''; // 名称
  7 +}
@@ -8,6 +8,7 @@ @@ -8,6 +8,7 @@
8 "tablet", 8 "tablet",
9 "2in1" 9 "2in1"
10 ], 10 ],
  11 + "compressNativeLibs": true,
11 "deliveryWithInstall": true 12 "deliveryWithInstall": true
12 } 13 }
13 } 14 }
@@ -7,6 +7,7 @@ import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailView @@ -7,6 +7,7 @@ import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailView
7 import { SpConstants } from 'wdConstant/Index'; 7 import { SpConstants } from 'wdConstant/Index';
8 import { WDShare } from 'wdShare/Index'; 8 import { WDShare } from 'wdShare/Index';
9 import { LikeComponent } from './view/LikeComponent' 9 import { LikeComponent } from './view/LikeComponent'
  10 +import { TrackConstants } from 'wdTracking/Index';
10 11
11 const TAG = 'CarderInteraction' 12 const TAG = 'CarderInteraction'
12 13
@@ -22,6 +23,8 @@ export struct CarderInteraction { @@ -22,6 +23,8 @@ export struct CarderInteraction {
22 @State likeBean: Record<string, string> = {} 23 @State likeBean: Record<string, string> = {}
23 @State likesStyle: number | string = 1 // 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空 24 @State likesStyle: number | string = 1 // 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空
24 @State openLikes: boolean = false // 是否可以点赞 1:可以 0:不可以 25 @State openLikes: boolean = false // 是否可以点赞 1:可以 0:不可以
  26 + @Provide pageName: string = TrackConstants.PageName.DynamicDetail
  27 + @Provide pageId: string = TrackConstants.PageName.DynamicDetail
25 28
26 async aboutToAppear() { 29 async aboutToAppear() {
27 await this.getContentDetailData() 30 await this.getContentDetailData()
@@ -46,6 +46,7 @@ export struct CompParser { @@ -46,6 +46,7 @@ export struct CompParser {
46 46
47 47
48 console.log('CompParser-compDTO', JSON.stringify(this.compDTO)) 48 console.log('CompParser-compDTO', JSON.stringify(this.compDTO))
  49 + this.pageName = this.pageModel.pageInfo.name
49 // 轮播图屏蔽音频类型稿件 50 // 轮播图屏蔽音频类型稿件
50 if (this.compDTO.compStyle === CompStyle.Zh_Carousel_Layout_01) { 51 if (this.compDTO.compStyle === CompStyle.Zh_Carousel_Layout_01) {
51 this.audioItems = this.compDTO.operDataList.filter(item => { 52 this.audioItems = this.compDTO.operDataList.filter(item => {
@@ -88,7 +89,7 @@ export struct CompParser { @@ -88,7 +89,7 @@ export struct CompParser {
88 } else if (this.compDTO.compStyle === CompStyle.Zh_Carousel_Layout_01) { 89 } else if (this.compDTO.compStyle === CompStyle.Zh_Carousel_Layout_01) {
89 if (this.compDTO.operDataList.length > this.audioItems.length) { 90 if (this.compDTO.operDataList.length > this.audioItems.length) {
90 ZhCarouselLayout01({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName }) 91 ZhCarouselLayout01({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName })
91 - Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) 92 + Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
92 } 93 }
93 } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_01 && 94 } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_01 &&
94 this.compDTO.imageScale === 2) { // && compDTO.name ==="横划卡" 95 this.compDTO.imageScale === 2) { // && compDTO.name ==="横划卡"
@@ -9,7 +9,7 @@ import font from '@ohos.font'; @@ -9,7 +9,7 @@ import font from '@ohos.font';
9 import { ENewspaperPageDialog } from '../dialog/ENewspaperPageDialog'; 9 import { ENewspaperPageDialog } from '../dialog/ENewspaperPageDialog';
10 import { RMCalendarBean } from './calendar/RMCalendarBean'; 10 import { RMCalendarBean } from './calendar/RMCalendarBean';
11 import { newsSkeleton } from './skeleton/newsSkeleton'; 11 import { newsSkeleton } from './skeleton/newsSkeleton';
12 -import { Logger, ToastUtils, NetworkUtil } from 'wdKit/Index'; 12 +import { Logger, ToastUtils, NetworkUtil, CustomToast } from 'wdKit/Index';
13 import { TrackingContent,TrackConstants, TrackingButton } from 'wdTracking/Index'; 13 import { TrackingContent,TrackConstants, TrackingButton } from 'wdTracking/Index';
14 import { WDShare } from 'wdShare/Index'; 14 import { WDShare } from 'wdShare/Index';
15 import { window } from '@kit.ArkUI'; 15 import { window } from '@kit.ArkUI';
@@ -36,6 +36,25 @@ export struct ENewspaperPageComponent { @@ -36,6 +36,25 @@ export struct ENewspaperPageComponent {
36 @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 36 @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
37 @State ratio: string = '100%' 37 @State ratio: string = '100%'
38 38
  39 + @State toastText:ResourceStr = ""
  40 + dialogToast: CustomDialogController = new CustomDialogController({
  41 + builder: CustomToast({
  42 + bgColor:$r("app.color.color_B3000000"),
  43 + opacityValue:1,
  44 + fontSizeValue:"25lpx",
  45 + lineHeightValue:"36lpx",
  46 + msg: this.toastText,
  47 + }),
  48 + autoCancel: false,
  49 + alignment: DialogAlignment.Center,
  50 + customStyle: true,
  51 + maskColor:"#00000000"
  52 + })
  53 +
  54 + showToastTip(msg:ResourceStr){
  55 + this.toastText = msg
  56 + this.dialogToast.open()
  57 + }
39 //watch监听报纸页码回调 58 //watch监听报纸页码回调
40 onCurrentPageNumUpdated(): void { 59 onCurrentPageNumUpdated(): void {
41 console.log("ENewspaperPageComponent-onCurrentPageNumUpdated", "currentPageNum:", this.currentPageNum) 60 console.log("ENewspaperPageComponent-onCurrentPageNumUpdated", "currentPageNum:", this.currentPageNum)
@@ -235,6 +254,7 @@ export struct ENewspaperPageComponent { @@ -235,6 +254,7 @@ export struct ENewspaperPageComponent {
235 ENewspaperItemComponent({ newspaperListItemBean: item}) 254 ENewspaperItemComponent({ newspaperListItemBean: item})
236 }) 255 })
237 } 256 }
  257 + .itemSpace(10)
238 .index(this.swiperIndex) 258 .index(this.swiperIndex)
239 .width(this.ratio) 259 .width(this.ratio)
240 // newspaper_shadow 44 高度 e_newspaper_content 35 margin top 260 // newspaper_shadow 44 高度 e_newspaper_content 35 margin top
@@ -322,7 +342,7 @@ export struct ENewspaperPageComponent { @@ -322,7 +342,7 @@ export struct ENewspaperPageComponent {
322 .id('e_newspaper_page_num') 342 .id('e_newspaper_page_num')
323 .onClick((event: ClickEvent) => { 343 .onClick((event: ClickEvent) => {
324 if(!NetworkUtil.isNetConnected()){ 344 if(!NetworkUtil.isNetConnected()){
325 - ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000) 345 + this.showToastTip('网络出小差了,请检查网络后重试')
326 return 346 return
327 } 347 }
328 if (this.newspaperListBean.list && this.newspaperListBean.list.length > 0) { 348 if (this.newspaperListBean.list && this.newspaperListBean.list.length > 0) {
@@ -333,7 +353,7 @@ export struct ENewspaperPageComponent { @@ -333,7 +353,7 @@ export struct ENewspaperPageComponent {
333 this.pageDialogController.close() 353 this.pageDialogController.close()
334 } 354 }
335 }else { 355 }else {
336 - ToastUtils.showToast('暂无数据', 1000) 356 + this.showToastTip('暂无数据')
337 } 357 }
338 }) 358 })
339 359
@@ -361,7 +381,7 @@ export struct ENewspaperPageComponent { @@ -361,7 +381,7 @@ export struct ENewspaperPageComponent {
361 .id('e_newspaper_read') 381 .id('e_newspaper_read')
362 .onClick((event: ClickEvent) => { 382 .onClick((event: ClickEvent) => {
363 if(!NetworkUtil.isNetConnected()){ 383 if(!NetworkUtil.isNetConnected()){
364 - ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000) 384 + this.showToastTip('网络出小差了,请检查网络后重试')
365 return 385 return
366 } 386 }
367 if (this.newspaperListBean.list && this.newspaperListBean.list.length > 0) { 387 if (this.newspaperListBean.list && this.newspaperListBean.list.length > 0) {
@@ -375,7 +395,7 @@ export struct ENewspaperPageComponent { @@ -375,7 +395,7 @@ export struct ENewspaperPageComponent {
375 'currentNumber':this.swiperIndex, 395 'currentNumber':this.swiperIndex,
376 }) 396 })
377 }else { 397 }else {
378 - ToastUtils.showToast('暂无数据', 1000) 398 + this.showToastTip('暂无数据')
379 } 399 }
380 }) 400 })
381 } 401 }
@@ -413,7 +433,7 @@ export struct ENewspaperPageComponent { @@ -413,7 +433,7 @@ export struct ENewspaperPageComponent {
413 let listBean = await NewspaperViewModel.getNewspaperList(this.calendarDate, this.picWidth + 'x' + this.picHeight) 433 let listBean = await NewspaperViewModel.getNewspaperList(this.calendarDate, this.picWidth + 'x' + this.picHeight)
414 this.newspaperListBean = listBean; 434 this.newspaperListBean = listBean;
415 } else { 435 } else {
416 - ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000) 436 + this.showToastTip('网络出小差了,请检查网络后重试')
417 } 437 }
418 } catch (exception) { 438 } catch (exception) {
419 439
1 import { FeedBackParams, FeedbackTypeBean, PhotoListBean } from 'wdBean/Index'; 1 import { FeedBackParams, FeedbackTypeBean, PhotoListBean } from 'wdBean/Index';
2 import { AppUtils, 2 import { AppUtils,
  3 + CustomToast,
3 DateTimeUtils, 4 DateTimeUtils,
4 DeviceUtil, 5 DeviceUtil,
5 - FastClickUtil, Logger, NetworkUtil, StringUtils, ToastUtils, UserDataLocal } from 'wdKit/Index'; 6 + FastClickUtil, Logger, NetworkUtil, StringUtils, UserDataLocal } from 'wdKit/Index';
6 import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel'; 7 import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel';
7 import { CustomTitleUI } from './reusable/CustomTitleUI' 8 import { CustomTitleUI } from './reusable/CustomTitleUI'
8 import { picker } from '@kit.CoreFileKit'; 9 import { picker } from '@kit.CoreFileKit';
@@ -38,6 +39,21 @@ export struct FeedBackActivity { @@ -38,6 +39,21 @@ export struct FeedBackActivity {
38 addPic: PhotoListBean = {itemType:1} as PhotoListBean 39 addPic: PhotoListBean = {itemType:1} as PhotoListBean
39 @State pics: PhotoListBean[] = [this.addPic] as PhotoListBean[] 40 @State pics: PhotoListBean[] = [this.addPic] as PhotoListBean[]
40 41
  42 + @State toastText:ResourceStr = ""
  43 + dialogToast: CustomDialogController = new CustomDialogController({
  44 + builder: CustomToast({
  45 + bgColor:$r("app.color.color_B3000000"),
  46 + opacityValue:1,
  47 + fontSizeValue:"25lpx",
  48 + lineHeightValue:"36lpx",
  49 + msg: this.toastText,
  50 + }),
  51 + autoCancel: false,
  52 + alignment: DialogAlignment.Center,
  53 + customStyle: true,
  54 + maskColor:"#00000000"
  55 + })
  56 +
41 async aboutToAppear() { 57 async aboutToAppear() {
42 await this.getContentDetailData() 58 await this.getContentDetailData()
43 } 59 }
@@ -124,7 +140,7 @@ export struct FeedBackActivity { @@ -124,7 +140,7 @@ export struct FeedBackActivity {
124 if(value.length> 500){ 140 if(value.length> 500){
125 //隐藏键盘 141 //隐藏键盘
126 inputMethod.getController().stopInputSession(); 142 inputMethod.getController().stopInputSession();
127 - ToastUtils.shortToast($r('app.string.res_feedback_commentsFail')) 143 + this.showToastTip($r('app.string.res_feedback_commentsFail'))
128 // Logger.debug(TAG, "onChange > 500 " + value) 144 // Logger.debug(TAG, "onChange > 500 " + value)
129 this.editValue = {classifyName:value.substring(0,500)} as FeedbackTypeBean 145 this.editValue = {classifyName:value.substring(0,500)} as FeedbackTypeBean
130 }else{ 146 }else{
@@ -285,9 +301,10 @@ export struct FeedBackActivity { @@ -285,9 +301,10 @@ export struct FeedBackActivity {
285 } 301 }
286 this.reportCommit() 302 this.reportCommit()
287 }) 303 })
288 - .margin({bottom:20}) 304 + .margin({bottom:64})
289 } 305 }
290 - }.margin({bottom:20}) 306 + }
  307 + // .margin({bottom:64})
291 } 308 }
292 .backgroundColor($r('app.color.color_fff')) 309 .backgroundColor($r('app.color.color_fff'))
293 } 310 }
@@ -408,13 +425,13 @@ export struct FeedBackActivity { @@ -408,13 +425,13 @@ export struct FeedBackActivity {
408 }) 425 })
409 }else{ 426 }else{
410 // 427 //
411 - ToastUtils.shortToast($r('app.string.feedback_opinion_type')) 428 + this.showToastTip($r('app.string.feedback_opinion_type'))
412 TrackingButton.click('feedbackPageSubmitFeedback',TrackConstants.PageName.FeedbackPage,TrackConstants.PageName.FeedbackPage) 429 TrackingButton.click('feedbackPageSubmitFeedback',TrackConstants.PageName.FeedbackPage,TrackConstants.PageName.FeedbackPage)
413 return 430 return
414 } 431 }
415 //内容必填 432 //内容必填
416 if(StringUtils.isEmpty(this.editValue.classifyName) || this.editValue.classifyName.length < 10 || this.editValue.classifyName.length>500){ 433 if(StringUtils.isEmpty(this.editValue.classifyName) || this.editValue.classifyName.length < 10 || this.editValue.classifyName.length>500){
417 - ToastUtils.shortToast($r('app.string.res_feedback_commentsFail')) 434 + this.showToastTip($r('app.string.res_feedback_commentsFail'))
418 return 435 return
419 } 436 }
420 437
@@ -457,4 +474,9 @@ export struct FeedBackActivity { @@ -457,4 +474,9 @@ export struct FeedBackActivity {
457 TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.FeedbackPage,TrackConstants.PageName.FeedbackPage,Math.floor((DateTimeUtils.getTimeStamp() - this.pageShowTime)/1000)) 474 TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.FeedbackPage,TrackConstants.PageName.FeedbackPage,Math.floor((DateTimeUtils.getTimeStamp() - this.pageShowTime)/1000))
458 475
459 } 476 }
  477 +
  478 + showToastTip(msg:ResourceStr){
  479 + this.toastText = msg
  480 + this.dialogToast.open()
  481 + }
460 } 482 }
@@ -88,7 +88,7 @@ export struct Card6Component { @@ -88,7 +88,7 @@ export struct Card6Component {
88 .fontSize(18) 88 .fontSize(18)
89 .lineHeight(27) 89 .lineHeight(27)
90 .fontWeight(FontWeight.Normal) 90 .fontWeight(FontWeight.Normal)
91 - .maxLines(2) 91 + .maxLines(this.contentDTO.appStyle === '6' ? 5 : 2)
92 .alignSelf(ItemAlign.Start) 92 .alignSelf(ItemAlign.Start)
93 .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。 93 .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。
94 .textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 && 94 .textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 &&
@@ -11,6 +11,7 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; @@ -11,6 +11,7 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
11 import NoMoreLayout from '../../page/NoMoreLayout'; 11 import NoMoreLayout from '../../page/NoMoreLayout';
12 import { EmptyComponent } from '../../view/EmptyComponent'; 12 import { EmptyComponent } from '../../view/EmptyComponent';
13 import { ContentDetailDTO, Params } from 'wdBean/Index'; 13 import { ContentDetailDTO, Params } from 'wdBean/Index';
  14 +import { TrackingContent, TrackParamConvert } from 'wdTracking/Index';
14 15
15 const TAG = 'CommentComponent'; 16 const TAG = 'CommentComponent';
16 17
@@ -31,6 +32,8 @@ export struct CommentComponent { @@ -31,6 +32,8 @@ export struct CommentComponent {
31 /*必传*/ 32 /*必传*/
32 @ObjectLink publishCommentModel: publishCommentModel 33 @ObjectLink publishCommentModel: publishCommentModel
33 @Consume contentDetailData: ContentDetailDTO 34 @Consume contentDetailData: ContentDetailDTO
  35 + @Consume pageId: string
  36 + @Consume pageName: string
34 listScroller: ListScroller = new ListScroller(); // scroller控制器 37 listScroller: ListScroller = new ListScroller(); // scroller控制器
35 historyOffset: number = 0; // 上次浏览到列表距离顶端的偏移量offset 38 historyOffset: number = 0; // 上次浏览到列表距离顶端的偏移量offset
36 @State allDatas: LazyDataSource<commentItemModel> = new LazyDataSource(); 39 @State allDatas: LazyDataSource<commentItemModel> = new LazyDataSource();
@@ -66,6 +69,9 @@ export struct CommentComponent { @@ -66,6 +69,9 @@ export struct CommentComponent {
66 69
67 this.dialogController = new CustomDialogController({ 70 this.dialogController = new CustomDialogController({
68 builder: CommentCustomDialog({ 71 builder: CommentCustomDialog({
  72 + onPublishBtnClickTrack: () => {
  73 + TrackingContent.commentClick(this.pageId, this.pageName, TrackParamConvert.contentDetail(this.contentDetailData))
  74 + },
69 confirm: (value: Record<string, string>) => { 75 confirm: (value: Record<string, string>) => {
70 this.addCommentLocal() 76 this.addCommentLocal()
71 }, 77 },
@@ -222,6 +228,7 @@ export struct CommentComponent { @@ -222,6 +228,7 @@ export struct CommentComponent {
222 } 228 }
223 } 229 }
224 } 230 }
  231 + .scrollBar(BarState.Off)
225 .margin({ bottom: 10 }) 232 .margin({ bottom: 10 })
226 .onReachEnd(() => { 233 .onReachEnd(() => {
227 if (!this.fixedHeightMode) { 234 if (!this.fixedHeightMode) {
@@ -22,6 +22,7 @@ export struct CommentCustomDialog { @@ -22,6 +22,7 @@ export struct CommentCustomDialog {
22 22
23 // confirm 表示内部处理调用 内容评论接口 发布了评论并成功,上层只需要 通过 publishCommentModel.lastCommentModel 即可获取最新已提交的评论 23 // confirm 表示内部处理调用 内容评论接口 发布了评论并成功,上层只需要 通过 publishCommentModel.lastCommentModel 即可获取最新已提交的评论
24 confirm?: (value: Record<string, string>) => void 24 confirm?: (value: Record<string, string>) => void
  25 + onPublishBtnClickTrack?: () => void // 和confirm配套使用。当设置了onPublishBtnClick 则无效
25 26
26 @State private emojiSwitch: boolean = false 27 @State private emojiSwitch: boolean = false
27 textInputController: TextAreaController = new TextAreaController() 28 textInputController: TextAreaController = new TextAreaController()
@@ -39,6 +40,11 @@ export struct CommentCustomDialog { @@ -39,6 +40,11 @@ export struct CommentCustomDialog {
39 } 40 }
40 } 41 }
41 42
  43 + // 点击时 即可埋点
  44 + if (this.onPublishBtnClickTrack) {
  45 + this.onPublishBtnClickTrack()
  46 + }
  47 +
42 let bean: Record<string, string> = {}; 48 let bean: Record<string, string> = {};
43 // this.publishCommentModel.commentContent = this.commentText 49 // this.publishCommentModel.commentContent = this.commentText
44 //TODO 判断类型 50 //TODO 判断类型
@@ -5,6 +5,7 @@ import measure from '@ohos.measure' @@ -5,6 +5,7 @@ import measure from '@ohos.measure'
5 import { ContentDetailDTO } from 'wdBean/Index' 5 import { ContentDetailDTO } from 'wdBean/Index'
6 import { HttpUtils } from 'wdNetwork/Index' 6 import { HttpUtils } from 'wdNetwork/Index'
7 import { WDRouterPage, WDRouterRule } from 'wdRouter/Index' 7 import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'
  8 +import { TrackingContent, TrackParamConvert } from 'wdTracking/Index'
8 9
9 @Preview 10 @Preview
10 @Component 11 @Component
@@ -20,6 +21,8 @@ export struct CommentTabComponent { @@ -20,6 +21,8 @@ export struct CommentTabComponent {
20 @State type: number = 1 21 @State type: number = 1
21 @State placeHolder: string = '说两句...' 22 @State placeHolder: string = '说两句...'
22 @State dialogController: CustomDialogController | null = null; 23 @State dialogController: CustomDialogController | null = null;
  24 + @Consume pageId: string
  25 + @Consume pageName: string
23 styleType: number = 1 //1: 白色背景(图文底部栏) 2: 黑色背景(图集底部栏) 26 styleType: number = 1 //1: 白色背景(图文底部栏) 2: 黑色背景(图集底部栏)
24 /*回调方法*/ 27 /*回调方法*/
25 dialogControllerConfirm: () => void = () => { 28 dialogControllerConfirm: () => void = () => {
@@ -29,6 +32,9 @@ export struct CommentTabComponent { @@ -29,6 +32,9 @@ export struct CommentTabComponent {
29 32
30 this.dialogController = new CustomDialogController({ 33 this.dialogController = new CustomDialogController({
31 builder: CommentCustomDialog({ 34 builder: CommentCustomDialog({
  35 + onPublishBtnClickTrack: () => {
  36 + TrackingContent.commentClick(this.pageId, this.pageName, TrackParamConvert.contentDetail(this.contentDetail))
  37 + },
32 confirm: (value: Record<string, string>) => { 38 confirm: (value: Record<string, string>) => {
33 this.dialogControllerConfirm(); 39 this.dialogControllerConfirm();
34 EmitterUtils.sendEvent(EmitterEventId.COMMENT_PUBLISH, this.publishCommentModel.targetId) 40 EmitterUtils.sendEvent(EmitterEventId.COMMENT_PUBLISH, this.publishCommentModel.targetId)
@@ -11,6 +11,7 @@ import { CommentCustomDialog } from './CommentCustomDialog' @@ -11,6 +11,7 @@ import { CommentCustomDialog } from './CommentCustomDialog'
11 import { publishCommentModel } from '../model/PublishCommentModel' 11 import { publishCommentModel } from '../model/PublishCommentModel'
12 import { ProcessUtils, WDRouterPage, WDRouterRule } from 'wdRouter/Index' 12 import { ProcessUtils, WDRouterPage, WDRouterRule } from 'wdRouter/Index'
13 import { ContentDTO, MasterDetailRes } from 'wdBean/Index' 13 import { ContentDTO, MasterDetailRes } from 'wdBean/Index'
  14 +import { TrackConstants, TrackingContent } from 'wdTracking/Index'
14 15
15 const TAG = 'QualityCommentsComponent'; 16 const TAG = 'QualityCommentsComponent';
16 17
@@ -34,6 +35,8 @@ export struct QualityCommentsComponent { @@ -34,6 +35,8 @@ export struct QualityCommentsComponent {
34 /*必传*/ 35 /*必传*/
35 @State publishCommentModel: publishCommentModel = new publishCommentModel() 36 @State publishCommentModel: publishCommentModel = new publishCommentModel()
36 37
  38 + // @Consume pageName: string
  39 +
37 aboutToDisappear(): void { 40 aboutToDisappear(): void {
38 // windowClass.setWindowSystemBarProperties({ statusBarColor: '#000' }) 41 // windowClass.setWindowSystemBarProperties({ statusBarColor: '#000' })
39 this.dialogController = null // 将dialogController置空 42 this.dialogController = null // 将dialogController置空
@@ -57,6 +60,9 @@ export struct QualityCommentsComponent { @@ -57,6 +60,9 @@ export struct QualityCommentsComponent {
57 showAlert() { 60 showAlert() {
58 this.dialogController = new CustomDialogController({ 61 this.dialogController = new CustomDialogController({
59 builder: CommentCustomDialog({ 62 builder: CommentCustomDialog({
  63 + onPublishBtnClickTrack: () => {
  64 + //TrackingContent.commentClick(this.pageName, this.pageName,{})
  65 + },
60 confirm: (value: Record<string, string>) => { 66 confirm: (value: Record<string, string>) => {
61 67
62 }, 68 },
@@ -189,11 +189,6 @@ class CommentViewModel { @@ -189,11 +189,6 @@ class CommentViewModel {
189 } 189 }
190 190
191 HttpRequest.post<ResponseDTO<commentItemModel>>(url, bean).then((data: ResponseDTO<commentItemModel>) => { 191 HttpRequest.post<ResponseDTO<commentItemModel>>(url, bean).then((data: ResponseDTO<commentItemModel>) => {
192 - // fixme 埋点 评论发布点击  
193 - TrackingContent.commentClick(pageId,pageName  
194 - ,{  
195 - 'duration':0,  
196 - })  
197 if (data.code != 0) { 192 if (data.code != 0) {
198 ToastUtils.showToast(data.message, 1000); 193 ToastUtils.showToast(data.message, 1000);
199 fail() 194 fail()
@@ -46,7 +46,7 @@ export struct ZhGridLayout03 { @@ -46,7 +46,7 @@ export struct ZhGridLayout03 {
46 left: $r('app.float.card_comp_pagePadding_lf'), 46 left: $r('app.float.card_comp_pagePadding_lf'),
47 right: $r('app.float.card_comp_pagePadding_lf'), 47 right: $r('app.float.card_comp_pagePadding_lf'),
48 top: $r('app.float.card_comp_pagePadding_tb'), 48 top: $r('app.float.card_comp_pagePadding_tb'),
49 - bottom: $r('app.float.card_comp_pagePadding_tb') 49 + bottom: '0vp'
50 }) 50 })
51 } 51 }
52 52
@@ -54,8 +54,7 @@ export struct ZhSingleRow02 { @@ -54,8 +54,7 @@ export struct ZhSingleRow02 {
54 54
55 resetEdgeAnimation() { 55 resetEdgeAnimation() {
56 if (this.moreWidth > this.initMoreWidth) { 56 if (this.moreWidth > this.initMoreWidth) {
57 - this.moreWidth = this.moreWidth - 1  
58 - this.resetEdgeAnimation(); 57 + this.moreWidth = 16
59 } 58 }
60 this.resetMoreTips() 59 this.resetMoreTips()
61 } 60 }
@@ -91,21 +90,30 @@ export struct ZhSingleRow02 { @@ -91,21 +90,30 @@ export struct ZhSingleRow02 {
91 .margin({ right: 8 }) 90 .margin({ right: 8 })
92 }) 91 })
93 } 92 }
94 - if (this.compDTO.operDataList.length >= 2) {  
95 - Column() {  
96 - if (this.moreWidth > this.initMoreWidth + 2) {  
97 - Text(this.moreTips)  
98 - .fontSize(8)  
99 - .fontColor(0x858585)  
100 - .width(8) 93 + if (this.compDTO.operDataList.length >= 2 && (this.compDTO?.objectType === '0' || this.compDTO?.objectType === '')) {
  94 + Row() {
  95 + Ellipse()
  96 + .width(2* (this.moreWidth - this.initMoreWidth - 1))
  97 + .height('100%')
  98 + .fill(0xe9e9e9)
  99 + .position({ left: -(this.moreWidth - this.initMoreWidth - 3) * 0.8 , top: 0 })
  100 +
  101 + Column() {
  102 + if (this.moreWidth > this.initMoreWidth + 2) {
  103 + Text(this.moreTips)
  104 + .fontSize(8)
  105 + .fontColor(0x858585)
  106 + .width(8)
  107 + }
101 } 108 }
  109 + .justifyContent(FlexAlign.Center)
  110 + .align(Alignment.Center)
  111 + .height('100%')
  112 + .width(this.initMoreWidth)
  113 + .backgroundColor(0xe9e9e9)
  114 + .borderRadius({ topLeft: 5, bottomLeft: 5 })
102 } 115 }
103 - .justifyContent(FlexAlign.Center)  
104 - .align(Alignment.Center)  
105 - .height('100%')  
106 - .width(this.moreWidth)  
107 - .backgroundColor(0xe9e9e9)  
108 - .borderRadius({ topLeft: 5, bottomLeft: 5 }) 116 + .margin({left: 1.5 * (this.moreWidth - this.initMoreWidth)})
109 } 117 }
110 } 118 }
111 } 119 }
1 -import { CompDTO, ContentDTO, Params, Action, ReserveItemBean} from 'wdBean'; 1 +import { CompDTO, ContentDTO, Params, Action, ReserveItemBean, PageTrackBean} from 'wdBean';
2 import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; 2 import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
3 import { postInteractAccentionOperateParams } from 'wdBean'; 3 import { postInteractAccentionOperateParams } from 'wdBean';
4 import { PageRepository } from '../../repository/PageRepository'; 4 import { PageRepository } from '../../repository/PageRepository';
@@ -78,8 +78,7 @@ export struct ZhSingleRow03 { @@ -78,8 +78,7 @@ export struct ZhSingleRow03 {
78 78
79 resetEdgeAnimation() { 79 resetEdgeAnimation() {
80 if (this.moreWidth > this.initMoreWidth) { 80 if (this.moreWidth > this.initMoreWidth) {
81 - this.moreWidth = this.moreWidth - 1  
82 - this.resetEdgeAnimation(); 81 + this.moreWidth = 16
83 } 82 }
84 this.resetMoreTips() 83 this.resetMoreTips()
85 } 84 }
@@ -166,21 +165,30 @@ export struct ZhSingleRow03 { @@ -166,21 +165,30 @@ export struct ZhSingleRow03 {
166 this.ItemCard(item) 165 this.ItemCard(item)
167 }) 166 })
168 } 167 }
169 - if (this.compDTO.operDataList.length >= 2) {  
170 - Column() {  
171 - if (this.moreWidth > this.initMoreWidth + 2) {  
172 - Text(this.moreTips)  
173 - .fontSize(8)  
174 - .fontColor(0x858585)  
175 - .width(8) 168 + if (this.compDTO.operDataList.length >= 2 && (this.compDTO?.objectType === '0' || this.compDTO?.objectType === '')) {
  169 + Row() {
  170 + Ellipse()
  171 + .width(2* (this.moreWidth - this.initMoreWidth - 1))
  172 + .height(116)
  173 + .fill(0xf9f9f9)
  174 + .position({ left: -(this.moreWidth - this.initMoreWidth - 3) * 0.8 , top: 0 })
  175 +
  176 + Column() {
  177 + if (this.moreWidth > this.initMoreWidth + 2) {
  178 + Text(this.moreTips)
  179 + .fontSize(8)
  180 + .fontColor(0x858585)
  181 + .width(8)
  182 + }
176 } 183 }
  184 + .justifyContent(FlexAlign.Center)
  185 + .align(Alignment.Center)
  186 + .height(116)
  187 + .width(this.initMoreWidth)
  188 + .backgroundColor(0xf9f9f9)
  189 + .borderRadius({ topLeft: 5, bottomLeft: 5 })
177 } 190 }
178 - .justifyContent(FlexAlign.Center)  
179 - .align(Alignment.Center)  
180 - .width(this.moreWidth)  
181 - .backgroundColor(0xf9f9f9)  
182 - .borderRadius({ topLeft: 5, bottomLeft: 5 })  
183 - .height(116) 191 + .margin({left: 1.5 * (this.moreWidth - this.initMoreWidth)})
184 } 192 }
185 } 193 }
186 } 194 }
@@ -268,7 +276,29 @@ export struct ZhSingleRow03 { @@ -268,7 +276,29 @@ export struct ZhSingleRow03 {
268 .textAlign(TextAlign.Center) 276 .textAlign(TextAlign.Center)
269 .borderRadius(3) 277 .borderRadius(3)
270 .onClick(() => { 278 .onClick(() => {
271 - this.bookAndCancel(item.relId, item.objectId, !this.isReserved(Number(item.objectId))) 279 +
  280 + const isSubscribe = !this.isReserved(Number(item.objectId))
  281 +
  282 + // 直播预约埋点
  283 + const params: ParamType = {
  284 + 'contentName': item.newsTitle,
  285 + 'contentType': item.objectType,
  286 + "liveStreamType": item?.liveInfo.vrType === 0 ? 1 : 2,
  287 + "vliveId": item.objectId,
  288 + "vliveName": item.newsTitle,
  289 + "contentId": item.objectId,
  290 + "compId": item.relId,
  291 + "contentStyle": item.appStyle,
  292 + "liveType": getLiveState(item),
  293 + 'contentShowChannelId': item.channelId,
  294 + 'linkUrl': item.linkUrl,
  295 + "pageId": this.pageId,
  296 + "pageName": this.pageName,
  297 + }
  298 + Logger.info(TAG, `直播预约埋点: ${JSON.stringify(params)}`);
  299 + Tracking.event(isSubscribe? "live_subscribe_click": "cancel_live_subscribe_click", params)
  300 +
  301 + this.bookAndCancel(item.relId, item.objectId, isSubscribe)
272 }) 302 })
273 303
274 } 304 }
@@ -371,18 +401,20 @@ export struct ZhSingleRow03 { @@ -371,18 +401,20 @@ export struct ZhSingleRow03 {
371 .fontWeight(600) 401 .fontWeight(600)
372 } 402 }
373 403
374 - Row() {  
375 - Text("更多")  
376 - .fontSize($r("app.float.font_size_14"))  
377 - .fontColor($r("app.color.color_999999"))  
378 - .margin({ right: 1 })  
379 - Image($r("app.media.more"))  
380 - .width(14)  
381 - .height(14) 404 + if (this.compDTO?.objectType === '0' || this.compDTO?.objectType === '') {
  405 + Row() {
  406 + Text("更多")
  407 + .fontSize($r("app.float.font_size_14"))
  408 + .fontColor($r("app.color.color_999999"))
  409 + .margin({ right: 1 })
  410 + Image($r("app.media.more"))
  411 + .width(14)
  412 + .height(14)
  413 + }
  414 + .onClick(() => {
  415 + this.jumpToMore();
  416 + })
382 } 417 }
383 - .onClick(() => {  
384 - this.jumpToMore();  
385 - })  
386 } 418 }
387 .justifyContent(FlexAlign.SpaceBetween) 419 .justifyContent(FlexAlign.SpaceBetween)
388 .margin({ top: 8, bottom: 8 }) 420 .margin({ top: 8, bottom: 8 })
@@ -231,13 +231,10 @@ export struct FollowListDetailUI { @@ -231,13 +231,10 @@ export struct FollowListDetailUI {
231 value.forEach((item) => { 231 value.forEach((item) => {
232 if (data.creatorId == item.creatorId) { 232 if (data.creatorId == item.creatorId) {
233 data.headPhotoUrl = item.headPhotoUrl 233 data.headPhotoUrl = item.headPhotoUrl
234 - if (item.fansNum > 10000) {  
235 - let temp = (item.fansNum / 10000) + ""  
236 - let index = temp.indexOf('.')  
237 - if (index != -1) {  
238 - temp = temp.substring(0, index + 2)  
239 - } else {  
240 - temp = temp 234 + if (item.fansNum >= 10000) {
  235 + let temp = (item.fansNum / 10000) .toFixed(1)
  236 + if (Number(temp.substring(temp.length-1)) == 0) {
  237 + temp = temp.substring(0, temp.length-2)
241 } 238 }
242 data.cnFansNum = temp + "万" 239 data.cnFansNum = temp + "万"
243 } else { 240 } else {
@@ -207,13 +207,10 @@ export struct HomePageBottomFollowComponent { @@ -207,13 +207,10 @@ export struct HomePageBottomFollowComponent {
207 value.list.forEach((value) => { 207 value.list.forEach((value) => {
208 let fansNum: number = value.fansNum 208 let fansNum: number = value.fansNum
209 let fansNumString = "" 209 let fansNumString = ""
210 - if (fansNum > 10000) {  
211 - let temp = (fansNum / 10000) + ""  
212 - let index = temp.indexOf('.')  
213 - if (index != -1) {  
214 - temp = temp.substring(0, index + 2)  
215 - } else {  
216 - temp = temp 210 + if (fansNum >= 10000) {
  211 + let temp = (fansNum / 10000) .toFixed(1)
  212 + if (Number(temp.substring(temp.length-1)) == 0) {
  213 + temp = temp.substring(0, temp.length-2)
217 } 214 }
218 fansNumString = temp + "万" 215 fansNumString = temp + "万"
219 } else { 216 } else {
@@ -168,7 +168,18 @@ export struct OtherHomePageBottomFollowComponent{ @@ -168,7 +168,18 @@ export struct OtherHomePageBottomFollowComponent{
168 this.hasMore = false 168 this.hasMore = false
169 }else{ 169 }else{
170 value.list.forEach((value)=>{ 170 value.list.forEach((value)=>{
171 - this.data_follow.push(new FollowListDetailItem(value.attentionHeadPhotoUrl,value.attentionUserName,value.fansNum+"",value.introduction,value.attentionCreatorId,"1",value.attentionUserId,value.cnUserType,value.cnUserId,value.mainControl,value.banControl,value.authIcon)) 171 + let fansNum: number = value.fansNum
  172 + let fansNumString = ""
  173 + if (fansNum >= 10000) {
  174 + let temp = (fansNum / 10000) .toFixed(1)
  175 + if (Number(temp.substring(temp.length-1)) == 0) {
  176 + temp = temp.substring(0, temp.length-2)
  177 + }
  178 + fansNumString = temp + "万"
  179 + } else {
  180 + fansNumString = fansNum + ""
  181 + }
  182 + this.data_follow.push(new FollowListDetailItem(value.attentionHeadPhotoUrl,value.attentionUserName,fansNumString,value.introduction,value.attentionCreatorId,"1",value.attentionUserId,value.cnUserType,value.cnUserId,value.mainControl,value.banControl,value.authIcon))
172 }) 183 })
173 this.data_follow.notifyDataReload() 184 this.data_follow.notifyDataReload()
174 this.count = this.data_follow.totalCount() 185 this.count = this.data_follow.totalCount()
@@ -5,7 +5,7 @@ import PageModel from '../../viewmodel/PageModel'; @@ -5,7 +5,7 @@ import PageModel from '../../viewmodel/PageModel';
5 import { autoRefresh, onActionEnd, onActionStart, onActionUpdate } from '../../utils/PullDownRefresh'; 5 import { autoRefresh, onActionEnd, onActionStart, onActionUpdate } from '../../utils/PullDownRefresh';
6 import LoadMoreLayout from './LoadMoreLayout'; 6 import LoadMoreLayout from './LoadMoreLayout';
7 import { CompParser } from '../CompParser'; 7 import { CompParser } from '../CompParser';
8 -import { CompDTO } from 'wdBean'; 8 +import { CompDTO, PageTrackBean } from 'wdBean';
9 import PageHelper from '../../viewmodel/PageHelper'; 9 import PageHelper from '../../viewmodel/PageHelper';
10 import { channelSkeleton } from '../skeleton/channelSkeleton' 10 import { channelSkeleton } from '../skeleton/channelSkeleton'
11 import { ProcessUtils } from 'wdRouter/Index'; 11 import { ProcessUtils } from 'wdRouter/Index';
@@ -30,6 +30,13 @@ export struct PageComponent { @@ -30,6 +30,13 @@ export struct PageComponent {
30 private listScroller: Scroller = new Scroller(); 30 private listScroller: Scroller = new Scroller();
31 private panOption: PanGestureOptions = new PanGestureOptions({ direction: PanDirection.Up | PanDirection.Down }) 31 private panOption: PanGestureOptions = new PanGestureOptions({ direction: PanDirection.Up | PanDirection.Down })
32 needload: boolean = true; 32 needload: boolean = true;
  33 + // page相关埋点数据,各组件需要,自行取用
  34 + // @Provide 暂不能用Provide、Consume,(别的用到组件样式的页面,都需要加provide,否则会crash,暂不用这种方案。待优化)
  35 + /**
  36 + * @deprecated
  37 + */
  38 + private pageTrackBean: PageTrackBean = new PageTrackBean()
  39 +
33 build() { 40 build() {
34 Column() { 41 Column() {
35 if (this.pageModel.viewType == ViewType.LOADING) { 42 if (this.pageModel.viewType == ViewType.LOADING) {
@@ -265,8 +272,14 @@ export struct PageComponent { @@ -265,8 +272,14 @@ export struct PageComponent {
265 this.pageModel.channelId = this.channelId; 272 this.pageModel.channelId = this.channelId;
266 this.pageModel.currentPage = 1; 273 this.pageModel.currentPage = 1;
267 this.pageModel.pageTotalCompSize = 0; 274 this.pageModel.pageTotalCompSize = 0;
268 - PageHelper.getInitCacheData(this.pageModel, this.pageAdvModel)  
269 - PageHelper.getInitData(this.pageModel, this.pageAdvModel) 275 + PageHelper.getInitCacheData(this.pageModel, this.pageAdvModel).then(() => {
  276 + this.pageTrackBean.pageId = this.pageId
  277 + this.pageTrackBean.pageName = this.pageModel.pageInfo.name
  278 + })
  279 + PageHelper.getInitData(this.pageModel, this.pageAdvModel).then(() => {
  280 + this.pageTrackBean.pageId = this.pageId
  281 + this.pageTrackBean.pageName = this.pageModel.pageInfo.name
  282 + })
270 }, 100) 283 }, 100)
271 } 284 }
272 } 285 }
1 -import { DateTimeUtils, PermissionUtil } from 'wdKit' 1 +import { BreakpointSystem, DateTimeUtils, PermissionUtil } from 'wdKit'
2 import { PrivacySettingModel } from '../../model/PrivacySettingModel' 2 import { PrivacySettingModel } from '../../model/PrivacySettingModel'
3 import { Params } from 'wdBean'; 3 import { Params } from 'wdBean';
4 import { WDRouterPage, WDRouterRule } from 'wdRouter'; 4 import { WDRouterPage, WDRouterRule } from 'wdRouter';
5 import { HttpUtils } from 'wdNetwork/Index'; 5 import { HttpUtils } from 'wdNetwork/Index';
6 import { TrackingPageBrowse, TrackConstants, TrackingButton } from 'wdTracking/Index'; 6 import { TrackingPageBrowse, TrackConstants, TrackingButton } from 'wdTracking/Index';
  7 +import { TitleBackComponent } from '../setting/TitleBackComponent';
7 8
8 const TAG = 'PrivacySettingPage'; 9 const TAG = 'PrivacySettingPage';
9 const DiyString = '开启个性化推荐' 10 const DiyString = '开启个性化推荐'
@@ -18,6 +19,17 @@ export struct PrivacySettingPage { @@ -18,6 +19,17 @@ export struct PrivacySettingPage {
18 tipsEnd = '中相应权限使用规则' 19 tipsEnd = '中相应权限使用规则'
19 pageShowTime:number = 0; 20 pageShowTime:number = 0;
20 pageHideTime:number = 0; 21 pageHideTime:number = 0;
  22 + @StorageProp('currentBreakpoint') @Watch("currentChanged")currentBreakpoint: string = 'sm';
  23 + private breakpointSystem = new BreakpointSystem();
  24 + @State percent:number = 1
  25 +
  26 + currentChanged(){
  27 + if(this.currentBreakpoint == "md" || this.currentBreakpoint == "lg"){
  28 + this.percent = 0.7
  29 + }else {
  30 + this.percent = 1
  31 + }
  32 + }
21 33
22 onPageShow(): void { 34 onPageShow(): void {
23 this.getPermissionStatus(); 35 this.getPermissionStatus();
@@ -32,6 +44,8 @@ export struct PrivacySettingPage { @@ -32,6 +44,8 @@ export struct PrivacySettingPage {
32 } 44 }
33 45
34 aboutToAppear() { 46 aboutToAppear() {
  47 + this.breakpointSystem.register();
  48 + this.currentChanged()
35 if (!HttpUtils.getUserId()) { 49 if (!HttpUtils.getUserId()) {
36 this.listData.splice(0, 1); 50 this.listData.splice(0, 1);
37 } 51 }
@@ -43,6 +57,10 @@ export struct PrivacySettingPage { @@ -43,6 +57,10 @@ export struct PrivacySettingPage {
43 57
44 } 58 }
45 59
  60 + aboutToDisappear(): void {
  61 + this.breakpointSystem.unregister();
  62 + }
  63 +
46 async getPermissionStatus() { 64 async getPermissionStatus() {
47 const permissionUtil = new PermissionUtil(); 65 const permissionUtil = new PermissionUtil();
48 for (const element of this.listData) { 66 for (const element of this.listData) {
@@ -57,25 +75,27 @@ export struct PrivacySettingPage { @@ -57,25 +75,27 @@ export struct PrivacySettingPage {
57 } 75 }
58 76
59 build() { 77 build() {
60 - Navigation() { 78 + Column(){
  79 + TitleBackComponent({title:"隐私设置"})
  80 +
61 //滑动区域 81 //滑动区域
62 this.PrivacySettingComponentsUI() 82 this.PrivacySettingComponentsUI()
  83 + }.backgroundColor('#F8F8F8')
  84 + .width("100%")
  85 + .height("100%")
63 86
64 - }.titleMode(NavigationTitleMode.Mini)  
65 - .title('隐私设置')  
66 - .backgroundColor('#F8F8F8')  
67 } 87 }
68 88
69 @Builder PrivacySettingComponentsUI() { 89 @Builder PrivacySettingComponentsUI() {
70 Column() { 90 Column() {
71 91
72 - List({ space: '23lpx' }) { 92 + List({ space: `${this.calcHeight(23)}lpx` }) {
73 ForEach(this.listData, (item: PrivacySettingModel, index:number) => { 93 ForEach(this.listData, (item: PrivacySettingModel, index:number) => {
74 ListItem() { 94 ListItem() {
75 if (item.privacyName == DiyString) { 95 if (item.privacyName == DiyString) {
76 - getTuiJianCell({ item:item, index:index }); 96 + getTuiJianCell({ item:item, index:index ,percent:$percent});
77 } else { 97 } else {
78 - getArrowCell({ item:item, index:index }); 98 + getArrowCell({ item:item, index:index ,percent:$percent});
79 } 99 }
80 }.onClick(() => { 100 }.onClick(() => {
81 if (item.privacyName == DiyString) { 101 if (item.privacyName == DiyString) {
@@ -103,32 +123,33 @@ export struct PrivacySettingPage { @@ -103,32 +123,33 @@ export struct PrivacySettingPage {
103 } 123 }
104 }) 124 })
105 }) 125 })
106 - }  
107 - .padding({ left: '29lpx', right: '29lpx' })  
108 - .margin({ top: '38lpx' }) 126 + }.width('100%')
  127 + .padding({ left: `${this.calcHeight(29)}lpx`, right: `${this.calcHeight(29)}lpx` })
  128 + .margin({ top: `${this.calcHeight(38)}lpx` })
  129 +
109 130
110 Row() { 131 Row() {
111 Text(this.tips) 132 Text(this.tips)
112 - .fontSize('25lpx') 133 + .fontSize(`${this.calcHeight(25)}lpx`)
113 .textAlign(TextAlign.Start) 134 .textAlign(TextAlign.Start)
114 .fontColor($r("app.color.color_666666")) 135 .fontColor($r("app.color.color_666666"))
115 - .margin({ left: '29lpx', top: '46lpx' }) 136 + .margin({ left: `${this.calcHeight(29)}lpx`, top: `${this.calcHeight(46)}lpx` })
116 // .backgroundColor(Color.Orange) 137 // .backgroundColor(Color.Orange)
117 Text(this.privacyTips) 138 Text(this.privacyTips)
118 - .fontSize('25lpx') 139 + .fontSize(`${this.calcHeight(25)}lpx`)
119 .textAlign(TextAlign.Start) 140 .textAlign(TextAlign.Start)
120 .fontColor('#ED2800') 141 .fontColor('#ED2800')
121 - .margin({ top: '46lpx' }) 142 + .margin({ top: `${this.calcHeight(46)}lpx` })
122 .onClick(() => { 143 .onClick(() => {
123 //跳转隐私政策 144 //跳转隐私政策
124 let bean={contentID:"2",pageID:""} as Params 145 let bean={contentID:"2",pageID:""} as Params
125 WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage,bean) 146 WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage,bean)
126 }) 147 })
127 Text(this.tipsEnd) 148 Text(this.tipsEnd)
128 - .fontSize('25lpx') 149 + .fontSize(`${this.calcHeight(25)}lpx`)
129 .textAlign(TextAlign.Start) 150 .textAlign(TextAlign.Start)
130 .fontColor($r("app.color.color_666666")) 151 .fontColor($r("app.color.color_666666"))
131 - .margin({ top: '46lpx' }) 152 + .margin({ top: `${this.calcHeight(46)}lpx` })
132 } 153 }
133 154
134 } 155 }
@@ -137,6 +158,10 @@ export struct PrivacySettingPage { @@ -137,6 +158,10 @@ export struct PrivacySettingPage {
137 .backgroundColor('#F8F8F8') 158 .backgroundColor('#F8F8F8')
138 .alignItems(HorizontalAlign.Start) 159 .alignItems(HorizontalAlign.Start)
139 } 160 }
  161 +
  162 + calcHeight(value:number): number{
  163 + return value * this.percent
  164 + }
140 } 165 }
141 166
142 167
@@ -144,6 +169,7 @@ export struct PrivacySettingPage { @@ -144,6 +169,7 @@ export struct PrivacySettingPage {
144 struct getArrowCell { 169 struct getArrowCell {
145 @ObjectLink item: PrivacySettingModel; 170 @ObjectLink item: PrivacySettingModel;
146 index:number = 0; 171 index:number = 0;
  172 + @Link percent:number
147 // 右文字+箭头cell 173 // 右文字+箭头cell
148 // @Builder getArrowCell(item:PrivacySettingModel, index) { 174 // @Builder getArrowCell(item:PrivacySettingModel, index) {
149 build() { 175 build() {
@@ -151,28 +177,32 @@ struct getArrowCell { @@ -151,28 +177,32 @@ struct getArrowCell {
151 // 左侧标题 177 // 左侧标题
152 Text(this.item.privacyName) 178 Text(this.item.privacyName)
153 .fontColor('#666666') 179 .fontColor('#666666')
154 - .fontSize('31lpx') 180 + .fontSize(`${this.calcHeight(31)}lpx`)
155 181
156 Row() { 182 Row() {
157 Text(this.item.permission ? '已开启' : '去设置') 183 Text(this.item.permission ? '已开启' : '去设置')
158 .fontColor(this.item.permission ? '#666666' : '#CCCCCC') 184 .fontColor(this.item.permission ? '#666666' : '#CCCCCC')
159 - .fontSize('31lpx')  
160 - .margin({ right: '8lpx' }) 185 + .fontSize(`${this.calcHeight(31)}lpx`)
  186 + .margin({ right: `${this.calcHeight(8)}lpx` })
161 187
162 Image($r('app.media.mine_user_arrow')) 188 Image($r('app.media.mine_user_arrow'))
163 - .width('27lpx')  
164 - .height('27lpx') 189 + .width(`${this.calcHeight(27)}lpx`)
  190 + .height(`${this.calcHeight(27)}lpx`)
165 .objectFit(ImageFit.Auto) 191 .objectFit(ImageFit.Auto)
166 } 192 }
167 193
168 } 194 }
169 .alignItems(VerticalAlign.Center) 195 .alignItems(VerticalAlign.Center)
170 .justifyContent(FlexAlign.SpaceBetween) 196 .justifyContent(FlexAlign.SpaceBetween)
171 - .height('97lpx') 197 + .height(`${this.calcHeight(97)}lpx`)
172 .width('100%') 198 .width('100%')
173 - .padding({ left: '29lpx', right: '29lpx' }) 199 + .padding({ left: `${this.calcHeight(29)}lpx`, right: `${this.calcHeight(29)}lpx` })
174 .backgroundColor('#FFFFFF') 200 .backgroundColor('#FFFFFF')
175 - .borderRadius('8lpx') 201 + .borderRadius(`${this.calcHeight(8)}lpx`)
  202 + }
  203 +
  204 + calcHeight(value:number): number{
  205 + return value * this.percent
176 } 206 }
177 } 207 }
178 208
@@ -180,6 +210,7 @@ struct getArrowCell { @@ -180,6 +210,7 @@ struct getArrowCell {
180 struct getTuiJianCell { 210 struct getTuiJianCell {
181 @ObjectLink item: PrivacySettingModel; 211 @ObjectLink item: PrivacySettingModel;
182 index:number = 0; 212 index:number = 0;
  213 + @Link percent:number
183 build() { 214 build() {
184 Column() { 215 Column() {
185 216
@@ -187,12 +218,12 @@ struct getTuiJianCell { @@ -187,12 +218,12 @@ struct getTuiJianCell {
187 // 左侧标题 218 // 左侧标题
188 Text(this.item.privacyName) 219 Text(this.item.privacyName)
189 .fontColor('#666666') 220 .fontColor('#666666')
190 - .fontSize('31lpx') 221 + .fontSize(`${this.calcHeight(31)}lpx`)
191 222
192 Row() { 223 Row() {
193 Toggle({ type: ToggleType.Switch, isOn: this.item.permission }) 224 Toggle({ type: ToggleType.Switch, isOn: this.item.permission })
194 - .height('58lpx')  
195 - .width('96lpx') 225 + .height(`${this.calcHeight(58)}lpx`)
  226 + .width(`${this.calcHeight(96)}lpx`)
196 .selectedColor('#ED2700') 227 .selectedColor('#ED2700')
197 .onChange((isOn: boolean) => { 228 .onChange((isOn: boolean) => {
198 // this.privacySwitch = isOn; 229 // this.privacySwitch = isOn;
@@ -203,25 +234,29 @@ struct getTuiJianCell { @@ -203,25 +234,29 @@ struct getTuiJianCell {
203 } 234 }
204 .alignItems(VerticalAlign.Center) 235 .alignItems(VerticalAlign.Center)
205 .justifyContent(FlexAlign.SpaceBetween) 236 .justifyContent(FlexAlign.SpaceBetween)
206 - .height('97lpx') 237 + .height(`${this.calcHeight(97)}lpx`)
207 .width('100%') 238 .width('100%')
208 239
209 240
210 Blank() 241 Blank()
211 .backgroundColor('#EDEDED') 242 .backgroundColor('#EDEDED')
212 - .height('1lpx') 243 + .height(`${this.calcHeight(1)}lpx`)
213 244
214 Text(DiyCloseTipsString) 245 Text(DiyCloseTipsString)
215 .fontColor('#999999') 246 .fontColor('#999999')
216 - .fontSize('23lpx')  
217 - .margin({ right: '8lpx' })  
218 - .height('69lpx') 247 + .fontSize(`${this.calcHeight(23)}lpx`)
  248 + .margin({ right: `${this.calcHeight(8)}lpx` })
  249 + .height(`${this.calcHeight(69)}lpx`)
219 250
220 - } 251 + }.width('100%')
221 .alignItems(HorizontalAlign.Start) 252 .alignItems(HorizontalAlign.Start)
222 .backgroundColor('#FFFFFF') 253 .backgroundColor('#FFFFFF')
223 - .borderRadius('8lpx')  
224 - .padding({ left: '29lpx', right: '29lpx' }) 254 + .borderRadius(`${this.calcHeight(8)}lpx`)
  255 + .padding({ left: `${this.calcHeight(29)}lpx`, right: `${this.calcHeight(29)}lpx` })
  256 + }
  257 +
  258 + calcHeight(value:number): number{
  259 + return value * this.percent
225 } 260 }
226 } 261 }
227 262
1 import { WindowModel } from 'wdKit/Index'; 1 import { WindowModel } from 'wdKit/Index';
  2 +import { TrackConstants } from 'wdTracking/Index';
2 import { QualityCommentsComponent } from '../comment/view/QualityCommentsComponent'; 3 import { QualityCommentsComponent } from '../comment/view/QualityCommentsComponent';
3 4
4 @Entry 5 @Entry
5 @Component 6 @Component
6 struct QualityCommentsPage { 7 struct QualityCommentsPage {
  8 + @Provide pageName: string = TrackConstants.PageName.Best_Comment
  9 + @Provide pageId: string = TrackConstants.PageName.Best_Comment
  10 +
7 onPageShow(): void { 11 onPageShow(): void {
8 // WindowModel.shared.setWindowLayoutFullScreen(true) 12 // WindowModel.shared.setWindowLayoutFullScreen(true)
9 } 13 }
@@ -23,6 +23,6 @@ struct SettingAboutPage { @@ -23,6 +23,6 @@ struct SettingAboutPage {
23 build() { 23 build() {
24 Column(){ 24 Column(){
25 AboutPageUI() 25 AboutPageUI()
26 - } 26 + }.backgroundColor($r('app.color.white'))
27 } 27 }
28 } 28 }
@@ -2,7 +2,7 @@ import { MineSettingComponent } from '../setting/MineSettingComponent'; @@ -2,7 +2,7 @@ import { MineSettingComponent } from '../setting/MineSettingComponent';
2 import { AccountAndSecurityLayout } from '../setting/AccountAndSecurityLayout'; 2 import { AccountAndSecurityLayout } from '../setting/AccountAndSecurityLayout';
3 import router from '@ohos.router'; 3 import router from '@ohos.router';
4 import { Params } from 'wdBean'; 4 import { Params } from 'wdBean';
5 -import { DateTimeUtils } from 'wdKit/Index'; 5 +import { BreakpointSystem, DateTimeUtils } from 'wdKit/Index';
6 import { TrackingPageBrowse, TrackConstants } from 'wdTracking/Index'; 6 import { TrackingPageBrowse, TrackConstants } from 'wdTracking/Index';
7 7
8 @Entry 8 @Entry
@@ -51,6 +51,7 @@ struct SettingPage { @@ -51,6 +51,7 @@ struct SettingPage {
51 AccountAndSecurityLayout({enterActivityTime:this.enterActivityTime}) 51 AccountAndSecurityLayout({enterActivityTime:this.enterActivityTime})
52 } 52 }
53 }.setFullWidth() 53 }.setFullWidth()
  54 + .backgroundColor($r("app.color.white"))
54 } 55 }
55 56
56 // 私有方法 57 // 私有方法
@@ -14,6 +14,7 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter' @@ -14,6 +14,7 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter'
14 import { LazyDataSource } from 'wdKit/Index'; 14 import { LazyDataSource } from 'wdKit/Index';
15 import LoadMoreLayout from '../page/LoadMoreLayout' 15 import LoadMoreLayout from '../page/LoadMoreLayout'
16 import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; 16 import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
  17 +import { TrackConstants, Tracking, TrackingContent, TrackingPageBrowse, TrackParamConvert } from 'wdTracking/Index';
17 18
18 const TAG: string = 'ReserveMorePage'; 19 const TAG: string = 'ReserveMorePage';
19 20
@@ -47,6 +48,9 @@ struct ReserveMorePage { @@ -47,6 +48,9 @@ struct ReserveMorePage {
47 @State private liveId: string = '' 48 @State private liveId: string = ''
48 @State isLoadingAttention: boolean = false 49 @State isLoadingAttention: boolean = false
49 @State loadImg: boolean = false; 50 @State loadImg: boolean = false;
  51 + private pageId: string = TrackConstants.PageName.Live_Appointment_List
  52 + private pageName: string = TrackConstants.PageName.Live_Appointment_List
  53 + private pageShowStartTime: number = 0
50 54
51 build() { 55 build() {
52 Column() { 56 Column() {
@@ -249,8 +253,24 @@ struct ReserveMorePage { @@ -249,8 +253,24 @@ struct ReserveMorePage {
249 top: index == 0 ? '12vp' : '8vp' 253 top: index == 0 ? '12vp' : '8vp'
250 }) 254 })
251 .onClick(() => { 255 .onClick(() => {
  256 +
  257 + // 内容点击埋点
  258 + TrackingContent.common(TrackConstants.EventType.Click,
  259 + item.pageId,
  260 + item.pageId,
  261 + TrackParamConvert.program(item))
  262 +
252 ProcessUtils.processPage(item) 263 ProcessUtils.processPage(item)
253 }) 264 })
  265 + .onVisibleAreaChange([0, 1], (isVisiable: boolean, ratio: number) => {
  266 + if (isVisiable) {
  267 + // 内容曝光埋点
  268 + TrackingContent.common(TrackConstants.EventType.Show,
  269 + item.pageId,
  270 + item.pageId,
  271 + TrackParamConvert.program(item))
  272 + }
  273 + })
254 } 274 }
255 275
256 /*导航栏*/ 276 /*导航栏*/
@@ -358,12 +378,18 @@ struct ReserveMorePage { @@ -358,12 +378,18 @@ struct ReserveMorePage {
358 } 378 }
359 379
360 onPageShow(): void { 380 onPageShow(): void {
  381 + this.pageShowStartTime = Date.now()
361 if (this.isShow) { 382 if (this.isShow) {
362 this.data.reloadData() 383 this.data.reloadData()
363 this.isShow = false 384 this.isShow = false
364 } 385 }
365 } 386 }
366 387
  388 + onPageHide(): void {
  389 + const duration = Date.now() - this.pageShowStartTime
  390 + TrackingPageBrowse.trackCommonPageExposureEnd(this.pageId, this.pageName, duration)
  391 + }
  392 +
367 private async getData(resolve?: (value: string | PromiseLike<string>) => void) { 393 private async getData(resolve?: (value: string | PromiseLike<string>) => void) {
368 if (this.isLoading) { 394 if (this.isLoading) {
369 if (resolve) { 395 if (resolve) {
@@ -386,6 +412,8 @@ struct ReserveMorePage { @@ -386,6 +412,8 @@ struct ReserveMorePage {
386 this.reserveList = [] 412 this.reserveList = []
387 this.reservedIds = [] 413 this.reservedIds = []
388 } 414 }
  415 +
  416 + liveReviewDTO.list.forEach((content) => { content.pageId = this.pageId })
389 this.data.push(...liveReviewDTO.list) 417 this.data.push(...liveReviewDTO.list)
390 //批量查询关注状态 418 //批量查询关注状态
391 this.getAppointmentInfo(liveReviewDTO.list) 419 this.getAppointmentInfo(liveReviewDTO.list)
@@ -488,6 +516,11 @@ struct ReserveMorePage { @@ -488,6 +516,11 @@ struct ReserveMorePage {
488 this.isLoadingAttention = true 516 this.isLoadingAttention = true
489 this.liveId = reserveItem.liveId.toString() 517 this.liveId = reserveItem.liveId.toString()
490 try { 518 try {
  519 +
  520 + // 埋点
  521 + Tracking.event(!reserveItem.subscribe ? "live_subscribe_click":"cancel_live_subscribe_click",
  522 + TrackParamConvert.program(item))
  523 +
491 const res = await LiveModel.liveAppointment(reserveItem.relationId, reserveItem.liveId.toString(), 524 const res = await LiveModel.liveAppointment(reserveItem.relationId, reserveItem.liveId.toString(),
492 !reserveItem.subscribe); 525 !reserveItem.subscribe);
493 if (res.code == 0) { 526 if (res.code == 0) {
@@ -4,14 +4,15 @@ import router from '@ohos.router' @@ -4,14 +4,15 @@ import router from '@ohos.router'
4 export struct CustomTitleUI { 4 export struct CustomTitleUI {
5 imgBack:boolean = true 5 imgBack:boolean = true
6 titleName:ResourceStr = "默认标题" 6 titleName:ResourceStr = "默认标题"
  7 + @Prop percent:number = 1
7 8
8 build() { 9 build() {
9 RelativeContainer() { 10 RelativeContainer() {
10 //标题栏目 11 //标题栏目
11 if(this.imgBack){ 12 if(this.imgBack){
12 Image($r('app.media.back_icon')) 13 Image($r('app.media.back_icon'))
13 - .width('46lpx')  
14 - .height('46lpx') 14 + .width(`${this.calcHeight(46)}lpx`)
  15 + .height(`${this.calcHeight(46)}lpx`)
15 .objectFit(ImageFit.Auto) 16 .objectFit(ImageFit.Auto)
16 .interpolation(ImageInterpolation.High) 17 .interpolation(ImageInterpolation.High)
17 .id("back_icon") 18 .id("back_icon")
@@ -19,7 +20,7 @@ export struct CustomTitleUI { @@ -19,7 +20,7 @@ export struct CustomTitleUI {
19 center: {anchor: "__container__", align: VerticalAlign.Center}, 20 center: {anchor: "__container__", align: VerticalAlign.Center},
20 left: {anchor: "__container__", align: HorizontalAlign.Start} 21 left: {anchor: "__container__", align: HorizontalAlign.Start}
21 }) 22 })
22 - .margin({left:'31lpx'}) 23 + .margin({left:`${this.calcHeight(31)}lpx`})
23 .onClick(()=>{ 24 .onClick(()=>{
24 router.back() 25 router.back()
25 }) 26 })
@@ -28,18 +29,22 @@ export struct CustomTitleUI { @@ -28,18 +29,22 @@ export struct CustomTitleUI {
28 Text(this.titleName) 29 Text(this.titleName)
29 .maxLines(1) 30 .maxLines(1)
30 .id("title") 31 .id("title")
31 - .fontSize('30lpx') 32 + .fontSize(`${this.calcHeight(30)}lpx`)
32 .fontWeight(400) 33 .fontWeight(400)
33 .fontColor($r('app.color.color_222222')) 34 .fontColor($r('app.color.color_222222'))
34 - .lineHeight('43lpx') 35 + .lineHeight(`${this.calcHeight(43)}lpx`)
35 .alignRules({ 36 .alignRules({
36 center: {anchor: "__container__", align: VerticalAlign.Center}, 37 center: {anchor: "__container__", align: VerticalAlign.Center},
37 middle: {anchor: "__container__", align: HorizontalAlign.Center} 38 middle: {anchor: "__container__", align: HorizontalAlign.Center}
38 }) 39 })
39 40
40 } 41 }
41 - .height('84lpx') 42 + .height(`${this.calcHeight(84)}lpx`)
42 .width('100%') 43 .width('100%')
43 .backgroundColor($r('app.color.white')) 44 .backgroundColor($r('app.color.white'))
44 } 45 }
  46 +
  47 + calcHeight(value:number): number{
  48 + return value * this.percent
  49 + }
45 } 50 }
1 import router from '@ohos.router' 1 import router from '@ohos.router'
2 -import { NetworkUtil, StringUtils, ToastUtils } from 'wdKit' 2 +import { BreakpointSystem, NetworkUtil, StringUtils, ToastUtils } from 'wdKit'
3 import { ParamType, TrackConstants, Tracking } from 'wdTracking/Index' 3 import { ParamType, TrackConstants, Tracking } from 'wdTracking/Index'
4 import SearcherAboutDataModel from '../../model/SearcherAboutDataModel' 4 import SearcherAboutDataModel from '../../model/SearcherAboutDataModel'
5 import { SearchHistoryItem } from '../../viewmodel/SearchHistoryItem' 5 import { SearchHistoryItem } from '../../viewmodel/SearchHistoryItem'
6 import { SearchRelatedItem } from '../../viewmodel/SearchRelatedItem' 6 import { SearchRelatedItem } from '../../viewmodel/SearchRelatedItem'
7 -import { EmptyComponent } from '../view/EmptyComponent'  
8 import { SearchHistoryComponent } from './SearchHistoryComponent' 7 import { SearchHistoryComponent } from './SearchHistoryComponent'
9 import { SearchHotsComponent } from './SearchHotsComponent' 8 import { SearchHotsComponent } from './SearchHotsComponent'
10 import { SearchRelatedComponent } from './SearchRelatedComponent' 9 import { SearchRelatedComponent } from './SearchRelatedComponent'
@@ -34,7 +33,22 @@ export struct SearchComponent { @@ -34,7 +33,22 @@ export struct SearchComponent {
34 @State isGetRequest:boolean = false 33 @State isGetRequest:boolean = false
35 @Link fromTabName: string 34 @Link fromTabName: string
36 35
  36 + @StorageProp('currentBreakpoint') @Watch("currentChanged")currentBreakpoint: string = 'sm';
  37 + private breakpointSystem = new BreakpointSystem();
  38 + @State percent:number = 1
  39 +
  40 + currentChanged(){
  41 + if(this.currentBreakpoint == "md" || this.currentBreakpoint == "lg"){
  42 + this.percent = 0.7
  43 + }else {
  44 + this.percent = 1
  45 + }
  46 + }
  47 +
  48 +
37 aboutToAppear() { 49 aboutToAppear() {
  50 + this.breakpointSystem.register();
  51 + this.currentChanged()
38 //获取提示滚动 52 //获取提示滚动
39 this.getSearchHint() 53 this.getSearchHint()
40 //清除缓存 54 //清除缓存
@@ -49,6 +63,11 @@ export struct SearchComponent { @@ -49,6 +63,11 @@ export struct SearchComponent {
49 }, 1000); 63 }, 1000);
50 } 64 }
51 65
  66 + aboutToDisappear(): void {
  67 + this.breakpointSystem.unregister();
  68 + }
  69 +
  70 +
52 getRelatedSearchContent() { 71 getRelatedSearchContent() {
53 if(StringUtils.isNotEmpty(this.searchText)){ 72 if(StringUtils.isNotEmpty(this.searchText)){
54 SearcherAboutDataModel.getRelatedSearchContentData(encodeURI(this.searchText),getContext(this)).then((value) => { 73 SearcherAboutDataModel.getRelatedSearchContentData(encodeURI(this.searchText),getContext(this)).then((value) => {
@@ -127,26 +146,26 @@ export struct SearchComponent { @@ -127,26 +146,26 @@ export struct SearchComponent {
127 Scroll(this.scroller) { 146 Scroll(this.scroller) {
128 Column() { 147 Column() {
129 if(this.searchHistoryData!=null && this.searchHistoryData.length>0){ 148 if(this.searchHistoryData!=null && this.searchHistoryData.length>0){
130 - SearchHistoryComponent({ searchHistoryData: $searchHistoryData, onDelHistory: (): void => this.getSearchHistoryData(),onGetSearchRes: (item,index): void => this.getSearchHistoryResData(item,index),onCloseInput : (): void => this.stopInput() }) 149 + SearchHistoryComponent({ searchHistoryData: $searchHistoryData, onDelHistory: (): void => this.getSearchHistoryData(),onGetSearchRes: (item,index): void => this.getSearchHistoryResData(item,index),onCloseInput : (): void => this.stopInput(),percent:this.percent })
131 } 150 }
132 151
133 if(this.searchHistoryData.length>0){ 152 if(this.searchHistoryData.length>0){
134 //分隔符 153 //分隔符
135 Divider() 154 Divider()
136 .width('100%') 155 .width('100%')
137 - .height('1lpx') 156 + .height(`${this.calcHeight(1)}lpx`)
138 .color($r('app.color.color_EDEDED')) 157 .color($r('app.color.color_EDEDED'))
139 - .strokeWidth('1lpx') 158 + .strokeWidth(`${this.calcHeight(1)}lpx`)
140 } 159 }
141 160
142 - SearchHotsComponent({onGetSearchRes: (item): void => this.getSearchHotResData(item)}) 161 + SearchHotsComponent({onGetSearchRes: (item): void => this.getSearchHotResData(item),percent:this.percent})
143 } 162 }
144 } 163 }
145 .scrollable(ScrollDirection.Vertical) 164 .scrollable(ScrollDirection.Vertical)
146 .scrollBar(BarState.Off) 165 .scrollBar(BarState.Off)
147 .width('100%') 166 .width('100%')
148 .height('100%') 167 .height('100%')
149 - .padding({ left: '31lpx', right: '31lpx' }) 168 + .padding({ left: `${this.calcHeight(31)}lpx`, right: `${this.calcHeight(31)}lpx` })
150 } else { 169 } else {
151 if (this.hasChooseSearch) { 170 if (this.hasChooseSearch) {
152 //搜索结果 171 //搜索结果
@@ -156,10 +175,10 @@ export struct SearchComponent { @@ -156,10 +175,10 @@ export struct SearchComponent {
156 this.getSearchHistoryData() 175 this.getSearchHistoryData()
157 this.getSearchInputResData(this.searchText) 176 this.getSearchInputResData(this.searchText)
158 } 177 }
159 - }}) 178 + },percent:this.percent})
160 } else { 179 } else {
161 //联想搜索 180 //联想搜索
162 - SearchRelatedComponent({relatedSearchContentData:$relatedSearchContentsData,onGetSearchRes: (item): void => this.getSearchRelatedResData(item),searchText:this.searchText}) 181 + SearchRelatedComponent({relatedSearchContentData:$relatedSearchContentsData,onGetSearchRes: (item): void => this.getSearchRelatedResData(item),searchText:this.searchText,percent:this.percent})
163 } 182 }
164 } 183 }
165 }.height('100%') 184 }.height('100%')
@@ -244,14 +263,14 @@ export struct SearchComponent { @@ -244,14 +263,14 @@ export struct SearchComponent {
244 Swiper(this.swiperController) { 263 Swiper(this.swiperController) {
245 ForEach(this.searchTextData, (item: string, index: number) => { 264 ForEach(this.searchTextData, (item: string, index: number) => {
246 Text(item) 265 Text(item)
247 - .fontWeight('400lpx')  
248 - .fontSize('25lpx') 266 + .fontWeight(400)
  267 + .fontSize(`${this.calcHeight(25)}lpx`)
249 .fontColor($r('app.color.color_666666')) 268 .fontColor($r('app.color.color_666666'))
250 - .lineHeight('35lpx') 269 + .lineHeight(`${this.calcHeight(35)}lpx`)
251 .textAlign(TextAlign.Start) 270 .textAlign(TextAlign.Start)
252 .maxLines(1) 271 .maxLines(1)
253 .textOverflow({ overflow: TextOverflow.Clip }) 272 .textOverflow({ overflow: TextOverflow.Clip })
254 - .margin({ left: '40lpx' }) 273 + .margin({ left: `${this.calcHeight(40)}lpx` })
255 }) 274 })
256 } 275 }
257 .loop(true) 276 .loop(true)
@@ -268,9 +287,9 @@ export struct SearchComponent { @@ -268,9 +287,9 @@ export struct SearchComponent {
268 Row(){ 287 Row(){
269 Search({ value: this.searchText, placeholder: '', controller: this.controller}) 288 Search({ value: this.searchText, placeholder: '', controller: this.controller})
270 .layoutWeight(1) 289 .layoutWeight(1)
271 - .height('69lpx') 290 + .height(`${this.calcHeight(69)}lpx`)
272 .backgroundColor($r('app.color.color_transparent')) 291 .backgroundColor($r('app.color.color_transparent'))
273 - .textFont({ size: "27lpx", weight: "400lpx" }) 292 + .textFont({ size: `${this.calcHeight(27)}lpx`, weight: 400 })
274 // .defaultFocus(true) 293 // .defaultFocus(true)
275 .id("searchId") 294 .id("searchId")
276 .searchIcon({ 295 .searchIcon({
@@ -318,42 +337,44 @@ export struct SearchComponent { @@ -318,42 +337,44 @@ export struct SearchComponent {
318 } 337 }
319 } 338 }
320 }) 339 })
321 - }.padding({right:'70lpx'})  
322 - .layoutWeight(1)  
323 340
324 - Image($r('app.media.search_input_del_icon'))  
325 - .width("31lpx")  
326 - .height("31lpx")  
327 - .objectFit(ImageFit.Auto)  
328 - .interpolation(ImageInterpolation.Medium)  
329 - .margin({left:"495lpx"})  
330 - .onClick(()=>{  
331 - this.searchText = ""  
332 - })  
333 - .visibility(StringUtils.isEmpty(this.searchText) ? Visibility.Hidden : Visibility.Visible) 341 + Image($r('app.media.search_input_del_icon'))
  342 + .width(`${this.calcHeight(31)}lpx`)
  343 + .height(`${this.calcHeight(31)}lpx`)
  344 + .objectFit(ImageFit.Auto)
  345 + .interpolation(ImageInterpolation.Medium)
  346 + .onClick(()=>{
  347 + this.searchText = ""
  348 + })
  349 + .offset({x:10})
  350 + .enabled(true)
  351 + .visibility(StringUtils.isEmpty(this.searchText) ? Visibility.Hidden : Visibility.Visible)
334 352
  353 + }.padding({right:`${this.calcHeight(70)}lpx`})
  354 + .layoutWeight(1)
  355 + .justifyContent(FlexAlign.SpaceBetween)
335 } 356 }
336 .backgroundImage($r('app.media.search_page_input_bg')) 357 .backgroundImage($r('app.media.search_page_input_bg'))
337 .backgroundImageSize(ImageSize.Cover) 358 .backgroundImageSize(ImageSize.Cover)
338 .layoutWeight(1) 359 .layoutWeight(1)
339 - .height('69lpx') 360 + .height(`${this.calcHeight(69)}lpx`)
340 361
341 //TODO 需要修改输入法 换行 362 //TODO 需要修改输入法 换行
342 //右 363 //右
343 Text("取消") 364 Text("取消")
344 .textAlign(TextAlign.Center) 365 .textAlign(TextAlign.Center)
345 - .fontWeight('400lpx')  
346 - .fontSize('31lpx')  
347 - .lineHeight('58lpx') 366 + .fontWeight(400)
  367 + .fontSize(`${this.calcHeight(31)}lpx`)
  368 + .lineHeight(`${this.calcHeight(58)}lpx`)
348 .fontColor($r('app.color.color_222222')) 369 .fontColor($r('app.color.color_222222'))
349 - .width('125lpx')  
350 - .height('58lpx') 370 + .width(`${this.calcHeight(125)}lpx`)
  371 + .height(`${this.calcHeight(58)}lpx`)
351 .onClick(() => { 372 .onClick(() => {
352 router.back() 373 router.back()
353 }) 374 })
354 } 375 }
355 - .height('85lpx')  
356 - .padding({ left: '31lpx' }) 376 + .height(`${this.calcHeight(85)}lpx`)
  377 + .padding({ left: `${this.calcHeight(31)}lpx` })
357 .alignItems(VerticalAlign.Center) 378 .alignItems(VerticalAlign.Center)
358 } 379 }
359 380
@@ -395,6 +416,10 @@ export struct SearchComponent { @@ -395,6 +416,10 @@ export struct SearchComponent {
395 this.isClickedInputSearch = false 416 this.isClickedInputSearch = false
396 this.isClickedHintSearch = false 417 this.isClickedHintSearch = false
397 } 418 }
  419 +
  420 + calcHeight(value:number): number{
  421 + return value * this.percent
  422 + }
398 } 423 }
399 424
400 function trackSearchClick(upOneLevelPageName: string,keyword:string){ 425 function trackSearchClick(upOneLevelPageName: string,keyword:string){
@@ -27,6 +27,7 @@ export struct SearchHistoryComponent{ @@ -27,6 +27,7 @@ export struct SearchHistoryComponent{
27 alignment: DialogAlignment.Center, 27 alignment: DialogAlignment.Center,
28 customStyle: true 28 customStyle: true
29 }) 29 })
  30 + @Prop percent:number = 1
30 31
31 onAccept(){ 32 onAccept(){
32 console.info('Callback when the second button is clicked') 33 console.info('Callback when the second button is clicked')
@@ -48,14 +49,14 @@ export struct SearchHistoryComponent{ @@ -48,14 +49,14 @@ export struct SearchHistoryComponent{
48 Text("搜索历史") 49 Text("搜索历史")
49 .textAlign(TextAlign.Center) 50 .textAlign(TextAlign.Center)
50 .fontWeight(FontWeight.Regular) 51 .fontWeight(FontWeight.Regular)
51 - .fontSize('27lpx')  
52 - .lineHeight('38lpx') 52 + .fontSize(`${this.calcHeight(27)}lpx`)
  53 + .lineHeight(`${this.calcHeight(38)}lpx`)
53 .fontColor($r('app.color.color_999999')) 54 .fontColor($r('app.color.color_999999'))
54 - .height('38lpx') 55 + .height(`${this.calcHeight(38)}lpx`)
55 56
56 Image($r('app.media.search_delete_icon')) 57 Image($r('app.media.search_delete_icon'))
57 - .height('31lpx')  
58 - .width('31lpx') 58 + .height(`${this.calcHeight(31)}lpx`)
  59 + .width(`${this.calcHeight(31)}lpx`)
59 .interpolation(ImageInterpolation.High) 60 .interpolation(ImageInterpolation.High)
60 .objectFit(ImageFit.Auto) 61 .objectFit(ImageFit.Auto)
61 .onClick(()=>{ 62 .onClick(()=>{
@@ -63,7 +64,7 @@ export struct SearchHistoryComponent{ @@ -63,7 +64,7 @@ export struct SearchHistoryComponent{
63 this.dialogController.open() 64 this.dialogController.open()
64 }) 65 })
65 }.justifyContent(FlexAlign.SpaceBetween) 66 }.justifyContent(FlexAlign.SpaceBetween)
66 - .margin({bottom:'17lpx'}) 67 + .margin({bottom:`${this.calcHeight(17)}lpx`})
67 .width('100%') 68 .width('100%')
68 69
69 Grid(){ 70 Grid(){
@@ -72,14 +73,14 @@ export struct SearchHistoryComponent{ @@ -72,14 +73,14 @@ export struct SearchHistoryComponent{
72 Row(){ 73 Row(){
73 Text(`${item.searchContent}`) 74 Text(`${item.searchContent}`)
74 .fontColor($r('app.color.color_222222')) 75 .fontColor($r('app.color.color_222222'))
75 - .fontSize('31lpx') 76 + .fontSize(`${this.calcHeight(31)}lpx`)
76 .fontWeight(FontWeight.Regular) 77 .fontWeight(FontWeight.Regular)
77 - .lineHeight('46lpx') 78 + .lineHeight(`${this.calcHeight(46)}lpx`)
78 .maxLines(1) 79 .maxLines(1)
79 - .constraintSize({maxWidth:index%2 === 0?'270lpx':'230lpx'}) 80 + .constraintSize({maxWidth:index%2 === 0?`${this.calcHeight(270)}lpx`:`${this.calcHeight(230)}lpx`})
80 .textOverflow({ overflow: TextOverflow.Ellipsis }) 81 .textOverflow({ overflow: TextOverflow.Ellipsis })
81 .textAlign(TextAlign.Start) 82 .textAlign(TextAlign.Start)
82 - .margin({left:index%2 === 0?'0lpx':'23lpx'}) 83 + .margin({left:index%2 === 0?'0lpx':`${this.calcHeight(23)}lpx`})
83 .onClick(()=>{ 84 .onClick(()=>{
84 if (this.onGetSearchRes !== undefined) { 85 if (this.onGetSearchRes !== undefined) {
85 this.onGetSearchRes(item.searchContent,index) 86 this.onGetSearchRes(item.searchContent,index)
@@ -87,9 +88,9 @@ export struct SearchHistoryComponent{ @@ -87,9 +88,9 @@ export struct SearchHistoryComponent{
87 }) 88 })
88 89
89 Image($r('app.media.search_item_delete_icon')) 90 Image($r('app.media.search_item_delete_icon'))
90 - .width('23lpx')  
91 - .height('23lpx')  
92 - .margin({left:'4lpx'}) 91 + .width(`${this.calcHeight(23)}lpx`)
  92 + .height(`${this.calcHeight(23)}lpx`)
  93 + .margin({left:`${this.calcHeight(4)}lpx`})
93 .interpolation(ImageInterpolation.Medium) 94 .interpolation(ImageInterpolation.Medium)
94 .objectFit(ImageFit.Auto) 95 .objectFit(ImageFit.Auto)
95 .onClick(()=>{ 96 .onClick(()=>{
@@ -103,19 +104,19 @@ export struct SearchHistoryComponent{ @@ -103,19 +104,19 @@ export struct SearchHistoryComponent{
103 104
104 if(index%2 === 0 && index != this.searchHistoryData.length-1 ){ 105 if(index%2 === 0 && index != this.searchHistoryData.length-1 ){
105 Divider() 106 Divider()
106 - .width('2lpx')  
107 - .height('23lpx') 107 + .width(`${this.calcHeight(2)}lpx`)
  108 + .height(`${this.calcHeight(23)}lpx`)
108 .color($r('app.color.color_CCCCCC')) 109 .color($r('app.color.color_CCCCCC'))
109 - .strokeWidth('2lpx') 110 + .strokeWidth(`${this.calcHeight(2)}lpx`)
110 .vertical(true) 111 .vertical(true)
111 } 112 }
112 }.height('100%') 113 }.height('100%')
113 .alignItems(VerticalAlign.Center) 114 .alignItems(VerticalAlign.Center)
114 .width('100%') 115 .width('100%')
115 - .margin({left:index%2 === 1?'23lpx':'0lpx'}) 116 + .margin({left:index%2 === 1?`${this.calcHeight(23)}lpx`:'0lpx'})
116 117
117 } 118 }
118 - .height('46lpx') 119 + .height(`${this.calcHeight(46)}lpx`)
119 .alignSelf(ItemAlign.Center) 120 .alignSelf(ItemAlign.Center)
120 121
121 }) 122 })
@@ -123,9 +124,9 @@ export struct SearchHistoryComponent{ @@ -123,9 +124,9 @@ export struct SearchHistoryComponent{
123 .height(this.getCategoryViewHeight()) 124 .height(this.getCategoryViewHeight())
124 .rowsTemplate(this.getCategoryRowTmpl()) 125 .rowsTemplate(this.getCategoryRowTmpl())
125 .columnsTemplate('1fr 1fr') 126 .columnsTemplate('1fr 1fr')
126 - .rowsGap('23lpx') 127 + .rowsGap(`${this.calcHeight(23)}lpx`)
127 } 128 }
128 - .margin({top:"36lpx",bottom:'46lpx'}) 129 + .margin({top:`${this.calcHeight(36)}lpx`,bottom:`${this.calcHeight(46)}lpx`})
129 } 130 }
130 131
131 getCategoryRowCount() { 132 getCategoryRowCount() {
@@ -140,6 +141,10 @@ export struct SearchHistoryComponent{ @@ -140,6 +141,10 @@ export struct SearchHistoryComponent{
140 } 141 }
141 142
142 getCategoryViewHeight() { 143 getCategoryViewHeight() {
143 - return `${50 * this.getCategoryRowCount()}lpx`; 144 + return `${50 * this.percent * this.getCategoryRowCount()}lpx`;
  145 + }
  146 +
  147 + calcHeight(value:number): number{
  148 + return value * this.percent
144 } 149 }
145 } 150 }
@@ -10,6 +10,7 @@ const TAG = "SearchHotsComponent" @@ -10,6 +10,7 @@ const TAG = "SearchHotsComponent"
10 export struct SearchHotsComponent{ 10 export struct SearchHotsComponent{
11 @State searchHotsData:SearchHotContentItem[] = [] 11 @State searchHotsData:SearchHotContentItem[] = []
12 onGetSearchRes?: (item:string) => void; 12 onGetSearchRes?: (item:string) => void;
  13 + @Prop percent:number = 1
13 14
14 aboutToAppear(){ 15 aboutToAppear(){
15 //获取搜索热词 16 //获取搜索热词
@@ -34,22 +35,22 @@ export struct SearchHotsComponent{ @@ -34,22 +35,22 @@ export struct SearchHotsComponent{
34 if(this.searchHotsData.length>0){ 35 if(this.searchHotsData.length>0){
35 Row() { 36 Row() {
36 Image($r('app.media.search_hot_icon')) 37 Image($r('app.media.search_hot_icon'))
37 - .width('46lpx')  
38 - .height('46lpx') 38 + .width(`${this.calcHeight(46)}lpx`)
  39 + .height(`${this.calcHeight(46)}lpx`)
39 .objectFit(ImageFit.Auto) 40 .objectFit(ImageFit.Auto)
40 - .margin({right:'8lpx'}) 41 + .margin({right:`${this.calcHeight(8)}lpx`})
41 .interpolation(ImageInterpolation.Medium) 42 .interpolation(ImageInterpolation.Medium)
42 43
43 Text("热门搜索") 44 Text("热门搜索")
44 .textAlign(TextAlign.Center) 45 .textAlign(TextAlign.Center)
45 .fontWeight(FontWeight.Bold) 46 .fontWeight(FontWeight.Bold)
46 - .fontSize('33lpx')  
47 - .lineHeight('46lpx') 47 + .fontSize(`${this.calcHeight(33)}lpx`)
  48 + .lineHeight(`${this.calcHeight(46)}lpx`)
48 .fontColor($r('app.color.color_222222')) 49 .fontColor($r('app.color.color_222222'))
49 - .height('46lpx') 50 + .height(`${this.calcHeight(46)}lpx`)
50 } 51 }
51 .width('100%') 52 .width('100%')
52 - .margin({bottom:"15lpx"}) 53 + .margin({bottom:`${this.calcHeight(15)}lpx`})
53 } 54 }
54 55
55 List(){ 56 List(){
@@ -60,49 +61,49 @@ export struct SearchHotsComponent{ @@ -60,49 +61,49 @@ export struct SearchHotsComponent{
60 Row(){ 61 Row(){
61 if(item.sequence <=3){ 62 if(item.sequence <=3){
62 Image(item.sequence===1?$r('app.media.search_hot_num1'):item.sequence===2?$r('app.media.search_hot_num2'):$r('app.media.search_hot_num3')) 63 Image(item.sequence===1?$r('app.media.search_hot_num1'):item.sequence===2?$r('app.media.search_hot_num2'):$r('app.media.search_hot_num3'))
63 - .width('27lpx')  
64 - .height('35lpx') 64 + .width(`${this.calcHeight(27)}lpx`)
  65 + .height(`${this.calcHeight(35)}lpx`)
65 .objectFit(ImageFit.Auto) 66 .objectFit(ImageFit.Auto)
66 - .margin({right:'12lpx'}) 67 + .margin({right:`${this.calcHeight(12)}lpx`})
67 .interpolation(ImageInterpolation.High) 68 .interpolation(ImageInterpolation.High)
68 }else { 69 }else {
69 Text(`${item.sequence}`) 70 Text(`${item.sequence}`)
70 - .height('31lpx') 71 + .height(`${this.calcHeight(31)}lpx`)
71 .fontColor($r('app.color.color_666666')) 72 .fontColor($r('app.color.color_666666'))
72 - .fontSize('27lpx') 73 + .fontSize(`${this.calcHeight(27)}lpx`)
73 .fontWeight(FontWeight.Regular) 74 .fontWeight(FontWeight.Regular)
74 - .lineHeight('31lpx')  
75 - .margin({right:'12lpx'}) 75 + .lineHeight(`${this.calcHeight(31)}lpx`)
  76 + .margin({right:`${this.calcHeight(12)}lpx`})
76 } 77 }
77 Text(`${item.hotEntry}`) 78 Text(`${item.hotEntry}`)
78 .textOverflow({ overflow: TextOverflow.Ellipsis }) 79 .textOverflow({ overflow: TextOverflow.Ellipsis })
79 .fontColor($r('app.color.color_222222')) 80 .fontColor($r('app.color.color_222222'))
80 - .fontSize('31lpx') 81 + .fontSize(`${this.calcHeight(31)}lpx`)
81 .maxLines(1) 82 .maxLines(1)
82 .fontWeight(FontWeight.Regular) 83 .fontWeight(FontWeight.Regular)
83 - .lineHeight('42lpx') 84 + .lineHeight(`${this.calcHeight(42)}lpx`)
84 }.layoutWeight(1) 85 }.layoutWeight(1)
85 86
86 if(item.mark===1 || item.mark===2){ 87 if(item.mark===1 || item.mark===2){
87 Image(item.mark===1?$r('app.media.search_hots_mark1'):$r('app.media.search_hots_mark2')) 88 Image(item.mark===1?$r('app.media.search_hots_mark1'):$r('app.media.search_hots_mark2'))
88 - .width('42lpx')  
89 - .height('31lpx') 89 + .width(`${this.calcHeight(42)}lpx`)
  90 + .height(`${this.calcHeight(31)}lpx`)
90 .objectFit(ImageFit.Auto) 91 .objectFit(ImageFit.Auto)
91 .interpolation(ImageInterpolation.High) 92 .interpolation(ImageInterpolation.High)
92 } 93 }
93 }.alignItems(VerticalAlign.Center) 94 }.alignItems(VerticalAlign.Center)
94 - .height('84lpx') 95 + .height(`${this.calcHeight(84)}lpx`)
95 .width('100%') 96 .width('100%')
96 .justifyContent(FlexAlign.SpaceBetween) 97 .justifyContent(FlexAlign.SpaceBetween)
97 98
98 if(index != this.searchHotsData.length-1 ){ 99 if(index != this.searchHotsData.length-1 ){
99 Divider() 100 Divider()
100 .width('100%') 101 .width('100%')
101 - .height('1lpx') 102 + .height(`${this.calcHeight(1)}lpx`)
102 .color($r('app.color.color_F5F5F5')) 103 .color($r('app.color.color_F5F5F5'))
103 - .strokeWidth('1lpx') 104 + .strokeWidth(`${this.calcHeight(1)}lpx`)
104 } 105 }
105 - }.height('85lpx') 106 + }.height(`${this.calcHeight(85)}lpx`)
106 .width('100%') 107 .width('100%')
107 .alignItems(HorizontalAlign.Start) 108 .alignItems(HorizontalAlign.Start)
108 } 109 }
@@ -117,6 +118,10 @@ export struct SearchHotsComponent{ @@ -117,6 +118,10 @@ export struct SearchHotsComponent{
117 }).layoutWeight(1) 118 }).layoutWeight(1)
118 }.width('100%') 119 }.width('100%')
119 .height('100%') 120 .height('100%')
120 - .margin({top:'46lpx'}) 121 + .margin({top:`${this.calcHeight(46)}lpx`})
  122 + }
  123 +
  124 + calcHeight(value:number): number{
  125 + return value * this.percent
121 } 126 }
122 } 127 }
@@ -10,6 +10,7 @@ export struct SearchRelatedComponent { @@ -10,6 +10,7 @@ export struct SearchRelatedComponent {
10 @Link relatedSearchContentData: SearchRelatedItem[] 10 @Link relatedSearchContentData: SearchRelatedItem[]
11 onGetSearchRes?: (item:string) => void; 11 onGetSearchRes?: (item:string) => void;
12 @Prop searchText: string 12 @Prop searchText: string
  13 + @Prop percent:number = 1
13 14
14 build() { 15 build() {
15 Column() { 16 Column() {
@@ -19,19 +20,19 @@ export struct SearchRelatedComponent { @@ -19,19 +20,19 @@ export struct SearchRelatedComponent {
19 Column(){ 20 Column(){
20 Row() { 21 Row() {
21 Image($r('app.media.search_related_item_icon')) 22 Image($r('app.media.search_related_item_icon'))
22 - .width('31lpx')  
23 - .height('31lpx') 23 + .width(`${this.calcHeight(31)}lpx`)
  24 + .height(`${this.calcHeight(31)}lpx`)
24 .objectFit(ImageFit.Auto) 25 .objectFit(ImageFit.Auto)
25 - .margin({ right: '10lpx' }) 26 + .margin({ right:`${this.calcHeight(10)}lpx` })
26 .interpolation(ImageInterpolation.High) 27 .interpolation(ImageInterpolation.High)
27 28
28 Text(){ 29 Text(){
29 ForEach(item.data_arr,(item:string)=>{ 30 ForEach(item.data_arr,(item:string)=>{
30 Span(item) 31 Span(item)
31 .fontColor(item===this.searchText?$r('app.color.color_ED2800'):$r('app.color.color_000000')) 32 .fontColor(item===this.searchText?$r('app.color.color_ED2800'):$r('app.color.color_000000'))
32 - .fontSize('31lpx')  
33 - .fontWeight('400lpx')  
34 - .lineHeight('50lpx') 33 + .fontSize(`${this.calcHeight(31)}lpx`)
  34 + .fontWeight(400)
  35 + .lineHeight(`${this.calcHeight(50)}lpx`)
35 }) 36 })
36 } 37 }
37 .maxLines(1) 38 .maxLines(1)
@@ -40,14 +41,14 @@ export struct SearchRelatedComponent { @@ -40,14 +41,14 @@ export struct SearchRelatedComponent {
40 41
41 }.alignItems(VerticalAlign.Center) 42 }.alignItems(VerticalAlign.Center)
42 .justifyContent(FlexAlign.Start) 43 .justifyContent(FlexAlign.Start)
43 - .height('95lpx') 44 + .height(`${this.calcHeight(95)}lpx`)
44 45
45 if (index != this.relatedSearchContentData.length - 1) { 46 if (index != this.relatedSearchContentData.length - 1) {
46 Divider() 47 Divider()
47 .width('100%') 48 .width('100%')
48 - .height('1lpx') 49 + .height(`${this.calcHeight(1)}lpx`)
49 .color($r('app.color.color_F5F5F5')) 50 .color($r('app.color.color_F5F5F5'))
50 - .strokeWidth('1lpx') 51 + .strokeWidth(`${this.calcHeight(1)}lpx`)
51 } 52 }
52 } 53 }
53 }.width('100%') 54 }.width('100%')
@@ -59,8 +60,11 @@ export struct SearchRelatedComponent { @@ -59,8 +60,11 @@ export struct SearchRelatedComponent {
59 }) 60 })
60 }.width('100%') 61 }.width('100%')
61 }.width('100%') 62 }.width('100%')
62 - .margin({ top: '8lpx' })  
63 - .padding({ left: '31lpx', right: '31lpx' }) 63 + .margin({ top: `${this.calcHeight(8)}lpx` })
  64 + .padding({ left: `${this.calcHeight(31)}lpx`, right: `${this.calcHeight(31)}lpx` })
64 } 65 }
65 66
  67 + calcHeight(value:number): number{
  68 + return value * this.percent
  69 + }
66 } 70 }
@@ -28,6 +28,7 @@ export struct SearchResultComponent { @@ -28,6 +28,7 @@ export struct SearchResultComponent {
28 scroller: Scroller = new Scroller() 28 scroller: Scroller = new Scroller()
29 onClickTryAgain?: () => void; 29 onClickTryAgain?: () => void;
30 @State isConnectNetwork : boolean = NetworkUtil.isNetConnected() 30 @State isConnectNetwork : boolean = NetworkUtil.isNetConnected()
  31 + @Prop percent:number = 1
31 32
32 aboutToAppear(): void { 33 aboutToAppear(): void {
33 if (this.count.length === 0 && this.isGetRequest == true) { 34 if (this.count.length === 0 && this.isGetRequest == true) {
@@ -71,7 +72,7 @@ export struct SearchResultComponent { @@ -71,7 +72,7 @@ export struct SearchResultComponent {
71 //缺省图 72 //缺省图
72 if(this.isConnectNetwork){ 73 if(this.isConnectNetwork){
73 EmptyComponent({emptyType:4}) 74 EmptyComponent({emptyType:4})
74 - .height('612lpx') 75 + .height(`${this.calcHeight(612)}lpx`)
75 .width('100%') 76 .width('100%')
76 }else{ 77 }else{
77 EmptyComponent({ emptyType: 1,emptyHeight:"100%" ,retry: () => { 78 EmptyComponent({ emptyType: 1,emptyHeight:"100%" ,retry: () => {
@@ -90,19 +91,19 @@ export struct SearchResultComponent { @@ -90,19 +91,19 @@ export struct SearchResultComponent {
90 ListItem() { 91 ListItem() {
91 Row() { 92 Row() {
92 Image($r('app.media.search_suggest_icon')) 93 Image($r('app.media.search_suggest_icon'))
93 - .width('6lpx')  
94 - .height('31lpx') 94 + .width(`${this.calcHeight(6)}lpx`)
  95 + .height(`${this.calcHeight(31)}lpx`)
95 .objectFit(ImageFit.Cover) 96 .objectFit(ImageFit.Cover)
96 .interpolation(ImageInterpolation.High) 97 .interpolation(ImageInterpolation.High)
97 - .margin({ right: '10lpx' }) 98 + .margin({ right: `${this.calcHeight(10)}lpx` })
98 Text("为你推荐") 99 Text("为你推荐")
99 .textAlign(TextAlign.Start) 100 .textAlign(TextAlign.Start)
100 .fontWeight(600) 101 .fontWeight(600)
101 - .fontSize('33lpx')  
102 - .lineHeight('46lpx') 102 + .fontSize(`${this.calcHeight(33)}lpx`)
  103 + .lineHeight(`${this.calcHeight(46)}lpx`)
103 .fontColor($r('app.color.color_222222')) 104 .fontColor($r('app.color.color_222222'))
104 - }.height('84lpx')  
105 - .padding({ left: '31lpx', right: '31lpx' }) 105 + }.height(`${this.calcHeight(84)}lpx`)
  106 + .padding({ left: `${this.calcHeight(31)}lpx`, right: `${this.calcHeight(31)}lpx` })
106 .width('100%') 107 .width('100%')
107 .alignItems(VerticalAlign.Center) 108 .alignItems(VerticalAlign.Center)
108 } 109 }
@@ -115,9 +116,9 @@ export struct SearchResultComponent { @@ -115,9 +116,9 @@ export struct SearchResultComponent {
115 if (index != this.data.totalCount() - 1) { 116 if (index != this.data.totalCount() - 1) {
116 Divider() 117 Divider()
117 .width('100%') 118 .width('100%')
118 - .height('1lpx') 119 + .height(`${this.calcHeight(1)}lpx`)
119 .color($r('app.color.color_F5F5F5')) 120 .color($r('app.color.color_F5F5F5'))
120 - .strokeWidth('1lpx') 121 + .strokeWidth(`${this.calcHeight(1)}lpx`)
121 } 122 }
122 } 123 }
123 } 124 }
@@ -144,7 +145,7 @@ export struct SearchResultComponent { @@ -144,7 +145,7 @@ export struct SearchResultComponent {
144 .vertical(false) 145 .vertical(false)
145 .barMode(BarMode.Fixed) 146 .barMode(BarMode.Fixed)
146 .barWidth('100%') 147 .barWidth('100%')
147 - .barHeight('84lpx') 148 + .barHeight(`${this.calcHeight(84)}lpx`)
148 .animationDuration(0) 149 .animationDuration(0)
149 .width('100%') 150 .width('100%')
150 .scrollable(false) 151 .scrollable(false)
@@ -152,26 +153,26 @@ export struct SearchResultComponent { @@ -152,26 +153,26 @@ export struct SearchResultComponent {
152 } 153 }
153 }.width('100%') 154 }.width('100%')
154 .layoutWeight(1) 155 .layoutWeight(1)
155 - .margin({ top: '12lpx' }) 156 + .margin({ top: `${this.calcHeight(12)}lpx` })
156 } 157 }
157 158
158 @Builder 159 @Builder
159 TabBuilder(index: number, item: string) { 160 TabBuilder(index: number, item: string) {
160 Stack() { 161 Stack() {
161 Text(item) 162 Text(item)
162 - .height('38lpx')  
163 - .fontSize('33lpx') 163 + .height(`${this.calcHeight(38)}lpx`)
  164 + .fontSize(`${this.calcHeight(33)}lpx`)
164 .fontWeight(this.currentIndex === index ? 600 : 400) 165 .fontWeight(this.currentIndex === index ? 600 : 400)
165 .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) 166 .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor)
166 - .lineHeight('38lpx') 167 + .lineHeight(`${this.calcHeight(38)}lpx`)
167 168
168 if (this.currentIndex === index) { 169 if (this.currentIndex === index) {
169 Divider() 170 Divider()
170 - .width('31lpx')  
171 - .height('4lpx') 171 + .width(`${this.calcHeight(31)}lpx`)
  172 + .height(`${this.calcHeight(4)}lpx`)
172 .color('#ED2800') 173 .color('#ED2800')
173 - .strokeWidth('4lpx')  
174 - .margin({ top: '50lpx' }) 174 + .strokeWidth(`${this.calcHeight(4)}lpx`)
  175 + .margin({ top: `${this.calcHeight(50)}lpx` })
175 .id("divTag") 176 .id("divTag")
176 } 177 }
177 }.onClick(() => { 178 }.onClick(() => {
@@ -179,7 +180,11 @@ export struct SearchResultComponent { @@ -179,7 +180,11 @@ export struct SearchResultComponent {
179 this.controller.changeIndex(this.currentIndex) 180 this.controller.changeIndex(this.currentIndex)
180 }) 181 })
181 .height('100%') 182 .height('100%')
182 - .margin({ right: '9lpx' })  
183 - .padding({ left: '31lpx', right: index === this.count.length - 1 ? "31lpx" : "0lpx" }) 183 + .margin({ right: `${this.calcHeight(9)}lpx` })
  184 + .padding({ left: `${this.calcHeight(31)}lpx`, right: index === this.count.length - 1 ? `${this.calcHeight(31)}lpx` : "0lpx" })
  185 + }
  186 +
  187 + calcHeight(value:number): number{
  188 + return value * this.percent
184 } 189 }
185 } 190 }
1 import { Params } from 'wdBean'; 1 import { Params } from 'wdBean';
2 -import { AppUtils, StringUtils } from 'wdKit/Index'; 2 +import { AppUtils, BreakpointSystem, StringUtils } from 'wdKit/Index';
3 import { WDRouterPage, WDRouterRule } from 'wdRouter'; 3 import { WDRouterPage, WDRouterRule } from 'wdRouter';
4 import { TrackingButton, TrackConstants } from 'wdTracking/Index'; 4 import { TrackingButton, TrackConstants } from 'wdTracking/Index';
5 import { CustomTitleUI } from '../reusable/CustomTitleUI'; 5 import { CustomTitleUI } from '../reusable/CustomTitleUI';
@@ -24,11 +24,25 @@ export struct AboutPageUI { @@ -24,11 +24,25 @@ export struct AboutPageUI {
24 alignment: DialogAlignment.Center 24 alignment: DialogAlignment.Center
25 }) 25 })
26 26
  27 + @StorageProp('currentBreakpoint') @Watch("currentChanged")currentBreakpoint: string = 'sm';
  28 + private breakpointSystem = new BreakpointSystem();
  29 + @State percent:number = 1
  30 +
  31 + currentChanged(){
  32 + if(this.currentBreakpoint == "md" || this.currentBreakpoint == "lg"){
  33 + this.percent = 0.7
  34 + }else {
  35 + this.percent = 1
  36 + }
  37 + }
  38 +
27 build() { 39 build() {
28 this.aboutUi() 40 this.aboutUi()
29 } 41 }
30 42
31 aboutToAppear() { 43 aboutToAppear() {
  44 + this.breakpointSystem.register();
  45 + this.currentChanged()
32 let context = getContext(); 46 let context = getContext();
33 context.getApplicationContext(); 47 context.getApplicationContext();
34 let appVerion = AppUtils.getAppVersionName() 48 let appVerion = AppUtils.getAppVersionName()
@@ -37,15 +51,19 @@ export struct AboutPageUI { @@ -37,15 +51,19 @@ export struct AboutPageUI {
37 } 51 }
38 } 52 }
39 53
  54 + aboutToDisappear(): void {
  55 + this.breakpointSystem.unregister();
  56 + }
  57 +
40 @Builder 58 @Builder
41 aboutUi() { 59 aboutUi() {
42 Column() { 60 Column() {
43 - CustomTitleUI({titleName:'关于'}) 61 + CustomTitleUI({titleName:'关于',percent:this.percent})
44 62
45 Image($r('app.media.setting_about_logo')) 63 Image($r('app.media.setting_about_logo'))
46 - .width('278lpx')  
47 - .height('154lpx')  
48 - .margin({ top: '173lpx', bottom: '154lpx' }) 64 + .width(`${this.calcHeight(278)}lpx`)
  65 + .height(`${this.calcHeight(154)}lpx`)
  66 + .margin({ top: `${this.calcHeight2(173)}lpx`, bottom: `${this.calcHeight2(154)}lpx` })
49 .gesture( 67 .gesture(
50 TapGesture({ count: 2 }) 68 TapGesture({ count: 2 })
51 .onAction((event: GestureEvent) => { 69 .onAction((event: GestureEvent) => {
@@ -77,28 +95,28 @@ export struct AboutPageUI { @@ -77,28 +95,28 @@ export struct AboutPageUI {
77 }) 95 })
78 }.divider({ 96 }.divider({
79 strokeWidth: 1, 97 strokeWidth: 1,
80 - startMargin: '29lpx',  
81 - endMargin: '29lpx', 98 + startMargin: `${this.calcHeight(29)}lpx`,
  99 + endMargin: `${this.calcHeight(29)}lpx`,
82 color: '#EDEDED' 100 color: '#EDEDED'
83 }) 101 })
84 102
85 Blank() 103 Blank()
86 104
87 Image($r('app.media.about_us_code')) 105 Image($r('app.media.about_us_code'))
88 - .width('192lpx')  
89 - .height('192lpx') 106 + .width(`${this.calcHeight(192)}lpx`)
  107 + .height(`${this.calcHeight(192)}lpx`)
90 108
91 Text(this.version) 109 Text(this.version)
92 - .fontSize('25lpx') 110 + .fontSize(`${this.calcHeight(25)}lpx`)
93 .textAlign(TextAlign.Center) 111 .textAlign(TextAlign.Center)
94 .fontColor($r("app.color.color_666666")) 112 .fontColor($r("app.color.color_666666"))
95 - .margin({ bottom: '31lpx' }) 113 + .margin({ bottom: `${this.calcHeight(31)}lpx` })
96 114
97 Text(this.message) 115 Text(this.message)
98 - .fontSize('19lpx') 116 + .fontSize(`${this.calcHeight(19)}lpx`)
99 .textAlign(TextAlign.Center) 117 .textAlign(TextAlign.Center)
100 .fontColor($r("app.color.color_999999")) 118 .fontColor($r("app.color.color_999999"))
101 - .margin({ bottom: '35lpx' }) 119 + .margin({ bottom: `${this.calcHeight(35)}lpx` })
102 } 120 }
103 .width('100%') 121 .width('100%')
104 .height('100%') 122 .height('100%')
@@ -112,18 +130,30 @@ export struct AboutPageUI { @@ -112,18 +130,30 @@ export struct AboutPageUI {
112 // 左侧标题 130 // 左侧标题
113 Text(`${item}`) 131 Text(`${item}`)
114 .fontColor('#666666') 132 .fontColor('#666666')
115 - .fontSize('31lpx') 133 + .fontSize(`${this.calcHeight(31)}lpx`)
116 134
117 Image($r('app.media.mine_user_arrow')) 135 Image($r('app.media.mine_user_arrow'))
118 - .width('27lpx')  
119 - .height('27lpx') 136 + .width(`${this.calcHeight(27)}lpx`)
  137 + .height(`${this.calcHeight(27)}lpx`)
120 .objectFit(ImageFit.Auto) 138 .objectFit(ImageFit.Auto)
121 } 139 }
122 .alignItems(VerticalAlign.Center) 140 .alignItems(VerticalAlign.Center)
123 .justifyContent(FlexAlign.SpaceBetween) 141 .justifyContent(FlexAlign.SpaceBetween)
124 - .height('97lpx') 142 + .height(`${this.calcHeight(97)}lpx`)
125 .width('100%') 143 .width('100%')
126 - .padding({ left: '29lpx', right: '29lpx' }) 144 + .padding({ left:`${this.calcHeight(29)}lpx`, right: `${this.calcHeight(29)}lpx` })
  145 + }
  146 +
  147 + calcHeight(value:number): number{
  148 + return value * this.percent
  149 + }
  150 +
  151 + calcHeight2(value:number): number{
  152 + if(this.percent < 1){
  153 + return value * 0.3
  154 + }else{
  155 + return value * 1
  156 + }
127 } 157 }
128 } 158 }
129 159
1 import { BottomNavi, CommonConstants, SpConstants } from 'wdConstant'; 1 import { BottomNavi, CommonConstants, SpConstants } from 'wdConstant';
2 -import { Logger, SPHelper, StringUtils } from 'wdKit'; 2 +import { BreakpointSystem, Logger, SPHelper, StringUtils } from 'wdKit';
3 import PageViewModel from '../../viewmodel/PageViewModel'; 3 import PageViewModel from '../../viewmodel/PageViewModel';
4 import storageStatistics from "@ohos.file.storageStatistics"; 4 import storageStatistics from "@ohos.file.storageStatistics";
5 import { BusinessError } from '@ohos.base'; 5 import { BusinessError } from '@ohos.base';
@@ -25,6 +25,17 @@ export struct MineSettingComponent { @@ -25,6 +25,17 @@ export struct MineSettingComponent {
25 @State cacheSize: number = 0 25 @State cacheSize: number = 0
26 @State accountState:boolean=false 26 @State accountState:boolean=false
27 preferences: dataPreferences.Preferences | null = null; 27 preferences: dataPreferences.Preferences | null = null;
  28 + @StorageProp('currentBreakpoint') @Watch("currentChanged")currentBreakpoint: string = 'sm';
  29 + private breakpointSystem = new BreakpointSystem();
  30 + @State percent:number = 1
  31 +
  32 + currentChanged(){
  33 + if(this.currentBreakpoint == "md" || this.currentBreakpoint == "lg"){
  34 + this.percent = 0.7
  35 + }else {
  36 + this.percent = 1
  37 + }
  38 + }
28 39
29 dialogController: CustomDialogController = new CustomDialogController({ 40 dialogController: CustomDialogController = new CustomDialogController({
30 builder: MyCustomDialog({ 41 builder: MyCustomDialog({
@@ -43,6 +54,8 @@ export struct MineSettingComponent { @@ -43,6 +54,8 @@ export struct MineSettingComponent {
43 customStyle: true 54 customStyle: true
44 }) 55 })
45 aboutToAppear() { 56 aboutToAppear() {
  57 + this.breakpointSystem.register();
  58 + this.currentChanged()
46 // 获取设置页面数据 59 // 获取设置页面数据
47 this.getSettingPageData() 60 this.getSettingPageData()
48 61
@@ -54,6 +67,10 @@ export struct MineSettingComponent { @@ -54,6 +67,10 @@ export struct MineSettingComponent {
54 67
55 } 68 }
56 69
  70 + aboutToDisappear(): void {
  71 + this.breakpointSystem.unregister();
  72 + }
  73 +
57 async getAccountState(){ 74 async getAccountState(){
58 let userId=await SPHelper.default.get(SpConstants.USER_ID,'') as string 75 let userId=await SPHelper.default.get(SpConstants.USER_ID,'') as string
59 if(userId==''){ 76 if(userId==''){
@@ -91,13 +108,13 @@ export struct MineSettingComponent { @@ -91,13 +108,13 @@ export struct MineSettingComponent {
91 if (item.type == 0) { 108 if (item.type == 0) {
92 Column() { 109 Column() {
93 this.getArrowCell(item,index) 110 this.getArrowCell(item,index)
94 - }.padding({ left: '27lpx' }).height('117lpx').justifyContent(FlexAlign.Center) 111 + }.padding({ left: `${this.calcHeight(27)}lpx` }).height(`${this.calcHeight(117)}lpx`).justifyContent(FlexAlign.Center)
95 } else if (item.type == 1) { 112 } else if (item.type == 1) {
96 Column() { 113 Column() {
97 this.getSwitchCell(item,index) 114 this.getSwitchCell(item,index)
98 - }.padding({ left: '27lpx' }).height('117lpx').justifyContent(FlexAlign.Center) 115 + }.padding({ left: `${this.calcHeight(27)}lpx` }).height(`${this.calcHeight(117)}lpx`).justifyContent(FlexAlign.Center)
99 } else { 116 } else {
100 - Column().width('100%').height('15lpx').backgroundColor(0xf0f0f0) 117 + Column().width('100%').height(`${this.calcHeight(15)}lpx`).backgroundColor(0xf0f0f0)
101 } 118 }
102 } 119 }
103 }) 120 })
@@ -112,7 +129,7 @@ export struct MineSettingComponent { @@ -112,7 +129,7 @@ export struct MineSettingComponent {
112 @Builder itemHead(text: string) { 129 @Builder itemHead(text: string) {
113 // 列表分组的头部组件,对应联系人分组A、B等位置的组件 130 // 列表分组的头部组件,对应联系人分组A、B等位置的组件
114 if (text.length > 0) { 131 if (text.length > 0) {
115 - Row().width('100%').height('20lpx').backgroundColor(0xf0f0f0) 132 + Row().width('100%').height(`${this.calcHeight(20)}lpx`).backgroundColor(0xf0f0f0)
116 } 133 }
117 } 134 }
118 135
@@ -125,28 +142,29 @@ export struct MineSettingComponent { @@ -125,28 +142,29 @@ export struct MineSettingComponent {
125 // 判断有没有图片 142 // 判断有没有图片
126 if (0) { 143 if (0) {
127 Image('https://pic.rmb.bdstatic.com/e182cf67c341d1128d2a6cc05886bf62.jpeg@s_0,h_2000') 144 Image('https://pic.rmb.bdstatic.com/e182cf67c341d1128d2a6cc05886bf62.jpeg@s_0,h_2000')
128 - .height('38lpx')  
129 - .margin({ right: '5lpx' }) 145 + .height(`${this.calcHeight(38)}lpx`)
  146 + .margin({ right: `${this.calcHeight(5)}lpx` })
130 147
131 Text(`${item.title}`) 148 Text(`${item.title}`)
132 - .margin({ top: '8lpx' })  
133 - .height('38lpx') 149 + .margin({ top: `${this.calcHeight(8)}lpx` })
  150 + .height(`${this.calcHeight(38)}lpx`)
134 .fontColor('#333333') 151 .fontColor('#333333')
135 - .fontSize('29lpx') 152 + .fontSize(`${this.calcHeight(29)}lpx`)
136 } else { 153 } else {
137 Text(`${item.title}`) 154 Text(`${item.title}`)
138 - .margin({ top: '8lpx' })  
139 - .height('38lpx') 155 + .margin({ top: `${this.calcHeight(8)}lpx` })
  156 + .height(`${this.calcHeight(38)}lpx`)
140 .fontColor('#333333') 157 .fontColor('#333333')
141 - .fontSize('29lpx') 158 + .fontSize(`${this.calcHeight(29)}lpx`)
142 } 159 }
143 }.width('60%') 160 }.width('60%')
144 161
145 // 右侧文案和右箭头 162 // 右侧文案和右箭头
146 Row() { 163 Row() {
147 Toggle({ type: ToggleType.Switch, isOn: item.switchState }) 164 Toggle({ type: ToggleType.Switch, isOn: item.switchState })
148 - .height('50lpx')  
149 - .margin({ left: '81lpx', right: '29lpx' }) 165 + .height(`${this.calcHeight(50)}lpx`)
  166 + .width(`${this.calcHeight(96)}lpx`)
  167 + .margin({ left: `${this.calcHeight(81)}lpx`, right: `${this.calcHeight(29)}lpx` })
150 .selectedColor("#ED2800") 168 .selectedColor("#ED2800")
151 .onChange((isOn: boolean) => { 169 .onChange((isOn: boolean) => {
152 if(item.itemType=='push_switch'){ 170 if(item.itemType=='push_switch'){
@@ -168,13 +186,13 @@ export struct MineSettingComponent { @@ -168,13 +186,13 @@ export struct MineSettingComponent {
168 } 186 }
169 }) 187 })
170 }.width('40%') 188 }.width('40%')
171 - .margin({ right: '29lpx' }) 189 + .margin({ right: `${this.calcHeight(29)}lpx` })
172 .justifyContent(FlexAlign.End) 190 .justifyContent(FlexAlign.End)
173 191
174 } 192 }
175 .alignItems(VerticalAlign.Center) 193 .alignItems(VerticalAlign.Center)
176 .justifyContent(FlexAlign.SpaceBetween) 194 .justifyContent(FlexAlign.SpaceBetween)
177 - }.height('54lpx') 195 + }.height(`${this.calcHeight(54)}lpx`)
178 } 196 }
179 197
180 // 右文字+箭头cell 198 // 右文字+箭头cell
@@ -185,10 +203,10 @@ export struct MineSettingComponent { @@ -185,10 +203,10 @@ export struct MineSettingComponent {
185 // 左侧logo和标题 203 // 左侧logo和标题
186 Row() { 204 Row() {
187 Text(`${item.title}`) 205 Text(`${item.title}`)
188 - .margin({ top: '8lpx' })  
189 - .height('38lpx') 206 + .margin({ top: `${this.calcHeight(8)}lpx` })
  207 + .height(`${this.calcHeight(38)}lpx`)
190 .fontColor('#333333') 208 .fontColor('#333333')
191 - .fontSize('29lpx') 209 + .fontSize(`${this.calcHeight(29)}lpx`)
192 }.width('60%') 210 }.width('60%')
193 211
194 // 右侧文案和右箭头 212 // 右侧文案和右箭头
@@ -197,13 +215,13 @@ export struct MineSettingComponent { @@ -197,13 +215,13 @@ export struct MineSettingComponent {
197 .fontColor('#999999') 215 .fontColor('#999999')
198 .maxLines(1) 216 .maxLines(1)
199 Image($r('app.media.mine_user_arrow_2')) 217 Image($r('app.media.mine_user_arrow_2'))
200 - .width('27lpx')  
201 - .height('27lpx') 218 + .width(`${this.calcHeight(27)}lpx`)
  219 + .height(`${this.calcHeight(27)}lpx`)
202 .objectFit(ImageFit.Auto) 220 .objectFit(ImageFit.Auto)
203 .interpolation(ImageInterpolation.High) 221 .interpolation(ImageInterpolation.High)
204 - Column().width('29lpx') 222 + Column().width(`${this.calcHeight(29)}lpx`)
205 }.width('40%') 223 }.width('40%')
206 - .margin({ right: '29lpx' }) 224 + .margin({ right: `${this.calcHeight(29)}lpx` })
207 .justifyContent(FlexAlign.End) 225 .justifyContent(FlexAlign.End)
208 226
209 } 227 }
@@ -211,7 +229,7 @@ export struct MineSettingComponent { @@ -211,7 +229,7 @@ export struct MineSettingComponent {
211 .justifyContent(FlexAlign.SpaceBetween) 229 .justifyContent(FlexAlign.SpaceBetween)
212 230
213 } 231 }
214 - .height('54lpx') 232 + .height(`${this.calcHeight(54)}lpx`)
215 .onClick(() => { 233 .onClick(() => {
216 if (item.itemType == 'account') { 234 if (item.itemType == 'account') {
217 trackButtonClick("settingPageAccountManagement") 235 trackButtonClick("settingPageAccountManagement")
@@ -266,6 +284,10 @@ export struct MineSettingComponent { @@ -266,6 +284,10 @@ export struct MineSettingComponent {
266 } 284 }
267 this.preferences.on('change', observer); 285 this.preferences.on('change', observer);
268 } 286 }
  287 +
  288 + calcHeight(value:number): number{
  289 + return value * this.percent
  290 + }
269 } 291 }
270 292
271 function trackButtonClick(buttonName: string){ 293 function trackButtonClick(buttonName: string){
@@ -43,8 +43,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent { @@ -43,8 +43,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
43 43
44 resetEdgeAnimation() { 44 resetEdgeAnimation() {
45 if (this.moreWidth > this.initMoreWidth) { 45 if (this.moreWidth > this.initMoreWidth) {
46 - this.moreWidth = this.moreWidth - 1  
47 - this.resetEdgeAnimation(); 46 + this.moreWidth = 16
48 } 47 }
49 this.resetMoreTips() 48 this.resetMoreTips()
50 } 49 }
@@ -141,21 +140,31 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent { @@ -141,21 +140,31 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
141 }) 140 })
142 }) 141 })
143 } 142 }
144 - if (this.compDTO.operDataList.length > 2) {  
145 - Column() {  
146 - if (this.moreWidth > this.initMoreWidth + 2) {  
147 - Text(this.moreTips)  
148 - .fontSize(8)  
149 - .fontColor(0x858585)  
150 - .width(8) 143 +
  144 + if (this.compDTO.operDataList.length >= 2 && (this.compDTO?.objectType === '0' || this.compDTO?.objectType === '')) {
  145 + Row() {
  146 + Ellipse()
  147 + .width(2* (this.moreWidth - this.initMoreWidth - 1))
  148 + .height(this.compDTO.operDataList.length == 2 ? 180 : 146)
  149 + .fill(0xf1f3f4)
  150 + .position({ left: -(this.moreWidth - this.initMoreWidth - 3) * 0.8 })
  151 +
  152 + Column() {
  153 + if (this.moreWidth > this.initMoreWidth + 2) {
  154 + Text(this.moreTips)
  155 + .fontSize(8)
  156 + .fontColor(0x858585)
  157 + .width(8)
  158 + }
151 } 159 }
  160 + .justifyContent(FlexAlign.Center)
  161 + .align(Alignment.Center)
  162 + .height(this.compDTO.operDataList.length == 2 ? 180 : 146)
  163 + .width(this.initMoreWidth)
  164 + .backgroundColor(0xf1f3f4)
  165 + .borderRadius({ topLeft: 5, bottomLeft: 5 })
152 } 166 }
153 - .justifyContent(FlexAlign.Center)  
154 - .align(Alignment.Center)  
155 - .width(this.moreWidth)  
156 - .backgroundColor(0xf1f3f4)  
157 - .borderRadius({ topLeft: 5, bottomLeft: 5 })  
158 - .height(this.compDTO.operDataList.length == 2 ? 180 : 146) 167 + .margin({left: 1.5 * (this.moreWidth - this.initMoreWidth)})
159 } 168 }
160 } 169 }
161 } 170 }
@@ -33,7 +33,8 @@ export struct LikeComponent { @@ -33,7 +33,8 @@ export struct LikeComponent {
33 styleType: number = 1 //1: 白色背景(图文底部栏) 2: 黑色背景(图集底部栏) 3 透明背景 33 styleType: number = 1 //1: 白色背景(图文底部栏) 2: 黑色背景(图集底部栏) 3 透明背景
34 @State likeCount: number = 0 //点赞数 34 @State likeCount: number = 0 //点赞数
35 pageParam: ParamType = {} 35 pageParam: ParamType = {}
36 - PageName: string = '' 36 + @Consume pageName: string
  37 + @Consume pageId: string
37 38
38 //上层传值 样例 39 //上层传值 样例
39 // this.data['contentId'] = '30035444649' //必须 40 // this.data['contentId'] = '30035444649' //必须
@@ -81,19 +82,6 @@ export struct LikeComponent { @@ -81,19 +82,6 @@ export struct LikeComponent {
81 'contentId': `${this.contentDetailData.newsId}`, 82 'contentId': `${this.contentDetailData.newsId}`,
82 'contentName': `${this.contentDetailData.newsTitle || ''}`, 83 'contentName': `${this.contentDetailData.newsTitle || ''}`,
83 } 84 }
84 - if(this.contentDetailData.newsType == 1) {  
85 - this.PageName = TrackConstants.PageName.VideoDetail // 点播  
86 - } else if(this.contentDetailData.newsType == 2) {  
87 - this.PageName = TrackConstants.PageName.Live_Detail // 直播  
88 - } else if(this.contentDetailData.newsType == 5) {  
89 - this.PageName = TrackConstants.PageName.Summary_Detail // 专题详情页  
90 - } else if(this.contentDetailData.newsType == 8) {  
91 - this.PageName = TrackConstants.PageName.Article_Detail // 图文详情页  
92 - } else if(this.contentDetailData.newsType == 9) {  
93 - this.PageName = TrackConstants.PageName.Atlas_Detail // 图集详情页  
94 - } else if(this.contentDetailData.newsType == 14 || this.contentDetailData.newsType == 15) {  
95 - this.PageName = TrackConstants.PageName.DynamicDetail // 动态图文/动态视频  
96 - }  
97 } 85 }
98 86
99 build() { 87 build() {
@@ -378,16 +366,16 @@ export struct LikeComponent { @@ -378,16 +366,16 @@ export struct LikeComponent {
378 if (this.contentDetailData.liveInfo) { 366 if (this.contentDetailData.liveInfo) {
379 this.likeStatus = true 367 this.likeStatus = true
380 this.likeCount++ 368 this.likeCount++
381 - TrackingContent.like(true,this.PageName,this.PageName,this.pageParam) 369 + TrackingContent.like(true,this.pageId,this.pageName,this.pageParam)
382 } else { 370 } else {
383 this.likeStatus = !this.likeStatus 371 this.likeStatus = !this.likeStatus
384 //点赞和取消点赞成功后更新点赞数 372 //点赞和取消点赞成功后更新点赞数
385 if (this.likeStatus) { 373 if (this.likeStatus) {
386 this.likeCount++ 374 this.likeCount++
387 - TrackingContent.like(true,this.PageName,this.PageName,this.pageParam) 375 + TrackingContent.like(true,this.pageId,this.pageName,this.pageParam)
388 } else { 376 } else {
389 this.likeCount-- 377 this.likeCount--
390 - TrackingContent.like(false,this.PageName,this.PageName,this.pageParam) 378 + TrackingContent.like(false,this.pageId,this.pageName,this.pageParam)
391 } 379 }
392 } 380 }
393 381
@@ -29,7 +29,6 @@ export struct LiveLikeComponent { @@ -29,7 +29,6 @@ export struct LiveLikeComponent {
29 @State likeCount: number = 0 //点赞数 29 @State likeCount: number = 0 //点赞数
30 @State likeBean: Record<string, string> = {} 30 @State likeBean: Record<string, string> = {}
31 pageParam: ParamType = {} 31 pageParam: ParamType = {}
32 - PageName: string = ''  
33 32
34 //上层传值 样例 33 //上层传值 样例
35 // this.data['contentId'] = '30035444649' //必须 34 // this.data['contentId'] = '30035444649' //必须
@@ -66,9 +65,6 @@ export struct LiveLikeComponent { @@ -66,9 +65,6 @@ export struct LiveLikeComponent {
66 'contentId': `${this.contentDetailData.newsId}`, 65 'contentId': `${this.contentDetailData.newsId}`,
67 'contentName': `${this.contentDetailData.newsTitle || ''}`, 66 'contentName': `${this.contentDetailData.newsTitle || ''}`,
68 } 67 }
69 - if (this.contentDetailData.newsType == 2) {  
70 - this.PageName = TrackConstants.PageName.Live_Detail // 直播  
71 - }  
72 } 68 }
73 69
74 build() { 70 build() {
@@ -11,7 +11,6 @@ import { @@ -11,7 +11,6 @@ import {
11 import router from '@ohos.router'; 11 import router from '@ohos.router';
12 import { MultiPictureDetailViewModel } from '../../viewmodel/MultiPictureDetailViewModel'; 12 import { MultiPictureDetailViewModel } from '../../viewmodel/MultiPictureDetailViewModel';
13 import { LiveLikeComponent } from './LiveLikeComponent'; 13 import { LiveLikeComponent } from './LiveLikeComponent';
14 -import { CommentTabComponent, CommentIconComponent, } from '../comment/view/CommentTabComponent';  
15 import { publishCommentModel } from '../comment/model/PublishCommentModel' 14 import { publishCommentModel } from '../comment/model/PublishCommentModel'
16 import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; 15 import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
17 import { PageRepository } from '../../repository/PageRepository'; 16 import { PageRepository } from '../../repository/PageRepository';
@@ -65,7 +64,8 @@ export struct LiveOperRowListView { @@ -65,7 +64,8 @@ export struct LiveOperRowListView {
65 @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 64 @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
66 @State dialogController: CustomDialogController | null = null; 65 @State dialogController: CustomDialogController | null = null;
67 pageParam: ParamType = {} 66 pageParam: ParamType = {}
68 - PageName: string = '' 67 + @Consume pageName: string
  68 + @Consume pageId: string
69 @State likesStyle: number | string = "love" // 点赞样式 love爱心型 thumb点赞手势 mourning 蜡烛(默哀) pray 祈福 69 @State likesStyle: number | string = "love" // 点赞样式 love爱心型 thumb点赞手势 mourning 蜡烛(默哀) pray 祈福
70 @State openLikes: boolean = false // 是否可以点赞 1:可以 0:不可以 70 @State openLikes: boolean = false // 是否可以点赞 1:可以 0:不可以
71 71
@@ -89,9 +89,6 @@ export struct LiveOperRowListView { @@ -89,9 +89,6 @@ export struct LiveOperRowListView {
89 'contentId': `${this.contentDetailData.newsId}`, 89 'contentId': `${this.contentDetailData.newsId}`,
90 'contentName': `${this.contentDetailData.newsTitle || ''}`, 90 'contentName': `${this.contentDetailData.newsTitle || ''}`,
91 } 91 }
92 - if(this.contentDetailData.newsType == 2) {  
93 - this.PageName = TrackConstants.PageName.Live_Detail // 直播  
94 - }  
95 } 92 }
96 93
97 async onDetailUpdated() { 94 async onDetailUpdated() {
@@ -426,9 +423,9 @@ export struct LiveOperRowListView { @@ -426,9 +423,9 @@ export struct LiveOperRowListView {
426 this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1 423 this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1
427 if (this.newsStatusOfUser.collectStatus === 1) { 424 if (this.newsStatusOfUser.collectStatus === 1) {
428 promptAction.showToast({ message: '收藏成功' }) 425 promptAction.showToast({ message: '收藏成功' })
429 - TrackingContent.collect(true,this.PageName,this.PageName,this.pageParam) 426 + TrackingContent.collect(true,this.pageId,this.pageName,this.pageParam)
430 } else { 427 } else {
431 - TrackingContent.collect(false,this.PageName,this.PageName,this.pageParam) 428 + TrackingContent.collect(false,this.pageId,this.pageName,this.pageParam)
432 } 429 }
433 this.queryContentInteractCount() 430 this.queryContentInteractCount()
434 } 431 }
@@ -89,7 +89,8 @@ export struct OperRowListView { @@ -89,7 +89,8 @@ export struct OperRowListView {
89 @State name: string = 'audio_recommend_status_wait' 89 @State name: string = 'audio_recommend_status_wait'
90 @State dialogController: CustomDialogController | null = null; 90 @State dialogController: CustomDialogController | null = null;
91 pageParam: ParamType = {} 91 pageParam: ParamType = {}
92 - PageName: string = '' 92 + @Consume pageName: string
  93 + @Consume pageId: string
93 @State likesStyle: number | string = 1 // 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空 94 @State likesStyle: number | string = 1 // 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空
94 @State openLikes: boolean = false // 是否可以点赞 1:可以 0:不可以 95 @State openLikes: boolean = false // 是否可以点赞 1:可以 0:不可以
95 96
@@ -119,19 +120,6 @@ export struct OperRowListView { @@ -119,19 +120,6 @@ export struct OperRowListView {
119 'contentId': `${this.contentDetailData.newsId}`, 120 'contentId': `${this.contentDetailData.newsId}`,
120 'contentName': `${this.contentDetailData.newsTitle || ''}`, 121 'contentName': `${this.contentDetailData.newsTitle || ''}`,
121 } 122 }
122 - if(this.contentDetailData.newsType == 1) {  
123 - this.PageName = TrackConstants.PageName.VideoDetail // 点播  
124 - } else if(this.contentDetailData.newsType == 2) {  
125 - this.PageName = TrackConstants.PageName.Live_Detail // 直播  
126 - } else if(this.contentDetailData.newsType == 5) {  
127 - this.PageName = TrackConstants.PageName.Summary_Detail // 专题详情页  
128 - } else if(this.contentDetailData.newsType == 8) {  
129 - this.PageName = TrackConstants.PageName.Article_Detail // 图文详情页  
130 - } else if(this.contentDetailData.newsType == 9) {  
131 - this.PageName = TrackConstants.PageName.Atlas_Detail // 图集详情页  
132 - } else if(this.contentDetailData.newsType == 14 || this.contentDetailData.newsType == 15) {  
133 - this.PageName = TrackConstants.PageName.DynamicDetail // 动态图文/动态视频  
134 - }  
135 } 123 }
136 124
137 async onDetailUpdated() { 125 async onDetailUpdated() {
@@ -376,7 +364,7 @@ export struct OperRowListView { @@ -376,7 +364,7 @@ export struct OperRowListView {
376 TapGesture() 364 TapGesture()
377 .onAction((event: GestureEvent) => { 365 .onAction((event: GestureEvent) => {
378 this.AudioSuspension.setPlayerUrl(this.audioUrl, this.audioTitle) 366 this.AudioSuspension.setPlayerUrl(this.audioUrl, this.audioTitle)
379 - TrackingButton.click('suspendedWindow',this.PageName,this.PageName) 367 + TrackingButton.click('suspendedWindow',this.pageId,this.pageName)
380 })) 368 }))
381 } 369 }
382 .height(36) 370 .height(36)
@@ -473,9 +461,9 @@ export struct OperRowListView { @@ -473,9 +461,9 @@ export struct OperRowListView {
473 this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1 461 this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1
474 if (this.newsStatusOfUser.collectStatus === 1) { 462 if (this.newsStatusOfUser.collectStatus === 1) {
475 promptAction.showToast({ message: '收藏成功' }) 463 promptAction.showToast({ message: '收藏成功' })
476 - TrackingContent.collect(true,this.PageName,this.PageName,this.pageParam) 464 + TrackingContent.collect(true,this.pageId,this.pageName,this.pageParam)
477 } else { 465 } else {
478 - TrackingContent.collect(false,this.PageName,this.PageName,this.pageParam) 466 + TrackingContent.collect(false,this.pageId,this.pageName,this.pageParam)
479 } 467 }
480 this.queryContentInteractCount() 468 this.queryContentInteractCount()
481 } 469 }
@@ -300,6 +300,7 @@ export struct ENewspaperListDialog { @@ -300,6 +300,7 @@ export struct ENewspaperListDialog {
300 }.width('100%') 300 }.width('100%')
301 .height('100%') 301 .height('100%')
302 .backgroundColor('#80000000') 302 .backgroundColor('#80000000')
  303 + .margin({bottom:44})
303 .onClick(() => { 304 .onClick(() => {
304 if (this.closeDialog) { 305 if (this.closeDialog) {
305 this.closeDialog() 306 this.closeDialog()
@@ -8,6 +8,7 @@ @@ -8,6 +8,7 @@
8 "tablet", 8 "tablet",
9 "2in1" 9 "2in1"
10 ], 10 ],
  11 + "compressNativeLibs": true,
11 "deliveryWithInstall": true, 12 "deliveryWithInstall": true,
12 "requestPermissions": [ 13 "requestPermissions": [
13 { 14 {
@@ -157,6 +157,10 @@ @@ -157,6 +157,10 @@
157 "value": "#0D000000" 157 "value": "#0D000000"
158 }, 158 },
159 { 159 {
  160 + "name": "color_B3000000",
  161 + "value": "#B3000000"
  162 + },
  163 + {
160 "name": "res_color_general_000000_30", 164 "name": "res_color_general_000000_30",
161 "value": "#4D000000" 165 "value": "#4D000000"
162 } 166 }
@@ -8,6 +8,7 @@ @@ -8,6 +8,7 @@
8 "tablet", 8 "tablet",
9 "2in1" 9 "2in1"
10 ], 10 ],
  11 + "compressNativeLibs": true,
11 "deliveryWithInstall": true, 12 "deliveryWithInstall": true,
12 "requestPermissions": [ 13 "requestPermissions": [
13 { 14 {
@@ -36,6 +36,8 @@ export struct DetailPlayLiveCommon { @@ -36,6 +36,8 @@ export struct DetailPlayLiveCommon {
36 @Provide pageBackPress: number = -1 36 @Provide pageBackPress: number = -1
37 @Provide contentDetailData: ContentDetailDTO = {} as ContentDetailDTO 37 @Provide contentDetailData: ContentDetailDTO = {} as ContentDetailDTO
38 @Provide publishCommentModel: publishCommentModel = new publishCommentModel() 38 @Provide publishCommentModel: publishCommentModel = new publishCommentModel()
  39 + @Provide pageId: string = TrackConstants.PageName.Live_Detail
  40 + @Provide pageName: string = TrackConstants.PageName.Live_Detail
39 // 横屏或竖屏 general-竖屏,news-横屏 41 // 横屏或竖屏 general-竖屏,news-横屏
40 @State liveLandscape: string = '' 42 @State liveLandscape: string = ''
41 @State isLoading: boolean = false 43 @State isLoading: boolean = false
@@ -9,7 +9,7 @@ import { router, window } from '@kit.ArkUI'; @@ -9,7 +9,7 @@ import { router, window } from '@kit.ArkUI';
9 import { WDAliPlayerController } from 'wdPlayer/Index'; 9 import { WDAliPlayerController } from 'wdPlayer/Index';
10 import { LiveOperRowListView } from 'wdComponent'; 10 import { LiveOperRowListView } from 'wdComponent';
11 import { publishCommentModel } from 'wdComponent/src/main/ets/components/comment/model/PublishCommentModel'; 11 import { publishCommentModel } from 'wdComponent/src/main/ets/components/comment/model/PublishCommentModel';
12 -import { TrackConstants, TrackingContent } from 'wdTracking/Index'; 12 +import { TrackConstants, TrackingContent, TrackParamConvert } from 'wdTracking/Index';
13 13
14 let TAG: string = 'DetailPlayLivePage'; 14 let TAG: string = 'DetailPlayLivePage';
15 15
@@ -98,12 +98,9 @@ export struct DetailPlayLivePage { @@ -98,12 +98,9 @@ export struct DetailPlayLivePage {
98 this.lastInputedChatComment = result 98 this.lastInputedChatComment = result
99 } 99 }
100 // 发布评论埋点 100 // 发布评论埋点
101 - TrackingContent.commentClick(TrackConstants.PageName.DynamicDetail, TrackConstants.PageName.DynamicDetail,  
102 - {  
103 - 'contentType': `${this.contentDetailData.newsType}`,  
104 - 'contentId': `${this.contentDetailData.newsId}`,  
105 - 'contentName': `${this.contentDetailData.newsTitle || ''}`,  
106 - }); 101 + TrackingContent.commentClick(TrackConstants.PageName.Live_Detail,
  102 + TrackConstants.PageName.Live_Detail,
  103 + TrackParamConvert.contentDetail(this.contentDetailData));
107 }) 104 })
108 } 105 }
109 } 106 }
@@ -11,7 +11,7 @@ import { ChartItemCompereComponent } from './ChartItemCompereComponent' @@ -11,7 +11,7 @@ import { ChartItemCompereComponent } from './ChartItemCompereComponent'
11 import { ChatItemComponent } from './ChartItemComponent' 11 import { ChatItemComponent } from './ChartItemComponent'
12 import { router } from '@kit.ArkUI' 12 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 -import { TrackConstants, TrackingContent } from 'wdTracking/Index' 14 +import { TrackConstants, TrackingContent, TrackParamConvert } from 'wdTracking/Index'
15 15
16 const TAG = "PlayerCommentComponent" 16 const TAG = "PlayerCommentComponent"
17 /** 17 /**
@@ -120,12 +120,9 @@ export struct PlayerCommentComponent { @@ -120,12 +120,9 @@ export struct PlayerCommentComponent {
120 }) 120 })
121 121
122 // 发布评论埋点 122 // 发布评论埋点
123 - TrackingContent.commentClick(TrackConstants.PageName.DynamicDetail, TrackConstants.PageName.DynamicDetail,  
124 - {  
125 - 'contentType': `${this.contentDetailData.newsType}`,  
126 - 'contentId': `${this.contentDetailData.newsId}`,  
127 - 'contentName': `${this.contentDetailData.newsTitle || ''}`,  
128 - }); 123 + TrackingContent.commentClick(TrackConstants.PageName.Live_Detail,
  124 + TrackConstants.PageName.Live_Detail,
  125 + TrackParamConvert.contentDetail(this.contentDetailData));
129 } 126 }
130 }, 127 },
131 onBack: () => { 128 onBack: () => {
@@ -8,6 +8,7 @@ @@ -8,6 +8,7 @@
8 "tablet", 8 "tablet",
9 "2in1" 9 "2in1"
10 ], 10 ],
  11 + "compressNativeLibs": true,
11 "deliveryWithInstall": true, 12 "deliveryWithInstall": true,
12 "pages": "$profile:main_pages", 13 "pages": "$profile:main_pages",
13 "requestPermissions": [ 14 "requestPermissions": [
@@ -13,7 +13,7 @@ import { PlayerBottomView } from '../view/PlayerBottomView'; @@ -13,7 +13,7 @@ import { PlayerBottomView } from '../view/PlayerBottomView';
13 import { PlayerRightView } from '../view/PlayerRightView'; 13 import { PlayerRightView } from '../view/PlayerRightView';
14 import { DisplayDirection } from 'wdConstant/Index'; 14 import { DisplayDirection } from 'wdConstant/Index';
15 import { CommentDialogView } from '../view/CommentDialogView'; 15 import { CommentDialogView } from '../view/CommentDialogView';
16 -import { window } from '@kit.ArkUI'; 16 +import { componentUtils, window } from '@kit.ArkUI';
17 import { PlayerFullScreenView } from '../view/PlayerFullScreenView'; 17 import { PlayerFullScreenView } from '../view/PlayerFullScreenView';
18 import { OperRowListView, publishCommentModel } from 'wdComponent/Index'; 18 import { OperRowListView, publishCommentModel } from 'wdComponent/Index';
19 import { ParamType, TrackConstants } from 'wdTracking/Index'; 19 import { ParamType, TrackConstants } from 'wdTracking/Index';
@@ -207,15 +207,18 @@ export struct DetailPlayShortVideoPage { @@ -207,15 +207,18 @@ export struct DetailPlayShortVideoPage {
207 * 屏幕变化动态计算播放器宽高 207 * 屏幕变化动态计算播放器宽高
208 */ 208 */
209 calculatePlayerRect() { 209 calculatePlayerRect() {
210 - let width = this.windowWidth  
211 - let height = this.windowHeight  
212 - if (this.displayDirection === DisplayDirection.VERTICAL) {  
213 - width = this.windowWidth  
214 - height = this.windowHeight  
215 - } else {  
216 - width = this.windowHeight  
217 - height = this.windowWidth  
218 - } 210 + const windowClass = WindowModel.shared.getWindowClass(); // 获取应用主窗口
  211 + const rect: window.Rect = windowClass.getWindowProperties().windowRect;
  212 +
  213 + let width = rect.width
  214 + let height = rect.height
  215 + // if (this.displayDirection === DisplayDirection.VERTICAL) {
  216 + width = rect.width
  217 + height = rect.height
  218 + // } else {
  219 + // width = rect.height
  220 + // height = rect.width
  221 + // }
219 // 视频宽高比屏幕大,则宽度撑满 222 // 视频宽高比屏幕大,则宽度撑满
220 if (this.ratio > width / height) { 223 if (this.ratio > width / height) {
221 this.playerWidth = '100%' 224 this.playerWidth = '100%'
@@ -225,7 +228,7 @@ export struct DetailPlayShortVideoPage { @@ -225,7 +228,7 @@ export struct DetailPlayShortVideoPage {
225 this.playerHeight = '100%' 228 this.playerHeight = '100%'
226 this.playerWidth = px2vp(height * this.ratio) 229 this.playerWidth = px2vp(height * this.ratio)
227 } 230 }
228 - console.log('calculatePlayerRect=====', this.windowWidth, this.windowHeight) 231 + console.log('calculatePlayerRect=====', width, height)
229 232
230 } 233 }
231 234
@@ -287,6 +290,7 @@ export struct DetailPlayShortVideoPage { @@ -287,6 +290,7 @@ export struct DetailPlayShortVideoPage {
287 .width('100%') 290 .width('100%')
288 291
289 } 292 }
  293 + .id('video-container')
290 .height('100%') 294 .height('100%')
291 .width('100%') 295 .width('100%')
292 .onAreaChange(() => this.calculatePlayerRect()) 296 .onAreaChange(() => this.calculatePlayerRect())
@@ -314,7 +318,9 @@ export struct DetailPlayShortVideoPage { @@ -314,7 +318,9 @@ export struct DetailPlayShortVideoPage {
314 318
315 @Builder 319 @Builder
316 playerViewBuilder() { 320 playerViewBuilder() {
317 - Stack({alignContent: this.showCommentList && this.index === this.currentIndex ? Alignment.Top : Alignment.Center}) { 321 + Stack({
  322 + alignContent: this.showCommentList && this.index === this.currentIndex ? Alignment.Top : Alignment.Center
  323 + }) {
318 WDPlayerRenderView({ 324 WDPlayerRenderView({
319 playerController: this.playerController, 325 playerController: this.playerController,
320 onLoad: async () => { 326 onLoad: async () => {
@@ -31,6 +31,8 @@ export struct DetailVideoListPage { @@ -31,6 +31,8 @@ export struct DetailVideoListPage {
31 @Provide switchVideoStatus: boolean = true 31 @Provide switchVideoStatus: boolean = true
32 @Provide displayDirection: DisplayDirection = DisplayDirection.VERTICAL 32 @Provide displayDirection: DisplayDirection = DisplayDirection.VERTICAL
33 @Provide showCommentList: boolean = false 33 @Provide showCommentList: boolean = false
  34 + @Provide pageName: string = TrackConstants.PageName.VideoDetail
  35 + @Provide pageId: string = TrackConstants.PageName.VideoDetail
34 @State data: ContentDetailDTO[] = [] 36 @State data: ContentDetailDTO[] = []
35 @State currentIndex: number = 0 37 @State currentIndex: number = 0
36 @State netStatus: number | undefined = undefined // 存储网络状态用来展示缺省图 38 @State netStatus: number | undefined = undefined // 存储网络状态用来展示缺省图
@@ -30,7 +30,8 @@ const storage = LocalStorage.getShared(); @@ -30,7 +30,8 @@ const storage = LocalStorage.getShared();
30 @Component 30 @Component
31 export struct VideoChannelDetail { 31 export struct VideoChannelDetail {
32 private groupId: string = '' // 楼层id 32 private groupId: string = '' // 楼层id
33 - private pageId: string = '' //页面id 33 + @Provide private pageId: string = '' //页面id
  34 + @Provide private pageName: string = ''
34 private pageNum: number = 1 35 private pageNum: number = 1
35 private pageSize: number = 5 36 private pageSize: number = 5
36 private loadStrategy: string = 'first_load' // 首次加载: first_load, 上推刷新: push_up, 下拉刷新: pull_down 37 private loadStrategy: string = 'first_load' // 首次加载: first_load, 上推刷新: push_up, 下拉刷新: pull_down
@@ -41,7 +41,8 @@ export struct PlayerRightView { @@ -41,7 +41,8 @@ export struct PlayerRightView {
41 @State likesStyle: number | string = 1 // 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空 41 @State likesStyle: number | string = 1 // 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空
42 @State openLikes: boolean = false // 是否可以点赞 1:可以 0:不可以 42 @State openLikes: boolean = false // 是否可以点赞 1:可以 0:不可以
43 pageParam: ParamType = {} 43 pageParam: ParamType = {}
44 - PageName: string = '' 44 + @Consume pageName: string
  45 + @Consume pageId: string
45 followUserId: string = '' 46 followUserId: string = ''
46 followUserName: string = '' 47 followUserName: string = ''
47 48
@@ -59,19 +60,6 @@ export struct PlayerRightView { @@ -59,19 +60,6 @@ export struct PlayerRightView {
59 'contentId': `${this.contentDetailData.newsId}`, 60 'contentId': `${this.contentDetailData.newsId}`,
60 'contentName': `${this.contentDetailData.newsTitle || ''}`, 61 'contentName': `${this.contentDetailData.newsTitle || ''}`,
61 } 62 }
62 - if(this.contentDetailData.newsType == 1) {  
63 - this.PageName = TrackConstants.PageName.VideoDetail // 点播  
64 - } else if(this.contentDetailData.newsType == 2) {  
65 - this.PageName = TrackConstants.PageName.Live_Detail // 直播  
66 - } else if(this.contentDetailData.newsType == 5) {  
67 - this.PageName = TrackConstants.PageName.Summary_Detail // 专题详情页  
68 - } else if(this.contentDetailData.newsType == 8) {  
69 - this.PageName = TrackConstants.PageName.Article_Detail // 图文详情页  
70 - } else if(this.contentDetailData.newsType == 9) {  
71 - this.PageName = TrackConstants.PageName.Atlas_Detail // 图集详情页  
72 - } else if(this.contentDetailData.newsType == 14 || this.contentDetailData.newsType == 15) {  
73 - this.PageName = TrackConstants.PageName.DynamicDetail // 动态图文/动态视频  
74 - }  
75 this.followUserId = this.contentDetailData?.rmhInfo?.rmhId || '' 63 this.followUserId = this.contentDetailData?.rmhInfo?.rmhId || ''
76 this.followUserName = this.contentDetailData?.rmhInfo?.rmhName || '' 64 this.followUserName = this.contentDetailData?.rmhInfo?.rmhName || ''
77 } 65 }
@@ -104,11 +92,11 @@ export struct PlayerRightView { @@ -104,11 +92,11 @@ export struct PlayerRightView {
104 this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus == '1' ? '0' : '1' 92 this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus == '1' ? '0' : '1'
105 if (this.newsStatusOfUser.likeStatus == '1') { 93 if (this.newsStatusOfUser.likeStatus == '1') {
106 this.interactData.likeNum = Number(this.interactData.likeNum || 0) + 1 94 this.interactData.likeNum = Number(this.interactData.likeNum || 0) + 1
107 - TrackingContent.like(true,this.PageName,this.PageName,this.pageParam) 95 + TrackingContent.like(true,this.pageId,this.pageName,this.pageParam)
108 console.log(TAG, '点赞') 96 console.log(TAG, '点赞')
109 } else { 97 } else {
110 this.interactData.likeNum = Math.max(0, Number(this.interactData.likeNum || 0) - 1) 98 this.interactData.likeNum = Math.max(0, Number(this.interactData.likeNum || 0) - 1)
111 - TrackingContent.like(false,this.PageName,this.PageName,this.pageParam) 99 + TrackingContent.like(false,this.pageId,this.pageName,this.pageParam)
112 console.log(TAG, '取消点赞') 100 console.log(TAG, '取消点赞')
113 } 101 }
114 console.log(TAG, '点赞、取消点赞==', this.newsStatusOfUser?.likeStatus, this.interactData?.likeNum) 102 console.log(TAG, '点赞、取消点赞==', this.newsStatusOfUser?.likeStatus, this.interactData?.likeNum)
@@ -144,11 +132,11 @@ export struct PlayerRightView { @@ -144,11 +132,11 @@ export struct PlayerRightView {
144 // this.queryContentInteractCount() 132 // this.queryContentInteractCount()
145 if (this.newsStatusOfUser.collectStatus === 1) { 133 if (this.newsStatusOfUser.collectStatus === 1) {
146 this.interactData.collectNum = Number(this.interactData.collectNum || 0) + 1 134 this.interactData.collectNum = Number(this.interactData.collectNum || 0) + 1
147 - TrackingContent.collect(true,this.PageName,this.PageName,this.pageParam) 135 + TrackingContent.collect(true,this.pageId,this.pageName,this.pageParam)
148 console.log(TAG, '收藏') 136 console.log(TAG, '收藏')
149 } else { 137 } else {
150 this.interactData.collectNum = Math.max(0, Number(this.interactData.collectNum || 0) - 1) 138 this.interactData.collectNum = Math.max(0, Number(this.interactData.collectNum || 0) - 1)
151 - TrackingContent.collect(false,this.PageName,this.PageName,this.pageParam) 139 + TrackingContent.collect(false,this.pageId,this.pageName,this.pageParam)
152 console.log(TAG, '取消收藏') 140 console.log(TAG, '取消收藏')
153 } 141 }
154 console.log(TAG, '收藏、取消收藏==', this.newsStatusOfUser?.collectStatus, this.interactData?.collectNum) 142 console.log(TAG, '收藏、取消收藏==', this.newsStatusOfUser?.collectStatus, this.interactData?.collectNum)
@@ -212,7 +200,7 @@ export struct PlayerRightView { @@ -212,7 +200,7 @@ export struct PlayerRightView {
212 } 200 }
213 }) 201 })
214 console.log(TAG, '关注号主') 202 console.log(TAG, '关注号主')
215 - TrackingContent.follow(true,this.followUserId,this.followUserName,TrackConstants.PageName.Atlas_Detail,TrackConstants.PageName.Atlas_Detail,this.pageParam) 203 + TrackingContent.follow(true,this.followUserId,this.followUserName,this.pageId,this.pageName,this.pageParam)
216 } 204 }
217 }) 205 })
218 } 206 }
@@ -8,6 +8,7 @@ @@ -8,6 +8,7 @@
8 "tablet", 8 "tablet",
9 "2in1" 9 "2in1"
10 ], 10 ],
  11 + "compressNativeLibs": true,
11 "deliveryWithInstall": true, 12 "deliveryWithInstall": true,
12 "pages": "$profile:main_pages" 13 "pages": "$profile:main_pages"
13 } 14 }
@@ -8,6 +8,7 @@ @@ -8,6 +8,7 @@
8 "tablet", 8 "tablet",
9 "2in1" 9 "2in1"
10 ], 10 ],
  11 + "compressNativeLibs": true,
11 "deliveryWithInstall": true, 12 "deliveryWithInstall": true,
12 "pages": "$profile:main_pages" 13 "pages": "$profile:main_pages"
13 } 14 }
@@ -8,6 +8,7 @@ @@ -8,6 +8,7 @@
8 "tablet", 8 "tablet",
9 "2in1" 9 "2in1"
10 ], 10 ],
  11 + "compressNativeLibs": true,
11 "deliveryWithInstall": true, 12 "deliveryWithInstall": true,
12 "pages": "$profile:main_pages", 13 "pages": "$profile:main_pages",
13 "requestPermissions": [ 14 "requestPermissions": [
@@ -8,6 +8,7 @@ @@ -8,6 +8,7 @@
8 "tablet", 8 "tablet",
9 "2in1" 9 "2in1"
10 ], 10 ],
  11 + "compressNativeLibs": true,
11 "deliveryWithInstall": true 12 "deliveryWithInstall": true
12 } 13 }
13 } 14 }
1 -import { Logger, EmitterEventId, EmitterUtils, DateTimeUtils,CustomToast, StringUtils, NetworkUtil } from 'wdKit' 1 +import { Logger, EmitterEventId, EmitterUtils, DateTimeUtils,CustomToast, StringUtils, NetworkUtil,
  2 + BreakpointSystem } from 'wdKit'
2 import router from '@ohos.router' 3 import router from '@ohos.router'
3 import { LoginViewModel } from './LoginViewModel' 4 import { LoginViewModel } from './LoginViewModel'
4 import { LoginInputComponent } from './LoginInputComponent' 5 import { LoginInputComponent } from './LoginInputComponent'
@@ -56,6 +57,17 @@ struct LoginPage { @@ -56,6 +57,17 @@ struct LoginPage {
56 57
57 loginViewModel = new LoginViewModel() 58 loginViewModel = new LoginViewModel()
58 @State isProtocol:boolean=false 59 @State isProtocol:boolean=false
  60 + @StorageProp('currentBreakpoint') @Watch("currentChanged")currentBreakpoint: string = 'sm';
  61 + private breakpointSystem = new BreakpointSystem();
  62 + @State percent:number = 1
  63 +
  64 + currentChanged(){
  65 + if(this.currentBreakpoint == "md" || this.currentBreakpoint == "lg"){
  66 + this.percent = 0.7
  67 + }else {
  68 + this.percent = 1
  69 + }
  70 + }
59 onCodeSend() { 71 onCodeSend() {
60 Logger.debug(TAG, "isCodeSend:" + this.isCodeSend + "") 72 Logger.debug(TAG, "isCodeSend:" + this.isCodeSend + "")
61 if (this.isCodeSend) { 73 if (this.isCodeSend) {
@@ -66,6 +78,12 @@ struct LoginPage { @@ -66,6 +78,12 @@ struct LoginPage {
66 78
67 aboutToAppear() { 79 aboutToAppear() {
68 Logger.debug(TAG, "aboutToAppear:" + this.isCodeSend + "") 80 Logger.debug(TAG, "aboutToAppear:" + this.isCodeSend + "")
  81 + this.breakpointSystem.register();
  82 + this.currentChanged()
  83 + }
  84 +
  85 + aboutToDisappear(): void {
  86 + this.breakpointSystem.unregister();
69 } 87 }
70 88
71 onPageShow() { 89 onPageShow() {
@@ -144,10 +162,10 @@ struct LoginPage { @@ -144,10 +162,10 @@ struct LoginPage {
144 Text("登录") 162 Text("登录")
145 .borderRadius(4) 163 .borderRadius(4)
146 .fontColor(this.isSubmit ? "#FFFFFFFF" : "#66FFFFFF") 164 .fontColor(this.isSubmit ? "#FFFFFFFF" : "#66FFFFFF")
147 - .fontSize("31lpx") 165 + .fontSize(`${this.calcHeight(31)}lpx`)
148 .fontWeight(400) 166 .fontWeight(400)
149 - .margin({ top: 20 })  
150 - .lineHeight("50lpx") 167 + .margin({ top: `${this.calcHeight(20)}` })
  168 + .lineHeight(`${this.calcHeight(50)}lpx`)
151 .height(44) 169 .height(44)
152 .textAlign(TextAlign.Center) 170 .textAlign(TextAlign.Center)
153 .width("100%") 171 .width("100%")
@@ -170,9 +188,9 @@ struct LoginPage { @@ -170,9 +188,9 @@ struct LoginPage {
170 if (!this.checkCodePage) { 188 if (!this.checkCodePage) {
171 Text('忘记密码') 189 Text('忘记密码')
172 .fontColor('#666666') 190 .fontColor('#666666')
173 - .fontSize("31lpx") 191 + .fontSize(`${this.calcHeight(31)}lpx`)
174 .fontWeight(400) 192 .fontWeight(400)
175 - .lineHeight("38lpx") 193 + .lineHeight(`${this.calcHeight(38)}lpx`)
176 .margin({ top: 16 }) 194 .margin({ top: 16 })
177 .onClick(() => { 195 .onClick(() => {
178 TrackingButton.click("loginPageForgotPassword",TrackConstants.PageName.Login_Page,TrackConstants.PageName.Login_Page) 196 TrackingButton.click("loginPageForgotPassword",TrackConstants.PageName.Login_Page,TrackConstants.PageName.Login_Page)
@@ -217,7 +235,8 @@ struct LoginPage { @@ -217,7 +235,8 @@ struct LoginPage {
217 235
218 ProtocolComponent({ 236 ProtocolComponent({
219 cancelMethod: (): void => this.cancelProtocol(), 237 cancelMethod: (): void => this.cancelProtocol(),
220 - agreeMethod: (): void => this.agreeProtocol() 238 + agreeMethod: (): void => this.agreeProtocol(),
  239 + percent:$percent
221 }) 240 })
222 .visibility(this.isProtocol ? Visibility.Visible : Visibility.None) 241 .visibility(this.isProtocol ? Visibility.Visible : Visibility.None)
223 242
@@ -301,15 +320,15 @@ struct LoginPage { @@ -301,15 +320,15 @@ struct LoginPage {
301 Row() { 320 Row() {
302 Row() { 321 Row() {
303 Image(this.checkCodePage ? $r('app.media.login_qt') : $r('app.media.login_other_password')) 322 Image(this.checkCodePage ? $r('app.media.login_qt') : $r('app.media.login_other_password'))
304 - .size({ width: "35lpx", height: "35lpx" })  
305 - .margin({right:"8lpx"})  
306 - .height("38lpx")  
307 - .width("38lpx") 323 + .size({ width: `${this.calcHeight(35)}lpx`, height: `${this.calcHeight(35)}lpx` })
  324 + .margin({right:`${this.calcHeight(8)}lpx`})
  325 + .height(`${this.calcHeight(38)}lpx`)
  326 + .width(`${this.calcHeight(38)}lpx`)
308 Text(this.checkCodePage ? "密码登录" : "手机号登录") 327 Text(this.checkCodePage ? "密码登录" : "手机号登录")
309 .fontWeight(400) 328 .fontWeight(400)
310 .fontColor("#3D3D3D") 329 .fontColor("#3D3D3D")
311 - .fontSize("23lpx")  
312 - .lineHeight("38lpx") 330 + .fontSize(`${this.calcHeight(23)}lpx`)
  331 + .lineHeight(`${this.calcHeight(38)}lpx`)
313 } 332 }
314 .onClick(() => { 333 .onClick(() => {
315 this.onPageHide() 334 this.onPageHide()
@@ -332,7 +351,7 @@ struct LoginPage { @@ -332,7 +351,7 @@ struct LoginPage {
332 }.height(36) 351 }.height(36)
333 .width('100%') 352 .width('100%')
334 .padding({ left: 25, right: 25 }) 353 .padding({ left: 25, right: 25 })
335 - .margin({ top: "46lpx" }) 354 + .margin({ top: `${this.calcHeight(46)}lpx` })
336 } 355 }
337 .width('100%') 356 .width('100%')
338 .margin({ bottom: 40 }) 357 .margin({ bottom: 40 })
@@ -478,7 +497,9 @@ struct LoginPage { @@ -478,7 +497,9 @@ struct LoginPage {
478 .slide(SlideEffect.Right) 497 .slide(SlideEffect.Right)
479 } 498 }
480 499
481 - 500 + calcHeight(value:number): number{
  501 + return value * this.percent
  502 + }
482 } 503 }
483 504
484 505
@@ -486,41 +507,42 @@ struct LoginPage { @@ -486,41 +507,42 @@ struct LoginPage {
486 struct ProtocolComponent { 507 struct ProtocolComponent {
487 cancelMethod?: () => void 508 cancelMethod?: () => void
488 agreeMethod?: () => void 509 agreeMethod?: () => void
  510 + @Link percent:number
489 511
490 build() { 512 build() {
491 Stack() { 513 Stack() {
492 Column() { 514 Column() {
493 Text("温馨提示") 515 Text("温馨提示")
494 .fontColor("#222222") 516 .fontColor("#222222")
495 - .fontSize("35lpx")  
496 - .lineHeight("50lpx") 517 + .fontSize(`${this.calcHeight(35)}lpx`)
  518 + .lineHeight(`${this.calcHeight(50)}lpx`)
497 .width("100%") 519 .width("100%")
498 .fontWeight(500) 520 .fontWeight(500)
499 .textAlign(TextAlign.Center) 521 .textAlign(TextAlign.Center)
500 - .margin({ top: "38lpx" }) 522 + .margin({ top: `${this.calcHeight(38)}lpx` })
501 Text() { 523 Text() {
502 Span("为保障您的合法权益,请阅读并同意") 524 Span("为保障您的合法权益,请阅读并同意")
503 - .fontSize("27lpx")  
504 - .lineHeight("42lpx") 525 + .fontSize(`${this.calcHeight(27)}lpx`)
  526 + .lineHeight(`${this.calcHeight(42)}lpx`)
505 .fontWeight(400) 527 .fontWeight(400)
506 .fontColor("#666666") 528 .fontColor("#666666")
507 529
508 Span("《用户协议》") 530 Span("《用户协议》")
509 - .fontSize("27lpx")  
510 - .lineHeight("42lpx") 531 + .fontSize(`${this.calcHeight(27)}lpx`)
  532 + .lineHeight(`${this.calcHeight(42)}lpx`)
511 .fontWeight(400) 533 .fontWeight(400)
512 .fontColor("#ED2800") 534 .fontColor("#ED2800")
513 .onClick(() => { 535 .onClick(() => {
514 let bean = { contentID: "1", pageID: "" } as Params 536 let bean = { contentID: "1", pageID: "" } as Params
515 WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage, bean) 537 WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage, bean)
516 }) 538 })
517 - Span("及").fontSize("27lpx")  
518 - .lineHeight("42lpx") 539 + Span("及").fontSize(`${this.calcHeight(27)}lpx`)
  540 + .lineHeight(`${this.calcHeight(42)}lpx`)
519 .fontWeight(400) 541 .fontWeight(400)
520 .fontColor("#666666") 542 .fontColor("#666666")
521 Span("《隐私政策》") 543 Span("《隐私政策》")
522 - .fontSize("27lpx")  
523 - .lineHeight("42lpx") 544 + .fontSize(`${this.calcHeight(27)}lpx`)
  545 + .lineHeight(`${this.calcHeight(42)}lpx`)
524 .fontWeight(400) 546 .fontWeight(400)
525 .fontColor("#ED2800") 547 .fontColor("#ED2800")
526 .onClick(() => { 548 .onClick(() => {
@@ -528,20 +550,20 @@ struct ProtocolComponent { @@ -528,20 +550,20 @@ struct ProtocolComponent {
528 WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage, bean) 550 WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage, bean)
529 }) 551 })
530 Span("后进行登录") 552 Span("后进行登录")
531 - .fontSize("27lpx")  
532 - .lineHeight("42lpx") 553 + .fontSize(`${this.calcHeight(27)}lpx`)
  554 + .lineHeight(`${this.calcHeight(42)}lpx`)
533 .fontWeight(400) 555 .fontWeight(400)
534 .fontColor("#666666") 556 .fontColor("#666666")
535 - }.margin({ top: "23lpx", left: "31lpx", right: "31lpx" }) 557 + }.margin({ top: `${this.calcHeight(23)}lpx`, left: `${this.calcHeight(31)}lpx`, right: `${this.calcHeight(31)}lpx` })
536 .wordBreak(WordBreak.BREAK_ALL) 558 .wordBreak(WordBreak.BREAK_ALL)
537 .textAlign(TextAlign.Start) 559 .textAlign(TextAlign.Start)
538 560
539 - Divider().color("#f5f5f5").width("100%").margin({ top: "27lpx" }).height('1lpx').strokeWidth('1lpx') 561 + Divider().color("#f5f5f5").width("100%").margin({ top: `${this.calcHeight(27)}lpx` }).height(`${this.calcHeight(1)}lpx`).strokeWidth(`${this.calcHeight(1)}lpx`)
540 Row() { 562 Row() {
541 Text('放弃登录') 563 Text('放弃登录')
542 - .fontSize("31lpx") 564 + .fontSize(`${this.calcHeight(31)}lpx`)
543 .fontWeight(500) 565 .fontWeight(500)
544 - .lineHeight("42lpx") 566 + .lineHeight(`${this.calcHeight(42)}lpx`)
545 .fontColor("#999999") 567 .fontColor("#999999")
546 .layoutWeight(1) 568 .layoutWeight(1)
547 .textAlign(TextAlign.Center) 569 .textAlign(TextAlign.Center)
@@ -553,17 +575,17 @@ struct ProtocolComponent { @@ -553,17 +575,17 @@ struct ProtocolComponent {
553 .height('100%') 575 .height('100%')
554 576
555 Divider() 577 Divider()
556 - .width("1lpx")  
557 - .strokeWidth('1lpx') 578 + .width(`${this.calcHeight(1)}lpx`)
  579 + .strokeWidth(`${this.calcHeight(1)}lpx`)
558 .vertical(true) 580 .vertical(true)
559 .height('100%') 581 .height('100%')
560 .color("#F5F5F5") 582 .color("#F5F5F5")
561 583
562 584
563 Text('同意并登录') 585 Text('同意并登录')
564 - .fontSize("31lpx") 586 + .fontSize(`${this.calcHeight(31)}lpx`)
565 .fontWeight(500) 587 .fontWeight(500)
566 - .lineHeight("42lpx") 588 + .lineHeight(`${this.calcHeight(42)}lpx`)
567 .fontColor("#ED2800") 589 .fontColor("#ED2800")
568 .layoutWeight(1) 590 .layoutWeight(1)
569 .textAlign(TextAlign.Center) 591 .textAlign(TextAlign.Center)
@@ -582,15 +604,19 @@ struct ProtocolComponent { @@ -582,15 +604,19 @@ struct ProtocolComponent {
582 .justifyContent(FlexAlign.Center) 604 .justifyContent(FlexAlign.Center)
583 } 605 }
584 .backgroundColor(Color.White) 606 .backgroundColor(Color.White)
585 - .borderRadius("12lpx")  
586 - .width("528lpx")  
587 - .height("309lpx") 607 + .borderRadius(`${this.calcHeight(12)}lpx`)
  608 + .width(`${this.calcHeight(528)}lpx`)
  609 + .height(`${this.calcHeight(309)}lpx`)
588 610
589 }.width('100%') 611 }.width('100%')
590 .height('100%') 612 .height('100%')
591 .backgroundColor('#66000000') 613 .backgroundColor('#66000000')
592 614
593 } 615 }
  616 +
  617 + calcHeight(value:number): number{
  618 + return value * this.percent
  619 + }
594 } 620 }
595 621
596 function trackTypeClick(typeValue: number,pageId: string){ 622 function trackTypeClick(typeValue: number,pageId: string){
1 -import { CustomToast, DateTimeUtils} from 'wdKit/Index'; 1 +import { BreakpointSystem, CustomToast, DateTimeUtils} from 'wdKit/Index';
2 import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; 2 import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
3 import { LoginModel } from './LoginModel'; 3 import { LoginModel } from './LoginModel';
4 import { ModifyPasswordRequestItem } from './ModifyPasswordRequestItem'; 4 import { ModifyPasswordRequestItem } from './ModifyPasswordRequestItem';
@@ -29,6 +29,27 @@ struct ModifyPasswordPage { @@ -29,6 +29,27 @@ struct ModifyPasswordPage {
29 }) 29 })
30 pageShowTime:number = 0; 30 pageShowTime:number = 0;
31 pageHideTime:number = 0; 31 pageHideTime:number = 0;
  32 + @StorageProp('currentBreakpoint') @Watch("currentChanged")currentBreakpoint: string = 'sm';
  33 + private breakpointSystem = new BreakpointSystem();
  34 + @State percent:number = 1
  35 +
  36 + currentChanged(){
  37 + if(this.currentBreakpoint == "md" || this.currentBreakpoint == "lg"){
  38 + this.percent = 0.7
  39 + }else {
  40 + this.percent = 1
  41 + }
  42 + }
  43 +
  44 + aboutToAppear() {
  45 + this.breakpointSystem.register();
  46 + this.currentChanged()
  47 + }
  48 +
  49 + aboutToDisappear(): void {
  50 + this.breakpointSystem.unregister();
  51 + }
  52 +
32 53
33 onPageShow() { 54 onPageShow() {
34 this.pageShowTime = DateTimeUtils.getTimeStamp() 55 this.pageShowTime = DateTimeUtils.getTimeStamp()
@@ -42,25 +63,54 @@ struct ModifyPasswordPage { @@ -42,25 +63,54 @@ struct ModifyPasswordPage {
42 } 63 }
43 64
44 build() { 65 build() {
45 - Row() {  
46 - Column() {  
47 - this.ModifyPasswordLayout()  
48 - }  
49 - .width('100%')  
50 - .height('100%')  
51 - }.width('100%')  
52 - .height('100%') 66 + Column(){
  67 + this.TitleBackComponent('')
  68 + this.ModifyPasswordLayout()
  69 + }
  70 +
  71 + }
  72 +
  73 + @Builder TitleBackComponent(title:string){
  74 + RelativeContainer() {
  75 + Text(title)
  76 + .fontColor('#FF333333')
  77 + .fontSize(18)
  78 + .textAlign(TextAlign.Center)
  79 + .height(44)
  80 + .alignRules({
  81 + top: { anchor: "__container__", align: VerticalAlign.Top },
  82 + left: { anchor: "__container__", align: HorizontalAlign.Start },
  83 + right: { anchor: "__container__", align: HorizontalAlign.End },
  84 +
  85 + })
  86 + .id('titleContent')
  87 + Image($r("app.media.login_back_icon"))
  88 + .objectFit(ImageFit.Auto)
  89 + .height(24)
  90 + .width(24)
  91 + .margin({
  92 + left: 16, top: 8
  93 + })
  94 + .alignRules({
  95 + top: { anchor: "__container__", align: VerticalAlign.Top },
  96 + left: { anchor: "__container__", align: HorizontalAlign.Start },
  97 + })
  98 + .onClick(() => {
  99 + router.back()
  100 + })
  101 + .id('backImage')
  102 +
  103 + }.height(44)
53 } 104 }
54 105
55 106
56 @Builder ModifyPasswordLayout(){ 107 @Builder ModifyPasswordLayout(){
57 - Navigation() {  
58 Column(){ 108 Column(){
59 Column() { 109 Column() {
60 Text("修改密码").fontWeight(FontWeight.Bold).fontSize(20).maxLines(1) 110 Text("修改密码").fontWeight(FontWeight.Bold).fontSize(20).maxLines(1)
61 } 111 }
62 .width('100%') 112 .width('100%')
63 - .height('75lpx') 113 + .height(`${this.calcHeight(75)}lpx`)
64 .alignItems(HorizontalAlign.Start) 114 .alignItems(HorizontalAlign.Start)
65 115
66 Row() { 116 Row() {
@@ -77,12 +127,12 @@ struct ModifyPasswordPage { @@ -77,12 +127,12 @@ struct ModifyPasswordPage {
77 }) 127 })
78 } 128 }
79 .alignItems(VerticalAlign.Center) 129 .alignItems(VerticalAlign.Center)
80 - .height('80lpx') 130 + .height(`${this.calcHeight(80)}lpx`)
81 .backgroundColor('#f5f5f5') 131 .backgroundColor('#f5f5f5')
82 .borderRadius('4vp') 132 .borderRadius('4vp')
83 } 133 }
84 .width('100%') 134 .width('100%')
85 - .height('110lpx') 135 + .height(`${this.calcHeight(110)}lpx`)
86 .backgroundColor(0xffffff0) 136 .backgroundColor(0xffffff0)
87 .alignItems(VerticalAlign.Center) 137 .alignItems(VerticalAlign.Center)
88 138
@@ -100,12 +150,12 @@ struct ModifyPasswordPage { @@ -100,12 +150,12 @@ struct ModifyPasswordPage {
100 }) 150 })
101 } 151 }
102 .alignItems(VerticalAlign.Center) 152 .alignItems(VerticalAlign.Center)
103 - .height('80lpx') 153 + .height(`${this.calcHeight(80)}lpx`)
104 .backgroundColor('#f5f5f5') 154 .backgroundColor('#f5f5f5')
105 .borderRadius('4vp') 155 .borderRadius('4vp')
106 } 156 }
107 .width('100%') 157 .width('100%')
108 - .height('110lpx') 158 + .height(`${this.calcHeight(110)}lpx`)
109 .backgroundColor(0xffffff0) 159 .backgroundColor(0xffffff0)
110 .alignItems(VerticalAlign.Center) 160 .alignItems(VerticalAlign.Center)
111 161
@@ -123,32 +173,32 @@ struct ModifyPasswordPage { @@ -123,32 +173,32 @@ struct ModifyPasswordPage {
123 }) 173 })
124 } 174 }
125 .alignItems(VerticalAlign.Center) 175 .alignItems(VerticalAlign.Center)
126 - .height('80lpx') 176 + .height(`${this.calcHeight(80)}lpx`)
127 .backgroundColor('#f5f5f5') 177 .backgroundColor('#f5f5f5')
128 .borderRadius('4vp') 178 .borderRadius('4vp')
129 } 179 }
130 .width('100%') 180 .width('100%')
131 - .height('110lpx') 181 + .height(`${this.calcHeight(110)}lpx`)
132 .backgroundColor(0xffffff0) 182 .backgroundColor(0xffffff0)
133 .alignItems(VerticalAlign.Center) 183 .alignItems(VerticalAlign.Center)
134 184
135 Column() { 185 Column() {
136 - Text("提示:密码长度6~20位,使用大写字母、小写字母、数字、特殊字符中三种或三种以上").fontSize(12).maxLines(3).fontColor(0x999999).padding({top:'10lpx'}) 186 + Text("提示:密码长度6~20位,使用大写字母、小写字母、数字、特殊字符中三种或三种以上").fontSize(12).maxLines(3).fontColor(0x999999).padding({top:`${this.calcHeight(10)}lpx`})
137 } 187 }
138 .width('100%') 188 .width('100%')
139 - .height('85lpx') 189 + .height(`${this.calcHeight(85)}lpx`)
140 .alignItems(HorizontalAlign.Start) 190 .alignItems(HorizontalAlign.Start)
141 191
142 Row() { 192 Row() {
143 Button( { type: ButtonType.Normal, stateEffect: true }){ 193 Button( { type: ButtonType.Normal, stateEffect: true }){
144 Text("确认") 194 Text("确认")
145 .fontColor("#fff") 195 .fontColor("#fff")
146 - .fontSize("35lpx")  
147 - .lineHeight("50lpx") 196 + .fontSize(`${this.calcHeight(35)}lpx`)
  197 + .lineHeight(`${this.calcHeight(50)}lpx`)
148 .opacity(this.btnStatus ?1:0.5) 198 .opacity(this.btnStatus ?1:0.5)
149 } 199 }
150 .width('100%') 200 .width('100%')
151 - .height('80lpx') 201 + .height(`${this.calcHeight(80)}lpx`)
152 .backgroundColor(this.btnStatus ? '#ED2800' : '#99ED2800') 202 .backgroundColor(this.btnStatus ? '#ED2800' : '#99ED2800')
153 .borderRadius('4vp') 203 .borderRadius('4vp')
154 .onClick(() => { 204 .onClick(() => {
@@ -158,25 +208,22 @@ struct ModifyPasswordPage { @@ -158,25 +208,22 @@ struct ModifyPasswordPage {
158 } 208 }
159 }) 209 })
160 } 210 }
161 - .padding({top:'25lpx'}) 211 + .padding({top:`${this.calcHeight(25)}lpx`})
162 .alignItems(VerticalAlign.Center) 212 .alignItems(VerticalAlign.Center)
163 .width('100%') 213 .width('100%')
164 - .height('120lpx') 214 + .height(`${this.calcHeight(120)}lpx`)
165 215
166 Column() { 216 Column() {
167 - Text("忘记密码").fontSize(12).maxLines(3).fontColor(0x999999).padding({top:'10lpx'}) 217 + Text("忘记密码").fontSize(12).maxLines(3).fontColor(0x999999).padding({top:`${this.calcHeight(10)}lpx`})
168 .onClick(()=>{ 218 .onClick(()=>{
169 WDRouterRule.jumpWithPage(WDRouterPage.forgetPasswordPage) 219 WDRouterRule.jumpWithPage(WDRouterPage.forgetPasswordPage)
170 }) 220 })
171 } 221 }
172 .width('100%') 222 .width('100%')
173 - .height('85lpx') 223 + .height(`${this.calcHeight(85)}lpx`)
174 .alignItems(HorizontalAlign.Center) 224 .alignItems(HorizontalAlign.Center)
175 - }.padding({top:"92lpx",left:"48lpx",right:"48lpx"}) 225 + }.padding({top:`${this.calcHeight(92)}lpx`,left:`${this.calcHeight(48)}lpx`,right:`${this.calcHeight(48)}lpx`})
176 226
177 - }.titleMode(NavigationTitleMode.Mini)  
178 - .backButtonIcon($r("app.media.login_back_icon"))  
179 - .title('')  
180 } 227 }
181 228
182 inputTextChange(){ 229 inputTextChange(){
@@ -211,6 +258,10 @@ struct ModifyPasswordPage { @@ -211,6 +258,10 @@ struct ModifyPasswordPage {
211 this.toastText = msg 258 this.toastText = msg
212 this.dialogToast.open() 259 this.dialogToast.open()
213 } 260 }
  261 +
  262 + calcHeight(value:number): number{
  263 + return value * this.percent
  264 + }
214 } 265 }
215 266
216 267
@@ -8,6 +8,7 @@ @@ -8,6 +8,7 @@
8 "tablet", 8 "tablet",
9 "2in1" 9 "2in1"
10 ], 10 ],
  11 + "compressNativeLibs": true,
11 "deliveryWithInstall": true, 12 "deliveryWithInstall": true,
12 "pages": "$profile:main_pages" 13 "pages": "$profile:main_pages"
13 } 14 }
@@ -8,6 +8,7 @@ @@ -8,6 +8,7 @@
8 "tablet", 8 "tablet",
9 "2in1" 9 "2in1"
10 ], 10 ],
  11 + "compressNativeLibs": true,
11 "deliveryWithInstall": true, 12 "deliveryWithInstall": true,
12 "pages": "$profile:main_pages", 13 "pages": "$profile:main_pages",
13 14
@@ -8,6 +8,7 @@ @@ -8,6 +8,7 @@
8 "tablet", 8 "tablet",
9 "2in1" 9 "2in1"
10 ], 10 ],
  11 + "compressNativeLibs": true,
11 "deliveryWithInstall": true, 12 "deliveryWithInstall": true,
12 "pages": "$profile:main_pages" 13 "pages": "$profile:main_pages"
13 } 14 }
@@ -135,6 +135,9 @@ export namespace TrackConstants { @@ -135,6 +135,9 @@ export namespace TrackConstants {
135 /// 我的预约 135 /// 我的预约
136 My_Saved_Live = "mySavedLivePage", 136 My_Saved_Live = "mySavedLivePage",
137 137
  138 + /// 直播预约更多列表
  139 + Live_Appointment_List = "liveSubscribeListPage",
  140 +
138 /// 兴趣选择 141 /// 兴趣选择
139 Preference_Selection = "preferenceSelectionPage", 142 Preference_Selection = "preferenceSelectionPage",
140 /// 升级页面 143 /// 升级页面
1 import { CompInfoBean, ContentDetailDTO, ContentDTO, PageInfoBean, PageInfoDTO } from 'wdBean/Index'; 1 import { CompInfoBean, ContentDetailDTO, ContentDTO, PageInfoBean, PageInfoDTO } from 'wdBean/Index';
  2 +import { StringUtils } from 'wdKit/Index';
2 import { ParamType } from './PublicParams'; 3 import { ParamType } from './PublicParams';
3 import { TrackConstants } from './TrackConstants'; 4 import { TrackConstants } from './TrackConstants';
4 import { TrackingUtils } from './TrackingUtils'; 5 import { TrackingUtils } from './TrackingUtils';
@@ -22,17 +23,40 @@ export class TrackParamConvert { @@ -22,17 +23,40 @@ export class TrackParamConvert {
22 23
23 static pageCompProgram(pageInfo?: PageInfoDTO, comp?: CompInfoBean, program?: ContentDTO) : ParamType { 24 static pageCompProgram(pageInfo?: PageInfoDTO, comp?: CompInfoBean, program?: ContentDTO) : ParamType {
24 let params = TrackingUtils.generateParams() 25 let params = TrackingUtils.generateParams()
  26 +
  27 + //TODO: 转换参数
  28 + if (pageInfo) {
  29 + params["pageName"] = pageInfo.name
  30 + params["pageId"] = pageInfo.id + ''
  31 + TrackParamConvert.appendRecommendPageInfo(pageInfo, params)
  32 + }
  33 +
25 if (program) { 34 if (program) {
  35 +
26 params["contentType"] = program.objectType 36 params["contentType"] = program.objectType
27 params["contentId"] = program.objectId 37 params["contentId"] = program.objectId
28 params["contentName"] = program.newsTitle 38 params["contentName"] = program.newsTitle
29 params["channelSourceId"] = program.channelId 39 params["channelSourceId"] = program.channelId
30 params["rmhPlatform"] = program.rmhPlatform 40 params["rmhPlatform"] = program.rmhPlatform
31 41
32 - TrackParamConvert.appendRecommend(program, params)  
33 - }  
34 - //TODO: 转换参数 42 + if (program.liveInfo) {
  43 + params["liveType"] = program.liveInfo.liveState
  44 + params["liveStreamType"] = ((program.liveInfo.vrType + '') == "1") ? "2" : "1"
  45 + params["vliveId"] = program.objectId
  46 + params["vliveName"] = program.newsTitle
  47 + }
  48 +
  49 + if (!StringUtils.isEmpty(program.linkUrl)) {
  50 + params["linkUrl"] = program.linkUrl
  51 + }
  52 +
  53 + if (program.rmhInfo && program.rmhInfo.rmhId) {
  54 + params["saAuthorId"] = program.rmhInfo.rmhId || ""
  55 + params["saAuthorName"] = program.rmhInfo.rmhName || ""
  56 + }
35 57
  58 + TrackParamConvert.appendRecommendProgram(program, params)
  59 + }
36 return params 60 return params
37 } 61 }
38 62
@@ -79,10 +103,68 @@ export class TrackParamConvert { @@ -79,10 +103,68 @@ export class TrackParamConvert {
79 return param 103 return param
80 } 104 }
81 105
82 - private static appendRecommend(detail: object, to: ParamType) {  
83 - 106 + private static appendRecommend(detail: ContentDetailDTO, to: ParamType) {
84 //TODO: ContentDetailDTO 增加推荐字段 107 //TODO: ContentDetailDTO 增加推荐字段
85 108
  109 + to["sceneId"] = !StringUtils.isEmpty(detail.sceneId) ? detail.sceneId : "9999"
  110 + to["subSceneId"] = !StringUtils.isEmpty(detail.subSceneId) ? detail.subSceneId : ""
  111 + //to["cnsTraceId"] = !StringUtils.isEmpty(detail.cnsTraceId) ? detail.cnsTraceId : "selfHold"
  112 + to["cnsTraceId"] = "selfHold"
  113 + to["itemId"] = !StringUtils.isEmpty(detail.itemId) ? detail.itemId : ""
  114 + // to["expIds"] = !StringUtils.isEmpty(detail.expIds) ? detail.expIds : ""
  115 + to["expIds"] = ""
  116 +
  117 + /// 这里填写默认值,后续在分享处 再重写
  118 + to["shareChannel"] = ""
  119 + /// 这里填写默认值,后续在action=browse时,再重写
  120 + to["duration"] = 0
  121 + }
  122 +
  123 + private static appendRecommendProgram(program: ContentDTO, to: ParamType) {
  124 +
  125 + to["sceneId"] = !StringUtils.isEmpty(program.itemId) ? program.itemId : "9999"
  126 + to["subSceneId"] = !StringUtils.isEmpty(program.itemId) ? program.itemId : ""
  127 + to["cnsTraceId"] = !StringUtils.isEmpty(program.itemId) ? program.itemId : "selfHold"
  128 + to["itemId"] = !StringUtils.isEmpty(program.itemId) ? program.itemId : ""
  129 + to["expIds"] = !StringUtils.isEmpty(program.itemId) ? program.itemId : ""
  130 +
  131 + /// 这里填写默认值,后续在分享处 再重写
  132 + to["shareChannel"] = ""
  133 + /// 这里填写默认值,后续在action=browse时,再重写
  134 + to["duration"] = 0
  135 + }
  136 +
  137 + private static appendRecommendCompInfo(program: CompInfoBean, to: ParamType) {
  138 +
  139 + // TODO:
  140 + // to["sceneId"] = !StringUtils.isEmpty(program.itemId) ? program.itemId : "9999"
  141 + // to["subSceneId"] = !StringUtils.isEmpty(program.itemId) ? program.itemId : ""
  142 + // to["cnsTraceId"] = !StringUtils.isEmpty(program.itemId) ? program.itemId : "selfHold"
  143 + // to["itemId"] = !StringUtils.isEmpty(program.itemId) ? program.itemId : ""
  144 + // to["expIds"] = !StringUtils.isEmpty(program.itemId) ? program.itemId : ""
  145 +
  146 + /// 这里填写默认值,后续在分享处 再重写
  147 + to["shareChannel"] = ""
  148 + /// 这里填写默认值,后续在action=browse时,再重写
  149 + to["duration"] = 0
  150 + }
  151 +
  152 + private static appendRecommendPageInfo(program: PageInfoDTO, to: ParamType) {
  153 +
  154 + // TODO:
  155 + // to["sceneId"] = !StringUtils.isEmpty(program.itemId) ? program.itemId : "9999"
  156 + // to["subSceneId"] = !StringUtils.isEmpty(program.itemId) ? program.itemId : ""
  157 + // to["cnsTraceId"] = !StringUtils.isEmpty(program.itemId) ? program.itemId : "selfHold"
  158 + // to["itemId"] = !StringUtils.isEmpty(program.itemId) ? program.itemId : ""
  159 + // to["expIds"] = !StringUtils.isEmpty(program.itemId) ? program.itemId : ""
  160 +
  161 + /// 这里填写默认值,后续在分享处 再重写
  162 + to["shareChannel"] = ""
  163 + /// 这里填写默认值,后续在action=browse时,再重写
  164 + to["duration"] = 0
  165 + }
  166 +
  167 + private static appendRecommendPageInfoBean(program: PageInfoBean, to: ParamType) {
86 to["sceneId"] = "9999" 168 to["sceneId"] = "9999"
87 to["subSceneId"] = "" 169 to["subSceneId"] = ""
88 to["cnsTraceId"] = "selfHold" 170 to["cnsTraceId"] = "selfHold"
@@ -95,6 +177,13 @@ export class TrackParamConvert { @@ -95,6 +177,13 @@ export class TrackParamConvert {
95 to["duration"] = 0 177 to["duration"] = 0
96 } 178 }
97 179
  180 + // 'sceneId': contentDTO.sceneId,
  181 + // 'subSceneId': contentDTO.subSceneId,
  182 + // 'cnsTraceId': contentDTO.cnsTraceId,
  183 + // 'cardItemId': compDTO.cardItemId,
  184 + // 'itemId': compDTO.itemId || contentDTO.itemId,
  185 + // 'expIds': compDTO.expIds || contentDTO.expIds
  186 +
98 187
99 ///早晚报 专题 188 ///早晚报 专题
100 static pageInfoBean_ParamType(pageInfo: PageInfoBean) : ParamType { 189 static pageInfoBean_ParamType(pageInfo: PageInfoBean) : ParamType {
@@ -128,7 +217,8 @@ export class TrackParamConvert { @@ -128,7 +217,8 @@ export class TrackParamConvert {
128 "channelSourceId": pageInfo.name, 217 "channelSourceId": pageInfo.name,
129 "pageId": 'summaryDetailPage', 218 "pageId": 'summaryDetailPage',
130 } 219 }
131 - TrackParamConvert.appendRecommend(pageInfo, param) 220 +
  221 + TrackParamConvert.appendRecommendPageInfoBean(pageInfo, param)
132 222
133 return param 223 return param
134 } 224 }
@@ -8,6 +8,7 @@ @@ -8,6 +8,7 @@
8 "tablet", 8 "tablet",
9 "2in1" 9 "2in1"
10 ], 10 ],
  11 + "compressNativeLibs": true,
11 "deliveryWithInstall": true, 12 "deliveryWithInstall": true,
12 "pages": "$profile:main_pages" 13 "pages": "$profile:main_pages"
13 } 14 }
@@ -2,6 +2,7 @@ import { Action } from 'wdBean'; @@ -2,6 +2,7 @@ import { Action } from 'wdBean';
2 import { ImageAndTextPageComponent } from 'wdComponent' 2 import { ImageAndTextPageComponent } from 'wdComponent'
3 import { Logger } from 'wdKit' 3 import { Logger } from 'wdKit'
4 import router from '@ohos.router'; 4 import router from '@ohos.router';
  5 +import { TrackConstants } from 'wdTracking/Index';
5 6
6 const TAG = 'ImageAndTextDetailPage'; 7 const TAG = 'ImageAndTextDetailPage';
7 8
@@ -10,6 +11,9 @@ const TAG = 'ImageAndTextDetailPage'; @@ -10,6 +11,9 @@ const TAG = 'ImageAndTextDetailPage';
10 struct ImageAndTextDetailPage { 11 struct ImageAndTextDetailPage {
11 action: Action = {} as Action 12 action: Action = {} as Action
12 13
  14 + @Provide pageName: string = TrackConstants.PageName.Article_Detail
  15 + @Provide pageId: string = TrackConstants.PageName.Article_Detail
  16 +
13 build() { 17 build() {
14 Column() { 18 Column() {
15 ImageAndTextPageComponent({action: this.action}) 19 ImageAndTextPageComponent({action: this.action})
@@ -4,6 +4,7 @@ import { CommonConstants, SpConstants } from 'wdConstant' @@ -4,6 +4,7 @@ import { CommonConstants, SpConstants } from 'wdConstant'
4 import { Logger, SPHelper, StringUtils } from 'wdKit' 4 import { Logger, SPHelper, StringUtils } from 'wdKit'
5 import router from '@ohos.router'; 5 import router from '@ohos.router';
6 import dataPreferences from '@ohos.data.preferences'; 6 import dataPreferences from '@ohos.data.preferences';
  7 +import { TrackConstants } from 'wdTracking/Index';
7 8
8 const TAG = 'SpacialTopicPage'; 9 const TAG = 'SpacialTopicPage';
9 10
@@ -25,6 +26,10 @@ struct SpacialTopicPage { @@ -25,6 +26,10 @@ struct SpacialTopicPage {
25 } 26 }
26 } 27 }
27 28
  29 +
  30 + @Provide pageName: string = TrackConstants.PageName.Summary_Detail
  31 + @Provide pageId: string = TrackConstants.PageName.Summary_Detail
  32 +
28 build() { 33 build() {
29 Column() { 34 Column() {
30 SpacialTopicPageComponent({ action: this.action ,reload:this.reload }) 35 SpacialTopicPageComponent({ action: this.action ,reload:this.reload })
@@ -2,6 +2,8 @@ import { Logger } from 'wdKit'; @@ -2,6 +2,8 @@ import { Logger } from 'wdKit';
2 import { AudioDetailComponent } from 'wdComponent'; 2 import { AudioDetailComponent } from 'wdComponent';
3 import router from '@ohos.router'; 3 import router from '@ohos.router';
4 import { Params, Action } from 'wdBean'; 4 import { Params, Action } from 'wdBean';
  5 +import { TrackConstants } from 'wdTracking/Index';
  6 +
5 const TAG = 'AudioDetail'; 7 const TAG = 'AudioDetail';
6 @Entry 8 @Entry
7 @Component 9 @Component
@@ -11,6 +13,9 @@ struct AudioDetail { @@ -11,6 +13,9 @@ struct AudioDetail {
11 @State contentId: string = '' 13 @State contentId: string = ''
12 @State relType: string = '' 14 @State relType: string = ''
13 15
  16 + @Provide pageId: string = TrackConstants.PageName.Audio_Detail
  17 + @Provide pageName: string = TrackConstants.PageName.Audio_Detail
  18 +
14 build() { 19 build() {
15 Column() { 20 Column() {
16 AudioDetailComponent({ 21 AudioDetailComponent({
@@ -13,6 +13,9 @@ struct DynamicDetailPage { @@ -13,6 +13,9 @@ struct DynamicDetailPage {
13 @State contentId: string = '' 13 @State contentId: string = ''
14 @State relType: string = '' 14 @State relType: string = ''
15 15
  16 + @Provide pageName: string = TrackConstants.PageName.DynamicDetail
  17 + @Provide pageId: string = TrackConstants.PageName.DynamicDetail
  18 +
16 build() { 19 build() {
17 Column() { 20 Column() {
18 DynamicDetailComponent({ 21 DynamicDetailComponent({
@@ -19,6 +19,8 @@ struct MultiPictureDetailPage { @@ -19,6 +19,8 @@ struct MultiPictureDetailPage {
19 @State relType: string = '' 19 @State relType: string = ''
20 pageShowTime:number = 0; 20 pageShowTime:number = 0;
21 pageHideTime:number = 0; 21 pageHideTime:number = 0;
  22 + @Provide pageId: string = TrackConstants.PageName.Atlas_Detail
  23 + @Provide pageName: string = TrackConstants.PageName.Atlas_Detail
22 24
23 build() { 25 build() {
24 Row() { 26 Row() {
@@ -27,6 +27,7 @@ struct Index { @@ -27,6 +27,7 @@ struct Index {
27 @State name: string = 'audio_status_wait'; 27 @State name: string = 'audio_status_wait';
28 28
29 async aboutToAppear() { 29 async aboutToAppear() {
  30 + window.findWindow("subWindow").setWindowBackgroundColor("#00000000")
30 this.AudioSuspension.playerController.get().onTimeUpdate = (position, duration) => { 31 this.AudioSuspension.playerController.get().onTimeUpdate = (position, duration) => {
31 this.currentTime = DateFormatUtil.convertMillisecondsToMinutesSeconds(position); 32 this.currentTime = DateFormatUtil.convertMillisecondsToMinutesSeconds(position);
32 this.totalTime = DateFormatUtil.convertMillisecondsToMinutesSeconds(duration); 33 this.totalTime = DateFormatUtil.convertMillisecondsToMinutesSeconds(duration);
@@ -167,6 +167,7 @@ export struct VideoChannelPage { @@ -167,6 +167,7 @@ export struct VideoChannelPage {
167 topNavIndex: $currentTopNavSelectedIndex, 167 topNavIndex: $currentTopNavSelectedIndex,
168 groupId: this.groupId + '', 168 groupId: this.groupId + '',
169 pageId: item.pageId + '', 169 pageId: item.pageId + '',
  170 + pageName: item.name + '',
170 channelId: item.channelId + '', 171 channelId: item.channelId + '',
171 autoRefresh: this.autoRefresh, 172 autoRefresh: this.autoRefresh,
172 }) 173 })
@@ -178,7 +179,9 @@ export struct VideoChannelPage { @@ -178,7 +179,9 @@ export struct VideoChannelPage {
178 pageId: item.pageId + '', 179 pageId: item.pageId + '',
179 channelId: item.channelId + '', 180 channelId: item.channelId + '',
180 autoRefresh: this.autoRefresh 181 autoRefresh: this.autoRefresh
181 - }).margin({ top: 40 }) 182 + })
  183 + .margin({ top: 40 })
  184 + .backgroundColor(Color.White)
182 } 185 }
183 }, (item: TopNavDTO) => item.channelId + '') 186 }, (item: TopNavDTO) => item.channelId + '')
184 } 187 }
@@ -9,6 +9,7 @@ @@ -9,6 +9,7 @@
9 "tablet", 9 "tablet",
10 "2in1" 10 "2in1"
11 ], 11 ],
  12 + "compressNativeLibs": true,
12 "deliveryWithInstall": true, 13 "deliveryWithInstall": true,
13 "installationFree": false, 14 "installationFree": false,
14 "pages": "$profile:main_pages", 15 "pages": "$profile:main_pages",