Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
wangliang_wd
2024-09-24 16:53:44 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
d4f4b8184d60bdfd55787edb01d9ab1957a92dcd
d4f4b818
1 parent
e94269f9
feat:优化评论界面,人民号号主页显示
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
73 additions
and
59 deletions
sight_harmony/features/wdComponent/src/main/ets/components/peopleShipHomePage/PeopleShipHomeNavComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/peopleShipHomePage/PeopleShipHomePageTopComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/peopleShipHomePage/PeopleShipHomeNavComponent.ets
View file @
d4f4b81
...
...
@@ -2,7 +2,8 @@ import router from '@ohos.router'
import { PeopleShipUserDetailData } from 'wdBean'
import { PeopleShipHomePageHeadComponent } from './PeopleShipHomePageHeadComponent'
import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'
import { ToastUtils } from 'wdKit';
import { SPHelper, ToastUtils } from 'wdKit';
import { SpConstants } from 'wdConstant'
@Component
export struct PeopleShipHomePageNavComponent {
...
...
@@ -10,10 +11,16 @@ export struct PeopleShipHomePageNavComponent {
@Consume isAttention: string
@Consume isLoadingAttention: boolean
@Prop attentionOpacity: boolean
@State userId:string = ''
// 页面详情数据
@Prop detailModel: PeopleShipUserDetailData = {} as PeopleShipUserDetailData
aboutToAppear(): void {
this.userId = SPHelper.default.getSync(SpConstants.USER_ID, "") as string
}
build() {
RelativeContainer() {
Row() {
...
...
@@ -67,52 +74,36 @@ export struct PeopleShipHomePageNavComponent {
})
.visibility((this.topOpacity > 0.5 ? Visibility.Visible : Visibility.Hidden))
if (this.isAttention == '0') {
// 关注
Button({ type: ButtonType.Normal, stateEffect: true }) {
Row(){
Image($r('app.media.people_ship_top_add'))
.objectFit(ImageFit.Auto)
.width('13vp')
.height('13pv')
.margin({
right: '3vp'
})
Text('关注')
.fontSize($r('app.float.vp_12'))
.fontColor(Color.White)
.height('100%')
if (this.userId != this.detailModel.userId){
if (this.isAttention == '0') {
// 关注
Button({ type: ButtonType.Normal, stateEffect: true }) {
Row(){
Image($r('app.media.people_ship_top_add'))
.objectFit(ImageFit.Auto)
.width('13vp')
.height('13pv')
.margin({
right: '3vp'
})
Text('关注')
.fontSize($r('app.float.vp_12'))
.fontColor(Color.White)
.height('100%')
}
.alignSelf(ItemAlign.Center)
.justifyContent(FlexAlign.Center)
.width('100%')
.height('100%')
}
.alignSelf(ItemAlign.Center)
.justifyContent(FlexAlign.Center)
.width('100%')
.height('100%')
}
.id("Button_Head")
.alignRules({
center: { anchor: "__container__", align: VerticalAlign.Center },
left: { anchor: "user_Head", align: HorizontalAlign.End }
})
.borderRadius(4)
.backgroundColor($r('app.color.color_ED2800'))
.width('54vp')
.height('24vp')
.onClick(() => {
if (this.isLoadingAttention){
return
}
this.isLoadingAttention = true
})
.margin({
left: '12vp',
})
.padding(0)
.visibility((this.attentionOpacity ? Visibility.Visible : Visibility.Hidden))
} else {
Button('已关注', { type: ButtonType.Normal, stateEffect: true })
.id("Button_Head")
.alignRules({
center: { anchor: "__container__", align: VerticalAlign.Center },
left: { anchor: "user_Head", align: HorizontalAlign.End }
})
.borderRadius(4)
.backgroundColor($r('app.color.color_
F5F5F5
'))
.backgroundColor($r('app.color.color_
ED2800
'))
.width('54vp')
.height('24vp')
.onClick(() => {
...
...
@@ -124,15 +115,33 @@ export struct PeopleShipHomePageNavComponent {
.margin({
left: '12vp',
})
.id("Button_Head")
.alignRules({
center: { anchor: "__container__", align: VerticalAlign.Center },
left: { anchor: "user_Head", align: HorizontalAlign.End }
})
.padding(0)
.fontSize($r('app.float.vp_12'))
.fontColor($r('app.color.color_999999'))
.visibility((this.attentionOpacity ? Visibility.Visible : Visibility.Hidden))
} else {
Button('已关注', { type: ButtonType.Normal, stateEffect: true })
.borderRadius(4)
.backgroundColor($r('app.color.color_F5F5F5'))
.width('54vp')
.height('24vp')
.onClick(() => {
if (this.isLoadingAttention){
return
}
this.isLoadingAttention = true
})
.margin({
left: '12vp',
})
.id("Button_Head")
.alignRules({
center: { anchor: "__container__", align: VerticalAlign.Center },
left: { anchor: "user_Head", align: HorizontalAlign.End }
})
.padding(0)
.fontSize($r('app.float.vp_12'))
.fontColor($r('app.color.color_999999'))
.visibility((this.attentionOpacity ? Visibility.Visible : Visibility.Hidden))
}
}
}
.height('100%')
...
...
sight_harmony/features/wdComponent/src/main/ets/components/peopleShipHomePage/PeopleShipHomePageTopComponent.ets
View file @
d4f4b81
import measure from '@ohos.measure'
import { DisplayUtils, NumberFormatterUtils } from 'wdKit'
import { DisplayUtils, NumberFormatterUtils
, SPHelper
} from 'wdKit'
import { PeopleShipHomePageHeadComponent } from './PeopleShipHomePageHeadComponent'
import { PeopleShipHomePageAttestationComponent } from './PeopleShipHomePageAttestationComponent'
import { Logger } from 'wdKit'
...
...
@@ -8,6 +8,7 @@ import { InfluenceData, PeopleShipUserDetailData } from 'wdBean'
import { PeopleShipHomeAttentionComponent } from './PeopleShipHomeAttentionComponent'
import { HWLocationUtils } from 'wdHwAbility'
import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'
import { SpConstants } from 'wdConstant'
@Component
...
...
@@ -32,6 +33,7 @@ export struct PeopleShipHomePageTopComponent {
@State lineInNum: number = 1
@Link topHeight: number
@State provinceName: string = ''
@State userId:string = ''
build() {
Column() {
...
...
@@ -242,13 +244,15 @@ export struct PeopleShipHomePageTopComponent {
top: '16vp'
})
// 分享-关注
PeopleShipHomeAttentionComponent()
.width(`calc(100% - ${32 + 'vp'})`)
.margin({
top: '10vp',
bottom: '16vp'
})
if (this.userId != this.detailModel.userId) {
// 分享-关注
PeopleShipHomeAttentionComponent()
.width(`calc(100% - ${32 + 'vp'})`)
.margin({
top: '10vp',
bottom: '16vp'
})
}
Row()
.backgroundColor($r('app.color.color_F5F5F5'))
.width('100%')
...
...
@@ -277,6 +281,7 @@ export struct PeopleShipHomePageTopComponent {
this.onIntroductionUpdated()
}
this.userId = SPHelper.default.getSync(SpConstants.USER_ID, "") as string
}
// 不听减去2个字-一直到时3行
...
...
Please
register
or
login
to post a comment