liyubing

feat:

1)处理首页新闻tab的顶导数据源;2)处理顶导存在电子报和播报 左右切换 回归问题
... ... @@ -116,62 +116,45 @@ export struct TopNavigationComponentNew {
if (curIndex === index) {
return
}
if (this.isBroadcastByIndex(index)) {
// 跳转到播报页面
ProcessUtils.gotoBroadcastPage(this.myChannelList[index].pageId)
let nextIndex = this.currentTopNavSelectedIndex > index ? index - 1 : index + 1
if (nextIndex < this.myChannelList.length) {
// 电子报和播报 相邻
if (this.isLayoutByIndex(nextIndex)) {
nextIndex = this.currentTopNavSelectedIndex > index ? nextIndex - 1 : nextIndex + 1
if (nextIndex < this.myChannelList.length) {
this.changePage(nextIndex)
} else {
this.changePage(curIndex)
}
} else {
this.changePage(nextIndex)
}
} else {
// 极左极右有特殊频道,用旧值
this.changePage(curIndex)
}
} else if (this.isLayoutByIndex(index)) {
// 跳转到电子报页面
ProcessUtils.gotoENewsPaper()
// 特殊频道遇到则跳转到下一个
let nextIndex = this.currentTopNavSelectedIndex > index ? index - 1 : index + 1
Logger.info(TAG, `电子报 :${nextIndex} ${this.myChannelList.length}`);
} else {
this.changePage(index)
}
})
.onAnimationEnd((index: number) => {
Logger.info(TAG, `onAnimationEnd ${index}`);
})
.onChange((index) => {
Logger.info(TAG, `onChange index : ${index}`);
if (this.isLayoutByIndex(index) || this.isBroadcastByIndex(index)) {
let nextIndex = this.currentTopNavSelectedIndex > index ? index - 1 : index + 1
if (nextIndex < this.myChannelList.length) {
// 电子报和播报 相邻
if (this.isBroadcastByIndex(nextIndex)) {
if (this.isBroadcastByIndex(nextIndex) || this.isLayoutByIndex(nextIndex)) {
nextIndex = this.currentTopNavSelectedIndex > index ? nextIndex - 1 : nextIndex + 1
if (nextIndex < this.myChannelList.length) {
this.changePage(nextIndex)
} else {
this.changePage(curIndex)
this.changePage(this.currentTopNavSelectedIndex)
}
} else {
this.changePage(nextIndex)
}
} else {
// 极左极右有特殊频道,用旧值
this.changePage(curIndex)
this.changePage(this.currentTopNavSelectedIndex)
}
} else {
this.changePage(index)
}
})
.onAnimationEnd((index: number) => {
Logger.info(TAG, `onAnimationEnd ${index}`);
})
.onChange((index) => {
Logger.info(TAG, `onChange index : ${index}`);
})
}
.width('100%')
... ...
... ... @@ -24,17 +24,17 @@ export class Tracking {
// Logger.error('yyyy','event track failed')
// })
let publicParams = new PublicParams()
publicParams.getPublicParams().then((pubParams) => {
if (params) {
for (const obj of Object.entries(params)) {
// Logger.info(TAG, ` ${obj[0]} => ` + `${obj[1]}`);
pubParams[obj[0]] = obj[1]
}
}
sensors.track(eventId, pubParams)
})
// let publicParams = new PublicParams()
// publicParams.getPublicParams().then((pubParams) => {
//
// if (params) {
// for (const obj of Object.entries(params)) {
// // Logger.info(TAG, ` ${obj[0]} => ` + `${obj[1]}`);
// pubParams[obj[0]] = obj[1]
// }
// }
// sensors.track(eventId, pubParams)
// })
}
}
... ...