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

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

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