新增配件UI布局
This commit is contained in:
parent
2f207db3ec
commit
e096b50bc6
@ -1,6 +1,7 @@
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:star_lock/common/safetyVerification/safetyVerification_binding.dart';
|
import 'package:star_lock/common/safetyVerification/safetyVerification_binding.dart';
|
||||||
import 'package:star_lock/login/register/starLock_register_binding.dart';
|
import 'package:star_lock/login/register/starLock_register_binding.dart';
|
||||||
|
import 'package:star_lock/main/accessoriesList/accessoriesList_page.dart';
|
||||||
import 'package:star_lock/main/lockDetail/doorLockLog/doorLockLog_page.dart';
|
import 'package:star_lock/main/lockDetail/doorLockLog/doorLockLog_page.dart';
|
||||||
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecord/keyOperationRecord_page.dart';
|
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecord/keyOperationRecord_page.dart';
|
||||||
|
|
||||||
@ -186,7 +187,7 @@ abstract class Routers {
|
|||||||
static const starLockMain = '/StarLockMain'; // 首页
|
static const starLockMain = '/StarLockMain'; // 首页
|
||||||
static const starLockMinePage = '/StarLockMinePage'; // 我的
|
static const starLockMinePage = '/StarLockMinePage'; // 我的
|
||||||
static const selectLockTypePage = '/SelectLockTypePage'; // 选择锁类型
|
static const selectLockTypePage = '/SelectLockTypePage'; // 选择锁类型
|
||||||
static const LockMallPage = '/LockMallPage'; // 商城页面
|
static const lockMallPage = '/LockMallPage'; // 商城页面
|
||||||
static const addLockPage = '/AddLockPage'; // 选择锁类型
|
static const addLockPage = '/AddLockPage'; // 选择锁类型
|
||||||
static const nearbyLockPage = '/NearbyLockPage'; // 附近的锁
|
static const nearbyLockPage = '/NearbyLockPage'; // 附近的锁
|
||||||
static const lockAddressPage = '/LockAddressPage'; // 锁地址
|
static const lockAddressPage = '/LockAddressPage'; // 锁地址
|
||||||
@ -424,6 +425,8 @@ abstract class Routers {
|
|||||||
static const catEyeCustomModePage = '/catEyeCustomModePage'; //猫眼自定义模式
|
static const catEyeCustomModePage = '/catEyeCustomModePage'; //猫眼自定义模式
|
||||||
static const videoSlotPage = '/videoSlotPage'; //录像时段
|
static const videoSlotPage = '/videoSlotPage'; //录像时段
|
||||||
static const liveVideoPage = '/liveVideoPage'; //实时画面
|
static const liveVideoPage = '/liveVideoPage'; //实时画面
|
||||||
|
|
||||||
|
static const accessoriesListPage = '/accessoriesListPage'; //配件列表
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract class AppRouters {
|
abstract class AppRouters {
|
||||||
@ -445,7 +448,7 @@ abstract class AppRouters {
|
|||||||
page: () => const SelectLockTypePage(),
|
page: () => const SelectLockTypePage(),
|
||||||
),
|
),
|
||||||
GetPage(
|
GetPage(
|
||||||
name: Routers.LockMallPage,
|
name: Routers.lockMallPage,
|
||||||
page: () => const LockMallPage(),
|
page: () => const LockMallPage(),
|
||||||
),
|
),
|
||||||
GetPage(
|
GetPage(
|
||||||
@ -1024,5 +1027,8 @@ abstract class AppRouters {
|
|||||||
GetPage(
|
GetPage(
|
||||||
name: Routers.messageDetailPage,
|
name: Routers.messageDetailPage,
|
||||||
page: (() => const MessageDetailPage())),
|
page: (() => const MessageDetailPage())),
|
||||||
|
GetPage(
|
||||||
|
name: Routers.accessoriesListPage,
|
||||||
|
page: (() => const AccessoriesListPage()))
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,23 @@
|
|||||||
|
import 'package:star_lock/main/accessoriesList/accessoriesList_state.dart';
|
||||||
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
|
|
||||||
|
class AccessoriesListLogic extends BaseGetXController {
|
||||||
|
final AccessoriesListState state = AccessoriesListState();
|
||||||
|
|
||||||
|
@override
|
||||||
|
void onReady() {
|
||||||
|
// TODO: implement onReady
|
||||||
|
super.onReady();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void onInit() {
|
||||||
|
// TODO: implement onInit
|
||||||
|
super.onInit();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void onClose() {
|
||||||
|
// TODO: implement onClose
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,80 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
|
import 'package:fluttertoast/fluttertoast.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:star_lock/appRouters.dart';
|
||||||
|
import 'package:star_lock/main/accessoriesList/accessoriesList_logic.dart';
|
||||||
|
|
||||||
|
import '../../../app_settings/app_colors.dart';
|
||||||
|
import '../../../baseWidget.dart';
|
||||||
|
import '../../../tools/titleAppBar.dart';
|
||||||
|
|
||||||
|
class AccessoriesListPage extends StatefulWidget {
|
||||||
|
const AccessoriesListPage({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<AccessoriesListPage> createState() => _AccessoriesListPageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _AccessoriesListPageState extends State<AccessoriesListPage>
|
||||||
|
with BaseWidget {
|
||||||
|
final logic = Get.put(AccessoriesListLogic());
|
||||||
|
final state = Get.find<AccessoriesListLogic>().state;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
backgroundColor: Colors.white,
|
||||||
|
appBar: TitleAppBar(
|
||||||
|
barTitle: '选择设备类型',
|
||||||
|
haveBack: true,
|
||||||
|
backgroundColor: AppColors.mainColor),
|
||||||
|
body: ListView(
|
||||||
|
children: [
|
||||||
|
_accessoriesItem(
|
||||||
|
'images/mine/icon_mine_selectGatewayType_G2.png', "照明灯具", true),
|
||||||
|
_accessoriesItem(
|
||||||
|
'images/mine/icon_mine_selectGatewayType_G4.png', "开门器", false),
|
||||||
|
_accessoriesItem(
|
||||||
|
'images/mine/icon_mine_selectGatewayType_G2.png', "电动窗帘", true),
|
||||||
|
_accessoriesItem(
|
||||||
|
'images/mine/icon_mine_selectGatewayType_G4.png', "门窗传感器", false),
|
||||||
|
_accessoriesItem(
|
||||||
|
'images/mine/icon_mine_selectGatewayType_G2.png', "传感器", true),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
//配件列表
|
||||||
|
Widget _accessoriesItem(String iconStr, String gatewayType, bool isWhite) {
|
||||||
|
return GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
logic.showToast("该功能暂未开放");
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
color: isWhite == true ? Colors.white : AppColors.mainBackgroundColor,
|
||||||
|
width: 1.sw,
|
||||||
|
height: 140.h,
|
||||||
|
padding: EdgeInsets.all(30.w),
|
||||||
|
child: Center(
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Image.asset(
|
||||||
|
iconStr,
|
||||||
|
width: 150.w,
|
||||||
|
height: 150.w,
|
||||||
|
),
|
||||||
|
// SizedBox(width: 20.w),
|
||||||
|
Text(
|
||||||
|
gatewayType,
|
||||||
|
style: TextStyle(fontSize: 22.sp),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,6 @@
|
|||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
class AccessoriesListState {
|
||||||
|
var getLockType = 1.obs; //0-所有锁;1-门锁;2-NFC无源锁;3-挂锁;4-保险箱锁;5-车位锁;6-智能门禁;7-网关
|
||||||
|
var lockTypeImg = 'images/lockType/addLock_touchScreen.png'.obs; //不同类型锁图片更换
|
||||||
|
}
|
||||||
@ -400,7 +400,9 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
|
|
||||||
// 新增配件
|
// 新增配件
|
||||||
showWidgetArr.add(bottomItem('images/main/icon_main_addLock.png', '新增配件',
|
showWidgetArr.add(bottomItem('images/main/icon_main_addLock.png', '新增配件',
|
||||||
state.bottomBtnisUneable.value, () {}));
|
state.bottomBtnisUneable.value, () {
|
||||||
|
Navigator.pushNamed(context, Routers.accessoriesListPage);
|
||||||
|
}));
|
||||||
|
|
||||||
return showWidgetArr;
|
return showWidgetArr;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,7 +18,8 @@ class SelectLockTypePage extends StatefulWidget {
|
|||||||
State<SelectLockTypePage> createState() => _SelectLockTypePageState();
|
State<SelectLockTypePage> createState() => _SelectLockTypePageState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _SelectLockTypePageState extends State<SelectLockTypePage> with BaseWidget {
|
class _SelectLockTypePageState extends State<SelectLockTypePage>
|
||||||
|
with BaseWidget {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
@ -80,6 +81,11 @@ class _SelectLockTypePageState extends State<SelectLockTypePage> with BaseWidget
|
|||||||
// Navigator.pushNamed(context, Routers.gatewayListPage);
|
// Navigator.pushNamed(context, Routers.gatewayListPage);
|
||||||
getNearByLimits();
|
getNearByLimits();
|
||||||
}),
|
}),
|
||||||
|
lockTypeItem(
|
||||||
|
'images/lockType/lockType_gatewayLock.png', '网络摄像头', () {
|
||||||
|
// Navigator.pushNamed(context, Routers.gatewayListPage);
|
||||||
|
getNearByLimits();
|
||||||
|
}),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@ -152,7 +152,7 @@ class _StarLockMinePageState extends State<StarLockMinePage> with BaseWidget {
|
|||||||
mineItem('images/mine/icon_mine_main_shoppingcart.png', "配件商城".tr,
|
mineItem('images/mine/icon_mine_main_shoppingcart.png', "配件商城".tr,
|
||||||
() {
|
() {
|
||||||
Get.back();
|
Get.back();
|
||||||
Get.toNamed(Routers.LockMallPage);
|
Get.toNamed(Routers.lockMallPage);
|
||||||
}),
|
}),
|
||||||
mineItem('images/mine/icon_mine_main_about.png',
|
mineItem('images/mine/icon_mine_main_about.png',
|
||||||
TranslationLoader.lanKeys!.about!.tr, () {
|
TranslationLoader.lanKeys!.about!.tr, () {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user