wangliang_wd

Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool into main

* 'main' of http://192.168.1.42/developOne/harmonyPool:
  频道全屏修改
  desc:全屏 我的 主页  状态栏 颜色适配
  fix:somobug
  fix: 18449 UI还原问题-【uat】直播预告、乡村振兴、月度排行 向左滑动,“查看更多” “松手查看” 文案字体偏小
  desc:用户主页 适配全屏
  fix:somobug
  desc:全屏适配
  fix: 17543 功能缺陷-页面加载-信息流图片加载,手机打开仅wifi加载图片控制,进入教育频道,长图图片未显示
  fix:somobug
  fix: 18540 人民号动态多图图片存在部分被截断
  fix(动态详情):顶部底部适配
  fix: 1、uat】人民号>关注tab,点击号头像没有跳转到号主页
  fix: 直播预告向左滑动到底,预期显示查看更多模块,松手会跳转到直播预告详情页,实际没有效果,看图,并且更多按钮没有显示
  进入人民号-推荐,查看任意人民号-视频详情页,鸿蒙版丢失底部评论区
  fix: 18562 头图卡-设置不展示标题_客户端不该展示标题
  desc:登录相关页面 适配全屏
  desc:重置密码 适配 折叠屏
  feat: 1、直播全屏聊天室,重试机制
