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

修改 笔记界面显示 笔记公开状态

上级 900a5017
...@@ -357,6 +357,7 @@ class NoteModel { ...@@ -357,6 +357,7 @@ class NoteModel {
this.color, this.color,
this.chapterName, this.chapterName,
this.isMy, this.isMy,
this.isOpen,
}); });
NoteModel.fromJson(dynamic json) { NoteModel.fromJson(dynamic json) {
...@@ -372,10 +373,12 @@ class NoteModel { ...@@ -372,10 +373,12 @@ class NoteModel {
color = json['color']; color = json['color'];
chapterName = json['chapter_name']; chapterName = json['chapter_name'];
isMy = json['is_my']; isMy = json['is_my'];
isOpen = json['is_open'];
} }
num? notesId; num? notesId;
num? types; num? types;
num? isMy; num? isMy;
num? isOpen;
num? chapterId; num? chapterId;
String? content; String? content;
String? positioning; String? positioning;
...@@ -388,6 +391,7 @@ class NoteModel { ...@@ -388,6 +391,7 @@ class NoteModel {
num? notesId, num? notesId,
num? types, num? types,
num? isMy, num? isMy,
num? isOpen,
num? chapterId, num? chapterId,
String? content, String? content,
String? positioning, String? positioning,
...@@ -399,6 +403,7 @@ class NoteModel { ...@@ -399,6 +403,7 @@ class NoteModel {
notesId: notesId ?? this.notesId, notesId: notesId ?? this.notesId,
types: types ?? this.types, types: types ?? this.types,
isMy: isMy ?? this.isMy, isMy: isMy ?? this.isMy,
isOpen: isOpen ?? this.isOpen,
chapterId: chapterId ?? this.chapterId, chapterId: chapterId ?? this.chapterId,
content: content ?? this.content, content: content ?? this.content,
positioning: positioning ?? this.positioning, positioning: positioning ?? this.positioning,
...@@ -412,6 +417,7 @@ class NoteModel { ...@@ -412,6 +417,7 @@ class NoteModel {
map['notes_id'] = notesId; map['notes_id'] = notesId;
map['types'] = types; map['types'] = types;
map['is_my'] = isMy; map['is_my'] = isMy;
map['is_open'] = isOpen;
map['chapter_id'] = chapterId; map['chapter_id'] = chapterId;
map['content'] = content; map['content'] = content;
map['positioning'] = positioning; map['positioning'] = positioning;
......
...@@ -144,7 +144,7 @@ class _ReadNotePageState extends State<ReadNotePage> { ...@@ -144,7 +144,7 @@ class _ReadNotePageState extends State<ReadNotePage> {
controller.delNotes(noteModel: model, bookId:widget.bookDetailModel.bookId.toString()); controller.delNotes(noteModel: model, bookId:widget.bookDetailModel.bookId.toString());
}, },
onTapEdit: (){ onTapEdit: (){
context.pushNamed(Routes.editNote,extra: model,queryParameters: {'book_id':widget.bookDetailModel.bookId}); context.pushNamed(Routes.editNote,extra: model,queryParameters: {'book_id':widget.bookDetailModel.bookId.toString()});
}, },
); );
} }
......
...@@ -26,6 +26,7 @@ class UserEditNoteController extends GetxController { ...@@ -26,6 +26,7 @@ class UserEditNoteController extends GetxController {
@override @override
void onInit() { void onInit() {
isPublic = model.isOpen ==1?true:false;
super.onInit(); super.onInit();
} }
...@@ -220,11 +221,17 @@ class UserEditNoteController extends GetxController { ...@@ -220,11 +221,17 @@ class UserEditNoteController extends GetxController {
'image':images 'image':images
}; };
String isOpen = '0';
if(isPublic){
isOpen = '1';
}
final result = MineAPI.editNotes( final result = MineAPI.editNotes(
content: model.content??'', content: model.content??'',
notesId: model.notesId.toString(), notesId: model.notesId.toString(),
bookId: bookId, bookId: bookId,
noteContent: jsonEncode(contentMap) noteContent: jsonEncode(contentMap),
isOpen: isOpen
); );
return result; return result;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论