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

回复消息跳转 我的讨论详细列表

上级 8eb70e1f
...@@ -223,6 +223,8 @@ class BookDetailModel { ...@@ -223,6 +223,8 @@ class BookDetailModel {
this.chapterName, this.chapterName,
this.readChapterId, this.readChapterId,
this.introduction, this.introduction,
/// 笔记
this.commentNum,
}); });
BookDetailModel.fromJson(dynamic json) { BookDetailModel.fromJson(dynamic json) {
...@@ -251,6 +253,7 @@ class BookDetailModel { ...@@ -251,6 +253,7 @@ class BookDetailModel {
chapterName = json['chapter_name']; chapterName = json['chapter_name'];
readChapterId = json['read_chapter_id']; readChapterId = json['read_chapter_id'];
introduction = json['introduction']; introduction = json['introduction'];
commentNum = json['comment_num'];
} }
num? bookId; num? bookId;
String? bookName; String? bookName;
...@@ -277,6 +280,7 @@ class BookDetailModel { ...@@ -277,6 +280,7 @@ class BookDetailModel {
String? chapterName; String? chapterName;
num? readChapterId; num? readChapterId;
String? introduction; String? introduction;
num? commentNum;
BookDetailModel copyWith({ num? bookId, BookDetailModel copyWith({ num? bookId,
String? bookName, String? bookName,
String? img, String? img,
...@@ -302,6 +306,7 @@ class BookDetailModel { ...@@ -302,6 +306,7 @@ class BookDetailModel {
String? chapterName, String? chapterName,
num? readChapterId, num? readChapterId,
String? introduction, String? introduction,
num? commentNum,
}) => 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,
...@@ -326,7 +331,8 @@ class BookDetailModel { ...@@ -326,7 +331,8 @@ 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 introduction: introduction ?? this.introduction,
commentNum: commentNum ?? this.commentNum,
); );
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final map = <String, dynamic>{}; final map = <String, dynamic>{};
...@@ -355,6 +361,7 @@ class BookDetailModel { ...@@ -355,6 +361,7 @@ class BookDetailModel {
map['chapter_name'] = chapterName; map['chapter_name'] = chapterName;
map['read_chapter_id'] = readChapterId; map['read_chapter_id'] = readChapterId;
map['introduction'] = introduction; map['introduction'] = introduction;
map['comment_num'] = commentNum;
return map; return map;
} }
......
...@@ -107,22 +107,30 @@ class MsgPage extends StatelessWidget { ...@@ -107,22 +107,30 @@ class MsgPage extends StatelessWidget {
///TODO: ///TODO:
}else if (model.type == 2){ }else if (model.type == 2){
// 2 购买完成三天未评价(跳转订单列表--已完成) // 2 购买完成三天未评价(跳转订单列表--已完成)
// final orderInfo = await controller.getOrderInfo(model.urlId?.orderNum??''); final orderInfo = await controller.getOrderInfo(model.urlId?.orderNum??'');
//
// final result = await context.pushNamed(Routes.orderEvaluate,extra:orderInfo, final result = await context.pushNamed(Routes.orderEvaluate,extra:orderInfo,
// queryParameters: {'orderNum':orderInfo.ordersnum}); queryParameters: {'orderNum':orderInfo.ordersnum});
//
final result = await context.pushNamed(Routes.order); // final result = await context.pushNamed(Routes.order);
if (result == true){ // if (result == true){
// controller.onRefresh(); // // controller.onRefresh();
} // }
///TODO: ///TODO:
}else if (model.type == 3){ }else if (model.type == 3){
// 3 讨论有人回复的时候 (跳转对应书籍的讨论页面) // 3 讨论有人回复的时候 (跳转我的讨论详情也)
final result = await context.pushNamed(Routes.bookDetail,queryParameters: {'book_id':model.urlId?.bookId.toString()});
if (result == true){ String bookId = model.urlId?.bookId.toString()??'';
// controller.onRefresh(); BookDetailModel bookDetails = await LibraryAPI.details(bookId:bookId);
} CourseModel courseModel = CourseModel(
img: bookDetails.img,
bookId: bookDetails.bookId,
bookName: bookDetails.bookName,
commentNum: bookDetails.commentNum
);
context.pushNamed(Routes.discussDes,extra: courseModel);
} }
else if (model.type == 4){ else if (model.type == 4){
// 4 订单完成后有新的积分增加(跳转用户积分记录页) // 4 订单完成后有新的积分增加(跳转用户积分记录页)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论