陈剑华

Merge remote-tracking branch 'origin/main'

Showing 20 changed files with 296 additions and 145 deletions
... ... @@ -82,7 +82,6 @@ export struct CompParser {
if (this.compDTO.operDataList[0]?.objectType !== '3' &&
this.compDTO.operDataList[0]?.objectType !== '13') { //暂时屏蔽活动和音频详情入口
if (this.compDTO.compStyle === CompStyle.Label_03) {
LabelComponent({ compDTO: this.compDTO })
Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
... ... @@ -108,7 +107,7 @@ export struct CompParser {
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_03) {
ZhSingleRow03({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName })
Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Grid_Layout_02) { //双列流小视频,一行两图卡 ->标题
//ZhGridLayout02({ compDTO: this.compDTO })
CompNormalTitle({ compDTO: this.compDTO })
... ... @@ -136,7 +135,7 @@ export struct CompParser {
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_03) {
// 大图卡
Card2Component({ compDTO: this.compDTO, contentDTO: this.compDTO.operDataList[0], pageId: this.pageId, pageName: this.pageName })
Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
} else if (this.compDTO.compStyle === CompStyle.Card_09) {
//时间链卡
Card9Component({ compDTO: this.compDTO, contentDTO:this.compDTO.operDataList[0], pageId: this.pageId, pageName: this.pageName })
... ...
... ... @@ -86,6 +86,7 @@ export struct TopNavigationComponentNew {
navIndex: index,
pageId: navItem?.pageId + '',
channelId: navItem?.channelId + '',
autoRefresh: this.autoRefresh2Page
})
} else
if (!this.isBroadcast(navItem) && !this.isLayout(navItem)) {
... ...
... ... @@ -14,7 +14,6 @@ import {
import { ViewType } from 'wdConstant/src/main/ets/enum/ViewType';
import { channelSkeleton } from '../skeleton/channelSkeleton'
import { EmptyComponent } from '../view/EmptyComponent';
import { ErrorComponent } from '../view/ErrorComponent';
import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'
import MinePageDatasModel from '../../model/MinePageDatasModel';
import { FollowListDetailRequestItem } from '../../viewmodel/FollowListDetailRequestItem';
... ... @@ -26,13 +25,14 @@ import PageHelper from '../../viewmodel/PageHelper';
import { PeopleShipAttentionContentListTopComponent } from './PeopleShipAttentionContentListTopComponent'
import { CardParser } from '../CardParser'
import { PeopleShipNoMoreData } from '../reusable/PeopleShipNoMoreData';
const TAG = 'PeopleShipMainComponent';
@Preview
@Component
export struct PeopleShipMainComponent {
@State private pageModel: PageModel = new PageModel();
@State private pageAdvModel: PageAdModel = new PageAdModel();
// 自动刷新通知
@Prop @Watch('onAutoRefresh') autoRefresh: number = 0
navIndex: number = 0;
pageId: string = "";
channelId: string = "";
... ... @@ -416,4 +416,13 @@ export struct PeopleShipMainComponent {
}
}
onAutoRefresh(changedPropertyName: string) {
if (this.navIndex != this.currentTopNavSelectedIndex) {
return
}
// 当前页面,自动刷新数据
Logger.debug(TAG, 'page onAutoRefresh ' + this.autoRefresh)
this.currentPage = 1
this.getData()
}
}
\ No newline at end of file
... ...
... ... @@ -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 = {
... ...
@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()
... ... @@ -138,15 +141,16 @@ struct ChangeBindPhonePage {
Row() {
Text("确认")
.layoutWeight(1)
.fontColor(this.isSubmit ?"#FFFFFFFF":"#66FFFFFF")
.fontColor("#FFFFFF")
.borderRadius(4)
.fontSize(18)
.textAlign(TextAlign.Center)
.fontWeight(FontWeight.Medium)
.margin({ top: 26 })
.height(44)
.backgroundColor(this.isSubmit ?"#ED2800":"#99ED2800")
.backgroundColor("#ED2800")
.enabled(this.isSubmit ? true : false)
.opacity(this.isSubmit ? 1: 0.6)
.onClick(() => {
TrackingButton.click("changePhoneNumberPageConfirm",TrackConstants.PageName.Change_PhoneNum,TrackConstants.PageName.Change_PhoneNum)
this.changeBindPhone()
... ... @@ -155,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()
... ... @@ -60,15 +63,16 @@ struct ForgetPasswordPage {
Row() {
Text("确认")
.layoutWeight(1)
.fontColor(this.isSubmit ?"#FFFFFFFF":"#66FFFFFF")
.fontColor("#FFFFFF")
.borderRadius(4)
.fontSize(18)
.textAlign(TextAlign.Center)
.fontWeight(FontWeight.Medium)
.margin({ top: 26 })
.height(44)
.backgroundColor(this.isSubmit ?"#ED2800":"#99ED2800")
.backgroundColor("#ED2800")
.enabled(this.isSubmit ? true : false)
.opacity(this.isSubmit ? 1: 0.6)
.onClick(() => {
this.checkVerifyCode()
})
... ... @@ -78,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() {
... ... @@ -161,7 +164,7 @@ struct LoginPage {
Row() {
Text("登录")
.borderRadius(4)
.fontColor(this.isSubmit ? "#FFFFFFFF" : "#66FFFFFF")
.fontColor("#FFFFFF")
.fontSize(`${this.calcHeight(31)}lpx`)
.fontWeight(400)
.margin({ top: `${this.calcHeight(20)}` })
... ... @@ -169,7 +172,8 @@ struct LoginPage {
.height(44)
.textAlign(TextAlign.Center)
.width("100%")
.backgroundColor(this.isSubmit ? "#FFED2800" : "#99ED2800")
.backgroundColor("#ED2800")
.opacity(this.isSubmit ? 1: 0.6)
.onClick(() => {
if (!this.isSubmit) {
return
... ... @@ -241,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)})
}
... ... @@ -189,30 +195,30 @@ struct ModifyPasswordPage {
.height(`${this.calcHeight(85)}lpx`)
.alignItems(HorizontalAlign.Start)
Row() {
Button( { type: ButtonType.Normal, stateEffect: true }){
Text("确认")
.fontColor("#fff")
.fontSize(`${this.calcHeight(35)}lpx`)
.lineHeight(`${this.calcHeight(50)}lpx`)
.opacity(this.btnStatus ?1:0.5)
}
.width('100%')
.height(`${this.calcHeight(80)}lpx`)
.backgroundColor(this.btnStatus ? '#ED2800' : '#99ED2800')
.enabled(this.btnStatus ?true:false)
.borderRadius('4vp')
.layoutWeight(1)
.fontColor("#FFFFFF")
.borderRadius(4)
.fontSize(18)
.textAlign(TextAlign.Center)
.fontWeight(FontWeight.Medium)
.margin({ top: 26 })
.height(44)
.backgroundColor("#ED2800")
.enabled(this.btnStatus ? true : false)
.opacity(this.btnStatus ? 1: 0.6)
.onClick(() => {
if(this.btnStatus){
TrackingButton.click("changePasswordPageConfirm",TrackConstants.PageName.Change_Passwd,TrackConstants.PageName.Change_Passwd)
this.submit()
}
})
}
}.width('100%')
.padding({top:`${this.calcHeight(25)}lpx`})
.alignItems(VerticalAlign.Center)
.width('100%')
.height(`${this.calcHeight(120)}lpx`)
Column() {
Text("忘记密码").fontSize(12).maxLines(3).fontColor(0x999999).padding({top:`${this.calcHeight(10)}lpx`})
... ...
... ... @@ -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,37 +344,39 @@ export struct SettingPasswordPage {
})
}
.width('100%')
.height('85lpx')
.height(`${this.calcHeight(85)}lpx`)
.alignItems(alignTitle)
}
// 按钮
@Builder getButtonCell(item: AccoutPageDataModel) {
Row() {
Button(item.compButtonTitle, { type: ButtonType.Normal, stateEffect: true })
.width('100%')
.height('80lpx')
.backgroundColor(this.btnStatus ? '#da3e22' : '#e5856d')
.enabled(this.btnStatus ?true:false)
.fontColor('#fff')
.borderRadius('4vp')
Text(item.compButtonTitle)
.layoutWeight(1)
.fontColor("#FFFFFF")
.borderRadius(`${this.calcHeight(4)}`)
.fontSize(`${this.calcHeight(18)}`)
.textAlign(TextAlign.Center)
.fontWeight(FontWeight.Medium)
.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'})
.alignItems(VerticalAlign.Center)
}.padding({top:`${this.calcHeight(25)}lpx`})
.width('100%')
.height('120lpx')
}
// 标题
@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",
... ...
... ... @@ -23,7 +23,7 @@ struct MorningEveningPaperPage {
PageTransitionEnter({ type: RouteType.Push, duration: 300 })
.slide(SlideEffect.Bottom).onEnter((type: RouteType, progress: number) => {
if (progress >= 0.99) {
WindowModel.shared.setWindowLayoutFullScreen(true)
// WindowModel.shared.setWindowLayoutFullScreen(true)
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', })
}
})
... ... @@ -43,14 +43,14 @@ struct MorningEveningPaperPage {
onPageShow() {
Logger.info(TAG, 'onPageShow');
if (this.isPageShow) {
WindowModel.shared.setWindowLayoutFullScreen(true)
// WindowModel.shared.setWindowLayoutFullScreen(true)
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', })
}
this.pageShowTime = DateTimeUtils.getTimeStamp()
}
onPageHide() {
WindowModel.shared.setWindowLayoutFullScreen(false)
// WindowModel.shared.setWindowLayoutFullScreen(false)
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', })
this.isPageShow = true
Logger.info(TAG, 'onPageHide');
... ...
... ... @@ -48,7 +48,6 @@ struct MultiPictureDetailPage {
}
aboutToAppear() {
this.openFullScreen()
Logger.info(TAG, 'aboutToDisappear');
... ... @@ -68,13 +67,11 @@ struct MultiPictureDetailPage {
aboutToDisappear(): void {
console.log(TAG, 'aboutToDisappear')
this.closeFullScreen()
}
onPageShow(): void {
console.log(TAG, 'onPageShow')
this.pageShowTime = DateTimeUtils.getTimeStamp()
this.openFullScreen()
}
... ... @@ -84,25 +81,7 @@ struct MultiPictureDetailPage {
let duration = 0
duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000)
TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Atlas_Detail,TrackConstants.PageName.Atlas_Detail,duration)
this.closeFullScreen()
}
/**
* 开启沉浸式
* TODO:颜色待根据业务接口修改
*/
openFullScreen() {
WindowModel.shared.setWindowLayoutFullScreen(true)
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', })
}
/**
* 关闭沉浸式
* TODO:颜色待根据业务接口修改
*/
closeFullScreen() {
WindowModel.shared.setWindowLayoutFullScreen(false)
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', })
}
}
\ No newline at end of file
... ...
... ... @@ -7,6 +7,7 @@ import LaunchDataModel, { defaultLaunchModel } from '../viewModel/LaunchDataMode
import { ParamType, TrackConstants, TrackingButton, TrackingContent } from 'wdTracking/Index';
import { ContentDTO } from 'wdBean/Index';
import { Core } from '@ohos/hypium';
@Entry
... ... @@ -62,7 +63,7 @@ struct LaunchAdvertisingPage {
}else {
//显示图片
Image(this.defaultModel.bootScreenUrl)
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
// .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
.width('100%')
.height('100%')
}
... ... @@ -74,11 +75,10 @@ struct LaunchAdvertisingPage {
bottom: 0
})
Stack(){
Column(){
Row(){
if (this.defaultModel.isAd === '1') {
if (this.defaultModel.isAd == '1') {
Text('广告')
.fontColor(Color.White)
.textAlign(TextAlign.Center)
... ... @@ -108,7 +108,7 @@ struct LaunchAdvertisingPage {
this.trackingLaunchJumpOver()
}).margin({right:16})
}.margin({top:10}).width('100%').height('56lpx')
}.margin({top:50}).width('100%').height('56lpx')
Blank()
... ... @@ -132,18 +132,21 @@ struct LaunchAdvertisingPage {
.margin({
bottom: '51lpx'
})
.borderWidth(1)
.borderColor(Color.White)
.backgroundColor('#80000000')
.onClick(()=>{
this.action()
})
}
if(this.defaultModel.screenType === '1') {
if(this.defaultModel.screenType == '1') {
Column(){
Image($r('app.media.LaunchPage_logo'))
.width('278lpx')
.height('154lpx')
.margin({top:20})
}.width('100%').height('16%').backgroundColor(Color.White).expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
}.width('100%').height('16%').backgroundColor(Color.White)
// .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
}
}
.width('100%')
... ... @@ -157,7 +160,7 @@ struct LaunchAdvertisingPage {
.height('100%')
.margin({top:'0'})
}
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
// .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
.width('100%')
.height('100%')
.backgroundColor(Color.White)
... ... @@ -212,7 +215,7 @@ struct LaunchAdvertisingPage {
this.defaultModel.screenName = dataModel.launchAdInfo[0].matInfo.advTitle
this.defaultModel.durations = dataModel.launchAdInfo[0].displayDuration
this.defaultModel.linkUrl = dataModel.launchAdInfo[0].matInfo.linkUrl
if (dataModel.launchAdInfo[0].matInfo.startStyle === '1') {
if (dataModel.launchAdInfo[0].matInfo.startStyle == '1') {
this.defaultModel.screenType = '2'
}else {
this.defaultModel.screenType = '1'
... ...
import { insightIntent, InsightIntentExecutor } from '@kit.AbilityKit';
import { window } from '@kit.ArkUI';
import { BusinessError } from '@kit.BasicServicesKit';
import { NetworkUtil, SPHelper, ToastUtils } from 'wdKit';
import { ProcessUtils } from 'wdRouter';
import DailyPaperTopicModel from 'wdComponent/src/main/ets/model/DailyPaperTopicModel'
/**
* 意图调用
*/
... ... @@ -19,7 +22,7 @@ export default class InsightIntentExecutorImpl extends InsightIntentExecutor {
*/
onExecuteInUIAbilityForegroundMode(name: string, param: Record<string, Object>, pageLoader: window.WindowStage):
Promise<insightIntent.ExecuteResult> {
console.log('yzl onExecuteInUIAbilityForegroundMode',name,JSON.stringify(param))
console.log('yzl onExecuteInUIAbilityForegroundMode', name, JSON.stringify(param))
// 根据意图名称分发处理逻辑
switch (name) {
case InsightIntentExecutorImpl.ViewBlog:
... ... @@ -36,19 +39,19 @@ export default class InsightIntentExecutorImpl extends InsightIntentExecutor {
}
} as insightIntent.ExecuteResult)
}
/**
* 实现习惯推荐功能
* @param param 意图参数
* @param pageLoader 窗口
*/
private jumpToViewBlog(param: Record<string, Object>, pageLoader: window.WindowStage): Promise<insightIntent.ExecuteResult> {
console.log('yzl jumpToView',JSON.stringify(param))
private jumpToViewBlog(param: Record<string, Object>,
pageLoader: window.WindowStage): Promise<insightIntent.ExecuteResult> {
console.log('yzl jumpToView', JSON.stringify(param))
return new Promise((resolve, reject) => {
// TODO 实现意图调用,loadContent的入参为歌曲落地页路径,例如:pages/SongPage
// TODO 热启动是否切到主页
pageLoader.loadContent('pages/MainPage')
.then(() => {
resolve({
code: 0,
result: {
... ... @@ -72,12 +75,26 @@ export default class InsightIntentExecutorImpl extends InsightIntentExecutor {
* @param param 意图参数
* @param pageLoader 窗口
*/
private jumpToViewColumnUpdate(param: Record<string, Object>, pageLoader: window.WindowStage): Promise<insightIntent.ExecuteResult> {
console.log('yzl jumpToViewColum',JSON.stringify(param))
private jumpToViewColumnUpdate(param: Record<string, Object>,
pageLoader: window.WindowStage): Promise<insightIntent.ExecuteResult> {
return new Promise((resolve, reject) => {
pageLoader.loadContent('pages/MainPage')
.then(() => {
ProcessUtils.gotoMorningEveningPaper()
if (NetworkUtil.isNetConnected()) {
DailyPaperTopicModel.getDailyPaperTopic().then(dailyPaperTopicBean => {
if (dailyPaperTopicBean && dailyPaperTopicBean.id > 0) {
SPHelper.default.saveSync('dailyPaperTopicPageId', dailyPaperTopicBean.id);
ProcessUtils.gotoMorningEveningPaper() //跳转至早晚报页面
} else {
ToastUtils.showToast('暂无早晚报信息', 1000)
}
}).catch((err: string) => {
console.log('yzlerr',JSON.stringify(err))
ToastUtils.showToast('暂无早晚报信息', 1000)
})
} else {
ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000)
}
resolve({
code: 0,
result: {
... ...