Showing
27 changed files
with
878 additions
and
412 deletions
| @@ -32,8 +32,8 @@ export class HttpBizUtil { | @@ -32,8 +32,8 @@ export class HttpBizUtil { | ||
| 32 | if (!headers) { | 32 | if (!headers) { |
| 33 | headers = new HashMap() | 33 | headers = new HashMap() |
| 34 | } | 34 | } |
| 35 | - headers?.replace('RMRB-X-TOKEN', token) | ||
| 36 | - headers?.replace('cookie', 'RMRB-X-TOKEN=' + token) | 35 | + headers?.set('RMRB-X-TOKEN', token) |
| 36 | + headers?.set('cookie', 'RMRB-X-TOKEN=' + token) | ||
| 37 | Logger.debug(TAG, 'get again send: ' + token) | 37 | Logger.debug(TAG, 'get again send: ' + token) |
| 38 | // refreshToken为空场景不处理,直接请求接口。 | 38 | // refreshToken为空场景不处理,直接请求接口。 |
| 39 | WDHttp.get<T>(url, headers).then((againResDTO: T) => { | 39 | WDHttp.get<T>(url, headers).then((againResDTO: T) => { |
| @@ -71,8 +71,8 @@ export class HttpBizUtil { | @@ -71,8 +71,8 @@ export class HttpBizUtil { | ||
| 71 | if (!headers) { | 71 | if (!headers) { |
| 72 | headers = new HashMap() | 72 | headers = new HashMap() |
| 73 | } | 73 | } |
| 74 | - headers?.replace('RMRB-X-TOKEN', token) | ||
| 75 | - headers?.replace('cookie', 'RMRB-X-TOKEN=' + token) | 74 | + headers?.set('RMRB-X-TOKEN', token) |
| 75 | + headers?.set('cookie', 'RMRB-X-TOKEN=' + token) | ||
| 76 | Logger.debug(TAG, 'post again send: ' + token) | 76 | Logger.debug(TAG, 'post again send: ' + token) |
| 77 | // refreshToken为空场景不处理,直接请求接口。 | 77 | // refreshToken为空场景不处理,直接请求接口。 |
| 78 | WDHttp.post<T>(url, data, headers).then((againResDTO: T) => { | 78 | WDHttp.post<T>(url, data, headers).then((againResDTO: T) => { |
| @@ -37,7 +37,7 @@ export struct ENewspaperItemComponent { | @@ -37,7 +37,7 @@ export struct ENewspaperItemComponent { | ||
| 37 | .onComplete(() => { | 37 | .onComplete(() => { |
| 38 | this.isShowSkeleton = false | 38 | this.isShowSkeleton = false |
| 39 | }) | 39 | }) |
| 40 | - .objectFit(ImageFit.Contain) | 40 | + .objectFit(ImageFit.Fill) |
| 41 | .visibility(this.isShowSkeleton ? Visibility.None : Visibility.Visible) | 41 | .visibility(this.isShowSkeleton ? Visibility.None : Visibility.Visible) |
| 42 | 42 | ||
| 43 | Canvas(this.context) | 43 | Canvas(this.context) |
| @@ -224,7 +224,7 @@ export struct MorningEveningPaperComponent { | @@ -224,7 +224,7 @@ export struct MorningEveningPaperComponent { | ||
| 224 | if (imageSource) { | 224 | if (imageSource) { |
| 225 | const pixelMap: image.PixelMap = await imageNet2PixelMap(imageSource); | 225 | const pixelMap: image.PixelMap = await imageNet2PixelMap(imageSource); |
| 226 | effectKit.createColorPicker(pixelMap, (err, colorPicker) => { | 226 | effectKit.createColorPicker(pixelMap, (err, colorPicker) => { |
| 227 | - let color = colorPicker.getMainColorSync(); | 227 | + let color = colorPicker.getLargestProportionColor(); |
| 228 | Logger.debug(TAG, "compInfoBean compStyle = " + color) | 228 | Logger.debug(TAG, "compInfoBean compStyle = " + color) |
| 229 | // color = ColorUtils.getMorningEveningPaperRgb({red:color.red,green:color.green,blue:color.blue,alpha:color.alpha}) | 229 | // color = ColorUtils.getMorningEveningPaperRgb({red:color.red,green:color.green,blue:color.blue,alpha:color.alpha}) |
| 230 | // 将取色器选取的color示例转换为十六进制颜色代码 | 230 | // 将取色器选取的color示例转换为十六进制颜色代码 |
| @@ -273,6 +273,7 @@ export struct MorningEveningPaperComponent { | @@ -273,6 +273,7 @@ export struct MorningEveningPaperComponent { | ||
| 273 | } | 273 | } |
| 274 | } | 274 | } |
| 275 | // .height(`calc(100% - ${this.bottomSafeHeight + this.topSafeHeight + 'vp'})`) | 275 | // .height(`calc(100% - ${this.bottomSafeHeight + this.topSafeHeight + 'vp'})`) |
| 276 | + .edgeEffect(EdgeEffect.None) // 必须设置列表为滑动到边缘无效果 | ||
| 276 | .scrollBar(BarState.Off) | 277 | .scrollBar(BarState.Off) |
| 277 | .onWillScroll(scrollOffset =>{ | 278 | .onWillScroll(scrollOffset =>{ |
| 278 | this.scrollOffset = this.scrollOffset + scrollOffset as number | 279 | this.scrollOffset = this.scrollOffset + scrollOffset as number |
| @@ -152,9 +152,7 @@ export struct SingleColumn999Component { | @@ -152,9 +152,7 @@ export struct SingleColumn999Component { | ||
| 152 | scrollBackward: NestedScrollMode.SELF_FIRST | 152 | scrollBackward: NestedScrollMode.SELF_FIRST |
| 153 | }) | 153 | }) |
| 154 | } else { | 154 | } else { |
| 155 | - if (this.compListItem && this.compListItem?.operDataList) { | ||
| 156 | - EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NoListContent}) | ||
| 157 | - } | 155 | + EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NoListContent}) |
| 158 | } | 156 | } |
| 159 | } | 157 | } |
| 160 | 158 | ||
| @@ -176,6 +174,5 @@ export struct SingleColumn999Component { | @@ -176,6 +174,5 @@ export struct SingleColumn999Component { | ||
| 176 | index: index, | 174 | index: index, |
| 177 | }) | 175 | }) |
| 178 | } | 176 | } |
| 179 | - | ||
| 180 | } | 177 | } |
| 181 | } | 178 | } |
| @@ -312,6 +312,7 @@ struct indicatorAnimations { | @@ -312,6 +312,7 @@ struct indicatorAnimations { | ||
| 312 | .margin({ | 312 | .margin({ |
| 313 | bottom: -2 | 313 | bottom: -2 |
| 314 | }) | 314 | }) |
| 315 | + .fontFamily('BebasNeue') | ||
| 315 | .flexShrink(0) | 316 | .flexShrink(0) |
| 316 | .animation({ | 317 | .animation({ |
| 317 | duration: 300, | 318 | duration: 300, |
| @@ -19,31 +19,121 @@ export struct ZhSingleRow02 { | @@ -19,31 +19,121 @@ export struct ZhSingleRow02 { | ||
| 19 | @State pageId: string = ''; | 19 | @State pageId: string = ''; |
| 20 | @State pageName: string = ''; | 20 | @State pageName: string = ''; |
| 21 | @State compDTO: CompDTO = {} as CompDTO | 21 | @State compDTO: CompDTO = {} as CompDTO |
| 22 | + @State initMoreWidth: number = 16; | ||
| 23 | + @State moreWidth:number = 16 | ||
| 24 | + @State moreTips: string = '' | ||
| 25 | + scroller: Scroller = new Scroller() | ||
| 26 | + | ||
| 27 | + resetMoreTips() { | ||
| 28 | + console.log('resetMoreTips', this.moreWidth, this.initMoreWidth) | ||
| 29 | + if (this.moreWidth < this.initMoreWidth * 2) { | ||
| 30 | + this.moreTips = '查看更多'; | ||
| 31 | + } | ||
| 32 | + } | ||
| 33 | + | ||
| 34 | + edgeAnimation() { | ||
| 35 | + if (this.moreWidth < this.initMoreWidth * 3) { | ||
| 36 | + if (!this.moreTips) { | ||
| 37 | + this.moreTips = '查看更多'; | ||
| 38 | + } | ||
| 39 | + this.moreWidth = this.moreWidth + 2 | ||
| 40 | + } | ||
| 41 | + if (this.moreWidth > this.initMoreWidth * 2) { | ||
| 42 | + this.moreTips = '松手查看'; | ||
| 43 | + } else { | ||
| 44 | + | ||
| 45 | + } | ||
| 46 | + } | ||
| 47 | + | ||
| 48 | + reverseEdgeAnimation() { | ||
| 49 | + if (this.moreWidth > this.initMoreWidth) { | ||
| 50 | + this.moreWidth = this.moreWidth - 2 | ||
| 51 | + } | ||
| 52 | + this.resetMoreTips() | ||
| 53 | + } | ||
| 54 | + | ||
| 55 | + resetEdgeAnimation() { | ||
| 56 | + if (this.moreWidth > this.initMoreWidth) { | ||
| 57 | + this.moreWidth = this.moreWidth - 1 | ||
| 58 | + this.resetEdgeAnimation(); | ||
| 59 | + } | ||
| 60 | + this.resetMoreTips() | ||
| 61 | + } | ||
| 62 | + | ||
| 63 | + toMore() { | ||
| 64 | + if (this.moreWidth > this.initMoreWidth * 2) { | ||
| 65 | + if (this.compDTO?.objectType === '11') { | ||
| 66 | + ProcessUtils.jumpChannelTab(this.compDTO.objectId, this.compDTO.pageId as string, this.compDTO.objectTitle) | ||
| 67 | + } else if (this.compDTO?.objectType === '5') { | ||
| 68 | + ProcessUtils._gotoSpecialTopic(this.compDTO.linkUrl) | ||
| 69 | + } else if (this.compDTO?.objectType === '6') { | ||
| 70 | + ProcessUtils._gotoDefaultWeb(this.compDTO.linkUrl) | ||
| 71 | + } | ||
| 72 | + } | ||
| 73 | + } | ||
| 22 | 74 | ||
| 23 | build() { | 75 | build() { |
| 24 | Column() { | 76 | Column() { |
| 25 | //顶部 | 77 | //顶部 |
| 26 | this.CompHeader(this.compDTO) | 78 | this.CompHeader(this.compDTO) |
| 27 | - Row(){ | ||
| 28 | - // 列表内容 | ||
| 29 | - List() { | ||
| 30 | - ForEach(this.compDTO.operDataList, (item: ContentDTO, index: number) => { | ||
| 31 | - CreatorItem({ | ||
| 32 | - item, | ||
| 33 | - index, | ||
| 34 | - compDTO: this.compDTO, | ||
| 35 | - pageId: this.pageId, | ||
| 36 | - pageName: this.pageName | 79 | + // 列表内容 |
| 80 | + Scroll(this.scroller) { | ||
| 81 | + Row() { | ||
| 82 | + Row() { | ||
| 83 | + ForEach(this.compDTO.operDataList, (item: ContentDTO, index: number) => { | ||
| 84 | + CreatorItem({ | ||
| 85 | + item, | ||
| 86 | + index, | ||
| 87 | + compDTO: this.compDTO, | ||
| 88 | + pageId: this.pageId, | ||
| 89 | + pageName: this.pageName | ||
| 90 | + }) | ||
| 91 | + .margin({ right: 8 }) | ||
| 37 | }) | 92 | }) |
| 38 | - .margin({right: index === this.compDTO.operDataList.length - 1 ? $r('app.float.card_comp_pagePadding_lf') : 0}) | ||
| 39 | - }) | 93 | + } |
| 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) | ||
| 101 | + } | ||
| 102 | + } | ||
| 103 | + .justifyContent(FlexAlign.Center) | ||
| 104 | + .align(Alignment.Center) | ||
| 105 | + .height('100%') | ||
| 106 | + .width(this.moreWidth) | ||
| 107 | + .backgroundColor(0xe9e9e9) | ||
| 108 | + .borderRadius({ topLeft: 5, bottomLeft: 5 }) | ||
| 109 | + } | ||
| 40 | } | 110 | } |
| 41 | - .listDirection(Axis.Horizontal) | ||
| 42 | - .scrollBar(BarState.Off) | ||
| 43 | - .edgeEffect(EdgeEffect.None) | ||
| 44 | } | 111 | } |
| 45 | .width(CommonConstants.FULL_WIDTH) | 112 | .width(CommonConstants.FULL_WIDTH) |
| 46 | .height(208) | 113 | .height(208) |
| 114 | + .align(Alignment.Start) | ||
| 115 | + .scrollable(this.compDTO.operDataList.length >= 2 ? ScrollDirection.Horizontal : ScrollDirection.None) | ||
| 116 | + .scrollBar(BarState.Off) | ||
| 117 | + .edgeEffect(EdgeEffect.None) | ||
| 118 | + .onReachEnd(() => { | ||
| 119 | + this.edgeAnimation() | ||
| 120 | + }) | ||
| 121 | + .onScrollStop(() => { | ||
| 122 | + // this.resetEdgeAnimation(); | ||
| 123 | + }) | ||
| 124 | + .onScroll((xOffset: number, yOffset: number) => { | ||
| 125 | + if (xOffset < 0) { | ||
| 126 | + this.reverseEdgeAnimation(); | ||
| 127 | + } | ||
| 128 | + }) | ||
| 129 | + .onTouch((event?: TouchEvent) => { | ||
| 130 | + if(event) { | ||
| 131 | + if (event.type === TouchType.Up) { | ||
| 132 | + this.toMore(); | ||
| 133 | + this.resetEdgeAnimation(); | ||
| 134 | + } | ||
| 135 | + } | ||
| 136 | + }) | ||
| 47 | } | 137 | } |
| 48 | .padding({ | 138 | .padding({ |
| 49 | left: $r('app.float.card_comp_pagePadding_lf'), | 139 | left: $r('app.float.card_comp_pagePadding_lf'), |
| @@ -126,6 +216,7 @@ struct CreatorItem { | @@ -126,6 +216,7 @@ struct CreatorItem { | ||
| 126 | .width(156) | 216 | .width(156) |
| 127 | .height(208) | 217 | .height(208) |
| 128 | .backgroundColor(0xf5f5f5) | 218 | .backgroundColor(0xf5f5f5) |
| 219 | + .borderRadius(5) | ||
| 129 | 220 | ||
| 130 | Row() | 221 | Row() |
| 131 | .width(156) | 222 | .width(156) |
| @@ -134,6 +225,7 @@ struct CreatorItem { | @@ -134,6 +225,7 @@ struct CreatorItem { | ||
| 134 | direction: GradientDirection.Bottom, | 225 | direction: GradientDirection.Bottom, |
| 135 | colors: [['rgba(0, 0, 0, 0.0)', 0.0], ['rgba(0, 0, 0, 0.3)', 1.0]] | 226 | colors: [['rgba(0, 0, 0, 0.0)', 0.0], ['rgba(0, 0, 0, 0.3)', 1.0]] |
| 136 | }) | 227 | }) |
| 228 | + .borderRadius(5) | ||
| 137 | Text(this.item.newsTitle) | 229 | Text(this.item.newsTitle) |
| 138 | .fontColor(0xffffff) | 230 | .fontColor(0xffffff) |
| 139 | .fontSize(14) | 231 | .fontSize(14) |
| @@ -145,7 +237,6 @@ struct CreatorItem { | @@ -145,7 +237,6 @@ struct CreatorItem { | ||
| 145 | } | 237 | } |
| 146 | .width(156) | 238 | .width(156) |
| 147 | .height(208) | 239 | .height(208) |
| 148 | - .margin({ right: 11 }) | ||
| 149 | .borderColor($r('app.color.color_EDEDED')) | 240 | .borderColor($r('app.color.color_EDEDED')) |
| 150 | .borderRadius($r('app.float.image_border_radius')) | 241 | .borderRadius($r('app.float.image_border_radius')) |
| 151 | } | 242 | } |
| @@ -10,6 +10,7 @@ import { Logger, ToastUtils } from 'wdKit'; | @@ -10,6 +10,7 @@ import { Logger, ToastUtils } from 'wdKit'; | ||
| 10 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | 10 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; |
| 11 | import { SpConstants } from 'wdConstant/Index' | 11 | import { SpConstants } from 'wdConstant/Index' |
| 12 | import { InfomationCardClick } from '../../utils/infomationCardClick'; | 12 | import { InfomationCardClick } from '../../utils/infomationCardClick'; |
| 13 | +import { ParamType, Tracking } from 'wdTracking/Index'; | ||
| 13 | 14 | ||
| 14 | /** | 15 | /** |
| 15 | * 直播预约卡 | 16 | * 直播预约卡 |
| @@ -17,7 +18,17 @@ import { InfomationCardClick } from '../../utils/infomationCardClick'; | @@ -17,7 +18,17 @@ import { InfomationCardClick } from '../../utils/infomationCardClick'; | ||
| 17 | */ | 18 | */ |
| 18 | const TAG = 'Zh_Single_Row-03' | 19 | const TAG = 'Zh_Single_Row-03' |
| 19 | 20 | ||
| 20 | - | 21 | +function getLiveState(contentDTO: ContentDTO) { |
| 22 | + if (contentDTO?.liveInfo?.liveState === 'wait') { | ||
| 23 | + return 'liveSubscribe' | ||
| 24 | + } else if (contentDTO?.liveInfo?.liveState === 'running') { | ||
| 25 | + return 'livePlaying' | ||
| 26 | + } else if (contentDTO?.liveInfo?.liveState === 'end') { | ||
| 27 | + return 'liveEnd' | ||
| 28 | + } else { | ||
| 29 | + return '' | ||
| 30 | + } | ||
| 31 | +} | ||
| 21 | interface reserveReqItem { | 32 | interface reserveReqItem { |
| 22 | liveId: string, | 33 | liveId: string, |
| 23 | relationId: string, | 34 | relationId: string, |
| @@ -29,17 +40,61 @@ export struct ZhSingleRow03 { | @@ -29,17 +40,61 @@ export struct ZhSingleRow03 { | ||
| 29 | @State pageId: string = ''; | 40 | @State pageId: string = ''; |
| 30 | @State pageName: string = ''; | 41 | @State pageName: string = ''; |
| 31 | @State compDTO: CompDTO = {} as CompDTO | 42 | @State compDTO: CompDTO = {} as CompDTO |
| 32 | - @State isEndEdge: boolean = false; | ||
| 33 | // @State reserveStatus: reserveItem[] = [] | 43 | // @State reserveStatus: reserveItem[] = [] |
| 34 | @State reservedIds: string[] = []; | 44 | @State reservedIds: string[] = []; |
| 35 | @State loadImg: boolean = false; | 45 | @State loadImg: boolean = false; |
| 46 | + @State initMoreWidth: number = 16; | ||
| 47 | + @State moreWidth:number = 16 | ||
| 48 | + @State moreTips: string = '' | ||
| 49 | + scroller: Scroller = new Scroller() | ||
| 50 | + | ||
| 51 | + resetMoreTips() { | ||
| 52 | + console.log('resetMoreTips', this.moreWidth, this.initMoreWidth) | ||
| 53 | + if (this.moreWidth < this.initMoreWidth * 2) { | ||
| 54 | + this.moreTips = '查看更多'; | ||
| 55 | + } | ||
| 56 | + } | ||
| 57 | + | ||
| 58 | + edgeAnimation() { | ||
| 59 | + if (this.moreWidth < this.initMoreWidth * 3) { | ||
| 60 | + if (!this.moreTips) { | ||
| 61 | + this.moreTips = '查看更多'; | ||
| 62 | + } | ||
| 63 | + this.moreWidth = this.moreWidth + 2 | ||
| 64 | + } | ||
| 65 | + if (this.moreWidth > this.initMoreWidth * 2) { | ||
| 66 | + this.moreTips = '松手查看'; | ||
| 67 | + } else { | ||
| 68 | + | ||
| 69 | + } | ||
| 70 | + } | ||
| 71 | + | ||
| 72 | + reverseEdgeAnimation() { | ||
| 73 | + if (this.moreWidth > this.initMoreWidth) { | ||
| 74 | + this.moreWidth = this.moreWidth - 2 | ||
| 75 | + } | ||
| 76 | + this.resetMoreTips() | ||
| 77 | + } | ||
| 78 | + | ||
| 79 | + resetEdgeAnimation() { | ||
| 80 | + if (this.moreWidth > this.initMoreWidth) { | ||
| 81 | + this.moreWidth = this.moreWidth - 1 | ||
| 82 | + this.resetEdgeAnimation(); | ||
| 83 | + } | ||
| 84 | + this.resetMoreTips() | ||
| 85 | + } | ||
| 86 | + | ||
| 87 | + toMore() { | ||
| 88 | + if (this.moreWidth > this.initMoreWidth * 2) { | ||
| 89 | + this.jumpToMore() | ||
| 90 | + } | ||
| 91 | + } | ||
| 36 | 92 | ||
| 37 | async aboutToAppear(): Promise<void> { | 93 | async aboutToAppear(): Promise<void> { |
| 38 | this.getReserveState(); | 94 | this.getReserveState(); |
| 39 | this.loadImg = await onlyWifiLoadImg(); | 95 | this.loadImg = await onlyWifiLoadImg(); |
| 40 | } | 96 | } |
| 41 | 97 | ||
| 42 | - scroller: Scroller = new Scroller() | ||
| 43 | 98 | ||
| 44 | // 请求所有预约状态 | 99 | // 请求所有预约状态 |
| 45 | async getReserveState() { | 100 | async getReserveState() { |
| @@ -106,25 +161,51 @@ export struct ZhSingleRow03 { | @@ -106,25 +161,51 @@ export struct ZhSingleRow03 { | ||
| 106 | 161 | ||
| 107 | Scroll(this.scroller){ | 162 | Scroll(this.scroller){ |
| 108 | Row() { | 163 | Row() { |
| 109 | - ForEach(this.compDTO.operDataList, (item: ContentDTO) => { | ||
| 110 | - this.ItemCard(item) | ||
| 111 | - }) | 164 | + Row() { |
| 165 | + ForEach(this.compDTO.operDataList, (item: ContentDTO) => { | ||
| 166 | + this.ItemCard(item) | ||
| 167 | + }) | ||
| 168 | + } | ||
| 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) | ||
| 176 | + } | ||
| 177 | + } | ||
| 178 | + .justifyContent(FlexAlign.Center) | ||
| 179 | + .align(Alignment.Center) | ||
| 180 | + .width(this.moreWidth) | ||
| 181 | + .backgroundColor(0xf9f9f9) | ||
| 182 | + .borderRadius({ topLeft: 5, bottomLeft: 5 }) | ||
| 183 | + .height(116) | ||
| 184 | + } | ||
| 112 | } | 185 | } |
| 113 | } | 186 | } |
| 114 | - .scrollable(ScrollDirection.Horizontal) | 187 | + .align(Alignment.Start) |
| 188 | + .scrollable(this.compDTO.operDataList.length >= 2 ? ScrollDirection.Horizontal : ScrollDirection.None) | ||
| 115 | .scrollBar(BarState.Off) | 189 | .scrollBar(BarState.Off) |
| 116 | - .onScrollEdge((side: Edge) => { | ||
| 117 | - if (side === Edge.End) { | ||
| 118 | - this.isEndEdge = true; | ||
| 119 | - } | 190 | + .edgeEffect(EdgeEffect.None) |
| 191 | + .onReachEnd(() => { | ||
| 192 | + this.edgeAnimation() | ||
| 120 | }) | 193 | }) |
| 121 | .onScrollStop(() => { | 194 | .onScrollStop(() => { |
| 122 | - if (this.isEndEdge) { | ||
| 123 | - this.jumpToMore(); | ||
| 124 | - } | 195 | + // this.resetEdgeAnimation(); |
| 125 | }) | 196 | }) |
| 126 | .onScroll((xOffset: number, yOffset: number) => { | 197 | .onScroll((xOffset: number, yOffset: number) => { |
| 127 | - this.isEndEdge = false; | 198 | + if (xOffset < 0) { |
| 199 | + this.reverseEdgeAnimation(); | ||
| 200 | + } | ||
| 201 | + }) | ||
| 202 | + .onTouch((event?: TouchEvent) => { | ||
| 203 | + if(event) { | ||
| 204 | + if (event.type === TouchType.Up) { | ||
| 205 | + this.toMore(); | ||
| 206 | + this.resetEdgeAnimation(); | ||
| 207 | + } | ||
| 208 | + } | ||
| 128 | }) | 209 | }) |
| 129 | } | 210 | } |
| 130 | .padding({ | 211 | .padding({ |
| @@ -138,42 +219,44 @@ export struct ZhSingleRow03 { | @@ -138,42 +219,44 @@ export struct ZhSingleRow03 { | ||
| 138 | 219 | ||
| 139 | @Builder | 220 | @Builder |
| 140 | ItemCard(item: ContentDTO) { | 221 | ItemCard(item: ContentDTO) { |
| 141 | - Column() { | ||
| 142 | - Row() { | ||
| 143 | - Image(this.loadImg ? item.coverUrl : '') | ||
| 144 | - .width(106) | ||
| 145 | - .height(60) | ||
| 146 | - .margin({right: 12}) | ||
| 147 | - .backgroundColor(0xf5f5f5) | ||
| 148 | - | ||
| 149 | - Text(item.newsTitle) | ||
| 150 | - .width(154) | ||
| 151 | - .height(60) | ||
| 152 | - .maxLines(3) | ||
| 153 | - .textOverflow({overflow: TextOverflow.Ellipsis}) | ||
| 154 | - } | ||
| 155 | - .margin({bottom: 16}) | 222 | + if (this.compDTO.operDataList.length >= 2) { |
| 223 | + Column() { | ||
| 224 | + Row() { | ||
| 225 | + Image(this.loadImg ? item.coverUrl : '') | ||
| 226 | + .width(106) | ||
| 227 | + .height(60) | ||
| 228 | + .margin({right: 12}) | ||
| 229 | + .backgroundColor(0xf5f5f5) | ||
| 230 | + .margin({right: 12}) | ||
| 156 | 231 | ||
| 157 | - Row() { | ||
| 158 | - Flex({justifyContent: FlexAlign.SpaceBetween}){ | ||
| 159 | - Row() { | ||
| 160 | - Text(this.format(new Date(item.liveInfo.liveStartTime).getTime())) | ||
| 161 | - .margin({right: 6}) | ||
| 162 | - .fontColor(0x000000) | ||
| 163 | - .fontSize(13) | ||
| 164 | - .textAlign(TextAlign.Start) | ||
| 165 | - Image($r('app.media.timeline_rect')) | ||
| 166 | - .width(4) | ||
| 167 | - .height(3) | ||
| 168 | - .margin({right: 6}) | ||
| 169 | - Text(item.liveInfo.liveStartTime.split(' ')[1].slice(0, 5)) | ||
| 170 | - .margin({right: 6}) | ||
| 171 | - .fontColor(0x000000) | ||
| 172 | - .fontSize(13) | ||
| 173 | - Text('开始直播') | ||
| 174 | - .fontColor(0xC8C8C8) | ||
| 175 | - .fontSize(13) | ||
| 176 | - } | 232 | + Text(item.newsTitle) |
| 233 | + .width(154) | ||
| 234 | + .height(60) | ||
| 235 | + .maxLines(3) | ||
| 236 | + .textOverflow({overflow: TextOverflow.Ellipsis}) | ||
| 237 | + } | ||
| 238 | + .margin({bottom: 16}) | ||
| 239 | + | ||
| 240 | + Row() { | ||
| 241 | + Flex({justifyContent: FlexAlign.SpaceBetween}){ | ||
| 242 | + Row() { | ||
| 243 | + Text(this.format(new Date(item.liveInfo.liveStartTime).getTime())) | ||
| 244 | + .margin({right: 6}) | ||
| 245 | + .fontColor(0x000000) | ||
| 246 | + .fontSize(13) | ||
| 247 | + .textAlign(TextAlign.Start) | ||
| 248 | + Image($r('app.media.timeline_rect')) | ||
| 249 | + .width(4) | ||
| 250 | + .height(3) | ||
| 251 | + .margin({right: 6}) | ||
| 252 | + Text(item.liveInfo.liveStartTime.split(' ')[1].slice(0, 5)) | ||
| 253 | + .margin({right: 6}) | ||
| 254 | + .fontColor(0x000000) | ||
| 255 | + .fontSize(13) | ||
| 256 | + Text('开始直播') | ||
| 257 | + .fontColor(0xC8C8C8) | ||
| 258 | + .fontSize(13) | ||
| 259 | + } | ||
| 177 | 260 | ||
| 178 | Row() { | 261 | Row() { |
| 179 | Text(this.isReserved(Number(item.objectId)) ? '已预约' : '预约') | 262 | Text(this.isReserved(Number(item.objectId)) ? '已预约' : '预约') |
| @@ -188,21 +271,89 @@ export struct ZhSingleRow03 { | @@ -188,21 +271,89 @@ export struct ZhSingleRow03 { | ||
| 188 | this.bookAndCancel(item.relId, item.objectId, !this.isReserved(Number(item.objectId))) | 271 | this.bookAndCancel(item.relId, item.objectId, !this.isReserved(Number(item.objectId))) |
| 189 | }) | 272 | }) |
| 190 | 273 | ||
| 274 | + } | ||
| 275 | + .margin({top: -5}) | ||
| 191 | } | 276 | } |
| 192 | - .margin({top: -5}) | 277 | + |
| 193 | } | 278 | } |
| 279 | + } | ||
| 280 | + .width(298) | ||
| 281 | + .height(116) | ||
| 282 | + .padding({top: 12, bottom: 12, left: 12, right: 12}) | ||
| 283 | + .backgroundColor(0xf9f9f9) | ||
| 284 | + .margin({right: 8}) | ||
| 285 | + .onClick(() => { | ||
| 286 | + InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName) | ||
| 287 | + ProcessUtils.processPage(item) | ||
| 288 | + }) | ||
| 289 | + } else { | ||
| 290 | + Column() { | ||
| 291 | + Row() { | ||
| 292 | + Image(this.loadImg ? item.coverUrl : '') | ||
| 293 | + .width(106) | ||
| 294 | + .height(60) | ||
| 295 | + .backgroundColor(0xf5f5f5) | ||
| 296 | + .margin({right: 12}) | ||
| 297 | + | ||
| 298 | + Text(item.newsTitle) | ||
| 299 | + .width(201) | ||
| 300 | + .height(60) | ||
| 301 | + .maxLines(3) | ||
| 302 | + .textOverflow({overflow: TextOverflow.Ellipsis}) | ||
| 303 | + } | ||
| 304 | + .margin({bottom: 16}) | ||
| 305 | + .justifyContent(FlexAlign.Start) | ||
| 306 | + | ||
| 307 | + Row() { | ||
| 308 | + Flex({justifyContent: FlexAlign.SpaceBetween}){ | ||
| 309 | + Row() { | ||
| 310 | + Text(this.format(new Date(item.liveInfo.liveStartTime).getTime())) | ||
| 311 | + .margin({right: 6}) | ||
| 312 | + .fontColor(0x000000) | ||
| 313 | + .fontSize(13) | ||
| 314 | + .textAlign(TextAlign.Start) | ||
| 315 | + Image($r('app.media.timeline_rect')) | ||
| 316 | + .width(4) | ||
| 317 | + .height(3) | ||
| 318 | + .margin({right: 6}) | ||
| 319 | + Text(item.liveInfo.liveStartTime.split(' ')[1].slice(0, 5)) | ||
| 320 | + .margin({right: 6}) | ||
| 321 | + .fontColor(0x000000) | ||
| 322 | + .fontSize(13) | ||
| 323 | + Text('开始直播') | ||
| 324 | + .fontColor(0xC8C8C8) | ||
| 325 | + .fontSize(13) | ||
| 326 | + } | ||
| 327 | + | ||
| 328 | + Row() { | ||
| 329 | + Text(this.isReserved(Number(item.objectId)) ? '已预约' : '预约') | ||
| 330 | + .width(48) | ||
| 331 | + .height(24) | ||
| 332 | + .backgroundColor(this.isReserved(Number(item.objectId)) ? 0xffffff : 0xED2800) | ||
| 333 | + .fontColor(this.isReserved(Number(item.objectId)) ? 0xC8C8C8 : 0xffffff) | ||
| 334 | + .fontSize(12) | ||
| 335 | + .textAlign(TextAlign.Center) | ||
| 336 | + .borderRadius(3) | ||
| 337 | + .onClick(() => { | ||
| 338 | + this.bookAndCancel(item.relId, item.objectId, !this.isReserved(Number(item.objectId))) | ||
| 339 | + }) | ||
| 194 | 340 | ||
| 341 | + } | ||
| 342 | + .margin({top: -5}) | ||
| 343 | + } | ||
| 344 | + | ||
| 345 | + } | ||
| 195 | } | 346 | } |
| 347 | + .width('100%') | ||
| 348 | + .height(116) | ||
| 349 | + .padding({top: 12, bottom: 12, left: 12, right: 12}) | ||
| 350 | + .backgroundColor(0xf9f9f9) | ||
| 351 | + .margin({right: 8}) | ||
| 352 | + .onClick(() => { | ||
| 353 | + InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName) | ||
| 354 | + ProcessUtils.processPage(item) | ||
| 355 | + }) | ||
| 196 | } | 356 | } |
| 197 | - .width(298) | ||
| 198 | - .height(116) | ||
| 199 | - .padding({top: 12, bottom: 12, left: 12, right: 12}) | ||
| 200 | - .backgroundColor(0xf9f9f9) | ||
| 201 | - .margin({right: 8}) | ||
| 202 | - .onClick(() => { | ||
| 203 | - InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName) | ||
| 204 | - ProcessUtils.processPage(item) | ||
| 205 | - }) | ||
| 206 | } | 357 | } |
| 207 | 358 | ||
| 208 | 359 | ||
| @@ -229,9 +380,6 @@ export struct ZhSingleRow03 { | @@ -229,9 +380,6 @@ export struct ZhSingleRow03 { | ||
| 229 | .width(14) | 380 | .width(14) |
| 230 | .height(14) | 381 | .height(14) |
| 231 | } | 382 | } |
| 232 | - .padding({ | ||
| 233 | - right: $r('app.float.card_comp_pagePadding_lf'), | ||
| 234 | - }) | ||
| 235 | .onClick(() => { | 383 | .onClick(() => { |
| 236 | this.jumpToMore(); | 384 | this.jumpToMore(); |
| 237 | }) | 385 | }) |
| @@ -261,85 +409,4 @@ export struct ZhSingleRow03 { | @@ -261,85 +409,4 @@ export struct ZhSingleRow03 { | ||
| 261 | 409 | ||
| 262 | } | 410 | } |
| 263 | 411 | ||
| 264 | -@Extend(Text) | ||
| 265 | -function textOverflowStyle(maxLine: number) { | ||
| 266 | - .maxLines(maxLine) | ||
| 267 | - .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 268 | -} | ||
| 269 | - | ||
| 270 | -@Component | ||
| 271 | -struct CreatorItem { | ||
| 272 | - @Prop item: ContentDTO | ||
| 273 | - @State rmhIsAttention: number = 0 | ||
| 274 | - @State loadImg: boolean = false; | ||
| 275 | - | ||
| 276 | - async aboutToAppear(): Promise<void> { | ||
| 277 | - this.loadImg = await onlyWifiLoadImg(); | ||
| 278 | - } | ||
| 279 | - build() { | ||
| 280 | - ListItem() { | ||
| 281 | - Column() { | ||
| 282 | - Stack({ alignContent: Alignment.Bottom }) { | ||
| 283 | - Image(this.loadImg ? this.item.coverUrl : '') | ||
| 284 | - .backgroundColor(0xf5f5f5) | ||
| 285 | - .width(156) | ||
| 286 | - .height(208) | ||
| 287 | - .border({width: 1}) | ||
| 288 | - .borderRadius(3) | ||
| 289 | - Row() | ||
| 290 | - .width(156) | ||
| 291 | - .height(80) | ||
| 292 | - .linearGradient({ | ||
| 293 | - direction: GradientDirection.Bottom, | ||
| 294 | - colors: [['rgba(0, 0, 0, 0.0)', 0.0], ['rgba(0, 0, 0, 0.3)', 1.0]] | ||
| 295 | - }) | ||
| 296 | - Text(this.item.newsTitle) | ||
| 297 | - .fontColor(0xffffff) | ||
| 298 | - .fontSize(14) | ||
| 299 | - .maxLines(2) | ||
| 300 | - .textOverflow({overflow: TextOverflow.Ellipsis}) | ||
| 301 | - .width(140) | ||
| 302 | - .margin({bottom: 8}) | ||
| 303 | - } | ||
| 304 | - } | ||
| 305 | - .width(156) | ||
| 306 | - .height(208) | ||
| 307 | - .margin({ right: 11 }) | ||
| 308 | - .borderColor($r('app.color.color_EDEDED')) | ||
| 309 | - .borderRadius($r('app.float.image_border_radius')) | ||
| 310 | - } | ||
| 311 | - .onClick((event: ClickEvent) => { | ||
| 312 | - ProcessUtils.processPage(this.item) | ||
| 313 | - }) | ||
| 314 | - } | ||
| 315 | - | ||
| 316 | - /** | ||
| 317 | - * 关注号主 TODO 这里后面需要抽离 | ||
| 318 | - */ | ||
| 319 | - handleAccention(item: ContentDTO, status: number) { | ||
| 320 | - this.rmhIsAttention = this.rmhIsAttention ? 0 : 1 | ||
| 321 | - return | ||
| 322 | - // 未登录,跳转登录 | ||
| 323 | - if (!HttpUtils.getUserId()) { | ||
| 324 | - WDRouterRule.jumpWithPage(WDRouterPage.loginPage) | ||
| 325 | - return | ||
| 326 | - } | ||
| 327 | 412 | ||
| 328 | - const params: postInteractAccentionOperateParams = { | ||
| 329 | - attentionUserType: item.rmhInfo?.userType || '', //被关注用户类型(1 普通用户 2 视频号 3 矩阵号) | ||
| 330 | - attentionUserId: item.rmhInfo?.userId || '', // 被关注用户号主id | ||
| 331 | - attentionCreatorId: item.rmhInfo?.rmhId || '', // 被关注用户号主id | ||
| 332 | - // userType: 1, | ||
| 333 | - // userId: '1', // TODO 用户id需要从本地获取 | ||
| 334 | - status: status, | ||
| 335 | - } | ||
| 336 | - PageRepository.postInteractAccentionOperate(params).then(res => { | ||
| 337 | - console.log(TAG, '关注号主==', JSON.stringify(res.data)) | ||
| 338 | - if (status === 1) { | ||
| 339 | - this.rmhIsAttention = 0 | ||
| 340 | - } else { | ||
| 341 | - this.rmhIsAttention = 1 | ||
| 342 | - } | ||
| 343 | - }) | ||
| 344 | - } | ||
| 345 | -} |
| @@ -11,6 +11,14 @@ import { FollowOperationRequestItem } from '../../../viewmodel/FollowOperationRe | @@ -11,6 +11,14 @@ import { FollowOperationRequestItem } from '../../../viewmodel/FollowOperationRe | ||
| 11 | export struct FollowChildComponent{ | 11 | export struct FollowChildComponent{ |
| 12 | @ObjectLink data: FollowListDetailItem | 12 | @ObjectLink data: FollowListDetailItem |
| 13 | @State type:number = 0 | 13 | @State type:number = 0 |
| 14 | + @State columnHeight:number = 202 | ||
| 15 | + | ||
| 16 | + | ||
| 17 | + aboutToAppear(): void { | ||
| 18 | + if(this.type == 0 && StringUtils.isEmpty(this.data.introduction)){ | ||
| 19 | + this.columnHeight = 202 - 31 | ||
| 20 | + } | ||
| 21 | + } | ||
| 14 | 22 | ||
| 15 | build() { | 23 | build() { |
| 16 | if(this.type == 0 ){ | 24 | if(this.type == 0 ){ |
| @@ -115,7 +123,7 @@ export struct FollowChildComponent{ | @@ -115,7 +123,7 @@ export struct FollowChildComponent{ | ||
| 115 | .justifyContent(FlexAlign.SpaceBetween) | 123 | .justifyContent(FlexAlign.SpaceBetween) |
| 116 | .alignItems(VerticalAlign.Top) | 124 | .alignItems(VerticalAlign.Top) |
| 117 | 125 | ||
| 118 | - }.height('202lpx') | 126 | + }.height(`${this.columnHeight}lpx`) |
| 119 | .justifyContent(FlexAlign.Start) | 127 | .justifyContent(FlexAlign.Start) |
| 120 | 128 | ||
| 121 | Divider() | 129 | Divider() |
| @@ -144,13 +144,11 @@ export struct FollowListDetailUI { | @@ -144,13 +144,11 @@ export struct FollowListDetailUI { | ||
| 144 | value.list.forEach((value) => { | 144 | value.list.forEach((value) => { |
| 145 | let fansNum: number = value.fansNum | 145 | let fansNum: number = value.fansNum |
| 146 | let fansNumString = "" | 146 | let fansNumString = "" |
| 147 | - if (fansNum > 10000) { | ||
| 148 | - let temp = (fansNum / 10000) + "" | ||
| 149 | - let index = temp.indexOf('.') | ||
| 150 | - if (index != -1) { | ||
| 151 | - temp = temp.substring(0, index + 2) | ||
| 152 | - } else { | ||
| 153 | - temp = temp | 147 | + |
| 148 | + if (fansNum >= 10000) { | ||
| 149 | + let temp = (fansNum / 10000) .toFixed(1) | ||
| 150 | + if (Number(temp.substring(temp.length-1)) == 0) { | ||
| 151 | + temp = temp.substring(0, temp.length-2) | ||
| 154 | } | 152 | } |
| 155 | fansNumString = temp + "万" | 153 | fansNumString = temp + "万" |
| 156 | } else { | 154 | } else { |
| @@ -45,7 +45,7 @@ export struct TopNavigationComponentNew { | @@ -45,7 +45,7 @@ export struct TopNavigationComponentNew { | ||
| 45 | @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 | 45 | @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 |
| 46 | @Link _currentNavIndex?: number; | 46 | @Link _currentNavIndex?: number; |
| 47 | // 顶导当前选中/焦点下标 | 47 | // 顶导当前选中/焦点下标 |
| 48 | - @State currentTopNavSelectedIndex: number = 0; | 48 | + @State @Watch('updateCurrentTopNavSelectedIndex') currentTopNavSelectedIndex: number = 0; |
| 49 | // 顶导数据 | 49 | // 顶导数据 |
| 50 | @State @Watch('onTopNavigationDataUpdated') topNavList: TopNavDTO[] = [] | 50 | @State @Watch('onTopNavigationDataUpdated') topNavList: TopNavDTO[] = [] |
| 51 | @State indexSettingChannelId: number = AppStorage.get<number>('indexSettingChannelId') || 2002 | 51 | @State indexSettingChannelId: number = AppStorage.get<number>('indexSettingChannelId') || 2002 |
| @@ -114,20 +114,6 @@ export struct TopNavigationComponentNew { | @@ -114,20 +114,6 @@ export struct TopNavigationComponentNew { | ||
| 114 | .onChange((index) => { | 114 | .onChange((index) => { |
| 115 | Logger.info(TAG, `onChange index : ${index}`); | 115 | Logger.info(TAG, `onChange index : ${index}`); |
| 116 | 116 | ||
| 117 | - // 顶部tab埋点 | ||
| 118 | - if(this.currentBottomNavName === '新闻') { | ||
| 119 | - const tab = this.myChannelList[index] | ||
| 120 | - Logger.info(TAG, `顶部tab : ${JSON.stringify(tab)}`); | ||
| 121 | - | ||
| 122 | - const params: ParamType = { | ||
| 123 | - "pageName": tab.name, | ||
| 124 | - "tabName": tab.name, | ||
| 125 | - "pageId": tab.pageId, | ||
| 126 | - } | ||
| 127 | - Tracking.event("home_page_tab_click ", params) | ||
| 128 | - } | ||
| 129 | - | ||
| 130 | - | ||
| 131 | if (this.isBroadcastByIndex(index)) { | 117 | if (this.isBroadcastByIndex(index)) { |
| 132 | // 跳转到播报页面 | 118 | // 跳转到播报页面 |
| 133 | ProcessUtils.gotoBroadcastPage(this.myChannelList[index].pageId) | 119 | ProcessUtils.gotoBroadcastPage(this.myChannelList[index].pageId) |
| @@ -217,6 +203,7 @@ export struct TopNavigationComponentNew { | @@ -217,6 +203,7 @@ export struct TopNavigationComponentNew { | ||
| 217 | moreChannelList: $moreChannelList, | 203 | moreChannelList: $moreChannelList, |
| 218 | localChannelList: $localChannelList, | 204 | localChannelList: $localChannelList, |
| 219 | changeTab: (index) => { | 205 | changeTab: (index) => { |
| 206 | + | ||
| 220 | this.changePage(index) | 207 | this.changePage(index) |
| 221 | } | 208 | } |
| 222 | }) | 209 | }) |
| @@ -496,6 +483,32 @@ export struct TopNavigationComponentNew { | @@ -496,6 +483,32 @@ export struct TopNavigationComponentNew { | ||
| 496 | `onTopNavigationDataUpdated currentTopNavIndex: ${this.currentTopNavSelectedIndex},topNavList.length:${this.topNavList.length}`); | 483 | `onTopNavigationDataUpdated currentTopNavIndex: ${this.currentTopNavSelectedIndex},topNavList.length:${this.topNavList.length}`); |
| 497 | } | 484 | } |
| 498 | 485 | ||
| 486 | + updateCurrentTopNavSelectedIndex() { | ||
| 487 | + Logger.info(TAG, `currentTopNavSelectedIndex : ${this.currentTopNavSelectedIndex}、${this.currentBottomNavName}`); | ||
| 488 | + | ||
| 489 | + // 顶部tab埋点 | ||
| 490 | + if(this.currentBottomNavName === '新闻') { | ||
| 491 | + const tab = this.myChannelList[this.currentTopNavSelectedIndex] | ||
| 492 | + Logger.info(TAG, `新闻tab埋点: ${JSON.stringify(tab)}`); | ||
| 493 | + | ||
| 494 | + const params: ParamType = { | ||
| 495 | + "pageName": tab.name, | ||
| 496 | + "tabName": tab.name, | ||
| 497 | + "pageId": tab.pageId, | ||
| 498 | + } | ||
| 499 | + Tracking.event("home_page_tab_click ", params) | ||
| 500 | + } else if(this.currentBottomNavName === '人民号') { | ||
| 501 | + const tab = this.topNavList[this.currentTopNavSelectedIndex] | ||
| 502 | + Logger.info(TAG, `人民号tab埋点: ${JSON.stringify(tab)}`); | ||
| 503 | + | ||
| 504 | + const params: ParamType = { | ||
| 505 | + "pageName": tab.name, | ||
| 506 | + "tabName": tab.name, | ||
| 507 | + "pageId": tab.pageId, | ||
| 508 | + } | ||
| 509 | + Tracking.event("People_account_page_tab_click", params) | ||
| 510 | + } | ||
| 511 | + } | ||
| 499 | onAutoRefresh() { | 512 | onAutoRefresh() { |
| 500 | if (this.bottomNavIndex != this._currentNavIndex) { | 513 | if (this.bottomNavIndex != this._currentNavIndex) { |
| 501 | return | 514 | return |
| @@ -8,6 +8,62 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent { | @@ -8,6 +8,62 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent { | ||
| 8 | @State compDTO: CompDTO = {} as CompDTO | 8 | @State compDTO: CompDTO = {} as CompDTO |
| 9 | @State pageId: string = ''; | 9 | @State pageId: string = ''; |
| 10 | @State pageName: string = ''; | 10 | @State pageName: string = ''; |
| 11 | + @State initMoreWidth: number = 16; | ||
| 12 | + @State moreWidth:number = 16 | ||
| 13 | + @State moreTips: string = '' | ||
| 14 | + scroller: Scroller = new Scroller() | ||
| 15 | + | ||
| 16 | + resetMoreTips() { | ||
| 17 | + console.log('resetMoreTips', this.moreWidth, this.initMoreWidth) | ||
| 18 | + if (this.moreWidth < this.initMoreWidth * 2) { | ||
| 19 | + this.moreTips = '查看更多'; | ||
| 20 | + } | ||
| 21 | + } | ||
| 22 | + | ||
| 23 | + edgeAnimation() { | ||
| 24 | + if (this.moreWidth < this.initMoreWidth * 3) { | ||
| 25 | + if (!this.moreTips) { | ||
| 26 | + this.moreTips = '查看更多'; | ||
| 27 | + } | ||
| 28 | + this.moreWidth = this.moreWidth + 2 | ||
| 29 | + } | ||
| 30 | + if (this.moreWidth > this.initMoreWidth * 2) { | ||
| 31 | + this.moreTips = '松手查看'; | ||
| 32 | + } else { | ||
| 33 | + | ||
| 34 | + } | ||
| 35 | + } | ||
| 36 | + | ||
| 37 | + reverseEdgeAnimation() { | ||
| 38 | + if (this.moreWidth > this.initMoreWidth) { | ||
| 39 | + this.moreWidth = this.moreWidth - 2 | ||
| 40 | + } | ||
| 41 | + this.resetMoreTips() | ||
| 42 | + } | ||
| 43 | + | ||
| 44 | + resetEdgeAnimation() { | ||
| 45 | + if (this.moreWidth > this.initMoreWidth) { | ||
| 46 | + this.moreWidth = this.moreWidth - 1 | ||
| 47 | + this.resetEdgeAnimation(); | ||
| 48 | + } | ||
| 49 | + this.resetMoreTips() | ||
| 50 | + } | ||
| 51 | + | ||
| 52 | + toMore() { | ||
| 53 | + if (this.moreWidth > this.initMoreWidth * 2) { | ||
| 54 | + if (this.compDTO.linkUrl) { | ||
| 55 | + let taskAction: Action = { | ||
| 56 | + type: 'JUMP_H5_BY_WEB_VIEW', | ||
| 57 | + params: { | ||
| 58 | + url: this.compDTO.linkUrl | ||
| 59 | + } as Params, | ||
| 60 | + }; | ||
| 61 | + WDRouterRule.jumpWithAction(taskAction) | ||
| 62 | + } else { | ||
| 63 | + this.jumpToLiveMorePage() | ||
| 64 | + } | ||
| 65 | + } | ||
| 66 | + } | ||
| 11 | 67 | ||
| 12 | build() { | 68 | build() { |
| 13 | Column() { | 69 | Column() { |
| @@ -48,57 +104,95 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent { | @@ -48,57 +104,95 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent { | ||
| 48 | }) | 104 | }) |
| 49 | 105 | ||
| 50 | }.justifyContent(FlexAlign.SpaceBetween) | 106 | }.justifyContent(FlexAlign.SpaceBetween) |
| 51 | - .padding({ left: 16, right: 16 }) | 107 | + // .padding({ left: 16, right: 16 }) |
| 52 | .margin({ top: 8, bottom: 8 }) | 108 | .margin({ top: 8, bottom: 8 }) |
| 53 | .width('100%') | 109 | .width('100%') |
| 54 | 110 | ||
| 55 | // .backgroundColor($r("app.color.white")) | 111 | // .backgroundColor($r("app.color.white")) |
| 56 | - List({ space: 12 }) { | 112 | + Scroll(this.scroller) { |
| 113 | + Row() { | ||
| 114 | + Row() { | ||
| 115 | + ForEach(this.compDTO.operDataList, (item: ContentDTO, index: number) => { | ||
| 116 | + Column() { | ||
| 117 | + Image(item.coverUrl) | ||
| 118 | + .aspectRatio(1.5) | ||
| 119 | + .width(this.compDTO.operDataList.length == 2 ? 210 : 150) | ||
| 120 | + .borderRadius(4) | ||
| 121 | + .objectFit(ImageFit.Cover) | ||
| 57 | 122 | ||
| 58 | - ForEach(this.compDTO.operDataList, (item: ContentDTO, index: number) => { | ||
| 59 | - ListItem() { | 123 | + Text(item.newsTitle) |
| 124 | + .fontSize($r("app.float.font_size_14")) | ||
| 125 | + .fontColor($r("app.color.color_212228")) | ||
| 126 | + .fontWeight(400) | ||
| 127 | + .maxLines(2) | ||
| 128 | + .textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。 | ||
| 129 | + .textAlign(TextAlign.Start) | ||
| 130 | + .margin({ top: 8 }) | ||
| 131 | + .width(150) | ||
| 132 | + .lineHeight(19) | ||
| 133 | + } | ||
| 134 | + .padding({ right: 16 }) | ||
| 135 | + // .offset({x:16}) | ||
| 136 | + .onClick(() => { | ||
| 137 | + InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName) | ||
| 138 | + ProcessUtils.processPage(item) | ||
| 139 | + }) | ||
| 140 | + }) | ||
| 141 | + } | ||
| 142 | + if (this.compDTO.operDataList.length > 2) { | ||
| 60 | Column() { | 143 | Column() { |
| 61 | - Image(item.coverUrl) | ||
| 62 | - .aspectRatio(1.5) | ||
| 63 | - .width(this.compDTO.operDataList.length == 2 ? 210 : 150) | ||
| 64 | - .borderRadius(4) | ||
| 65 | - .objectFit(ImageFit.Cover) | ||
| 66 | - | ||
| 67 | - Text(item.newsTitle) | ||
| 68 | - .fontSize($r("app.float.font_size_14")) | ||
| 69 | - .fontColor($r("app.color.color_212228")) | ||
| 70 | - .fontWeight(400) | ||
| 71 | - .maxLines(2) | ||
| 72 | - .textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。 | ||
| 73 | - .textAlign(TextAlign.Start) | ||
| 74 | - .margin({ top: 8 }) | ||
| 75 | - .width(150) | ||
| 76 | - .lineHeight(19) | 144 | + if (this.moreWidth > this.initMoreWidth + 2) { |
| 145 | + Text(this.moreTips) | ||
| 146 | + .fontSize(8) | ||
| 147 | + .fontColor(0x858585) | ||
| 148 | + .width(8) | ||
| 149 | + } | ||
| 77 | } | 150 | } |
| 151 | + .justifyContent(FlexAlign.Center) | ||
| 152 | + .align(Alignment.Center) | ||
| 153 | + .width(this.moreWidth) | ||
| 154 | + .backgroundColor(0xf1f3f4) | ||
| 155 | + .borderRadius({ topLeft: 5, bottomLeft: 5 }) | ||
| 156 | + .height(this.compDTO.operDataList.length == 2 ? 180 : 146) | ||
| 78 | } | 157 | } |
| 79 | - .padding({ left: (index == 0) ? 16 : 0, right: (index == this.compDTO.operDataList.length - 1) ? 16 : 0 }) | ||
| 80 | - // .offset({x:16}) | ||
| 81 | - .onClick(() => { | ||
| 82 | - InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName) | ||
| 83 | - ProcessUtils.processPage(item) | ||
| 84 | - }) | ||
| 85 | - }) | ||
| 86 | - | ||
| 87 | - }.listDirection(Axis.Horizontal) | 158 | + } |
| 159 | + } | ||
| 160 | + .align(Alignment.Start) | ||
| 161 | + .scrollable(this.compDTO.operDataList.length > 2 ? ScrollDirection.Horizontal : ScrollDirection.None) | ||
| 88 | .scrollBar(BarState.Off) | 162 | .scrollBar(BarState.Off) |
| 89 | - .width('100%') | 163 | + .edgeEffect(EdgeEffect.None) |
| 164 | + .onReachEnd(() => { | ||
| 165 | + this.edgeAnimation() | ||
| 166 | + }) | ||
| 167 | + .onScrollStop(() => { | ||
| 168 | + // this.resetEdgeAnimation(); | ||
| 169 | + }) | ||
| 170 | + .onScroll((xOffset: number, yOffset: number) => { | ||
| 171 | + if (xOffset < 0) { | ||
| 172 | + this.reverseEdgeAnimation(); | ||
| 173 | + } | ||
| 174 | + }) | ||
| 175 | + .onTouch((event?: TouchEvent) => { | ||
| 176 | + if(event) { | ||
| 177 | + if (event.type === TouchType.Up) { | ||
| 178 | + this.toMore(); | ||
| 179 | + this.resetEdgeAnimation(); | ||
| 180 | + } | ||
| 181 | + } | ||
| 182 | + }) | ||
| 183 | + // .width('100%') | ||
| 90 | 184 | ||
| 91 | // .backgroundColor($r("app.color.color_FE4B05")) | 185 | // .backgroundColor($r("app.color.color_FE4B05")) |
| 92 | // .padding({left:16,right:16}) | 186 | // .padding({left:16,right:16}) |
| 93 | // .margin({left:16,right:16}) | 187 | // .margin({left:16,right:16}) |
| 94 | 188 | ||
| 95 | } | 189 | } |
| 96 | - .width("100%") | 190 | + // .width("100%") |
| 97 | .padding({ | 191 | .padding({ |
| 98 | - top: 14, | ||
| 99 | - left: 0, | ||
| 100 | - right: 0, | ||
| 101 | - bottom: 14 | 192 | + left: $r('app.float.card_comp_pagePadding_lf'), |
| 193 | + right: $r('app.float.card_comp_pagePadding_lf'), | ||
| 194 | + top: $r('app.float.card_comp_pagePadding_tb'), | ||
| 195 | + bottom: $r('app.float.card_comp_pagePadding_tb') | ||
| 102 | }) | 196 | }) |
| 103 | .backgroundColor($r("app.color.white")) | 197 | .backgroundColor($r("app.color.white")) |
| 104 | // .backgroundColor($r("app.color.color_FE4B05")) | 198 | // .backgroundColor($r("app.color.color_FE4B05")) |
| @@ -18,6 +18,62 @@ export struct LiveHorizontalCardComponent { | @@ -18,6 +18,62 @@ export struct LiveHorizontalCardComponent { | ||
| 18 | @State pageName: string = ''; | 18 | @State pageName: string = ''; |
| 19 | @State compDTO: CompDTO = {} as CompDTO | 19 | @State compDTO: CompDTO = {} as CompDTO |
| 20 | @State loadImg: boolean = false; | 20 | @State loadImg: boolean = false; |
| 21 | + @State initMoreWidth: number = 16; | ||
| 22 | + @State moreWidth:number = 16 | ||
| 23 | + @State moreTips: string = '' | ||
| 24 | + scroller: Scroller = new Scroller() | ||
| 25 | + | ||
| 26 | + resetMoreTips() { | ||
| 27 | + console.log('resetMoreTips', this.moreWidth, this.initMoreWidth) | ||
| 28 | + if (this.moreWidth < this.initMoreWidth * 2) { | ||
| 29 | + this.moreTips = '查看更多'; | ||
| 30 | + } | ||
| 31 | + } | ||
| 32 | + | ||
| 33 | + edgeAnimation() { | ||
| 34 | + if (this.moreWidth < this.initMoreWidth * 3) { | ||
| 35 | + if (!this.moreTips) { | ||
| 36 | + this.moreTips = '查看更多'; | ||
| 37 | + } | ||
| 38 | + this.moreWidth = this.moreWidth + 2 | ||
| 39 | + } | ||
| 40 | + if (this.moreWidth > this.initMoreWidth * 2) { | ||
| 41 | + this.moreTips = '松手查看'; | ||
| 42 | + } else { | ||
| 43 | + | ||
| 44 | + } | ||
| 45 | + } | ||
| 46 | + | ||
| 47 | + reverseEdgeAnimation() { | ||
| 48 | + if (this.moreWidth > this.initMoreWidth) { | ||
| 49 | + this.moreWidth = this.moreWidth - 2 | ||
| 50 | + } | ||
| 51 | + this.resetMoreTips() | ||
| 52 | + } | ||
| 53 | + | ||
| 54 | + resetEdgeAnimation() { | ||
| 55 | + if (this.moreWidth > this.initMoreWidth) { | ||
| 56 | + this.moreWidth = this.moreWidth - 1 | ||
| 57 | + this.resetEdgeAnimation(); | ||
| 58 | + } | ||
| 59 | + this.resetMoreTips() | ||
| 60 | + } | ||
| 61 | + | ||
| 62 | + toMore() { | ||
| 63 | + if (this.moreWidth > this.initMoreWidth * 2) { | ||
| 64 | + if (this.compDTO.linkUrl) { | ||
| 65 | + let taskAction: Action = { | ||
| 66 | + type: 'JUMP_H5_BY_WEB_VIEW', | ||
| 67 | + params: { | ||
| 68 | + url: this.compDTO.linkUrl | ||
| 69 | + } as Params, | ||
| 70 | + }; | ||
| 71 | + WDRouterRule.jumpWithAction(taskAction) | ||
| 72 | + } else { | ||
| 73 | + this.jumpToLiveMorePage() | ||
| 74 | + } | ||
| 75 | + } | ||
| 76 | + } | ||
| 21 | 77 | ||
| 22 | async aboutToAppear(): Promise<void> { | 78 | async aboutToAppear(): Promise<void> { |
| 23 | this.loadImg = await onlyWifiLoadImg(); | 79 | this.loadImg = await onlyWifiLoadImg(); |
| @@ -63,52 +119,91 @@ export struct LiveHorizontalCardComponent { | @@ -63,52 +119,91 @@ export struct LiveHorizontalCardComponent { | ||
| 63 | }) | 119 | }) |
| 64 | } | 120 | } |
| 65 | }.justifyContent(FlexAlign.SpaceBetween) | 121 | }.justifyContent(FlexAlign.SpaceBetween) |
| 66 | - .padding({ left: 16, right: 16 }) | 122 | + // .padding({ left: 16, right: 16 }) |
| 67 | .margin({ top: 8, bottom: 8 }) | 123 | .margin({ top: 8, bottom: 8 }) |
| 68 | .width(CommonConstants.FULL_WIDTH) | 124 | .width(CommonConstants.FULL_WIDTH) |
| 69 | 125 | ||
| 70 | // 多个 | 126 | // 多个 |
| 71 | if (this.compDTO.operDataList.length >= 2) { | 127 | if (this.compDTO.operDataList.length >= 2) { |
| 72 | - List({ space: 12 }) { | ||
| 73 | - ForEach(this.compDTO.operDataList, (item: ContentDTO, index: number) => { | ||
| 74 | - ListItem() { | ||
| 75 | - Column() { | ||
| 76 | - Stack({ alignContent: Alignment.BottomEnd }) { | ||
| 77 | - Image(this.loadImg ? item.coverUrl : '') | ||
| 78 | - .backgroundColor(0xf5f5f5) | ||
| 79 | - .aspectRatio(16 / 9) | 128 | + Scroll(this.scroller) { |
| 129 | + Row() { | ||
| 130 | + Row() { | ||
| 131 | + ForEach(this.compDTO.operDataList, (item: ContentDTO, index: number) => { | ||
| 132 | + Column() { | ||
| 133 | + Stack({ alignContent: Alignment.BottomEnd }) { | ||
| 134 | + Image(this.loadImg ? item.coverUrl : '') | ||
| 135 | + .backgroundColor(0xf5f5f5) | ||
| 136 | + .aspectRatio(16 / 9) | ||
| 137 | + .width(this.compDTO.operDataList.length == 2 ? 210 : 150) | ||
| 138 | + .borderRadius(4) | ||
| 139 | + .objectFit(ImageFit.Cover) | ||
| 140 | + CardMediaInfo({ | ||
| 141 | + livePeopleNum:false, | ||
| 142 | + contentDTO: item | ||
| 143 | + }) | ||
| 144 | + } | ||
| 145 | + | ||
| 146 | + Text(item.newsTitle) | ||
| 147 | + .fontSize($r("app.float.font_size_14")) | ||
| 148 | + .fontColor($r("app.color.color_212228")) | ||
| 149 | + .fontWeight(400) | ||
| 150 | + .maxLines(2) | ||
| 151 | + .textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。 | ||
| 152 | + .textAlign(TextAlign.Start) | ||
| 153 | + .margin({ top: 8 }) | ||
| 80 | .width(this.compDTO.operDataList.length == 2 ? 210 : 150) | 154 | .width(this.compDTO.operDataList.length == 2 ? 210 : 150) |
| 81 | - .borderRadius(4) | ||
| 82 | - .objectFit(ImageFit.Cover) | ||
| 83 | - CardMediaInfo({ | ||
| 84 | - livePeopleNum:false, | ||
| 85 | - contentDTO: item | ||
| 86 | - }) | ||
| 87 | } | 155 | } |
| 88 | - | ||
| 89 | - Text(item.newsTitle) | ||
| 90 | - .fontSize($r("app.float.font_size_14")) | ||
| 91 | - .fontColor($r("app.color.color_212228")) | ||
| 92 | - .fontWeight(400) | ||
| 93 | - .maxLines(2) | ||
| 94 | - .textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。 | ||
| 95 | - .textAlign(TextAlign.Start) | ||
| 96 | - .margin({ top: 8 }) | ||
| 97 | - .width(this.compDTO.operDataList.length == 2 ? 210 : 150) | ||
| 98 | - } | 156 | + .padding({ right: 16 }) |
| 157 | + .onClick(() => { | ||
| 158 | + InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName) | ||
| 159 | + if (item.objectType != '0') { | ||
| 160 | + console.log(item.objectId) | ||
| 161 | + this.gotoLive(item) | ||
| 162 | + } | ||
| 163 | + }) | ||
| 164 | + }) | ||
| 99 | } | 165 | } |
| 100 | - .padding({ left: (index == 0) ? 16 : 0, right: (index == this.compDTO.operDataList.length - 1) ? 16 : 0 }) | ||
| 101 | - .onClick(() => { | ||
| 102 | - InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName) | ||
| 103 | - if (item.objectType != '0') { | ||
| 104 | - console.log(item.objectId) | ||
| 105 | - this.gotoLive(item) | 166 | + if (this.compDTO.operDataList.length >= 2) { |
| 167 | + Column() { | ||
| 168 | + if (this.moreWidth > this.initMoreWidth + 2) { | ||
| 169 | + Text(this.moreTips) | ||
| 170 | + .fontSize(8) | ||
| 171 | + .fontColor(0x858585) | ||
| 172 | + .width(8) | ||
| 173 | + } | ||
| 106 | } | 174 | } |
| 107 | - }) | ||
| 108 | - }) | 175 | + .justifyContent(FlexAlign.Center) |
| 176 | + .align(Alignment.Center) | ||
| 177 | + .width(this.moreWidth) | ||
| 178 | + .backgroundColor(0xf1f3f4) | ||
| 179 | + .borderRadius({ topLeft: 5, bottomLeft: 5 }) | ||
| 180 | + .height(this.compDTO.operDataList.length == 2 ? 180 : 146) | ||
| 181 | + } | ||
| 182 | + } | ||
| 109 | } | 183 | } |
| 110 | - .listDirection(Axis.Horizontal) | 184 | + .align(Alignment.Start) |
| 185 | + .scrollable(this.compDTO.operDataList.length >= 2 ? ScrollDirection.Horizontal : ScrollDirection.None) | ||
| 111 | .scrollBar(BarState.Off) | 186 | .scrollBar(BarState.Off) |
| 187 | + .edgeEffect(EdgeEffect.None) | ||
| 188 | + .onReachEnd(() => { | ||
| 189 | + this.edgeAnimation() | ||
| 190 | + }) | ||
| 191 | + .onScrollStop(() => { | ||
| 192 | + // this.resetEdgeAnimation(); | ||
| 193 | + }) | ||
| 194 | + .onScroll((xOffset: number, yOffset: number) => { | ||
| 195 | + if (xOffset < 0) { | ||
| 196 | + this.reverseEdgeAnimation(); | ||
| 197 | + } | ||
| 198 | + }) | ||
| 199 | + .onTouch((event?: TouchEvent) => { | ||
| 200 | + if(event) { | ||
| 201 | + if (event.type === TouchType.Up) { | ||
| 202 | + this.toMore(); | ||
| 203 | + this.resetEdgeAnimation(); | ||
| 204 | + } | ||
| 205 | + } | ||
| 206 | + }) | ||
| 112 | .width(CommonConstants.FULL_WIDTH) | 207 | .width(CommonConstants.FULL_WIDTH) |
| 113 | .height(this.compDTO.operDataList.length == 2 ? 180 : 136) | 208 | .height(this.compDTO.operDataList.length == 2 ? 180 : 136) |
| 114 | } else if (this.compDTO.operDataList.length) { | 209 | } else if (this.compDTO.operDataList.length) { |
| @@ -116,9 +211,12 @@ export struct LiveHorizontalCardComponent { | @@ -116,9 +211,12 @@ export struct LiveHorizontalCardComponent { | ||
| 116 | LiveHorizontalCardForOneComponent({ contentDTO: this.compDTO.operDataList[0] }) | 211 | LiveHorizontalCardForOneComponent({ contentDTO: this.compDTO.operDataList[0] }) |
| 117 | } | 212 | } |
| 118 | } | 213 | } |
| 119 | - .width(CommonConstants.FULL_WIDTH) | 214 | + // .width(CommonConstants.FULL_WIDTH) |
| 120 | .padding({ | 215 | .padding({ |
| 121 | - top: 14, | 216 | + left: $r('app.float.card_comp_pagePadding_lf'), |
| 217 | + right: $r('app.float.card_comp_pagePadding_lf'), | ||
| 218 | + top: $r('app.float.card_comp_pagePadding_tb'), | ||
| 219 | + bottom: $r('app.float.card_comp_pagePadding_tb') | ||
| 122 | }) | 220 | }) |
| 123 | .backgroundColor($r("app.color.white")) | 221 | .backgroundColor($r("app.color.white")) |
| 124 | } | 222 | } |
| @@ -4,9 +4,7 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; | @@ -4,9 +4,7 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; | ||
| 4 | import { SpConstants } from 'wdConstant/Index'; | 4 | import { SpConstants } from 'wdConstant/Index'; |
| 5 | import measure from '@ohos.measure' | 5 | import measure from '@ohos.measure' |
| 6 | import { ParamType, TrackConstants, TrackingContent } from 'wdTracking/Index'; | 6 | import { ParamType, TrackConstants, TrackingContent } from 'wdTracking/Index'; |
| 7 | -import { | ||
| 8 | - ContentDetailDTO, | ||
| 9 | -} from 'wdBean'; | 7 | +import { ContentDetailDTO, } from 'wdBean'; |
| 10 | import { LiveModel } from '../../viewmodel/LiveModel'; | 8 | import { LiveModel } from '../../viewmodel/LiveModel'; |
| 11 | import { HttpUtils } from 'wdNetwork/Index'; | 9 | import { HttpUtils } from 'wdNetwork/Index'; |
| 12 | import vibrator from '@ohos.vibrator'; | 10 | import vibrator from '@ohos.vibrator'; |
| @@ -47,6 +45,7 @@ export struct LiveLikeComponent { | @@ -47,6 +45,7 @@ export struct LiveLikeComponent { | ||
| 47 | this.onDetailUpdated() | 45 | this.onDetailUpdated() |
| 48 | this.contentTrackingDict() | 46 | this.contentTrackingDict() |
| 49 | } | 47 | } |
| 48 | + | ||
| 50 | async onDetailUpdated() { | 49 | async onDetailUpdated() { |
| 51 | // 2:竖屏直播页 4:横屏直播页 | 50 | // 2:竖屏直播页 4:横屏直播页 |
| 52 | // 点赞样式 love爱心型 thumb点赞手势 mourning 蜡烛(默哀) pray 祈福 | 51 | // 点赞样式 love爱心型 thumb点赞手势 mourning 蜡烛(默哀) pray 祈福 |
| @@ -61,13 +60,13 @@ export struct LiveLikeComponent { | @@ -61,13 +60,13 @@ export struct LiveLikeComponent { | ||
| 61 | this.getLikeCount() | 60 | this.getLikeCount() |
| 62 | } | 61 | } |
| 63 | 62 | ||
| 64 | - contentTrackingDict(){ | 63 | + contentTrackingDict() { |
| 65 | this.pageParam = { | 64 | this.pageParam = { |
| 66 | 'contentType': `${this.contentDetailData.newsType}`, | 65 | 'contentType': `${this.contentDetailData.newsType}`, |
| 67 | 'contentId': `${this.contentDetailData.newsId}`, | 66 | 'contentId': `${this.contentDetailData.newsId}`, |
| 68 | 'contentName': `${this.contentDetailData.newsTitle || ''}`, | 67 | 'contentName': `${this.contentDetailData.newsTitle || ''}`, |
| 69 | } | 68 | } |
| 70 | - if(this.contentDetailData.newsType == 2) { | 69 | + if (this.contentDetailData.newsType == 2) { |
| 71 | this.PageName = TrackConstants.PageName.Live_Detail // 直播 | 70 | this.PageName = TrackConstants.PageName.Live_Detail // 直播 |
| 72 | } | 71 | } |
| 73 | } | 72 | } |
| @@ -118,7 +117,9 @@ export struct LiveLikeComponent { | @@ -118,7 +117,9 @@ export struct LiveLikeComponent { | ||
| 118 | .width(36) | 117 | .width(36) |
| 119 | .height(36) | 118 | .height(36) |
| 120 | .borderRadius(18) | 119 | .borderRadius(18) |
| 121 | - .backgroundColor((this.pageComponentType === 4 || this.pageComponentType === 2) ? '#4D000000' : this.pageComponentType === 8 ? Color.Transparent : '#FFF5F5F5') | 120 | + .backgroundColor((this.pageComponentType === 4 || this.pageComponentType === 2) ? '#4D000000' : |
| 121 | + this.pageComponentType === 8 ? Color.Transparent : '#FFF5F5F5') | ||
| 122 | + | ||
| 122 | if (this.likeCount != 0) { | 123 | if (this.likeCount != 0) { |
| 123 | RelativeContainer() { | 124 | RelativeContainer() { |
| 124 | Image(this.styleType == 1 ? $r('app.media.comment_icon_number_bg') : $r('app.media.ic_like_back_Select')) | 125 | Image(this.styleType == 1 ? $r('app.media.comment_icon_number_bg') : $r('app.media.ic_like_back_Select')) |
| @@ -211,6 +212,16 @@ export struct LiveLikeComponent { | @@ -211,6 +212,16 @@ export struct LiveLikeComponent { | ||
| 211 | console.error(`An unexpected error occurred. Code: ${e.code}, message: ${e.message}`); | 212 | console.error(`An unexpected error occurred. Code: ${e.code}, message: ${e.message}`); |
| 212 | } | 213 | } |
| 213 | this.likeCount++ | 214 | this.likeCount++ |
| 215 | + this.likeStatus = true | ||
| 216 | + | ||
| 217 | + //内容点赞、取消点赞Tracking 1点赞 0取消点赞 | ||
| 218 | + TrackingContent.like(true, TrackConstants.PageName.DynamicDetail, TrackConstants.PageName.DynamicDetail, | ||
| 219 | + { | ||
| 220 | + 'contentType': `${this.contentDetailData.newsType}`, | ||
| 221 | + 'contentId': `${this.contentDetailData.newsId}`, | ||
| 222 | + 'contentName': `${this.contentDetailData.newsTitle || ''}`, | ||
| 223 | + }) | ||
| 224 | + | ||
| 214 | 225 | ||
| 215 | }).catch(() => { | 226 | }).catch(() => { |
| 216 | }) | 227 | }) |
| @@ -245,6 +256,7 @@ export struct LiveLikeComponent { | @@ -245,6 +256,7 @@ export struct LiveLikeComponent { | ||
| 245 | this.likeCount = 0 | 256 | this.likeCount = 0 |
| 246 | }) | 257 | }) |
| 247 | } | 258 | } |
| 259 | + | ||
| 248 | private getMeasureText(text: string) { | 260 | private getMeasureText(text: string) { |
| 249 | let width = measure.measureText({ | 261 | let width = measure.measureText({ |
| 250 | textContent: text, | 262 | textContent: text, |
| @@ -23,7 +23,7 @@ const TAG = 'DetailPlayLiveCommon' | @@ -23,7 +23,7 @@ const TAG = 'DetailPlayLiveCommon' | ||
| 23 | @Component | 23 | @Component |
| 24 | export struct DetailPlayLiveCommon { | 24 | export struct DetailPlayLiveCommon { |
| 25 | private liveViewModel: LiveViewModel = new LiveViewModel() | 25 | private liveViewModel: LiveViewModel = new LiveViewModel() |
| 26 | - pageShowTime:number = 0; | 26 | + pageShowTime: number = 0; |
| 27 | @Provide relId: string = '' | 27 | @Provide relId: string = '' |
| 28 | @Provide contentId: string = '' | 28 | @Provide contentId: string = '' |
| 29 | @Provide relType: string = '' | 29 | @Provide relType: string = '' |
| @@ -38,7 +38,6 @@ export struct DetailPlayLiveCommon { | @@ -38,7 +38,6 @@ export struct DetailPlayLiveCommon { | ||
| 38 | @Provide publishCommentModel: publishCommentModel = new publishCommentModel() | 38 | @Provide publishCommentModel: publishCommentModel = new publishCommentModel() |
| 39 | // 横屏或竖屏 general-竖屏,news-横屏 | 39 | // 横屏或竖屏 general-竖屏,news-横屏 |
| 40 | @State liveLandscape: string = '' | 40 | @State liveLandscape: string = '' |
| 41 | - | ||
| 42 | @State isLoading: boolean = false | 41 | @State isLoading: boolean = false |
| 43 | 42 | ||
| 44 | async aboutToAppear(): Promise<void> { | 43 | async aboutToAppear(): Promise<void> { |
| @@ -56,7 +55,6 @@ export struct DetailPlayLiveCommon { | @@ -56,7 +55,6 @@ export struct DetailPlayLiveCommon { | ||
| 56 | 55 | ||
| 57 | } | 56 | } |
| 58 | 57 | ||
| 59 | - | ||
| 60 | build() { | 58 | build() { |
| 61 | Column() { | 59 | Column() { |
| 62 | // 直播预约或横屏直播统一进横屏直播 | 60 | // 直播预约或横屏直播统一进横屏直播 |
| @@ -66,7 +64,7 @@ export struct DetailPlayLiveCommon { | @@ -66,7 +64,7 @@ export struct DetailPlayLiveCommon { | ||
| 66 | } else if (this.liveLandscape === 'general') { | 64 | } else if (this.liveLandscape === 'general') { |
| 67 | // 沉浸式直播 | 65 | // 沉浸式直播 |
| 68 | DetailPlayVLivePage() | 66 | DetailPlayVLivePage() |
| 69 | - }else { | 67 | + } else { |
| 70 | PictureLoading().visibility(this.isLoading ? Visibility.None : Visibility.Visible) | 68 | PictureLoading().visibility(this.isLoading ? Visibility.None : Visibility.Visible) |
| 71 | } | 69 | } |
| 72 | } | 70 | } |
| @@ -86,12 +84,12 @@ export struct DetailPlayLiveCommon { | @@ -86,12 +84,12 @@ export struct DetailPlayLiveCommon { | ||
| 86 | if (data) { | 84 | if (data) { |
| 87 | let detailData = data[0] | 85 | let detailData = data[0] |
| 88 | //人民号类型单独获取直播地址 | 86 | //人民号类型单独获取直播地址 |
| 89 | - if (detailData.rmhPlatform === 1) { | 87 | + if (detailData.rmhPlatform === 1 && detailData.liveInfo?.liveState === 'running') { |
| 90 | 88 | ||
| 91 | let vliveId = detailData.liveInfo.vlive[0].vliveId as string | 89 | let vliveId = detailData.liveInfo.vlive[0].vliveId as string |
| 92 | console.error(TAG, 'vliveId==' + vliveId) | 90 | console.error(TAG, 'vliveId==' + vliveId) |
| 93 | let pullStreamAddressData = await this.liveViewModel.getLiveRoomPullAddress(vliveId) as GetPullAddressBean | 91 | let pullStreamAddressData = await this.liveViewModel.getLiveRoomPullAddress(vliveId) as GetPullAddressBean |
| 94 | - | 92 | + console.error(TAG, 'vliveId==' + vliveId) |
| 95 | if (pullStreamAddressData) { | 93 | if (pullStreamAddressData) { |
| 96 | console.log(TAG, ' GetPullAddressBean:', JSON.stringify(pullStreamAddressData)) | 94 | console.log(TAG, ' GetPullAddressBean:', JSON.stringify(pullStreamAddressData)) |
| 97 | let m3u8uUrl = pullStreamAddressData.transCode[0].m3u8Url | 95 | let m3u8uUrl = pullStreamAddressData.transCode[0].m3u8Url |
| @@ -133,7 +131,7 @@ export struct DetailPlayLiveCommon { | @@ -133,7 +131,7 @@ export struct DetailPlayLiveCommon { | ||
| 133 | ToastUtils.shortToast('内容不存在') | 131 | ToastUtils.shortToast('内容不存在') |
| 134 | router.back() | 132 | router.back() |
| 135 | } | 133 | } |
| 136 | - },()=>{ | 134 | + }, () => { |
| 137 | this.isLoading | 135 | this.isLoading |
| 138 | ToastUtils.shortToast('内容不存在') | 136 | ToastUtils.shortToast('内容不存在') |
| 139 | router.back() | 137 | router.back() |
| @@ -141,8 +139,6 @@ export struct DetailPlayLiveCommon { | @@ -141,8 +139,6 @@ export struct DetailPlayLiveCommon { | ||
| 141 | }) | 139 | }) |
| 142 | } | 140 | } |
| 143 | 141 | ||
| 144 | - | ||
| 145 | - | ||
| 146 | onPageShow() { | 142 | onPageShow() { |
| 147 | this.pageShow = Math.random() | 143 | this.pageShow = Math.random() |
| 148 | Logger.info(TAG, 'onPageShow') | 144 | Logger.info(TAG, 'onPageShow') |
| @@ -152,10 +148,10 @@ export struct DetailPlayLiveCommon { | @@ -152,10 +148,10 @@ export struct DetailPlayLiveCommon { | ||
| 152 | onPageHide() { | 148 | onPageHide() { |
| 153 | this.pageHide = Math.random() | 149 | this.pageHide = Math.random() |
| 154 | Logger.info(TAG, 'onPageHide') | 150 | Logger.info(TAG, 'onPageHide') |
| 155 | - console.error("XXXXZZZZ", '---onPageHide------------') | ||
| 156 | //页面浏览 | 151 | //页面浏览 |
| 157 | - TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Live_Detail,TrackConstants.PageName.Live_Detail | ||
| 158 | - ,Math.floor((DateTimeUtils.getTimeStamp() - this.pageShowTime)/1000)) | 152 | + TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Live_Detail, |
| 153 | + TrackConstants.PageName.Live_Detail | ||
| 154 | + , Math.floor((DateTimeUtils.getTimeStamp() - this.pageShowTime) / 1000)) | ||
| 159 | 155 | ||
| 160 | } | 156 | } |
| 161 | 157 |
| @@ -9,6 +9,7 @@ import { router, window } from '@kit.ArkUI'; | @@ -9,6 +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 | 13 | ||
| 13 | let TAG: string = 'DetailPlayLivePage'; | 14 | let TAG: string = 'DetailPlayLivePage'; |
| 14 | 15 | ||
| @@ -34,10 +35,9 @@ export struct DetailPlayLivePage { | @@ -34,10 +35,9 @@ export struct DetailPlayLivePage { | ||
| 34 | @Consume @Watch('onBackPressCus') pageBackPress: number | 35 | @Consume @Watch('onBackPressCus') pageBackPress: number |
| 35 | @Consume contentDetailData: ContentDetailDTO | 36 | @Consume contentDetailData: ContentDetailDTO |
| 36 | @Consume publishCommentModel: publishCommentModel | 37 | @Consume publishCommentModel: publishCommentModel |
| 37 | - | ||
| 38 | // 尽量不要动属性。用来作为输入了评论之后,值传递 | 38 | // 尽量不要动属性。用来作为输入了评论之后,值传递 |
| 39 | - @State lastInputedLiveComment: LiveRoomItemBean = {} as LiveRoomItemBean // 上次输入的直播间消息 | ||
| 40 | - @State lastInputedChatComment: LiveRoomItemBean = {} as LiveRoomItemBean // 上次输入的大家聊消息 | 39 | + @State lastInputedLiveComment: LiveRoomItemBean = {} as LiveRoomItemBean // 上次输入的直播间消息 |
| 40 | + @State lastInputedChatComment: LiveRoomItemBean = {} as LiveRoomItemBean // 上次输入的大家聊消息 | ||
| 41 | 41 | ||
| 42 | aboutToAppear(): void { | 42 | aboutToAppear(): void { |
| 43 | Logger.info(TAG, `wyj-aboutToAppear`) | 43 | Logger.info(TAG, `wyj-aboutToAppear`) |
| @@ -69,10 +69,12 @@ export struct DetailPlayLivePage { | @@ -69,10 +69,12 @@ export struct DetailPlayLivePage { | ||
| 69 | TopPlayComponent({ playerController: this.playerController }) | 69 | TopPlayComponent({ playerController: this.playerController }) |
| 70 | .height(this.displayDirection == DisplayDirection.VERTICAL ? 211 : '100%') | 70 | .height(this.displayDirection == DisplayDirection.VERTICAL ? 211 : '100%') |
| 71 | 71 | ||
| 72 | - TabComponent({ tabs: this.tabs, | 72 | + TabComponent({ |
| 73 | + tabs: this.tabs, | ||
| 73 | changeToTab: this.changeToTab, | 74 | changeToTab: this.changeToTab, |
| 74 | lastInputedLiveComment: this.lastInputedLiveComment, | 75 | lastInputedLiveComment: this.lastInputedLiveComment, |
| 75 | - lastInputedChatComment: this.lastInputedChatComment}) | 76 | + lastInputedChatComment: this.lastInputedChatComment |
| 77 | + }) | ||
| 76 | .layoutWeight(1) | 78 | .layoutWeight(1) |
| 77 | .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) | 79 | .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) |
| 78 | 80 | ||
| @@ -95,6 +97,13 @@ export struct DetailPlayLivePage { | @@ -95,6 +97,13 @@ export struct DetailPlayLivePage { | ||
| 95 | } else { | 97 | } else { |
| 96 | this.lastInputedChatComment = result | 98 | this.lastInputedChatComment = result |
| 97 | } | 99 | } |
| 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 | + }); | ||
| 98 | }) | 107 | }) |
| 99 | } | 108 | } |
| 100 | } | 109 | } |
| @@ -7,6 +7,7 @@ import { WDAliPlayerController } from 'wdPlayer/Index'; | @@ -7,6 +7,7 @@ import { WDAliPlayerController } from 'wdPlayer/Index'; | ||
| 7 | import { DisplayDirection } from 'wdConstant/Index'; | 7 | import { DisplayDirection } from 'wdConstant/Index'; |
| 8 | import { LiveEmptyComponent, WDLiveViewDefaultType } from 'wdComponent/Index'; | 8 | import { LiveEmptyComponent, WDLiveViewDefaultType } from 'wdComponent/Index'; |
| 9 | import { PlayerEndView } from '../widgets/vertical/PlayerEndView'; | 9 | import { PlayerEndView } from '../widgets/vertical/PlayerEndView'; |
| 10 | +import { TrackConstants, TrackingButton } from 'wdTracking/Index'; | ||
| 10 | 11 | ||
| 11 | const storage = LocalStorage.getShared(); | 12 | const storage = LocalStorage.getShared(); |
| 12 | const TAG = 'DetailPlayVLivePage' | 13 | const TAG = 'DetailPlayVLivePage' |
| @@ -96,6 +97,9 @@ export struct DetailPlayVLivePage { | @@ -96,6 +97,9 @@ export struct DetailPlayVLivePage { | ||
| 96 | .markAnchor({ x: 56, y: this.bottomSafeHeight }) | 97 | .markAnchor({ x: 56, y: this.bottomSafeHeight }) |
| 97 | .onClick(() => { | 98 | .onClick(() => { |
| 98 | this.swiperController.showNext() | 99 | this.swiperController.showNext() |
| 100 | + // 埋点 | ||
| 101 | + TrackingButton.click('clearScreen', TrackConstants.PageName.Live_Detail, | ||
| 102 | + TrackConstants.PageName.Live_Detail) | ||
| 99 | }) | 103 | }) |
| 100 | 104 | ||
| 101 | } | 105 | } |
| @@ -116,7 +120,5 @@ export struct DetailPlayVLivePage { | @@ -116,7 +120,5 @@ export struct DetailPlayVLivePage { | ||
| 116 | console.error(TAG, 'getLiveDetails catch', message) | 120 | console.error(TAG, 'getLiveDetails catch', message) |
| 117 | }) | 121 | }) |
| 118 | } | 122 | } |
| 119 | - | ||
| 120 | - | ||
| 121 | } | 123 | } |
| 122 | 124 |
| @@ -39,6 +39,8 @@ export class LiveViewModel { | @@ -39,6 +39,8 @@ export class LiveViewModel { | ||
| 39 | console.log(TAG, 'getContentDetail:', JSON.stringify(resDTO.data)) | 39 | console.log(TAG, 'getContentDetail:', JSON.stringify(resDTO.data)) |
| 40 | if (resDTO.data) { | 40 | if (resDTO.data) { |
| 41 | success(resDTO.data) | 41 | success(resDTO.data) |
| 42 | + }else { | ||
| 43 | + fail("数据为空") | ||
| 42 | } | 44 | } |
| 43 | }).catch(() => { | 45 | }).catch(() => { |
| 44 | fail("数据为空") | 46 | fail("数据为空") |
| @@ -4,6 +4,7 @@ import { DateTimeUtils, StringUtils, ToastUtils } from 'wdKit/Index' | @@ -4,6 +4,7 @@ import { DateTimeUtils, StringUtils, ToastUtils } from 'wdKit/Index' | ||
| 4 | import { LiveViewModel } from '../../viewModel/LiveViewModel' | 4 | import { LiveViewModel } from '../../viewModel/LiveViewModel' |
| 5 | import { HttpUtils } from 'wdNetwork/Index' | 5 | import { HttpUtils } from 'wdNetwork/Index' |
| 6 | import { WDRouterPage, WDRouterRule } from 'wdRouter/Index' | 6 | import { WDRouterPage, WDRouterRule } from 'wdRouter/Index' |
| 7 | +import { ParamType, TrackConstants, TrackingContent } from 'wdTracking/Index' | ||
| 7 | 8 | ||
| 8 | @Component | 9 | @Component |
| 9 | export struct LiveCountdownComponent { | 10 | export struct LiveCountdownComponent { |
| @@ -19,6 +20,7 @@ export struct LiveCountdownComponent { | @@ -19,6 +20,7 @@ export struct LiveCountdownComponent { | ||
| 19 | //是否预约过直播 | 20 | //是否预约过直播 |
| 20 | @State isAppointmentLive: boolean = false | 21 | @State isAppointmentLive: boolean = false |
| 21 | liveViewModel: LiveViewModel = new LiveViewModel() | 22 | liveViewModel: LiveViewModel = new LiveViewModel() |
| 23 | + pageParam: ParamType = {} | ||
| 22 | 24 | ||
| 23 | aboutToAppear(): void { | 25 | aboutToAppear(): void { |
| 24 | //注册字体 | 26 | //注册字体 |
| @@ -30,6 +32,15 @@ export struct LiveCountdownComponent { | @@ -30,6 +32,15 @@ export struct LiveCountdownComponent { | ||
| 30 | this.textTimerController.start() | 32 | this.textTimerController.start() |
| 31 | }, 0) | 33 | }, 0) |
| 32 | this.updateData() | 34 | this.updateData() |
| 35 | + this.contentTrackingDict() | ||
| 36 | + } | ||
| 37 | + | ||
| 38 | + contentTrackingDict() { | ||
| 39 | + this.pageParam = { | ||
| 40 | + 'contentType': `${this.liveDetailsBean.newsType}`, | ||
| 41 | + 'contentId': `${this.liveDetailsBean.newsId}`, | ||
| 42 | + 'contentName': `${this.liveDetailsBean.newsTitle || ''}`, | ||
| 43 | + } | ||
| 33 | } | 44 | } |
| 34 | 45 | ||
| 35 | build() { | 46 | build() { |
| @@ -141,7 +152,7 @@ export struct LiveCountdownComponent { | @@ -141,7 +152,7 @@ export struct LiveCountdownComponent { | ||
| 141 | } | 152 | } |
| 142 | //2024-04-01 19:44:00-trim->2024-04-0119:44:00 | 153 | //2024-04-01 19:44:00-trim->2024-04-0119:44:00 |
| 143 | if (StringUtils.isNotEmpty(this.liveDetailsBean.liveInfo?.planStartTime)) { | 154 | if (StringUtils.isNotEmpty(this.liveDetailsBean.liveInfo?.planStartTime)) { |
| 144 | - let playStartTimeTmp = this.liveDetailsBean.liveInfo?.planStartTime+'' | 155 | + let playStartTimeTmp = this.liveDetailsBean.liveInfo?.planStartTime + '' |
| 145 | this.month = Number(playStartTimeTmp.substring(5, 7)).toString() | 156 | this.month = Number(playStartTimeTmp.substring(5, 7)).toString() |
| 146 | this.day = playStartTimeTmp.substring(8, 10) | 157 | this.day = playStartTimeTmp.substring(8, 10) |
| 147 | this.hour = playStartTimeTmp.substring(11, 13) | 158 | this.hour = playStartTimeTmp.substring(11, 13) |
| @@ -152,7 +163,7 @@ export struct LiveCountdownComponent { | @@ -152,7 +163,7 @@ export struct LiveCountdownComponent { | ||
| 152 | getLiveAppointmentStatus() { | 163 | getLiveAppointmentStatus() { |
| 153 | this.liveViewModel.getLiveAppointmentStatus( | 164 | this.liveViewModel.getLiveAppointmentStatus( |
| 154 | this.liveDetailsBean.reLInfo ? this.liveDetailsBean.reLInfo.relId : '', | 165 | this.liveDetailsBean.reLInfo ? this.liveDetailsBean.reLInfo.relId : '', |
| 155 | - this.liveDetailsBean.newsId+'' | 166 | + this.liveDetailsBean.newsId + '' |
| 156 | ).then( | 167 | ).then( |
| 157 | (data) => { | 168 | (data) => { |
| 158 | this.isAppointmentLive = data | 169 | this.isAppointmentLive = data |
| @@ -165,15 +176,19 @@ export struct LiveCountdownComponent { | @@ -165,15 +176,19 @@ export struct LiveCountdownComponent { | ||
| 165 | liveAppointment() { | 176 | liveAppointment() { |
| 166 | this.liveViewModel.liveAppointment( | 177 | this.liveViewModel.liveAppointment( |
| 167 | this.liveDetailsBean.reLInfo ? this.liveDetailsBean.reLInfo.relId : '', | 178 | this.liveDetailsBean.reLInfo ? this.liveDetailsBean.reLInfo.relId : '', |
| 168 | - this.liveDetailsBean.newsId+'', | 179 | + this.liveDetailsBean.newsId + '', |
| 169 | !this.isAppointmentLive).then( | 180 | !this.isAppointmentLive).then( |
| 170 | (data) => { | 181 | (data) => { |
| 171 | if (data.success) { | 182 | if (data.success) { |
| 172 | this.isAppointmentLive = !this.isAppointmentLive | 183 | this.isAppointmentLive = !this.isAppointmentLive |
| 173 | if (this.isAppointmentLive) { | 184 | if (this.isAppointmentLive) { |
| 174 | ToastUtils.showToast('预约成功', 1000) | 185 | ToastUtils.showToast('预约成功', 1000) |
| 186 | + TrackingContent.subscribeClick(true, TrackConstants.PageName.Live_Detail, | ||
| 187 | + TrackConstants.PageName.Live_Detail, this.pageParam) | ||
| 175 | } else { | 188 | } else { |
| 176 | ToastUtils.showToast('取消预约成功', 1000) | 189 | ToastUtils.showToast('取消预约成功', 1000) |
| 190 | + TrackingContent.subscribeClick(false, TrackConstants.PageName.Live_Detail, | ||
| 191 | + TrackConstants.PageName.Live_Detail, this.pageParam) | ||
| 177 | } | 192 | } |
| 178 | } | 193 | } |
| 179 | }, | 194 | }, |
| @@ -56,7 +56,7 @@ export struct PlayUIComponent { | @@ -56,7 +56,7 @@ export struct PlayUIComponent { | ||
| 56 | /* | 56 | /* |
| 57 | 初始话播放器设置 | 57 | 初始话播放器设置 |
| 58 | */ | 58 | */ |
| 59 | - initPlayerSet(){ | 59 | + initPlayerSet() { |
| 60 | 60 | ||
| 61 | //播放进度监听 | 61 | //播放进度监听 |
| 62 | if (this.playerController) { | 62 | if (this.playerController) { |
| @@ -279,8 +279,13 @@ export struct PlayUIComponent { | @@ -279,8 +279,13 @@ export struct PlayUIComponent { | ||
| 279 | }) | 279 | }) |
| 280 | } | 280 | } |
| 281 | 281 | ||
| 282 | - // 进度条 | ||
| 283 | - this.playProgressView() | 282 | + if (this.contentDetailData.liveInfo?.liveState == 'running') { |
| 283 | + Blank() | ||
| 284 | + } else { | ||
| 285 | + // 进度条 | ||
| 286 | + this.playProgressView() | ||
| 287 | + } | ||
| 288 | + | ||
| 284 | // 总的播放时间 | 289 | // 总的播放时间 |
| 285 | if (this.contentDetailData?.liveInfo?.liveState != 'running' || this.contentDetailData.showTime) { | 290 | if (this.contentDetailData?.liveInfo?.liveState != 'running' || this.contentDetailData.showTime) { |
| 286 | Text(this.totalTime) | 291 | Text(this.totalTime) |
| @@ -32,15 +32,14 @@ export struct TopPlayComponent { | @@ -32,15 +32,14 @@ export struct TopPlayComponent { | ||
| 32 | @Provide playSourceState: number = 0 | 32 | @Provide playSourceState: number = 0 |
| 33 | private playUrl: string = "" | 33 | private playUrl: string = "" |
| 34 | private xComponentIsLoaded: boolean = false | 34 | private xComponentIsLoaded: boolean = false |
| 35 | - pageParam: ParamType = {} | ||
| 36 | 35 | ||
| 37 | aboutToAppear(): void { | 36 | aboutToAppear(): void { |
| 38 | if (this.playerController) { | 37 | if (this.playerController) { |
| 38 | + | ||
| 39 | this.playerController.onCanplay = () => { | 39 | this.playerController.onCanplay = () => { |
| 40 | this.isCanPlay = true | 40 | this.isCanPlay = true |
| 41 | this.isLoading = true | 41 | this.isLoading = true |
| 42 | this.playerController?.play() | 42 | this.playerController?.play() |
| 43 | - | ||
| 44 | } | 43 | } |
| 45 | 44 | ||
| 46 | this.playerController.onStatusChange = (status: number) => { | 45 | this.playerController.onStatusChange = (status: number) => { |
| @@ -148,16 +147,12 @@ export struct TopPlayComponent { | @@ -148,16 +147,12 @@ export struct TopPlayComponent { | ||
| 148 | Logger.debug(TAG, "播放地址为空") | 147 | Logger.debug(TAG, "播放地址为空") |
| 149 | return | 148 | return |
| 150 | } | 149 | } |
| 151 | - this.contentTrackingDict() | ||
| 152 | - this.playerController?.firstPlay(this.playUrl, TrackConstants.PageName.Live_Detail, this.pageParam); | ||
| 153 | - } | ||
| 154 | 150 | ||
| 155 | - contentTrackingDict() { | ||
| 156 | - this.pageParam = { | 151 | + this.playerController?.firstPlay(this.playUrl, TrackConstants.PageName.Live_Detail, { |
| 157 | 'contentType': `${this.contentDetailData.newsType}`, | 152 | 'contentType': `${this.contentDetailData.newsType}`, |
| 158 | 'contentId': `${this.contentDetailData.newsId}`, | 153 | 'contentId': `${this.contentDetailData.newsId}`, |
| 159 | 'contentName': `${this.contentDetailData.newsTitle || ''}`, | 154 | 'contentName': `${this.contentDetailData.newsTitle || ''}`, |
| 160 | - } | 155 | + }); |
| 161 | } | 156 | } |
| 162 | 157 | ||
| 163 | build() { | 158 | build() { |
| @@ -11,6 +11,7 @@ import { ChartItemCompereComponent } from './ChartItemCompereComponent' | @@ -11,6 +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 | 15 | ||
| 15 | const TAG = "PlayerCommentComponent" | 16 | const TAG = "PlayerCommentComponent" |
| 16 | /** | 17 | /** |
| @@ -105,6 +106,7 @@ export struct PlayerCommentComponent { | @@ -105,6 +106,7 @@ export struct PlayerCommentComponent { | ||
| 105 | contentDetailData: this.contentDetailData, | 106 | contentDetailData: this.contentDetailData, |
| 106 | onCommentInputFocus: () => { | 107 | onCommentInputFocus: () => { |
| 107 | 108 | ||
| 109 | + | ||
| 108 | }, | 110 | }, |
| 109 | onCommentInputed: (content) => { | 111 | onCommentInputed: (content) => { |
| 110 | if (content.comment) { | 112 | if (content.comment) { |
| @@ -116,6 +118,14 @@ export struct PlayerCommentComponent { | @@ -116,6 +118,14 @@ export struct PlayerCommentComponent { | ||
| 116 | this.liveChatList.push(result) | 118 | this.liveChatList.push(result) |
| 117 | this.scroller.scrollEdge(Edge.Bottom) | 119 | this.scroller.scrollEdge(Edge.Bottom) |
| 118 | }) | 120 | }) |
| 121 | + | ||
| 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 | + }); | ||
| 119 | } | 129 | } |
| 120 | }, | 130 | }, |
| 121 | onBack: () => { | 131 | onBack: () => { |
| @@ -7,8 +7,8 @@ struct GuidePages { | @@ -7,8 +7,8 @@ struct GuidePages { | ||
| 7 | // guideImage = [$r('app.media.guide_static1'), $r('app.media.guide_static2'), $r('app.media.guide_static3'), $r('app.media.guide_static4'),$r('app.media.guide_static5')] | 7 | // guideImage = [$r('app.media.guide_static1'), $r('app.media.guide_static2'), $r('app.media.guide_static3'), $r('app.media.guide_static4'),$r('app.media.guide_static5')] |
| 8 | // guideTitle = [$r('app.media.guide_title1'), $r('app.media.guide_title2'), $r('app.media.guide_title3'), $r('app.media.guide_title4'),$r('app.media.guide_title5')] | 8 | // guideTitle = [$r('app.media.guide_title1'), $r('app.media.guide_title2'), $r('app.media.guide_title3'), $r('app.media.guide_title4'),$r('app.media.guide_title5')] |
| 9 | // guideIndex = [$r('app.media.guide_index1'), $r('app.media.guide_index2'), $r('app.media.guide_index3'),$r('app.media.guide_index4'), $r('app.media.guide_button')] | 9 | // guideIndex = [$r('app.media.guide_index1'), $r('app.media.guide_index2'), $r('app.media.guide_index3'),$r('app.media.guide_index4'), $r('app.media.guide_button')] |
| 10 | - guideImage = [$r('app.media.guide_Static')] | ||
| 11 | - guideIndex = [$r('app.media.guide_button')] | 10 | + guideImage = [$r('app.media.guide_Static'),''] |
| 11 | + guideIndex = [$r('app.media.guide_button'),''] | ||
| 12 | 12 | ||
| 13 | build() { | 13 | build() { |
| 14 | Column() { | 14 | Column() { |
| @@ -17,10 +17,16 @@ struct GuidePages { | @@ -17,10 +17,16 @@ struct GuidePages { | ||
| 17 | this.ChildItem(index) | 17 | this.ChildItem(index) |
| 18 | 18 | ||
| 19 | }, (item: number) => JSON.stringify(item)) | 19 | }, (item: number) => JSON.stringify(item)) |
| 20 | - }.loop(false).disableSwipe(true) | 20 | + }.loop(false) |
| 21 | .indicator(false) | 21 | .indicator(false) |
| 22 | .width('100%') | 22 | .width('100%') |
| 23 | .height('100%') | 23 | .height('100%') |
| 24 | + .effectMode(EdgeEffect.None) | ||
| 25 | + .onChange(index => { | ||
| 26 | + if (index == 1) { | ||
| 27 | + WDRouterRule.jumpWithReplacePage(WDRouterPage.launchInterestsPage) | ||
| 28 | + } | ||
| 29 | + }) | ||
| 24 | }.width('100%') | 30 | }.width('100%') |
| 25 | .height('100%') | 31 | .height('100%') |
| 26 | 32 |
| @@ -113,6 +113,29 @@ export class TrackingContent { | @@ -113,6 +113,29 @@ export class TrackingContent { | ||
| 113 | 113 | ||
| 114 | } | 114 | } |
| 115 | 115 | ||
| 116 | + | ||
| 117 | + /** | ||
| 118 | + * 直播预约埋点 | ||
| 119 | + * @param isSubscribeFlag | ||
| 120 | + * @param pageId | ||
| 121 | + * @param pageName | ||
| 122 | + * @param extParams | ||
| 123 | + */ | ||
| 124 | + static subscribeClick(isSubscribeFlag:boolean ,pageId: string, pageName: string,extParams?: ParamType){ | ||
| 125 | + let params = TrackingUtils.generateParams(extParams) | ||
| 126 | + if (pageId.length) { | ||
| 127 | + params["pageId"] = pageId | ||
| 128 | + } | ||
| 129 | + if (pageName.length) { | ||
| 130 | + params["pageName"] = pageName | ||
| 131 | + } | ||
| 132 | + | ||
| 133 | + let event = isSubscribeFlag?'live_subscribe_click':'cancel_live_subscribe_click' | ||
| 134 | + TrackingUtils.fillPositionWith(params) | ||
| 135 | + Tracking.event(event, params) | ||
| 136 | + } | ||
| 137 | + | ||
| 138 | + | ||
| 116 | // 内容下载点击事件 1.图片 2.音频 3.视频 | 139 | // 内容下载点击事件 1.图片 2.音频 3.视频 |
| 117 | static download(donwloadContentType: number, pageId: string, pageName: string, extParams?: ParamType) { | 140 | static download(donwloadContentType: number, pageId: string, pageName: string, extParams?: ParamType) { |
| 118 | let params = TrackingUtils.generateParams(extParams) | 141 | let params = TrackingUtils.generateParams(extParams) |
| @@ -103,8 +103,8 @@ struct LaunchAdvertisingPage { | @@ -103,8 +103,8 @@ struct LaunchAdvertisingPage { | ||
| 103 | .fontSize('24lpx') | 103 | .fontSize('24lpx') |
| 104 | .width('72lpx') | 104 | .width('72lpx') |
| 105 | .height('36lpx') | 105 | .height('36lpx') |
| 106 | - .borderRadius(5) | ||
| 107 | - .margin({top:'10lpx',left:'19lpx'}) | 106 | + .borderRadius(2) |
| 107 | + .margin({top:'15lpx',left:'19lpx'}) | ||
| 108 | .backgroundColor('#80000000') | 108 | .backgroundColor('#80000000') |
| 109 | } | 109 | } |
| 110 | .width('100%') | 110 | .width('100%') |
| @@ -191,7 +191,7 @@ struct LaunchAdvertisingPage { | @@ -191,7 +191,7 @@ struct LaunchAdvertisingPage { | ||
| 191 | this.trackingLaunchClick() | 191 | this.trackingLaunchClick() |
| 192 | 192 | ||
| 193 | if(this.defaultModel.linkUrl.length > 0){ | 193 | if(this.defaultModel.linkUrl.length > 0){ |
| 194 | - if (this.defaultModel.objectType == '2') { | 194 | + if (this.defaultModel.openType == '2') { |
| 195 | //端外打开 | 195 | //端外打开 |
| 196 | ProcessUtils.jumpExternalWebPage(this.defaultModel.linkUrl) | 196 | ProcessUtils.jumpExternalWebPage(this.defaultModel.linkUrl) |
| 197 | }else { | 197 | }else { |
| @@ -3,8 +3,9 @@ import { WDRouterRule } from 'wdRouter'; | @@ -3,8 +3,9 @@ import { WDRouterRule } from 'wdRouter'; | ||
| 3 | import { WDRouterPage } from 'wdRouter'; | 3 | import { WDRouterPage } from 'wdRouter'; |
| 4 | import { SPHelper } from 'wdKit/Index'; | 4 | import { SPHelper } from 'wdKit/Index'; |
| 5 | import { SpConstants } from 'wdConstant/Index'; | 5 | import { SpConstants } from 'wdConstant/Index'; |
| 6 | -import { ButtonOptions, promptAction } from '@kit.ArkUI'; | 6 | +import { ButtonOptions, promptAction, window } from '@kit.ArkUI'; |
| 7 | import { ParamType, TrackConstants, TrackingContent } from 'wdTracking/Index'; | 7 | import { ParamType, TrackConstants, TrackingContent } from 'wdTracking/Index'; |
| 8 | +import { ImageKnifeComponent } from '@ohos/imageknife'; | ||
| 8 | 9 | ||
| 9 | @Entry | 10 | @Entry |
| 10 | @Component | 11 | @Component |
| @@ -13,7 +14,6 @@ struct LaunchInterestsHobbiesPage { | @@ -13,7 +14,6 @@ struct LaunchInterestsHobbiesPage { | ||
| 13 | @State selectCount: number = 0 | 14 | @State selectCount: number = 0 |
| 14 | @State interestsArray: InterestsList[] = [] | 15 | @State interestsArray: InterestsList[] = [] |
| 15 | 16 | ||
| 16 | - | ||
| 17 | aboutToAppear(){ | 17 | aboutToAppear(){ |
| 18 | //请求接口,获取兴趣偏好数据 | 18 | //请求接口,获取兴趣偏好数据 |
| 19 | this.requestInterestsData() | 19 | this.requestInterestsData() |
| @@ -21,106 +21,116 @@ struct LaunchInterestsHobbiesPage { | @@ -21,106 +21,116 @@ struct LaunchInterestsHobbiesPage { | ||
| 21 | 21 | ||
| 22 | build() { | 22 | build() { |
| 23 | Column() { | 23 | Column() { |
| 24 | - Row(){ | ||
| 25 | - Blank() | ||
| 26 | - Text('跳过') | ||
| 27 | - .fontSize('27lpx') | ||
| 28 | - .fontColor('#333333') | ||
| 29 | - .width('54lpx') | ||
| 30 | - .height('35lpx') | ||
| 31 | - .margin({top:'27lpx',right:'46lpx'}) | ||
| 32 | - .onClick(()=>{ | ||
| 33 | - //直接跳过到首页 | ||
| 34 | - //跳转首页 | ||
| 35 | - WDRouterRule.jumpWithReplacePage(WDRouterPage.mainPage) | ||
| 36 | - | ||
| 37 | - this.trackingLaunchJumpOver(false) | ||
| 38 | - }) | ||
| 39 | - } | ||
| 40 | - .width('100%') | ||
| 41 | - .justifyContent(FlexAlign.End) | ||
| 42 | - | ||
| 43 | - Text('选择感兴趣的内容') | ||
| 44 | - .fontSize('46lpx') | ||
| 45 | - .fontWeight(FontWeight.Bold) | ||
| 46 | - .textAlign(TextAlign.Center) | ||
| 47 | - .fontColor('#333333') | ||
| 48 | - .width('100%') | ||
| 49 | - .height('61lpx') | ||
| 50 | - .margin({top:'84lpx'}) | ||
| 51 | - Text('完善信息,将为您推荐个性化的内容') | ||
| 52 | - .fontSize('27lpx') | ||
| 53 | - .textAlign(TextAlign.Center) | ||
| 54 | - .fontColor('#9E9E9E') | ||
| 55 | - .width('100%') | ||
| 56 | - .height('35lpx') | ||
| 57 | - .margin({top:'12lpx'}) | ||
| 58 | - | ||
| 59 | - Grid( ){ | ||
| 60 | - ForEach(this.interestsArray,(item:InterestsList,index:number)=>{ | ||
| 61 | - GridItem(){ | ||
| 62 | - Stack({alignContent:Alignment.TopStart}){ | ||
| 63 | - | ||
| 64 | - Image(item.pic) | ||
| 65 | - .width('100%') | ||
| 66 | - .height('100%') | ||
| 67 | - .backgroundColor(Color.White) | ||
| 68 | - .borderRadius(5) | ||
| 69 | - Stack(){ | ||
| 70 | - Image('') | ||
| 71 | - .width('100%') | ||
| 72 | - .height('100%') | ||
| 73 | - .backgroundColor(Color.Black) | ||
| 74 | - .opacity(item.choose?0.5:0) | ||
| 75 | - .borderRadius(5) | ||
| 76 | - } | ||
| 77 | - | ||
| 78 | - Stack(){ | ||
| 79 | - Column({}){ | ||
| 80 | - Text(item.name) | ||
| 81 | - .fontSize(18) | ||
| 82 | - .fontColor('#FFFFFF') | ||
| 83 | - .margin({top:'21lpx',left:'19lpx'}) | ||
| 84 | - .width('100%') | ||
| 85 | - .height('46lpx') | ||
| 86 | - .fontWeight(FontWeight.Bold) | ||
| 87 | - Text(item.title) | ||
| 88 | - .fontSize('23lpx') | ||
| 89 | - .fontColor('#FFFFFF') | ||
| 90 | - .margin({top:'2lpx',left:'19lpx'}) | 24 | + Stack(){ |
| 25 | + Column(){ | ||
| 26 | + Row(){ | ||
| 27 | + Blank() | ||
| 28 | + Text('跳过') | ||
| 29 | + .fontSize('27lpx') | ||
| 30 | + .fontColor('#333333') | ||
| 31 | + .width('54lpx') | ||
| 32 | + .height('35lpx') | ||
| 33 | + .margin({right:'46lpx'}) | ||
| 34 | + .onClick(()=>{ | ||
| 35 | + //直接跳过到首页 | ||
| 36 | + //跳转首页 | ||
| 37 | + WDRouterRule.jumpWithReplacePage(WDRouterPage.mainPage) | ||
| 38 | + | ||
| 39 | + this.trackingLaunchJumpOver(false) | ||
| 40 | + }) | ||
| 41 | + } | ||
| 42 | + .width('100%') | ||
| 43 | + .justifyContent(FlexAlign.End) | ||
| 44 | + | ||
| 45 | + Text('选择感兴趣的内容') | ||
| 46 | + .fontSize('46lpx') | ||
| 47 | + .fontWeight(FontWeight.Bold) | ||
| 48 | + .textAlign(TextAlign.Center) | ||
| 49 | + .fontColor('#333333') | ||
| 50 | + .width('100%') | ||
| 51 | + .height('61lpx') | ||
| 52 | + .margin({top:'84lpx'}) | ||
| 53 | + Text('完善信息,将为您推荐个性化的内容') | ||
| 54 | + .fontSize('27lpx') | ||
| 55 | + .textAlign(TextAlign.Center) | ||
| 56 | + .fontColor('#9E9E9E') | ||
| 57 | + .width('100%') | ||
| 58 | + .height('35lpx') | ||
| 59 | + .margin({top:'12lpx'}) | ||
| 60 | + | ||
| 61 | + Grid( ){ | ||
| 62 | + ForEach(this.interestsArray,(item:InterestsList,index:number)=>{ | ||
| 63 | + GridItem(){ | ||
| 64 | + Stack({alignContent:Alignment.TopStart}){ | ||
| 65 | + ImageKnifeComponent({imageKnifeOption:{loadSrc:item.pic}}) | ||
| 91 | .width('100%') | 66 | .width('100%') |
| 92 | - .height('31lpx') | ||
| 93 | - Image(item.choose ? $r('app.media.interestsSelected') : $r('app.media.interestsSelectNot')) | ||
| 94 | - .height('32lpx') | ||
| 95 | - .width('32lpx') | ||
| 96 | - .margin({top:'80lpx',left:'110lpx'}) | ||
| 97 | - | ||
| 98 | - }.justifyContent(FlexAlign.Start) | 67 | + .height('100%') |
| 68 | + .backgroundColor(Color.White) | ||
| 69 | + .borderRadius(5) | ||
| 70 | + // Image(item.pic) | ||
| 71 | + // .width('100%') | ||
| 72 | + // .height('100%') | ||
| 73 | + // .backgroundColor(Color.White) | ||
| 74 | + // .borderRadius(5) | ||
| 75 | + Stack(){ | ||
| 76 | + Image('') | ||
| 77 | + .width('100%') | ||
| 78 | + .height('100%') | ||
| 79 | + .backgroundColor(Color.Black) | ||
| 80 | + .opacity(item.choose?0.5:0) | ||
| 81 | + .borderRadius(5) | ||
| 82 | + } | ||
| 83 | + Stack(){ | ||
| 84 | + Column({}){ | ||
| 85 | + Text(item.name) | ||
| 86 | + .fontSize(18) | ||
| 87 | + .fontColor('#FFFFFF') | ||
| 88 | + .margin({top:'21lpx',left:'19lpx'}) | ||
| 89 | + .width('100%') | ||
| 90 | + .height('46lpx') | ||
| 91 | + .fontWeight(FontWeight.Bold) | ||
| 92 | + Text(item.title) | ||
| 93 | + .fontSize('23lpx') | ||
| 94 | + .fontColor('#FFFFFF') | ||
| 95 | + .margin({top:'2lpx',left:'19lpx'}) | ||
| 96 | + .width('100%') | ||
| 97 | + .height('31lpx') | ||
| 98 | + Image(item.choose ? $r('app.media.interestsSelected') : $r('app.media.interestsSelectNot')) | ||
| 99 | + .height('32lpx') | ||
| 100 | + .width('32lpx') | ||
| 101 | + .margin({top:'80lpx',left:'110lpx'}) | ||
| 102 | + | ||
| 103 | + }.justifyContent(FlexAlign.Start) | ||
| 104 | + } | ||
| 105 | + | ||
| 106 | + } | ||
| 99 | } | 107 | } |
| 108 | + .width('192lpx') | ||
| 109 | + .height('230lpx') | ||
| 110 | + .borderRadius('8lpx') | ||
| 111 | + .onClick(()=>{ | ||
| 112 | + //选择后改变已选择属性 | ||
| 113 | + item.choose = !item.choose | ||
| 114 | + this.interestsArray.splice(index,1,item) | ||
| 115 | + this.selectCount = this.interestsArray.filter(item => item.choose).length | ||
| 116 | + }) | ||
| 100 | 117 | ||
| 101 | - } | 118 | + }) |
| 102 | } | 119 | } |
| 103 | - .width('192lpx') | ||
| 104 | - .height('230lpx') | ||
| 105 | - .borderRadius('8lpx') | ||
| 106 | - .onClick(()=>{ | ||
| 107 | - //选择后改变已选择属性 | ||
| 108 | - item.choose = !item.choose | ||
| 109 | - this.interestsArray.splice(index,1,item) | ||
| 110 | - this.selectCount = this.interestsArray.filter(item => item.choose).length | ||
| 111 | - }) | ||
| 112 | - | ||
| 113 | - }) | ||
| 114 | - | 120 | + .width('90%') |
| 121 | + // .height('70%') | ||
| 122 | + .margin({top:'61lpx',bottom:'240lpx'}) | ||
| 123 | + .columnsTemplate('1fr 1fr 1fr') | ||
| 124 | + .columnsGap('23lpx') | ||
| 125 | + .rowsGap('23lpx') | ||
| 126 | + .scrollBar(BarState.Off) | ||
| 127 | + } | ||
| 128 | + .width('100%') | ||
| 129 | + .height('100%') | ||
| 115 | } | 130 | } |
| 116 | - .width('90%') | ||
| 117 | - .height('70%') | ||
| 118 | - .margin({top:'61lpx'}) | ||
| 119 | - .columnsTemplate('1fr 1fr 1fr') | ||
| 120 | - // .rowsTemplate('1fr 1fr 1fr 1fr') | ||
| 121 | - .columnsGap('23lpx') | ||
| 122 | - .rowsGap('23lpx') | ||
| 123 | - .scrollBar(BarState.Off) | 131 | + .width('100%') |
| 132 | + .height(`calc(100% - ${108 + 'lpx'})`) | ||
| 133 | + // .backgroundColor(Color.Red) | ||
| 124 | 134 | ||
| 125 | Stack({alignContent:Alignment.Center}){ | 135 | Stack({alignContent:Alignment.Center}){ |
| 126 | Button(this.selectCount == 0?'选好了':'选好了(' + this.selectCount + ')') | 136 | Button(this.selectCount == 0?'选好了':'选好了(' + this.selectCount + ')') |
| @@ -131,9 +141,11 @@ struct LaunchInterestsHobbiesPage { | @@ -131,9 +141,11 @@ struct LaunchInterestsHobbiesPage { | ||
| 131 | .borderRadius('10lpx') | 141 | .borderRadius('10lpx') |
| 132 | .width('662lpx') | 142 | .width('662lpx') |
| 133 | .height('84lpx') | 143 | .height('84lpx') |
| 144 | + .margin({top:'10lpx'}) | ||
| 134 | Image('') | 145 | Image('') |
| 135 | .width('662lpx') | 146 | .width('662lpx') |
| 136 | .height('84lpx') | 147 | .height('84lpx') |
| 148 | + .margin({top:'10lpx'}) | ||
| 137 | .backgroundColor(Color.White) | 149 | .backgroundColor(Color.White) |
| 138 | .opacity(this.selectCount == 0 ? 0.6 : 0) | 150 | .opacity(this.selectCount == 0 ? 0.6 : 0) |
| 139 | .borderRadius('10lpx') | 151 | .borderRadius('10lpx') |
| @@ -156,10 +168,8 @@ struct LaunchInterestsHobbiesPage { | @@ -156,10 +168,8 @@ struct LaunchInterestsHobbiesPage { | ||
| 156 | } | 168 | } |
| 157 | .width('100%') | 169 | .width('100%') |
| 158 | .height('108lpx') | 170 | .height('108lpx') |
| 159 | - // .position({y:}) | ||
| 160 | - // .margin({bottom:'1',top:'1'}) | ||
| 161 | - .backgroundColor('#FFFFFF') | ||
| 162 | - | 171 | + .margin({top:0}) |
| 172 | + // .backgroundColor(Color.Orange) | ||
| 163 | } | 173 | } |
| 164 | .width('100%') | 174 | .width('100%') |
| 165 | .height('100%') | 175 | .height('100%') |
| @@ -8,6 +8,8 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter'; | @@ -8,6 +8,8 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter'; | ||
| 8 | import { DisplayDirection } from 'wdConstant/Index'; | 8 | import { DisplayDirection } from 'wdConstant/Index'; |
| 9 | import { PageComponent } from 'wdComponent/Index'; | 9 | import { PageComponent } from 'wdComponent/Index'; |
| 10 | import { TrackingButton, TrackConstants } from 'wdTracking/Index'; | 10 | import { TrackingButton, TrackConstants } from 'wdTracking/Index'; |
| 11 | +import { Logger } from 'wdKit'; | ||
| 12 | +import { ParamType, Tracking } from 'wdTracking/Index'; | ||
| 11 | 13 | ||
| 12 | const TAG = 'VideoChannelPage' | 14 | const TAG = 'VideoChannelPage' |
| 13 | 15 | ||
| @@ -100,6 +102,18 @@ export struct VideoChannelPage { | @@ -100,6 +102,18 @@ export struct VideoChannelPage { | ||
| 100 | right: $r('app.float.top_tab_item_padding_horizontal'), | 102 | right: $r('app.float.top_tab_item_padding_horizontal'), |
| 101 | }) | 103 | }) |
| 102 | .onClick(() => { | 104 | .onClick(() => { |
| 105 | + | ||
| 106 | + // 视频tab埋点 | ||
| 107 | + const tab = this.topNavList[index] | ||
| 108 | + Logger.info(TAG, `视频tab埋点: ${JSON.stringify(tab)}`); | ||
| 109 | + | ||
| 110 | + const params: ParamType = { | ||
| 111 | + "pageName": tab.name, | ||
| 112 | + "tabName": tab.name, | ||
| 113 | + "pageId": tab.pageId, | ||
| 114 | + } | ||
| 115 | + Tracking.event("video_page_tab_click", params) | ||
| 116 | + | ||
| 103 | if (this.currentTopNavSelectedIndex === index) { | 117 | if (this.currentTopNavSelectedIndex === index) { |
| 104 | this.autoRefresh++ | 118 | this.autoRefresh++ |
| 105 | } | 119 | } |
-
Please register or login to post a comment