liyubing

fix:1)搜索 输入wuhuhuan,人民号提示暂无内容,android显示对应结果

@@ -10,7 +10,7 @@ import { @@ -10,7 +10,7 @@ import {
10 } from 'wdBean/Index' 10 } from 'wdBean/Index'
11 import { LiveInfoDTO } from 'wdBean/src/main/ets/bean/detail/LiveInfoDTO' 11 import { LiveInfoDTO } from 'wdBean/src/main/ets/bean/detail/LiveInfoDTO'
12 import { VoiceInfoDTO } from 'wdBean/src/main/ets/bean/detail/VoiceInfoDTO' 12 import { VoiceInfoDTO } from 'wdBean/src/main/ets/bean/detail/VoiceInfoDTO'
13 -import { LazyDataSource, StringUtils, UserDataLocal } from 'wdKit/Index' 13 +import { LazyDataSource, StringUtils, UserDataLocal } from 'wdKit/Index'
14 import MinePageDatasModel from '../../model/MinePageDatasModel' 14 import MinePageDatasModel from '../../model/MinePageDatasModel'
15 import SearcherAboutDataModel from '../../model/SearcherAboutDataModel' 15 import SearcherAboutDataModel from '../../model/SearcherAboutDataModel'
16 import { CreatorDetailRequestItem } from '../../viewmodel/CreatorDetailRequestItem' 16 import { CreatorDetailRequestItem } from '../../viewmodel/CreatorDetailRequestItem'
@@ -19,8 +19,7 @@ import { FollowListDetailItem } from '../../viewmodel/FollowListDetailItem' @@ -19,8 +19,7 @@ import { FollowListDetailItem } from '../../viewmodel/FollowListDetailItem'
19 import { FollowListStatusRequestItem } from '../../viewmodel/FollowListStatusRequestItem' 19 import { FollowListStatusRequestItem } from '../../viewmodel/FollowListStatusRequestItem'
20 import { QueryListIsFollowedItem } from '../../viewmodel/QueryListIsFollowedItem' 20 import { QueryListIsFollowedItem } from '../../viewmodel/QueryListIsFollowedItem'
21 import { SearchResultContentData } from '../../viewmodel/SearchResultContentData' 21 import { SearchResultContentData } from '../../viewmodel/SearchResultContentData'
22 -import {  
23 - SearchResultContentItem, SearchRmhDescription } from '../../viewmodel/SearchResultContentItem' 22 +import { SearchResultContentItem, SearchRmhDescription } from '../../viewmodel/SearchResultContentItem'
24 import { CardParser } from '../CardParser' 23 import { CardParser } from '../CardParser'
25 import { FollowChildComponent } from '../mine/follow/FollowChildComponent' 24 import { FollowChildComponent } from '../mine/follow/FollowChildComponent'
26 import { ListHasNoMoreDataUI } from '../reusable/ListHasNoMoreDataUI' 25 import { ListHasNoMoreDataUI } from '../reusable/ListHasNoMoreDataUI'
@@ -38,7 +37,7 @@ export struct SearchResultContentComponent { @@ -38,7 +37,7 @@ export struct SearchResultContentComponent {
38 @State keywords: string = "" 37 @State keywords: string = ""
39 @State searchType: string = "" 38 @State searchType: string = ""
40 @State data: LazyDataSource<ContentDTO> = new LazyDataSource(); 39 @State data: LazyDataSource<ContentDTO> = new LazyDataSource();
41 - tempList : ContentDTO[] = [] 40 + tempList: ContentDTO[] = []
42 @State data_rmh: SearchRmhDescription[] = [] 41 @State data_rmh: SearchRmhDescription[] = []
43 @State count: number = -1; 42 @State count: number = -1;
44 @State isLoading: boolean = false 43 @State isLoading: boolean = false
@@ -48,14 +47,14 @@ export struct SearchResultContentComponent { @@ -48,14 +47,14 @@ export struct SearchResultContentComponent {
48 scroller: Scroller = new Scroller() 47 scroller: Scroller = new Scroller()
49 private scroller2: Scroller = new Scroller() 48 private scroller2: Scroller = new Scroller()
50 @State ellipseW: number = 0 49 @State ellipseW: number = 0
51 - @State moreWidth:number = 20 50 + @State moreWidth: number = 20
52 @State listLeft: number = 0 51 @State listLeft: number = 0
53 @State isEnd: boolean = false 52 @State isEnd: boolean = false
54 - @Watch('updateData') @Prop sameSearch:number = 0  
55 - @Prop isCurrentShow:boolean = false; 53 + @Watch('updateData') @Prop sameSearch: number = 0
  54 + @Prop isCurrentShow: boolean = false;
56 55
57 - updateData(){  
58 - if(this.isCurrentShow){ 56 + updateData() {
  57 + if (this.isCurrentShow) {
59 this.data_rmh = [] 58 this.data_rmh = []
60 59
61 this.data.clearAllData() 60 this.data.clearAllData()
@@ -115,7 +114,7 @@ export struct SearchResultContentComponent { @@ -115,7 +114,7 @@ export struct SearchResultContentComponent {
115 data.headerPhotoUrl = item.headPhotoUrl.split("?")[0] 114 data.headerPhotoUrl = item.headPhotoUrl.split("?")[0]
116 data.mainControl = item.mainControl + "" 115 data.mainControl = item.mainControl + ""
117 116
118 - if(data_temp.length === 1){ 117 + if (data_temp.length === 1) {
119 this.bean.headPhotoUrl = item.headPhotoUrl.split("?")[0] 118 this.bean.headPhotoUrl = item.headPhotoUrl.split("?")[0]
120 this.bean.cnUserName = item.userName 119 this.bean.cnUserName = item.userName
121 this.bean.creatorId = item.creatorId 120 this.bean.creatorId = item.creatorId
@@ -133,8 +132,8 @@ export struct SearchResultContentComponent { @@ -133,8 +132,8 @@ export struct SearchResultContentComponent {
133 } else { 132 } else {
134 this.bean.cnFansNum = item.fansNum + "" 133 this.bean.cnFansNum = item.fansNum + ""
135 } 134 }
136 - let regex:RegExp = new RegExp('\n','g')  
137 - this.bean.introduction = item.introduction.replace(regex,'') 135 + let regex: RegExp = new RegExp('\n', 'g')
  136 + this.bean.introduction = item.introduction.replace(regex, '')
138 137
139 this.bean.mainControl = item.mainControl 138 this.bean.mainControl = item.mainControl
140 this.bean.banControl = item.banControl 139 this.bean.banControl = item.banControl
@@ -148,9 +147,13 @@ export struct SearchResultContentComponent { @@ -148,9 +147,13 @@ export struct SearchResultContentComponent {
148 data_temp.forEach((data) => { 147 data_temp.forEach((data) => {
149 this.data_rmh.push(data) 148 this.data_rmh.push(data)
150 }) 149 })
  150 +
  151 + if(this.data_rmh.length > 0){
  152 + this.count = 1
  153 + }
151 //只有一条创作者,获取 创作者信息 154 //只有一条创作者,获取 创作者信息
152 if (this.data_rmh.length === 1) { 155 if (this.data_rmh.length === 1) {
153 - if(StringUtils.isNotEmpty(UserDataLocal.getUserId())){ 156 + if (StringUtils.isNotEmpty(UserDataLocal.getUserId())) {
154 //查询是否被关注 157 //查询是否被关注
155 let status = new FollowListStatusRequestItem() 158 let status = new FollowListStatusRequestItem()
156 status.creatorIds.push(new QueryListIsFollowedItem(this.data_rmh[0].creatorId)) 159 status.creatorIds.push(new QueryListIsFollowedItem(this.data_rmh[0].creatorId))
@@ -159,7 +162,7 @@ export struct SearchResultContentComponent { @@ -159,7 +162,7 @@ export struct SearchResultContentComponent {
159 }).catch((err: Error) => { 162 }).catch((err: Error) => {
160 console.log(TAG, "请求失败") 163 console.log(TAG, "请求失败")
161 }) 164 })
162 - }else{ 165 + } else {
163 this.bean.status = "" 166 this.bean.status = ""
164 } 167 }
165 } 168 }
@@ -192,53 +195,55 @@ export struct SearchResultContentComponent { @@ -192,53 +195,55 @@ export struct SearchResultContentComponent {
192 }) 195 })
193 }) 196 })
194 197
195 - SearcherAboutDataModel.getInteractListData(data, getContext(this)).then((newValue) => {  
196 - newValue.forEach((item) => {  
197 - resultData.list.forEach((data) => {  
198 - if (item.contentId == data.data.id) {  
199 - data.data.collectNum = item.collectNum + ""  
200 - data.data.commentNum = item.commentNum + ""  
201 - data.data.likeNum = item.likeNum + ""  
202 - data.data.readNum = item.readNum + ""  
203 - data.data.shareNum = item.shareNum + ""  
204 - } 198 + if (data.contentList.length > 0) {
  199 +
  200 + SearcherAboutDataModel.getInteractListData(data, getContext(this)).then((newValue) => {
  201 + newValue.forEach((item) => {
  202 + resultData.list.forEach((data) => {
  203 + if (item.contentId == data.data.id) {
  204 + data.data.collectNum = item.collectNum + ""
  205 + data.data.commentNum = item.commentNum + ""
  206 + data.data.likeNum = item.likeNum + ""
  207 + data.data.readNum = item.readNum + ""
  208 + data.data.shareNum = item.shareNum + ""
  209 + }
  210 + })
205 }) 211 })
206 - })  
207 - // 批量号主信息  
208 - let creatorIdList: string[] = []  
209 - resultData.list.forEach((value:SearchResultContentItem) => {  
210 - creatorIdList.push(value.data.creatorId)  
211 - })  
212 - SearcherAboutDataModel.getCreatorDetailListData({creatorIdList:creatorIdList}).then((rem) => { 212 + // 批量号主信息
  213 + let creatorIdList: string[] = []
213 resultData.list.forEach((value: SearchResultContentItem) => { 214 resultData.list.forEach((value: SearchResultContentItem) => {
214 - const landscape = value.data.landscape  
215 - let photos: FullColumnImgUrlDTO[] = []  
216 - // if (value.data.appStyle === 4) { 215 + creatorIdList.push(value.data.creatorId)
  216 + })
  217 + SearcherAboutDataModel.getCreatorDetailListData({ creatorIdList: creatorIdList }).then((rem) => {
  218 + resultData.list.forEach((value: SearchResultContentItem) => {
  219 + const landscape = value.data.landscape
  220 + let photos: FullColumnImgUrlDTO[] = []
  221 + // if (value.data.appStyle === 4) {
217 value.data.appStyleImages.split("&&").forEach((value) => { 222 value.data.appStyleImages.split("&&").forEach((value) => {
218 let resizeParams = MinePageDatasModel.extractResizeParams(value) 223 let resizeParams = MinePageDatasModel.extractResizeParams(value)
219 - if(resizeParams && resizeParams.length === 2){ 224 + if (resizeParams && resizeParams.length === 2) {
220 photos.push( 225 photos.push(
221 { 226 {
222 fullUrl: value, 227 fullUrl: value,
223 - weight:resizeParams[0],  
224 - height:resizeParams[1], 228 + weight: resizeParams[0],
  229 + height: resizeParams[1],
225 landscape: Number(landscape), 230 landscape: Number(landscape),
226 } as FullColumnImgUrlDTO 231 } as FullColumnImgUrlDTO
227 ) 232 )
228 } 233 }
229 }) 234 })
230 - // }  
231 - let contentDTO = this.dataTransform(rem,value, photos);  
232 - if(value.data.type != "13"){  
233 - this.data.push(contentDTO)  
234 - if(value.data.sameContentList != null && value.data.sameContentList.length > 0) {  
235 - let contentDTO2 = new ContentDTO();  
236 - contentDTO2.sameContentListJson = JSON.stringify(value.data.sameContentList)  
237 - contentDTO2.sameContentListSize = value.data.sameContentList.length  
238 - this.data.push(contentDTO2) 235 + // }
  236 + let contentDTO = this.dataTransform(rem, value, photos);
  237 + if (value.data.type != "13") {
  238 + this.data.push(contentDTO)
  239 + if (value.data.sameContentList != null && value.data.sameContentList.length > 0) {
  240 + let contentDTO2 = new ContentDTO();
  241 + contentDTO2.sameContentListJson = JSON.stringify(value.data.sameContentList)
  242 + contentDTO2.sameContentListSize = value.data.sameContentList.length
  243 + this.data.push(contentDTO2)
  244 + }
239 } 245 }
240 - }  
241 - }) 246 + })
242 247
243 this.tempList = [] 248 this.tempList = []
244 this.data.notifyDataReload() 249 this.data.notifyDataReload()
@@ -249,14 +254,17 @@ export struct SearchResultContentComponent { @@ -249,14 +254,17 @@ export struct SearchResultContentComponent {
249 this.hasMore = false 254 this.hasMore = false
250 } 255 }
251 this.isLoading = false 256 this.isLoading = false
  257 + }).catch((err: Error) => {
  258 + console.log(TAG, JSON.stringify(err))
  259 + })
252 }).catch((err: Error) => { 260 }).catch((err: Error) => {
253 - console.log(TAG, JSON.stringify(err)) 261 + console.log(TAG, "请求失败")
  262 + this.isLoading = false
  263 + this.count = this.count === -1 ? 0 : this.count
254 }) 264 })
255 - }).catch((err: Error) => {  
256 - console.log(TAG, "请求失败")  
257 - this.isLoading = false  
258 - this.count = this.count === -1 ? 0 : this.count  
259 - }) 265 + }else {
  266 + this.hasMore = false
  267 + }
260 } 268 }
261 269
262 build() { 270 build() {
@@ -264,15 +272,15 @@ export struct SearchResultContentComponent { @@ -264,15 +272,15 @@ export struct SearchResultContentComponent {
264 if (this.count == 0) { 272 if (this.count == 0) {
265 ListHasNoMoreDataUI({ style: 2 }) 273 ListHasNoMoreDataUI({ style: 2 })
266 } else { 274 } else {
267 - List({scroller:this.scroller2}) {  
268 - if (this.data_rmh != null && this.data_rmh.length > 0){  
269 - if (this.data_rmh.length === 1){  
270 - ListItem(){ 275 + List({ scroller: this.scroller2 }) {
  276 + if (this.data_rmh != null && this.data_rmh.length > 0) {
  277 + if (this.data_rmh.length === 1) {
  278 + ListItem() {
271 FollowChildComponent({ data: this.bean, type: 1 }) 279 FollowChildComponent({ data: this.bean, type: 1 })
272 - }.padding({left:"31lpx",right:"31lpx"})  
273 - }else{  
274 - ListItem(){  
275 - Column(){ 280 + }.padding({ left: "31lpx", right: "31lpx" })
  281 + } else {
  282 + ListItem() {
  283 + Column() {
276 this.SearchListUI() 284 this.SearchListUI()
277 } 285 }
278 } 286 }
@@ -283,21 +291,26 @@ export struct SearchResultContentComponent { @@ -283,21 +291,26 @@ export struct SearchResultContentComponent {
283 Column() { 291 Column() {
284 if (this.searchType == "activity") { 292 if (this.searchType == "activity") {
285 ActivityItemComponent({ contentDTO: item }) 293 ActivityItemComponent({ contentDTO: item })
286 - }else if(item.sameContentListSize > 0){ 294 + } else if (item.sameContentListSize > 0) {
287 MoreComponent({ contentDTO: item }) 295 MoreComponent({ contentDTO: item })
288 - }else if(item.appStyle == "9"){  
289 - Column(){  
290 - Card9Component({ compDTO: new CompDTO, contentDTO:item, pageId: "", pageName: "" }) 296 + } else if (item.appStyle == "9") {
  297 + Column() {
  298 + Card9Component({
  299 + compDTO: new CompDTO,
  300 + contentDTO: item,
  301 + pageId: "",
  302 + pageName: ""
  303 + })
291 Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) 304 Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
292 } 305 }
293 } else { 306 } else {
294 - if(this.data?.get(index + 1)?.sameContentListSize > 0) { 307 + if (this.data?.get(index + 1)?.sameContentListSize > 0) {
295 Divider() 308 Divider()
296 .width('100%') 309 .width('100%')
297 .color($r('app.color.color_F5F5F5')) 310 .color($r('app.color.color_F5F5F5'))
298 .strokeWidth(4) 311 .strokeWidth(4)
299 } 312 }
300 - CardParser({compDTO:new CompDTO, contentDTO: item }) 313 + CardParser({ compDTO: new CompDTO, contentDTO: item })
301 } 314 }
302 if (index != this.data.totalCount() - 1) { 315 if (index != this.data.totalCount() - 1) {
303 Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) 316 Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
@@ -312,7 +325,7 @@ export struct SearchResultContentComponent { @@ -312,7 +325,7 @@ export struct SearchResultContentComponent {
312 }, (item: ContentDTO, index: number) => index.toString()) 325 }, (item: ContentDTO, index: number) => index.toString())
313 326
314 //没有更多数据 显示提示 327 //没有更多数据 显示提示
315 - if (!this.hasMore && this.data.totalCount() > 0) { 328 + if (!this.hasMore && (this.data.totalCount() > 0|| (this.data_rmh != null && this.data_rmh.length > 0))) {
316 ListItem() { 329 ListItem() {
317 ListHasNoMoreDataUI() 330 ListHasNoMoreDataUI()
318 } 331 }
@@ -320,6 +333,7 @@ export struct SearchResultContentComponent { @@ -320,6 +333,7 @@ export struct SearchResultContentComponent {
320 }.cachedCount(5) 333 }.cachedCount(5)
321 .edgeEffect(EdgeEffect.None) 334 .edgeEffect(EdgeEffect.None)
322 .scrollBar(BarState.Off) 335 .scrollBar(BarState.Off)
  336 + .height('100%')
323 .onReachEnd(() => { 337 .onReachEnd(() => {
324 console.log(TAG, "触底了"); 338 console.log(TAG, "触底了");
325 if (!this.isLoading) { 339 if (!this.isLoading) {
@@ -334,23 +348,23 @@ export struct SearchResultContentComponent { @@ -334,23 +348,23 @@ export struct SearchResultContentComponent {
334 348
335 @Builder 349 @Builder
336 SearchListUI() { 350 SearchListUI() {
337 - List({initialIndex: 0,space:'8lpx',scroller: this.scroller}) {  
338 - ListItemGroup(){ 351 + List({ initialIndex: 0, space: '8lpx', scroller: this.scroller }) {
  352 + ListItemGroup() {
339 ForEach(this.data_rmh, (item: SearchRmhDescription, index: number) => { 353 ForEach(this.data_rmh, (item: SearchRmhDescription, index: number) => {
340 ListItem() { 354 ListItem() {
341 - SearchCreatorComponent({item:item}) 355 + SearchCreatorComponent({ item: item })
342 } 356 }
343 .width('150lpx') 357 .width('150lpx')
344 .height('100%') 358 .height('100%')
345 }) 359 })
346 }.offset({ left: this.listLeft }) 360 }.offset({ left: this.listLeft })
347 361
348 - ListItem(){  
349 - if (this.data_rmh.length === 10){ 362 + ListItem() {
  363 + if (this.data_rmh.length === 10) {
350 this.itemEnd() 364 this.itemEnd()
351 } 365 }
352 }.height('100%') 366 }.height('100%')
353 - .margin({left:'23lpx'}) 367 + .margin({ left: '23lpx' })
354 } 368 }
355 .edgeEffect(EdgeEffect.None) 369 .edgeEffect(EdgeEffect.None)
356 .scrollBar(BarState.Off) 370 .scrollBar(BarState.Off)
@@ -359,10 +373,10 @@ export struct SearchResultContentComponent { @@ -359,10 +373,10 @@ export struct SearchResultContentComponent {
359 .height('219lpx') 373 .height('219lpx')
360 .onReachEnd(() => { 374 .onReachEnd(() => {
361 this.isEnd = true 375 this.isEnd = true
362 - console.log(TAG,'is end') 376 + console.log(TAG, 'is end')
363 }) 377 })
364 .onScrollFrameBegin((offset: number, state: ScrollState) => { 378 .onScrollFrameBegin((offset: number, state: ScrollState) => {
365 - console.log(TAG,'offset', offset) 379 + console.log(TAG, 'offset', offset)
366 if (!this.scroller.isAtEnd()) { 380 if (!this.scroller.isAtEnd()) {
367 this.isEnd = false 381 this.isEnd = false
368 } 382 }
@@ -374,31 +388,35 @@ export struct SearchResultContentComponent { @@ -374,31 +388,35 @@ export struct SearchResultContentComponent {
374 .parallelGesture( 388 .parallelGesture(
375 PanGesture({ direction: PanDirection.Horizontal, distance: 1 }) 389 PanGesture({ direction: PanDirection.Horizontal, distance: 1 })
376 .onActionStart((event: GestureEvent) => { 390 .onActionStart((event: GestureEvent) => {
377 - console.info(TAG,'Pan start') 391 + console.info(TAG, 'Pan start')
378 }) 392 })
379 .onActionUpdate((event: GestureEvent) => { 393 .onActionUpdate((event: GestureEvent) => {
380 ///小于10个不展示滑动 394 ///小于10个不展示滑动
381 - if (this.data_rmh.length < 10) return; 395 + if (this.data_rmh.length < 10) {
  396 + return;
  397 + }
382 if (event && this.isEnd) { 398 if (event && this.isEnd) {
383 // console.log('event.offsetX',event.offsetX) 399 // console.log('event.offsetX',event.offsetX)
384 this.listLeft = event.offsetX < -60 ? -60 : event.offsetX > 0 ? 0 : event.offsetX 400 this.listLeft = event.offsetX < -60 ? -60 : event.offsetX > 0 ? 0 : event.offsetX
385 this.ellipseW = (-this.listLeft) / 1.5 401 this.ellipseW = (-this.listLeft) / 1.5
386 402
387 - console.log(TAG,"this.ellipseW==>" + this.ellipseW) 403 + console.log(TAG, "this.ellipseW==>" + this.ellipseW)
388 } 404 }
389 }) 405 })
390 .onActionEnd((event: GestureEvent) => { 406 .onActionEnd((event: GestureEvent) => {
391 - if (this.data_rmh.length < 10) return;  
392 - console.info(TAG,'Pan end') 407 + if (this.data_rmh.length < 10) {
  408 + return;
  409 + }
  410 + console.info(TAG, 'Pan end')
393 this.listLeft = 0 411 this.listLeft = 0
394 // this.moreWidth = 20 412 // this.moreWidth = 20
395 413
396 - if (event.offsetX < 0 && this.ellipseW >=20) {  
397 - console.log(TAG,'跳转') 414 + if (event.offsetX < 0 && this.ellipseW >= 20) {
  415 + console.log(TAG, '跳转')
398 let params: Params = { 416 let params: Params = {
399 pageID: this.keywords 417 pageID: this.keywords
400 } 418 }
401 - WDRouterRule.jumpWithPage(WDRouterPage.searchCreatorPage,params) 419 + WDRouterRule.jumpWithPage(WDRouterPage.searchCreatorPage, params)
402 } 420 }
403 this.ellipseW = 0 421 this.ellipseW = 0
404 }) 422 })
@@ -411,18 +429,17 @@ export struct SearchResultContentComponent { @@ -411,18 +429,17 @@ export struct SearchResultContentComponent {
411 .strokeWidth('12lpx') 429 .strokeWidth('12lpx')
412 } 430 }
413 431
414 -  
415 @Builder 432 @Builder
416 itemEnd() { 433 itemEnd() {
417 Row() { 434 Row() {
418 Ellipse() 435 Ellipse()
419 - .width(2* this.ellipseW) 436 + .width(2 * this.ellipseW)
420 .height('100%') 437 .height('100%')
421 .fill('rgb(240,235,238)') 438 .fill('rgb(240,235,238)')
422 .position({ left: -this.ellipseW, top: 0 }) 439 .position({ left: -this.ellipseW, top: 0 })
423 440
424 - Column(){  
425 - Text(this.ellipseW === 0 ? '' : this.ellipseW < 20? '查看更多' : '松手查看') 441 + Column() {
  442 + Text(this.ellipseW === 0 ? '' : this.ellipseW < 20 ? '查看更多' : '松手查看')
426 .width('19lpx') 443 .width('19lpx')
427 .fontSize('19lpx') 444 .fontSize('19lpx')
428 .fontWeight('400lpx') 445 .fontWeight('400lpx')
@@ -437,153 +454,153 @@ export struct SearchResultContentComponent { @@ -437,153 +454,153 @@ export struct SearchResultContentComponent {
437 .height('100%') 454 .height('100%')
438 } 455 }
439 456
440 - private dataTransform(rem:CreatorDetailResponseItem[],value: SearchResultContentItem, photos: FullColumnImgUrlDTO[]): ContentDTO {  
441 - let rmhInfo = this.getRmhInfo(rem,value)  
442 - console.log('获取photos',JSON.stringify(photos))  
443 - console.log('获取value2',JSON.stringify(value))  
444 - let liveType = value.data?.liveType;  
445 - let seoTags = value.data?.seoTags  
446 - let cornerMark = value.data?.cornerMark  
447 - let contentDTO = new ContentDTO();  
448 - contentDTO.liveType = liveType?liveType: ""  
449 - contentDTO.seoTags = seoTags?seoTags: ""  
450 - contentDTO.cornerMark = cornerMark?cornerMark: ""  
451 - contentDTO.appStyle = value.data.appStyle + ""  
452 - contentDTO.cityCode = value.data.cityCode  
453 - contentDTO.coverSize = ""  
454 - contentDTO.coverType = value.data.type == "5" ? 1 : -1  
455 - contentDTO.coverUrl =  
456 - this.searchType == "activity" ? value.data.zhChannelPageImg : value.data.appStyleImages.split("&&")[0];  
457 - contentDTO.description = value.data.description  
458 - contentDTO.districtCode = value.data.districtCode  
459 - contentDTO.endTime = value.data.endTime  
460 - contentDTO.hImageUrl = ""  
461 - contentDTO.heatValue = ""  
462 - contentDTO.innerUrl = ""  
463 - contentDTO.landscape = Number.parseInt(value.data.landscape)  
464 - contentDTO.linkUrl = value.data.linkUrl  
465 - contentDTO.openLikes = Number.parseInt(value.data.openLikes)  
466 - contentDTO.openUrl = ""  
467 - contentDTO.pageId = value.data.pageId  
468 - contentDTO.programAuth = ""  
469 - contentDTO.programId = ""  
470 - contentDTO.programName = ""  
471 - contentDTO.programSource = -1  
472 - contentDTO.programType = Number.parseInt(value.data.status)  
473 - contentDTO.provinceCode = value.data.provinceCode  
474 - contentDTO.showTitleEd = value.data.showTitleEd  
475 - contentDTO.showTitleIng = value.data.showTitleIng  
476 - contentDTO.showTitleNo = value.data.showTitleNo  
477 - contentDTO.startTime = value.data.startTime  
478 - contentDTO.subType = ""  
479 - contentDTO.subtitle = ""  
480 - contentDTO.title = value.data.title  
481 - contentDTO.vImageUrl = ""  
482 - contentDTO.screenType = ""  
483 - contentDTO.source = StringUtils.isEmpty(value.data.creatorName) ? value.data.sourceName : value.data.creatorName  
484 - contentDTO.objectId = value.data.id  
485 - contentDTO.objectType = value.data.type  
486 - contentDTO.channelId = value.data.channelId  
487 - contentDTO.relId = value.data.relId  
488 - contentDTO.relType = value.data.relType  
489 - contentDTO.newsTitle = value.data.titleLiteral;  
490 - contentDTO.publishTime =  
491 - StringUtils.isNotEmpty(value.data.firstPublishTime) ? value.data.firstPublishTime : value.data.publishTime  
492 - contentDTO.visitorComment = -1  
493 - contentDTO.fullColumnImgUrls = photos  
494 - contentDTO.newsSummary = ""  
495 - contentDTO.hasMore = -1  
496 - contentDTO.slideShows = []  
497 - contentDTO.voiceInfo = {} as VoiceInfoDTO  
498 - contentDTO.tagWord = -1  
499 - contentDTO.isSelect = true  
500 - contentDTO.rmhInfo = {} as RmhInfoDTO  
501 - contentDTO.photoNum = StringUtils.isEmpty(value.data.picCount) ? 0 : Number(value.data.picCount)  
502 - contentDTO.liveInfo = {} as LiveInfoDTO;  
503 - contentDTO.videoInfo = {  
504 - videoDuration: Number.parseInt(value.data.duration)  
505 - } as VideoInfoDTO;  
506 -  
507 - let interact = new InteractDataDTO()  
508 - interact.collectNum = value.data.collectNum  
509 - interact.commentNum = value.data.commentNum  
510 - interact.contentId = value.data.id  
511 - interact.contentType = Number.parseInt(value.data.type)  
512 - interact.likeNum = value.data.likeNum  
513 - interact.readNum = Number.parseInt(value.data.readNum)  
514 - interact.shareNum = Number.parseInt(value.data.shareNum)  
515 - contentDTO.interactData = interact  
516 - contentDTO.corner = ''  
517 - contentDTO.rmhPlatform = 0  
518 - contentDTO.newTags = ''  
519 - contentDTO.isSearch = true  
520 - contentDTO.publishTimestamp = ""  
521 - contentDTO.bottomNavId = '';  
522 - contentDTO.openType = '';  
523 - contentDTO.extra = '';  
524 - contentDTO.titleShow = value.data.titleShow == "1" ? 0 : 1  
525 - contentDTO.rmhInfo = rmhInfo  
526 - contentDTO.shareFlag = value.data.shareFlag  
527 - contentDTO.contentText = value.data.contentText  
528 - return contentDTO; 457 + private dataTransform(rem: CreatorDetailResponseItem[], value: SearchResultContentItem,
  458 + photos: FullColumnImgUrlDTO[]): ContentDTO {
  459 + let rmhInfo = this.getRmhInfo(rem, value)
  460 + console.log('获取photos', JSON.stringify(photos))
  461 + console.log('获取value2', JSON.stringify(value))
  462 + let liveType = value.data?.liveType;
  463 + let seoTags = value.data?.seoTags
  464 + let cornerMark = value.data?.cornerMark
  465 + let contentDTO = new ContentDTO();
  466 + contentDTO.liveType = liveType ? liveType : ""
  467 + contentDTO.seoTags = seoTags ? seoTags : ""
  468 + contentDTO.cornerMark = cornerMark ? cornerMark : ""
  469 + contentDTO.appStyle = value.data.appStyle + ""
  470 + contentDTO.cityCode = value.data.cityCode
  471 + contentDTO.coverSize = ""
  472 + contentDTO.coverType = value.data.type == "5" ? 1 : -1
  473 + contentDTO.coverUrl =
  474 + this.searchType == "activity" ? value.data.zhChannelPageImg : value.data.appStyleImages.split("&&")[0];
  475 + contentDTO.description = value.data.description
  476 + contentDTO.districtCode = value.data.districtCode
  477 + contentDTO.endTime = value.data.endTime
  478 + contentDTO.hImageUrl = ""
  479 + contentDTO.heatValue = ""
  480 + contentDTO.innerUrl = ""
  481 + contentDTO.landscape = Number.parseInt(value.data.landscape)
  482 + contentDTO.linkUrl = value.data.linkUrl
  483 + contentDTO.openLikes = Number.parseInt(value.data.openLikes)
  484 + contentDTO.openUrl = ""
  485 + contentDTO.pageId = value.data.pageId
  486 + contentDTO.programAuth = ""
  487 + contentDTO.programId = ""
  488 + contentDTO.programName = ""
  489 + contentDTO.programSource = -1
  490 + contentDTO.programType = Number.parseInt(value.data.status)
  491 + contentDTO.provinceCode = value.data.provinceCode
  492 + contentDTO.showTitleEd = value.data.showTitleEd
  493 + contentDTO.showTitleIng = value.data.showTitleIng
  494 + contentDTO.showTitleNo = value.data.showTitleNo
  495 + contentDTO.startTime = value.data.startTime
  496 + contentDTO.subType = ""
  497 + contentDTO.subtitle = ""
  498 + contentDTO.title = value.data.title
  499 + contentDTO.vImageUrl = ""
  500 + contentDTO.screenType = ""
  501 + contentDTO.source = StringUtils.isEmpty(value.data.creatorName) ? value.data.sourceName : value.data.creatorName
  502 + contentDTO.objectId = value.data.id
  503 + contentDTO.objectType = value.data.type
  504 + contentDTO.channelId = value.data.channelId
  505 + contentDTO.relId = value.data.relId
  506 + contentDTO.relType = value.data.relType
  507 + contentDTO.newsTitle = value.data.titleLiteral;
  508 + contentDTO.publishTime =
  509 + StringUtils.isNotEmpty(value.data.firstPublishTime) ? value.data.firstPublishTime : value.data.publishTime
  510 + contentDTO.visitorComment = -1
  511 + contentDTO.fullColumnImgUrls = photos
  512 + contentDTO.newsSummary = ""
  513 + contentDTO.hasMore = -1
  514 + contentDTO.slideShows = []
  515 + contentDTO.voiceInfo = {} as VoiceInfoDTO
  516 + contentDTO.tagWord = -1
  517 + contentDTO.isSelect = true
  518 + contentDTO.rmhInfo = {} as RmhInfoDTO
  519 + contentDTO.photoNum = StringUtils.isEmpty(value.data.picCount) ? 0 : Number(value.data.picCount)
  520 + contentDTO.liveInfo = {} as LiveInfoDTO;
  521 + contentDTO.videoInfo = {
  522 + videoDuration: Number.parseInt(value.data.duration)
  523 + } as VideoInfoDTO;
  524 +
  525 + let interact = new InteractDataDTO()
  526 + interact.collectNum = value.data.collectNum
  527 + interact.commentNum = value.data.commentNum
  528 + interact.contentId = value.data.id
  529 + interact.contentType = Number.parseInt(value.data.type)
  530 + interact.likeNum = value.data.likeNum
  531 + interact.readNum = Number.parseInt(value.data.readNum)
  532 + interact.shareNum = Number.parseInt(value.data.shareNum)
  533 + contentDTO.interactData = interact
  534 + contentDTO.corner = ''
  535 + contentDTO.rmhPlatform = 0
  536 + contentDTO.newTags = ''
  537 + contentDTO.isSearch = true
  538 + contentDTO.publishTimestamp = ""
  539 + contentDTO.bottomNavId = '';
  540 + contentDTO.openType = '';
  541 + contentDTO.extra = '';
  542 + contentDTO.titleShow = value.data.titleShow == "1" ? 0 : 1
  543 + contentDTO.rmhInfo = rmhInfo
  544 + contentDTO.shareFlag = value.data.shareFlag
  545 + contentDTO.contentText = value.data.contentText
  546 + return contentDTO;
529 } 547 }
530 548
531 - // 搜索数据转化rmhInfo  
532 - private getRmhInfo(rem:CreatorDetailResponseItem[],value:SearchResultContentItem){  
533 - let obj = value.data  
534 - let rmhInfo:RmhInfoDTO = {  
535 - rmhHeadUrl:obj.headerPhotoUrl,  
536 - rmhName:obj.creatorName,  
537 - rmhId:obj.creatorId,  
538 - authIcon:obj.authIcon,  
539 - authTitle: obj.authTitle,  
540 - authTitle2: '',  
541 - banControl: 0,  
542 - cnIsAttention: 0,  
543 - cnAttention: 0,  
544 - cnlsComment: 0,  
545 - cnlsLike: 0,  
546 - cnMainControl: 0,  
547 - cnShareControl: 0,  
548 - cnIsComment: 0,  
549 - cnIsLike:0,  
550 - posterShareControl: 0,  
551 - rmhDesc: obj.introduction,  
552 - userId: obj.userId,  
553 - userType: obj.userType,  
554 - honoraryIcon:'',  
555 - rmhPlatform:0  
556 - }  
557 - if(rem.length>0){  
558 - rem.forEach(item=>{  
559 - if(item.creatorId === obj.creatorId){  
560 - rmhInfo = {  
561 - rmhHeadUrl:item.headPhotoUrl,  
562 - rmhName:item.userName,  
563 - rmhId:item.creatorId,  
564 - authIcon:item.authIcon,  
565 - authTitle: item.authTitle,  
566 - authTitle2: '',  
567 - banControl: 0,  
568 - cnIsAttention:item.isAttention,  
569 - cnAttention: 0,  
570 - cnlsComment: 0,  
571 - cnlsLike: 0,  
572 - cnMainControl: 0,  
573 - cnShareControl: 0,  
574 - cnIsComment: 0,  
575 - cnIsLike:0,  
576 - posterShareControl: 0,  
577 - rmhDesc: item.introduction,  
578 - userId: item.userId,  
579 - userType: item.userType,  
580 - honoraryIcon:'',  
581 - rmhPlatform:0  
582 - } 549 + // 搜索数据转化rmhInfo
  550 + private getRmhInfo(rem: CreatorDetailResponseItem[], value: SearchResultContentItem) {
  551 + let obj = value.data
  552 + let rmhInfo: RmhInfoDTO = {
  553 + rmhHeadUrl: obj.headerPhotoUrl,
  554 + rmhName: obj.creatorName,
  555 + rmhId: obj.creatorId,
  556 + authIcon: obj.authIcon,
  557 + authTitle: obj.authTitle,
  558 + authTitle2: '',
  559 + banControl: 0,
  560 + cnIsAttention: 0,
  561 + cnAttention: 0,
  562 + cnlsComment: 0,
  563 + cnlsLike: 0,
  564 + cnMainControl: 0,
  565 + cnShareControl: 0,
  566 + cnIsComment: 0,
  567 + cnIsLike: 0,
  568 + posterShareControl: 0,
  569 + rmhDesc: obj.introduction,
  570 + userId: obj.userId,
  571 + userType: obj.userType,
  572 + honoraryIcon: '',
  573 + rmhPlatform: 0
  574 + }
  575 + if (rem.length > 0) {
  576 + rem.forEach(item => {
  577 + if (item.creatorId === obj.creatorId) {
  578 + rmhInfo = {
  579 + rmhHeadUrl: item.headPhotoUrl,
  580 + rmhName: item.userName,
  581 + rmhId: item.creatorId,
  582 + authIcon: item.authIcon,
  583 + authTitle: item.authTitle,
  584 + authTitle2: '',
  585 + banControl: 0,
  586 + cnIsAttention: item.isAttention,
  587 + cnAttention: 0,
  588 + cnlsComment: 0,
  589 + cnlsLike: 0,
  590 + cnMainControl: 0,
  591 + cnShareControl: 0,
  592 + cnIsComment: 0,
  593 + cnIsLike: 0,
  594 + posterShareControl: 0,
  595 + rmhDesc: item.introduction,
  596 + userId: item.userId,
  597 + userType: item.userType,
  598 + honoraryIcon: '',
  599 + rmhPlatform: 0
583 } 600 }
584 - })  
585 - }  
586 - return rmhInfo 601 + }
  602 + })
587 } 603 }
588 - 604 + return rmhInfo
  605 + }
589 } 606 }