王士厅
Showing 33 changed files with 552 additions and 273 deletions
@@ -38,6 +38,10 @@ export class ContentConstants { @@ -38,6 +38,10 @@ export class ContentConstants {
38 */ 38 */
39 static readonly TYPE_NINE: string = "9"; 39 static readonly TYPE_NINE: string = "9";
40 /** 40 /**
  41 + * 11:频道跳转
  42 + */
  43 + static readonly TYPE_CHANNEL: string = "11";
  44 + /**
41 * 13:音频详情 45 * 13:音频详情
42 */ 46 */
43 static readonly TYPE_AUDIO: string = "13"; 47 static readonly TYPE_AUDIO: string = "13";
@@ -134,6 +134,10 @@ export class ProcessUtils { @@ -134,6 +134,10 @@ export class ProcessUtils {
134 // 专题详情,跳转h5 134 // 专题详情,跳转h5
135 ProcessUtils.gotoSpecialTopic(content); 135 ProcessUtils.gotoSpecialTopic(content);
136 break; 136 break;
  137 + case ContentConstants.TYPE_CHANNEL:
  138 + // 频道跳转
  139 + HomeChannelUtils.jumpChannelTab(content.objectId, content.pageId, content.newsTitle)
  140 + break;
137 //动态详情页(动态图文) 141 //动态详情页(动态图文)
138 case ContentConstants.TYPE_FOURTEEN: 142 case ContentConstants.TYPE_FOURTEEN:
139 ProcessUtils.gotoDynamicDetailPage(content); 143 ProcessUtils.gotoDynamicDetailPage(content);
@@ -104,7 +104,7 @@ export class ContentDTO implements BaseDTO { @@ -104,7 +104,7 @@ export class ContentDTO implements BaseDTO {
104 //底部导航栏 id(用于频道跳转) 104 //底部导航栏 id(用于频道跳转)
105 bottomNavId: string = ''; 105 bottomNavId: string = '';
106 // 链接类型: 0:无链接;1:内链(文章);2:外链 106 // 链接类型: 0:无链接;1:内链(文章);2:外链
107 - openType: string = ''; 107 + openType: string = '1';
108 extra: string = '' 108 extra: string = ''
109 sameContentList:ContentDTO[] = [] 109 sameContentList:ContentDTO[] = []
110 sameContentListJson:string = "" 110 sameContentListJson:string = ""
@@ -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 }) 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 })
  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 })
219 } 232 }
220 } 233 }
221 234
  235 +
