提交 08fd23b2 authored 作者: 岳维路's avatar 岳维路

合并分支 'test' 到 'sim'

Test 查看合并请求 kiwitap/zijing-app!12
...@@ -156,7 +156,7 @@ abstract class LibraryAPI { ...@@ -156,7 +156,7 @@ abstract class LibraryAPI {
'book_id': bookId, 'book_id': bookId,
'chapter_id': chapterId 'chapter_id': chapterId
}, },
showLoading: true // showLoading: true
); );
if (result.data is! Map && result.data['list'] is! List) return []; if (result.data is! Map && result.data['list'] is! List) return [];
return List.generate(result.data['list'].length, (index) { return List.generate(result.data['list'].length, (index) {
...@@ -179,7 +179,7 @@ abstract class LibraryAPI { ...@@ -179,7 +179,7 @@ abstract class LibraryAPI {
'book_id': bookId, 'book_id': bookId,
'chapter_id': chapterId 'chapter_id': chapterId
}, },
showLoading: true, // showLoading: true,
); );
if (result.data is! Map && result.data['list'] is! List) return []; if (result.data is! Map && result.data['list'] is! List) return [];
return List.generate(result.data['list'].length, (index) { return List.generate(result.data['list'].length, (index) {
......
...@@ -379,6 +379,7 @@ abstract class MineAPI { ...@@ -379,6 +379,7 @@ abstract class MineAPI {
'type': type, 'type': type,
'identifying': identifying, 'identifying': identifying,
}, },
showLoading: true
); );
if (result.data is! Map) return PayOrderModel(); if (result.data is! Map) return PayOrderModel();
return PayOrderModel.fromJson(result.data); return PayOrderModel.fromJson(result.data);
......
...@@ -132,7 +132,8 @@ class ChapterModel { ...@@ -132,7 +132,8 @@ class ChapterModel {
this.sort, this.sort,
this.seen, this.seen,
this.children, this.children,
this.selected = false this.selected = false,
this.currentRead = false
}); });
ChapterModel.fromJson(dynamic json) { ChapterModel.fromJson(dynamic json) {
...@@ -150,6 +151,7 @@ class ChapterModel { ...@@ -150,6 +151,7 @@ class ChapterModel {
}); });
} }
selected = false; selected = false;
currentRead = false;
} }
num? id; num? id;
String? name; String? name;
...@@ -159,6 +161,7 @@ class ChapterModel { ...@@ -159,6 +161,7 @@ class ChapterModel {
num? sort; num? sort;
num? seen; num? seen;
late bool selected; late bool selected;
late bool currentRead;
List<ChapterModel>? children; List<ChapterModel>? children;
ChapterModel copyWith({ num? id, ChapterModel copyWith({ num? id,
String? name, String? name,
...@@ -589,3 +592,12 @@ class SearchAllModel { ...@@ -589,3 +592,12 @@ class SearchAllModel {
} }
class PopBackModel {
PopBackModel({
required this.chapterId,
required this.back
});
String chapterId;
bool back;
}
...@@ -17,7 +17,7 @@ class _AnswerPageState extends State<AnswerPage> { ...@@ -17,7 +17,7 @@ class _AnswerPageState extends State<AnswerPage> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
title: const Text('知识测评'), title: Text('${widget.params['title']}'),
), ),
body: InAppWebView( body: InAppWebView(
initialUrlRequest: URLRequest( initialUrlRequest: URLRequest(
......
...@@ -114,6 +114,7 @@ class _BuildItemState extends State<BuildItem> { ...@@ -114,6 +114,7 @@ class _BuildItemState extends State<BuildItem> {
onTap: (){ onTap: (){
if(chapterModel.children!.isEmpty){ if(chapterModel.children!.isEmpty){
widget.onTap(chapterModel); widget.onTap(chapterModel);
chapterModel.currentRead= true;
} }
else{ else{
setState(() { setState(() {
...@@ -134,7 +135,7 @@ class _BuildItemState extends State<BuildItem> { ...@@ -134,7 +135,7 @@ class _BuildItemState extends State<BuildItem> {
}, },
child: Container( child: Container(
padding: EdgeInsets.symmetric(horizontal: 15.w), padding: EdgeInsets.symmetric(horizontal: 15.w),
height: 30.w, height: 40.w,
color: Colors.white, color: Colors.white,
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
...@@ -158,7 +159,7 @@ class _BuildItemState extends State<BuildItem> { ...@@ -158,7 +159,7 @@ class _BuildItemState extends State<BuildItem> {
):const SizedBox(), ):const SizedBox(),
], ],
), ),
Transform.rotate( chapterModel.children!.isEmpty?const SizedBox(): Transform.rotate(
angle: chapterModel.selected?0:-90 * (3.141592653589793 / 180), angle: chapterModel.selected?0:-90 * (3.141592653589793 / 180),
child: GestureDetector( child: GestureDetector(
onTap: (){ onTap: (){
...@@ -167,8 +168,8 @@ class _BuildItemState extends State<BuildItem> { ...@@ -167,8 +168,8 @@ class _BuildItemState extends State<BuildItem> {
}); });
}, },
child: SizedBox( child: SizedBox(
width: 20.w, width: 12.w,
height: 20.w, height: 6.w,
// color: Colors.red, // color: Colors.red,
child: Image.asset('assets/images/down.png') child: Image.asset('assets/images/down.png')
), ),
......
...@@ -14,6 +14,8 @@ class BookDetailController extends GetxController with GetSingleTickerProviderSt ...@@ -14,6 +14,8 @@ class BookDetailController extends GetxController with GetSingleTickerProviderSt
const Tab(text: '本书信息',), const Tab(text: '本书信息',),
]; ];
num currentChapterId = 0;
// 目录 // 目录
List <ChapterModel> chapters = []; List <ChapterModel> chapters = [];
// 图书 // 图书
...@@ -48,6 +50,25 @@ class BookDetailController extends GetxController with GetSingleTickerProviderSt ...@@ -48,6 +50,25 @@ class BookDetailController extends GetxController with GetSingleTickerProviderSt
} }
} }
/// 设置当前读的章节id
void setCurrentReadChapterId(){
for(ChapterModel chapterModel in chapters){
writeCurrentReadChapterIdToData(chapterModel);
}
}
void writeCurrentReadChapterIdToData(ChapterModel chapterModel){
for(ChapterModel cModel in chapterModel.children!){
cModel.currentRead = false;
if(cModel.id == currentChapterId){
cModel.currentRead = true;
cModel.selected = true;
chapterModel.selected = true;
}
writeCurrentReadChapterIdToData(chapterModel);
}
}
/// 写入特定数据 /// 写入特定数据
...@@ -68,6 +89,7 @@ class BookDetailController extends GetxController with GetSingleTickerProviderSt ...@@ -68,6 +89,7 @@ class BookDetailController extends GetxController with GetSingleTickerProviderSt
writeData(chapters, result); writeData(chapters, result);
chapters = result; chapters = result;
setCurrentReadChapterId();
update(); update();
} }
......
...@@ -113,9 +113,11 @@ class _BookDetailPageState extends State<BookDetailPage> with SingleTickerProvid ...@@ -113,9 +113,11 @@ class _BookDetailPageState extends State<BookDetailPage> with SingleTickerProvid
controller.getBookDetails(); controller.getBookDetails();
} }
}else{ }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(),'note_id':'0'},extra: controller.bookDetails); final PopBackModel? backModel = await context.pushNamed(Routes.web,queryParameters: {'book_id': controller.bookDetails.bookId.toString(),'chapter_id': chapterModel.id.toString(),'chapter_name':chapterModel.name.toString(),'note_id':'0'},extra: controller.bookDetails);
if (result == true){ if (backModel!.back == true){
controller.getChapters(); controller.getChapters();
// controller.setCurrentReadChapterId(backModel!.chapterId);
controller.currentChapterId = int.parse(backModel!.chapterId);
} }
} }
}, },
...@@ -211,9 +213,11 @@ class _BookDetailPageState extends State<BookDetailPage> with SingleTickerProvid ...@@ -211,9 +213,11 @@ class _BookDetailPageState extends State<BookDetailPage> with SingleTickerProvid
if(controller.bookDetails.isFree == 1){ if(controller.bookDetails.isFree == 1){
final String chapterId = await controller.getCurrentChapterId(); final String chapterId = await controller.getCurrentChapterId();
final String chapterName = await controller.getCurrentChapterName(); final String chapterName = await controller.getCurrentChapterName();
final result = await context.pushNamed(Routes.web,queryParameters: {'book_id': controller.bookDetails.bookId.toString(),'chapter_id': chapterId,'chapter_name':chapterName,'note_id':'0'},extra: controller.bookDetails); final PopBackModel? backModel = await context.pushNamed(Routes.web,queryParameters: {'book_id': controller.bookDetails.bookId.toString(),'chapter_id': chapterId,'chapter_name':chapterName,'note_id':'0'},extra: controller.bookDetails);
if (result == true){ if (backModel!.back == true){
controller.getChapters(); controller.getChapters();
controller.currentChapterId = int.parse(backModel!.chapterId);
// controller.setCurrentReadChapterId(backModel!.chapterId);
} }
} }
else { else {
...@@ -242,9 +246,11 @@ class _BookDetailPageState extends State<BookDetailPage> with SingleTickerProvid ...@@ -242,9 +246,11 @@ class _BookDetailPageState extends State<BookDetailPage> with SingleTickerProvid
else{ else{
final String chapterId = await controller.getCurrentChapterId(); final String chapterId = await controller.getCurrentChapterId();
final String chapterName = await controller.getCurrentChapterName(); final String chapterName = await controller.getCurrentChapterName();
final result = await context.pushNamed(Routes.web,queryParameters: {'book_id': controller.bookDetails.bookId.toString(),'chapter_id': chapterId,'chapter_name':chapterName,'note_id':'0'},extra: controller.bookDetails); final PopBackModel? backModel = await context.pushNamed(Routes.web,queryParameters: {'book_id': controller.bookDetails.bookId.toString(),'chapter_id': chapterId,'chapter_name':chapterName,'note_id':'0'},extra: controller.bookDetails);
if (result == true){ if (backModel!.back == true){
controller.getChapters(); controller.getChapters();
controller.currentChapterId = int.parse(backModel!.chapterId);
// controller.setCurrentReadChapterId(backModel!.chapterId);
} }
} }
} }
...@@ -253,9 +259,11 @@ class _BookDetailPageState extends State<BookDetailPage> with SingleTickerProvid ...@@ -253,9 +259,11 @@ class _BookDetailPageState extends State<BookDetailPage> with SingleTickerProvid
final String chapterId = await controller.getCurrentChapterId(); final String chapterId = await controller.getCurrentChapterId();
final String chapterName = await controller.getCurrentChapterName(); final String chapterName = await controller.getCurrentChapterName();
final result = await context.pushNamed(Routes.web,queryParameters: {'book_id': controller.bookDetails.bookId.toString(),'chapter_id': chapterId,'chapter_name':chapterName,'note_id':'0'},extra: controller.bookDetails); final PopBackModel? backModel = await context.pushNamed(Routes.web,queryParameters: {'book_id': controller.bookDetails.bookId.toString(),'chapter_id': chapterId,'chapter_name':chapterName,'note_id':'0'},extra: controller.bookDetails);
if (result == true){ if (backModel!.back == true){
controller.getChapters(); controller.getChapters();
controller.currentChapterId = int.parse(backModel!.chapterId);
// controller.setCurrentReadChapterId(backModel!.chapterId);
} }
} }
......
...@@ -27,7 +27,7 @@ class BuildItem extends StatelessWidget { ...@@ -27,7 +27,7 @@ class BuildItem extends StatelessWidget {
child: Text( child: Text(
model.helpTitle ?? '', model.helpTitle ?? '',
style: TextStyle( style: TextStyle(
fontSize: 12.w, height: 1.5.w, color: Colours.c9), fontSize: 12.w, height: 1.5.w, color: Colours.c3),
), ),
), ),
], ],
......
...@@ -3,6 +3,7 @@ library image_view; ...@@ -3,6 +3,7 @@ library image_view;
import 'package:extended_image/extended_image.dart'; import 'package:extended_image/extended_image.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_book/utils/index.dart';
import 'package:go_router/go_router.dart'; import 'package:go_router/go_router.dart';
......
...@@ -2,9 +2,11 @@ part of image_view; ...@@ -2,9 +2,11 @@ part of image_view;
class ImageViewPage extends StatefulWidget { class ImageViewPage extends StatefulWidget {
final List<String>images; final List<String>images;
final int currentIndex;
const ImageViewPage({ const ImageViewPage({
Key? key, Key? key,
required this.images required this.images,
required this.currentIndex
}) : super(key: key); }) : super(key: key);
@override @override
...@@ -36,15 +38,16 @@ class _ImageViewPageState extends State<ImageViewPage> { ...@@ -36,15 +38,16 @@ class _ImageViewPageState extends State<ImageViewPage> {
color: Colors.black, color: Colors.black,
child: ExtendedImageGesturePageView.builder( child: ExtendedImageGesturePageView.builder(
controller: ExtendedPageController( controller: ExtendedPageController(
initialPage: 0, initialPage: widget.currentIndex,
pageSpacing: 50, pageSpacing: 50,
), ),
onPageChanged: (int page) { onPageChanged: (int page) {
// _preloadImage(page - 1); _preloadImage(page - 1);
// _preloadImage(page + 1); _preloadImage(page + 1);
}, },
itemCount: widget.images.length, itemCount: widget.images.length,
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
Console.log('-index---------------------------$index----');
return GestureDetector( return GestureDetector(
onTap: (){ onTap: (){
context.pop(); context.pop();
......
...@@ -121,12 +121,18 @@ class LibraryController extends GetxController with GetTickerProviderStateMixin{ ...@@ -121,12 +121,18 @@ class LibraryController extends GetxController with GetTickerProviderStateMixin{
for(FilterModel model in filterCategories){ for(FilterModel model in filterCategories){
model.selected = false; model.selected = false;
} }
filterCategories.first.selected = true; if(filterCategories.isNotEmpty){
selectedCategory = filterCategories.first;
selectedCategory.selected = true;
}
for(FilterModel model in filterLabels){ for(FilterModel model in filterLabels){
model.selected = false; model.selected = false;
} }
filterLabels.first.selected = true; if(filterLabels.isNotEmpty){
selectedLabel = filterLabels.first;
selectedLabel.selected = true;
}
for(FilterModel model in filterFree){ for(FilterModel model in filterFree){
model.selected = false; model.selected = false;
...@@ -135,8 +141,9 @@ class LibraryController extends GetxController with GetTickerProviderStateMixin{ ...@@ -135,8 +141,9 @@ class LibraryController extends GetxController with GetTickerProviderStateMixin{
for(FilterModel model in filterDown){ for(FilterModel model in filterDown){
model.selected = false; model.selected = false;
} }
update();
// onRefresh();
update();
} }
/// 确定 /// 确定
...@@ -202,10 +209,14 @@ class LibraryController extends GetxController with GetTickerProviderStateMixin{ ...@@ -202,10 +209,14 @@ class LibraryController extends GetxController with GetTickerProviderStateMixin{
categories = await LibraryAPI.categories(); categories = await LibraryAPI.categories();
tabController.dispose(); tabController.dispose();
tabController = TabController(length:categories.length, vsync: this); tabController = TabController(length:categories.length, vsync: this);
categories.first.selected = true;
filterCategories = categories.map((model) { filterCategories = categories.map((model) {
return FilterModel(id: model.categoryId.toString(), name: model.name??'',selected: model.selected); return FilterModel(id: model.categoryId.toString(), name: model.name??'',selected: model.selected);
}).toList(); }).toList();
if(filterCategories.isNotEmpty){
selectedCategory = filterCategories.first;
selectedCategory.selected = true;
}
update(); update();
} }
...@@ -216,8 +227,10 @@ class LibraryController extends GetxController with GetTickerProviderStateMixin{ ...@@ -216,8 +227,10 @@ class LibraryController extends GetxController with GetTickerProviderStateMixin{
filterLabels = labels.map((model) { filterLabels = labels.map((model) {
return FilterModel(id: model.labelId.toString(), name: model.name??'',selected: model.selected); return FilterModel(id: model.labelId.toString(), name: model.name??'',selected: model.selected);
}).toList(); }).toList();
if (filterLabels.isNotEmpty){
selectedLabel = filterLabels.first; selectedLabel = filterLabels.first;
selectedLabel.selected = true; selectedLabel.selected = true;
}
update(['label']); update(['label']);
......
...@@ -41,8 +41,8 @@ class _LibraryPageState extends State<LibraryPage> { ...@@ -41,8 +41,8 @@ class _LibraryPageState extends State<LibraryPage> {
Row( Row(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Expanded(child: _buildCategory()), controller.filterCategories.isEmpty?const SizedBox():Expanded(child: _buildCategory()),
GestureDetector( controller.filterCategories.isEmpty?const SizedBox():GestureDetector(
onTap: (){ onTap: (){
controller.setShow(controller.show); controller.setShow(controller.show);
}, },
...@@ -115,7 +115,8 @@ class _LibraryPageState extends State<LibraryPage> { ...@@ -115,7 +115,8 @@ class _LibraryPageState extends State<LibraryPage> {
controller.sureFilter(); controller.sureFilter();
}, },
resetTap: (){ resetTap: (){
// controller.setShow(controller.show);
controller.resetFilter();
},), },),
), ),
], ],
......
...@@ -26,12 +26,18 @@ class _FilterPageState extends State<FilterPage> { ...@@ -26,12 +26,18 @@ class _FilterPageState extends State<FilterPage> {
// return FilterModel(id: model.labelId.toString(), name: model.name??''); // return FilterModel(id: model.labelId.toString(), name: model.name??'');
// }).toList(); // }).toList();
return Container( return GestureDetector(
onTap: (){
widget.controller.setShow(widget.controller.show);
},
child: Container(
color: const Color(0xFF000000).withOpacity(0.5), color: const Color(0xFF000000).withOpacity(0.5),
child: SingleChildScrollView(
child: Column( child: Column(
children: [ children: [
Container( GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: (){},
child: Container(
color: Colors.white, color: Colors.white,
width: double.infinity, width: double.infinity,
padding: EdgeInsets.only(bottom: 10.w), padding: EdgeInsets.only(bottom: 10.w),
...@@ -41,8 +47,8 @@ class _FilterPageState extends State<FilterPage> { ...@@ -41,8 +47,8 @@ class _FilterPageState extends State<FilterPage> {
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
_buildWrapWidget('分类', widget.controller.filterCategories), widget.controller.filterCategories.isEmpty?const SizedBox():_buildWrapWidget('分类', widget.controller.filterCategories),
_buildWrapWidget('标签', widget.controller.filterLabels), widget.controller.filterLabels.isEmpty?const SizedBox():_buildWrapWidget('标签', widget.controller.filterLabels),
_buildWrapWidget('是否收费', widget.controller.filterFree), _buildWrapWidget('是否收费', widget.controller.filterFree),
_buildWrapWidget('排序', widget.controller.filterDown), _buildWrapWidget('排序', widget.controller.filterDown),
], ],
...@@ -51,6 +57,7 @@ class _FilterPageState extends State<FilterPage> { ...@@ -51,6 +57,7 @@ class _FilterPageState extends State<FilterPage> {
), ),
), ),
),
Container( Container(
padding: EdgeInsets.only(left:10.w,right:10.w,top:30.w,bottom:10.w), padding: EdgeInsets.only(left:10.w,right:10.w,top:30.w,bottom:10.w),
color: Colors.white, color: Colors.white,
...@@ -60,9 +67,7 @@ class _FilterPageState extends State<FilterPage> { ...@@ -60,9 +67,7 @@ class _FilterPageState extends State<FilterPage> {
children: [ children: [
Expanded( Expanded(
child: GestureDetector( child: GestureDetector(
onTap: (){ onTap: widget.resetTap,
widget.controller.resetFilter();
},
child: Container( child: Container(
alignment: Alignment.center, alignment: Alignment.center,
height: 35.w, height: 35.w,
...@@ -109,7 +114,7 @@ class _FilterPageState extends State<FilterPage> { ...@@ -109,7 +114,7 @@ class _FilterPageState extends State<FilterPage> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Container(
margin: EdgeInsets.only(left: 10.w,bottom: 10.w,top: 10.w), margin: EdgeInsets.only(left: 10.w,bottom: 15.w,top: 15.w),
child: Text(title,style: TextStyle(fontSize: 15.w,height:1.6,color: Colours.c3,fontWeight: Fonts.boldSemi),) child: Text(title,style: TextStyle(fontSize: 15.w,height:1.6,color: Colours.c3,fontWeight: Fonts.boldSemi),)
), ),
Container( Container(
......
...@@ -47,7 +47,19 @@ class _MainPageState extends State<MainPage> with WidgetsBindingObserver{ ...@@ -47,7 +47,19 @@ class _MainPageState extends State<MainPage> with WidgetsBindingObserver{
), ),
bottomNavigationBar: GetBuilder<MainController>( bottomNavigationBar: GetBuilder<MainController>(
id: 'navigation', id: 'navigation',
builder: (controller) => BottomNavigationBar( builder: (controller) => Container(
decoration: BoxDecoration(
color: Colors.white,
boxShadow:[
BoxShadow(
color: const Color(0xFFE0E0E0).withOpacity(0.5),
spreadRadius: 0,
blurRadius: 4.5,
offset: const Offset(0, 0),
),
],
),
child: BottomNavigationBar(
currentIndex:controller.currentPage , currentIndex:controller.currentPage ,
onTap: (page){ onTap: (page){
if (page != 1 && !UserStore.to.isLogin) { if (page != 1 && !UserStore.to.isLogin) {
...@@ -121,6 +133,7 @@ class _MainPageState extends State<MainPage> with WidgetsBindingObserver{ ...@@ -121,6 +133,7 @@ class _MainPageState extends State<MainPage> with WidgetsBindingObserver{
] ]
), ),
), ),
),
) )
); );
} }
......
library read_info;
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
import 'package:go_router/go_router.dart';
import '../../utils/index.dart';
part 'view.dart';
\ No newline at end of file
part of read_info;
class ReadInfoPage extends StatefulWidget {
final Map<String,String> params;
const ReadInfoPage({
Key? key,
required this.params
}) : super(key: key);
@override
State<ReadInfoPage> createState() => _ReadInfoPageState();
}
class _ReadInfoPageState extends State<ReadInfoPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('${widget.params['title']}'),
),
body: InAppWebView(
initialUrlRequest: URLRequest(
url: WebUri.uri(Uri.parse(kReadInfo))
),
onLoadStop: (controller, url) {
String jsonStr = jsonEncode(widget.params);
controller.evaluateJavascript(source: 'callbackInFlutterComponent($jsonStr)');
},
onConsoleMessage: (controller, consoleMessage) {
// 接收从 WebView 发送的消息
Console.log("画廊扩展阅读-------Received message from WebView-----------------------------: ${consoleMessage.message}");
},
)
);
}
}
...@@ -96,7 +96,8 @@ class ReadController extends FullLifeCycleController with GetSingleTickerProvide ...@@ -96,7 +96,8 @@ class ReadController extends FullLifeCycleController with GetSingleTickerProvide
initTts(); initTts();
netStatus = await Tools.checkCurrentNetStatus(); netStatus = await Tools.checkCurrentNetStatus();
discussTitleFocusNode.addListener(_onCommentFocusChanged); discussTitleFocusNode.addListener(_onCommentFocusChanged);
await ScreenProtector.preventScreenshotOn(); // 开启防截屏
// await ScreenProtector.preventScreenshotOn();
super.onInit(); super.onInit();
} }
...@@ -135,7 +136,8 @@ class ReadController extends FullLifeCycleController with GetSingleTickerProvide ...@@ -135,7 +136,8 @@ class ReadController extends FullLifeCycleController with GetSingleTickerProvide
contentInput.dispose(); contentInput.dispose();
flutterTts.stop(); flutterTts.stop();
searchInput.dispose(); searchInput.dispose();
await ScreenProtector.preventScreenshotOff(); // 关闭防截屏
// await ScreenProtector.preventScreenshotOff();
super.onClose(); super.onClose();
} }
///------------------------------------------ 页面 生命周期-------------------------------------------------------- ///------------------------------------------ 页面 生命周期--------------------------------------------------------
...@@ -167,6 +169,9 @@ class ReadController extends FullLifeCycleController with GetSingleTickerProvide ...@@ -167,6 +169,9 @@ class ReadController extends FullLifeCycleController with GetSingleTickerProvide
} }
void setShowSearch(bool show){ void setShowSearch(bool show){
if(show == false){
searchInput.text = '';
}
showSearch = show; showSearch = show;
update(); update();
} }
......
...@@ -62,6 +62,9 @@ class DiscussController extends GetxController { ...@@ -62,6 +62,9 @@ class DiscussController extends GetxController {
} }
void setShowSearch(bool show){ void setShowSearch(bool show){
if(show == false){
searchInput.text = '';
}
showSearch = show; showSearch = show;
update(); update();
} }
......
...@@ -46,6 +46,9 @@ class NoteController extends GetxController { ...@@ -46,6 +46,9 @@ class NoteController extends GetxController {
} }
void setShowSearch(bool show){ void setShowSearch(bool show){
if(show == false){
searchInput.text = '';
}
showSearch = show; showSearch = show;
update(); update();
} }
......
...@@ -27,9 +27,10 @@ class _ReadPageState extends State<ReadPage> { ...@@ -27,9 +27,10 @@ class _ReadPageState extends State<ReadPage> {
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
PopBackModel backModel = PopBackModel(chapterId: widget.chapterId,back: true);
return WillPopScope( return WillPopScope(
onWillPop: () async { onWillPop: () async {
context.pop(true); context.pop(backModel);
CustomToast.dismiss(); CustomToast.dismiss();
return false; return false;
}, },
...@@ -168,7 +169,10 @@ class _ReadPageState extends State<ReadPage> { ...@@ -168,7 +169,10 @@ class _ReadPageState extends State<ReadPage> {
String chapterId = args.first[0].toString(); String chapterId = args.first[0].toString();
String position = args.first[1].toString(); String position = args.first[1].toString();
// 0:未答题 1:答题结果
String type = args.first[2].toString(); String type = args.first[2].toString();
// 测评标题
String title = args.first[3].toString();
String url = ''; String url = '';
// 未答题 // 未答题
if(type == '0'){ if(type == '0'){
...@@ -182,7 +186,8 @@ class _ReadPageState extends State<ReadPage> { ...@@ -182,7 +186,8 @@ class _ReadPageState extends State<ReadPage> {
'position':position, 'position':position,
'url':url, 'url':url,
'book_id':readController.bookId, 'book_id':readController.bookId,
'token':UserStore.to.token 'token':UserStore.to.token,
'title':title
}; };
Console.log('监听答题回调---------------给页面传参---------------------------------$params'); Console.log('监听答题回调---------------给页面传参---------------------------------$params');
context.pushNamed(Routes.answer,queryParameters: params); context.pushNamed(Routes.answer,queryParameters: params);
...@@ -210,6 +215,24 @@ class _ReadPageState extends State<ReadPage> { ...@@ -210,6 +215,24 @@ class _ReadPageState extends State<ReadPage> {
context.pushNamed(Routes.link,queryParameters: {'url': args.first.toString()}); context.pushNamed(Routes.link,queryParameters: {'url': args.first.toString()});
}); });
// 画廊 扩展于都
controller.addJavaScriptHandler(handlerName: 'readInfoCallback', callback: (args){
String position = args.first[0].toString();
String type = args.first[1].toString();
String title = args.first[2].toString();
Map<String,String> params = {
'chapter_id':readController.chapterId,
'position':position,
'book_id':readController.bookId,
'token':UserStore.to.token,
'title':title,
'base_url':kServerUrl,
'type':type
};
Console.log('监听画廊 扩展于都---------------给页面传参---------------------------------$params');
context.pushNamed(Routes.readInfo,queryParameters: params);
});
/// 离线需要参数 /// 离线需要参数
// // // //
...@@ -403,6 +426,10 @@ class _ReadPageState extends State<ReadPage> { ...@@ -403,6 +426,10 @@ class _ReadPageState extends State<ReadPage> {
controller.selectChapter(ChapterModel(id: sModel.chapterId,name: sModel.chapterName)); controller.selectChapter(ChapterModel(id: sModel.chapterId,name: sModel.chapterName));
controller.webViewController.reload(); controller.webViewController.reload();
}, },
// 删除笔记后 重新刷新web页
delTapCallBack: (){
controller.webViewController.reload();
},
bookDetailModel: controller.bookDetailModel, bookDetailModel: controller.bookDetailModel,
chapterId: controller.chapterId, chapterId: controller.chapterId,
); );
......
...@@ -87,6 +87,10 @@ class _ReadCategoryPageState extends State<ReadCategoryPage> { ...@@ -87,6 +87,10 @@ class _ReadCategoryPageState extends State<ReadCategoryPage> {
], ],
), ),
widget.controller.showSearch? Expanded( widget.controller.showSearch? Expanded(
child: CustomPullScrollView(
controller: widget.controller.refreshController,
onRefresh: widget.controller.onRefreshSearch,
onLoading: widget.controller.onLoadingSearch,
child: BuildSearchAll( child: BuildSearchAll(
onTap: (SearchAllModel sModel){ onTap: (SearchAllModel sModel){
if (widget.onTapSearchItem !=null) { if (widget.onTapSearchItem !=null) {
...@@ -94,7 +98,8 @@ class _ReadCategoryPageState extends State<ReadCategoryPage> { ...@@ -94,7 +98,8 @@ class _ReadCategoryPageState extends State<ReadCategoryPage> {
} }
}, },
searchALlResults: widget.controller.searchALlResults searchALlResults: widget.controller.searchALlResults
,)): ,),
)):
widget.controller.showSearch?const SizedBox():BuildBook(bookDetailModel: widget.controller.bookDetailModel,), widget.controller.showSearch?const SizedBox():BuildBook(bookDetailModel: widget.controller.bookDetailModel,),
widget.controller.showSearch?const SizedBox():Expanded( widget.controller.showSearch?const SizedBox():Expanded(
child: ListView.builder( child: ListView.builder(
......
...@@ -88,6 +88,10 @@ class _ReadDiscussPageState extends State<ReadDiscussPage> { ...@@ -88,6 +88,10 @@ class _ReadDiscussPageState extends State<ReadDiscussPage> {
], ],
), ),
controller.showSearch? Expanded( controller.showSearch? Expanded(
child: CustomPullScrollView(
controller: controller.refreshController,
onRefresh: controller.onRefreshSearch,
onLoading: controller.onLoadingSearch,
child: BuildSearchAll( child: BuildSearchAll(
onTap: (SearchAllModel sModel){ onTap: (SearchAllModel sModel){
if (widget.onTapSearchItem !=null) { if (widget.onTapSearchItem !=null) {
...@@ -95,12 +99,17 @@ class _ReadDiscussPageState extends State<ReadDiscussPage> { ...@@ -95,12 +99,17 @@ class _ReadDiscussPageState extends State<ReadDiscussPage> {
} }
}, },
searchALlResults: controller.searchALlResults, searchALlResults: controller.searchALlResults,
),
)): )):
controller.showSearch?const SizedBox():BuildBook(bookDetailModel: widget.bookDetailModel,), controller.showSearch?const SizedBox():BuildBook(bookDetailModel: widget.bookDetailModel,),
controller.showSearch?const SizedBox():Expanded( controller.showSearch?const SizedBox():Expanded(
child: Stack( child: Stack(
children: [ children: [
ListView.builder( CustomPullScrollView(
controller: controller.refreshController,
onRefresh: controller.onRefresh,
onLoading: controller.onLoading,
child: ListView.builder(
itemBuilder: (BuildContext context,int index){ itemBuilder: (BuildContext context,int index){
DiscussModel model = controller.discuss[index]; DiscussModel model = controller.discuss[index];
return BuildDiscuss( return BuildDiscuss(
...@@ -114,6 +123,7 @@ class _ReadDiscussPageState extends State<ReadDiscussPage> { ...@@ -114,6 +123,7 @@ class _ReadDiscussPageState extends State<ReadDiscussPage> {
}, },
itemCount: controller.discuss.length, itemCount: controller.discuss.length,
), ),
),
Visibility( Visibility(
visible: controller.showReply, visible: controller.showReply,
child: Positioned( child: Positioned(
......
...@@ -121,7 +121,7 @@ class _BuildItemState extends State<BuildItem> { ...@@ -121,7 +121,7 @@ class _BuildItemState extends State<BuildItem> {
}, },
child: Container( child: Container(
padding: EdgeInsets.symmetric(horizontal: 15.w), padding: EdgeInsets.symmetric(horizontal: 15.w),
height: 30.w, height: 40.w,
color: Colors.white, color: Colors.white,
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
...@@ -154,8 +154,8 @@ class _BuildItemState extends State<BuildItem> { ...@@ -154,8 +154,8 @@ class _BuildItemState extends State<BuildItem> {
}); });
}, },
child: Container( child: Container(
width: 20.w, width: 12.w,
height: 20.w, height: 6.w,
// color: Colors.red, // color: Colors.red,
child: Image.asset('assets/images/down.png') child: Image.asset('assets/images/down.png')
), ),
......
...@@ -7,12 +7,14 @@ class ReadNotePage extends StatefulWidget { ...@@ -7,12 +7,14 @@ class ReadNotePage extends StatefulWidget {
// 当前的章节id // 当前的章节id
final String chapterId; final String chapterId;
final void Function()? onTap; final void Function()? onTap;
final void Function() delTapCallBack;
const ReadNotePage({ const ReadNotePage({
Key? key, Key? key,
required this.onTap, required this.onTap,
required this.bookDetailModel, required this.bookDetailModel,
required this.chapterId, required this.chapterId,
this.onTapSearchItem this.onTapSearchItem,
required this.delTapCallBack
}) : super(key: key); }) : super(key: key);
@override @override
...@@ -85,20 +87,30 @@ class _ReadNotePageState extends State<ReadNotePage> { ...@@ -85,20 +87,30 @@ class _ReadNotePageState extends State<ReadNotePage> {
):const SizedBox(), ):const SizedBox(),
], ],
), ),
controller.showSearch? Expanded(child: BuildSearchAll( controller.showSearch? Expanded(
child: CustomPullScrollView(
controller: controller.refreshController,
onRefresh: controller.onRefreshSearch,
onLoading: controller.onLoadingSearch,
child: BuildSearchAll(
onTap: (SearchAllModel sModel){ onTap: (SearchAllModel sModel){
if (widget.onTapSearchItem !=null) { if (widget.onTapSearchItem !=null) {
widget.onTapSearchItem!(sModel); widget.onTapSearchItem!(sModel);
} }
}, },
searchALlResults: controller.searchALlResults searchALlResults: controller.searchALlResults
),
)): )):
controller.showSearch?const SizedBox():BuildBook(bookDetailModel: widget.bookDetailModel,), controller.showSearch?const SizedBox():BuildBook(bookDetailModel: widget.bookDetailModel,),
controller.showSearch?const SizedBox():Expanded( controller.showSearch?const SizedBox():Expanded(
child: MediaQuery.removePadding( child: MediaQuery.removePadding(
context: context, context: context,
removeTop: true, removeTop: true,
child:ListView.builder( child:CustomPullScrollView(
controller: controller.refreshController,
onRefresh: controller.onRefresh,
onLoading: controller.onLoading,
child: ListView.builder(
itemBuilder: (BuildContext context,int index){ itemBuilder: (BuildContext context,int index){
NoteModel model = controller.notes[index]; NoteModel model = controller.notes[index];
// 划线 // 划线
...@@ -107,6 +119,7 @@ class _ReadNotePageState extends State<ReadNotePage> { ...@@ -107,6 +119,7 @@ class _ReadNotePageState extends State<ReadNotePage> {
model: model, model: model,
onTapDel: (){ onTapDel: (){
controller.delNotes(noteModel: model, bookId:widget.bookDetailModel.bookId.toString()); controller.delNotes(noteModel: model, bookId:widget.bookDetailModel.bookId.toString());
widget.delTapCallBack();
}, },
); );
} }
...@@ -116,6 +129,7 @@ class _ReadNotePageState extends State<ReadNotePage> { ...@@ -116,6 +129,7 @@ class _ReadNotePageState extends State<ReadNotePage> {
model: model, model: model,
onTapDel: (){ onTapDel: (){
controller.delNotes(noteModel: model, bookId:widget.bookDetailModel.bookId.toString()); controller.delNotes(noteModel: model, bookId:widget.bookDetailModel.bookId.toString());
widget.delTapCallBack();
}, },
); );
} }
...@@ -139,6 +153,7 @@ class _ReadNotePageState extends State<ReadNotePage> { ...@@ -139,6 +153,7 @@ class _ReadNotePageState extends State<ReadNotePage> {
), ),
), ),
), ),
),
], ],
), ),
); );
......
...@@ -26,6 +26,8 @@ class _BuildSearchAllState extends State<BuildSearchAll> { ...@@ -26,6 +26,8 @@ class _BuildSearchAllState extends State<BuildSearchAll> {
widget.onTap!(model); widget.onTap!(model);
} }
}, },
child: Container(
color: Colors.white,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
...@@ -45,6 +47,7 @@ class _BuildSearchAllState extends State<BuildSearchAll> { ...@@ -45,6 +47,7 @@ class _BuildSearchAllState extends State<BuildSearchAll> {
Gaps.vGaps10, Gaps.vGaps10,
Container(height: 0.5.w,color: Colours.cF2,) Container(height: 0.5.w,color: Colours.cF2,)
], ],
),
) )
); );
}, },
......
...@@ -79,7 +79,7 @@ class _BuildHistoryState extends State<BuildHistory> { ...@@ -79,7 +79,7 @@ class _BuildHistoryState extends State<BuildHistory> {
), ),
child: Padding( child: Padding(
padding: const EdgeInsets.symmetric(horizontal:15,vertical: 3), padding: const EdgeInsets.symmetric(horizontal:15,vertical: 3),
child: Text(e,style: const TextStyle(fontSize: 13,height: 1.4,color: Colours.c3),textAlign: TextAlign.center,), child: Text(e,style: const TextStyle(fontSize: 13,height: 1.5,color: Colours.c3),textAlign: TextAlign.center,),
), ),
), ),
); );
......
...@@ -82,10 +82,11 @@ class BuildDayItem extends StatelessWidget { ...@@ -82,10 +82,11 @@ class BuildDayItem extends StatelessWidget {
Expanded( Expanded(
child: Container( child: Container(
// color: Colors.green, // color: Colors.green,
height: 86.w,
padding: EdgeInsets.only(top: 2.5.w,left: 13.w), padding: EdgeInsets.only(top: 2.5.w,left: 13.w),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
// mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
...@@ -95,7 +96,7 @@ class BuildDayItem extends StatelessWidget { ...@@ -95,7 +96,7 @@ class BuildDayItem extends StatelessWidget {
Text(courseModel.authors??'',style: TextStyle(fontSize: 12.w,height: 1.4,color: Colours.c6),), Text(courseModel.authors??'',style: TextStyle(fontSize: 12.w,height: 1.4,color: Colours.c6),),
], ],
), ),
Gaps.vGaps25, // Gaps.vGaps25,
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
...@@ -105,7 +106,11 @@ class BuildDayItem extends StatelessWidget { ...@@ -105,7 +106,11 @@ class BuildDayItem extends StatelessWidget {
child: Text(courseModel.typeName,style: TextStyle(fontSize: 11.w,height: 1.3,color:AppTheme.primary),), child: Text(courseModel.typeName,style: TextStyle(fontSize: 11.w,height: 1.3,color:AppTheme.primary),),
), ),
// Spacer(), // Spacer(),
Text('上次读到:${courseModel.lastChapter}',style: TextStyle(fontSize: 11.w,height: 1.3,color: Colours.c6),) Container(
width: 120,
alignment: Alignment.centerLeft,
child: Text('上次读到:${courseModel.lastChapter}',style: TextStyle(fontSize: 11.w,height: 1.3,color: Colours.c6),maxLines: 1,overflow: TextOverflow.ellipsis,),
)
], ],
) )
], ],
......
...@@ -167,7 +167,7 @@ class _StudyReportPageState extends State<StudyReportPage> { ...@@ -167,7 +167,7 @@ class _StudyReportPageState extends State<StudyReportPage> {
children: [ children: [
RichText(text: TextSpan( RichText(text: TextSpan(
children: [ children: [
TextSpan(text: '总回顾',style: TextStyle(fontSize: 14.w,height: 1.5,color: Colours.c9),), TextSpan(text: '测评总数',style: TextStyle(fontSize: 14.w,height: 1.5,color: Colours.c9),),
WidgetSpan(child: SizedBox(width: 36.w),), WidgetSpan(child: SizedBox(width: 36.w),),
TextSpan(text:controller.model.questionAllNums !=null? controller.model.questionAllNums.toString():'' ,style: TextStyle(fontSize: 21.w,height: 1.5,color: Colours.c3,fontWeight: Fonts.medium)), TextSpan(text:controller.model.questionAllNums !=null? controller.model.questionAllNums.toString():'' ,style: TextStyle(fontSize: 21.w,height: 1.5,color: Colours.c3,fontWeight: Fonts.medium)),
TextSpan(text: '/条',style: TextStyle(fontSize: 13.w,height: 1.5,color: Colours.c3)), TextSpan(text: '/条',style: TextStyle(fontSize: 13.w,height: 1.5,color: Colours.c3)),
......
...@@ -24,7 +24,11 @@ class BuildCard extends StatelessWidget { ...@@ -24,7 +24,11 @@ class BuildCard extends StatelessWidget {
right: 0, right: 0,
child: Container( child: Container(
padding: EdgeInsets.only(left: 17.5.w,top:25.w,right: 20.w,bottom: 20.w), padding: EdgeInsets.only(left: 17.5.w,top:25.w,right: 20.w,bottom: 20.w),
child: Row( child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(model.bookName??'',style: TextStyle(fontSize: 18.w,height: 1.4,color: Colors.white,fontWeight: Fonts.boldSemi),),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
...@@ -33,7 +37,7 @@ class BuildCard extends StatelessWidget { ...@@ -33,7 +37,7 @@ class BuildCard extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text(model.bookName??'',style: TextStyle(fontSize: 18.w,height: 1.4,color: Colors.white,fontWeight: Fonts.boldSemi),), // Text(model.bookName??'',style: TextStyle(fontSize: 18.w,height: 1.4,color: Colors.white,fontWeight: Fonts.boldSemi),),
Gaps.vGaps15, Gaps.vGaps15,
Row( Row(
children: [ children: [
...@@ -57,13 +61,15 @@ class BuildCard extends StatelessWidget { ...@@ -57,13 +61,15 @@ class BuildCard extends StatelessWidget {
] ]
), ),
), ),
Container( CustomCard(
url: model.img ?? '',
height: 120.w, height: 120.w,
width: 100.w, width: 100.w,
child: CustomImage.network(url: model.img??''),
) )
], ],
), ),
],
),
) )
) )
], ],
......
...@@ -165,7 +165,7 @@ class BuildNote extends StatelessWidget { ...@@ -165,7 +165,7 @@ class BuildNote extends StatelessWidget {
List<String>images = model.noteContent?.image?.map((MediaModel model) => model.content??'').toList()??[]; List<String>images = model.noteContent?.image?.map((MediaModel model) => model.content??'').toList()??[];
return GestureDetector( return GestureDetector(
onTap: (){ onTap: (){
context.pushNamed(Routes.imageView,extra:images); context.pushNamed(Routes.imageView,extra:images,queryParameters: {'index': index.toString()});
}, },
child: Stack( child: Stack(
children: [ children: [
......
...@@ -18,6 +18,7 @@ import 'package:flutter_book/pages/help_cneter_content/index.dart'; ...@@ -18,6 +18,7 @@ import 'package:flutter_book/pages/help_cneter_content/index.dart';
import 'package:flutter_book/pages/link/index.dart'; import 'package:flutter_book/pages/link/index.dart';
import 'package:flutter_book/pages/login/index.dart'; import 'package:flutter_book/pages/login/index.dart';
import 'package:flutter_book/pages/main/index.dart'; import 'package:flutter_book/pages/main/index.dart';
import 'package:flutter_book/pages/read_info/index.dart';
import 'package:flutter_book/pages/reset_pwd/index.dart'; import 'package:flutter_book/pages/reset_pwd/index.dart';
import 'package:flutter_book/pages/search/index.dart'; import 'package:flutter_book/pages/search/index.dart';
import 'package:flutter_book/pages/splash/index.dart'; import 'package:flutter_book/pages/splash/index.dart';
......
...@@ -12,7 +12,7 @@ abstract class Routes { ...@@ -12,7 +12,7 @@ abstract class Routes {
static const web = 'read_web'; static const web = 'read_web';
static const answer = 'answer'; static const answer = 'answer';
static const readInfo = 'read_info';
// 支付界面 // 支付界面
static const bookPay = 'book_pay'; static const bookPay = 'book_pay';
...@@ -703,7 +703,18 @@ abstract class Routes { ...@@ -703,7 +703,18 @@ abstract class Routes {
) )
) )
), ),
GoRoute( // 知识测评 GoRoute( // 画廊 扩展阅读
path: '/$readInfo',
name: readInfo,
pageBuilder: (context, state) =>CupertinoPage(
name: state.uri.toString(),
key: state.pageKey,
child: ReadInfoPage(
params: state.uri.queryParameters,
)
)
),
GoRoute( // 图片预览
path: '/$imageView', path: '/$imageView',
name: imageView, name: imageView,
pageBuilder: (context, state) =>BottomToTopTransitionPage( pageBuilder: (context, state) =>BottomToTopTransitionPage(
...@@ -711,6 +722,7 @@ abstract class Routes { ...@@ -711,6 +722,7 @@ abstract class Routes {
key: state.pageKey, key: state.pageKey,
child: ImageViewPage( child: ImageViewPage(
images: state.extra as List<String>, images: state.extra as List<String>,
currentIndex: int.parse(state.uri.queryParameters['index'].toString()),
) )
) )
......
...@@ -99,6 +99,7 @@ class HttpService extends GetxService { ...@@ -99,6 +99,7 @@ class HttpService extends GetxService {
try { try {
final requestOptions = options ?? Options(); final requestOptions = options ?? Options();
requestOptions.headers = _getHeaders(excludeToken: excludeToken,params: params,url: url); requestOptions.headers = _getHeaders(excludeToken: excludeToken,params: params,url: url);
Console.log('----headers------${requestOptions.headers}\n----params------$params-----');
// 如果启用缓存,将cacheEnabled参数添加到请求选项中 // 如果启用缓存,将cacheEnabled参数添加到请求选项中
if(cacheEnabled){ if(cacheEnabled){
requestOptions.extra ??= {}; requestOptions.extra ??= {};
...@@ -111,7 +112,6 @@ class HttpService extends GetxService { ...@@ -111,7 +112,6 @@ class HttpService extends GetxService {
cancelToken: cancelToken, cancelToken: cancelToken,
); );
if (showLoading) CustomToast.dismiss(); if (showLoading) CustomToast.dismiss();
Console.log('----headers------${requestOptions.headers}\n----params------$params-----');
Console.log(response.data); Console.log(response.data);
return ResponseModel.fromJson(response.data); return ResponseModel.fromJson(response.data);
} catch (error){ } catch (error){
...@@ -245,7 +245,8 @@ class _RequestInterceptor extends Interceptor { ...@@ -245,7 +245,8 @@ class _RequestInterceptor extends Interceptor {
Console.log('----------403---------access_token-------------------------${UserStore.to.accessToken}--------------------'); Console.log('----------403---------access_token-------------------------${UserStore.to.accessToken}--------------------');
msg = '$statusCode - Unauthorized'; msg = '$statusCode - Unauthorized';
final newToken = await refreshToken(); final newToken = await refreshToken();
if (newToken != null) { Console.log('newToken----------$newToken');
if (newToken != null && newToken.isNotEmpty) {
final RequestOptions requestOptions = err.requestOptions; final RequestOptions requestOptions = err.requestOptions;
final headers = requestOptions.headers; final headers = requestOptions.headers;
headers['Authorization'] = newToken; headers['Authorization'] = newToken;
......
...@@ -25,9 +25,9 @@ const String kReadBook = '$kServerUrl/html/app/read.html'; ...@@ -25,9 +25,9 @@ const String kReadBook = '$kServerUrl/html/app/read.html';
// 答题页 // 答题页
const String kAnswer = '$kServerUrl/html/app/evaluating.html'; const String kAnswer = '$kServerUrl/html/app/evaluating.html';
// 答题结果页 // 答题结果页
const String kAnswerResult = '$kServerUrl/html/app/evaluating_result.html'; const String kAnswerResult = 'http://150.158.138.40:9200/evaluating_result.html';
// 画廊 扩展阅读
const String kReadInfo = 'http://150.158.138.40:9200/read_info.html';
......
...@@ -378,8 +378,8 @@ class CustomInputSearch extends StatelessWidget { ...@@ -378,8 +378,8 @@ class CustomInputSearch extends StatelessWidget {
onTap: onTap, onTap: onTap,
style: TextStyle( style: TextStyle(
// fontFamily: 'Sans', // fontFamily: 'Sans',
fontSize: 16.w, fontSize: 12.w,
height: 1.2, height: 1.5,
), ),
decoration: InputDecoration( decoration: InputDecoration(
border: OutlineInputBorder( border: OutlineInputBorder(
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论