wangliang_wd

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

* 'main' of http://192.168.1.42/developOne/harmonyPool:
  fix |> 20791 人民号>推荐频道,地方精选卡不应展示更多按钮,见对比截图。
  ref |> 修复离开直播详情时,没有退出直播IM问题
  fix |> 20785 【偶现】搜索结果,数据重复展示
@@ -8,4 +8,5 @@ export const enum BottomNavi { @@ -8,4 +8,5 @@ export const enum BottomNavi {
8 VIDEO=2, 8 VIDEO=2,
9 SERVICE=3, 9 SERVICE=3,
10 MINE=4, 10 MINE=4,
  11 + TEMPLATE=5,
11 } 12 }
@@ -112,6 +112,7 @@ export class ContentDTO implements BaseDTO { @@ -112,6 +112,7 @@ export class ContentDTO implements BaseDTO {
112 sameContentList:ContentDTO[] = [] 112 sameContentList:ContentDTO[] = []
113 sameContentListJson:string = "" 113 sameContentListJson:string = ""
114 sameContentListSize:number = 0 114 sameContentListSize:number = 0
  115 + sameContentListId:string = ""
115 /* 116 /*
116 本地辅助字段 117 本地辅助字段
117 */ 118 */
1 import { CompDTO, ContentDTO } from 'wdBean'; 1 import { CompDTO, ContentDTO } from 'wdBean';
2 -import { CommonConstants, CompStyle } from 'wdConstant/Index'; 2 +import { BottomNavi, CommonConstants, CompStyle } from 'wdConstant/Index';
3 import PageModel from '../viewmodel/PageModel'; 3 import PageModel from '../viewmodel/PageModel';
4 import { CardParser } from './CardParser'; 4 import { CardParser } from './CardParser';
5 import { Card2Component } from './cardview/Card2Component'; 5 import { Card2Component } from './cardview/Card2Component';
@@ -42,6 +42,7 @@ export struct CompParser { @@ -42,6 +42,7 @@ export struct CompParser {
42 @State private pageModel: PageModel = new PageModel(); 42 @State private pageModel: PageModel = new PageModel();
43 @State audioItems: ContentDTO[] = []; 43 @State audioItems: ContentDTO[] = [];
44 @State noneAudioItems: ContentDTO[] = []; 44 @State noneAudioItems: ContentDTO[] = [];
  45 + bottomNavi:BottomNavi = BottomNavi.PEOPLE
45 46
46 aboutToAppear(): void { 47 aboutToAppear(): void {
47 48
@@ -167,7 +168,7 @@ export struct CompParser { @@ -167,7 +168,7 @@ export struct CompParser {
167 ZhGridLayout03({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName, loadImg: this.pageModel.loadImg }) 168 ZhGridLayout03({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName, loadImg: this.pageModel.loadImg })
168 this.getBehindDivider() 169 this.getBehindDivider()
169 } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_04) { 170 } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_04) {
170 - ZhSingleRow04({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName, loadImg: this.pageModel.loadImg }) 171 + ZhSingleRow04({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName, loadImg: this.pageModel.loadImg ,bottomNavi:this.bottomNavi})
171 this.getBehindDivider() 172 this.getBehindDivider()
172 } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_05) { 173 } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_05) {
173 // ZhSingleRow05({ compDTO }) 174 // ZhSingleRow05({ compDTO })
1 import { CompDTO, ContentDTO } from 'wdBean'; 1 import { CompDTO, ContentDTO } from 'wdBean';
2 -import { CommonConstants } from 'wdConstant'; 2 +import { BottomNavi, CommonConstants } from 'wdConstant';
3 import { DateTimeUtils } from 'wdKit'; 3 import { DateTimeUtils } from 'wdKit';
4 import { ProcessUtils } from 'wdRouter'; 4 import { ProcessUtils } from 'wdRouter';
5 import { InfomationCardClick } from '../../utils/infomationCardClick'; 5 import { InfomationCardClick } from '../../utils/infomationCardClick';
@@ -15,6 +15,7 @@ export struct ZhSingleRow04 { @@ -15,6 +15,7 @@ export struct ZhSingleRow04 {
15 @State pageId: string = ''; 15 @State pageId: string = '';
16 @State pageName: string = ''; 16 @State pageName: string = '';
17 @State compDTO: CompDTO = {} as CompDTO 17 @State compDTO: CompDTO = {} as CompDTO
  18 + bottomNavi:BottomNavi = BottomNavi.PEOPLE
18 19
19 build() { 20 build() {
20 Column() { 21 Column() {
@@ -32,30 +33,33 @@ export struct ZhSingleRow04 { @@ -32,30 +33,33 @@ export struct ZhSingleRow04 {
32 .lineHeight(25) 33 .lineHeight(25)
33 } 34 }
34 35
35 - Row() {  
36 - Text("更多")  
37 - .fontSize($r("app.float.font_size_14"))  
38 - .fontColor($r("app.color.color_999999"))  
39 - .margin({ right: 1 })  
40 - Image($r("app.media.more"))  
41 - .width(14)  
42 - .height(14)  
43 - }  
44 - .visibility(this.compDTO?.objectType === '0' || this.compDTO?.objectType === '' ? Visibility.None :  
45 - Visibility.Visible)  
46 - .onClick(() => {  
47 - if (this.compDTO?.objectType === '11') {  
48 - ProcessUtils.jumpChannelTab(this.compDTO.objectId, this.compDTO.pageId as string, this.compDTO.objectTitle)  
49 - } else {  
50 - const contentDTO: ContentDTO = {  
51 - objectId: this.compDTO.objectId,  
52 - objectType: this.compDTO.objectType,  
53 - linkUrl: this.compDTO.linkUrl,  
54 - pageId: this.compDTO.pageId  
55 - } as ContentDTO  
56 - ProcessUtils.processPage(contentDTO) 36 +
  37 + if(this.bottomNavi === BottomNavi.NEWS){
  38 + Row() {
  39 + Text("更多")
  40 + .fontSize($r("app.float.font_size_14"))
  41 + .fontColor($r("app.color.color_999999"))
  42 + .margin({ right: 1 })
  43 + Image($r("app.media.more"))
  44 + .width(14)
  45 + .height(14)
57 } 46 }
58 - }) 47 + .visibility(this.compDTO?.objectType === '0' || this.compDTO?.objectType === '' ? Visibility.None :
  48 + Visibility.Visible)
  49 + .onClick(() => {
  50 + if (this.compDTO?.objectType === '11') {
  51 + ProcessUtils.jumpChannelTab(this.compDTO.objectId, this.compDTO.pageId as string, this.compDTO.objectTitle)
  52 + } else {
  53 + const contentDTO: ContentDTO = {
  54 + objectId: this.compDTO.objectId,
  55 + objectType: this.compDTO.objectType,
  56 + linkUrl: this.compDTO.linkUrl,
  57 + pageId: this.compDTO.pageId
  58 + } as ContentDTO
  59 + ProcessUtils.processPage(contentDTO)
  60 + }
  61 + })
  62 + }
59 } 63 }
60 .justifyContent(FlexAlign.SpaceBetween) 64 .justifyContent(FlexAlign.SpaceBetween)
61 .margin({ bottom: 8 }) 65 .margin({ bottom: 8 })
@@ -125,7 +125,8 @@ export struct PageComponent { @@ -125,7 +125,8 @@ export struct PageComponent {
125 nextCompDTO: compIndex === this.pageModel.compList.getDataArray().length - 1 ? new CompDTO() : this.pageModel.compList.get(compIndex + 1) as CompDTO, 125 nextCompDTO: compIndex === this.pageModel.compList.getDataArray().length - 1 ? new CompDTO() : this.pageModel.compList.get(compIndex + 1) as CompDTO,
126 compDTO: compDTO, 126 compDTO: compDTO,
127 compIndex: compIndex, 127 compIndex: compIndex,
128 - pageId: this.pageId 128 + pageId: this.pageId,
  129 + bottomNavi:this.bottomNavi
129 } 130 }
130 ) 131 )
131 } 132 }
@@ -9,6 +9,7 @@ import LoadMoreLayout from '../LoadMoreLayout' @@ -9,6 +9,7 @@ import LoadMoreLayout from '../LoadMoreLayout'
9 import TemplatePageHelp from './TemplatePageHelp' 9 import TemplatePageHelp from './TemplatePageHelp'
10 import TemplatePageModel from './TemplatePageModel' 10 import TemplatePageModel from './TemplatePageModel'
11 import { TemplatePageStateType } from './TemplatePageStateType' 11 import { TemplatePageStateType } from './TemplatePageStateType'
  12 +import { BottomNavi} from 'wdConstant/Index';
12 13
13 14
14 const TAG: string = 'TemplatePageComponent'; 15 const TAG: string = 'TemplatePageComponent';
@@ -126,7 +127,8 @@ export default struct TemplatePageComponent { @@ -126,7 +127,8 @@ export default struct TemplatePageComponent {
126 nextCompDTO: index === this.templatePage.compList.getDataArray().length - 1 ? new CompDTO() : this.templatePage.compList.get(index + 1) as CompDTO, 127 nextCompDTO: index === this.templatePage.compList.getDataArray().length - 1 ? new CompDTO() : this.templatePage.compList.get(index + 1) as CompDTO,
127 compIndex: index, 128 compIndex: index,
128 pageId: this.pageId, 129 pageId: this.pageId,
129 - pageName: this.pageName 130 + pageName: this.pageName,
  131 + bottomNavi:BottomNavi.TEMPLATE
130 }); 132 });
131 } 133 }
132 } 134 }
@@ -62,7 +62,6 @@ export struct SearchResultContentComponent { @@ -62,7 +62,6 @@ export struct SearchResultContentComponent {
62 62
63 this.curPageNum = 1 63 this.curPageNum = 1
64 this.hasMore = true 64 this.hasMore = true
65 - this.isLoading = false  
66 this.getNewSearchResultData() 65 this.getNewSearchResultData()
67 } 66 }
68 67
@@ -86,6 +85,10 @@ export struct SearchResultContentComponent { @@ -86,6 +85,10 @@ export struct SearchResultContentComponent {
86 } 85 }
87 86
88 getNewSearchResultData() { 87 getNewSearchResultData() {
  88 + if (this.isLoading){
  89 + return
  90 + }
  91 +
89 this.isLoading = true 92 this.isLoading = true
90 if (this.hasMore) { 93 if (this.hasMore) {
91 SearcherAboutDataModel.getSearchResultListData("20", `${this.curPageNum}`, this.searchType, this.keywords, 94 SearcherAboutDataModel.getSearchResultListData("20", `${this.curPageNum}`, this.searchType, this.keywords,
@@ -178,6 +181,8 @@ export struct SearchResultContentComponent { @@ -178,6 +181,8 @@ export struct SearchResultContentComponent {
178 this.isLoading = false 181 this.isLoading = false
179 this.count = this.count === -1 ? 0 : this.count 182 this.count = this.count === -1 ? 0 : this.count
180 }) 183 })
  184 + }else{
  185 + this.isLoading = false
181 } 186 }
182 } 187 }
183 188
@@ -236,12 +241,23 @@ export struct SearchResultContentComponent { @@ -236,12 +241,23 @@ export struct SearchResultContentComponent {
236 // } 241 // }
237 let contentDTO = this.dataTransform(rem, value, photos); 242 let contentDTO = this.dataTransform(rem, value, photos);
238 if (value.data.type != "13") { 243 if (value.data.type != "13") {
239 - this.data.push(contentDTO)  
240 - if (value.data.sameContentList != null && value.data.sameContentList.length > 0) {  
241 - let contentDTO2 = new ContentDTO();  
242 - contentDTO2.sameContentListJson = JSON.stringify(value.data.sameContentList)  
243 - contentDTO2.sameContentListSize = value.data.sameContentList.length  
244 - this.data.push(contentDTO2) 244 + //避免 重复(偶现bug 暂时处理)
  245 + let index = this.data.getDataArray().findIndex(obj => obj.objectId == contentDTO.objectId);
  246 + if (index === -1) {
  247 + this.data.push(contentDTO)
  248 +
  249 + if (value.data.sameContentList != null && value.data.sameContentList.length > 0) {
  250 + let contentDTO2 = new ContentDTO();
  251 + contentDTO2.sameContentListId = contentDTO.objectId + value.data.sameContentList[0].id
  252 + contentDTO2.sameContentListJson = JSON.stringify(value.data.sameContentList)
  253 + contentDTO2.sameContentListSize = value.data.sameContentList.length
  254 +
  255 + let index = this.data.getDataArray().findIndex(obj => obj.sameContentListId == contentDTO2.sameContentListId)
  256 + if (index === -1){
  257 + this.data.push(contentDTO2)
  258 + }
  259 + }
  260 +
245 } 261 }
246 } 262 }
247 }) 263 })
@@ -256,6 +272,7 @@ export struct SearchResultContentComponent { @@ -256,6 +272,7 @@ export struct SearchResultContentComponent {
256 } 272 }
257 this.isLoading = false 273 this.isLoading = false
258 }).catch((err: Error) => { 274 }).catch((err: Error) => {
  275 + this.isLoading = false
259 console.log(TAG, JSON.stringify(err)) 276 console.log(TAG, JSON.stringify(err))
260 }) 277 })
261 }).catch((err: Error) => { 278 }).catch((err: Error) => {
@@ -265,6 +282,7 @@ export struct SearchResultContentComponent { @@ -265,6 +282,7 @@ export struct SearchResultContentComponent {
265 }) 282 })
266 } else { 283 } else {
267 this.hasMore = false 284 this.hasMore = false
  285 + this.isLoading = false
268 } 286 }
269 } 287 }
270 288
@@ -51,4 +51,7 @@ export class LiveDetailChatRoomController { @@ -51,4 +51,7 @@ export class LiveDetailChatRoomController {
51 room.enterRoom() 51 room.enterRoom()
52 } 52 }
53 } 53 }
  54 + disconnectLiveRoom() {
  55 + LiveRoomManager.sharedManager().disconnect()
  56 + }
54 } 57 }
@@ -100,6 +100,7 @@ export struct DetailPlayLivePage { @@ -100,6 +100,7 @@ export struct DetailPlayLivePage {
100 Logger.info(TAG, `wyj-aboutToDisappear`) 100 Logger.info(TAG, `wyj-aboutToDisappear`)
101 await this.playerController?.stop() 101 await this.playerController?.stop()
102 await this.playerController?.release() 102 await this.playerController?.release()
  103 + this.chatRoomController.disconnectLiveRoom()
103 } 104 }
104 105
105 configChatRoom() { 106 configChatRoom() {
@@ -84,6 +84,7 @@ export struct DetailPlayVLivePage { @@ -84,6 +84,7 @@ export struct DetailPlayVLivePage {
84 84
85 aboutToDisappear(): void { 85 aboutToDisappear(): void {
86 this.closeFullScreen() 86 this.closeFullScreen()
  87 + this.chatRoomController.disconnectLiveRoom()
87 } 88 }
88 89
89 openFullScreen() { 90 openFullScreen() {