提交 4fc098cd authored 作者: yueweilu's avatar yueweilu

修改 bug

上级 56b8833d
...@@ -2,6 +2,7 @@ library answer; ...@@ -2,6 +2,7 @@ library answer;
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart'; import 'package:flutter_inappwebview/flutter_inappwebview.dart';
import 'package:go_router/go_router.dart';
import '../../utils/index.dart'; import '../../utils/index.dart';
......
...@@ -27,6 +27,12 @@ class _AnswerPageState extends State<AnswerPage> { ...@@ -27,6 +27,12 @@ class _AnswerPageState extends State<AnswerPage> {
String str = '$kServerUrl,${widget.params['book_id']},${widget.params['chapter_id']},${widget.params['token']},${widget.params['position']}'; String str = '$kServerUrl,${widget.params['book_id']},${widget.params['chapter_id']},${widget.params['token']},${widget.params['position']}';
Console.log('知识测评--------传给前端的参数--------------------------------$str'); Console.log('知识测评--------传给前端的参数--------------------------------$str');
controller.evaluateJavascript(source: 'callbackInFlutterComponent("$str");'); controller.evaluateJavascript(source: 'callbackInFlutterComponent("$str");');
controller.addJavaScriptHandler(handlerName: 'evaluatingSubmitCallback', callback: (args){
Console.log('监听笔记回调------------------------------------------------$args');
context.pop();
// readController.titleInput.text = args.toString();
});
}, },
onConsoleMessage: (controller, consoleMessage) { onConsoleMessage: (controller, consoleMessage) {
// 接收从 WebView 发送的消息 // 接收从 WebView 发送的消息
......
...@@ -18,7 +18,7 @@ class _BaiKePageState extends State<BaiDictPage> { ...@@ -18,7 +18,7 @@ class _BaiKePageState extends State<BaiDictPage> {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
centerTitle: false, centerTitle: false,
title: Text('$widget.keyword',style: TextStyle(fontSize: 14.w,fontWeight: Fonts.medium,color: Colours.c3),), title: Text(widget.keyword,style: TextStyle(fontSize: 14.w,fontWeight: Fonts.medium,color: Colours.c3),),
), ),
body: InAppWebView( body: InAppWebView(
initialUrlRequest: URLRequest( initialUrlRequest: URLRequest(
......
...@@ -87,6 +87,7 @@ class _BookDetailPageState extends State<BookDetailPage> with SingleTickerProvid ...@@ -87,6 +87,7 @@ class _BookDetailPageState extends State<BookDetailPage> with SingleTickerProvid
Expanded( Expanded(
child: TabBarView( child: TabBarView(
controller: controller.tabController, controller: controller.tabController,
physics: const NeverScrollableScrollPhysics(),
children: [ children: [
BookCategoryPage( BookCategoryPage(
chapters: controller.chapters, chapters: controller.chapters,
...@@ -129,7 +130,28 @@ class _BookDetailPageState extends State<BookDetailPage> with SingleTickerProvid ...@@ -129,7 +130,28 @@ class _BookDetailPageState extends State<BookDetailPage> with SingleTickerProvid
options: ContextMenuOptions(hideDefaultSystemContextMenuItems: true), options: ContextMenuOptions(hideDefaultSystemContextMenuItems: true),
), ),
onWebViewCreated: (InAppWebViewController wcontroller){ onWebViewCreated: (InAppWebViewController wcontroller){
wcontroller.loadData(data: controller.bookDetails.content??'',);
wcontroller.loadData(data: """
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<style>
*{ margin: 0; padding: 5px;}
html{ font-size: 10px;}
body p{ font-size: 1.5rem; line-height:2.4rem;color: #999}
img{ max-width:100%}
</style>
</head>
<body>
${controller.bookDetails.content}
</body>
</html>
""",);
}, },
), ),
BookInfoPage(model:controller.bookDetails,) BookInfoPage(model:controller.bookDetails,)
......
...@@ -140,7 +140,7 @@ class _ReadInputDiscussState extends State<ReadInputDiscuss> { ...@@ -140,7 +140,7 @@ class _ReadInputDiscussState extends State<ReadInputDiscuss> {
mainAxisAlignment:MainAxisAlignment.spaceBetween, mainAxisAlignment:MainAxisAlignment.spaceBetween,
children: [ children: [
Image.asset('assets/images/audio.png'), Image.asset('assets/images/audio.png'),
Text('0:00/1:52',style: TextStyle(fontSize: 10.w,height: 1.4,color: Colours.c9),) // Text('0:00/1:52',style: TextStyle(fontSize: 10.w,height: 1.4,color: Colours.c9),)
], ],
), ),
), ),
...@@ -173,7 +173,7 @@ class _ReadInputDiscussState extends State<ReadInputDiscuss> { ...@@ -173,7 +173,7 @@ class _ReadInputDiscussState extends State<ReadInputDiscuss> {
}, },
child: Image.asset('assets/images/read_add_img.png')), child: Image.asset('assets/images/read_add_img.png')),
Gaps.hGaps10, Gaps.hGaps10,
GestureDetector( widget.controller.chatType ==0?const SizedBox():GestureDetector(
onTap: () async { onTap: () async {
if(widget.controller.startRecording){ if(widget.controller.startRecording){
widget.controller.stopRecorder(); widget.controller.stopRecorder();
......
...@@ -28,18 +28,30 @@ class _BuildListPageState extends State<BuildListPage> with AutomaticKeepAliveCl ...@@ -28,18 +28,30 @@ class _BuildListPageState extends State<BuildListPage> with AutomaticKeepAliveCl
NoteModel model = controller.notes[index]; NoteModel model = controller.notes[index];
// 划线 // 划线
if(model.types == 1){ if(model.types == 1){
return BuildLine(model: model, return GestureDetector(
// TODO:跳转阅读页对应位置
onTap: () async{
// final result = await context.pushNamed(Routes.web,queryParameters: {'book_id': controller.bookDetails.bookId.toString(),'chapter_id': controller.bookDetails.chapterId.toString(),'chapter_name':controller.bookDetails.chapterName.toString()},extra: controller.bookDetails);
},
child: BuildLine(model: model,
onTapDel: (){ onTapDel: (){
controller.delNotes(notesId: model.notesId.toString(), bookId:widget.model.bookId.toString()); controller.delNotes(notesId: model.notesId.toString(), bookId:widget.model.bookId.toString());
}, },
),
); );
} }
// 高亮 // 高亮
else if(model.types == 2){ else if(model.types == 2){
return BuildHigh(model: model, return GestureDetector(
// TODO:跳转阅读页对应位置
onTap: (){
// final result = await context.pushNamed(Routes.web,queryParameters: {'book_id': controller.bookDetails.bookId.toString(),'chapter_id': controller.bookDetails.chapterId.toString(),'chapter_name':controller.bookDetails.chapterName.toString()},extra: controller.bookDetails);
},
child: BuildHigh(model: model,
onTapDel: (){ onTapDel: (){
controller.delNotes(notesId: model.notesId.toString(), bookId:widget.model.bookId.toString()); controller.delNotes(notesId: model.notesId.toString(), bookId:widget.model.bookId.toString());
}, },
),
); );
} }
// 笔记 // 笔记
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论