Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool into main
* 'main' of http://192.168.1.42/developOne/harmonyPool: fix:somebug feat: 18108 搜索结果-图集卡封面图加载不出 fix:somebug fix:somebug uat】 进入竖屏直播-竖屏流-评论预显示静止-默哀,默哀图标显示未爱心,预期默哀 feat: 17910 【全域规则】频道-外部卡片日期展示规则与需求不一致 desc:埋点[注销账号页面 - 页面浏览,普通按钮] fix:somebug fix(埋点):动态详情页/版面页/意见反馈页页面浏览埋点 解决【18014 UI还原问题-【uat】底部导航-选中视频频道后,图标变成白色。看图】 desc:埋点[更换手机号页 - 页面浏览,登录按钮点击] desc:抽离 更换手机号为单独page desc:埋点[修改密码 - 登录按钮点击] fix:somebug fix(意见反馈):UI调整 fix:somebug fix(17431):电子报-版面,无网络时,点击读报纸,提示信息错误、提示位置不对,不应该提示暂无数据、提示位置应该居中展示 人民号主页下文章详情页,视频详情页,动态详情页与图集详情页均无法收藏 精选评论通顶通底 fix(17226):人民号图集稿件下的图片进行下载时鸿蒙与安卓的提示信息和弹出位置不一致
Showing
44 changed files
with
627 additions
and
135 deletions
| @@ -68,6 +68,7 @@ export class WDRouterPage { | @@ -68,6 +68,7 @@ export class WDRouterPage { | ||
| 68 | static loginPage = new WDRouterPage("wdLogin", "ets/pages/login/LoginPage"); | 68 | static loginPage = new WDRouterPage("wdLogin", "ets/pages/login/LoginPage"); |
| 69 | static oneKeyLoginPage = new WDRouterPage("wdLogin", "ets/pages/login/OneKeyLoginPage"); | 69 | static oneKeyLoginPage = new WDRouterPage("wdLogin", "ets/pages/login/OneKeyLoginPage"); |
| 70 | static forgetPasswordPage = new WDRouterPage("wdLogin", "ets/pages/login/ForgetPasswordPage"); | 70 | static forgetPasswordPage = new WDRouterPage("wdLogin", "ets/pages/login/ForgetPasswordPage"); |
| 71 | + static changeBindPhonePage = new WDRouterPage("wdLogin", "ets/pages/login/ChangeBindPhonePage"); | ||
| 71 | static modifyPasswordPage = new WDRouterPage("wdLogin", "ets/pages/login/ModifyPasswordPage"); | 72 | static modifyPasswordPage = new WDRouterPage("wdLogin", "ets/pages/login/ModifyPasswordPage"); |
| 72 | //我的 预约 | 73 | //我的 预约 |
| 73 | static appointmentListPage = new WDRouterPage("wdComponent", "ets/components/page/AppointmentListPage"); | 74 | static appointmentListPage = new WDRouterPage("wdComponent", "ets/components/page/AppointmentListPage"); |
| @@ -11,7 +11,8 @@ import { LiveRoomDataBean } from '../live/LiveRoomDataBean'; | @@ -11,7 +11,8 @@ import { LiveRoomDataBean } from '../live/LiveRoomDataBean'; | ||
| 11 | 11 | ||
| 12 | @Observed | 12 | @Observed |
| 13 | export class ContentDTO implements BaseDTO { | 13 | export class ContentDTO implements BaseDTO { |
| 14 | - seoTags?:string; | 14 | + seoTags: string = ''; |
| 15 | + cornerMark:string = ''; | ||
| 15 | liveType?: string; // 直播新闻-直播状态 | 16 | liveType?: string; // 直播新闻-直播状态 |
| 16 | expIds: string = ''; | 17 | expIds: string = ''; |
| 17 | itemId: string = ''; | 18 | itemId: string = ''; |
| @@ -158,6 +159,7 @@ export class ContentDTO implements BaseDTO { | @@ -158,6 +159,7 @@ export class ContentDTO implements BaseDTO { | ||
| 158 | content.rmhInfo = old.rmhInfo; | 159 | content.rmhInfo = old.rmhInfo; |
| 159 | content.photoNum = old.photoNum; | 160 | content.photoNum = old.photoNum; |
| 160 | content.corner = old.corner; | 161 | content.corner = old.corner; |
| 162 | + content.cornerMark = old.cornerMark; | ||
| 161 | content.rmhPlatform = old.rmhPlatform; | 163 | content.rmhPlatform = old.rmhPlatform; |
| 162 | content.newTags = old.newTags; | 164 | content.newTags = old.newTags; |
| 163 | content.titleShow = old.titleShow; | 165 | content.titleShow = old.titleShow; |
| @@ -751,7 +751,7 @@ export struct DynamicDetailComponent { | @@ -751,7 +751,7 @@ export struct DynamicDetailComponent { | ||
| 751 | return | 751 | return |
| 752 | } | 752 | } |
| 753 | const params: postExecuteLikeParams = { | 753 | const params: postExecuteLikeParams = { |
| 754 | - status: this.newsStatusOfUser?.likeStatus === '1' ? '0' : '1', | 754 | + status: this.newsStatusOfUser?.likeStatus === '1' ? 0 : 1, |
| 755 | contentId: this.contentDetailData?.newsId + '', | 755 | contentId: this.contentDetailData?.newsId + '', |
| 756 | contentType: this.contentDetailData?.newsType + '', | 756 | contentType: this.contentDetailData?.newsType + '', |
| 757 | } | 757 | } |
| @@ -10,6 +10,7 @@ import { ENewspaperPageDialog } from '../dialog/ENewspaperPageDialog'; | @@ -10,6 +10,7 @@ import { ENewspaperPageDialog } from '../dialog/ENewspaperPageDialog'; | ||
| 10 | import { RMCalendarBean } from './calendar/RMCalendarBean'; | 10 | import { RMCalendarBean } from './calendar/RMCalendarBean'; |
| 11 | import { newsSkeleton } from './skeleton/newsSkeleton'; | 11 | import { newsSkeleton } from './skeleton/newsSkeleton'; |
| 12 | import { Logger, ToastUtils, NetworkUtil } from 'wdKit/Index'; | 12 | import { Logger, ToastUtils, NetworkUtil } from 'wdKit/Index'; |
| 13 | +import { promptAction } from '@kit.ArkUI'; | ||
| 13 | 14 | ||
| 14 | @Component | 15 | @Component |
| 15 | export struct ENewspaperPageComponent { | 16 | export struct ENewspaperPageComponent { |
| @@ -270,6 +271,10 @@ export struct ENewspaperPageComponent { | @@ -270,6 +271,10 @@ export struct ENewspaperPageComponent { | ||
| 270 | }) | 271 | }) |
| 271 | .id('e_newspaper_page_num') | 272 | .id('e_newspaper_page_num') |
| 272 | .onClick((event: ClickEvent) => { | 273 | .onClick((event: ClickEvent) => { |
| 274 | + if(!NetworkUtil.isNetConnected()){ | ||
| 275 | + ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000) | ||
| 276 | + return | ||
| 277 | + } | ||
| 273 | if (this.newspaperListBean.list && this.newspaperListBean.list.length > 0) { | 278 | if (this.newspaperListBean.list && this.newspaperListBean.list.length > 0) { |
| 274 | this.pageDialogShow = !this.pageDialogShow | 279 | this.pageDialogShow = !this.pageDialogShow |
| 275 | if (this.pageDialogShow) { | 280 | if (this.pageDialogShow) { |
| @@ -305,6 +310,10 @@ export struct ENewspaperPageComponent { | @@ -305,6 +310,10 @@ export struct ENewspaperPageComponent { | ||
| 305 | }) | 310 | }) |
| 306 | .id('e_newspaper_read') | 311 | .id('e_newspaper_read') |
| 307 | .onClick((event: ClickEvent) => { | 312 | .onClick((event: ClickEvent) => { |
| 313 | + if(!NetworkUtil.isNetConnected()){ | ||
| 314 | + ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000) | ||
| 315 | + return | ||
| 316 | + } | ||
| 308 | if (this.newspaperListBean.list && this.newspaperListBean.list.length > 0) { | 317 | if (this.newspaperListBean.list && this.newspaperListBean.list.length > 0) { |
| 309 | this.isOpenListDialog = true | 318 | this.isOpenListDialog = true |
| 310 | }else { | 319 | }else { |
| 1 | import { FeedBackParams, FeedbackTypeBean, PhotoListBean } from 'wdBean/Index'; | 1 | import { FeedBackParams, FeedbackTypeBean, PhotoListBean } from 'wdBean/Index'; |
| 2 | import { AppUtils, | 2 | import { AppUtils, |
| 3 | + DateTimeUtils, | ||
| 3 | DeviceUtil, | 4 | DeviceUtil, |
| 4 | FastClickUtil, Logger, NetworkUtil, StringUtils, ToastUtils, UserDataLocal } from 'wdKit/Index'; | 5 | FastClickUtil, Logger, NetworkUtil, StringUtils, ToastUtils, UserDataLocal } from 'wdKit/Index'; |
| 5 | import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel'; | 6 | import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel'; |
| @@ -9,7 +10,7 @@ import { BusinessError } from '@kit.BasicServicesKit'; | @@ -9,7 +10,7 @@ import { BusinessError } from '@kit.BasicServicesKit'; | ||
| 9 | import { router } from '@kit.ArkUI'; | 10 | import { router } from '@kit.ArkUI'; |
| 10 | import { CommonConstants } from 'wdConstant/Index'; | 11 | import { CommonConstants } from 'wdConstant/Index'; |
| 11 | import { ProcessUtils } from 'wdRouter/Index'; | 12 | import { ProcessUtils } from 'wdRouter/Index'; |
| 12 | -import { HashMap } from '@kit.ArkTS'; | 13 | +import { TrackingPageBrowse } from 'wdTracking/Index'; |
| 13 | 14 | ||
| 14 | const TAG = 'FeedBackActivity' | 15 | const TAG = 'FeedBackActivity' |
| 15 | 16 | ||
| @@ -20,6 +21,9 @@ const TAG = 'FeedBackActivity' | @@ -20,6 +21,9 @@ const TAG = 'FeedBackActivity' | ||
| 20 | @Entry | 21 | @Entry |
| 21 | @Component | 22 | @Component |
| 22 | export struct FeedBackActivity { | 23 | export struct FeedBackActivity { |
| 24 | + pageShowTime:number = 0; | ||
| 25 | + pageId:string = 'feedbackPage'; | ||
| 26 | + pageName:string=this.pageId; | ||
| 23 | @State canSubmit: boolean = false; | 27 | @State canSubmit: boolean = false; |
| 24 | @State textNumLabel: string = '0/500'; | 28 | @State textNumLabel: string = '0/500'; |
| 25 | contact: string = ""; | 29 | contact: string = ""; |
| @@ -50,7 +54,7 @@ export struct FeedBackActivity { | @@ -50,7 +54,7 @@ export struct FeedBackActivity { | ||
| 50 | .fontSize($r('app.float.font_size_16')) | 54 | .fontSize($r('app.float.font_size_16')) |
| 51 | .fontWeight(FontWeight.Bold) | 55 | .fontWeight(FontWeight.Bold) |
| 52 | .width('100%') | 56 | .width('100%') |
| 53 | - .margin({ left: $r('app.float.vp_15'), top: $r('app.float.vp_14') }) | 57 | + .margin({ left: 24, top: $r('app.float.vp_14') }) |
| 54 | GridRow({ | 58 | GridRow({ |
| 55 | columns:3, | 59 | columns:3, |
| 56 | }) { | 60 | }) { |
| @@ -75,7 +79,7 @@ export struct FeedBackActivity { | @@ -75,7 +79,7 @@ export struct FeedBackActivity { | ||
| 75 | } | 79 | } |
| 76 | }) | 80 | }) |
| 77 | } | 81 | } |
| 78 | - .width('100%') | 82 | + .width('94%') |
| 79 | .margin({top:$r('app.float.vp_16')}) | 83 | .margin({top:$r('app.float.vp_16')}) |
| 80 | Blank() | 84 | Blank() |
| 81 | .height($r('app.float.margin_5')) | 85 | .height($r('app.float.margin_5')) |
| @@ -85,7 +89,7 @@ export struct FeedBackActivity { | @@ -85,7 +89,7 @@ export struct FeedBackActivity { | ||
| 85 | .fontSize($r('app.float.font_size_16')) | 89 | .fontSize($r('app.float.font_size_16')) |
| 86 | .fontWeight(FontWeight.Bold) | 90 | .fontWeight(FontWeight.Bold) |
| 87 | .width(CommonConstants.FULL_WIDTH) | 91 | .width(CommonConstants.FULL_WIDTH) |
| 88 | - .margin({ left: $r('app.float.vp_16'), top: $r('app.float.vp_12') }) | 92 | + .margin({ left: 24, top: $r('app.float.vp_12') }) |
| 89 | Stack({ alignContent: Alignment.BottomEnd }) { | 93 | Stack({ alignContent: Alignment.BottomEnd }) { |
| 90 | TextArea({ placeholder: $r('app.string.feedback_comments') }) | 94 | TextArea({ placeholder: $r('app.string.feedback_comments') }) |
| 91 | .width(CommonConstants.FULL_WIDTH) | 95 | .width(CommonConstants.FULL_WIDTH) |
| @@ -165,7 +169,7 @@ export struct FeedBackActivity { | @@ -165,7 +169,7 @@ export struct FeedBackActivity { | ||
| 165 | .margin({bottom: $r('app.float.vp_12'), right: $r('app.float.vp_11')}) | 169 | .margin({bottom: $r('app.float.vp_12'), right: $r('app.float.vp_11')}) |
| 166 | } | 170 | } |
| 167 | .height(200) | 171 | .height(200) |
| 168 | - .width('90%') | 172 | + .width('94%') |
| 169 | .margin({ top: $r('app.float.vp_12') }) | 173 | .margin({ top: $r('app.float.vp_12') }) |
| 170 | .backgroundColor($r('app.color.color_F5F5F5')) | 174 | .backgroundColor($r('app.color.color_F5F5F5')) |
| 171 | .borderRadius(4) | 175 | .borderRadius(4) |
| @@ -176,9 +180,8 @@ export struct FeedBackActivity { | @@ -176,9 +180,8 @@ export struct FeedBackActivity { | ||
| 176 | Text($r('app.string.feedback_email')) | 180 | Text($r('app.string.feedback_email')) |
| 177 | .fontColor($r('app.color.color_222222')) | 181 | .fontColor($r('app.color.color_222222')) |
| 178 | .fontSize($r('app.float.font_size_14')) | 182 | .fontSize($r('app.float.font_size_14')) |
| 179 | - .fontWeight(FontWeight.Bold) | ||
| 180 | - .width('100%') | ||
| 181 | - .margin({ left: $r('app.float.vp_16'), top: $r('app.float.margin_24') }) | 183 | + .width('94%') |
| 184 | + .margin({ top: $r('app.float.margin_24') }) | ||
| 182 | Row() { | 185 | Row() { |
| 183 | Text($r('app.string.feedback_mail')) | 186 | Text($r('app.string.feedback_mail')) |
| 184 | .fontColor($r('app.color.color_222222')) | 187 | .fontColor($r('app.color.color_222222')) |
| @@ -187,6 +190,7 @@ export struct FeedBackActivity { | @@ -187,6 +190,7 @@ export struct FeedBackActivity { | ||
| 187 | TextInput({ placeholder: $r('app.string.feedback_hideemail') }) | 190 | TextInput({ placeholder: $r('app.string.feedback_hideemail') }) |
| 188 | .width(CommonConstants.FULL_WIDTH) | 191 | .width(CommonConstants.FULL_WIDTH) |
| 189 | .height(CommonConstants.FULL_HEIGHT) | 192 | .height(CommonConstants.FULL_HEIGHT) |
| 193 | + // .margin({left:15}) | ||
| 190 | .backgroundColor($r('app.color.color_F5F5F5')) | 194 | .backgroundColor($r('app.color.color_F5F5F5')) |
| 191 | .onChange((value) => { | 195 | .onChange((value) => { |
| 192 | // Logger.debug(TAG, "onChange" + value + "/" + this.passwordContent) | 196 | // Logger.debug(TAG, "onChange" + value + "/" + this.passwordContent) |
| @@ -194,7 +198,7 @@ export struct FeedBackActivity { | @@ -194,7 +198,7 @@ export struct FeedBackActivity { | ||
| 194 | }) | 198 | }) |
| 195 | } | 199 | } |
| 196 | .height(44) | 200 | .height(44) |
| 197 | - .width('90%') | 201 | + .width('94%') |
| 198 | .backgroundColor($r('app.color.color_F5F5F5')) | 202 | .backgroundColor($r('app.color.color_F5F5F5')) |
| 199 | .margin({top: $r('app.float.margin_16') }) | 203 | .margin({top: $r('app.float.margin_16') }) |
| 200 | .borderRadius(4) | 204 | .borderRadius(4) |
| @@ -380,4 +384,12 @@ export struct FeedBackActivity { | @@ -380,4 +384,12 @@ export struct FeedBackActivity { | ||
| 380 | } | 384 | } |
| 381 | } | 385 | } |
| 382 | 386 | ||
| 387 | + onPageShow() { | ||
| 388 | + this.pageShowTime = DateTimeUtils.getTimeStamp() | ||
| 389 | + } | ||
| 390 | + onPageHide() { | ||
| 391 | + //页面浏览 | ||
| 392 | + TrackingPageBrowse.trackCommonPageExposureEnd(this.pageId,this.pageName,Math.floor((DateTimeUtils.getTimeStamp() - this.pageShowTime)/1000)) | ||
| 393 | + | ||
| 394 | + } | ||
| 383 | } | 395 | } |
| @@ -24,6 +24,10 @@ export struct ImageDownloadComponent { | @@ -24,6 +24,10 @@ export struct ImageDownloadComponent { | ||
| 24 | 24 | ||
| 25 | build() { | 25 | build() { |
| 26 | Column() { | 26 | Column() { |
| 27 | + // Image($r('app.media.save_detail_img')) | ||
| 28 | + // .width(24) | ||
| 29 | + // .height(24) | ||
| 30 | + // .margin({bottom:6}) | ||
| 27 | SaveButton({ icon: SaveIconStyle.LINES }) | 31 | SaveButton({ icon: SaveIconStyle.LINES }) |
| 28 | .iconSize(24) | 32 | .iconSize(24) |
| 29 | .iconColor(Color.White) | 33 | .iconColor(Color.White) |
| @@ -33,7 +37,8 @@ export struct ImageDownloadComponent { | @@ -33,7 +37,8 @@ export struct ImageDownloadComponent { | ||
| 33 | await this.saveImage(this.imageBuffer); | 37 | await this.saveImage(this.imageBuffer); |
| 34 | promptAction.showToast({ | 38 | promptAction.showToast({ |
| 35 | message: $r('app.string.image_request_success'), | 39 | message: $r('app.string.image_request_success'), |
| 36 | - duration: 2000 | 40 | + duration: 2000, |
| 41 | + alignment:Alignment.Center | ||
| 37 | }) | 42 | }) |
| 38 | } | 43 | } |
| 39 | }) | 44 | }) |
| @@ -174,6 +174,7 @@ export struct CardMediaInfo { | @@ -174,6 +174,7 @@ export struct CardMediaInfo { | ||
| 174 | .mediaLogo() | 174 | .mediaLogo() |
| 175 | Text(`${this.contentDTO.photoNum}`) | 175 | Text(`${this.contentDTO.photoNum}`) |
| 176 | .mediaTextImgtype() | 176 | .mediaTextImgtype() |
| 177 | + .fontFamily('BebasNeue') | ||
| 177 | } | 178 | } |
| 178 | .margin({ left: 80,top: 55}) | 179 | .margin({ left: 80,top: 55}) |
| 179 | 180 |
| @@ -26,14 +26,11 @@ export struct CardSourceInfo { | @@ -26,14 +26,11 @@ export struct CardSourceInfo { | ||
| 26 | let flag: boolean = false; | 26 | let flag: boolean = false; |
| 27 | if (curRouter === 'MainPage') { | 27 | if (curRouter === 'MainPage') { |
| 28 | if (this.isTwoDaysAgo(publishTime)) { | 28 | if (this.isTwoDaysAgo(publishTime)) { |
| 29 | - console.log('curRouter 01') | ||
| 30 | flag = false | 29 | flag = false |
| 31 | } else { | 30 | } else { |
| 32 | - console.log('curRouter 02') | ||
| 33 | flag = true; | 31 | flag = true; |
| 34 | } | 32 | } |
| 35 | } else { | 33 | } else { |
| 36 | - console.log('curRouter 03') | ||
| 37 | flag = true; | 34 | flag = true; |
| 38 | } | 35 | } |
| 39 | return flag; | 36 | return flag; |
| @@ -54,6 +51,12 @@ export struct CardSourceInfo { | @@ -54,6 +51,12 @@ export struct CardSourceInfo { | ||
| 54 | .fontColor($r("app.color.color_ED2800")) | 51 | .fontColor($r("app.color.color_ED2800")) |
| 55 | .margin({ right: 2 }) | 52 | .margin({ right: 2 }) |
| 56 | } | 53 | } |
| 54 | + if(this.contentDTO.cornerMark){ | ||
| 55 | + Text(this.contentDTO.cornerMark) | ||
| 56 | + .fontSize($r("app.float.font_size_11")) | ||
| 57 | + .fontColor($r("app.color.color_ED2800")) | ||
| 58 | + .margin({ right: 2 }) | ||
| 59 | + } | ||
| 57 | if (this.contentDTO.rmhPlatform === 1) { | 60 | if (this.contentDTO.rmhPlatform === 1) { |
| 58 | Text(this.contentDTO.rmhInfo?.rmhName) | 61 | Text(this.contentDTO.rmhInfo?.rmhName) |
| 59 | .fontSize($r("app.float.font_size_11")) | 62 | .fontSize($r("app.float.font_size_11")) |
| @@ -91,15 +94,21 @@ export struct CardSourceInfo { | @@ -91,15 +94,21 @@ export struct CardSourceInfo { | ||
| 91 | // .fontColor($r("app.color.color_B0B0B0")) | 94 | // .fontColor($r("app.color.color_B0B0B0")) |
| 92 | // .flexShrink(0); | 95 | // .flexShrink(0); |
| 93 | // } | 96 | // } |
| 94 | - if (this.contentDTO.source && this.showTime()) { | 97 | + // if (this.contentDTO.source && this.showTime()) { |
| 98 | + // Text(this.handleTimeStr()) | ||
| 99 | + // .fontSize($r("app.float.font_size_11")) | ||
| 100 | + // .fontColor($r("app.color.color_B0B0B0")) | ||
| 101 | + // .flexShrink(0) | ||
| 102 | + // .margin({right: 4}) | ||
| 103 | + // } | ||
| 104 | + if (this.showTime()) { | ||
| 95 | Text(this.handleTimeStr()) | 105 | Text(this.handleTimeStr()) |
| 96 | .fontSize($r("app.float.font_size_11")) | 106 | .fontSize($r("app.float.font_size_11")) |
| 97 | .fontColor($r("app.color.color_B0B0B0")) | 107 | .fontColor($r("app.color.color_B0B0B0")) |
| 98 | .flexShrink(0) | 108 | .flexShrink(0) |
| 99 | .margin({right: 4}) | 109 | .margin({right: 4}) |
| 100 | } | 110 | } |
| 101 | - | ||
| 102 | - if (this.getContentDtoBean()?.interactData?.commentNum && this.contentDTO.source) { | 111 | + if (this.getContentDtoBean()?.interactData?.commentNum) { |
| 103 | Text(`${this.getContentDtoBean()?.interactData?.commentNum}评`) | 112 | Text(`${this.getContentDtoBean()?.interactData?.commentNum}评`) |
| 104 | .fontSize($r("app.float.font_size_11")) | 113 | .fontSize($r("app.float.font_size_11")) |
| 105 | .fontColor($r("app.color.color_B0B0B0")) | 114 | .fontColor($r("app.color.color_B0B0B0")) |
| @@ -107,6 +116,15 @@ export struct CardSourceInfo { | @@ -107,6 +116,15 @@ export struct CardSourceInfo { | ||
| 107 | .visibility(Number(this.getContentDtoBean()?.interactData?.commentNum) === 0 ? Visibility.None : | 116 | .visibility(Number(this.getContentDtoBean()?.interactData?.commentNum) === 0 ? Visibility.None : |
| 108 | Visibility.Visible) | 117 | Visibility.Visible) |
| 109 | } | 118 | } |
| 119 | + | ||
| 120 | + // if (this.getContentDtoBean()?.interactData?.commentNum && this.contentDTO.source) { | ||
| 121 | + // Text(`${this.getContentDtoBean()?.interactData?.commentNum}评`) | ||
| 122 | + // .fontSize($r("app.float.font_size_11")) | ||
| 123 | + // .fontColor($r("app.color.color_B0B0B0")) | ||
| 124 | + // .flexShrink(0) | ||
| 125 | + // .visibility(Number(this.getContentDtoBean()?.interactData?.commentNum) === 0 ? Visibility.None : | ||
| 126 | + // Visibility.Visible) | ||
| 127 | + // } | ||
| 110 | } | 128 | } |
| 111 | .width(CommonConstants.FULL_WIDTH) | 129 | .width(CommonConstants.FULL_WIDTH) |
| 112 | .margin({ top: 8 }) | 130 | .margin({ top: 8 }) |
| @@ -80,9 +80,8 @@ export struct RmhTitle { | @@ -80,9 +80,8 @@ export struct RmhTitle { | ||
| 80 | 80 | ||
| 81 | async aboutToAppear(): Promise<void> { | 81 | async aboutToAppear(): Promise<void> { |
| 82 | this.getBatchAttentionStatus() | 82 | this.getBatchAttentionStatus() |
| 83 | - | ||
| 84 | - let page = router.getState(); | ||
| 85 | - if (page.path.includes('/page/PeopleShipHomePage') || page.path.includes('/pages/MainPage')) { | 83 | + const curRouter = router.getState().name; |
| 84 | + if (curRouter === 'MainPage') { | ||
| 86 | this.hideTime = true; | 85 | this.hideTime = true; |
| 87 | } | 86 | } |
| 88 | 87 |
| @@ -27,6 +27,7 @@ export struct Card17Component { | @@ -27,6 +27,7 @@ export struct Card17Component { | ||
| 27 | @State str03: string = ''; | 27 | @State str03: string = ''; |
| 28 | 28 | ||
| 29 | async aboutToAppear(): Promise<void> { | 29 | async aboutToAppear(): Promise<void> { |
| 30 | + console.log('Card17Component', JSON.stringify(this.contentDTO)) | ||
| 30 | this.titleInit(); | 31 | this.titleInit(); |
| 31 | this.clicked = hasClicked(this.contentDTO.objectId) | 32 | this.clicked = hasClicked(this.contentDTO.objectId) |
| 32 | this.loadImg = await onlyWifiLoadImg(); | 33 | this.loadImg = await onlyWifiLoadImg(); |
| @@ -65,7 +66,7 @@ export struct Card17Component { | @@ -65,7 +66,7 @@ export struct Card17Component { | ||
| 65 | GridRow({ gutter: 2 }) { | 66 | GridRow({ gutter: 2 }) { |
| 66 | GridCol({ span: { xs: 8 } }) { | 67 | GridCol({ span: { xs: 8 } }) { |
| 67 | Image(this.loadImg ? | 68 | Image(this.loadImg ? |
| 68 | - this.contentDTO.fullColumnImgUrls.length > 0 ? this.contentDTO.fullColumnImgUrls[0].url : '' : '') | 69 | + this.contentDTO.fullColumnImgUrls.length > 0 ? this.contentDTO.fullColumnImgUrls[0].url || this.contentDTO.fullColumnImgUrls[0].fullUrl : '' : '') |
| 69 | .backgroundColor(this.loadImg ? '#f5f5f5' : 0xf5f5f5) | 70 | .backgroundColor(this.loadImg ? '#f5f5f5' : 0xf5f5f5) |
| 70 | .width(CommonConstants.FULL_WIDTH) | 71 | .width(CommonConstants.FULL_WIDTH) |
| 71 | .height(160)// .aspectRatio(CompUtils.ASPECT_RATIO_16_9) | 72 | .height(160)// .aspectRatio(CompUtils.ASPECT_RATIO_16_9) |
| @@ -77,7 +78,7 @@ export struct Card17Component { | @@ -77,7 +78,7 @@ export struct Card17Component { | ||
| 77 | 78 | ||
| 78 | GridCol({ span: { xs: 4 } }) { | 79 | GridCol({ span: { xs: 4 } }) { |
| 79 | Image(this.loadImg ? | 80 | Image(this.loadImg ? |
| 80 | - this.contentDTO.fullColumnImgUrls.length > 1 ? this.contentDTO.fullColumnImgUrls[1].url : '' : '') | 81 | + this.contentDTO.fullColumnImgUrls.length > 1 ? this.contentDTO.fullColumnImgUrls[1].url || this.contentDTO.fullColumnImgUrls[1].fullUrl : '' : '') |
| 81 | .backgroundColor(this.loadImg ? '#f5f5f5' : 0xf5f5f5) | 82 | .backgroundColor(this.loadImg ? '#f5f5f5' : 0xf5f5f5) |
| 82 | .width(CommonConstants.FULL_WIDTH) | 83 | .width(CommonConstants.FULL_WIDTH) |
| 83 | .height(79)// .aspectRatio(CompUtils.ASPECT_RATIO_16_9) | 84 | .height(79)// .aspectRatio(CompUtils.ASPECT_RATIO_16_9) |
| @@ -94,7 +95,7 @@ export struct Card17Component { | @@ -94,7 +95,7 @@ export struct Card17Component { | ||
| 94 | 95 | ||
| 95 | GridCol({ span: { xs: 4 } }) { | 96 | GridCol({ span: { xs: 4 } }) { |
| 96 | Image(this.loadImg ? | 97 | Image(this.loadImg ? |
| 97 | - this.contentDTO.fullColumnImgUrls.length > 2 ? this.contentDTO.fullColumnImgUrls[2].url : '' : '') | 98 | + this.contentDTO.fullColumnImgUrls.length > 2 ? this.contentDTO.fullColumnImgUrls[2].url || this.contentDTO.fullColumnImgUrls[2].fullUrl : '' : '') |
| 98 | .backgroundColor(this.loadImg ? '#f5f5f5' : 0xf5f5f5) | 99 | .backgroundColor(this.loadImg ? '#f5f5f5' : 0xf5f5f5) |
| 99 | .width(CommonConstants.FULL_WIDTH) | 100 | .width(CommonConstants.FULL_WIDTH) |
| 100 | .height(79)// .aspectRatio(CompUtils.ASPECT_RATIO_16_9) | 101 | .height(79)// .aspectRatio(CompUtils.ASPECT_RATIO_16_9) |
| @@ -50,14 +50,39 @@ export struct Card2Component { | @@ -50,14 +50,39 @@ export struct Card2Component { | ||
| 50 | Column() { | 50 | Column() { |
| 51 | Column() { | 51 | Column() { |
| 52 | Stack() { | 52 | Stack() { |
| 53 | - //新闻标题 | 53 | + // if(this.contentDTO.objectType == '5'){ |
| 54 | + // Notes({ objectType: this.contentDTO.objectType }).height(30).align(Alignment.Center) | ||
| 55 | + // }else if(this.contentDTO.objectType == '2'){ | ||
| 56 | + // if(this.contentDTO.seoTags){ | ||
| 57 | + // Notes({ newTags: this.contentDTO.seoTags }).height(30).align(Alignment.Center) | ||
| 58 | + // }else if(this.contentDTO.newTags){ | ||
| 59 | + // Notes({ newTags: this.contentDTO.newTags }).height(30).align(Alignment.Center) | ||
| 60 | + // | ||
| 61 | + // } | ||
| 62 | + // }else { | ||
| 63 | + // if(this.contentDTO.newTags){ | ||
| 64 | + // Notes({ newTags: this.contentDTO.newTags }).height(30).align(Alignment.Center) | ||
| 65 | + // } | ||
| 66 | + // } | ||
| 67 | + if(this.contentDTO.objectType == '5'){ | ||
| 68 | + Notes({ objectType: this.contentDTO.objectType }).height(30).align(Alignment.Center) | ||
| 69 | + } else { | ||
| 70 | + if (this.contentDTO.seoTags) { | ||
| 71 | + Notes({ newTags: this.contentDTO.seoTags }).height(30).align(Alignment.Center) | ||
| 72 | + } | ||
| 54 | if (this.contentDTO.newTags) { | 73 | if (this.contentDTO.newTags) { |
| 55 | Notes({ newTags: this.contentDTO.newTags }).height(30).align(Alignment.Center) | 74 | Notes({ newTags: this.contentDTO.newTags }).height(30).align(Alignment.Center) |
| 56 | - //Notes({ newTags: this.contentDTO.newTags }) | ||
| 57 | - } else if (this.contentDTO.objectType == '5') { | ||
| 58 | - Notes({ objectType: this.contentDTO.objectType }).height(30).align(Alignment.Center) | ||
| 59 | - //Notes({ objectType: this.contentDTO.objectType }) | ||
| 60 | } | 75 | } |
| 76 | + } | ||
| 77 | + //新闻标题 | ||
| 78 | + // if (this.contentDTO.newTags) { | ||
| 79 | + // | ||
| 80 | + // //Notes({ newTags: this.contentDTO.newTags }) | ||
| 81 | + // } else if (this.contentDTO.objectType == '5') { | ||
| 82 | + // | ||
| 83 | + // //Notes({ objectType: this.contentDTO.objectType }) | ||
| 84 | + // } | ||
| 85 | + | ||
| 61 | Text() { | 86 | Text() { |
| 62 | if (this.titleMarked) { | 87 | if (this.titleMarked) { |
| 63 | Span(this.str01) | 88 | Span(this.str01) |
| @@ -74,9 +99,10 @@ export struct Card2Component { | @@ -74,9 +99,10 @@ export struct Card2Component { | ||
| 74 | .lineHeight(27) | 99 | .lineHeight(27) |
| 75 | .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。 | 100 | .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。 |
| 76 | .align(Alignment.Start) | 101 | .align(Alignment.Start) |
| 77 | - .textIndent(this.contentDTO.newTags?.length < 5 && this.contentDTO.newTags?.length > 2 ? 58 : | ||
| 78 | - (this.contentDTO.newTags?.length != 0 && this.contentDTO.newTags?.length) || | ||
| 79 | - this.contentDTO.objectType == '5' ? 35 : 0) | 102 | + .textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 && |
| 103 | + (this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) < 5 ? 58 : | ||
| 104 | + ((this.contentDTO.newTags?.length > 0 || this.contentDTO.seoTags?.length > 0) || this.contentDTO.objectType == '5') ? 35 : | ||
| 105 | + 0 ) | ||
| 80 | }.alignContent(Alignment.TopStart) | 106 | }.alignContent(Alignment.TopStart) |
| 81 | 107 | ||
| 82 | //.textIndent(this.contentDTO.objectType == '5' ? 35 : 0) | 108 | //.textIndent(this.contentDTO.objectType == '5' ? 35 : 0) |
| @@ -32,7 +32,6 @@ export struct Card6Component { | @@ -32,7 +32,6 @@ export struct Card6Component { | ||
| 32 | this.loadImg = await onlyWifiLoadImg(); | 32 | this.loadImg = await onlyWifiLoadImg(); |
| 33 | this.clicked = hasClicked(this.contentDTO.objectId) | 33 | this.clicked = hasClicked(this.contentDTO.objectId) |
| 34 | } | 34 | } |
| 35 | - | ||
| 36 | titleInit() { | 35 | titleInit() { |
| 37 | if (this.contentDTO.title?.includes('<em>') && this.contentDTO.title?.includes('</em>')) { | 36 | if (this.contentDTO.title?.includes('<em>') && this.contentDTO.title?.includes('</em>')) { |
| 38 | this.titleMarked = true; | 37 | this.titleMarked = true; |
| @@ -57,11 +56,17 @@ export struct Card6Component { | @@ -57,11 +56,17 @@ export struct Card6Component { | ||
| 57 | // .margin({ right: 2 }) | 56 | // .margin({ right: 2 }) |
| 58 | // } | 57 | // } |
| 59 | Stack() { | 58 | Stack() { |
| 59 | + if(this.contentDTO.objectType == '5'){ | ||
| 60 | + Notes({ objectType: this.contentDTO.objectType }).height(30).align(Alignment.Center) | ||
| 61 | + } else { | ||
| 62 | + if (this.contentDTO.seoTags) { | ||
| 63 | + Notes({ newTags: this.contentDTO.seoTags }).height(30).align(Alignment.Center) | ||
| 64 | + } | ||
| 60 | if (this.contentDTO.newTags) { | 65 | if (this.contentDTO.newTags) { |
| 61 | - Notes({ newTags: this.contentDTO.newTags }).height(27).align(Alignment.Center) | ||
| 62 | - } else if (this.contentDTO.objectType == '5') { | ||
| 63 | - Notes({ objectType: this.contentDTO.objectType }).height(27).align(Alignment.Center) | 66 | + Notes({ newTags: this.contentDTO.newTags }).height(30).align(Alignment.Center) |
| 64 | } | 67 | } |
| 68 | + } | ||
| 69 | + | ||
| 65 | 70 | ||
| 66 | Text() { | 71 | Text() { |
| 67 | if (this.titleMarked) { | 72 | if (this.titleMarked) { |
| @@ -80,9 +85,10 @@ export struct Card6Component { | @@ -80,9 +85,10 @@ export struct Card6Component { | ||
| 80 | .maxLines(3) | 85 | .maxLines(3) |
| 81 | .alignSelf(ItemAlign.Start) | 86 | .alignSelf(ItemAlign.Start) |
| 82 | .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。 | 87 | .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。 |
| 83 | - .textIndent(this.contentDTO?.newTags?.length < 5 && this.contentDTO?.newTags?.length > 2 ? 58 : | ||
| 84 | - (this.contentDTO.newTags?.length != 0 && this.contentDTO.newTags?.length) || | ||
| 85 | - this.contentDTO.objectType == '5' ? 35 : 0) | 88 | + .textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 && |
| 89 | + (this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) < 5 ? 58 : | ||
| 90 | + ((this.contentDTO.newTags?.length > 0 || this.contentDTO.seoTags?.length > 0) || this.contentDTO.objectType == '5') ? 35 : | ||
| 91 | + 0 ) | ||
| 86 | }.alignContent(Alignment.TopStart) | 92 | }.alignContent(Alignment.TopStart) |
| 87 | 93 | ||
| 88 | } | 94 | } |
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/QualityCommentsComponent.ets
| @@ -18,9 +18,8 @@ const TAG = 'QualityCommentsComponent'; | @@ -18,9 +18,8 @@ const TAG = 'QualityCommentsComponent'; | ||
| 18 | @Preview | 18 | @Preview |
| 19 | @Component | 19 | @Component |
| 20 | export struct QualityCommentsComponent { | 20 | export struct QualityCommentsComponent { |
| 21 | - | ||
| 22 | //刷新 | 21 | //刷新 |
| 23 | - @State viewType:number = ViewType.LOADING; | 22 | + @State viewType: number = ViewType.LOADING; |
| 24 | @State hasMore: boolean = true; | 23 | @State hasMore: boolean = true; |
| 25 | @State currentPage: number = 1; | 24 | @State currentPage: number = 1; |
| 26 | private scroller: Scroller = new Scroller(); | 25 | private scroller: Scroller = new Scroller(); |
| @@ -32,11 +31,9 @@ export struct QualityCommentsComponent { | @@ -32,11 +31,9 @@ export struct QualityCommentsComponent { | ||
| 32 | currentWindowColor: string = '#FF4202' | 31 | currentWindowColor: string = '#FF4202' |
| 33 | @State allDatas: LazyDataSource<commentItemModel> = new LazyDataSource(); | 32 | @State allDatas: LazyDataSource<commentItemModel> = new LazyDataSource(); |
| 34 | @State dialogController: CustomDialogController | null = null; | 33 | @State dialogController: CustomDialogController | null = null; |
| 35 | - | ||
| 36 | /*必传*/ | 34 | /*必传*/ |
| 37 | @State publishCommentModel: publishCommentModel = new publishCommentModel() | 35 | @State publishCommentModel: publishCommentModel = new publishCommentModel() |
| 38 | 36 | ||
| 39 | - | ||
| 40 | aboutToDisappear(): void { | 37 | aboutToDisappear(): void { |
| 41 | // windowClass.setWindowSystemBarProperties({ statusBarColor: '#000' }) | 38 | // windowClass.setWindowSystemBarProperties({ statusBarColor: '#000' }) |
| 42 | this.dialogController = null // 将dialogController置空 | 39 | this.dialogController = null // 将dialogController置空 |
| @@ -55,7 +52,7 @@ export struct QualityCommentsComponent { | @@ -55,7 +52,7 @@ export struct QualityCommentsComponent { | ||
| 55 | this.showAlert() | 52 | this.showAlert() |
| 56 | } | 53 | } |
| 57 | 54 | ||
| 58 | - showAlert(){ | 55 | + showAlert() { |
| 59 | this.dialogController = new CustomDialogController({ | 56 | this.dialogController = new CustomDialogController({ |
| 60 | builder: CommentCustomDialog({ | 57 | builder: CommentCustomDialog({ |
| 61 | confirm: (value: Record<string, string>) => { | 58 | confirm: (value: Record<string, string>) => { |
| @@ -74,9 +71,11 @@ export struct QualityCommentsComponent { | @@ -74,9 +71,11 @@ export struct QualityCommentsComponent { | ||
| 74 | }) | 71 | }) |
| 75 | } | 72 | } |
| 76 | 73 | ||
| 77 | - getData(resolve?: (value: string | PromiseLike<string>) => void){ | 74 | + getData(resolve?: (value: string | PromiseLike<string>) => void) { |
| 78 | commentViewModel.fetchQualityCommentList(this.currentPage + '').then((commentListModel) => { | 75 | commentViewModel.fetchQualityCommentList(this.currentPage + '').then((commentListModel) => { |
| 79 | - if(resolve) resolve('刷新成功') | 76 | + if (resolve) { |
| 77 | + resolve('刷新成功') | ||
| 78 | + } | ||
| 80 | 79 | ||
| 81 | if (commentListModel && commentListModel.list && commentListModel.list.length > 0) { | 80 | if (commentListModel && commentListModel.list && commentListModel.list.length > 0) { |
| 82 | if (this.currentPage === 1) { | 81 | if (this.currentPage === 1) { |
| @@ -143,6 +142,7 @@ export struct QualityCommentsComponent { | @@ -143,6 +142,7 @@ export struct QualityCommentsComponent { | ||
| 143 | .height(this.topSafeHeight + vp2px(44) + 'px') | 142 | .height(this.topSafeHeight + vp2px(44) + 'px') |
| 144 | .width('100%') | 143 | .width('100%') |
| 145 | .backgroundColor($r('app.color.color_transparent')) | 144 | .backgroundColor($r('app.color.color_transparent')) |
| 145 | + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP]) | ||
| 146 | } | 146 | } |
| 147 | 147 | ||
| 148 | /*导航栏*/ | 148 | /*导航栏*/ |
| @@ -187,62 +187,66 @@ export struct QualityCommentsComponent { | @@ -187,62 +187,66 @@ export struct QualityCommentsComponent { | ||
| 187 | .height(this.topSafeHeight + vp2px(44) + 'px') | 187 | .height(this.topSafeHeight + vp2px(44) + 'px') |
| 188 | .width('100%') | 188 | .width('100%') |
| 189 | .backgroundColor($r('app.color.white')) | 189 | .backgroundColor($r('app.color.white')) |
| 190 | + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP]) | ||
| 190 | } | 191 | } |
| 191 | 192 | ||
| 192 | build() { | 193 | build() { |
| 193 | - Column() { | ||
| 194 | - | ||
| 195 | - | ||
| 196 | Stack({ alignContent: Alignment.Top }) { | 194 | Stack({ alignContent: Alignment.Top }) { |
| 197 | - | ||
| 198 | Scroll() { | 195 | Scroll() { |
| 199 | Column() { | 196 | Column() { |
| 200 | Stack() { | 197 | Stack() { |
| 201 | this.titleHeader() | 198 | this.titleHeader() |
| 202 | 199 | ||
| 203 | - if(this.viewType == ViewType.ERROR){ | 200 | + if (this.viewType == ViewType.ERROR) { |
| 204 | ErrorComponent() | 201 | ErrorComponent() |
| 205 | - }else if(this.viewType == ViewType.EMPTY){ | ||
| 206 | - EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NoComment}) | ||
| 207 | - }else { | 202 | + } else if (this.viewType == ViewType.EMPTY) { |
| 203 | + EmptyComponent({ emptyType: WDViewDefaultType.WDViewDefaultType_NoComment }) | ||
| 204 | + } else { | ||
| 208 | this.listLayout() | 205 | this.listLayout() |
| 209 | } | 206 | } |
| 210 | 207 | ||
| 211 | }.alignContent(Alignment.Top) | 208 | }.alignContent(Alignment.Top) |
| 212 | - }.backgroundColor(this.currentWindowColor).width('100%') | 209 | + } |
| 210 | + .backgroundColor(this.currentWindowColor).width('100%') | ||
| 213 | } | 211 | } |
| 214 | .friction(0.6) | 212 | .friction(0.6) |
| 215 | .scrollBar(BarState.Off) | 213 | .scrollBar(BarState.Off) |
| 216 | .edgeEffect(EdgeEffect.None) | 214 | .edgeEffect(EdgeEffect.None) |
| 217 | - .width('100%') | ||
| 218 | - .height('100%') | 215 | + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM]) |
| 219 | 216 | ||
| 220 | this.TabbarTransparent() | 217 | this.TabbarTransparent() |
| 221 | this.TabbarNormal() | 218 | this.TabbarNormal() |
| 222 | - | ||
| 223 | - } | ||
| 224 | - | ||
| 225 | } | 219 | } |
| 220 | + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM]) | ||
| 226 | 221 | ||
| 227 | } | 222 | } |
| 228 | 223 | ||
| 229 | @Builder | 224 | @Builder |
| 230 | - listLayout(){ | ||
| 231 | - List({ space: 12, scroller:this.scroller }) { | 225 | + listLayout() { |
| 226 | + List({ space: 12, scroller: this.scroller }) { | ||
| 232 | // ListItemGroup({ header: this.titleHeader() }) | 227 | // ListItemGroup({ header: this.titleHeader() }) |
| 233 | LazyForEach(this.allDatas, (item: commentItemModel, index: number) => { | 228 | LazyForEach(this.allDatas, (item: commentItemModel, index: number) => { |
| 234 | ListItem() { | 229 | ListItem() { |
| 235 | - QualityCommentItem({ item: item, index: index , dialogController:this.dialogController, publishCommentModel:this.publishCommentModel}).margin({ left: 12, right: 12 }) | 230 | + QualityCommentItem({ |
| 231 | + item: item, | ||
| 232 | + index: index, | ||
| 233 | + dialogController: this.dialogController, | ||
| 234 | + publishCommentModel: this.publishCommentModel | ||
| 235 | + }).margin({ left: 12, right: 12 }) | ||
| 236 | } | 236 | } |
| 237 | }) | 237 | }) |
| 238 | // 加载更多 | 238 | // 加载更多 |
| 239 | ListItem() { | 239 | ListItem() { |
| 240 | - if (this.hasMore === false) NoMoreLayout() | 240 | + if (this.hasMore === false) { |
| 241 | + NoMoreLayout() | ||
| 241 | } | 242 | } |
| 243 | + } | ||
| 244 | + | ||
| 242 | // ListItem() { | 245 | // ListItem() { |
| 243 | // | 246 | // |
| 244 | // }.height(`${this.bottomSafeHeight}` + 'px') | 247 | // }.height(`${this.bottomSafeHeight}` + 'px') |
| 245 | - }.onReachEnd(()=>{ | 248 | + } |
| 249 | + .onReachEnd(() => { | ||
| 246 | this.currentPage++ | 250 | this.currentPage++ |
| 247 | this.getData() | 251 | this.getData() |
| 248 | }) | 252 | }) |
| @@ -255,14 +259,9 @@ export struct QualityCommentsComponent { | @@ -255,14 +259,9 @@ export struct QualityCommentsComponent { | ||
| 255 | scrollBackward: NestedScrollMode.SELF_FIRST | 259 | scrollBackward: NestedScrollMode.SELF_FIRST |
| 256 | }) | 260 | }) |
| 257 | } | 261 | } |
| 258 | - | ||
| 259 | - | ||
| 260 | - | ||
| 261 | } | 262 | } |
| 262 | 263 | ||
| 263 | 264 | ||
| 264 | - | ||
| 265 | - | ||
| 266 | @Component | 265 | @Component |
| 267 | struct QualityCommentItem { | 266 | struct QualityCommentItem { |
| 268 | @ObjectLink publishCommentModel: publishCommentModel | 267 | @ObjectLink publishCommentModel: publishCommentModel |
| @@ -279,7 +278,8 @@ struct QualityCommentItem { | @@ -279,7 +278,8 @@ struct QualityCommentItem { | ||
| 279 | 278 | ||
| 280 | Image(this.item.fromUserHeader) | 279 | Image(this.item.fromUserHeader) |
| 281 | 280 | ||
| 282 | - .alt($r(commentViewModel.adjustUserType(this.item.fromUserType) ? 'app.media.WDAccountOwnerHedaerDefaultIcon' : 'app.media.WDAccountDefaultIcon')) | 281 | + .alt($r(commentViewModel.adjustUserType(this.item.fromUserType) ? |
| 282 | + 'app.media.WDAccountOwnerHedaerDefaultIcon' : 'app.media.WDAccountDefaultIcon')) | ||
| 283 | .width(50) | 283 | .width(50) |
| 284 | .height(50) | 284 | .height(50) |
| 285 | .borderRadius(25) | 285 | .borderRadius(25) |
| @@ -376,7 +376,7 @@ struct QualityCommentItem { | @@ -376,7 +376,7 @@ struct QualityCommentItem { | ||
| 376 | Row() { | 376 | Row() { |
| 377 | Image($r('app.media.comment_icon_pinglun')).width(16).height(16) | 377 | Image($r('app.media.comment_icon_pinglun')).width(16).height(16) |
| 378 | }.height('100%') | 378 | }.height('100%') |
| 379 | - .onClick(()=>{ | 379 | + .onClick(() => { |
| 380 | this.replyComment() | 380 | this.replyComment() |
| 381 | }) | 381 | }) |
| 382 | 382 |
| 1 | -import ArrayList from '@ohos.util.ArrayList' | ||
| 2 | import { MineSettingComponent } from '../setting/MineSettingComponent'; | 1 | import { MineSettingComponent } from '../setting/MineSettingComponent'; |
| 3 | import { AccountAndSecurityLayout } from '../setting/AccountAndSecurityLayout'; | 2 | import { AccountAndSecurityLayout } from '../setting/AccountAndSecurityLayout'; |
| 4 | import router from '@ohos.router'; | 3 | import router from '@ohos.router'; |
| 5 | -import { Action, Params } from 'wdBean'; | 4 | +import { Params } from 'wdBean'; |
| 6 | import { DateTimeUtils } from 'wdKit/Index'; | 5 | import { DateTimeUtils } from 'wdKit/Index'; |
| 7 | -import { TrackingPageBrowse, TrackConstants, TrackingButton } from 'wdTracking/Index'; | 6 | +import { TrackingPageBrowse, TrackConstants } from 'wdTracking/Index'; |
| 8 | 7 | ||
| 9 | @Entry | 8 | @Entry |
| 10 | @Component | 9 | @Component |
| 11 | struct SettingPage { | 10 | struct SettingPage { |
| 12 | - @State message: string = 'Hello World 02' | ||
| 13 | @State pageType: string = 'mainSetting'; | 11 | @State pageType: string = 'mainSetting'; |
| 14 | @State params:Params = router.getParams() as Params; | 12 | @State params:Params = router.getParams() as Params; |
| 15 | @State enterActivityTime:number = 0; | 13 | @State enterActivityTime:number = 0; |
| 14 | + @Provide pageShow: number = -1 | ||
| 15 | + @Provide pageHide: number = -1 | ||
| 16 | 16 | ||
| 17 | pageShowSettingTime:number = 0; | 17 | pageShowSettingTime:number = 0; |
| 18 | pageHideSettingTime:number = 0; | 18 | pageHideSettingTime:number = 0; |
| 19 | - pageShowAccountTime:number = 0; | ||
| 20 | - pageHideAccountTime:number = 0; | 19 | + |
| 21 | 20 | ||
| 22 | onPageShow() { | 21 | onPageShow() { |
| 22 | + this.pageShow = Math.random() | ||
| 23 | + | ||
| 23 | this.pageType = this.params.pageID; | 24 | this.pageType = this.params.pageID; |
| 24 | this.enterActivityTime = DateTimeUtils.getTimeStamp() | 25 | this.enterActivityTime = DateTimeUtils.getTimeStamp() |
| 25 | if (this.pageType == 'mainSetting'){ | 26 | if (this.pageType == 'mainSetting'){ |
| 26 | this.pageShowSettingTime = DateTimeUtils.getTimeStamp() | 27 | this.pageShowSettingTime = DateTimeUtils.getTimeStamp() |
| 27 | - }else{ | ||
| 28 | - this.pageShowAccountTime = DateTimeUtils.getTimeStamp() | ||
| 29 | } | 28 | } |
| 30 | } | 29 | } |
| 31 | 30 | ||
| 32 | onPageHide(): void { | 31 | onPageHide(): void { |
| 32 | + this.pageHide = Math.random() | ||
| 33 | if (this.pageType == 'mainSetting'){ | 33 | if (this.pageType == 'mainSetting'){ |
| 34 | this.pageHideSettingTime = DateTimeUtils.getTimeStamp() | 34 | this.pageHideSettingTime = DateTimeUtils.getTimeStamp() |
| 35 | - }else{ | ||
| 36 | - this.pageHideAccountTime = DateTimeUtils.getTimeStamp() | ||
| 37 | } | 35 | } |
| 38 | 36 | ||
| 39 | let duration = 0 | 37 | let duration = 0 |
| 40 | if(this.pageType == 'mainSetting'){ | 38 | if(this.pageType == 'mainSetting'){ |
| 41 | duration = Math.floor((this.pageHideSettingTime - this.pageShowSettingTime)/1000) | 39 | duration = Math.floor((this.pageHideSettingTime - this.pageShowSettingTime)/1000) |
| 42 | - }else{ | ||
| 43 | - duration = Math.floor((this.pageHideAccountTime - this.pageShowAccountTime)/1000) | ||
| 44 | } | 40 | } |
| 45 | if(this.pageType == 'mainSetting'){ | 41 | if(this.pageType == 'mainSetting'){ |
| 46 | TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Setting,TrackConstants.PageName.Setting,duration) | 42 | TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Setting,TrackConstants.PageName.Setting,duration) |
| 47 | - }else{ | ||
| 48 | - TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Account_Management,TrackConstants.PageName.Account_Management,duration) | ||
| 49 | } | 43 | } |
| 50 | } | 44 | } |
| 51 | 45 |
| @@ -460,10 +460,11 @@ export struct SearchResultContentComponent { | @@ -460,10 +460,11 @@ export struct SearchResultContentComponent { | ||
| 460 | console.log('获取value2',JSON.stringify(value)) | 460 | console.log('获取value2',JSON.stringify(value)) |
| 461 | let liveType = value.data?.liveType; | 461 | let liveType = value.data?.liveType; |
| 462 | let seoTags = value.data?.seoTags | 462 | let seoTags = value.data?.seoTags |
| 463 | + let cornerMark = value.data?.cornerMark | ||
| 463 | let contentDTO = new ContentDTO(); | 464 | let contentDTO = new ContentDTO(); |
| 464 | contentDTO.liveType = liveType?liveType: "" | 465 | contentDTO.liveType = liveType?liveType: "" |
| 465 | contentDTO.seoTags = seoTags?seoTags: "" | 466 | contentDTO.seoTags = seoTags?seoTags: "" |
| 466 | - // console.log('获取value333333333',JSON.stringify(contentDTO.liveType)) | 467 | + contentDTO.cornerMark = cornerMark?cornerMark: "" |
| 467 | contentDTO.appStyle = value.data.appStyle + "" | 468 | contentDTO.appStyle = value.data.appStyle + "" |
| 468 | contentDTO.cityCode = value.data.cityCode | 469 | contentDTO.cityCode = value.data.cityCode |
| 469 | contentDTO.coverSize = "" | 470 | contentDTO.coverSize = "" |
| 1 | import { SpConstants } from 'wdConstant'; | 1 | import { SpConstants } from 'wdConstant'; |
| 2 | -import { Logger, SPHelper, ToastUtils, EmitterEventId, EmitterUtils } from 'wdKit'; | 2 | +import { Logger, SPHelper, ToastUtils, EmitterEventId, EmitterUtils, DateTimeUtils } from 'wdKit'; |
| 3 | import {MineMainSettingFunctionItem} from '../../viewmodel/MineMainSettingFunctionItem'; | 3 | import {MineMainSettingFunctionItem} from '../../viewmodel/MineMainSettingFunctionItem'; |
| 4 | import MineSettingDatasModel from '../../model/MineSettingDatasModel'; | 4 | import MineSettingDatasModel from '../../model/MineSettingDatasModel'; |
| 5 | import router from '@ohos.router'; | 5 | import router from '@ohos.router'; |
| @@ -11,7 +11,7 @@ import { LogoutViewModel } from '../../viewmodel/LogoutViewModel'; | @@ -11,7 +11,7 @@ import { LogoutViewModel } from '../../viewmodel/LogoutViewModel'; | ||
| 11 | import { CustomLogoutDialog } from './CustomLogoutDialog'; | 11 | import { CustomLogoutDialog } from './CustomLogoutDialog'; |
| 12 | import { emitter } from '@kit.BasicServicesKit'; | 12 | import { emitter } from '@kit.BasicServicesKit'; |
| 13 | import { ConfirmLogoutDialog } from './ConfirmLogoutDialog'; | 13 | import { ConfirmLogoutDialog } from './ConfirmLogoutDialog'; |
| 14 | -import { TrackingButton, TrackConstants } from 'wdTracking/Index'; | 14 | +import { TrackingButton, TrackConstants, TrackingPageBrowse } from 'wdTracking/Index'; |
| 15 | export { SettingPasswordParams } from "wdLogin" | 15 | export { SettingPasswordParams } from "wdLogin" |
| 16 | 16 | ||
| 17 | @Component | 17 | @Component |
| @@ -22,8 +22,37 @@ export struct AccountAndSecurityLayout { | @@ -22,8 +22,37 @@ export struct AccountAndSecurityLayout { | ||
| 22 | @State protocolState: boolean = false //协议勾选状态 | 22 | @State protocolState: boolean = false //协议勾选状态 |
| 23 | @State isAccountPage: boolean = true | 23 | @State isAccountPage: boolean = true |
| 24 | @State ifSetPassword: boolean = false //是否设置过密码 | 24 | @State ifSetPassword: boolean = false //是否设置过密码 |
| 25 | + @Consume pageShow :number | ||
| 26 | + @Consume @Watch('pageHideForUpdateData') pageHide :number | ||
| 25 | 27 | ||
| 26 | @Watch("checkSetPassword") @Prop enterActivityTime:number = 0; | 28 | @Watch("checkSetPassword") @Prop enterActivityTime:number = 0; |
| 29 | + logoutLayoutShowTime:number = 0; | ||
| 30 | + logoutLayoutHideTime:number = 0; | ||
| 31 | + pageShowAccountTime:number = 0; | ||
| 32 | + pageHideAccountTime:number = 0; | ||
| 33 | + | ||
| 34 | + //注销账户 浏览埋点 | ||
| 35 | + logoutLayoutHide(){ | ||
| 36 | + this.logoutLayoutHideTime = DateTimeUtils.getTimeStamp() | ||
| 37 | + let duration = 0 | ||
| 38 | + duration = Math.floor((this.logoutLayoutHideTime - this.logoutLayoutShowTime)/1000) | ||
| 39 | + TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Cancel_Account,TrackConstants.PageName.Cancel_Account,duration) | ||
| 40 | + } | ||
| 41 | + //账户管理 浏览埋点 | ||
| 42 | + logoutLayoutHide2(){ | ||
| 43 | + this.pageHideAccountTime = DateTimeUtils.getTimeStamp() | ||
| 44 | + let duration = 0 | ||
| 45 | + duration = Math.floor((this.pageHideAccountTime - this.pageShowAccountTime)/1000) | ||
| 46 | + TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Account_Management,TrackConstants.PageName.Account_Management,duration) | ||
| 47 | + } | ||
| 48 | + | ||
| 49 | + pageHideForUpdateData(){ | ||
| 50 | + if(!this.isAccountPage){ | ||
| 51 | + this.logoutLayoutHide() | ||
| 52 | + }else{ | ||
| 53 | + this.logoutLayoutHide2() | ||
| 54 | + } | ||
| 55 | + } | ||
| 27 | 56 | ||
| 28 | logoutViewModel = new LogoutViewModel() | 57 | logoutViewModel = new LogoutViewModel() |
| 29 | dialogController: CustomDialogController = new CustomDialogController({ | 58 | dialogController: CustomDialogController = new CustomDialogController({ |
| @@ -57,6 +86,7 @@ export struct AccountAndSecurityLayout { | @@ -57,6 +86,7 @@ export struct AccountAndSecurityLayout { | ||
| 57 | 86 | ||
| 58 | 87 | ||
| 59 | aboutToAppear() { | 88 | aboutToAppear() { |
| 89 | + this.pageShowAccountTime = DateTimeUtils.getTimeStamp() | ||
| 60 | // 获取设置页面数据 | 90 | // 获取设置页面数据 |
| 61 | this.getAccountAndSecurityData() | 91 | this.getAccountAndSecurityData() |
| 62 | this.addEmitEvent() | 92 | this.addEmitEvent() |
| @@ -175,9 +205,7 @@ export struct AccountAndSecurityLayout { | @@ -175,9 +205,7 @@ export struct AccountAndSecurityLayout { | ||
| 175 | .onClick(() => { | 205 | .onClick(() => { |
| 176 | console.log(index + "") | 206 | console.log(index + "") |
| 177 | if (index == 0){ | 207 | if (index == 0){ |
| 178 | - trackButtonClick("accountManagementPageChangePhoneNumber") | ||
| 179 | - let pageType = {'pageType': 2} as Record<string, number>; | ||
| 180 | - WDRouterRule.jumpWithPage(WDRouterPage.forgetPasswordPage, pageType) | 208 | + WDRouterRule.jumpWithPage(WDRouterPage.changeBindPhonePage) |
| 181 | }else if (index == 1) { | 209 | }else if (index == 1) { |
| 182 | trackButtonClick("accountManagementPageAccountManagementPassword") | 210 | trackButtonClick("accountManagementPageAccountManagementPassword") |
| 183 | if (this.ifSetPassword) { | 211 | if (this.ifSetPassword) { |
| @@ -191,7 +219,7 @@ export struct AccountAndSecurityLayout { | @@ -191,7 +219,7 @@ export struct AccountAndSecurityLayout { | ||
| 191 | }else if (index == 3) { | 219 | }else if (index == 3) { |
| 192 | trackButtonClick("accountManagementPageAccountCancellation") | 220 | trackButtonClick("accountManagementPageAccountCancellation") |
| 193 | this.isAccountPage=false | 221 | this.isAccountPage=false |
| 194 | - // WDRouterRule.jumpWithPage(WDRouterPage.forgetPasswordPage, pageType) | 222 | + this.logoutLayoutShowTime = DateTimeUtils.getTimeStamp() |
| 195 | } | 223 | } |
| 196 | }) | 224 | }) |
| 197 | 225 | ||
| @@ -255,6 +283,8 @@ export struct AccountAndSecurityLayout { | @@ -255,6 +283,8 @@ export struct AccountAndSecurityLayout { | ||
| 255 | }) | 283 | }) |
| 256 | .onClick(() => { | 284 | .onClick(() => { |
| 257 | this.isAccountPage=true | 285 | this.isAccountPage=true |
| 286 | + this.pageShowAccountTime = DateTimeUtils.getTimeStamp() | ||
| 287 | + this.logoutLayoutHide() | ||
| 258 | this.protocolState=false | 288 | this.protocolState=false |
| 259 | }) | 289 | }) |
| 260 | .id('backImage') | 290 | .id('backImage') |
| @@ -332,6 +362,7 @@ export struct AccountAndSecurityLayout { | @@ -332,6 +362,7 @@ export struct AccountAndSecurityLayout { | ||
| 332 | Text() { | 362 | Text() { |
| 333 | Span("我已阅读并同意").fontColor("#999999").fontSize(12) | 363 | Span("我已阅读并同意").fontColor("#999999").fontSize(12) |
| 334 | Span("《用户注销协议》").fontColor("#ED2800").fontSize(12).onClick(() => { | 364 | Span("《用户注销协议》").fontColor("#ED2800").fontSize(12).onClick(() => { |
| 365 | + TrackingButton.click("cancelAccountPageUserLogoffAgreement",TrackConstants.PageName.Cancel_Account,TrackConstants.PageName.Cancel_Account) | ||
| 335 | let bean = { contentID: "3", pageID: "" } as Params | 366 | let bean = { contentID: "3", pageID: "" } as Params |
| 336 | WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage, bean) | 367 | WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage, bean) |
| 337 | }) | 368 | }) |
| @@ -353,6 +384,7 @@ export struct AccountAndSecurityLayout { | @@ -353,6 +384,7 @@ export struct AccountAndSecurityLayout { | ||
| 353 | if (!this.protocolState) { | 384 | if (!this.protocolState) { |
| 354 | return | 385 | return |
| 355 | } | 386 | } |
| 387 | + TrackingButton.click("cancelAccountPageconfirmCancelAccount",TrackConstants.PageName.Cancel_Account,TrackConstants.PageName.Cancel_Account) | ||
| 356 | this.dialogController.open() | 388 | this.dialogController.open() |
| 357 | 389 | ||
| 358 | }) | 390 | }) |
| @@ -456,6 +488,7 @@ export struct AccountAndSecurityLayout { | @@ -456,6 +488,7 @@ export struct AccountAndSecurityLayout { | ||
| 456 | 488 | ||
| 457 | //注销账号 | 489 | //注销账号 |
| 458 | requestLogout() { | 490 | requestLogout() { |
| 491 | + TrackingButton.click("cancelAccountPageCancelAccountSuccess",TrackConstants.PageName.Cancel_Account,TrackConstants.PageName.Cancel_Account) | ||
| 459 | this.logoutViewModel.requestLogout().then(()=>{ | 492 | this.logoutViewModel.requestLogout().then(()=>{ |
| 460 | ToastUtils.shortToast("注销成功") | 493 | ToastUtils.shortToast("注销成功") |
| 461 | router.back() | 494 | router.back() |
| @@ -5,6 +5,11 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; | @@ -5,6 +5,11 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; | ||
| 5 | import { SpConstants } from 'wdConstant/Index'; | 5 | import { SpConstants } from 'wdConstant/Index'; |
| 6 | import { ContentDetailDTO } from 'wdBean/Index'; | 6 | import { ContentDetailDTO } from 'wdBean/Index'; |
| 7 | import measure from '@ohos.measure' | 7 | import measure from '@ohos.measure' |
| 8 | +import { | ||
| 9 | + ContentDetailRequest, | ||
| 10 | + postExecuteLikeParams, | ||
| 11 | + batchLikeAndCollectParams, | ||
| 12 | +} from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest'; | ||
| 8 | 13 | ||
| 9 | const TAG = 'LikeComponent'; | 14 | const TAG = 'LikeComponent'; |
| 10 | 15 | ||
| @@ -17,7 +22,7 @@ interface ILikeStyleResp { | @@ -17,7 +22,7 @@ interface ILikeStyleResp { | ||
| 17 | export struct LikeComponent { | 22 | export struct LikeComponent { |
| 18 | @Consume contentDetailData: ContentDetailDTO | 23 | @Consume contentDetailData: ContentDetailDTO |
| 19 | @Prop pageComponentType: number | 24 | @Prop pageComponentType: number |
| 20 | - @State likesStyle: number = this.contentDetailData.likesStyle // 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空 | 25 | + @State likesStyle: number | string = 1 // 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空 |
| 21 | @State likeStatus: boolean = false | 26 | @State likeStatus: boolean = false |
| 22 | viewModel: LikeViewModel = new LikeViewModel() | 27 | viewModel: LikeViewModel = new LikeViewModel() |
| 23 | @Prop @Watch('onDataUpdated') data: Record<string, string> | 28 | @Prop @Watch('onDataUpdated') data: Record<string, string> |
| @@ -36,12 +41,21 @@ export struct LikeComponent { | @@ -36,12 +41,21 @@ export struct LikeComponent { | ||
| 36 | // this.data['status'] = "1" | 41 | // this.data['status'] = "1" |
| 37 | 42 | ||
| 38 | aboutToAppear() { | 43 | aboutToAppear() { |
| 44 | + // 2:竖屏直播页 3:图集 4:横屏直播页 | ||
| 45 | + if(this.pageComponentType == 2 || this.pageComponentType == 4) { | ||
| 46 | + // 点赞样式 love爱心型 thumb点赞手势 mourning 蜡烛(默哀) pray 祈福 | ||
| 47 | + this.likesStyle = this.contentDetailData?.liveInfo?.likesStyle | ||
| 48 | + } else { | ||
| 49 | + // 内容用 点赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空 | ||
| 50 | + this.likesStyle = this.contentDetailData.likesStyle | ||
| 51 | + } | ||
| 39 | this.onDataUpdated() | 52 | this.onDataUpdated() |
| 40 | } | 53 | } |
| 41 | 54 | ||
| 42 | onDataUpdated() { | 55 | onDataUpdated() { |
| 56 | + console.log(TAG, '点赞点击') | ||
| 43 | if (this.data) { | 57 | if (this.data) { |
| 44 | - if (this.data['channelId'] !== 'undefined') { | 58 | + if (this.data['contentType'] !== 'undefined') { |
| 45 | //获取点赞状态 | 59 | //获取点赞状态 |
| 46 | this.getLikeStatus() | 60 | this.getLikeStatus() |
| 47 | //获取点赞数 | 61 | //获取点赞数 |
| @@ -74,7 +88,7 @@ export struct LikeComponent { | @@ -74,7 +88,7 @@ export struct LikeComponent { | ||
| 74 | * 将点赞样式转换为icon | 88 | * 将点赞样式转换为icon |
| 75 | */ | 89 | */ |
| 76 | transLikeStyle(): ILikeStyleResp { | 90 | transLikeStyle(): ILikeStyleResp { |
| 77 | - if (this.likesStyle === 1) { | 91 | + if (this.likesStyle === 1 || this.likesStyle === 'love' || this.likesStyle === 'thumb') { |
| 78 | return { | 92 | return { |
| 79 | url: this.likeStatus ? $r(`app.media.ic_like_check`) : | 93 | url: this.likeStatus ? $r(`app.media.ic_like_check`) : |
| 80 | this.styleType == 1 ? | 94 | this.styleType == 1 ? |
| @@ -82,12 +96,12 @@ export struct LikeComponent { | @@ -82,12 +96,12 @@ export struct LikeComponent { | ||
| 82 | $r(`app.media.ic_like_uncheck`), | 96 | $r(`app.media.ic_like_uncheck`), |
| 83 | name: '赞' | 97 | name: '赞' |
| 84 | } | 98 | } |
| 85 | - } else if (this.likesStyle === 2) { | 99 | + } else if (this.likesStyle === 2 || this.likesStyle === 'pray') { |
| 86 | return { | 100 | return { |
| 87 | url: this.likeStatus ? $r(`app.media.ic_thub_check`) : $r(`app.media.ic_thub_uncheck`), | 101 | url: this.likeStatus ? $r(`app.media.ic_thub_check`) : $r(`app.media.ic_thub_uncheck`), |
| 88 | name: '祈祷' | 102 | name: '祈祷' |
| 89 | } | 103 | } |
| 90 | - } else if (this.likesStyle === 3) { | 104 | + } else if (this.likesStyle === 3 || this.likesStyle === 'mourning') { |
| 91 | return { | 105 | return { |
| 92 | url: this.likeStatus ? $r(`app.media.ic_candle_check`) : | 106 | url: this.likeStatus ? $r(`app.media.ic_candle_check`) : |
| 93 | $r(`app.media.ic_candle_uncheck`), | 107 | $r(`app.media.ic_candle_uncheck`), |
| @@ -137,6 +151,7 @@ export struct LikeComponent { | @@ -137,6 +151,7 @@ export struct LikeComponent { | ||
| 137 | } | 151 | } |
| 138 | .width(154) | 152 | .width(154) |
| 139 | .height(40) | 153 | .height(40) |
| 154 | + .visibility(this.likesStyle == 4 || this.likesStyle == 'empty' ? Visibility.None : Visibility.Visible) | ||
| 140 | } | 155 | } |
| 141 | 156 | ||
| 142 | @Builder | 157 | @Builder |
| @@ -154,6 +169,7 @@ export struct LikeComponent { | @@ -154,6 +169,7 @@ export struct LikeComponent { | ||
| 154 | .onClick(() => { | 169 | .onClick(() => { |
| 155 | this.clickButtonEvent() | 170 | this.clickButtonEvent() |
| 156 | }) | 171 | }) |
| 172 | + .visibility(this.likesStyle == 4 || this.likesStyle == 'empty' ? Visibility.None : Visibility.Visible) | ||
| 157 | } | 173 | } |
| 158 | 174 | ||
| 159 | @Builder | 175 | @Builder |
| @@ -167,7 +183,10 @@ export struct LikeComponent { | @@ -167,7 +183,10 @@ export struct LikeComponent { | ||
| 167 | .onClick(() => { | 183 | .onClick(() => { |
| 168 | this.clickButtonEvent() | 184 | this.clickButtonEvent() |
| 169 | }) | 185 | }) |
| 170 | - }.width(24).height(24) | 186 | + } |
| 187 | + .width(24) | ||
| 188 | + .height(24) | ||
| 189 | + .visibility(this.likesStyle == 4 || this.likesStyle == 'empty' ? Visibility.None : Visibility.Visible) | ||
| 171 | } | 190 | } |
| 172 | 191 | ||
| 173 | @Builder | 192 | @Builder |
| @@ -242,6 +261,7 @@ export struct LikeComponent { | @@ -242,6 +261,7 @@ export struct LikeComponent { | ||
| 242 | }.width(24).height(24).onClick(() => { | 261 | }.width(24).height(24).onClick(() => { |
| 243 | this.clickButtonEvent() | 262 | this.clickButtonEvent() |
| 244 | }) | 263 | }) |
| 264 | + .visibility(this.likesStyle == 4 || this.likesStyle == 'empty' ? Visibility.None : Visibility.Visible) | ||
| 245 | } | 265 | } |
| 246 | 266 | ||
| 247 | @Builder | 267 | @Builder |
| @@ -278,6 +298,7 @@ export struct LikeComponent { | @@ -278,6 +298,7 @@ export struct LikeComponent { | ||
| 278 | } | 298 | } |
| 279 | .width(36) | 299 | .width(36) |
| 280 | .height(42) | 300 | .height(42) |
| 301 | + .visibility(this.likesStyle == 4 || this.likesStyle == 'empty' ? Visibility.None : Visibility.Visible) | ||
| 281 | 302 | ||
| 282 | } | 303 | } |
| 283 | 304 | ||
| @@ -300,13 +321,26 @@ export struct LikeComponent { | @@ -300,13 +321,26 @@ export struct LikeComponent { | ||
| 300 | 321 | ||
| 301 | executeLike(status: string) { | 322 | executeLike(status: string) { |
| 302 | console.log(TAG, '点赞接口调用', status) | 323 | console.log(TAG, '点赞接口调用', status) |
| 303 | - this.data['status'] = status | ||
| 304 | - this.data['contentId'] = this.contentDetailData?.newsId + '' | ||
| 305 | - this.data['contentType'] = this.contentDetailData?.newsType + '' | ||
| 306 | 324 | ||
| 307 | - this.viewModel.executeLike2(this.data).then(() => { | 325 | + const params: postExecuteLikeParams = { |
| 326 | + status: Number(status), | ||
| 327 | + contentId: this.data['contentId'], | ||
| 328 | + contentType: this.data['contentType'] | ||
| 329 | + } | ||
| 330 | + if(this.data['relType']) { | ||
| 331 | + params.relType = this.data['relType'] | ||
| 332 | + } | ||
| 333 | + if(this.data['contentRelId']) { | ||
| 334 | + params.contentRelId = this.data['contentRelId'] | ||
| 335 | + } | ||
| 336 | + if(this.data['channelId']) { | ||
| 337 | + params.channelId = this.data['channelId'] | ||
| 338 | + } | ||
| 339 | + | ||
| 340 | + console.log(TAG, "点赞 params", JSON.stringify(params)) | ||
| 341 | + ContentDetailRequest.postExecuteLike(params).then((data) => { | ||
| 308 | 342 | ||
| 309 | - console.log(TAG, '点赞接口调用成功') | 343 | + console.log(TAG, '点赞接口调用成功', JSON.stringify(data)) |
| 310 | 344 | ||
| 311 | // 直播点赞一直增加 | 345 | // 直播点赞一直增加 |
| 312 | if (this.contentDetailData.liveInfo) { | 346 | if (this.contentDetailData.liveInfo) { |
| @@ -333,12 +367,26 @@ export struct LikeComponent { | @@ -333,12 +367,26 @@ export struct LikeComponent { | ||
| 333 | } | 367 | } |
| 334 | 368 | ||
| 335 | getLikeStatus() { | 369 | getLikeStatus() { |
| 336 | - this.viewModel.getLikeStatus(this.data).then((data) => { | ||
| 337 | - if (data && data['data'].length && data['data'][0]['likeStatus']) { | ||
| 338 | - this.likeStatus = data['data'][0]['likeStatus'] | 370 | + // console.log(TAG, "this.data", JSON.stringify(this.data)) |
| 371 | + const params: batchLikeAndCollectParams = { | ||
| 372 | + contentList: [ | ||
| 373 | + { | ||
| 374 | + contentId: this.data['contentId'], | ||
| 375 | + contentType: this.data['contentType'], | ||
| 376 | + contentRelId: this.data['contentRelId'] || '' + '', | ||
| 377 | + } | ||
| 378 | + ] | ||
| 379 | + } | ||
| 380 | + console.log(TAG, "查询点赞状态params", JSON.stringify(params)) | ||
| 381 | + ContentDetailRequest.postBatchLikeAndCollectStatus(params).then(res => { | ||
| 382 | + console.log(TAG, '查询点赞、收藏状态==', JSON.stringify(res.data)) | ||
| 383 | + if (res.data) { | ||
| 384 | + if(res.data[0].likeStatus) { | ||
| 385 | + this.likeStatus = res.data[0].likeStatus ? true : false | ||
| 339 | } else { | 386 | } else { |
| 340 | this.likeStatus = false | 387 | this.likeStatus = false |
| 341 | } | 388 | } |
| 389 | + } | ||
| 342 | }).catch(() => { | 390 | }).catch(() => { |
| 343 | this.likeStatus = false | 391 | this.likeStatus = false |
| 344 | }) | 392 | }) |
| @@ -36,6 +36,7 @@ const TAG = 'OperRowListView'; | @@ -36,6 +36,7 @@ const TAG = 'OperRowListView'; | ||
| 36 | * 注意:外层需注册 @Provide contentDetailData:contentDetailData = {} as contentDetailData | 36 | * 注意:外层需注册 @Provide contentDetailData:contentDetailData = {} as contentDetailData |
| 37 | * 传值示例: | 37 | * 传值示例: |
| 38 | OperRowListView({ | 38 | OperRowListView({ |
| 39 | + | ||
| 39 | contentDetailData: this.contentDetailData[0], | 40 | contentDetailData: this.contentDetailData[0], |
| 40 | operationButtonList: ['comment', 'like', 'collect', 'listen', 'share'] | 41 | operationButtonList: ['comment', 'like', 'collect', 'listen', 'share'] |
| 41 | }) | 42 | }) |
| @@ -123,11 +124,25 @@ export struct OperRowListView { | @@ -123,11 +124,25 @@ export struct OperRowListView { | ||
| 123 | await this.queryContentInteractCount() | 124 | await this.queryContentInteractCount() |
| 124 | // 点赞需要数据 | 125 | // 点赞需要数据 |
| 125 | this.likeBean['contentId'] = this.contentDetailData.newsId + '' | 126 | this.likeBean['contentId'] = this.contentDetailData.newsId + '' |
| 127 | + if(this.contentDetailData.userInfo?.userName) { | ||
| 126 | this.likeBean['userName'] = this.contentDetailData.userInfo?.userName + '' | 128 | this.likeBean['userName'] = this.contentDetailData.userInfo?.userName + '' |
| 129 | + } | ||
| 127 | this.likeBean['contentType'] = this.contentDetailData.newsType + '' | 130 | this.likeBean['contentType'] = this.contentDetailData.newsType + '' |
| 131 | + if(this.contentDetailData.newsTitle) { | ||
| 128 | this.likeBean['title'] = this.contentDetailData.newsTitle + '' | 132 | this.likeBean['title'] = this.contentDetailData.newsTitle + '' |
| 133 | + } | ||
| 134 | + if(this.contentDetailData.userInfo?.headPhotoUrl) { | ||
| 129 | this.likeBean['userHeaderUrl'] = this.contentDetailData.userInfo?.headPhotoUrl + '' | 135 | this.likeBean['userHeaderUrl'] = this.contentDetailData.userInfo?.headPhotoUrl + '' |
| 136 | + } | ||
| 137 | + if(this.contentDetailData.reLInfo?.channelId) { | ||
| 130 | this.likeBean['channelId'] = this.contentDetailData.reLInfo?.channelId + '' | 138 | this.likeBean['channelId'] = this.contentDetailData.reLInfo?.channelId + '' |
| 139 | + } | ||
| 140 | + if(this.contentDetailData?.reLInfo?.relType) { | ||
| 141 | + this.likeBean['relType'] = this.contentDetailData?.reLInfo?.relType + '' | ||
| 142 | + } | ||
| 143 | + if(this.contentDetailData?.reLInfo?.relId) { | ||
| 144 | + this.likeBean['contentRelId'] = this.contentDetailData?.reLInfo?.relId + '' | ||
| 145 | + } | ||
| 131 | console.info(TAG, 'contentDetailData----', JSON.stringify(this.contentDetailData)) | 146 | console.info(TAG, 'contentDetailData----', JSON.stringify(this.contentDetailData)) |
| 132 | console.info(TAG, 'likeBean----', JSON.stringify(this.likeBean)) | 147 | console.info(TAG, 'likeBean----', JSON.stringify(this.likeBean)) |
| 133 | // 评论需要数据 | 148 | // 评论需要数据 |
| @@ -202,7 +217,7 @@ export struct OperRowListView { | @@ -202,7 +217,7 @@ export struct OperRowListView { | ||
| 202 | .padding({ | 217 | .padding({ |
| 203 | top: 10, | 218 | top: 10, |
| 204 | // bottom: 10 | 219 | // bottom: 10 |
| 205 | - bottom: px2vp(this.bottomSafeHeight) | 220 | + bottom: `${this.bottomSafeHeight}px` |
| 206 | // bottom: 50 | 221 | // bottom: 50 |
| 207 | }) | 222 | }) |
| 208 | } | 223 | } |
| @@ -387,6 +402,7 @@ export struct OperRowListView { | @@ -387,6 +402,7 @@ export struct OperRowListView { | ||
| 387 | } | 402 | } |
| 388 | ] | 403 | ] |
| 389 | } | 404 | } |
| 405 | + console.info(TAG, '查询用户对作品收藏1', JSON.stringify(params)) | ||
| 390 | // console.info(TAG, '查询用户对作品收藏11', JSON.stringify(params)) | 406 | // console.info(TAG, '查询用户对作品收藏11', JSON.stringify(params)) |
| 391 | let data = await MultiPictureDetailViewModel.getInteractDataStatus(params) | 407 | let data = await MultiPictureDetailViewModel.getInteractDataStatus(params) |
| 392 | console.info(TAG, '查询用户对作品收藏22', JSON.stringify(data)) | 408 | console.info(TAG, '查询用户对作品收藏22', JSON.stringify(data)) |
No preview for this file type
| @@ -119,7 +119,7 @@ export interface postBatchAttentionStatusResult { | @@ -119,7 +119,7 @@ export interface postBatchAttentionStatusResult { | ||
| 119 | 119 | ||
| 120 | 120 | ||
| 121 | export interface postExecuteLikeParams { | 121 | export interface postExecuteLikeParams { |
| 122 | - status: string; | 122 | + status: number; |
| 123 | contentId: string; | 123 | contentId: string; |
| 124 | contentType: string; | 124 | contentType: string; |
| 125 | relType?: string; | 125 | relType?: string; |
| @@ -112,7 +112,7 @@ export struct DetailPlayShortVideoPage { | @@ -112,7 +112,7 @@ export struct DetailPlayShortVideoPage { | ||
| 112 | { | 112 | { |
| 113 | contentId: this.contentDetailData?.newsId + '', | 113 | contentId: this.contentDetailData?.newsId + '', |
| 114 | contentType: this.contentDetailData?.newsType + '', | 114 | contentType: this.contentDetailData?.newsType + '', |
| 115 | - contentRelId: this.contentDetailData?.reLInfo?.relId + '', | 115 | + contentRelId: this.contentDetailData?.reLInfo?.relId || '' + '', |
| 116 | } | 116 | } |
| 117 | ] | 117 | ] |
| 118 | } | 118 | } |
| @@ -74,7 +74,7 @@ export struct OperationListView { | @@ -74,7 +74,7 @@ export struct OperationListView { | ||
| 74 | return | 74 | return |
| 75 | } | 75 | } |
| 76 | const params: postExecuteLikeParams = { | 76 | const params: postExecuteLikeParams = { |
| 77 | - status: this.newsStatusOfUser?.likeStatus === '1' ? '0' : '1', | 77 | + status: this.newsStatusOfUser?.likeStatus === '1' ? 0 : 1, |
| 78 | contentId: this.contentDetailData?.newsId + '', | 78 | contentId: this.contentDetailData?.newsId + '', |
| 79 | contentType: this.contentDetailData?.newsType + '', | 79 | contentType: this.contentDetailData?.newsType + '', |
| 80 | } | 80 | } |
| @@ -56,15 +56,22 @@ export struct PlayerRightView { | @@ -56,15 +56,22 @@ export struct PlayerRightView { | ||
| 56 | return | 56 | return |
| 57 | } | 57 | } |
| 58 | const params: postExecuteLikeParams = { | 58 | const params: postExecuteLikeParams = { |
| 59 | - status: this.newsStatusOfUser?.likeStatus === '1' ? '0' : '1', | 59 | + status: this.newsStatusOfUser?.likeStatus === '1' ? 0 : 1, |
| 60 | contentId: this.contentDetailData?.newsId + '', | 60 | contentId: this.contentDetailData?.newsId + '', |
| 61 | contentType: this.contentDetailData?.newsType + '', | 61 | contentType: this.contentDetailData?.newsType + '', |
| 62 | + userName: this.contentDetailData?.userInfo?.userName || '' + '', | ||
| 63 | + contentRelId: this.contentDetailData?.reLInfo?.relId || '' + '', | ||
| 64 | + title: this.contentDetailData?.newsTitle || '' + '', | ||
| 65 | + channelId: this.contentDetailData?.reLInfo?.channelId + '', | ||
| 66 | + relType: this.contentDetailData?.reLInfo?.relType || '' + '', | ||
| 67 | + userHeaderUrl: this.contentDetailData?.userInfo?.headPhotoUrl || '' + '', | ||
| 62 | } | 68 | } |
| 69 | + console.log(TAG, '点赞params', JSON.stringify(params)) | ||
| 63 | ContentDetailRequest.postExecuteLike(params).then(res => { | 70 | ContentDetailRequest.postExecuteLike(params).then(res => { |
| 64 | - | 71 | + console.log(TAG, '点赞this.newsStatusOfUser', JSON.stringify(this.newsStatusOfUser)) |
| 65 | if (this.newsStatusOfUser) { | 72 | if (this.newsStatusOfUser) { |
| 66 | - this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus === '1' ? '0' : '1' | ||
| 67 | - if (this.newsStatusOfUser.likeStatus === '1') { | 73 | + this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus == '1' ? '0' : '1' |
| 74 | + if (this.newsStatusOfUser.likeStatus == '1') { | ||
| 68 | this.interactData.likeNum = Number(this.interactData.likeNum || 0) + 1 | 75 | this.interactData.likeNum = Number(this.interactData.likeNum || 0) + 1 |
| 69 | } else { | 76 | } else { |
| 70 | this.interactData.likeNum = Math.max(0, Number(this.interactData.likeNum || 0) - 1) | 77 | this.interactData.likeNum = Math.max(0, Number(this.interactData.likeNum || 0) - 1) |
| @@ -237,17 +244,17 @@ export struct PlayerRightView { | @@ -237,17 +244,17 @@ export struct PlayerRightView { | ||
| 237 | transLikeStyle(): ILikeStyleResp { | 244 | transLikeStyle(): ILikeStyleResp { |
| 238 | if (this.likesStyle === 1) { | 245 | if (this.likesStyle === 1) { |
| 239 | return { | 246 | return { |
| 240 | - url: this.newsStatusOfUser.likeStatus === '1' ? $r(`app.media.ic_like_check`) : $r(`app.media.ic_like_uncheck`), | 247 | + url: this.newsStatusOfUser.likeStatus == '1' ? $r(`app.media.ic_like_check`) : $r(`app.media.ic_like_uncheck`), |
| 241 | name: '赞' | 248 | name: '赞' |
| 242 | } | 249 | } |
| 243 | } else if (this.likesStyle === 2) { | 250 | } else if (this.likesStyle === 2) { |
| 244 | return { | 251 | return { |
| 245 | - url: this.newsStatusOfUser.likeStatus === '1' ? $r(`app.media.ic_thub_check`) : $r(`app.media.ic_thub_uncheck`), | 252 | + url: this.newsStatusOfUser.likeStatus == '1' ? $r(`app.media.ic_thub_check`) : $r(`app.media.ic_thub_uncheck`), |
| 246 | name: '祈祷' | 253 | name: '祈祷' |
| 247 | } | 254 | } |
| 248 | } else if (this.likesStyle === 3) { | 255 | } else if (this.likesStyle === 3) { |
| 249 | return { | 256 | return { |
| 250 | - url: this.newsStatusOfUser.likeStatus === '1' ? $r(`app.media.ic_candle_check`) : | 257 | + url: this.newsStatusOfUser.likeStatus == '1' ? $r(`app.media.ic_candle_check`) : |
| 251 | $r(`app.media.ic_candle_uncheck`), | 258 | $r(`app.media.ic_candle_uncheck`), |
| 252 | name: '默哀' | 259 | name: '默哀' |
| 253 | } | 260 | } |
| 1 | +import { SpConstants } from 'wdConstant/Index' | ||
| 2 | +import { CustomToast, Logger, NetworkUtil, ToastUtils, SPHelper, EmitterEventId, | ||
| 3 | + DateTimeUtils } from 'wdKit/Index' | ||
| 4 | +import { LoginViewModel } from './LoginViewModel' | ||
| 5 | +import { router } from '@kit.ArkUI' | ||
| 6 | +import { emitter } from '@kit.BasicServicesKit' | ||
| 7 | +import { TrackingPageBrowse, TrackConstants, TrackingButton } from 'wdTracking/Index' | ||
| 8 | + | ||
| 9 | +const TAG = 'ChangeBindPhonePage' | ||
| 10 | +/*更换手机号页面*/ | ||
| 11 | +@Entry | ||
| 12 | +@Component | ||
| 13 | +struct ChangeBindPhonePage { | ||
| 14 | + @State phoneContent: string = '' | ||
| 15 | + @State codeContent: string = '' | ||
| 16 | + @State isSubmit: boolean = false //是否可以提交 默认不可以 | ||
| 17 | + loginViewModel: LoginViewModel = new LoginViewModel() | ||
| 18 | + @State @Watch('onCodeSend') isCodeSend: boolean = false //验证码点击发送事件 | ||
| 19 | + @State pageTitle:string = '更换手机号'; | ||
| 20 | + @State @Watch('startCount') codeStateSuccess:boolean=false | ||
| 21 | + @State codeBtnState: boolean = false | ||
| 22 | + @State timeCount: number = 60 | ||
| 23 | + isFirst:boolean=true//是否第一次获取验证码 | ||
| 24 | + lastTime: number = 0 | ||
| 25 | + pageShowTime:number = 0; | ||
| 26 | + pageHideTime:number = 0; | ||
| 27 | + | ||
| 28 | + | ||
| 29 | + onPageShow() { | ||
| 30 | + this.pageShowTime = DateTimeUtils.getTimeStamp() | ||
| 31 | + } | ||
| 32 | + | ||
| 33 | + onPageHide(): void { | ||
| 34 | + this.pageHideTime = DateTimeUtils.getTimeStamp() | ||
| 35 | + let duration = 0 | ||
| 36 | + duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000) | ||
| 37 | + TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Change_PhoneNum,TrackConstants.PageName.Change_PhoneNum,duration) | ||
| 38 | + } | ||
| 39 | + | ||
| 40 | + onCodeSend() { | ||
| 41 | + if (this.isCodeSend) { | ||
| 42 | + TrackingButton.click("changePhoneNumberPageSendVerificationCode",TrackConstants.PageName.Change_PhoneNum,TrackConstants.PageName.Change_PhoneNum) | ||
| 43 | + this.sendVerifyCode() | ||
| 44 | + } | ||
| 45 | + } | ||
| 46 | + | ||
| 47 | + @State toastText:string = "" | ||
| 48 | + dialogToast: CustomDialogController = new CustomDialogController({ | ||
| 49 | + builder: CustomToast({ | ||
| 50 | + msg: this.toastText, | ||
| 51 | + }), | ||
| 52 | + autoCancel: false, | ||
| 53 | + alignment: DialogAlignment.Center, | ||
| 54 | + customStyle: true, | ||
| 55 | + maskColor:"#00000000" | ||
| 56 | + }) | ||
| 57 | + | ||
| 58 | + | ||
| 59 | + | ||
| 60 | + build() { | ||
| 61 | + Column() { | ||
| 62 | + Image($r('app.media.login_back_icon')).width(24).height(24).margin({ left: 15, top: 10 }).onClick(() => { | ||
| 63 | + router.back() | ||
| 64 | + }) | ||
| 65 | + | ||
| 66 | + Text(this.pageTitle).fontSize(22).fontColor('#333333').fontWeight(FontWeight.Bold).margin({ left: 25, top: 112 }) | ||
| 67 | + | ||
| 68 | + Column(){ | ||
| 69 | + TextInput({text: this.phoneContent, placeholder: "请输入手机号" }) | ||
| 70 | + .fontSize(16) | ||
| 71 | + .height(48) | ||
| 72 | + .placeholderColor("#CCCCCC") | ||
| 73 | + .maxLength(11) | ||
| 74 | + .margin({ top: 36 }) | ||
| 75 | + .backgroundColor("#F5F5F5") | ||
| 76 | + .borderRadius(4) | ||
| 77 | + .type(InputType.Number) | ||
| 78 | + .onChange((content) => { | ||
| 79 | + this.phoneContent = content | ||
| 80 | + this.isSubmit = (this.phoneContent.length >= 11 && this.codeContent.length >= 4) | ||
| 81 | + | ||
| 82 | + if (content.length >= 11 ) { | ||
| 83 | + this.codeBtnState = true | ||
| 84 | + } else { | ||
| 85 | + this.codeBtnState = false | ||
| 86 | + } | ||
| 87 | + }) | ||
| 88 | + | ||
| 89 | + | ||
| 90 | + Row() { | ||
| 91 | + TextInput({ text: this.codeContent,placeholder: "验证码" }) | ||
| 92 | + .placeholderColor("#CCCCCC") | ||
| 93 | + .layoutWeight(1) | ||
| 94 | + .fontSize(16) | ||
| 95 | + .height(48) | ||
| 96 | + .type(InputType.Number) | ||
| 97 | + .fontColor("#222222") | ||
| 98 | + .backgroundColor("#00000000") | ||
| 99 | + .borderRadius({ topLeft: 4, bottomLeft: 4 }) | ||
| 100 | + .onChange((value) => { | ||
| 101 | + this.codeContent = value | ||
| 102 | + this.isSubmit = (this.phoneContent.length >= 11 && this.codeContent.length >= 4) | ||
| 103 | + }) | ||
| 104 | + | ||
| 105 | + Text(this.codeStateSuccess ? this.timeCount + "s" : this.isFirst?"发送验证码":'重新获取') | ||
| 106 | + .fontColor(this.codeBtnState?'#ED2800':'#80ED2800') | ||
| 107 | + .width(110) | ||
| 108 | + .fontSize(14) | ||
| 109 | + .fontWeight( FontWeight.Bold) | ||
| 110 | + .height(48) | ||
| 111 | + .textAlign(TextAlign.Center) | ||
| 112 | + .enabled(this.codeStateSuccess?false:true) | ||
| 113 | + .onClick(() => { | ||
| 114 | + if (this.phoneContent.length < 11) { | ||
| 115 | + return | ||
| 116 | + } | ||
| 117 | + | ||
| 118 | + let currentTime = DateTimeUtils.getTimeStamp() | ||
| 119 | + if (currentTime - this.lastTime < 500) { | ||
| 120 | + return | ||
| 121 | + } | ||
| 122 | + this.lastTime = currentTime; | ||
| 123 | + this.isCodeSend = true | ||
| 124 | + | ||
| 125 | + }) | ||
| 126 | + | ||
| 127 | + | ||
| 128 | + }.margin({ top: 12 }) | ||
| 129 | + .height(48) | ||
| 130 | + .alignItems(VerticalAlign.Center) | ||
| 131 | + .justifyContent(FlexAlign.Start) | ||
| 132 | + .backgroundImage($r('app.media.code_login_bg')) | ||
| 133 | + .backgroundImageSize({width:'100%',height:48}) | ||
| 134 | + }.width('100%') | ||
| 135 | + .padding({ left: 25, right: 25 }) | ||
| 136 | + | ||
| 137 | + | ||
| 138 | + Row() { | ||
| 139 | + Text("确认") | ||
| 140 | + .layoutWeight(1) | ||
| 141 | + .fontColor(this.isSubmit ?"#FFFFFFFF":"#66FFFFFF") | ||
| 142 | + .borderRadius(4) | ||
| 143 | + .fontSize(18) | ||
| 144 | + .textAlign(TextAlign.Center) | ||
| 145 | + .fontWeight(FontWeight.Medium) | ||
| 146 | + .margin({ top: 26 }) | ||
| 147 | + .height(44) | ||
| 148 | + .backgroundColor(this.isSubmit ?"#ED2800":"#99ED2800") | ||
| 149 | + .enabled(this.isSubmit ? true : false) | ||
| 150 | + .onClick(() => { | ||
| 151 | + TrackingButton.click("changePhoneNumberPageConfirm",TrackConstants.PageName.Change_PhoneNum,TrackConstants.PageName.Change_PhoneNum) | ||
| 152 | + this.changeBindPhone() | ||
| 153 | + }) | ||
| 154 | + }.width('100%') | ||
| 155 | + .padding({ left: 25, right: 25 }) | ||
| 156 | + | ||
| 157 | + }.width('100%').height('100%').alignItems(HorizontalAlign.Start) | ||
| 158 | + } | ||
| 159 | + | ||
| 160 | + //发送验证码 | ||
| 161 | + sendVerifyCode() { | ||
| 162 | + if (this.isEmpty(this.phoneContent)) { | ||
| 163 | + return | ||
| 164 | + } | ||
| 165 | + | ||
| 166 | + this.loginViewModel.sendVerifyCode(this.phoneContent).then((verifyCode) => { | ||
| 167 | + this.showToastTip("已发送") | ||
| 168 | + this.codeStateSuccess=true | ||
| 169 | + this.isCodeSend=false | ||
| 170 | + Logger.debug(TAG, "sendVerifyCode: " + verifyCode) | ||
| 171 | + }).catch((message: string)=>{ | ||
| 172 | + let netStatus = NetworkUtil.isNetConnected() | ||
| 173 | + if (netStatus) { | ||
| 174 | + this.showToastTip(message) | ||
| 175 | + } else { | ||
| 176 | + this.showToastTip("验证码获取失败,请重新尝试") | ||
| 177 | + } | ||
| 178 | + this.codeStateSuccess=false | ||
| 179 | + this.isCodeSend=false | ||
| 180 | + }) | ||
| 181 | + } | ||
| 182 | + | ||
| 183 | + isEmpty(obj: undefined|null|string): boolean { | ||
| 184 | + return (obj == undefined || obj == null || obj == ''); | ||
| 185 | + } | ||
| 186 | + | ||
| 187 | + changeBindPhone(){ | ||
| 188 | + if (!this.isSubmit) { | ||
| 189 | + return | ||
| 190 | + } | ||
| 191 | + if (this.isEmpty(this.phoneContent)) { | ||
| 192 | + return | ||
| 193 | + } | ||
| 194 | + if (this.isEmpty(this.codeContent)) { | ||
| 195 | + return | ||
| 196 | + } | ||
| 197 | + this.loginViewModel.changeBindPhone(this.phoneContent,this.codeContent).then(()=>{ | ||
| 198 | + ToastUtils.shortToast('绑定成功') | ||
| 199 | + this.querySecurity() | ||
| 200 | + }).catch((message: string) => { | ||
| 201 | + if (message != '') { | ||
| 202 | + ToastUtils.shortToast(message) | ||
| 203 | + } | ||
| 204 | + }) | ||
| 205 | + } | ||
| 206 | + | ||
| 207 | + querySecurity(){ | ||
| 208 | + this.loginViewModel.querySecurity().then(()=>{ | ||
| 209 | + SPHelper.default.save(SpConstants.USER_PHONE,this.phoneContent) | ||
| 210 | + this.sendEmitEvent() | ||
| 211 | + router.back() | ||
| 212 | + }).catch(()=>{ | ||
| 213 | + | ||
| 214 | + }) | ||
| 215 | + } | ||
| 216 | + | ||
| 217 | + sendEmitEvent(){ | ||
| 218 | + // 定义一个eventId为1的事件,事件优先级为Low | ||
| 219 | + let event: emitter.InnerEvent = { | ||
| 220 | + eventId: EmitterEventId.PHONE_CHANGE_SUCCESS, | ||
| 221 | + priority: emitter.EventPriority.LOW | ||
| 222 | + }; | ||
| 223 | + | ||
| 224 | + let eventData: emitter.EventData = { | ||
| 225 | + data: { | ||
| 226 | + content: this.phoneContent, | ||
| 227 | + } | ||
| 228 | + }; | ||
| 229 | + | ||
| 230 | + // 发送eventId为1的事件,事件内容为eventData | ||
| 231 | + emitter.emit(event, eventData); | ||
| 232 | + } | ||
| 233 | + | ||
| 234 | + showToastTip(msg:string){ | ||
| 235 | + this.toastText = msg | ||
| 236 | + this.dialogToast.open() | ||
| 237 | + } | ||
| 238 | + | ||
| 239 | + startCount() { | ||
| 240 | + this.isFirst = false | ||
| 241 | + let time = setInterval(() => { | ||
| 242 | + Logger.debug("倒计时:" + this.timeCount) | ||
| 243 | + this.timeCount-- | ||
| 244 | + if (this.timeCount < 1) { | ||
| 245 | + this.codeStateSuccess = false | ||
| 246 | + this.timeCount = 60 | ||
| 247 | + clearInterval(time) | ||
| 248 | + } | ||
| 249 | + }, 1000) | ||
| 250 | + } | ||
| 251 | +} |
| @@ -22,7 +22,7 @@ struct ForgetPasswordPage { | @@ -22,7 +22,7 @@ struct ForgetPasswordPage { | ||
| 22 | @State isSubmit: boolean = false //是否可以提交 默认不可以 | 22 | @State isSubmit: boolean = false //是否可以提交 默认不可以 |
| 23 | loginViewModel: LoginViewModel = new LoginViewModel() | 23 | loginViewModel: LoginViewModel = new LoginViewModel() |
| 24 | @State @Watch('onCodeSend') isCodeSend: boolean = false //验证码点击发送事件 | 24 | @State @Watch('onCodeSend') isCodeSend: boolean = false //验证码点击发送事件 |
| 25 | - pageType:number = (router.getParams() as Record<string, number>)['pageType']; //0、登录->忘记密码 1、设置->重置密码 2、设置->更换手机号页面1 3、设置->更换手机号页面2 | 25 | + pageType:number = (router.getParams() as Record<string, number>)['pageType']; //0、登录->忘记密码 1、设置->重置密码 3、设置->更换手机号页面2(不知道是啥) |
| 26 | phone:string = (router.getParams() as Record<string, number>)['phone'] + ""; //登录 密码登录 填写手机号 点击忘记密码 带过来手机号 | 26 | phone:string = (router.getParams() as Record<string, number>)['phone'] + ""; //登录 密码登录 填写手机号 点击忘记密码 带过来手机号 |
| 27 | @State pageTitle:string = '找回密码'; | 27 | @State pageTitle:string = '找回密码'; |
| 28 | @State codeStateSuccess:boolean=false | 28 | @State codeStateSuccess:boolean=false |
| @@ -51,7 +51,6 @@ struct ForgetPasswordPage { | @@ -51,7 +51,6 @@ struct ForgetPasswordPage { | ||
| 51 | router.back() | 51 | router.back() |
| 52 | }) | 52 | }) |
| 53 | 53 | ||
| 54 | - | ||
| 55 | Text(this.pageTitle).fontSize(22).fontColor('#333333').fontWeight(FontWeight.Bold).margin({ left: 25, top: 112 }) | 54 | Text(this.pageTitle).fontSize(22).fontColor('#333333').fontWeight(FontWeight.Bold).margin({ left: 25, top: 112 }) |
| 56 | LoginInputComponent({ | 55 | LoginInputComponent({ |
| 57 | phoneContent: $phoneContent, | 56 | phoneContent: $phoneContent, |
| @@ -74,11 +73,7 @@ struct ForgetPasswordPage { | @@ -74,11 +73,7 @@ struct ForgetPasswordPage { | ||
| 74 | .backgroundColor(this.isSubmit ?"#ED2800":"#99ED2800") | 73 | .backgroundColor(this.isSubmit ?"#ED2800":"#99ED2800") |
| 75 | .enabled(this.isSubmit ? true : false) | 74 | .enabled(this.isSubmit ? true : false) |
| 76 | .onClick(() => { | 75 | .onClick(() => { |
| 77 | - if(this.pageType==2){ | ||
| 78 | - this.changeBindPhone() | ||
| 79 | - }else { | ||
| 80 | this.checkVerifyCode() | 76 | this.checkVerifyCode() |
| 81 | - } | ||
| 82 | }) | 77 | }) |
| 83 | }.padding({ left: 25, right: 25 }).width('100%') | 78 | }.padding({ left: 25, right: 25 }).width('100%') |
| 84 | 79 | ||
| @@ -98,8 +93,6 @@ struct ForgetPasswordPage { | @@ -98,8 +93,6 @@ struct ForgetPasswordPage { | ||
| 98 | } | 93 | } |
| 99 | }else if (this.pageType == 1){ | 94 | }else if (this.pageType == 1){ |
| 100 | this.pageTitle = '验证当前手机号' | 95 | this.pageTitle = '验证当前手机号' |
| 101 | - }else if (this.pageType == 2){ | ||
| 102 | - this.pageTitle = '更换手机号' | ||
| 103 | } | 96 | } |
| 104 | if (this.isCodeSend) { | 97 | if (this.isCodeSend) { |
| 105 | this.sendVerifyCode() | 98 | this.sendVerifyCode() |
| @@ -10,7 +10,7 @@ export struct LoginInputComponent { | @@ -10,7 +10,7 @@ export struct LoginInputComponent { | ||
| 10 | @Link isCodeSend: boolean //验证码控件是否点击 默认没有 发送接口 | 10 | @Link isCodeSend: boolean //验证码控件是否点击 默认没有 发送接口 |
| 11 | @Link isSubmit: boolean //是否可以提交 | 11 | @Link isSubmit: boolean //是否可以提交 |
| 12 | isFirst:boolean=true//是否第一次获取验证码 | 12 | isFirst:boolean=true//是否第一次获取验证码 |
| 13 | - pageType?:number; //0、登录->忘记密码 1、设置->重置密码 2、设置->更换手机号页面1 3、设置->更换手机号页面2 | 13 | + pageType?:number; //0、登录->忘记密码 1、设置->重置密码 3、设置->更换手机号页面2 |
| 14 | lastTime: number = 0 | 14 | lastTime: number = 0 |
| 15 | @Link @Watch('startCount') codeStateSuccess: boolean //验证码获取成功与否回调 成功显示倒计时 | 15 | @Link @Watch('startCount') codeStateSuccess: boolean //验证码获取成功与否回调 成功显示倒计时 |
| 16 | @Watch('onCheckChange') @Prop protocolState: boolean = false //协议勾选状态 | 16 | @Watch('onCheckChange') @Prop protocolState: boolean = false //协议勾选状态 |
| @@ -4,7 +4,7 @@ import { LoginModel } from './LoginModel'; | @@ -4,7 +4,7 @@ import { LoginModel } from './LoginModel'; | ||
| 4 | import { ModifyPasswordRequestItem } from './ModifyPasswordRequestItem'; | 4 | import { ModifyPasswordRequestItem } from './ModifyPasswordRequestItem'; |
| 5 | import { router } from '@kit.ArkUI'; | 5 | import { router } from '@kit.ArkUI'; |
| 6 | import { encryptMessage } from '../../utils/cryptoUtil'; | 6 | import { encryptMessage } from '../../utils/cryptoUtil'; |
| 7 | -import { TrackingPageBrowse, TrackConstants } from 'wdTracking/Index'; | 7 | +import { TrackingPageBrowse, TrackConstants, TrackingButton } from 'wdTracking/Index'; |
| 8 | 8 | ||
| 9 | /** | 9 | /** |
| 10 | * 修改密码页面 | 10 | * 修改密码页面 |
| @@ -153,6 +153,7 @@ struct ModifyPasswordPage { | @@ -153,6 +153,7 @@ struct ModifyPasswordPage { | ||
| 153 | .borderRadius('4vp') | 153 | .borderRadius('4vp') |
| 154 | .onClick(() => { | 154 | .onClick(() => { |
| 155 | if(this.btnStatus){ | 155 | if(this.btnStatus){ |
| 156 | + TrackingButton.click("changePasswordPageConfirm",TrackConstants.PageName.Change_Passwd,TrackConstants.PageName.Change_Passwd) | ||
| 156 | this.submit() | 157 | this.submit() |
| 157 | } | 158 | } |
| 158 | }) | 159 | }) |
| @@ -8,6 +8,7 @@ | @@ -8,6 +8,7 @@ | ||
| 8 | "pages/login/SettingPasswordLayout", | 8 | "pages/login/SettingPasswordLayout", |
| 9 | "pages/guide/GuidePages", | 9 | "pages/guide/GuidePages", |
| 10 | "pages/login/OneKeyLoginPage", | 10 | "pages/login/OneKeyLoginPage", |
| 11 | - "pages/login/ModifyPasswordPage" | 11 | + "pages/login/ModifyPasswordPage", |
| 12 | + "pages/login/ChangeBindPhonePage" | ||
| 12 | ] | 13 | ] |
| 13 | } | 14 | } |
| 1 | import { ENewspaperPageComponent } from 'wdComponent'; | 1 | import { ENewspaperPageComponent } from 'wdComponent'; |
| 2 | -import { Logger } from 'wdKit'; | 2 | +import { DateTimeUtils, Logger } from 'wdKit'; |
| 3 | import common from '@ohos.app.ability.common'; | 3 | import common from '@ohos.app.ability.common'; |
| 4 | import window from '@ohos.window'; | 4 | import window from '@ohos.window'; |
| 5 | +import { TrackingPageBrowse } from 'wdTracking/Index'; | ||
| 5 | 6 | ||
| 6 | const TAG = 'ENewspaper'; | 7 | const TAG = 'ENewspaper'; |
| 7 | 8 | ||
| 8 | @Entry | 9 | @Entry |
| 9 | @Component | 10 | @Component |
| 10 | struct ENewspaper { | 11 | struct ENewspaper { |
| 12 | + pageShowTime:number = 0; | ||
| 13 | + pageId:string = 'newsPaperPage'; | ||
| 14 | + pageName:string=this.pageId; | ||
| 11 | // 获取UIAbility上下文 | 15 | // 获取UIAbility上下文 |
| 12 | context: common.UIAbilityContext = getContext(this) as common.UIAbilityContext | 16 | context: common.UIAbilityContext = getContext(this) as common.UIAbilityContext |
| 13 | 17 | ||
| @@ -46,6 +50,7 @@ struct ENewspaper { | @@ -46,6 +50,7 @@ struct ENewspaper { | ||
| 46 | } | 50 | } |
| 47 | 51 | ||
| 48 | onPageShow() { | 52 | onPageShow() { |
| 53 | + this.pageShowTime = DateTimeUtils.getTimeStamp() | ||
| 49 | this.setSystemBar('#80000000','#80000000', '#FFFFFFFF') | 54 | this.setSystemBar('#80000000','#80000000', '#FFFFFFFF') |
| 50 | Logger.info(TAG, 'onPageShow'); | 55 | Logger.info(TAG, 'onPageShow'); |
| 51 | } | 56 | } |
| @@ -53,6 +58,8 @@ struct ENewspaper { | @@ -53,6 +58,8 @@ struct ENewspaper { | ||
| 53 | onPageHide() { | 58 | onPageHide() { |
| 54 | this.setSystemBar('#FFFFFFFF','#00000000', '#000000') | 59 | this.setSystemBar('#FFFFFFFF','#00000000', '#000000') |
| 55 | Logger.info(TAG, 'onPageHide'); | 60 | Logger.info(TAG, 'onPageHide'); |
| 61 | + //页面浏览 | ||
| 62 | + TrackingPageBrowse.trackCommonPageExposureEnd(this.pageId,this.pageName,Math.floor((DateTimeUtils.getTimeStamp() - this.pageShowTime)/1000)) | ||
| 56 | } | 63 | } |
| 57 | 64 | ||
| 58 | onBackPress() { | 65 | onBackPress() { |
| 1 | -import { Logger } from 'wdKit'; | 1 | +import { DateTimeUtils, Logger } from 'wdKit'; |
| 2 | import { DynamicDetailComponent } from 'wdComponent'; | 2 | import { DynamicDetailComponent } from 'wdComponent'; |
| 3 | import router from '@ohos.router'; | 3 | import router from '@ohos.router'; |
| 4 | import { Params, Action } from 'wdBean'; | 4 | import { Params, Action } from 'wdBean'; |
| 5 | +import { TrackingPageBrowse } from 'wdTracking/Index'; | ||
| 6 | + | ||
| 5 | const TAG = 'DynamicDetailPage'; | 7 | const TAG = 'DynamicDetailPage'; |
| 6 | @Entry | 8 | @Entry |
| 7 | @Component | 9 | @Component |
| 8 | struct DynamicDetailPage { | 10 | struct DynamicDetailPage { |
| 9 | - | 11 | + pageShowTime:number = 0; |
| 12 | + pageId:string = 'dynamicDetailPage'; | ||
| 13 | + pageName:string=this.pageId; | ||
| 10 | @State relId: string = '' | 14 | @State relId: string = '' |
| 11 | @State contentId: string = '' | 15 | @State contentId: string = '' |
| 12 | @State relType: string = '' | 16 | @State relType: string = '' |
| @@ -30,4 +34,12 @@ struct DynamicDetailPage { | @@ -30,4 +34,12 @@ struct DynamicDetailPage { | ||
| 30 | this.relType = params?.extra?.relType || ''; | 34 | this.relType = params?.extra?.relType || ''; |
| 31 | this.contentId = params?.contentID || ''; | 35 | this.contentId = params?.contentID || ''; |
| 32 | } | 36 | } |
| 37 | + onPageShow() { | ||
| 38 | + this.pageShowTime = DateTimeUtils.getTimeStamp() | ||
| 39 | + } | ||
| 40 | + onPageHide() { | ||
| 41 | + //页面浏览 | ||
| 42 | + TrackingPageBrowse.trackCommonPageExposureEnd(this.pageId,this.pageName,Math.floor((DateTimeUtils.getTimeStamp() - this.pageShowTime)/1000)) | ||
| 43 | + | ||
| 44 | + } | ||
| 33 | } | 45 | } |
| @@ -131,7 +131,7 @@ export struct BottomNavigationComponent { | @@ -131,7 +131,7 @@ export struct BottomNavigationComponent { | ||
| 131 | @Builder | 131 | @Builder |
| 132 | tabBarBuilder(navItem: BottomNavDTO, index: number) { | 132 | tabBarBuilder(navItem: BottomNavDTO, index: number) { |
| 133 | Stack({ alignContent: Alignment.Bottom }) { | 133 | Stack({ alignContent: Alignment.Bottom }) { |
| 134 | - Image(this.currentNavIndex === index ? navItem.iconC : navItem.icon) | 134 | + Image(this.getBottomIcon(navItem, this.currentNavIndex === index)) |
| 135 | .height(CommonConstants.FULL_PARENT) | 135 | .height(CommonConstants.FULL_PARENT) |
| 136 | .padding({ | 136 | .padding({ |
| 137 | bottom: 15, | 137 | bottom: 15, |
| @@ -140,6 +140,7 @@ export struct BottomNavigationComponent { | @@ -140,6 +140,7 @@ export struct BottomNavigationComponent { | ||
| 140 | top: 2 | 140 | top: 2 |
| 141 | }) | 141 | }) |
| 142 | .aspectRatio(this.ASPECT_RATIO_1_1) | 142 | .aspectRatio(this.ASPECT_RATIO_1_1) |
| 143 | + .alt(this.getBottomLocalIcon(navItem, this.currentNavIndex === index)) | ||
| 143 | 144 | ||
| 144 | Text(navItem.name) | 145 | Text(navItem.name) |
| 145 | .margin({ bottom: $r('app.float.bottom_navigation_margin_bottom') }) | 146 | .margin({ bottom: $r('app.float.bottom_navigation_margin_bottom') }) |
| @@ -160,6 +161,48 @@ export struct BottomNavigationComponent { | @@ -160,6 +161,48 @@ export struct BottomNavigationComponent { | ||
| 160 | 161 | ||
| 161 | } | 162 | } |
| 162 | 163 | ||
| 164 | + private getBottomIcon(navItem: BottomNavDTO, isSelect: boolean): string | Resource { | ||
| 165 | + if (!navItem) { | ||
| 166 | + return '' | ||
| 167 | + } | ||
| 168 | + let icon: string = '' | ||
| 169 | + if (this.isImmersive) { | ||
| 170 | + // 获取沉浸式icon | ||
| 171 | + icon = isSelect ? navItem.immersiveIconCUrl : navItem.immersiveIconUrl | ||
| 172 | + } else { | ||
| 173 | + // 获取常规icon | ||
| 174 | + icon = isSelect ? navItem.iconC : navItem.icon | ||
| 175 | + } | ||
| 176 | + if (StringUtils.isEmpty(icon) || icon.includes('.pag')) { | ||
| 177 | + // 兜底,获取预置的本地icon | ||
| 178 | + return this.getBottomLocalIcon(navItem, isSelect) | ||
| 179 | + } | ||
| 180 | + return icon | ||
| 181 | + } | ||
| 182 | + | ||
| 183 | + private getBottomLocalIcon(navItem: BottomNavDTO, isSelect: boolean): Resource { | ||
| 184 | + if (!navItem) { | ||
| 185 | + return isSelect ? $r('app.media.icon_tab_res1') : $r('app.media.icon_tab_res1_no') | ||
| 186 | + } | ||
| 187 | + // type:1普通 2我的 | ||
| 188 | + if (navItem.type == '2') { | ||
| 189 | + // 我的 | ||
| 190 | + return isSelect ? $r('app.media.icon_tab_res5') : $r('app.media.icon_tab_res5_no') | ||
| 191 | + } else { | ||
| 192 | + // 顶部样式:中文的(11-新闻;12-人民号;13-视频;14-服务) | ||
| 193 | + if (navItem.topStyle == '11') { | ||
| 194 | + return isSelect ? $r('app.media.icon_tab_res1') : $r('app.media.icon_tab_res1_no') | ||
| 195 | + } else if (navItem.topStyle == '12') { | ||
| 196 | + return isSelect ? $r('app.media.icon_tab_res2') : $r('app.media.icon_tab_res2_no') | ||
| 197 | + } else if (navItem.topStyle == '13') { | ||
| 198 | + return isSelect ? $r('app.media.icon_tab_res3') : $r('app.media.icon_tab_res3_no') | ||
| 199 | + } else if (navItem.topStyle == '14') { | ||
| 200 | + return isSelect ? $r('app.media.icon_tab_res4') : $r('app.media.icon_tab_res4_no') | ||
| 201 | + } | ||
| 202 | + } | ||
| 203 | + return isSelect ? $r('app.media.icon_tab_res1') : $r('app.media.icon_tab_res1_no') | ||
| 204 | + } | ||
| 205 | + | ||
| 163 | // 底导切换函数 | 206 | // 底导切换函数 |
| 164 | async onBottomNavigationIndexChange(navItem: BottomNavDTO, index: number) { | 207 | async onBottomNavigationIndexChange(navItem: BottomNavDTO, index: number) { |
| 165 | Logger.info(TAG, `onBottomNavigationIndexChange this.currentNavIndex: ${this.currentNavIndex}`); | 208 | Logger.info(TAG, `onBottomNavigationIndexChange this.currentNavIndex: ${this.currentNavIndex}`); |
| @@ -25,7 +25,9 @@ import { EmptyComponent, | @@ -25,7 +25,9 @@ import { EmptyComponent, | ||
| 25 | viewBlogItemInsightIntentShare} from 'wdComponent/Index'; | 25 | viewBlogItemInsightIntentShare} from 'wdComponent/Index'; |
| 26 | 26 | ||
| 27 | const TAG = 'MultiPictureDetailPageComponent'; | 27 | const TAG = 'MultiPictureDetailPageComponent'; |
| 28 | - | 28 | +/** |
| 29 | + * 多图(图集详情页)UI | ||
| 30 | + */ | ||
| 29 | @Component | 31 | @Component |
| 30 | export struct MultiPictureDetailPageComponent { | 32 | export struct MultiPictureDetailPageComponent { |
| 31 | private relId: string = '' | 33 | private relId: string = '' |
| @@ -21,6 +21,7 @@ export struct VideoChannelPage { | @@ -21,6 +21,7 @@ export struct VideoChannelPage { | ||
| 21 | @Prop topNavList: TopNavDTO[] | 21 | @Prop topNavList: TopNavDTO[] |
| 22 | @Link _currentNavIndex?: number; | 22 | @Link _currentNavIndex?: number; |
| 23 | @Consume barBackgroundColor: Color | 23 | @Consume barBackgroundColor: Color |
| 24 | + @Consume isImmersive: boolean | ||
| 24 | @Consume displayDirection: DisplayDirection | 25 | @Consume displayDirection: DisplayDirection |
| 25 | @Consume @Watch('setBarBackgroundColor') currentBottomNavInfo: BottomNavDTO // 当前底导信息 | 26 | @Consume @Watch('setBarBackgroundColor') currentBottomNavInfo: BottomNavDTO // 当前底导信息 |
| 26 | @State @Watch('setBarBackgroundColor') currentTopNavSelectedIndex: number = 0; | 27 | @State @Watch('setBarBackgroundColor') currentTopNavSelectedIndex: number = 0; |
| @@ -42,8 +43,10 @@ export struct VideoChannelPage { | @@ -42,8 +43,10 @@ export struct VideoChannelPage { | ||
| 42 | if (this.currentTopNavSelectedIndex === 0 && this.currentBottomNavInfo?.name === '视频') { | 43 | if (this.currentTopNavSelectedIndex === 0 && this.currentBottomNavInfo?.name === '视频') { |
| 43 | console.error('setBarBackgroundColor', '黑色') | 44 | console.error('setBarBackgroundColor', '黑色') |
| 44 | this.barBackgroundColor = Color.Black | 45 | this.barBackgroundColor = Color.Black |
| 46 | + this.isImmersive = true | ||
| 45 | } else { | 47 | } else { |
| 46 | this.barBackgroundColor = Color.White | 48 | this.barBackgroundColor = Color.White |
| 49 | + this.isImmersive = false | ||
| 47 | console.error('setBarBackgroundColor', '白色') | 50 | console.error('setBarBackgroundColor', '白色') |
| 48 | } | 51 | } |
| 49 | } | 52 | } |
2.63 KB
875 Bytes
2.52 KB
2.69 KB
2.61 KB
2.44 KB
-
Please register or login to post a comment