Merge branch 'dev_feature' into dev
ui调整 # Conflicts: # ln_jq_app/lib/pages/b_page/reservation/controller.dart # ln_jq_app/lib/pages/b_page/site/controller.dart # ln_jq_app/lib/pages/b_page/site/view.dart # ln_jq_app/lib/pages/c_page/mine/view.dart # ln_jq_app/lib/pages/c_page/reservation/controller.dart # ln_jq_app/lib/pages/c_page/reservation/view.dart # ln_jq_app/lib/pages/login/view.dart
This commit is contained in:
@@ -1,22 +1,25 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:getx_scaffold/common/index.dart';
|
||||
import 'package:getx_scaffold/getx_scaffold.dart';
|
||||
import 'package:ln_jq_app/common/login_util.dart';
|
||||
import 'package:ln_jq_app/pages/b_page/base_widgets/controller.dart';
|
||||
import 'package:ln_jq_app/pages/b_page/reservation/view.dart';
|
||||
import 'package:ln_jq_app/pages/b_page/site/view.dart';
|
||||
|
||||
class B_BaseWidgetsPage extends GetView<B_BaseWidgetsController> {
|
||||
B_BaseWidgetsPage({super.key});
|
||||
B_BaseWidgetsPage({super.key});
|
||||
|
||||
final PageController _pageController = PageController();
|
||||
|
||||
// 主视图
|
||||
Widget _buildView() {
|
||||
return PageView(
|
||||
controller: _pageController,
|
||||
physics: const NeverScrollableScrollPhysics(), // 禁止滑动
|
||||
onPageChanged: (index) {
|
||||
jumpTabAndPage(index);
|
||||
},
|
||||
children: _buildPages(), // 页面的列表
|
||||
children: _buildPages(),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -25,33 +28,59 @@ class B_BaseWidgetsPage extends GetView<B_BaseWidgetsController> {
|
||||
controller.updateUi(); // 更新 UI
|
||||
_pageController.jumpToPage(controller.pageIndex);
|
||||
}
|
||||
|
||||
// 对应的页面
|
||||
List<Widget> _buildPages() {
|
||||
return [
|
||||
SitePage(),
|
||||
ReservationPage(),
|
||||
];
|
||||
return [SitePage(), ReservationPage()];
|
||||
}
|
||||
|
||||
//导航栏
|
||||
// 自定义导航栏 (悬浮胶囊样式)
|
||||
Widget _buildNavigationBar() {
|
||||
return NavigationX(
|
||||
currentIndex: controller.pageIndex, // 当前选中的tab索引
|
||||
onTap: (index) {
|
||||
jumpTabAndPage(index);
|
||||
}, // 切换tab事件
|
||||
items: [
|
||||
NavigationItemModel(
|
||||
label: '加氢预约',
|
||||
icon: AntdIcon.orderedlist,
|
||||
selectedIcon: AntdIcon.calendar_fill,
|
||||
return SafeArea(
|
||||
child: Container(
|
||||
height: 50.h,
|
||||
margin: const EdgeInsets.fromLTRB(24, 0, 24, 10), // 悬浮边距
|
||||
decoration: BoxDecoration(
|
||||
color: Color.fromRGBO(240, 244, 247, 1), // 浅灰色背景
|
||||
borderRadius: BorderRadius.circular(30),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.05),
|
||||
blurRadius: 10,
|
||||
offset: const Offset(0, 5),
|
||||
),
|
||||
],
|
||||
),
|
||||
NavigationItemModel(
|
||||
label: '站点信息',
|
||||
icon: AntdIcon.car,
|
||||
selectedIcon: AntdIcon.car_fill,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
_buildNavItem(0, "ic_h2_select@2x", "ic_h2@2x"),
|
||||
_buildNavItem(1, "ic_h2_my@2x", "ic_h2_my_select@2x"),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// 构建单个导航项
|
||||
Widget _buildNavItem(int index, String icon, String selectedIcon) {
|
||||
bool isSelected = controller.pageIndex == index;
|
||||
return GestureDetector(
|
||||
onTap: () => jumpTabAndPage(index),
|
||||
behavior: HitTestBehavior.opaque,
|
||||
child: AnimatedContainer(
|
||||
duration: const Duration(milliseconds: 200),
|
||||
padding: EdgeInsets.symmetric(horizontal: 50.w, vertical: 8),
|
||||
decoration: BoxDecoration(
|
||||
color: isSelected ? const Color(0xFF006633) : Colors.transparent, // 选中时的深绿色背景
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
),
|
||||
child: SizedBox(
|
||||
height: 24,
|
||||
width: 24,
|
||||
child: LoginUtil.getAssImg(isSelected ? selectedIcon : icon),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user