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 { @@ -38,6 +38,7 @@ export struct CompParser {
38 @State pageId: string = ''; 38 @State pageId: string = '';
39 @State pageName: string = ''; 39 @State pageName: string = '';
40 @ObjectLink compDTO: CompDTO 40 @ObjectLink compDTO: CompDTO
  41 + @State nextCompDTO: CompDTO = new CompDTO
41 @State compIndex: number = 0; 42 @State compIndex: number = 0;
42 @State private pageModel: PageModel = new PageModel(); 43 @State private pageModel: PageModel = new PageModel();
43 @State audioItems: ContentDTO[] = []; 44 @State audioItems: ContentDTO[] = [];
@@ -83,17 +84,14 @@ export struct CompParser { @@ -83,17 +84,14 @@ export struct CompParser {
83 this.compDTO.operDataList[0]?.objectType !== '13') { //暂时屏蔽活动和音频详情入口 84 this.compDTO.operDataList[0]?.objectType !== '13') { //暂时屏蔽活动和音频详情入口
84 if (this.compDTO.compStyle === CompStyle.Label_03) { 85 if (this.compDTO.compStyle === CompStyle.Label_03) {
85 LabelComponent({ compDTO: this.compDTO }) 86 LabelComponent({ compDTO: this.compDTO })
86 - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })  
87 } else if (this.compDTO.compStyle === CompStyle.Zh_Carousel_Layout_01) { 87 } else if (this.compDTO.compStyle === CompStyle.Zh_Carousel_Layout_01) {
88 if (this.compDTO.operDataList.length > this.audioItems.length) { 88 if (this.compDTO.operDataList.length > this.audioItems.length) {
89 ZhCarouselLayout01({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName }) 89 ZhCarouselLayout01({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName })
90 - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })  
91 } 90 }
92 } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_01 && 91 } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_01 &&
93 this.compDTO.imageScale === 2) { // && compDTO.name ==="横划卡" 92 this.compDTO.imageScale === 2) { // && compDTO.name ==="横划卡"
94 93
95 LiveHorizontalCardComponent({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName }) 94 LiveHorizontalCardComponent({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName })
96 - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })  
97 } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_01 && this.compDTO.imageScale === 3) { 95 } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_01 && this.compDTO.imageScale === 3) {
98 if (this.compDTO.operDataList.length > 1) { 96 if (this.compDTO.operDataList.length > 1) {
99 HorizontalStrokeCardThreeTwoRadioForMoreComponent({ 97 HorizontalStrokeCardThreeTwoRadioForMoreComponent({
@@ -108,17 +106,13 @@ export struct CompParser { @@ -108,17 +106,13 @@ export struct CompParser {
108 pageName: this.pageName 106 pageName: this.pageName
109 }) 107 })
110 } 108 }
111 - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })  
112 } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_02) { 109 } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_02) {
113 ZhSingleRow02({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName }) 110 ZhSingleRow02({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName })
114 - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })  
115 } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_03) { 111 } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_03) {
116 ZhSingleRow03({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName }) 112 ZhSingleRow03({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName })
117 - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })  
118 } else if (this.compDTO.compStyle === CompStyle.Zh_Grid_Layout_02) { //双列流小视频,一行两图卡 ->标题 113 } else if (this.compDTO.compStyle === CompStyle.Zh_Grid_Layout_02) { //双列流小视频,一行两图卡 ->标题
119 //ZhGridLayout02({ compDTO: this.compDTO }) 114 //ZhGridLayout02({ compDTO: this.compDTO })
120 CompNormalTitle({ compDTO: this.compDTO }) 115 CompNormalTitle({ compDTO: this.compDTO })
121 - // Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })  
122 } else if (this.compDTO.compStyle === CompStyle.Card_Comp_Zh_Grid_Layout_02) { //双列流小视频,一行两图卡 116 } else if (this.compDTO.compStyle === CompStyle.Card_Comp_Zh_Grid_Layout_02) { //双列流小视频,一行两图卡
123 117
124 ZhGridLayout02NewsContent({ 118 ZhGridLayout02NewsContent({
@@ -130,16 +124,12 @@ export struct CompParser { @@ -130,16 +124,12 @@ export struct CompParser {
130 124
131 } else if (this.compDTO.compStyle === CompStyle.Zh_Grid_Layout_03) { 125 } else if (this.compDTO.compStyle === CompStyle.Zh_Grid_Layout_03) {
132 ZhGridLayout03({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName }) 126 ZhGridLayout03({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName })
133 - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })  
134 } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_04) { 127 } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_04) {
135 ZhSingleRow04({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName }) 128 ZhSingleRow04({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName })
136 - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })  
137 } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_05) { 129 } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_05) {
138 // ZhSingleRow05({ compDTO }) 130 // ZhSingleRow05({ compDTO })
139 - // Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })  
140 } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_06) { 131 } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_06) {
141 ZhSingleRow06({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName }) 132 ZhSingleRow06({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName })
142 - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })  
143 } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_02) { 133 } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_02) {
144 //头图卡 和comStyle 2相同, 134 //头图卡 和comStyle 2相同,
145 Card5Component({ 135 Card5Component({
@@ -149,7 +139,6 @@ export struct CompParser { @@ -149,7 +139,6 @@ export struct CompParser {
149 pageId: this.pageId, 139 pageId: this.pageId,
150 pageName: this.pageName 140 pageName: this.pageName
151 }) 141 })
152 - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })  
153 } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_03) { 142 } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_03) {
154 // 大图卡 143 // 大图卡
155 Card2Component({ 144 Card2Component({
@@ -158,7 +147,6 @@ export struct CompParser { @@ -158,7 +147,6 @@ export struct CompParser {
158 pageId: this.pageId, 147 pageId: this.pageId,
159 pageName: this.pageName 148 pageName: this.pageName
160 }) 149 })
161 - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })  
162 } else if (this.compDTO.compStyle === CompStyle.Card_09) { 150 } else if (this.compDTO.compStyle === CompStyle.Card_09) {
163 //时间链卡 151 //时间链卡
164 Card9Component({ 152 Card9Component({
@@ -167,7 +155,6 @@ export struct CompParser { @@ -167,7 +155,6 @@ export struct CompParser {
167 pageId: this.pageId, 155 pageId: this.pageId,
168 pageName: this.pageName 156 pageName: this.pageName
169 }) 157 })
170 - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })  
171 } else if (this.compDTO.compStyle === CompStyle.Card_13) { 158 } else if (this.compDTO.compStyle === CompStyle.Card_13) {
172 Card6Component({ 159 Card6Component({
173 compDTO: this.compDTO, 160 compDTO: this.compDTO,
@@ -175,7 +162,6 @@ export struct CompParser { @@ -175,7 +162,6 @@ export struct CompParser {
175 pageId: this.pageId, 162 pageId: this.pageId,
176 pageName: this.pageName 163 pageName: this.pageName
177 }) 164 })
178 - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })  
179 } else if (this.compDTO.compStyle === CompStyle.Card_03) { 165 } else if (this.compDTO.compStyle === CompStyle.Card_03) {
180 Card3Component({ 166 Card3Component({
181 compDTO: this.compDTO, 167 compDTO: this.compDTO,
@@ -183,20 +169,15 @@ export struct CompParser { @@ -183,20 +169,15 @@ export struct CompParser {
183 pageId: this.pageId, 169 pageId: this.pageId,
184 pageName: this.pageName 170 pageName: this.pageName
185 }) 171 })
186 - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })  
187 } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_04) { 172 } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_04) {
188 ZhSingleColumn04({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName }) 173 ZhSingleColumn04({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName })
189 - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })  
190 } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_05) { 174 } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_05) {
191 // ZhSingleColumn05({ compDTO: compDTO }) 175 // ZhSingleColumn05({ compDTO: compDTO })
192 - // Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })  
193 } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_09) { 176 } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_09) {
194 ZhSingleColumn09({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName }) 177 ZhSingleColumn09({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName })
195 - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })  
196 } else if (this.compDTO.compStyle === CompStyle.Card_Comp_Adv) { // 广告 178 } else if (this.compDTO.compStyle === CompStyle.Card_Comp_Adv) { // 广告
197 AdvCardParser({ pageModel: this.pageModel, compDTO: this.compDTO }) 179 AdvCardParser({ pageModel: this.pageModel, compDTO: this.compDTO })
198 //Text(`compIndex = ${compIndex}`).width('100%').fontSize('12fp').fontColor(Color.Red).padding({ left: 0, right: 0 }) 180 //Text(`compIndex = ${compIndex}`).width('100%').fontSize('12fp').fontColor(Color.Red).padding({ left: 0, right: 0 })
199 - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })  
200 } else if (!Number.isNaN(Number(this.compDTO.compStyle)) || this.compDTO.compType === 'appStyle') { 181 } else if (!Number.isNaN(Number(this.compDTO.compStyle)) || this.compDTO.compType === 'appStyle') {
201 CardParser({ 182 CardParser({
202 contentDTO: this.compDTO.operDataList[0], 183 contentDTO: this.compDTO.operDataList[0],
@@ -205,7 +186,6 @@ export struct CompParser { @@ -205,7 +186,6 @@ export struct CompParser {
205 pageName: this.pageName, 186 pageName: this.pageName,
206 compIndex: this.compIndex 187 compIndex: this.compIndex
207 }); 188 });
208 - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })  
209 } else { 189 } else {
210 // Text(this.compDTO.compStyle) 190 // Text(this.compDTO.compStyle)
211 // .width(CommonConstants.FULL_PARENT) 191 // .width(CommonConstants.FULL_PARENT)
@@ -215,9 +195,43 @@ export struct CompParser { @@ -215,9 +195,43 @@ export struct CompParser {
215 // WDRouterRule.jumpWithPage(WDRouterPage.QualityCommentsPage) 195 // WDRouterRule.jumpWithPage(WDRouterPage.QualityCommentsPage)
216 // } 196 // }
217 // }) 197 // })
218 - // Divider().strokeWidth(8).color('#f5f5f5').padding({ left: 0, right: 0 })  
219 } 198 }
  199 +
  200 + if (
  201 + this.compDTO.compStyle === CompStyle.Card_09 ||
  202 + this.compDTO.compStyle === CompStyle.Zh_Single_Column_09 ||
  203 + this.compDTO.compStyle === CompStyle.Zh_Single_Row_04 ||
  204 + this.compDTO.compStyle === CompStyle.Zh_Single_Row_06
  205 + ) {
  206 + if (this.compDTO.compStyle === this.nextCompDTO.compStyle) {
  207 + Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
  208 + } else {
  209 + Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 16, right: 16 })
  210 + }
  211 + } else if (this.compDTO?.operDataList?.[0]?.appStyle === CompStyle.Card_10) {
  212 + // 大专题
  213 + if (this.nextCompDTO?.operDataList?.[0]?.appStyle === CompStyle.Card_10) {
  214 + Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
  215 + } else {
  216 + Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 16, right: 16 })
