zhangfengjin

Merge remote-tracking branch 'origin/main'

... ... @@ -77,7 +77,7 @@ export struct MorningEveningPaperComponent {
offset: { dx: 12, dy: -150 },
})
private AudioSuspension = new AudioSuspensionModel()
// private AudioSuspension = new AudioSuspensionModel()
onCancel() {
Logger.info(TAG, "cj2024 onCancel = ")
... ... @@ -307,7 +307,7 @@ export struct MorningEveningPaperComponent {
Logger.info("TAG", "cj compInfoBean onClick1 = " + this.isAudioPlaying)
// dialog.open()
// this.playerController.firstPlay(this.audioPlayUrl, this.audioTitle)
this.AudioSuspension.setPlayerUrl(this.audioPlayUrl, this.audioTitle)
// this.AudioSuspension.setPlayerUrl(this.audioPlayUrl, this.audioTitle)
Logger.info(TAG, "this.audioPlayUrl = " + this.audioPlayUrl)
Logger.info("TAG", "cj compInfoBean onClick2 = " + this.isAudioPlaying)
})
... ...
... ... @@ -366,7 +366,8 @@ export struct MultiPictureDetailPageComponent {
publishCommentModel: this.publishCommentModel,
operationButtonList: this.operationButtonList,
styleType: 2,
componentType:5,
componentType: 5,
pageComponentType: 3
})
}
.transition(TransitionEffect.OPACITY.animation({ duration: this.duration, curve: Curve.Ease }).combine(
... ...
... ... @@ -43,6 +43,17 @@ export struct CommentTabComponent {
}
getCommentInputBackImg() {
if (this.pageComponentType === 2) {
return $r('app.media.comment_img_input_black')
} else if (this.pageComponentType === 3) {
return $r('app.media.comment_img_input_hui1')
} else {
return $r('app.media.comment_img_input_hui')
}
}
build() {
Row() {
Stack({ alignContent: Alignment.Start }) {
... ... @@ -67,8 +78,7 @@ export struct CommentTabComponent {
})
.id("RowBg")
} else {
Image(this.pageComponentType === 2 ? $r('app.media.comment_img_input_black') :
$r('app.media.comment_img_input_hui'))
Image(this.getCommentInputBackImg())
.objectFit(ImageFit.Fill)
.resizable({
slice: {
... ...
... ... @@ -193,7 +193,7 @@ export struct TopNavigationComponent {
//意图共享
topNavInsightIntentShare(item: TopNavDTO){
let tapNavIntent: insightIntent.InsightIntent = {
intentName: 'ViewColumn',
intentName: 'ViewBlog',
intentVersion: '1.0.1',
identifier: '52dac3b0-6520-4974-81e5-25f0879449b5',
intentActionInfo: {
... ... @@ -205,7 +205,7 @@ export struct TopNavigationComponent {
}
},
intentEntityInfo: {
entityName: 'ViewColumn',
entityName: 'Blog',
entityId: String(item.pageId) || '',
displayName: item.name,
logoURL: 'https://www-file.huawei.com/-/media/corporate/images/home/logo/huawei_logo.png',
... ... @@ -213,7 +213,7 @@ export struct TopNavigationComponent {
isPublicData: true
}
}
console.log('yzl',JSON.stringify(tapNavIntent))
try {
let context = getContext(this) as common.UIAbilityContext;
// 共享数据
... ...
... ... @@ -62,7 +62,7 @@ export struct OperRowListView {
* 7:图集详情页
*/
@Prop componentType: number = 1 //1: 底部栏目样式 2: 新闻页中间位置样式 3:动态Tab内容下的互动入口
@Prop pageComponentType?: number = -1 //1:视频详情页 2竖屏直播页
@Prop pageComponentType?: number = -1 //1:视频详情页 2:竖屏直播页 3:图集
@State likesStyle: number = this.contentDetailData.likesStyle // 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空
@Prop operationButtonList?: string[] = ['comment', 'collect', 'share'] // 组件展示条件
@State needLike: boolean = true
... ... @@ -76,7 +76,7 @@ export struct OperRowListView {
@State audioUrl: string = ''
@State audioTitle: string = ''
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
private AudioSuspension = new AudioSuspensionModel()
// private AudioSuspension = new AudioSuspensionModel()
@State currentStatus: number | string | undefined = 0;
async aboutToAppear() {
... ... @@ -192,7 +192,7 @@ export struct OperRowListView {
publishCommentModel: this.publishCommentModel,
contentDetail: this.contentDetailData,
onCommentFocus: this.onCommentFocus,
pageComponentType: this.pageComponentType
pageComponentType: this.pageComponentType,
})
}
}
... ... @@ -279,7 +279,7 @@ export struct OperRowListView {
.aspectRatio(1)
.interpolation(ImageInterpolation.High)
.onClick((event: ClickEvent) => {
this.AudioSuspension.setPlayerUrl(this.audioUrl, this.audioTitle)
// this.AudioSuspension.setPlayerUrl(this.audioUrl, this.audioTitle)
// ToastUtils.showToast('音频为公共方法,待开发', 1000);
})
}
... ...
... ... @@ -70,59 +70,59 @@ export default class EntryAbility extends UIAbility {
}
hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? '');
});
// 1.创建悬浮窗
const config: window.Configuration = {
name: "floatWindow", windowType: window.WindowType.TYPE_FLOAT, ctx: this.context
};
window.createWindow(config, (err: BusinessError, data) => {
let errCode: number = err.code;
if (errCode) {
console.error('floatWindowClass Failed to create the floatWindow. Cause: ' + JSON.stringify(err));
return;
}
console.info('floatWindowClass Succeeded in creating the floatWindow. Data: ' + JSON.stringify(data));
floatWindowClass = data;
AppStorage.setOrCreate('floatWindowClass', floatWindowClass);
// 2.悬浮窗窗口创建成功后,设置悬浮窗的位置、大小及相关属性等。
floatWindowClass.moveWindowTo(0, 604, (err: BusinessError) => {
let errCode: number = err.code;
if (errCode) {
console.error('floatWindowClass Failed to move the window. Cause:' + JSON.stringify(err));
return;
}
console.info('floatWindowClass Succeeded in moving the window.');
});
// 3.为悬浮窗加载对应的目标页面。
floatWindowClass.setUIContent("pages/view/AudioComponent", (err: BusinessError) => {
let errCode: number = err.code;
if (errCode) {
console.error('floatWindowClass Failed to load the content. Cause:' + JSON.stringify(err));
return;
}
console.info('floatWindowClass Succeeded in loading the content.');
});
floatWindowClass.on('windowEvent', (data) => {
EmitterUtils.sendEvent(EmitterEventId.AUDIO_WINDOW_TYPE, data)
});
});
// 1.创建悬浮窗
// const config: window.Configuration = {
// name: "floatWindow", windowType: window.WindowType.TYPE_FLOAT, ctx: this.context
// };
// window.createWindow(config, (err: BusinessError, data) => {
// let errCode: number = err.code;
// if (errCode) {
// console.error('floatWindowClass Failed to create the floatWindow. Cause: ' + JSON.stringify(err));
// return;
// }
// console.info('floatWindowClass Succeeded in creating the floatWindow. Data: ' + JSON.stringify(data));
// floatWindowClass = data;
// AppStorage.setOrCreate('floatWindowClass', floatWindowClass);
// // 2.悬浮窗窗口创建成功后,设置悬浮窗的位置、大小及相关属性等。
// floatWindowClass.moveWindowTo(0, 604, (err: BusinessError) => {
// let errCode: number = err.code;
// if (errCode) {
// console.error('floatWindowClass Failed to move the window. Cause:' + JSON.stringify(err));
// return;
// }
// console.info('floatWindowClass Succeeded in moving the window.');
// });
// // 3.为悬浮窗加载对应的目标页面。
// floatWindowClass.setUIContent("pages/view/AudioComponent", (err: BusinessError) => {
// let errCode: number = err.code;
// if (errCode) {
// console.error('floatWindowClass Failed to load the content. Cause:' + JSON.stringify(err));
// return;
// }
// console.info('floatWindowClass Succeeded in loading the content.');
// });
//
// floatWindowClass.on('windowEvent', (data) => {
// EmitterUtils.sendEvent(EmitterEventId.AUDIO_WINDOW_TYPE, data)
// });
//
// });
}
destroyFloatWindow() {
(floatWindowClass as window.Window).destroyWindow((err: BusinessError) => {
let errCode: number = err.code;
if (errCode) {
console.error('floatWindowClass Failed to destroy the window. Cause: ' + JSON.stringify(err));
return;
}
console.info('floatWindowClass Succeeded in destroying the window.');
});
}
// destroyFloatWindow() {
// (floatWindowClass as window.Window).destroyWindow((err: BusinessError) => {
// let errCode: number = err.code;
// if (errCode) {
// console.error('floatWindowClass Failed to destroy the window. Cause: ' + JSON.stringify(err));
// return;
// }
// console.info('floatWindowClass Succeeded in destroying the window.');
// });
// }
onWindowStageDestroy(): void {
// Main window is destroyed, release UI related resources
this.destroyFloatWindow()
// this.destroyFloatWindow()
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy');
}
... ...
... ... @@ -8,7 +8,7 @@ const TAG = 'AudioSuspensionModel'
@Entry
@Component
struct Index {
private AudioSuspension = new AudioSuspensionModel()
// private AudioSuspension = new AudioSuspensionModel()
@State audioTitle: string | undefined = '';
@State currentTime: string = '00:00';
@State totalTime: string = '00:00';
... ... @@ -21,11 +21,11 @@ struct Index {
private foldHeight: number = 200
aboutToAppear() {
this.AudioSuspension.playerController.get().onTimeUpdate = (position, duration) => {
this.currentTime = DateFormatUtil.convertMillisecondsToMinutesSeconds(position);
this.totalTime = DateFormatUtil.convertMillisecondsToMinutesSeconds(duration);
this.progressVal = Math.floor(position * 100 / duration);
}
// this.AudioSuspension.playerController.get().onTimeUpdate = (position, duration) => {
// this.currentTime = DateFormatUtil.convertMillisecondsToMinutesSeconds(position);
// this.totalTime = DateFormatUtil.convertMillisecondsToMinutesSeconds(duration);
// this.progressVal = Math.floor(position * 100 / duration);
// }
EmitterUtils.receiveEvent(EmitterEventId.AUDIO_CHANGE_TITLe, (val:string | undefined) => {
console.log(TAG,'this.audioTitle', val)
... ... @@ -41,11 +41,11 @@ struct Index {
if (val == window.WindowEventType.WINDOW_ACTIVE) {
console.info(TAG, 'current window stage event is WINDOW_ACTIVE', val);
this.isExpand = true
this.AudioSuspension.resizeWindow(this.expandWidth, this.expandHeight)
// this.AudioSuspension.resizeWindow(this.expandWidth, this.expandHeight)
} else if (val == window.WindowEventType.WINDOW_INACTIVE) {
console.info(TAG, 'current window stage event is WINDOW_INACTIVE', val);
this.isExpand = false
this.AudioSuspension.resizeWindow(this.foldWidth, this.foldHeight)
// this.AudioSuspension.resizeWindow(this.foldWidth, this.foldHeight)
}
})
... ... @@ -53,7 +53,7 @@ struct Index {
onPageHide() {
// this.status = PlayerConstants.STATUS_PAUSE;
this.AudioSuspension.playerController.get()?.pause();
// this.AudioSuspension.playerController.get()?.pause();
}
build() {
... ... @@ -118,9 +118,9 @@ struct Index {
.height(24)
.margin({ right: 12 })
.onClick(() => {
if (this.AudioSuspension.playerController) {
this.AudioSuspension.playerController.get().switchPlayOrPause()
}
// if (this.AudioSuspension.playerController) {
// this.AudioSuspension.playerController.get().switchPlayOrPause()
// }
})
Image($r("app.media.icon_audio_close"))
... ... @@ -128,10 +128,10 @@ struct Index {
.width(24)
.height(24)
.onClick(() => {
if (this.AudioSuspension.playerController) {
this.AudioSuspension.playerController.get().stop()
this.AudioSuspension.destroyWindow()
}
// if (this.AudioSuspension.playerController) {
// this.AudioSuspension.playerController.get().stop()
// this.AudioSuspension.destroyWindow()
// }
})
}.width(80)
.height(60)
... ... @@ -142,9 +142,9 @@ struct Index {
.width(24)
.height(24)
.onClick(() => {
if (this.AudioSuspension.playerController) {
this.AudioSuspension.playerController.get().switchPlayOrPause()
}
// if (this.AudioSuspension.playerController) {
// this.AudioSuspension.playerController.get().switchPlayOrPause()
// }
})
}
.justifyContent(FlexAlign.Center)
... ...
... ... @@ -92,16 +92,16 @@
{
"name": "ohos.permission.INTERNET"
},
{
"name": "ohos.permission.SYSTEM_FLOAT_WINDOW",
"reason": "$string:EntryAbility_desc",
"usedScene": {
"abilities": [
"FormAbility"
],
"when": "inuse"
}
}
// {
// "name": "ohos.permission.SYSTEM_FLOAT_WINDOW",
// "reason": "$string:EntryAbility_desc",
// "usedScene": {
// "abilities": [
// "FormAbility"
// ],
// "when": "inuse"
// }
// }
]
}
}
\ No newline at end of file
... ...