Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
陈剑华
2024-09-20 13:44:53 +0800
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
4ed7d5b83d5c48abee95208db63f4dfdc9533c4d
4ed7d5b8
2 parents
bbbbdc9d
30c6d933
Merge remote-tracking branch 'origin/main'
Hide whitespace changes
Inline
Side-by-side
Showing
34 changed files
with
440 additions
and
313 deletions
sight_harmony/AppScope/resources/base/media/live_end_BG_l.png
sight_harmony/AppScope/resources/base/media/live_end_BG_r.png
sight_harmony/commons/wdWebComponent/src/main/ets/pages/WdWebLocalComponent.ets
sight_harmony/commons/wdWebComponent/src/main/resources/base/media/icon_play.png
sight_harmony/commons/wdWebComponent/src/main/resources/base/media/slider_block.png
sight_harmony/features/wdComponent/src/main/ets/components/DynamicDetailComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/ImageAndTextPageComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/InteractMessage/InteractMComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/mine/MinePageUserSimpleInfoUI.ets
sight_harmony/features/wdComponent/src/main/ets/components/mine/appointment/AppointmentListChildComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/mine/follow/FollowThirdTabsComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/mine/message/subscribe/SubscribeListChildComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/mine/message/subscribe/SubscribeMessageComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/CardView.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/EditUserIntroductionPage.ets
sight_harmony/features/wdComponent/src/main/ets/components/peopleShipHomePage/PeopleShipHomeArticleListComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/peopleShipHomePage/PeopleShipHomePageTopComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/reusable/CustomTitleUI.ets
sight_harmony/features/wdComponent/src/main/ets/model/InteractMessageModel.ets
sight_harmony/features/wdComponent/src/main/ets/model/MineSettingDatasModel.ets
sight_harmony/features/wdComponent/src/main/ets/pages/MineHomePage.ets
sight_harmony/features/wdComponent/src/main/ets/pages/ShowUserHeaderPage.ets
sight_harmony/features/wdComponent/src/main/ets/utils/lazyloadImg.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/pages/DetailPlayLiveCommon.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/video/PlayUIComponent.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/vertical/PlayerEndView.ets
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/pages/DetailPlayShortVideoPage.ets
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/pages/DetailVideoListPage.ets
sight_harmony/features/wdLogin/src/main/ets/pages/login/LoginProtocolWebview.ets
sight_harmony/features/wdPlayer/src/main/ets/controller/BackgroundAudioController.ets
sight_harmony/products/phone/src/main/ets/pages/launchPage/LaunchAdvertisingPage.ets
sight_harmony/products/phone/src/main/ets/pages/view/AudioComponent.ets
sight_harmony/products/phone/src/main/ets/pages/view/BottomNavigationComponent.ets
sight_harmony/products/phone/src/main/ets/pages/view/VideoChannelPage.ets
sight_harmony/AppScope/resources/base/media/live_end_BG_l.png
0 → 100644
View file @
4ed7d5b
5.7 KB
sight_harmony/AppScope/resources/base/media/live_end_BG_r.png
0 → 100644
View file @
4ed7d5b
5.78 KB
sight_harmony/commons/wdWebComponent/src/main/ets/pages/WdWebLocalComponent.ets
View file @
4ed7d5b
...
...
@@ -323,6 +323,7 @@ export struct WdWebLocalComponent {
}else {
Row() {
Image(this.isPause ? $r('app.media.icon_play') : $r('app.media.icon_pause'))
.interpolation(ImageInterpolation.Medium)
.width(24)
.height(24)
.onClick(() => {
...
...
sight_harmony/commons/wdWebComponent/src/main/resources/base/media/icon_play.png
View file @
4ed7d5b
293 Bytes
|
W:
|
H:
383 Bytes
|
W:
|
H:
2-up
Swipe
Onion skin
sight_harmony/commons/wdWebComponent/src/main/resources/base/media/slider_block.png
View file @
4ed7d5b
497 Bytes
|
W:
|
H:
631 Bytes
|
W:
|
H:
2-up
Swipe
Onion skin
sight_harmony/features/wdComponent/src/main/ets/components/DynamicDetailComponent.ets
View file @
4ed7d5b
...
...
@@ -352,7 +352,6 @@ export struct DynamicDetailComponent {
}
.width(48)
.padding({ bottom: 9 })
}
}
...
...
@@ -380,22 +379,46 @@ export struct DynamicDetailComponent {
GridCol({
span: this.onePicW > this.onePicH ? 12 : 8
}) {
Image(item.picPath)
.backgroundColor(0xf5f5f5)
.width('100%')
.autoResize(true)
.objectFit(ImageFit.Cover)
.autoResize(true)
.aspectRatio(3/4)
.borderRadius(this.caclImageRadius(index))
.borderStyle(BorderStyle.Solid)
.borderWidth(0.5)
.borderColor($r('app.color.color_0D000000'))
.opacity(!item.width && !item.height ? 0 : 1)
.onComplete((event?) => {
this.onePicW = event?.width || 0;
this.onePicH = event?.height || 0;
})
Stack({alignContent: Alignment.BottomEnd}) {
Image(item.picPath)
.backgroundColor(0xf5f5f5)
.width('100%')
.autoResize(true)
.objectFit(ImageFit.Cover)
.autoResize(true)
.aspectRatio(3/4)
.borderRadius(this.caclImageRadius(index))
.borderStyle(BorderStyle.Solid)
.borderWidth(0.5)
.borderColor($r('app.color.color_0D000000'))
.opacity(!item.width && !item.height ? 0 : 1)
.onComplete((event?) => {
this.onePicW = event?.width || 0;
this.onePicH = event?.height || 0;
})
if(this.getPicType(item) !== 3){
Flex({ direction: FlexDirection.Row }) {
Image($r('app.media.icon_long_pic'))
.width(12)
.height(12)
.margin({ right: 4 })
Text('长图')
.fontSize(10)
.fontWeight(400)
.textShadow({
radius: 1,
color: `rgba(0,0,0,0.5)`,
offsetY:1,
offsetX:1
})
.fontColor(0xffffff)
.fontFamily('PingFang SC')
}
.width(48)
.align(Alignment.BottomEnd)
.padding({ bottom: 3 })
}
}
}
.onClick(async (event: ClickEvent) => {
let retvalue = await FastClickUtil.isMinDelayTime()
...
...
@@ -405,46 +428,48 @@ export struct DynamicDetailComponent {
ProcessUtils.gotoMultiPictureListPage(this.contentDetailData.photoList, index)
})
}
} else if (this.contentDetailData.photoList.length === 4) {
GridCol({
span: { xs: 4 }
}) {
Stack({alignContent: Alignment.BottomEnd}) {
Image(item.picPath)
.aspectRatio(1)
.borderRadius(this.caclImageRadius(index))
if(this.getPicType(item) !== 3){
Flex({ direction: FlexDirection.Row }) {
Image($r('app.media.icon_long_pic'))
.width(12)
.height(12)
.margin({ right: 4 })
Text('长图')
.fontSize(10)
.fontWeight(400)
.textShadow({
radius: 1,
color: `rgba(0,0,0,0.5)`,
offsetY:1,
offsetX:1
})
.fontColor(0xffffff)
.fontFamily('PingFang SC')
}
.width(48)
.align(Alignment.BottomEnd)
.padding({ bottom: 3 })
}
}
}
.onClick(async (event: ClickEvent) => {
let retvalue = await FastClickUtil.isMinDelayTime()
if(retvalue){
return
}
ProcessUtils.gotoMultiPictureListPage(this.contentDetailData.photoList, index)
})
} else {
}
// else if (this.contentDetailData.photoList.length === 4) {
// GridCol({
// span: { xs: 4 }
// }) {
// Stack({alignContent: Alignment.BottomEnd}) {
// Image(item.picPath)
// .aspectRatio(1)
// .borderRadius(this.caclImageRadius(index))
// if(this.getPicType(item) !== 3){
// Flex({ direction: FlexDirection.Row }) {
// Image($r('app.media.icon_long_pic'))
// .width(12)
// .height(12)
// .margin({ right: 4 })
// Text('长图')
// .fontSize(10)
// .fontWeight(400)
// .textShadow({
// radius: 1,
// color: `rgba(0,0,0,0.5)`,
// offsetY:1,
// offsetX:1
// })
// .fontColor(0xffffff)
// .fontFamily('PingFang SC')
// }
// .width(48)
// .align(Alignment.BottomEnd)
// .padding({ bottom: 3 })
// }
// }
// }
// .onClick(async (event: ClickEvent) => {
// let retvalue = await FastClickUtil.isMinDelayTime()
// if(retvalue){
// return
// }
// ProcessUtils.gotoMultiPictureListPage(this.contentDetailData.photoList, index)
// })
// }
else {
GridCol({
span: { sm: 4, lg: 3 }
}) {
...
...
sight_harmony/features/wdComponent/src/main/ets/components/ImageAndTextPageComponent.ets
View file @
4ed7d5b
...
...
@@ -65,7 +65,6 @@ export struct ImageAndTextPageComponent {
@State reachEndIncreament: number = 0
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
@State isScrollTop: boolean = true
@State offsetY: number = 0
@State executedStartTime: number = new Date().getTime()
private screenHeight: number = 0
...
...
@@ -208,8 +207,9 @@ export struct ImageAndTextPageComponent {
.onAreaChange((oldValue: Area, newValue: Area) => {
this.info = newValue
// console.log(TAG, "总页面滑动偏移量", this.scroller.currentOffset().yOffset)
// console.log(TAG, "总页面滑动偏移量111", newValue.globalPosition.y as number)
// console.log(TAG, ">>>>>当前页面滚动位置:", this.scroller.currentOffset().yOffset)
// console.log(TAG, ">>>>>当前评论区位置:", newValue.globalPosition.y as number)
// console.log(TAG, ">>>>>当前屏幕宽度和底部高度:", this.screenHeight,this.bottomHeight)
this.checkToScrollCommentArea()
})
// .onMeasureSize()
...
...
@@ -284,7 +284,7 @@ export struct ImageAndTextPageComponent {
.justifyContent(FlexAlign.SpaceBetween)
.alignItems(VerticalAlign.Bottom)
if (this.isNetConnected && !this.detailContentEmpty) {
//
if (this.isNetConnected && !this.detailContentEmpty) {
Row() {
Image($r('app.media.ic_news_detail_division'))
.width('100%')
...
...
@@ -294,7 +294,7 @@ export struct ImageAndTextPageComponent {
}
.padding({ left: 15, right: 15 })
.backgroundColor(Color.White)
}
//
}
}.backgroundColor(Color.White)
}
.margin({top: `${this.topSafeHeight}px`, bottom: `${this.bottomSafeHeight}px`})
...
...
@@ -467,7 +467,7 @@ export struct ImageAndTextPageComponent {
* 查询点赞、收藏数量
*/
queryContentInteractCount() {
console.error(TAG, 'contentDetailData2222', JSON.stringify(this.contentDetailData))
//
console.error(TAG, 'contentDetailData2222', JSON.stringify(this.contentDetailData))
const params: contentInteractParams = {
contentId: this.contentDetailData?.newsId + '',
...
...
@@ -504,16 +504,16 @@ export struct ImageAndTextPageComponent {
private pageScrollToCommonent() {
const info = componentUtils.getRectangleById('comment');
console.log(TAG, "点击滑动页面", JSON.stringify(info))
//评论区当前位置
let currentCommonentOffSetY = this.info?.globalPosition.y as number
let currentCommonentOffSetY = this.info?.globalPosition.y as number - 70
// 当前页面滚动位置
let currentScrollOffSetY = this.scroller.currentOffset().yOffset
let offSetY = 0
if (currentCommonentOffSetY >= (this.screenHeight-this.bottomHeight) ) {
offSetY = current
CommonentOffSetY-2
00
offSetY = current
ScrollOffSetY + (currentCommonentOffSetY - this.screenHeight+this.bottomHeight) + 4
00
}
// 定位到评论区域
if (
this.isScrollTop
) {
if (
!this.showMainText
) {
this.scroller.scrollTo({
xOffset: 0,
yOffset: offSetY,
...
...
@@ -522,11 +522,10 @@ export struct ImageAndTextPageComponent {
} else {
this.scroller.scrollEdge(Edge.Top)
}
this.isScrollTop = !this.isScrollTop
}
aboutToAppear() {
Logger.debug(TAG, '文章详情页 aboutToAppear,开始请求接口数据');
//
Logger.debug(TAG, '文章详情页 aboutToAppear,开始请求接口数据');
this.getDetail()
this.screenHeight = DisplayUtils.getDeviceHeight()
this.initAnimationConfig();
...
...
@@ -576,8 +575,7 @@ export struct ImageAndTextPageComponent {
// 需要评论区位置,调用前 请确保它有值
return
}
let offSetY = this.info?.globalPosition.y as number -60
Logger.debug(TAG, "即将滚动至yOffset: " + offSetY)
let offSetY = this.info?.globalPosition.y as number -70
if (offSetY >= (this.screenHeight-this.bottomHeight) ) {
this.showMainText = false
}else {
...
...
sight_harmony/features/wdComponent/src/main/ets/components/InteractMessage/InteractMComponent.ets
View file @
4ed7d5b
...
...
@@ -82,6 +82,8 @@ export struct InteractMComponent {
let contentDTO :ContentDTO = new ContentDTO();
contentDTO.objectType = this.messageModel.InteractMsubM.contentType
contentDTO.objectId = this.messageModel.InteractMsubM.contentId
contentDTO.relId = this.messageModel.InteractMsubM.contentRelId
contentDTO.relType = this.messageModel.InteractMsubM.contentRelType
ProcessUtils.processPage(contentDTO)
})
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/mine/MinePageUserSimpleInfoUI.ets
View file @
4ed7d5b
...
...
@@ -58,7 +58,7 @@ export default struct MinePageUserSimpleInfoUI {
.alt(this.userType === "1"?$r('app.media.default_head_userPage'):$r('app.media.AccountOwner_DefaultIcon'))
.width(63.21)
.height(63.21)
.objectFit(ImageFit.
Cover
)
.objectFit(ImageFit.
Fill
)
.borderRadius(50)
if(StringUtils.isNotEmpty(this.levelHead)){
...
...
sight_harmony/features/wdComponent/src/main/ets/components/mine/appointment/AppointmentListChildComponent.ets
View file @
4ed7d5b
...
...
@@ -147,7 +147,7 @@ export struct AppointmentListChildComponent {
}
}
.height(24)
.width(82)
.width(
this.item.status == "wait"?150:
82)
.padding({ left: 10, right: 10})
.alignItems(VerticalAlign.Center)
.backgroundColor($r('app.color.color_F5F5F5'))
...
...
sight_harmony/features/wdComponent/src/main/ets/components/mine/follow/FollowThirdTabsComponent.ets
View file @
4ed7d5b
...
...
@@ -50,7 +50,7 @@ export struct FollowThirdTabsComponent{
.fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor)
.lineHeight(18)
.backgroundImage($r('app.media.ic_collect_mid'))
.backgroundImageSize(ImageSize.
Cover
)
.backgroundImageSize(ImageSize.
FILL
)
.padding({top:7,bottom:7})
Image(index === 0?$r("app.media.ic_collect_left_right"):(index === this.data[this.firstIndex].children[this.secondIndex].children.length-1?$r('app.media.ic_collect_right_right'):$r('app.media.ic_collect_mid_right')))
...
...
sight_harmony/features/wdComponent/src/main/ets/components/mine/message/subscribe/SubscribeListChildComponent.ets
View file @
4ed7d5b
...
...
@@ -9,9 +9,8 @@ export struct SubscribeListChildComponent{
Row(){
Text(`${this.item.dealTime}`)
.margin({top:16,bottom:12})
.fontWeight(400)
.fontSize(12)
.lineHeight(1
7
)
.lineHeight(1
6
)
.fontColor($r('app.color.color_999999'))
}.width('100%')
.backgroundColor($r('app.color.color_F5F5F5'))
...
...
@@ -45,7 +44,6 @@ export struct SubscribeListChildComponent{
Text(`${this.item.desc}`)
.fontSize(14)
.lineHeight(20)
.fontWeight(400)
.fontColor($r('app.color.color_222222'))
.layoutWeight(1)
}.alignItems(VerticalAlign.Center)
...
...
sight_harmony/features/wdComponent/src/main/ets/components/mine/message/subscribe/SubscribeMessageComponent.ets
View file @
4ed7d5b
import { LazyDataSource, NetworkUtil, StringUtils, ToastUtils } from 'wdKit/Index';
import {
DateTimeUtils,
LazyDataSource, NetworkUtil, StringUtils, ToastUtils } from 'wdKit/Index';
import { Remark, SubscribeMessageModel,
WDMessageCenterMessageType } from '../../../../model/InteractMessageModel';
import MinePageDatasModel from '../../../../model/MinePageDatasModel';
...
...
@@ -150,10 +150,11 @@ export struct SubscribeMessageComponent{
this.hasMore = false
} else {
value.list.forEach((value) => {
let dealTime = this.DealStartTime(value.time,1)
let dealTime2 = this.DealStartTime(value.time,2)
let remark = JSON.parse(value.remark) as Remark
let liveTime = DateTimeUtils.formatDate(Number(remark.planStartTimeLong),'yyyy-MM-dd HH:mm:ss')
let dealTime = this.DealStartTime(liveTime,1)
let dealTime2 = this.DealStartTime(liveTime,2)
let bean = new SubscribeMessageModel(dealTime,value.message,remark.coverImageUrl,value.title,dealTime2,value.contentId)
bean.relId = remark.relationId
...
...
sight_harmony/features/wdComponent/src/main/ets/components/page/CardView.ets
View file @
4ed7d5b
...
...
@@ -8,6 +8,7 @@ import { TrackConstants,
TrackingContent, TrackingPageBrowse, TrackParamConvert } from 'wdTracking/Index';
import { WDShare } from 'wdShare/Index';
import { hasClicked, persistentStorage } from '../../utils/persistentStorage';
import { LottieView } from '../lottie/LottieView';
const TAG: string = 'CardView';
...
...
@@ -443,7 +444,7 @@ export struct PaperSingleColumn999CardView {
Image(this.item?.coverUrl)
.borderRadius(5)
.objectFit(ImageFit.Cover)
.aspectRatio(319 /
179
) ///图片设计比例
.aspectRatio(319 /
200
) ///图片设计比例
.padding({ top: 10 })
//视频
if (this.item?.videoInfo) {
...
...
@@ -481,6 +482,15 @@ export struct PaperSingleColumn999CardView {
.width(14)
.height(14)
.objectFit(ImageFit.Contain)
// LottieView({
// name: 'MorningPaper_live_status',
// path: "lottie/live_detail_living.json",
// lottieWidth: 14,
// lottieHeight: 14,
// autoplay: true,
// loop: true,
// })
Text(this.buildLiveStateString())
.fontColor(Color.White)
.fontSize($r('app.float.vp_12'))
...
...
sight_harmony/features/wdComponent/src/main/ets/components/page/EditUserIntroductionPage.ets
View file @
4ed7d5b
...
...
@@ -16,7 +16,7 @@ struct EditUserIntroductionPage {
CustomTitleUI({titleName:'修改简介'})
Row(){
Text
Input
({placeholder:'请输入简介',text:this.params.editContent})
Text
Area
({placeholder:'请输入简介',text:this.params.editContent})
.maxLength(60)
.width('100%')
.height(80)
...
...
sight_harmony/features/wdComponent/src/main/ets/components/peopleShipHomePage/PeopleShipHomeArticleListComponent.ets
View file @
4ed7d5b
import { Logger} from 'wdKit'
import { Logger
, ToastUtils
} from 'wdKit'
import { PeopleShipHomePageDataModel } from '../../viewmodel/PeopleShipHomePageDataModel'
import {
ContentDTO,
...
...
@@ -49,7 +49,10 @@ export struct PeopleShipHomeArticleListComponent {
// LoadingComponent()
this.LoadingLayout()
} else if (this.viewType == 2) {
ErrorComponent()
Column(){
EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NoCreation}).height('40%')
}.width('100%')
.height('100%')
}else if(this.viewType == 4){
Column(){
EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NoCreation}).height('40%')
...
...
@@ -201,6 +204,7 @@ export struct PeopleShipHomeArticleListComponent {
this.isLoading = false
if (this.arr.length == 0) {
this.viewType = 2
ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000)
}
}
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/peopleShipHomePage/PeopleShipHomePageTopComponent.ets
View file @
4ed7d5b
...
...
@@ -318,51 +318,51 @@ export struct PeopleShipHomePageTopComponent {
this.content = this.subTxt
}
}
// if (this.detailModel) {
// this.topFixedHeight = 160
// if (this.detailModel.region && this.detailModel.region.length > 0) {
// this.provinceName = this.detailModel.region
// } else {
// this.provinceName = await this.computeIPRegion(this.detailModel.province)
// }
// if (this.detailModel.authId == 1 && this.detailModel.categoryAuth.length > 0) {
// this.topFixedHeight += this.getTextLineNum(this.detailModel.categoryAuth, DisplayUtils.getDeviceWidth() - 90, 22, $r('app.float.vp_12')) * 18
// this.topFixedHeight += 12
// } else if (this.detailModel.authId == 2) {
// if (this.detailModel.authTitle && this.detailModel.authTitle.length > 0) {
// this.topFixedHeight += this.getTextLineNum(this.detailModel.authTitle, DisplayUtils.getDeviceWidth() - 90, 22, $r('app.float.vp_12')) * 18
// if (this.detailModel.authPersonal && this.detailModel.authPersonal.length > 0){
// this.topFixedHeight += 8
// }else{
// this.topFixedHeight += 12
// }
// }
// if (this.detailModel.authPersonal && this.detailModel.authPersonal.length > 0) {
// this.topFixedHeight += this.getTextLineNum(this.detailModel.authPersonal, DisplayUtils.getDeviceWidth() - 90, 22, $r('app.float.vp_12')) * 18
// this.topFixedHeight += 12
// }
// }else {
// this.topFixedHeight += 10
// }
//
// // IP归属地
// if (this.provinceName && this.provinceName.length > 0) {
// this.topFixedHeight += 30
// }
//
// // 简介
// if (this.detailModel.introduction && this.detailModel.introduction.length > 0 ) {
// this.lineInNum = this.getTextLineNum(`简介:${this.detailModel.introduction}`, DisplayUtils.getDeviceWidth() - 32, 21, $r('app.float.vp_14'))
// if (this.lineInNum <= 3) {
// this.topHeight = this.topFixedHeight + (21 * this.lineInNum)
// } else {
// this.lineInNum = this.getTextLineNum(`简介:${this.detailModel.introduction}` + '收起', DisplayUtils.getDeviceWidth() - 32, 21, $r('app.float.vp_14'))
// this.topHeight = this.topFixedHeight + (this.isCollapse ? 21 * 3 : 21 * this.lineInNum)
// }
// }
//
// this.topHeight = this.topFixedHeight
// }
if (this.detailModel) {
// this.topFixedHeight = 160
if (this.detailModel.region && this.detailModel.region.length > 0) {
this.provinceName = this.detailModel.region
} else {
this.provinceName = await this.computeIPRegion(this.detailModel.province)
}
// if (this.detailModel.authId == 1 && this.detailModel.categoryAuth.length > 0) {
// this.topFixedHeight += this.getTextLineNum(this.detailModel.categoryAuth, DisplayUtils.getDeviceWidth() - 90, 22, $r('app.float.vp_12')) * 18
// this.topFixedHeight += 12
// } else if (this.detailModel.authId == 2) {
// if (this.detailModel.authTitle && this.detailModel.authTitle.length > 0) {
// this.topFixedHeight += this.getTextLineNum(this.detailModel.authTitle, DisplayUtils.getDeviceWidth() - 90, 22, $r('app.float.vp_12')) * 18
// if (this.detailModel.authPersonal && this.detailModel.authPersonal.length > 0){
// this.topFixedHeight += 8
// }else{
// this.topFixedHeight += 12
// }
// }
// if (this.detailModel.authPersonal && this.detailModel.authPersonal.length > 0) {
// this.topFixedHeight += this.getTextLineNum(this.detailModel.authPersonal, DisplayUtils.getDeviceWidth() - 90, 22, $r('app.float.vp_12')) * 18
// this.topFixedHeight += 12
// }
// }else {
// this.topFixedHeight += 10
// }
//
// // IP归属地
// if (this.provinceName && this.provinceName.length > 0) {
// this.topFixedHeight += 30
// }
//
// // 简介
// if (this.detailModel.introduction && this.detailModel.introduction.length > 0 ) {
// this.lineInNum = this.getTextLineNum(`简介:${this.detailModel.introduction}`, DisplayUtils.getDeviceWidth() - 32, 21, $r('app.float.vp_14'))
// if (this.lineInNum <= 3) {
// this.topHeight = this.topFixedHeight + (21 * this.lineInNum)
// } else {
// this.lineInNum = this.getTextLineNum(`简介:${this.detailModel.introduction}` + '收起', DisplayUtils.getDeviceWidth() - 32, 21, $r('app.float.vp_14'))
// this.topHeight = this.topFixedHeight + (this.isCollapse ? 21 * 3 : 21 * this.lineInNum)
// }
// }
//
// this.topHeight = this.topFixedHeight
}
}
private computeShowNum(count: number) {
...
...
sight_harmony/features/wdComponent/src/main/ets/components/reusable/CustomTitleUI.ets
View file @
4ed7d5b
...
...
@@ -5,44 +5,53 @@ export struct CustomTitleUI {
imgBack:boolean = true
titleName:ResourceStr = "默认标题"
@Prop percent:number = 1
isShowBottomLine:boolean = false
build() {
RelativeContainer() {
//标题栏目
if(this.imgBack){
Image($r('app.media.back_icon'))
.width(24)
.height(24)
.objectFit(ImageFit.Auto)
.interpolation(ImageInterpolation.High)
.id("back_icon")
Column(){
RelativeContainer() {
//标题栏目
if(this.imgBack){
Image($r('app.media.back_icon'))
.width(24)
.height(24)
.objectFit(ImageFit.Auto)
.interpolation(ImageInterpolation.High)
.id("back_icon")
.alignRules({
center: {anchor: "__container__", align: VerticalAlign.Center},
left: {anchor: "__container__", align: HorizontalAlign.Start}
})
.margin({left: 16})
.onClick(()=>{
router.back()
})
}
Text(this.titleName)
.maxLines(1)
.id("title")
.fontFamily('PingFang SC-Regular')
.fontSize(18)
.fontWeight(400)
.fontColor($r('app.color.color_222222'))
.lineHeight(26)
.alignRules({
center: {anchor: "__container__", align: VerticalAlign.Center},
left: {anchor: "__container__", align: HorizontalAlign.Start}
})
.margin({left: 16})
.onClick(()=>{
router.back()
middle: {anchor: "__container__", align: HorizontalAlign.Center}
})
}
Text(this.titleName)
.maxLines(1)
.id("title")
.fontFamily('PingFang SC-Regular')
.fontSize(18)
.fontWeight(400)
.fontColor($r('app.color.color_222222'))
.lineHeight(26)
.alignRules({
center: {anchor: "__container__", align: VerticalAlign.Center},
middle: {anchor: "__container__", align: HorizontalAlign.Center}
})
}
.height(44)
.width('100%')
.backgroundColor($r('app.color.white'))
if(this.isShowBottomLine){
Text().backgroundColor($r('app.color.color_EDEDED'))
.width('100%')
.height(1)
}
}
.height(44)
.width('100%')
.backgroundColor($r('app.color.white'))
}
calcHeight(value:number): number{
...
...
sight_harmony/features/wdComponent/src/main/ets/model/InteractMessageModel.ets
View file @
4ed7d5b
...
...
@@ -107,6 +107,7 @@ export class SubscribeMessageModel{
export class Remark{
relationType:string = ""
coverImageUrl:string = ""
planStartTimeLong:string = ""
relationId:string = ""
status:string = ""
userName:string = ""
...
...
sight_harmony/features/wdComponent/src/main/ets/model/MineSettingDatasModel.ets
View file @
4ed7d5b
...
...
@@ -26,7 +26,7 @@ export class MineSettingDatasModel {
mainSettingData.push(new MineMainSettingFunctionItem(null, '隐私设罝', null, 0, false,"private_setting"))
let wifiState=SPHelper.default.getSync(SpConstants.SETTING_WIFI_IMAGE_SWITCH,false) as boolean
mainSettingData.push(new MineMainSettingFunctionItem(null, '仅wifi网络加载图片', null, 1, wifiState,"wifi_switch"))
let videoState=SPHelper.default.getSync(SpConstants.SETTING_WIFI_VIDEO_SWITCH,
fals
e) as boolean
let videoState=SPHelper.default.getSync(SpConstants.SETTING_WIFI_VIDEO_SWITCH,
tru
e) as boolean
mainSettingData.push(new MineMainSettingFunctionItem(null, 'wifi网络情况下自动播放视频', null, 1, videoState,"video_switch"))
let suspensionState=SPHelper.default.getSync(SpConstants.SETTING_SUSPENSION_SWITCH,false) as boolean
// mainSettingData.push(new MineMainSettingFunctionItem(null, '开启播放器悬浮窗', null, 1, suspensionState,"suspensionState_switch"))
...
...
sight_harmony/features/wdComponent/src/main/ets/pages/MineHomePage.ets
View file @
4ed7d5b
...
...
@@ -154,7 +154,7 @@ struct MineHomePage {
Row() {
Row() {
Text(
`${this.browseNum}`
)
Text(
this.handlerNum(this.browseNum.toString())
)
.textStyle()
Text("阅读")
.textStyle2()
...
...
@@ -168,7 +168,7 @@ struct MineHomePage {
.vertical(true)
.opacity(0.4)
Row() {
Text(
`${this.commentNum}`
)
Text(
this.handlerNum(this.commentNum.toString())
)
.textStyle()
Text("评论")
.textStyle2()
...
...
@@ -182,7 +182,7 @@ struct MineHomePage {
.vertical(true)
.opacity(0.4)
Row() {
Text(
`${this.attentionNum}`
)
Text(
this.handlerNum(this.attentionNum.toString())
)
.textStyle()
Text("关注")
.textStyle2()
...
...
@@ -401,7 +401,8 @@ struct MineHomePage {
})
.margin({ left: 10 })
.onClick(() => {
router.back()
let params = {'headPhotoUrl': this.headPhotoUrl} as Record<string, string>;
WDRouterRule.jumpWithPage(WDRouterPage.showUserHeaderPage,params)
})
Text(`${this.userName}`)
...
...
@@ -518,6 +519,24 @@ struct MineHomePage {
console.log(TAG,JSON.stringify(err))
})
}
handlerNum(number: string) {
const num = number??'0';
if (Number.parseInt(num) <= 9999) {
return Number.parseInt(num).toString()
} else if (Number.parseInt(num) > 9999 && Number.parseInt(num) <= 99999999) {
const num1: string = num.slice(0, -4); // 万
const num2: string = num.slice(-4, -3); // 千
return num2 === '0' ? num1 +'万' : num1 + '.' + num2 + '万'
} else if (Number.parseInt(num) > 99999999) {
const num1: string = num.slice(0, -8); // 亿
const num2: string = num.slice(-8, -7);
return num2 === '0' ? num1 +'亿' : num1 + '.' + num2 + '亿'
}
return num
}
getUserLevel(){
MinePageDatasModel.getUserLevelData(getContext(this)).then((value)=>{
if(value!=null){
...
...
sight_harmony/features/wdComponent/src/main/ets/pages/ShowUserHeaderPage.ets
View file @
4ed7d5b
...
...
@@ -14,10 +14,9 @@ struct ShowUserHeaderPage {
Row() {
Image(this.headPhotoUrl)
.alt($r('app.media.default_head'))
.width('720lpx')
.height('720lpx')
.width('100%')
.objectFit(ImageFit.Auto)
.clip(new Circle({ width: '720lpx', height: '720lpx' }))
//
.clip(new Circle({ width: '720lpx', height: '720lpx' }))
}
.width('100%')
.height('100%')
...
...
sight_harmony/features/wdComponent/src/main/ets/utils/lazyloadImg.ets
View file @
4ed7d5b
...
...
@@ -16,7 +16,7 @@ async function onlyWifiLoadImg(): Promise<boolean> {
}
async function onlyWifiLoadVideo(): Promise<boolean> {
let loadImageOnlyWifiSwitch = await SPHelper.default.get(SpConstants.SETTING_WIFI_VIDEO_SWITCH,
''
) || false;
let loadImageOnlyWifiSwitch = await SPHelper.default.get(SpConstants.SETTING_WIFI_VIDEO_SWITCH,
true
) || false;
if (!loadImageOnlyWifiSwitch) {
// 开关没开,直接让加载视频
return true
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/pages/DetailPlayLiveCommon.ets
View file @
4ed7d5b
...
...
@@ -9,6 +9,8 @@ import { publishCommentModel } from 'wdComponent/src/main/ets/components/comment
import { PictureLoading } from '../widgets/vertical/PictureLoading';
import { TrackConstants, TrackingPageBrowse } from 'wdTracking/Index';
import { LiveDetailPageLogic } from '../viewModel/LiveDetailPageLogic';
import { AudioSuspensionModel } from 'wdComponent'
import { BusinessError } from '@kit.BasicServicesKit';
const TAG = 'DetailPlayLiveCommon'
...
...
@@ -60,15 +62,8 @@ export struct DetailPlayLiveCommon {
// 是否隐藏Loading view
@State isHideLoading: boolean = false
async aboutToAppear(): Promise<void> {
const par: Action = router.getParams() as Action;
const params = par?.params;
this.relId = params?.extra?.relId || '';
this.relType = params?.extra?.relType || '';
this.contentId = params?.contentID || '';
this.getContentDetail()
}
private AudioSuspension = new AudioSuspensionModel()
@State isShowAudioCom: boolean = false
build() {
Column() {
...
...
@@ -92,82 +87,116 @@ export struct DetailPlayLiveCommon {
/**
* 查询视频详情用于评论展示
*/
getContentDetail() {
this.liveViewModel.getContentDetail(this.contentId, this.relId, this.relType)
.then(async (data: Array<ContentDetailDTO>) => {
console.log(TAG, '查询视频详情用于评论展示 getContentDetail:', JSON.stringify(data))
if (data) {
let detailData = data[0]
//人民号类型单独获取直播地址
if (detailData.rmhPlatform === 1 && detailData.liveInfo?.liveState === 'running') { //
let vliveId = detailData.liveInfo.vlive[0].vliveId as string
let pullStreamAddressData = await this.liveViewModel.getLiveRoomPullAddress(vliveId) as GetPullAddressBean
if (pullStreamAddressData) {
// console.log(TAG, ' GetPullAddressBean:', JSON.stringify(pullStreamAddressData))
let m3u8uUrl = pullStreamAddressData.transCode[0].m3u8Url
detailData.liveInfo.vlive[0].liveUrl = m3u8uUrl
this.playUrl = m3u8uUrl
}
getContentDetail(): Promise<void> {
return new Promise<void>((resolve, reject) => {
this.liveViewModel.getContentDetail(this.contentId, this.relId, this.relType)
.then(async (data: Array<ContentDetailDTO>) => {
// console.log(TAG, '查询视频详情用于评论展示 getContentDetail:', JSON.stringify(data));
if (!data || data.length === 0) {
this.isHideLoading = true;
ToastUtils.shortToast('内容不存在');
router.back();
reject();
return;
}
this.liveState = detailData.liveInfo?.liveState
this.contentDetailData = data[0]
this.liveDetailPageLogic.contentDetailData = this.contentDetailData
this.liveDetailPageLogic.liveLandscape = detailData?.liveInfo?.liveLandScape
const detailData = data[0];
this.liveDetailPageLogic.liveState = detailData.liveInfo?.liveState
// 人民号类型单独获取直播地址
if (detailData.rmhPlatform === 1 && detailData.liveInfo?.liveState === 'running') {
const vliveId = detailData.liveInfo.vlive[0].vliveId as string;
const pullStreamAddressData = await this.liveViewModel.getLiveRoomPullAddress(vliveId) as GetPullAddressBean;
this.liveDetailPageLogic.resolvingRoomImgSource()
this.liveDetailPageLogic.resolvingRoomVliveData(0)
this.publishCommentModel.targetId = String(detailData?.newsId || '')
this.publishCommentModel.targetRelId = String(detailData?.reLInfo?.relId || '')
this.publishCommentModel.targetTitle = detailData?.newsTitle
this.publishCommentModel.targetRelType = String(detailData?.reLInfo?.relType || '')
this.publishCommentModel.targetRelObjectId = String(detailData?.reLInfo?.relObjectId || '')
this.publishCommentModel.keyArticle = String(detailData?.keyArticle || '')
this.publishCommentModel.targetType = String(detailData?.newsType || '')
this.publishCommentModel.visitorComment = String(detailData?.visitorComment || '')
this.publishCommentModel.commentContent = ''
this.liveStyle = detailData.liveInfo?.liveStyle
if (detailData.liveInfo.liveState == 'end') {
this.playUrl = detailData.liveInfo.vlive[0].replayUri
if (pullStreamAddressData) {
const m3u8uUrl = pullStreamAddressData.transCode[0].m3u8Url;
detailData.liveInfo.vlive[0].liveUrl = m3u8uUrl;
this.playUrl = m3u8uUrl;
}
}
} else {
this.isHideLoading = true
ToastUtils.shortToast('内容不存在')
router.back()
}
}, () => {
this.isHideLoading = true
ToastUtils.shortToast('内容不存在')
router.back()
this.liveState = detailData.liveInfo?.liveState;
this.contentDetailData = detailData;
this.liveDetailPageLogic.contentDetailData = this.contentDetailData;
this.liveDetailPageLogic.liveLandscape = detailData?.liveInfo?.liveLandScape;
this.liveDetailPageLogic.liveState = detailData.liveInfo?.liveState;
this.liveDetailPageLogic.resolvingRoomImgSource();
this.liveDetailPageLogic.resolvingRoomVliveData(0);
const publishCommentModel = this.publishCommentModel;
publishCommentModel.targetId = String(detailData?.newsId || '');
publishCommentModel.targetRelId = String(detailData?.reLInfo?.relId || '');
publishCommentModel.targetTitle = detailData?.newsTitle;
publishCommentModel.targetRelType = String(detailData?.reLInfo?.relType || '');
publishCommentModel.targetRelObjectId = String(detailData?.reLInfo?.relObjectId || '');
publishCommentModel.keyArticle = String(detailData?.keyArticle || '');
publishCommentModel.targetType = String(detailData?.newsType || '');
publishCommentModel.visitorComment = String(detailData?.visitorComment || '');
publishCommentModel.commentContent = '';
this.liveStyle = detailData.liveInfo?.liveStyle;
if (detailData.liveInfo?.liveState === 'end') {
this.playUrl = detailData.liveInfo.vlive[0].replayUri;
}
})
resolve();
})
.catch(() => {
this.isHideLoading = true;
ToastUtils.shortToast('内容不存在');
router.back();
reject();
});
});
}
onPageShow() {
async onPageShow() {
this.pageShow = Math.random()
Logger.info(TAG, 'onPageShow')
//
Logger.info(TAG, 'onPageShow')
this.pageShowTime = DateTimeUtils.getTimeStamp()
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff'})
const par: Action = router.getParams() as Action;
const params = par?.params;
this.relId = params?.extra?.relId || '';
this.relType = params?.extra?.relType || '';
this.contentId = params?.contentID || '';
await this.getContentDetail()
// 判断当前窗口是否已显示,使用callback异步回调。
// Logger.info(TAG, 'this.liveState', this.liveState)
if(this.liveState !== 'wait') {
this.AudioSuspension.floatWindowClass.get().isShowing((err: BusinessError, data) => {
const errCode: number = err.code;
if (errCode) {
// console.error(TAG, 'Failed window is showing Cause:' + JSON.stringify(err));
return;
}
// console.info(TAG, 'window is showing: ' + JSON.stringify(data));
if(data) {
this.isShowAudioCom = true
this.AudioSuspension.playerController.get()?.pause();
this.AudioSuspension.minimize()
}
});
}
}
onPageHide() {
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000'})
this.pageHide = Math.random()
Logger.info(TAG, 'onPageHide')
//
Logger.info(TAG, 'onPageHide')
//页面浏览
TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Live_Detail,
TrackConstants.PageName.Live_Detail
, Math.floor((DateTimeUtils.getTimeStamp() - this.pageShowTime) / 1000))
if(this.liveState !== 'wait') {
if (this.isShowAudioCom) {
this.AudioSuspension.showWindow()
this.isShowAudioCom = false
}
}
}
onBackPress(): boolean | void {
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/video/PlayUIComponent.ets
View file @
4ed7d5b
...
...
@@ -258,7 +258,7 @@ export struct PlayUIComponent {
.fontWeight(400)
.fontColor(Color.White)
if (this.liveRoomDataBean.pv > 0) {
if (this.liveRoomDataBean.pv > 0
&& !StringUtils.isEmpty(this.liveUrl)
) {
Image($r('app.media.icon_live_player_status_end'))
.width(12)
.height(12)
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/vertical/PlayerEndView.ets
View file @
4ed7d5b
...
...
@@ -91,6 +91,19 @@ export struct PlayerEndView {
.padding({ bottom: 40, top: 120 })
Stack() {
if (this.contentDetailData.rmhInfo != null) {
Row() {
Image($r("app.media.live_end_BG_l"))
.width(307/2.0)
.height(254)
Image($r("app.media.live_end_BG_r"))
.width(307/2.0)
.height(254)
}
// .width(307)
// .height(254)
// .backgroundColor(Color.Red)
}
Column() {
if (this.contentDetailData.rmhInfo != null) {
Text(this.contentDetailData?.rmhInfo?.rmhName)
...
...
@@ -104,22 +117,25 @@ export struct PlayerEndView {
.fontColor('#B2FFFFFF')
.padding({ top: 8 })
}
Row() {
Column() {
Text(this.duration).fontWeight(600).fontSize(24).fontColor(Color.White)
Text('直播时长').fontWeight(400).fontSize(13).fontColor(Color.White)
}
Text('').width(1).height(32).margin({ left: 36, right: 36 }).backgroundColor('#33FFFFFF')
Column() {
Text(NumberFormatterUtils.formatNumberWithWan(this.liveRoomDataBean?.pv || ''))
.fontWeight(600)
.fontSize(24)
.fontColor(Color.White)
Text('观看人数').fontWeight(400).fontSize(13).fontColor(Color.White)
Blank().height(this.contentDetailData.rmhInfo == null ? 26:16)
Stack() {
Row() {
Column() {
Text(this.duration).fontWeight(600).fontSize(20).fontColor(Color.White)
Text('直播时长').fontWeight(400).fontSize(12).fontColor(Color.White)
}
Blank().width(1).height(32).margin({ left: 36, right: 36 })
Column() {
Text(NumberFormatterUtils.formatNumberWithWan(this.liveRoomDataBean?.pv || ''))
.fontWeight(600)
.fontSize(20)
.fontColor(Color.White)
Text('观看人数').fontWeight(400).fontSize(12).fontColor(Color.White)
}
}
Text('').width(1).height(32).backgroundColor('#33FFFFFF')
}
.padding({ top: this.contentDetailData.rmhInfo == null ? 26 : 16 })
if (this.contentDetailData.rmhInfo != null) {
Row() {
Text(this.followStatus == '0' ? '关注' : '已关注')
...
...
@@ -132,7 +148,8 @@ export struct PlayerEndView {
left: 122,
right: 122
})
.backgroundColor(this.followStatus == '0' ? '#FFED2800' : Color.Grey)
.height(42)
.backgroundColor(this.followStatus == '0' ? '#FFED2800' : '#CCCCCC')
.borderRadius(4)
.onClick(() => {
this.handleAccention()
...
...
@@ -143,16 +160,16 @@ export struct PlayerEndView {
}
.width(307)
.height(this.contentDetailData.rmhInfo == null ? 100 : 254)
.backgroundColor(
'#999999
')
.backgroundColor(
this.contentDetailData.rmhInfo == null ? '#12ffffff' : '
')
.borderRadius(4)
if (this.contentDetailData.rmhInfo != null) {
Image(this.contentDetailData.rmhInfo?.rmhHeadUrl)
.width(80)
.height(80)
.borderRadius(40)
.borderWidth(1)
.borderColor(Color.White)
.borderStyle(BorderStyle.Solid)
// .borderWidth(1)
// .borderColor(Color.White)
// .borderStyle(BorderStyle.Solid)
.position({ x: '50%', y: 0 })
.markAnchor({ x: '50%', y: '50%' })
}
...
...
@@ -183,6 +200,8 @@ export struct PlayerEndView {
}
.height('100%')
.width('100%')
// .align(Alignment.Center)
.justifyContent(FlexAlign.Center)
}
.height('100%')
.width('100%')
...
...
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/pages/DetailPlayShortVideoPage.ets
View file @
4ed7d5b
...
...
@@ -306,9 +306,9 @@ export struct DetailPlayShortVideoPage {
onHeightDidChange: (height: number) => {
this.playerWidth = px2vp(this.windowWidth)
this.playerHeight = px2vp(this.windowHeight - height)
Logger.debug(TAG,
"height: " + px2vp(height) + " ===> 视频高度: " + this.playerHeight + " window height: " +
px2vp(this.windowHeight))
// Logger.debug(TAG,
// "height: " + px2vp(height) + " ===> 视频高度: " + this.playerHeight + " window height: " +
// px2vp(this.windowHeight))
}
})
this.playerViewBuilder()
...
...
@@ -332,13 +332,9 @@ export struct DetailPlayShortVideoPage {
.layoutWeight(1)
.onClick(() => {
this.playerController?.switchPlayOrPause();
this.isPlay = !this.isPlay
this.playerController.onStatusChange = (status: number) => {
this.status = status
if (status === PlayerConstants.STATUS_PAUSE) {
this.isPlay = false
} else if (status === PlayerConstants.STATUS_START) {
this.isPlay = true
}
}
})
...
...
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/pages/DetailVideoListPage.ets
View file @
4ed7d5b
...
...
@@ -100,7 +100,7 @@ export struct DetailVideoListPage {
aboutToAppear() {
// 在视频详情页
this.peopleShipHomeCreatorId = AppStorage.get<string>('peopleShipHomeCreatorId') || '';
console.info(`cj2024 peopleShipHomeCreatorId = ${this.peopleShipHomeCreatorId}`)
//
console.info(`cj2024 peopleShipHomeCreatorId = ${this.peopleShipHomeCreatorId}`)
if (this.peopleShipHomeCreatorId) {
// 从人民号号主传过来的
this.getPeopleShipHomeDetail(this.peopleShipHomeCreatorId);
...
...
@@ -112,17 +112,25 @@ export struct DetailVideoListPage {
}
async getPeopleShipHomeDetail(peopleShipHomeCreatorId: string) {
this.openFullScreen();
const action: Action = router.getParams() as Action;
if (action) {
this.contentId = action.params?.contentID || '';
if (action.params && action.params.extra) {
this.relId = action.params.extra.relId || '';
this.relType = action.params.extra.relType || '';
// 注册监听网络连接
this.netStatus = undefined
let netStatus = NetworkUtil.isNetConnected()
if (netStatus) {
this.openFullScreen();
const action: Action = router.getParams() as Action;
if (action) {
this.contentId = action.params?.contentID || '';
if (action.params && action.params.extra) {
this.relId = action.params.extra.relId || '';
this.relType = action.params.extra.relType || '';
}
// console.info(TAG, `cj2024 getPeopleShipHomeDetail contentId = ${this.contentId}`)
await this.getRmhContentDetail(this.contentId, this.relId, this.relType)
this.getRmhPublishNexts(peopleShipHomeCreatorId, this.contentId, 1, 1, 10, systemDateTime.getTime(false));
}
console.info(`cj2024 getPeopleShipHomeDetail contentId = ${this.contentId}`)
await this.getContentDetail(this.contentId, this.relId, this.relType)
this.getRmhPublishNexts(peopleShipHomeCreatorId, this.contentId, 1, 1, 10, systemDateTime.getTime(false));
} else {
// 无网络
this.netStatus = 1
}
}
...
...
@@ -249,8 +257,8 @@ export struct DetailVideoListPage {
relId: relId,
relType: relType
}).then(async (resDTO: ResponseDTO<ContentDetailDTO[]>) => {
console.log(TAG, 'getContentDetail:', JSON.stringify(resDTO.data))
this.isOffLine = resDTO.data == null ? true : false
// console.log(TAG, 'getContentDetail:', JSON.stringify(resDTO.data))
// this.isOffLine = resDTO.data == null ? true : false
if (resDTO.data) {
const params: contentListParams = {
contentList: [{
...
...
@@ -288,7 +296,7 @@ export struct DetailVideoListPage {
pageSize: pageSize,
refreshTime: refreshTime
}).then(async (resDTO: ResponseDTO<PeopleShipNextListDTO>) => {
console.log(TAG, 'cj2024 getRmhPublishNexts:', JSON.stringify(resDTO.data))
//
console.log(TAG, 'cj2024 getRmhPublishNexts:', JSON.stringify(resDTO.data))
this.isOffLine = resDTO.data == null ? true : false
if (resDTO.data && resDTO.data.list && resDTO.data.list.length > 0) {
const params: contentListParams = {
...
...
@@ -321,7 +329,7 @@ export struct DetailVideoListPage {
refreshCnt: 1
}).then(async res => {
if (res.data) {
console.log(TAG, 'cj2024 queryVideoList:', JSON.stringify(res.data))
//
console.log(TAG, 'cj2024 queryVideoList:', JSON.stringify(res.data))
await this.getContentInteract(res.data)
this.data = this.data.concat(res.data)
// console.log('视频列表===', JSON.stringify(res.data))
...
...
sight_harmony/features/wdLogin/src/main/ets/pages/login/LoginProtocolWebview.ets
View file @
4ed7d5b
...
...
@@ -70,7 +70,12 @@ struct LoginProtocolWebview {
}
.alignItems(VerticalAlign.Center)
.width('100%')
.height(44)
.height(43)
Text().backgroundColor("#EDEDED")
.width('100%')
.height(1)
if(this.isConnectNetwork){
Web({ src: this.webUrl, controller: this.webviewController })
.backgroundColor(Color.White)
...
...
sight_harmony/features/wdPlayer/src/main/ets/controller/BackgroundAudioController.ets
View file @
4ed7d5b
...
...
@@ -27,7 +27,7 @@ export class BackgroundAudioController {
public gotContextFunc?: () => Context
public avplayerController?: WDPlayerController
private lastSession?: AVSessionManager.AVSession
private lastSession?: AVSessionManager.AVSession
| null
private applyedLongTaskPlay: boolean = false
...
...
@@ -64,6 +64,7 @@ export class BackgroundAudioController {
if (this.lastSession) {
this.lastSession.deactivate();
this.lastSession.destroy();
this.lastSession = null
}
}
...
...
sight_harmony/products/phone/src/main/ets/pages/launchPage/LaunchAdvertisingPage.ets
View file @
4ed7d5b
...
...
@@ -126,7 +126,7 @@ struct LaunchAdvertisingPage {
.fontColor(Color.White)
.margin({left:14,right:14})
}
.width(
7
4)
.width(
8
4)
.height(28)
.margin({top:5,right:10})
.backgroundColor('#80000000')
...
...
sight_harmony/products/phone/src/main/ets/pages/view/AudioComponent.ets
View file @
4ed7d5b
import { AudioSuspensionModel } from 'wdComponent'
import { PlayerConstants, DateFormatUtil } from 'wdPlayer'
import { PlayerConstants, DateFormatUtil
, BackgroundAudioController
} from 'wdPlayer'
import { EmitterEventId, EmitterUtils, SPHelper } from 'wdKit/Index'
import window from '@ohos.window';
import lottie from '@ohos/lottie';
...
...
@@ -195,6 +195,7 @@ struct Index {
if (this.AudioSuspension.playerController) {
this.AudioSuspension.playerController.get().pause()
this.AudioSuspension.minimize()
BackgroundAudioController.sharedController().destorySession()
}
}))
}
...
...
sight_harmony/products/phone/src/main/ets/pages/view/BottomNavigationComponent.ets
View file @
4ed7d5b
...
...
@@ -9,8 +9,6 @@ import { VideoChannelPage } from './VideoChannelPage';
import ChannelViewModel from 'wdComponent/src/main/ets/viewmodel/ChannelViewModel';
import { ALL, ImageKnifeComponent, ImageKnifeOption } from '@ohos/imageknife';
import { ParamType, Tracking } from 'wdTracking/Index';
import { AudioSuspensionModel } from 'wdComponent'
import { BusinessError } from '@kit.BasicServicesKit';
import { GrayManageModel } from 'wdComponent/src/main/ets/viewmodel/GrayManageModel';
const TAG = 'BottomNavigationComponent';
...
...
@@ -54,8 +52,6 @@ export struct BottomNavigationComponent {
@State assignChannel: AssignChannelParam = new AssignChannelParam()
// 自动刷新触发(双击tab自动刷新)
@State autoRefresh: number = 0
private AudioSuspension = new AudioSuspensionModel()
@State isShowAudioCom: boolean = false
// 国殇灰度管理
GrayManage: SubscribedAbstractProperty<GrayManageModel> = AppStorage.link<GrayManageModel>('GrayManage')
...
...
@@ -157,9 +153,6 @@ export struct BottomNavigationComponent {
.hoverEffect(HoverEffect.Highlight)
.visibility(this.displayDirection === DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None)
// .hitTestBehavior(HitTestMode.Block)
.onTouch(() => {
this.handleAudio(navItem)
})
.onClick(() => {
// Logger.info(TAG, `onChange, index: ${index}`);
// Logger.info(TAG, `onChange, navItem: ${JSON.stringify(navItem)}`);
...
...
@@ -268,32 +261,6 @@ export struct BottomNavigationComponent {
return isSelect ? $r('app.media.icon_tab_res1') : $r('app.media.icon_tab_res1_no')
}
// 控制音频悬浮窗显隐
handleAudio(navItem: BottomNavDTO) {
if (navItem.name === '视频') {
// 判断当前窗口是否已显示,使用callback异步回调。
this.AudioSuspension.floatWindowClass.get().isShowing((err: BusinessError, data) => {
const errCode: number = err.code;
if (errCode) {
// console.error(TAG, 'Failed window is showing Cause:' + JSON.stringify(err));
return;
}
// console.info(TAG, 'window is showing: ' + JSON.stringify(data));
if(data) {
this.isShowAudioCom = true
this.AudioSuspension.playerController.get()?.pause();
this.AudioSuspension.minimize()
}
});
} else {
// console.info(TAG, 'this.isShowAudioCom: ' + this.isShowAudioCom);
if (this.isShowAudioCom) {
this.AudioSuspension.showWindow()
this.isShowAudioCom = false
}
}
}
// 底导切换函数
async onBottomNavigationIndexChange(navItem: BottomNavDTO, index: number) {
// Logger.info(TAG, `onBottomNavigationIndexChange to Index:${index},this.currentNavIndex: ${this.currentNavIndex}`);
...
...
sight_harmony/products/phone/src/main/ets/pages/view/VideoChannelPage.ets
View file @
4ed7d5b
...
...
@@ -13,6 +13,8 @@ import { ParamType, Tracking } from 'wdTracking/Index';
import { ColorUtils } from 'wdComponent/src/main/ets/utils/ColorUtils';
import { ImageKnifeComponent } from '@ohos/imageknife';
import { CommonUtils } from 'wdComponent/src/main/ets/utils/CommonUtils';
import { AudioSuspensionModel } from 'wdComponent'
import { BusinessError } from '@kit.BasicServicesKit';
const TAG = 'VideoChannelPage'
...
...
@@ -42,6 +44,8 @@ export struct VideoChannelPage {
// 背景高度
@State backgroundImageH: number = 0
@Consume @Watch('setBarBackgroundColor') pageShow: number
private AudioSuspension = new AudioSuspensionModel()
@State isShowAudioCom: boolean = false
// 国殇灰度管理
GrayManage: SubscribedAbstractProperty<GrayManageModel> = AppStorage.link<GrayManageModel>('GrayManage')
...
...
@@ -50,6 +54,9 @@ export struct VideoChannelPage {
this.backgroundImageH = px2vp(this.topSafeHeight) + 44
// console.info(`cj2024 backgroundImageH = ${this.backgroundImageH} this.topSafeHeight = ${this.topSafeHeight}`)
this.setBarBackgroundColor()
if (this.currentTopNavSelectedIndex === 0) {
this.handleAudio(this.topNavList[0])
}
}
/**
...
...
@@ -100,6 +107,32 @@ export struct VideoChannelPage {
}
// 控制音频悬浮窗显隐
handleAudio(navItem: TopNavDTO) {
if (navItem.name === '视频') {
// 判断当前窗口是否已显示,使用callback异步回调。
this.AudioSuspension.floatWindowClass.get().isShowing((err: BusinessError, data) => {
const errCode: number = err.code;
if (errCode) {
// console.error(TAG, 'Failed window is showing Cause:' + JSON.stringify(err));
return;
}
// console.info(TAG, 'window is showing: ' + JSON.stringify(data));
if(data) {
this.isShowAudioCom = true
this.AudioSuspension.playerController.get()?.pause();
this.AudioSuspension.minimize()
}
});
} else {
// console.info(TAG, 'this.isShowAudioCom: ' + this.isShowAudioCom);
if (this.isShowAudioCom) {
this.AudioSuspension.showWindow()
this.isShowAudioCom = false
}
}
}
build() {
Stack({ alignContent: Alignment.Top }) {
...
...
@@ -152,6 +185,7 @@ export struct VideoChannelPage {
.onClick(() => {
// 视频tab埋点
const tab = this.topNavList[index]
this.handleAudio(tab)
Logger.info(TAG, `视频tab埋点: ${JSON.stringify(tab)}`);
const params: ParamType = {
"pageName": tab.name,
...
...
Please
register
or
login
to post a comment