yangchenggong1_wd

desc:全屏适配

... ... @@ -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,33 +57,40 @@ export struct SubscribeMessageComponent{
}
}
} else {
CustomPullToRefresh({
alldata:this.data,
scroller:this.scroller,
customList:()=>{
this.ListLayout()
},
onRefresh:(resolve)=>{
this.curPageNum = 1;
this.hasMore = true
this.isGetRequest = false
this.data.clear()
if (!this.isLoading) {
this.getNewPageData()
}
if(resolve) resolve('刷新成功')
},
onLoadMore:(resolve)=> {
if (!this.isLoading) {
//加载分页数据
this.getNewPageData()
Stack(){
Row()
.width("100%")
.height("100%")
.backgroundColor($r('app.color.color_F9F9F9'))
CustomPullToRefresh({
alldata:this.data,
scroller:this.scroller,
customList:()=>{
this.ListLayout()
},
onRefresh:(resolve)=>{
this.curPageNum = 1;
this.hasMore = true
this.isGetRequest = false
this.data.clear()
if (!this.isLoading) {
this.getNewPageData()
}
if(resolve) resolve('刷新成功')
},
onLoadMore:(resolve)=> {
if (!this.isLoading) {
//加载分页数据
this.getNewPageData()
}
}
}
})
.width('100%')
})
.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(){
AppointmentListUI()
}
Column(){
AppointmentListUI()
}
}.width("100%")
.height("100%")
.padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)})
}
}
\ No newline at end of file
... ...
... ... @@ -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,12 +27,16 @@ struct FollowListPage {
}
build() {
Column() {
//Tab 详情
FollowFirstTabsComponent({changeIndex:Number(this.curIndex)})
}
.backgroundColor($r('app.color.white'))
.height('100%')
.width('100%')
Column(){
Column() {
//Tab 详情
FollowFirstTabsComponent({changeIndex:Number(this.curIndex)})
}
.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,22 +155,25 @@ export struct MinePageComponent {
}
build() {
Scroll(this.scroller){
Stack(){
Image($r('app.media.mine_head_bg'))
.width('100%')
.height(`${657 * this.percent}lpx`)
.objectFit(ImageFit.Auto)
this.MinePageUI()
Column(){
Scroll(this.scroller){
Stack(){
Image($r('app.media.mine_head_bg'))
.width('100%')
.height(`${657 * this.percent}lpx`)
.objectFit(ImageFit.Auto)
this.MinePageUI()
}
.alignContent(Alignment.Top)
}
.alignContent(Alignment.Top)
}
.setFullWidthAndHeight()
.backgroundColor($r('app.color.color_F9F9F9'))
.scrollable(ScrollDirection.Vertical)
.scrollBar(BarState.Off)
// 预留状态栏、导航栏高度
.margin({ top: this.topRectHeight})
.setFullWidthAndHeight()
.backgroundColor($r('app.color.color_F9F9F9'))
.scrollable(ScrollDirection.Vertical)
.scrollBar(BarState.Off)
}.width("100%")
.height("100%")
.padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)})
}
... ...
... ... @@ -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,13 +78,17 @@ export struct PrivacySettingPage {
build() {
Column(){
TitleBackComponent({title:"隐私设置"})
//滑动区域
this.PrivacySettingComponentsUI()
}.backgroundColor('#F8F8F8')
.width("100%")
Column(){
TitleBackComponent({title:"隐私设置"})
//滑动区域
this.PrivacySettingComponentsUI()
}.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(){
AboutPageUI()
}.backgroundColor($r('app.color.white'))
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,14 +46,19 @@ struct SettingPage {
}
build() {
Column() {
if (this.pageType == 'mainSetting') {
MineSettingComponent()
} else {
AccountAndSecurityLayout({enterActivityTime:this.enterActivityTime})
}
}.setFullWidth()
.backgroundColor($r("app.color.white"))
Column(){
Column() {
if (this.pageType == 'mainSetting') {
MineSettingComponent()
} else {
AccountAndSecurityLayout({enterActivityTime:this.enterActivityTime})
}
}.setFullWidth()
.backgroundColor($r("app.color.white"))
}.width("100%")
.height("100%")
.padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)})
}
// 私有方法
... ...
... ... @@ -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(){
MessageListUI()
}
Column(){
MessageListUI()
}
}.width("100%")
.height("100%")
.padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)})
}
}
\ No newline at end of file
... ...
... ... @@ -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(){
SearchComponent({fromTabName:$fromTabName})
}.height('100%')
.width('100%')
.backgroundColor($r('app.color.white'))
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(){
SubscribeMessageComponent()
}.height("100%")
.width("100%")
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
... ...