wangliang_wd

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

* 'main' of http://192.168.1.42/developOne/harmonyPool:
  18497图集详情页,图片上滑或下滑,返回上一页面,页面退出效果明显,参考视频中安卓退出效果
  ref |> 处理音频播控中心暂停后再播放问题
  ref |> 调整评论弹框上面点赞需要登录问题
  fix: 轮播卡修复点右边的稿件,跳到左边稿件的详情了
  未授权不提示失败
  滑动后滑块不消失
... ... @@ -53,8 +53,11 @@ export struct ImageDownloadComponent {
} catch (error) {
const err: BusinessError = error as BusinessError;
//console.info(`Failed to save photo. Code is ${err.code}, message is ${err.message}`);
if (this.isGranted) {
promptAction.showToast({ message: '保存图片失败!' });
}
}
}
})
}
... ... @@ -161,11 +164,12 @@ export struct ImageDownloadComponent {
* @returns
*/
async saveImage(buffer: ArrayBuffer | string): Promise<void> {
//console.info(`cj2024 saveImage buffer ${buffer}`)
//console.info(`cj2024 saveImage buffer ${buffer} isGranted = ${this.isGranted}`)
if (!this.isGranted) {
//跳转权限设置
// const permissionUtil = new PermissionUtil();
PermissionUtil.reqPermissionsFromUser(['ohos.permission.READ_MEDIA'], this).then((res) => {
//console.info(`cj2024 saveImage res ${res}`)
this.isGranted = res;
});
} else {
... ... @@ -192,7 +196,10 @@ export struct ImageDownloadComponent {
await asset.close(fd);
promptAction.showToast({ message: '已保存至相册!' });
} else {
if (this.isGranted) {
promptAction.showToast({ message: '保存图片失败!' });
}
throw new Error('Failed to create asset');
}
}
... ...
... ... @@ -48,6 +48,7 @@ export struct CommentComponent {
// 是否在弹框中
@Provide inDialog: boolean = false
private dialogBeforeJumpOtherPageAction: () => void = () => {}
// 在自定义组件即将析构销毁时将dialogControlle置空
aboutToDisappear() {
... ... @@ -158,7 +159,8 @@ export struct CommentComponent {
commentHeaderView({
item: item,
dialogController: this.dialogController,
publishCommentModel: this.publishCommentModel
publishCommentModel: this.publishCommentModel,
dialogBeforeJumpOtherPageAction: this.dialogBeforeJumpOtherPageAction
})
}
... ... @@ -194,7 +196,8 @@ export struct CommentComponent {
ChildCommentItem({
item: childItem,
dialogController: this.dialogController,
publishCommentModel: this.publishCommentModel
publishCommentModel: this.publishCommentModel,
dialogBeforeJumpOtherPageAction: this.dialogBeforeJumpOtherPageAction
});
}
.onClick(() => {
... ... @@ -209,7 +212,8 @@ export struct CommentComponent {
ChildCommentItem({
item: childItem,
dialogController: this.dialogController,
publishCommentModel: this.publishCommentModel
publishCommentModel: this.publishCommentModel,
dialogBeforeJumpOtherPageAction: this.dialogBeforeJumpOtherPageAction
});
}
.onClick(() => {
... ... @@ -319,6 +323,7 @@ struct ChildCommentItem {
@Consume contentDetailData: ContentDetailDTO
@Consume inDialog: boolean
private dialogBeforeJumpOtherPageAction: () => void = () => {}
build() {
Column() {
... ... @@ -388,7 +393,8 @@ struct ChildCommentItem {
commentFooterView({
item: this.item,
dialogController: this.dialogController,
publishCommentModel: this.publishCommentModel
publishCommentModel: this.publishCommentModel,
dialogBeforeJumpOtherPageAction: this.dialogBeforeJumpOtherPageAction
}).margin({ left: 95, right: 16 })
}.alignItems(HorizontalAlign.Start)
.width('100%')
... ... @@ -430,7 +436,7 @@ struct ChildCommentItem {
commentViewModel.jumpToAccountPage(this.item, () => {
if (this.inDialog) {
PublicDialogManager.shareInstance().closeLastDialog()
if (this.dialogBeforeJumpOtherPageAction) { this.dialogBeforeJumpOtherPageAction() }
}
})
})
... ... @@ -541,6 +547,7 @@ struct commentHeaderView {
@ObjectLink item: commentItemModel
@Consume inDialog: boolean
private dialogBeforeJumpOtherPageAction: () => void = () => {}
build() {
Column() {
... ... @@ -598,7 +605,8 @@ struct commentHeaderView {
commentFooterView({
item: this.item,
dialogController: this.dialogController,
publishCommentModel: this.publishCommentModel
publishCommentModel: this.publishCommentModel,
dialogBeforeJumpOtherPageAction: this.dialogBeforeJumpOtherPageAction
}).margin({ left: 59, right: 16 })
}.alignItems(HorizontalAlign.Start)
.padding({bottom: 8})
... ... @@ -640,7 +648,7 @@ struct commentHeaderView {
commentViewModel.jumpToAccountPage(this.item, () => {
if (this.inDialog) {
PublicDialogManager.shareInstance().closeLastDialog()
if (this.dialogBeforeJumpOtherPageAction) { this.dialogBeforeJumpOtherPageAction() }
}
})
})
... ... @@ -676,6 +684,7 @@ struct commentFooterView {
@ObjectLink item: commentItemModel
@Consume inDialog: boolean
private dialogBeforeJumpOtherPageAction: () => void = () => {}
build() {
Row() {
... ... @@ -748,7 +757,7 @@ struct commentFooterView {
const user_id = HttpUtils.getUserId()
if (!user_id) {
if (this.inDialog) {
PublicDialogManager.shareInstance().closeLastDialog()
if (this.dialogBeforeJumpOtherPageAction) { this.dialogBeforeJumpOtherPageAction() }
}
WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
return
... ...
... ... @@ -117,7 +117,12 @@ struct CommentListDialog {
publishCommentModel: this.publishCommentModel,
fixedHeightMode: true,
inDialog: true,
showTitleComponent: false
showTitleComponent: false,
dialogBeforeJumpOtherPageAction: () => {
if (this.onClose) {
this.onClose()
}
}
}).layoutWeight(1)
OperRowListView({
... ...
... ... @@ -93,6 +93,11 @@ export struct ZhCarouselLayout01 {
item: item,
length: this.compDTO.operDataList.length
})
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName)
Logger.info(TAG, `ZhCarouselLayout01 onClick event index: ${index}`)
ProcessUtils.processPage(item)
})
})
}
.borderRadius($r('app.float.image_border_radius'))
... ... @@ -162,11 +167,6 @@ export struct ZhCarouselLayout01 {
})
.backgroundColor(0xffffff)
.width(CommonConstants.FULL_WIDTH)
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.compDTO.operDataList[this.swiperIndex], this.pageId, this.pageName)
Logger.info(TAG, `ZhCarouselLayout01 onClick event index: ${this.swiperIndex}`);
ProcessUtils.processPage(this.compDTO.operDataList[this.swiperIndex])
})
} else {
EmptyComponent({ emptyHeight: 200 })
}
... ...
... ... @@ -24,6 +24,13 @@ export struct MultiPictureListPage {
@Provide topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
// @Provide bgc: Color = Color.White;
@Provide duration: number = 0
@State noAnimation: boolean = true
pageTransition() {
// PageTransitionEnter({ duration: this.noAnimation ? 0 : 300 })
PageTransitionExit({ duration: !this.noAnimation ? 0 : 300 })
}
aboutToAppear(): void {
//获取宽高尺寸
... ... @@ -65,6 +72,7 @@ export struct MultiPictureListPage {
})
.onClick(() => {
this.onBack();
this.noAnimation = false
router.back();
})
.id("backImg")
... ...
... ... @@ -328,9 +328,10 @@ export struct PlayerFullScreenView {
if (this.showOperator == false) {
this.restartTimer();
} else {
if (this.isTouched) {
// if (this.isTouched) {
this.showOperator = false
}
// }
// this.restartTimer();
}
}
}
... ...
... ... @@ -224,7 +224,7 @@ export class BackgroundAudioController {
listenPlayEvents() {
this.lastSession?.on('play', () => {
Logger.debug(TAG, `on play `);
this.avplayerController?.play()
this.avplayerController?.resume()
this.hasSetupProgress = false
});
this.lastSession?.on('pause', () => {
... ...
... ... @@ -249,6 +249,21 @@ export class WDPlayerController {
this.avPlayer?.pause();
}
async resume() {
if (this.status == PlayerConstants.STATUS_PAUSE) {
Logger.debug(TAG, "start resume")
this.avPlayer?.play();
return
}
if (this.status == PlayerConstants.STATUS_COMPLETION) {
Logger.debug(TAG, "start resume")
this.avPlayer?.seek(0);
this.avPlayer?.play();
return
}
this.play()
}
async play() {
// if (this.avPlayer == null) {
// await this.initPromise;
... ...