liyubing

Merge remote-tracking branch 'origin/main'

@@ -4,6 +4,7 @@ import { TopNavDTO } from './TopNavDTO'; @@ -4,6 +4,7 @@ import { TopNavDTO } from './TopNavDTO';
4 * 底导(包含顶导列表)数据 4 * 底导(包含顶导列表)数据
5 */ 5 */
6 export interface BottomNavDTO { 6 export interface BottomNavDTO {
  7 + pageName: string;
7 backgroundUrl: string; // 迭代四:页面背景图 8 backgroundUrl: string; // 迭代四:页面背景图
8 channelChooseActionUrl: string; // 迭代四:频道选中下划线动画 9 channelChooseActionUrl: string; // 迭代四:频道选中下划线动画
9 channelChooseCColor: string; // 迭代四:频道未选中颜色 10 channelChooseCColor: string; // 迭代四:频道未选中颜色
@@ -107,8 +107,6 @@ export struct CardMediaInfo { @@ -107,8 +107,6 @@ export struct CardMediaInfo {
107 .margin({ 107 .margin({
108 right: '2vp' 108 right: '2vp'
109 }) 109 })
110 - // Image($r('app.media.card_live'))  
111 - // .mediaLogo()  
112 Text('直播中') 110 Text('直播中')
113 .mediaText() 111 .mediaText()
114 } else if (this.contentDTO?.liveType === 'end' && this.contentDTO?.linkUrl) { 112 } else if (this.contentDTO?.liveType === 'end' && this.contentDTO?.linkUrl) {
@@ -116,10 +114,17 @@ export struct CardMediaInfo { @@ -116,10 +114,17 @@ export struct CardMediaInfo {
116 .mediaLogo() 114 .mediaLogo()
117 Text('回看') 115 Text('回看')
118 .mediaText() 116 .mediaText()
119 - }else if(this.contentDTO?.liveInfo?.liveState === 'end' && !this.contentDTO?.linkUrl){ 117 + }else if(this.contentDTO?.liveType === 'end' && !this.contentDTO?.linkUrl){
120 Text('已结束') 118 Text('已结束')
121 .mediaText() 119 .mediaText()
  120 + }else if(!this.contentDTO?.liveType && this.contentDTO?.linkUrl){
  121 + // 加个防护,生产有出现这样的特例
  122 + Image($r('app.media.card_play'))
  123 + .mediaLogo()
  124 + Text('回看')
  125 + .mediaText()
122 } 126 }
  127 +
123 }else { 128 }else {
124 // 当liveInfo存在时后 129 // 当liveInfo存在时后
125 130
@@ -129,6 +134,7 @@ export struct CardMediaInfo { @@ -129,6 +134,7 @@ export struct CardMediaInfo {
129 Text('预约') 134 Text('预约')
130 .mediaText() 135 .mediaText()
131 } else if (this.contentDTO?.liveInfo?.liveState === 'running') { 136 } else if (this.contentDTO?.liveInfo?.liveState === 'running') {
  137 + Row(){
132 LottieView({ 138 LottieView({
133 name: 'live_status_wait', 139 name: 'live_status_wait',
134 path: "lottie/live_detail_living.json", 140 path: "lottie/live_detail_living.json",
@@ -136,14 +142,14 @@ export struct CardMediaInfo { @@ -136,14 +142,14 @@ export struct CardMediaInfo {
136 lottieHeight: 14, 142 lottieHeight: 14,
137 autoplay: true, 143 autoplay: true,
138 loop: true, 144 loop: true,
139 - })  
140 - .margin({ 145 + }).margin({
141 right: '2vp' 146 right: '2vp'
142 }) 147 })
143 - // Image($r('app.media.card_live'))  
144 - // .mediaLogo()  
145 Text('直播中') 148 Text('直播中')
146 .mediaText() 149 .mediaText()
  150 +
  151 + }
  152 +
147 } else if (this.contentDTO?.liveInfo?.liveState === 'end' && this.contentDTO?.liveInfo?.replayUri) { 153 } else if (this.contentDTO?.liveInfo?.liveState === 'end' && this.contentDTO?.liveInfo?.replayUri) {
148 Image($r('app.media.card_play')) 154 Image($r('app.media.card_play'))
149 .mediaLogo() 155 .mediaLogo()
@@ -154,7 +160,6 @@ export struct CardMediaInfo { @@ -154,7 +160,6 @@ export struct CardMediaInfo {
154 Text('已结束') 160 Text('已结束')
155 .mediaText() 161 .mediaText()
156 } 162 }
157 -  
158 } 163 }
159 // 备注直播间观看人数在轮播图卡不显示 164 // 备注直播间观看人数在轮播图卡不显示
160 if(this.beused !== 'Zh_Carousel_Layout_01'){ 165 if(this.beused !== 'Zh_Carousel_Layout_01'){
@@ -165,15 +170,6 @@ export struct CardMediaInfo { @@ -165,15 +170,6 @@ export struct CardMediaInfo {
165 .mediaText() 170 .mediaText()
166 } 171 }
167 } 172 }
168 -  
169 -  
170 - // } else if (this.contentDTO?.liveInfo?.liveState === 'end' && this.contentDTO?.liveInfo  
171 - // ?.replayUri) {  
172 - // // Image($r('app.media.card_live'))  
173 - // // .mediaLogo()  
174 - // Text('直播结束')  
175 - // .mediaText()  
176 - // }  
177 } 173 }
178 } else if (this.contentDTO.objectType === '9') { 174 } else if (this.contentDTO.objectType === '9') {
179 // 显示组图;图片数量 175 // 显示组图;图片数量
@@ -6,24 +6,25 @@ import { TrackingButton, TrackConstants } from 'wdTracking/Index'; @@ -6,24 +6,25 @@ import { TrackingButton, TrackConstants } from 'wdTracking/Index';
6 @Component 6 @Component
7 export default struct MinePageMoreFunctionUI { 7 export default struct MinePageMoreFunctionUI {
8 @Link moreData: MinePageMoreFunctionModel[] 8 @Link moreData: MinePageMoreFunctionModel[]
  9 + @Link percent:number
9 10
10 build() { 11 build() {
11 Column() { 12 Column() {
12 Column() { 13 Column() {
13 Text("更多功能") 14 Text("更多功能")
14 .fontColor($r('app.color.color_222222')) 15 .fontColor($r('app.color.color_222222'))
15 - .fontSize('29lpx')  
16 - .margin({ left: "31lpx" })  
17 - .lineHeight('46lpx') 16 + .fontSize(`${this.calcHeight(29)}lpx`)
  17 + .margin({ left: `${this.calcHeight(31)}lpx` })
  18 + .lineHeight(`${this.calcHeight(46)}lpx`)
18 .fontWeight(FontWeight.Bold) 19 .fontWeight(FontWeight.Bold)
19 - }.height('92lpx') 20 + }.height(`${this.calcHeight(92)}lpx`)
20 .width('100%') 21 .width('100%')
21 .justifyContent(FlexAlign.Center) 22 .justifyContent(FlexAlign.Center)
22 .alignItems(HorizontalAlign.Start) 23 .alignItems(HorizontalAlign.Start)
23 24
24 Text().backgroundColor($r('app.color.color_F5F5F5')) 25 Text().backgroundColor($r('app.color.color_F5F5F5'))
25 .width('100%') 26 .width('100%')
26 - .height('1lpx') 27 + .height(`${this.calcHeight(1)}lpx`)
27 28
28 List() { 29 List() {
29 ForEach(this.moreData, (item: MinePageMoreFunctionModel, index: number) => { 30 ForEach(this.moreData, (item: MinePageMoreFunctionModel, index: number) => {
@@ -31,39 +32,42 @@ export default struct MinePageMoreFunctionUI { @@ -31,39 +32,42 @@ export default struct MinePageMoreFunctionUI {
31 Column() { 32 Column() {
32 Column() { 33 Column() {
33 Row() { 34 Row() {
  35 + Row(){
34 if (item.imgSrc) { 36 if (item.imgSrc) {
35 Image(item.imgSrc) 37 Image(item.imgSrc)
36 - .width('38lpx')  
37 - .height('38lpx')  
38 - .margin({ right: '15lpx' }) 38 + .width(`${this.calcHeight(38)}lpx`)
  39 + .height(`${this.calcHeight(38)}lpx`)
  40 + .margin({ right: `${this.calcHeight(15)}lpx` })
39 .objectFit(ImageFit.Auto) 41 .objectFit(ImageFit.Auto)
40 .interpolation(ImageInterpolation.High) 42 .interpolation(ImageInterpolation.High)
41 } 43 }
42 Text(`${item.msg}`) 44 Text(`${item.msg}`)
43 - .width('456lpx')  
44 - .height('38lpx') 45 + .height(`${this.calcHeight(38)}lpx`)
45 .fontColor($r('app.color.color_666666')) 46 .fontColor($r('app.color.color_666666'))
46 - .fontSize('29lpx') 47 + .fontSize(`${this.calcHeight(29)}lpx`)
47 .fontWeight(400) 48 .fontWeight(400)
  49 + }.alignItems(VerticalAlign.Center)
  50 + .justifyContent(FlexAlign.Start)
48 51
49 - Blank()  
50 Image($r('app.media.mine_user_arrow_2')) 52 Image($r('app.media.mine_user_arrow_2'))
51 - .width('27lpx')  
52 - .height('27lpx') 53 + .width(`${this.calcHeight(27)}lpx`)
  54 + .height(`${this.calcHeight(27)}lpx`)
53 .objectFit(ImageFit.Auto) 55 .objectFit(ImageFit.Auto)
54 .interpolation(ImageInterpolation.High) 56 .interpolation(ImageInterpolation.High)
55 - .margin({ left: '81lpx', right: '29lpx' }) 57 + .margin({ left: `${this.calcHeight(81)}lpx`, right: `${this.calcHeight(29)}lpx` })
56 }.alignItems(VerticalAlign.Center) 58 }.alignItems(VerticalAlign.Center)
  59 + .justifyContent(FlexAlign.SpaceBetween)
  60 + .width("100%")
  61 +
  62 + }.height(`${this.calcHeight(108)}lpx`)
57 .justifyContent(FlexAlign.Center) 63 .justifyContent(FlexAlign.Center)
58 - }.height('108lpx')  
59 - .justifyContent(FlexAlign.Center)  
60 - .alignItems(HorizontalAlign.Start)  
61 - .padding({ left: '27lpx' }) 64 + .padding({ left: `${this.calcHeight(27)}lpx` })
  65 + .width("100%")
62 66
63 if (index != this.moreData.length - 1) { 67 if (index != this.moreData.length - 1) {
64 Text().backgroundColor($r('app.color.color_F5F5F5')) 68 Text().backgroundColor($r('app.color.color_F5F5F5'))
65 - .width('612lpx')  
66 - .height('1lpx') 69 + .width(`612lpx`)
  70 + .height(`${this.calcHeight(1)}lpx`)
67 } 71 }
68 } 72 }
69 } 73 }
@@ -83,15 +87,21 @@ export default struct MinePageMoreFunctionUI { @@ -83,15 +87,21 @@ export default struct MinePageMoreFunctionUI {
83 ProcessUtils.gotoFeedBackActivity() 87 ProcessUtils.gotoFeedBackActivity()
84 } 88 }
85 }) 89 })
86 - .height('117lpx') 90 + .height(`${this.calcHeight(117)}lpx`)
  91 + .width("100%")
87 }) 92 })
88 }.onScrollFrameBegin((offset, state) => { 93 }.onScrollFrameBegin((offset, state) => {
89 return { offsetRemain: 0 } 94 return { offsetRemain: 0 }
90 }) 95 })
  96 + .width("100%")
91 } 97 }
92 .backgroundColor($r('app.color.white')) 98 .backgroundColor($r('app.color.white'))
93 .borderRadius(8) 99 .borderRadius(8)
94 - .margin({ left: '23lpx', right: '23lpx', top: "19lpx" }) 100 + .margin({ left: `${this.calcHeight(23)}lpx`, right: `${this.calcHeight(23)}lpx`, top: `${this.calcHeight(19)}lpx` })
  101 + }
  102 +
  103 + calcHeight(value:number): number{
  104 + return value * this.percent
95 } 105 }
96 } 106 }
97 107
@@ -11,12 +11,13 @@ const TAG = "MinePagePersonFunctionUI" @@ -11,12 +11,13 @@ const TAG = "MinePagePersonFunctionUI"
11 export default struct MinePagePersonFunctionUI { 11 export default struct MinePagePersonFunctionUI {
12 @Link personalData:MinePagePersonalFunctionsItem[] 12 @Link personalData:MinePagePersonalFunctionsItem[]
13 @Prop isLogin:boolean 13 @Prop isLogin:boolean
  14 + @Link percent:number
14 15
15 build() { 16 build() {
16 Grid(){ 17 Grid(){
17 ForEach(this.personalData,(item:MinePagePersonalFunctionsItem,index:number)=>{ 18 ForEach(this.personalData,(item:MinePagePersonalFunctionsItem,index:number)=>{
18 GridItem(){ 19 GridItem(){
19 - PagePersonFunction({ item: item, noDivider : (index % 5 < 4 && index != this.personalData.length-1) ? false : true}) 20 + PagePersonFunction({ item: item, noDivider : (index % 5 < 4 && index != this.personalData.length-1) ? false : true,percent:$percent})
20 }.onClick(()=>{ 21 }.onClick(()=>{
21 console.log(index+"") 22 console.log(index+"")
22 switch (item.msg){ 23 switch (item.msg){
@@ -77,14 +78,14 @@ export default struct MinePagePersonFunctionUI { @@ -77,14 +78,14 @@ export default struct MinePagePersonFunctionUI {
77 break; 78 break;
78 } 79 }
79 } 80 }
80 - }).width('142lpx')  
81 - .height('117lpx') 81 + })/*.width(`${this.calcHeight(142)}lpx`)*/
  82 + .height(`${this.calcHeight(117)}lpx`)
82 }) 83 })
83 } 84 }
84 .rowsTemplate('1fr') 85 .rowsTemplate('1fr')
85 .columnsTemplate('1fr 1fr 1fr 1fr 1fr') 86 .columnsTemplate('1fr 1fr 1fr 1fr 1fr')
86 - .height('117lpx')  
87 - .margin({top:'31lpx'}) 87 + .height(`${this.calcHeight(117)}lpx`)
  88 + .margin({top:`${this.calcHeight(31)}lpx`})
88 } 89 }
89 90
90 messageClick(){ 91 messageClick(){
@@ -94,6 +95,10 @@ export default struct MinePagePersonFunctionUI { @@ -94,6 +95,10 @@ export default struct MinePagePersonFunctionUI {
94 console.log(TAG, JSON.stringify(err)) 95 console.log(TAG, JSON.stringify(err))
95 }) 96 })
96 } 97 }
  98 +
  99 + calcHeight(value:number): number{
  100 + return value * this.percent
  101 + }
