Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
book-app
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
book-app
Commits
ea72baed
提交
ea72baed
authored
3月 19, 2024
作者:
岳维路
浏览文件
操作
浏览文件
下载
差异文件
合并分支 'test' 到 'sim'
Test 查看合并请求 kiwitap/zijing-app!14
上级
642c0844
6fc556c2
显示空白字符变更
内嵌
并排
正在显示
14 个修改的文件
包含
254 行增加
和
50 行删除
+254
-50
library.dart
lib/models/library.dart
+3
-1
item.dart
lib/pages/book_category/widgets/item.dart
+1
-1
controller.dart
lib/pages/book_detail/controller.dart
+50
-15
view.dart
lib/pages/book_detail/view.dart
+4
-0
controller.dart
lib/pages/login/controller.dart
+3
-4
controller.dart
lib/pages/read_web/controller.dart
+75
-7
view.dart
lib/pages/read_web/view.dart
+20
-6
discuss.dart
lib/pages/read_web/widgets/discuss.dart
+27
-8
item.dart
lib/pages/read_web/widgets/item.dart
+2
-1
index.dart
lib/pages/scale_image/index.dart
+11
-0
view.dart
lib/pages/scale_image/view.dart
+37
-0
index.dart
lib/routes/index.dart
+1
-0
routes.dart
lib/routes/routes.dart
+12
-0
constants.dart
lib/utils/constants.dart
+8
-7
没有找到文件。
lib/models/library.dart
浏览文件 @
ea72baed
...
@@ -595,9 +595,11 @@ class SearchAllModel {
...
@@ -595,9 +595,11 @@ class SearchAllModel {
class
PopBackModel
{
class
PopBackModel
{
PopBackModel
({
PopBackModel
({
required
this
.
chapterId
,
required
this
.
chapterId
,
required
this
.
back
required
this
.
back
,
required
this
.
chapterName
});
});
String
chapterId
;
String
chapterId
;
String
chapterName
;
bool
back
;
bool
back
;
}
}
lib/pages/book_category/widgets/item.dart
浏览文件 @
ea72baed
...
@@ -144,7 +144,7 @@ class _BuildItemState extends State<BuildItem> {
...
@@ -144,7 +144,7 @@ class _BuildItemState extends State<BuildItem> {
Row
(
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
children:
[
Text
(
chapterModel
.
name
??
''
,
style:
TextStyle
(
fontSize:
14
.
w
,
color:
chapterModel
.
seen
==
0
?
Colours
.
c3
:
Colours
.
c9
,
fontWeight:
Fonts
.
medium
,
height:
2
),),
Text
(
chapterModel
.
name
??
''
,
style:
TextStyle
(
fontSize:
14
.
w
,
color:
chapterModel
.
currentRead
?
AppTheme
.
primary
:
chapterModel
.
seen
==
0
?
Colours
.
c3
:
Colours
.
c9
,
fontWeight:
Fonts
.
medium
,
height:
2
),),
Gaps
.
hGaps5
,
Gaps
.
hGaps5
,
chapterModel
.
isReading
==
1
?
Container
(
chapterModel
.
isReading
==
1
?
Container
(
margin:
const
EdgeInsets
.
fromLTRB
(
0
,
6
,
0
,
0
),
margin:
const
EdgeInsets
.
fromLTRB
(
0
,
6
,
0
,
0
),
...
...
lib/pages/book_detail/controller.dart
浏览文件 @
ea72baed
...
@@ -5,7 +5,7 @@ class BookDetailController extends GetxController with GetSingleTickerProviderSt
...
@@ -5,7 +5,7 @@ class BookDetailController extends GetxController with GetSingleTickerProviderSt
final
String
bookId
;
final
String
bookId
;
BookDetailController
(
this
.
bookId
);
BookDetailController
(
this
.
bookId
);
late
TabController
tabController
;
final
PageController
pageController
=
PageController
(
initialPage:
0
);
final
PageController
pageController
=
PageController
(
initialPage:
0
);
List
<
Widget
>
tabs
=
[
List
<
Widget
>
tabs
=
[
const
Tab
(
text:
'目录'
,),
const
Tab
(
text:
'目录'
,),
...
@@ -13,6 +13,7 @@ class BookDetailController extends GetxController with GetSingleTickerProviderSt
...
@@ -13,6 +13,7 @@ class BookDetailController extends GetxController with GetSingleTickerProviderSt
const
Tab
(
text:
'简介'
,),
const
Tab
(
text:
'简介'
,),
const
Tab
(
text:
'本书信息'
,),
const
Tab
(
text:
'本书信息'
,),
];
];
late
TabController
tabController
=
TabController
(
length:
tabs
.
length
,
vsync:
this
);
num
currentChapterId
=
0
;
num
currentChapterId
=
0
;
...
@@ -24,7 +25,6 @@ class BookDetailController extends GetxController with GetSingleTickerProviderSt
...
@@ -24,7 +25,6 @@ class BookDetailController extends GetxController with GetSingleTickerProviderSt
@override
@override
void
onInit
()
{
void
onInit
()
{
tabController
=
TabController
(
length:
tabs
.
length
,
vsync:
this
);
super
.
onInit
();
super
.
onInit
();
}
}
...
@@ -50,25 +50,60 @@ class BookDetailController extends GetxController with GetSingleTickerProviderSt
...
@@ -50,25 +50,60 @@ class BookDetailController extends GetxController with GetSingleTickerProviderSt
}
}
}
}
/// 设置当前读的章节id
void
writeCurrentReadChapterIdToData
(
List
<
ChapterModel
>
data
)
{
void
setCurrentReadChapterId
(){
for
(
ChapterModel
cModel
in
data
){
for
(
ChapterModel
chapterModel
in
chapters
){
writeCurrentReadChapterIdToData
(
chapterModel
);
}
}
void
writeCurrentReadChapterIdToData
(
ChapterModel
chapterModel
){
for
(
ChapterModel
cModel
in
chapterModel
.
children
!){
cModel
.
currentRead
=
false
;
cModel
.
currentRead
=
false
;
if
(
cModel
.
id
==
currentChapterId
){
if
(
cModel
.
id
==
currentChapterId
){
cModel
.
currentRead
=
true
;
cModel
.
currentRead
=
true
;
cModel
.
selected
=
true
;
cModel
.
selected
=
true
;
chapterModel
.
selected
=
true
;
}
}
writeCurrentReadChapterIdToData
(
chapterModel
);
else
{
writeCurrentReadChapterIdToData
(
cModel
.
children
!);
}
}
ChapterModel
?
tModel
=
findChapterById
(
chapters
,
currentChapterId
);
if
(
tModel
!=
null
){
updateParentsStatus
(
chapters
,
tModel
!);
}
}
ChapterModel
?
findChapterById
(
List
<
ChapterModel
>
data
,
num
id
){
for
(
ChapterModel
cModel
in
data
){
if
(
cModel
.
id
==
id
){
return
cModel
;
}
}
ChapterModel
?
tModel
=
findChapterById
(
cModel
.
children
!,
id
);
if
(
tModel
!=
null
){
return
tModel
;
}
}
}
return
null
;
}
void
updateParentsStatus
(
List
<
ChapterModel
>
data
,
ChapterModel
model
)
{
ChapterModel
?
parentNode
=
findParentChapter
(
data
,
model
);
while
(
parentNode
!=
null
)
{
parentNode
.
selected
=
true
;
parentNode
=
findParentChapter
(
data
,
parentNode
);
}
}
ChapterModel
?
findParentChapter
(
List
<
ChapterModel
>
data
,
ChapterModel
model
){
for
(
ChapterModel
tModel
in
data
){
if
(
tModel
.
id
==
model
.
pid
){
return
tModel
;
}
ChapterModel
?
cModel
=
findParentChapter
(
tModel
.
children
!,
model
);
if
(
cModel
!=
null
)
{
return
cModel
;
}
}
return
null
;
}
/// 写入特定数据
/// 写入特定数据
...
@@ -89,7 +124,7 @@ class BookDetailController extends GetxController with GetSingleTickerProviderSt
...
@@ -89,7 +124,7 @@ class BookDetailController extends GetxController with GetSingleTickerProviderSt
writeData
(
chapters
,
result
);
writeData
(
chapters
,
result
);
chapters
=
result
;
chapters
=
result
;
setCurrentReadChapterId
(
);
writeCurrentReadChapterIdToData
(
chapters
);
update
();
update
();
}
}
...
...
lib/pages/book_detail/view.dart
浏览文件 @
ea72baed
...
@@ -118,6 +118,7 @@ class _BookDetailPageState extends State<BookDetailPage> with SingleTickerProvid
...
@@ -118,6 +118,7 @@ class _BookDetailPageState extends State<BookDetailPage> with SingleTickerProvid
controller
.
getChapters
();
controller
.
getChapters
();
// controller.setCurrentReadChapterId(backModel!.chapterId);
// controller.setCurrentReadChapterId(backModel!.chapterId);
controller
.
currentChapterId
=
int
.
parse
(
backModel
!.
chapterId
);
controller
.
currentChapterId
=
int
.
parse
(
backModel
!.
chapterId
);
controller
.
getBookDetails
();
}
}
}
}
},
},
...
@@ -217,6 +218,7 @@ class _BookDetailPageState extends State<BookDetailPage> with SingleTickerProvid
...
@@ -217,6 +218,7 @@ class _BookDetailPageState extends State<BookDetailPage> with SingleTickerProvid
if
(
backModel
!.
back
==
true
){
if
(
backModel
!.
back
==
true
){
controller
.
getChapters
();
controller
.
getChapters
();
controller
.
currentChapterId
=
int
.
parse
(
backModel
!.
chapterId
);
controller
.
currentChapterId
=
int
.
parse
(
backModel
!.
chapterId
);
controller
.
getBookDetails
();
// controller.setCurrentReadChapterId(backModel!.chapterId);
// controller.setCurrentReadChapterId(backModel!.chapterId);
}
}
}
}
...
@@ -249,6 +251,7 @@ class _BookDetailPageState extends State<BookDetailPage> with SingleTickerProvid
...
@@ -249,6 +251,7 @@ class _BookDetailPageState extends State<BookDetailPage> with SingleTickerProvid
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
);
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
(
backModel
!.
back
==
true
){
if
(
backModel
!.
back
==
true
){
controller
.
getChapters
();
controller
.
getChapters
();
controller
.
getBookDetails
();
controller
.
currentChapterId
=
int
.
parse
(
backModel
!.
chapterId
);
controller
.
currentChapterId
=
int
.
parse
(
backModel
!.
chapterId
);
// controller.setCurrentReadChapterId(backModel!.chapterId);
// controller.setCurrentReadChapterId(backModel!.chapterId);
}
}
...
@@ -263,6 +266,7 @@ class _BookDetailPageState extends State<BookDetailPage> with SingleTickerProvid
...
@@ -263,6 +266,7 @@ class _BookDetailPageState extends State<BookDetailPage> with SingleTickerProvid
if
(
backModel
!.
back
==
true
){
if
(
backModel
!.
back
==
true
){
controller
.
getChapters
();
controller
.
getChapters
();
controller
.
currentChapterId
=
int
.
parse
(
backModel
!.
chapterId
);
controller
.
currentChapterId
=
int
.
parse
(
backModel
!.
chapterId
);
controller
.
getBookDetails
();
// controller.setCurrentReadChapterId(backModel!.chapterId);
// controller.setCurrentReadChapterId(backModel!.chapterId);
}
}
...
...
lib/pages/login/controller.dart
浏览文件 @
ea72baed
...
@@ -88,7 +88,7 @@ class LoginController extends GetxController {
...
@@ -88,7 +88,7 @@ class LoginController extends GetxController {
});
});
/// 测试账号
/// 测试账号
if
(
kDebugMode
)
{
if
(
kDebugMode
)
{
phoneInput
.
text
=
'1
3521054068
'
;
phoneInput
.
text
=
'1
8810760819
'
;
passwordInput
.
text
=
'12345678'
;
passwordInput
.
text
=
'12345678'
;
// phoneInput.text = '17311837355';
// phoneInput.text = '17311837355';
// passwordInput.text = '12345678';
// passwordInput.text = '12345678';
...
@@ -151,9 +151,8 @@ class LoginController extends GetxController {
...
@@ -151,9 +151,8 @@ class LoginController extends GetxController {
// UserStore.to.profile(),
// UserStore.to.profile(),
// ]);
// ]);
if
(!
context
.
mounted
)
return
;
if
(
context
.
mounted
){
if
(
context
.
canPop
()){
context
.
goNamed
(
Routes
.
main
);
context
.
pop
();
}
else
{
}
else
{
context
.
goNamed
(
Routes
.
main
);
context
.
goNamed
(
Routes
.
main
);
}
}
...
...
lib/pages/read_web/controller.dart
浏览文件 @
ea72baed
...
@@ -157,12 +157,13 @@ class ReadController extends FullLifeCycleController with GetSingleTickerProvide
...
@@ -157,12 +157,13 @@ class ReadController extends FullLifeCycleController with GetSingleTickerProvide
update
();
update
();
}
}
// 设置 chapterId 和 chapterName
// // 设置 chapterId 和 chapterName
void
setChapterInfo
({
required
String
id
,
required
String
name
}){
// void setChapterInfo({required String id,required String name}){
chapterId
=
id
;
// chapterId = id;
chapterName
=
name
;
// chapterName = name;
update
();
// writeCurrentReadChapterIdToData(chapters);
}
// update();
// }
void
setShow
(
bool
value
)
{
void
setShow
(
bool
value
)
{
_show
=
!
value
;
_show
=
!
value
;
update
();
update
();
...
@@ -180,6 +181,7 @@ class ReadController extends FullLifeCycleController with GetSingleTickerProvide
...
@@ -180,6 +181,7 @@ class ReadController extends FullLifeCycleController with GetSingleTickerProvide
void
selectChapter
(
ChapterModel
model
)
{
void
selectChapter
(
ChapterModel
model
)
{
chapterName
=
model
.
name
??
''
;
chapterName
=
model
.
name
??
''
;
chapterId
=
model
.
id
.
toString
();
chapterId
=
model
.
id
.
toString
();
writeCurrentReadChapterIdToData
(
chapters
);
update
();
update
();
}
}
...
@@ -455,8 +457,21 @@ class ReadController extends FullLifeCycleController with GetSingleTickerProvide
...
@@ -455,8 +457,21 @@ class ReadController extends FullLifeCycleController with GetSingleTickerProvide
// 图片链接数组
// 图片链接数组
List
<
String
>
images
=
[];
List
<
String
>
images
=
[];
final
status
=
await
Tools
.
checkCurrentNetStatus
();
final
status
=
await
Tools
.
checkCurrentNetStatus
();
if
(
chatType
==
0
){
if
(
contentInput
.
text
.
isEmpty
&&
discussInputImages
.
isEmpty
){
Toast
.
show
(
'话题必须填写内容或选择图片'
);
return
false
;
}
}
else
if
(
chatType
==
1
){
if
(
contentInput
.
text
.
isEmpty
&&
discussInputImages
.
isEmpty
&&
discussInputAudios
.
isEmpty
){
Toast
.
show
(
'笔记必须填写内容或选择图片或音频'
);
}
return
false
;
}
// 有网情况下 先直传oss 获取到url
// 有网情况下 先直传oss 获取到url
if
(
status
){
if
(
status
){
CustomToast
.
loading
();
CustomToast
.
loading
();
...
@@ -841,9 +856,62 @@ class ReadController extends FullLifeCycleController with GetSingleTickerProvide
...
@@ -841,9 +856,62 @@ class ReadController extends FullLifeCycleController with GetSingleTickerProvide
/// 获取目录信息
/// 获取目录信息
void
_getChapters
()
async
{
void
_getChapters
()
async
{
chapters
=
await
LibraryAPI
.
chapters
(
bookId:
bookId
);
chapters
=
await
LibraryAPI
.
chapters
(
bookId:
bookId
);
writeCurrentReadChapterIdToData
(
chapters
);
update
();
update
();
}
}
void
writeCurrentReadChapterIdToData
(
List
<
ChapterModel
>
data
)
{
for
(
ChapterModel
cModel
in
data
){
cModel
.
currentRead
=
false
;
if
(
cModel
.
id
==
int
.
parse
(
chapterId
)){
cModel
.
currentRead
=
true
;
cModel
.
selected
=
true
;
}
else
{
writeCurrentReadChapterIdToData
(
cModel
.
children
!);
}
}
ChapterModel
?
tModel
=
findChapterById
(
chapters
,
int
.
parse
(
chapterId
));
if
(
tModel
!=
null
){
updateParentsStatus
(
chapters
,
tModel
!);
}
}
ChapterModel
?
findChapterById
(
List
<
ChapterModel
>
data
,
num
id
){
for
(
ChapterModel
cModel
in
data
){
if
(
cModel
.
id
==
id
){
return
cModel
;
}
ChapterModel
?
tModel
=
findChapterById
(
cModel
.
children
!,
id
);
if
(
tModel
!=
null
){
return
tModel
;
}
}
return
null
;
}
void
updateParentsStatus
(
List
<
ChapterModel
>
data
,
ChapterModel
model
)
{
ChapterModel
?
parentNode
=
findParentChapter
(
data
,
model
);
while
(
parentNode
!=
null
)
{
parentNode
.
selected
=
true
;
parentNode
=
findParentChapter
(
data
,
parentNode
);
}
}
ChapterModel
?
findParentChapter
(
List
<
ChapterModel
>
data
,
ChapterModel
model
){
for
(
ChapterModel
tModel
in
data
){
if
(
tModel
.
id
==
model
.
pid
){
return
tModel
;
}
ChapterModel
?
cModel
=
findParentChapter
(
tModel
.
children
!,
model
);
if
(
cModel
!=
null
)
{
return
cModel
;
}
}
return
null
;
}
/// 添加阅读时长
/// 添加阅读时长
void
_addReadTime
({
required
type
})
async
{
void
_addReadTime
({
required
type
})
async
{
...
...
lib/pages/read_web/view.dart
浏览文件 @
ea72baed
...
@@ -27,16 +27,16 @@ class _ReadPageState extends State<ReadPage> {
...
@@ -27,16 +27,16 @@ class _ReadPageState extends State<ReadPage> {
}
}
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
PopBackModel
backModel
=
PopBackModel
(
chapterId:
widget
.
chapterId
,
back:
true
);
return
GetBuilder
(
return
WillPopScope
(
init:
ReadController
(
bookId:
widget
.
bookId
,
chapterId:
widget
.
chapterId
,
chapterName:
widget
.
chapterName
,
bookDetailModel:
widget
.
bookDetailModel
,
noteId:
widget
.
noteId
),
builder:
(
readController
)
=>
WillPopScope
(
onWillPop:
()
async
{
onWillPop:
()
async
{
PopBackModel
backModel
=
PopBackModel
(
chapterId:
readController
.
chapterId
,
back:
true
,
chapterName:
readController
.
chapterId
);
context
.
pop
(
backModel
);
context
.
pop
(
backModel
);
CustomToast
.
dismiss
();
CustomToast
.
dismiss
();
return
false
;
return
false
;
},
},
child:
GetBuilder
<
ReadController
>(
child:
Scaffold
(
init:
ReadController
(
bookId:
widget
.
bookId
,
chapterId:
widget
.
chapterId
,
chapterName:
widget
.
chapterName
,
bookDetailModel:
widget
.
bookDetailModel
,
noteId:
widget
.
noteId
),
builder:
(
readController
)
=>
Scaffold
(
appBar:
CustomAppBar
(
appBar:
CustomAppBar
(
titleSpacing:
0
,
titleSpacing:
0
,
title:
Align
(
title:
Align
(
...
@@ -200,7 +200,9 @@ class _ReadPageState extends State<ReadPage> {
...
@@ -200,7 +200,9 @@ class _ReadPageState extends State<ReadPage> {
controller
.
addJavaScriptHandler
(
handlerName:
'loadChapterCallBack'
,
callback:
(
args
){
controller
.
addJavaScriptHandler
(
handlerName:
'loadChapterCallBack'
,
callback:
(
args
){
String
chapterId
=
args
.
first
[
0
].
toString
();
String
chapterId
=
args
.
first
[
0
].
toString
();
String
chapterName
=
args
.
first
[
1
].
toString
();
String
chapterName
=
args
.
first
[
1
].
toString
();
readController
.
setChapterInfo
(
id:
chapterId
,
name:
chapterName
??
''
);
ChapterModel
chapterModel
=
ChapterModel
(
id:
int
.
parse
(
chapterId
),
name:
chapterName
);
// readController.setChapterInfo(id: chapterId, name: chapterName ?? '');
readController
.
selectChapter
(
chapterModel
);
Console
.
log
(
'监听 上一节 下一节------------------------------------------------
$args
'
);
Console
.
log
(
'监听 上一节 下一节------------------------------------------------
$args
'
);
});
});
...
@@ -232,6 +234,17 @@ class _ReadPageState extends State<ReadPage> {
...
@@ -232,6 +234,17 @@ class _ReadPageState extends State<ReadPage> {
Console
.
log
(
'监听画廊 扩展于都---------------给页面传参---------------------------------
$params
'
);
Console
.
log
(
'监听画廊 扩展于都---------------给页面传参---------------------------------
$params
'
);
context
.
pushNamed
(
Routes
.
readInfo
,
queryParameters:
params
);
context
.
pushNamed
(
Routes
.
readInfo
,
queryParameters:
params
);
});
});
// 图片预览
controller
.
addJavaScriptHandler
(
handlerName:
'scaleImageCallback'
,
callback:
(
args
){
String
url
=
args
.
first
[
0
].
toString
();
String
title
=
args
.
first
[
1
].
toString
();
Map
<
String
,
String
>
params
=
{
'url'
:
url
,
'title'
:
title
,
};
Console
.
log
(
'监听图片预览---------------给页面传参---------------------------------
$params
'
);
context
.
pushNamed
(
Routes
.
scaleImage
,
queryParameters:
params
);
});
/// 离线需要参数
/// 离线需要参数
...
@@ -409,6 +422,7 @@ class _ReadPageState extends State<ReadPage> {
...
@@ -409,6 +422,7 @@ class _ReadPageState extends State<ReadPage> {
controller
.
chooseTool
(
model
);
controller
.
chooseTool
(
model
);
// 选择了新的章节 刷新 webview
// 选择了新的章节 刷新 webview
controller
.
webViewController
.
reload
();
controller
.
webViewController
.
reload
();
// controller.setCurrentReadChapterId();
},
},
);
);
}
}
...
...
lib/pages/read_web/widgets/discuss.dart
浏览文件 @
ea72baed
...
@@ -101,11 +101,12 @@ class _ReadDiscussPageState extends State<ReadDiscussPage> {
...
@@ -101,11 +101,12 @@ class _ReadDiscussPageState extends State<ReadDiscussPage> {
searchALlResults:
controller
.
searchALlResults
,
searchALlResults:
controller
.
searchALlResults
,
),
),
)):
)):
controller
.
showSearch
?
const
SizedBox
():
BuildBook
(
bookDetailModel:
widget
.
bookDetailModel
,),
Expanded
(
child:
Stack
(
controller
.
showSearch
?
const
SizedBox
():
Expanded
(
child:
Stack
(
children:
[
children:
[
CustomPullScrollView
(
Column
(
children:
[
BuildBook
(
bookDetailModel:
widget
.
bookDetailModel
,),
Expanded
(
child:
CustomPullScrollView
(
controller:
controller
.
refreshController
,
controller:
controller
.
refreshController
,
onRefresh:
controller
.
onRefresh
,
onRefresh:
controller
.
onRefresh
,
onLoading:
controller
.
onLoading
,
onLoading:
controller
.
onLoading
,
...
@@ -123,15 +124,31 @@ class _ReadDiscussPageState extends State<ReadDiscussPage> {
...
@@ -123,15 +124,31 @@ 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
(
bottom:
MediaQuery
.
of
(
context
).
viewInsets
.
bottom
-
69
,
bottom:
-
69
,
left:
0
,
left:
0
,
right:
0
,
right:
0
,
top:
0
,
child:
GestureDetector
(
onTap:
(){
controller
.
setShow
();
},
child:
Container
(
// color: Colors.white,
color:
const
Color
(
0xFF000000
).
withOpacity
(
0.5
),
child:
SingleChildScrollView
(
reverse:
true
,
child:
GestureDetector
(
behavior:
HitTestBehavior
.
opaque
,
onTap:
(){},
child:
Container
(
child:
Container
(
color:
Colors
.
white
,
color:
Colors
.
white
,
padding:
EdgeInsets
.
only
(
bottom:
MediaQuery
.
of
(
context
).
viewInsets
.
bottom
),
child:
Padding
(
child:
Padding
(
padding:
const
EdgeInsets
.
all
(
8.0
),
padding:
const
EdgeInsets
.
all
(
8.0
),
child:
Row
(
child:
Row
(
...
@@ -177,11 +194,13 @@ class _ReadDiscussPageState extends State<ReadDiscussPage> {
...
@@ -177,11 +194,13 @@ class _ReadDiscussPageState extends State<ReadDiscussPage> {
),
),
),
),
),
),
),
),
)
)
],
),
)
)
)
],
),)
],
],
),
),
),
),
...
...
lib/pages/read_web/widgets/item.dart
浏览文件 @
ea72baed
...
@@ -100,6 +100,7 @@ class _BuildItemState extends State<BuildItem> {
...
@@ -100,6 +100,7 @@ class _BuildItemState extends State<BuildItem> {
onTap:
(){
onTap:
(){
if
(
chapterModel
.
children
!.
isEmpty
){
if
(
chapterModel
.
children
!.
isEmpty
){
widget
.
onTapChapter
(
chapterModel
);
widget
.
onTapChapter
(
chapterModel
);
chapterModel
.
currentRead
=
true
;
}
}
else
{
else
{
setState
(()
{
setState
(()
{
...
@@ -130,7 +131,7 @@ class _BuildItemState extends State<BuildItem> {
...
@@ -130,7 +131,7 @@ class _BuildItemState extends State<BuildItem> {
Row
(
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
children:
[
Text
(
chapterModel
.
name
??
''
,
style:
TextStyle
(
fontSize:
14
.
w
,
color:
chapterModel
.
seen
==
0
?
Colours
.
c3
:
Colours
.
c9
,
fontWeight:
Fonts
.
medium
,
height:
2
),),
Text
(
chapterModel
.
name
??
''
,
style:
TextStyle
(
fontSize:
14
.
w
,
color:
chapterModel
.
currentRead
?
AppTheme
.
primary
:
chapterModel
.
seen
==
0
?
Colours
.
c3
:
Colours
.
c9
,
fontWeight:
Fonts
.
medium
,
height:
2
),),
Gaps
.
hGaps5
,
Gaps
.
hGaps5
,
chapterModel
.
isReading
==
1
?
Container
(
chapterModel
.
isReading
==
1
?
Container
(
margin:
const
EdgeInsets
.
fromLTRB
(
0
,
6
,
0
,
0
),
margin:
const
EdgeInsets
.
fromLTRB
(
0
,
6
,
0
,
0
),
...
...
lib/pages/scale_image/index.dart
0 → 100644
浏览文件 @
ea72baed
library
scale_image
;
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
lib/pages/scale_image/view.dart
0 → 100644
浏览文件 @
ea72baed
part of
scale_image
;
class
ScaleImagePage
extends
StatefulWidget
{
final
Map
<
String
,
String
>
params
;
const
ScaleImagePage
({
Key
?
key
,
required
this
.
params
})
:
super
(
key:
key
);
@override
State
<
ScaleImagePage
>
createState
()
=>
_ScaleImagePageState
();
}
class
_ScaleImagePageState
extends
State
<
ScaleImagePage
>
{
@override
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
appBar:
AppBar
(
title:
Text
(
'
${widget.params['title']}
'
),
),
body:
InAppWebView
(
initialUrlRequest:
URLRequest
(
url:
WebUri
.
uri
(
Uri
.
parse
(
kScaleImage
))
),
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}
"
);
},
)
);
}
}
lib/routes/index.dart
浏览文件 @
ea72baed
...
@@ -56,6 +56,7 @@ import '../pages/bai_dict/index.dart';
...
@@ -56,6 +56,7 @@ import '../pages/bai_dict/index.dart';
import
'../pages/bai_ke/index.dart'
;
import
'../pages/bai_ke/index.dart'
;
import
'../pages/image_view/index.dart'
;
import
'../pages/image_view/index.dart'
;
import
'../pages/read_web/index.dart'
;
import
'../pages/read_web/index.dart'
;
import
'../pages/scale_image/index.dart'
;
import
'../pages/user_edit_note/index.dart'
;
import
'../pages/user_edit_note/index.dart'
;
import
'../pages/user_order/index.dart'
;
import
'../pages/user_order/index.dart'
;
import
'../pages/user_order_cancel_detail/index.dart'
;
import
'../pages/user_order_cancel_detail/index.dart'
;
...
...
lib/routes/routes.dart
浏览文件 @
ea72baed
...
@@ -13,6 +13,7 @@ abstract class Routes {
...
@@ -13,6 +13,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
readInfo
=
'read_info'
;
static
const
scaleImage
=
'scale_image'
;
// 支付界面
// 支付界面
static
const
bookPay
=
'book_pay'
;
static
const
bookPay
=
'book_pay'
;
...
@@ -714,6 +715,17 @@ abstract class Routes {
...
@@ -714,6 +715,17 @@ abstract class Routes {
)
)
)
)
),
),
GoRoute
(
// 画廊 扩展阅读
path:
'/
$scaleImage
'
,
name:
scaleImage
,
pageBuilder:
(
context
,
state
)
=>
CupertinoPage
(
name:
state
.
uri
.
toString
(),
key:
state
.
pageKey
,
child:
ScaleImagePage
(
params:
state
.
uri
.
queryParameters
,
)
)
),
GoRoute
(
// 图片预览
GoRoute
(
// 图片预览
path:
'/
$imageView
'
,
path:
'/
$imageView
'
,
name:
imageView
,
name:
imageView
,
...
...
lib/utils/constants.dart
浏览文件 @
ea72baed
...
@@ -2,8 +2,8 @@ part of utils;
...
@@ -2,8 +2,8 @@ part of utils;
// 服务器地址
// 服务器地址
// const String kServerUrl = 'http://192.168.11.88:81';
// const String kServerUrl = 'http://192.168.11.88:81';
const
String
kServerUrl
=
'http://8.141.148.247:7421'
;
//
const String kServerUrl = 'http://8.141.148.247:7421';
//
const String kServerUrl = 'http://1507.superge.cn:81';
const
String
kServerUrl
=
'http://1507.superge.cn:81'
;
const
String
kLocalToken
=
'local_token'
;
const
String
kLocalToken
=
'local_token'
;
const
String
kLocalAccessToken
=
'local_access_token'
;
const
String
kLocalAccessToken
=
'local_access_token'
;
const
String
kLocalAccount
=
'local_account'
;
const
String
kLocalAccount
=
'local_account'
;
...
@@ -18,17 +18,18 @@ const String kUserPriAgreement = '/html/agreement/pri_agreement.html';
...
@@ -18,17 +18,18 @@ const String kUserPriAgreement = '/html/agreement/pri_agreement.html';
const
String
kUserRechargeAgreement
=
'/html/agreement/rec_agreement.html'
;
const
String
kUserRechargeAgreement
=
'/html/agreement/rec_agreement.html'
;
// 错题详情页 html
// 错题详情页 html
const
String
kUserWrongDes
=
'
$kServerUrl
/html/app
/evaluating_wrong.html'
;
const
String
kUserWrongDes
=
'
http://150.158.138.40:9200
/evaluating_wrong.html'
;
// 阅读页 html
// 阅读页 html
const
String
kReadTestUnderLineBook
=
'http://150.158.138.40:9200/read-unline.html'
;
const
String
kReadTestUnderLineBook
=
'http://150.158.138.40:9200/read-unline.html'
;
const
String
kReadBook
=
'
$kServerUrl
/html/app
/read.html'
;
const
String
kReadBook
=
'
http://150.158.138.40:9200
/read.html'
;
// 答题页
// 答题页
const
String
kAnswer
=
'
$kServerUrl
/html/app
/evaluating.html'
;
const
String
kAnswer
=
'
http://150.158.138.40:9200
/evaluating.html'
;
// 答题结果页
// 答题结果页
const
String
kAnswerResult
=
'
$kServerUrl
/html/app/evaluating_result.html'
;
const
String
kAnswerResult
=
'
$kServerUrl
/html/app/evaluating_result.html'
;
// 画廊 扩展阅读
// 画廊 扩展阅读
const
String
kReadInfo
=
'
$kServerUrl
/html/app/read_info.html'
;
const
String
kReadInfo
=
'http://150.158.138.40:9200/read_info.html'
;
// 阅读页 图片预览
const
String
kScaleImage
=
'http://150.158.138.40:9200/read_img.html'
;
abstract
class
C
{
abstract
class
C
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论