Showing
5 changed files
with
45 additions
and
22 deletions
| @@ -5,7 +5,8 @@ import { | @@ -5,7 +5,8 @@ import { | ||
| 5 | PhotoListBean, | 5 | PhotoListBean, |
| 6 | postInteractBrowsOperateParams, | 6 | postInteractBrowsOperateParams, |
| 7 | postBatchAttentionStatusParams, | 7 | postBatchAttentionStatusParams, |
| 8 | - postInteractAccentionOperateParams | 8 | + postInteractAccentionOperateParams, |
| 9 | + Params | ||
| 9 | } from 'wdBean'; | 10 | } from 'wdBean'; |
| 10 | import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel'; | 11 | import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel'; |
| 11 | import display from '@ohos.display'; | 12 | import display from '@ohos.display'; |
| @@ -44,6 +45,7 @@ export struct MultiPictureDetailPageComponent { | @@ -44,6 +45,7 @@ export struct MultiPictureDetailPageComponent { | ||
| 44 | @State netStatus: number | undefined = undefined // 存储网络状态用来展示缺省图 | 45 | @State netStatus: number | undefined = undefined // 存储网络状态用来展示缺省图 |
| 45 | @State showDownload: Boolean = false // 控制是否显示下载默认隐藏 | 46 | @State showDownload: Boolean = false // 控制是否显示下载默认隐藏 |
| 46 | @State publishCommentModel: publishCommentModel = new publishCommentModel() | 47 | @State publishCommentModel: publishCommentModel = new publishCommentModel() |
| 48 | + @State operationButtonList: string[] = ['comment', 'like', 'collect', 'share'] | ||
| 47 | 49 | ||
| 48 | //watch监听页码回调 | 50 | //watch监听页码回调 |
| 49 | onCurrentPageNumUpdated(): void { | 51 | onCurrentPageNumUpdated(): void { |
| @@ -98,19 +100,31 @@ export struct MultiPictureDetailPageComponent { | @@ -98,19 +100,31 @@ export struct MultiPictureDetailPageComponent { | ||
| 98 | if (this.contentDetailData.rmhPlatform == 1) { | 100 | if (this.contentDetailData.rmhPlatform == 1) { |
| 99 | Row() { | 101 | Row() { |
| 100 | Row({ space: 8 }) { | 102 | Row({ space: 8 }) { |
| 101 | - Row() { | ||
| 102 | - Image(this.contentDetailData?.rmhInfo?.rmhHeadUrl) | ||
| 103 | - .borderRadius(24) | ||
| 104 | - .aspectRatio(1) | ||
| 105 | - .border({ width: 1, color: Color.White, style: BorderStyle.Solid }) | ||
| 106 | - .alt($r('app.media.picture_loading')) | ||
| 107 | - .width(36) | ||
| 108 | - .height(36) | ||
| 109 | - .objectFit(ImageFit.Fill) | ||
| 110 | - .interpolation(ImageInterpolation.High) | 103 | + if (this.getImgUrl()){ |
| 104 | + Row() { | ||
| 105 | + Image(this.getImgUrl()) | ||
| 106 | + .borderRadius(24) | ||
| 107 | + .aspectRatio(1) | ||
| 108 | + .border({ width: 1, color: Color.White, style: BorderStyle.Solid }) | ||
| 109 | + .width(36) | ||
| 110 | + .height(36) | ||
| 111 | + .objectFit(ImageFit.Fill) | ||
| 112 | + .interpolation(ImageInterpolation.High) | ||
| 113 | + .onClick(() => { | ||
| 114 | + if (this.contentDetailData.rmhInfo?.cnMainControl === 1) { | ||
| 115 | + // 号主页 | ||
| 116 | + const params: Params = { | ||
| 117 | + creatorId: this.contentDetailData.rmhInfo.rmhId, | ||
| 118 | + pageID: '' | ||
| 119 | + } | ||
| 120 | + WDRouterRule.jumpWithPage(WDRouterPage.peopleShipHomePage, params) | ||
| 121 | + } | ||
| 122 | + | ||
| 123 | + }) | ||
| 124 | + } | ||
| 125 | + .width('13%') | ||
| 126 | + .height('100%') | ||
| 111 | } | 127 | } |
| 112 | - .width('13%') | ||
| 113 | - .height('100%') | ||
| 114 | 128 | ||
| 115 | Row() { | 129 | Row() { |
| 116 | Flex({ | 130 | Flex({ |
| @@ -190,6 +204,7 @@ export struct MultiPictureDetailPageComponent { | @@ -190,6 +204,7 @@ export struct MultiPictureDetailPageComponent { | ||
| 190 | middle: { anchor: "__container__", align: HorizontalAlign.Center } | 204 | middle: { anchor: "__container__", align: HorizontalAlign.Center } |
| 191 | }) | 205 | }) |
| 192 | .id('e_attention') | 206 | .id('e_attention') |
| 207 | + .visibility(!this.showDownload ? Visibility.Visible : Visibility.None) | ||
| 193 | } | 208 | } |
| 194 | if (this.contentDetailData?.photoList && this.contentDetailData?.photoList?.length > 0) { | 209 | if (this.contentDetailData?.photoList && this.contentDetailData?.photoList?.length > 0) { |
| 195 | Swiper(this.swiperController) { | 210 | Swiper(this.swiperController) { |
| @@ -305,10 +320,8 @@ export struct MultiPictureDetailPageComponent { | @@ -305,10 +320,8 @@ export struct MultiPictureDetailPageComponent { | ||
| 305 | OperRowListView({ | 320 | OperRowListView({ |
| 306 | contentDetailData: this.contentDetailData, | 321 | contentDetailData: this.contentDetailData, |
| 307 | publishCommentModel: this.publishCommentModel, | 322 | publishCommentModel: this.publishCommentModel, |
| 323 | + operationButtonList: this.operationButtonList, | ||
| 308 | }) | 324 | }) |
| 309 | - .width('100%') | ||
| 310 | - .height(56) | ||
| 311 | - .border({ width: { top: 0.5 }, color: '#FFFFFF' }) | ||
| 312 | } | 325 | } |
| 313 | .visibility(!this.showDownload ? Visibility.Visible : Visibility.None) | 326 | .visibility(!this.showDownload ? Visibility.Visible : Visibility.None) |
| 314 | Column(){ | 327 | Column(){ |
| @@ -385,6 +398,7 @@ export struct MultiPictureDetailPageComponent { | @@ -385,6 +398,7 @@ export struct MultiPictureDetailPageComponent { | ||
| 385 | if (this.contentDetailData?.photoList && this.contentDetailData?.photoList?.length === 0) { | 398 | if (this.contentDetailData?.photoList && this.contentDetailData?.photoList?.length === 0) { |
| 386 | // 暂无内容 | 399 | // 暂无内容 |
| 387 | this.netStatus = 0 | 400 | this.netStatus = 0 |
| 401 | + this.operationButtonList = [] | ||
| 388 | Logger.info(TAG, `this.netStatus:${JSON.stringify(this.netStatus)}`) | 402 | Logger.info(TAG, `this.netStatus:${JSON.stringify(this.netStatus)}`) |
| 389 | } | 403 | } |
| 390 | Logger.info(TAG, `contentDetailData:${JSON.stringify(this.contentDetailData)}`) | 404 | Logger.info(TAG, `contentDetailData:${JSON.stringify(this.contentDetailData)}`) |
| @@ -399,12 +413,17 @@ export struct MultiPictureDetailPageComponent { | @@ -399,12 +413,17 @@ export struct MultiPictureDetailPageComponent { | ||
| 399 | Logger.info(TAG, `fetchDetailData then,err: ${JSON.stringify(err)}`); | 413 | Logger.info(TAG, `fetchDetailData then,err: ${JSON.stringify(err)}`); |
| 400 | // 内容获取失败 | 414 | // 内容获取失败 |
| 401 | this.netStatus = 9 | 415 | this.netStatus = 9 |
| 416 | + this.operationButtonList = [] | ||
| 402 | }) | 417 | }) |
| 403 | } catch (exception) { | 418 | } catch (exception) { |
| 404 | 419 | ||
| 405 | } | 420 | } |
| 406 | } | 421 | } |
| 407 | 422 | ||
| 423 | + getImgUrl() { | ||
| 424 | + return this.contentDetailData?.rmhInfo?.rmhHeadUrl || this.contentDetailData?.userInfo?.userHeadUrl | ||
| 425 | + } | ||
| 426 | + | ||
| 408 | // 记录浏览历史 | 427 | // 记录浏览历史 |
| 409 | private getInteractBrowsOperate() { | 428 | private getInteractBrowsOperate() { |
| 410 | try { | 429 | try { |
| @@ -11,7 +11,7 @@ export struct SearchCreatorComponent{ | @@ -11,7 +11,7 @@ export struct SearchCreatorComponent{ | ||
| 11 | Stack({alignContent: Alignment.Bottom}){ | 11 | Stack({alignContent: Alignment.Bottom}){ |
| 12 | Image(this.item.headerPhotoUrl) | 12 | Image(this.item.headerPhotoUrl) |
| 13 | .width('92lpx') | 13 | .width('92lpx') |
| 14 | - .alt($r('app.media.default_head')) | 14 | + .alt($r('app.media.icon_default_head_mater')) |
| 15 | .height('92lpx') | 15 | .height('92lpx') |
| 16 | .margin({bottom:'15lpx'}) | 16 | .margin({bottom:'15lpx'}) |
| 17 | .borderRadius(50) | 17 | .borderRadius(50) |
| @@ -81,9 +81,9 @@ export struct AccountAndSecurityLayout { | @@ -81,9 +81,9 @@ export struct AccountAndSecurityLayout { | ||
| 81 | 81 | ||
| 82 | // 收到eventId为1的事件后执行该回调 | 82 | // 收到eventId为1的事件后执行该回调 |
| 83 | let callback = (eventData: emitter.EventData): void => { | 83 | let callback = (eventData: emitter.EventData): void => { |
| 84 | - promptAction.showToast({ | ||
| 85 | - message: JSON.stringify(eventData) | ||
| 86 | - }); | 84 | + // promptAction.showToast({ |
| 85 | + // message: JSON.stringify(eventData) | ||
| 86 | + // }); | ||
| 87 | if(eventData&&eventData.data){ | 87 | if(eventData&&eventData.data){ |
| 88 | this.listData[0].subTitle = eventData.data['content'] | 88 | this.listData[0].subTitle = eventData.data['content'] |
| 89 | } | 89 | } |
| @@ -184,6 +184,10 @@ struct ForgetPasswordPage { | @@ -184,6 +184,10 @@ struct ForgetPasswordPage { | ||
| 184 | this.loginViewModel.changeBindPhone(this.phoneContent,this.codeContent).then(()=>{ | 184 | this.loginViewModel.changeBindPhone(this.phoneContent,this.codeContent).then(()=>{ |
| 185 | ToastUtils.shortToast('绑定成功') | 185 | ToastUtils.shortToast('绑定成功') |
| 186 | this.querySecurity() | 186 | this.querySecurity() |
| 187 | + }).catch((message: string) => { | ||
| 188 | + if (message != '') { | ||
| 189 | + ToastUtils.shortToast(message) | ||
| 190 | + } | ||
| 187 | }) | 191 | }) |
| 188 | } | 192 | } |
| 189 | 193 |
| @@ -171,8 +171,8 @@ export class LoginViewModel { | @@ -171,8 +171,8 @@ export class LoginViewModel { | ||
| 171 | return new Promise<object>((success, fail) => { | 171 | return new Promise<object>((success, fail) => { |
| 172 | this.loginModel.changeBindPhone(phone, verificationCode).then((data: object) => { | 172 | this.loginModel.changeBindPhone(phone, verificationCode).then((data: object) => { |
| 173 | success(data) | 173 | success(data) |
| 174 | - }).catch(() => { | ||
| 175 | - fail() | 174 | + }).catch((message: string) => { |
| 175 | + fail(message) | ||
| 176 | }) | 176 | }) |
| 177 | }) | 177 | }) |
| 178 | } | 178 | } |
-
Please register or login to post a comment