提交 e5f283bb authored 作者: yueweilu's avatar yueweilu

1、图书详情添加 编辑推荐tab

2、讨论添加新的字段
上级 9ec70060
......@@ -222,6 +222,7 @@ class BookDetailModel {
this.chapterId,
this.chapterName,
this.readChapterId,
this.introduction,
});
BookDetailModel.fromJson(dynamic json) {
......@@ -249,6 +250,7 @@ class BookDetailModel {
chapterId = json['chapter_id'];
chapterName = json['chapter_name'];
readChapterId = json['read_chapter_id'];
introduction = json['introduction'];
}
num? bookId;
String? bookName;
......@@ -274,6 +276,7 @@ class BookDetailModel {
num? chapterId;
String? chapterName;
num? readChapterId;
String? introduction;
BookDetailModel copyWith({ num? bookId,
String? bookName,
String? img,
......@@ -298,6 +301,7 @@ class BookDetailModel {
num? chapterId,
String? chapterName,
num? readChapterId,
String? introduction,
}) => BookDetailModel( bookId: bookId ?? this.bookId,
bookName: bookName ?? this.bookName,
img: img ?? this.img,
......@@ -322,6 +326,7 @@ class BookDetailModel {
chapterId: chapterId ?? this.chapterId,
chapterName: chapterName ?? this.chapterName,
readChapterId: readChapterId?? this.readChapterId,
introduction: introduction ?? this.introduction
);
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
......@@ -349,6 +354,7 @@ class BookDetailModel {
map['chapter_id'] = chapterId;
map['chapter_name'] = chapterName;
map['read_chapter_id'] = readChapterId;
map['introduction'] = introduction;
return map;
}
......
......@@ -539,6 +539,8 @@ class DiscussModel {
this.commentAll,
this.personPic,
this.isMy,
this.commentsCheck,
this.status,
});
DiscussModel.fromJson(dynamic json) {
......@@ -560,6 +562,8 @@ class DiscussModel {
personName = json['person_name'];
personPic = json['person_pic'];
isMy = json['is_my'];
commentsCheck = json['comments_check'];
status = json['status'];
if (json['comment_all'] != null) {
commentAll = [];
......@@ -581,6 +585,8 @@ class DiscussModel {
num? goodNum;
num? replyNum;
num? isMy;
num? commentsCheck;
num? status;
String? createTime;
String? replacePersonName;
String? replacePersonPic;
......@@ -601,6 +607,8 @@ class DiscussModel {
num? goodNum,
num? replyNum,
num? isMy,
num? commentsCheck,
num? status,
String? createTime,
String? replacePersonName,
String? replacePersonPic,
......@@ -621,6 +629,8 @@ class DiscussModel {
goodNum: goodNum ?? this.goodNum,
replyNum: replyNum ?? this.replyNum,
isMy: isMy ?? this.isMy,
status:status ?? this.status,
commentsCheck: commentsCheck ?? this.commentsCheck,
createTime: createTime ?? this.createTime,
replacePersonName: replacePersonName ?? this.replacePersonName,
replacePersonPic: replacePersonPic ?? this.replacePersonPic,
......@@ -646,6 +656,8 @@ class DiscussModel {
map['good_num'] = goodNum;
map['reply_num'] = replyNum;
map['is_my'] = isMy;
map['comments_check'] = commentsCheck;
map['status'] = status;
map['create_time'] = createTime;
map['replace_person_name'] = replacePersonName;
map['replace_person_pic'] = replacePersonPic;
......
......@@ -9,6 +9,7 @@ class BookDetailController extends GetxController with GetSingleTickerProviderSt
final PageController pageController = PageController(initialPage: 0);
List <Widget>tabs = [
const Tab(text: '目录',),
const Tab(text: '编辑推荐',),
const Tab(text: '简介',),
const Tab(text: '本书信息',),
];
......
......@@ -120,11 +120,13 @@ class _BookDetailPageState extends State<BookDetailPage> with SingleTickerProvid
}
},
),
// Container(
// padding: EdgeInsets.only(left: 15.w,right: 15.w,top:12.w),
// color: Colors.white,
// child: Text(controller.bookDetails.content??'',style: TextStyle(fontSize: 12.w,height: 1.5,color: Colours.c3),),
// ),
SingleChildScrollView(
child: Container(
padding: EdgeInsets.only(left: 15.w,right: 15.w,top:12.w),
color: Colors.white,
child: Text(controller.bookDetails.introduction??'',style: const TextStyle(fontSize: 15,height: 2.1,color: Colours.c9),),
),
),
InAppWebView(
contextMenu: ContextMenu(
options: ContextMenuOptions(hideDefaultSystemContextMenuItems: true),
......
......@@ -180,8 +180,8 @@ class _BuildDiscussState extends State<BuildDiscuss> {
}
String _showText(DiscussModel discussModel){
String text = '';
if (discussModel.commentsCheck==0 || discussModel.status == 1){
// 是我的
if(discussModel.isMy == 1){
text = '${discussModel.content?.text?.content}';
......@@ -191,10 +191,12 @@ class _BuildDiscussState extends State<BuildDiscuss> {
text = '${discussModel.content?.text?.content}';
}
}
}
return text;
}
String _showStatus(DiscussModel discussModel){
String text = '';
if ((discussModel.commentsCheck==0 && discussModel.status == 0) || discussModel.status == 1 ){
// 是我的
if(discussModel.isMy == 1){
// 审核中
......@@ -224,6 +226,15 @@ class _BuildDiscussState extends State<BuildDiscuss> {
text = '';
}
}
}else{
if(discussModel.status == 0){
text = '(审核中)';
}
else if(discussModel.status == 2){
text = '(审核未通过)';
}
}
return text;
}
Widget _buildListView(List<DiscussModel> data){
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论