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

章节跳转 判断书籍 免费 购买情况 是否试读

上级 58f4d2b1
......@@ -93,10 +93,30 @@ class _BookDetailPageState extends State<BookDetailPage> with SingleTickerProvid
bookId: controller.bookId,
bookDetails: controller.bookDetails,
onTap: (ChapterModel chapterModel) async{
if(controller.bookDetails.isFree == 0 && controller.bookDetails.isHave ==0 && chapterModel.isReading ==0){
List<CourseModel> buy = [];
CourseModel model= CourseModel(
bookId: controller.bookDetails.bookId,
price: controller.bookDetails.price,
vipPrice: controller.bookDetails.vipPrice,
img: controller.bookDetails.img,
bookName: controller.bookDetails.bookName,
cartId: 0,
status: 1,
selected: true
);
buy.add(model);
final result = await context.pushNamed(Routes.bookPay,extra: buy);
if (result == true) {
controller.getChapters();
}
}else{
final result = await context.pushNamed(Routes.web,queryParameters: {'book_id': controller.bookDetails.bookId.toString(),'chapter_id': chapterModel.id.toString(),'chapter_name':chapterModel.name.toString()},extra: controller.bookDetails);
if (result == true){
controller.getChapters();
}
}
},
),
// Container(
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论