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-06-04 17:52:44 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
c8eb7414075e2f6b24400e8238eb0dab2dabe982
c8eb7414
1 parent
3381a6d7
feat:兴趣选择卡
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
sight_harmony/products/phone/src/main/ets/pages/launchPage/LaunchInterestsHobbiesPage.ets
sight_harmony/products/phone/src/main/ets/pages/launchPage/LaunchInterestsHobbiesPage.ets
View file @
c8eb741
...
...
@@ -5,7 +5,7 @@ import { SPHelper } from 'wdKit/Index';
import { SpConstants } from 'wdConstant/Index';
import { ButtonOptions, promptAction, window } from '@kit.ArkUI';
import { ParamType, TrackConstants, TrackingContent } from 'wdTracking/Index';
import { ImageKnifeComponent } from '@ohos/imageknife';
import { ImageKnifeComponent
,ScaleType
} from '@ohos/imageknife';
@Entry
@Component
...
...
@@ -13,6 +13,8 @@ struct LaunchInterestsHobbiesPage {
@State message: string = 'Hello World'
@State selectCount: number = 0
@State interestsArray: InterestsList[] = []
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
aboutToAppear(){
//请求接口,获取兴趣偏好数据
...
...
@@ -39,6 +41,7 @@ struct LaunchInterestsHobbiesPage {
this.trackingLaunchJumpOver(false)
})
}
.margin({top:px2vp(this.topSafeHeight)})
.width('100%')
.justifyContent(FlexAlign.End)
...
...
@@ -62,7 +65,7 @@ struct LaunchInterestsHobbiesPage {
ForEach(this.interestsArray,(item:InterestsList,index:number)=>{
GridItem(){
Stack({alignContent:Alignment.TopStart}){
ImageKnifeComponent({imageKnifeOption:{loadSrc:item.pic}})
ImageKnifeComponent({imageKnifeOption:{loadSrc:item.pic
,mainScaleType:ScaleType.FIT_XY
}})
.width('100%')
.height('100%')
.backgroundColor(Color.White)
...
...
@@ -98,7 +101,7 @@ struct LaunchInterestsHobbiesPage {
Image(item.choose ? $r('app.media.interestsSelected') : $r('app.media.interestsSelectNot'))
.height('32lpx')
.width('32lpx')
.margin({top:'80lpx',left:'1
1
0lpx'})
.margin({top:'80lpx',left:'1
2
0lpx'})
}.justifyContent(FlexAlign.Start)
}
...
...
@@ -118,8 +121,7 @@ struct LaunchInterestsHobbiesPage {
})
}
.width('90%')
// .height('70%')
.margin({top:'61lpx',bottom:'240lpx'})
.margin({top:'61lpx',bottom:'300lpx'})
.columnsTemplate('1fr 1fr 1fr')
.columnsGap('23lpx')
.rowsGap('23lpx')
...
...
@@ -129,7 +131,7 @@ struct LaunchInterestsHobbiesPage {
.height('100%')
}
.width('100%')
.height(`calc(100% - ${1
0
8 + 'lpx'})`)
.height(`calc(100% - ${1
5
8 + 'lpx'})`)
// .backgroundColor(Color.Red)
Stack({alignContent:Alignment.Center}){
...
...
Please
register
or
login
to post a comment