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

Merge branch 'sim' into 'test'

# Conflicts: # lib/utils/constants.dart
......@@ -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);
......
......@@ -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;
}
......@@ -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 = 'https://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 = '$kHtmlBaseServer/evaluating_wrong.html';
const String kUserWrongDes = '$kServerUrl/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 = '$kHtmlBaseServer/evaluating.html';
const String kAnswer = '$kServerUrl/html/app/evaluating.html';
// 答题结果页
const String kAnswerResult = '$kHtmlBaseServer/evaluating_result.html';
const String kAnswerResult = '$kServerUrl/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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论