97 } 102 }
98 103
99 function trackButtonClick(buttonName: string){ 104 function trackButtonClick(buttonName: string){
@@ -13,6 +13,7 @@ export default struct MinePageUserSimpleInfoUI { @@ -13,6 +13,7 @@ export default struct MinePageUserSimpleInfoUI {
13 userType:string = "1" 13 userType:string = "1"
14 @State levelHead:string = "" 14 @State levelHead:string = ""
15 @State levelId:number = 0 15 @State levelId:number = 0
  16 + @Link percent:number
16 17
17 loginStateChange(){ 18 loginStateChange(){
18 if(this.isLogin){ 19 if(this.isLogin){
@@ -29,20 +30,20 @@ export default struct MinePageUserSimpleInfoUI { @@ -29,20 +30,20 @@ export default struct MinePageUserSimpleInfoUI {
29 Stack(){ 30 Stack(){
30 Image(this.headPhotoUrl==""?$r('app.media.default_head'):this.headPhotoUrl) 31 Image(this.headPhotoUrl==""?$r('app.media.default_head'):this.headPhotoUrl)
31 .alt($r('app.media.default_head')) 32 .alt($r('app.media.default_head'))
32 - .width('100lpx')  
33 - .height('100lpx') 33 + .width(`${this.calcHeight(100)}lpx`)
  34 + .height(`${this.calcHeight(100)}lpx`)
34 .objectFit(ImageFit.Cover) 35 .objectFit(ImageFit.Cover)
35 .borderRadius(50) 36 .borderRadius(50)
36 37
37 if(StringUtils.isNotEmpty(this.levelHead)){ 38 if(StringUtils.isNotEmpty(this.levelHead)){
38 Image(this.levelHead) 39 Image(this.levelHead)
39 - .width('130lpx')  
40 - .height('130lpx') 40 + .width(`${this.calcHeight(130)}lpx`)
  41 + .height(`${this.calcHeight(130)}lpx`)
41 .objectFit(ImageFit.Cover) 42 .objectFit(ImageFit.Cover)
42 .borderRadius(50) 43 .borderRadius(50)
43 } 44 }
44 - }.width('130lpx')  
45 - .height('130lpx') 45 + }.width(`${this.calcHeight(130)}lpx`)
  46 + .height(`${this.calcHeight(130)}lpx`)
46 .alignContent(Alignment.Center) 47 .alignContent(Alignment.Center)
47 .onClick(()=>{ 48 .onClick(()=>{
48 this.jumpLogin() 49 this.jumpLogin()
@@ -58,13 +59,13 @@ export default struct MinePageUserSimpleInfoUI { @@ -58,13 +59,13 @@ export default struct MinePageUserSimpleInfoUI {
58 .maxLines(1) 59 .maxLines(1)
59 .fontWeight(FontWeight.Bold) 60 .fontWeight(FontWeight.Bold)
60 .textOverflow({ overflow: TextOverflow.Ellipsis }) 61 .textOverflow({ overflow: TextOverflow.Ellipsis })
61 - .fontSize('33lpx')  
62 - .lineHeight("46lpx") 62 + .fontSize(`${this.calcHeight(33)}lpx`)
  63 + .lineHeight(`${this.calcHeight(46)}lpx`)
63 64
64 Image($r('app.media.mine_user_edit')) 65 Image($r('app.media.mine_user_edit'))
65 - .width('27lpx')  
66 - .height('27lpx')  
67 - .margin({left:'15lpx'}) 66 + .width(`${this.calcHeight(27)}lpx`)
  67 + .height(`${this.calcHeight(27)}lpx`)
  68 + .margin({left:`${this.calcHeight(15)}lpx`})
68 .objectFit(ImageFit.Cover) 69 .objectFit(ImageFit.Cover)
69 Blank() 70 Blank()
70 }.width('100%') 71 }.width('100%')
@@ -75,39 +76,39 @@ export default struct MinePageUserSimpleInfoUI { @@ -75,39 +76,39 @@ export default struct MinePageUserSimpleInfoUI {
75 76
76 Stack(){ 77 Stack(){
77 Image($r('app.media.mine_grade_bg')) 78 Image($r('app.media.mine_grade_bg'))
78 - .width('84lpx')  
79 - .height('29lpx') 79 + .width(`${this.calcHeight(84)}lpx`)
  80 + .height(`${this.calcHeight(29)}lpx`)
80 .objectFit(ImageFit.Auto) 81 .objectFit(ImageFit.Auto)
81 Text(`等级${this.levelId}`) 82 Text(`等级${this.levelId}`)
82 .textAlign(TextAlign.Center) 83 .textAlign(TextAlign.Center)
83 .fontColor($r('app.color.white')) 84 .fontColor($r('app.color.white'))
84 - .fontSize('19lpx')  
85 - .width('50lpx')  
86 - .height('29lpx')  
87 - }.margin({top:'15lpx'}) 85 + .fontSize(`${this.calcHeight(19)}lpx`)
  86 + .width(`${this.calcHeight(50)}lpx`)
  87 + .height(`${this.calcHeight(29)}lpx`)
  88 + }.margin({top:'`${this.calcHeight(15)}lpx`'})
88 }.alignItems(HorizontalAlign.Start) 89 }.alignItems(HorizontalAlign.Start)
89 - .margin({top:'12lpx',left:'23lpx'})  
90 - .width('352lpx') 90 + .margin({top:`${this.calcHeight(12)}lpx`,left:`${this.calcHeight(23)}lpx`})
  91 + .width(`${this.calcHeight(352)}lpx`)
91 }else{ 92 }else{
92 Row(){ 93 Row(){
93 Text("登录注册") 94 Text("登录注册")
94 .fontColor($r('app.color.color_222222')) 95 .fontColor($r('app.color.color_222222'))
95 - .fontSize('38lpx')  
96 - .lineHeight("46lpx") 96 + .fontSize(`${this.calcHeight(38)}lpx`)
  97 + .lineHeight(`${this.calcHeight(46)}lpx`)
97 .fontWeight(600) 98 .fontWeight(600)
98 99
99 Image($r('app.media.mine_user_edit')) 100 Image($r('app.media.mine_user_edit'))
100 - .width('11lpx')  
101 - .height('20lpx')  
102 - .margin({left:'15lpx'}) 101 + .width(`${this.calcHeight(11)}lpx`)
  102 + .height(`${this.calcHeight(20)}lpx`)
  103 + .margin({left:`${this.calcHeight(15)}lpx`})
103 .objectFit(ImageFit.Cover) 104 .objectFit(ImageFit.Cover)
104 Blank() 105 Blank()
105 }.onClick(()=>{ 106 }.onClick(()=>{
106 this.jumpLogin() 107 this.jumpLogin()
107 trackButtonClick("myPageUserLogin") 108 trackButtonClick("myPageUserLogin")
108 }) 109 })
109 - .margin({top:'11lpx',left:'23lpx'})  
110 - .width('352lpx') 110 + .margin({top:`${this.calcHeight(11)}lpx`,left:`${this.calcHeight(23)}lpx`})
  111 + .width(`${this.calcHeight(352)}lpx`)
111 } 112 }
112 113
113 Blank() 114 Blank()
@@ -116,15 +117,15 @@ export default struct MinePageUserSimpleInfoUI { @@ -116,15 +117,15 @@ export default struct MinePageUserSimpleInfoUI {
116 Text("签到") 117 Text("签到")
117 .textAlign(TextAlign.Start) 118 .textAlign(TextAlign.Start)
118 .width('108lpx') 119 .width('108lpx')
119 - .height('46lpx') 120 + .height(`${this.calcHeight(46)}lpx`)
120 .fontColor($r('app.color.color_AD6000')) 121 .fontColor($r('app.color.color_AD6000'))
121 .backgroundColor($r('app.color.color_FFC460')) 122 .backgroundColor($r('app.color.color_FFC460'))
122 .fontWeight(500) 123 .fontWeight(500)
123 .position({x:'23lpx'}) 124 .position({x:'23lpx'})
124 .padding({left:'35lpx'}) 125 .padding({left:'35lpx'})
125 Image($r("app.media.mine_sign_icon")) 126 Image($r("app.media.mine_sign_icon"))
126 - .width('50lpx')  
127 - .height('50lpx') 127 + .width(`${this.calcHeight(50)}lpx`)
  128 + .height(`${this.calcHeight(50)}lpx`)
128 }.width('131lpx') 129 }.width('131lpx')
129 .visibility(Visibility.Hidden) 130 .visibility(Visibility.Hidden)
130 }.backgroundColor($r('app.color.white')) 131 }.backgroundColor($r('app.color.white'))
@@ -201,6 +202,10 @@ export default struct MinePageUserSimpleInfoUI { @@ -201,6 +202,10 @@ export default struct MinePageUserSimpleInfoUI {
201 WDRouterRule.jumpWithPage(WDRouterPage.mineHomePage) 202 WDRouterRule.jumpWithPage(WDRouterPage.mineHomePage)
202 } 203 }
203 } 204 }
  205 +
  206 + calcHeight(value:number): number{
  207 + return value * this.percent
  208 + }
204 } 209 }
205 210
206 function trackButtonClick(buttonName: string){ 211 function trackButtonClick(buttonName: string){
@@ -4,6 +4,7 @@ import MinePagePersonalFunctionsItem from '../../viewmodel/MinePagePersonalFunct @@ -4,6 +4,7 @@ import MinePagePersonalFunctionsItem from '../../viewmodel/MinePagePersonalFunct
4 export struct PagePersonFunction{ 4 export struct PagePersonFunction{
5 @ObjectLink item: MinePagePersonalFunctionsItem 5 @ObjectLink item: MinePagePersonalFunctionsItem
6 @State noDivider:boolean = false 6 @State noDivider:boolean = false
  7 + @Link percent:number
7 8
8 build() { 9 build() {
9 Row(){ 10 Row(){
@@ -15,18 +16,18 @@ export struct PagePersonFunction{ @@ -15,18 +16,18 @@ export struct PagePersonFunction{
15 if (this.item.isShowRedPoint) { 16 if (this.item.isShowRedPoint) {
16 Button() 17 Button()
17 .type(ButtonType.Circle) 18 .type(ButtonType.Circle)
18 - .width("12lpx")  
19 - .height("12lpx") 19 + .width(`${this.calcHeight(12)}lpx`)
  20 + .height(`${this.calcHeight(12)}lpx`)
20 .backgroundColor($r('app.color.color_ED2800')) 21 .backgroundColor($r('app.color.color_ED2800'))
21 } 22 }
22 - }.width('46lpx')  
23 - .height('46lpx') 23 + }.width(`${this.calcHeight(46)}lpx`)
  24 + .height(`${this.calcHeight(46)}lpx`)
24 25
25 Text(`${this.item.msg}`) 26 Text(`${this.item.msg}`)
26 - .margin({top:'8lpx'})  
27 - .height('23lpx') 27 + .margin({top:`${this.calcHeight(8)}lpx`})
  28 + .height(`${this.calcHeight(23)}lpx`)
28 .fontColor($r('app.color.color_222222')) 29 .fontColor($r('app.color.color_222222'))
29 - .fontSize('23lpx') 30 + .fontSize(`${this.calcHeight(23)}lpx`)
30 } 31 }
31 .alignItems(HorizontalAlign.Center) 32 .alignItems(HorizontalAlign.Center)
32 .width('100%') 33 .width('100%')
@@ -35,10 +36,13 @@ export struct PagePersonFunction{ @@ -35,10 +36,13 @@ export struct PagePersonFunction{
35 if(!this.noDivider){ 36 if(!this.noDivider){
36 Text().backgroundColor($r('app.color.color_222222')) 37 Text().backgroundColor($r('app.color.color_222222'))
37 .opacity(0.1) 38 .opacity(0.1)
38 - .width('2lpx')  
39 - .height('29lpx') 39 + .width(`${this.calcHeight(2)}lpx`)
  40 + .height(`${this.calcHeight(29)}lpx`)
40 } 41 }
41 } 42 }
42 } 43 }
43 44
  45 + calcHeight(value:number): number{
  46 + return value * this.percent
  47 + }
44 } 48 }
@@ -82,6 +82,7 @@ export struct FollowChildComponent{ @@ -82,6 +82,7 @@ export struct FollowChildComponent{
82 .justifyContent(FlexAlign.Center) 82 .justifyContent(FlexAlign.Center)
83 .width('100lpx') 83 .width('100lpx')
84 .backgroundColor($r("app.color.color_F5F5F5")) 84 .backgroundColor($r("app.color.color_F5F5F5"))
  85 + .borderRadius("6lpx")
85 .height('46lpx') 86 .height('46lpx')
86 .onClick(()=>{ 87 .onClick(()=>{
87 this.followOperation() 88 this.followOperation()
@@ -198,6 +199,7 @@ export struct FollowChildComponent{ @@ -198,6 +199,7 @@ export struct FollowChildComponent{
198 } 199 }
199 .backgroundColor($r("app.color.color_F5F5F5")) 200 .backgroundColor($r("app.color.color_F5F5F5"))
200 .justifyContent(FlexAlign.Center) 201 .justifyContent(FlexAlign.Center)
  202 + .borderRadius("6lpx")
201 .width('100lpx') 203 .width('100lpx')
202 .height('46lpx') 204 .height('46lpx')
203 .onClick(()=>{ 205 .onClick(()=>{
@@ -10,7 +10,10 @@ const TAG = "FollowFirstTabsComponent" @@ -10,7 +10,10 @@ const TAG = "FollowFirstTabsComponent"
10 export struct FollowFirstTabsComponent{ 10 export struct FollowFirstTabsComponent{
11 @State currentIndex: number = 0 11 @State currentIndex: number = 0
12 @Prop changeIndex: number 12 @Prop changeIndex: number
13 - private controller: TabsController = new TabsController() 13 +
  14 + private swiperController: SwiperController = new SwiperController()
  15 + private listScroller: Scroller = new Scroller()
  16 +
14 @State data:FollowListItem[] = [] 17 @State data:FollowListItem[] = []
15 fontColor: string = '#999999' 18 fontColor: string = '#999999'
16 selectedFontColor: string = '#000000' 19 selectedFontColor: string = '#000000'
@@ -20,7 +23,7 @@ export struct FollowFirstTabsComponent{ @@ -20,7 +23,7 @@ export struct FollowFirstTabsComponent{
20 this.getFollowTabList() 23 this.getFollowTabList()
21 24
22 EmitterUtils.receiveEvent(EmitterEventId.MY_FOLLOW_EMPTY, (() => { 25 EmitterUtils.receiveEvent(EmitterEventId.MY_FOLLOW_EMPTY, (() => {
23 - if(this.controller != null && this.data.length>1 ){ 26 + if(this.swiperController != null && this.data.length>1 ){
24 this.jumpFollowNextPage() 27 this.jumpFollowNextPage()
25 } 28 }
26 })) 29 }))
@@ -33,7 +36,7 @@ export struct FollowFirstTabsComponent{ @@ -33,7 +36,7 @@ export struct FollowFirstTabsComponent{
33 this.data.push(element) 36 this.data.push(element)
34 }) 37 })
35 38
36 - if(this.controller != null && this.data.length>1 && this.changeIndex === 1){ 39 + if(this.swiperController != null && this.data.length>1 && this.changeIndex === 1){
37 this.jumpFollowNextPage() 40 this.jumpFollowNextPage()
38 } 41 }
39 }).catch((err:Error)=>{ 42 }).catch((err:Error)=>{
@@ -45,7 +48,7 @@ export struct FollowFirstTabsComponent{ @@ -45,7 +48,7 @@ export struct FollowFirstTabsComponent{
45 //个人主页 跳转 关注页 tab 2 48 //个人主页 跳转 关注页 tab 2
46 let intervalID = setInterval(() => { 49 let intervalID = setInterval(() => {
47 this.currentIndex = 1 50 this.currentIndex = 1
48 - this.controller.changeIndex(this.currentIndex) 51 + this.swiperController.changeIndex(this.currentIndex)
49 clearInterval(intervalID); 52 clearInterval(intervalID);
50 }, 500); 53 }, 500);
51 } 54 }
@@ -70,7 +73,8 @@ export struct FollowFirstTabsComponent{ @@ -70,7 +73,8 @@ export struct FollowFirstTabsComponent{
70 } 73 }
71 }.onClick(()=>{ 74 }.onClick(()=>{
72 this.currentIndex = index 75 this.currentIndex = index
73 - this.controller.changeIndex(this.currentIndex) 76 + this.swiperController.changeIndex(this.currentIndex)
  77 + this.listScroller.scrollToIndex(index, true, ScrollAlign.CENTER)
74 trackTabFirstClick(item.directoryName) 78 trackTabFirstClick(item.directoryName)
75 }) 79 })
76 .height('100%') 80 .height('100%')
@@ -90,28 +94,38 @@ export struct FollowFirstTabsComponent{ @@ -90,28 +94,38 @@ export struct FollowFirstTabsComponent{
90 .layoutWeight(1) 94 .layoutWeight(1)
91 .width('100%') 95 .width('100%')
92 }else{ 96 }else{
93 - Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { 97 + Column(){
  98 + List({ scroller: this.listScroller }){
  99 + ForEach(this.data, (item: FollowListItem, index: number ) => {
  100 + ListItem(){
  101 + this.TabBuilder(index,item)
  102 + }
  103 + }, (item: FollowListItem, index: number) => index.toString())
  104 + }.listDirection(Axis.Horizontal)
  105 + .backgroundColor($r('app.color.white'))
  106 + .width("100%")
  107 + .height("84lpx")
  108 + .edgeEffect(EdgeEffect.None)
  109 + .scrollBar(BarState.Off)
  110 +
  111 + Swiper(this.swiperController){
94 ForEach(this.data, (item: FollowListItem, index: number ) => { 112 ForEach(this.data, (item: FollowListItem, index: number ) => {
95 - TabContent(){  
96 FollowSecondTabsComponent({data:$data,firstIndex:index}) 113 FollowSecondTabsComponent({data:$data,firstIndex:index})
97 - }.tabBar(this.TabBuilder(index,item))  
98 .backgroundColor($r('app.color.white')) 114 .backgroundColor($r('app.color.white'))
99 - .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])  
100 }, (item: FollowListItem, index: number) => index.toString()) 115 }, (item: FollowListItem, index: number) => index.toString())
101 } 116 }
102 - .vertical(false)  
103 - .barMode(BarMode.Scrollable)  
104 - .barWidth('100%')  
105 - .barBackgroundColor($r('app.color.white'))  
106 - .barHeight('84lpx')  
107 - .animationDuration(0)  
108 .onChange((index: number) => { 117 .onChange((index: number) => {
109 this.currentIndex = index 118 this.currentIndex = index
110 trackTabFirstClick(this.data[index].directoryName) 119 trackTabFirstClick(this.data[index].directoryName)
  120 + this.listScroller.scrollToIndex(index, true, ScrollAlign.CENTER)
111 }) 121 })
112 .width('100%') 122 .width('100%')
113 .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM]) 123 .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
114 .layoutWeight(1) 124 .layoutWeight(1)
  125 + .loop(false)
  126 + .indicator(false)
  127 + .effectMode(EdgeEffect.None)
  128 + }.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
115 } 129 }
116 }.width('100%') 130 }.width('100%')
117 .height("100%") 131 .height("100%")
@@ -98,6 +98,7 @@ export struct FollowListDetailUI { @@ -98,6 +98,7 @@ export struct FollowListDetailUI {
98 ListItem() { 98 ListItem() {
99 ListHasNoMoreDataUI() 99 ListHasNoMoreDataUI()
100 } 100 }
  101 + .margin({bottom:"40lpx"})
101 } 102 }
102 } 103 }
103 .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM]) 104 .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
@@ -7,7 +7,7 @@ export struct FollowSecondTabsComponent{ @@ -7,7 +7,7 @@ export struct FollowSecondTabsComponent{
7 @Link data:FollowListItem[] 7 @Link data:FollowListItem[]
8 @State firstIndex:number = 0 8 @State firstIndex:number = 0
9 @State currentIndex: number = 0 9 @State currentIndex: number = 0
10 - private controller: TabsController = new TabsController() 10 + private swiperController: SwiperController = new SwiperController()
11 fontColor: string = '#000000' 11 fontColor: string = '#000000'
12 selectedFontColor: string = '#ED2800' 12 selectedFontColor: string = '#ED2800'
13 13
@@ -77,20 +77,16 @@ export struct FollowSecondTabsComponent{ @@ -77,20 +77,16 @@ export struct FollowSecondTabsComponent{
77 .alignItems(VerticalAlign.Top) 77 .alignItems(VerticalAlign.Top)
78 .height('100%') 78 .height('100%')
79 79
80 - Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { 80 + Swiper(this.swiperController ) {
81 ForEach(this.data[this.firstIndex].children, (item: FollowSecondListItem, index: number ) => { 81 ForEach(this.data[this.firstIndex].children, (item: FollowSecondListItem, index: number ) => {
82 - TabContent(){  
83 FollowThirdTabsComponent({data:$data,firstIndex:$firstIndex,secondIndex:index}) 82 FollowThirdTabsComponent({data:$data,firstIndex:$firstIndex,secondIndex:index})
84 - }.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])  
85 }, (item: FollowListItem, index: number) => index.toString()) 83 }, (item: FollowListItem, index: number) => index.toString())
86 } 84 }
  85 + .loop(false)
87 .vertical(true) 86 .vertical(true)
88 - .barMode(BarMode.Scrollable)  
89 - .animationDuration(0)  
90 - .onChange((index: number) => {  
91 - this.currentIndex = index  
92 - })  
93 - .barWidth(0) 87 + .indicator(false)
  88 + .disableSwipe(true)
  89 + .effectMode(EdgeEffect.None)
94 .height('100%') 90 .height('100%')
95 .layoutWeight(1) 91 .layoutWeight(1)
96 .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM]) 92 .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
@@ -110,7 +106,7 @@ export struct FollowSecondTabsComponent{ @@ -110,7 +106,7 @@ export struct FollowSecondTabsComponent{
110 } 106 }
111 .onClick(()=>{ 107 .onClick(()=>{
112 this.currentIndex = index 108 this.currentIndex = index
113 - this.controller.changeIndex(this.currentIndex) 109 + this.swiperController.changeIndex(this.currentIndex)
114 }) 110 })
115 .justifyContent(FlexAlign.Center) 111 .justifyContent(FlexAlign.Center)
116 .height('84lpx') 112 .height('84lpx')
@@ -10,8 +10,8 @@ export struct FollowThirdTabsComponent{ @@ -10,8 +10,8 @@ export struct FollowThirdTabsComponent{
10 @Link firstIndex: number 10 @Link firstIndex: number
11 @State secondIndex:number = -1 11 @State secondIndex:number = -1
12 12
13 -  
14 - private controller: TabsController = new TabsController() 13 + private swiperController: SwiperController = new SwiperController()
  14 + private listScroller: Scroller = new Scroller()
15 fontColor: string = '#666666' 15 fontColor: string = '#666666'
16 selectedFontColor: string = '#222222' 16 selectedFontColor: string = '#222222'
17 17
@@ -50,7 +50,8 @@ export struct FollowThirdTabsComponent{ @@ -50,7 +50,8 @@ export struct FollowThirdTabsComponent{
50 } 50 }
51 .onClick(()=>{ 51 .onClick(()=>{
52 this.currentIndex = index 52 this.currentIndex = index
53 - this.controller.changeIndex(this.currentIndex) 53 + this.swiperController.changeIndex(this.currentIndex)
  54 + this.listScroller.scrollToIndex(index, true, ScrollAlign.CENTER)
54 }) 55 })
55 .offset({x:index === 0?"0lpx":"-5lpx"}) 56 .offset({x:index === 0?"0lpx":"-5lpx"})
56 .height('80lpx') 57 .height('80lpx')
@@ -62,31 +63,47 @@ export struct FollowThirdTabsComponent{ @@ -62,31 +63,47 @@ export struct FollowThirdTabsComponent{
62 @Builder FollowThirdUI(){ 63 @Builder FollowThirdUI(){
63 64
64 Column(){ 65 Column(){
65 - Column() {  
66 - // 页签  
67 - Row() {  
68 - Scroll() {  
69 - Row() { 66 +
  67 + List({ scroller: this.listScroller }){
70 ForEach(this.data[this.firstIndex].children[this.secondIndex].children, (item: FollowThirdListItem, index: number ) => { 68 ForEach(this.data[this.firstIndex].children[this.secondIndex].children, (item: FollowThirdListItem, index: number ) => {
  69 + ListItem(){
71 this.TabBuilder(index,item) 70 this.TabBuilder(index,item)
72 - })  
73 } 71 }
74 - .justifyContent(FlexAlign.Start) 72 + })
75 } 73 }
76 - .align(Alignment.Start)  
77 - .scrollable(ScrollDirection.Horizontal) 74 + .backgroundColor($r('app.color.white'))
  75 + .edgeEffect(EdgeEffect.None)
78 .scrollBar(BarState.Off) 76 .scrollBar(BarState.Off)
  77 + .listDirection(Axis.Horizontal)
79 .width('100%') 78 .width('100%')
  79 + .height("84lpx")
80 .padding({left:'31lpx',right:'48lpx'}) 80 .padding({left:'31lpx',right:'48lpx'})
81 - }  
82 - .alignItems(VerticalAlign.Bottom)  
83 - .width('100%')  
84 - }  
85 - .backgroundColor($r('app.color.white'))  
86 - .alignItems(HorizontalAlign.Start)  
87 - .width('100%')  
88 81
89 - Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { 82 + // Column() {
  83 + // // 页签
  84 + // Row() {
  85 + // Scroll() {
  86 + // Row() {
  87 + // ForEach(this.data[this.firstIndex].children[this.secondIndex].children, (item: FollowThirdListItem, index: number ) => {
  88 + // this.TabBuilder(index,item)
  89 + // })
  90 + // }
  91 + // .justifyContent(FlexAlign.Start)
  92 + // }
  93 + // .align(Alignment.Start)
  94 + // .scrollable(ScrollDirection.Horizontal)
  95 + // .scrollBar(BarState.Off)
  96 + // .width('100%')
  97 + // .padding({left:'31lpx',right:'48lpx'})
  98 + // }
  99 + // .alignItems(VerticalAlign.Bottom)
  100 + // .width('100%')
  101 + // }
  102 + // .backgroundColor($r('app.color.white'))
  103 + // .alignItems(HorizontalAlign.Start)
  104 + // .width('100%')
  105 +
  106 + Swiper(this.swiperController ) {
90 ForEach(this.data[this.firstIndex].children[this.secondIndex].children, (item: FollowThirdListItem, index: number ) => { 107 ForEach(this.data[this.firstIndex].children[this.secondIndex].children, (item: FollowThirdListItem, index: number ) => {
91 TabContent(){ 108 TabContent(){
92 Column(){ 109 Column(){
@@ -96,12 +113,12 @@ export struct FollowThirdTabsComponent{ @@ -96,12 +113,12 @@ export struct FollowThirdTabsComponent{
96 .backgroundColor($r('app.color.white')) 113 .backgroundColor($r('app.color.white'))
97 }, (item: FollowListItem, index: number) => index.toString()) 114 }, (item: FollowListItem, index: number) => index.toString())
98 } 115 }
99 - .barHeight(0)  
100 - .vertical(false)  
101 - .barMode(BarMode.Scrollable)  
102 - .animationDuration(0) 116 + .loop(false)
  117 + .indicator(false)
  118 + .disableSwipe(true)
  119 + .effectMode(EdgeEffect.None)
103 .onChange((index: number) => { 120 .onChange((index: number) => {
104 - this.currentIndex = index 121 + // this.currentIndex = index
105 }) 122 })
106 .width('100%') 123 .width('100%')
107 .layoutWeight(1) 124 .layoutWeight(1)
@@ -5,7 +5,7 @@ import MinePageDatasModel from '../../model/MinePageDatasModel' @@ -5,7 +5,7 @@ import MinePageDatasModel from '../../model/MinePageDatasModel'
5 import MinePageUserSimpleInfoUI from '../mine/MinePageUserSimpleInfoUI' 5 import MinePageUserSimpleInfoUI from '../mine/MinePageUserSimpleInfoUI'
6 import MinePagePersonFunctionUI from '../mine/MinePagePersonFunctionUI' 6 import MinePagePersonFunctionUI from '../mine/MinePagePersonFunctionUI'
7 import MinePageMoreFunctionUI from '../mine/MinePageMoreFunctionUI' 7 import MinePageMoreFunctionUI from '../mine/MinePageMoreFunctionUI'
8 -import { DateTimeUtils, SPHelper, StringUtils } from 'wdKit' 8 +import { BreakpointSystem, DateTimeUtils, SPHelper, StringUtils } from 'wdKit'
9 import { SpConstants } from 'wdConstant' 9 import { SpConstants } from 'wdConstant'
10 import dataPreferences from '@ohos.data.preferences'; 10 import dataPreferences from '@ohos.data.preferences';
11 import { MergeRecordDialog } from '../../dialog/MergeRecordDialog' 11 import { MergeRecordDialog } from '../../dialog/MergeRecordDialog'
@@ -59,6 +59,20 @@ export struct MinePageComponent { @@ -59,6 +59,20 @@ export struct MinePageComponent {
59 pageHideTime:number = 0; 59 pageHideTime:number = 0;
60 pageFirstCreateTime:number = 0; 60 pageFirstCreateTime:number = 0;
61 @Prop isMinePage:boolean = false; 61 @Prop isMinePage:boolean = false;
  62 + @StorageProp('currentBreakpoint') @Watch("currentChanged")currentBreakpoint: string = 'sm';
  63 + private breakpointSystem = new BreakpointSystem();
  64 + @State percent:number = 1
  65 +
  66 + currentChanged(){
  67 + if(this.currentBreakpoint == "md" || this.currentBreakpoint == "lg"){
  68 + //大屏幕 折叠屏 或者ipad
  69 + this.percent = 0.7
  70 + }else {
  71 + this.percent = 1
  72 + }
  73 + console.log(TAG,"currentBreakpoint==>"+this.percent)
  74 + }
  75 +
62 76
63 //第一次还没创建时候 pageShow 接收不到监听 77 //第一次还没创建时候 pageShow 接收不到监听
64 async pageShowForUpdateData() { 78 async pageShowForUpdateData() {
@@ -85,11 +99,14 @@ export struct MinePageComponent { @@ -85,11 +99,14 @@ export struct MinePageComponent {
85 } 99 }
86 100
87 aboutToAppear(){ 101 aboutToAppear(){
  102 + this.breakpointSystem.register();
88 this.pageFirstCreateTime = DateTimeUtils.getTimeStamp() 103 this.pageFirstCreateTime = DateTimeUtils.getTimeStamp()
89 104
90 this.getFunctionData() 105 this.getFunctionData()
91 this.getUserLogin() 106 this.getUserLogin()
92 this.addLoginStatusObserver() 107 this.addLoginStatusObserver()
  108 + console.log(TAG,"currentBreakpoint==>"+this.currentBreakpoint)
  109 + this.currentChanged()
93 } 110 }
94 111
95 getMessageData(){ 112 getMessageData(){
@@ -119,6 +136,7 @@ export struct MinePageComponent { @@ -119,6 +136,7 @@ export struct MinePageComponent {
119 } 136 }
120 137
121 aboutToDisappear(): void { 138 aboutToDisappear(): void {
  139 + this.breakpointSystem.unregister();
122 if(this.preferences){ 140 if(this.preferences){
123 this.preferences.off('change', this.observer); 141 this.preferences.off('change', this.observer);
124 } 142 }
@@ -139,7 +157,7 @@ export struct MinePageComponent { @@ -139,7 +157,7 @@ export struct MinePageComponent {
139 Stack(){ 157 Stack(){
140 Image($r('app.media.mine_head_bg')) 158 Image($r('app.media.mine_head_bg'))
141 .width('100%') 159 .width('100%')
142 - .height('657lpx') 160 + .height(`${657 * this.percent}lpx`)
143 .objectFit(ImageFit.Auto) 161 .objectFit(ImageFit.Auto)
144 this.MinePageUI() 162 this.MinePageUI()
145 } 163 }
@@ -155,16 +173,16 @@ export struct MinePageComponent { @@ -155,16 +173,16 @@ export struct MinePageComponent {
155 @Builder MinePageUI(){ 173 @Builder MinePageUI(){
156 Column(){ 174 Column(){
157 //头像层 175 //头像层
158 - MinePageUserSimpleInfoUI({isLogin:this.isLogin}) 176 + MinePageUserSimpleInfoUI({isLogin:this.isLogin,percent:$percent})
159 //Grid 区域 177 //Grid 区域
160 - MinePagePersonFunctionUI({personalData:$personalData,isLogin:this.isLogin}) 178 + MinePagePersonFunctionUI({personalData:$personalData,isLogin:this.isLogin,percent:$percent})
161 //Card 179 //Card
162 //MinePageCardUI() 180 //MinePageCardUI()
163 //创作者区域 181 //创作者区域
164 182
165 //MinePageCreatorFunctionUI({creatorData:$creatorData}) 183 //MinePageCreatorFunctionUI({creatorData:$creatorData})
166 //更多功能 184 //更多功能
167 - MinePageMoreFunctionUI({moreData:$moreData}) 185 + MinePageMoreFunctionUI({moreData:$moreData,percent:$percent})
168 }.width('100%') 186 }.width('100%')
169 .height('100%') 187 .height('100%')
170 .justifyContent(FlexAlign.Start) 188 .justifyContent(FlexAlign.Start)
@@ -10,6 +10,7 @@ import { PeopleShipMainComponent } from '../peopleShip/PeopleShipMainComponent'; @@ -10,6 +10,7 @@ import { PeopleShipMainComponent } from '../peopleShip/PeopleShipMainComponent';
10 import { channelSkeleton } from '../skeleton/channelSkeleton'; 10 import { channelSkeleton } from '../skeleton/channelSkeleton';
11 import { TrackConstants, TrackingButton } from 'wdTracking/Index'; 11 import { TrackConstants, TrackingButton } from 'wdTracking/Index';
12 import DailyPaperTopicModel from '../../model/DailyPaperTopicModel' 12 import DailyPaperTopicModel from '../../model/DailyPaperTopicModel'
  13 +import { ParamType, Tracking } from 'wdTracking/Index';
13 14
14 const TAG = 'TopNavigationComponent'; 15 const TAG = 'TopNavigationComponent';
15 16
@@ -29,6 +30,8 @@ export struct TopNavigationComponentNew { @@ -29,6 +30,8 @@ export struct TopNavigationComponentNew {
29 * @deprecated TODO type判断 30 * @deprecated TODO type判断
30 */ 31 */
31 private currentBottomNavName: string = '' 32 private currentBottomNavName: string = ''
  33 + private pageName: string = ''
  34 + private pageId: number = 0
32 private swiperController: SwiperController = new SwiperController() 35 private swiperController: SwiperController = new SwiperController()
33 private listScroller: Scroller = new Scroller() 36 private listScroller: Scroller = new Scroller()
34 @Consume barBackgroundColor: Color 37 @Consume barBackgroundColor: Color
@@ -110,6 +113,21 @@ export struct TopNavigationComponentNew { @@ -110,6 +113,21 @@ export struct TopNavigationComponentNew {
110 }) 113 })
111 .onChange((index) => { 114 .onChange((index) => {
112 Logger.info(TAG, `onChange index : ${index}`); 115 Logger.info(TAG, `onChange index : ${index}`);
  116 +
  117 + // 顶部tab埋点
  118 + if(this.currentBottomNavName === '新闻') {
  119 + const tab = this.myChannelList[index]
  120 + Logger.info(TAG, `顶部tab : ${JSON.stringify(tab)}`);
  121 +
  122 + const params: ParamType = {
  123 + "pageName": tab.name,
  124 + "tabName": tab.name,
  125 + "pageId": tab.pageId,
  126 + }
  127 + Tracking.event("home_page_tab_click ", params)
  128 + }
  129 +
  130 +
113 if (this.isBroadcastByIndex(index)) { 131 if (this.isBroadcastByIndex(index)) {
114 // 跳转到播报页面 132 // 跳转到播报页面
115 ProcessUtils.gotoBroadcastPage(this.myChannelList[index].pageId) 133 ProcessUtils.gotoBroadcastPage(this.myChannelList[index].pageId)
@@ -166,6 +184,14 @@ export struct TopNavigationComponentNew { @@ -166,6 +184,14 @@ export struct TopNavigationComponentNew {
166 .height(30) 184 .height(30)
167 .width(124) 185 .width(124)
168 .onClick(() => { 186 .onClick(() => {
  187 +
  188 + // 早晚报埋点
  189 + const params: ParamType = {
  190 + "pageName": this.pageName,
  191 + "pageId": this.pageId,
  192 + }
  193 + Tracking.event("morning_evening_news_click", params)
  194 +
169 this.clickMorningEveningPaper() 195 this.clickMorningEveningPaper()
170 }) 196 })
171 }.width('100%') 197 }.width('100%')
@@ -8,6 +8,7 @@ import { CompUtils, TopNavigationComponentNew } from 'wdComponent/Index'; @@ -8,6 +8,7 @@ import { CompUtils, TopNavigationComponentNew } from 'wdComponent/Index';
8 import { VideoChannelPage } from './VideoChannelPage'; 8 import { VideoChannelPage } from './VideoChannelPage';
9 import ChannelViewModel from 'wdComponent/src/main/ets/viewmodel/ChannelViewModel'; 9 import ChannelViewModel from 'wdComponent/src/main/ets/viewmodel/ChannelViewModel';
10 import { ALL, ImageKnifeComponent, ImageKnifeOption, NONE } from '@ohos/imageknife'; 10 import { ALL, ImageKnifeComponent, ImageKnifeOption, NONE } from '@ohos/imageknife';
  11 +import { ParamType, Tracking } from 'wdTracking/Index';
11 12
12 const TAG = 'BottomNavigationComponent'; 13 const TAG = 'BottomNavigationComponent';
13 PersistentStorage.persistProp('channelIds', ''); 14 PersistentStorage.persistProp('channelIds', '');
@@ -157,6 +158,14 @@ export struct BottomNavigationComponent { @@ -157,6 +158,14 @@ export struct BottomNavigationComponent {
157 // .hitTestBehavior(HitTestMode.Block) 158 // .hitTestBehavior(HitTestMode.Block)
158 .onClick(() => { 159 .onClick(() => {
159 Logger.info(TAG, `onChange, index: ${index}`); 160 Logger.info(TAG, `onChange, index: ${index}`);
  161 + Logger.info(TAG, `onChange, navItem: ${JSON.stringify(navItem)}`);
  162 + // 底部bar埋点
  163 + const params: ParamType = {
  164 + "pageName": navItem.pageName,
  165 + "pageId": navItem.id,
  166 + }
  167 + Tracking.event("bar_click", params)
  168 +
160 this.onBottomNavigationIndexChange(navItem, index) 169 this.onBottomNavigationIndexChange(navItem, index)
161 }) 170 })
162 171
@@ -354,6 +363,15 @@ export struct BottomNavigationComponent { @@ -354,6 +363,15 @@ export struct BottomNavigationComponent {
354 Logger.info(TAG, `setData, bottomNav.length: ${list.length}`); 363 Logger.info(TAG, `setData, bottomNav.length: ${list.length}`);
355 // 使用filter方法移除name为'服务'的项 364 // 使用filter方法移除name为'服务'的项
356 list = list.filter(item => item.name !== '服务'); 365 list = list.filter(item => item.name !== '服务');
  366 + list.forEach(item => {
  367 + switch (item.name) {
  368 + case '新闻': item.pageName = 'NEWS'; break;
  369 + case '人民号': item.pageName = 'PEOPLE'; break;
  370 + case '视频': item.pageName = 'VIDEOS'; break;
  371 + case '我的': item.pageName = 'MY'; break;
  372 + default : item.pageName = 'NEWS'; break;
  373 + }
  374 + })
357 this.bottomNavList = list 375 this.bottomNavList = list
358 } 376 }
359 } 377 }