Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
book-app
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
book-app
Commits
70c0b90d
提交
70c0b90d
authored
3月 04, 2024
作者:
yueweilu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
多条播放依次时 显示时间问题
上级
5c24764d
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
80 行增加
和
12 行删除
+80
-12
key.properties
android/key.properties
+3
-3
controller.dart
lib/pages/read_web/controller.dart
+7
-3
note_controller.dart
lib/pages/read_web/note_controller.dart
+44
-0
note.dart
lib/pages/read_web/widgets/note.dart
+9
-1
controller.dart
lib/pages/user_edit_note/controller.dart
+7
-2
controller.dart
lib/pages/user_notes_des/controller.dart
+7
-2
index.dart
lib/pages/user_notes_des/index.dart
+2
-0
note.dart
lib/pages/user_notes_des/widgets/note.dart
+1
-1
没有找到文件。
android/key.properties
浏览文件 @
70c0b90d
...
...
@@ -4,5 +4,5 @@ keyPassword=123456
keyAlias
=
zijing
#storeFile=/Users/apple/zijiing_key.jks
storeFile
=
zijiing_key.jks
\ No newline at end of file
storeFile
=
/Users/apple/zijiing_key.jks
#
storeFile
=
zijiing_key.jks
\ No newline at end of file
lib/pages/read_web/controller.dart
浏览文件 @
70c0b90d
...
...
@@ -367,11 +367,15 @@ class ReadController extends FullLifeCycleController with GetSingleTickerProvide
// 本地音频
audioPlayer
.
setFilePath
(
audioModel
.
path
);
audioPlayer
.
play
()
;
audioPlayer
.
positionStream
.
listen
((
position
)
{
StreamSubscription
?
positionSubscription
;
positionSubscription
=
audioPlayer
.
positionStream
.
listen
((
position
)
{
String
temp
=
Tools
.
formatDuration
(
position
);
Console
.
log
(
'播放时间---------------------
$temp
'
);
Console
.
log
(
'播放时间---------------------
$temp
------id-------------
${audioModel.path}
'
);
audioModel
.
currentDuration
=
temp
;
if
(
position
>=
audioPlayer
.
duration
!){
Console
.
log
(
'---------播放结束-----------'
);
positionSubscription
?.
cancel
();
}
update
();
});
// currentPlayMediaModel = mediaModel;
...
...
lib/pages/read_web/note_controller.dart
浏览文件 @
70c0b90d
...
...
@@ -14,6 +14,8 @@ class NoteController extends GetxController {
late
TextEditingController
searchInput
=
TextEditingController
();
just_audio
.
AudioPlayer
audioPlayer
=
just_audio
.
AudioPlayer
();
final
int
_limit
=
10
;
int
_page
=
1
;
bool
_noMore
=
false
;
...
...
@@ -39,6 +41,7 @@ class NoteController extends GetxController {
void
onClose
()
{
refreshController
.
dispose
();
searchInput
.
dispose
();
audioPlayer
.
dispose
();
super
.
onClose
();
}
...
...
@@ -47,6 +50,47 @@ class NoteController extends GetxController {
update
();
}
void
delNotes
({
required
String
notesId
,
required
String
bookId
})
async
{
final
result
=
await
MineAPI
.
delNotes
(
notesId:
notesId
,
bookId:
bookId
);
if
(
result
){
Toast
.
show
(
'删除笔记成功'
);
onRefresh
();
}
}
// 播放音频
void
playAudio
(
MediaModel
mediaModel
){
if
(
audioPlayer
.
playerState
.
playing
){
audioPlayer
.
stop
();
mediaModel
.
currentDuration
=
'0:00:00'
;
// if(currentPlayMediaModel.id == mediaModel.id){
// return;
// }
}
// 本地音频
if
(
mediaModel
.
id
==
0
){
audioPlayer
.
setFilePath
(
mediaModel
.
path
);
}
// 远程音频
else
{
audioPlayer
.
setUrl
(
mediaModel
.
content
??
''
);
}
audioPlayer
.
play
();
StreamSubscription
?
positionSubscription
;
positionSubscription
=
audioPlayer
.
positionStream
.
listen
((
position
)
{
String
temp
=
Tools
.
formatDuration
(
position
);
Console
.
log
(
'播放时间---------------------
$temp
------id-------------
${mediaModel.id}
'
);
mediaModel
.
currentDuration
=
temp
;
if
(
position
>=
audioPlayer
.
duration
!){
Console
.
log
(
'---------播放结束-----------'
);
positionSubscription
?.
cancel
();
}
update
();
});
// currentPlayMediaModel = mediaModel;
}
/// 搜全文
Future
<
void
>
searchAll
([
bool
isRefresh
=
false
])
async
{
if
(
isRefresh
)
_searchPage
=
1
;
...
...
lib/pages/read_web/widgets/note.dart
浏览文件 @
70c0b90d
...
...
@@ -111,7 +111,15 @@ class _ReadNotePageState extends State<ReadNotePage> {
}
// 笔记
else
if
(
model
.
types
==
3
){
return
BuildNote
(
model:
model
,);
return
BuildNote
(
model:
model
,
onTapAudio:
(
MediaModel
mediaModel
){
controller
.
playAudio
(
mediaModel
);
},
onTapDel:
(){
controller
.
delNotes
(
notesId:
model
.
notesId
.
toString
(),
bookId:
widget
.
bookDetailModel
.
bookId
.
toString
());
},
);
}
},
itemCount:
controller
.
notes
.
length
,
...
...
lib/pages/user_edit_note/controller.dart
浏览文件 @
70c0b90d
...
...
@@ -157,10 +157,15 @@ class UserEditNoteController extends GetxController {
audioPlayer
.
setUrl
(
mediaModel
.
content
??
''
);
}
audioPlayer
.
play
();
audioPlayer
.
positionStream
.
listen
((
position
)
{
StreamSubscription
?
positionSubscription
;
positionSubscription
=
audioPlayer
.
positionStream
.
listen
((
position
)
{
String
temp
=
Tools
.
formatDuration
(
position
);
Console
.
log
(
'播放时间---------------------
$temp
'
);
Console
.
log
(
'播放时间---------------------
$temp
------id-------------
${mediaModel.id}
'
);
mediaModel
.
currentDuration
=
temp
;
if
(
position
>=
audioPlayer
.
duration
!){
Console
.
log
(
'---------播放结束-----------'
);
positionSubscription
?.
cancel
();
}
update
();
});
// currentPlayMediaModel = mediaModel;
...
...
lib/pages/user_notes_des/controller.dart
浏览文件 @
70c0b90d
...
...
@@ -49,10 +49,15 @@ class UserNotesDesController extends GetxController {
audioPlayer
.
setUrl
(
mediaModel
.
content
??
''
);
}
audioPlayer
.
play
();
audioPlayer
.
positionStream
.
listen
((
position
)
{
StreamSubscription
?
positionSubscription
;
positionSubscription
=
audioPlayer
.
positionStream
.
listen
((
position
)
{
String
temp
=
Tools
.
formatDuration
(
position
);
Console
.
log
(
'播放时间---------------------
$temp
'
);
Console
.
log
(
'播放时间---------------------
$temp
------id-------------
${mediaModel.id}
'
);
mediaModel
.
currentDuration
=
temp
;
if
(
position
>=
audioPlayer
.
duration
!){
Console
.
log
(
'---------播放结束-----------'
);
positionSubscription
?.
cancel
();
}
update
();
});
// currentPlayMediaModel = mediaModel;
...
...
lib/pages/user_notes_des/index.dart
浏览文件 @
70c0b90d
library
user_notes_des
;
import
'dart:async'
;
import
'package:easy_refresh/easy_refresh.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_book/widgets/index.dart'
;
...
...
lib/pages/user_notes_des/widgets/note.dart
浏览文件 @
70c0b90d
...
...
@@ -203,7 +203,7 @@ class BuildNote extends StatelessWidget {
},
child:
Image
.
asset
(
'assets/images/audio.png'
)
),
Text
(
'
0:00
/
${mediaModel.duration}
'
,
style:
TextStyle
(
fontSize:
10
.
w
,
height:
1.4
,
color:
Colours
.
c9
),)
Text
(
'
${mediaModel.currentDuration}
/
${mediaModel.duration}
'
,
style:
TextStyle
(
fontSize:
10
.
w
,
height:
1.4
,
color:
Colours
.
c9
),)
],
),
),
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论