陈剑华

Merge remote-tracking branch 'origin/main'

Showing 20 changed files with 600 additions and 475 deletions
@@ -2,26 +2,26 @@ @@ -2,26 +2,26 @@
2 * 顶导 2 * 顶导
3 */ 3 */
4 export class TopNavDTO { 4 export class TopNavDTO {
5 - channelId: number = 0;  
6 - channelStyle: number = 0; 5 + channelId: number = 0; //频道id
  6 + channelStyle: number = 0; //频道样式;1-沉浸式;2-信息流
7 channelType: number = 0; // 频道样式;1-沉浸式;2-信息流;3-特殊频道(跳转指定页面的,如版面) 7 channelType: number = 0; // 频道样式;1-沉浸式;2-信息流;3-特殊频道(跳转指定页面的,如版面)
8 - defaultPermitted: number = 0;  
9 - delPermitted: number = 0; 8 + defaultPermitted: number = 0; //允许设置为默认首页 0:否, 1:是;【首页设置频道】
  9 + delPermitted: number = 0; //允许删除 0:否, 1:是;【撤销属性】
10 fontCColor: string = ''; // 频道展示样式颜色(选中状态) 10 fontCColor: string = ''; // 频道展示样式颜色(选中状态)
11 fontColor: string = ''; // 频道展示样式颜色(未选中状态) 11 fontColor: string = ''; // 频道展示样式颜色(未选中状态)
12 - headlinesOn: number = 0;  
13 - homeChannel: string = '';  
14 - iconUrlSize: string = '';  
15 - iconCUrlSize: string = ''; 12 + headlinesOn: number = 0; //头条标识 0:否, 1:是;【是否头条=是的频道,固定排序在第一位,且不可移出/移动】
  13 + homeChannel: string = ''; //必须 是否首页设置;0否,1是
  14 + iconUrlSize: string = ''; // 选中图片的大小
  15 + iconCUrlSize: string = ''; // 未选中图片的大小
16 iconUrl: string = ''; // 频道图片展示样式图片相对地址(未选中状态) 16 iconUrl: string = ''; // 频道图片展示样式图片相对地址(未选中状态)
17 - iconCUrl: string = ''; //频道图片展示样式图片相对地址(选中状态  
18 - localChannel: string = '';  
19 - moreChannel: string = '';  
20 - movePermitted: number = 0;  
21 - myChannel: string = '';  
22 - name: string = '';  
23 - num: number = 0;  
24 - pageId: number = 0; 17 + iconCUrl: string = ''; //频道图片展示样式图片相对地址(选中状态)
  18 + localChannel: string = ''; // 必须 是否地方频道栏目;0否,1是
  19 + moreChannel: string = ''; // 必须 是否更多栏目;0否,1是
  20 + movePermitted: number = 0; //允许移动 0:否, 1:是;【位置属性】
  21 + myChannel: string = '';// 必须 是否我的栏目;0否,1是
  22 + name: string = ''; //频道名称
  23 + num: number = 0; //首页设置根据这个排序20230828
  24 + pageId: number = 0; //频道关联页面id
25 pageType: string = ''; 25 pageType: string = '';
26 underlineCColor: string = ''; // 选中下划线颜色 26 underlineCColor: string = ''; // 选中下划线颜色
27 } 27 }
@@ -91,14 +91,14 @@ export struct MorningEveningPaperComponent { @@ -91,14 +91,14 @@ export struct MorningEveningPaperComponent {
91 private AudioSuspension = new AudioSuspensionModel() 91 private AudioSuspension = new AudioSuspensionModel()
92 92
93 onCancel() { 93 onCancel() {
94 - Logger.info(TAG, "cj2024 onCancel = ") 94 + console.log(TAG, "cj2024 onCancel = ")
95 } 95 }
96 96
97 /** 97 /**
98 * 回调无用 98 * 回调无用
99 **/ 99 **/
100 onConfirm() { 100 onConfirm() {
101 - Logger.info(TAG, "cj2024 onConfirm = ") 101 + console.log(TAG, "cj2024 onConfirm = ")
102 // if (this.playerController != undefined) { 102 // if (this.playerController != undefined) {
103 // 103 //
104 // } 104 // }
@@ -108,10 +108,10 @@ export struct MorningEveningPaperComponent { @@ -108,10 +108,10 @@ export struct MorningEveningPaperComponent {
108 108
109 // 续播判断 109 // 续播判断
110 changeContinue() { 110 changeContinue() {
111 - Logger.info(TAG, "cj2024 changeContinue = 1") 111 + console.log(TAG, "cj2024 changeContinue = 1")
112 // if (this.nextContId) { 112 // if (this.nextContId) {
113 this.playerController.continue = () => { 113 this.playerController.continue = () => {
114 - Logger.info(TAG, "cj2024 changeContinue = 2") 114 + console.log(TAG, "cj2024 changeContinue = 2")
115 this.playerController?.stop(); 115 this.playerController?.stop();
116 // this.playVM.playWithContentId(this.nextContId ?? ''); 116 // this.playVM.playWithContentId(this.nextContId ?? '');
117 } 117 }
@@ -130,8 +130,8 @@ export struct MorningEveningPaperComponent { @@ -130,8 +130,8 @@ export struct MorningEveningPaperComponent {
130 const dailyPaperTopicPageId = await SPHelper.default.getSync('dailyPaperTopicPageId', "") as String 130 const dailyPaperTopicPageId = await SPHelper.default.getSync('dailyPaperTopicPageId', "") as String
131 console.info(TAG, `aboutToAppear = ` + dailyPaperTopicPageId) 131 console.info(TAG, `aboutToAppear = ` + dailyPaperTopicPageId)
132 const currentTime = new Date().getTime() 132 const currentTime = new Date().getTime()
133 - Logger.info(TAG, "currentTime = " + currentTime)  
134 - Logger.info(TAG, `currentTime = ${currentTime}`) 133 + console.log(TAG, "currentTime = " + currentTime)
  134 + console.log(TAG, `currentTime = ${currentTime}`)
135 try { 135 try {
136 136
137 // let pageInfoBean = await MorningEveningViewModel.getMorningEveningPageInfo("" + this.dailyPaperTopicPageId) 137 // let pageInfoBean = await MorningEveningViewModel.getMorningEveningPageInfo("" + this.dailyPaperTopicPageId)
@@ -145,13 +145,13 @@ export struct MorningEveningPaperComponent { @@ -145,13 +145,13 @@ export struct MorningEveningPaperComponent {
145 let dateTime = DateTimeUtils.parseDate(this.pageInfoBean?.topicInfo?.topicDate ?? '', DateTimeUtils.PATTERN_DATE_HYPHEN) 145 let dateTime = DateTimeUtils.parseDate(this.pageInfoBean?.topicInfo?.topicDate ?? '', DateTimeUtils.PATTERN_DATE_HYPHEN)
146 const dateShow = new Date(dateTime) 146 const dateShow = new Date(dateTime)
147 this.subTitle = `${dateShow.getFullYear()}年\n${(dateShow.getMonth() + 1)}月${dateShow.getDate()}日` 147 this.subTitle = `${dateShow.getFullYear()}年\n${(dateShow.getMonth() + 1)}月${dateShow.getDate()}日`
148 - Logger.info(TAG, "pageInfoBean topicDate = " + this.pageInfoBean?.topicInfo?.topicDate)  
149 - Logger.info(TAG, "pageInfoBean title = " + this.pageInfoBean?.topicInfo?.title) 148 + console.log(TAG, "pageInfoBean topicDate = " + this.pageInfoBean?.topicInfo?.topicDate)
  149 + console.log(TAG, "pageInfoBean title = " + this.pageInfoBean?.topicInfo?.title)
150 150
151 - Logger.info(TAG, "pageInfoBean dateTime = " + dateTime)  
152 - Logger.info(TAG, "pageInfoBean subTitle = " + this.subTitle) 151 + console.log(TAG, "pageInfoBean dateTime = " + dateTime)
  152 + console.log(TAG, "pageInfoBean subTitle = " + this.subTitle)
153 153
154 - Logger.info(TAG, "this.pageInfoBean = " + JSON.stringify(this.pageInfoBean)) 154 + console.log(TAG, "this.pageInfoBean = " + JSON.stringify(this.pageInfoBean))
155 155
156 this.isHasTopView = this.pageInfoBean?.topicInfo?.frontLinkObject?true:false 156 this.isHasTopView = this.pageInfoBean?.topicInfo?.frontLinkObject?true:false
157 let coverUrl = this.isHasTopView?this.pageInfoBean?.topicInfo?.frontLinkObject?.coverUrl as string :'' 157 let coverUrl = this.isHasTopView?this.pageInfoBean?.topicInfo?.frontLinkObject?.coverUrl as string :''
@@ -159,21 +159,22 @@ export struct MorningEveningPaperComponent { @@ -159,21 +159,22 @@ export struct MorningEveningPaperComponent {
159 159
160 let compInfoBean = await MorningEveningViewModel.getMorningEveningCompInfo(pageInfoBean?.id, pageInfoBean?.groups[0]?.id, currentTime + "", pageInfoBean?.topicInfo?.topicId) 160 let compInfoBean = await MorningEveningViewModel.getMorningEveningCompInfo(pageInfoBean?.id, pageInfoBean?.groups[0]?.id, currentTime + "", pageInfoBean?.topicInfo?.topicId)
161 // this.compInfoBean = compInfoBean 161 // this.compInfoBean = compInfoBean
162 - Logger.info(TAG, "compInfoBean = " + JSON.stringify(compInfoBean)) 162 + console.log(TAG, "compInfoBean = " + JSON.stringify(compInfoBean))
163 if (compInfoBean?.compList[0]) { 163 if (compInfoBean?.compList[0]) {
164 this.compListItem = compInfoBean?.compList[0] 164 this.compListItem = compInfoBean?.compList[0]
165 - Logger.debug(TAG, '获取评论数据' + `${this.compListItem.operDataList.length}`) 165 + console.log(TAG, '获取评论数据' + `${this.compListItem.operDataList.length}`)
166 if (this.compListItem.operDataList && this.compListItem.operDataList.length > 0) { 166 if (this.compListItem.operDataList && this.compListItem.operDataList.length > 0) {
167 this.getAllContentInteractData(this.compListItem.operDataList) 167 this.getAllContentInteractData(this.compListItem.operDataList)
168 } 168 }
169 - Logger.debug(TAG, 'compInfoBean?.compList[0].audioDataList', JSON.stringify(compInfoBean?.compList[0].audioDataList)) 169 + console.log(TAG, 'compInfoBean?.compList[0].audioDataList', JSON.stringify(compInfoBean?.compList[0].audioDataList))
170 if (compInfoBean?.compList[0].audioDataList) { 170 if (compInfoBean?.compList[0].audioDataList) {
171 this.audioPlayUrl = compInfoBean?.compList[0].audioDataList[0].audioUrl 171 this.audioPlayUrl = compInfoBean?.compList[0].audioDataList[0].audioUrl
172 this.audioTitle = compInfoBean?.compList[0].audioDataList[0].title 172 this.audioTitle = compInfoBean?.compList[0].audioDataList[0].title
  173 + console.log(TAG, 'this.audioPlayUrl', this.audioPlayUrl)
173 } 174 }
174 } 175 }
175 176
176 - Logger.info(TAG, "compInfoBean compStyle = " + compInfoBean.compList[0].compStyle) 177 + console.log(TAG, "compInfoBean compStyle = " + compInfoBean.compList[0].compStyle)
177 this.playerController.onTimeUpdate = (position, duration) => { 178 this.playerController.onTimeUpdate = (position, duration) => {
178 this.currentTime = DateFormatUtil.secondToTime(position); 179 this.currentTime = DateFormatUtil.secondToTime(position);
179 this.totalTime = DateFormatUtil.secondToTime(duration); 180 this.totalTime = DateFormatUtil.secondToTime(duration);
@@ -203,10 +204,10 @@ export struct MorningEveningPaperComponent { @@ -203,10 +204,10 @@ export struct MorningEveningPaperComponent {
203 contentType: Number(item.objectType ?? '1') 204 contentType: Number(item.objectType ?? '1')
204 }) 205 })
205 }) 206 })
206 - Logger.debug(TAG, '获取评论数据' + `${JSON.stringify(params)}`) 207 + console.log(TAG, '获取评论数据' + `${JSON.stringify(params)}`)
207 208
208 this.commentList = await PeopleShipMainViewModel.getContentInteractInfo(params) 209 this.commentList = await PeopleShipMainViewModel.getContentInteractInfo(params)
209 - Logger.debug(TAG, '获取评论数据' + `${JSON.stringify(this.commentList)}`) 210 + console.log(TAG, '获取评论数据' + `${JSON.stringify(this.commentList)}`)
210 211
211 } catch (exception) { 212 } catch (exception) {
212 213
@@ -216,7 +217,7 @@ export struct MorningEveningPaperComponent { @@ -216,7 +217,7 @@ export struct MorningEveningPaperComponent {
216 async setComponentBgColor(imageUrl: string) { 217 async setComponentBgColor(imageUrl: string) {
217 // 图片转换为PixelMap对象 218 // 图片转换为PixelMap对象
218 // const pixelMap: image.PixelMap = await image2PixelMap(item.icon); 219 // const pixelMap: image.PixelMap = await image2PixelMap(item.icon);
219 - Logger.debug(TAG, "compInfoBean compStyle = " + imageUrl) 220 + console.log(TAG, "compInfoBean compStyle = " + imageUrl)
220 221
221 if (imageUrl.length > 0 && this.pageInfoBean.topicInfo.frontFlag === 1) { 222 if (imageUrl.length > 0 && this.pageInfoBean.topicInfo.frontFlag === 1) {
222 const imageSource: image.ImageSource | undefined = await getPicture(imageUrl) 223 const imageSource: image.ImageSource | undefined = await getPicture(imageUrl)
@@ -237,11 +238,11 @@ export struct MorningEveningPaperComponent { @@ -237,11 +238,11 @@ export struct MorningEveningPaperComponent {
237 const pixelMap: image.PixelMap = await imageNet2PixelMap(imageSource); 238 const pixelMap: image.PixelMap = await imageNet2PixelMap(imageSource);
238 effectKit.createColorPicker(pixelMap, (err, colorPicker) => { 239 effectKit.createColorPicker(pixelMap, (err, colorPicker) => {
239 let color = colorPicker.getLargestProportionColor(); 240 let color = colorPicker.getLargestProportionColor();
240 - Logger.debug(TAG, "compInfoBean compStyle = " + color) 241 + console.log(TAG, "compInfoBean compStyle = " + color)
241 // color = ColorUtils.getMorningEveningPaperRgb({red:color.red,green:color.green,blue:color.blue,alpha:color.alpha}) 242 // color = ColorUtils.getMorningEveningPaperRgb({red:color.red,green:color.green,blue:color.blue,alpha:color.alpha})
242 // 将取色器选取的color示例转换为十六进制颜色代码 243 // 将取色器选取的color示例转换为十六进制颜色代码
243 this.mixedBgColor = "#" + color.alpha.toString(16) + color.red.toString(16) + color.green.toString(16) + color.blue.toString(16); 244 this.mixedBgColor = "#" + color.alpha.toString(16) + color.red.toString(16) + color.green.toString(16) + color.blue.toString(16);
244 - Logger.debug(TAG, "compInfoBean compStyle = " + this.mixedBgColor) 245 + console.log(TAG, "compInfoBean compStyle = " + this.mixedBgColor)
245 }); 246 });
246 247
247 } 248 }
@@ -267,11 +268,15 @@ export struct MorningEveningPaperComponent { @@ -267,11 +268,15 @@ export struct MorningEveningPaperComponent {
267 topicInfoView({ frontLinkObject: this.pageInfoBean?.topicInfo?.frontLinkObject }) 268 topicInfoView({ frontLinkObject: this.pageInfoBean?.topicInfo?.frontLinkObject })
268 } 269 }
269 270
270 - if (this.audioPlayUrl !== ""){  
271 - ListItem() {  
272 - this.AudioBarView()  
273 - } 271 + }
  272 +
  273 + if (this.audioPlayUrl.length > 0){
  274 + ListItem() {
  275 + this.AudioBarView()
274 } 276 }
  277 + .margin({
  278 + top: this.isHasTopView ? 10 : 44+this.topSafeHeight
  279 + })
275 } 280 }
276 281
277 ListItem() { 282 ListItem() {
@@ -282,7 +287,7 @@ export struct MorningEveningPaperComponent { @@ -282,7 +287,7 @@ export struct MorningEveningPaperComponent {
282 compListItem: this.compListItem, 287 compListItem: this.compListItem,
283 }) 288 })
284 .margin({ 289 .margin({
285 - top: this.isHasTopView ? 10 : 44+this.topSafeHeight 290 + top: this.isHasTopView || this.audioPlayUrl.length > 0 ? 10 : 44+this.topSafeHeight
286 }) 291 })
287 } 292 }
288 } 293 }
@@ -310,8 +315,11 @@ export struct MorningEveningPaperComponent { @@ -310,8 +315,11 @@ export struct MorningEveningPaperComponent {
310 @Builder 315 @Builder
311 topPaperTitle(){ 316 topPaperTitle(){
312 Column(){ 317 Column(){
313 - PaperTitleComponent({topicInfo:this.pageInfoBean?.topicInfo}).margin({top:this.topSafeHeight})  
314 - }.height(44+this.topSafeHeight).backgroundColor(this.isHasTopView?(this.scrollOffset > 100?this.mixedBgColor:''):this.mixedBgColor) 318 + PaperTitleComponent({topicInfo:this.pageInfoBean?.topicInfo})
  319 + .margin({top:this.topSafeHeight})
  320 + }
  321 + .height(44+this.topSafeHeight)
  322 + .backgroundColor(this.isHasTopView?(this.scrollOffset > 100?this.mixedBgColor:''):this.mixedBgColor)
315 } 323 }
316 324
317 @Builder 325 @Builder
@@ -328,7 +336,7 @@ export struct MorningEveningPaperComponent { @@ -328,7 +336,7 @@ export struct MorningEveningPaperComponent {
328 .margin({ left: 10 }) 336 .margin({ left: 10 })
329 .alignSelf(ItemAlign.Start) 337 .alignSelf(ItemAlign.Start)
330 338
331 - Text(`${this.pageInfoBean.topicInfo.topicPattern === 1 ? '早上好' : this.pageInfoBean.topicInfo.topicPattern === 2 ? '中午好' : '晚上好'}, 请收听今日新闻播报`) 339 + Text(`${this.pageInfoBean.topicInfo?.topicPattern === 1 ? '早上好' : this.pageInfoBean.topicInfo?.topicPattern === 2 ? '中午好' : '晚上好'}, 请收听今日新闻播报`)
332 .fontSize(14) 340 .fontSize(14)
333 .margin({ left: 50 }) 341 .margin({ left: 50 })
334 .fontColor(Color.Black) 342 .fontColor(Color.Black)
@@ -350,27 +358,20 @@ export struct MorningEveningPaperComponent { @@ -350,27 +358,20 @@ export struct MorningEveningPaperComponent {
350 .margin({ left: 10 })// .alignSelf(ItemAlign.Center) 358 .margin({ left: 10 })// .alignSelf(ItemAlign.Center)
351 .objectFit(ImageFit.Contain) 359 .objectFit(ImageFit.Contain)
352 .onClick(() => { 360 .onClick(() => {
353 - Logger.info("TAG", "cj compInfoBean onClick1 = " + this.isAudioPlaying) 361 + console.log("TAG", "cj compInfoBean onClick1 = " + this.isAudioPlaying)
354 // dialog.open() 362 // dialog.open()
355 // this.playerController.firstPlay(this.audioPlayUrl, this.audioTitle) 363 // this.playerController.firstPlay(this.audioPlayUrl, this.audioTitle)
356 this.AudioSuspension.setPlayerUrl(this.audioPlayUrl, this.audioTitle) 364 this.AudioSuspension.setPlayerUrl(this.audioPlayUrl, this.audioTitle)
357 - Logger.info(TAG, "this.audioPlayUrl = " + this.audioPlayUrl)  
358 - Logger.info("TAG", "cj compInfoBean onClick2 = " + this.isAudioPlaying) 365 + console.log(TAG, "this.audioPlayUrl = " + this.audioPlayUrl)
  366 + console.log("TAG", "cj compInfoBean onClick2 = " + this.isAudioPlaying)
359 }) 367 })
360 } 368 }
361 - // .aspectRatio(7 / 4)  
362 .height('100%') 369 .height('100%')
363 - // .justifyContent(FlexAlign.Center)  
364 - // .width(94)  
365 - // .width(140)  
366 .width('20%') 370 .width('20%')
367 - // .height(56)  
368 .onClick(() => { 371 .onClick(() => {
369 - // console.info(TAG, `onClick listen_right_bg`);  
370 }) 372 })
371 } 373 }
372 .margin({ left: 12, right: 12 }) 374 .margin({ left: 12, right: 12 })
373 - // .width('100%')  
374 .height(56) 375 .height(56)
375 .alignItems(VerticalAlign.Center) 376 .alignItems(VerticalAlign.Center)
376 .justifyContent(FlexAlign.SpaceBetween) 377 .justifyContent(FlexAlign.SpaceBetween)
@@ -66,6 +66,7 @@ export struct AppointmentListUI { @@ -66,6 +66,7 @@ export struct AppointmentListUI {
66 CustomPullToRefresh({ 66 CustomPullToRefresh({
67 alldata:this.data, 67 alldata:this.data,
68 scroller:this.scroller, 68 scroller:this.scroller,
  69 + hasMore:this.hasMore,
69 customList:()=>{ 70 customList:()=>{
70 this.ListLayout() 71 this.ListLayout()
71 }, 72 },
@@ -73,7 +74,6 @@ export struct AppointmentListUI { @@ -73,7 +74,6 @@ export struct AppointmentListUI {
73 this.curPageNum = 1; 74 this.curPageNum = 1;
74 this.hasMore = true 75 this.hasMore = true
75 this.isGetRequest = false 76 this.isGetRequest = false
76 - this.data.clear()  
77 77
78 if (!this.isLoading){ 78 if (!this.isLoading){
79 this.getNewPageData() 79 this.getNewPageData()
@@ -82,8 +82,10 @@ export struct AppointmentListUI { @@ -82,8 +82,10 @@ export struct AppointmentListUI {
82 }, 82 },
83 onLoadMore:(resolve)=> { 83 onLoadMore:(resolve)=> {
84 if (!this.isLoading) { 84 if (!this.isLoading) {
  85 + this.curPageNum++
85 this.isLoading = true 86 this.isLoading = true
86 this.getNewPageData() 87 this.getNewPageData()
  88 + if(resolve) resolve('刷新成功')
87 } 89 }
88 } 90 }
89 }) 91 })
@@ -143,6 +145,8 @@ export struct AppointmentListUI { @@ -143,6 +145,8 @@ export struct AppointmentListUI {
143 this.isLoading = true 145 this.isLoading = true
144 if (this.hasMore) { 146 if (this.hasMore) {
145 MinePageDatasModel.getAppointmentListData("20", `${this.curPageNum}`, getContext(this)).then((value) => { 147 MinePageDatasModel.getAppointmentListData("20", `${this.curPageNum}`, getContext(this)).then((value) => {
  148 + if (this.curPageNum) this.data.clear()
  149 +
146 if (!this.data || value.list.length == 0) { 150 if (!this.data || value.list.length == 0) {
147 this.hasMore = false 151 this.hasMore = false
148 } else { 152 } else {
@@ -156,10 +160,11 @@ export struct AppointmentListUI { @@ -156,10 +160,11 @@ export struct AppointmentListUI {
156 }) 160 })
157 this.data.notifyDataReload() 161 this.data.notifyDataReload()
158 this.count = this.data.totalCount() 162 this.count = this.data.totalCount()
159 - if (this.data.totalCount() < value.totalCount) {  
160 - this.curPageNum++  
161 - if(this.count < 5){  
162 - this.getNewPageData() 163 + if (20 < value.totalCount ) {
  164 + if (value.list.length === 20) {
  165 + this.hasMore = true
  166 + }else {
  167 + this.hasMore = false
163 } 168 }
164 } else { 169 } else {
165 this.hasMore = false 170 this.hasMore = false
@@ -116,7 +116,6 @@ export struct HomePageBottomFollowComponent { @@ -116,7 +116,6 @@ export struct HomePageBottomFollowComponent {
116 this.curPageNum = 1; 116 this.curPageNum = 1;
117 this.hasMore = true 117 this.hasMore = true
118 this.isGetRequest = false 118 this.isGetRequest = false
119 - this.data_follow.clear()  
120 119
121 if (!this.isLoading){ 120 if (!this.isLoading){
122 this.getNewPageData() 121 this.getNewPageData()
@@ -201,6 +200,7 @@ export struct HomePageBottomFollowComponent { @@ -201,6 +200,7 @@ export struct HomePageBottomFollowComponent {
201 let object = new FollowListDetailRequestItem(-1, 20, this.curPageNum) 200 let object = new FollowListDetailRequestItem(-1, 20, this.curPageNum)
202 201
203 MinePageDatasModel.getMineFollowListData(object, getContext(this)).then((value) => { 202 MinePageDatasModel.getMineFollowListData(object, getContext(this)).then((value) => {
  203 + if (this.curPageNum === 1) this.data_follow.clear()
204 if (!this.data_follow || value.list.length == 0) { 204 if (!this.data_follow || value.list.length == 0) {
205 this.hasMore = false 205 this.hasMore = false
206 } else { 206 } else {
@@ -77,7 +77,6 @@ export struct OtherHomePageBottomFollowComponent{ @@ -77,7 +77,6 @@ export struct OtherHomePageBottomFollowComponent{
77 this.curPageNum = 1; 77 this.curPageNum = 1;
78 this.hasMore = true 78 this.hasMore = true
79 this.isGetRequest = false 79 this.isGetRequest = false
80 - this.data_follow.clear()  
81 80
82 if (!this.isLoading){ 81 if (!this.isLoading){
83 this.getNewPageData() 82 this.getNewPageData()
@@ -164,6 +163,9 @@ export struct OtherHomePageBottomFollowComponent{ @@ -164,6 +163,9 @@ export struct OtherHomePageBottomFollowComponent{
164 let object = new UserFollowListRequestItem(Number(this.curUserId),20,this.curPageNum,"1") 163 let object = new UserFollowListRequestItem(Number(this.curUserId),20,this.curPageNum,"1")
165 164
166 MinePageDatasModel.getOtherUserFollowListData(object,getContext(this)).then((value)=>{ 165 MinePageDatasModel.getOtherUserFollowListData(object,getContext(this)).then((value)=>{
  166 +
  167 + if (this.curPageNum === 1) this.data_follow.clear()
  168 +
167 if (!this.data_follow || value.list.length == 0){ 169 if (!this.data_follow || value.list.length == 0){
168 this.hasMore = false 170 this.hasMore = false
169 }else{ 171 }else{
@@ -430,7 +430,7 @@ export struct PaperSingleColumn999CardView { @@ -430,7 +430,7 @@ export struct PaperSingleColumn999CardView {
430 build() { 430 build() {
431 Column() { 431 Column() {
432 Text(this.item?.newsTitle) 432 Text(this.item?.newsTitle)
433 - .fontColor('#222222') 433 + .fontColor(this.isRead ? 0x848484 : '#222222')
434 .fontSize(16) 434 .fontSize(16)
435 .fontWeight(FontWeight.Medium) 435 .fontWeight(FontWeight.Medium)
436 .alignSelf(ItemAlign.Start) 436 .alignSelf(ItemAlign.Start)
@@ -12,8 +12,7 @@ const MORE_CHANNEL: string = '更多频道' @@ -12,8 +12,7 @@ const MORE_CHANNEL: string = '更多频道'
12 const LOCAL_CHANNEL: string = '地方频道' 12 const LOCAL_CHANNEL: string = '地方频道'
13 13
14 const TAG: string = 'ChannelSubscriptionLayout' 14 const TAG: string = 'ChannelSubscriptionLayout'
15 -  
16 -// @Entry 15 +export { ChannelSubscriptionLayout }
17 @Component 16 @Component
18 struct ChannelSubscriptionLayout { 17 struct ChannelSubscriptionLayout {
19 @State indexSettingArray: string [] = ['推荐', '热点'] 18 @State indexSettingArray: string [] = ['推荐', '热点']
@@ -41,7 +40,9 @@ struct ChannelSubscriptionLayout { @@ -41,7 +40,9 @@ struct ChannelSubscriptionLayout {
41 aboutToAppear() { 40 aboutToAppear() {
42 this.currentTopNavSelectedItem = this.myChannelList[this.currentTopNavSelectedIndex] 41 this.currentTopNavSelectedItem = this.myChannelList[this.currentTopNavSelectedIndex]
43 this.myChannelList.forEach(item => { 42 this.myChannelList.forEach(item => {
44 - this.channelIds.push(item.channelId) 43 + if(item != undefined && item.channelId != undefined){
  44 + this.channelIds.push(item.channelId)
  45 + }
45 }) 46 })
46 } 47 }
47 48
@@ -222,7 +223,6 @@ struct ChannelSubscriptionLayout { @@ -222,7 +223,6 @@ struct ChannelSubscriptionLayout {
222 .padding({ bottom: 10 }) 223 .padding({ bottom: 10 })
223 224
224 List() { 225 List() {
225 -  
226 ListItem() { 226 ListItem() {
227 Row() { 227 Row() {
228 Text(INDEX_SETTING_TITLE) 228 Text(INDEX_SETTING_TITLE)
@@ -515,4 +515,3 @@ struct ChannelSubscriptionLayout { @@ -515,4 +515,3 @@ struct ChannelSubscriptionLayout {
515 } 515 }
516 } 516 }
517 517
518 -export { ChannelSubscriptionLayout }  
@@ -57,7 +57,8 @@ struct EditUserInfoPage { @@ -57,7 +57,8 @@ struct EditUserInfoPage {
57 sexDialogController: CustomDialogController = new CustomDialogController({ 57 sexDialogController: CustomDialogController = new CustomDialogController({
58 builder: EditUserSexCustomDialog({ 58 builder: EditUserSexCustomDialog({
59 confirmCallback:(index)=>{ 59 confirmCallback:(index)=>{
60 - this.currentUserInfo.userExtend.sex = index; 60 + ///1男 2女
  61 + this.currentUserInfo.userExtend.sex = index == 0?2:1;
61 this.currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_sex 62 this.currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_sex
62 this.updateEditModel() 63 this.updateEditModel()
63 } 64 }
@@ -11,6 +11,9 @@ import { channelSkeleton } from '../skeleton/channelSkeleton'; @@ -11,6 +11,9 @@ import { channelSkeleton } from '../skeleton/channelSkeleton';
11 import { ParamType, TrackConstants, Tracking, TrackingButton } from 'wdTracking/Index'; 11 import { ParamType, TrackConstants, Tracking, TrackingButton } from 'wdTracking/Index';
12 import DailyPaperTopicModel from '../../model/DailyPaperTopicModel'; 12 import DailyPaperTopicModel from '../../model/DailyPaperTopicModel';
13 import { CompUtils } from '../../utils/CompUtils'; 13 import { CompUtils } from '../../utils/CompUtils';
  14 +import ChannelViewModel from '../../viewmodel/ChannelViewModel';
  15 +import { JSON } from '@kit.ArkTS';
  16 +import text from '@ohos.graphics.text';
14 17
15 const TAG = 'TopNavigationComponent'; 18 const TAG = 'TopNavigationComponent';
16 19
@@ -25,22 +28,28 @@ export struct TopNavigationComponentNew { @@ -25,22 +28,28 @@ export struct TopNavigationComponentNew {
25 private topRectHeight: string = AppStorage.get<number>('topSafeHeight') + 'px'; 28 private topRectHeight: string = AppStorage.get<number>('topSafeHeight') + 'px';
26 private pageName: string = '' 29 private pageName: string = ''
27 private pageId: number = 0 30 private pageId: number = 0
  31 + readonly MAX_LINE: number = 1; // 顶部tab text最大行数
28 private swiperController: SwiperController = new SwiperController() 32 private swiperController: SwiperController = new SwiperController()
29 private listScroller: Scroller = new Scroller() 33 private listScroller: Scroller = new Scroller()
30 /** 34 /**
31 * 首页 底导 某个tab 对象 35 * 首页 底导 某个tab 对象
32 */ 36 */
33 navItem: BottomNavDTO = {} as BottomNavDTO 37 navItem: BottomNavDTO = {} as BottomNavDTO
  38 + // 背景色
34 @Consume barBackgroundColor: Color 39 @Consume barBackgroundColor: Color
35 - 40 + // 首页当前正在哪个tab的索引值
36 @Link _currentNavIndex?: number; 41 @Link _currentNavIndex?: number;
  42 + // 记录首页底部tab 的索引值
  43 + @State bottomNavIndex: number = 0
37 // 顶导当前选中/焦点下标 44 // 顶导当前选中/焦点下标
38 @State @Watch('updateCurrentTopNavSelectedIndex') currentTopNavSelectedIndex: number = 0; 45 @State @Watch('updateCurrentTopNavSelectedIndex') currentTopNavSelectedIndex: number = 0;
39 // 顶导数据 46 // 顶导数据
40 @State @Watch('onTopNavigationDataUpdated') topNavList: TopNavDTO[] = [] 47 @State @Watch('onTopNavigationDataUpdated') topNavList: TopNavDTO[] = []
  48 + //
41 @State indexSettingChannelId: number = AppStorage.get<number>('indexSettingChannelId') || 2002 49 @State indexSettingChannelId: number = AppStorage.get<number>('indexSettingChannelId') || 2002
42 //本地缓存频道id列表 50 //本地缓存频道id列表
43 @State storageChannelIds: string = AppStorage.get<string>('channelIds') || '' 51 @State storageChannelIds: string = AppStorage.get<string>('channelIds') || ''
  52 + // 首页设置的频道信息数组
44 @State homeChannelList: TopNavDTO[] = [] 53 @State homeChannelList: TopNavDTO[] = []
45 // 我的频道列表 54 // 我的频道列表
46 @State myChannelList: TopNavDTO[] = [] 55 @State myChannelList: TopNavDTO[] = []
@@ -48,18 +57,14 @@ export struct TopNavigationComponentNew { @@ -48,18 +57,14 @@ export struct TopNavigationComponentNew {
48 @State moreChannelList: TopNavDTO[] = [] 57 @State moreChannelList: TopNavDTO[] = []
49 // 地方频道列表 58 // 地方频道列表
50 @State localChannelList: TopNavDTO[] = [] 59 @State localChannelList: TopNavDTO[] = []
51 - readonly MAX_LINE: number = 1;  
52 @ObjectLink @Watch('onAssignChannelChange') assignChannel: AssignChannelParam 60 @ObjectLink @Watch('onAssignChannelChange') assignChannel: AssignChannelParam
53 // 底导传递过来的自动刷新通知 61 // 底导传递过来的自动刷新通知
54 @Prop @Watch('onAutoRefresh') autoRefresh: number = 0 62 @Prop @Watch('onAutoRefresh') autoRefresh: number = 0
55 // 传递给page的自动刷新通知 63 // 传递给page的自动刷新通知
56 @State autoRefresh2Page: number = 0 64 @State autoRefresh2Page: number = 0
57 - // 当前底导index  
58 - @State bottomNavIndex: number = 0  
59 @State animationDuration: number = 0 65 @State animationDuration: number = 0
60 @State indicatorLeftMargin: number = 0 66 @State indicatorLeftMargin: number = 0
61 @State indicatorWidth: number = 0 67 @State indicatorWidth: number = 0
62 -  
63 @State isClickMorningEveningPaper: boolean = false 68 @State isClickMorningEveningPaper: boolean = false
64 69
65 build() { 70 build() {
@@ -70,7 +75,7 @@ export struct TopNavigationComponentNew { @@ -70,7 +75,7 @@ export struct TopNavigationComponentNew {
70 Swiper(this.swiperController) { 75 Swiper(this.swiperController) {
71 ForEach(CompUtils.isNews(this.navItem) ? this.myChannelList : this.topNavList, 76 ForEach(CompUtils.isNews(this.navItem) ? this.myChannelList : this.topNavList,
72 (navItem: TopNavDTO, index: number) => { 77 (navItem: TopNavDTO, index: number) => {
73 - if (CompUtils.isRMH(this.navItem) && navItem.channelType === 3) { 78 + if (CompUtils.isRMH(this.navItem) && this.isSpecialChannel(navItem)) {
74 // 人民号 -- 关注tab 79 // 人民号 -- 关注tab
75 PeopleShipMainComponent({ 80 PeopleShipMainComponent({
76 currentTopNavSelectedIndex: $currentTopNavSelectedIndex, 81 currentTopNavSelectedIndex: $currentTopNavSelectedIndex,
@@ -79,7 +84,7 @@ export struct TopNavigationComponentNew { @@ -79,7 +84,7 @@ export struct TopNavigationComponentNew {
79 channelId: navItem?.channelId + '', 84 channelId: navItem?.channelId + '',
80 autoRefresh: this.autoRefresh2Page 85 autoRefresh: this.autoRefresh2Page
81 }) 86 })
82 - } else 87 + } else {
83 if (!this.isBroadcast(navItem) && !this.isLayout(navItem)) { 88 if (!this.isBroadcast(navItem) && !this.isLayout(navItem)) {
84 PageComponent({ 89 PageComponent({
85 currentTopNavSelectedIndex: $currentTopNavSelectedIndex, 90 currentTopNavSelectedIndex: $currentTopNavSelectedIndex,
@@ -89,7 +94,9 @@ export struct TopNavigationComponentNew { @@ -89,7 +94,9 @@ export struct TopNavigationComponentNew {
89 autoRefresh: this.autoRefresh2Page 94 autoRefresh: this.autoRefresh2Page
90 }) 95 })
91 } else { 96 } else {
92 - channelSkeleton() 97 + channelSkeleton()
  98 + //Text('特殊频道').fontColor(Color.Red).fontSize(20).width('100%').height('100%')
  99 + }
93 } 100 }
94 }) 101 })
95 } 102 }
@@ -109,29 +116,45 @@ export struct TopNavigationComponentNew { @@ -109,29 +116,45 @@ export struct TopNavigationComponentNew {
109 if (curIndex === index) { 116 if (curIndex === index) {
110 return 117 return
111 } 118 }
  119 +
112 if (this.isBroadcastByIndex(index)) { 120 if (this.isBroadcastByIndex(index)) {
113 // 跳转到播报页面 121 // 跳转到播报页面
114 ProcessUtils.gotoBroadcastPage(this.myChannelList[index].pageId) 122 ProcessUtils.gotoBroadcastPage(this.myChannelList[index].pageId)
115 - let nextIndex = this.currentTopNavSelectedIndex > index ? index - 1 : index + 1  
116 - if (nextIndex < this.myChannelList.length) {  
117 - this.changePage(nextIndex)  
118 - } 123 +
119 } else if (this.isLayoutByIndex(index)) { 124 } else if (this.isLayoutByIndex(index)) {
  125 + // 跳转到电子报页面
120 ProcessUtils.gotoENewsPaper() 126 ProcessUtils.gotoENewsPaper()
121 - let nextIndex = this.currentTopNavSelectedIndex > index ? index - 1 : index + 1  
122 - if (nextIndex < this.myChannelList.length) {  
123 - this.changePage(nextIndex)  
124 - } 127 +
125 } else { 128 } else {
126 - this.currentTopNavSelectedIndex = index;  
127 - this.changePage(this.currentTopNavSelectedIndex) 129 + this.changePage(index)
128 } 130 }
129 }) 131 })
130 - // .onAnimationEnd((index: number)=>{  
131 - // Logger.info(TAG, `onAnimationEnd ${index}`);  
132 - // }) 132 + .onAnimationEnd((index: number) => {
  133 + Logger.info(TAG, `onAnimationEnd ${index}`);
  134 + })
133 .onChange((index) => { 135 .onChange((index) => {
134 Logger.info(TAG, `onChange index : ${index}`); 136 Logger.info(TAG, `onChange index : ${index}`);
  137 + if (this.isLayoutByIndex(index) || this.isBroadcastByIndex(index)) {
  138 + let nextIndex = this.currentTopNavSelectedIndex > index ? index - 1 : index + 1
  139 + if (nextIndex < this.myChannelList.length) {
  140 + // 电子报和播报 相邻
  141 + if (this.isBroadcastByIndex(nextIndex) || this.isLayoutByIndex(nextIndex)) {
  142 + nextIndex = this.currentTopNavSelectedIndex > index ? nextIndex - 1 : nextIndex + 1
  143 + if (nextIndex < this.myChannelList.length) {
  144 + this.changePage(nextIndex)
  145 + } else {
  146 + this.changePage(this.currentTopNavSelectedIndex)
  147 + }
  148 +
  149 + } else {
  150 + this.changePage(nextIndex)
  151 + }
  152 + } else {
  153 + // 极左极右有特殊频道,用旧值
  154 + this.changePage(this.currentTopNavSelectedIndex)
  155 + }
  156 + }
  157 +
135 }) 158 })
136 } 159 }
137 .width('100%') 160 .width('100%')
@@ -141,10 +164,14 @@ export struct TopNavigationComponentNew { @@ -141,10 +164,14 @@ export struct TopNavigationComponentNew {
141 .margin({ top: this.topRectHeight }) 164 .margin({ top: this.topRectHeight })
142 } 165 }
143 166
  167 + /**
  168 + * 新闻tab 头部
  169 + */
144 @Builder 170 @Builder
145 topBar() { 171 topBar() {
146 Column() { 172 Column() {
147 Row() { 173 Row() {
  174 +
148 FirstTabTopSearchComponent() 175 FirstTabTopSearchComponent()
149 176
150 Image($r('app.media.icon_ren_min_ri_bao')) 177 Image($r('app.media.icon_ren_min_ri_bao'))
@@ -173,19 +200,12 @@ export struct TopNavigationComponentNew { @@ -173,19 +200,12 @@ export struct TopNavigationComponentNew {
173 .width(124) 200 .width(124)
174 .onClick(() => { 201 .onClick(() => {
175 //防止多次点击 202 //防止多次点击
176 - if(!this.isClickMorningEveningPaper) { 203 + if (!this.isClickMorningEveningPaper) {
177 this.isClickMorningEveningPaper = true; 204 this.isClickMorningEveningPaper = true;
178 let c = setInterval(() => { 205 let c = setInterval(() => {
179 this.isClickMorningEveningPaper = false 206 this.isClickMorningEveningPaper = false
180 }, 1000); 207 }, 1000);
181 208
182 - // 早晚报埋点  
183 - const params: ParamType = {  
184 - "pageName": this.pageName,  
185 - "pageId": this.pageId,  
186 - }  
187 - Tracking.event("morning_evening_news_click", params)  
188 -  
189 this.clickMorningEveningPaper() 209 this.clickMorningEveningPaper()
190 } 210 }
191 }) 211 })
@@ -282,6 +302,11 @@ export struct TopNavigationComponentNew { @@ -282,6 +302,11 @@ export struct TopNavigationComponentNew {
282 } 302 }
283 } 303 }
284 304
  305 + /**
  306 + * 顶部导航栏
  307 + * @param item
  308 + * @param index
  309 + */
285 @Builder 310 @Builder
286 tabBarBuilder(item: TopNavDTO, index: number) { 311 tabBarBuilder(item: TopNavDTO, index: number) {
287 Column() { 312 Column() {
@@ -411,7 +436,8 @@ export struct TopNavigationComponentNew { @@ -411,7 +436,8 @@ export struct TopNavigationComponentNew {
411 item.myChannel = '1' 436 item.myChannel = '1'
412 } 437 }
413 //频道分类 438 //频道分类
414 - if (item.name !== '播报') { //暂时隐藏播报 439 + //TODO 暂时隐藏播报
  440 + if (item.name !== '播报') {
415 if (item.myChannel === '1') { 441 if (item.myChannel === '1') {
416 _myChannelList.push(item) 442 _myChannelList.push(item)
417 } 443 }
@@ -451,28 +477,46 @@ export struct TopNavigationComponentNew { @@ -451,28 +477,46 @@ export struct TopNavigationComponentNew {
451 } 477 }
452 } 478 }
453 479
  480 + /**
  481 + * 频道是播报
  482 + * @param item
  483 + * @returns
  484 + */
454 private isBroadcast(item?: TopNavDTO): boolean { 485 private isBroadcast(item?: TopNavDTO): boolean {
455 - // TODO 用id channelId = '2066'  
456 - return item?.name === '播报' 486 + return item?.channelId === 2066
457 } 487 }
458 488
  489 + /**
  490 + * 频道是电子报
  491 + * @param item
  492 + * @returns
  493 + */
459 private isLayout(item?: TopNavDTO): boolean { 494 private isLayout(item?: TopNavDTO): boolean {
460 - // TODO 用id channelId = '2006'  
461 - return item?.name === '版面' 495 + return item?.channelId === 2006
462 } 496 }
463 497
  498 + /**
  499 + * 检测播报
  500 + * @param index
  501 + * @returns
  502 + */
464 private isBroadcastByIndex(index: number): boolean { 503 private isBroadcastByIndex(index: number): boolean {
465 let item = this._currentNavIndex === 0 ? this.myChannelList[index] : this.topNavList[index] 504 let item = this._currentNavIndex === 0 ? this.myChannelList[index] : this.topNavList[index]
466 return this.isBroadcast(item) 505 return this.isBroadcast(item)
467 } 506 }
468 507
  508 + /**
  509 + * 检测电子报
  510 + * @param index
  511 + * @returns
  512 + */
469 private isLayoutByIndex(index: number): boolean { 513 private isLayoutByIndex(index: number): boolean {
470 let item = this._currentNavIndex === 0 ? this.myChannelList[index] : this.topNavList[index] 514 let item = this._currentNavIndex === 0 ? this.myChannelList[index] : this.topNavList[index]
471 return this.isLayout(item) 515 return this.isLayout(item)
472 } 516 }
473 517
474 private isSpecialChannel(item?: TopNavDTO) { 518 private isSpecialChannel(item?: TopNavDTO) {
475 - // 版面、播报,可以用这个判断 519 + // 版面、播报、关注,可以用这个判断
476 return item?.channelType === 3 520 return item?.channelType === 3
477 } 521 }
478 522
@@ -481,7 +525,8 @@ export struct TopNavigationComponentNew { @@ -481,7 +525,8 @@ export struct TopNavigationComponentNew {
481 this.topNavListHandle() 525 this.topNavListHandle()
482 this.changePage(this.currentTopNavSelectedIndex) 526 this.changePage(this.currentTopNavSelectedIndex)
483 527
484 - console.log('XY', '----TopNavigation-------aboutToAppear'+this.navItem.name) 528 + console.log('XY', '----TopNavigation-------aboutToAppear' + this.navItem.name)
  529 + this.getTopNavList(this.navItem.id)
485 } 530 }
486 531
487 onTopNavigationDataUpdated() { 532 onTopNavigationDataUpdated() {
@@ -489,14 +534,16 @@ export struct TopNavigationComponentNew { @@ -489,14 +534,16 @@ export struct TopNavigationComponentNew {
489 `onTopNavigationDataUpdated currentTopNavIndex: ${this.currentTopNavSelectedIndex},topNavList.length:${this.topNavList.length}`); 534 `onTopNavigationDataUpdated currentTopNavIndex: ${this.currentTopNavSelectedIndex},topNavList.length:${this.topNavList.length}`);
490 } 535 }
491 536
  537 + /**
  538 + *
  539 + */
492 updateCurrentTopNavSelectedIndex() { 540 updateCurrentTopNavSelectedIndex() {
493 - Logger.info(TAG, `this.navItem 埋点参数topStyle: ${this.navItem.topStyle}`);  
494 541
495 - // 顶部tab埋点  
496 if (CompUtils.isNews(this.navItem)) { 542 if (CompUtils.isNews(this.navItem)) {
497 const tab = this.myChannelList[this.currentTopNavSelectedIndex] 543 const tab = this.myChannelList[this.currentTopNavSelectedIndex]
498 - Logger.info(TAG, `新闻tab埋点: ${JSON.stringify(tab)}`); 544 + //Logger.info(TAG, `新闻tab埋点: ${JSON.stringify(tab)}`);
499 545
  546 + // 埋点
500 const params: ParamType = { 547 const params: ParamType = {
501 "pageName": tab.name, 548 "pageName": tab.name,
502 "tabName": tab.name, 549 "tabName": tab.name,
@@ -507,6 +554,7 @@ export struct TopNavigationComponentNew { @@ -507,6 +554,7 @@ export struct TopNavigationComponentNew {
507 const tab = this.topNavList[this.currentTopNavSelectedIndex] 554 const tab = this.topNavList[this.currentTopNavSelectedIndex]
508 Logger.info(TAG, `人民号tab埋点: ${JSON.stringify(tab)}`); 555 Logger.info(TAG, `人民号tab埋点: ${JSON.stringify(tab)}`);
509 556
  557 + // 埋点
510 const params: ParamType = { 558 const params: ParamType = {
511 "pageName": tab.name, 559 "pageName": tab.name,
512 "tabName": tab.name, 560 "tabName": tab.name,
@@ -516,12 +564,15 @@ export struct TopNavigationComponentNew { @@ -516,12 +564,15 @@ export struct TopNavigationComponentNew {
516 } 564 }
517 } 565 }
518 566
  567 + /**
  568 + * 自动刷新方法
  569 + */
519 onAutoRefresh() { 570 onAutoRefresh() {
520 if (this.bottomNavIndex != this._currentNavIndex) { 571 if (this.bottomNavIndex != this._currentNavIndex) {
521 return 572 return
522 } 573 }
523 // 通知page刷新 574 // 通知page刷新
524 - this.autoRefresh2Page++ 575 + this.doAutoRefresh()
525 } 576 }
526 577
527 private doAutoRefresh() { 578 private doAutoRefresh() {
@@ -616,49 +667,34 @@ export struct TopNavigationComponentNew { @@ -616,49 +667,34 @@ export struct TopNavigationComponentNew {
616 return null 667 return null
617 } 668 }
618 669
619 - // private getTextInfo(index: number): Record<string, number> {  
620 - // let strJson = getInspectorByKey(index.toString())  
621 - // try {  
622 - // let obj: Record<string, string> = JSON.parse(strJson)  
623 - // let rectInfo: number[][] = JSON.parse('[' + obj.$rect + ']')  
624 - // return { 'left': px2vp(rectInfo[0][0]), 'width': px2vp(rectInfo[1][0] - rectInfo[0][0]) }  
625 - // } catch (error) {  
626 - // return { 'left': 0, 'width': 0 }  
627 - // } 670 + //
  671 + // private startAnimateTo(duration: number, leftMargin: number, width: number) {
  672 + // animateTo({
  673 + // duration: duration, // 动画时长
  674 + // curve: Curve.Linear, // 动画曲线
  675 + // iterations: 1, // 播放次数
  676 + // playMode: PlayMode.Normal, // 动画模式
  677 + // onFinish: () => {
  678 + // console.info('play end')
  679 + // }
  680 + // }, () => {
  681 + // this.indicatorLeftMargin = leftMargin
  682 + // this.indicatorWidth = width
  683 + // })
628 // } 684 // }
629 685
630 - // private getCurrentIndicatorInfo(index: number, event: TabsAnimationEvent): Record<string, number> {  
631 - // let nextIndex = index  
632 - // if (index > 0 && event.currentOffset > 0) {  
633 - // nextIndex--  
634 - // } else if (index < 3 && event.currentOffset < 0) {  
635 - // nextIndex++  
636 - // }  
637 - // let indexInfo = this.getTextInfo(index)  
638 - // let nextIndexInfo = this.getTextInfo(nextIndex)  
639 - // let swipeRatio = Math.abs(event.currentOffset / this.tabsWidth)  
640 - // let currentIndex = swipeRatio > 0.5 ? nextIndex : index // 页面滑动超过一半,tabBar切换到下一页。  
641 - // let currentLeft = indexInfo.left + (nextIndexInfo.left - indexInfo.left) * swipeRatio  
642 - // let currentWidth = indexInfo.width + (nextIndexInfo.width - indexInfo.width) * swipeRatio  
643 - // return { 'index': currentIndex, 'left': currentLeft, 'width': currentWidth }  
644 - // } 686 + /**
  687 + * 进入早晚报专题
  688 + */
  689 + clickMorningEveningPaper() {
645 690
646 - private startAnimateTo(duration: number, leftMargin: number, width: number) {  
647 - animateTo({  
648 - duration: duration, // 动画时长  
649 - curve: Curve.Linear, // 动画曲线  
650 - iterations: 1, // 播放次数  
651 - playMode: PlayMode.Normal, // 动画模式  
652 - onFinish: () => {  
653 - console.info('play end')  
654 - }  
655 - }, () => {  
656 - this.indicatorLeftMargin = leftMargin  
657 - this.indicatorWidth = width  
658 - })  
659 - } 691 + // 早晚报埋点
  692 + const params: ParamType = {
  693 + "pageName": this.pageName,
  694 + "pageId": this.pageId,
  695 + }
  696 + Tracking.event("morning_evening_news_click", params)
660 697
661 - clickMorningEveningPaper() {  
662 if (NetworkUtil.isNetConnected()) { 698 if (NetworkUtil.isNetConnected()) {
663 DailyPaperTopicModel.getDailyPaperTopic().then(dailyPaperTopicBean => { 699 DailyPaperTopicModel.getDailyPaperTopic().then(dailyPaperTopicBean => {
664 if (dailyPaperTopicBean && dailyPaperTopicBean.id > 0) { 700 if (dailyPaperTopicBean && dailyPaperTopicBean.id > 0) {
@@ -676,4 +712,14 @@ export struct TopNavigationComponentNew { @@ -676,4 +712,14 @@ export struct TopNavigationComponentNew {
676 ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000) 712 ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000)
677 } 713 }
678 } 714 }
  715 +
  716 + //请求顶导数据
  717 + async getTopNavList(id: number) {
  718 + let bottomNavDetail = await ChannelViewModel.getBottomNavDetailData(id)
  719 + let topNavList = bottomNavDetail?.topNavChannelList || []
  720 + for (let topNav of topNavList) {
  721 + console.debug(TAG, 'getTopNavList=>' + JSON.stringify(topNav))
  722 +
  723 + }
  724 + }
679 } 725 }
@@ -129,6 +129,7 @@ export struct EmptyComponent { @@ -129,6 +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 .onClick((event: ClickEvent) => { 133 .onClick((event: ClickEvent) => {
133 Logger.info(TAG, `noProgrammeData onClick event?.source: ${event.source}`); 134 Logger.info(TAG, `noProgrammeData onClick event?.source: ${event.source}`);
134 }) 135 })
@@ -40,7 +40,7 @@ export class EditInfoModel{ @@ -40,7 +40,7 @@ export class EditInfoModel{
40 //生日 40 //生日
41 birthday:string = '' 41 birthday:string = ''
42 //性别 42 //性别
43 - sex:number = 10 43 + sex:number = 0
44 44
45 airec:number = 0 45 airec:number = 0
46 46
@@ -41,7 +41,7 @@ class EditInfoViewModel { @@ -41,7 +41,7 @@ class EditInfoViewModel {
41 new EditListInfo('简介',item&&item.userExtend.introduction?item.userExtend.introduction:'待完善'), 41 new EditListInfo('简介',item&&item.userExtend.introduction?item.userExtend.introduction:'待完善'),
42 new EditListInfo('地区',item&&item.userExtend.address?item.userExtend.address:'待完善'), 42 new EditListInfo('地区',item&&item.userExtend.address?item.userExtend.address:'待完善'),
43 new EditListInfo('生日',item&&item.userExtend.birthday?item.userExtend.birthday:'待完善'), 43 new EditListInfo('生日',item&&item.userExtend.birthday?item.userExtend.birthday:'待完善'),
44 - new EditListInfo('性别',item?(item.userExtend.sex === 10?'待完善':(item.userExtend.sex === 1?'男':'女')):'待完善'),] 44 + new EditListInfo('性别',item?(item.userExtend.sex === 0?'待完善':(item.userExtend.sex === 1?'男':'女')):'待完善'),]
45 return this.editListData 45 return this.editListData
46 } 46 }
47 47
@@ -36,6 +36,7 @@ export struct DetailVideoListPage { @@ -36,6 +36,7 @@ export struct DetailVideoListPage {
36 @State data: ContentDetailDTO[] = [] 36 @State data: ContentDetailDTO[] = []
37 @State currentIndex: number = 0 37 @State currentIndex: number = 0
38 @State netStatus: number | undefined = undefined // 存储网络状态用来展示缺省图 38 @State netStatus: number | undefined = undefined // 存储网络状态用来展示缺省图
  39 + @State isOffLine: boolean = false // 存储视频下线状态用来展示缺省图
39 @State interactDataList: InteractDataDTO[] = [] 40 @State interactDataList: InteractDataDTO[] = []
40 pageShowTime:number = 0; 41 pageShowTime:number = 0;
41 pageHideTime:number = 0; 42 pageHideTime:number = 0;
@@ -140,6 +141,7 @@ export struct DetailVideoListPage { @@ -140,6 +141,7 @@ export struct DetailVideoListPage {
140 relType: relType 141 relType: relType
141 }).then(async (resDTO: ResponseDTO<ContentDetailDTO[]>) => { 142 }).then(async (resDTO: ResponseDTO<ContentDetailDTO[]>) => {
142 console.log(TAG, 'getContentDetail:', JSON.stringify(resDTO.data)) 143 console.log(TAG, 'getContentDetail:', JSON.stringify(resDTO.data))
  144 + this.isOffLine = resDTO.data == null ? true : false
143 if (resDTO.data) { 145 if (resDTO.data) {
144 const params: contentListParams = { 146 const params: contentListParams = {
145 contentList: [{ 147 contentList: [{
@@ -202,7 +204,7 @@ export struct DetailVideoListPage { @@ -202,7 +204,7 @@ export struct DetailVideoListPage {
202 build() { 204 build() {
203 if (this.netStatus !== undefined) { 205 if (this.netStatus !== undefined) {
204 EmptyComponent({ 206 EmptyComponent({
205 - emptyType: this.netStatus, emptyButton: true, retry: () => { 207 + emptyType: 1, emptyButton: true, retry: () => {
206 this.getContentDetail(this.contentId, this.relId, this.relType) 208 this.getContentDetail(this.contentId, this.relId, this.relType)
207 } 209 }
208 }) 210 })
@@ -211,6 +213,18 @@ export struct DetailVideoListPage { @@ -211,6 +213,18 @@ export struct DetailVideoListPage {
211 center: { anchor: "__container__", align: VerticalAlign.Center }, 213 center: { anchor: "__container__", align: VerticalAlign.Center },
212 middle: { anchor: "__container__", align: HorizontalAlign.Center } 214 middle: { anchor: "__container__", align: HorizontalAlign.Center }
213 }) 215 })
  216 + } else if (this.isOffLine) {
  217 + EmptyComponent({
  218 + emptyType: 15, emptyButton: true, retry: () => {
  219 + this.getContentDetail(this.contentId, this.relId, this.relType)
  220 + }
  221 + })
  222 + .id('e_empty_content')
  223 + .alignRules({
  224 + center: { anchor: "__container__", align: VerticalAlign.Center },
  225 + middle: { anchor: "__container__", align: HorizontalAlign.Center }
  226 + })
  227 + .backgroundColor(Color.Black)
214 } else { 228 } else {
215 Column() { 229 Column() {
216 Swiper(this.swiperController) { 230 Swiper(this.swiperController) {
@@ -11,17 +11,5 @@ @@ -11,17 +11,5 @@
11 "compressNativeLibs": true, 11 "compressNativeLibs": true,
12 "deliveryWithInstall": true, 12 "deliveryWithInstall": true,
13 "pages": "$profile:main_pages", 13 "pages": "$profile:main_pages",
14 - "requestPermissions": [  
15 - {  
16 - "name": "ohos.permission.APPROXIMATELY_LOCATION",  
17 - "reason": "$string:location_reason",  
18 - "usedScene": {  
19 - "abilities": [  
20 - "FormAbility"  
21 - ],  
22 - "when": "inuse"  
23 - }  
24 - }  
25 - ]  
26 } 14 }
27 } 15 }
@@ -8,6 +8,9 @@ import { WDRouterRule } from 'wdRouter/src/main/ets/router/WDRouterRule'; @@ -8,6 +8,9 @@ import { WDRouterRule } from 'wdRouter/src/main/ets/router/WDRouterRule';
8 import { Params } from '../../../../../../../commons/wdRouter/oh_modules/wdBean/src/main/ets/bean/content/Params' 8 import { Params } from '../../../../../../../commons/wdRouter/oh_modules/wdBean/src/main/ets/bean/content/Params'
9 import {InterestsHobbiesModel} from '../../../../../../../products/phone/src/main/ets/pages/viewModel/InterestsHobbiesModel' 9 import {InterestsHobbiesModel} from '../../../../../../../products/phone/src/main/ets/pages/viewModel/InterestsHobbiesModel'
10 import { TrackingPageBrowse, TrackConstants, TrackingButton, ParamType, Tracking } from 'wdTracking/Index' 10 import { TrackingPageBrowse, TrackConstants, TrackingButton, ParamType, Tracking } from 'wdTracking/Index'
  11 +import { window } from '@kit.ArkUI';
  12 +import { BusinessError } from '@kit.BasicServicesKit';
  13 +import { common } from '@kit.AbilityKit'
11 14
12 @Extend(Row) 15 @Extend(Row)
13 function otherStyle() { 16 function otherStyle() {
@@ -45,6 +48,7 @@ struct LoginPage { @@ -45,6 +48,7 @@ struct LoginPage {
45 lastTime: number = 0 48 lastTime: number = 0
46 @State codeStateSuccess:boolean=false 49 @State codeStateSuccess:boolean=false
47 @State toastText:string = "" 50 @State toastText:string = ""
  51 + @State isPrivacyMode: boolean = true;
48 dialogToast: CustomDialogController = new CustomDialogController({ 52 dialogToast: CustomDialogController = new CustomDialogController({
49 builder: CustomToast({ 53 builder: CustomToast({
50 msg: this.toastText, 54 msg: this.toastText,
@@ -84,6 +88,29 @@ struct LoginPage { @@ -84,6 +88,29 @@ struct LoginPage {
84 this.currentChanged() 88 this.currentChanged()
85 } 89 }
86 90
  91 + disableScreenCapture(){
  92 + let windowClass: window.Window|undefined = undefined;
  93 + let context = getContext(this) as common.UIAbilityContext
  94 + try {
  95 + window.getLastWindow(context, (err, data) => {
  96 + if (err.code) {
  97 + return
  98 + }
  99 + windowClass = data
  100 + windowClass.setWindowPrivacyMode(this.isPrivacyMode, (err: BusinessError) => {
  101 + const errCode: number = err.code;
  102 + if (errCode) {
  103 + console.error('Failed to set the window to privacy mode. Cause:' + JSON.stringify(err));
  104 + return;
  105 + }
  106 + console.info('Succeeded in setting the window to privacy mode.');
  107 + });
  108 + })
  109 + } catch (exception) {
  110 + console.error('Failed to set the window to privacy mode. Cause:' + JSON.stringify(exception));
  111 + }
  112 + }
  113 +
87 aboutToDisappear(): void { 114 aboutToDisappear(): void {
88 this.breakpointSystem.unregister(); 115 this.breakpointSystem.unregister();
89 } 116 }
@@ -91,6 +118,8 @@ struct LoginPage { @@ -91,6 +118,8 @@ struct LoginPage {
91 onPageShow() { 118 onPageShow() {
92 Logger.debug(TAG, "onPageShow:" + this.isCodeSend + " ") 119 Logger.debug(TAG, "onPageShow:" + this.isCodeSend + " ")
93 this.pageShowTime = DateTimeUtils.getTimeStamp() 120 this.pageShowTime = DateTimeUtils.getTimeStamp()
  121 + this.isPrivacyMode = true
  122 + this.disableScreenCapture()
94 } 123 }
95 124
96 onPageHide(): void { 125 onPageHide(): void {
@@ -103,6 +132,8 @@ struct LoginPage { @@ -103,6 +132,8 @@ struct LoginPage {
103 }else{ 132 }else{
104 TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Login_Page,TrackConstants.PageName.Login_Page,duration) 133 TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Login_Page,TrackConstants.PageName.Login_Page,duration)
105 } 134 }
  135 + this.isPrivacyMode = false
  136 + this.disableScreenCapture()
106 } 137 }
107 138
108 build() { 139 build() {
@@ -637,3 +668,5 @@ function trackTypeClick(typeValue: number,pageId: string){ @@ -637,3 +668,5 @@ function trackTypeClick(typeValue: number,pageId: string){
637 668
638 Tracking.event("login_type_click", params) 669 Tracking.event("login_type_click", params)
639 } 670 }
  671 +
  672 +
@@ -8,6 +8,11 @@ @@ -8,6 +8,11 @@
8 // "tablet", 8 // "tablet",
9 // "2in1" 9 // "2in1"
10 ], 10 ],
  11 + "requestPermissions": [
  12 + {
  13 + "name": "ohos.permission.PRIVACY_WINDOW"
  14 + }
  15 + ],
11 "compressNativeLibs": true, 16 "compressNativeLibs": true,
12 "deliveryWithInstall": true, 17 "deliveryWithInstall": true,
13 "pages": "$profile:main_pages" 18 "pages": "$profile:main_pages"
1 -import { LogoutViewModel, PermissionDesComponent } from 'wdComponent'; 1 +import { LogoutViewModel } from 'wdComponent';
2 import { BreakpointConstants } from 'wdConstant'; 2 import { BreakpointConstants } from 'wdConstant';
3 3
4 -import { common } from '@kit.AbilityKit';  
5 import { BreakpointSystem, EmitterEventId, EmitterUtils, Logger, MpaasUpgradeCheck, WindowModel } from 'wdKit'; 4 import { BreakpointSystem, EmitterEventId, EmitterUtils, Logger, MpaasUpgradeCheck, WindowModel } from 'wdKit';
6 import { promptAction, window } from '@kit.ArkUI'; 5 import { promptAction, window } from '@kit.ArkUI';
7 import { UpgradeTipDialog } from "./upgradePage/UpgradeTipDialog" 6 import { UpgradeTipDialog } from "./upgradePage/UpgradeTipDialog"
@@ -20,7 +19,6 @@ struct MainPage { @@ -20,7 +19,6 @@ struct MainPage {
20 private breakpointSystem: BreakpointSystem = new BreakpointSystem() 19 private breakpointSystem: BreakpointSystem = new BreakpointSystem()
21 @StorageLink('currentBreakpoint') @Watch('watchCurrentBreakpoint') currentBreakpoint: string = 20 @StorageLink('currentBreakpoint') @Watch('watchCurrentBreakpoint') currentBreakpoint: string =
22 BreakpointConstants.BREAKPOINT_XS; 21 BreakpointConstants.BREAKPOINT_XS;
23 - @State isPermission: boolean = false  
24 upgradeDialogController?: CustomDialogController 22 upgradeDialogController?: CustomDialogController
25 23
26 watchCurrentBreakpoint() { 24 watchCurrentBreakpoint() {
@@ -37,9 +35,6 @@ struct MainPage { @@ -37,9 +35,6 @@ struct MainPage {
37 EmitterUtils.receiveEvent(EmitterEventId.FORCE_USER_LOGIN_OUT, () => { 35 EmitterUtils.receiveEvent(EmitterEventId.FORCE_USER_LOGIN_OUT, () => {
38 LogoutViewModel.clearLoginInfo() 36 LogoutViewModel.clearLoginInfo()
39 }) 37 })
40 - EmitterUtils.receiveEvent(EmitterEventId.LOCATION, () => {  
41 - this.isPermission = true  
42 - })  
43 } 38 }
44 39
45 pageTransition() { 40 pageTransition() {
@@ -114,9 +109,6 @@ struct MainPage { @@ -114,9 +109,6 @@ struct MainPage {
114 build() { 109 build() {
115 Stack({ alignContent: Alignment.Top }) { 110 Stack({ alignContent: Alignment.Top }) {
116 BottomNavigationComponent() 111 BottomNavigationComponent()
117 - if (this.isPermission) {  
118 - PermissionDesComponent()  
119 - }  
120 } 112 }
121 } 113 }
122 } 114 }
@@ -151,7 +151,7 @@ struct Index { @@ -151,7 +151,7 @@ struct Index {
151 TapGesture() 151 TapGesture()
152 .onAction((event: GestureEvent) => { 152 .onAction((event: GestureEvent) => {
153 if (this.AudioSuspension.playerController) { 153 if (this.AudioSuspension.playerController) {
154 - this.AudioSuspension.playerController.get().switchPlayOrPause() 154 + this.AudioSuspension.playerController.get().pause()
155 this.AudioSuspension.minimize() 155 this.AudioSuspension.minimize()
156 } 156 }
157 })) 157 }))
@@ -36,7 +36,7 @@ export struct BottomNavigationComponent { @@ -36,7 +36,7 @@ export struct BottomNavigationComponent {
36 @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 36 @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
37 @State @Watch('onBottomNavigationDataUpdated') bottomNavList: BottomNavDTO[] = [] // 底导/顶导全部数据 37 @State @Watch('onBottomNavigationDataUpdated') bottomNavList: BottomNavDTO[] = [] // 底导/顶导全部数据
38 @State currentNavIndex: number = BottomNavi.NEWS; // 底导当前选中/焦点下标 38 @State currentNavIndex: number = BottomNavi.NEWS; // 底导当前选中/焦点下标
39 - @State topNavList: TopNavDTO[] = [] 39 + // @State topNavList: TopNavDTO[] = []
40 // 底导TabsController 40 // 底导TabsController
41 private navController: TabsController = new TabsController(); 41 private navController: TabsController = new TabsController();
42 readonly ASPECT_RATIO_1_1: number = 1 / 1; // 底导图片宽高比 42 readonly ASPECT_RATIO_1_1: number = 1 / 1; // 底导图片宽高比
@@ -52,8 +52,7 @@ export struct BottomNavigationComponent { @@ -52,8 +52,7 @@ export struct BottomNavigationComponent {
52 @State assignChannel: AssignChannelParam = new AssignChannelParam() 52 @State assignChannel: AssignChannelParam = new AssignChannelParam()
53 // 自动刷新触发(双击tab自动刷新) 53 // 自动刷新触发(双击tab自动刷新)
54 @State autoRefresh: number = 0 54 @State autoRefresh: number = 0
55 - // 顶导数据,从接口获取 TODO 顶导业务逻辑没看懂,暂时不替换顶导list。频道管理数据待梳理  
56 - // @State topNavMap: Record<string, TopNavDTO[]> = {} 55 +
57 56
58 async aboutToAppear() { 57 async aboutToAppear() {
59 Logger.info(TAG, `aboutToAppear currentNavIndex: ${this.currentNavIndex}`); 58 Logger.info(TAG, `aboutToAppear currentNavIndex: ${this.currentNavIndex}`);
@@ -239,11 +238,7 @@ export struct BottomNavigationComponent { @@ -239,11 +238,7 @@ export struct BottomNavigationComponent {
239 // 请求顶导数据(参数): 238 // 请求顶导数据(参数):
240 } 239 }
241 240
242 - //请求顶导数据  
243 - async getTopNavList(id: number) {  
244 - let bottomNavDetail = await ChannelViewModel.getBottomNavDetailData(id)  
245 - this.topNavList = bottomNavDetail?.topNavChannelList || []  
246 - } 241 +
247 242
248 onBottomNavigationDataUpdated() { 243 onBottomNavigationDataUpdated() {
249 Logger.error('yyyy', 'onBottomNavigationDataUpdated ' + JSON.stringify(this.bottomNavList)) 244 Logger.error('yyyy', 'onBottomNavigationDataUpdated ' + JSON.stringify(this.bottomNavList))
@@ -366,7 +361,8 @@ export struct BottomNavigationComponent { @@ -366,7 +361,8 @@ export struct BottomNavigationComponent {
366 item.pageName = 'MY'; 361 item.pageName = 'MY';
367 break; 362 break;
368 default: 363 default:
369 - item.pageName = 'NEWS'; break; 364 + item.pageName = 'NEWS';
  365 + break;
370 } 366 }
371 }) 367 })
372 this.bottomNavList = list 368 this.bottomNavList = list
@@ -55,6 +55,7 @@ export struct MultiPictureDetailPageComponent { @@ -55,6 +55,7 @@ export struct MultiPictureDetailPageComponent {
55 @Provide showCommentList: boolean = false 55 @Provide showCommentList: boolean = false
56 private scroller: Scroller = new Scroller() 56 private scroller: Scroller = new Scroller()
57 @State netStatus: number | undefined = undefined // 存储网络状态用来展示缺省图 57 @State netStatus: number | undefined = undefined // 存储网络状态用来展示缺省图
  58 + @State isOffLine: boolean = false // 存储视频下线状态用来展示缺省图
58 @State showDownload: Boolean = false // 控制是否显示下载默认隐藏 59 @State showDownload: Boolean = false // 控制是否显示下载默认隐藏
59 @State publishCommentModel: publishCommentModel = new publishCommentModel() 60 @State publishCommentModel: publishCommentModel = new publishCommentModel()
60 @State operationButtonList: string[] = ['comment', 'like', 'collect', 'share'] 61 @State operationButtonList: string[] = ['comment', 'like', 'collect', 'share']
@@ -113,7 +114,32 @@ export struct MultiPictureDetailPageComponent { @@ -113,7 +114,32 @@ export struct MultiPictureDetailPageComponent {
113 114
114 build() { 115 build() {
115 RelativeContainer() { 116 RelativeContainer() {
116 - this.init() 117 + if (this.contentDetailData.rmhPlatform == 1) {
  118 + this.rmh()
  119 + }
  120 + if (this.contentDetailData?.photoList && this.contentDetailData?.photoList?.length > 0) {
  121 + this.imgSwiper()
  122 + }
  123 + if (this.netStatus !== undefined) {
  124 + this.noNet()
  125 + }
  126 + if (this.isOffLine) {
  127 + this.offLine()
  128 + }
  129 + Column() {
  130 + if (!this.showDownload) {
  131 + this.NShowDownload()
  132 + }
  133 + if (this.showDownload) {
  134 + this.YShowDownload()
  135 + }
  136 + }
  137 + .zIndex(10)
  138 + .id('e_swiper_bottom')
  139 + .alignRules({
  140 + bottom: { anchor: "__container__", align: VerticalAlign.Bottom },
  141 + middle: { anchor: "__container__", align: HorizontalAlign.Center }
  142 + })
117 CommentDialogView({ 143 CommentDialogView({
118 index: $index, 144 index: $index,
119 currentIndex: $currentIndex, 145 currentIndex: $currentIndex,
@@ -130,310 +156,215 @@ export struct MultiPictureDetailPageComponent { @@ -130,310 +156,215 @@ export struct MultiPictureDetailPageComponent {
130 } 156 }
131 157
132 @Builder 158 @Builder
133 - init() {  
134 - if (this.contentDetailData.rmhPlatform == 1) {  
135 - if (!this.showDownload) {  
136 - Row() {  
137 - Row({ space: 8 }) {  
138 - if (this.getImgUrl()) {  
139 - Row() {  
140 - Stack() {  
141 - Image(this.getImgUrl())  
142 - .borderRadius(18)  
143 - .aspectRatio(1)  
144 - .border({ width: 1, color: Color.White, style: BorderStyle.Solid })  
145 - .width(36)  
146 - .height(36)  
147 - .objectFit(ImageFit.Fill)  
148 - .interpolation(ImageInterpolation.High)  
149 - if (!StringUtils.isEmpty(this.contentDetailData.rmhInfo?.authIcon)) {  
150 - Stack() {  
151 - Image(this.contentDetailData.rmhInfo?.authIcon)  
152 - .width($r('app.float.vp_13'))  
153 - .height($r('app.float.vp_13'))  
154 - .objectFit(ImageFit.Cover)  
155 - }  
156 - .width(36)  
157 - .height(36)  
158 - .alignContent(Alignment.BottomEnd) 159 + rmh() {
  160 + if (!this.showDownload) {
  161 + Row() {
  162 + Row({ space: 8 }) {
  163 + if (this.getImgUrl()) {
  164 + Row() {
  165 + Stack() {
  166 + Image(this.getImgUrl())
  167 + .borderRadius(18)
  168 + .aspectRatio(1)
  169 + .border({ width: 1, color: Color.White, style: BorderStyle.Solid })
  170 + .width(36)
  171 + .height(36)
  172 + .objectFit(ImageFit.Fill)
  173 + .interpolation(ImageInterpolation.High)
  174 + if (!StringUtils.isEmpty(this.contentDetailData.rmhInfo?.authIcon)) {
  175 + Stack() {
  176 + Image(this.contentDetailData.rmhInfo?.authIcon)
  177 + .width($r('app.float.vp_13'))
  178 + .height($r('app.float.vp_13'))
  179 + .objectFit(ImageFit.Cover)
159 } 180 }
  181 + .width(36)
  182 + .height(36)
  183 + .alignContent(Alignment.BottomEnd)
160 } 184 }
161 - .width(36)  
162 - .height(36)  
163 - .alignContent(Alignment.Center)  
164 - .onClick(() => {  
165 - if (this.contentDetailData.rmhInfo?.cnMainControl === 1) {  
166 - // 号主页  
167 - const params: Params = {  
168 - creatorId: this.contentDetailData.rmhInfo.rmhId,  
169 - pageID: ''  
170 - }  
171 - WDRouterRule.jumpWithPage(WDRouterPage.peopleShipHomePage, params)  
172 - }  
173 -  
174 - })  
175 } 185 }
176 - .width('13%')  
177 - .height('100%')  
178 - } 186 + .width(36)
  187 + .height(36)
  188 + .alignContent(Alignment.Center)
  189 + .onClick(() => {
  190 + if (this.contentDetailData.rmhInfo?.cnMainControl === 1) {
  191 + // 号主页
  192 + const params: Params = {
  193 + creatorId: this.contentDetailData.rmhInfo.rmhId,
  194 + pageID: ''
  195 + }
  196 + WDRouterRule.jumpWithPage(WDRouterPage.peopleShipHomePage, params)
  197 + }
179 198
180 - Row() {  
181 - Flex({  
182 - direction: FlexDirection.Column,  
183 - justifyContent: FlexAlign.SpaceAround,  
184 - alignItems: ItemAlign.Start  
185 - }) {  
186 - Text(`${this.contentDetailData?.rmhInfo?.rmhName}`)  
187 - .fontColor(Color.White)  
188 - .fontSize(14)  
189 - .fontFamily('PingFang PingFang SC-Medium')  
190 - .fontWeight(500)  
191 - .lineHeight(17)  
192 - .margin(0)  
193 - .height(17)  
194 - Text(`${this.contentDetailData?.rmhInfo?.rmhDesc}`)  
195 - .fontColor(Color.White)  
196 - .fontSize(12)  
197 - .fontFamily('PingFang SC-Regular')  
198 - .fontWeight(400)  
199 - .lineHeight(14)  
200 - .height(14)  
201 - .textOverflow({ overflow: TextOverflow.Ellipsis })  
202 - .margin(0)  
203 - .maxLines(1)  
204 - } 199 + })
205 } 200 }
206 - .width('81%') 201 + .width('13%')
207 .height('100%') 202 .height('100%')
208 } 203 }
209 - .width('74.4%')  
210 - .height('100%')  
211 - .margin({  
212 - top: 0,  
213 - bottom: 0,  
214 - left: 16,  
215 - right: 0  
216 - })  
217 - .onClick(() => {  
218 - if (this.contentDetailData.rmhInfo?.cnMainControl === 1) {  
219 - // 号主页  
220 - const params: Params = {  
221 - creatorId: this.contentDetailData.rmhInfo.rmhId,  
222 - pageID: ''  
223 - }  
224 - WDRouterRule.jumpWithPage(WDRouterPage.peopleShipHomePage, params)  
225 - }  
226 -  
227 - })  
228 204
229 Row() { 205 Row() {
230 - if (this.followStatus == '0') {  
231 - Button({ type: ButtonType.Normal, stateEffect: true }) {  
232 - Row() {  
233 - Text('+关注').fontSize(12).fontColor(0xffffff)  
234 - }.alignItems(VerticalAlign.Center)  
235 - }  
236 - .borderRadius(4)  
237 - .backgroundColor('#ED2800')  
238 - .width(48)  
239 - .height(24)  
240 - .onClick(() => {  
241 - this.handleAccention()  
242 - })  
243 - } else {  
244 - Button({ type: ButtonType.Normal, stateEffect: true }) {  
245 - Row() {  
246 - Text('已关注').fontSize(12).fontColor(0xffffff)  
247 - }.alignItems(VerticalAlign.Center)  
248 - }  
249 - .borderRadius(4)  
250 - .backgroundColor('#333333')  
251 - .width(54)  
252 - .height(24)  
253 - .onClick(() => {  
254 - this.handleAccention()  
255 - }) 206 + Flex({
  207 + direction: FlexDirection.Column,
  208 + justifyContent: FlexAlign.SpaceAround,
  209 + alignItems: ItemAlign.Start
  210 + }) {
  211 + Text(`${this.contentDetailData?.rmhInfo?.rmhName}`)
  212 + .fontColor(Color.White)
  213 + .fontSize(14)
  214 + .fontFamily('PingFang PingFang SC-Medium')
  215 + .fontWeight(500)
  216 + .lineHeight(17)
  217 + .margin(0)
  218 + .height(17)
  219 + Text(`${this.contentDetailData?.rmhInfo?.rmhDesc}`)
  220 + .fontColor(Color.White)
  221 + .fontSize(12)
  222 + .fontFamily('PingFang SC-Regular')
  223 + .fontWeight(400)
  224 + .lineHeight(14)
  225 + .height(14)
  226 + .textOverflow({ overflow: TextOverflow.Ellipsis })
  227 + .margin(0)
  228 + .maxLines(1)
256 } 229 }
257 -  
258 } 230 }
259 - .justifyContent(FlexAlign.Center)  
260 - .alignItems(VerticalAlign.Center)  
261 - .width('21.6%') 231 + .width('81%')
262 .height('100%') 232 .height('100%')
263 } 233 }
264 - .width('100%')  
265 - .height(44)  
266 - .zIndex(10)  
267 - .margin({ top: `${this.topSafeHeight + 12}px` })  
268 - .alignRules({  
269 - top: { anchor: "__container__", align: VerticalAlign.Top },  
270 - middle: { anchor: "__container__", align: HorizontalAlign.Center } 234 + .width('74.4%')
  235 + .height('100%')
  236 + .margin({
  237 + top: 0,
  238 + bottom: 0,
  239 + left: 16,
  240 + right: 0
271 }) 241 })
272 - .id('e_attention')  
273 - .transition(TransitionEffect.OPACITY.animation({ duration: this.duration, curve: Curve.Ease }).combine(  
274 - TransitionEffect.translate({ x: 0, y: `-${this.topSafeHeight + 12}px` })  
275 - ))  
276 - }  
277 -  
278 - }  
279 - if (this.contentDetailData?.photoList && this.contentDetailData?.photoList?.length > 0) {  
280 - Swiper(this.swiperController) {  
281 - ForEach(this.contentDetailData.photoList, (item: PhotoListBean) => {  
282 - Swiper(this.swiperControllerItem) {  
283 - MultiPictureDetailItemComponent({ MultiPictureDetailItem: item }) 242 + .onClick(() => {
  243 + if (this.contentDetailData.rmhInfo?.cnMainControl === 1) {
  244 + // 号主页
  245 + const params: Params = {
  246 + creatorId: this.contentDetailData.rmhInfo.rmhId,
  247 + pageID: ''
  248 + }
  249 + WDRouterRule.jumpWithPage(WDRouterPage.peopleShipHomePage, params)
284 } 250 }
285 - .width('100%')  
286 - .height('100%')  
287 - .vertical(true)  
288 - .autoPlay(false)  
289 - .cachedCount(1)  
290 - .indicator(false)  
291 - .displayCount(1)  
292 - .onGestureSwipe((index: number, extraInfo: SwiperAnimationEvent) => {  
293 - console.info("onGestureSwipe current offset: " + extraInfo.currentOffset)  
294 - this.currentOffset = Math.abs(extraInfo.currentOffset)  
295 - })  
296 - .onTouch((event: TouchEvent) => {  
297 - if (this.duration === 0) {  
298 - this.duration = 500 251 +
  252 + })
  253 +
  254 + Row() {
  255 + if (this.followStatus == '0') {
  256 + Button({ type: ButtonType.Normal, stateEffect: true }) {
  257 + Row() {
  258 + Text('+关注').fontSize(12).fontColor(0xffffff)
  259 + }.alignItems(VerticalAlign.Center)
299 } 260 }
300 - if (event.type === 1) {  
301 - // if(this.currentOffset > px2vp((this.windowHeight - item.height)/2 - 100)) {  
302 - if (this.currentOffset > 160) {  
303 - router.back()  
304 - } 261 + .borderRadius(4)
  262 + .backgroundColor('#ED2800')
  263 + .width(48)
  264 + .height(24)
  265 + .onClick(() => {
  266 + this.handleAccention()
  267 + })
  268 + } else {
  269 + Button({ type: ButtonType.Normal, stateEffect: true }) {
  270 + Row() {
  271 + Text('已关注').fontSize(12).fontColor(0xffffff)
  272 + }.alignItems(VerticalAlign.Center)
305 } 273 }
306 - })  
307 - }) 274 + .borderRadius(4)
  275 + .backgroundColor('#333333')
  276 + .width(54)
  277 + .height(24)
  278 + .onClick(() => {
  279 + this.handleAccention()
  280 + })
  281 + }
  282 +
  283 + }
  284 + .justifyContent(FlexAlign.Center)
  285 + .alignItems(VerticalAlign.Center)
  286 + .width('21.6%')
  287 + .height('100%')
308 } 288 }
309 - .index(this.swiperIndex)  
310 .width('100%') 289 .width('100%')
311 - .height('100%')  
312 - .vertical(false)  
313 - .autoPlay(false)  
314 - .indicator(false)  
315 - .displayCount(1)  
316 - .loop(false)  
317 - .effectMode(EdgeEffect.None)  
318 - .id('e_swiper_content') 290 + .height(44)
  291 + .zIndex(10)
  292 + .margin({ top: `${this.topSafeHeight + 12}px` })
319 .alignRules({ 293 .alignRules({
320 - center: { anchor: "__container__", align: VerticalAlign.Center }, 294 + top: { anchor: "__container__", align: VerticalAlign.Top },
321 middle: { anchor: "__container__", align: HorizontalAlign.Center } 295 middle: { anchor: "__container__", align: HorizontalAlign.Center }
322 }) 296 })
323 - .zIndex(1)  
324 - .onAnimationStart((index: number, targetIndex: number, extraInfo: SwiperAnimationEvent) => {  
325 - this.swiperIndex = targetIndex  
326 - })  
327 - .onClick(() => {  
328 - this.showDownload = !this.showDownload  
329 - }) 297 + .id('e_attention')
  298 + .transition(TransitionEffect.OPACITY.animation({ duration: this.duration, curve: Curve.Ease }).combine(
  299 + TransitionEffect.translate({ x: 0, y: `-${this.topSafeHeight + 12}px` })
  300 + ))
330 } 301 }
331 - if (this.netStatus !== undefined) {  
332 - EmptyComponent({  
333 - emptyType: this.netStatus, emptyButton: true, retry: () => {  
334 - this.getContentDetailData() 302 + }
  303 +
  304 + @Builder
  305 + imgSwiper() {
  306 + Swiper(this.swiperController) {
  307 + ForEach(this.contentDetailData.photoList, (item: PhotoListBean) => {
  308 + Swiper(this.swiperControllerItem) {
  309 + MultiPictureDetailItemComponent({ MultiPictureDetailItem: item })
335 } 310 }
336 - })  
337 - .id('e_empty_content')  
338 - .alignRules({  
339 - center: { anchor: "__container__", align: VerticalAlign.Center },  
340 - middle: { anchor: "__container__", align: HorizontalAlign.Center } 311 + .width('100%')
  312 + .height('100%')
  313 + .vertical(true)
  314 + .autoPlay(false)
  315 + .cachedCount(1)
  316 + .indicator(false)
  317 + .displayCount(1)
  318 + .loop(false)
  319 + .onGestureSwipe((index: number, extraInfo: SwiperAnimationEvent) => {
  320 + console.info("onGestureSwipe current offset: " + extraInfo.currentOffset)
  321 + this.currentOffset = Math.abs(extraInfo.currentOffset)
341 }) 322 })
342 - }  
343 - Column() {  
344 - if (!this.showDownload) {  
345 - Column() {  
346 - Row() {  
347 - Scroll(this.scroller) {  
348 - Row() {  
349 - Flex({  
350 - direction: FlexDirection.Column,  
351 - justifyContent: FlexAlign.Start  
352 - }) {  
353 - if (this.contentDetailData?.photoList?.length) {  
354 - Text() {  
355 - Span(`${this.swiperIndex + 1}`)  
356 - .fontSize(24)  
357 - .fontFamily('PingFang SC-Medium')  
358 - .fontWeight(500)  
359 - .lineHeight(28)  
360 - Span(`/${this.contentDetailData?.photoList?.length}`)  
361 - .fontSize(14)  
362 - .fontFamily('PingFang SC-Medium')  
363 - .fontWeight(500)  
364 - .lineHeight(19)  
365 - }  
366 - .fontColor(Color.White)  
367 - .margin({  
368 - top: 4,  
369 - left: 18,  
370 - bottom: 4,  
371 - right: 4  
372 - })  
373 - }  
374 - if (this.contentDetailData.newsTitle) {  
375 - Text(`${this.contentDetailData.newsTitle}`)  
376 - .fontColor(Color.White)  
377 - .fontSize(16)  
378 - .fontFamily('PingFang SC-Semibold')  
379 - .fontWeight(600)  
380 - .lineHeight(24)  
381 - .margin({  
382 - top: 4,  
383 - left: 18,  
384 - bottom: 4,  
385 - right: 18  
386 - })  
387 - }  
388 - if (this.contentDetailData.photoList?.[this.swiperIndex].picDesc) {  
389 - Text(`${this.contentDetailData.photoList?.[this.swiperIndex].picDesc}`)  
390 - .fontColor(Color.White)  
391 - .fontSize(14)  
392 - .fontFamily('PingFang SC-Regular')  
393 - .fontWeight(400)  
394 - .lineHeight(22)  
395 - .textOverflow({ overflow: TextOverflow.Ellipsis })  
396 - .margin({  
397 - top: 4,  
398 - left: 0,  
399 - bottom: 4,  
400 - right: 18  
401 - })  
402 - .maxLines(32)  
403 - }  
404 - }  
405 - }  
406 - .width('100%')  
407 - }  
408 - .scrollable(ScrollDirection.Vertical)  
409 - .scrollBarWidth(0)  
410 - .height(px2vp(this.titleHeight))  
411 - .align(Alignment.Bottom) 323 + .onTouch((event: TouchEvent) => {
  324 + if (this.duration === 0) {
  325 + this.duration = 500
412 } 326 }
413 -  
414 - OperRowListView({  
415 - contentDetailData: this.contentDetailData,  
416 - publishCommentModel: this.publishCommentModel,  
417 - operationButtonList: this.operationButtonList,  
418 - styleType: 2,  
419 - componentType: 5,  
420 - pageComponentType: 3,  
421 - onCommentIconClick: () => {  
422 - this.showCommentList = true 327 + if (event.type === 1) {
  328 + // if(this.currentOffset > px2vp((this.windowHeight - item.height)/2 - 100)) {
  329 + if (this.currentOffset > 160) {
  330 + router.back()
423 } 331 }
424 - }) 332 + }
  333 + })
  334 + })
  335 + }
  336 + .index(this.swiperIndex)
  337 + .width('100%')
  338 + .height('100%')
  339 + .vertical(false)
  340 + .autoPlay(false)
  341 + .indicator(false)
  342 + .displayCount(1)
  343 + .loop(false)
  344 + .effectMode(EdgeEffect.Spring)
  345 + .id('e_swiper_content')
  346 + .alignRules({
  347 + center: { anchor: "__container__", align: VerticalAlign.Center },
  348 + middle: { anchor: "__container__", align: HorizontalAlign.Center }
  349 + })
  350 + .zIndex(1)
  351 + .onAnimationStart((index: number, targetIndex: number, extraInfo: SwiperAnimationEvent) => {
  352 + this.swiperIndex = targetIndex
  353 + })
  354 + .onClick(() => {
  355 + this.showDownload = !this.showDownload
  356 + })
  357 + }
425 358
426 - }  
427 - .transition(TransitionEffect.OPACITY.animation({ duration: this.duration, curve: Curve.Ease }).combine(  
428 - TransitionEffect.translate({ x: 0, y: `-${this.bottomSafeHeight}px` })  
429 - ))  
430 - }  
431 - if (this.showDownload) {  
432 - Column() { 359 + @Builder
  360 + NShowDownload() {
  361 + Column() {
  362 + Row() {
  363 + Scroll(this.scroller) {
433 Row() { 364 Row() {
434 Flex({ 365 Flex({
435 - direction: FlexDirection.Row,  
436 - justifyContent: FlexAlign.SpaceBetween 366 + direction: FlexDirection.Column,
  367 + justifyContent: FlexAlign.Start
437 }) { 368 }) {
438 if (this.contentDetailData?.photoList?.length) { 369 if (this.contentDetailData?.photoList?.length) {
439 Text() { 370 Text() {
@@ -449,44 +380,155 @@ export struct MultiPictureDetailPageComponent { @@ -449,44 +380,155 @@ export struct MultiPictureDetailPageComponent {
449 .lineHeight(19) 380 .lineHeight(19)
450 } 381 }
451 .fontColor(Color.White) 382 .fontColor(Color.White)
452 - .margin(4) 383 + .margin({
  384 + top: 4,
  385 + left: 18,
  386 + bottom: 4,
  387 + right: 4
  388 + })
453 } 389 }
454 -  
455 - if (this.contentDetailData.photoList?.[this.swiperIndex].picPath) {  
456 - ImageDownloadComponent({ url: this.contentDetailData.photoList?.[this.swiperIndex].picPath }) 390 + if (this.contentDetailData.newsTitle) {
  391 + Text(`${this.contentDetailData.newsTitle}`)
  392 + .fontColor(Color.White)
  393 + .fontSize(16)
  394 + .fontFamily('PingFang SC-Semibold')
  395 + .fontWeight(600)
  396 + .lineHeight(24)
457 .margin({ 397 .margin({
458 - top: 8, 398 + top: 4,
459 left: 18, 399 left: 18,
460 - bottom: 24, 400 + bottom: 4,
  401 + right: 18
  402 + })
  403 + }
  404 + if (this.contentDetailData.photoList?.[this.swiperIndex].picDesc) {
  405 + Text(`${this.contentDetailData.photoList?.[this.swiperIndex].picDesc}`)
  406 + .fontColor(Color.White)
  407 + .fontSize(14)
  408 + .fontFamily('PingFang SC-Regular')
  409 + .fontWeight(400)
  410 + .lineHeight(22)
  411 + .textOverflow({ overflow: TextOverflow.Ellipsis })
  412 + .margin({
  413 + top: 4,
  414 + left: 0,
  415 + bottom: 4,
461 right: 18 416 right: 18
462 }) 417 })
463 - .parallelGesture(  
464 - TapGesture()  
465 - .onAction((event: GestureEvent) => {  
466 - TrackingContent.download(1,TrackConstants.PageName.Atlas_Detail,TrackConstants.PageName.Atlas_Detail,this.pageParam)  
467 - })) 418 + .maxLines(32)
468 } 419 }
469 } 420 }
470 } 421 }
471 .width('100%') 422 .width('100%')
472 } 423 }
473 - .transition(TransitionEffect.OPACITY.animation({ duration: this.duration, curve: Curve.Ease }).combine(  
474 - TransitionEffect.translate({ x: 0, y: `${this.bottomSafeHeight}px` })  
475 - )) 424 + .scrollable(ScrollDirection.Vertical)
  425 + .scrollBarWidth(0)
  426 + .constraintSize({
  427 + maxHeight: px2vp(this.titleHeight)
  428 + })
  429 + .align(Alignment.Bottom)
476 } 430 }
  431 +
  432 + OperRowListView({
  433 + contentDetailData: this.contentDetailData,
  434 + publishCommentModel: this.publishCommentModel,
  435 + operationButtonList: this.operationButtonList,
  436 + styleType: 2,
  437 + componentType: 5,
  438 + pageComponentType: 3,
  439 + onCommentIconClick: () => {
  440 + this.showCommentList = true
  441 + }
  442 + })
  443 +
477 } 444 }
478 - .zIndex(10)  
479 - .id('e_swiper_bottom')  
480 - .alignRules({  
481 - bottom: { anchor: "__container__", align: VerticalAlign.Bottom },  
482 - middle: { anchor: "__container__", align: HorizontalAlign.Center } 445 + .transition(TransitionEffect.OPACITY.animation({ duration: this.duration, curve: Curve.Ease }).combine(
  446 + TransitionEffect.translate({ x: 0, y: `-${this.bottomSafeHeight}px` })
  447 + ))
  448 + }
  449 +
  450 + @Builder
  451 + YShowDownload() {
  452 + Column() {
  453 + Row() {
  454 + Flex({
  455 + direction: FlexDirection.Row,
  456 + justifyContent: FlexAlign.SpaceBetween
  457 + }) {
  458 + if (this.contentDetailData?.photoList?.length) {
  459 + Text() {
  460 + Span(`${this.swiperIndex + 1}`)
  461 + .fontSize(24)
  462 + .fontFamily('PingFang SC-Medium')
  463 + .fontWeight(500)
  464 + .lineHeight(28)
  465 + Span(`/${this.contentDetailData?.photoList?.length}`)
  466 + .fontSize(14)
  467 + .fontFamily('PingFang SC-Medium')
  468 + .fontWeight(500)
  469 + .lineHeight(19)
  470 + }
  471 + .fontColor(Color.White)
  472 + .margin(4)
  473 + }
  474 +
  475 + if (this.contentDetailData.photoList?.[this.swiperIndex].picPath) {
  476 + ImageDownloadComponent({ url: this.contentDetailData.photoList?.[this.swiperIndex].picPath })
  477 + .margin({
  478 + top: 8,
  479 + left: 18,
  480 + bottom: 24,
  481 + right: 18
  482 + })
  483 + .parallelGesture(
  484 + TapGesture()
  485 + .onAction((event: GestureEvent) => {
  486 + TrackingContent.download(1,TrackConstants.PageName.Atlas_Detail,TrackConstants.PageName.Atlas_Detail,this.pageParam)
  487 + }))
  488 + }
  489 + }
  490 + }
  491 + .width('100%')
  492 + }
  493 + .transition(TransitionEffect.OPACITY.animation({ duration: this.duration, curve: Curve.Ease }).combine(
  494 + TransitionEffect.translate({ x: 0, y: `${this.bottomSafeHeight}px` })
  495 + ))
  496 + }
  497 +
  498 + @Builder
  499 + noNet() {
  500 + EmptyComponent({
  501 + emptyType: 1, emptyButton: true, retry: () => {
  502 + this.getContentDetailData()
  503 + }
  504 + })
  505 + .id('e_empty_content')
  506 + .alignRules({
  507 + center: { anchor: "__container__", align: VerticalAlign.Center },
  508 + middle: { anchor: "__container__", align: HorizontalAlign.Center }
  509 + })
  510 + }
  511 +
  512 + @Builder
  513 + offLine() {
  514 + EmptyComponent({
  515 + emptyType: 15, emptyButton: true, retry: () => {
  516 + this.getContentDetailData
  517 + }
483 }) 518 })
  519 + .id('e_empty_content')
  520 + .alignRules({
  521 + center: { anchor: "__container__", align: VerticalAlign.Center },
  522 + middle: { anchor: "__container__", align: HorizontalAlign.Center }
  523 + })
  524 + .backgroundColor(Color.Black)
484 } 525 }
485 526
486 getContentDetailData() { 527 getContentDetailData() {
487 try { 528 try {
488 PageRepository.fetchDetailData(this.relId, this.contentId, this.relType) 529 PageRepository.fetchDetailData(this.relId, this.contentId, this.relType)
489 .then(async (resDTO: ResponseDTO<ContentDetailDTO[]>) => { 530 .then(async (resDTO: ResponseDTO<ContentDetailDTO[]>) => {
  531 + this.isOffLine = resDTO.data == null ? true : false
490 if (!resDTO || !resDTO.data) { 532 if (!resDTO || !resDTO.data) {
491 Logger.error(TAG, 'fetchDetailData is empty'); 533 Logger.error(TAG, 'fetchDetailData is empty');
492 return 534 return