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-06-13 15:49:14 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
092bb8675b14f50872f50d63fafbc4ecfb1ee882
092bb867
1 parent
dbd1879a
早晚报语音播报调试
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
29 deletions
sight_harmony/features/wdComponent/src/main/ets/components/MorningEveningPaper/MorningEveningPaperComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/MorningEveningPaper/MorningEveningPaperComponent.ets
View file @
092bb86
...
...
@@ -91,14 +91,14 @@ export struct MorningEveningPaperComponent {
private AudioSuspension = new AudioSuspensionModel()
onCancel() {
Logger.info
(TAG, "cj2024 onCancel = ")
console.log
(TAG, "cj2024 onCancel = ")
}
/**
* 回调无用
**/
onConfirm() {
Logger.info
(TAG, "cj2024 onConfirm = ")
console.log
(TAG, "cj2024 onConfirm = ")
// if (this.playerController != undefined) {
//
// }
...
...
@@ -108,10 +108,10 @@ export struct MorningEveningPaperComponent {
// 续播判断
changeContinue() {
Logger.info
(TAG, "cj2024 changeContinue = 1")
console.log
(TAG, "cj2024 changeContinue = 1")
// if (this.nextContId) {
this.playerController.continue = () => {
Logger.info
(TAG, "cj2024 changeContinue = 2")
console.log
(TAG, "cj2024 changeContinue = 2")
this.playerController?.stop();
// this.playVM.playWithContentId(this.nextContId ?? '');
}
...
...
@@ -130,8 +130,8 @@ export struct MorningEveningPaperComponent {
const dailyPaperTopicPageId = await SPHelper.default.getSync('dailyPaperTopicPageId', "") as String
console.info(TAG, `aboutToAppear = ` + dailyPaperTopicPageId)
const currentTime = new Date().getTime()
Logger.info(TAG, "currentTime = " + currentTime)
Logger.info(TAG, `currentTime = ${currentTime}`)
console.log(TAG, "currentTime = " + currentTime)
console.log(TAG, `currentTime = ${currentTime}`)
try {
// let pageInfoBean = await MorningEveningViewModel.getMorningEveningPageInfo("" + this.dailyPaperTopicPageId)
...
...
@@ -145,13 +145,13 @@ export struct MorningEveningPaperComponent {
let dateTime = DateTimeUtils.parseDate(this.pageInfoBean?.topicInfo?.topicDate ?? '', DateTimeUtils.PATTERN_DATE_HYPHEN)
const dateShow = new Date(dateTime)
this.subTitle = `${dateShow.getFullYear()}年\n${(dateShow.getMonth() + 1)}月${dateShow.getDate()}日`
Logger.info(TAG, "pageInfoBean topicDate = " + this.pageInfoBean?.topicInfo?.topicDate)
Logger.info(TAG, "pageInfoBean title = " + this.pageInfoBean?.topicInfo?.title)
console.log(TAG, "pageInfoBean topicDate = " + this.pageInfoBean?.topicInfo?.topicDate)
console.log(TAG, "pageInfoBean title = " + this.pageInfoBean?.topicInfo?.title)
Logger.info(TAG, "pageInfoBean dateTime = " + dateTime)
Logger.info(TAG, "pageInfoBean subTitle = " + this.subTitle)
console.log(TAG, "pageInfoBean dateTime = " + dateTime)
console.log(TAG, "pageInfoBean subTitle = " + this.subTitle)
Logger.info
(TAG, "this.pageInfoBean = " + JSON.stringify(this.pageInfoBean))
console.log
(TAG, "this.pageInfoBean = " + JSON.stringify(this.pageInfoBean))
this.isHasTopView = this.pageInfoBean?.topicInfo?.frontLinkObject?true:false
let coverUrl = this.isHasTopView?this.pageInfoBean?.topicInfo?.frontLinkObject?.coverUrl as string :''
...
...
@@ -159,21 +159,22 @@ export struct MorningEveningPaperComponent {
let compInfoBean = await MorningEveningViewModel.getMorningEveningCompInfo(pageInfoBean?.id, pageInfoBean?.groups[0]?.id, currentTime + "", pageInfoBean?.topicInfo?.topicId)
// this.compInfoBean = compInfoBean
Logger.info
(TAG, "compInfoBean = " + JSON.stringify(compInfoBean))
console.log
(TAG, "compInfoBean = " + JSON.stringify(compInfoBean))
if (compInfoBean?.compList[0]) {
this.compListItem = compInfoBean?.compList[0]
Logger.debu
g(TAG, '获取评论数据' + `${this.compListItem.operDataList.length}`)
console.lo
g(TAG, '获取评论数据' + `${this.compListItem.operDataList.length}`)
if (this.compListItem.operDataList && this.compListItem.operDataList.length > 0) {
this.getAllContentInteractData(this.compListItem.operDataList)
}
Logger.debu
g(TAG, 'compInfoBean?.compList[0].audioDataList', JSON.stringify(compInfoBean?.compList[0].audioDataList))
console.lo
g(TAG, 'compInfoBean?.compList[0].audioDataList', JSON.stringify(compInfoBean?.compList[0].audioDataList))
if (compInfoBean?.compList[0].audioDataList) {
this.audioPlayUrl = compInfoBean?.compList[0].audioDataList[0].audioUrl
this.audioTitle = compInfoBean?.compList[0].audioDataList[0].title
console.log(TAG, 'this.audioPlayUrl', this.audioPlayUrl)
}
}
Logger.info
(TAG, "compInfoBean compStyle = " + compInfoBean.compList[0].compStyle)
console.log
(TAG, "compInfoBean compStyle = " + compInfoBean.compList[0].compStyle)
this.playerController.onTimeUpdate = (position, duration) => {
this.currentTime = DateFormatUtil.secondToTime(position);
this.totalTime = DateFormatUtil.secondToTime(duration);
...
...
@@ -203,10 +204,10 @@ export struct MorningEveningPaperComponent {
contentType: Number(item.objectType ?? '1')
})
})
Logger.debu
g(TAG, '获取评论数据' + `${JSON.stringify(params)}`)
console.lo
g(TAG, '获取评论数据' + `${JSON.stringify(params)}`)
this.commentList = await PeopleShipMainViewModel.getContentInteractInfo(params)
Logger.debu
g(TAG, '获取评论数据' + `${JSON.stringify(this.commentList)}`)
console.lo
g(TAG, '获取评论数据' + `${JSON.stringify(this.commentList)}`)
} catch (exception) {
...
...
@@ -216,7 +217,7 @@ export struct MorningEveningPaperComponent {
async setComponentBgColor(imageUrl: string) {
// 图片转换为PixelMap对象
// const pixelMap: image.PixelMap = await image2PixelMap(item.icon);
Logger.debu
g(TAG, "compInfoBean compStyle = " + imageUrl)
console.lo
g(TAG, "compInfoBean compStyle = " + imageUrl)
if (imageUrl.length > 0 && this.pageInfoBean.topicInfo.frontFlag === 1) {
const imageSource: image.ImageSource | undefined = await getPicture(imageUrl)
...
...
@@ -237,11 +238,11 @@ export struct MorningEveningPaperComponent {
const pixelMap: image.PixelMap = await imageNet2PixelMap(imageSource);
effectKit.createColorPicker(pixelMap, (err, colorPicker) => {
let color = colorPicker.getLargestProportionColor();
Logger.debu
g(TAG, "compInfoBean compStyle = " + color)
console.lo
g(TAG, "compInfoBean compStyle = " + color)
// color = ColorUtils.getMorningEveningPaperRgb({red:color.red,green:color.green,blue:color.blue,alpha:color.alpha})
// 将取色器选取的color示例转换为十六进制颜色代码
this.mixedBgColor = "#" + color.alpha.toString(16) + color.red.toString(16) + color.green.toString(16) + color.blue.toString(16);
Logger.debu
g(TAG, "compInfoBean compStyle = " + this.mixedBgColor)
console.lo
g(TAG, "compInfoBean compStyle = " + this.mixedBgColor)
});
}
...
...
@@ -267,10 +268,11 @@ export struct MorningEveningPaperComponent {
topicInfoView({ frontLinkObject: this.pageInfoBean?.topicInfo?.frontLinkObject })
}
if (this.audioPlayUrl !== ""){
ListItem() {
this.AudioBarView()
}
}
if (this.audioPlayUrl !== ""){
ListItem() {
this.AudioBarView()
}
}
...
...
@@ -310,8 +312,11 @@ export struct MorningEveningPaperComponent {
@Builder
topPaperTitle(){
Column(){
PaperTitleComponent({topicInfo:this.pageInfoBean?.topicInfo}).margin({top:this.topSafeHeight})
}.height(44+this.topSafeHeight).backgroundColor(this.isHasTopView?(this.scrollOffset > 100?this.mixedBgColor:''):this.mixedBgColor)
PaperTitleComponent({topicInfo:this.pageInfoBean?.topicInfo})
.margin({top:this.topSafeHeight})
}
.height(44+this.topSafeHeight)
.backgroundColor(this.isHasTopView?(this.scrollOffset > 100?this.mixedBgColor:''):this.mixedBgColor)
}
@Builder
...
...
@@ -350,12 +355,12 @@ export struct MorningEveningPaperComponent {
.margin({ left: 10 })// .alignSelf(ItemAlign.Center)
.objectFit(ImageFit.Contain)
.onClick(() => {
Logger.info
("TAG", "cj compInfoBean onClick1 = " + this.isAudioPlaying)
console.log
("TAG", "cj compInfoBean onClick1 = " + this.isAudioPlaying)
// dialog.open()
// this.playerController.firstPlay(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)
console.log(TAG, "this.audioPlayUrl = " + this.audioPlayUrl)
console.log("TAG", "cj compInfoBean onClick2 = " + this.isAudioPlaying)
})
}
// .aspectRatio(7 / 4)
...
...
Please
register
or
login
to post a comment