Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
book-app
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
book-app
Commits
eff851b5
提交
eff851b5
authored
4月 08, 2024
作者:
岳维路
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'sim' into 'test'
# Conflicts: # lib/utils/constants.dart
上级
9835a375
4edddaf3
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
74 行增加
和
72 行删除
+74
-72
controller.dart
lib/pages/library/controller.dart
+8
-8
view.dart
lib/pages/library/view.dart
+57
-57
constants.dart
lib/utils/constants.dart
+9
-7
没有找到文件。
lib/pages/library/controller.dart
浏览文件 @
eff851b5
...
...
@@ -21,7 +21,7 @@ class LibraryController extends GetxController with GetTickerProviderStateMixin{
late
FilterModel
selectedDown
=
FilterModel
();
late
TabController
tabController
=
TabController
(
length:
categories
.
length
,
vsync:
this
);
//
late TabController tabController = TabController(length:categories.length, vsync: this);
final
EasyRefreshController
refreshController
=
EasyRefreshController
(
controlFinishLoad:
true
,
...
...
@@ -110,7 +110,7 @@ class LibraryController extends GetxController with GetTickerProviderStateMixin{
@override
void
onClose
()
{
tabController
.
dispose
();
//
tabController.dispose();
refreshController
.
dispose
();
super
.
onClose
();
}
...
...
@@ -147,10 +147,10 @@ class LibraryController extends GetxController with GetTickerProviderStateMixin{
/// 确定
void
sureFilter
(){
WidgetsBinding
.
instance
!.
addPostFrameCallback
((
_
)
{
tabController
.
animateTo
(
3
);
// 你想要的标签索引
});
update
();
//
WidgetsBinding.instance!.addPostFrameCallback((_) {
//
tabController.animateTo(3); // 你想要的标签索引
//
});
//
update();
for
(
FilterModel
model
in
filterCategories
){
if
(
model
.
selected
){
selectedCategory
=
model
;
...
...
@@ -206,8 +206,8 @@ class LibraryController extends GetxController with GetTickerProviderStateMixin{
void
_getTabs
()
async
{
categories
=
await
LibraryAPI
.
categories
();
tabController
.
dispose
();
tabController
=
TabController
(
length:
categories
.
length
,
vsync:
this
);
//
tabController.dispose();
//
tabController = TabController(length:categories.length, vsync: this);
filterCategories
=
categories
.
map
((
model
)
{
return
FilterModel
(
id:
model
.
categoryId
.
toString
(),
name:
model
.
name
??
''
,
selected:
model
.
selected
);
...
...
lib/pages/library/view.dart
浏览文件 @
eff851b5
...
...
@@ -175,63 +175,63 @@ class _LibraryPageState extends State<LibraryPage> {
}
PreferredSizeWidget
_buildTab
(
LibraryController
controller
){
return
PreferredSize
(
preferredSize:
Size
.
fromHeight
(
48
.
w
),
child:
Container
(
color:
Colors
.
white
,
child:
Row
(
children:
[
// TabBar放在左侧
Expanded
(
child:
TabBar
(
indicator:
BoxDecoration
(
border:
const
Border
(
bottom:
BorderSide
(
color:
Colors
.
transparent
,
width:
0.0
)),
// 将指示器的底边框颜色设置为透明
color:
const
Color
(
0xFFC02D55
).
withOpacity
(
0.08
)
),
labelStyle:
TextStyle
(
color:
AppTheme
.
primary
,
fontSize:
14
.
w
,
height:
1.5
,
fontWeight:
Fonts
.
medium
),
unselectedLabelColor:
Colours
.
c9
,
unselectedLabelStyle:
TextStyle
(
color:
Colours
.
c9
,
fontSize:
14
.
w
,
height:
1.5
),
controller:
controller
.
tabController
,
isScrollable:
true
,
tabs:
controller
.
filterCategories
.
map
((
model
){
return
Tab
(
text:
model
.
name
);
}).
toList
(),
),
),
// 筛选按钮放在右侧
GestureDetector
(
onTap:
(){
controller
.
setShow
(
controller
.
show
);
},
child:
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
.
w
),
alignment:
Alignment
.
center
,
height:
38
.
w
,
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Container
(
width:
12
.
w
,
height:
12
.
w
,
// color: Colors.red,
alignment:
Alignment
.
center
,
child:
Image
.
asset
(
'assets/images/filter.png'
,
),
),
Gaps
.
hGaps5
,
Text
(
'筛选'
,
style:
TextStyle
(
color:
Colours
.
c9
,
fontSize:
14
.
w
,
height:
1.5
),)
],
),
// width: 75,
),
)
],
),
),
);
}
//
PreferredSizeWidget _buildTab(LibraryController controller){
//
return PreferredSize(
//
preferredSize: Size.fromHeight(48.w),
//
child: Container(
//
color: Colors.white,
//
child: Row(
//
children: [
//
// TabBar放在左侧
//
Expanded(
//
child: TabBar(
//
indicator: BoxDecoration(
//
border: const Border(bottom: BorderSide(color: Colors.transparent, width: 0.0)), // 将指示器的底边框颜色设置为透明
//
color: const Color(0xFFC02D55).withOpacity(0.08)
//
),
//
labelStyle: TextStyle(color: AppTheme.primary,fontSize: 14.w,height: 1.5,fontWeight: Fonts.medium),
//
unselectedLabelColor: Colours.c9,
//
unselectedLabelStyle: TextStyle(color: Colours.c9,fontSize: 14.w,height: 1.5),
//
controller: controller.tabController,
//
isScrollable: true,
//
tabs: controller.filterCategories.map((model){
//
return Tab(text: model.name);
//
}).toList(),
//
),
//
),
//
// 筛选按钮放在右侧
//
GestureDetector(
//
onTap: (){
//
controller.setShow(controller.show);
//
},
//
child: Container(
//
padding: EdgeInsets.symmetric(horizontal: 10.w),
//
alignment: Alignment.center,
//
height: 38.w,
//
child: Row(
//
mainAxisAlignment: MainAxisAlignment.center,
//
children: [
//
Container(
//
width: 12.w,
//
height: 12.w,
//
// color: Colors.red,
//
alignment: Alignment.center,
//
child: Image.asset(
//
'assets/images/filter.png',
//
),
//
),
//
Gaps.hGaps5,
//
Text('筛选',style: TextStyle(color: Colours.c9,fontSize: 14.w,height: 1.5),)
//
],
//
),
//
// width: 75,
//
),
//
)
//
],
//
),
//
),
//
);
//
}
// @override
// bool get wantKeepAlive => true;
}
lib/utils/constants.dart
浏览文件 @
eff851b5
...
...
@@ -3,8 +3,8 @@ part of utils;
// 服务器地址
// const String kServerUrl = 'http://192.168.11.88:81';
// const String kServerUrl = 'http://8.141.148.247:7421';
const
String
kServerUrl
=
'http
://1507.superge.cn:81
'
;
const
String
kHtmlBaseServer
=
'http://150.158.138.40:9200
'
;
const
String
kServerUrl
=
'http
s://ebook-app.ezijing.com
'
;
// const String kServerUrl = 'http://1507.superge.cn:81
';
const
String
kLocalToken
=
'local_token'
;
const
String
kLocalAccessToken
=
'local_access_token'
;
const
String
kLocalAccount
=
'local_account'
;
...
...
@@ -19,19 +19,21 @@ const String kUserPriAgreement = '/html/agreement/pri_agreement.html';
const
String
kUserRechargeAgreement
=
'/html/agreement/rec_agreement.html'
;
// 错题详情页 html
const
String
kUserWrongDes
=
'
$k
HtmlBaseServer
/evaluating_wrong.html'
;
const
String
kUserWrongDes
=
'
$k
ServerUrl
/html/app
/evaluating_wrong.html'
;
// 阅读页 html
String
kReadTestUnderLineBook
=
'
$kHtmlBaseServer
/read_unline.html?t=
${DateTime.now().millisecondsSinceEpoch}
'
;
const
String
kReadBook
=
'
$kHtmlBaseServer
/read.html'
;
// 答题页
const
String
kAnswer
=
'
$k
HtmlBaseServer
/evaluating.html'
;
const
String
kAnswer
=
'
$k
ServerUrl
/html/app
/evaluating.html'
;
// 答题结果页
const
String
kAnswerResult
=
'
$k
HtmlBaseServer
/evaluating_result.html'
;
const
String
kAnswerResult
=
'
$k
ServerUrl
/html/app
/evaluating_result.html'
;
// 画廊 扩展阅读
const
String
kReadInfo
=
'
$kHtmlBaseServer
/read_info.html'
;
const
String
kReadInfo
=
'
$kServerUrl
/html/app/read_info.html'
;
// 阅读页 图片预览
const
String
kScaleImage
=
'
$kHtmlBaseServer
/read_img.html'
;
const
String
kScaleImage
=
'
$kServerUrl
/html/app/read_img.html'
;
abstract
class
C
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论