220 } 217 }
  218 + } else if (this.compDTO.compType === 'appStyle') {
  219 + if (
  220 + this.nextCompDTO.compStyle === CompStyle.Card_09 ||
  221 + this.nextCompDTO?.operDataList?.[0]?.appStyle === CompStyle.Card_10 ||
  222 + this.nextCompDTO.compStyle === CompStyle.Zh_Single_Column_09 ||
  223 + this.nextCompDTO.compStyle === CompStyle.Zh_Single_Row_04 ||
  224 + this.nextCompDTO.compStyle === CompStyle.Zh_Single_Row_06
  225 + ) {
  226 + Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 16, right: 16 })
  227 + } else {
  228 + Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
  229 + }
  230 + } else {
  231 + // Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
  232 + }
  233 + }
  234 +
221 235
222 } 236 }
223 } 237 }
@@ -64,13 +64,12 @@ export struct ENewspaperItemComponent { @@ -64,13 +64,12 @@ export struct ENewspaperItemComponent {
64 .zIndex(15) 64 .zIndex(15)
65 } 65 }
66 } 66 }
67 - // this.itemPicWidth this.itemPicHeight 外层计算已减去,注掉解决骨架屏压缩变形  
68 - /*.padding({ 67 + .padding({
69 top: 14, 68 top: 14,
70 right: 10, 69 right: 10,
71 bottom: 14, 70 bottom: 14,
72 left: 10 71 left: 10
73 - })*/ 72 + })
74 .backgroundColor(Color.White) 73 .backgroundColor(Color.White)
75 .width('100%') 74 .width('100%')
76 .onTouch((event: TouchEvent) => { 75 .onTouch((event: TouchEvent) => {
@@ -145,7 +145,6 @@ export struct ENewspaperPageComponent { @@ -145,7 +145,6 @@ export struct ENewspaperPageComponent {
145 145
146 let ratio = this.ratio == '100%' ? 1 : 0.5 146 let ratio = this.ratio == '100%' ? 1 : 0.5
147 this.picWidth = this.picWidth * ratio 147 this.picWidth = this.picWidth * ratio
148 - this.picHeight = this.picHeight  
149 // 默认日期 148 // 默认日期
150 const date = new Date() 149 const date = new Date()
151 const month = date.getMonth() + 1 150 const month = date.getMonth() + 1
@@ -174,13 +173,16 @@ export struct ENewspaperPageComponent { @@ -174,13 +173,16 @@ export struct ENewspaperPageComponent {
174 173
175 resizeWindow() { 174 resizeWindow() {
176 this.windowClass?.on('windowSizeChange', () => { 175 this.windowClass?.on('windowSizeChange', () => {
  176 + this.resize()
  177 + });
  178 + }
  179 + resize() {
177 this.screenWidth = this.windowClass?.getWindowProperties()?.windowRect.width || this.displayTool.width 180 this.screenWidth = this.windowClass?.getWindowProperties()?.windowRect.width || this.displayTool.width
178 // 2000折叠屏 TODO DeviceUtil 方法完善了换判断条件 181 // 2000折叠屏 TODO DeviceUtil 方法完善了换判断条件
179 this.ratio = this.screenWidth > 2000 ? '50%' : '100%' 182 this.ratio = this.screenWidth > 2000 ? '50%' : '100%'
180 let ratio = this.ratio == '100%' ? 1 : 0.5 183 let ratio = this.ratio == '100%' ? 1 : 0.5
181 this.picWidth = this.screenWidth - vp2px(20) 184 this.picWidth = this.screenWidth - vp2px(20)
182 this.picWidth = this.picWidth * ratio 185 this.picWidth = this.picWidth * ratio
183 - });  
184 } 186 }
185 187
186 build() { 188 build() {
@@ -257,10 +259,10 @@ export struct ENewspaperPageComponent { @@ -257,10 +259,10 @@ export struct ENewspaperPageComponent {
257 middle: { anchor: "__container__", align: HorizontalAlign.Center } 259 middle: { anchor: "__container__", align: HorizontalAlign.Center }
258 }) 260 })
259 .id('news_skeleton_id') 261 .id('news_skeleton_id')
260 - .width('100%')  
261 - .height(px2vp(this.picHeight) + 32) 262 + .width(px2vp(this.picWidth))
  263 + .height(px2vp(this.picHeight))
262 .margin({ top: 59, left: 10, right: 10 }) 264 .margin({ top: 59, left: 10, right: 10 })
263 - .padding({ right: 10, left: 10 }) 265 + // .padding({ right: 10, left: 10 })
264 } 266 }
265 267
266 if (this.newspaperListBean && this.newspaperListBean.list && this.newspaperListBean.list.length > 0) { 268 if (this.newspaperListBean && this.newspaperListBean.list && this.newspaperListBean.list.length > 0) {
@@ -448,8 +450,7 @@ export struct ENewspaperPageComponent { @@ -448,8 +450,7 @@ export struct ENewspaperPageComponent {
448 private async getNewspaperList() { 450 private async getNewspaperList() {
449 // ENewspaperItemComponent .padding({ top:14, right: 10, bottom: 14, left: 10 }) 451 // ENewspaperItemComponent .padding({ top:14, right: 10, bottom: 14, left: 10 })
450 // 计算图片的内容宽高 452 // 计算图片的内容宽高
451 - let ratio = this.ratio == '100%' ? 1 : 0.5  
452 - this.itemPicWidth = this.picWidth * ratio - vp2px(20) 453 + this.itemPicWidth = this.picWidth - vp2px(20)
453 this.itemPicHeight = this.picHeight - vp2px(28) 454 this.itemPicHeight = this.picHeight - vp2px(28)
454 try { 455 try {
455 if (NetworkUtil.isNetConnected()) { 456 if (NetworkUtil.isNetConnected()) {
@@ -276,7 +276,7 @@ export struct MorningEveningPaperComponent { @@ -276,7 +276,7 @@ export struct MorningEveningPaperComponent {
276 this.AudioBarView() 276 this.AudioBarView()
277 } 277 }
278 .margin({ 278 .margin({
279 - top: this.isHasTopView ? 10 : 44+this.topSafeHeight 279 + top: this.isHasTopView ? 10 : 44 + this.topSafeHeight
280 }) 280 })
281 } 281 }
282 282
@@ -329,8 +329,8 @@ export struct MorningEveningPaperComponent { @@ -329,8 +329,8 @@ export struct MorningEveningPaperComponent {
329 Stack({ alignContent: Alignment.Start }) { 329 Stack({ alignContent: Alignment.Start }) {
330 Image($r('app.media.listen_left_bg')) 330 Image($r('app.media.listen_left_bg'))
331 .width('100%') 331 .width('100%')
332 - .height('100%')  
333 - .objectFit(ImageFit.Contain) 332 + // .height('100%')
  333 + .objectFit(ImageFit.Fill)
334 Image($r('app.media.icon_listen')) 334 Image($r('app.media.icon_listen'))
335 .width(20) 335 .width(20)
336 .height(20) 336 .height(20)
@@ -54,7 +54,8 @@ export struct Card5Component { @@ -54,7 +54,8 @@ export struct Card5Component {
54 bottomRight: $r('app.float.image_border_radius') 54 bottomRight: $r('app.float.image_border_radius')
55 } 55 }
56 ) 56 )
57 - .aspectRatio(343 / 225) 57 + // .aspectRatio(343 / 225)
  58 + .autoResize(true)
58 if (!!this.titleShowPolicy || this.titleShowPolicy === null ) { 59 if (!!this.titleShowPolicy || this.titleShowPolicy === null ) {
59 Row() 60 Row()
60 .borderRadius( 61 .borderRadius(
@@ -138,8 +138,8 @@ export struct ZhSingleColumn09 { @@ -138,8 +138,8 @@ export struct ZhSingleColumn09 {
138 .textAlign(TextAlign.Center) 138 .textAlign(TextAlign.Center)
139 .fontColor(0xffffff) 139 .fontColor(0xffffff)
140 Image($r('app.media.icon_selected')) 140 Image($r('app.media.icon_selected'))
141 - .width(19)  
142 - .height(19) 141 + .width(14)
  142 + .height(14)
143 .opacity(this.activeIndexs.includes(index) ? 1 : 0) 143 .opacity(this.activeIndexs.includes(index) ? 1 : 0)
144 .objectFit(ImageFit.Contain) 144 .objectFit(ImageFit.Contain)
145 } 145 }
1 import { TopNavDTO } from 'wdBean'; 1 import { TopNavDTO } from 'wdBean';
2 import curves from '@ohos.curves'; 2 import curves from '@ohos.curves';
3 -import { Logger } from 'wdKit/Index'; 3 +import { Logger, SPHelper } from 'wdKit/Index';
  4 +import { SpConstants } from 'wdConstant/Index';
4 5
5 const INDEX_SETTING_TITLE: string = '首页设置' 6 const INDEX_SETTING_TITLE: string = '首页设置'
6 const INDEX_SETTING_SUBTITLE: string = '将指定频道设置为首页' 7 const INDEX_SETTING_SUBTITLE: string = '将指定频道设置为首页'
@@ -43,7 +44,6 @@ struct ChannelSubscriptionLayout { @@ -43,7 +44,6 @@ struct ChannelSubscriptionLayout {
43 @State isEditIng: boolean = false 44 @State isEditIng: boolean = false
44 // 顶部导航栏是否有临时跳转频道数据不 45 // 顶部导航栏是否有临时跳转频道数据不
45 @Prop haveTempTabData: boolean 46 @Prop haveTempTabData: boolean
46 -  
47 changeTab: (index: number) => void = () => { 47 changeTab: (index: number) => void = () => {
48 } 48 }
49 49
@@ -67,9 +67,14 @@ struct ChannelSubscriptionLayout { @@ -67,9 +67,14 @@ struct ChannelSubscriptionLayout {
67 delChannelItem(index: number) { 67 delChannelItem(index: number) {
68 68
69 let item = this.myChannelList.splice(index, 1)[0] 69 let item = this.myChannelList.splice(index, 1)[0]
70 - this.channelIds.splice(index, 1) 70 + // this.channelIds.splice(index, 1)
71 AppStorage.setOrCreate('channelIds', this.channelIds.join(',')) 71 AppStorage.setOrCreate('channelIds', this.channelIds.join(','))
72 72
  73 + // 本地频道特殊处理
  74 + let provinceName = SPHelper.default.getSync(SpConstants.LOCATION_PROVINCE_NAME, '') as string
  75 + if (provinceName && provinceName.includes(item.name) && item.localChannel == '0') {
  76 + item.localChannel = '1'
  77 + }
73 /* 78 /*
74 删除的频道信息回到原栏目中去 79 删除的频道信息回到原栏目中去
75 */ 80 */
@@ -130,8 +135,8 @@ struct ChannelSubscriptionLayout { @@ -130,8 +135,8 @@ struct ChannelSubscriptionLayout {
130 this.myChannelList.push(item) 135 this.myChannelList.push(item)
131 AppStorage.setOrCreate('channelIds', this.channelIds.join(',')) 136 AppStorage.setOrCreate('channelIds', this.channelIds.join(','))
132 137
133 - let storageChannelIds: string = AppStorage.get<string>('channelIds') || ''  
134 - console.debug('TopNavigationComponent', 'addChannelItem==>' + storageChannelIds) 138 + // let storageChannelIds: string = AppStorage.get<string>('channelIds') || ''
  139 + // console.debug('TopNavigationComponent', 'addChannelItem==>' + storageChannelIds)
135 } 140 }
136 141
137 itemMove(index: number, newIndex: number): void { 142 itemMove(index: number, newIndex: number): void {
@@ -570,7 +575,7 @@ struct ChannelSubscriptionLayout { @@ -570,7 +575,7 @@ struct ChannelSubscriptionLayout {
570 .backgroundColor(Color.White) 575 .backgroundColor(Color.White)
571 .onClick(() => { 576 .onClick(() => {
572 this.isShow = true 577 this.isShow = true
573 - if(this.haveTempTabData){ 578 + if (this.haveTempTabData) {
574 // 存储数据 579 // 存储数据
575 AppStorage.setOrCreate('channelIds', this.channelIds.join(',')) 580 AppStorage.setOrCreate('channelIds', this.channelIds.join(','))
576 this.haveTempTabData = false 581 this.haveTempTabData = false
@@ -578,18 +583,23 @@ struct ChannelSubscriptionLayout { @@ -578,18 +583,23 @@ struct ChannelSubscriptionLayout {
578 }) 583 })
579 .bindContentCover(this.isShow, this.sheetBuilder(), { 584 .bindContentCover(this.isShow, this.sheetBuilder(), {
580 modalTransition: ModalTransition.DEFAULT, 585 modalTransition: ModalTransition.DEFAULT,
581 - onWillAppear: () => {console.log("BindContentCover onWillAppear.")},  
582 - onAppear: () => {console.log("BindContentCover onAppear.")},  
583 - onWillDisappear: () => {console.log("BindContentCover onWillDisappear.") 586 + onWillAppear: () => {
  587 + console.log("BindContentCover onWillAppear.")
  588 + },
  589 + onAppear: () => {
  590 + console.log("BindContentCover onAppear.")
  591 + },
  592 + onWillDisappear: () => {
  593 + console.log("BindContentCover onWillDisappear.")
584 this.isShow = false 594 this.isShow = false
585 - this.isEditIng = false},  
586 - onDisappear: () => {console.log("BindContentCover onDisappear.") 595 + this.isEditIng = false
  596 + },
  597 + onDisappear: () => {
  598 + console.log("BindContentCover onDisappear.")
587 } 599 }
588 }) 600 })
589 } 601 }
590 602
591 -  
592 -  
593 /** 603 /**
594 * 改变我的频道栏目中频道id数据 604 * 改变我的频道栏目中频道id数据
595 */ 605 */
@@ -95,7 +95,15 @@ export struct PageComponent { @@ -95,7 +95,15 @@ export struct PageComponent {
95 LazyForEach(this.pageModel.compList, (compDTO: CompDTO, compIndex: number) => { 95 LazyForEach(this.pageModel.compList, (compDTO: CompDTO, compIndex: number) => {
96 ListItem() { 96 ListItem() {
97 Column() { 97 Column() {
98 - CompParser({ pageModel: this.pageModel, compDTO: compDTO, compIndex: compIndex, pageId: this.pageId }); 98 + CompParser(
  99 + {
  100 + pageModel: this.pageModel,
  101 + nextCompDTO: compIndex === this.pageModel.compList.getDataArray().length - 1 ? new CompDTO() : this.pageModel.compList.get(compIndex + 1) as CompDTO,
  102 + compDTO: compDTO,
  103 + compIndex: compIndex,
  104 + pageId: this.pageId
  105 + }
  106 + );
99 } 107 }
100 } 108 }
101 }, 109 },
1 -import { BottomNavDTO, TopNavDTO } from 'wdBean';  
2 -import { SpConstants } from 'wdConstant'; 1 +import { BottomNavDTO, NavigationDetailDTO, TopNavDTO } from 'wdBean';
3 import { Logger, NetworkUtil, SPHelper, ToastUtils } from 'wdKit'; 2 import { Logger, NetworkUtil, SPHelper, ToastUtils } from 'wdKit';
4 import { ProcessUtils, WDRouterPage, WDRouterRule } from 'wdRouter'; 3 import { ProcessUtils, WDRouterPage, WDRouterRule } from 'wdRouter';
5 import { PageComponent } from './PageComponent'; 4 import { PageComponent } from './PageComponent';
@@ -422,7 +421,6 @@ export struct TopNavigationComponentNew { @@ -422,7 +421,6 @@ export struct TopNavigationComponentNew {
422 421
423 async aboutToAppear() { 422 async aboutToAppear() {
424 423
425 -  
426 if (CompUtils.isNews(this.navItem)) { 424 if (CompUtils.isNews(this.navItem)) {
427 425
428 // 请求顶导网络数据 426 // 请求顶导网络数据
@@ -619,20 +617,51 @@ export struct TopNavigationComponentNew { @@ -619,20 +617,51 @@ export struct TopNavigationComponentNew {
619 //请求顶导数据 617 //请求顶导数据
620 async getTopNavList(id: number) { 618 async getTopNavList(id: number) {
621 619
  620 +
622 Logger.debug(TAG, 'getTopNavList=存储=>' + this.storageChannelIds) 621 Logger.debug(TAG, 'getTopNavList=存储=>' + this.storageChannelIds)
623 622
  623 + // 1 、使用存储数据
  624 + let bottomDetailCache = await ChannelViewModel.getBottomNavDetailCacheData(id)
  625 +
  626 + if (bottomDetailCache != null && bottomDetailCache.topNavChannelList.length > 0) {
  627 + Logger.debug(TAG, '使用缓存数据')
  628 + this.processTopNewsTapData(bottomDetailCache, false)
  629 + }
  630 +
  631 + // 2、请求网络数据
624 let bottomNavDetail = await ChannelViewModel.getBottomNavDetailData(id, this.storageChannelIds) 632 let bottomNavDetail = await ChannelViewModel.getBottomNavDetailData(id, this.storageChannelIds)
  633 +
  634 + if (bottomNavDetail != null) {
  635 + // 3、 接口数据md5和存储数据md5对比,一致不更新
  636 + if (bottomNavDetail.md5 == bottomDetailCache?.md5) {
  637 + Logger.debug(TAG, '不使用接口数据')
  638 + } else {
  639 + Logger.debug(TAG, '使用接口数据')
  640 + this.processTopNewsTapData(bottomNavDetail, true)
  641 + //存储
  642 + ChannelViewModel.saveBottomDetailData(bottomNavDetail)
  643 + }
  644 +
  645 + }
  646 +
  647 + }
  648 +
  649 + /**
  650 + * 加工新闻tab 顶导数据
  651 + * @param bottomNavDetail
  652 + */
  653 + private processTopNewsTapData(bottomNavDetail: NavigationDetailDTO, isNetData: boolean) {
  654 +
625 let topNavList = bottomNavDetail?.topNavChannelList || [] 655 let topNavList = bottomNavDetail?.topNavChannelList || []
626 656
627 - //let provinceName = SPHelper.default.getSync(SpConstants.LOCATION_PROVINCE_NAME, '') as string  
628 let _myChannelList: TopNavDTO [] = [] 657 let _myChannelList: TopNavDTO [] = []
629 - 658 + this.homeChannelList = []
  659 + this.moreChannelList = []
  660 + this.localChannelList = []
630 topNavList.forEach(item => { 661 topNavList.forEach(item => {
631 if (item.defaultPermitted === 1) { 662 if (item.defaultPermitted === 1) {
632 - console.debug('TopNavigationComponent', '--homeChannelList--->' + item.name)  
633 this.homeChannelList.push(item) 663 this.homeChannelList.push(item)
634 } 664 }
635 -  
636 //TODO 暂时隐藏播报 665 //TODO 暂时隐藏播报
637 if (item.name !== '播报') { 666 if (item.name !== '播报') {
638 if (item.myChannel === '1') { 667 if (item.myChannel === '1') {
@@ -645,6 +674,33 @@ export struct TopNavigationComponentNew { @@ -645,6 +674,33 @@ export struct TopNavigationComponentNew {
645 } 674 }
646 }) 675 })
647 676
  677 + //根据缓存数组排序
  678 + if (this.storageChannelIds && !isNetData) {
  679 + Logger.debug(TAG, '根据存储内容')
  680 + let sortedyChannelList: TopNavDTO [] = []
  681 + let _storageChannelIds = this.storageChannelIds.split(',')
  682 + _storageChannelIds.forEach((channelId) => {
  683 + for (let a of _myChannelList) {
  684 + if (channelId == String(a.channelId)) {
  685 + let startIndex = _myChannelList.findIndex(b => b.channelId == a.channelId)
  686 + _myChannelList.splice(startIndex, 1)
  687 + sortedyChannelList.push(a)
  688 + break;
  689 + }
  690 + }
  691 + })
  692 + // 依据存储的我的频道中频道id集合,过滤出符合条件频道,剩余的频道,针对本地频道处理,每次删除,再次进入存储的频道详情信息里面我的频道栏目的信息集合都有本地频道
  693 + if (_myChannelList.length > 0) {
  694 +
  695 + _myChannelList.forEach((localChannelBean) => {
  696 + localChannelBean.localChannel = '1'
  697 + })
  698 + this.localChannelList.unshift(..._myChannelList)
  699 + }
  700 +
  701 + _myChannelList = sortedyChannelList
  702 + }
  703 +
648 this.myChannelList = _myChannelList 704 this.myChannelList = _myChannelList
649 705
650 //缓存首页频道 706 //缓存首页频道
@@ -653,7 +709,9 @@ export struct TopNavigationComponentNew { @@ -653,7 +709,9 @@ export struct TopNavigationComponentNew {
653 this.currentTopNavSelectedIndex = index 709 this.currentTopNavSelectedIndex = index
654 } 710 }
655 711
  712 + if (isNetData) {
656 // 存储我的频道栏目中的频道id信息 713 // 存储我的频道栏目中的频道id信息
  714 + Logger.debug(TAG, '存储我的频道栏目数据')
657 let channelIds: number [] = [] 715 let channelIds: number [] = []
658 this.myChannelList.forEach(item => { 716 this.myChannelList.forEach(item => {
659 if (item != undefined && item.channelId != undefined) { 717 if (item != undefined && item.channelId != undefined) {
@@ -662,4 +720,6 @@ export struct TopNavigationComponentNew { @@ -662,4 +720,6 @@ export struct TopNavigationComponentNew {
662 }) 720 })
663 AppStorage.setOrCreate('channelIds', channelIds.join(',')) 721 AppStorage.setOrCreate('channelIds', channelIds.join(','))
664 } 722 }
  723 +
  724 + }
665 } 725 }
@@ -123,6 +123,7 @@ export default struct TemplatePageComponent { @@ -123,6 +123,7 @@ export default struct TemplatePageComponent {
123 123
124 CompParser({ 124 CompParser({
125 compDTO: compDTO, 125 compDTO: compDTO,
  126 + nextCompDTO: index === this.templatePage.compList.getDataArray().length - 1 ? new CompDTO() : this.templatePage.compList.get(index + 1) as CompDTO,
126 compIndex: index, 127 compIndex: index,
127 pageId: this.pageId, 128 pageId: this.pageId,
128 pageName: this.pageName 129 pageName: this.pageName
@@ -15,35 +15,39 @@ export struct newsSkeleton { @@ -15,35 +15,39 @@ export struct newsSkeleton {
15 Row() { 15 Row() {
16 Column() { 16 Column() {
17 Image($r('app.media.peopleSeleton')) 17 Image($r('app.media.peopleSeleton'))
18 - .width(120.89)  
19 - .height(46.98)// 后缀名不能省略 18 + .width('100%')
  19 + .height(47)// 后缀名不能省略
20 .interpolation(ImageInterpolation.High) 20 .interpolation(ImageInterpolation.High)
  21 + .margin({
  22 + bottom: 6
  23 + })
21 textArea('100%', 8) 24 textArea('100%', 8)
22 } 25 }
23 .margin({ 26 .margin({
24 - right: 5 27 + right: '2%'
25 }) 28 })
26 - .width(120.89) 29 + .width(`76%`)
27 .alignItems(HorizontalAlign.Start) 30 .alignItems(HorizontalAlign.Start)
28 31
29 Column() { 32 Column() {
30 Row() 33 Row()
31 - .width(`16.5%`) 34 + .width(`100%`)
32 .height(25) 35 .height(25)
33 .backgroundColor('#FFF5F5F5') 36 .backgroundColor('#FFF5F5F5')
34 Row() 37 Row()
35 - .width(`16.5%`) 38 + .width(`100%`)
36 .height(4) 39 .height(4)
37 .backgroundColor('#FFF5F5F5') 40 .backgroundColor('#FFF5F5F5')
38 .margin({ top: 3, bottom: 3 }) 41 .margin({ top: 3, bottom: 3 })
39 Row() 42 Row()
40 - .width(`16.5%`) 43 + .width(`100%`)
41 .height(20) 44 .height(20)
42 .backgroundColor('#FFF5F5F5') 45 .backgroundColor('#FFF5F5F5')
43 // textArea(27, 25) 46 // textArea(27, 25)
44 // textArea(27, 4) 47 // textArea(27, 4)
45 // textArea(27, 20) 48 // textArea(27, 20)
46 } 49 }
  50 + .width(`22%`)
47 .border({ width: 1 }) 51 .border({ width: 1 })
48 .borderColor('#FFF5F5F5') 52 .borderColor('#FFF5F5F5')
49 .padding({ 53 .padding({
@@ -119,6 +123,7 @@ export struct newsSkeleton { @@ -119,6 +123,7 @@ export struct newsSkeleton {
119 .width('100%') 123 .width('100%')
120 } 124 }
121 .height('100%') 125 .height('100%')
  126 + .width('100%')
122 127
123 } 128 }
124 } 129 }
@@ -192,11 +192,11 @@ export class PageRepository { @@ -192,11 +192,11 @@ export class PageRepository {
192 /** 192 /**
193 * 早晚报pageInfo请求 193 * 早晚报pageInfo请求
194 * */ 194 * */
195 - static getMorningEveningPageInfoUrl(pageId: string,topicId:string) { 195 + static getMorningEveningPageInfoUrl(pageId: string, topicId: string) {
196 let url = HttpUrlUtils.getHost() + HttpUrlUtils.PAGE_INFO_PATH; 196 let url = HttpUrlUtils.getHost() + HttpUrlUtils.PAGE_INFO_PATH;
197 url = url + "?pageId=" + pageId; 197 url = url + "?pageId=" + pageId;
198 - if(!StringUtils.isEmpty(topicId)){  
199 - url = url+ "&topicId=" + topicId; 198 + if (!StringUtils.isEmpty(topicId)) {
  199 + url = url + "&topicId=" + topicId;
200 } 200 }
201 Logger.info(TAG, "getMorningEveningPageInfoUrl url = " + url) 201 Logger.info(TAG, "getMorningEveningPageInfoUrl url = " + url)
202 return url; 202 return url;
@@ -237,10 +237,11 @@ export class PageRepository { @@ -237,10 +237,11 @@ export class PageRepository {
237 static fetchNavigationDetailDataApi(id: number = 210, myChannelIds?: string) { 237 static fetchNavigationDetailDataApi(id: number = 210, myChannelIds?: string) {
238 let url = PageRepository.getBottomNavGroupDetailUrl() + `?id=${id}`; 238 let url = PageRepository.getBottomNavGroupDetailUrl() + `?id=${id}`;
239 239
  240 + // 310000 310100 310115120
240 let provinceCode = HttpUtils.getProvinceCode() 241 let provinceCode = HttpUtils.getProvinceCode()
241 if (provinceCode) { 242 if (provinceCode) {
242 url = url + "&districtCode=" + HttpUtils.getDistrictCode() 243 url = url + "&districtCode=" + HttpUtils.getDistrictCode()
243 - + "&provinceCode=" + HttpUtils.getProvinceCode() 244 + + "&provinceCode=" + provinceCode
244 + "&cityCode=" + HttpUtils.getCityCode() 245 + "&cityCode=" + HttpUtils.getCityCode()
245 } 246 }
246 if (myChannelIds) { 247 if (myChannelIds) {
@@ -395,8 +396,8 @@ export class PageRepository { @@ -395,8 +396,8 @@ export class PageRepository {
395 /** 396 /**
396 * 获取早晚报pageInfo 397 * 获取早晚报pageInfo
397 * */ 398 * */
398 - static fetchMorningEveningPageInfo(pageId: string,topicId:string) {  
399 - let url = PageRepository.getMorningEveningPageInfoUrl(pageId,topicId) 399 + static fetchMorningEveningPageInfo(pageId: string, topicId: string) {
  400 + let url = PageRepository.getMorningEveningPageInfoUrl(pageId, topicId)
400 return WDHttp.get<ResponseDTO<PageInfoBean>>(url) 401 return WDHttp.get<ResponseDTO<PageInfoBean>>(url)
401 }; 402 };
402 403
@@ -421,7 +422,7 @@ export class PageRepository { @@ -421,7 +422,7 @@ export class PageRepository {
421 * 获取播报pageInfo 422 * 获取播报pageInfo
422 * */ 423 * */
423 static fetchBroadcastPageInfo(pageId: string) { 424 static fetchBroadcastPageInfo(pageId: string) {
424 - let url = PageRepository.getMorningEveningPageInfoUrl(pageId,'') 425 + let url = PageRepository.getMorningEveningPageInfoUrl(pageId, '')
425 return WDHttp.get<ResponseDTO<PageInfoBean>>(url) 426 return WDHttp.get<ResponseDTO<PageInfoBean>>(url)
426 }; 427 };
427 428
@@ -58,7 +58,7 @@ export class ChannelViewModel { @@ -58,7 +58,7 @@ export class ChannelViewModel {
58 } 58 }
59 59
60 /** 60 /**
61 - * 保存导详情数据到缓存 61 + * 保存顶部导详情数据到缓存
62 */ 62 */
63 saveBottomDetailData(data: NavigationDetailDTO) { 63 saveBottomDetailData(data: NavigationDetailDTO) {
64 CacheData.saveCacheData(CacheData.channelCacheDataKey + data?.id, data, data.md5) 64 CacheData.saveCacheData(CacheData.channelCacheDataKey + data?.id, data, data.md5)
@@ -75,7 +75,7 @@ export class ChannelViewModel { @@ -75,7 +75,7 @@ export class ChannelViewModel {
75 /** 75 /**
76 * 获取底导详情(顶导)接口数据 76 * 获取底导详情(顶导)接口数据
77 */ 77 */
78 - async getBottomNavDetailData(id: number, myChannelIds?: string): Promise<NavigationDetailDTO> { 78 + async getBottomNavDetailData(id: number, myChannelIds?: string): Promise<NavigationDetailDTO|null> {
79 Logger.info(TAG, `getBottomNavDetailData start`); 79 Logger.info(TAG, `getBottomNavDetailData start`);
80 return this.getNavDetailData(id,myChannelIds); 80 return this.getNavDetailData(id,myChannelIds);
81 } 81 }
@@ -111,18 +111,18 @@ export class ChannelViewModel { @@ -111,18 +111,18 @@ export class ChannelViewModel {
111 * @param myChannelIds 111 * @param myChannelIds
112 * @returns 112 * @returns
113 */ 113 */
114 - private getNavDetailData(id: number, myChannelIds?: string): Promise<NavigationDetailDTO> {  
115 - return new Promise<NavigationDetailDTO>((success, error) => { 114 + private getNavDetailData(id: number, myChannelIds?: string): Promise<NavigationDetailDTO|null> {
  115 + return new Promise<NavigationDetailDTO|null>((success, error) => {
116 Logger.info(TAG, `getNavData start`); 116 Logger.info(TAG, `getNavData start`);
117 PageRepository.fetchNavigationDetailDataApi(id,myChannelIds).then((navResDTO: ResponseDTO<NavigationDetailDTO>) => { 117 PageRepository.fetchNavigationDetailDataApi(id,myChannelIds).then((navResDTO: ResponseDTO<NavigationDetailDTO>) => {
118 if (!navResDTO || !navResDTO.data) { 118 if (!navResDTO || !navResDTO.data) {
119 Logger.error(TAG, 'getNavData then navResDTO is empty'); 119 Logger.error(TAG, 'getNavData then navResDTO is empty');
120 - error('navResDTO is empty'); 120 + success(null);
121 return 121 return
122 } 122 }
123 if (navResDTO.code != 0) { 123 if (navResDTO.code != 0) {
124 Logger.error(TAG, `getNavData then code:${navResDTO.code}, message:${navResDTO.message}`); 124 Logger.error(TAG, `getNavData then code:${navResDTO.code}, message:${navResDTO.message}`);
125 - error('navResDTO Response Code is failure'); 125 + success(null);
126 return 126 return
127 } 127 }
128 // let navResStr = JSON.stringify(navResDTO); 128 // let navResStr = JSON.stringify(navResDTO);
@@ -131,7 +131,7 @@ export class ChannelViewModel { @@ -131,7 +131,7 @@ export class ChannelViewModel {
131 success(navResDTO.data); 131 success(navResDTO.data);
132 }).catch((err: Error) => { 132 }).catch((err: Error) => {
133 Logger.error(TAG, `fetchNavigationDataApi catch, error.name : ${err.name}, error.message:${err.message}`); 133 Logger.error(TAG, `fetchNavigationDataApi catch, error.name : ${err.name}, error.message:${err.message}`);
134 - error(err); 134 + success(null);
135 }) 135 })
136 }) 136 })
137 } 137 }
@@ -77,9 +77,9 @@ export class PageHelper { @@ -77,9 +77,9 @@ export class PageHelper {
77 * 进页面请求数据 77 * 进页面请求数据
78 */ 78 */
79 async getInitCacheData(pageModel: PageModel, pageAdvModel: PageAdModel) { 79 async getInitCacheData(pageModel: PageModel, pageAdvModel: PageAdModel) {
80 - Logger.debug(TAG, 'getInitCacheData') 80 + // Logger.debug(TAG, 'getInitCacheData')
81 PageViewModel.getPageInfoCache(pageModel.pageId).then(pageInfo => { 81 PageViewModel.getPageInfoCache(pageModel.pageId).then(pageInfo => {
82 - Logger.debug(TAG, 'getInitCacheData back: ' + pageInfo) 82 + // Logger.debug(TAG, 'getInitCacheData back: ' + pageInfo)
83 if (pageInfo == null) { 83 if (pageInfo == null) {
84 return; 84 return;
85 } 85 }
@@ -125,9 +125,9 @@ export class PageHelper { @@ -125,9 +125,9 @@ export class PageHelper {
125 this.refreshUIEnd(pageModel, false) 125 this.refreshUIEnd(pageModel, false)
126 }) 126 })
127 } else { 127 } else {
128 - Logger.debug(TAG, 'getPageInfo') 128 + // Logger.debug(TAG, 'getPageInfo')
129 PageViewModel.getPageInfo(pageModel.pageId).then(pageInfo => { 129 PageViewModel.getPageInfo(pageModel.pageId).then(pageInfo => {
130 - Logger.debug(TAG, 'getPageInfo back: ' + JSON.stringify(pageInfo)) 130 + // Logger.debug(TAG, 'getPageInfo back: ' + JSON.stringify(pageInfo))
131 if (pageInfo == null) { 131 if (pageInfo == null) {
132 pageModel.viewType = ViewType.EMPTY; 132 pageModel.viewType = ViewType.EMPTY;
133 pageModel.emptyType = WDViewDefaultType.WDViewDefaultType_NoContent1; 133 pageModel.emptyType = WDViewDefaultType.WDViewDefaultType_NoContent1;
@@ -137,9 +137,9 @@ export class PageHelper { @@ -137,9 +137,9 @@ export class PageHelper {
137 pageModel.pageInfo = pageInfo; 137 pageModel.pageInfo = pageInfo;
138 if (pageInfo.md5 == pageModel.displayPageInfoMd5) { 138 if (pageInfo.md5 == pageModel.displayPageInfoMd5) {
139 // 缓存一致,不解析 139 // 缓存一致,不解析
140 - Logger.debug(TAG, 'getPageInfo 与缓存一致,不解析广告。。。') 140 + // Logger.debug(TAG, 'getPageInfo 与缓存一致,不解析广告。。。')
141 } else { 141 } else {
142 - Logger.debug(TAG, 'getPageInfo 要解析广告') 142 + // Logger.debug(TAG, 'getPageInfo 要解析广告')
143 if (pageModel.currentPage == 1) { 143 if (pageModel.currentPage == 1) {
144 // 保存缓存 144 // 保存缓存
145 CacheData.saveCacheData(CacheData.comPageInfoCacheKey + pageModel.pageId, pageInfo, pageInfo.md5) 145 CacheData.saveCacheData(CacheData.comPageInfoCacheKey + pageModel.pageId, pageInfo, pageInfo.md5)
@@ -148,7 +148,7 @@ export class PageHelper { @@ -148,7 +148,7 @@ export class PageHelper {
148 //解析页面挂角广告资源 148 //解析页面挂角广告资源
149 pageAdvModel.analysisAdvSource(pageInfo); 149 pageAdvModel.analysisAdvSource(pageInfo);
150 } 150 }
151 - Logger.debug(TAG, 'getPageInfo go on') 151 + // Logger.debug(TAG, 'getPageInfo go on')
152 this.parseGroup(pageModel, false) 152 this.parseGroup(pageModel, false)
153 }).catch(() => { 153 }).catch(() => {
154 this.refreshUIEnd(pageModel, false) 154 this.refreshUIEnd(pageModel, false)
@@ -190,14 +190,14 @@ export class PageHelper { @@ -190,14 +190,14 @@ export class PageHelper {
190 190
191 //Logger.error("ZZZXXXXX", '楼层id-start--》' + pageModel.groupId); 191 //Logger.error("ZZZXXXXX", '楼层id-start--》' + pageModel.groupId);
192 let pageDto: PageDTO 192 let pageDto: PageDTO
193 - Logger.debug(TAG, 'parseGroup isCache: ' + isCache) 193 + //Logger.debug(TAG, 'parseGroup isCache: ' + isCache)
194 if (isCache) { 194 if (isCache) {
195 pageDto = await PageViewModel.getPageGroupCacheData(pageModel.bizCopy()) as PageDTO 195 pageDto = await PageViewModel.getPageGroupCacheData(pageModel.bizCopy()) as PageDTO
196 pageModel.displayGroupInfoMd5 = pageDto.md5 196 pageModel.displayGroupInfoMd5 = pageDto.md5
197 } else { 197 } else {
198 pageDto = await PageViewModel.getPageGroupCompData(pageModel.bizCopy()) as PageDTO 198 pageDto = await PageViewModel.getPageGroupCompData(pageModel.bizCopy()) as PageDTO
199 if (pageDto.md5 == pageModel.displayGroupInfoMd5) { 199 if (pageDto.md5 == pageModel.displayGroupInfoMd5) {
200 - Logger.debug(TAG, 'parseGroup cache load, return: ' + pageDto.md5) 200 + // Logger.debug(TAG, 'parseGroup cache load, return: ' + pageDto.md5)
201 // 下拉刷新场景,数据没变,拦截刷新UI,重置相关参数 201 // 下拉刷新场景,数据没变,拦截刷新UI,重置相关参数
202 if (pageModel.loadStrategy === 2) { 202 if (pageModel.loadStrategy === 2) {
203 // 缓存数据一致,不再刷新 203 // 缓存数据一致,不再刷新
@@ -211,17 +211,17 @@ export class PageHelper { @@ -211,17 +211,17 @@ export class PageHelper {
211 return 211 return
212 } 212 }
213 pageModel.displayGroupInfoMd5 = pageDto.md5 213 pageModel.displayGroupInfoMd5 = pageDto.md5
214 - Logger.debug(TAG, 'parseGroup cache load, save: ' + pageDto.md5) 214 + // Logger.debug(TAG, 'parseGroup cache load, save: ' + pageDto.md5)
215 // 保存缓存 215 // 保存缓存
216 CacheData.saveCacheData(CacheData.compGroupInfoDataCacheKey + pageModel.pageId + pageModel.groupId, pageDto, 216 CacheData.saveCacheData(CacheData.compGroupInfoDataCacheKey + pageModel.pageId + pageModel.groupId, pageDto,
217 pageDto.md5) 217 pageDto.md5)
218 } 218 }
219 - Logger.debug(TAG, 'parseGroup go on') 219 + // Logger.debug(TAG, 'parseGroup go on')
220 // await,确保groups接口顺序执行 220 // await,确保groups接口顺序执行
221 // let pageDto = page 221 // let pageDto = page
222 let index = pageInfo.groups.indexOf(group) 222 let index = pageInfo.groups.indexOf(group)
223 223
224 - Logger.debug(TAG, 'yyyy parseGroup print') 224 + // Logger.debug(TAG, 'yyyy parseGroup print')
225 this.printComp(pageDto) 225 this.printComp(pageDto)
226 // 解析楼层组件 226 // 解析楼层组件
227 this.analysisPageGroupCompData(pageDto, pageInfo) 227 this.analysisPageGroupCompData(pageDto, pageInfo)
@@ -268,7 +268,7 @@ export class PageHelper { @@ -268,7 +268,7 @@ export class PageHelper {
268 268
269 if (pageModel.compList.isEmpty()) { 269 if (pageModel.compList.isEmpty()) {
270 // 没数据,展示空页面 270 // 没数据,展示空页面
271 - Logger.debug(TAG, 'aboutToAppear, data response page ' + pageModel.pageId + ', comp list is empty.'); 271 + //Logger.debug(TAG, 'aboutToAppear, data response page ' + pageModel.pageId + ', comp list is empty.');
272 pageModel.viewType = ViewType.EMPTY; 272 pageModel.viewType = ViewType.EMPTY;
273 pageModel.emptyType = WDViewDefaultType.WDViewDefaultType_NoContent1; 273 pageModel.emptyType = WDViewDefaultType.WDViewDefaultType_NoContent1;
274 274
@@ -296,7 +296,7 @@ export class PageHelper { @@ -296,7 +296,7 @@ export class PageHelper {
296 pageInfo.pageAdList.push(...pageDto.compAdList) 296 pageInfo.pageAdList.push(...pageDto.compAdList)
297 } 297 }
298 // TODO 待删除 298 // TODO 待删除
299 - Logger.debug(TAG, 'yyyy analysisPageGroupCompData size, '+pageInfo?.oneRequestPageGroupCompList?.length) 299 + // Logger.debug(TAG, 'yyyy analysisPageGroupCompData size, '+pageInfo?.oneRequestPageGroupCompList?.length)
300 } 300 }
301 301
302 } 302 }
@@ -343,7 +343,7 @@ export class PageHelper { @@ -343,7 +343,7 @@ export class PageHelper {
343 pageModel.currentPage++; 343 pageModel.currentPage++;
344 pageModel.hasMore = true; 344 pageModel.hasMore = true;
345 345
346 - Logger.debug(TAG, 'yyyy compLoadMore print') 346 + // Logger.debug(TAG, 'yyyy compLoadMore print')
347 this.printComp(data) 347 this.printComp(data)
348 //移除音频 和 活动 348 //移除音频 和 活动
349 this.loadMorePageComp(pageModel, data) 349 this.loadMorePageComp(pageModel, data)
@@ -372,7 +372,7 @@ export class PageHelper { @@ -372,7 +372,7 @@ export class PageHelper {
372 pageModel.pageInfo.oneRequestPageGroupCompList.add(comp) 372 pageModel.pageInfo.oneRequestPageGroupCompList.add(comp)
373 }) 373 })
374 // TODO 待删除 374 // TODO 待删除
375 - Logger.debug(TAG, 'yyyy loadMorePageComp size, ' + pageModel.pageInfo.oneRequestPageGroupCompList?.length) 375 + // Logger.debug(TAG, 'yyyy loadMorePageComp size, ' + pageModel.pageInfo.oneRequestPageGroupCompList?.length)
376 376
377 // 记录 377 // 记录
378 pageModel.pageTotalCompSize = pageCompList.length + pageModel.pageTotalCompSize 378 pageModel.pageTotalCompSize = pageCompList.length + pageModel.pageTotalCompSize
@@ -398,7 +398,7 @@ export class PageHelper { @@ -398,7 +398,7 @@ export class PageHelper {
398 let contentInfo: ContentDTO = CollectionUtils.getElement(element.operDataList, 0); 398 let contentInfo: ContentDTO = CollectionUtils.getElement(element.operDataList, 0);
399 //移除音频 和 活动 399 //移除音频 和 活动
400 if (contentInfo && (contentInfo.objectType === '13' || contentInfo.objectType === '3')) { 400 if (contentInfo && (contentInfo.objectType === '13' || contentInfo.objectType === '3')) {
401 - Logger.debug(TAG, 'getGroupData 移除音频 和 活动'); 401 + //Logger.debug(TAG, 'getGroupData 移除音频 和 活动');
402 } else { 402 } else {
403 // 暂时屏蔽活动和音频详情入口 403 // 暂时屏蔽活动和音频详情入口
404 if (element.operDataList[0]?.objectType === '3' || element.operDataList[0]?.objectType === '13') { 404 if (element.operDataList[0]?.objectType === '3' || element.operDataList[0]?.objectType === '13') {
@@ -843,7 +843,7 @@ export class PageHelper { @@ -843,7 +843,7 @@ export class PageHelper {
843 * 删除分页数据,保留第一页的数据。(下拉刷新场景用到) 843 * 删除分页数据,保留第一页的数据。(下拉刷新场景用到)
844 */ 844 */
845 deleteMorePage(pageModel: PageModel) { 845 deleteMorePage(pageModel: PageModel) {
846 - Logger.debug(TAG, 'deleteMorePage endindex: ' + pageModel.firstPageEndIndex) 846 + //Logger.debug(TAG, 'deleteMorePage endindex: ' + pageModel.firstPageEndIndex)
847 if (pageModel.firstPageEndIndex < 0) { 847 if (pageModel.firstPageEndIndex < 0) {
848 return 848 return
849 } 849 }
@@ -855,7 +855,7 @@ export class PageHelper { @@ -855,7 +855,7 @@ export class PageHelper {
855 * 临时打印comp相关信息,用于问题定位。TODO 待删除 855 * 临时打印comp相关信息,用于问题定位。TODO 待删除
856 */ 856 */
857 private printComp(pageDto: PageDTO) { 857 private printComp(pageDto: PageDTO) {
858 - Logger.debug(TAG, 'yyyy printComp pageDto.compList.size: ' + pageDto?.compList?.length) 858 + //Logger.debug(TAG, 'yyyy printComp pageDto.compList.size: ' + pageDto?.compList?.length)
859 new Promise<void>(() => { 859 new Promise<void>(() => {
860 let tmpCompList: CompDTO[] = Array.from(pageDto.compList) 860 let tmpCompList: CompDTO[] = Array.from(pageDto.compList)
861 tmpCompList.forEach((v, k) => { 861 tmpCompList.forEach((v, k) => {
@@ -863,10 +863,10 @@ export class PageHelper { @@ -863,10 +863,10 @@ export class PageHelper {
863 Logger.warn(TAG, 'yyyy printComp comp forEach, ' + v.compStyle) 863 Logger.warn(TAG, 'yyyy printComp comp forEach, ' + v.compStyle)
864 v.operDataList.forEach((cv, ci) => { 864 v.operDataList.forEach((cv, ci) => {
865 if (cv) { 865 if (cv) {
866 - Logger.debug(TAG, 'yyyy printComp ContentDTO print, ' + v.compStyle)  
867 - Logger.debug(TAG, 'yyyy printComp ContentDTO xxxx newsTitle, ' + cv.newsTitle) 866 + // Logger.debug(TAG, 'yyyy printComp ContentDTO print, ' + v.compStyle)
  867 + // Logger.debug(TAG, 'yyyy printComp ContentDTO xxxx newsTitle, ' + cv.newsTitle)
868 } else { 868 } else {
869 - Logger.warn(TAG, 'yyyy printComp ContentDTO is null, ' + v.compStyle) 869 + // Logger.warn(TAG, 'yyyy printComp ContentDTO is null, ' + v.compStyle)
870 } 870 }
871 }) 871 })
872 } else { 872 } else {
@@ -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