Showing 55 changed files with 400 additions and 143 deletions
... ... @@ -106,10 +106,11 @@ export class ProcessUtils {
case ContentConstants.TYPE_AUDIO:
ProcessUtils.gotoAudio(content)
break;
case ContentConstants.TYPE_TELETEXT:case ContentConstants.TYPE_Activity:
case ContentConstants.TYPE_TELETEXT:
case ContentConstants.TYPE_Activity:
// 图文详情,跳转h5
if (content?.linkUrl) { //有 linkUrl 走专题页展示逻辑
ProcessUtils.gotoSpecialTopic(content,true)
ProcessUtils.gotoSpecialTopic(content, true)
} else {
ProcessUtils.gotoWeb(content);
}
... ... @@ -171,17 +172,17 @@ export class ProcessUtils {
let relIndex = 0;
for (let index = 0; index < photoList.length; index++) {
const element = photoList[index];
if(!StringUtils.isEmpty(element.picPath)){
relIndex = relIndex+1
if (!StringUtils.isEmpty(element.picPath)) {
relIndex = relIndex + 1
}
}
tempP.length = relIndex
relIndex = 0
for (let index = 0; index < photoList.length; index++) {
const element = photoList[index];
if(!StringUtils.isEmpty(element.picPath)){
if (!StringUtils.isEmpty(element.picPath)) {
tempP[relIndex] = element
relIndex = relIndex+1
relIndex = relIndex + 1
}
}
photoList.length = tempP.length
... ... @@ -243,7 +244,7 @@ export class ProcessUtils {
public static gotoDefaultWeb(content: ContentDTO) {
// 内链
if(content.openType == '1'){
if (content.openType == '1') {
let taskAction: Action = {
type: 'JUMP_H5_BY_WEB_VIEW',
params: {
... ... @@ -251,10 +252,10 @@ export class ProcessUtils {
} as Params,
};
WDRouterRule.jumpWithAction(taskAction)
}else if(content.openType == '2') {
} else if (content.openType == '2') {
// 外链
ProcessUtils.jumpExternalWebPage(content.linkUrl);
}else {
} else {
// 无需跳转
}
... ... @@ -476,9 +477,14 @@ export class ProcessUtils {
/**
* 跳转人民号主页
* @params creatorId 创作者id
* @param creatorId 创作者id
* @param banControl 是否封禁可以查看号主页 0 可以,1不可以
* @param mainControl 中文端账号是否拥有主页展示权限:0-未拥有,1-拥有
* @param userId 用户id
* @param userType 用户类型 1: 普通用户,2: 创作者 3: 矩阵号 4:运营子账号 5:内容源账号
*/
public static gotoPeopleShipHomePage(creatorId: string) {
public static gotoPeopleShipHomePage(creatorId: string, banControl?: number, mainControl?: number, userId?: string,
userType?: string) {
let params = { 'creatorId': creatorId } as Record<string, string>;
WDRouterRule.jumpWithPage(WDRouterPage.peopleShipHomePage, params)
}
... ...
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) {
... ...
... ... @@ -82,6 +82,9 @@ export struct DynamicDetailComponent {
@State openLikes: boolean = false // 是否可以点赞 1:可以 0:不可以
pageParam: ParamType = {}
// @Provide bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
@Provide topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
async aboutToAppear() {
await this.getContentDetailData()
// 内容用 点赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空
... ... @@ -112,7 +115,7 @@ export struct DynamicDetailComponent {
.width('100%')
.alignItems(VerticalAlign.Bottom)
.padding({ bottom: 5 })
.margin({top: `${this.topSafeHeight}px`})
//分割线
Image($r('app.media.ic_news_detail_division'))
.width('100%')
... ... @@ -570,6 +573,7 @@ export struct DynamicDetailComponent {
})
.height(100)
}
.margin({bottom: 65})
}
.alignSelf(ItemAlign.Start)
.backgroundColor('#FFFFFFFF')
... ...
... ... @@ -9,7 +9,7 @@ import { RmhInfoDTO, CompDTO, ContentDTO } from 'wdBean'
import { CommonConstants } from 'wdConstant/Index';
import { DateTimeUtils, SPHelper, Logger, ToastUtils } from 'wdKit';
import { SpConstants } from 'wdConstant/Index'
import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
import { ProcessUtils, WDRouterPage, WDRouterRule } from 'wdRouter/Index';
import router from '@ohos.router'
import { postBatchAttentionStatusParams } from 'wdBean/Index';
import { MultiPictureDetailViewModel } from '../../viewmodel/MultiPictureDetailViewModel'
... ... @@ -180,5 +180,11 @@ export struct RmhTitle {
}
.width(CommonConstants.FULL_WIDTH)
.margin({ bottom: 10 })
.onClick(()=>{
// 跳转号主
ProcessUtils.gotoPeopleShipHomePage( this.rmhInfo?.rmhId,this.rmhInfo?.banControl,this.rmhInfo?.cnMainControl,this.rmhInfo?.userId,this.rmhInfo?.userType)
})
}
}
\ No newline at end of file
... ...
... ... @@ -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'))
... ...
... ... @@ -53,7 +53,7 @@ export struct Card5Component {
}
)
.aspectRatio(343 / 225)
if (this.titleShowPolicy === 1 || this.titleShowPolicy === null || this.titleShowPolicy === '') {
if (!!this.titleShowPolicy) {
Row()
.borderRadius(
{
... ...
... ... @@ -74,6 +74,10 @@ export struct ZhSingleRow02 {
}
}
showMore() {
return !!this.compDTO.dataSourceType || !(this.compDTO?.objectType === '0' || this.compDTO?.objectType === '')
}
build() {
Column() {
//顶部
... ... @@ -93,7 +97,7 @@ export struct ZhSingleRow02 {
.margin({ right: 8 })
})
}
if (this.compDTO.operDataList.length >= 2 && !(this.compDTO?.objectType === '0' || this.compDTO?.objectType === '')) {
if (this.compDTO.operDataList.length >= 2 && this.showMore()) {
Row() {
Ellipse()
.width(2* (this.moreWidth - this.initMoreWidth - 1))
... ... @@ -104,7 +108,7 @@ export struct ZhSingleRow02 {
Column() {
if (this.moreWidth > this.initMoreWidth + 2) {
Text(this.moreTips)
.fontSize(8)
.fontSize(9)
.fontColor(0x858585)
.width(8)
}
... ... @@ -182,7 +186,7 @@ export struct ZhSingleRow02 {
.padding({
right: $r('app.float.card_comp_pagePadding_lf'),
})
.visibility(this.compDTO?.objectType === '0' || this.compDTO?.objectType === '' ? Visibility.None : Visibility.Visible)
.visibility(this.showMore() ? Visibility.Visible : Visibility.None)
.onClick(() => {
if (this.compDTO?.objectType === '11') {
ProcessUtils.jumpChannelTab(this.compDTO.objectId, this.compDTO.pageId as string, this.compDTO.objectTitle)
... ...
... ... @@ -150,7 +150,10 @@ export struct ZhSingleRow03 {
return str.slice(0)
}
}
}
showMore() {
return !!this.compDTO.dataSourceType || !(this.compDTO?.objectType === '0' || this.compDTO?.objectType === '')
}
build() {
... ... @@ -165,7 +168,7 @@ export struct ZhSingleRow03 {
this.ItemCard(item)
})
}
if (this.compDTO.operDataList.length >= 2 && !(this.compDTO?.objectType === '0' || this.compDTO?.objectType === '')) {
if (this.compDTO.operDataList.length >= 2 && this.showMore()) {
Row() {
Ellipse()
.width(2* (this.moreWidth - this.initMoreWidth - 1))
... ... @@ -176,7 +179,7 @@ export struct ZhSingleRow03 {
Column() {
if (this.moreWidth > this.initMoreWidth + 2) {
Text(this.moreTips)
.fontSize(8)
.fontSize(9)
.fontColor(0x858585)
.width(8)
}
... ... @@ -401,7 +404,7 @@ export struct ZhSingleRow03 {
.fontWeight(600)
}
if (!(this.compDTO?.objectType === '0' || this.compDTO?.objectType === '')) {
if (this.showMore()) {
Row() {
Text("更多")
.fontSize($r("app.float.font_size_14"))
... ...
... ... @@ -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
... ...
... ... @@ -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)})
}
// 私有方法
... ...
... ... @@ -206,6 +206,7 @@ export struct PeopleShipHomeArticleListComponent {
}
for (const element of listData.list) {
let contentDTO = new ContentDTO()
console.info(TAG, 'element.appStyle'+`${element.appStyle}`)
contentDTO.appStyle = this.changeCommon(element.appStyle)
contentDTO.newsTitle = element.title;
contentDTO.newsSummary = element.description;
... ...
... ... @@ -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)
}
... ...
... ... @@ -158,6 +158,7 @@ export struct OperRowListView {
console.info(TAG, 'contentDetailData----', JSON.stringify(this.contentDetailData))
console.info(TAG, 'likeBean----', JSON.stringify(this.likeBean))
console.info(TAG, 'this.operationButtonList', JSON.stringify(this.operationButtonList))
// 评论需要数据
/* this.publishCommentModel.targetId = this.contentDetailData.newsId + ''
this.publishCommentModel.targetRelId = this.contentDetailData.reLInfo?.relId + ''
... ...
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
... ...
... ... @@ -140,7 +140,6 @@ export struct MultiPictureListPage {
.id('e_picture_container')
// 设置顶部绘制延伸到状态栏
// 设置底部绘制延伸到导航条
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
}
/**
... ...
... ... @@ -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(){
... ...
... ... @@ -40,8 +40,6 @@ export struct DetailPlayLivePage {
@State lastInputedLiveComment: LiveRoomItemBean = {} as LiveRoomItemBean // 上次输入的直播间消息
@State lastInputedChatComment: LiveRoomItemBean = {} as LiveRoomItemBean // 上次输入的大家聊消息
aboutToAppear(): void {
Logger.info(TAG, `wyj-aboutToAppear`)
... ... @@ -72,7 +70,6 @@ export struct DetailPlayLivePage {
TopPlayComponent({ playerController: this.playerController })
.height(this.displayDirection == DisplayDirection.VERTICAL ? 211 : '100%')
TabComponent({
tabs: this.tabs,
changeToTab: this.changeToTab,
... ...
import { LiveRoomDataBean } from 'wdBean/Index';
import { ContentDetailDTO, LiveRoomDataBean } from 'wdBean/Index';
import { LiveViewModel } from '../viewModel/LiveViewModel';
import { WindowModel } from 'wdKit/Index';
import { PlayerComponent } from '../widgets/vertical/PlayerComponent';
... ... @@ -22,6 +22,7 @@ export struct DetailPlayVLivePage {
private liveViewModel: LiveViewModel = new LiveViewModel()
private playerController: WDAliPlayerController = new WDAliPlayerController();
private swiperController: SwiperController = new SwiperController()
@Consume contentDetailData: ContentDetailDTO
@Provide bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
@Provide topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
@Provide liveRoomDataBean: LiveRoomDataBean = {} as LiveRoomDataBean
... ... @@ -36,6 +37,9 @@ export struct DetailPlayVLivePage {
@Consume contentId: string
@State swiperIndex: number = 1
@Consume liveDetailPageLogic: LiveDetailPageLogic
//播放错误
@State isPlayerError: boolean = false
@State isCanplay: boolean = false
aboutToAppear(): void {
this.openFullScreen()
... ... @@ -78,28 +82,27 @@ export struct DetailPlayVLivePage {
LiveEmptyComponent({
emptyType: WDLiveViewDefaultType.WDViewDefaultType_NoLiveSuspend
})
.height('40%').margin({top:this.topSafeHeight })
.height('40%').margin({ top: this.topSafeHeight })
} else {
if (this.liveDetailPageLogic.showPad) {
// 有垫片
if(this.liveDetailPageLogic.padImageUri.length > 0){
if (this.liveDetailPageLogic.padImageUri.length > 0) {
// 配置了垫片资源
Image(this.liveDetailPageLogic.padImageUri).objectFit(ImageFit.Fill).width('100%').height('100%')
}else {
} else {
// 没有配置垫片资源
LiveEmptyComponent({
emptyType: WDLiveViewDefaultType.WDViewDefaultType_NoLiveSuspend
})
.height('40%').margin({top:this.topSafeHeight })
.height('40%').margin({ top: this.topSafeHeight })
}
} else {
// 播放器
PlayerComponent({
playerController: this.playerController
playerController: this.playerController, isPlayerError: this.isPlayerError, isCanplay: this.isCanplay
})
}
}
... ... @@ -110,6 +113,44 @@ export struct DetailPlayVLivePage {
swiperController: this.swiperController,
swiperIndex: $swiperIndex
})
// 直播资源加载失败
Column() {
Text('直播加载中,请稍候重试')
.fontSize('20fp')
.fontWeight(500)
.margin({ top: 16 })
.fontColor(Color.White)
Button('点击重试')
.type(ButtonType.Normal)
.width(80)
.height(28)
.backgroundColor(Color.Transparent)
.fontColor('#ffcccccc')
.border({ width: 1 })
.borderColor('#4dffffff')
.borderRadius(4)
.fontSize($r('app.float.font_size_12'))
.margin({ top: 16 })
.padding(0)
.onClick(() => {
this.isCanplay = false
this.isPlayerError = false
this.playerController?.firstPlay(this.playUrl, TrackConstants.PageName.Live_Detail, {
'contentType': `${this.contentDetailData.newsType}`,
'contentId': `${this.contentDetailData.newsId}`,
'contentName': `${this.contentDetailData.newsTitle || ''}`,
});
})
}
.width('100%')
.margin({ top: 195 })
.justifyContent(FlexAlign.Center)
.visibility(this.isPlayerError ? Visibility.Visible :
Visibility.None)
// 清屏按钮
Image($r('app.media.icon_live_more'))
.width(40)
... ...
... ... @@ -25,7 +25,7 @@ export struct TopPlayComponent {
//已结束直播
@State isEnd: boolean = false
//播放错误
@State isError: boolean = false
@State isPlayerError: boolean = false
// loading 控制字段
@State isHideLoading: boolean = false
// 获取播放资源能播放了
... ... @@ -50,14 +50,14 @@ export struct TopPlayComponent {
this.playSourceState = status
Logger.debug(TAG, 'status==>' + status)
if (status === PlayerConstants.STATUS_ERROR) {
this.isError = true
this.isPlayerError = true
this.isHideLoading = true
this.isCanPlay = false
} else if (status === PlayerConstants.STATUS_COMPLETION) {
// 播放完成
} else {
this.isError = false
this.isPlayerError = false
}
}
... ... @@ -186,7 +186,7 @@ export struct TopPlayComponent {
onLoad: async () => {
if (StringUtils.isNotEmpty(this.playUrl)) {
this.isHideLoading = false
this.isError = false
this.isPlayerError = false
this.xComponentIsLoaded = true
Logger.debug(TAG, `---onLoad------>`)
this.tryToPlay()
... ... @@ -265,12 +265,12 @@ export struct TopPlayComponent {
.padding(0)
.onClick(() => {
this.isHideLoading = false
this.isError = false
this.isPlayerError = false
this.xComponentIsLoaded = true
this.tryToPlay()
})
}.width('100%').visibility(this.isError ? Visibility.Visible :
}.width('100%').visibility(this.isPlayerError ? Visibility.Visible :
Visibility.None)
}
... ...
import { ContentDetailDTO } from 'wdBean/Index';
import { AliPlayerRenderView, WDAliPlayerController, WDPlayerRenderVLiveView } from 'wdPlayer/Index';
import { AliPlayerRenderView, PlayerConstants, WDAliPlayerController, WDPlayerRenderVLiveView } from 'wdPlayer/Index';
import { ParamType, TrackConstants } from 'wdTracking/Index';
import { PictureLoading } from './PictureLoading';
... ... @@ -20,8 +20,10 @@ export struct PlayerComponent {
// 0-横屏流画面,1-竖屏幕流画面
@State liveStreamType: number | null = -1
@State playUrl: string = ''
@State isCanplay: boolean = false
pageParam: ParamType = {}
// 播放失败
@Link isPlayerError: boolean
@Link isCanplay: boolean
pageShowChange() {
this.playerController?.play()
... ... @@ -31,10 +33,33 @@ export struct PlayerComponent {
this.playerController?.pause()
}
async aboutToAppear(): Promise<void> {
aboutToAppear(){
if (this.playerController) {
this.playerController.onCanplay = () => {
this.isCanplay = true
this.playerController?.play()
}
this.playerController.onStatusChange = (status: number) => {
if (status === PlayerConstants.STATUS_ERROR) {
this.isPlayerError = true
this.isCanplay = true
} else if (status === PlayerConstants.STATUS_COMPLETION) {
// 播放完成
} else {
//this.isPlayerError = false
}
}
}
setTimeout(() => {
this.updateData()
}, 10)
}
async aboutToDisappear(): Promise<void> {
... ... @@ -65,17 +90,16 @@ export struct PlayerComponent {
this.liveStreamType = liveStreamType
this.playUrl = playUrl
}
console.error("XXXXZZZZ", 'updateData ----liveState==>' + this.playUrl)
}
build() {
Column() {
Stack() {
// TODO:判断横竖屏,liveStreamType=1竖屏铺满屏幕,裁剪不拉伸,liveStreamType=0横屏正常展示
if (this.liveStreamType == null || this.liveStreamType == 1) {
WDPlayerRenderVLiveView({
playerController: this.playerController,
onLoad: () => {
console.error("XXXXZZZZ", '-------------1--------' + this.playUrl)
this.isCanplay = true
this.contentTrackingDict()
this.playerController?.firstPlay(this.playUrl, TrackConstants.PageName.Live_Detail, this.pageParam);
... ... @@ -94,21 +118,14 @@ export struct PlayerComponent {
PictureLoading().visibility(this.isCanplay ? Visibility.None : Visibility.Visible)
}
.height('100%')
.width('100%')
.align(Alignment.Top)
.alignContent(Alignment.Top)
.onClick(() => {
if (this.liveState === 'end') {
this.isShowControl = !this.isShowControl
}
})
}
.height('100%')
.width('100%')
}
contentTrackingDict() {
this.pageParam = {
... ...
... ... @@ -172,6 +172,7 @@ export struct DetailPlayShortVideoPage {
this.queryNewsInfoOfUser()
this.contentTrackingDict()
this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '')
}
contentTrackingDict() {
... ...
... ... @@ -45,7 +45,7 @@ export struct VideoChannelDetail {
@Prop @Watch('autoRefreshChange') autoRefresh: number = 0
@Consume barBackgroundColor: Color
private swiperController: SwiperController = new SwiperController()
@Provide showComment: boolean = false
@Consume showComment: boolean
@Provide windowWidth: number = AppStorage.get<number>('windowWidth') || 0
@Provide windowHeight: number = AppStorage.get<number>('windowHeight') || 0
@Provide bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
... ... @@ -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())
... ...
@Entry
@Component
struct Index {
@State message: string = 'Hello World';
build() {
Row() {
Column() {
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
}
.width('100%')
}
.height('100%')
}
}
\ No newline at end of file
... ... @@ -24,6 +24,8 @@ struct ChangeBindPhonePage {
lastTime: number = 0
pageShowTime:number = 0;
pageHideTime:number = 0;
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
onPageShow() {
... ... @@ -58,6 +60,7 @@ struct ChangeBindPhonePage {
build() {
Column(){
Column() {
Image($r('app.media.login_back_icon')).width(24).height(24).margin({ left: 15, top: 10 }).onClick(() => {
router.back()
... ... @@ -156,6 +159,10 @@ struct ChangeBindPhonePage {
.padding({ left: 25, right: 25 })
}.width('100%').height('100%').alignItems(HorizontalAlign.Start)
}.width("100%")
.height("100%")
.padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)})
}
//发送验证码
... ...
... ... @@ -23,6 +23,8 @@ struct ForgetPasswordPage {
@State pageTitle:string = '找回密码';
@State isForgetPassword: number = 0 //是否是登录页忘记密码过来的,标题不一样
@State codeStateSuccess:boolean=false
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
onCodeSend() {
if (this.isCodeSend) {
this.sendVerifyCode()
... ... @@ -43,6 +45,7 @@ struct ForgetPasswordPage {
build() {
Column(){
Column() {
Image($r('app.media.login_back_icon')).width(24).height(24).margin({ left: 15, top: 10 }).onClick(() => {
router.back()
... ... @@ -79,6 +82,11 @@ struct ForgetPasswordPage {
.height('100%')
.alignItems(HorizontalAlign.Start)
.backgroundColor(Color.White)
}.width("100%")
.height("100%")
.padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)})
}
aboutToAppear() {
... ...
... ... @@ -27,6 +27,8 @@ const TAG = "LoginPage"
@Entry
@Component
struct LoginPage {
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
@State codeBtnState: boolean = false
@State timeCount: number = 60
phoneController: TextInputController = new TextInputController()
... ... @@ -104,6 +106,7 @@ struct LoginPage {
}
build() {
Column(){
Stack() {
RelativeContainer() {
... ... @@ -242,8 +245,12 @@ struct LoginPage {
.visibility(this.isProtocol ? Visibility.Visible : Visibility.None)
}.width('100%')
.height('100%')
.height("100%")
.backgroundColor(Color.White)
}.width("100%")
.height("100%")
.padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)})
}
@Builder
... ...
... ... @@ -10,6 +10,8 @@ const TAG = 'LoginProtocolWebview';
@Entry
@Component
struct LoginProtocolWebview {
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
webUrl: string = ''
webviewController: webview.WebviewController = new webview.WebviewController()
userProtocol = "https://cdnpeoplefrontuat.aikan.pdnews.cn/rmrb/rmrb-protocol-zh-web/0.0.1/app/protocol-1005.html"
... ... @@ -55,7 +57,7 @@ struct LoginProtocolWebview {
}
build() {
Column(){
Column() {
Row() {
Image($r("app.media.login_back_icon"))
... ... @@ -88,5 +90,9 @@ struct LoginProtocolWebview {
})
.padding({bottom:this.contentID === "2" ? "40lpx" : 0 })
}
}.width("100%")
.height("100%")
.padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)})
}
}
\ No newline at end of file
... ...
... ... @@ -12,6 +12,8 @@ import { TrackingPageBrowse, TrackConstants, TrackingButton } from 'wdTracking/I
@Entry
@Component
struct ModifyPasswordPage {
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
password_old: string = '';
password_new: string = '';
password_new_repeat: string = '';
... ... @@ -64,9 +66,13 @@ struct ModifyPasswordPage {
build() {
Column(){
Column(){
this.TitleBackComponent('')
this.ModifyPasswordLayout()
}
}.width("100%")
.height("100%")
.padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)})
}
... ...
... ... @@ -2,7 +2,7 @@ import ArrayList from '@ohos.util.ArrayList';
import { Params } from '../../../../../../../commons/wdRouter/oh_modules/wdBean/Index';
import router from '@ohos.router';
import { LoginViewModel } from './LoginViewModel';
import { CustomToast, DateTimeUtils, Logger, SPHelper, ToastUtils } from 'wdKit';
import { BreakpointSystem, CustomToast, DateTimeUtils, Logger, SPHelper, ToastUtils } from 'wdKit';
import {
SpConstants
} from '../../../../../../../commons/wdNetwork/oh_modules/wdConstant/src/main/ets/constants/SpConstants'
... ... @@ -74,6 +74,19 @@ export struct SettingPasswordPage {
pageHideResetTime:number = 0;
pageShowSetTime:number = 0;
pageHideSetTime:number = 0;
@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"){
this.percent = 0.7
}else {
this.percent = 1
}
}
onPageShow(): void {
if (this.pageType === 0){//重置密码
... ... @@ -83,6 +96,10 @@ export struct SettingPasswordPage {
}
}
calcHeight(value:number): number{
return value * this.percent
}
onPageHide(): void {
if (this.pageType === 0){
this.pageHideResetTime = DateTimeUtils.getTimeStamp()
... ... @@ -104,7 +121,13 @@ export struct SettingPasswordPage {
}
}
aboutToDisappear(): void {
this.breakpointSystem.unregister();
}
aboutToAppear() {
this.breakpointSystem.register();
this.currentChanged()
let params:SettingPasswordParams = router.getParams() as SettingPasswordParams;
this.pageId = parseInt(params.pageID);
this.getPageListData(this.pageId)
... ... @@ -147,10 +170,48 @@ export struct SettingPasswordPage {
}
build() {
Navigation() {
Column(){
Column(){
this.TitleBackComponent('')
this.settingList() //滑动区域
}.titleMode(NavigationTitleMode.Mini)
.title('')
}
}.width("100%")
.height("100%")
.padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)})
}
@Builder TitleBackComponent(title:string){
RelativeContainer() {
Text(title)
.fontColor('#FF333333')
.fontSize(`${this.calcHeight(18)}`)
.textAlign(TextAlign.Center)
.height(`${this.calcHeight(44)}`)
.alignRules({
top: { anchor: "__container__", align: VerticalAlign.Top },
left: { anchor: "__container__", align: HorizontalAlign.Start },
right: { anchor: "__container__", align: HorizontalAlign.End },
})
.id('titleContent')
Image($r("app.media.login_back_icon"))
.objectFit(ImageFit.Auto)
.height(`${this.calcHeight(24)}`)
.width(`${this.calcHeight(24)}`)
.margin({
left: `${this.calcHeight(16)}`, top: `${this.calcHeight(8)}`
})
.alignRules({
top: { anchor: "__container__", align: VerticalAlign.Top },
left: { anchor: "__container__", align: HorizontalAlign.Start },
})
.onClick(() => {
router.back()
})
.id('backImage')
}.height(`${this.calcHeight(44)}`)
}
// 页面布局
... ... @@ -176,7 +237,7 @@ export struct SettingPasswordPage {
})
}
}.width('100%')
.padding({ left:"31lpx",right:"31lpx",top:"131lpx" })
.padding({ left:`${this.calcHeight(31)}lpx`,right:`${this.calcHeight(31)}lpx`,top:`${this.calcHeight(131)}lpx` })
.height('100%')
}
... ... @@ -185,10 +246,10 @@ export struct SettingPasswordPage {
// 标题
@Builder getTitleCell(item: AccoutPageDataModel, alignTitle: HorizontalAlign) {
Column() {
Text(item.compTitle).fontWeight(FontWeight.Bold).fontSize(20).maxLines(1)
Text(item.compTitle).fontWeight(FontWeight.Bold).fontSize(`${this.calcHeight(20)}`).maxLines(1)
}
.width('100%')
.height('75lpx')
.height(`${this.calcHeight(75)}lpx`)
.alignItems(alignTitle)
}
... ... @@ -210,12 +271,12 @@ export struct SettingPasswordPage {
})
}
.alignItems(VerticalAlign.Center)
.height('80lpx')
.height(`${this.calcHeight(80)}lpx`)
.backgroundColor('#f5f5f5')
.borderRadius('4vp')
.borderRadius(`${this.calcHeight(4)}`)
}
.width('100%')
.height('110lpx')
.height(`${this.calcHeight(110)}lpx`)
.backgroundColor(0xffffff0)
.alignItems(VerticalAlign.Center)
}
... ... @@ -235,12 +296,12 @@ export struct SettingPasswordPage {
})
}
.alignItems(VerticalAlign.Center)
.height('80lpx')
.height(`${this.calcHeight(80)}lpx`)
.backgroundColor('#f5f5f5')
.borderRadius('4vp')
.borderRadius(`${this.calcHeight(4)}`)
}
.width('100%')
.height('110lpx')
.height(`${this.calcHeight(110)}lpx`)
.backgroundColor(0xffffff0)
.alignItems(VerticalAlign.Center)
}
... ... @@ -249,7 +310,7 @@ export struct SettingPasswordPage {
@Builder getCodeCell(item: AccoutPageDataModel) {
Row() {
Stack() {
Image($r('app.media.get_code_bg')).width('100%').borderRadius('4vp')
Image($r('app.media.get_code_bg')).width('100%').borderRadius(`${this.calcHeight(4)}`)
Row() {
TextInput({ placeholder: item.inputPlacholder })
.placeholderColor("#CCCCCC")
... ... @@ -264,10 +325,10 @@ export struct SettingPasswordPage {
.fontColor('#da3e22')
}
.width('100%')
}.height('80lpx')
}.height(`${this.calcHeight(80)}lpx`)
}
.width('100%')
.height('110lpx')
.height(`${this.calcHeight(110)}lpx`)
.backgroundColor(0xffffff0)
.alignItems(VerticalAlign.Center)
}
... ... @@ -275,7 +336,7 @@ export struct SettingPasswordPage {
// desc
@Builder getDescCell(item: AccoutPageDataModel, alignTitle: HorizontalAlign) {
Column() {
Text(item.compDesc).fontSize(12).maxLines(3).fontColor(0x999999).padding({top:'10lpx'})
Text(item.compDesc).fontSize(`${this.calcHeight(12)}`).maxLines(3).fontColor(0x999999).padding({top:`${this.calcHeight(10)}lpx`})
.onClick(()=>{
if (item.compDesc == '忘记密码') {
this.showToastTip('密码不符合密码规范')
... ... @@ -283,7 +344,7 @@ export struct SettingPasswordPage {
})
}
.width('100%')
.height('85lpx')
.height(`${this.calcHeight(85)}lpx`)
.alignItems(alignTitle)
}
... ... @@ -293,29 +354,29 @@ export struct SettingPasswordPage {
Text(item.compButtonTitle)
.layoutWeight(1)
.fontColor("#FFFFFF")
.borderRadius(4)
.fontSize(18)
.borderRadius(`${this.calcHeight(4)}`)
.fontSize(`${this.calcHeight(18)}`)
.textAlign(TextAlign.Center)
.fontWeight(FontWeight.Medium)
.margin({ top: 26 })
.height(44)
.margin({ top: `${this.calcHeight(26)}` })
.height(`${this.calcHeight(44)}`)
.backgroundColor("#ED2800")
.enabled(this.btnStatus ? true : false)
.opacity(this.btnStatus ? 1: 0.6)
.onClick(() => {
this.buttonClick()
})
}.padding({top:'25lpx'})
}.padding({top:`${this.calcHeight(25)}lpx`})
.width('100%')
}
// 标题
@Builder getLogoCell(item: AccoutPageDataModel) {
Column() {
Image(item.compLogo).height('150lpx').width('150lpx')
Image(item.compLogo).height(`${this.calcHeight(150)}lpx`).width(`${this.calcHeight(150)}lpx`)
}
.width('100%')
.height('200lpx')
.height(`${this.calcHeight(200)}lpx`)
}
/***************************** 事件处理 ******************************************/
... ...
... ... @@ -24,6 +24,8 @@ struct VerifyPhoneNumberPage {
isFirst:boolean=true//是否第一次获取验证码
pageShowTime:number = 0;
pageHideTime:number = 0;
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
onCodeSend() {
if (this.isCodeSend) {
... ... @@ -60,6 +62,7 @@ struct VerifyPhoneNumberPage {
build() {
Column(){
Column() {
Image($r('app.media.login_back_icon')).width(24).height(24).margin({ left: 15, top: 10 }).onClick(() => {
router.back()
... ... @@ -155,6 +158,9 @@ struct VerifyPhoneNumberPage {
}.padding({ left: 25, right: 25 }).width('100%')
}.width('100%').height('100%').alignItems(HorizontalAlign.Start)
}.width("100%")
.height("100%")
.padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)})
}
//发送验证码
... ...
{
"src": [
"pages/Index",
"pages/login/LoginPage",
"pages/login/ForgetPasswordPage",
"pages/login/LoginProtocolWebview",
... ...
... ... @@ -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)
... ...
... ... @@ -32,6 +32,8 @@ export struct VideoChannelPage {
@State indicatorWidth: number = 0
// 传递给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')
... ... @@ -70,7 +72,6 @@ export struct VideoChannelPage {
}
.width('100%')
.height('100%')
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
}
@Builder
... ... @@ -150,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)
}
... ... @@ -179,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 + '')
... ...