张善主

Merge remote-tracking branch 'origin/main'

Showing 52 changed files with 351 additions and 183 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 }
@@ -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 "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 }
@@ -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 }
@@ -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 ==="横划卡"
@@ -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
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';
@@ -268,7 +268,29 @@ export struct ZhSingleRow03 { @@ -268,7 +268,29 @@ export struct ZhSingleRow03 {
268 .textAlign(TextAlign.Center) 268 .textAlign(TextAlign.Center)
269 .borderRadius(3) 269 .borderRadius(3)
270 .onClick(() => { 270 .onClick(() => {
271 - this.bookAndCancel(item.relId, item.objectId, !this.isReserved(Number(item.objectId))) 271 +
  272 + const isSubscribe = !this.isReserved(Number(item.objectId))
  273 +
  274 + // 直播预约埋点
  275 + const params: ParamType = {
  276 + 'contentName': item.newsTitle,
  277 + 'contentType': item.objectType,
  278 + "liveStreamType": item?.liveInfo.vrType === 0 ? 1 : 2,
  279 + "vliveId": item.objectId,
  280 + "vliveName": item.newsTitle,
  281 + "contentId": item.objectId,
  282 + "compId": item.relId,
  283 + "contentStyle": item.appStyle,
  284 + "liveType": getLiveState(item),
  285 + 'contentShowChannelId': item.channelId,
  286 + 'linkUrl': item.linkUrl,
  287 + "pageId": this.pageId,
  288 + "pageName": this.pageName,
  289 + }
  290 + Logger.info(TAG, `直播预约埋点: ${JSON.stringify(params)}`);
  291 + Tracking.event(isSubscribe? "live_subscribe_click": "cancel_live_subscribe_click", params)
  292 +
  293 + this.bookAndCancel(item.relId, item.objectId, isSubscribe)
272 }) 294 })
273 295
274 } 296 }
@@ -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()
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 }
@@ -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
@@ -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';
@@ -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 "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": [
@@ -212,13 +212,13 @@ export struct DetailPlayShortVideoPage { @@ -212,13 +212,13 @@ export struct DetailPlayShortVideoPage {
212 212
213 let width = rect.width 213 let width = rect.width
214 let height = rect.height 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 - } 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 + // }
222 // 视频宽高比屏幕大,则宽度撑满 222 // 视频宽高比屏幕大,则宽度撑满
223 if (this.ratio > width / height) { 223 if (this.ratio > width / height) {
224 this.playerWidth = '100%' 224 this.playerWidth = '100%'
@@ -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
@@ -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 }
@@ -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 }
@@ -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})
@@ -3,6 +3,7 @@ import { SpacialTopicPageComponent } from 'wdComponent' @@ -3,6 +3,7 @@ import { SpacialTopicPageComponent } from 'wdComponent'
3 import { CommonConstants } from 'wdConstant' 3 import { CommonConstants } from 'wdConstant'
4 import { Logger } from 'wdKit' 4 import { Logger } from 'wdKit'
5 import router from '@ohos.router'; 5 import router from '@ohos.router';
  6 +import { TrackConstants } from 'wdTracking/Index';
6 7
7 const TAG = 'SpacialTopicPage'; 8 const TAG = 'SpacialTopicPage';
8 9
@@ -12,6 +13,10 @@ struct SpacialTopicPage { @@ -12,6 +13,10 @@ struct SpacialTopicPage {
12 @State action: Action = {} as Action 13 @State action: Action = {} as Action
13 @State reload: number = 0 14 @State reload: number = 0
14 @State count: number = 0 15 @State count: number = 0
  16 +
  17 + @Provide pageName: string = TrackConstants.PageName.Summary_Detail
  18 + @Provide pageId: string = TrackConstants.PageName.Summary_Detail
  19 +
15 build() { 20 build() {
16 Column() { 21 Column() {
17 SpacialTopicPageComponent({ action: this.action ,reload:this.reload }) 22 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() {
@@ -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 })
@@ -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",