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
wangyujian_wd
2024-04-26 11:06:44 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
f6ff3fe1982ad94e42d2da70314bd42f5bd9f772
f6ff3fe1
1 parent
4edc7f53
fix:1)多图列表页面修改下载图片问题,新增指定图片位置打开索引值;2)关闭直播播放视频逻辑,调优后再放开验证;
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
32 additions
and
171 deletions
sight_harmony/features/wdBean/src/main/ets/bean/component/extra/ExtraDTO.ts
sight_harmony/features/wdComponent/Index.ets
sight_harmony/features/wdComponent/src/main/ets/components/ImageDownloadComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/ImageSwiperComponent.ets
sight_harmony/features/wdComponent/src/main/ets/pages/MultiPictureListPage.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/pages/DetailPlayLivePage.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/TabLiveItemComponent.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/video/PlayUIComponent.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/video/TopPlayComponet.ets
sight_harmony/features/wdBean/src/main/ets/bean/component/extra/ExtraDTO.ts
View file @
f6ff3fe
...
...
@@ -15,5 +15,6 @@ export interface ExtraDTO extends ItemDTO {
relType
:
string
;
liveStreamType
?:
number
;
photoList
:
PhotoListBean
[];
swiperIndex
?:
number
commentId
?:
string
;
}
\ No newline at end of file
...
...
sight_harmony/features/wdComponent/Index.ets
View file @
f6ff3fe
...
...
@@ -71,8 +71,6 @@ export { SpacialTopicPageComponent } from './src/main/ets/components/SpacialTopi
export { LogoutViewModel } from "./src/main/ets/viewmodel/LogoutViewModel"
export { ImageSwiperComponent } from "./src/main/ets/components/ImageSwiperComponent"
export { newsSkeleton } from "./src/main/ets/components/skeleton/newsSkeleton"
export { LiveCommentComponent } from "./src/main/ets/components/comment/view/LiveCommentComponent"
...
...
sight_harmony/features/wdComponent/src/main/ets/components/ImageDownloadComponent.ets
View file @
f6ff3fe
...
...
@@ -20,7 +20,7 @@ export struct ImageDownloadComponent {
@State image: PixelMap | undefined = undefined;
@State photoAccessHelper: photoAccessHelper.PhotoAccessHelper | undefined = undefined; // 相册模块管理实例
@State imageBuffer: ArrayBuffer | undefined = undefined; // 图片ArrayBuffer
url: string = ''
@Prop @Watch('onChangeUrl')
url: string = ''
build() {
Column() {
...
...
@@ -40,7 +40,11 @@ export struct ImageDownloadComponent {
}
async aboutToAppear(): Promise<void> {
aboutToAppear(): void {
this.onChangeUrl()
}
async onChangeUrl(): Promise<void> {
console.info(`cj2024 图片下载 ${this.url}`)
const context = getContext(this) as common.UIAbilityContext;
const atManager = abilityAccessCtrl.createAtManager();
...
...
sight_harmony/features/wdComponent/src/main/ets/components/ImageSwiperComponent.ets
deleted
100644 → 0
View file @
4edc7f5
import { PhotoListBean } from 'wdBean/Index';
import { Logger } from 'wdKit/Index';
import { display, router } from '@kit.ArkUI';
import { ImageDownloadComponent } from './ImageDownloadComponent';
import { ImageItemView } from './view/ImageItemView';
const TAG = 'ImageSwiperComponent';
@Component
export struct ImageSwiperComponent {
@Provide @Watch('onCurrentPageNumUpdated') currentPageNum: string = '01'
private scroller: Scroller = new Scroller()
@State swiperIndex: number = 0;
photoList: PhotoListBean[] = [];
private swiperController: SwiperController = new SwiperController()
private displayTool = display.getDefaultDisplaySync()
private screenWidth: number = 0
private picWidth: number = 0
@State picHeight: number = 0
@State isEnableSwipe: boolean = true;
// @Provide bgc: Color = Color.White;
//watch监听页码回调
onCurrentPageNumUpdated(): void {
Logger.info(TAG, `currentPageNum:${this.currentPageNum}`,)
let _swiperIndex = Number.parseInt(this.currentPageNum)
Logger.info(TAG, `_swiperIndex:${_swiperIndex}`)
this.swiperIndex = _swiperIndex > 0 ? _swiperIndex - 1 : _swiperIndex
}
aboutToAppear(): void {
//获取宽高尺寸
this.screenWidth = this.displayTool.width
// this.picWidth = this.screenWidth - vp2px(52)
this.picWidth = this.screenWidth
this.picHeight = this.picWidth * 578 / 375
}
build() {
RelativeContainer() {
Image($r('app.media.icon_arrow_left_white'))
.width(24)
.height(24)
.aspectRatio(1)
.interpolation(ImageInterpolation.High)
.alignRules({
top: { anchor: "__container__", align: VerticalAlign.Top },
left: { anchor: "__container__", align: HorizontalAlign.Start }
})
.onClick(() => {
router.back();
})
.id("backImg")
if (this.photoList && this.photoList?.length > 0) {
Swiper(this.swiperController) {
ForEach(this.photoList, (item: PhotoListBean) => {
// MultiPictureDetailItemComponent({ MultiPictureDetailItem: item })
ImageItemView({ MultiPictureDetailItem: item, isEnableSwipe: this.isEnableSwipe })
})
}
.index(this.swiperIndex)
.width('100%')
.height(px2vp(this.picHeight) + 32)
.vertical(false)
.autoPlay(false)
.cachedCount(3)
.indicator(false)
.displayCount(1)
.id('e_swiper_content')
.alignRules({
center: { anchor: "__container__", align: VerticalAlign.Center },
middle: { anchor: "__container__", align: HorizontalAlign.Center }
})
.onChange((index: number) => {
this.swiperIndex = index
})
Row() {
Scroll(this.scroller) {
Row() {
Flex({
direction: FlexDirection.Column,
justifyContent: FlexAlign.Start
}) {
Text() {
Span(`${this.swiperIndex + 1}`)
.fontSize(24)
.fontFamily('PingFang SC-Medium')
.fontWeight(500)
.lineHeight(28)
Span(`/${this.photoList.length}`)
.fontSize(14)
.fontFamily('PingFang SC-Medium')
.fontWeight(500)
.lineHeight(19)
}.fontColor(Color.White).margin(4)
}
}
.width('100%')
.margin({
top: 8,
left: 18,
bottom: 24,
right: 18
})
}
.scrollable(ScrollDirection.Vertical)
.scrollBarWidth(0)
}
.id('e_swiper_titles')
.alignRules({
bottom: { anchor: "__container__", align: VerticalAlign.Bottom },
middle: { anchor: "__container__", align: HorizontalAlign.Center }
})
}
ImageDownloadComponent({ url: this.photoList[this.swiperIndex].picPath })
.alignRules({
bottom: { anchor: "__container__", align: VerticalAlign.Bottom },
right: { anchor: "__container__", align: HorizontalAlign.End }
})
.margin({
top: 8,
left: 18,
bottom: 24,
right: 18
})
.id("downloadImg")
}
.width('100%')
.height('100%')
.backgroundColor(Color.Black)
.id('e_picture_container')
// 设置顶部绘制延伸到状态栏
// 设置底部绘制延伸到导航条
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
}
}
\ No newline at end of file
sight_harmony/features/wdComponent/src/main/ets/pages/MultiPictureListPage.ets
View file @
f6ff3fe
import { PhotoListBean } from 'wdBean/Index';
import { display, router } from '@kit.ArkUI';
import { Logger } from 'wdKit/Index';
import { ImageItemView } from '../components/view/ImageItemView';
import { ImageDownloadComponent } from '../components/ImageDownloadComponent';
import { Action } from 'wdBean';
...
...
@@ -10,7 +9,6 @@ const TAG = 'MultiPictureListPage';
@Entry
@Component
export struct MultiPictureListPage {
@Provide @Watch('onCurrentPageNumUpdated') currentPageNum: string = '01'
private scroller: Scroller = new Scroller()
@State swiperIndex: number = 0;
photoList: PhotoListBean[] = [];
...
...
@@ -20,17 +18,10 @@ export struct MultiPictureListPage {
private picWidth: number = 0
@State picHeight: number = 0
@State isEnableSwipe: boolean = true;
@State currentUrl: string = ''
// @Provide bgc: Color = Color.White;
//watch监听页码回调
onCurrentPageNumUpdated(): void {
Logger.info(TAG, `currentPageNum:${this.currentPageNum}`,)
let _swiperIndex = Number.parseInt(this.currentPageNum)
Logger.info(TAG, `_swiperIndex:${_swiperIndex}`)
this.swiperIndex = _swiperIndex > 0 ? _swiperIndex - 1 : _swiperIndex
}
aboutToAppear(): void {
//获取宽高尺寸
this.screenWidth = this.displayTool.width
...
...
@@ -40,6 +31,8 @@ export struct MultiPictureListPage {
let par: Action = router.getParams() as Action;
let params = par?.params;
this.photoList = params?.extra?.photoList || [];
this.swiperIndex = params?.extra?.swiperIndex || 0;
this.currentUrl = this.photoList[this.swiperIndex]?.picPath
}
build() {
...
...
@@ -80,6 +73,7 @@ export struct MultiPictureListPage {
})
.onChange((index: number) => {
this.swiperIndex = index
this.currentUrl = this.photoList[index]?.picPath
})
Row() {
...
...
@@ -121,7 +115,7 @@ export struct MultiPictureListPage {
})
}
ImageDownloadComponent({ url: this.
photoList[this.swiperIndex].picPath
})
ImageDownloadComponent({ url: this.
currentUrl
})
.alignRules({
bottom: { anchor: "__container__", align: VerticalAlign.Bottom },
right: { anchor: "__container__", align: HorizontalAlign.End }
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/pages/DetailPlayLivePage.ets
View file @
f6ff3fe
...
...
@@ -32,15 +32,15 @@ export struct DetailPlayLivePage {
aboutToAppear(): void {
Logger.info(TAG, `wyj-aboutToAppear`)
this.listener?.on("change", (mediaQueryResult) => {
Logger.info(TAG, `change;${mediaQueryResult.matches}`)
if (mediaQueryResult?.matches) {
this.displayDirection = DisplayDirection.VIDEO_HORIZONTAL
} else {
this.displayDirection = DisplayDirection.VERTICAL
}
WindowModel.shared.setMainWindowFullScreen(this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL)
})
// this.listener?.on("change", (mediaQueryResult) => {
// Logger.info(TAG, `change;${mediaQueryResult.matches}`)
// if (mediaQueryResult?.matches) {
// this.displayDirection = DisplayDirection.VIDEO_HORIZONTAL
// } else {
// this.displayDirection = DisplayDirection.VERTICAL
// }
// WindowModel.shared.setMainWindowFullScreen(this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL)
// })
this.getLiveDetails()
this.getLiveRoomData()
}
...
...
@@ -67,7 +67,7 @@ export struct DetailPlayLivePage {
onPageShowCus(): void {
Logger.info(TAG, `wyj-onPageShowCus`)
// WindowModel.shared.setPreferredOrientation(window.Orientation.
AUTO_ROTATION_RESTRICT
ED);
// WindowModel.shared.setPreferredOrientation(window.Orientation.
LOCK
ED);
}
onPageHideCus(): void {
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/TabLiveItemComponent.ets
View file @
f6ff3fe
...
...
@@ -100,7 +100,7 @@ export struct TabLiveItemComponent {
picDesc: ''
})
}
this.gotoMultipleListImagePage()
this.gotoMultipleListImagePage(
index
)
})
})
}
...
...
@@ -187,13 +187,14 @@ export struct TabLiveItemComponent {
* 大图列表页
* @param content
* */
gotoMultipleListImagePage() {
gotoMultipleListImagePage(
index: number
) {
let taskAction: Action = {
type: 'JUMP_DETAIL_PAGE',
params: {
detailPageType: 18,
extra: {
photoList: this.photoList
photoList: this.photoList,
swiperIndex: index,
} as ExtraDTO
} as Params,
};
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/video/PlayUIComponent.ets
View file @
f6ff3fe
...
...
@@ -191,7 +191,10 @@ export struct PlayUIComponent {
@Builder
getMiddleUIComponent() {
Stack()
Stack() {
Text('播放功能暂时关闭')
.fontColor(Color.White)
}.alignContent(Alignment.Center)
.layoutWeight(1)
.width('100%')
.onClick(() => {
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/video/TopPlayComponet.ets
View file @
f6ff3fe
...
...
@@ -13,7 +13,7 @@ export struct TopPlayComponent {
aboutToAppear(): void {
if (this.playerController) {
this.playerController.onCanplay = () => {
this.playerController?.play()
//
this.playerController?.play()
}
}
}
...
...
@@ -31,7 +31,7 @@ export struct TopPlayComponent {
} else if (this.liveDetailsBean.liveInfo.liveState == 'end') {
playUrl = this.liveDetailsBean.liveInfo.vlive[0].replayUri
}
this.playerController?.firstPlay(playUrl);
//
this.playerController?.firstPlay(playUrl);
}
}
...
...
Please
register
or
login
to post a comment