222 } 236 }
223 } 237 }
@@ -4,7 +4,7 @@ import { @@ -4,7 +4,7 @@ import {
4 PageInfoBean, 4 PageInfoBean,
5 ContentDTO, 5 ContentDTO,
6 contentListParams, 6 contentListParams,
7 - InteractDataDTO 7 + InteractDataDTO, TopicInfo
8 } from 'wdBean'; 8 } from 'wdBean';
9 import { DateTimeUtils, Logger, SPHelper, WindowModel } from 'wdKit/Index'; 9 import { DateTimeUtils, Logger, SPHelper, WindowModel } from 'wdKit/Index';
10 import { PaperReaderSimpleDialog } from '../../dialog/PaperReaderDialog'; 10 import { PaperReaderSimpleDialog } from '../../dialog/PaperReaderDialog';
@@ -61,6 +61,7 @@ export struct MorningEveningPaperComponent { @@ -61,6 +61,7 @@ export struct MorningEveningPaperComponent {
61 @Provide title: string = '' 61 @Provide title: string = ''
62 @Provide subTitle: string = '' 62 @Provide subTitle: string = ''
63 @Provide audioTitle: string = '' 63 @Provide audioTitle: string = ''
  64 + @Provide topicInfo: TopicInfo = {} as TopicInfo
64 @Provide isAudioPlaying: boolean = false 65 @Provide isAudioPlaying: boolean = false
65 @Provide status: number = PlayerConstants.STATUS_START; 66 @Provide status: number = PlayerConstants.STATUS_START;
66 @Provide currentTime: string = "00:00"; 67 @Provide currentTime: string = "00:00";
@@ -142,6 +143,7 @@ export struct MorningEveningPaperComponent { @@ -142,6 +143,7 @@ export struct MorningEveningPaperComponent {
142 viewColumInsightIntentShare(context,String(dailyPaperTopicPageId), this.pageInfoBean) 143 viewColumInsightIntentShare(context,String(dailyPaperTopicPageId), this.pageInfoBean)
143 144
144 this.title = this.pageInfoBean?.topicInfo?.title 145 this.title = this.pageInfoBean?.topicInfo?.title
  146 + this.topicInfo = this.pageInfoBean?.topicInfo
145 let dateTime = DateTimeUtils.parseDate(this.pageInfoBean?.topicInfo?.topicDate ?? '', DateTimeUtils.PATTERN_DATE_HYPHEN) 147 let dateTime = DateTimeUtils.parseDate(this.pageInfoBean?.topicInfo?.topicDate ?? '', DateTimeUtils.PATTERN_DATE_HYPHEN)
146 const dateShow = new Date(dateTime) 148 const dateShow = new Date(dateTime)
147 this.subTitle = `${dateShow.getFullYear()}年\n${(dateShow.getMonth() + 1)}月${dateShow.getDate()}日` 149 this.subTitle = `${dateShow.getFullYear()}年\n${(dateShow.getMonth() + 1)}月${dateShow.getDate()}日`
@@ -314,7 +316,7 @@ export struct MorningEveningPaperComponent { @@ -314,7 +316,7 @@ export struct MorningEveningPaperComponent {
314 @Builder 316 @Builder
315 topPaperTitle(){ 317 topPaperTitle(){
316 Column(){ 318 Column(){
317 - PaperTitleComponent({topicInfo:this.pageInfoBean?.topicInfo}) 319 + PaperTitleComponent()
318 .margin({top:this.topSafeHeight}) 320 .margin({top:this.topSafeHeight})
319 } 321 }
320 .height(44+this.topSafeHeight) 322 .height(44+this.topSafeHeight)
@@ -12,7 +12,7 @@ import { TrackConstants } from 'wdTracking/Index'; @@ -12,7 +12,7 @@ import { TrackConstants } from 'wdTracking/Index';
12 export struct PaperTitleComponent { 12 export struct PaperTitleComponent {
13 @Consume title?: string 13 @Consume title?: string
14 @Consume subTitle?: string 14 @Consume subTitle?: string
15 - topicInfo: TopicInfo = {} as TopicInfo 15 + @Consume topicInfo: TopicInfo
16 aboutToAppear() { 16 aboutToAppear() {
17 } 17 }
18 18
@@ -98,18 +98,18 @@ export struct PaperTitleComponent { @@ -98,18 +98,18 @@ export struct PaperTitleComponent {
98 }) 98 })
99 .margin({ right: 16 }) 99 .margin({ right: 16 })
100 100
101 - // Image($r('app.media.icon_share'))  
102 - // .height($r('app.float.top_arrow_size'))  
103 - // .width($r('app.float.top_arrow_size'))  
104 - // .alignRules({  
105 - // right: { anchor: "img_close", align: HorizontalAlign.Start },  
106 - // center: { anchor: "__container__", align: VerticalAlign.Center }  
107 - // })  
108 - // .id('img_share')  
109 - // .margin({ right: 16 })  
110 - // .onClick(() => {  
111 - // this.share()  
112 - // }) 101 + Image($r('app.media.icon_share'))
  102 + .height($r('app.float.top_arrow_size'))
  103 + .width($r('app.float.top_arrow_size'))
  104 + .alignRules({
  105 + right: { anchor: "img_close", align: HorizontalAlign.Start },
  106 + center: { anchor: "__container__", align: VerticalAlign.Center }
  107 + })
  108 + .id('img_share')
  109 + .margin({ right: 16 })
  110 + .onClick(() => {
  111 + this.share()
  112 + })
113 } 113 }
114 // .margin({ left: 14, right: 14 }) 114 // .margin({ left: 14, right: 14 })
115 .height($r('app.float.top_bar_height')) 115 .height($r('app.float.top_bar_height'))
@@ -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(
@@ -94,7 +94,7 @@ export struct Card6Component { @@ -94,7 +94,7 @@ export struct Card6Component {
94 .alignSelf(ItemAlign.Start) 94 .alignSelf(ItemAlign.Start)
95 .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。 95 .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。
96 .textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 && 96 .textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 &&
97 - (this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) < 5 ? 58 : 97 + (this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) < 5 ? (12 + (this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) * 11) :
98 ((this.contentDTO.newTags?.length > 0 || this.contentDTO.seoTags?.length > 0) || this.contentDTO.objectType == '5' || this.contentDTO.top === 1) ? 35 : 98 ((this.contentDTO.newTags?.length > 0 || this.contentDTO.seoTags?.length > 0) || this.contentDTO.objectType == '5' || this.contentDTO.top === 1) ? 35 :
99 0 ) 99 0 )
100 }.alignContent(Alignment.TopStart) 100 }.alignContent(Alignment.TopStart)
@@ -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 }
@@ -21,7 +21,7 @@ export default struct MinePageUserSimpleInfoUI { @@ -21,7 +21,7 @@ export default struct MinePageUserSimpleInfoUI {
21 ///已登录状态,先获取本地数据 21 ///已登录状态,先获取本地数据
22 this.userName = SPHelper.default.getSync(SpConstants.USER_NAME,"") as string 22 this.userName = SPHelper.default.getSync(SpConstants.USER_NAME,"") as string
23 this.headPhotoUrl = SPHelper.default.getSync(SpConstants.USER_HEAD_PHOTO_URL,"") as string 23 this.headPhotoUrl = SPHelper.default.getSync(SpConstants.USER_HEAD_PHOTO_URL,"") as string
24 - 24 + this.userType = SPHelper.default.getSync(SpConstants.USER_Type,"") as string
25 this.getUserInfo() 25 this.getUserInfo()
26 }else{ 26 }else{
27 this.headPhotoUrl = "" 27 this.headPhotoUrl = ""
@@ -33,8 +33,8 @@ export default struct MinePageUserSimpleInfoUI { @@ -33,8 +33,8 @@ export default struct MinePageUserSimpleInfoUI {
33 Row(){ 33 Row(){
34 //头像 34 //头像
35 Stack(){ 35 Stack(){
36 - Image(this.headPhotoUrl==""?$r('app.media.default_head'):this.headPhotoUrl)  
37 - .alt($r('app.media.default_head')) 36 + Image(this.headPhotoUrl)
  37 + .alt(this.userType === '1'?$r('app.media.default_head'):$r('app.media.AccountOwner_DefaultIcon'))
38 .width(`${this.calcHeight(100)}lpx`) 38 .width(`${this.calcHeight(100)}lpx`)
39 .height(`${this.calcHeight(100)}lpx`) 39 .height(`${this.calcHeight(100)}lpx`)
40 .objectFit(ImageFit.Cover) 40 .objectFit(ImageFit.Cover)
@@ -37,7 +37,7 @@ export struct AppointmentListUI { @@ -37,7 +37,7 @@ export struct AppointmentListUI {
37 if (this.isGetRequest == true) { 37 if (this.isGetRequest == true) {
38 if(this.isConnectNetwork){ 38 if(this.isConnectNetwork){
39 EmptyComponent({ emptyType: 10 }) 39 EmptyComponent({ emptyType: 10 })
40 - .height('100%') 40 + .height('80%')
41 .width('100%') 41 .width('100%')
42 }else{ 42 }else{
43 EmptyComponent({ emptyType: 1,emptyHeight:"100%" ,retry: () => { 43 EmptyComponent({ emptyType: 1,emptyHeight:"100%" ,retry: () => {
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 */
@@ -47,7 +47,7 @@ struct MyCollectionListPage { @@ -47,7 +47,7 @@ struct MyCollectionListPage {
47 }, 47 },
48 title:this.isAllSelect?'是否确认清空?':'确认删除'+this.deleteNum.toString()+'条收藏', 48 title:this.isAllSelect?'是否确认清空?':'确认删除'+this.deleteNum.toString()+'条收藏',
49 tipShow: false , 49 tipShow: false ,
50 - leftTextColor:$r('app.color.color_648DF2'), 50 + leftTextColor:$r('app.color.color_333333')
51 }), 51 }),
52 autoCancel: true, 52 autoCancel: true,
53 alignment: DialogAlignment.Center, 53 alignment: DialogAlignment.Center,
@@ -108,7 +108,9 @@ struct MyCollectionListPage { @@ -108,7 +108,9 @@ struct MyCollectionListPage {
108 this.allSelectDatas(isAllSelect) 108 this.allSelectDatas(isAllSelect)
109 }, 109 },
110 confirmCallback:()=>{ 110 confirmCallback:()=>{
111 - this.dialogController.open() 111 + if(this.deleteNum > 0){
  112 + this.dialogController.open()
  113 + }
112 } 114 }
113 }) 115 })
114 } 116 }
@@ -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 { ContentDTO , Action,GoldenPositionExtraBean, CompDTO} from 'wdBean';  
2 -import { CommonConstants ,ViewType} from 'wdConstant'; 1 +import { Action, CompDTO, ContentDTO } from 'wdBean';
  2 +import { CommonConstants, ViewType } from 'wdConstant';
3 import PageViewModel from '../../viewmodel/PageViewModel'; 3 import PageViewModel from '../../viewmodel/PageViewModel';
4 import PageModel from '../../viewmodel/PageModel'; 4 import PageModel from '../../viewmodel/PageModel';
5 -import { DateTimeUtils, LazyDataSource } from 'wdKit/Index';  
6 import router from '@ohos.router'; 5 import router from '@ohos.router';
7 import { CardParser } from '../CardParser'; 6 import { CardParser } from '../CardParser';
8 -import { channelSkeleton } from '../skeleton/channelSkeleton' 7 +import { channelSkeleton } from '../skeleton/channelSkeleton';
9 import { ErrorComponent } from '../view/ErrorComponent'; 8 import { ErrorComponent } from '../view/ErrorComponent';
10 import { EmptyComponent } from '../view/EmptyComponent'; 9 import { EmptyComponent } from '../view/EmptyComponent';
11 import { listTouchEvent } from '../../utils/PullDownRefresh'; 10 import { listTouchEvent } from '../../utils/PullDownRefresh';
@@ -14,13 +13,21 @@ import { RefreshLayoutBean } from '../refresh/RefreshLayoutBean'; @@ -14,13 +13,21 @@ import { RefreshLayoutBean } from '../refresh/RefreshLayoutBean';
14 import RefreshLayout from '../refresh/RefreshLayout'; 13 import RefreshLayout from '../refresh/RefreshLayout';
15 import PageNoMoreLayout from './PageNoMoreLayout'; 14 import PageNoMoreLayout from './PageNoMoreLayout';
16 import { NoMoreBean } from './NoMoreBean'; 15 import { NoMoreBean } from './NoMoreBean';
  16 +import CommonPageTitle from './CommonPageTitle';
  17 +import TemplatePageComponent from './template/TemplatePageComponent';
  18 +import { TemplatePageConstant } from './template/TemplatePageConstant';
17 19
18 const TAG: string = 'ThemeListPage'; 20 const TAG: string = 'ThemeListPage';
19 21
  22 +/**
  23 + * 金刚卡位聚合页
  24 + */
20 @Entry 25 @Entry
21 @Component 26 @Component
22 struct ThemeListPage { 27 struct ThemeListPage {
23 - @State private pageModel: PageModel = new PageModel(); 28 + @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') as number;
  29 + @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
  30 + // @State private pageModel: PageModel = new PageModel();
24 sort: number = 1; 31 sort: number = 1;
25 currentPage: number = 1; 32 currentPage: number = 1;
26 pageSize: number = 20; 33 pageSize: number = 20;
@@ -29,129 +36,27 @@ struct ThemeListPage { @@ -29,129 +36,27 @@ struct ThemeListPage {
29 @State private pageAdvModel: PageAdModel = new PageAdModel(); 36 @State private pageAdvModel: PageAdModel = new PageAdModel();
30 37
31 aboutToAppear(): void { 38 aboutToAppear(): void {
32 - let par:Action = router.getParams() as Action; 39 + let par: Action = router.getParams() as Action;
33 let params = par?.params; 40 let params = par?.params;
34 this.extra = params?.extra?.extra || ''; 41 this.extra = params?.extra?.extra || '';
35 this.title = params?.extra?.title || ''; 42 this.title = params?.extra?.title || '';
36 43
37 - this.pageModel.pageType = 1;  
38 - this.pageModel.extra = this.extra;  
39 -  
40 - PageViewModel.postThemeList(this.currentPage, this.pageSize,this.extra).then((liveReviewDTO) => {  
41 - console.log(`postThemeList${JSON.stringify(liveReviewDTO)}`)  
42 - this.pageModel.compList.addItems(liveReviewDTO.list)  
43 - if(this.pageModel.compList.getDataArray().length > 0){  
44 - this.pageModel.viewType = ViewType.LOADED;  
45 - }else{  
46 - this.pageModel.viewType = ViewType.EMPTY  
47 - }  
48 - })  
49 } 44 }
50 45
51 build() { 46 build() {
  47 +
52 Column() { 48 Column() {
53 - this.TabbarNormal()  
54 - if (this.pageModel.viewType == ViewType.LOADING) {  
55 - this.LoadingLayout()  
56 - } else if (this.pageModel.viewType == ViewType.ERROR) {  
57 - ErrorComponent()  
58 - } else if (this.pageModel.viewType == ViewType.EMPTY) {  
59 - EmptyComponent()  
60 - } else {  
61 - this.ListLayout()  
62 - }  
63 - }  
64 - .padding({  
65 - bottom: $r('app.float.card_comp_pagePadding_tb')  
66 - })  
67 - .onTouch((event: TouchEvent | undefined) => {  
68 - if (event) {  
69 - if (this.pageModel.viewType === ViewType.LOADED) {  
70 - listTouchEvent(this.pageModel, this.pageAdvModel, event);  
71 - }  
72 - }  
73 - })  
74 - }  
75 - @Builder  
76 - LoadingLayout() {  
77 - channelSkeleton()  
78 - }  
79 - /*导航栏*/  
80 - @Builder  
81 - TabbarNormal() {  
82 - RelativeContainer() {  
83 - //标题栏目  
84 - Image($r('app.media.icon_arrow_left'))  
85 - .width(24)  
86 - .height(24)  
87 - .objectFit(ImageFit.Auto)  
88 - .id("back_icon")  
89 - .alignRules({  
90 - center: { anchor: "__container__", align: VerticalAlign.Center },  
91 - left: { anchor: "__container__", align: HorizontalAlign.Start }  
92 - })  
93 - .onClick(() => {  
94 - router.back()  
95 - })  
96 49
97 - Text(this.title)// .height('42lpx')  
98 - .maxLines(1)  
99 - .id("title")  
100 - .fontSize('35lpx')  
101 - .fontWeight(400)  
102 - .fontColor($r('app.color.color_222222'))  
103 - .lineHeight('42lpx')  
104 - .alignRules({  
105 - center: { anchor: "__container__", align: VerticalAlign.Center },  
106 - middle: { anchor: "__container__", align: HorizontalAlign.Center }  
107 - }) 50 + //常见标题
  51 + CommonPageTitle({ title: this.title })
  52 + // 通用模板组件
  53 + TemplatePageComponent({ pageDataSourceType: TemplatePageConstant.THEME_LIST_PAGE, extra: this.extra })
108 } 54 }
109 - .height(44)  
110 - .width('100%') 55 + .height('100%')
  56 + .backgroundColor(Color.White)
111 .padding({ 57 .padding({
112 - left: $r('app.float.card_comp_pagePadding_lf'),  
113 - right: $r('app.float.card_comp_pagePadding_lf'),  
114 - })  
115 - }  
116 -  
117 - @Builder  
118 - ListLayout() {  
119 - List() {  
120 - // 下拉刷新  
121 - ListItem() {  
122 - RefreshLayout({  
123 - refreshBean: new RefreshLayoutBean(this.pageModel.isVisiblePullDown, this.pageModel.load,  
124 - this.pageModel.offsetY)  
125 - })  
126 - }  
127 -  
128 - LazyForEach(this.pageModel.compList, (contentDTO: ContentDTO, contentIndex: number) => {  
129 - ListItem() {  
130 - Column() {  
131 - CardParser({compDTO:new CompDTO, contentDTO });  
132 - }  
133 - }  
134 - },  
135 - (contentDTO: ContentDTO, contentIndex: number) => contentDTO.pageId + contentIndex.toString()  
136 - )  
137 - // 加载更多  
138 - ListItem() {  
139 - if (this.pageModel.hasMore) {  
140 - // LoadMoreLayout({  
141 - // refreshBean: new RefreshLayoutBean(this.pageModel.isVisiblePullUpLoad, this.pageModel.pullUpLoadImage,  
142 - // this.pageModel.pullUpLoadText, this.pageModel.pullUpLoadHeight)  
143 - // })  
144 - } else {  
145 - PageNoMoreLayout({ noMoreBean: new NoMoreBean(this.pageModel.pageInfo.baselineCopywriting) })  
146 - }  
147 - }  
148 - }  
149 - .scrollBar(BarState.Off)  
150 - .cachedCount(8)  
151 - .height(CommonConstants.FULL_PARENT)  
152 - .onScrollIndex((start: number, end: number) => {  
153 - this.pageModel.startIndex = start;  
154 - this.pageModel.endIndex = end; 58 + top: px2vp(this.topSafeHeight),
  59 + bottom: px2vp(this.bottomSafeHeight)
155 }) 60 })
156 } 61 }
157 } 62 }
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,13 +709,17 @@ export struct TopNavigationComponentNew { @@ -653,13 +709,17 @@ export struct TopNavigationComponentNew {
653 this.currentTopNavSelectedIndex = index 709 this.currentTopNavSelectedIndex = index
654 } 710 }
655 711
656 - // 存储我的频道栏目中的频道id信息  
657 - let channelIds: number [] = []  
658 - this.myChannelList.forEach(item => {  
659 - if (item != undefined && item.channelId != undefined) {  
660 - channelIds.push(item.channelId)  
661 - }  
662 - })  
663 - AppStorage.setOrCreate('channelIds', channelIds.join(',')) 712 + if (isNetData) {
  713 + // 存储我的频道栏目中的频道id信息
  714 + Logger.debug(TAG, '存储我的频道栏目数据')
  715 + let channelIds: number [] = []
  716 + this.myChannelList.forEach(item => {
  717 + if (item != undefined && item.channelId != undefined) {
  718 + channelIds.push(item.channelId)
  719 + }
  720 + })
  721 + AppStorage.setOrCreate('channelIds', channelIds.join(','))
  722 + }
  723 +
664 } 724 }
665 } 725 }
1 -import { CompDTO, ContentDTO, LiveRoomDataBean, ReserveBean, ReserveItemBean } from 'wdBean/Index'  
2 -import { DateTimeUtils, Logger } from 'wdKit/Index'  
3 -import { HttpUtils } from 'wdNetwork/Index' 1 +import { CompDTO,
  2 + ContentBean,
  3 + ContentDTO,
  4 + InteractDataDTO,
  5 + InteractParam, LiveRoomDataBean, ReserveBean, ReserveItemBean } from 'wdBean/Index'
  6 +import { BaseDTO } from 'wdBean/src/main/ets/bean/component/BaseDTO'
  7 +import { CollectionUtils, DateTimeUtils, LazyDataSource, Logger, StringUtils } from 'wdKit/Index'
  8 +import { HttpUtils, ResponseDTO } from 'wdNetwork/Index'
  9 +import { PageRepository } from '../../../repository/PageRepository'
4 import { LiveModel } from '../../../viewmodel/LiveModel' 10 import { LiveModel } from '../../../viewmodel/LiveModel'
5 import PageViewModel from '../../../viewmodel/PageViewModel' 11 import PageViewModel from '../../../viewmodel/PageViewModel'
6 12
@@ -64,7 +70,6 @@ export class BasePageHelp { @@ -64,7 +70,6 @@ export class BasePageHelp {
64 * 请求获取直播房间的动态数据 70 * 请求获取直播房间的动态数据
65 * @param compList 71 * @param compList
66 */ 72 */
67 -  
68 getLiveRoomDataInfo(compList: CompDTO[]) { 73 getLiveRoomDataInfo(compList: CompDTO[]) {
69 74
70 let list: ContentDTO[] = [] 75 let list: ContentDTO[] = []
@@ -110,4 +115,143 @@ export class BasePageHelp { @@ -110,4 +115,143 @@ export class BasePageHelp {
110 }); 115 });
111 return idList.join(',') 116 return idList.join(',')
112 } 117 }
  118 +
  119 +/**
  120 + * 批查稿件的互动数据,如 评论人数等
  121 + * @param compList
  122 + * @returns
  123 + */
  124 + async getInteractData(compList: CompDTO[]) {
  125 + let param: InteractParam = this.getInteractParams(compList);
  126 + const SIZE = 20;
  127 + // 批查接口,参数size限制20,这里截断分批查询,0,20;20,40...
  128 + let count = Math.ceil(param.contentList.length / SIZE);
  129 + let promises: Array<Promise<InteractDataDTO[]>> = new Array;
  130 + if (count == 1) {
  131 + let promise: Promise<InteractDataDTO[]> = this.createInteractDataPromise(param);
  132 + promises.push(promise);
  133 + } else {
  134 + for (let i = 1; i <= count; i++) {
  135 + // 将查询参数截断(参数限制20个),分批请求接口
  136 + let subList = new Array<ContentBean>();
  137 + let start = 0;
  138 + let end = 0;
  139 + if (i == count) {
  140 + start = (i - 1) * SIZE;
  141 + end = param.contentList.length;
  142 + subList = CollectionUtils.getSubElements(param.contentList, start, end)
  143 + } else {
  144 + start = (i - 1) * SIZE;
  145 + end = start + SIZE;
  146 + subList = CollectionUtils.getSubElements(param.contentList, start, end)
  147 + }
  148 + let subParam: InteractParam = {} as InteractParam;
  149 + subParam.contentList = subList;
  150 + let promise: Promise<InteractDataDTO[]> = this.createInteractDataPromise(subParam);
  151 + promises.push(promise);
  152 + }
  153 + }
  154 +
  155 + return new Promise<InteractDataDTO[]>((success, error) => {
  156 + Promise.all(promises).then((result) => {
  157 + if (!CollectionUtils.isArray(result)) {
  158 + success(new Array<InteractDataDTO>());
  159 + return;
  160 + }
  161 +
  162 + let allInteractDataList: Array<InteractDataDTO> = new Array();
  163 + result.forEach((value: InteractDataDTO[]) => {
  164 + if (value != null && value.length > 0) {
  165 + allInteractDataList.push(...value);
  166 + }
  167 + })
  168 + // 批查全部完成,统一设置到comp里
  169 + // this.resetInteract(allInteractDataList, compList);
  170 + success(allInteractDataList);
  171 + })
  172 + })
  173 + }
  174 +
  175 + private getInteractParams(compList: CompDTO[]): InteractParam {
  176 + if (compList == null || compList.length == 0) {
  177 + return {} as InteractParam;
  178 + }
  179 +
  180 + let param: InteractParam = {} as InteractParam;
  181 + param.contentList = new Array<ContentBean>();
  182 + compList.forEach((value) => {
  183 + let contentList = value.operDataList;
  184 +
  185 + let letBatch = false
  186 + // 只有稿件才能批查
  187 + if (!Number.isNaN(Number(value.compStyle))) {
  188 + letBatch = true
  189 + }
  190 +
  191 + if (letBatch) {
  192 + if (contentList != null && contentList.length == 1) { // 对只有一条数据的稿件参与批查
  193 + contentList.forEach((v) => {
  194 + if (StringUtils.isNotEmpty(v.objectId)) {
  195 + let bean = {} as ContentBean;
  196 + bean.contentId = v.objectId;
  197 + bean.contentType = v.objectType;
  198 + param.contentList.push(bean);
  199 + }
  200 + })
  201 + }
  202 + }
  203 + })
  204 + return param;
  205 + }
  206 +
  207 + private createInteractDataPromise(param: InteractParam) {
  208 + return new Promise<InteractDataDTO[]>((success, error) => {
  209 + PageRepository.fetchInteractData(param).then((resDTO: ResponseDTO<InteractDataDTO[]>) => {
  210 + if (!resDTO || !resDTO.data) {
  211 + Logger.info(TAG, "getInteractData then,resDTO.timeStamp:" + resDTO.timestamp);
  212 + success([]);
  213 + return;
  214 + }
  215 + success(resDTO.data);
  216 + }).catch((err: Error) => {
  217 + Logger.error(TAG, `getInteractData catch, error.name : ${err.name}, error.message:${err.message}`);
  218 + // 无论是否成功(暂不做重试),都回调结果,通知刷新数据
  219 + success([]);
  220 + })
  221 + });
  222 + }
  223 +
  224 + /**
  225 + * 刷新互动数据到compList
  226 + * @param interact 批查互动数据结果
  227 + * @param compList comp list
  228 + */
  229 + resetInteract(interact: InteractDataDTO[], compList: BaseDTO[]) {
  230 + if (interact == null || interact.length == 0) {
  231 + return
  232 + }
  233 + let time = DateTimeUtils.getTimeStamp().toString()
  234 + interact.forEach((interactData) => {
  235 + let id = interactData.contentId;
  236 + outer: for (let i = 0; i < compList.length; i++) {
  237 + let comp = compList[i] as CompDTO;
  238 + if (comp == null || comp.operDataList == null || comp.operDataList.length == 0) {
  239 + continue;
  240 + }
  241 + for (let j = 0; j < comp.operDataList.length; j++) {
  242 + let content = comp.operDataList[j];
  243 + if (content == null) {
  244 + continue;
  245 + }
  246 + if (id == content.objectId) {
  247 + content.interactData = interactData;
  248 + comp.timestamp = time
  249 + break outer;
  250 + }
  251 + }
  252 + }
  253 + })
  254 + }
  255 +
  256 +
113 } 257 }
@@ -23,6 +23,7 @@ const TAG: string = 'TemplatePageComponent'; @@ -23,6 +23,7 @@ const TAG: string = 'TemplatePageComponent';
23 */ 23 */
24 @Component 24 @Component
25 export default struct TemplatePageComponent { 25 export default struct TemplatePageComponent {
  26 +
26 // 模板页面的数据驱动对象 27 // 模板页面的数据驱动对象
27 @State private templatePage: TemplatePageModel = new TemplatePageModel 28 @State private templatePage: TemplatePageModel = new TemplatePageModel
28 // 此内容主要因CustomPullToRefresh需要,目前没任何业务意义要求 29 // 此内容主要因CustomPullToRefresh需要,目前没任何业务意义要求
@@ -31,11 +32,14 @@ export default struct TemplatePageComponent { @@ -31,11 +32,14 @@ export default struct TemplatePageComponent {
31 private templateScroller: Scroller = new Scroller() 32 private templateScroller: Scroller = new Scroller()
32 //识别不同页面的业务类型 33 //识别不同页面的业务类型
33 pageDataSourceType: string = '' 34 pageDataSourceType: string = ''
  35 +
34 @State listColor: Resource = $r('app.color.color_fff') 36 @State listColor: Resource = $r('app.color.color_fff')
35 // 埋点字段 37 // 埋点字段
36 pageId: string = '' 38 pageId: string = ''
37 pageName: string = '' 39 pageName: string = ''
38 40
  41 + extra: string = ''
  42 +
39 async aboutToAppear() { 43 async aboutToAppear() {
40 Logger.debug(TAG, 'aboutToAppear') 44 Logger.debug(TAG, 'aboutToAppear')
41 this.requestPageData() 45 this.requestPageData()
@@ -81,8 +85,6 @@ export default struct TemplatePageComponent { @@ -81,8 +85,6 @@ export default struct TemplatePageComponent {
81 if (this.templatePage.pageCompType === TemplatePageStateType.LOADING) { 85 if (this.templatePage.pageCompType === TemplatePageStateType.LOADING) {
82 this.LoadingLayout() 86 this.LoadingLayout()
83 } else if (this.templatePage.pageCompType === TemplatePageStateType.LOADED) { 87 } else if (this.templatePage.pageCompType === TemplatePageStateType.LOADED) {
84 -  
85 -  
86 CustomPullToRefresh({ 88 CustomPullToRefresh({
87 alldata: this.pageData, 89 alldata: this.pageData,
88 scroller: this.templateScroller, 90 scroller: this.templateScroller,
@@ -123,6 +125,7 @@ export default struct TemplatePageComponent { @@ -123,6 +125,7 @@ export default struct TemplatePageComponent {
123 125
124 CompParser({ 126 CompParser({
125 compDTO: compDTO, 127 compDTO: compDTO,
  128 + nextCompDTO: index === this.templatePage.compList.getDataArray().length - 1 ? new CompDTO() : this.templatePage.compList.get(index + 1) as CompDTO,
126 compIndex: index, 129 compIndex: index,
127 pageId: this.pageId, 130 pageId: this.pageId,
128 pageName: this.pageName 131 pageName: this.pageName
@@ -167,6 +170,7 @@ export default struct TemplatePageComponent { @@ -167,6 +170,7 @@ export default struct TemplatePageComponent {
167 } 170 }
168 171
169 this.templatePage.pageDataSourceType = this.pageDataSourceType 172 this.templatePage.pageDataSourceType = this.pageDataSourceType
  173 + this.templatePage.extra = this.extra
170 174
171 TemplatePageHelp.requestPageData(this.templatePage) 175 TemplatePageHelp.requestPageData(this.templatePage)
172 } 176 }
@@ -18,4 +18,10 @@ export class TemplatePageConstant { @@ -18,4 +18,10 @@ export class TemplatePageConstant {
18 public static LIVE_PORTEND_PAGE :string = 'live_portend_page' 18 public static LIVE_PORTEND_PAGE :string = 'live_portend_page'
19 19
20 20
  21 + /**
  22 + * 金刚卡位聚会页
  23 + */
  24 + public static THEME_LIST_PAGE :string = 'theme_list_page'
  25 +
  26 +
21 } 27 }
1 -import { CompDTO } from 'wdBean/Index'; 1 +import { CompDTO, InteractDataDTO } from 'wdBean/Index';
2 import { CompStyle } from 'wdConstant/Index'; 2 import { CompStyle } from 'wdConstant/Index';
3 import { DateTimeUtils, NetworkUtil } from 'wdKit/Index'; 3 import { DateTimeUtils, NetworkUtil } from 'wdKit/Index';
4 import PageViewModel from '../../../viewmodel/PageViewModel'; 4 import PageViewModel from '../../../viewmodel/PageViewModel';
@@ -40,8 +40,8 @@ export class TemplatePageHelp extends BasePageHelp { @@ -40,8 +40,8 @@ export class TemplatePageHelp extends BasePageHelp {
40 // 加载缓存数据了,不用无网络提示 40 // 加载缓存数据了,不用无网络提示
41 } else { 41 } else {
42 // 无网情况 42 // 无网情况
43 - pageModel.pageCompType = TemplatePageStateType.OTHER;  
44 - pageModel.noNormalState = WDViewDefaultType.WDViewDefaultType_NoNetwork 43 + this.pageModel.pageCompType = TemplatePageStateType.OTHER
  44 + this.pageModel.noNormalState = WDViewDefaultType.WDViewDefaultType_NoNetwork
45 } 45 }
46 } 46 }
47 47
@@ -61,6 +61,9 @@ export class TemplatePageHelp extends BasePageHelp { @@ -61,6 +61,9 @@ export class TemplatePageHelp extends BasePageHelp {
61 } else if (this.pageModel.pageDataSourceType === TemplatePageConstant.LIVE_PORTEND_PAGE) { 61 } else if (this.pageModel.pageDataSourceType === TemplatePageConstant.LIVE_PORTEND_PAGE) {
62 // 直播预告 62 // 直播预告
63 this.requestLivePortendData(this.pageModel.resolve) 63 this.requestLivePortendData(this.pageModel.resolve)
  64 + } else if (this.pageModel.pageDataSourceType === TemplatePageConstant.THEME_LIST_PAGE) {
  65 + // 金刚卡位聚合页
  66 + this.requestThemeListData(this.pageModel.resolve)
64 } 67 }
65 68
66 } 69 }
@@ -171,15 +174,80 @@ export class TemplatePageHelp extends BasePageHelp { @@ -171,15 +174,80 @@ export class TemplatePageHelp extends BasePageHelp {
171 this.pageModel.isLoading = false 174 this.pageModel.isLoading = false
172 } 175 }
173 176
  177 +
  178 + /**
  179 + * 请求金刚卡位聚合页数据
  180 + */
  181 + private async requestThemeListData(resolve?: (value: string | PromiseLike<string>) => void) {
  182 +
  183 + this.pageModel.isLoading = true
  184 +
  185 + const liveReviewDTO =
  186 + await PageViewModel.postThemeList(this.pageModel.currentPage, this.pageModel.pageSize, this.pageModel.extra)
  187 +
  188 + if (liveReviewDTO && liveReviewDTO.list && liveReviewDTO.list.length > 0) {
  189 +
  190 + if (liveReviewDTO.list.length === this.pageModel.pageSize) {
  191 + this.pageModel.hasMore = true
  192 + } else {
  193 + this.pageModel.hasMore = false
  194 + }
  195 +
  196 + // 依据业务请求获取的数据,转换成compDTO数据
  197 + let time = DateTimeUtils.getTimeStamp().toString()
  198 + let pageContentList: CompDTO[] = [] // 收集页面组件、稿件和本地组件容器
  199 + for (let contentDto of liveReviewDTO.list) {
  200 + let compDTO: CompDTO = new CompDTO()
  201 + compDTO.compType = 'appStyle'
  202 + contentDto.appStyle = contentDto.appStyle
  203 + if (this.pageModel.isEmitter) {
  204 + contentDto.timestamp = time
  205 + }
  206 + compDTO.operDataList.push(contentDto)
  207 +
  208 + pageContentList.push(compDTO)
  209 + }
  210 +
  211 + // 推送数据到懒加载机制
  212 + this.pushDataToPage(pageContentList)
  213 +
  214 + // 批查
  215 + this.allCompBatchRequest(pageContentList)
  216 +
  217 +
  218 + } else {
  219 +
  220 + this.pageModel.hasMore = false
  221 + if (this.pageModel.currentPage === 1) {
  222 + // 无业务数据
  223 + this.pageNoHaveData()
  224 + this.pageModel.pageCompType = TemplatePageStateType.OTHER
  225 + this.pageModel.noNormalState = WDViewDefaultType.WDViewDefaultType_NoContent2
  226 + }
  227 + }
  228 +
  229 + this.resolveEnd(resolve)
  230 +
  231 + // 完成业务请求加载
  232 + this.pageModel.isLoading = false
  233 + }
  234 +
174 /** 235 /**
175 * 处理页面批查业务方法 236 * 处理页面批查业务方法
176 * @param list 237 * @param list
177 */ 238 */
178 private allCompBatchRequest(compList: CompDTO[]) { 239 private allCompBatchRequest(compList: CompDTO[]) {
179 240
180 - // 获取直播房间的动态数据 241 + // 获取直播房间的动态数据 如直播观看人数
181 this.getLiveRoomDataInfo(compList) 242 this.getLiveRoomDataInfo(compList)
182 243
  244 + // 获取互动数据,如评论数量等
  245 + this.getInteractData(compList).then((data: InteractDataDTO[]) => {
  246 + // 刷新,替换所有数据
  247 + this.resetInteract(data, compList)
  248 +
  249 + })
  250 +
183 } 251 }
184 252
185 253
@@ -207,9 +275,10 @@ export class TemplatePageHelp extends BasePageHelp { @@ -207,9 +275,10 @@ export class TemplatePageHelp extends BasePageHelp {
207 */ 275 */
208 private pageNoHaveData() { 276 private pageNoHaveData() {
209 this.pageModel.pageCompType = TemplatePageStateType.OTHER 277 this.pageModel.pageCompType = TemplatePageStateType.OTHER
210 - this.pageModel.noNormalState = WDViewDefaultType.WDViewDefaultType_NoNetwork 278 + this.pageModel.noNormalState = WDViewDefaultType.WDViewDefaultType_NoListContent
211 } 279 }
212 280
  281 +
213 /** 282 /**
214 * 解析结束 283 * 解析结束
215 * @param resolve 284 * @param resolve
@@ -33,6 +33,9 @@ export default class TemplatePageModel { @@ -33,6 +33,9 @@ export default class TemplatePageModel {
33 haveDataShow: boolean = false 33 haveDataShow: boolean = false
34 // 接收Emitter事件,需要刷新界面,此时就需要对展示业务进行驱动更新 34 // 接收Emitter事件,需要刷新界面,此时就需要对展示业务进行驱动更新
35 isEmitter: boolean = false 35 isEmitter: boolean = false
  36 +
  37 + // 扩展字段
  38 + extra :string = ''
36 /** 39 /**
37 * 此字段可驱动组件展示不同业务的组件, 40 * 此字段可驱动组件展示不同业务的组件,
38 */ 41 */
@@ -41,5 +44,6 @@ export default class TemplatePageModel { @@ -41,5 +44,6 @@ export default class TemplatePageModel {
41 * 异常状态 ——> 记录在获取数据中的不同状态,如无数据、无网络等情况 44 * 异常状态 ——> 记录在获取数据中的不同状态,如无数据、无网络等情况
42 */ 45 */
43 noNormalState: WDViewDefaultType = WDViewDefaultType.WDViewDefaultType_Default 46 noNormalState: WDViewDefaultType = WDViewDefaultType.WDViewDefaultType_Default
  47 +
44 resolve?: (value: string | PromiseLike<string>) => void 48 resolve?: (value: string | PromiseLike<string>) => void
45 } 49 }
@@ -49,7 +49,7 @@ export struct MineSettingComponent { @@ -49,7 +49,7 @@ export struct MineSettingComponent {
49 title: "清理缓存", 49 title: "清理缓存",
50 tipValue:"是否确认清理此App的缓存", 50 tipValue:"是否确认清理此App的缓存",
51 tipShow:true, 51 tipShow:true,
52 - leftTextColor:$r('app.color.color_648DF2') 52 + leftTextColor:$r('app.color.color_333333')
53 }), 53 }),
54 autoCancel: true, 54 autoCancel: true,
55 alignment: DialogAlignment.Center, 55 alignment: DialogAlignment.Center,
@@ -33,7 +33,7 @@ export struct CustomBottomFuctionUI { @@ -33,7 +33,7 @@ export struct CustomBottomFuctionUI {
33 33
34 Button('删除'+ (this.deleteNum === 0 ? '':'('+this.deleteNum.toString()+')')) 34 Button('删除'+ (this.deleteNum === 0 ? '':'('+this.deleteNum.toString()+')'))
35 .type(ButtonType.Normal) 35 .type(ButtonType.Normal)
36 - .fontColor(this.deleteNum === 0?$r('app.color.color_222222'):$r('app.color.color_ED2800')) 36 + .fontColor(this.deleteNum === 0?$r('app.color.color_B0B0B0'):$r('app.color.color_ED2800'))
37 .backgroundColor(Color.White) 37 .backgroundColor(Color.White)
38 .id("delete_Button") 38 .id("delete_Button")
39 .alignRules({ 39 .alignRules({
@@ -129,7 +129,7 @@ export struct EmptyComponent { @@ -129,7 +129,7 @@ export struct EmptyComponent {
129 .fontWeight(FontWeight.Normal) 129 .fontWeight(FontWeight.Normal)
130 .opacity(this.TEXT_OPACITY) 130 .opacity(this.TEXT_OPACITY)
131 .margin({ top: this.EMPTY_TIP_TEXT_MARGIN_TOP }) 131 .margin({ top: this.EMPTY_TIP_TEXT_MARGIN_TOP })
132 - .fontColor(this.emptyType !== 15 ? '#FFCCCCCC' : '#999999') 132 + .fontColor('#666666')
133 .onClick((event: ClickEvent) => { 133 .onClick((event: ClickEvent) => {
134 Logger.info(TAG, `noProgrammeData onClick event?.source: ${event.source}`); 134 Logger.info(TAG, `noProgrammeData onClick event?.source: ${event.source}`);
135 }) 135 })
@@ -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 {
@@ -296,22 +296,28 @@ export class PageViewModel extends BaseViewModel { @@ -296,22 +296,28 @@ export class PageViewModel extends BaseViewModel {
296 }) 296 })
297 }) 297 })
298 } 298 }
299 -  
300 - async postThemeList(pageNum: number, pageSize: number, extra: string): Promise<LiveReviewDTO> { 299 + /**
  300 + * 金刚卡聚合页
  301 + * @param pageNum
  302 + * @param pageSize
  303 + * @param extra
  304 + * @returns
  305 + */
  306 + async postThemeList(pageNum: number, pageSize: number, extra: string): Promise<LiveReviewDTO | null> {
301 let bean: GoldenPositionExtraBean = JSON.parse(extra) 307 let bean: GoldenPositionExtraBean = JSON.parse(extra)
302 bean.pageNum = pageNum 308 bean.pageNum = pageNum
303 bean.pageSize = pageSize 309 bean.pageSize = pageSize
304 - return new Promise<LiveReviewDTO>((success, error) => { 310 + return new Promise<LiveReviewDTO| null>((success, error) => {
305 Logger.info(TAG, `postThemeList pageInfo start`); 311 Logger.info(TAG, `postThemeList pageInfo start`);
306 PageRepository.postThemeList(bean).then((resDTO) => { 312 PageRepository.postThemeList(bean).then((resDTO) => {
307 if (!resDTO || !resDTO.data) { 313 if (!resDTO || !resDTO.data) {
308 Logger.error(TAG, 'postThemeList then navResDTO is empty'); 314 Logger.error(TAG, 'postThemeList then navResDTO is empty');
309 - error('resDTO is empty'); 315 + success(null);
310 return 316 return
311 } 317 }
312 if (resDTO.code != 0) { 318 if (resDTO.code != 0) {
313 Logger.error(TAG, `postThemeList then code:${resDTO.code}, message:${resDTO.message}`); 319 Logger.error(TAG, `postThemeList then code:${resDTO.code}, message:${resDTO.message}`);
314 - error('resDTO Response Code is failure'); 320 + success(null);
315 return 321 return
316 } 322 }
317 // let navResStr = JSON.stringify(navResDTO); 323 // let navResStr = JSON.stringify(navResDTO);
@@ -319,7 +325,7 @@ export class PageViewModel extends BaseViewModel { @@ -319,7 +325,7 @@ export class PageViewModel extends BaseViewModel {
319 success(resDTO.data); 325 success(resDTO.data);
320 }).catch((err: Error) => { 326 }).catch((err: Error) => {
321 Logger.error(TAG, `postThemeList catch, error.name : ${err.name}, error.message:${err.message}`); 327 Logger.error(TAG, `postThemeList catch, error.name : ${err.name}, error.message:${err.message}`);
322 - error(err); 328 + success(null);
323 }) 329 })
324 }) 330 })
325 } 331 }
@@ -68,7 +68,9 @@ export struct DetailPlayShortVideoPage { @@ -68,7 +68,9 @@ export struct DetailPlayShortVideoPage {
68 this.queryNewsInfoOfUser() 68 this.queryNewsInfoOfUser()
69 if (this.switchVideoStatus && this.isPlay && this.onlyWifiLoadVideo) { 69 if (this.switchVideoStatus && this.isPlay && this.onlyWifiLoadVideo) {
70 await this.playerController.play() 70 await this.playerController.play()
71 - this.imageVisible = false 71 + await this.playerController.startRenderFrame(() => {
  72 + this.imageVisible = false
  73 + })
72 } 74 }
73 } 75 }
74 } 76 }
@@ -81,7 +83,9 @@ export struct DetailPlayShortVideoPage { @@ -81,7 +83,9 @@ export struct DetailPlayShortVideoPage {
81 if (this.currentIndex === this.index) { 83 if (this.currentIndex === this.index) {
82 if (this.switchVideoStatus && this.isPlay && this.onlyWifiLoadVideo) { 84 if (this.switchVideoStatus && this.isPlay && this.onlyWifiLoadVideo) {
83 await this.playerController.play() 85 await this.playerController.play()
84 - this.imageVisible = false 86 + await this.playerController.startRenderFrame(() => {
  87 + this.imageVisible = false
  88 + })
85 } else { 89 } else {
86 this.playerController.pause() 90 this.playerController.pause()
87 } 91 }
@@ -106,14 +110,18 @@ export struct DetailPlayShortVideoPage { @@ -106,14 +110,18 @@ export struct DetailPlayShortVideoPage {
106 this.playerController.onCanplay = async () => { 110 this.playerController.onCanplay = async () => {
107 this.ratio = this.playerController.videoWidth / this.playerController.videoHeight 111 this.ratio = this.playerController.videoWidth / this.playerController.videoHeight
108 await this.playerController.play() 112 await this.playerController.play()
109 - this.imageVisible = false 113 + await this.playerController.startRenderFrame(() => {
  114 + this.imageVisible = false
  115 + })
110 } 116 }
111 } else { 117 } else {
112 if (!this.onlyWifiLoadVideo) { 118 if (!this.onlyWifiLoadVideo) {
113 await this.playerController.pause() 119 await this.playerController.pause()
114 } else { 120 } else {
115 await this.playerController.play() 121 await this.playerController.play()
116 - this.imageVisible = false 122 + await this.playerController.startRenderFrame(() => {
  123 + this.imageVisible = false
  124 + })
117 } 125 }
118 } 126 }
119 } 127 }
@@ -186,7 +194,9 @@ export struct DetailPlayShortVideoPage { @@ -186,7 +194,9 @@ export struct DetailPlayShortVideoPage {
186 await this.playerController.pause() 194 await this.playerController.pause()
187 } else { 195 } else {
188 await this.playerController.play() 196 await this.playerController.play()
189 - this.imageVisible = false 197 + await this.playerController.startRenderFrame(() => {
  198 + this.imageVisible = false
  199 + })
190 } 200 }
191 } 201 }
192 } 202 }
@@ -363,7 +373,9 @@ export struct DetailPlayShortVideoPage { @@ -363,7 +373,9 @@ export struct DetailPlayShortVideoPage {
363 this.onlyWifiLoadVideo = true 373 this.onlyWifiLoadVideo = true
364 this.toastTextVisible = false 374 this.toastTextVisible = false
365 this.playerController?.play() 375 this.playerController?.play()
366 - this.imageVisible = false 376 + this.playerController.startRenderFrame(() => {
  377 + this.imageVisible = false
  378 + })
367 }) 379 })
368 } 380 }
369 .width('100%') 381 .width('100%')
@@ -142,6 +142,16 @@ export struct PlayerFullScreenView { @@ -142,6 +142,16 @@ export struct PlayerFullScreenView {
142 .margin({ left: 16, right: 8 }) 142 .margin({ left: 16, right: 8 })
143 143
144 PlayerProgressFullScreenView({ playerController: this.playerController }).layoutWeight(1) 144 PlayerProgressFullScreenView({ playerController: this.playerController }).layoutWeight(1)
  145 + .onTouch((event?: TouchEvent) => {
  146 + if (event) {
  147 + if (event.type === TouchType.Down) {
  148 + clearInterval(this.timer)
  149 + }
  150 + if (event.type === TouchType.Up) {
  151 + this.restartTimer();
  152 + }
  153 + }
  154 + })
145 155
146 Text(DateTimeUtils.secondToTime(this.videoDuration)) 156 Text(DateTimeUtils.secondToTime(this.videoDuration))
147 .fontSize(12) 157 .fontSize(12)
@@ -250,6 +250,13 @@ export class WDPlayerController { @@ -250,6 +250,13 @@ export class WDPlayerController {
250 this.avPlayer?.play(); 250 this.avPlayer?.play();
251 } 251 }
252 252
  253 + async startRenderFrame(cb: Function) {
  254 + this.avPlayer?.on('startRenderFrame', () => {
  255 + cb && cb();
  256 + console.info('startRenderFrame success')
  257 + })
  258 + }
  259 +
253 async stop() { 260 async stop() {
254 // if (this.avPlayer == null) { 261 // if (this.avPlayer == null) {
255 // await this.initPromise; 262 // await this.initPromise;
@@ -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
@@ -9,6 +9,8 @@ const TAG = 'DefaultWebPage' @@ -9,6 +9,8 @@ const TAG = 'DefaultWebPage'
9 @Entry 9 @Entry
10 @Component 10 @Component
11 struct DefaultWebPage { 11 struct DefaultWebPage {
  12 + @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') as number;
  13 + @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
12 webviewControl: BridgeWebViewControl = new BridgeWebViewControl() 14 webviewControl: BridgeWebViewControl = new BridgeWebViewControl()
13 scroller: Scroller = new Scroller(); 15 scroller: Scroller = new Scroller();
14 action: Action = {} as Action 16 action: Action = {} as Action
@@ -24,24 +26,28 @@ struct DefaultWebPage { @@ -24,24 +26,28 @@ struct DefaultWebPage {
24 isPageEnd: $isPageEnd 26 isPageEnd: $isPageEnd
25 }) 27 })
26 }.layoutWeight(1) 28 }.layoutWeight(1)
27 - .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP]) 29 +
28 30
29 Row() { 31 Row() {
30 - Button({type: ButtonType.Normal}) { 32 + Button({ type: ButtonType.Normal }) {
31 Image($r("app.media.back_icon_black")) 33 Image($r("app.media.back_icon_black"))
32 .width(20).height(25) 34 .width(20).height(25)
33 }.height(44).width(44) 35 }.height(44).width(44)
34 .backgroundColor(Color.White) 36 .backgroundColor(Color.White)
35 - .onClick(() => {  
36 - router.back()  
37 - }) 37 + .onClick(() => {
  38 + router.back()
  39 + })
  40 +
38 Blank() 41 Blank()
39 }.width("100%").height(44) 42 }.width("100%").height(44)
40 .alignItems(VerticalAlign.Center) 43 .alignItems(VerticalAlign.Center)
41 .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM]) 44 .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
42 } 45 }
43 .width(CommonConstants.FULL_WIDTH) 46 .width(CommonConstants.FULL_WIDTH)
44 - .height(CommonConstants.FULL_HEIGHT) 47 + .height(CommonConstants.FULL_HEIGHT).padding({
  48 + top: px2vp(this.topSafeHeight),
  49 + bottom: px2vp(this.bottomSafeHeight)
  50 + })
45 } 51 }
46 52
47 aboutToAppear() { 53 aboutToAppear() {