Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
book-app
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
book-app
Commits
e5f283bb
提交
e5f283bb
authored
3月 06, 2024
作者:
yueweilu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1、图书详情添加 编辑推荐tab
2、讨论添加新的字段
上级
9ec70060
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
38 行增加
和
6 行删除
+38
-6
library.dart
lib/models/library.dart
+6
-0
mine.dart
lib/models/mine.dart
+12
-0
controller.dart
lib/pages/book_detail/controller.dart
+1
-0
view.dart
lib/pages/book_detail/view.dart
+7
-5
discuss.dart
lib/pages/user_discuss_des/widgets/discuss.dart
+12
-1
没有找到文件。
lib/models/library.dart
浏览文件 @
e5f283bb
...
@@ -222,6 +222,7 @@ class BookDetailModel {
...
@@ -222,6 +222,7 @@ class BookDetailModel {
this
.
chapterId
,
this
.
chapterId
,
this
.
chapterName
,
this
.
chapterName
,
this
.
readChapterId
,
this
.
readChapterId
,
this
.
introduction
,
});
});
BookDetailModel
.
fromJson
(
dynamic
json
)
{
BookDetailModel
.
fromJson
(
dynamic
json
)
{
...
@@ -249,6 +250,7 @@ class BookDetailModel {
...
@@ -249,6 +250,7 @@ class BookDetailModel {
chapterId
=
json
[
'chapter_id'
];
chapterId
=
json
[
'chapter_id'
];
chapterName
=
json
[
'chapter_name'
];
chapterName
=
json
[
'chapter_name'
];
readChapterId
=
json
[
'read_chapter_id'
];
readChapterId
=
json
[
'read_chapter_id'
];
introduction
=
json
[
'introduction'
];
}
}
num
?
bookId
;
num
?
bookId
;
String
?
bookName
;
String
?
bookName
;
...
@@ -274,6 +276,7 @@ class BookDetailModel {
...
@@ -274,6 +276,7 @@ class BookDetailModel {
num
?
chapterId
;
num
?
chapterId
;
String
?
chapterName
;
String
?
chapterName
;
num
?
readChapterId
;
num
?
readChapterId
;
String
?
introduction
;
BookDetailModel
copyWith
({
num
?
bookId
,
BookDetailModel
copyWith
({
num
?
bookId
,
String
?
bookName
,
String
?
bookName
,
String
?
img
,
String
?
img
,
...
@@ -298,6 +301,7 @@ class BookDetailModel {
...
@@ -298,6 +301,7 @@ class BookDetailModel {
num
?
chapterId
,
num
?
chapterId
,
String
?
chapterName
,
String
?
chapterName
,
num
?
readChapterId
,
num
?
readChapterId
,
String
?
introduction
,
})
=>
BookDetailModel
(
bookId:
bookId
??
this
.
bookId
,
})
=>
BookDetailModel
(
bookId:
bookId
??
this
.
bookId
,
bookName:
bookName
??
this
.
bookName
,
bookName:
bookName
??
this
.
bookName
,
img:
img
??
this
.
img
,
img:
img
??
this
.
img
,
...
@@ -322,6 +326,7 @@ class BookDetailModel {
...
@@ -322,6 +326,7 @@ class BookDetailModel {
chapterId:
chapterId
??
this
.
chapterId
,
chapterId:
chapterId
??
this
.
chapterId
,
chapterName:
chapterName
??
this
.
chapterName
,
chapterName:
chapterName
??
this
.
chapterName
,
readChapterId:
readChapterId
??
this
.
readChapterId
,
readChapterId:
readChapterId
??
this
.
readChapterId
,
introduction:
introduction
??
this
.
introduction
);
);
Map
<
String
,
dynamic
>
toJson
()
{
Map
<
String
,
dynamic
>
toJson
()
{
final
map
=
<
String
,
dynamic
>{};
final
map
=
<
String
,
dynamic
>{};
...
@@ -349,6 +354,7 @@ class BookDetailModel {
...
@@ -349,6 +354,7 @@ class BookDetailModel {
map
[
'chapter_id'
]
=
chapterId
;
map
[
'chapter_id'
]
=
chapterId
;
map
[
'chapter_name'
]
=
chapterName
;
map
[
'chapter_name'
]
=
chapterName
;
map
[
'read_chapter_id'
]
=
readChapterId
;
map
[
'read_chapter_id'
]
=
readChapterId
;
map
[
'introduction'
]
=
introduction
;
return
map
;
return
map
;
}
}
...
...
lib/models/mine.dart
浏览文件 @
e5f283bb
...
@@ -539,6 +539,8 @@ class DiscussModel {
...
@@ -539,6 +539,8 @@ class DiscussModel {
this
.
commentAll
,
this
.
commentAll
,
this
.
personPic
,
this
.
personPic
,
this
.
isMy
,
this
.
isMy
,
this
.
commentsCheck
,
this
.
status
,
});
});
DiscussModel
.
fromJson
(
dynamic
json
)
{
DiscussModel
.
fromJson
(
dynamic
json
)
{
...
@@ -560,6 +562,8 @@ class DiscussModel {
...
@@ -560,6 +562,8 @@ class DiscussModel {
personName
=
json
[
'person_name'
];
personName
=
json
[
'person_name'
];
personPic
=
json
[
'person_pic'
];
personPic
=
json
[
'person_pic'
];
isMy
=
json
[
'is_my'
];
isMy
=
json
[
'is_my'
];
commentsCheck
=
json
[
'comments_check'
];
status
=
json
[
'status'
];
if
(
json
[
'comment_all'
]
!=
null
)
{
if
(
json
[
'comment_all'
]
!=
null
)
{
commentAll
=
[];
commentAll
=
[];
...
@@ -581,6 +585,8 @@ class DiscussModel {
...
@@ -581,6 +585,8 @@ class DiscussModel {
num
?
goodNum
;
num
?
goodNum
;
num
?
replyNum
;
num
?
replyNum
;
num
?
isMy
;
num
?
isMy
;
num
?
commentsCheck
;
num
?
status
;
String
?
createTime
;
String
?
createTime
;
String
?
replacePersonName
;
String
?
replacePersonName
;
String
?
replacePersonPic
;
String
?
replacePersonPic
;
...
@@ -601,6 +607,8 @@ class DiscussModel {
...
@@ -601,6 +607,8 @@ class DiscussModel {
num
?
goodNum
,
num
?
goodNum
,
num
?
replyNum
,
num
?
replyNum
,
num
?
isMy
,
num
?
isMy
,
num
?
commentsCheck
,
num
?
status
,
String
?
createTime
,
String
?
createTime
,
String
?
replacePersonName
,
String
?
replacePersonName
,
String
?
replacePersonPic
,
String
?
replacePersonPic
,
...
@@ -621,6 +629,8 @@ class DiscussModel {
...
@@ -621,6 +629,8 @@ class DiscussModel {
goodNum:
goodNum
??
this
.
goodNum
,
goodNum:
goodNum
??
this
.
goodNum
,
replyNum:
replyNum
??
this
.
replyNum
,
replyNum:
replyNum
??
this
.
replyNum
,
isMy:
isMy
??
this
.
isMy
,
isMy:
isMy
??
this
.
isMy
,
status:
status
??
this
.
status
,
commentsCheck:
commentsCheck
??
this
.
commentsCheck
,
createTime:
createTime
??
this
.
createTime
,
createTime:
createTime
??
this
.
createTime
,
replacePersonName:
replacePersonName
??
this
.
replacePersonName
,
replacePersonName:
replacePersonName
??
this
.
replacePersonName
,
replacePersonPic:
replacePersonPic
??
this
.
replacePersonPic
,
replacePersonPic:
replacePersonPic
??
this
.
replacePersonPic
,
...
@@ -646,6 +656,8 @@ class DiscussModel {
...
@@ -646,6 +656,8 @@ class DiscussModel {
map
[
'good_num'
]
=
goodNum
;
map
[
'good_num'
]
=
goodNum
;
map
[
'reply_num'
]
=
replyNum
;
map
[
'reply_num'
]
=
replyNum
;
map
[
'is_my'
]
=
isMy
;
map
[
'is_my'
]
=
isMy
;
map
[
'comments_check'
]
=
commentsCheck
;
map
[
'status'
]
=
status
;
map
[
'create_time'
]
=
createTime
;
map
[
'create_time'
]
=
createTime
;
map
[
'replace_person_name'
]
=
replacePersonName
;
map
[
'replace_person_name'
]
=
replacePersonName
;
map
[
'replace_person_pic'
]
=
replacePersonPic
;
map
[
'replace_person_pic'
]
=
replacePersonPic
;
...
...
lib/pages/book_detail/controller.dart
浏览文件 @
e5f283bb
...
@@ -9,6 +9,7 @@ class BookDetailController extends GetxController with GetSingleTickerProviderSt
...
@@ -9,6 +9,7 @@ class BookDetailController extends GetxController with GetSingleTickerProviderSt
final
PageController
pageController
=
PageController
(
initialPage:
0
);
final
PageController
pageController
=
PageController
(
initialPage:
0
);
List
<
Widget
>
tabs
=
[
List
<
Widget
>
tabs
=
[
const
Tab
(
text:
'目录'
,),
const
Tab
(
text:
'目录'
,),
const
Tab
(
text:
'编辑推荐'
,),
const
Tab
(
text:
'简介'
,),
const
Tab
(
text:
'简介'
,),
const
Tab
(
text:
'本书信息'
,),
const
Tab
(
text:
'本书信息'
,),
];
];
...
...
lib/pages/book_detail/view.dart
浏览文件 @
e5f283bb
...
@@ -120,11 +120,13 @@ class _BookDetailPageState extends State<BookDetailPage> with SingleTickerProvid
...
@@ -120,11 +120,13 @@ class _BookDetailPageState extends State<BookDetailPage> with SingleTickerProvid
}
}
},
},
),
),
// Container(
SingleChildScrollView
(
// padding: EdgeInsets.only(left: 15.w,right: 15.w,top:12.w),
child:
Container
(
// color: Colors.white,
padding:
EdgeInsets
.
only
(
left:
15
.
w
,
right:
15
.
w
,
top:
12
.
w
),
// child: Text(controller.bookDetails.content??'',style: TextStyle(fontSize: 12.w,height: 1.5,color: Colours.c3),),
color:
Colors
.
white
,
// ),
child:
Text
(
controller
.
bookDetails
.
introduction
??
''
,
style:
const
TextStyle
(
fontSize:
15
,
height:
2.1
,
color:
Colours
.
c9
),),
),
),
InAppWebView
(
InAppWebView
(
contextMenu:
ContextMenu
(
contextMenu:
ContextMenu
(
options:
ContextMenuOptions
(
hideDefaultSystemContextMenuItems:
true
),
options:
ContextMenuOptions
(
hideDefaultSystemContextMenuItems:
true
),
...
...
lib/pages/user_discuss_des/widgets/discuss.dart
浏览文件 @
e5f283bb
...
@@ -180,8 +180,8 @@ class _BuildDiscussState extends State<BuildDiscuss> {
...
@@ -180,8 +180,8 @@ class _BuildDiscussState extends State<BuildDiscuss> {
}
}
String
_showText
(
DiscussModel
discussModel
){
String
_showText
(
DiscussModel
discussModel
){
String
text
=
''
;
String
text
=
''
;
if
(
discussModel
.
commentsCheck
==
0
||
discussModel
.
status
==
1
){
// 是我的
// 是我的
if
(
discussModel
.
isMy
==
1
){
if
(
discussModel
.
isMy
==
1
){
text
=
'
${discussModel.content?.text?.content}
'
;
text
=
'
${discussModel.content?.text?.content}
'
;
...
@@ -191,10 +191,12 @@ class _BuildDiscussState extends State<BuildDiscuss> {
...
@@ -191,10 +191,12 @@ class _BuildDiscussState extends State<BuildDiscuss> {
text
=
'
${discussModel.content?.text?.content}
'
;
text
=
'
${discussModel.content?.text?.content}
'
;
}
}
}
}
}
return
text
;
return
text
;
}
}
String
_showStatus
(
DiscussModel
discussModel
){
String
_showStatus
(
DiscussModel
discussModel
){
String
text
=
''
;
String
text
=
''
;
if
((
discussModel
.
commentsCheck
==
0
&&
discussModel
.
status
==
0
)
||
discussModel
.
status
==
1
){
// 是我的
// 是我的
if
(
discussModel
.
isMy
==
1
){
if
(
discussModel
.
isMy
==
1
){
// 审核中
// 审核中
...
@@ -224,6 +226,15 @@ class _BuildDiscussState extends State<BuildDiscuss> {
...
@@ -224,6 +226,15 @@ class _BuildDiscussState extends State<BuildDiscuss> {
text
=
''
;
text
=
''
;
}
}
}
}
}
else
{
if
(
discussModel
.
status
==
0
){
text
=
'(审核中)'
;
}
else
if
(
discussModel
.
status
==
2
){
text
=
'(审核未通过)'
;
}
}
return
text
;
return
text
;
}
}
Widget
_buildListView
(
List
<
DiscussModel
>
data
){
Widget
_buildListView
(
List
<
DiscussModel
>
data
){
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论