wangliang_wd

Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool into main

* 'main' of http://192.168.1.42/developOne/harmonyPool:
  fix: 19038 UI还原问题-【uat】进入北京频道,头图卡,显示和android不一致,看图
  fix: 19047 UI还原问题-【生产】-兴趣卡选中打勾偏大,看图
  fix: 17931 UI还原问题-【uat】地区精选卡,上下两条线比android细,看图
  feat: 1)关闭埋点功能入口
  feat: 1)新闻tab的顶导数据  存储处理
  feat: 1)新闻tab的顶导数据  存储处理
  早晚报音频组件一多适配
  电子报优化骨架屏逻辑,折叠屏bug修改
... ... @@ -38,6 +38,7 @@ export struct CompParser {
@State pageId: string = '';
@State pageName: string = '';
@ObjectLink compDTO: CompDTO
@State nextCompDTO: CompDTO = new CompDTO
@State compIndex: number = 0;
@State private pageModel: PageModel = new PageModel();
@State audioItems: ContentDTO[] = [];
... ... @@ -83,17 +84,14 @@ export struct CompParser {
this.compDTO.operDataList[0]?.objectType !== '13') { //暂时屏蔽活动和音频详情入口
if (this.compDTO.compStyle === CompStyle.Label_03) {
LabelComponent({ compDTO: this.compDTO })
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Carousel_Layout_01) {
if (this.compDTO.operDataList.length > this.audioItems.length) {
ZhCarouselLayout01({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName })
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
}
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_01 &&
this.compDTO.imageScale === 2) { // && compDTO.name ==="横划卡"
LiveHorizontalCardComponent({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName })
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_01 && this.compDTO.imageScale === 3) {
if (this.compDTO.operDataList.length > 1) {
HorizontalStrokeCardThreeTwoRadioForMoreComponent({
... ... @@ -108,17 +106,13 @@ export struct CompParser {
pageName: this.pageName
})
}
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_02) {
ZhSingleRow02({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName })
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_03) {
ZhSingleRow03({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName })
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Grid_Layout_02) { //双列流小视频,一行两图卡 ->标题
//ZhGridLayout02({ compDTO: this.compDTO })
CompNormalTitle({ compDTO: this.compDTO })
// Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
} else if (this.compDTO.compStyle === CompStyle.Card_Comp_Zh_Grid_Layout_02) { //双列流小视频,一行两图卡
ZhGridLayout02NewsContent({
... ... @@ -130,16 +124,12 @@ export struct CompParser {
} else if (this.compDTO.compStyle === CompStyle.Zh_Grid_Layout_03) {
ZhGridLayout03({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName })
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_04) {
ZhSingleRow04({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName })
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_05) {
// ZhSingleRow05({ compDTO })
// Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_06) {
ZhSingleRow06({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName })
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_02) {
//头图卡 和comStyle 2相同,
Card5Component({
... ... @@ -149,7 +139,6 @@ export struct CompParser {
pageId: this.pageId,
pageName: this.pageName
})
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_03) {
// 大图卡
Card2Component({
... ... @@ -158,7 +147,6 @@ export struct CompParser {
pageId: this.pageId,
pageName: this.pageName
})
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
} else if (this.compDTO.compStyle === CompStyle.Card_09) {
//时间链卡
Card9Component({
... ... @@ -167,7 +155,6 @@ export struct CompParser {
pageId: this.pageId,
pageName: this.pageName
})
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
} else if (this.compDTO.compStyle === CompStyle.Card_13) {
Card6Component({
compDTO: this.compDTO,
... ... @@ -175,7 +162,6 @@ export struct CompParser {
pageId: this.pageId,
pageName: this.pageName
})
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
} else if (this.compDTO.compStyle === CompStyle.Card_03) {
Card3Component({
compDTO: this.compDTO,
... ... @@ -183,20 +169,15 @@ export struct CompParser {
pageId: this.pageId,
pageName: this.pageName
})
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_04) {
ZhSingleColumn04({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName })
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_05) {
// ZhSingleColumn05({ compDTO: compDTO })
// Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_09) {
ZhSingleColumn09({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName })
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
} else if (this.compDTO.compStyle === CompStyle.Card_Comp_Adv) { // 广告
AdvCardParser({ pageModel: this.pageModel, compDTO: this.compDTO })
//Text(`compIndex = ${compIndex}`).width('100%').fontSize('12fp').fontColor(Color.Red).padding({ left: 0, right: 0 })
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
} else if (!Number.isNaN(Number(this.compDTO.compStyle)) || this.compDTO.compType === 'appStyle') {
CardParser({
contentDTO: this.compDTO.operDataList[0],
... ... @@ -205,7 +186,6 @@ export struct CompParser {
pageName: this.pageName,
compIndex: this.compIndex
});
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
} else {
// Text(this.compDTO.compStyle)
// .width(CommonConstants.FULL_PARENT)
... ... @@ -215,9 +195,43 @@ export struct CompParser {
// WDRouterRule.jumpWithPage(WDRouterPage.QualityCommentsPage)
// }
// })
// Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 })
}
if (
this.compDTO.compStyle === CompStyle.Card_09 ||
this.compDTO.compStyle === CompStyle.Zh_Single_Column_09 ||
this.compDTO.compStyle === CompStyle.Zh_Single_Row_04 ||
this.compDTO.compStyle === CompStyle.Zh_Single_Row_06
) {
if (this.compDTO.compStyle === this.nextCompDTO.compStyle) {
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
} else {
Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 16, right: 16 })
}
} else if (this.compDTO?.operDataList?.[0]?.appStyle === CompStyle.Card_10) {
// 大专题
if (this.nextCompDTO?.operDataList?.[0]?.appStyle === CompStyle.Card_10) {
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
} else {
Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 16, right: 16 })
}
} else if (this.compDTO.compType === 'appStyle') {
if (
this.nextCompDTO.compStyle === CompStyle.Card_09 ||
this.nextCompDTO?.operDataList?.[0]?.appStyle === CompStyle.Card_10 ||
this.nextCompDTO.compStyle === CompStyle.Zh_Single_Column_09 ||
this.nextCompDTO.compStyle === CompStyle.Zh_Single_Row_04 ||
this.nextCompDTO.compStyle === CompStyle.Zh_Single_Row_06
) {
Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 16, right: 16 })
} else {
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
}
} else {
// Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
}
}
}
}
\ No newline at end of file
... ...
... ... @@ -64,13 +64,12 @@ export struct ENewspaperItemComponent {
.zIndex(15)
}
}
// this.itemPicWidth this.itemPicHeight 外层计算已减去,注掉解决骨架屏压缩变形
/*.padding({
.padding({
top: 14,
right: 10,
bottom: 14,
left: 10
})*/
})
.backgroundColor(Color.White)
.width('100%')
.onTouch((event: TouchEvent) => {
... ...
... ... @@ -145,7 +145,6 @@ export struct ENewspaperPageComponent {
let ratio = this.ratio == '100%' ? 1 : 0.5
this.picWidth = this.picWidth * ratio
this.picHeight = this.picHeight
// 默认日期
const date = new Date()
const month = date.getMonth() + 1
... ... @@ -174,13 +173,16 @@ export struct ENewspaperPageComponent {
resizeWindow() {
this.windowClass?.on('windowSizeChange', () => {
this.resize()
});
}
resize() {
this.screenWidth = this.windowClass?.getWindowProperties()?.windowRect.width || this.displayTool.width
// 2000折叠屏 TODO DeviceUtil 方法完善了换判断条件
this.ratio = this.screenWidth > 2000 ? '50%' : '100%'
let ratio = this.ratio == '100%' ? 1 : 0.5
this.picWidth = this.screenWidth - vp2px(20)
this.picWidth = this.picWidth * ratio
});
}
build() {
... ... @@ -257,10 +259,10 @@ export struct ENewspaperPageComponent {
middle: { anchor: "__container__", align: HorizontalAlign.Center }
})
.id('news_skeleton_id')
.width('100%')
.height(px2vp(this.picHeight) + 32)
.width(px2vp(this.picWidth))
.height(px2vp(this.picHeight))
.margin({ top: 59, left: 10, right: 10 })
.padding({ right: 10, left: 10 })
// .padding({ right: 10, left: 10 })
}
if (this.newspaperListBean && this.newspaperListBean.list && this.newspaperListBean.list.length > 0) {
... ... @@ -448,8 +450,7 @@ export struct ENewspaperPageComponent {
private async getNewspaperList() {
// ENewspaperItemComponent .padding({ top:14, right: 10, bottom: 14, left: 10 })
// 计算图片的内容宽高
let ratio = this.ratio == '100%' ? 1 : 0.5
this.itemPicWidth = this.picWidth * ratio - vp2px(20)
this.itemPicWidth = this.picWidth - vp2px(20)
this.itemPicHeight = this.picHeight - vp2px(28)
try {
if (NetworkUtil.isNetConnected()) {
... ...
... ... @@ -276,7 +276,7 @@ export struct MorningEveningPaperComponent {
this.AudioBarView()
}
.margin({
top: this.isHasTopView ? 10 : 44+this.topSafeHeight
top: this.isHasTopView ? 10 : 44 + this.topSafeHeight
})
}
... ... @@ -329,8 +329,8 @@ export struct MorningEveningPaperComponent {
Stack({ alignContent: Alignment.Start }) {
Image($r('app.media.listen_left_bg'))
.width('100%')
.height('100%')
.objectFit(ImageFit.Contain)
// .height('100%')
.objectFit(ImageFit.Fill)
Image($r('app.media.icon_listen'))
.width(20)
.height(20)
... ...
... ... @@ -54,7 +54,8 @@ export struct Card5Component {
bottomRight: $r('app.float.image_border_radius')
}
)
.aspectRatio(343 / 225)
// .aspectRatio(343 / 225)
.autoResize(true)
if (!!this.titleShowPolicy || this.titleShowPolicy === null ) {
Row()
.borderRadius(
... ...
... ... @@ -138,8 +138,8 @@ export struct ZhSingleColumn09 {
.textAlign(TextAlign.Center)
.fontColor(0xffffff)
Image($r('app.media.icon_selected'))
.width(19)
.height(19)
.width(14)
.height(14)
.opacity(this.activeIndexs.includes(index) ? 1 : 0)
.objectFit(ImageFit.Contain)
}
... ...
import { TopNavDTO } from 'wdBean';
import curves from '@ohos.curves';
import { Logger } from 'wdKit/Index';
import { Logger, SPHelper } from 'wdKit/Index';
import { SpConstants } from 'wdConstant/Index';
const INDEX_SETTING_TITLE: string = '首页设置'
const INDEX_SETTING_SUBTITLE: string = '将指定频道设置为首页'
... ... @@ -43,7 +44,6 @@ struct ChannelSubscriptionLayout {
@State isEditIng: boolean = false
// 顶部导航栏是否有临时跳转频道数据不
@Prop haveTempTabData: boolean
changeTab: (index: number) => void = () => {
}
... ... @@ -67,9 +67,14 @@ struct ChannelSubscriptionLayout {
delChannelItem(index: number) {
let item = this.myChannelList.splice(index, 1)[0]
this.channelIds.splice(index, 1)
// this.channelIds.splice(index, 1)
AppStorage.setOrCreate('channelIds', this.channelIds.join(','))
// 本地频道特殊处理
let provinceName = SPHelper.default.getSync(SpConstants.LOCATION_PROVINCE_NAME, '') as string
if (provinceName && provinceName.includes(item.name) && item.localChannel == '0') {
item.localChannel = '1'
}
/*
删除的频道信息回到原栏目中去
*/
... ... @@ -130,8 +135,8 @@ struct ChannelSubscriptionLayout {
this.myChannelList.push(item)
AppStorage.setOrCreate('channelIds', this.channelIds.join(','))
let storageChannelIds: string = AppStorage.get<string>('channelIds') || ''
console.debug('TopNavigationComponent', 'addChannelItem==>' + storageChannelIds)
// let storageChannelIds: string = AppStorage.get<string>('channelIds') || ''
// console.debug('TopNavigationComponent', 'addChannelItem==>' + storageChannelIds)
}
itemMove(index: number, newIndex: number): void {
... ... @@ -570,7 +575,7 @@ struct ChannelSubscriptionLayout {
.backgroundColor(Color.White)
.onClick(() => {
this.isShow = true
if(this.haveTempTabData){
if (this.haveTempTabData) {
// 存储数据
AppStorage.setOrCreate('channelIds', this.channelIds.join(','))
this.haveTempTabData = false
... ... @@ -578,18 +583,23 @@ struct ChannelSubscriptionLayout {
})
.bindContentCover(this.isShow, this.sheetBuilder(), {
modalTransition: ModalTransition.DEFAULT,
onWillAppear: () => {console.log("BindContentCover onWillAppear.")},
onAppear: () => {console.log("BindContentCover onAppear.")},
onWillDisappear: () => {console.log("BindContentCover onWillDisappear.")
onWillAppear: () => {
console.log("BindContentCover onWillAppear.")
},
onAppear: () => {
console.log("BindContentCover onAppear.")
},
onWillDisappear: () => {
console.log("BindContentCover onWillDisappear.")
this.isShow = false
this.isEditIng = false},
onDisappear: () => {console.log("BindContentCover onDisappear.")
this.isEditIng = false
},
onDisappear: () => {
console.log("BindContentCover onDisappear.")
}
})
}
/**
* 改变我的频道栏目中频道id数据
*/
... ...
... ... @@ -95,7 +95,15 @@ export struct PageComponent {
LazyForEach(this.pageModel.compList, (compDTO: CompDTO, compIndex: number) => {
ListItem() {
Column() {
CompParser({ pageModel: this.pageModel, compDTO: compDTO, compIndex: compIndex, pageId: this.pageId });
CompParser(
{
pageModel: this.pageModel,
nextCompDTO: compIndex === this.pageModel.compList.getDataArray().length - 1 ? new CompDTO() : this.pageModel.compList.get(compIndex + 1) as CompDTO,
compDTO: compDTO,
compIndex: compIndex,
pageId: this.pageId
}
);
}
}
},
... ...
import { BottomNavDTO, TopNavDTO } from 'wdBean';
import { SpConstants } from 'wdConstant';
import { BottomNavDTO, NavigationDetailDTO, TopNavDTO } from 'wdBean';
import { Logger, NetworkUtil, SPHelper, ToastUtils } from 'wdKit';
import { ProcessUtils, WDRouterPage, WDRouterRule } from 'wdRouter';
import { PageComponent } from './PageComponent';
... ... @@ -422,7 +421,6 @@ export struct TopNavigationComponentNew {
async aboutToAppear() {
if (CompUtils.isNews(this.navItem)) {
// 请求顶导网络数据
... ... @@ -619,20 +617,51 @@ export struct TopNavigationComponentNew {
//请求顶导数据
async getTopNavList(id: number) {
Logger.debug(TAG, 'getTopNavList=存储=>' + this.storageChannelIds)
// 1 、使用存储数据
let bottomDetailCache = await ChannelViewModel.getBottomNavDetailCacheData(id)
if (bottomDetailCache != null && bottomDetailCache.topNavChannelList.length > 0) {
Logger.debug(TAG, '使用缓存数据')
this.processTopNewsTapData(bottomDetailCache, false)
}
// 2、请求网络数据
let bottomNavDetail = await ChannelViewModel.getBottomNavDetailData(id, this.storageChannelIds)
if (bottomNavDetail != null) {
// 3、 接口数据md5和存储数据md5对比,一致不更新
if (bottomNavDetail.md5 == bottomDetailCache?.md5) {
Logger.debug(TAG, '不使用接口数据')
} else {
Logger.debug(TAG, '使用接口数据')
this.processTopNewsTapData(bottomNavDetail, true)
//存储
ChannelViewModel.saveBottomDetailData(bottomNavDetail)
}
}
}
/**
* 加工新闻tab 顶导数据
* @param bottomNavDetail
*/
private processTopNewsTapData(bottomNavDetail: NavigationDetailDTO, isNetData: boolean) {
let topNavList = bottomNavDetail?.topNavChannelList || []
//let provinceName = SPHelper.default.getSync(SpConstants.LOCATION_PROVINCE_NAME, '') as string
let _myChannelList: TopNavDTO [] = []
this.homeChannelList = []
this.moreChannelList = []
this.localChannelList = []
topNavList.forEach(item => {
if (item.defaultPermitted === 1) {
console.debug('TopNavigationComponent', '--homeChannelList--->' + item.name)
this.homeChannelList.push(item)
}
//TODO 暂时隐藏播报
if (item.name !== '播报') {
if (item.myChannel === '1') {
... ... @@ -645,6 +674,33 @@ export struct TopNavigationComponentNew {
}
})
//根据缓存数组排序
if (this.storageChannelIds && !isNetData) {
Logger.debug(TAG, '根据存储内容')
let sortedyChannelList: TopNavDTO [] = []
let _storageChannelIds = this.storageChannelIds.split(',')
_storageChannelIds.forEach((channelId) => {
for (let a of _myChannelList) {
if (channelId == String(a.channelId)) {
let startIndex = _myChannelList.findIndex(b => b.channelId == a.channelId)
_myChannelList.splice(startIndex, 1)
sortedyChannelList.push(a)
break;
}
}
})
// 依据存储的我的频道中频道id集合,过滤出符合条件频道,剩余的频道,针对本地频道处理,每次删除,再次进入存储的频道详情信息里面我的频道栏目的信息集合都有本地频道
if (_myChannelList.length > 0) {
_myChannelList.forEach((localChannelBean) => {
localChannelBean.localChannel = '1'
})
this.localChannelList.unshift(..._myChannelList)
}
_myChannelList = sortedyChannelList
}
this.myChannelList = _myChannelList
//缓存首页频道
... ... @@ -653,7 +709,9 @@ export struct TopNavigationComponentNew {
this.currentTopNavSelectedIndex = index
}
if (isNetData) {
// 存储我的频道栏目中的频道id信息
Logger.debug(TAG, '存储我的频道栏目数据')
let channelIds: number [] = []
this.myChannelList.forEach(item => {
if (item != undefined && item.channelId != undefined) {
... ... @@ -662,4 +720,6 @@ export struct TopNavigationComponentNew {
})
AppStorage.setOrCreate('channelIds', channelIds.join(','))
}
}
}
\ No newline at end of file
... ...
... ... @@ -123,6 +123,7 @@ export default struct TemplatePageComponent {
CompParser({
compDTO: compDTO,
nextCompDTO: index === this.templatePage.compList.getDataArray().length - 1 ? new CompDTO() : this.templatePage.compList.get(index + 1) as CompDTO,
compIndex: index,
pageId: this.pageId,
pageName: this.pageName
... ...
... ... @@ -15,35 +15,39 @@ export struct newsSkeleton {
Row() {
Column() {
Image($r('app.media.peopleSeleton'))
.width(120.89)
.height(46.98)// 后缀名不能省略
.width('100%')
.height(47)// 后缀名不能省略
.interpolation(ImageInterpolation.High)
.margin({
bottom: 6
})
textArea('100%', 8)
}
.margin({
right: 5
right: '2%'
})
.width(120.89)
.width(`76%`)
.alignItems(HorizontalAlign.Start)
Column() {
Row()
.width(`16.5%`)
.width(`100%`)
.height(25)
.backgroundColor('#FFF5F5F5')
Row()
.width(`16.5%`)
.width(`100%`)
.height(4)
.backgroundColor('#FFF5F5F5')
.margin({ top: 3, bottom: 3 })
Row()
.width(`16.5%`)
.width(`100%`)
.height(20)
.backgroundColor('#FFF5F5F5')
// textArea(27, 25)
// textArea(27, 4)
// textArea(27, 20)
}
.width(`22%`)
.border({ width: 1 })
.borderColor('#FFF5F5F5')
.padding({
... ... @@ -119,6 +123,7 @@ export struct newsSkeleton {
.width('100%')
}
.height('100%')
.width('100%')
}
}
... ...
... ... @@ -192,11 +192,11 @@ export class PageRepository {
/**
* 早晚报pageInfo请求
* */
static getMorningEveningPageInfoUrl(pageId: string,topicId:string) {
static getMorningEveningPageInfoUrl(pageId: string, topicId: string) {
let url = HttpUrlUtils.getHost() + HttpUrlUtils.PAGE_INFO_PATH;
url = url + "?pageId=" + pageId;
if(!StringUtils.isEmpty(topicId)){
url = url+ "&topicId=" + topicId;
if (!StringUtils.isEmpty(topicId)) {
url = url + "&topicId=" + topicId;
}
Logger.info(TAG, "getMorningEveningPageInfoUrl url = " + url)
return url;
... ... @@ -237,10 +237,11 @@ export class PageRepository {
static fetchNavigationDetailDataApi(id: number = 210, myChannelIds?: string) {
let url = PageRepository.getBottomNavGroupDetailUrl() + `?id=${id}`;
// 310000 310100 310115120
let provinceCode = HttpUtils.getProvinceCode()
if (provinceCode) {
url = url + "&districtCode=" + HttpUtils.getDistrictCode()
+ "&provinceCode=" + HttpUtils.getProvinceCode()
+ "&provinceCode=" + provinceCode
+ "&cityCode=" + HttpUtils.getCityCode()
}
if (myChannelIds) {
... ... @@ -395,8 +396,8 @@ export class PageRepository {
/**
* 获取早晚报pageInfo
* */
static fetchMorningEveningPageInfo(pageId: string,topicId:string) {
let url = PageRepository.getMorningEveningPageInfoUrl(pageId,topicId)
static fetchMorningEveningPageInfo(pageId: string, topicId: string) {
let url = PageRepository.getMorningEveningPageInfoUrl(pageId, topicId)
return WDHttp.get<ResponseDTO<PageInfoBean>>(url)
};
... ... @@ -421,7 +422,7 @@ export class PageRepository {
* 获取播报pageInfo
* */
static fetchBroadcastPageInfo(pageId: string) {
let url = PageRepository.getMorningEveningPageInfoUrl(pageId,'')
let url = PageRepository.getMorningEveningPageInfoUrl(pageId, '')
return WDHttp.get<ResponseDTO<PageInfoBean>>(url)
};
... ...
... ... @@ -58,7 +58,7 @@ export class ChannelViewModel {
}
/**
* 保存导详情数据到缓存
* 保存顶部导详情数据到缓存
*/
saveBottomDetailData(data: NavigationDetailDTO) {
CacheData.saveCacheData(CacheData.channelCacheDataKey + data?.id, data, data.md5)
... ... @@ -75,7 +75,7 @@ export class ChannelViewModel {
/**
* 获取底导详情(顶导)接口数据
*/
async getBottomNavDetailData(id: number, myChannelIds?: string): Promise<NavigationDetailDTO> {
async getBottomNavDetailData(id: number, myChannelIds?: string): Promise<NavigationDetailDTO|null> {
Logger.info(TAG, `getBottomNavDetailData start`);
return this.getNavDetailData(id,myChannelIds);
}
... ... @@ -111,18 +111,18 @@ export class ChannelViewModel {
* @param myChannelIds
* @returns
*/
private getNavDetailData(id: number, myChannelIds?: string): Promise<NavigationDetailDTO> {
return new Promise<NavigationDetailDTO>((success, error) => {
private getNavDetailData(id: number, myChannelIds?: string): Promise<NavigationDetailDTO|null> {
return new Promise<NavigationDetailDTO|null>((success, error) => {
Logger.info(TAG, `getNavData start`);
PageRepository.fetchNavigationDetailDataApi(id,myChannelIds).then((navResDTO: ResponseDTO<NavigationDetailDTO>) => {
if (!navResDTO || !navResDTO.data) {
Logger.error(TAG, 'getNavData then navResDTO is empty');
error('navResDTO is empty');
success(null);
return
}
if (navResDTO.code != 0) {
Logger.error(TAG, `getNavData then code:${navResDTO.code}, message:${navResDTO.message}`);
error('navResDTO Response Code is failure');
success(null);
return
}
// let navResStr = JSON.stringify(navResDTO);
... ... @@ -131,7 +131,7 @@ export class ChannelViewModel {
success(navResDTO.data);
}).catch((err: Error) => {
Logger.error(TAG, `fetchNavigationDataApi catch, error.name : ${err.name}, error.message:${err.message}`);
error(err);
success(null);
})
})
}
... ...
... ... @@ -77,9 +77,9 @@ export class PageHelper {
* 进页面请求数据
*/
async getInitCacheData(pageModel: PageModel, pageAdvModel: PageAdModel) {
Logger.debug(TAG, 'getInitCacheData')
// Logger.debug(TAG, 'getInitCacheData')
PageViewModel.getPageInfoCache(pageModel.pageId).then(pageInfo => {
Logger.debug(TAG, 'getInitCacheData back: ' + pageInfo)
// Logger.debug(TAG, 'getInitCacheData back: ' + pageInfo)
if (pageInfo == null) {
return;
}
... ... @@ -125,9 +125,9 @@ export class PageHelper {
this.refreshUIEnd(pageModel, false)
})
} else {
Logger.debug(TAG, 'getPageInfo')
// Logger.debug(TAG, 'getPageInfo')
PageViewModel.getPageInfo(pageModel.pageId).then(pageInfo => {
Logger.debug(TAG, 'getPageInfo back: ' + JSON.stringify(pageInfo))
// Logger.debug(TAG, 'getPageInfo back: ' + JSON.stringify(pageInfo))
if (pageInfo == null) {
pageModel.viewType = ViewType.EMPTY;
pageModel.emptyType = WDViewDefaultType.WDViewDefaultType_NoContent1;
... ... @@ -137,9 +137,9 @@ export class PageHelper {
pageModel.pageInfo = pageInfo;
if (pageInfo.md5 == pageModel.displayPageInfoMd5) {
// 缓存一致,不解析
Logger.debug(TAG, 'getPageInfo 与缓存一致,不解析广告。。。')
// Logger.debug(TAG, 'getPageInfo 与缓存一致,不解析广告。。。')
} else {
Logger.debug(TAG, 'getPageInfo 要解析广告')
// Logger.debug(TAG, 'getPageInfo 要解析广告')
if (pageModel.currentPage == 1) {
// 保存缓存
CacheData.saveCacheData(CacheData.comPageInfoCacheKey + pageModel.pageId, pageInfo, pageInfo.md5)
... ... @@ -148,7 +148,7 @@ export class PageHelper {
//解析页面挂角广告资源
pageAdvModel.analysisAdvSource(pageInfo);
}
Logger.debug(TAG, 'getPageInfo go on')
// Logger.debug(TAG, 'getPageInfo go on')
this.parseGroup(pageModel, false)
}).catch(() => {
this.refreshUIEnd(pageModel, false)
... ... @@ -190,14 +190,14 @@ export class PageHelper {
//Logger.error("ZZZXXXXX", '楼层id-start--》' + pageModel.groupId);
let pageDto: PageDTO
Logger.debug(TAG, 'parseGroup isCache: ' + isCache)
//Logger.debug(TAG, 'parseGroup isCache: ' + isCache)
if (isCache) {
pageDto = await PageViewModel.getPageGroupCacheData(pageModel.bizCopy()) as PageDTO
pageModel.displayGroupInfoMd5 = pageDto.md5
} else {
pageDto = await PageViewModel.getPageGroupCompData(pageModel.bizCopy()) as PageDTO
if (pageDto.md5 == pageModel.displayGroupInfoMd5) {
Logger.debug(TAG, 'parseGroup cache load, return: ' + pageDto.md5)
// Logger.debug(TAG, 'parseGroup cache load, return: ' + pageDto.md5)
// 下拉刷新场景,数据没变,拦截刷新UI,重置相关参数
if (pageModel.loadStrategy === 2) {
// 缓存数据一致,不再刷新
... ... @@ -211,17 +211,17 @@ export class PageHelper {
return
}
pageModel.displayGroupInfoMd5 = pageDto.md5
Logger.debug(TAG, 'parseGroup cache load, save: ' + pageDto.md5)
// Logger.debug(TAG, 'parseGroup cache load, save: ' + pageDto.md5)
// 保存缓存
CacheData.saveCacheData(CacheData.compGroupInfoDataCacheKey + pageModel.pageId + pageModel.groupId, pageDto,
pageDto.md5)
}
Logger.debug(TAG, 'parseGroup go on')
// Logger.debug(TAG, 'parseGroup go on')
// await,确保groups接口顺序执行
// let pageDto = page
let index = pageInfo.groups.indexOf(group)
Logger.debug(TAG, 'yyyy parseGroup print')
// Logger.debug(TAG, 'yyyy parseGroup print')
this.printComp(pageDto)
// 解析楼层组件
this.analysisPageGroupCompData(pageDto, pageInfo)
... ... @@ -268,7 +268,7 @@ export class PageHelper {
if (pageModel.compList.isEmpty()) {
// 没数据,展示空页面
Logger.debug(TAG, 'aboutToAppear, data response page ' + pageModel.pageId + ', comp list is empty.');
//Logger.debug(TAG, 'aboutToAppear, data response page ' + pageModel.pageId + ', comp list is empty.');
pageModel.viewType = ViewType.EMPTY;
pageModel.emptyType = WDViewDefaultType.WDViewDefaultType_NoContent1;
... ... @@ -296,7 +296,7 @@ export class PageHelper {
pageInfo.pageAdList.push(...pageDto.compAdList)
}
// TODO 待删除
Logger.debug(TAG, 'yyyy analysisPageGroupCompData size, '+pageInfo?.oneRequestPageGroupCompList?.length)
// Logger.debug(TAG, 'yyyy analysisPageGroupCompData size, '+pageInfo?.oneRequestPageGroupCompList?.length)
}
}
... ... @@ -343,7 +343,7 @@ export class PageHelper {
pageModel.currentPage++;
pageModel.hasMore = true;
Logger.debug(TAG, 'yyyy compLoadMore print')
// Logger.debug(TAG, 'yyyy compLoadMore print')
this.printComp(data)
//移除音频 和 活动
this.loadMorePageComp(pageModel, data)
... ... @@ -372,7 +372,7 @@ export class PageHelper {
pageModel.pageInfo.oneRequestPageGroupCompList.add(comp)
})
// TODO 待删除
Logger.debug(TAG, 'yyyy loadMorePageComp size, ' + pageModel.pageInfo.oneRequestPageGroupCompList?.length)
// Logger.debug(TAG, 'yyyy loadMorePageComp size, ' + pageModel.pageInfo.oneRequestPageGroupCompList?.length)
// 记录
pageModel.pageTotalCompSize = pageCompList.length + pageModel.pageTotalCompSize
... ... @@ -398,7 +398,7 @@ export class PageHelper {
let contentInfo: ContentDTO = CollectionUtils.getElement(element.operDataList, 0);
//移除音频 和 活动
if (contentInfo && (contentInfo.objectType === '13' || contentInfo.objectType === '3')) {
Logger.debug(TAG, 'getGroupData 移除音频 和 活动');
//Logger.debug(TAG, 'getGroupData 移除音频 和 活动');
} else {
// 暂时屏蔽活动和音频详情入口
if (element.operDataList[0]?.objectType === '3' || element.operDataList[0]?.objectType === '13') {
... ... @@ -843,7 +843,7 @@ export class PageHelper {
* 删除分页数据,保留第一页的数据。(下拉刷新场景用到)
*/
deleteMorePage(pageModel: PageModel) {
Logger.debug(TAG, 'deleteMorePage endindex: ' + pageModel.firstPageEndIndex)
//Logger.debug(TAG, 'deleteMorePage endindex: ' + pageModel.firstPageEndIndex)
if (pageModel.firstPageEndIndex < 0) {
return
}
... ... @@ -855,7 +855,7 @@ export class PageHelper {
* 临时打印comp相关信息,用于问题定位。TODO 待删除
*/
private printComp(pageDto: PageDTO) {
Logger.debug(TAG, 'yyyy printComp pageDto.compList.size: ' + pageDto?.compList?.length)
//Logger.debug(TAG, 'yyyy printComp pageDto.compList.size: ' + pageDto?.compList?.length)
new Promise<void>(() => {
let tmpCompList: CompDTO[] = Array.from(pageDto.compList)
tmpCompList.forEach((v, k) => {
... ... @@ -863,10 +863,10 @@ export class PageHelper {
Logger.warn(TAG, 'yyyy printComp comp forEach, ' + v.compStyle)
v.operDataList.forEach((cv, ci) => {
if (cv) {
Logger.debug(TAG, 'yyyy printComp ContentDTO print, ' + v.compStyle)
Logger.debug(TAG, 'yyyy printComp ContentDTO xxxx newsTitle, ' + cv.newsTitle)
// Logger.debug(TAG, 'yyyy printComp ContentDTO print, ' + v.compStyle)
// Logger.debug(TAG, 'yyyy printComp ContentDTO xxxx newsTitle, ' + cv.newsTitle)
} else {
Logger.warn(TAG, 'yyyy printComp ContentDTO is null, ' + v.compStyle)
// Logger.warn(TAG, 'yyyy printComp ContentDTO is null, ' + v.compStyle)
}
})
} else {
... ...
... ... @@ -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)
// })
}
}
... ...