|
|
@@ -4908,8 +4908,8 @@ export struct LocalMusic {
|
|
|
StrUtil.isEmpty(item.pixelMapPath) ? $r('app.media.add') :
|
|
|
item.pixelMapPath)
|
|
|
.fillColor(this.themeColor)
|
|
|
- .height(66)
|
|
|
- .width(66)
|
|
|
+ .height(88)
|
|
|
+ .width(88)
|
|
|
.borderRadius('100%')
|
|
|
.clip(true)
|
|
|
.opacity(this.opacityItem)// 绑定透明度
|
|
|
@@ -4924,12 +4924,12 @@ export struct LocalMusic {
|
|
|
}
|
|
|
|
|
|
})
|
|
|
- .width('18%')
|
|
|
+ .width('28%')
|
|
|
|
|
|
Row() {
|
|
|
Column() {
|
|
|
Text(item.name)
|
|
|
- .fontSize(14)
|
|
|
+ .fontSize(18)
|
|
|
.maxLines(1)
|
|
|
.textOverflow({ overflow: TextOverflow.MARQUEE })//超长滚动
|
|
|
.animation({
|
|
|
@@ -4941,7 +4941,7 @@ export struct LocalMusic {
|
|
|
.margin({ left: 18 })
|
|
|
Row() {
|
|
|
Text(item.artist)
|
|
|
- .fontSize(11)
|
|
|
+ .fontSize(15)
|
|
|
.maxLines(1)
|
|
|
.textOverflow({ overflow: TextOverflow.MARQUEE })//超长滚动
|
|
|
.padding({ top: 8 })
|
|
|
@@ -4957,70 +4957,6 @@ export struct LocalMusic {
|
|
|
.justifyContent(FlexAlign.Center)
|
|
|
.alignItems(HorizontalAlign.Start)
|
|
|
|
|
|
- Button('获取封面')
|
|
|
- .fontColor(Color.White)
|
|
|
- .fontSize(12)
|
|
|
- .height(38)
|
|
|
- .width(88)
|
|
|
- .clickEffect({ level: ClickEffectLevel.MIDDLE,scale:0.6 })
|
|
|
- .backgroundColor(this.themeColor)
|
|
|
- .stateEffect(true)
|
|
|
- .margin({ right: 5, left: 12 })
|
|
|
- .onClick(async () => {
|
|
|
- if (PreferencesUtil.getStringSync('COVER_API', '') === '') {
|
|
|
- this.showTipsDialog();
|
|
|
- return; // Return empty string when no API is configured
|
|
|
- }
|
|
|
-
|
|
|
- const imagePath:string | undefined = await this.doSearchCover(item);
|
|
|
- console.info('onecold imagePath = '+imagePath)
|
|
|
- if (StrUtil.isNotEmpty(imagePath)) {
|
|
|
- //用户更改过图片
|
|
|
- this.imagePathStr = imagePath
|
|
|
- ToastUtil.showToast('获取封面成功')
|
|
|
- }else{
|
|
|
- ToastUtil.showToast('获取封面失败,请重试')
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- })
|
|
|
-
|
|
|
- Button('获取歌词')
|
|
|
- .fontColor(Color.White)
|
|
|
- .fontSize(12)
|
|
|
- .height(38)
|
|
|
- .width(88)
|
|
|
- .clickEffect({ level: ClickEffectLevel.MIDDLE,scale:0.6 })
|
|
|
- .backgroundColor(this.themeColor)
|
|
|
- .stateEffect(true)
|
|
|
- .margin({ right: 12, left: 5 })
|
|
|
- .onClick(async () => {
|
|
|
- //判断有没有设置api
|
|
|
- let apiUrl = PreferencesUtil.getStringSync('LRC_API', '')
|
|
|
- if (StrUtil.isEmpty(apiUrl)) {
|
|
|
- this.isLyricSetting = false
|
|
|
- this.showTipsDialog()
|
|
|
- return
|
|
|
- }
|
|
|
- let artist = item.artist
|
|
|
- let title = item.name
|
|
|
- if(!artist)
|
|
|
- artist = ''
|
|
|
- if(!title)
|
|
|
- title = ''
|
|
|
- let res: string | undefined = await getApiLyric(apiUrl,title, artist, false);
|
|
|
- if (res && StrUtil.isNotEmpty(res) && res !== 'unknown' && res !== 'Timeout was reached') {
|
|
|
- this.lyricConStr = res;
|
|
|
- ToastUtil.showToast('获取歌词成功')
|
|
|
- }else{
|
|
|
- ToastUtil.showToast('获取歌词失败,请重试')
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- // let res : string | undefined = await getApiLyric(title, artist, false);
|
|
|
-
|
|
|
-
|
|
|
- })
|
|
|
|
|
|
}
|
|
|
.height('100%')
|
|
|
@@ -5029,8 +4965,72 @@ export struct LocalMusic {
|
|
|
|
|
|
}
|
|
|
.width('100%')
|
|
|
- .height(58)
|
|
|
+ .height(98)
|
|
|
+
|
|
|
+ Row() {
|
|
|
+ Button('获取封面')
|
|
|
+ .fontColor(Color.White)
|
|
|
+ .fontSize(12)
|
|
|
+ .height(38)
|
|
|
+ .width(88)
|
|
|
+ .clickEffect({ level: ClickEffectLevel.MIDDLE,scale:0.6 })
|
|
|
+ .backgroundColor(this.themeColor)
|
|
|
+ .stateEffect(true)
|
|
|
+ .margin({ right: 15, left: 20 })
|
|
|
+ .onClick(async () => {
|
|
|
+ if (PreferencesUtil.getStringSync('COVER_API', '') === '') {
|
|
|
+ this.showTipsDialog();
|
|
|
+ return; // Return empty string when no API is configured
|
|
|
+ }
|
|
|
+
|
|
|
+ const imagePath:string | undefined = await this.doSearchCover(item);
|
|
|
+ console.info('onecold imagePath = '+imagePath)
|
|
|
+ if (StrUtil.isNotEmpty(imagePath)) {
|
|
|
+ //用户更改过图片
|
|
|
+ this.imagePathStr = imagePath
|
|
|
+ ToastUtil.showToast('获取封面成功')
|
|
|
+ }else{
|
|
|
+ ToastUtil.showToast('获取封面失败,请重试')
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
+ })
|
|
|
+
|
|
|
+ Button('获取歌词')
|
|
|
+ .fontColor(Color.White)
|
|
|
+ .fontSize(12)
|
|
|
+ .height(38)
|
|
|
+ .width(88)
|
|
|
+ .clickEffect({ level: ClickEffectLevel.MIDDLE,scale:0.6 })
|
|
|
+ .backgroundColor(this.themeColor)
|
|
|
+ .stateEffect(true)
|
|
|
+ .margin({ right: 20, left: 15 })
|
|
|
+ .onClick(async () => {
|
|
|
+ //判断有没有设置api
|
|
|
+ let apiUrl = PreferencesUtil.getStringSync('LRC_API', '')
|
|
|
+ if (StrUtil.isEmpty(apiUrl)) {
|
|
|
+ this.isLyricSetting = false
|
|
|
+ this.showTipsDialog()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ let artist = item.artist
|
|
|
+ let title = item.name
|
|
|
+ if(!artist)
|
|
|
+ artist = ''
|
|
|
+ if(!title)
|
|
|
+ title = ''
|
|
|
+ let res: string | undefined = await getApiLyric(apiUrl,title, artist, false);
|
|
|
+ if (res && StrUtil.isNotEmpty(res) && res !== 'unknown' && res !== 'Timeout was reached') {
|
|
|
+ this.lyricConStr = res;
|
|
|
+ ToastUtil.showToast('获取歌词成功')
|
|
|
+ }else{
|
|
|
+ ToastUtil.showToast('获取歌词失败,请重试')
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+ }
|
|
|
+ .height(55)
|
|
|
+ .justifyContent(FlexAlign.Start)
|
|
|
|
|
|
Row() {
|
|
|
Text('标题:')
|