wangliang_wd

feat:兴趣选择卡

... ... @@ -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:'110lpx'})
.margin({top:'80lpx',left:'120lpx'})
}.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% - ${108 + 'lpx'})`)
.height(`calc(100% - ${158 + 'lpx'})`)
// .backgroundColor(Color.Red)
Stack({alignContent:Alignment.Center}){
... ...