张善主

Merge remote-tracking branch 'origin/main'

# Conflicts:
#	sight_harmony/features/wdComponent/src/main/ets/pages/MultiPictureListPage.ets
Showing 36 changed files with 155 additions and 50 deletions
... ... @@ -135,6 +135,13 @@ export class WindowModel {
})
}
/**
* 状态栏显示设置
*/
setSpecificSystemBarEnabled(visible: boolean) {
this.windowClass?.setSpecificSystemBarEnabled('status', visible)
}
setWindowSystemBarEnable(names: Array<'status' | 'navigation'>) {
this.windowClass?.setWindowSystemBarEnable(names)
}
... ...
import { CompStyle } from 'wdConstant';
import { CompDTO, ContentDTO } from 'wdBean';
import { Card2Component } from './cardview/Card2Component';
import { Card3Component } from './cardview/Card3Component';
// import { Card3Component } from './cardview/Card3Component';
import { Card4Component } from './cardview/Card4Component';
import { Card5Component } from './cardview/Card5Component';
import { Card6Component } from './cardview/Card6Component';
... ... @@ -60,14 +60,11 @@ export struct CardParser {
} else {
if (contentDTO.appStyle === CompStyle.Card_02) {
Card2Component({ compDTO: this.compDTO, contentDTO, pageId: this.pageId, pageName: this.pageName })
} else if (contentDTO.appStyle === CompStyle.Card_03) {
Card3Component({ compDTO: this.compDTO, contentDTO, pageId: this.pageId, pageName: this.pageName })
} else if (contentDTO.appStyle === CompStyle.Card_04) {
Card4Component({ compDTO: this.compDTO, contentDTO, pageId: this.pageId, pageName: this.pageName })
} else if (contentDTO.appStyle === CompStyle.Card_05) {
Card5Component({ compDTO: this.compDTO, contentDTO, titleShowPolicy: this.compDTO.titleShowPolicy, pageId: this.pageId, pageName: this.pageName})
} else if (contentDTO.appStyle === CompStyle.Card_06 || contentDTO.appStyle === CompStyle
.Card_13) {
} else if (contentDTO.appStyle === CompStyle.Card_06 ) {
Card6Component({ compDTO: this.compDTO, contentDTO: this.contentDTO, pageId: this.pageId, pageName: this.pageName })
} else if (contentDTO.appStyle === CompStyle.Card_10) {
Card10Component({ compDTO: this.compDTO, contentDTO, pageId: this.pageId, pageName: this.pageName })
... ...
... ... @@ -4,7 +4,9 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
import PageModel from '../viewmodel/PageModel';
import { CardParser } from './CardParser';
import { Card2Component } from './cardview/Card2Component';
import { Card3Component } from './cardview/Card3Component';
import { Card9Component } from './cardview/Card9Component';
import { Card6Component } from './cardview/Card6Component';
import { Card5Component } from './cardview/Card5Component';
import { AdvCardParser } from './cardViewAdv/AdvCardParser';
import { ZhCarouselLayout01 } from './compview/ZhCarouselLayout01';
... ... @@ -71,6 +73,7 @@ export struct CompParser {
build() {
Column() {
//Text(JSON.stringify(this.compDTO.compStyle))
this.componentBuilder();
}
}
... ... @@ -140,7 +143,13 @@ export struct CompParser {
//时间链卡
Card9Component({ compDTO: this.compDTO, contentDTO:this.compDTO.operDataList[0], pageId: this.pageId, pageName: this.pageName })
Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_04) {
} else if(this.compDTO.compStyle === CompStyle.Card_13){
Card6Component({ compDTO: this.compDTO, contentDTO: this.compDTO.operDataList[0], pageId: this.pageId, pageName: this.pageName })
Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
} else if(this.compDTO.compStyle === CompStyle.Card_03){
Card3Component({ compDTO: this.compDTO, contentDTO: this.compDTO.operDataList[0], pageId: this.pageId, pageName: this.pageName })
Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
}else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_04) {
ZhSingleColumn04({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName })
Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_05) {
... ...
... ... @@ -86,9 +86,14 @@ export struct Card10Component {
Column() {
ForEach(this.contentDTO.slideShows, (item: slideShows, index: number) => {
this.timelineItem(item, index)
if (index < this.contentDTO.slideShows.length - 1) {
// 在不是最后一个元素的情况下添加分隔符
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 0, right: 0 });
}
})
}
// 底部-查看更多。根据接口返回的isMore判断是否显示查看更多
if (this.contentDTO.hasMore == 1) {
Row() {
... ...
... ... @@ -221,7 +221,9 @@ struct createImg {
}) {
Image(this.loadImg ? item.fullUrl : '')
.backgroundColor(0xf5f5f5)
.aspectRatio(this.onePicW > this.onePicH ? 343 / 198 : 228 / 305)
// .aspectRatio(this.onePicW > this.onePicH ? 343 / 198 : 228 / 305)
.width('100%')
.autoResize(true)
.autoResize(true)
.borderRadius(this.caclImageRadius(index))
.opacity(!item.weight && !item.height ? 0 : 1)
... ... @@ -279,6 +281,8 @@ struct createImg {
.backgroundColor(0xf5f5f5)
.aspectRatio(1)
.borderRadius(this.caclImageRadius(index))
.width('100%')
.autoResize(true)
if (this.getPicType(item.weight, item.height) !== 3) {
Flex({ direction: FlexDirection.Row }) {
Image($r('app.media.icon_long_pic'))
... ...
... ... @@ -108,7 +108,7 @@ export struct ZhSingleRow02 {
Column() {
if (this.moreWidth > this.initMoreWidth + 2) {
Text(this.moreTips)
.fontSize(8)
.fontSize(9)
.fontColor(0x858585)
.width(8)
}
... ...
... ... @@ -179,7 +179,7 @@ export struct ZhSingleRow03 {
Column() {
if (this.moreWidth > this.initMoreWidth + 2) {
Text(this.moreTips)
.fontSize(8)
.fontSize(9)
.fontColor(0x858585)
.width(8)
}
... ...
... ... @@ -63,7 +63,6 @@ export struct AppointmentListUI {
.width("100%")
.height("100%")
.backgroundColor($r('app.color.color_F9F9F9'))
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
CustomPullToRefresh({
alldata:this.data,
scroller:this.scroller,
... ...
... ... @@ -120,12 +120,11 @@ export struct FollowFirstTabsComponent{
this.listScroller.scrollToIndex(index, true, ScrollAlign.CENTER)
})
.width('100%')
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
.layoutWeight(1)
.loop(false)
.indicator(false)
.effectMode(EdgeEffect.None)
}.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
}
}
}.width('100%')
.height("100%")
... ...
... ... @@ -101,7 +101,6 @@ export struct FollowListDetailUI {
.margin({bottom:"40lpx"})
}
}
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
.edgeEffect(EdgeEffect.None)
.cachedCount(5)
.padding({ left: '31lpx', right: '31lpx' })
... ...
... ... @@ -27,7 +27,6 @@ export struct FollowSecondTabsComponent{
.width("100%")
.height("100%")
.backgroundColor($r('app.color.color_transparent'))
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
FollowListDetailUI({creatorDirectoryId:this.data[this.firstIndex].id,type:1})
.height("100%")
... ... @@ -40,7 +39,6 @@ export struct FollowSecondTabsComponent{
.width("100%")
.height("100%")
.backgroundColor($r('app.color.color_transparent'))
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
this.FollowSecondUI()
}.width("100%")
... ... @@ -50,7 +48,6 @@ export struct FollowSecondTabsComponent{
}
.width('100%')
.layoutWeight(1)
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
}
@Builder FollowSecondUI(){
... ... @@ -89,7 +86,6 @@ export struct FollowSecondTabsComponent{
.effectMode(EdgeEffect.None)
.height('100%')
.layoutWeight(1)
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
}.width('100%')
}
... ...
... ... @@ -122,7 +122,6 @@ export struct FollowThirdTabsComponent{
})
.width('100%')
.layoutWeight(1)
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
}
}
... ...
import { DateTimeUtils, StringUtils, ToastUtils } from 'wdKit/Index'
import { DateTimeUtils } from 'wdKit/Index'
import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'
import { Remark, WDMessageCenterMessageType } from '../../../model/InteractMessageModel'
import MinePageDatasModel from '../../../model/MinePageDatasModel'
... ... @@ -7,7 +7,6 @@ import { CustomPullToRefresh } from '../../reusable/CustomPullToRefresh'
import { CustomTitleUI } from '../../reusable/CustomTitleUI'
import { MessageListItemUI } from './MessageListItemUI'
import {TrackingButton,TrackConstants}from 'wdTracking/Index'
import TrackingPageBrowseUtils from '../../../utils/TrackingPageBrowseUtils'
const TAG = "MessageListUI"
... ...
... ... @@ -57,6 +57,12 @@ export struct SubscribeMessageComponent{
}
}
} else {
Stack(){
Row()
.width("100%")
.height("100%")
.backgroundColor($r('app.color.color_F9F9F9'))
CustomPullToRefresh({
alldata:this.data,
scroller:this.scroller,
... ... @@ -83,7 +89,8 @@ export struct SubscribeMessageComponent{
.width('100%')
}
}
.backgroundColor($r('app.color.color_F9F9F9'))
}
.backgroundColor($r('app.color.color_transparent'))
.height('100%')
.width('100%')
}
... ...
... ... @@ -9,6 +9,9 @@ const TAG = "AppointmentListPage"
struct AppointmentListPage {
pageShowTime:number = 0;
pageHideTime:number = 0;
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
onPageShow() {
this.pageShowTime = DateTimeUtils.getTimeStamp()
... ... @@ -23,7 +26,12 @@ struct AppointmentListPage {
build() {
Column(){
Column(){
AppointmentListUI()
}
}.width("100%")
.height("100%")
.padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)})
}
}
\ No newline at end of file
... ...
... ... @@ -7,6 +7,7 @@ import { TrackConstants,
TrackingButton,
TrackingContent, TrackingPageBrowse, TrackParamConvert } from 'wdTracking/Index';
import { WDShare } from 'wdShare/Index';
import { hasClicked, persistentStorage } from '../../utils/persistentStorage';
const TAG: string = 'CardView';
... ... @@ -393,6 +394,7 @@ export struct MasonryLayout01CardView {
export struct PaperSingleColumn999CardView {
private item: ContentDTO = new ContentDTO();
private index: number = -1;
@State isRead: boolean = false;//已读状态
@State interactData: InteractDataDTO = {} as InteractDataDTO;
@Consume @Watch('onChangeCommentList') commentList: InteractDataDTO[]
... ... @@ -533,7 +535,7 @@ export struct PaperSingleColumn999CardView {
}
if (this.item?.newsSummary) {
Text(this.item?.newsSummary)
.fontColor('#6666666')
.fontColor(this.isRead ? 0x848484 : '#222222')
.fontSize(14)
.padding({ top: 10 })
.alignSelf(ItemAlign.Start)
... ... @@ -599,6 +601,8 @@ export struct PaperSingleColumn999CardView {
.margin({ bottom: 10, left: 12, right: 12 })
.borderRadius(4)
.onClick(() => {
this.isRead = true
persistentStorage(this.item.objectId);
ProcessUtils.processPage(this.item)
TrackingContent.common(TrackConstants.EventType.Click,TrackConstants.SummaryType.MorningAndEveningNews,TrackConstants.SummaryType.MorningAndEveningNews,TrackParamConvert.program(this.item))
}).onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => {
... ... @@ -610,6 +614,7 @@ export struct PaperSingleColumn999CardView {
aboutToAppear(): void {
this.onChangeCommentList()
this.isRead = hasClicked(this.item.objectId)
}
onChangeCommentList() {
... ...
... ... @@ -11,6 +11,8 @@ struct FollowListPage {
@State curIndex: string = '0';
pageShowTime:number = 0;
pageHideTime:number = 0;
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
onPageShow() {
this.curIndex = this.params?.['index'];
... ... @@ -25,6 +27,7 @@ struct FollowListPage {
}
build() {
Column(){
Column() {
//Tab 详情
FollowFirstTabsComponent({changeIndex:Number(this.curIndex)})
... ... @@ -32,5 +35,8 @@ struct FollowListPage {
.backgroundColor($r('app.color.white'))
.height('100%')
.width('100%')
}.width("100%")
.height("100%")
.padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)})
}
}
\ No newline at end of file
... ...
... ... @@ -19,7 +19,6 @@ const TAG = 'MinePageComponent';
*/
@Component
export struct MinePageComponent {
private topRectHeight: string = AppStorage.get<number>('topSafeHeight') + 'px';
//是否是创作者
@State isCreator:boolean = false
@State isLogin:boolean = false //默认 false 测试放开
... ... @@ -63,6 +62,8 @@ export struct MinePageComponent {
@StorageProp('currentBreakpoint') @Watch("currentChanged")currentBreakpoint: string = 'sm';
private breakpointSystem = new BreakpointSystem();
@State percent:number = 1
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
currentChanged(){
if(this.currentBreakpoint == "md" || this.currentBreakpoint == "lg"){
... ... @@ -154,6 +155,7 @@ export struct MinePageComponent {
}
build() {
Column(){
Scroll(this.scroller){
Stack(){
Image($r('app.media.mine_head_bg'))
... ... @@ -168,8 +170,10 @@ export struct MinePageComponent {
.backgroundColor($r('app.color.color_F9F9F9'))
.scrollable(ScrollDirection.Vertical)
.scrollBar(BarState.Off)
// 预留状态栏、导航栏高度
.margin({ top: this.topRectHeight})
}.width("100%")
.height("100%")
.padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)})
}
... ...
... ... @@ -132,6 +132,7 @@ struct MyCollectionListPage {
// 加载更多
ListItem() {
if (this.browSingModel.hasMore === false) NoMoreLayout()
//Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 0, right: 0 });
}
}
.scrollBar(BarState.Off)
... ... @@ -150,15 +151,18 @@ struct MyCollectionListPage {
}
})
.margin({left:16})
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 });
}
Column() {
BigPicCardComponent({compDTO:new CompDTO,contentDTO:compDTO,pageId:TrackConstants.PageName.My_Collect,pageName:TrackConstants.PageName.My_Collect})
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 });
}
}.onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => {
if (isVisible) {
TrackingContent.common(TrackConstants.EventType.Show, TrackConstants.PageName.My_Collect,TrackConstants.PageName.My_Collect, TrackParamConvert.program(compDTO))
}
})
}
... ...
... ... @@ -76,7 +76,6 @@ export struct PageComponent {
onActionEnd(this.pageModel, this.pageAdvModel)
})
)
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
}
... ...
... ... @@ -47,7 +47,7 @@ struct PeopleShipHomePage {
}
onPageHide(): void {
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', })
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000'})
}
topOpacityChange(){
... ... @@ -70,7 +70,6 @@ struct PeopleShipHomePage {
.objectRepeat(ImageRepeat.NoRepeat)
.backgroundColor(Color.White)
.visibility(this.isLoading ? Visibility.None : Visibility.Visible)
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
Row()
.height(px2vp(this.topSafeHeight))
... ... @@ -78,7 +77,6 @@ struct PeopleShipHomePage {
.backgroundColor($r('app.color.white'))
.visibility(this.topOpacity > 0 ? Visibility.Visible : Visibility.None)
.opacity(this.topOpacity )
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
}
Column(){
... ... @@ -141,10 +139,10 @@ struct PeopleShipHomePage {
})
}
}
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
.alignItems(HorizontalAlign.Start)
.justifyContent(FlexAlign.Start)
.width('100%')
.margin({top:px2vp(this.topSafeHeight)})
}
.width('100%')
}else{
... ... @@ -165,7 +163,6 @@ struct PeopleShipHomePage {
}
aboutToAppear() {
WindowModel.shared.setWindowLayoutFullScreen(false)
this.getData()
}
... ...
... ... @@ -22,6 +22,8 @@ export struct PrivacySettingPage {
@StorageProp('currentBreakpoint') @Watch("currentChanged")currentBreakpoint: string = 'sm';
private breakpointSystem = new BreakpointSystem();
@State percent:number = 1
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
currentChanged(){
if(this.currentBreakpoint == "md" || this.currentBreakpoint == "lg"){
... ... @@ -76,6 +78,7 @@ export struct PrivacySettingPage {
build() {
Column(){
Column(){
TitleBackComponent({title:"隐私设置"})
//滑动区域
... ... @@ -83,6 +86,9 @@ export struct PrivacySettingPage {
}.backgroundColor('#F8F8F8')
.width("100%")
.height("100%")
}.width("100%")
.height("100%")
.padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)})
}
... ...
... ... @@ -7,6 +7,8 @@ import { AboutPageUI } from '../setting/AboutPageUI';
struct SettingAboutPage {
pageShowTime:number = 0;
pageHideTime:number = 0;
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
onPageShow() {
this.pageShowTime = DateTimeUtils.getTimeStamp()
... ... @@ -22,7 +24,12 @@ struct SettingAboutPage {
build() {
Column(){
Column(){
AboutPageUI()
}.backgroundColor($r('app.color.white'))
}.width("100%")
.height("100%")
.padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)})
}
}
\ No newline at end of file
... ...
... ... @@ -16,6 +16,8 @@ struct SettingPage {
pageShowSettingTime:number = 0;
pageHideSettingTime:number = 0;
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
onPageShow() {
... ... @@ -44,6 +46,7 @@ struct SettingPage {
}
build() {
Column(){
Column() {
if (this.pageType == 'mainSetting') {
MineSettingComponent()
... ... @@ -52,6 +55,10 @@ struct SettingPage {
}
}.setFullWidth()
.backgroundColor($r("app.color.white"))
}.width("100%")
.height("100%")
.padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)})
}
// 私有方法
... ...
... ... @@ -167,7 +167,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
Column() {
if (this.moreWidth > this.initMoreWidth + 2) {
Text(this.moreTips)
.fontSize(8)
.fontSize(9)
.fontColor(0x858585)
.width(8)
}
... ...
... ... @@ -190,7 +190,7 @@ export struct LiveHorizontalCardComponent {
Column() {
if (this.moreWidth > this.initMoreWidth + 2) {
Text(this.moreTips)
.fontSize(8)
.fontSize(9)
.fontColor(0x858585)
.width(8)
}
... ...
import router from '@ohos.router'
import { DateTimeUtils, NetworkUtil, StringUtils } from 'wdKit';
import { DateTimeUtils, NetworkUtil, StringUtils, WindowModel } from 'wdKit';
import { WDRouterPage, WDRouterRule } from 'wdRouter';
import { editModelParams } from '../model/EditInfoModel';
import { HomePageBottomCommentComponent } from '../components/mine/home/HomePageBottomCommentComponent';
... ... @@ -14,7 +14,7 @@ const TAG = "MineHomePage"
@Entry
@Component
struct MineHomePage {
@State tileOpacity: number = 0;
@Watch('topOpacityChange') @State tileOpacity: number = 0;
firstPositionY:number = 0;
fontColor: string = '#999999'
selectedFontColor: string = '#000000'
... ... @@ -38,10 +38,12 @@ struct MineHomePage {
@State isCommentEnter:string = "";
@State isConnectNetwork : boolean = NetworkUtil.isNetConnected()
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
pageShowTime:number = 0;
pageHideTime:number = 0;
onPageShow(): void {
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff'})
this.pageShowTime = DateTimeUtils.getTimeStamp()
this.getUserInfo()
... ... @@ -54,7 +56,16 @@ struct MineHomePage {
}, 200);
}
topOpacityChange(){
if(this.tileOpacity > 0.8){
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000'})
}else{
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff'})
}
}
onPageHide(): void {
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000'})
this.pageHideTime = DateTimeUtils.getTimeStamp()
let duration = 0
duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000)
... ... @@ -69,7 +80,6 @@ struct MineHomePage {
.width('100%')
.height('355lpx')
.objectFit(ImageFit.Cover)
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
Row()
.height(px2vp(this.topSafeHeight))
... ... @@ -77,7 +87,6 @@ struct MineHomePage {
.backgroundColor($r('app.color.white'))
.visibility(this.tileOpacity > 0 ? 0 : 1)
.opacity(this.tileOpacity )
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
}
Column(){
... ... @@ -287,8 +296,10 @@ struct MineHomePage {
.scrollBar(BarState.Off)
.width('100%')
.layoutWeight(1)
}.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
}
.margin({top:px2vp(this.topSafeHeight)})
}.width('100%')
.padding({bottom:px2vp(this.bottomSafeHeight)})
.layoutWeight(1)
}else{
Column(){
... ...
... ... @@ -4,6 +4,8 @@ import TrackingPageBrowseUtils from '../utils/TrackingPageBrowseUtils'
@Entry
@Component
struct MineMessagePage {
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
onPageShow(): void {
TrackingPageBrowseUtils.TrackingPageBrowseExposureStart()
... ... @@ -15,7 +17,12 @@ struct MineMessagePage {
build() {
Column(){
Column(){
MessageListUI()
}
}.width("100%")
.height("100%")
.padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)})
}
}
\ No newline at end of file
... ...
... ... @@ -70,7 +70,6 @@ struct OtherNormalUserHomePage {
.width('100%')
.height('355lpx')
.objectFit(ImageFit.Cover)
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
Row()
.height(px2vp(this.topSafeHeight))
... ... @@ -78,7 +77,6 @@ struct OtherNormalUserHomePage {
.backgroundColor($r('app.color.white'))
.visibility(this.tileOpacity > 0 ? 0 : 1)
.opacity(this.tileOpacity )
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
}
Column(){
... ... @@ -254,7 +252,7 @@ struct OtherNormalUserHomePage {
.scrollBar(BarState.Off)
.width('100%')
.layoutWeight(1)
}.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
}
}.width('100%')
.layoutWeight(1)
}else{
... ...
... ... @@ -10,6 +10,8 @@ struct SearchPage {
@State fromTabName: string = 'NEWS';
pageShowTime:number = 0;
pageHideTime:number = 0;
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
onPageShow() {
this.fromTabName = this.params?.['tabName'];
... ... @@ -25,9 +27,13 @@ struct SearchPage {
build() {
Column(){
Column(){
SearchComponent({fromTabName:$fromTabName})
}.height('100%')
.width('100%')
.backgroundColor($r('app.color.white'))
}.width("100%")
.height("100%")
.padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)})
}
}
\ No newline at end of file
... ...
... ... @@ -5,11 +5,19 @@ const TAG = "SubscribeMessagePage"
@Entry
@Component
struct SubscribeMessagePage {
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
build() {
Column(){
Column(){
SubscribeMessageComponent()
}.height("100%")
.width("100%")
}.width("100%")
.height("100%")
.padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)})
}
}
\ No newline at end of file
... ...
... ... @@ -16,6 +16,7 @@ import { CommentListItem } from '../viewmodel/CommentListItem';
struct VisitorCommentPage {
@State data: LazyDataSource<CommentListItem> = new LazyDataSource();
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
@State count: number = 0;
@State isLoading: boolean = false
@State hasMore: boolean = true
... ... @@ -35,13 +36,14 @@ struct VisitorCommentPage {
}
build() {
Column(){
Column() {
//标题栏目
CustomTitleUI({ titleName: "评论列表" })
if (this.count == 0) {
if (this.isGetRequest == true) {
if(this.isConnectNetwork){
EmptyComponent({ emptyType: 10 })
EmptyComponent({ emptyType: 11 })
.height('100%')
.width('100%')
}else{
... ... @@ -68,7 +70,6 @@ struct VisitorCommentPage {
.width("100%")
.height("100%")
.backgroundColor($r('app.color.white'))
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
CustomPullToRefresh({
alldata:this.data,
scroller:this.scroller,
... ... @@ -99,6 +100,10 @@ struct VisitorCommentPage {
.backgroundColor($r('app.color.color_transparent'))
.height('100%')
.width('100%')
}.width("100%")
.height("100%")
.padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)})
}
@Builder ListLayout(){
... ...
... ... @@ -311,8 +311,6 @@ export struct VideoChannelDetail {
.curve(Curves.initCurve(Curve.EaseIn))
.width('100%')
.height('100%')
// 扩展至所有非安全区域
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
.onChange((index: number) => {
this.currentIndex = index
console.info('onChange==', index.toString())
... ...
... ... @@ -72,7 +72,14 @@ struct MultiPictureDetailPage {
onPageShow(): void {
console.log(TAG, 'onPageShow')
this.pageShowTime = DateTimeUtils.getTimeStamp()
/*// 获取当前应用窗口
let windowClass: window.Window = window.getLastWindow(this.context)
// 将状态栏和导航栏的背景色设置为跟应用窗口相同的颜色
windowClass.setWindowSystemBarProperties({
navigationBarColor: color,
statusBarColor: barColor,
statusBarContentColor: barContentColor,
})*/
}
onPageHide(): void {
... ...
... ... @@ -114,7 +114,7 @@ export struct BottomNavigationComponent {
.barMode(BarMode.Fixed)
.barBackgroundColor(this.barBackgroundColor)
// 备注:鸿蒙目前只有修改三线导航背景方法,对于全面屏导航条手机需要设置背景色并使其扩散到导航区域
.backgroundColor(this.barBackgroundColor)
// .backgroundColor(this.barBackgroundColor)
.layoutWeight(1)
Blank().width('100%').height(this.bottomRectHeight1).backgroundColor(this.barBackgroundColor)
... ...
... ... @@ -33,6 +33,7 @@ export struct VideoChannelPage {
// 传递给page的自动刷新通知
@State autoRefresh2Page: number = 0
@Provide showComment: boolean = false
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
aboutToAppear(): void {
this.setBarBackgroundColor()
console.log(TAG, 'aboutToAppear')
... ... @@ -71,7 +72,6 @@ export struct VideoChannelPage {
}
.width('100%')
.height('100%')
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
}
@Builder
... ... @@ -151,7 +151,9 @@ export struct VideoChannelPage {
}
.zIndex(20)
.height($r('app.float.top_tab_bar_height_common'))
.margin({ top: 10 })
.margin({
top: px2vp(this.topSafeHeight)
})
.visibility(this.displayDirection === DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None)
}
... ... @@ -180,7 +182,7 @@ export struct VideoChannelPage {
channelId: item.channelId + '',
autoRefresh: this.autoRefresh
})
.padding({ top: 55 })
.padding({ top: px2vp(this.topSafeHeight) + 55 })
.backgroundColor(Color.White)
}
}, (item: TopNavDTO) => item.channelId + '')
... ...