liyubing

feat:

1)处理首页新闻tab的顶导数据源;2)处理顶导存在电子报和播报 左右切换 回归问题
@@ -116,62 +116,45 @@ export struct TopNavigationComponentNew { @@ -116,62 +116,45 @@ export struct TopNavigationComponentNew {
116 if (curIndex === index) { 116 if (curIndex === index) {
117 return 117 return
118 } 118 }
  119 +
119 if (this.isBroadcastByIndex(index)) { 120 if (this.isBroadcastByIndex(index)) {
120 // 跳转到播报页面 121 // 跳转到播报页面
121 ProcessUtils.gotoBroadcastPage(this.myChannelList[index].pageId) 122 ProcessUtils.gotoBroadcastPage(this.myChannelList[index].pageId)
122 - let nextIndex = this.currentTopNavSelectedIndex > index ? index - 1 : index + 1  
123 - if (nextIndex < this.myChannelList.length) {  
124 - // 电子报和播报 相邻  
125 - if (this.isLayoutByIndex(nextIndex)) {  
126 - nextIndex = this.currentTopNavSelectedIndex > index ? nextIndex - 1 : nextIndex + 1  
127 - if (nextIndex < this.myChannelList.length) {  
128 - this.changePage(nextIndex)  
129 - } else {  
130 - this.changePage(curIndex)  
131 - }  
132 123
133 - } else {  
134 - this.changePage(nextIndex)  
135 - }  
136 - } else {  
137 - // 极左极右有特殊频道,用旧值  
138 - this.changePage(curIndex)  
139 - }  
140 } else if (this.isLayoutByIndex(index)) { 124 } else if (this.isLayoutByIndex(index)) {
141 // 跳转到电子报页面 125 // 跳转到电子报页面
142 ProcessUtils.gotoENewsPaper() 126 ProcessUtils.gotoENewsPaper()
143 - // 特殊频道遇到则跳转到下一个  
144 - let nextIndex = this.currentTopNavSelectedIndex > index ? index - 1 : index + 1  
145 127
146 - Logger.info(TAG, `电子报 :${nextIndex} ${this.myChannelList.length}`); 128 + } else {
  129 + this.changePage(index)
  130 + }
  131 + })
  132 + .onAnimationEnd((index: number) => {
  133 + Logger.info(TAG, `onAnimationEnd ${index}`);
  134 + })
  135 + .onChange((index) => {
  136 + Logger.info(TAG, `onChange index : ${index}`);
  137 + if (this.isLayoutByIndex(index) || this.isBroadcastByIndex(index)) {
  138 + let nextIndex = this.currentTopNavSelectedIndex > index ? index - 1 : index + 1
147 if (nextIndex < this.myChannelList.length) { 139 if (nextIndex < this.myChannelList.length) {
148 -  
149 // 电子报和播报 相邻 140 // 电子报和播报 相邻
150 - if (this.isBroadcastByIndex(nextIndex)) { 141 + if (this.isBroadcastByIndex(nextIndex) || this.isLayoutByIndex(nextIndex)) {
151 nextIndex = this.currentTopNavSelectedIndex > index ? nextIndex - 1 : nextIndex + 1 142 nextIndex = this.currentTopNavSelectedIndex > index ? nextIndex - 1 : nextIndex + 1
152 if (nextIndex < this.myChannelList.length) { 143 if (nextIndex < this.myChannelList.length) {
153 this.changePage(nextIndex) 144 this.changePage(nextIndex)
154 } else { 145 } else {
155 - this.changePage(curIndex) 146 + this.changePage(this.currentTopNavSelectedIndex)
156 } 147 }
157 148
158 } else { 149 } else {
159 this.changePage(nextIndex) 150 this.changePage(nextIndex)
160 } 151 }
161 -  
162 } else { 152 } else {
163 // 极左极右有特殊频道,用旧值 153 // 极左极右有特殊频道,用旧值
164 - this.changePage(curIndex) 154 + this.changePage(this.currentTopNavSelectedIndex)
165 } 155 }
166 - } else {  
167 - this.changePage(index)  
168 } 156 }
169 - })  
170 - .onAnimationEnd((index: number) => {  
171 - Logger.info(TAG, `onAnimationEnd ${index}`);  
172 - })  
173 - .onChange((index) => {  
174 - Logger.info(TAG, `onChange index : ${index}`); 157 +
175 }) 158 })
176 } 159 }
177 .width('100%') 160 .width('100%')
@@ -24,17 +24,17 @@ export class Tracking { @@ -24,17 +24,17 @@ export class Tracking {
24 // Logger.error('yyyy','event track failed') 24 // Logger.error('yyyy','event track failed')
25 // }) 25 // })
26 26
27 - let publicParams = new PublicParams()  
28 - publicParams.getPublicParams().then((pubParams) => {  
29 -  
30 - if (params) {  
31 - for (const obj of Object.entries(params)) {  
32 - // Logger.info(TAG, ` ${obj[0]} => ` + `${obj[1]}`);  
33 - pubParams[obj[0]] = obj[1]  
34 - }  
35 - }  
36 - sensors.track(eventId, pubParams)  
37 - }) 27 + // let publicParams = new PublicParams()
  28 + // publicParams.getPublicParams().then((pubParams) => {
  29 + //
  30 + // if (params) {
  31 + // for (const obj of Object.entries(params)) {
  32 + // // Logger.info(TAG, ` ${obj[0]} => ` + `${obj[1]}`);
  33 + // pubParams[obj[0]] = obj[1]
  34 + // }
  35 + // }
  36 + // sensors.track(eventId, pubParams)
  37 + // })
38 } 38 }
39 } 39 }
40 40