Showing
2 changed files
with
16 additions
and
2 deletions
| @@ -2,7 +2,8 @@ import router from '@ohos.router' | @@ -2,7 +2,8 @@ import router from '@ohos.router' | ||
| 2 | import { PeopleShipUserDetailData } from 'wdBean' | 2 | import { PeopleShipUserDetailData } from 'wdBean' |
| 3 | import { PeopleShipHomePageHeadComponent } from './PeopleShipHomePageHeadComponent' | 3 | import { PeopleShipHomePageHeadComponent } from './PeopleShipHomePageHeadComponent' |
| 4 | import { WDRouterPage, WDRouterRule } from 'wdRouter/Index' | 4 | import { WDRouterPage, WDRouterRule } from 'wdRouter/Index' |
| 5 | -import { ToastUtils } from 'wdKit'; | 5 | +import { SPHelper, ToastUtils } from 'wdKit'; |
| 6 | +import { SpConstants } from 'wdConstant' | ||
| 6 | 7 | ||
| 7 | @Component | 8 | @Component |
| 8 | export struct PeopleShipHomePageNavComponent { | 9 | export struct PeopleShipHomePageNavComponent { |
| @@ -10,10 +11,16 @@ export struct PeopleShipHomePageNavComponent { | @@ -10,10 +11,16 @@ export struct PeopleShipHomePageNavComponent { | ||
| 10 | @Consume isAttention: string | 11 | @Consume isAttention: string |
| 11 | @Consume isLoadingAttention: boolean | 12 | @Consume isLoadingAttention: boolean |
| 12 | @Prop attentionOpacity: boolean | 13 | @Prop attentionOpacity: boolean |
| 14 | + @State userId:string = '' | ||
| 13 | 15 | ||
| 14 | // 页面详情数据 | 16 | // 页面详情数据 |
| 15 | @Prop detailModel: PeopleShipUserDetailData = {} as PeopleShipUserDetailData | 17 | @Prop detailModel: PeopleShipUserDetailData = {} as PeopleShipUserDetailData |
| 16 | 18 | ||
| 19 | + aboutToAppear(): void { | ||
| 20 | + this.userId = SPHelper.default.getSync(SpConstants.USER_ID, "") as string | ||
| 21 | + } | ||
| 22 | + | ||
| 23 | + | ||
| 17 | build() { | 24 | build() { |
| 18 | RelativeContainer() { | 25 | RelativeContainer() { |
| 19 | Row() { | 26 | Row() { |
| @@ -67,6 +74,7 @@ export struct PeopleShipHomePageNavComponent { | @@ -67,6 +74,7 @@ export struct PeopleShipHomePageNavComponent { | ||
| 67 | }) | 74 | }) |
| 68 | .visibility((this.topOpacity > 0.5 ? Visibility.Visible : Visibility.Hidden)) | 75 | .visibility((this.topOpacity > 0.5 ? Visibility.Visible : Visibility.Hidden)) |
| 69 | 76 | ||
| 77 | + if (this.userId != this.detailModel.userId){ | ||
| 70 | if (this.isAttention == '0') { | 78 | if (this.isAttention == '0') { |
| 71 | // 关注 | 79 | // 关注 |
| 72 | Button({ type: ButtonType.Normal, stateEffect: true }) { | 80 | Button({ type: ButtonType.Normal, stateEffect: true }) { |
| @@ -135,6 +143,7 @@ export struct PeopleShipHomePageNavComponent { | @@ -135,6 +143,7 @@ export struct PeopleShipHomePageNavComponent { | ||
| 135 | .visibility((this.attentionOpacity ? Visibility.Visible : Visibility.Hidden)) | 143 | .visibility((this.attentionOpacity ? Visibility.Visible : Visibility.Hidden)) |
| 136 | } | 144 | } |
| 137 | } | 145 | } |
| 146 | + } | ||
| 138 | .height('100%') | 147 | .height('100%') |
| 139 | } | 148 | } |
| 140 | .height(44) | 149 | .height(44) |
| 1 | import measure from '@ohos.measure' | 1 | import measure from '@ohos.measure' |
| 2 | -import { DisplayUtils, NumberFormatterUtils } from 'wdKit' | 2 | +import { DisplayUtils, NumberFormatterUtils, SPHelper } from 'wdKit' |
| 3 | import { PeopleShipHomePageHeadComponent } from './PeopleShipHomePageHeadComponent' | 3 | import { PeopleShipHomePageHeadComponent } from './PeopleShipHomePageHeadComponent' |
| 4 | import { PeopleShipHomePageAttestationComponent } from './PeopleShipHomePageAttestationComponent' | 4 | import { PeopleShipHomePageAttestationComponent } from './PeopleShipHomePageAttestationComponent' |
| 5 | import { Logger } from 'wdKit' | 5 | import { Logger } from 'wdKit' |
| @@ -8,6 +8,7 @@ import { InfluenceData, PeopleShipUserDetailData } from 'wdBean' | @@ -8,6 +8,7 @@ import { InfluenceData, PeopleShipUserDetailData } from 'wdBean' | ||
| 8 | import { PeopleShipHomeAttentionComponent } from './PeopleShipHomeAttentionComponent' | 8 | import { PeopleShipHomeAttentionComponent } from './PeopleShipHomeAttentionComponent' |
| 9 | import { HWLocationUtils } from 'wdHwAbility' | 9 | import { HWLocationUtils } from 'wdHwAbility' |
| 10 | import { WDRouterPage, WDRouterRule } from 'wdRouter/Index' | 10 | import { WDRouterPage, WDRouterRule } from 'wdRouter/Index' |
| 11 | +import { SpConstants } from 'wdConstant' | ||
| 11 | 12 | ||
| 12 | 13 | ||
| 13 | @Component | 14 | @Component |
| @@ -32,6 +33,7 @@ export struct PeopleShipHomePageTopComponent { | @@ -32,6 +33,7 @@ export struct PeopleShipHomePageTopComponent { | ||
| 32 | @State lineInNum: number = 1 | 33 | @State lineInNum: number = 1 |
| 33 | @Link topHeight: number | 34 | @Link topHeight: number |
| 34 | @State provinceName: string = '' | 35 | @State provinceName: string = '' |
| 36 | + @State userId:string = '' | ||
| 35 | 37 | ||
| 36 | build() { | 38 | build() { |
| 37 | Column() { | 39 | Column() { |
| @@ -242,6 +244,7 @@ export struct PeopleShipHomePageTopComponent { | @@ -242,6 +244,7 @@ export struct PeopleShipHomePageTopComponent { | ||
| 242 | top: '16vp' | 244 | top: '16vp' |
| 243 | }) | 245 | }) |
| 244 | 246 | ||
| 247 | + if (this.userId != this.detailModel.userId) { | ||
| 245 | // 分享-关注 | 248 | // 分享-关注 |
| 246 | PeopleShipHomeAttentionComponent() | 249 | PeopleShipHomeAttentionComponent() |
| 247 | .width(`calc(100% - ${32 + 'vp'})`) | 250 | .width(`calc(100% - ${32 + 'vp'})`) |
| @@ -249,6 +252,7 @@ export struct PeopleShipHomePageTopComponent { | @@ -249,6 +252,7 @@ export struct PeopleShipHomePageTopComponent { | ||
| 249 | top: '10vp', | 252 | top: '10vp', |
| 250 | bottom: '16vp' | 253 | bottom: '16vp' |
| 251 | }) | 254 | }) |
| 255 | + } | ||
| 252 | Row() | 256 | Row() |
| 253 | .backgroundColor($r('app.color.color_F5F5F5')) | 257 | .backgroundColor($r('app.color.color_F5F5F5')) |
| 254 | .width('100%') | 258 | .width('100%') |
| @@ -277,6 +281,7 @@ export struct PeopleShipHomePageTopComponent { | @@ -277,6 +281,7 @@ export struct PeopleShipHomePageTopComponent { | ||
| 277 | this.onIntroductionUpdated() | 281 | this.onIntroductionUpdated() |
| 278 | } | 282 | } |
| 279 | 283 | ||
| 284 | + this.userId = SPHelper.default.getSync(SpConstants.USER_ID, "") as string | ||
| 280 | } | 285 | } |
| 281 | 286 | ||
| 282 | // 不听减去2个字-一直到时3行 | 287 | // 不听减去2个字-一直到时3行 |
-
Please register or login to post a comment