Showing
1 changed file
with
33 additions
and
24 deletions
| 1 | import { ContentDTO, NewspaperListItemBean, NewspaperPositionItemBean, Params } from 'wdBean'; | 1 | import { ContentDTO, NewspaperListItemBean, NewspaperPositionItemBean, Params } from 'wdBean'; |
| 2 | import { StringUtils } from 'wdKit'; | 2 | import { StringUtils } from 'wdKit'; |
| 3 | import { ProcessUtils } from 'wdRouter'; | 3 | import { ProcessUtils } from 'wdRouter'; |
| 4 | -import { TrackingContent,TrackConstants } from 'wdTracking/Index'; | 4 | +import { TrackingContent, TrackConstants } from 'wdTracking/Index'; |
| 5 | import { newsSkeleton } from './skeleton/newsSkeleton'; | 5 | import { newsSkeleton } from './skeleton/newsSkeleton'; |
| 6 | 6 | ||
| 7 | @Component | 7 | @Component |
| @@ -21,21 +21,22 @@ export struct ENewspaperItemComponent { | @@ -21,21 +21,22 @@ export struct ENewspaperItemComponent { | ||
| 21 | aboutToAppear(): void { | 21 | aboutToAppear(): void { |
| 22 | for (let index = 0; index < this.newspaperListItemBean.items.length; index++) { | 22 | for (let index = 0; index < this.newspaperListItemBean.items.length; index++) { |
| 23 | const element = this.newspaperListItemBean.items[index]; | 23 | const element = this.newspaperListItemBean.items[index]; |
| 24 | - TrackingContent.common(TrackConstants.EventType.Show,TrackConstants.PageName.NewsPaperPage,TrackConstants.PageName.NewsPaperPage | ||
| 25 | - ,{ | ||
| 26 | - 'contentName':element.title, | ||
| 27 | - 'contentType':element.newsType, | ||
| 28 | - 'contentId':element.newsId, | ||
| 29 | - 'panelNumber':this.newspaperListItemBean.pageNum, | ||
| 30 | - 'panelName':this.newspaperListItemBean.pageName, | ||
| 31 | - 'readMode':'1', | 24 | + TrackingContent.common(TrackConstants.EventType.Show, TrackConstants.PageName.NewsPaperPage, |
| 25 | + TrackConstants.PageName.NewsPaperPage | ||
| 26 | + , { | ||
| 27 | + 'contentName': element.title, | ||
| 28 | + 'contentType': element.newsType, | ||
| 29 | + 'contentId': element.newsId, | ||
| 30 | + 'panelNumber': this.newspaperListItemBean.pageNum, | ||
| 31 | + 'panelName': this.newspaperListItemBean.pageName, | ||
| 32 | + 'readMode': '1', | ||
| 32 | }) | 33 | }) |
| 33 | } | 34 | } |
| 34 | } | 35 | } |
| 36 | + | ||
| 35 | build() { | 37 | build() { |
| 36 | Stack() { | 38 | Stack() { |
| 37 | - newsSkeleton() | ||
| 38 | - .visibility(this.isShowSkeleton ? Visibility.Visible : Visibility.None) | 39 | + |
| 39 | Image(this.newspaperListItemBean.pagePic) | 40 | Image(this.newspaperListItemBean.pagePic) |
| 40 | .width(px2vp(this.itemPicWidth)) | 41 | .width(px2vp(this.itemPicWidth)) |
| 41 | .height(px2vp(this.itemPicHeight)) | 42 | .height(px2vp(this.itemPicHeight)) |
| @@ -48,6 +49,8 @@ export struct ENewspaperItemComponent { | @@ -48,6 +49,8 @@ export struct ENewspaperItemComponent { | ||
| 48 | }) | 49 | }) |
| 49 | .objectFit(ImageFit.Fill) | 50 | .objectFit(ImageFit.Fill) |
| 50 | .visibility(this.isShowSkeleton ? Visibility.None : Visibility.Visible) | 51 | .visibility(this.isShowSkeleton ? Visibility.None : Visibility.Visible) |
| 52 | + newsSkeleton() | ||
| 53 | + .visibility(this.isShowSkeleton ? Visibility.Visible : Visibility.None) | ||
| 51 | if (this.contentWidth !== 0) { | 54 | if (this.contentWidth !== 0) { |
| 52 | Canvas(this.context) | 55 | Canvas(this.context) |
| 53 | .width(px2vp(this.contentWidth)) | 56 | .width(px2vp(this.contentWidth)) |
| @@ -58,7 +61,12 @@ export struct ENewspaperItemComponent { | @@ -58,7 +61,12 @@ export struct ENewspaperItemComponent { | ||
| 58 | }) | 61 | }) |
| 59 | } | 62 | } |
| 60 | } | 63 | } |
| 61 | - .padding({ top:14, right: 10, bottom: 14, left: 10 }) | 64 | + .padding({ |
| 65 | + top: 14, | ||
| 66 | + right: 10, | ||
| 67 | + bottom: 14, | ||
| 68 | + left: 10 | ||
| 69 | + }) | ||
| 62 | .backgroundColor(Color.White) | 70 | .backgroundColor(Color.White) |
| 63 | .width('100%') | 71 | .width('100%') |
| 64 | .onTouch((event: TouchEvent) => { | 72 | .onTouch((event: TouchEvent) => { |
| @@ -88,21 +96,22 @@ export struct ENewspaperItemComponent { | @@ -88,21 +96,22 @@ export struct ENewspaperItemComponent { | ||
| 88 | if (this.itemBeanClicked != null && this.itemBeanClicked.newsId != 0) { | 96 | if (this.itemBeanClicked != null && this.itemBeanClicked.newsId != 0) { |
| 89 | //公共跳转 | 97 | //公共跳转 |
| 90 | let content: ContentDTO = { | 98 | let content: ContentDTO = { |
| 91 | - objectId:this.itemBeanClicked.newsId+'', | ||
| 92 | - objectType:this.itemBeanClicked.newsType+'', | ||
| 93 | - relId:this.itemBeanClicked.relId+'', | ||
| 94 | - relType:this.itemBeanClicked.relType ?? '0' | 99 | + objectId: this.itemBeanClicked.newsId + '', |
| 100 | + objectType: this.itemBeanClicked.newsType + '', | ||
| 101 | + relId: this.itemBeanClicked.relId + '', | ||
| 102 | + relType: this.itemBeanClicked.relType ?? '0' | ||
| 95 | } as ContentDTO | 103 | } as ContentDTO |
| 96 | ProcessUtils.processPage(content) | 104 | ProcessUtils.processPage(content) |
| 97 | //内容点击 | 105 | //内容点击 |
| 98 | - TrackingContent.clickWithEvent('current_Number_Panel_content_click',TrackConstants.PageName.NewsPaperPage,TrackConstants.PageName.NewsPaperPage | ||
| 99 | - ,{ | ||
| 100 | - 'contentName':this.itemBeanClicked.title, | ||
| 101 | - 'contentType':this.itemBeanClicked.newsType, | ||
| 102 | - 'contentId':this.itemBeanClicked.newsId, | ||
| 103 | - 'panelNumber':this.newspaperListItemBean.pageNum, | ||
| 104 | - 'panelName':this.newspaperListItemBean.pageName, | ||
| 105 | - 'readMode':'1', | 106 | + TrackingContent.clickWithEvent('current_Number_Panel_content_click', TrackConstants.PageName.NewsPaperPage, |
| 107 | + TrackConstants.PageName.NewsPaperPage | ||
| 108 | + , { | ||
| 109 | + 'contentName': this.itemBeanClicked.title, | ||
| 110 | + 'contentType': this.itemBeanClicked.newsType, | ||
| 111 | + 'contentId': this.itemBeanClicked.newsId, | ||
| 112 | + 'panelNumber': this.newspaperListItemBean.pageNum, | ||
| 113 | + 'panelName': this.newspaperListItemBean.pageName, | ||
| 114 | + 'readMode': '1', | ||
| 106 | }) | 115 | }) |
| 107 | this.itemBeanClicked = {} as NewspaperPositionItemBean | 116 | this.itemBeanClicked = {} as NewspaperPositionItemBean |
| 108 | } | 117 | } |
-
Please register or login to post a comment