Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool
Showing
10 changed files
with
281 additions
and
54 deletions
| @@ -175,3 +175,6 @@ export { ReserveItemBean } from './src/main/ets/bean/live/ReserveItemBean'; | @@ -175,3 +175,6 @@ export { ReserveItemBean } from './src/main/ets/bean/live/ReserveItemBean'; | ||
| 175 | 175 | ||
| 176 | 176 | ||
| 177 | export { FeedbackTypeBean } from './src/main/ets/bean/detail/FeedbackTypeBean'; | 177 | export { FeedbackTypeBean } from './src/main/ets/bean/detail/FeedbackTypeBean'; |
| 178 | +export { FeedBackParams } from './src/main/ets/bean/content/FeedBackParams'; | ||
| 179 | + | ||
| 180 | + |
| @@ -85,6 +85,8 @@ export class ContentDTO implements BaseDTO { | @@ -85,6 +85,8 @@ export class ContentDTO implements BaseDTO { | ||
| 85 | // 链接类型: 0:无链接;1:内链(文章);2:外链 | 85 | // 链接类型: 0:无链接;1:内链(文章);2:外链 |
| 86 | openType: string = ''; | 86 | openType: string = ''; |
| 87 | extra: string = '' | 87 | extra: string = '' |
| 88 | + sameContentList:ContentDTO[] = [] | ||
| 89 | + sameContentListJson:string = "" | ||
| 88 | /* | 90 | /* |
| 89 | 本地辅助字段 | 91 | 本地辅助字段 |
| 90 | */ | 92 | */ |
| 1 | -import { FeedbackTypeBean, PhotoListBean } from 'wdBean/Index'; | 1 | +import { FeedBackParams, FeedbackTypeBean, PhotoListBean } from 'wdBean/Index'; |
| 2 | import { AppUtils, | 2 | import { AppUtils, |
| 3 | DeviceUtil, | 3 | DeviceUtil, |
| 4 | FastClickUtil, Logger, NetworkUtil, StringUtils, ToastUtils, UserDataLocal } from 'wdKit/Index'; | 4 | FastClickUtil, Logger, NetworkUtil, StringUtils, ToastUtils, UserDataLocal } from 'wdKit/Index'; |
| @@ -60,9 +60,9 @@ export struct FeedBackActivity { | @@ -60,9 +60,9 @@ export struct FeedBackActivity { | ||
| 60 | GridCol({ | 60 | GridCol({ |
| 61 | }) { | 61 | }) { |
| 62 | Row(){ | 62 | Row(){ |
| 63 | - Toggle({ type: ToggleType.Checkbox, isOn: false }) | 63 | + Toggle({ type: ToggleType.Checkbox, isOn: feedbackTypeBean.isSelect }) |
| 64 | .onChange((select) => { | 64 | .onChange((select) => { |
| 65 | - feedbackTypeBean.isselect = select | 65 | + feedbackTypeBean.isSelect = select |
| 66 | this.canSubmit = this.checkSubmit() | 66 | this.canSubmit = this.checkSubmit() |
| 67 | }) | 67 | }) |
| 68 | Text(feedbackTypeBean.classifyName) | 68 | Text(feedbackTypeBean.classifyName) |
| @@ -325,8 +325,8 @@ export struct FeedBackActivity { | @@ -325,8 +325,8 @@ export struct FeedBackActivity { | ||
| 325 | //问题类型必选 | 325 | //问题类型必选 |
| 326 | let selectType = "" | 326 | let selectType = "" |
| 327 | this.feedbackTypeBeans.forEach((value) => { | 327 | this.feedbackTypeBeans.forEach((value) => { |
| 328 | - if(value.isselect){ | ||
| 329 | - selectType = selectType+"," | 328 | + if(value.isSelect){ |
| 329 | + selectType = selectType+value.id+"," | ||
| 330 | } | 330 | } |
| 331 | }) | 331 | }) |
| 332 | if(!StringUtils.isEmpty(selectType)){ | 332 | if(!StringUtils.isEmpty(selectType)){ |
| @@ -343,29 +343,31 @@ export struct FeedBackActivity { | @@ -343,29 +343,31 @@ export struct FeedBackActivity { | ||
| 343 | } | 343 | } |
| 344 | 344 | ||
| 345 | try { | 345 | try { |
| 346 | - let map: HashMap<String,String> = {} as HashMap<String,String> | 346 | + let feedBackParams: FeedBackParams = { |
| 347 | //反馈内容 | 347 | //反馈内容 |
| 348 | - map.set("content", this.contact); | 348 | + "content": this.contact, |
| 349 | //投诉类型 id | 349 | //投诉类型 id |
| 350 | - map.set("classifyFlagIds", selectType); | ||
| 351 | - if(!StringUtils.isEmpty(this.email)){ | 350 | + "classifyFlagIds": selectType, |
| 351 | + //设备 | ||
| 352 | + "appVersion": "V" + AppUtils.getAppVersionName(), | ||
| 353 | + "appDevice": "harmony" + DeviceUtil.getDisplayVersion() + " " + DeviceUtil.getProductModel() | ||
| 354 | + } as FeedBackParams | ||
| 352 | //邮箱 | 355 | //邮箱 |
| 353 | - map.set("userContact", this.email); | 356 | + if(!StringUtils.isEmpty(this.email)){ |
| 357 | + feedBackParams.userContact = this.email | ||
| 354 | } | 358 | } |
| 355 | //用户名称 | 359 | //用户名称 |
| 356 | - if (!StringUtils.isEmpty(UserDataLocal.getUserName())) { | ||
| 357 | - map.set("userName", UserDataLocal.getUserName()); | 360 | + if(!StringUtils.isEmpty(UserDataLocal.getUserName())){ |
| 361 | + feedBackParams.userName = UserDataLocal.getUserName() | ||
| 358 | } | 362 | } |
| 359 | - //设备 | ||
| 360 | - map.set("appVersion", "V" + AppUtils.getAppVersionName()); | ||
| 361 | - map.set("appDevice", "harmony" + DeviceUtil.getDisplayVersion() + " " + DeviceUtil.getProductModel()); | 363 | + |
| 362 | // //投诉图片 | 364 | // //投诉图片 |
| 363 | // if (imageUrl.size() > 0) { | 365 | // if (imageUrl.size() > 0) { |
| 364 | // String[] str = imageUrl.toArray(new String[imageUrl.size()]); | 366 | // String[] str = imageUrl.toArray(new String[imageUrl.size()]); |
| 365 | // map.set("imageUrls", str); | 367 | // map.set("imageUrls", str); |
| 366 | // } | 368 | // } |
| 367 | - await MultiPictureDetailViewModel.feedBackCommit(map) | ||
| 368 | - | 369 | + await MultiPictureDetailViewModel.feedBackCommit(feedBackParams) |
| 370 | + router.back(); | ||
| 369 | } catch (exception) { | 371 | } catch (exception) { |
| 370 | console.log('请求失败',JSON.stringify(exception)) | 372 | console.log('请求失败',JSON.stringify(exception)) |
| 371 | } | 373 | } |
| 1 | /** | 1 | /** |
| 2 | * More_Comp | 2 | * More_Comp |
| 3 | */ | 3 | */ |
| 4 | +import { ContentDTO } from 'wdBean/Index'; | ||
| 5 | + | ||
| 4 | const TAG: string = 'Card9Component'; | 6 | const TAG: string = 'Card9Component'; |
| 5 | 7 | ||
| 6 | @Entry | 8 | @Entry |
| 7 | @Component | 9 | @Component |
| 8 | export struct MoreComponent { | 10 | export struct MoreComponent { |
| 11 | + @State contentDTO: ContentDTO = new ContentDTO(); | ||
| 9 | 12 | ||
| 10 | build() { | 13 | build() { |
| 11 | Row() { | 14 | Row() { |
| @@ -49,7 +49,7 @@ export struct SearchComponent { | @@ -49,7 +49,7 @@ export struct SearchComponent { | ||
| 49 | getRelatedSearchContent() { | 49 | getRelatedSearchContent() { |
| 50 | if(StringUtils.isNotEmpty(this.searchText)){ | 50 | if(StringUtils.isNotEmpty(this.searchText)){ |
| 51 | SearcherAboutDataModel.getRelatedSearchContentData(encodeURI(this.searchText),getContext(this)).then((value) => { | 51 | SearcherAboutDataModel.getRelatedSearchContentData(encodeURI(this.searchText),getContext(this)).then((value) => { |
| 52 | - if (value != null) { | 52 | + if (value != null && value.length > 0) { |
| 53 | this.relatedSearchContentsData = [] | 53 | this.relatedSearchContentsData = [] |
| 54 | value.forEach(item=>{ | 54 | value.forEach(item=>{ |
| 55 | let tempValue:string = item | 55 | let tempValue:string = item |
| @@ -81,6 +81,9 @@ export struct SearchComponent { | @@ -81,6 +81,9 @@ export struct SearchComponent { | ||
| 81 | this.relatedSearchContentsData.push(new SearchRelatedItem(item,tempArr)) | 81 | this.relatedSearchContentsData.push(new SearchRelatedItem(item,tempArr)) |
| 82 | } | 82 | } |
| 83 | }) | 83 | }) |
| 84 | + }else{ | ||
| 85 | + this.hasInputContent = false | ||
| 86 | + this.relatedSearchContentsData = [] | ||
| 84 | } | 87 | } |
| 85 | }).catch((err: Error) => { | 88 | }).catch((err: Error) => { |
| 86 | console.log(TAG, JSON.stringify(err)) | 89 | console.log(TAG, JSON.stringify(err)) |
| @@ -228,7 +231,7 @@ export struct SearchComponent { | @@ -228,7 +231,7 @@ export struct SearchComponent { | ||
| 228 | Row() { | 231 | Row() { |
| 229 | //左 | 232 | //左 |
| 230 | Stack({ alignContent: Alignment.Start }) { | 233 | Stack({ alignContent: Alignment.Start }) { |
| 231 | - if (this.searchTextData != null && this.searchTextData.length > 0 && !this.hasInputContent) { | 234 | + if (this.searchTextData != null && this.searchTextData.length > 0 && !this.hasInputContent && StringUtils.isEmpty(this.searchText)) { |
| 232 | Swiper(this.swiperController) { | 235 | Swiper(this.swiperController) { |
| 233 | ForEach(this.searchTextData, (item: string, index: number) => { | 236 | ForEach(this.searchTextData, (item: string, index: number) => { |
| 234 | Text(item) | 237 | Text(item) |
| @@ -20,12 +20,16 @@ import { FollowListDetailItem } from '../../viewmodel/FollowListDetailItem' | @@ -20,12 +20,16 @@ import { FollowListDetailItem } from '../../viewmodel/FollowListDetailItem' | ||
| 20 | import { FollowListStatusRequestItem } from '../../viewmodel/FollowListStatusRequestItem' | 20 | import { FollowListStatusRequestItem } from '../../viewmodel/FollowListStatusRequestItem' |
| 21 | import { QueryListIsFollowedItem } from '../../viewmodel/QueryListIsFollowedItem' | 21 | import { QueryListIsFollowedItem } from '../../viewmodel/QueryListIsFollowedItem' |
| 22 | import { SearchResultContentData } from '../../viewmodel/SearchResultContentData' | 22 | import { SearchResultContentData } from '../../viewmodel/SearchResultContentData' |
| 23 | -import { SearchResultContentItem, SearchRmhDescription } from '../../viewmodel/SearchResultContentItem' | 23 | +import { |
| 24 | + SearchDescription, | ||
| 25 | + SearchResultContentItem, SearchRmhDescription } from '../../viewmodel/SearchResultContentItem' | ||
| 24 | import { CardParser } from '../CardParser' | 26 | import { CardParser } from '../CardParser' |
| 25 | import { FollowChildComponent } from '../mine/follow/FollowChildComponent' | 27 | import { FollowChildComponent } from '../mine/follow/FollowChildComponent' |
| 26 | import { ListHasNoMoreDataUI } from '../reusable/ListHasNoMoreDataUI' | 28 | import { ListHasNoMoreDataUI } from '../reusable/ListHasNoMoreDataUI' |
| 27 | import { ActivityItemComponent } from './ActivityItemComponent' | 29 | import { ActivityItemComponent } from './ActivityItemComponent' |
| 28 | import { SearchCreatorComponent } from './SearchCreatorComponent' | 30 | import { SearchCreatorComponent } from './SearchCreatorComponent' |
| 31 | +import { JSON } from '@kit.ArkTS' | ||
| 32 | +import { MoreComponent } from '../cardview/MoreComponent' | ||
| 29 | 33 | ||
| 30 | const TAG = "SearchResultContentComponent" | 34 | const TAG = "SearchResultContentComponent" |
| 31 | 35 | ||
| @@ -34,6 +38,7 @@ export struct SearchResultContentComponent { | @@ -34,6 +38,7 @@ export struct SearchResultContentComponent { | ||
| 34 | @State keywords: string = "" | 38 | @State keywords: string = "" |
| 35 | @State searchType: string = "" | 39 | @State searchType: string = "" |
| 36 | @State data: LazyDataSource<ContentDTO> = new LazyDataSource(); | 40 | @State data: LazyDataSource<ContentDTO> = new LazyDataSource(); |
| 41 | + tempList : ContentDTO[] = [] | ||
| 37 | @State data_rmh: SearchRmhDescription[] = [] | 42 | @State data_rmh: SearchRmhDescription[] = [] |
| 38 | @State count: number = -1; | 43 | @State count: number = -1; |
| 39 | @State isLoading: boolean = false | 44 | @State isLoading: boolean = false |
| @@ -62,7 +67,7 @@ export struct SearchResultContentComponent { | @@ -62,7 +67,7 @@ export struct SearchResultContentComponent { | ||
| 62 | getNewSearchResultData() { | 67 | getNewSearchResultData() { |
| 63 | this.isLoading = true | 68 | this.isLoading = true |
| 64 | if (this.hasMore) { | 69 | if (this.hasMore) { |
| 65 | - SearcherAboutDataModel.getSearchResultListData("15", `${this.curPageNum}`, this.searchType, this.keywords, | 70 | + SearcherAboutDataModel.getSearchResultListData("20", `${this.curPageNum}`, this.searchType, this.keywords, |
| 66 | getContext(this)).then((value) => { | 71 | getContext(this)).then((value) => { |
| 67 | console.log('SearcherAboutDataModel', JSON.stringify(value)) | 72 | console.log('SearcherAboutDataModel', JSON.stringify(value)) |
| 68 | if (!this.data || value.list.length == 0) { | 73 | if (!this.data || value.list.length == 0) { |
| @@ -183,9 +188,8 @@ export struct SearchResultContentComponent { | @@ -183,9 +188,8 @@ export struct SearchResultContentComponent { | ||
| 183 | resultData.list.forEach((value:SearchResultContentItem) => { | 188 | resultData.list.forEach((value:SearchResultContentItem) => { |
| 184 | creatorIdList.push(value.data.creatorId) | 189 | creatorIdList.push(value.data.creatorId) |
| 185 | }) | 190 | }) |
| 191 | + let isRemain : boolean = false | ||
| 186 | SearcherAboutDataModel.getCreatorDetailListData({creatorIdList:creatorIdList}).then((rem) => { | 192 | SearcherAboutDataModel.getCreatorDetailListData({creatorIdList:creatorIdList}).then((rem) => { |
| 187 | - | ||
| 188 | - | ||
| 189 | resultData.list.forEach((value) => { | 193 | resultData.list.forEach((value) => { |
| 190 | let photos: FullColumnImgUrlDTO[] = [] | 194 | let photos: FullColumnImgUrlDTO[] = [] |
| 191 | // if (value.data.appStyle === 4) { | 195 | // if (value.data.appStyle === 4) { |
| @@ -196,44 +200,100 @@ export struct SearchResultContentComponent { | @@ -196,44 +200,100 @@ export struct SearchResultContentComponent { | ||
| 196 | // } | 200 | // } |
| 197 | let contentDTO = this.dataTransform(rem,value, photos); | 201 | let contentDTO = this.dataTransform(rem,value, photos); |
| 198 | if(value.data.type != "13"){ | 202 | if(value.data.type != "13"){ |
| 199 | - this.data.push(contentDTO) | 203 | + this.tempList.push(contentDTO) |
| 204 | + if(value.data.sameContentList != null && value.data.sameContentList.length > 0) { | ||
| 205 | + let contentDTO2 = new ContentDTO(); | ||
| 206 | + contentDTO2.sameContentListJson = JSON.stringify(value.data.sameContentList) | ||
| 207 | + isRemain = true | ||
| 208 | + this.tempList.push(contentDTO2) | ||
| 209 | + } | ||
| 200 | } | 210 | } |
| 201 | }) | 211 | }) |
| 202 | - | ||
| 203 | - | ||
| 204 | - }).catch((err: Error) => { | ||
| 205 | - console.log(TAG, JSON.stringify(err)) | 212 | + if(!isRemain){ |
| 213 | + this.tempList.forEach((value) => { | ||
| 214 | + this.data.push(value) | ||
| 206 | }) | 215 | }) |
| 207 | - | ||
| 208 | - | 216 | + this.tempList = [] |
| 209 | this.data.notifyDataReload() | 217 | this.data.notifyDataReload() |
| 210 | this.count = this.data.totalCount() | 218 | this.count = this.data.totalCount() |
| 211 | - if (this.data.totalCount() < resultData.totalCount) { | 219 | + if (this.count < resultData.totalCount) { |
| 212 | this.curPageNum++ | 220 | this.curPageNum++ |
| 213 | } else { | 221 | } else { |
| 214 | this.hasMore = false | 222 | this.hasMore = false |
| 215 | } | 223 | } |
| 216 | this.isLoading = false | 224 | this.isLoading = false |
| 217 | - | ||
| 218 | - if (this.count === 0 && resultData.list.length > 0) { | ||
| 219 | - this.count = -1 | ||
| 220 | - if (!this.isLoading) { | ||
| 221 | - //加载分页数据 | ||
| 222 | - this.getNewSearchResultData() | ||
| 223 | - } | ||
| 224 | - } else if (this.count <= 10 && resultData.list.length > 0) { | ||
| 225 | - if (!this.isLoading) { | ||
| 226 | - //加载分页数据 | ||
| 227 | - this.getNewSearchResultData() | ||
| 228 | - } | 225 | + }else{ |
| 226 | + this.dealSameContent(resultData.totalCount) | ||
| 229 | } | 227 | } |
| 230 | }).catch((err: Error) => { | 228 | }).catch((err: Error) => { |
| 229 | + console.log(TAG, JSON.stringify(err)) | ||
| 230 | + }) | ||
| 231 | + }).catch((err: Error) => { | ||
| 231 | console.log(TAG, "请求失败") | 232 | console.log(TAG, "请求失败") |
| 232 | this.isLoading = false | 233 | this.isLoading = false |
| 233 | this.count = this.count === -1 ? 0 : this.count | 234 | this.count = this.count === -1 ? 0 : this.count |
| 234 | }) | 235 | }) |
| 235 | } | 236 | } |
| 236 | 237 | ||
| 238 | + async dealSameContent(count:number){ | ||
| 239 | + this.tempList.forEach(async (tempValue) => { | ||
| 240 | + if(StringUtils.isNotEmpty(tempValue.sameContentListJson)){ | ||
| 241 | + let data: contentListParams = { | ||
| 242 | + contentList: [] | ||
| 243 | + } | ||
| 244 | + let resultData : SearchDescription[] = JSON.parse(tempValue.sameContentListJson) as SearchDescription[] | ||
| 245 | + if(resultData!=null){ | ||
| 246 | + resultData.forEach((item) => { | ||
| 247 | + data.contentList.push({ | ||
| 248 | + contentId: item.id + '', | ||
| 249 | + contentType: Number.parseInt(item.type) | ||
| 250 | + }) | ||
| 251 | + }) | ||
| 252 | + | ||
| 253 | + let newValue = await SearcherAboutDataModel.getInteractListData(data, getContext(this)) | ||
| 254 | + newValue.forEach((item) => { | ||
| 255 | + resultData.forEach((data) => { | ||
| 256 | + if (item.contentId == data.id) { | ||
| 257 | + data.collectNum = item.collectNum + "" | ||
| 258 | + data.commentNum = item.commentNum + "" | ||
| 259 | + data.likeNum = item.likeNum + "" | ||
| 260 | + data.readNum = item.readNum + "" | ||
| 261 | + data.shareNum = item.shareNum + "" | ||
| 262 | + } | ||
| 263 | + }) | ||
| 264 | + }) | ||
| 265 | + let creatorIdList: string[] = [] | ||
| 266 | + resultData.forEach((value:SearchDescription) => { | ||
| 267 | + creatorIdList.push(value.creatorId) | ||
| 268 | + }) | ||
| 269 | + let rem = await SearcherAboutDataModel.getCreatorDetailListData({creatorIdList:creatorIdList}) | ||
| 270 | + resultData.forEach((value) => { | ||
| 271 | + let photos: FullColumnImgUrlDTO[] = [] | ||
| 272 | + value.appStyleImages.split("&&").forEach((value) => { | ||
| 273 | + const resizeParams = this.extractResizeParams(value) | ||
| 274 | + photos.push({ fullUrl: value,weight:resizeParams.width,height:resizeParams.height, } as FullColumnImgUrlDTO) | ||
| 275 | + }) | ||
| 276 | + let contentDTO = this.dataTransform2(rem,value, photos); | ||
| 277 | + tempValue.sameContentList.push(contentDTO) | ||
| 278 | + }) | ||
| 279 | + } | ||
| 280 | + } | ||
| 281 | + }) | ||
| 282 | + | ||
| 283 | + this.tempList.forEach((value) => { | ||
| 284 | + this.data.push(value) | ||
| 285 | + }) | ||
| 286 | + this.tempList = [] | ||
| 287 | + this.data.notifyDataReload() | ||
| 288 | + this.count = this.data.totalCount() | ||
| 289 | + if (this.count < count) { | ||
| 290 | + this.curPageNum++ | ||
| 291 | + } else { | ||
| 292 | + this.hasMore = false | ||
| 293 | + } | ||
| 294 | + this.isLoading = false | ||
| 295 | + } | ||
| 296 | + | ||
| 237 | build() { | 297 | build() { |
| 238 | Column() { | 298 | Column() { |
| 239 | if (this.count == 0) { | 299 | if (this.count == 0) { |
| @@ -258,6 +318,8 @@ export struct SearchResultContentComponent { | @@ -258,6 +318,8 @@ export struct SearchResultContentComponent { | ||
| 258 | Column() { | 318 | Column() { |
| 259 | if (this.searchType == "activity") { | 319 | if (this.searchType == "activity") { |
| 260 | ActivityItemComponent({ contentDTO: item }) | 320 | ActivityItemComponent({ contentDTO: item }) |
| 321 | + }else if(item.sameContentList != null && item.sameContentList.length > 0){ | ||
| 322 | + MoreComponent({ contentDTO: item }) | ||
| 261 | } else { | 323 | } else { |
| 262 | CardParser({compDTO:new CompDTO, contentDTO: item }) | 324 | CardParser({compDTO:new CompDTO, contentDTO: item }) |
| 263 | } | 325 | } |
| @@ -284,7 +346,6 @@ export struct SearchResultContentComponent { | @@ -284,7 +346,6 @@ export struct SearchResultContentComponent { | ||
| 284 | .onReachEnd(() => { | 346 | .onReachEnd(() => { |
| 285 | console.log(TAG, "触底了"); | 347 | console.log(TAG, "触底了"); |
| 286 | if (!this.isLoading) { | 348 | if (!this.isLoading) { |
| 287 | - //加载分页数据 | ||
| 288 | this.getNewSearchResultData() | 349 | this.getNewSearchResultData() |
| 289 | } | 350 | } |
| 290 | }) | 351 | }) |
| @@ -476,10 +537,94 @@ export struct SearchResultContentComponent { | @@ -476,10 +537,94 @@ export struct SearchResultContentComponent { | ||
| 476 | contentDTO.shareFlag = value.data.shareFlag | 537 | contentDTO.shareFlag = value.data.shareFlag |
| 477 | contentDTO.contentText = value.data.contentText | 538 | contentDTO.contentText = value.data.contentText |
| 478 | return contentDTO; | 539 | return contentDTO; |
| 540 | + } | ||
| 479 | 541 | ||
| 542 | + private dataTransform2(rem:CreatorDetailResponseItem[],value: SearchDescription, photos: FullColumnImgUrlDTO[]): ContentDTO { | ||
| 543 | + let rmhInfo = this.getRmhInfo2(rem,value) | ||
| 544 | + console.log('获取photos',JSON.stringify(photos)) | ||
| 545 | + console.log('获取value2',JSON.stringify(value)) | ||
| 546 | + let contentDTO = new ContentDTO(); | ||
| 547 | + contentDTO.appStyle = value.appStyle + "" | ||
| 548 | + contentDTO.cityCode = value.cityCode | ||
| 549 | + contentDTO.coverSize = "" | ||
| 550 | + contentDTO.coverType = value.type == "5" ? 1 : -1 | ||
| 551 | + contentDTO.coverUrl = | ||
| 552 | + this.searchType == "activity" ? value.zhChannelPageImg : value.appStyleImages.split("&&")[0]; | ||
| 553 | + contentDTO.description = value.description | ||
| 554 | + contentDTO.districtCode = value.districtCode | ||
| 555 | + contentDTO.endTime = value.endTime | ||
| 556 | + contentDTO.hImageUrl = "" | ||
| 557 | + contentDTO.heatValue = "" | ||
| 558 | + contentDTO.innerUrl = "" | ||
| 559 | + contentDTO.landscape = Number.parseInt(value.landscape) | ||
| 560 | + contentDTO.linkUrl = value.linkUrl | ||
| 561 | + contentDTO.openLikes = Number.parseInt(value.openLikes) | ||
| 562 | + contentDTO.openUrl = "" | ||
| 563 | + contentDTO.pageId = value.pageId | ||
| 564 | + contentDTO.programAuth = "" | ||
| 565 | + contentDTO.programId = "" | ||
| 566 | + contentDTO.programName = "" | ||
| 567 | + contentDTO.programSource = -1 | ||
| 568 | + contentDTO.programType = Number.parseInt(value.status) | ||
| 569 | + contentDTO.provinceCode = value.provinceCode | ||
| 570 | + contentDTO.showTitleEd = value.showTitleEd | ||
| 571 | + contentDTO.showTitleIng = value.showTitleIng | ||
| 572 | + contentDTO.showTitleNo = value.showTitleNo | ||
| 573 | + contentDTO.startTime = value.startTime | ||
| 574 | + contentDTO.subType = "" | ||
| 575 | + contentDTO.subtitle = "" | ||
| 576 | + contentDTO.title = value.title | ||
| 577 | + contentDTO.vImageUrl = "" | ||
| 578 | + contentDTO.screenType = "" | ||
| 579 | + contentDTO.source = StringUtils.isEmpty(value.creatorName) ? value.sourceName : value.creatorName | ||
| 580 | + contentDTO.objectId = value.id | ||
| 581 | + contentDTO.objectType = value.type | ||
| 582 | + contentDTO.channelId = value.channelId | ||
| 583 | + contentDTO.relId = value.relId | ||
| 584 | + contentDTO.relType = value.relType | ||
| 585 | + contentDTO.newsTitle = value.titleLiteral; | ||
| 586 | + contentDTO.publishTime = | ||
| 587 | + StringUtils.isNotEmpty(value.firstPublishTime) ? value.firstPublishTime : value.publishTime | ||
| 588 | + contentDTO.visitorComment = -1 | ||
| 589 | + contentDTO.fullColumnImgUrls = photos | ||
| 590 | + contentDTO.newsSummary = "" | ||
| 591 | + contentDTO.hasMore = -1 | ||
| 592 | + contentDTO.slideShows = [] | ||
| 593 | + contentDTO.voiceInfo = {} as VoiceInfoDTO | ||
| 594 | + contentDTO.tagWord = -1 | ||
| 595 | + contentDTO.isSelect = true | ||
| 596 | + contentDTO.rmhInfo = {} as RmhInfoDTO | ||
| 597 | + contentDTO.photoNum = -1 | ||
| 598 | + contentDTO.liveInfo = {} as LiveInfoDTO; | ||
| 599 | + contentDTO.videoInfo = { | ||
| 600 | + videoDuration: Number.parseInt(value.duration) | ||
| 601 | + } as VideoInfoDTO; | ||
| 480 | 602 | ||
| 481 | - | 603 | + let interact = new InteractDataDTO() |
| 604 | + interact.collectNum = value.collectNum | ||
| 605 | + interact.commentNum = value.commentNum | ||
| 606 | + interact.contentId = value.id | ||
| 607 | + interact.contentType = Number.parseInt(value.type) | ||
| 608 | + interact.likeNum = value.likeNum | ||
| 609 | + interact.readNum = Number.parseInt(value.readNum) | ||
| 610 | + interact.shareNum = Number.parseInt(value.shareNum) | ||
| 611 | + contentDTO.interactData = interact | ||
| 612 | + contentDTO.corner = '' | ||
| 613 | + contentDTO.rmhPlatform = 0 | ||
| 614 | + contentDTO.newTags = '' | ||
| 615 | + contentDTO.isSearch = true | ||
| 616 | + contentDTO.publishTimestamp = "" | ||
| 617 | + contentDTO.bottomNavId = ''; | ||
| 618 | + contentDTO.openType = ''; | ||
| 619 | + contentDTO.extra = ''; | ||
| 620 | + contentDTO.titleShow = value.type == "5" ? 1 : 0; | ||
| 621 | + contentDTO.rmhInfo = rmhInfo | ||
| 622 | + contentDTO.shareFlag = value.shareFlag | ||
| 623 | + contentDTO.contentText = value.contentText | ||
| 624 | + return contentDTO; | ||
| 482 | } | 625 | } |
| 626 | + | ||
| 627 | + | ||
| 483 | // 搜索数据转化rmhInfo | 628 | // 搜索数据转化rmhInfo |
| 484 | private getRmhInfo(rem:CreatorDetailResponseItem[],value:SearchResultContentItem){ | 629 | private getRmhInfo(rem:CreatorDetailResponseItem[],value:SearchResultContentItem){ |
| 485 | let obj = value.data | 630 | let obj = value.data |
| @@ -535,6 +680,65 @@ export struct SearchResultContentComponent { | @@ -535,6 +680,65 @@ export struct SearchResultContentComponent { | ||
| 535 | } | 680 | } |
| 536 | return rmhInfo | 681 | return rmhInfo |
| 537 | } | 682 | } |
| 683 | + | ||
| 684 | + // 搜索数据转化rmhInfo | ||
| 685 | + private getRmhInfo2(rem:CreatorDetailResponseItem[],value:SearchDescription){ | ||
| 686 | + let obj = value | ||
| 687 | + let rmhInfo:RmhInfoDTO = { | ||
| 688 | + rmhHeadUrl:obj.headerPhotoUrl, | ||
| 689 | + rmhName:obj.creatorName, | ||
| 690 | + rmhId:obj.creatorId, | ||
| 691 | + authIcon:obj.authIcon, | ||
| 692 | + authTitle: obj.authTitle, | ||
| 693 | + authTitle2: '', | ||
| 694 | + banControl: 0, | ||
| 695 | + cnIsAttention: 0, | ||
| 696 | + cnAttention: 0, | ||
| 697 | + cnlsComment: 0, | ||
| 698 | + cnlsLike: 0, | ||
| 699 | + cnMainControl: 0, | ||
| 700 | + cnShareControl: 0, | ||
| 701 | + cnIsComment: 0, | ||
| 702 | + cnIsLike:0, | ||
| 703 | + posterShareControl: 0, | ||
| 704 | + rmhDesc: obj.introduction, | ||
| 705 | + userId: obj.userId, | ||
| 706 | + userType: obj.userType, | ||
| 707 | + honoraryIcon:'' | ||
| 708 | + } | ||
| 709 | + if(rem.length>0){ | ||
| 710 | + rem.forEach(item=>{ | ||
| 711 | + if(item.creatorId === obj.creatorId){ | ||
| 712 | + rmhInfo = { | ||
| 713 | + rmhHeadUrl:item.headPhotoUrl, | ||
| 714 | + rmhName:item.userName, | ||
| 715 | + rmhId:item.creatorId, | ||
| 716 | + authIcon:item.authIcon, | ||
| 717 | + authTitle: item.authTitle, | ||
| 718 | + authTitle2: '', | ||
| 719 | + banControl: 0, | ||
| 720 | + cnIsAttention:item.isAttention, | ||
| 721 | + cnAttention: 0, | ||
| 722 | + cnlsComment: 0, | ||
| 723 | + cnlsLike: 0, | ||
| 724 | + cnMainControl: 0, | ||
| 725 | + cnShareControl: 0, | ||
| 726 | + cnIsComment: 0, | ||
| 727 | + cnIsLike:0, | ||
| 728 | + posterShareControl: 0, | ||
| 729 | + rmhDesc: item.introduction, | ||
| 730 | + userId: item.userId, | ||
| 731 | + userType: item.userType, | ||
| 732 | + honoraryIcon:'' | ||
| 733 | + } | ||
| 734 | + } | ||
| 735 | + }) | ||
| 736 | + } | ||
| 737 | + return rmhInfo | ||
| 738 | + } | ||
| 739 | + | ||
| 740 | + | ||
| 741 | + | ||
| 538 | private extractResizeParams(url: string) { | 742 | private extractResizeParams(url: string) { |
| 539 | const heightRegex = /h_(\d+)/; // 匹配高度参数,如h_450 | 743 | const heightRegex = /h_(\d+)/; // 匹配高度参数,如h_450 |
| 540 | const widthRegex = /w_(\d+)/; // 匹配宽度参数,如w_800 | 744 | const widthRegex = /w_(\d+)/; // 匹配宽度参数,如w_800 |
| @@ -8,11 +8,12 @@ import { ContentDetailDTO, | @@ -8,11 +8,12 @@ import { ContentDetailDTO, | ||
| 8 | postBatchAttentionStatusResult, | 8 | postBatchAttentionStatusResult, |
| 9 | postInteractBrowsOperateParams, | 9 | postInteractBrowsOperateParams, |
| 10 | InteractDataDTO, | 10 | InteractDataDTO, |
| 11 | - FeedbackTypeBean | 11 | + FeedbackTypeBean, |
| 12 | + FeedBackParams | ||
| 12 | } from 'wdBean'; | 13 | } from 'wdBean'; |
| 13 | import { PageRepository } from '../repository/PageRepository'; | 14 | import { PageRepository } from '../repository/PageRepository'; |
| 14 | import { ArrayList } from '@kit.ArkTS'; | 15 | import { ArrayList } from '@kit.ArkTS'; |
| 15 | - | 16 | +import { ToastUtils} from 'wdKit/Index'; |
| 16 | const TAG = 'MultiPictureDetailViewModel'; | 17 | const TAG = 'MultiPictureDetailViewModel'; |
| 17 | 18 | ||
| 18 | export class MultiPictureDetailViewModel { | 19 | export class MultiPictureDetailViewModel { |
| @@ -158,15 +159,16 @@ export class MultiPictureDetailViewModel { | @@ -158,15 +159,16 @@ export class MultiPictureDetailViewModel { | ||
| 158 | }) | 159 | }) |
| 159 | } | 160 | } |
| 160 | 161 | ||
| 161 | - static async feedBackCommit(params:HashMap<String,String>): Promise<ResponseDTO> { | ||
| 162 | - return new Promise<ResponseDTO>((success, error) => { | 162 | + static async feedBackCommit(params:FeedBackParams): Promise<object> { |
| 163 | + return new Promise<object>((success, error) => { | ||
| 163 | Logger.info(TAG, `fetchDetailData start`); | 164 | Logger.info(TAG, `fetchDetailData start`); |
| 164 | - WDHttp.post(HttpUrlUtils.getHost() + HttpUrlUtils.FEEDBACK_COMMIT_PATH,params).then((resDTO: ResponseDTO) => { | ||
| 165 | - | 165 | + WDHttp.post(HttpUrlUtils.getHost() + HttpUrlUtils.FEEDBACK_COMMIT_PATH,params).then((resDTO: object) => { |
| 166 | success(resDTO); | 166 | success(resDTO); |
| 167 | + ToastUtils.shortToast('反馈成功') | ||
| 167 | }).catch((err: Error) => { | 168 | }).catch((err: Error) => { |
| 168 | Logger.error(TAG, `fetchDetailData catch, error.name : ${err.name}, error.message:${err.message}`); | 169 | Logger.error(TAG, `fetchDetailData catch, error.name : ${err.name}, error.message:${err.message}`); |
| 169 | error(err); | 170 | error(err); |
| 171 | + ToastUtils.shortToast('反馈失败') | ||
| 170 | }) | 172 | }) |
| 171 | }) | 173 | }) |
| 172 | } | 174 | } |
| @@ -5,7 +5,7 @@ export class SearchResultContentItem{ | @@ -5,7 +5,7 @@ export class SearchResultContentItem{ | ||
| 5 | resultType:string = "" | 5 | resultType:string = "" |
| 6 | } | 6 | } |
| 7 | 7 | ||
| 8 | -class SearchDescription{ | 8 | +export class SearchDescription{ |
| 9 | likeEnable: string = "" | 9 | likeEnable: string = "" |
| 10 | previewUri: string = "" | 10 | previewUri: string = "" |
| 11 | firstFrameImageBucket: string = "" | 11 | firstFrameImageBucket: string = "" |
| @@ -178,7 +178,7 @@ class SearchDescription{ | @@ -178,7 +178,7 @@ class SearchDescription{ | ||
| 178 | likeNum: string= "" | 178 | likeNum: string= "" |
| 179 | readNum: string= "" | 179 | readNum: string= "" |
| 180 | shareNum: string= "" | 180 | shareNum: string= "" |
| 181 | - | 181 | + sameContentList:SearchDescription[] = [] |
| 182 | } | 182 | } |
| 183 | 183 | ||
| 184 | @Observed | 184 | @Observed |
-
Please register or login to post a comment