Showing
38 changed files
with
384 additions
and
117 deletions
| @@ -44,4 +44,7 @@ export class SpConstants{ | @@ -44,4 +44,7 @@ export class SpConstants{ | ||
| 44 | //频道信息流页面左右挂角 | 44 | //频道信息流页面左右挂角 |
| 45 | static APP_PAGE_CORNER_ADV = 'app_page_corner_adv_' | 45 | static APP_PAGE_CORNER_ADV = 'app_page_corner_adv_' |
| 46 | 46 | ||
| 47 | + | ||
| 48 | + //游客状态下首次评论时间 | ||
| 49 | + static FIRSTCOMMENTTIME = 'firstCommentTime' | ||
| 47 | } | 50 | } |
| @@ -441,6 +441,12 @@ export class HttpUrlUtils { | @@ -441,6 +441,12 @@ export class HttpUrlUtils { | ||
| 441 | return url; | 441 | return url; |
| 442 | } | 442 | } |
| 443 | 443 | ||
| 444 | + //游客评论合并 | ||
| 445 | + static visitorMergeComment() { | ||
| 446 | + let url = HttpUrlUtils.getHost() + "/api/rmrb-comment/comment/zh/c/visitorMerge"; | ||
| 447 | + return url; | ||
| 448 | + } | ||
| 449 | + | ||
| 444 | static getAppointmentListDataUrl() { | 450 | static getAppointmentListDataUrl() { |
| 445 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.APPOINTMENT_LIST_DATA_PATH | 451 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.APPOINTMENT_LIST_DATA_PATH |
| 446 | return url | 452 | return url |
| @@ -44,7 +44,7 @@ export struct CompParser { | @@ -44,7 +44,7 @@ export struct CompParser { | ||
| 44 | 44 | ||
| 45 | @Builder | 45 | @Builder |
| 46 | componentBuilder(compDTO: CompDTO, compIndex: number) { | 46 | componentBuilder(compDTO: CompDTO, compIndex: number) { |
| 47 | - // if (compDTO.operDataList[0]?.objectType !== '3' && compDTO.operDataList[0]?.objectType !== '13') { //暂时屏蔽活动和音频详情入口 | 47 | + if (compDTO.operDataList[0]?.objectType !== '3' && compDTO.operDataList[0]?.objectType !== '13') { //暂时屏蔽活动和音频详情入口 |
| 48 | if (compDTO.compStyle === CompStyle.Label_03) { | 48 | if (compDTO.compStyle === CompStyle.Label_03) { |
| 49 | LabelComponent({ compDTO: compDTO }) | 49 | LabelComponent({ compDTO: compDTO }) |
| 50 | Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | 50 | Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) |
| @@ -77,8 +77,8 @@ export struct CompParser { | @@ -77,8 +77,8 @@ export struct CompParser { | ||
| 77 | ZhSingleRow04({ compDTO: compDTO }) | 77 | ZhSingleRow04({ compDTO: compDTO }) |
| 78 | Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | 78 | Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) |
| 79 | } else if (compDTO.compStyle === CompStyle.Zh_Single_Row_05) { | 79 | } else if (compDTO.compStyle === CompStyle.Zh_Single_Row_05) { |
| 80 | - ZhSingleRow05({ compDTO }) | ||
| 81 | - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | 80 | + // ZhSingleRow05({ compDTO }) |
| 81 | + // Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | ||
| 82 | } else if (compDTO.compStyle === CompStyle.Zh_Single_Row_06) { | 82 | } else if (compDTO.compStyle === CompStyle.Zh_Single_Row_06) { |
| 83 | ZhSingleRow06({ compDTO }) | 83 | ZhSingleRow06({ compDTO }) |
| 84 | Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | 84 | Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) |
| @@ -119,6 +119,6 @@ export struct CompParser { | @@ -119,6 +119,6 @@ export struct CompParser { | ||
| 119 | } | 119 | } |
| 120 | } | 120 | } |
| 121 | 121 | ||
| 122 | - // } | 122 | + } |
| 123 | } | 123 | } |
| 124 | 124 |
| 1 | -import { AccountManagerUtils, Logger, DateTimeUtils, SPHelper, NumberFormatterUtils } from 'wdKit'; | 1 | +import { AccountManagerUtils, Logger, DateTimeUtils, SPHelper, NumberFormatterUtils, DisplayUtils } from 'wdKit'; |
| 2 | import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel'; | 2 | import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel'; |
| 3 | import { ContentDetailDTO,postBatchAttentionStatusParams, | 3 | import { ContentDetailDTO,postBatchAttentionStatusParams, |
| 4 | PhotoListBean, | 4 | PhotoListBean, |
| @@ -53,7 +53,7 @@ export struct DynamicDetailComponent { | @@ -53,7 +53,7 @@ export struct DynamicDetailComponent { | ||
| 53 | //跳转 | 53 | //跳转 |
| 54 | private mJumpInfo: ContentDTO = {} as ContentDTO; | 54 | private mJumpInfo: ContentDTO = {} as ContentDTO; |
| 55 | 55 | ||
| 56 | - @State publishCommentModel: publishCommentModel = new publishCommentModel() | 56 | + |
| 57 | 57 | ||
| 58 | async aboutToAppear() { | 58 | async aboutToAppear() { |
| 59 | await this.getContentDetailData() | 59 | await this.getContentDetailData() |
| @@ -83,7 +83,7 @@ export struct DynamicDetailComponent { | @@ -83,7 +83,7 @@ export struct DynamicDetailComponent { | ||
| 83 | Image($r('app.media.ic_news_detail_division')) | 83 | Image($r('app.media.ic_news_detail_division')) |
| 84 | .width('100%') | 84 | .width('100%') |
| 85 | .height($r('app.float.margin_7')) | 85 | .height($r('app.float.margin_7')) |
| 86 | - .margin({left: $r('app.float.margin_16'), right: $r('app.float.margin_16')} ) | 86 | + .padding({left: $r('app.float.margin_16'), right: $r('app.float.margin_16')} ) |
| 87 | Stack({ alignContent: Alignment.Bottom }) { | 87 | Stack({ alignContent: Alignment.Bottom }) { |
| 88 | Scroll(this.scroller) { | 88 | Scroll(this.scroller) { |
| 89 | Column() { | 89 | Column() { |
| @@ -275,8 +275,8 @@ export struct DynamicDetailComponent { | @@ -275,8 +275,8 @@ export struct DynamicDetailComponent { | ||
| 275 | Image(this.contentDetailData.fullColumnImgUrls!= null && this.contentDetailData.fullColumnImgUrls.length>0&&!StringUtils.isEmpty(this.contentDetailData.fullColumnImgUrls[0].url)? | 275 | Image(this.contentDetailData.fullColumnImgUrls!= null && this.contentDetailData.fullColumnImgUrls.length>0&&!StringUtils.isEmpty(this.contentDetailData.fullColumnImgUrls[0].url)? |
| 276 | this.contentDetailData.fullColumnImgUrls[0].url: | 276 | this.contentDetailData.fullColumnImgUrls[0].url: |
| 277 | this.contentDetailData.videoInfo[0].firstFrameImageUri) | 277 | this.contentDetailData.videoInfo[0].firstFrameImageUri) |
| 278 | - .width(CommonConstants.FULL_WIDTH) | ||
| 279 | - .aspectRatio(16 / 9) | 278 | + .width(DisplayUtils.getDeviceWidth()- 32) |
| 279 | + .height((DisplayUtils.getDeviceWidth()-32)* 9 / 16) | ||
| 280 | .borderRadius($r('app.float.image_border_radius')) | 280 | .borderRadius($r('app.float.image_border_radius')) |
| 281 | CardMediaInfo({ contentDTO: this.mJumpInfo }) | 281 | CardMediaInfo({ contentDTO: this.mJumpInfo }) |
| 282 | } | 282 | } |
| @@ -291,7 +291,8 @@ export struct DynamicDetailComponent { | @@ -291,7 +291,8 @@ export struct DynamicDetailComponent { | ||
| 291 | Image(this.contentDetailData.fullColumnImgUrls!= null && this.contentDetailData.fullColumnImgUrls.length>0&&!StringUtils.isEmpty(this.contentDetailData.fullColumnImgUrls[0].url)? | 291 | Image(this.contentDetailData.fullColumnImgUrls!= null && this.contentDetailData.fullColumnImgUrls.length>0&&!StringUtils.isEmpty(this.contentDetailData.fullColumnImgUrls[0].url)? |
| 292 | this.contentDetailData.fullColumnImgUrls[0].url: | 292 | this.contentDetailData.fullColumnImgUrls[0].url: |
| 293 | this.contentDetailData.videoInfo[0].firstFrameImageUri) | 293 | this.contentDetailData.videoInfo[0].firstFrameImageUri) |
| 294 | - .width(CommonConstants.FULL_WIDTH) | 294 | + .width(DisplayUtils.getDeviceWidth()/2) |
| 295 | + .height(DisplayUtils.getDeviceWidth()/2* 4 / 3) | ||
| 295 | .borderRadius($r('app.float.image_border_radius')) | 296 | .borderRadius($r('app.float.image_border_radius')) |
| 296 | CardMediaInfo({ contentDTO: this.mJumpInfo }) | 297 | CardMediaInfo({ contentDTO: this.mJumpInfo }) |
| 297 | } | 298 | } |
| @@ -299,7 +300,7 @@ export struct DynamicDetailComponent { | @@ -299,7 +300,7 @@ export struct DynamicDetailComponent { | ||
| 299 | } | 300 | } |
| 300 | } | 301 | } |
| 301 | } | 302 | } |
| 302 | - .margin({ left: $r('app.float.margin_16'),right: $r('app.float.margin_16'),top: $r('app.float.margin_8')}) | 303 | + .padding({ left: this.contentDetailData.videoInfo[0].videoLandScape === 1?0: 16,top: $r('app.float.margin_8')}) |
| 303 | .onClick((event: ClickEvent) => { | 304 | .onClick((event: ClickEvent) => { |
| 304 | ProcessUtils.processPage(this.mJumpInfo) | 305 | ProcessUtils.processPage(this.mJumpInfo) |
| 305 | }) | 306 | }) |
| @@ -362,9 +363,17 @@ export struct DynamicDetailComponent { | @@ -362,9 +363,17 @@ export struct DynamicDetailComponent { | ||
| 362 | }) | 363 | }) |
| 363 | // 评论 | 364 | // 评论 |
| 364 | if (this.contentDetailData?.openComment) { | 365 | if (this.contentDetailData?.openComment) { |
| 365 | - Divider().strokeWidth(6).color('#f5f5f5') | 366 | + Divider().strokeWidth(6).color('#f5f5f5').margin({top:$r('app.float.margin_24')}) |
| 366 | CommentComponent({ | 367 | CommentComponent({ |
| 367 | - publishCommentModel: this.publishCommentModel | 368 | + publishCommentModel: { |
| 369 | + targetId: String(this.contentDetailData?.newsId || ''), | ||
| 370 | + targetRelId: this.contentDetailData?.reLInfo?.relId, | ||
| 371 | + targetTitle: this.contentDetailData?.newsTitle, | ||
| 372 | + targetRelType: this.contentDetailData?.reLInfo?.relType, | ||
| 373 | + targetRelObjectId: String(this.contentDetailData?.reLInfo?.relObjectId), | ||
| 374 | + keyArticle: String(this.contentDetailData?.keyArticle), | ||
| 375 | + targetType: String(this.contentDetailData?.newsType), | ||
| 376 | + } as publishCommentModel | ||
| 368 | }) | 377 | }) |
| 369 | } | 378 | } |
| 370 | Blank().layoutWeight(1) | 379 | Blank().layoutWeight(1) |
| @@ -379,7 +388,15 @@ export struct DynamicDetailComponent { | @@ -379,7 +388,15 @@ export struct DynamicDetailComponent { | ||
| 379 | OperRowListView({ contentDetailData: this.contentDetailData | 388 | OperRowListView({ contentDetailData: this.contentDetailData |
| 380 | ,interactData:this.interactDataDTO | 389 | ,interactData:this.interactDataDTO |
| 381 | ,newsStatusOfUser:this.newsStatusOfUser | 390 | ,newsStatusOfUser:this.newsStatusOfUser |
| 382 | - ,publishCommentModel: this.publishCommentModel | 391 | + ,publishCommentModel: { |
| 392 | + targetId: String(this.contentDetailData?.newsId || ''), | ||
| 393 | + targetRelId: this.contentDetailData?.reLInfo?.relId, | ||
| 394 | + targetTitle: this.contentDetailData?.newsTitle, | ||
| 395 | + targetRelType: this.contentDetailData?.reLInfo?.relType, | ||
| 396 | + targetRelObjectId: String(this.contentDetailData?.reLInfo?.relObjectId), | ||
| 397 | + keyArticle: String(this.contentDetailData?.keyArticle), | ||
| 398 | + targetType: String(this.contentDetailData?.newsType), | ||
| 399 | + } as publishCommentModel | ||
| 383 | ,needLike:false}) | 400 | ,needLike:false}) |
| 384 | } | 401 | } |
| 385 | } | 402 | } |
| @@ -399,17 +416,6 @@ export struct DynamicDetailComponent { | @@ -399,17 +416,6 @@ export struct DynamicDetailComponent { | ||
| 399 | } catch (exception) { | 416 | } catch (exception) { |
| 400 | console.log('请求失败',JSON.stringify(exception)) | 417 | console.log('请求失败',JSON.stringify(exception)) |
| 401 | } | 418 | } |
| 402 | - if (this.contentDetailData.openComment) { | ||
| 403 | - this.publishCommentModel = { | ||
| 404 | - targetId: String(this.contentDetailData?.newsId || ''), | ||
| 405 | - targetRelId: this.contentDetailData?.reLInfo?.relId, | ||
| 406 | - targetTitle: this.contentDetailData?.newsTitle, | ||
| 407 | - targetRelType: this.contentDetailData?.reLInfo?.relType, | ||
| 408 | - targetRelObjectId: String(this.contentDetailData?.reLInfo?.relObjectId), | ||
| 409 | - keyArticle: String(this.contentDetailData?.keyArticle), | ||
| 410 | - targetType: String(this.contentDetailData?.newsType), | ||
| 411 | - } as publishCommentModel | ||
| 412 | - } | ||
| 413 | this.getBatchAttentionStatus() | 419 | this.getBatchAttentionStatus() |
| 414 | this.getInteractDataStatus() | 420 | this.getInteractDataStatus() |
| 415 | this.makeJumpInfo() | 421 | this.makeJumpInfo() |
| 1 | -import { Logger, NumberFormatterUtils, DateTimeUtils, EmitterUtils, EmitterEventId } from 'wdKit'; | 1 | +import { Logger, NumberFormatterUtils, DateTimeUtils, EmitterUtils, EmitterEventId, NetworkUtil } from 'wdKit'; |
| 2 | import { | 2 | import { |
| 3 | Action, | 3 | Action, |
| 4 | ContentDetailDTO, | 4 | ContentDetailDTO, |
| @@ -20,7 +20,7 @@ import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailView | @@ -20,7 +20,7 @@ import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailView | ||
| 20 | import { PageRepository } from '../repository/PageRepository'; | 20 | import { PageRepository } from '../repository/PageRepository'; |
| 21 | import { detailedSkeleton } from './skeleton/detailSkeleton'; | 21 | import { detailedSkeleton } from './skeleton/detailSkeleton'; |
| 22 | import { publishCommentModel } from '../components/comment/model/PublishCommentModel'; | 22 | import { publishCommentModel } from '../components/comment/model/PublishCommentModel'; |
| 23 | - | 23 | +import { EmptyComponent } from '../components/view/EmptyComponent'; |
| 24 | import { CommentComponent } from '../components/comment/view/CommentComponent' | 24 | import { CommentComponent } from '../components/comment/view/CommentComponent' |
| 25 | import { HttpUtils } from 'wdNetwork/Index'; | 25 | import { HttpUtils } from 'wdNetwork/Index'; |
| 26 | 26 | ||
| @@ -40,6 +40,7 @@ export struct ImageAndTextPageComponent { | @@ -40,6 +40,7 @@ export struct ImageAndTextPageComponent { | ||
| 40 | @State publishTime: string = '' | 40 | @State publishTime: string = '' |
| 41 | @State publishCommentModel: publishCommentModel = new publishCommentModel() | 41 | @State publishCommentModel: publishCommentModel = new publishCommentModel() |
| 42 | @State operationButtonList: string[] = ['comment', 'collect', 'share'] | 42 | @State operationButtonList: string[] = ['comment', 'collect', 'share'] |
| 43 | + @State isNetConnected: boolean = true | ||
| 43 | 44 | ||
| 44 | build() { | 45 | build() { |
| 45 | Column() { | 46 | Column() { |
| @@ -143,9 +144,19 @@ export struct ImageAndTextPageComponent { | @@ -143,9 +144,19 @@ export struct ImageAndTextPageComponent { | ||
| 143 | .scrollBar(BarState.Off) | 144 | .scrollBar(BarState.Off) |
| 144 | .align(Alignment.Top) | 145 | .align(Alignment.Top) |
| 145 | 146 | ||
| 147 | + if(!this.isNetConnected) { | ||
| 148 | + EmptyComponent({ | ||
| 149 | + emptyType: 1, | ||
| 150 | + emptyButton: true, | ||
| 151 | + retry: () => { | ||
| 152 | + this.getDetail() | ||
| 153 | + } | ||
| 154 | + }) | ||
| 155 | + }else{ | ||
| 146 | if (!this.isPageEnd) { | 156 | if (!this.isPageEnd) { |
| 147 | detailedSkeleton() | 157 | detailedSkeleton() |
| 148 | } | 158 | } |
| 159 | + } | ||
| 149 | 160 | ||
| 150 | //底部交互区 | 161 | //底部交互区 |
| 151 | if (this.contentDetailData?.length) { | 162 | if (this.contentDetailData?.length) { |
| @@ -163,6 +174,7 @@ export struct ImageAndTextPageComponent { | @@ -163,6 +174,7 @@ export struct ImageAndTextPageComponent { | ||
| 163 | } | 174 | } |
| 164 | 175 | ||
| 165 | private async getDetail() { | 176 | private async getDetail() { |
| 177 | + this.isNetConnected = NetworkUtil.isNetConnected() | ||
| 166 | let contentId: string = '' | 178 | let contentId: string = '' |
| 167 | let relId: string = '' | 179 | let relId: string = '' |
| 168 | let relType: string = '' | 180 | let relType: string = '' |
| @@ -91,7 +91,6 @@ export struct SpacialTopicPageComponent { | @@ -91,7 +91,6 @@ export struct SpacialTopicPageComponent { | ||
| 91 | } | 91 | } |
| 92 | .width(CommonConstants.FULL_WIDTH) | 92 | .width(CommonConstants.FULL_WIDTH) |
| 93 | .height(CommonConstants.FULL_HEIGHT) | 93 | .height(CommonConstants.FULL_HEIGHT) |
| 94 | - // .padding({ bottom: 76 }) | ||
| 95 | 94 | ||
| 96 | if (!this.isPageEnd) { | 95 | if (!this.isPageEnd) { |
| 97 | detailedSkeleton() | 96 | detailedSkeleton() |
| 1 | import { ContentDTO, slideShows } from 'wdBean'; | 1 | import { ContentDTO, slideShows } from 'wdBean'; |
| 2 | -import { CommonConstants } from 'wdConstant' | 2 | +import { CommonConstants } from 'wdConstant'; |
| 3 | import { DateTimeUtils } from 'wdKit'; | 3 | import { DateTimeUtils } from 'wdKit'; |
| 4 | import { ProcessUtils } from 'wdRouter'; | 4 | import { ProcessUtils } from 'wdRouter'; |
| 5 | 5 | ||
| @@ -104,10 +104,12 @@ export struct Card9Component { | @@ -104,10 +104,12 @@ export struct Card9Component { | ||
| 104 | Column() { | 104 | Column() { |
| 105 | Row() { | 105 | Row() { |
| 106 | // 标题 | 106 | // 标题 |
| 107 | - Image($r("app.media.timeline_rect")) | 107 | + Image($r("app.media.timeAxis")) |
| 108 | .width(9) | 108 | .width(9) |
| 109 | .height(9) | 109 | .height(9) |
| 110 | .margin({ right: 5 }) | 110 | .margin({ right: 5 }) |
| 111 | + .fillColor(item.newsTitleColor) | ||
| 112 | + | ||
| 111 | Text(DateTimeUtils.formatDate(item.publishTime, "MM月dd日 HH:mm")) | 113 | Text(DateTimeUtils.formatDate(item.publishTime, "MM月dd日 HH:mm")) |
| 112 | .fontSize($r('app.float.font_size_12')) | 114 | .fontSize($r('app.float.font_size_12')) |
| 113 | .fontColor($r('app.color.color_222222')) | 115 | .fontColor($r('app.color.color_222222')) |
| 1 | -import { DateTimeUtils, Logger, ToastUtils, UserDataLocal } from 'wdKit/Index'; | 1 | +import { SpConstants } from 'wdConstant/Index'; |
| 2 | +import { DateTimeUtils, Logger, SPHelper, ToastUtils, UserDataLocal } from 'wdKit/Index'; | ||
| 2 | import { HttpBizUtil, HttpUrlUtils, HttpUtils, ResponseDTO } from 'wdNetwork/Index'; | 3 | import { HttpBizUtil, HttpUrlUtils, HttpUtils, ResponseDTO } from 'wdNetwork/Index'; |
| 3 | import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest'; | 4 | import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest'; |
| 4 | import { | 5 | import { |
| @@ -183,6 +184,14 @@ class CommentViewModel { | @@ -183,6 +184,14 @@ class CommentViewModel { | ||
| 183 | } | 184 | } |
| 184 | ToastUtils.showToast(data.message, 1000); | 185 | ToastUtils.showToast(data.message, 1000); |
| 185 | let model = data.data as commentItemModel | 186 | let model = data.data as commentItemModel |
| 187 | + | ||
| 188 | + let userId = HttpUtils.getUserId() | ||
| 189 | + let FIRSTCOMMENTTIME = SPHelper.default.getSync(SpConstants.FIRSTCOMMENTTIME, '') | ||
| 190 | + | ||
| 191 | + if (!userId && !FIRSTCOMMENTTIME) { | ||
| 192 | + //保存首次评论时间 | ||
| 193 | + SPHelper.default.saveSync(SpConstants.FIRSTCOMMENTTIME, DateTimeUtils.formatDate(data.timestamp, DateTimeUtils.PATTERN_DATE_TIME_HYPHEN)) | ||
| 194 | + } | ||
| 186 | success(model) | 195 | success(model) |
| 187 | }, (error: Error) => { | 196 | }, (error: Error) => { |
| 188 | ToastUtils.showToast('评论失败', 1000); | 197 | ToastUtils.showToast('评论失败', 1000); |
| @@ -19,7 +19,7 @@ export struct FollowChildComponent{ | @@ -19,7 +19,7 @@ export struct FollowChildComponent{ | ||
| 19 | Row() { | 19 | Row() { |
| 20 | Row(){ | 20 | Row(){ |
| 21 | Stack({alignContent: Alignment.Bottom}){ | 21 | Stack({alignContent: Alignment.Bottom}){ |
| 22 | - Image(StringUtils.isEmpty(this.data.headPhotoUrl)?$r('app.media.default_head'):this.data.headPhotoUrl) | 22 | + Image(StringUtils.isEmpty(this.data.headPhotoUrl)?$r('app.media.icon_default_head_mater'):this.data.headPhotoUrl) |
| 23 | .objectFit(ImageFit.Auto) | 23 | .objectFit(ImageFit.Auto) |
| 24 | .width('92lpx') | 24 | .width('92lpx') |
| 25 | .height('92lpx') | 25 | .height('92lpx') |
| @@ -128,7 +128,7 @@ export struct FollowChildComponent{ | @@ -128,7 +128,7 @@ export struct FollowChildComponent{ | ||
| 128 | Row() { | 128 | Row() { |
| 129 | Row(){ | 129 | Row(){ |
| 130 | Stack({alignContent: Alignment.Bottom}){ | 130 | Stack({alignContent: Alignment.Bottom}){ |
| 131 | - Image(StringUtils.isEmpty(this.data.headPhotoUrl)?$r('app.media.default_head'):this.data.headPhotoUrl) | 131 | + Image(StringUtils.isEmpty(this.data.headPhotoUrl)?$r('app.media.icon_default_head_mater'):this.data.headPhotoUrl) |
| 132 | .objectFit(ImageFit.Auto) | 132 | .objectFit(ImageFit.Auto) |
| 133 | .width('92lpx') | 133 | .width('92lpx') |
| 134 | .height('92lpx') | 134 | .height('92lpx') |
| @@ -70,7 +70,7 @@ export struct FollowListDetailUI { | @@ -70,7 +70,7 @@ export struct FollowListDetailUI { | ||
| 70 | Column() { | 70 | Column() { |
| 71 | if (this.count === 0) { | 71 | if (this.count === 0) { |
| 72 | if (this.isGetRequest == true) { | 72 | if (this.isGetRequest == true) { |
| 73 | - EmptyComponent({ emptyType: 14 }) | 73 | + EmptyComponent({ emptyType: 14,emptyHeight:"100%" }) |
| 74 | .layoutWeight(1) | 74 | .layoutWeight(1) |
| 75 | .width('100%') | 75 | .width('100%') |
| 76 | } | 76 | } |
| @@ -179,6 +179,7 @@ export struct FollowListDetailUI { | @@ -179,6 +179,7 @@ export struct FollowListDetailUI { | ||
| 179 | if (!this.data || value.list.length == 0) { | 179 | if (!this.data || value.list.length == 0) { |
| 180 | this.hasMore = false | 180 | this.hasMore = false |
| 181 | this.isLoading = false | 181 | this.isLoading = false |
| 182 | + this.isGetRequest = true | ||
| 182 | } else { | 183 | } else { |
| 183 | this.getFollowListStatus(value) | 184 | this.getFollowListStatus(value) |
| 184 | } | 185 | } |
| @@ -226,6 +227,8 @@ export struct FollowListDetailUI { | @@ -226,6 +227,8 @@ export struct FollowListDetailUI { | ||
| 226 | }) | 227 | }) |
| 227 | }) | 228 | }) |
| 228 | this.getFollowStatus(data_temp, result.totalCount) | 229 | this.getFollowStatus(data_temp, result.totalCount) |
| 230 | + }else{ | ||
| 231 | + this.isGetRequest = true | ||
| 229 | } | 232 | } |
| 230 | }).catch((err: Error) => { | 233 | }).catch((err: Error) => { |
| 231 | console.log(TAG, JSON.stringify(err)) | 234 | console.log(TAG, JSON.stringify(err)) |
| @@ -146,7 +146,7 @@ export struct HomePageBottomComponent{ | @@ -146,7 +146,7 @@ export struct HomePageBottomComponent{ | ||
| 146 | 146 | ||
| 147 | LazyForEach(this.data_follow, (item: FollowListDetailItem, index: number = 0) => { | 147 | LazyForEach(this.data_follow, (item: FollowListDetailItem, index: number = 0) => { |
| 148 | ListItem() { | 148 | ListItem() { |
| 149 | - FollowChildComponent({data: item,type:1}) | 149 | + FollowChildComponent({data: item,type:2}) |
| 150 | } | 150 | } |
| 151 | .onClick(() => { | 151 | .onClick(() => { |
| 152 | }) | 152 | }) |
| @@ -449,7 +449,7 @@ struct ChannelDialog { | @@ -449,7 +449,7 @@ struct ChannelDialog { | ||
| 449 | }.width('100%').height('100%') | 449 | }.width('100%').height('100%') |
| 450 | .scrollBar(BarState.Off) | 450 | .scrollBar(BarState.Off) |
| 451 | } | 451 | } |
| 452 | - .padding({ top: 40, right: 15, bottom: 20, left: 15 }) | 452 | + .padding({ top: 40, right: 15, bottom: 40, left: 15 }) |
| 453 | .backgroundColor('#ffffff') | 453 | .backgroundColor('#ffffff') |
| 454 | } | 454 | } |
| 455 | } | 455 | } |
| @@ -526,10 +526,9 @@ struct ChannelSubscriptionLayout { | @@ -526,10 +526,9 @@ struct ChannelSubscriptionLayout { | ||
| 526 | .width(18) | 526 | .width(18) |
| 527 | } | 527 | } |
| 528 | .width(36) | 528 | .width(36) |
| 529 | - .height(36) | 529 | + .height(40) |
| 530 | .justifyContent(FlexAlign.Center) | 530 | .justifyContent(FlexAlign.Center) |
| 531 | - .padding({ bottom: 6 }) | ||
| 532 | - .backgroundColor('#ffffff') | 531 | + .backgroundColor(Color.White) |
| 533 | .onClick(() => { | 532 | .onClick(() => { |
| 534 | if (this.dialogController != null) { | 533 | if (this.dialogController != null) { |
| 535 | this.dialogController.open() | 534 | this.dialogController.open() |
| @@ -8,6 +8,7 @@ import MinePageMoreFunctionUI from '../mine/MinePageMoreFunctionUI' | @@ -8,6 +8,7 @@ import MinePageMoreFunctionUI from '../mine/MinePageMoreFunctionUI' | ||
| 8 | import { SPHelper, StringUtils } from 'wdKit' | 8 | import { SPHelper, StringUtils } from 'wdKit' |
| 9 | import { SpConstants } from 'wdConstant' | 9 | import { SpConstants } from 'wdConstant' |
| 10 | import dataPreferences from '@ohos.data.preferences'; | 10 | import dataPreferences from '@ohos.data.preferences'; |
| 11 | +import { MergeRecordDialog } from '../../dialog/MergeRecordDialog' | ||
| 11 | 12 | ||
| 12 | const TAG = 'MinePageComponent'; | 13 | const TAG = 'MinePageComponent'; |
| 13 | 14 | ||
| @@ -30,9 +31,23 @@ export struct MinePageComponent { | @@ -30,9 +31,23 @@ export struct MinePageComponent { | ||
| 30 | this.isLogin = false | 31 | this.isLogin = false |
| 31 | }else { | 32 | }else { |
| 32 | this.isLogin = true | 33 | this.isLogin = true |
| 34 | + this.addRecordDialog() | ||
| 33 | } | 35 | } |
| 34 | } | 36 | } |
| 35 | } | 37 | } |
| 38 | + mergeDialogController: CustomDialogController = new CustomDialogController({ | ||
| 39 | + builder: MergeRecordDialog({ | ||
| 40 | + cancel: () => { | ||
| 41 | + this.clearMergeRecord() | ||
| 42 | + }, | ||
| 43 | + confirm: () => { | ||
| 44 | + this.dealMergeRecordData() | ||
| 45 | + } | ||
| 46 | + }), | ||
| 47 | + customStyle: true, | ||
| 48 | + alignment: DialogAlignment.Center, | ||
| 49 | + autoCancel: false | ||
| 50 | + }) | ||
| 36 | 51 | ||
| 37 | aboutToAppear(){ | 52 | aboutToAppear(){ |
| 38 | this.getUserLogin() | 53 | this.getUserLogin() |
| @@ -112,5 +127,29 @@ export struct MinePageComponent { | @@ -112,5 +127,29 @@ export struct MinePageComponent { | ||
| 112 | } | 127 | } |
| 113 | } | 128 | } |
| 114 | 129 | ||
| 130 | + addRecordDialog() { | ||
| 131 | + setTimeout(() => { | ||
| 132 | + this.dealMergeRecordDialog() | ||
| 133 | + }, 300) | ||
| 134 | + } | ||
| 135 | + | ||
| 136 | + dealMergeRecordDialog() { | ||
| 137 | + let commentTime = SPHelper.default.getSync(SpConstants.FIRSTCOMMENTTIME, "") | ||
| 138 | + if (StringUtils.isNotEmpty(commentTime)) { | ||
| 139 | + this.mergeDialogController.open() | ||
| 140 | + } | ||
| 141 | + } | ||
| 142 | + | ||
| 143 | + dealMergeRecordData() { | ||
| 144 | + MinePageDatasModel.visitorMergeComment().then(() => { | ||
| 145 | + this.mergeDialogController.close() | ||
| 146 | + }).catch(() => { | ||
| 147 | + this.mergeDialogController.close() | ||
| 148 | + }) | ||
| 149 | + } | ||
| 150 | + | ||
| 151 | + clearMergeRecord(){ | ||
| 152 | + SPHelper.default.saveSync(SpConstants.FIRSTCOMMENTTIME, "") | ||
| 153 | + } | ||
| 115 | } | 154 | } |
| 116 | 155 |
| @@ -5,12 +5,14 @@ import { RefreshConstants } from '../../utils/RefreshConstants' | @@ -5,12 +5,14 @@ import { RefreshConstants } from '../../utils/RefreshConstants' | ||
| 5 | */ | 5 | */ |
| 6 | @Component | 6 | @Component |
| 7 | export default struct NoMoreLayout { | 7 | export default struct NoMoreLayout { |
| 8 | + | ||
| 9 | + | ||
| 8 | build() { | 10 | build() { |
| 9 | - Row() { | 11 | + Column() { |
| 10 | Text($r('app.string.footer_text')) | 12 | Text($r('app.string.footer_text')) |
| 11 | - .margin({ left: RefreshConstants.NoMoreLayoutConstant_NORMAL_PADDING }) | ||
| 12 | .fontSize(RefreshConstants.NoMoreLayoutConstant_TITLE_FONT) | 13 | .fontSize(RefreshConstants.NoMoreLayoutConstant_TITLE_FONT) |
| 13 | .textAlign(TextAlign.Center) | 14 | .textAlign(TextAlign.Center) |
| 15 | + .margin({bottom:40}) | ||
| 14 | } | 16 | } |
| 15 | .width(RefreshConstants.FULL_WIDTH) | 17 | .width(RefreshConstants.FULL_WIDTH) |
| 16 | .justifyContent(FlexAlign.Center) | 18 | .justifyContent(FlexAlign.Center) |
| @@ -7,6 +7,7 @@ import { FirstTabTopSearchComponent } from '../search/FirstTabTopSearchComponent | @@ -7,6 +7,7 @@ import { FirstTabTopSearchComponent } from '../search/FirstTabTopSearchComponent | ||
| 7 | import { VideoChannelDetail } from 'wdDetailPlayShortVideo/Index'; | 7 | import { VideoChannelDetail } from 'wdDetailPlayShortVideo/Index'; |
| 8 | import { AssignChannelParam } from 'wdRouter/src/main/ets/utils/HomeChannelUtils'; | 8 | import { AssignChannelParam } from 'wdRouter/src/main/ets/utils/HomeChannelUtils'; |
| 9 | import { PeopleShipMainComponent } from '../peopleShip/PeopleShipMainComponent'; | 9 | import { PeopleShipMainComponent } from '../peopleShip/PeopleShipMainComponent'; |
| 10 | +import { WDRouterPage, WDRouterRule } from 'wdRouter' | ||
| 10 | 11 | ||
| 11 | 12 | ||
| 12 | const TAG = 'TopNavigationComponent'; | 13 | const TAG = 'TopNavigationComponent'; |
| @@ -63,6 +64,8 @@ export struct TopNavigationComponent { | @@ -63,6 +64,8 @@ export struct TopNavigationComponent { | ||
| 63 | @State indicatorLeftMargin: number = 0 | 64 | @State indicatorLeftMargin: number = 0 |
| 64 | @State indicatorWidth: number = 0 | 65 | @State indicatorWidth: number = 0 |
| 65 | private tabsWidth: number = 0 | 66 | private tabsWidth: number = 0 |
| 67 | + //定时器延时处理切换至版面、播报tab时 返回上一个tab | ||
| 68 | + @State tabTimmer: number = 0 | ||
| 66 | 69 | ||
| 67 | topOrBottomNavChange() { | 70 | topOrBottomNavChange() { |
| 68 | if (this.currentBottomNavName === this.currentBottomNavInfo?.name) { | 71 | if (this.currentBottomNavName === this.currentBottomNavInfo?.name) { |
| @@ -260,6 +263,9 @@ export struct TopNavigationComponent { | @@ -260,6 +263,9 @@ export struct TopNavigationComponent { | ||
| 260 | }) | 263 | }) |
| 261 | .animationDuration(this.animationDuration) | 264 | .animationDuration(this.animationDuration) |
| 262 | .onChange((index: number) => { | 265 | .onChange((index: number) => { |
| 266 | + if(this.tabTimmer){ | ||
| 267 | + clearTimeout(this.tabTimmer) | ||
| 268 | + } | ||
| 263 | this.currentTopNavName = | 269 | this.currentTopNavName = |
| 264 | this._currentNavIndex === 0 ? this.myChannelList[index].name : this.topNavList[index].name | 270 | this._currentNavIndex === 0 ? this.myChannelList[index].name : this.topNavList[index].name |
| 265 | Logger.info(TAG, `onChange index : ${index}`); | 271 | Logger.info(TAG, `onChange index : ${index}`); |
| @@ -271,11 +277,15 @@ export struct TopNavigationComponent { | @@ -271,11 +277,15 @@ export struct TopNavigationComponent { | ||
| 271 | if (this.isBroadcast(this._currentNavIndex === 0 ? this.myChannelList[index] : this.topNavList[index])) { | 277 | if (this.isBroadcast(this._currentNavIndex === 0 ? this.myChannelList[index] : this.topNavList[index])) { |
| 272 | // 跳转到播报页面 | 278 | // 跳转到播报页面 |
| 273 | ProcessUtils.gotoBroadcastPage(this.myChannelList[index].pageId) | 279 | ProcessUtils.gotoBroadcastPage(this.myChannelList[index].pageId) |
| 280 | + this.tabTimmer = setTimeout(() => { | ||
| 274 | this.tabsController.changeIndex(this.currentTopNavSelectedIndex) | 281 | this.tabsController.changeIndex(this.currentTopNavSelectedIndex) |
| 282 | + }, 500) | ||
| 275 | } | 283 | } |
| 276 | if (this.isLayout(this._currentNavIndex === 0 ? this.myChannelList[index] : this.topNavList[index])) { | 284 | if (this.isLayout(this._currentNavIndex === 0 ? this.myChannelList[index] : this.topNavList[index])) { |
| 277 | ProcessUtils.gotoENewsPaper() | 285 | ProcessUtils.gotoENewsPaper() |
| 286 | + this.tabTimmer = setTimeout(() => { | ||
| 278 | this.tabsController.changeIndex(this.currentTopNavSelectedIndex) | 287 | this.tabsController.changeIndex(this.currentTopNavSelectedIndex) |
| 288 | + }, 500) | ||
| 279 | } | 289 | } |
| 280 | }) | 290 | }) |
| 281 | .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { | 291 | .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { |
| @@ -326,6 +336,20 @@ export struct TopNavigationComponent { | @@ -326,6 +336,20 @@ export struct TopNavigationComponent { | ||
| 326 | this.tabsController.changeIndex(index) | 336 | this.tabsController.changeIndex(index) |
| 327 | } | 337 | } |
| 328 | }) | 338 | }) |
| 339 | + }else { | ||
| 340 | + Row() { | ||
| 341 | + Image($r('app.media.icon_search')) | ||
| 342 | + .width(18) | ||
| 343 | + .height(18) | ||
| 344 | + } | ||
| 345 | + .height('40vp') | ||
| 346 | + .width('40vp') | ||
| 347 | + .margin({ right: 10 }) | ||
| 348 | + .alignItems(VerticalAlign.Center) | ||
| 349 | + .justifyContent(FlexAlign.Center) | ||
| 350 | + .onClick(() => { | ||
| 351 | + WDRouterRule.jumpWithPage(WDRouterPage.searchPage) | ||
| 352 | + }) | ||
| 329 | } | 353 | } |
| 330 | } | 354 | } |
| 331 | } | 355 | } |
| @@ -24,7 +24,7 @@ import PageAdModel from '../../viewmodel/PageAdvModel'; | @@ -24,7 +24,7 @@ import PageAdModel from '../../viewmodel/PageAdvModel'; | ||
| 24 | import PageHelper from '../../viewmodel/PageHelper'; | 24 | import PageHelper from '../../viewmodel/PageHelper'; |
| 25 | import { PeopleShipAttentionContentListTopComponent } from './PeopleShipAttentionContentListTopComponent' | 25 | import { PeopleShipAttentionContentListTopComponent } from './PeopleShipAttentionContentListTopComponent' |
| 26 | import { CardParser } from '../CardParser' | 26 | import { CardParser } from '../CardParser' |
| 27 | -import NoMoreLayout from '../page/NoMoreLayout'; | 27 | +import { PeopleShipNoMoreData } from '../reusable/PeopleShipNoMoreData'; |
| 28 | 28 | ||
| 29 | @Preview | 29 | @Preview |
| 30 | @Component | 30 | @Component |
| @@ -161,7 +161,7 @@ export struct PeopleShipMainComponent { | @@ -161,7 +161,7 @@ export struct PeopleShipMainComponent { | ||
| 161 | // 加载更多 | 161 | // 加载更多 |
| 162 | ListItem() { | 162 | ListItem() { |
| 163 | if (!this.hasMore && !this.isLoading) { | 163 | if (!this.hasMore && !this.isLoading) { |
| 164 | - NoMoreLayout() | 164 | + PeopleShipNoMoreData() |
| 165 | } | 165 | } |
| 166 | } | 166 | } |
| 167 | } | 167 | } |
| 1 | import { PeopleShipRecommendHeadComponent } from './PeopleShipRecommendHeadComponent' | 1 | import { PeopleShipRecommendHeadComponent } from './PeopleShipRecommendHeadComponent' |
| 2 | import { RmhRecommendDTO } from 'wdBean'; | 2 | import { RmhRecommendDTO } from 'wdBean'; |
| 3 | -import { Logger } from 'wdKit/Index'; | ||
| 4 | -import NoMoreLayout from '../page/NoMoreLayout'; | 3 | +import { PeopleShipNoMoreData } from '../reusable/PeopleShipNoMoreData'; |
| 5 | 4 | ||
| 6 | @Component | 5 | @Component |
| 7 | export struct PeopleShipRecommendComponent { | 6 | export struct PeopleShipRecommendComponent { |
| @@ -87,7 +86,8 @@ export struct PeopleShipRecommendComponent { | @@ -87,7 +86,8 @@ export struct PeopleShipRecommendComponent { | ||
| 87 | // 为你推荐 | 86 | // 为你推荐 |
| 88 | Button(this.rmhSelectedList.length == 0 ? '一键关注' : `一键关注 (${this.rmhSelectedList.length})`, { type: ButtonType.Normal, stateEffect: this.rmhSelectedList.length != 0 }) | 87 | Button(this.rmhSelectedList.length == 0 ? '一键关注' : `一键关注 (${this.rmhSelectedList.length})`, { type: ButtonType.Normal, stateEffect: this.rmhSelectedList.length != 0 }) |
| 89 | .margin({ | 88 | .margin({ |
| 90 | - top: '24vp' | 89 | + top: '24vp', |
| 90 | + bottom: '10vp' | ||
| 91 | }) | 91 | }) |
| 92 | .width('120vp') | 92 | .width('120vp') |
| 93 | .height('36vp') | 93 | .height('36vp') |
| @@ -104,7 +104,7 @@ export struct PeopleShipRecommendComponent { | @@ -104,7 +104,7 @@ export struct PeopleShipRecommendComponent { | ||
| 104 | } | 104 | } |
| 105 | }) | 105 | }) |
| 106 | // 没有更多 | 106 | // 没有更多 |
| 107 | - NoMoreLayout() | 107 | + PeopleShipNoMoreData() |
| 108 | } | 108 | } |
| 109 | .width('100%') | 109 | .width('100%') |
| 110 | } | 110 | } |
| @@ -18,9 +18,9 @@ import { CardParser } from '../CardParser' | @@ -18,9 +18,9 @@ import { CardParser } from '../CardParser' | ||
| 18 | import { PageRepository } from '../../repository/PageRepository' | 18 | import { PageRepository } from '../../repository/PageRepository' |
| 19 | import { RefreshLayoutBean } from '../page/RefreshLayoutBean' | 19 | import { RefreshLayoutBean } from '../page/RefreshLayoutBean' |
| 20 | import CustomRefreshLoadLayout from '../page/CustomRefreshLoadLayout' | 20 | import CustomRefreshLoadLayout from '../page/CustomRefreshLoadLayout' |
| 21 | -import { ErrorComponent } from '../view/ErrorComponent'; | ||
| 22 | -import NoMoreLayout from '../page/NoMoreLayout'; | 21 | +import { ErrorComponent } from '../view/ErrorComponent' |
| 23 | import { CustomPullToRefresh } from '../reusable/CustomPullToRefresh' | 22 | import { CustomPullToRefresh } from '../reusable/CustomPullToRefresh' |
| 23 | +import { PeopleShipNoMoreData } from '../reusable/PeopleShipNoMoreData' | ||
| 24 | 24 | ||
| 25 | const TAG = 'PeopleShipHomeArticleListComponent'; | 25 | const TAG = 'PeopleShipHomeArticleListComponent'; |
| 26 | 26 | ||
| @@ -104,7 +104,7 @@ export struct PeopleShipHomeArticleListComponent { | @@ -104,7 +104,7 @@ export struct PeopleShipHomeArticleListComponent { | ||
| 104 | // 加载更多 | 104 | // 加载更多 |
| 105 | ListItem() { | 105 | ListItem() { |
| 106 | if (!this.hasMore && !this.isLoading) { | 106 | if (!this.hasMore && !this.isLoading) { |
| 107 | - NoMoreLayout() | 107 | + PeopleShipNoMoreData() |
| 108 | } | 108 | } |
| 109 | } | 109 | } |
| 110 | } | 110 | } |
| @@ -56,7 +56,7 @@ export struct PeopleShipHomePageNavComponent { | @@ -56,7 +56,7 @@ export struct PeopleShipHomePageNavComponent { | ||
| 56 | 56 | ||
| 57 | if (this.isAttention == '0') { | 57 | if (this.isAttention == '0') { |
| 58 | // 关注 | 58 | // 关注 |
| 59 | - Button('+关注', { type: ButtonType.Normal, stateEffect: true }) | 59 | + Button('+ 关注', { type: ButtonType.Normal, stateEffect: true }) |
| 60 | .borderRadius(4) | 60 | .borderRadius(4) |
| 61 | .backgroundColor($r('app.color.color_ED2800')) | 61 | .backgroundColor($r('app.color.color_ED2800')) |
| 62 | .width('54vp') | 62 | .width('54vp') |
sight_harmony/features/wdComponent/src/main/ets/components/reusable/PeopleShipNoMoreData.ets
0 → 100644
| 1 | +@Component | ||
| 2 | +export struct PeopleShipNoMoreData{ | ||
| 3 | + | ||
| 4 | + @State title: string = '已显示全部内容' | ||
| 5 | + build(){ | ||
| 6 | + Row(){ | ||
| 7 | + Text("已显示全部内容") | ||
| 8 | + .fontColor($r('app.color.color_999999')) | ||
| 9 | + .fontWeight(400) | ||
| 10 | + .fontSize('14vp') | ||
| 11 | + } | ||
| 12 | + .justifyContent(FlexAlign.Center) | ||
| 13 | + .alignItems(VerticalAlign.Center) | ||
| 14 | + .width('100%') | ||
| 15 | + .margin({top:'24vp',bottom:'24vp'}) | ||
| 16 | + } | ||
| 17 | +} |
| @@ -29,11 +29,19 @@ export struct FirstTabTopSearchComponent { | @@ -29,11 +29,19 @@ export struct FirstTabTopSearchComponent { | ||
| 29 | if (value != null) { | 29 | if (value != null) { |
| 30 | this.searchTextData = value | 30 | this.searchTextData = value |
| 31 | } | 31 | } |
| 32 | + this.setDefaultHitData() | ||
| 32 | }).catch((err: Error) => { | 33 | }).catch((err: Error) => { |
| 33 | console.log(TAG, JSON.stringify(err)) | 34 | console.log(TAG, JSON.stringify(err)) |
| 35 | + this.setDefaultHitData() | ||
| 34 | }) | 36 | }) |
| 35 | } | 37 | } |
| 36 | 38 | ||
| 39 | + setDefaultHitData(){ | ||
| 40 | + if(this.searchTextData.length === 0){ | ||
| 41 | + this.searchTextData.push("搜索") | ||
| 42 | + } | ||
| 43 | + } | ||
| 44 | + | ||
| 37 | build() { | 45 | build() { |
| 38 | Row() { | 46 | Row() { |
| 39 | Image($r('app.media.icon_search')) | 47 | Image($r('app.media.icon_search')) |
| @@ -13,14 +13,18 @@ const TAG = "SearchComponent" | @@ -13,14 +13,18 @@ const TAG = "SearchComponent" | ||
| 13 | @Component | 13 | @Component |
| 14 | export struct SearchComponent { | 14 | export struct SearchComponent { |
| 15 | @State searchTextData: string[] = [] | 15 | @State searchTextData: string[] = [] |
| 16 | + @State hasNoSearchTextData: boolean = false | ||
| 17 | + @State curHintSearchData: string = "" | ||
| 16 | @State hasInputContent: boolean = false | 18 | @State hasInputContent: boolean = false |
| 17 | @State hasChooseSearch: boolean = false | 19 | @State hasChooseSearch: boolean = false |
| 18 | - @State isClickedHistory: boolean = false | ||
| 19 | - @State isClickedHot: boolean = false | ||
| 20 | - @State isClickedRelated: boolean = false | 20 | + @State isClickedHistorySearch: boolean = false |
| 21 | + @State isClickedHotSearch: boolean = false | ||
| 22 | + @State isClickedRelatedSearch: boolean = false | ||
| 23 | + @State isClickedInputSearch: boolean = false | ||
| 24 | + @State isClickedHintSearch: boolean = false | ||
| 21 | private swiperController: SwiperController = new SwiperController() | 25 | private swiperController: SwiperController = new SwiperController() |
| 22 | @State searchText: string = '' | 26 | @State searchText: string = '' |
| 23 | - controller: TextInputController = new TextInputController() | 27 | + controller: SearchController = new SearchController() |
| 24 | @State searchHistoryData: SearchHistoryItem[] = [] | 28 | @State searchHistoryData: SearchHistoryItem[] = [] |
| 25 | @State relatedSearchContentsData: SearchRelatedItem[] = [] | 29 | @State relatedSearchContentsData: SearchRelatedItem[] = [] |
| 26 | scroller: Scroller = new Scroller() | 30 | scroller: Scroller = new Scroller() |
| @@ -30,6 +34,8 @@ export struct SearchComponent { | @@ -30,6 +34,8 @@ export struct SearchComponent { | ||
| 30 | aboutToAppear() { | 34 | aboutToAppear() { |
| 31 | //获取提示滚动 | 35 | //获取提示滚动 |
| 32 | this.getSearchHint() | 36 | this.getSearchHint() |
| 37 | + //清除缓存 | ||
| 38 | + SearcherAboutDataModel.searchHistoryData = [] | ||
| 33 | //获取搜索历史 | 39 | //获取搜索历史 |
| 34 | this.getSearchHistoryData() | 40 | this.getSearchHistoryData() |
| 35 | } | 41 | } |
| @@ -75,10 +81,18 @@ export struct SearchComponent { | @@ -75,10 +81,18 @@ export struct SearchComponent { | ||
| 75 | if (value != null) { | 81 | if (value != null) { |
| 76 | this.searchTextData = value | 82 | this.searchTextData = value |
| 77 | } | 83 | } |
| 84 | + this.setDefaultHitData() | ||
| 78 | }).catch((err: Error) => { | 85 | }).catch((err: Error) => { |
| 79 | console.log(TAG, JSON.stringify(err)) | 86 | console.log(TAG, JSON.stringify(err)) |
| 87 | + this.setDefaultHitData() | ||
| 80 | }) | 88 | }) |
| 81 | } | 89 | } |
| 90 | + setDefaultHitData(){ | ||
| 91 | + if(this.searchTextData.length === 0){ | ||
| 92 | + this.hasNoSearchTextData = true | ||
| 93 | + this.searchTextData.push("搜索感兴趣的内容") | ||
| 94 | + } | ||
| 95 | + } | ||
| 82 | 96 | ||
| 83 | getSearchHistoryData() { | 97 | getSearchHistoryData() { |
| 84 | this.searchHistoryData = SearcherAboutDataModel.getSearchHistoryData() | 98 | this.searchHistoryData = SearcherAboutDataModel.getSearchHistoryData() |
| @@ -131,7 +145,7 @@ export struct SearchComponent { | @@ -131,7 +145,7 @@ export struct SearchComponent { | ||
| 131 | getSearchHistoryResData(content:string,index:number){ | 145 | getSearchHistoryResData(content:string,index:number){ |
| 132 | //删除单条记录 | 146 | //删除单条记录 |
| 133 | SearcherAboutDataModel.delSearchSingleHistoryData(index) | 147 | SearcherAboutDataModel.delSearchSingleHistoryData(index) |
| 134 | - this.isClickedHistory = true | 148 | + this.isClickedHistorySearch = true |
| 135 | this.searchResData(content) | 149 | this.searchResData(content) |
| 136 | } | 150 | } |
| 137 | 151 | ||
| @@ -148,6 +162,16 @@ export struct SearchComponent { | @@ -148,6 +162,16 @@ export struct SearchComponent { | ||
| 148 | //查询 操作 TODO | 162 | //查询 操作 TODO |
| 149 | this.hasChooseSearch = true | 163 | this.hasChooseSearch = true |
| 150 | this.getSearchResultCountData() | 164 | this.getSearchResultCountData() |
| 165 | + this.controller.stopEditing() | ||
| 166 | + } | ||
| 167 | + | ||
| 168 | + /** | ||
| 169 | + * 点击hint搜索列表回调 | ||
| 170 | + * @param content | ||
| 171 | + */ | ||
| 172 | + getSearchHintResData(content:string){ | ||
| 173 | + this.isClickedHintSearch = true | ||
| 174 | + this.searchResData(content) | ||
| 151 | } | 175 | } |
| 152 | 176 | ||
| 153 | /** | 177 | /** |
| @@ -155,7 +179,7 @@ export struct SearchComponent { | @@ -155,7 +179,7 @@ export struct SearchComponent { | ||
| 155 | * @param content | 179 | * @param content |
| 156 | */ | 180 | */ |
| 157 | getSearchRelatedResData(content:string){ | 181 | getSearchRelatedResData(content:string){ |
| 158 | - this.isClickedRelated = true | 182 | + this.isClickedRelatedSearch = true |
| 159 | this.searchResData(content) | 183 | this.searchResData(content) |
| 160 | } | 184 | } |
| 161 | 185 | ||
| @@ -164,10 +188,18 @@ export struct SearchComponent { | @@ -164,10 +188,18 @@ export struct SearchComponent { | ||
| 164 | * @param content | 188 | * @param content |
| 165 | */ | 189 | */ |
| 166 | getSearchHotResData(content:string){ | 190 | getSearchHotResData(content:string){ |
| 167 | - this.isClickedHot = true | 191 | + this.isClickedHotSearch = true |
| 168 | this.searchResData(content) | 192 | this.searchResData(content) |
| 169 | } | 193 | } |
| 170 | 194 | ||
| 195 | + /** | ||
| 196 | + * 点击输入法搜索搜索列表回调 | ||
| 197 | + * @param content | ||
| 198 | + */ | ||
| 199 | + getSearchInputResData(content:string){ | ||
| 200 | + this.isClickedInputSearch = true | ||
| 201 | + this.searchResData(content) | ||
| 202 | + } | ||
| 171 | 203 | ||
| 172 | //搜索框 | 204 | //搜索框 |
| 173 | @Builder searchInputComponent() { | 205 | @Builder searchInputComponent() { |
| @@ -185,7 +217,7 @@ export struct SearchComponent { | @@ -185,7 +217,7 @@ export struct SearchComponent { | ||
| 185 | .textAlign(TextAlign.Start) | 217 | .textAlign(TextAlign.Start) |
| 186 | .maxLines(1) | 218 | .maxLines(1) |
| 187 | .textOverflow({ overflow: TextOverflow.Clip }) | 219 | .textOverflow({ overflow: TextOverflow.Clip }) |
| 188 | - .margin({ left: '40lpx' }) | 220 | + .margin({ left: '70lpx' }) |
| 189 | }) | 221 | }) |
| 190 | } | 222 | } |
| 191 | .loop(true) | 223 | .loop(true) |
| @@ -195,42 +227,57 @@ export struct SearchComponent { | @@ -195,42 +227,57 @@ export struct SearchComponent { | ||
| 195 | .vertical(true) | 227 | .vertical(true) |
| 196 | .enabled(false) | 228 | .enabled(false) |
| 197 | .focusable(false) | 229 | .focusable(false) |
| 230 | + .onChange((index: number) => { | ||
| 231 | + this.curHintSearchData = this.searchTextData[index] | ||
| 232 | + }) | ||
| 198 | } | 233 | } |
| 199 | Row(){ | 234 | Row(){ |
| 200 | - TextInput({ text: this.searchText, placeholder: '', controller: this.controller }) | ||
| 201 | - .caretColor(Color.Pink) | ||
| 202 | - .fontSize('27lpx') | 235 | + Search({ value: this.searchText, placeholder: '', controller: this.controller}) |
| 203 | .layoutWeight(1) | 236 | .layoutWeight(1) |
| 204 | - .fontColor(Color.Black) | 237 | + .height('69lpx') |
| 238 | + .backgroundColor($r('app.color.color_transparent')) | ||
| 239 | + .textFont({ size: "27lpx", weight: "400lpx" }) | ||
| 240 | + .defaultFocus(true) | ||
| 241 | + .caretStyle({color:Color.Pink}) | ||
| 242 | + .onSubmit((value: string) => { | ||
| 243 | + if(StringUtils.isNotEmpty(this.searchText)){ | ||
| 244 | + SearcherAboutDataModel.putSearchHistoryData(this.searchText) | ||
| 245 | + this.getSearchHistoryData() | ||
| 246 | + this.getSearchInputResData(this.searchText) | ||
| 247 | + }else{ | ||
| 248 | + if(!this.hasNoSearchTextData){ | ||
| 249 | + if(StringUtils.isEmpty(this.curHintSearchData)){ | ||
| 250 | + this.curHintSearchData = this.searchTextData[0] | ||
| 251 | + } | ||
| 252 | + this.getSearchHintResData(this.curHintSearchData) | ||
| 253 | + }else{ | ||
| 254 | + ToastUtils.shortToast("请输入搜索关键词") | ||
| 255 | + } | ||
| 256 | + } | ||
| 257 | + }) | ||
| 205 | .onChange((value: string) => { | 258 | .onChange((value: string) => { |
| 206 | this.searchText = value | 259 | this.searchText = value |
| 260 | + if(this.isClickedHistorySearch || this.isClickedHotSearch || this.isClickedRelatedSearch || this.isClickedInputSearch|| this.isClickedHintSearch){ | ||
| 261 | + this.hasChooseSearch = true | ||
| 262 | + }else{ | ||
| 263 | + this.hasChooseSearch = false | ||
| 264 | + } | ||
| 265 | + | ||
| 207 | if (this.searchText.length > 0) { | 266 | if (this.searchText.length > 0) { |
| 208 | this.hasInputContent = true | 267 | this.hasInputContent = true |
| 209 | } else { | 268 | } else { |
| 210 | this.hasInputContent = false | 269 | this.hasInputContent = false |
| 211 | } | 270 | } |
| 212 | - if(this.isClickedHistory || this.isClickedHot || this.isClickedRelated){ | ||
| 213 | - this.isClickedHistory = false | ||
| 214 | - this.isClickedHot = false | ||
| 215 | - this.isClickedRelated = false | 271 | + |
| 272 | + if(this.isClickedHistorySearch || this.isClickedHotSearch || this.isClickedRelatedSearch || this.isClickedInputSearch|| this.isClickedHintSearch){ | ||
| 273 | + this.resetSearch() | ||
| 216 | }else{ | 274 | }else{ |
| 275 | + if(this.hasInputContent){ | ||
| 217 | this.getRelatedSearchContent() | 276 | this.getRelatedSearchContent() |
| 218 | } | 277 | } |
| 219 | - }) | ||
| 220 | - .backgroundColor($r('app.color.color_transparent')) | ||
| 221 | - .defaultFocus(true) | ||
| 222 | - if(this.hasInputContent){ | ||
| 223 | - Image($r('app.media.search_input_del_icon')) | ||
| 224 | - .width('31lpx') | ||
| 225 | - .height('31lpx') | ||
| 226 | - .objectFit(ImageFit.Cover) | ||
| 227 | - .interpolation(ImageInterpolation.High) | ||
| 228 | - .onClick(()=>{ | ||
| 229 | - this.searchText = "" | ||
| 230 | - this.hasInputContent = false | ||
| 231 | - this.hasChooseSearch = false | ||
| 232 | - }) | ||
| 233 | } | 278 | } |
| 279 | + }) | ||
| 280 | + | ||
| 234 | }.padding({right:'30lpx'}) | 281 | }.padding({right:'30lpx'}) |
| 235 | .layoutWeight(1) | 282 | .layoutWeight(1) |
| 236 | } | 283 | } |
| @@ -241,7 +288,7 @@ export struct SearchComponent { | @@ -241,7 +288,7 @@ export struct SearchComponent { | ||
| 241 | 288 | ||
| 242 | //TODO 需要修改输入法 换行 | 289 | //TODO 需要修改输入法 换行 |
| 243 | //右 | 290 | //右 |
| 244 | - Text(this.hasInputContent?"搜索":"取消") | 291 | + Text("取消") |
| 245 | .textAlign(TextAlign.Center) | 292 | .textAlign(TextAlign.Center) |
| 246 | .fontWeight('400lpx') | 293 | .fontWeight('400lpx') |
| 247 | .fontSize('31lpx') | 294 | .fontSize('31lpx') |
| @@ -250,16 +297,7 @@ export struct SearchComponent { | @@ -250,16 +297,7 @@ export struct SearchComponent { | ||
| 250 | .width('125lpx') | 297 | .width('125lpx') |
| 251 | .height('58lpx') | 298 | .height('58lpx') |
| 252 | .onClick(() => { | 299 | .onClick(() => { |
| 253 | - if(this.hasInputContent){ | ||
| 254 | - if(StringUtils.isNotEmpty(this.searchText)){ | ||
| 255 | - SearcherAboutDataModel.putSearchHistoryData(this.searchText) | ||
| 256 | - this.getSearchHistoryData() | ||
| 257 | - | ||
| 258 | - this.getSearchHotResData(this.searchText) | ||
| 259 | - } | ||
| 260 | - }else{ | ||
| 261 | router.back() | 300 | router.back() |
| 262 | - } | ||
| 263 | }) | 301 | }) |
| 264 | } | 302 | } |
| 265 | .height('85lpx') | 303 | .height('85lpx') |
| @@ -289,9 +327,19 @@ export struct SearchComponent { | @@ -289,9 +327,19 @@ export struct SearchComponent { | ||
| 289 | } | 327 | } |
| 290 | } | 328 | } |
| 291 | this.isGetRequest = true | 329 | this.isGetRequest = true |
| 330 | + this.resetSearch() | ||
| 292 | }).catch((err: Error) => { | 331 | }).catch((err: Error) => { |
| 293 | console.log(TAG, JSON.stringify(err)) | 332 | console.log(TAG, JSON.stringify(err)) |
| 294 | this.isGetRequest = true | 333 | this.isGetRequest = true |
| 334 | + this.resetSearch() | ||
| 295 | }) | 335 | }) |
| 296 | } | 336 | } |
| 337 | + | ||
| 338 | + resetSearch(){ | ||
| 339 | + this.isClickedHistorySearch = false | ||
| 340 | + this.isClickedHotSearch = false | ||
| 341 | + this.isClickedRelatedSearch = false | ||
| 342 | + this.isClickedInputSearch = false | ||
| 343 | + this.isClickedHintSearch = false | ||
| 344 | + } | ||
| 297 | } | 345 | } |
| @@ -135,6 +135,6 @@ export struct SearchHistoryComponent{ | @@ -135,6 +135,6 @@ export struct SearchHistoryComponent{ | ||
| 135 | } | 135 | } |
| 136 | 136 | ||
| 137 | getCategoryViewHeight() { | 137 | getCategoryViewHeight() { |
| 138 | - return `${46 * this.getCategoryRowCount()}lpx`; | 138 | + return `${50 * this.getCategoryRowCount()}lpx`; |
| 139 | } | 139 | } |
| 140 | } | 140 | } |
| @@ -80,7 +80,7 @@ export struct SearchHotsComponent{ | @@ -80,7 +80,7 @@ export struct SearchHotsComponent{ | ||
| 80 | .fontWeight('400lpx') | 80 | .fontWeight('400lpx') |
| 81 | .lineHeight('42lpx') | 81 | .lineHeight('42lpx') |
| 82 | }.layoutWeight(1) | 82 | }.layoutWeight(1) |
| 83 | - if(item.mark!=0){ | 83 | + if(item.mark===1 || item.mark===2){ |
| 84 | Image(item.mark===1?$r('app.media.search_hots_mark1'):$r('app.media.search_hots_mark2')) | 84 | Image(item.mark===1?$r('app.media.search_hots_mark1'):$r('app.media.search_hots_mark2')) |
| 85 | .width('42lpx') | 85 | .width('42lpx') |
| 86 | .height('31lpx') | 86 | .height('31lpx') |
| 1 | import { Params } from 'wdBean'; | 1 | import { Params } from 'wdBean'; |
| 2 | import { AppUtils, StringUtils } from 'wdKit/Index'; | 2 | import { AppUtils, StringUtils } from 'wdKit/Index'; |
| 3 | import { WDRouterPage, WDRouterRule } from 'wdRouter'; | 3 | import { WDRouterPage, WDRouterRule } from 'wdRouter'; |
| 4 | +import { CustomTitleUI } from '../reusable/CustomTitleUI'; | ||
| 4 | import { EnvironmentCustomDialog } from './EnvironmentCustomDialog'; | 5 | import { EnvironmentCustomDialog } from './EnvironmentCustomDialog'; |
| 5 | 6 | ||
| 6 | const TAG = 'AboutPageUI'; | 7 | const TAG = 'AboutPageUI'; |
| @@ -23,11 +24,11 @@ export struct AboutPageUI { | @@ -23,11 +24,11 @@ export struct AboutPageUI { | ||
| 23 | }) | 24 | }) |
| 24 | 25 | ||
| 25 | build() { | 26 | build() { |
| 26 | - Navigation() { | 27 | + // Navigation() { |
| 27 | //滑动区域 | 28 | //滑动区域 |
| 28 | this.aboutUi() | 29 | this.aboutUi() |
| 29 | - }.titleMode(NavigationTitleMode.Mini) | ||
| 30 | - .title('关于') | 30 | + // }.titleMode(NavigationTitleMode.Mini) |
| 31 | + // .title('关于') | ||
| 31 | } | 32 | } |
| 32 | 33 | ||
| 33 | aboutToAppear() { | 34 | aboutToAppear() { |
| @@ -42,6 +43,8 @@ export struct AboutPageUI { | @@ -42,6 +43,8 @@ export struct AboutPageUI { | ||
| 42 | @Builder | 43 | @Builder |
| 43 | aboutUi() { | 44 | aboutUi() { |
| 44 | Column() { | 45 | Column() { |
| 46 | + CustomTitleUI({titleName:'关于'}) | ||
| 47 | + | ||
| 45 | Image($r('app.media.setting_about_logo')) | 48 | Image($r('app.media.setting_about_logo')) |
| 46 | .width('278lpx') | 49 | .width('278lpx') |
| 47 | .height('154lpx') | 50 | .height('154lpx') |
| @@ -197,7 +197,7 @@ export struct EmptyComponent { | @@ -197,7 +197,7 @@ export struct EmptyComponent { | ||
| 197 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoNetwork) { | 197 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoNetwork) { |
| 198 | contentString = '网络出小差了,请检查网络后重试' | 198 | contentString = '网络出小差了,请检查网络后重试' |
| 199 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_ContentFailed) { | 199 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_ContentFailed) { |
| 200 | - contentString = '获取内容失败请重试' | 200 | + contentString = '获取内容失败,请重试' |
| 201 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoCreation) { | 201 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoCreation) { |
| 202 | contentString = '暂无作品' | 202 | contentString = '暂无作品' |
| 203 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoBooking) { | 203 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoBooking) { |
| 1 | +@CustomDialog | ||
| 2 | +export struct MergeRecordDialog { | ||
| 3 | + controller: CustomDialogController | ||
| 4 | + cancel: () => void = () => { | ||
| 5 | + } | ||
| 6 | + confirm: () => void = () => { | ||
| 7 | + } | ||
| 8 | + | ||
| 9 | + build() { | ||
| 10 | + Column() { | ||
| 11 | + Text("合并游客记录到当前账号,可避免信息丢失") | ||
| 12 | + .fontColor("#222222") | ||
| 13 | + .fontSize(18) | ||
| 14 | + .width("100%") | ||
| 15 | + .fontWeight(FontWeight.Bold) | ||
| 16 | + .textAlign(TextAlign.Center) | ||
| 17 | + .margin({ top: 20 }) | ||
| 18 | + | ||
| 19 | + Divider().color("#999999").width("100%").margin({ top: 20 }).height('1vp') | ||
| 20 | + Row() { | ||
| 21 | + Text('取消') | ||
| 22 | + .fontSize(16) | ||
| 23 | + .fontColor("#648DF2") | ||
| 24 | + .layoutWeight(1) | ||
| 25 | + .fontWeight(FontWeight.Medium) | ||
| 26 | + .textAlign(TextAlign.Center) | ||
| 27 | + .onClick(() => { | ||
| 28 | + this.controller.close() | ||
| 29 | + if (this.cancel) { | ||
| 30 | + this.cancel() | ||
| 31 | + } | ||
| 32 | + | ||
| 33 | + }) | ||
| 34 | + .height('100%') | ||
| 35 | + // Divider().color("#999999").height('100%').width('0.5vp') | ||
| 36 | + Text('一键合并') | ||
| 37 | + .fontSize(16) | ||
| 38 | + .fontColor("#648DF2") | ||
| 39 | + .layoutWeight(1) | ||
| 40 | + .fontWeight(FontWeight.Medium) | ||
| 41 | + .textAlign(TextAlign.Center) | ||
| 42 | + .border({ | ||
| 43 | + width: { left: 1 }, | ||
| 44 | + color: "#999999", | ||
| 45 | + style: { left: BorderStyle.Solid } | ||
| 46 | + | ||
| 47 | + }) | ||
| 48 | + .onClick(() => { | ||
| 49 | + this.controller.close() | ||
| 50 | + if (this.confirm) { | ||
| 51 | + this.confirm() | ||
| 52 | + } | ||
| 53 | + }) | ||
| 54 | + .height('100%') | ||
| 55 | + }.layoutWeight(1).justifyContent(FlexAlign.Center) | ||
| 56 | + }.height(140).backgroundColor(Color.White).borderRadius(10).width('74%') | ||
| 57 | + } | ||
| 58 | +} |
| @@ -4,7 +4,7 @@ import MinePageCreatorFunctionsItem from '../viewmodel/MinePageCreatorFunctionsI | @@ -4,7 +4,7 @@ import MinePageCreatorFunctionsItem from '../viewmodel/MinePageCreatorFunctionsI | ||
| 4 | import MinePageMoreFunctionModel from '../viewmodel/MinePageMoreFunctionModel'; | 4 | import MinePageMoreFunctionModel from '../viewmodel/MinePageMoreFunctionModel'; |
| 5 | import { HttpBizUtil, HttpUrlUtils, HttpUtils, ResponseDTO, WDHttp } from 'wdNetwork'; | 5 | import { HttpBizUtil, HttpUrlUtils, HttpUtils, ResponseDTO, WDHttp } from 'wdNetwork'; |
| 6 | import { MineAppointmentListItem } from '../viewmodel/MineAppointmentListItem'; | 6 | import { MineAppointmentListItem } from '../viewmodel/MineAppointmentListItem'; |
| 7 | -import { Logger, StringUtils, EmitterUtils, EmitterEventId } from 'wdKit'; | 7 | +import { Logger, StringUtils, EmitterUtils, EmitterEventId, SPHelper } from 'wdKit'; |
| 8 | import { MineFollowListDetailItem } from '../viewmodel/MineFollowListDetailItem'; | 8 | import { MineFollowListDetailItem } from '../viewmodel/MineFollowListDetailItem'; |
| 9 | import { FollowListDetailRequestItem } from '../viewmodel/FollowListDetailRequestItem'; | 9 | import { FollowListDetailRequestItem } from '../viewmodel/FollowListDetailRequestItem'; |
| 10 | import { FollowListItem } from '../viewmodel/FollowListItem'; | 10 | import { FollowListItem } from '../viewmodel/FollowListItem'; |
| @@ -22,6 +22,7 @@ import { UserFollowListRequestItem } from '../viewmodel/UserFollowListRequestIte | @@ -22,6 +22,7 @@ import { UserFollowListRequestItem } from '../viewmodel/UserFollowListRequestIte | ||
| 22 | import { AppointmentOperationRequestItem } from '../viewmodel/AppointmentOperationRequestItem'; | 22 | import { AppointmentOperationRequestItem } from '../viewmodel/AppointmentOperationRequestItem'; |
| 23 | import { CommentLikeOperationRequestItem } from '../viewmodel/CommentLikeOperationRequestItem'; | 23 | import { CommentLikeOperationRequestItem } from '../viewmodel/CommentLikeOperationRequestItem'; |
| 24 | import { FollowOperationRequestItem } from '../viewmodel/FollowOperationRequestItem'; | 24 | import { FollowOperationRequestItem } from '../viewmodel/FollowOperationRequestItem'; |
| 25 | +import { SpConstants } from 'wdConstant/Index'; | ||
| 25 | 26 | ||
| 26 | const TAG = "MinePageDatasModel" | 27 | const TAG = "MinePageDatasModel" |
| 27 | 28 | ||
| @@ -559,7 +560,26 @@ class MinePageDatasModel{ | @@ -559,7 +560,26 @@ class MinePageDatasModel{ | ||
| 559 | return WDHttp.post<ResponseDTO>(url,object) | 560 | return WDHttp.post<ResponseDTO>(url,object) |
| 560 | }; | 561 | }; |
| 561 | 562 | ||
| 562 | - | 563 | + visitorMergeComment() { |
| 564 | + let bean: Record<string, string> = {}; | ||
| 565 | + bean['time'] = SPHelper.default.getSync(SpConstants.FIRSTCOMMENTTIME, "") as string | ||
| 566 | + bean['deviceId'] = HttpUtils.getDeviceId(); | ||
| 567 | + return new Promise<object>((success, error) => { | ||
| 568 | + // Logger.info(TAG, `visitorMergeComment`); | ||
| 569 | + HttpBizUtil.post<ResponseDTO<object>>(HttpUrlUtils.visitorMergeComment(), bean).then((data: ResponseDTO<object>) => { | ||
| 570 | + if (!data) { | ||
| 571 | + error() | ||
| 572 | + } | ||
| 573 | + if (data.code != 0) { | ||
| 574 | + error() | ||
| 575 | + } | ||
| 576 | + SPHelper.default.save(SpConstants.FIRSTCOMMENTTIME, "") | ||
| 577 | + success(data) | ||
| 578 | + }).catch(() => { | ||
| 579 | + error() | ||
| 580 | + }) | ||
| 581 | + }) | ||
| 582 | + } | ||
| 563 | } | 583 | } |
| 564 | 584 | ||
| 565 | const minePageDatasModel = MinePageDatasModel.getInstance() | 585 | const minePageDatasModel = MinePageDatasModel.getInstance() |
| 1 | 1 | ||
| 2 | -import { Logger, SPHelper, UserDataLocal } from 'wdKit'; | 2 | +import { Logger, SPHelper, StringUtils, UserDataLocal } from 'wdKit'; |
| 3 | import { HttpUrlUtils, ResponseDTO, WDHttp } from 'wdNetwork'; | 3 | import { HttpUrlUtils, ResponseDTO, WDHttp } from 'wdNetwork'; |
| 4 | import { SearchHistoryItem } from '../viewmodel/SearchHistoryItem'; | 4 | import { SearchHistoryItem } from '../viewmodel/SearchHistoryItem'; |
| 5 | import { SearchHotContentItem } from '../viewmodel/SearchHotContentItem'; | 5 | import { SearchHotContentItem } from '../viewmodel/SearchHotContentItem'; |
| @@ -18,7 +18,7 @@ const TAG = "SearcherAboutDataModel" | @@ -18,7 +18,7 @@ const TAG = "SearcherAboutDataModel" | ||
| 18 | class SearcherAboutDataModel{ | 18 | class SearcherAboutDataModel{ |
| 19 | private static instance: SearcherAboutDataModel; | 19 | private static instance: SearcherAboutDataModel; |
| 20 | public searchHistoryData:SearchHistoryItem[] = [] | 20 | public searchHistoryData:SearchHistoryItem[] = [] |
| 21 | - public SEARCH_HISTORY_KEY:string = "SEARCH_HISTORY_KEY" + UserDataLocal.getUserId() | 21 | + public SEARCH_HISTORY_KEY:string = "SEARCH_HISTORY_KEY" |
| 22 | 22 | ||
| 23 | private constructor() { } | 23 | private constructor() { } |
| 24 | 24 | ||
| @@ -37,7 +37,7 @@ class SearcherAboutDataModel{ | @@ -37,7 +37,7 @@ class SearcherAboutDataModel{ | ||
| 37 | * 插入搜索记录(单个) | 37 | * 插入搜索记录(单个) |
| 38 | */ | 38 | */ |
| 39 | public async putSearchHistoryData(content:string){ | 39 | public async putSearchHistoryData(content:string){ |
| 40 | - let history = SPHelper.default.getSync(this.SEARCH_HISTORY_KEY,"[]") as string | 40 | + let history = SPHelper.default.getSync(this.generationSearchKey(),"[]") as string |
| 41 | this.searchHistoryData = JSON.parse(history) | 41 | this.searchHistoryData = JSON.parse(history) |
| 42 | this.searchHistoryData.forEach((element,index) => { | 42 | this.searchHistoryData.forEach((element,index) => { |
| 43 | if (element.searchContent == content) { | 43 | if (element.searchContent == content) { |
| @@ -45,14 +45,14 @@ class SearcherAboutDataModel{ | @@ -45,14 +45,14 @@ class SearcherAboutDataModel{ | ||
| 45 | } | 45 | } |
| 46 | }); | 46 | }); |
| 47 | this.searchHistoryData.splice(0,0,new SearchHistoryItem(content)) | 47 | this.searchHistoryData.splice(0,0,new SearchHistoryItem(content)) |
| 48 | - await SPHelper.default.saveSync(this.SEARCH_HISTORY_KEY, JSON.stringify(this.searchHistoryData)); | 48 | + await SPHelper.default.saveSync(this.generationSearchKey(), JSON.stringify(this.searchHistoryData)); |
| 49 | } | 49 | } |
| 50 | 50 | ||
| 51 | /** | 51 | /** |
| 52 | * 删除搜索记录(所有) | 52 | * 删除搜索记录(所有) |
| 53 | */ | 53 | */ |
| 54 | public async delSearchHistoryData(){ | 54 | public async delSearchHistoryData(){ |
| 55 | - SPHelper.default.deleteSync(this.SEARCH_HISTORY_KEY) | 55 | + SPHelper.default.deleteSync(this.generationSearchKey()) |
| 56 | this.searchHistoryData = [] | 56 | this.searchHistoryData = [] |
| 57 | } | 57 | } |
| 58 | /** | 58 | /** |
| @@ -62,11 +62,11 @@ class SearcherAboutDataModel{ | @@ -62,11 +62,11 @@ class SearcherAboutDataModel{ | ||
| 62 | if(this.searchHistoryData!=null && this.searchHistoryData.length>0){ | 62 | if(this.searchHistoryData!=null && this.searchHistoryData.length>0){ |
| 63 | this.searchHistoryData.splice(index,1) | 63 | this.searchHistoryData.splice(index,1) |
| 64 | }else{ | 64 | }else{ |
| 65 | - let history = SPHelper.default.getSync(this.SEARCH_HISTORY_KEY,"[]") as string | 65 | + let history = SPHelper.default.getSync(this.generationSearchKey(),"[]") as string |
| 66 | this.searchHistoryData = JSON.parse(history) | 66 | this.searchHistoryData = JSON.parse(history) |
| 67 | this.searchHistoryData.splice(index,1) | 67 | this.searchHistoryData.splice(index,1) |
| 68 | } | 68 | } |
| 69 | - SPHelper.default.saveSync(this.SEARCH_HISTORY_KEY, JSON.stringify(this.searchHistoryData)) | 69 | + SPHelper.default.saveSync(this.generationSearchKey(), JSON.stringify(this.searchHistoryData)) |
| 70 | } | 70 | } |
| 71 | 71 | ||
| 72 | /** | 72 | /** |
| @@ -79,7 +79,7 @@ class SearcherAboutDataModel{ | @@ -79,7 +79,7 @@ class SearcherAboutDataModel{ | ||
| 79 | } | 79 | } |
| 80 | return this.searchHistoryData | 80 | return this.searchHistoryData |
| 81 | } | 81 | } |
| 82 | - let history = SPHelper.default.getSync(this.SEARCH_HISTORY_KEY,"[]") as string | 82 | + let history = SPHelper.default.getSync(this.generationSearchKey(),"[]") as string |
| 83 | 83 | ||
| 84 | this.searchHistoryData = JSON.parse(history) | 84 | this.searchHistoryData = JSON.parse(history) |
| 85 | if(this.searchHistoryData.length>10){ | 85 | if(this.searchHistoryData.length>10){ |
| @@ -91,6 +91,15 @@ class SearcherAboutDataModel{ | @@ -91,6 +91,15 @@ class SearcherAboutDataModel{ | ||
| 91 | return this.searchHistoryData | 91 | return this.searchHistoryData |
| 92 | } | 92 | } |
| 93 | 93 | ||
| 94 | + public generationSearchKey():string{ | ||
| 95 | + let userId = UserDataLocal.getUserId() | ||
| 96 | + if(StringUtils.isEmpty(userId)){ | ||
| 97 | + return this.SEARCH_HISTORY_KEY + "_" + "0000111122223333" | ||
| 98 | + }else{ | ||
| 99 | + return this.SEARCH_HISTORY_KEY + "_" + userId | ||
| 100 | + } | ||
| 101 | + } | ||
| 102 | + | ||
| 94 | /** | 103 | /** |
| 95 | * 首页 搜索提示滚动内容 | 104 | * 首页 搜索提示滚动内容 |
| 96 | */ | 105 | */ |
| @@ -34,7 +34,7 @@ export class RefreshConstants { | @@ -34,7 +34,7 @@ export class RefreshConstants { | ||
| 34 | /** | 34 | /** |
| 35 | * The refresh and load height. | 35 | * The refresh and load height. |
| 36 | */ | 36 | */ |
| 37 | - static readonly CUSTOM_LAYOUT_HEIGHT: number = 90; | 37 | + static readonly CUSTOM_LAYOUT_HEIGHT: number = 80; |
| 38 | /** | 38 | /** |
| 39 | * Full the width. | 39 | * Full the width. |
| 40 | */ | 40 | */ |
| @@ -52,7 +52,7 @@ export class PageHelper { | @@ -52,7 +52,7 @@ export class PageHelper { | ||
| 52 | PageViewModel.getPageInfo(pageModel.pageId).then(pageInfo => { | 52 | PageViewModel.getPageInfo(pageModel.pageId).then(pageInfo => { |
| 53 | if (pageInfo == null) { | 53 | if (pageInfo == null) { |
| 54 | pageModel.viewType = ViewType.EMPTY; | 54 | pageModel.viewType = ViewType.EMPTY; |
| 55 | - pageModel.emptyType = WDViewDefaultType.WDViewDefaultType_NoListContent; | 55 | + pageModel.emptyType = WDViewDefaultType.WDViewDefaultType_NoContent1; |
| 56 | return; | 56 | return; |
| 57 | } | 57 | } |
| 58 | pageModel.pageInfo = pageInfo; | 58 | pageModel.pageInfo = pageInfo; |
| @@ -94,7 +94,7 @@ export class PageHelper { | @@ -94,7 +94,7 @@ export class PageHelper { | ||
| 94 | // 没数据,展示空页面 | 94 | // 没数据,展示空页面 |
| 95 | Logger.debug(TAG, 'aboutToAppear, data response page ' + pageModel.pageId + ', comp list is empty.'); | 95 | Logger.debug(TAG, 'aboutToAppear, data response page ' + pageModel.pageId + ', comp list is empty.'); |
| 96 | pageModel.viewType = ViewType.EMPTY; | 96 | pageModel.viewType = ViewType.EMPTY; |
| 97 | - pageModel.emptyType = WDViewDefaultType.WDViewDefaultType_NoListContent; | 97 | + pageModel.emptyType = WDViewDefaultType.WDViewDefaultType_NoContent1; |
| 98 | 98 | ||
| 99 | } | 99 | } |
| 100 | } | 100 | } |
| 1 | +<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="9" height="6" viewBox="0 0 9 6"><g><g><path d="M2.63066,0.5L7.79156,0.5C8.13703,0.5,8.3784,0.8420000000000001,8.26266,1.167505L6.84044,5.1675C6.76957,5.36684,6.5809,5.5,6.36934,5.5L1.208442,5.5C0.862974,5.5,0.6216,5.158,0.737335,4.8325L2.15956,0.832495C2.23043,0.633155,2.4191000000000003,0.5,2.63066,0.5" fill-rule="evenodd" fill="#ED2800" fill-opacity="1"/></g></g></svg> |
| @@ -60,7 +60,7 @@ export class LoginModel { | @@ -60,7 +60,7 @@ export class LoginModel { | ||
| 60 | let bean: Record<string, Object> = {}; | 60 | let bean: Record<string, Object> = {}; |
| 61 | bean['phone'] = phone | 61 | bean['phone'] = phone |
| 62 | bean['loginType'] = loginType | 62 | bean['loginType'] = loginType |
| 63 | - bean['deviceId'] = '60da5af6-9c59-3566-8622-8c6c00710994' | 63 | + bean['deviceId'] = HttpUtils.getDeviceId() |
| 64 | bean['verificationCode'] = verificationCode | 64 | bean['verificationCode'] = verificationCode |
| 65 | return new Promise<LoginBean>((success, fail) => { | 65 | return new Promise<LoginBean>((success, fail) => { |
| 66 | HttpRequest.post<ResponseDTO<LoginBean>>(HttpUrlUtils.getAppLoginUrl(), bean).then((data: ResponseDTO<LoginBean>) => { | 66 | HttpRequest.post<ResponseDTO<LoginBean>>(HttpUrlUtils.getAppLoginUrl(), bean).then((data: ResponseDTO<LoginBean>) => { |
| @@ -90,7 +90,7 @@ export class LoginModel { | @@ -90,7 +90,7 @@ export class LoginModel { | ||
| 90 | bean['userName'] = phone | 90 | bean['userName'] = phone |
| 91 | } | 91 | } |
| 92 | bean['loginType'] = loginType | 92 | bean['loginType'] = loginType |
| 93 | - bean['deviceId'] = '60da5af6-9c59-3566-8622-8c6c00710994' | 93 | + bean['deviceId'] = HttpUtils.getDeviceId() |
| 94 | bean['password'] = password | 94 | bean['password'] = password |
| 95 | bean['oldPassword'] = oldPassword | 95 | bean['oldPassword'] = oldPassword |
| 96 | return new Promise<LoginBean>((success, fail) => { | 96 | return new Promise<LoginBean>((success, fail) => { |
| 1 | import { Logger } from 'wdKit/src/main/ets/utils/Logger' | 1 | import { Logger } from 'wdKit/src/main/ets/utils/Logger' |
| 2 | import { LoginModel } from './LoginModel' | 2 | import { LoginModel } from './LoginModel' |
| 3 | import { LoginBean } from './LoginBean' | 3 | import { LoginBean } from './LoginBean' |
| 4 | -import { SPHelper, StringUtils } from 'wdKit' | 4 | +import { SPHelper, StringUtils, UserDataLocal } from 'wdKit' |
| 5 | import { CheckVerifyBean } from './CheckVerifyBean' | 5 | import { CheckVerifyBean } from './CheckVerifyBean' |
| 6 | import cryptoFramework from '@ohos.security.cryptoFramework' | 6 | import cryptoFramework from '@ohos.security.cryptoFramework' |
| 7 | import buffer from '@ohos.buffer' | 7 | import buffer from '@ohos.buffer' |
| @@ -157,6 +157,7 @@ export class LoginViewModel { | @@ -157,6 +157,7 @@ export class LoginViewModel { | ||
| 157 | SPHelper.default.saveSync(SpConstants.USER_STATUS, '') | 157 | SPHelper.default.saveSync(SpConstants.USER_STATUS, '') |
| 158 | SPHelper.default.saveSync(SpConstants.USER_Type, '') | 158 | SPHelper.default.saveSync(SpConstants.USER_Type, '') |
| 159 | SPHelper.default.saveSync(SpConstants.USER_NAME, '') | 159 | SPHelper.default.saveSync(SpConstants.USER_NAME, '') |
| 160 | + UserDataLocal.clearUserData() | ||
| 160 | success(data) | 161 | success(data) |
| 161 | }).catch((message: string) => { | 162 | }).catch((message: string) => { |
| 162 | fail(message) | 163 | fail(message) |
| @@ -3,8 +3,9 @@ import { WdWebComponent } from 'wdWebComponent'; | @@ -3,8 +3,9 @@ import { WdWebComponent } from 'wdWebComponent'; | ||
| 3 | import router from '@ohos.router'; | 3 | import router from '@ohos.router'; |
| 4 | import { CommonConstants } from 'wdConstant' | 4 | import { CommonConstants } from 'wdConstant' |
| 5 | import { BridgeWebViewControl } from 'wdJsBridge'; | 5 | import { BridgeWebViewControl } from 'wdJsBridge'; |
| 6 | -import { detailedSkeleton } from 'wdComponent/src/main/ets/components/skeleton/detailSkeleton' | 6 | + |
| 7 | const TAG = 'DefaultWebPage' | 7 | const TAG = 'DefaultWebPage' |
| 8 | + | ||
| 8 | @Entry | 9 | @Entry |
| 9 | @Component | 10 | @Component |
| 10 | struct DefaultWebPage { | 11 | struct DefaultWebPage { |
| @@ -16,9 +17,6 @@ struct DefaultWebPage { | @@ -16,9 +17,6 @@ struct DefaultWebPage { | ||
| 16 | 17 | ||
| 17 | build() { | 18 | build() { |
| 18 | Column() { | 19 | Column() { |
| 19 | - if (!this.isPageEnd) { | ||
| 20 | - detailedSkeleton() | ||
| 21 | - } | ||
| 22 | Stack({ alignContent: Alignment.Bottom }) { | 20 | Stack({ alignContent: Alignment.Bottom }) { |
| 23 | Column() { | 21 | Column() { |
| 24 | WdWebComponent({ | 22 | WdWebComponent({ |
-
Please register or login to post a comment