王士厅
Showing 29 changed files with 218 additions and 101 deletions
... ... @@ -32,6 +32,12 @@ export struct CardParser {
pageShowTime:number = 0;
pageHideTime:number = 0;
aboutToAppear(): void {
console.log('CardParser-contentDTO', JSON.stringify(this.contentDTO))
console.log('CardParser-compDTO', JSON.stringify(this.compDTO))
}
onPageShow() {
this.pageShowTime = DateTimeUtils.getTimeStamp()
}
... ...
... ... @@ -52,6 +52,16 @@ export struct CompParser {
})
this.compDTO.operDataList = this.noneAudioItems;
}
// 金刚卡屏蔽音频类型稿件
if (this.compDTO.compStyle === CompStyle.Zh_Grid_Layout_03) {
this.audioItems = this.compDTO.operDataList.filter(item => {
return item.objectType === '13' || item.linkUrl.includes('audiotopic')
})
this.noneAudioItems = this.compDTO.operDataList.filter(item => {
return item.objectType !== '13' && !item.linkUrl.includes('audiotopic')
})
this.compDTO.operDataList = this.noneAudioItems;
}
}
build() {
... ...
... ... @@ -68,6 +68,7 @@ export struct MorningEveningPaperComponent {
@State topSafeHeight: number = 0;
@State bottomSafeHeight: number = 0;
@State isHasTopView: boolean = false;
@State scrollOffset: number = 0
private audioDataList: AudioDataList[] = []
private playerController: WDPlayerController = new WDPlayerController();
... ... @@ -267,24 +268,22 @@ export struct MorningEveningPaperComponent {
compListItem: this.compListItem,
})
.margin({
top: this.pageInfoBean?.topicInfo?.frontLinkObject ? 10 : 44
top: this.isHasTopView ? 10 : 44+this.topSafeHeight
})
}
}
.height(`calc(100% - ${this.bottomSafeHeight + this.topSafeHeight + 'vp'})`).scrollBar(BarState.Off)
.onAreaChange((oldValue: Area, newValue: Area) => {
let persent = Math.abs(Number(newValue.globalPosition.y)) / 150
if (persent > 1) {
persent = 1
}
// .height(`calc(100% - ${this.bottomSafeHeight + this.topSafeHeight + 'vp'})`)
.scrollBar(BarState.Off)
.onWillScroll(scrollOffset =>{
this.scrollOffset = this.scrollOffset + scrollOffset as number
})
PaperTitleComponent().margin({top:this.isHasTopView?this.topSafeHeight:0}).backgroundColor(this.mixedBgColor).opacity(this.isHasTopView?0:1)
this.topPaperTitle()
}
.width('100%')
.height('100%')
.padding({
top: this.isHasTopView?0:this.topSafeHeight,
top: 0,
// bottom: this.bottomSafeHeight
})
// .backgroundColor(Color.Black)
... ... @@ -293,6 +292,13 @@ export struct MorningEveningPaperComponent {
}
@Builder
topPaperTitle(){
Column(){
PaperTitleComponent().margin({top:this.topSafeHeight})
}.height(44+this.topSafeHeight).backgroundColor(this.scrollOffset > 100?this.mixedBgColor:'')
}
@Builder
AudioBarView(dialog: CustomDialogController) {
Row() {
Stack({ alignContent: Alignment.Start }) {
... ...
... ... @@ -78,8 +78,9 @@ export struct CardMediaInfo {
Text(DateTimeUtils.getFormattedDuration(this.contentDTO.videoInfo.videoDuration * 1000))
.mediaText()
.fontFamily('BebasNeue')
}
}
} .margin({ left: 68,top: 135})
} else if (this.contentDTO.objectType === '2') {
// liveInfo.liveState 直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停
// 显示直播信息
... ...
... ... @@ -77,8 +77,15 @@ export struct Card10Component {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
ProcessUtils.processPage(this.contentDTO)
})
if (this.contentDTO.objectType == '5') {
Notes({ objectType: 5 }).margin({ left: 5, bottom: 5 })
if(this.contentDTO.objectType == '5'){
Notes({ objectType: this.contentDTO.objectType }).height(30).align(Alignment.Center).margin({ left: 5, bottom: 5 })
} else {
if (this.contentDTO.seoTags) {
Notes({ newTags: this.contentDTO.seoTags }).height(30).align(Alignment.Center)
}
if (this.contentDTO.newTags) {
Notes({ newTags: this.contentDTO.newTags }).height(30).align(Alignment.Center)
}
}
}.alignContent(Alignment.BottomStart)
... ... @@ -128,8 +135,15 @@ export struct Card10Component {
Row() {
Column() {
Stack() {
if (item.objectType == '5') {
Notes({ objectType: 5 })
if(this.contentDTO.objectType == '5'){
Notes({ objectType: this.contentDTO.objectType }).height(30).align(Alignment.Center)
} else {
if (this.contentDTO.seoTags) {
Notes({ newTags: this.contentDTO.seoTags }).height(30).align(Alignment.Center)
}
if (this.contentDTO.newTags) {
Notes({ newTags: this.contentDTO.newTags }).height(30).align(Alignment.Center)
}
}
Text(item.newsTitle)
.fontSize($r('app.float.font_size_17'))
... ... @@ -137,7 +151,10 @@ export struct Card10Component {
.fontColor($r('app.color.color_222222'))
.maxLines(2)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.textIndent(item.objectType == '5' ? 38 : 0)
.textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 &&
(this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) < 5 ? 58 :
((this.contentDTO.newTags?.length > 0 || this.contentDTO.seoTags?.length > 0) || this.contentDTO.objectType == '5') ? 35 :
0 )
}.alignContent(Alignment.TopStart)
//bottom 评论等信息
... ...
... ... @@ -38,10 +38,15 @@ export struct Card11Component {
build() {
Column() {
Stack() {
if(this.contentDTO.objectType == '5'){
Notes({ objectType: this.contentDTO.objectType }).height(30).align(Alignment.Center)
} else {
if (this.contentDTO.seoTags) {
Notes({ newTags: this.contentDTO.seoTags }).height(30).align(Alignment.Center)
}
if (this.contentDTO.newTags) {
Notes({ newTags: this.contentDTO.newTags }).height(30).align(Alignment.Center)
} else if (this.contentDTO.objectType == '5') {
Notes({ objectType: this.contentDTO.objectType }).height(30).align(Alignment.Center)
}
}
Text() {
if (this.titleMarked) {
... ... @@ -63,9 +68,10 @@ export struct Card11Component {
.maxLines(3)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.width(CommonConstants.FULL_WIDTH)
.textIndent(this.contentDTO.newTags?.length < 5 && this.contentDTO.newTags?.length > 2 ? 58 :
(this.contentDTO.newTags?.length != 0 && this.contentDTO.newTags?.length) ||
this.contentDTO.objectType == '5' ? 35 : 0)
.textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 &&
(this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) < 5 ? 58 :
((this.contentDTO.newTags?.length > 0 || this.contentDTO.seoTags?.length > 0) || this.contentDTO.objectType == '5') ? 35 :
0 )
}.alignContent(Alignment.TopStart)
... ...
... ... @@ -36,10 +36,20 @@ export struct Card3Component {
build() {
Column() {
Stack() {
// if (this.contentDTO.newTags) {
// Notes({ newTags: this.contentDTO.newTags }).height(27).align(Alignment.Center)
// } else if (this.contentDTO.objectType == '5') {
// Notes({ objectType: this.contentDTO.objectType }).height(27).align(Alignment.Center)
// }
if(this.contentDTO.objectType == '5'){
Notes({ objectType: this.contentDTO.objectType }).height(30).align(Alignment.Center)
} else {
if (this.contentDTO.seoTags) {
Notes({ newTags: this.contentDTO.seoTags }).height(30).align(Alignment.Center)
}
if (this.contentDTO.newTags) {
Notes({ newTags: this.contentDTO.newTags }).height(27).align(Alignment.Center)
} else if (this.contentDTO.objectType == '5') {
Notes({ objectType: this.contentDTO.objectType }).height(27).align(Alignment.Center)
Notes({ newTags: this.contentDTO.newTags }).height(30).align(Alignment.Center)
}
}
Text() {
if (this.titleMarked) {
... ... @@ -59,9 +69,10 @@ export struct Card3Component {
.fontSize($r("app.float.font_size_18"))
.fontColor(this.clicked ? 0x848484 : $r("app.color.color_222222"))
.width(CommonConstants.FULL_WIDTH)
.textIndent(this.contentDTO.newTags?.length < 5 && this.contentDTO.newTags?.length > 2 ? 58 :
(this.contentDTO.newTags?.length != 0 && this.contentDTO.newTags?.length) ||
this.contentDTO.objectType == '5' ? 35 : 0)
.textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 &&
(this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) < 5 ? 58 :
((this.contentDTO.newTags?.length > 0 || this.contentDTO.seoTags?.length > 0) || this.contentDTO.objectType == '5') ? 35 :
0 )
}.alignContent(Alignment.TopStart)
// 评论等信息
... ...
... ... @@ -46,10 +46,15 @@ export struct Card4Component {
//body
Column() {
Stack() {
if(this.contentDTO.objectType == '5'){
Notes({ objectType: this.contentDTO.objectType }).height(19).align(Alignment.Center)
} else {
if (this.contentDTO.seoTags) {
Notes({ newTags: this.contentDTO.seoTags }).height(19).align(Alignment.Center)
}
if (this.contentDTO.newTags) {
Notes({ newTags: this.contentDTO.newTags }).height(19).align(Alignment.Center)
} else if (this.contentDTO.objectType == '5') {
Notes({ objectType: this.contentDTO.objectType }).height(19).align(Alignment.Center)
}
}
Text() {
if (this.titleMarked) {
... ... @@ -69,9 +74,10 @@ export struct Card4Component {
.fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222'))
.maxLines(3)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.textIndent(this.contentDTO.newTags?.length < 5 && this.contentDTO.newTags?.length > 2 ? 58 :
(this.contentDTO.newTags?.length != 0 && this.contentDTO.newTags?.length) ||
this.contentDTO.objectType == '5' ? 30 : 0)
.textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 &&
(this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) < 5 ? 58 :
((this.contentDTO.newTags?.length > 0 || this.contentDTO.seoTags?.length > 0) || this.contentDTO.objectType == '5') ? 35 :
0 )
}.alignContent(Alignment.TopStart)
//新闻标题
... ...
... ... @@ -57,10 +57,15 @@ export struct Card5Component {
})
Row() {
Stack() {
if(this.contentDTO.objectType == '5'){
Notes({ objectType: this.contentDTO.objectType }).align(Alignment.Center)
} else {
if (this.contentDTO.seoTags) {
Notes({ newTags: this.contentDTO.seoTags }).align(Alignment.Center)
}
if (this.contentDTO.newTags) {
Notes({ newTags: this.contentDTO.newTags })
} else if (this.contentDTO.objectType == '5') {
Notes({ objectType: this.contentDTO.objectType })
Notes({ newTags: this.contentDTO.newTags }).align(Alignment.Center)
}
}
Text() {
... ... @@ -83,9 +88,10 @@ export struct Card5Component {
.maxLines(2)
.align(Alignment.TopStart)
.textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。
.textIndent(this.contentDTO.newTags?.length < 5 && this.contentDTO.newTags?.length > 2 ? 58 :
(this.contentDTO.newTags?.length != 0 && this.contentDTO.newTags?.length) ||
this.contentDTO.objectType == '5' ? 35 : 0)
.textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 &&
(this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) < 5 ? 58 :
((this.contentDTO.newTags?.length > 0 || this.contentDTO.seoTags?.length > 0) || this.contentDTO.objectType == '5') ? 35 :
0 )
}.alignContent(Alignment.TopStart)
}
.justifyContent(FlexAlign.Start)
... ...
... ... @@ -103,8 +103,8 @@ export struct Card6Component {
.width('64%')
.height(this.contentDTO.appStyle === CompStyle.Card_13 ? '' : 156)
Stack() {
Image(this.loadImg ? this.contentDTO.coverUrl : '')
Stack({alignContent: Alignment.BottomEnd}) {
Image(this.loadImg ? this.contentDTO.coverUrl || this.contentDTO.fullColumnImgUrls?.[0]?.url || this.contentDTO.fullColumnImgUrls?.[0]?.fullUrl : '')
.backgroundColor(this.loadImg ? $r('app.color.color_B0B0B0') : 0xf5f5f5)
.borderRadius(5)
.aspectRatio(this.contentDTO.appStyle === CompStyle.Card_13 ? 3 / 2 : 3 / 4)
... ...
... ... @@ -88,10 +88,16 @@ export struct Card9Component {
topLeft: $r('app.float.image_border_radius'),
topRight: $r('app.float.image_border_radius')
})
if (this.contentDTO.objectType == '5') {
Notes({ objectType: 5 })
if(this.contentDTO.objectType == '5'){
Notes({ objectType: this.contentDTO.objectType }).align(Alignment.Center)
.margin({ left: 5, bottom: 5 })
} else {
if (this.contentDTO.seoTags) {
Notes({ newTags: this.contentDTO.seoTags }).align(Alignment.Center)
}
if (this.contentDTO.newTags) {
Notes({ newTags: this.contentDTO.newTags }).align(Alignment.Center)
}
}
}.alignContent(Alignment.BottomStart)
... ...
... ... @@ -15,6 +15,7 @@ export struct CommentCustomDialog {
@State private emojiSwitch: boolean = false
textInputController: TextAreaController = new TextAreaController()
@State positionInfo: CaretOffset = { index: 0, x: 0, y: 0 }
@State publishButtonOpacity: number = 0.5
aboutToAppear(): void {
}
... ... @@ -55,8 +56,15 @@ export struct CommentCustomDialog {
.height('100%')
.width('100%')
.backgroundColor($r('app.color.color_transparent'))
.caretColor("#ED2800")
.onChange(value => {
this.publishCommentModel.commentContent = value;
if (value.length > 0) {
this.publishButtonOpacity = 1.0
} else {
this.publishButtonOpacity = 0.5
}
})
.onFocus(() => {
if (this.emojiSwitch) {
... ... @@ -98,13 +106,14 @@ export struct CommentCustomDialog {
Row() {
Text('发布')
.backgroundColor('#F89381')
.backgroundColor("#ED2800")
.width(80)
.height(30)
.fontSize(15)
.fontColor(Color.White)
.textAlign(TextAlign.Center)
.borderRadius(4)
.opacity(this.publishButtonOpacity)
.onClick(() => {
if (this.publishCommentModel.commentContent.length > 0) {
//请求评论接口
... ...
... ... @@ -257,6 +257,7 @@ export struct QualityCommentsComponent {
.height("100%")
.width("100%")
.edgeEffect(EdgeEffect.None) // 必须设置列表为滑动到边缘无效果
.scrollBar(BarState.Off)
.nestedScroll({
scrollForward: NestedScrollMode.PARENT_FIRST,
scrollBackward: NestedScrollMode.SELF_FIRST
... ... @@ -405,7 +406,7 @@ struct QualityCommentItem {
if (this.item.api_authIcon && this.item.api_authIcon.length > 0) {
Image(this.item.api_authIcon) // 加v
.width(12).height(12)
.width(14).height(14)
.objectFit(ImageFit.Cover)
}
}.width(50).height(50)
... ...
import { ContentDTO } from 'wdBean/Index'
import { StringUtils, UserDataLocal } from 'wdKit/Index'
import { ProcessUtils } from 'wdRouter/Index'
import MinePageDatasModel from '../../../model/MinePageDatasModel'
import { CommentLikeOperationRequestItem } from '../../../viewmodel/CommentLikeOperationRequestItem'
import { CommentListItem } from '../../../viewmodel/CommentListItem'
import measure from '@ohos.measure'
import { TrackingContent, TrackConstants, TrackParamConvert } from 'wdTracking/Index'
@Component
export struct ChildCommentComponent {
... ... @@ -16,8 +14,6 @@ export struct ChildCommentComponent {
@State isExpandParent: boolean = false;
@State isOverLines: boolean = false
@State isOverLinesParent: boolean = false
testText:string = "1,因为读书的人\n是低着头向上看的人\n身处一隅,却能放眼世界\n2,因为读书的人\n总是比不读书的人\n活得有趣一点\n3,因为读书的人\n即使平凡,绝不平庸"
@Link fromPage:number
build() {
Column() {
... ... @@ -196,15 +192,6 @@ export struct ChildCommentComponent {
}.height('69lpx')
.justifyContent(FlexAlign.Center)
.onClick(() => {
let content = getParams(this.data)
if(this.fromPage === 0 ){
TrackingContent.common(TrackConstants.EventType.Click,TrackConstants.PageName.Main_Personal,TrackConstants.PageName.Main_Personal,TrackParamConvert.program(content))
}else{
TrackingContent.common(TrackConstants.EventType.Click,TrackConstants.PageName.Customer_Personal,TrackConstants.PageName.Customer_Personal,TrackParamConvert.program(content))
}
ProcessUtils.processPage(content)
})
}
.margin({ top: '19lpx', bottom: '31lpx', left: '31lpx', right: '31lpx' })
.padding({ left: '23lpx' })
... ...
... ... @@ -10,6 +10,7 @@ import { OtherUserCommentLikeStatusRequestItem } from '../../../viewmodel/OtherU
import { CustomPullToRefresh } from '../../reusable/CustomPullToRefresh';
import { ContentDTO } from 'wdBean/Index';
import { TrackingContent, TrackConstants, TrackParamConvert } from 'wdTracking/Index';
import { ProcessUtils } from 'wdRouter/Index';
const TAG = "HomePageBottomCommentComponent"
... ... @@ -85,10 +86,15 @@ export struct HomePageBottomCommentComponent {
ChildCommentComponent({
data: item,
levelHead: UserDataLocal.getUserLevelHeaderUrl(),
isLastItem: index === this.data_comment.totalCount() - 1,
fromPage:0
isLastItem: index === this.data_comment.totalCount() - 1
})
}.onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => {
}
.onClick(()=>{
let content = getParams(item)
TrackingContent.common(TrackConstants.EventType.Click,TrackConstants.PageName.Main_Personal,TrackConstants.PageName.Main_Personal,TrackParamConvert.program(content))
ProcessUtils.processPage(content)
})
.onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => {
if (isVisible) {
let contentDTO = getParams(item)
TrackingContent.common(TrackConstants.EventType.Show, TrackConstants.PageName.Main_Personal,TrackConstants.PageName.Main_Personal, TrackParamConvert.program(contentDTO))
... ...
... ... @@ -10,6 +10,7 @@ import { EmptyComponent } from '../../view/EmptyComponent';
import { CustomPullToRefresh } from '../../reusable/CustomPullToRefresh';
import { ContentDTO } from 'wdBean/Index';
import { TrackingContent, TrackConstants, TrackParamConvert } from 'wdTracking/Index';
import { ProcessUtils } from 'wdRouter/Index';
const TAG = "HomePageBottomComponent"
/**
... ... @@ -87,9 +88,13 @@ export struct OtherHomePageBottomCommentComponent {
data: item,
levelHead: this.levelHead,
isLastItem: index === this.data_comment.totalCount() - 1,
fromPage:1
})
}.onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => {
}
.onClick(()=>{
let content = getParams(item)
TrackingContent.common(TrackConstants.EventType.Click,TrackConstants.PageName.Customer_Personal,TrackConstants.PageName.Customer_Personal,TrackParamConvert.program(content))
ProcessUtils.processPage(content)
}).onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => {
if (isVisible) {
let contentDTO = getParams(item)
TrackingContent.common(TrackConstants.EventType.Show, TrackConstants.PageName.Customer_Personal,TrackConstants.PageName.Customer_Personal, TrackParamConvert.program(contentDTO))
... ...
... ... @@ -438,7 +438,7 @@ export struct PaperSingleColumn999CardView {
Stack({ alignContent: Alignment.BottomEnd }) {
Image(this.item?.coverUrl)
.borderRadius(5)
.aspectRatio(16 / 9)
.aspectRatio(319 / 179) ///图片设计比例
.padding({ top: 10 })
if (this.item?.videoInfo) {
Row() {
... ...
... ... @@ -9,6 +9,7 @@ import { AssignChannelParam } from 'wdRouter/src/main/ets/utils/HomeChannelUtils
import { PeopleShipMainComponent } from '../peopleShip/PeopleShipMainComponent';
import { channelSkeleton } from '../skeleton/channelSkeleton';
import { TrackConstants, TrackingButton } from 'wdTracking/Index';
import DailyPaperTopicModel from '../../model/DailyPaperTopicModel'
const TAG = 'TopNavigationComponent';
... ... @@ -170,13 +171,7 @@ export struct TopNavigationComponentNew {
.height(30)
.width(124)
.onClick(() => {
if (NetworkUtil.isNetConnected()) {
ProcessUtils.gotoMorningEveningPaper()
TrackingButton.click('morning_evening_news_click', TrackConstants.SummaryType.MorningAndEveningNews,
TrackConstants.SummaryType.MorningAndEveningNews)
} else {
ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000)
}
this.clickMorningEveningPaper()
})
}.width('100%')
.justifyContent(FlexAlign.SpaceBetween)
... ... @@ -621,4 +616,21 @@ export struct TopNavigationComponentNew {
this.indicatorWidth = width
})
}
clickMorningEveningPaper(){
if (NetworkUtil.isNetConnected()) {
DailyPaperTopicModel.getDailyPaperTopic().then(dailyPaperTopicBean =>{
if (dailyPaperTopicBean && dailyPaperTopicBean.id > 0) {
SPHelper.default.saveSync('dailyPaperTopicPageId', dailyPaperTopicBean.id);
ProcessUtils.gotoMorningEveningPaper()
TrackingButton.click('morning_evening_news_click',TrackConstants.SummaryType.MorningAndEveningNews,TrackConstants.SummaryType.MorningAndEveningNews)
}else {
ToastUtils.showToast('暂无早晚报信息', 1000)
}
}).catch()
} else {
ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000)
}
}
}
\ No newline at end of file
... ...
... ... @@ -7,7 +7,6 @@
import { SPHelper } from 'wdKit/Index'
import { WDRouterPage, WDRouterRule } from 'wdRouter'
import { TrackingButton, TrackConstants } from 'wdTracking/Index'
import DailyPaperTopicModel from '../../model/DailyPaperTopicModel'
import SearcherAboutDataModel from '../../model/SearcherAboutDataModel'
const TAG = "FirstTabTopSearchComponent"
... ... @@ -19,10 +18,6 @@ export struct FirstTabTopSearchComponent {
async aboutToAppear() {
this.getSearchHint()
let dailyPaperTopicBean = await DailyPaperTopicModel.getDailyPaperTopic()
if (dailyPaperTopicBean) {
SPHelper.default.saveSync('dailyPaperTopicPageId', dailyPaperTopicBean.id);
}
}
getSearchHint() {
... ...
... ... @@ -9,6 +9,14 @@ import { publishCommentModel } from 'wdComponent/src/main/ets/components/comment
const TAG = 'DetailPlayLiveCommon'
/**
* @Description: 沉浸式和非沉浸式直播页面
* @Author:
* @Email:
* @CreateDate:
* @UpdateRemark: 更新说明
* @Version: 1.0
*/
@Entry
@Component
export struct DetailPlayLiveCommon {
... ... @@ -41,8 +49,10 @@ export struct DetailPlayLiveCommon {
Column() {
// 直播预约或横屏直播统一进横屏直播
if (this.liveState === 'wait' || this.liveStyle === 0) {
// 非沉浸式
DetailPlayLivePage({ contentId: this.contentId, relId: this.relId, relType: this.relType })
} else if (this.liveStyle === 1) {
// 沉浸式
DetailPlayVLivePage()
}
}
... ... @@ -61,6 +71,7 @@ export struct DetailPlayLiveCommon {
console.log(TAG, '查询视频详情用于评论展示 getContentDetail:', JSON.stringify(data))
if (data) {
this.contentDetailData = data[0];
// if (this.contentDetailData.openComment === 1) {
console.log(TAG, '查询视频详情用于评论展示 openComment:', this.contentDetailData.openComment)
this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '')
... ...
... ... @@ -15,6 +15,9 @@ import { ResponseDTO } from 'wdNetwork/Index';
let TAG: string = 'DetailPlayLivePage';
/**
* 非沉浸式房间直播组件
*/
@Component
export struct DetailPlayLivePage {
//横竖屏,默认竖屏
... ... @@ -63,7 +66,7 @@ export struct DetailPlayLivePage {
build() {
Column() {
TopPlayComponent({ playerController: this.playerController })
.height(211)
.height(this.displayDirection == DisplayDirection.VERTICAL ?211:'100%')
TabComponent({ tabs: this.tabs, changeToTab: this.changeToTab })
.layoutWeight(1)
.visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None)
... ...
... ... @@ -12,6 +12,9 @@ import { PlayerEndView } from '../widgets/vertical/PlayerEndView';
const storage = LocalStorage.getShared();
const TAG = 'DetailPlayVLivePage'
/**
* 沉浸式房间直播组件
*/
@Entry(storage)
@Component
export struct DetailPlayVLivePage {
... ...
... ... @@ -2,6 +2,9 @@ import { TabChatComponent } from './TabChatComponent'
import { TabInfoComponent } from './TabInfoComponent'
import { TabLiveComponent } from './TabLiveComponent'
/**
* 非沉浸式直播 tab 组件
*/
@Component
export struct TabComponent {
@Prop @Watch('changeToChart') changeToTab: number
... ...
import { LiveDetailsBean } from 'wdBean/Index';
import { StringUtils } from 'wdKit/Index';
import { PlayerConstants, WDAliPlayerController, WDPlayerController, WDPlayerRenderLiveView } from 'wdPlayer/Index';
import { Logger, StringUtils } from 'wdKit/Index';
import { PlayerConstants, WDAliPlayerController, WDPlayerRenderLiveView } from 'wdPlayer/Index';
import { PlayUIComponent } from './PlayUIComponent';
import { Logger } from 'wdKit/Index';
import { PictureLoading } from '../../vertical/PictureLoading';
const TAG: string = 'TopPlayComponent'
... ... @@ -23,6 +22,7 @@ export struct TopPlayComponent {
@State isLoading: boolean = false
// 获取播放资源能播放了
@State isCanPlay: boolean = false
private playUrl: string = ""
private xComponentIsLoaded: boolean = false
... ... @@ -99,6 +99,7 @@ export struct TopPlayComponent {
build() {
Stack() {
// 视频资源播放
WDPlayerRenderLiveView({
playerController: this.playerController,
onLoad: async () => {
... ... @@ -112,17 +113,20 @@ export struct TopPlayComponent {
.width('100%')
.visibility(this.isWait ? Visibility.None : Visibility.Visible)
// 直播房间图
Image(this.imgUrl)
.objectFit(ImageFit.Cover)
.visibility(this.isWait || this.isEnd ? Visibility.Visible : Visibility.None)
.contrast(this.isEnd ? 0.2 : 1)
.width('100%')
// loading
PictureLoading().visibility(this.isLoading ? Visibility.None : Visibility.Visible)
// 视频播放器上的控制面板和信息
PlayUIComponent({ playerController: this.playerController, isShowBottom: this.isCanPlay })
// 直播结束
Text('直播已结束')
.fontSize('20fp')
.fontWeight(500)
... ... @@ -131,6 +135,7 @@ export struct TopPlayComponent {
Visibility.None)
// 直播资源加载失败
Column() {
Text('直播加载中,请稍候重试')
... ...
... ... @@ -22,6 +22,7 @@ export struct PlayerInfoComponent {
}
.cachedCount(2)
.indicator(false)
.effectMode(EdgeEffect.None)
.loop(false)
.width('100%')
.height('100%')
... ...
... ... @@ -4,10 +4,7 @@ import { LoginViewModel } from './LoginViewModel'
import router from '@ohos.router'
import { WDRouterRule, WDRouterPage } from 'wdRouter';
import { SettingPasswordParams } from './SettingPasswordPage'
import { Router } from '@ohos.arkui.UIContext'
import { CustomToast, EmitterEventId, EmitterUtils, NetworkUtil, SPHelper, StringUtils, ToastUtils } from 'wdKit/Index'
import { SpConstants } from 'wdConstant/Index'
import { emitter } from '@kit.BasicServicesKit'
import { CustomToast, NetworkUtil,StringUtils } from 'wdKit/Index'
const TAG = 'ForgetPasswordPage'
... ... @@ -24,6 +21,7 @@ struct ForgetPasswordPage {
@State @Watch('onCodeSend') isCodeSend: boolean = false //验证码点击发送事件
@State params:Record<string, number> = router.getParams() as Record<string, number>;//登录 密码登录 填写手机号 点击忘记密码 带过来手机号
@State pageTitle:string = '找回密码';
@State isForgetPassword: number = 0 //是否是登录页忘记密码过来的,标题不一样
@State codeStateSuccess:boolean=false
onCodeSend() {
if (this.isCodeSend) {
... ... @@ -31,10 +29,6 @@ struct ForgetPasswordPage {
}
}
@State toastText:string = ""
dialogToast: CustomDialogController = new CustomDialogController({
builder: CustomToast({
... ... @@ -87,6 +81,7 @@ struct ForgetPasswordPage {
let phone = ""
if(this.params){
phone = this.params['phone']+ ""
this.isForgetPassword = this.params['isForgetPassword']
}
if(StringUtils.isNotEmpty(phone) && phone.indexOf("****") === -1){
this.phoneContent = phone
... ... @@ -157,7 +152,8 @@ struct ForgetPasswordPage {
pageID:'1',
phoneContent:this.phoneContent,
codeContent:this.codeContent,
pageType:1
pageType:1,
isForgetPassword:this.isForgetPassword
}
WDRouterRule.jumpWithPage(WDRouterPage.settingPasswordPage, params)
}).catch((message: string)=>{
... ... @@ -171,7 +167,8 @@ struct ForgetPasswordPage {
pageID:'1',
phoneContent:this.phoneContent,
codeContent:this.codeContent,
pageType:0
pageType:0,
isForgetPassword:this.isForgetPassword
}
WDRouterRule.jumpWithReplacePage(WDRouterPage.settingPasswordPage, params)
... ...
... ... @@ -177,10 +177,11 @@ struct LoginPage {
.onClick(() => {
TrackingButton.click("loginPageForgotPassword",TrackConstants.PageName.Login_Page,TrackConstants.PageName.Login_Page)
if(StringUtils.isNotEmpty(this.accountContent) && StringUtils.photoMatch(this.accountContent)){
let pageType = { 'phone': Number(this.accountContent) } as Record<string, number>;
let pageType = { 'phone': Number(this.accountContent),'isForgetPassword':1 } as Record<string, number>;
WDRouterRule.jumpWithPage(WDRouterPage.forgetPasswordPage, pageType)
}else{
WDRouterRule.jumpWithPage(WDRouterPage.forgetPasswordPage)
let pageType = {'isForgetPassword':1 } as Record<string, number>;
WDRouterRule.jumpWithPage(WDRouterPage.forgetPasswordPage,pageType)
}
})
}
... ...
... ... @@ -18,6 +18,7 @@ export interface SettingPasswordParams {
codeContent?: string;
tempToken?:string;
pageType?:number; //0、登录->忘记密码 1、设置->重置密码
isForgetPassword?:number
}
export default class AccoutPageDataModel {
... ... @@ -107,6 +108,17 @@ export struct SettingPasswordPage {
let params:SettingPasswordParams = router.getParams() as SettingPasswordParams;
this.pageId = parseInt(params.pageID);
this.getPageListData(this.pageId)
if(params){
if(params.isForgetPassword === 1){
this.listData.forEach((item) => {
if (item.compType === 0) {
item.compTitle = "重置密码"
}
})
}
}
this.phoneContent = params.phoneContent!;
this.codeContent = params.codeContent!;
... ... @@ -151,8 +163,6 @@ export struct SettingPasswordPage {
this.getTitleCell(item, HorizontalAlign.Start)
} else if (item.compType == 1) {
this.getPasswordCell(item)
} else if (item.compType == 2) {
this.getCodeCell(item)
} else if (item.compType == 3) {
if (index == this.listData.length - 1) {
this.getDescCell(item, HorizontalAlign.Center)
... ... @@ -161,18 +171,12 @@ export struct SettingPasswordPage {
}
} else if (item.compType == 4) {
this.getButtonCell(item)
} else if (item.compType == 5) {
this.getLogoCell(item)
} else if (item.compType == 7) {
this.getPhoneCell(item)
} else {
Text('' + item.compType)
}
}
})
}
}.width('100%')
.padding('30lpx')
.padding({ left:"31lpx",right:"31lpx",top:"131lpx" })
.height('100%')
}
... ...
import componentUtils from '@ohos.arkui.componentUtils';
import { WDPlayerController } from '../controller/WDPlayerController'
import { WindowModel } from 'wdKit';
import { Logger } from '../utils/Logger';
import { enableAliPlayer } from '../utils/GlobalSetting';
... ...