Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
book-app
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
book-app
Commits
5005e23c
提交
5005e23c
authored
3月 04, 2024
作者:
岳维路
浏览文件
操作
浏览文件
下载
差异文件
合并分支 'test' 到 'sim'
地址 查看合并请求 kiwitap/zijing-app!1
上级
853fdaa5
a6290010
全部展开
显示空白字符变更
内嵌
并排
正在显示
11 个修改的文件
包含
160 行增加
和
20 行删除
+160
-20
mine.dart
lib/models/mine.dart
+13
-0
controller.dart
lib/pages/read_web/controller.dart
+24
-1
note_controller.dart
lib/pages/read_web/note_controller.dart
+10
-0
category.dart
lib/pages/read_web/widgets/category.dart
+1
-1
discuss.dart
lib/pages/read_web/widgets/discuss.dart
+1
-1
input_discuss.dart
lib/pages/read_web/widgets/input_discuss.dart
+7
-1
note.dart
lib/pages/read_web/widgets/note.dart
+1
-1
discuss.dart
lib/pages/user_discuss_des/widgets/discuss.dart
+60
-2
note.dart
lib/pages/user_notes_des/widgets/note.dart
+37
-8
constants.dart
lib/utils/constants.dart
+6
-5
pubspec.lock
pubspec.lock
+0
-0
没有找到文件。
lib/models/mine.dart
浏览文件 @
5005e23c
...
...
@@ -356,6 +356,7 @@ class NoteModel {
this
.
noteContent
,
this
.
color
,
this
.
chapterName
,
this
.
isMy
,
});
NoteModel
.
fromJson
(
dynamic
json
)
{
...
...
@@ -368,9 +369,11 @@ class NoteModel {
noteContent
=
json
[
'note_content'
]
!=
null
?
NoteContentModel
.
fromJson
(
json
[
'note_content'
])
:
null
;
color
=
json
[
'color'
];
chapterName
=
json
[
'chapter_name'
];
isMy
=
json
[
'is_my'
];
}
num
?
notesId
;
num
?
types
;
num
?
isMy
;
num
?
chapterId
;
String
?
content
;
String
?
positioning
;
...
...
@@ -382,6 +385,7 @@ class NoteModel {
NoteModel
copyWith
({
num
?
notesId
,
num
?
types
,
num
?
isMy
,
num
?
chapterId
,
String
?
content
,
String
?
positioning
,
...
...
@@ -392,6 +396,7 @@ class NoteModel {
NoteModel
(
notesId:
notesId
??
this
.
notesId
,
types:
types
??
this
.
types
,
isMy:
isMy
??
this
.
isMy
,
chapterId:
chapterId
??
this
.
chapterId
,
content:
content
??
this
.
content
,
positioning:
positioning
??
this
.
positioning
,
...
...
@@ -404,6 +409,7 @@ class NoteModel {
final
map
=
<
String
,
dynamic
>{};
map
[
'notes_id'
]
=
notesId
;
map
[
'types'
]
=
types
;
map
[
'is_my'
]
=
isMy
;
map
[
'chapter_id'
]
=
chapterId
;
map
[
'content'
]
=
content
;
map
[
'positioning'
]
=
positioning
;
...
...
@@ -530,6 +536,7 @@ class DiscussModel {
this
.
personName
,
this
.
commentAll
,
this
.
personPic
,
this
.
isMy
,
});
DiscussModel
.
fromJson
(
dynamic
json
)
{
...
...
@@ -550,6 +557,8 @@ class DiscussModel {
replacePersonPic
=
json
[
'replace_person_pic'
];
personName
=
json
[
'person_name'
];
personPic
=
json
[
'person_pic'
];
isMy
=
json
[
'is_my'
];
if
(
json
[
'comment_all'
]
!=
null
)
{
commentAll
=
[];
json
[
'comment_all'
].
forEach
((
v
)
{
...
...
@@ -569,6 +578,7 @@ class DiscussModel {
num
?
personId
;
num
?
goodNum
;
num
?
replyNum
;
num
?
isMy
;
String
?
createTime
;
String
?
replacePersonName
;
String
?
replacePersonPic
;
...
...
@@ -588,6 +598,7 @@ class DiscussModel {
num
?
personId
,
num
?
goodNum
,
num
?
replyNum
,
num
?
isMy
,
String
?
createTime
,
String
?
replacePersonName
,
String
?
replacePersonPic
,
...
...
@@ -607,6 +618,7 @@ class DiscussModel {
personId:
personId
??
this
.
personId
,
goodNum:
goodNum
??
this
.
goodNum
,
replyNum:
replyNum
??
this
.
replyNum
,
isMy:
isMy
??
this
.
isMy
,
createTime:
createTime
??
this
.
createTime
,
replacePersonName:
replacePersonName
??
this
.
replacePersonName
,
replacePersonPic:
replacePersonPic
??
this
.
replacePersonPic
,
...
...
@@ -631,6 +643,7 @@ class DiscussModel {
map
[
'person_id'
]
=
personId
;
map
[
'good_num'
]
=
goodNum
;
map
[
'reply_num'
]
=
replyNum
;
map
[
'is_my'
]
=
isMy
;
map
[
'create_time'
]
=
createTime
;
map
[
'replace_person_name'
]
=
replacePersonName
;
map
[
'replace_person_pic'
]
=
replacePersonPic
;
...
...
lib/pages/read_web/controller.dart
浏览文件 @
5005e23c
...
...
@@ -81,6 +81,8 @@ class ReadController extends FullLifeCycleController with GetSingleTickerProvide
late
TextEditingController
searchInput
=
TextEditingController
();
just_audio
.
AudioPlayer
audioPlayer
=
just_audio
.
AudioPlayer
();
///------------------------------------------ 页面 生命周期--------------------------------------------------------
...
...
@@ -316,7 +318,6 @@ class ReadController extends FullLifeCycleController with GetSingleTickerProvide
}
// 停止录音
void
stopRecorder
()
async
{
just_audio
.
AudioPlayer
audioPlayer
=
just_audio
.
AudioPlayer
();
startRecording
=
false
;
final
path
=
await
_mRecorder
.
stopRecorder
();
var
duration
=
await
audioPlayer
.
setFilePath
(
path
!);
...
...
@@ -354,6 +355,27 @@ class ReadController extends FullLifeCycleController with GetSingleTickerProvide
clearDiscussAudios
();
}
// 播放音频
void
playAudio
(
AudioModel
audioModel
){
if
(
audioPlayer
.
playerState
.
playing
){
audioPlayer
.
stop
();
audioModel
.
currentDuration
=
'0:00:00'
;
// if(currentPlayMediaModel.id == mediaModel.id){
// return;
// }
}
// 本地音频
audioPlayer
.
setFilePath
(
audioModel
.
path
);
audioPlayer
.
play
();
audioPlayer
.
positionStream
.
listen
((
position
)
{
String
temp
=
Tools
.
formatDuration
(
position
);
Console
.
log
(
'播放时间---------------------
$temp
'
);
audioModel
.
currentDuration
=
temp
;
update
();
});
// currentPlayMediaModel = mediaModel;
}
// 添加讨论图片
void
addDiscussInputImages
(
String
path
){
discussInputImages
.
add
(
path
);
...
...
@@ -874,4 +896,5 @@ class AudioModel {
AudioModel
({
required
this
.
path
,
required
this
.
duration
});
String
path
;
String
duration
;
late
String
currentDuration
;
}
lib/pages/read_web/note_controller.dart
浏览文件 @
5005e23c
...
...
@@ -101,6 +101,16 @@ class NoteController extends GetxController {
bookId:
bookDetailModel
.
bookId
.
toString
(),
chapterId:
chapterId
);
for
(
NoteModel
noteModel
in
result
){
if
(
noteModel
.
noteContent
!.
audio
!.
isNotEmpty
){
for
(
MediaModel
mediaModel
in
noteModel
.
noteContent
!.
audio
!){
Duration
?
duration
=
await
just_audio
.
AudioPlayer
().
setUrl
(
mediaModel
.
content
??
''
);
mediaModel
.
duration
=
Tools
.
formatDuration
(
duration
!);
}
}
}
// 如果是刷新 清理数据
if
(
isRefresh
)
notes
.
clear
();
notes
.
addAll
(
result
);
...
...
lib/pages/read_web/widgets/category.dart
浏览文件 @
5005e23c
...
...
@@ -61,7 +61,7 @@ class _ReadCategoryPageState extends State<ReadCategoryPage> {
child:
CustomInputSearch
(
controller:
widget
.
controller
.
searchInput
,
readOnly:
false
,
hintText:
'搜索全文
---目录
'
,
hintText:
'搜索全文'
,
onTap:
()
{
// context.pushNamed(Routes.msgs);
},
...
...
lib/pages/read_web/widgets/discuss.dart
浏览文件 @
5005e23c
...
...
@@ -62,7 +62,7 @@ class _ReadDiscussPageState extends State<ReadDiscussPage> {
child:
CustomInputSearch
(
controller:
controller
.
searchInput
,
readOnly:
false
,
hintText:
'搜索全文
---讨论
'
,
hintText:
'搜索全文'
,
onTap:
()
{
// context.pushNamed(Routes.msgs);
},
...
...
lib/pages/read_web/widgets/input_discuss.dart
浏览文件 @
5005e23c
...
...
@@ -125,7 +125,12 @@ class _ReadInputDiscussState extends State<ReadInputDiscuss> {
physics:
const
NeverScrollableScrollPhysics
(),
shrinkWrap:
true
,
itemBuilder:
(
BuildContext
context
,
int
index
){
return
Container
(
AudioModel
audioModel
=
widget
.
controller
.
discussInputAudios
[
index
];
return
GestureDetector
(
onTap:
(){
widget
.
controller
.
playAudio
(
audioModel
);
},
child:
Container
(
height:
20
.
w
,
margin:
EdgeInsets
.
only
(
right:
130
.
w
),
child:
Container
(
...
...
@@ -144,6 +149,7 @@ class _ReadInputDiscussState extends State<ReadInputDiscuss> {
],
),
),
),
);
},
itemCount:
widget
.
controller
.
discussInputAudios
.
length
,
...
...
lib/pages/read_web/widgets/note.dart
浏览文件 @
5005e23c
...
...
@@ -60,7 +60,7 @@ class _ReadNotePageState extends State<ReadNotePage> {
child:
CustomInputSearch
(
controller:
controller
.
searchInput
,
readOnly:
false
,
hintText:
'搜索全文
---笔记
'
,
hintText:
'搜索全文'
,
onTap:
()
{
// context.pushNamed(Routes.msgs);
},
...
...
lib/pages/user_discuss_des/widgets/discuss.dart
浏览文件 @
5005e23c
...
...
@@ -117,7 +117,7 @@ class _BuildDiscussState extends State<BuildDiscuss> {
type
==
0
?
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
model
.
content
?.
text
?.
content
??
'审核中'
,
style:
TextStyle
(
fontSize:
13
.
w
,
height:
1.5
,
color:
Colours
.
c3
),),
Text
(
_showText
(
model
)
,
style:
TextStyle
(
fontSize:
13
.
w
,
height:
1.5
,
color:
Colours
.
c3
),),
Gaps
.
vGaps10
,
_buildImageGridView
()
],
...
...
@@ -174,6 +174,40 @@ class _BuildDiscussState extends State<BuildDiscuss> {
);
}
String
_showText
(
DiscussModel
discussModel
){
String
text
=
''
;
// 是我的
if
(
discussModel
.
isMy
==
1
){
// 审核中
if
(
discussModel
.
content
?.
text
?.
privacyStatus
==
0
||
discussModel
.
content
?.
text
?.
privacyStatus
==
2
){
text
=
'
${discussModel.content?.text?.content}
(审核中)'
;
}
// 审核未通过
else
if
(
discussModel
.
content
?.
text
?.
privacyStatus
==-
1
){
text
=
'
${discussModel.content?.text?.content}
(审核未通过)'
;
}
// 审核通过
else
{
text
=
'
${discussModel.content?.text?.content}
'
;
}
}
else
{
// 审核中
if
(
discussModel
.
content
?.
text
?.
privacyStatus
==
0
||
discussModel
.
content
?.
text
?.
privacyStatus
==
2
){
text
=
'(审核中)'
;
}
// 审核未通过
else
if
(
discussModel
.
content
?.
text
?.
privacyStatus
==-
1
){
text
=
'(审核未通过)'
;
}
// 审核通过
else
{
text
=
'
${discussModel.content?.text?.content}
'
;
}
}
return
text
;
}
Widget
_buildListView
(
List
<
DiscussModel
>
data
){
return
ListView
.
builder
(
physics:
const
NeverScrollableScrollPhysics
(),
...
...
@@ -199,7 +233,31 @@ class _BuildDiscussState extends State<BuildDiscuss> {
),
itemBuilder:
(
BuildContext
context
,
int
index
)
{
MediaModel
?
mediaModel
=
widget
.
model
.
content
?.
image
?[
index
];
return
CustomImage
.
network
(
url:
widget
.
model
?.
content
?.
image
?[
index
].
content
??
''
,
fit:
BoxFit
.
cover
,);
return
Stack
(
children:
[
Positioned
(
left:
0
,
right:
0
,
top:
0
,
bottom:
0
,
child:
CustomImage
.
network
(
url:
mediaModel
?.
content
??
''
,
fit:
BoxFit
.
cover
,)
),
Visibility
(
visible:
mediaModel
?.
privacyStatus
==
0
?
true
:
false
,
child:
Positioned
(
left:
0
,
right:
0
,
top:
0
,
bottom:
0
,
child:
Container
(
alignment:
Alignment
.
center
,
color:
widget
.
model
.
isMy
==
1
?
Colours
.
c9
.
withOpacity
(
0.5
):
Colours
.
c9
.
withOpacity
(
1
),
child:
Text
(
'(审核中)'
,
style:
TextStyle
(
fontSize:
11
.
w
,
height:
1.5
,
color:
AppTheme
.
primary
),),
)
),
),
],
);
// return Container(
// color: Colors.red,
// );
...
...
lib/pages/user_notes_des/widgets/note.dart
浏览文件 @
5005e23c
...
...
@@ -65,18 +65,12 @@ class BuildNote extends StatelessWidget {
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
Text
(
model
.
noteContent
?.
text
?.
content
??
''
,
style:
TextStyle
(
Text
(
_showText
(
model
)
,
style:
TextStyle
(
fontSize:
14
.
w
,
height:
1.5
,
// color: Colors.red,
color:
Colours
.
c3
),),
model
.
noteContent
?.
text
?.
privacyStatus
==
0
?
Text
(
'(审核中)'
,
style:
TextStyle
(
fontSize:
11
.
w
,
height:
1.5
,
// color: Colors.red,
color:
AppTheme
.
primary
),):
const
SizedBox
(),
],
),
Gaps
.
vGaps13
,
...
...
@@ -103,6 +97,41 @@ class BuildNote extends StatelessWidget {
);
}
String
_showText
(
NoteModel
discussModel
){
String
text
=
''
;
// 是我的
if
(
discussModel
.
isMy
==
1
){
// 审核中
if
(
discussModel
.
noteContent
?.
text
?.
privacyStatus
==
0
||
discussModel
.
noteContent
?.
text
?.
privacyStatus
==
2
){
text
=
'
${discussModel.noteContent?.text?.content}
(审核中)'
;
}
// 审核未通过
else
if
(
discussModel
.
noteContent
?.
text
?.
privacyStatus
==-
1
){
text
=
'
${discussModel.noteContent?.text?.content}
(审核未通过)'
;
}
// 审核通过
else
{
text
=
'
${discussModel.noteContent?.text?.content}
'
;
}
}
else
{
// 审核中
if
(
discussModel
.
noteContent
?.
text
?.
privacyStatus
==
0
||
discussModel
.
noteContent
?.
text
?.
privacyStatus
==
2
){
text
=
'(审核中)'
;
}
// 审核未通过
else
if
(
discussModel
.
noteContent
?.
text
?.
privacyStatus
==-
1
){
text
=
'(审核未通过)'
;
}
// 审核通过
else
{
text
=
'
${discussModel.noteContent?.text?.content}
'
;
}
}
return
text
;
}
// 图片
Widget
_buildImageGridView
(){
return
GridView
.
builder
(
...
...
@@ -135,7 +164,7 @@ class BuildNote extends StatelessWidget {
bottom:
0
,
child:
Container
(
alignment:
Alignment
.
center
,
color:
Colours
.
c9
.
withOpacity
(
0.5
),
color:
model
.
isMy
==
1
?
Colours
.
c9
.
withOpacity
(
0.5
):
Colours
.
c9
.
withOpacity
(
1
),
child:
Text
(
'(审核中)'
,
style:
TextStyle
(
fontSize:
14
.
w
,
height:
1.5
,
color:
AppTheme
.
primary
),),
)
),
...
...
lib/utils/constants.dart
浏览文件 @
5005e23c
...
...
@@ -3,7 +3,8 @@ part of utils;
// 服务器地址
// const String kServerUrl = 'https://app.vning.com';
// const String kServerUrl = 'http://192.168.11.88:81';
const
String
kServerUrl
=
'http://1507.superge.cn:81'
;
const
String
kServerUrl
=
'http://8.141.148.247:7421'
;
// const String kServerUrl = 'http://1507.superge.cn:81';
const
String
kLocalToken
=
'local_token'
;
const
String
kLocalAccessToken
=
'local_access_token'
;
const
String
kLocalAccount
=
'local_account'
;
...
...
@@ -18,13 +19,13 @@ const String kUserPriAgreement = '/html/agreement/pri_agreement.html';
const
String
kUserRechargeAgreement
=
'/html/agreement/rec_agreement.html'
;
// 错题详情页 html
const
String
kUserWrongDes
=
'
http://150.158.138.40:9200
/evaluating_wrong.html'
;
const
String
kUserWrongDes
=
'
$kServerUrl
/html/app
/evaluating_wrong.html'
;
// 阅读页 html
const
String
kReadBook
=
'
http://150.158.138.40:9200
/read.html'
;
const
String
kReadBook
=
'
$kServerUrl
/html/app
/read.html'
;
// 答题页
const
String
kAnswer
=
'
http://150.158.138.40:9200
/evaluating.html'
;
const
String
kAnswer
=
'
$kServerUrl
/html/app
/evaluating.html'
;
// 答题结果页
const
String
kAnswerResult
=
'
http://150.158.138.40:9200
/evaluating_result.html'
;
const
String
kAnswerResult
=
'
$kServerUrl
/html/app
/evaluating_result.html'
;
...
...
pubspec.lock
浏览文件 @
5005e23c
差异被折叠。
点击展开。
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论