调试转移网关、转移智能锁模块接口

This commit is contained in:
魏少阳 2023-09-22 16:06:08 +08:00
parent bdd57b242b
commit f0e55ffdb7
24 changed files with 1378 additions and 510 deletions

View File

@ -40,7 +40,7 @@
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
buildConfiguration = "Release"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"

View File

@ -18,9 +18,9 @@ import 'package:star_lock/mine/mineSet/lockUserManage/expireLockList/expireLockL
import 'package:star_lock/mine/mineSet/lockUserManage/lockUserManageList_Page.dart';
import 'package:star_lock/mine/mineSet/mineSet_page.dart';
import 'package:star_lock/mine/mineSet/transferGateway/selectGetewayList_page.dart';
import 'package:star_lock/mine/mineSet/transferSmartLock/recipientInformation_page.dart';
import 'package:star_lock/mine/mineSet/transferSmartLock/selectBranch_page.dart';
import 'package:star_lock/mine/mineSet/transferSmartLock/transferSmartLock_page.dart';
import 'package:star_lock/mine/mineSet/transferSmartLock/recipientInformation/recipientInformation_page.dart';
import 'package:star_lock/mine/mineSet/transferSmartLock/selectBranch/selectBranch_page.dart';
import 'package:star_lock/mine/mineSet/transferSmartLock/transferSmartLockList/transferSmartLock_page.dart';
import 'common/safetyVerification/safetyVerification_page.dart';
import 'login/forgetPassword/starLock_forgetPassword_page.dart';

View File

@ -0,0 +1,111 @@
class GetewayDataEntity {
int? errorCode;
String? description;
String? errorMsg;
GetewayListData? data;
GetewayDataEntity(
{this.errorCode, this.description, this.errorMsg, this.data});
GetewayDataEntity.fromJson(Map<String, dynamic> json) {
errorCode = json['errorCode'];
description = json['description'];
errorMsg = json['errorMsg'];
data = json['data'] != null ? GetewayListData.fromJson(json['data']) : null;
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['errorCode'] = errorCode;
data['description'] = description;
data['errorMsg'] = errorMsg;
if (this.data != null) {
data['data'] = this.data!.toJson();
}
return data;
}
}
class GetewayListData {
List<GetewayItemData>? list;
int? pageNo;
int? pageSize;
int? pages;
int? total;
GetewayListData({this.list, this.pageNo, this.pageSize, this.pages, this.total});
GetewayListData.fromJson(Map<String, dynamic> json) {
if (json['list'] != null) {
list = <GetewayItemData>[];
json['list'].forEach((v) {
list!.add(GetewayItemData.fromJson(v));
});
}
pageNo = json['pageNo'];
pageSize = json['pageSize'];
pages = json['pages'];
total = json['total'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
if (list != null) {
data['list'] = list!.map((v) => v.toJson()).toList();
}
data['pageNo'] = pageNo;
data['pageSize'] = pageSize;
data['pages'] = pages;
data['total'] = total;
return data;
}
}
class GetewayItemData {
String? serialNumber;
int? plugId;
String? plugName;
String? networkName;
int? lockNum;
String? plugMac;
String? networkMac;
int? isOnline;
String? plugVersion;
int? selet = 0;
GetewayItemData(
{this.serialNumber,
this.plugId,
this.plugName,
this.networkName,
this.lockNum,
this.plugMac,
this.networkMac,
this.isOnline,
this.plugVersion});
GetewayItemData.fromJson(Map<String, dynamic> json) {
serialNumber = json['serialNumber'];
plugId = json['plugId'];
plugName = json['plugName'];
networkName = json['networkName'];
lockNum = json['lockNum'];
plugMac = json['plugMac'];
networkMac = json['networkMac'];
isOnline = json['isOnline'];
plugVersion = json['plugVersion'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['serialNumber'] = serialNumber;
data['plugId'] = plugId;
data['plugName'] = plugName;
data['networkName'] = networkName;
data['lockNum'] = lockNum;
data['plugMac'] = plugMac;
data['networkMac'] = networkMac;
data['isOnline'] = isOnline;
data['plugVersion'] = plugVersion;
return data;
}
}

View File

@ -0,0 +1,45 @@
import 'package:star_lock/tools/baseGetXController.dart';
import '../../../network/api_repository.dart';
import 'selectGetewayList_state.dart';
class SelectGetewayListLogic extends BaseGetXController{
SelectGetewayListState state = SelectGetewayListState();
//
Future<void> getGetewayListData() async{
var entity = await ApiRepository.to.getGatewayListData(
pageNo: '1',
pageSize: '20'
);
if(entity.errorCode!.codeIsSuccessful){
state.getewayListData.value = entity.data!.list!;
}
}
@override
void onReady() {
// TODO: implement onReady
super.onReady();
print("onReady()");
getGetewayListData();
}
@override
void onInit() {
// TODO: implement onInit
super.onInit();
print("onInit()");
}
@override
void onClose() {
// TODO: implement onClose
super.onClose();
}
}

View File

@ -6,6 +6,10 @@ import '../../../../appRouters.dart';
import '../../../../app_settings/app_colors.dart';
import '../../../../tools/titleAppBar.dart';
import '../../../../translations/trans_lib.dart';
import '../../../tools/noData.dart';
import '../../../tools/toast.dart';
import 'selectGetewayList_entity.dart';
import 'selectGetewayList_logic.dart';
class SelectGetewayListPage extends StatefulWidget {
const SelectGetewayListPage({Key? key}) : super(key: key);
@ -15,6 +19,9 @@ class SelectGetewayListPage extends StatefulWidget {
}
class _SelectGetewayListPageState extends State<SelectGetewayListPage> {
final logic = Get.put(SelectGetewayListLogic());
final state = Get.find<SelectGetewayListLogic>().state;
@override
Widget build(BuildContext context) {
return Scaffold(
@ -25,7 +32,19 @@ class _SelectGetewayListPageState extends State<SelectGetewayListPage> {
backgroundColor: AppColors.mainColor,
actionsList: [
TextButton(
onPressed: () {},
onPressed: () {
setState(() {
for (var element in state.getewayListData.value) {
if(state.isSeletAll == true){
state.isSeletAll = false;
element.selet = 0;
}else{
state.isSeletAll = true;
element.selet = 1;
}
}
});
},
child: Text(
'全选',
style: TextStyle(color: Colors.white, fontSize: 24.sp),
@ -48,8 +67,8 @@ class _SelectGetewayListPageState extends State<SelectGetewayListPage> {
}
Widget _buildMainUI() {
return ListView.separated(
itemCount: 10,
return Obx(() => state.getewayListData.value.isNotEmpty ? ListView.separated(
itemCount: state.getewayListData.value.length,
separatorBuilder: (context, index) {
return Divider(
height: 1,
@ -59,16 +78,22 @@ class _SelectGetewayListPageState extends State<SelectGetewayListPage> {
);
},
itemBuilder: (c, index) {
return _electronicKeyItem('images/icon_lock.png', "张三",
"2023.6.21 11.15", "2023.6.21 11.15", () {
Navigator.pushNamed(context, Routers.authorizedAdminDetailPage);
GetewayItemData getewayItemData = state.getewayListData.value[index];
return _electronicKeyItem(getewayItemData, () {
setState(() {
if(getewayItemData.selet == 1){
getewayItemData.selet = 0;
}else{
getewayItemData.selet = 1;
}
});
});
});
}):const NoData());
}
Widget _electronicKeyItem(String lockTypeIcon, String lockTypeTitle,
String beginTime, String endTime, Function() action) {
Widget _electronicKeyItem(GetewayItemData getewayItemData, Function() action) {
return GestureDetector(
onTap: action,
child: Container(
color: Colors.white,
height: 80.h,
@ -81,9 +106,9 @@ class _SelectGetewayListPageState extends State<SelectGetewayListPage> {
),
GestureDetector(
child: Image.asset(
'images/icon_round_unSelet.png',
width: 16,
height: 16,
(getewayItemData.selet == 1) ? 'images/icon_round_selet.png' : 'images/icon_round_unSelet.png',
width: 30.w,
height: 30.w,
),
),
SizedBox(
@ -98,26 +123,40 @@ class _SelectGetewayListPageState extends State<SelectGetewayListPage> {
SizedBox(
width: 16.w,
),
Text(
'星锁网关',
style: TextStyle(fontSize: 24.sp),
)
Text(getewayItemData.plugName!, style: TextStyle(fontSize: 24.sp),)
],
),
),
onTap: () {},
);
}
Widget _buildNextBtn() {
return GestureDetector(
child: Container(
color: AppColors.btnDisableColor,
color: AppColors.mainColor,
width: ScreenUtil().screenWidth,
height: 64.h,
child: TextButton(
onPressed: () {
Navigator.pushNamed(context, Routers.recipientInformationPage);
onPressed: () async {
bool isCanNext = false;
var idList = [];
for (var element in state.getewayListData.value) {
if(element.selet == 1){
isCanNext = true;
idList.add(element.plugId);
}
}
if(isCanNext == false){
Toast.show(msg: "请选择锁");
return;
}
var data = await Get.toNamed(Routers.recipientInformationPage, arguments: {
"idList":idList,
"isFromType":1,
});
if(data != null) {
logic.getGetewayListData();
}
},
child: Text(
'下一步',

View File

@ -0,0 +1,11 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'selectGetewayList_entity.dart';
class SelectGetewayListState{
var getewayListData = <GetewayItemData>[].obs;
final TextEditingController searchController = TextEditingController();
bool isSeletAll = false;
}

View File

@ -0,0 +1,52 @@
class RecipientInformationEntity {
int? errorCode;
String? description;
String? errorMsg;
RecipientInformationData? data;
RecipientInformationEntity(
{this.errorCode, this.description, this.errorMsg, this.data});
RecipientInformationEntity.fromJson(Map<String, dynamic> json) {
errorCode = json['errorCode'];
description = json['description'];
errorMsg = json['errorMsg'];
data = json['data'] != null ? RecipientInformationData.fromJson(json['data']) : null;
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['errorCode'] = errorCode;
data['description'] = description;
data['errorMsg'] = errorMsg;
if (this.data != null) {
data['data'] = this.data!.toJson();
}
return data;
}
}
class RecipientInformationData {
String? uid;
String? nickname;
String? headUrl;
String? userid;
RecipientInformationData({this.uid, this.nickname, this.headUrl, this.userid});
RecipientInformationData.fromJson(Map<String, dynamic> json) {
uid = json['uid'];
nickname = json['nickname'];
headUrl = json['headUrl'];
userid = json['userid'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['uid'] = uid;
data['nickname'] = nickname;
data['headUrl'] = headUrl;
data['userid'] = userid;
return data;
}
}

View File

@ -0,0 +1,61 @@
import 'package:get/get.dart';
import 'package:star_lock/tools/baseGetXController.dart';
import '../../../../network/api_repository.dart';
import '../../../../tools/toast.dart';
import 'recipientInformation_entity.dart';
import 'recipientInformation_state.dart';
class RecipientInformationLogic extends BaseGetXController{
RecipientInformationState state = RecipientInformationState();
//
Future<void> transferLockConfirmInfoData(void Function(RecipientInformationData recipientInformationData) action) async{
var entity = await ApiRepository.to.transferLockConfirmInfoData(
receiverUserid: state.numberController.text,
type: state.type.value.toString(),
countryCode: state.countryCode.value
);
if(entity.errorCode!.codeIsSuccessful){
action(entity.data!);
}
}
//
Future<void> transferLockInfoData() async{
var entity = await ApiRepository.to.transferLockInfoData(
receiverUserid: state.numberController.text,
lockIdList: state.idList.value,
countryCode: state.countryCode.value
);
if(entity.errorCode!.codeIsSuccessful){
Get.back(result: "scuess");
}
}
@override
void onReady() {
// TODO: implement onReady
super.onReady();
print("onReady()");
}
@override
void onInit() {
// TODO: implement onInit
super.onInit();
print("onInit()");
}
@override
void onClose() {
// TODO: implement onClose
super.onClose();
}
}

View File

@ -0,0 +1,303 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:star_lock/mine/mineSet/transferSmartLock/recipientInformation/recipientInformation_logic.dart';
import 'package:star_lock/tools/submitBtn.dart';
import 'package:star_lock/tools/toast.dart';
import '../../../../../appRouters.dart';
import '../../../../../app_settings/app_colors.dart';
import '../../../../../tools/titleAppBar.dart';
import '../../../../../translations/trans_lib.dart';
import '../../../../tools/commonItem.dart';
import 'recipientInformation_entity.dart';
class RecipientInformationPage extends StatefulWidget {
const RecipientInformationPage({Key? key}) : super(key: key);
@override
State<RecipientInformationPage> createState() =>
_RecipientInformationPageState();
}
class _RecipientInformationPageState extends State<RecipientInformationPage> {
final logic = Get.put(RecipientInformationLogic());
final state = Get.find<RecipientInformationLogic>().state;
@override
Widget build(BuildContext context) {
return Scaffold(
resizeToAvoidBottomInset: false,
backgroundColor: AppColors.mainBackgroundColor,
appBar: TitleAppBar(
barTitle: TranslationLoader.lanKeys!.recipientInformation!.tr,
haveBack: true,
backgroundColor: AppColors.mainColor,
),
body: Column(
children: [
SizedBox(height: 150.h, child: _buildMainUI()),
SizedBox(height: 10.h),
_buildAccoutRow(),
_buildBottomText(),
_buildNextBtn(context),
SizedBox(height: 64.h),
Visibility(
visible: state.isFromType.value == 2 ? true : false,
child: _buildRemoveBadLockBtn()),
SizedBox(height: 64.h,)
],
),
);
}
Widget _buildMainUI() {
return Obx(() => Column(
children: [
_electronicKeyItem(state.type.value == 1 ? 'images/select_circle.png' : 'images/normal_circle.png', "个人用户", () {
setState(() {
state.type.value = 1;
});
}),
_electronicKeyItem(state.type.value == 2 ? 'images/select_circle.png' : 'images/normal_circle.png', "好房管家", () {
setState(() {
state.type.value = 2;
});
})
],
));
}
Widget _electronicKeyItem(
String leftIcon, String leftTitle, Function() action) {
return GestureDetector(
onTap: action,
child: Container(
color: Colors.white,
height: 70.h,
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(
width: 40.w,
),
GestureDetector(
child: Image.asset(
leftIcon,
width: 20.w,
height: 20.w,
),
),
SizedBox(
width: 16.w,
),
Text(
leftTitle,
style: TextStyle(fontSize: 24.sp),
)
],
),
),
);
}
Widget _buildAccoutRow() {
return Container(
// height: 60.h,
color: Colors.white,
child: Column(
children: [
Row(
children: [
SizedBox(width: 40.w,),
Text('账号', style: TextStyle(color: AppColors.darkGrayTextColor, fontSize: 22.sp)),
Expanded(
child: TextField(
controller: state.numberController,
textAlign: TextAlign.right,
keyboardType: TextInputType.text,
onChanged: (value) {},
decoration: InputDecoration(
border: InputBorder.none,
hintText: state.type.value == 1 ? "请输入手机号或email" : "请输入好房管家管理员的账号",
hintStyle: TextStyle(
color: AppColors.placeholderTextColor,
fontSize: ScreenUtil().setSp(22),
textBaseline: TextBaseline.alphabetic),
),
)),
SizedBox(width: 20.w,),
Image.asset('images/icon_addressBook.png', width: 28.w, height: 28.h,),
SizedBox(width: 40.w,)
],
),
Divider(
color: AppColors.greyLineColor,
indent: 20.w,
endIndent: 20.w,
height: 1,
),
CommonItem(
leftTitel: TranslationLoader.lanKeys!.countryAndRegion!.tr,
rightTitle: "",
isHaveLine: true,
isHaveRightWidget: true,
isHaveDirection: true,
rightWidget: Text(
'${state.countryName.value} +${state.countryCode.value}',
textAlign: TextAlign.end,
style:
TextStyle(fontSize: 22.sp, color: AppColors.darkGrayTextColor),
),
action: () async {
var result = await Navigator.pushNamed(
context, Routers.seletCountryRegionPage);
result as Map<String, dynamic>;
state.countryCode.value = result['code'];
state.countryName.value = result['countryName'];
setState(() {});
},
),
],
),
);
}
Widget _buildBottomText() {
return Padding(
padding: EdgeInsets.only(top: 20.h, bottom: 80.h),
child: Text(
'选中的智能锁将会转移到您输入的账号中,您将失去锁的管理权',
style:
TextStyle(fontSize: 18.sp, color: AppColors.placeholderTextColor),
textAlign: TextAlign.left,
),
);
}
Widget _buildNextBtn(BuildContext context) {
return SubmitBtn(btnName: '下一步', onClick: () {
if(state.numberController.text.isEmpty){
Toast.show(msg: "请输入手机号或email");
return;
}
if(state.type.value == 1){
logic.transferLockConfirmInfoData((v){
showCupertinoAlertDialog(context, v);
});
}else{
Get.toNamed(Routers.selectBranchPage, arguments: {
"idList":state.idList.value,
"countryCode":state.countryCode.value,
"number":state.numberController.text,
});
}
});
}
Widget _buildRemoveBadLockBtn() {
return Row(
children: [
const Expanded(child: SizedBox()),
TextButton(
onPressed: () {
},
child: Text('移除坏锁', style: TextStyle(fontSize: 22.sp, color: AppColors.darkGrayTextColor), textAlign: TextAlign.end,)),
SizedBox(width: 10.h,)
],
);
}
void showCupertinoAlertDialog(BuildContext context, RecipientInformationData recipientInformationData) {
showGeneralDialog(
context: context,
barrierColor: Colors.black.withOpacity(.5),
barrierDismissible: true,
barrierLabel: '',
transitionDuration: const Duration(milliseconds: 200),
transitionBuilder: (BuildContext context,
Animation<double> animation,
Animation<double> secondaryAnimation,
Widget child) {
return ScaleTransition(scale: animation, child: child);
},
pageBuilder: (BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation) {
// recipientInformationData.nickname = "张三张三张三";
return Center(
child: Container(
width: 400.w,
height: 370.h,
color: Colors.white,
child: Column(
children: [
SizedBox(height: 20.h),
Text("转移确认", style: TextStyle(fontSize: 24.sp)),
SizedBox(height: 20.h),
Image.asset('images/icon_lockGroup_item.png', width: 70.h, height: 70.h, fit: BoxFit.fill),
SizedBox(height: 15.h),
Stack(
alignment: Alignment.center,
clipBehavior: Clip.none,
children: <Widget>[
Text(recipientInformationData.nickname!, style: TextStyle(fontSize: 22.sp)),
Positioned(
left: (recipientInformationData.nickname!.length*19.w).w,
child: Container(
width: 80.w,
color: Colors.red,
child: Center(child: Text(state.type.value == 1 ? "个人用户" : "好房管家", style: TextStyle(fontSize: 18.sp, color: Colors.white))),
),
)
],
),
SizedBox(height: 8.h),
Text(recipientInformationData.userid!, style: TextStyle(fontSize: 22.sp)),
SizedBox(height: 8.h),
Text("本次共转移${state.idList.value.length}把智能锁", style: TextStyle(fontSize: 20.sp)),
SizedBox(height: 20.h),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
ElevatedButton(
onPressed: () {
Get.back();
},
style: ElevatedButton.styleFrom(
onPrimary: AppColors.appBarIconColor,
backgroundColor: Colors.grey,
minimumSize: Size(110.w, 45.h),
padding: const EdgeInsets.symmetric(horizontal: 16),
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(2)),
),
),
child: Text('取消', style: TextStyle(fontSize: 22.sp)),
),
ElevatedButton(
onPressed: () {
Get.back();
logic.transferLockInfoData();
},
style: ElevatedButton.styleFrom(
onPrimary: AppColors.appBarIconColor,
backgroundColor: AppColors.mainColor,
minimumSize: Size(110.w, 45.h),
padding: const EdgeInsets.symmetric(horizontal: 16),
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(2)),
),
),
child: Text('确认', style: TextStyle(fontSize: 22.sp)),
),
],
)
],
),
),
);
});
}
}

View File

@ -0,0 +1,18 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
class RecipientInformationState{
var type = 1.obs;// 1 2
final TextEditingController numberController = TextEditingController();
final countryName = "中国".obs;
final countryCode = "86".obs;
final isFromType = 1.obs;
final idList = [].obs;
RecipientInformationState() {
Map map = Get.arguments;
idList.value = map["idList"];
isFromType.value = map["isFromType"];
}
}

View File

@ -1,185 +0,0 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:star_lock/tools/submitBtn.dart';
import '../../../../appRouters.dart';
import '../../../../app_settings/app_colors.dart';
import '../../../../tools/titleAppBar.dart';
import '../../../../translations/trans_lib.dart';
class RecipientInformationPage extends StatefulWidget {
const RecipientInformationPage({Key? key}) : super(key: key);
@override
State<RecipientInformationPage> createState() =>
_RecipientInformationPageState();
}
class _RecipientInformationPageState extends State<RecipientInformationPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: AppColors.mainBackgroundColor,
appBar: TitleAppBar(
barTitle: TranslationLoader.lanKeys!.recipientInformation!.tr,
haveBack: true,
backgroundColor: AppColors.mainColor,
),
body: Column(
children: [
SizedBox(height: 150.h, child: _buildMainUI()),
SizedBox(
height: 20.h,
),
_buildAccoutRow(),
_buildBottomText(),
_buildNextBtn(),
Expanded(
child: SizedBox(
height: 64.h,
)),
_buildRemoveBadLockBtn(),
SizedBox(
height: 64.h,
)
],
),
);
}
Widget _buildMainUI() {
return ListView.separated(
itemCount: 2,
separatorBuilder: (context, index) {
return Divider(
height: 1,
indent: 20.w,
endIndent: 20.w,
color: AppColors.greyLineColor,
);
},
itemBuilder: (c, index) {
if (index == 0) {
return _electronicKeyItem(
'images/select_circle.png', "个人用户", () {});
} else {
return _electronicKeyItem(
'images/normal_circle.png', "好房管家", () {});
}
});
}
Widget _electronicKeyItem(
String leftIcon, String leftTitle, Function() action) {
return GestureDetector(
child: Container(
color: Colors.white,
height: 70.h,
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(
width: 40.w,
),
GestureDetector(
child: Image.asset(
leftIcon,
width: 20.w,
height: 20.w,
),
),
SizedBox(
width: 16.w,
),
Text(
leftTitle,
style: TextStyle(fontSize: 24.sp),
)
],
),
),
onTap: () {},
);
}
Widget _buildAccoutRow() {
return Container(
height: 60.h,
color: Colors.white,
child: Row(
children: [
SizedBox(
width: 40.w,
),
Text(
'账号',
style:
TextStyle(color: AppColors.darkGrayTextColor, fontSize: 22.sp),
),
Expanded(
child: TextField(
textAlign: TextAlign.right,
keyboardType: TextInputType.text,
onChanged: (value) {},
decoration: InputDecoration(
border: InputBorder.none,
hintText: '请输入手机号或email',
hintStyle: TextStyle(
color: AppColors.placeholderTextColor,
fontSize: ScreenUtil().setSp(22),
textBaseline: TextBaseline.alphabetic),
),
)),
SizedBox(
width: 20.w,
),
Image.asset(
'images/icon_addressBook.png',
width: 28.w,
height: 28.h,
),
SizedBox(
width: 40.w,
)
],
),
);
}
Widget _buildBottomText() {
return Padding(
padding: EdgeInsets.only(top: 20.h, bottom: 80.h),
child: Text(
'选中的智能锁将会转移到您输入的账号中,您将失去锁的管理权',
style:
TextStyle(fontSize: 18.sp, color: AppColors.placeholderTextColor),
textAlign: TextAlign.left,
),
);
}
Widget _buildNextBtn() {
return SubmitBtn(btnName: '下一步', onClick: () {});
}
Widget _buildRemoveBadLockBtn() {
return Row(
children: [
const Expanded(child: SizedBox()),
TextButton(
onPressed: () {},
child: Text(
'移除坏锁',
style: TextStyle(
fontSize: 18.sp, color: AppColors.darkGrayTextColor),
textAlign: TextAlign.end,
)),
SizedBox(
width: 10.h,
)
],
);
}
}

View File

@ -0,0 +1,10 @@
import 'package:star_lock/tools/baseGetXController.dart';
import 'selectBranch_state.dart';
class SelectBranchLogic extends BaseGetXController{
SelectBranchState state = SelectBranchState();
}

View File

@ -0,0 +1,230 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import '../../../../../app_settings/app_colors.dart';
import '../../../../../tools/titleAppBar.dart';
import '../../../../../translations/trans_lib.dart';
import '../recipientInformation/recipientInformation_entity.dart';
import 'selectBranch_logic.dart';
class SelectBranchPage extends StatefulWidget {
const SelectBranchPage({Key? key}) : super(key: key);
@override
State<SelectBranchPage> createState() => _SelectBranchPageState();
}
class _SelectBranchPageState extends State<SelectBranchPage> {
final logic = Get.put(SelectBranchLogic());
final state = Get.find<SelectBranchLogic>().state;
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: AppColors.mainBackgroundColor,
appBar: TitleAppBar(
barTitle: TranslationLoader.lanKeys!.recipientInformation!.tr,
haveBack: true,
backgroundColor: AppColors.mainColor,
),
body: Column(
children: [
_buildTopView(),
SizedBox(
height: 20.h,
),
Expanded(child: _buildMainUI()),
_buildNextBtn(),
SizedBox(
height: 64.h,
)
],
),
);
}
Widget _buildTopView() {
return Container(
height: 120.h,
width: ScreenUtil().screenWidth,
color: Colors.white,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(left: 40.w, top: 20.h, bottom: 16.h),
child: Text(
'公寓',
style: TextStyle(fontSize: 28.sp),
),
),
Obx(() => Padding(
padding: EdgeInsets.only(left: 40.w),
child: Text('管理员:${state.receiverNumber.value}',
style: TextStyle(
color: AppColors.darkGrayTextColor, fontSize: 24.sp)),
))
],
),
);
}
Widget _buildMainUI() {
return ListView.separated(
itemCount: 1,
separatorBuilder: (context, index) {
return Divider(
height: 1,
indent: 20.w,
endIndent: 20.w,
color: AppColors.greyLineColor,
);
},
itemBuilder: (c, index) {
return _electronicKeyItem('images/normal_circle.png', "分组一", () {});
});
}
Widget _electronicKeyItem(
String leftIcon, String leftTitle, Function() action) {
return GestureDetector(
child: Container(
color: Colors.white,
height: 70.h,
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(
width: 40.w,
),
GestureDetector(
child: Image.asset(
leftIcon,
width: 16,
height: 16,
),
),
SizedBox(
width: 16.w,
),
Text(
leftTitle,
style: TextStyle(fontSize: 24.sp),
)
],
),
),
onTap: () {},
);
}
Widget _buildNextBtn() {
return GestureDetector(
child: Container(
color: AppColors.mainColor,
width: ScreenUtil().screenWidth,
height: 64.h,
child: TextButton(
onPressed: () {
// showCupertinoAlertDialog(context, RecipientInformationData());
},
child: Text(
'下一步',
style: TextStyle(fontSize: 28.sp, color: Colors.white),
)),
),
);
}
void showCupertinoAlertDialog(BuildContext context, RecipientInformationData recipientInformationData) {
showGeneralDialog(
context: context,
barrierColor: Colors.black.withOpacity(.5),
barrierDismissible: true,
barrierLabel: '',
transitionDuration: const Duration(milliseconds: 200),
transitionBuilder: (BuildContext context,
Animation<double> animation,
Animation<double> secondaryAnimation,
Widget child) {
return ScaleTransition(scale: animation, child: child);
},
pageBuilder: (BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation) {
// recipientInformationData.nickname = "张三张三张三";
return Center(
child: Container(
width: 400.w,
height: 370.h,
color: Colors.white,
child: Column(
children: [
SizedBox(height: 20.h),
Text("转移确认", style: TextStyle(fontSize: 24.sp)),
SizedBox(height: 20.h),
Image.asset('images/icon_lockGroup_item.png', width: 70.h, height: 70.h, fit: BoxFit.fill),
SizedBox(height: 15.h),
Stack(
alignment: Alignment.center,
clipBehavior: Clip.none,
children: <Widget>[
Text(recipientInformationData.nickname!, style: TextStyle(fontSize: 22.sp)),
Positioned(
left: (recipientInformationData.nickname!.length*19.w).w,
child: Container(
width: 80.w,
color: Colors.red,
child: Center(child: Text(state.type.value == 1 ? "个人用户" : "好房管家", style: TextStyle(fontSize: 18.sp, color: Colors.white))),
),
)
],
),
SizedBox(height: 8.h),
Text(recipientInformationData.userid!, style: TextStyle(fontSize: 22.sp)),
SizedBox(height: 8.h),
Text("本次共转移${state.idList.value.length}把智能锁", style: TextStyle(fontSize: 20.sp)),
SizedBox(height: 20.h),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
ElevatedButton(
onPressed: () {
Get.back();
},
style: ElevatedButton.styleFrom(
onPrimary: AppColors.appBarIconColor,
backgroundColor: Colors.grey,
minimumSize: Size(110.w, 45.h),
padding: const EdgeInsets.symmetric(horizontal: 16),
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(2)),
),
),
child: Text('取消', style: TextStyle(fontSize: 22.sp)),
),
ElevatedButton(
onPressed: () {
Get.back();
// logic.transferLockInfoData();
},
style: ElevatedButton.styleFrom(
onPrimary: AppColors.appBarIconColor,
backgroundColor: AppColors.mainColor,
minimumSize: Size(110.w, 45.h),
padding: const EdgeInsets.symmetric(horizontal: 16),
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(2)),
),
),
child: Text('确认', style: TextStyle(fontSize: 22.sp)),
),
],
)
],
),
),
);
});
}
}

View File

@ -0,0 +1,17 @@
import 'package:get/get.dart';
class SelectBranchState{
var type = 1.obs;// 1 2
final receiverNumber = "".obs;
final countryName = "中国".obs;
final countryCode = "86".obs;
final idList = [].obs;
SelectBranchState() {
Map map = Get.arguments;
idList.value = map["idList"];
countryCode.value = map["countryCode"];
receiverNumber.value = map["number"];
}
}

View File

@ -1,133 +0,0 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import '../../../../app_settings/app_colors.dart';
import '../../../../tools/titleAppBar.dart';
import '../../../../translations/trans_lib.dart';
class SelectBranchPage extends StatefulWidget {
const SelectBranchPage({Key? key}) : super(key: key);
@override
State<SelectBranchPage> createState() => _SelectBranchPageState();
}
class _SelectBranchPageState extends State<SelectBranchPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: AppColors.mainBackgroundColor,
appBar: TitleAppBar(
barTitle: TranslationLoader.lanKeys!.recipientInformation!.tr,
haveBack: true,
backgroundColor: AppColors.mainColor,
),
body: Column(
children: [
_buildTopView(),
SizedBox(
height: 20.h,
),
Expanded(child: _buildMainUI()),
_buildNextBtn(),
SizedBox(
height: 64.h,
)
],
),
);
}
Widget _buildTopView() {
return Container(
height: 120.h,
width: ScreenUtil().screenWidth,
color: Colors.white,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(left: 40.w, top: 20.h, bottom: 16.h),
child: Text(
'公寓',
style: TextStyle(fontSize: 28.sp),
),
),
Padding(
padding: EdgeInsets.only(left: 40.w),
child: Text('管理员18682150237',
style: TextStyle(
color: AppColors.darkGrayTextColor, fontSize: 24.sp)),
)
],
),
);
}
Widget _buildMainUI() {
return ListView.separated(
itemCount: 5,
separatorBuilder: (context, index) {
return Divider(
height: 1,
indent: 20.w,
endIndent: 20.w,
color: AppColors.greyLineColor,
);
},
itemBuilder: (c, index) {
return _electronicKeyItem('images/select_circle.png', "分组一", () {});
});
}
Widget _electronicKeyItem(
String leftIcon, String leftTitle, Function() action) {
return GestureDetector(
child: Container(
color: Colors.white,
height: 70.h,
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(
width: 40.w,
),
GestureDetector(
child: Image.asset(
leftIcon,
width: 16,
height: 16,
),
),
SizedBox(
width: 16.w,
),
Text(
leftTitle,
style: TextStyle(fontSize: 28.sp),
)
],
),
),
onTap: () {},
);
}
Widget _buildNextBtn() {
return GestureDetector(
child: Container(
color: AppColors.mainColor,
width: ScreenUtil().screenWidth,
height: 64.h,
child: TextButton(
onPressed: () {},
child: Text(
'下一步',
style: TextStyle(fontSize: 28.sp, color: Colors.white),
)),
),
);
}
}

View File

@ -0,0 +1,118 @@
class TransferSmartLockEntity {
int? errorCode;
String? description;
String? errorMsg;
TransferSmartLockListData? data;
TransferSmartLockEntity(
{this.errorCode, this.description, this.errorMsg, this.data});
TransferSmartLockEntity.fromJson(Map<String, dynamic> json) {
errorCode = json['errorCode'];
description = json['description'];
errorMsg = json['errorMsg'];
data = json['data'] != null ? TransferSmartLockListData.fromJson(json['data']) : null;
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['errorCode'] = errorCode;
data['description'] = description;
data['errorMsg'] = errorMsg;
if (this.data != null) {
data['data'] = this.data!.toJson();
}
return data;
}
}
class TransferSmartLockListData {
List<TransferSmartLockItemData>? list;
TransferSmartLockListData({this.list});
TransferSmartLockListData.fromJson(Map<String, dynamic> json) {
if (json['list'] != null) {
list = <TransferSmartLockItemData>[];
json['list'].forEach((v) {
list!.add(TransferSmartLockItemData.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
if (list != null) {
data['list'] = list!.map((v) => v.toJson()).toList();
}
return data;
}
}
class TransferSmartLockItemData {
int? lockId;
int? selet = 0;
String? lockAlias;
LockVersion? lockVersion;
TransferSmartLockItemData({this.lockId, this.lockAlias, this.lockVersion});
TransferSmartLockItemData.fromJson(Map<String, dynamic> json) {
lockId = json['lockId'];
lockAlias = json['lockAlias'];
// lockVersion = json['lockVersion'] != null
// ? LockVersion.fromJson(json['lockVersion'])
// : null;
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['lockId'] = lockId;
data['lockAlias'] = lockAlias;
// if (lockVersion != null) {
// data['lockVersion'] = lockVersion!.toJson();
// }
return data;
}
}
class LockVersion {
bool? showAdminKbpwdFlag;
int? groupId;
int? protocolVersion;
int? protocolType;
int? orgId;
String? logoUrl;
int? scene;
LockVersion(
{this.showAdminKbpwdFlag,
this.groupId,
this.protocolVersion,
this.protocolType,
this.orgId,
this.logoUrl,
this.scene});
LockVersion.fromJson(Map<String, dynamic> json) {
showAdminKbpwdFlag = json['showAdminKbpwdFlag'];
groupId = json['groupId'];
protocolVersion = json['protocolVersion'];
protocolType = json['protocolType'];
orgId = json['orgId'];
logoUrl = json['logoUrl'];
scene = json['scene'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['showAdminKbpwdFlag'] = showAdminKbpwdFlag;
data['groupId'] = groupId;
data['protocolVersion'] = protocolVersion;
data['protocolType'] = protocolType;
data['orgId'] = orgId;
data['logoUrl'] = logoUrl;
data['scene'] = scene;
return data;
}
}

View File

@ -0,0 +1,40 @@
import 'package:star_lock/tools/baseGetXController.dart';
import '../../../../network/api_repository.dart';
import 'transferSmartLock_state.dart';
class TransferSmartLockLogic extends BaseGetXController{
TransferSmartLockState state = TransferSmartLockState();
//
Future<void> getTransferLockListData() async{
var entity = await ApiRepository.to.getTransferLockListData();
if(entity.errorCode!.codeIsSuccessful){
state.transferSmartLockListData.value = entity.data!.list!;
}
}
@override
void onReady() {
// TODO: implement onReady
super.onReady();
print("onReady()");
getTransferLockListData();
}
@override
void onInit() {
// TODO: implement onInit
super.onInit();
print("onInit()");
}
@override
void onClose() {
// TODO: implement onClose
super.onClose();
}
}

View File

@ -0,0 +1,197 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import '../../../../../appRouters.dart';
import '../../../../../app_settings/app_colors.dart';
import '../../../../../tools/titleAppBar.dart';
import '../../../../../translations/trans_lib.dart';
import '../../../../tools/noData.dart';
import '../../../../tools/toast.dart';
import 'transferSmartLock_entity.dart';
import 'transferSmartLock_logic.dart';
class TransferSmartLockPage extends StatefulWidget {
const TransferSmartLockPage({Key? key}) : super(key: key);
@override
State<TransferSmartLockPage> createState() => _TransferSmartLockPageState();
}
class _TransferSmartLockPageState extends State<TransferSmartLockPage> {
final logic = Get.put(TransferSmartLockLogic());
final state = Get.find<TransferSmartLockLogic>().state;
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: AppColors.mainBackgroundColor,
appBar: TitleAppBar(
barTitle: TranslationLoader.lanKeys!.selectiveLock!.tr,
haveBack: true,
backgroundColor: AppColors.mainColor,
actionsList: [
TextButton(
onPressed: () {
setState(() {
for (var element in state.transferSmartLockListData.value) {
if(state.isSeletAll == true){
state.isSeletAll = false;
element.selet = 0;
}else{
state.isSeletAll = true;
element.selet = 1;
}
}
});
},
child: Text(state.isSeletAll == true ? TranslationLoader.lanKeys!.checkAll!.tr : TranslationLoader.lanKeys!.cancel!.tr, style: TextStyle(color: Colors.white, fontSize: 24.sp)))
],
),
body: Column(
children: [
_searchWidget(),
SizedBox(height: 10.h),
Expanded(child: _buildMainUI()),
SizedBox(height: 20.h),
_buildNextBtn(),
SizedBox(height: 64.h)
],
),
);
}
Widget _searchWidget() {
return Container(
height: 60.h,
margin: EdgeInsets.only(top: 20.w, left: 20.w, right: 10.w),
decoration: BoxDecoration(
color: Colors.white, borderRadius: BorderRadius.circular(5)),
child: TextField(
//
maxLines: 1,
controller: state.searchController,
autofocus: false,
onChanged: (value){
print("onChanged:$value");
},
onEditingComplete: (){
print("onEditingComplete:");
},
onSubmitted: (value) async {
FocusScope.of(context).requestFocus(FocusNode());
await logic.getTransferLockListData();
if(state.searchController.text.isNotEmpty){
var contrList = <TransferSmartLockItemData>[];
for (var element in state.transferSmartLockListData.value) {
if(element.lockAlias!.contains(state.searchController.text)){
contrList.add(element);
}
}
state.transferSmartLockListData.value = contrList;
print("contrList:${contrList[0].lockAlias} state.transferSmartLockListData.value:${state.transferSmartLockListData.value[0].lockAlias}");
}
},
decoration: InputDecoration(
//
contentPadding: const EdgeInsets.only(top: 12.0, left: -19.0, right: -15.0, bottom: 8.0),
hintText: TranslationLoader.lanKeys!.pleaseEnter!.tr,
hintStyle: TextStyle(fontSize: 22.sp, height: 3.0),
//线
border: InputBorder.none,
//
icon: Padding(
padding: EdgeInsets.only(
top: 20.h, bottom: 20.h, right: 20.w, left: 10.w),
child: Image.asset(
'images/main/icon_main_search.png',
width: 40.w,
height: 40.w,
),
),
),
),
);
}
Widget _buildMainUI() {
return Obx(() => state.transferSmartLockListData.value.isNotEmpty ? ListView.separated(
itemCount: state.transferSmartLockListData.value.length,
separatorBuilder: (context, index) {
return Divider(
height: 1,
indent: 20.w,
endIndent: 20.w,
color: AppColors.greyLineColor,
);
},
itemBuilder: (c, index) {
TransferSmartLockItemData transferSmartLockItemData = state.transferSmartLockListData.value[index];
return _electronicKeyItem(transferSmartLockItemData, () {
setState(() {
if(transferSmartLockItemData.selet == 1){
transferSmartLockItemData.selet = 0;
}else{
transferSmartLockItemData.selet = 1;
}
});
});
}):const NoData());
}
Widget _electronicKeyItem(TransferSmartLockItemData transferSmartLockItemData, Function() action) {
return GestureDetector(
onTap: action,
child: Container(
color: Colors.white,
height: 90.h,
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(width: 20.w),
Image.asset((transferSmartLockItemData.selet == 1) ? 'images/icon_round_selet.png' : 'images/icon_round_unSelet.png', width: 30.w, height: 30.w),
SizedBox(width: 16.w),
Image.asset('images/icon_lockGroup_item.png', width: 50.h, height: 50.h, fit: BoxFit.fill),
SizedBox(width: 10.w),
Text(transferSmartLockItemData.lockAlias!, style: TextStyle(fontSize: 22.sp, color: AppColors.blackColor))
],
),
),
);
}
Widget _buildNextBtn() {
return GestureDetector(
child: Container(
color: AppColors.mainColor,
width: ScreenUtil().screenWidth,
height: 64.h,
child: TextButton(
onPressed: () async {
bool isCanNext = false;
var idList = [];
for (var element in state.transferSmartLockListData.value) {
if(element.selet == 1){
isCanNext = true;
idList.add(element.lockId);
}
}
if(isCanNext == false){
Toast.show(msg: "请选择锁");
return;
}
var data = await Get.toNamed(Routers.recipientInformationPage, arguments: {
"idList":idList,
"isFromType":2,
});
if(data != null) {
logic.getTransferLockListData();
}
},
child: Text('下一步', style: TextStyle(fontSize: 28.sp, color: Colors.white),
)),
),
);
}
}

View File

@ -0,0 +1,11 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'transferSmartLock_entity.dart';
class TransferSmartLockState{
var transferSmartLockListData = <TransferSmartLockItemData>[].obs;
final TextEditingController searchController = TextEditingController();
bool isSeletAll = false;
}

View File

@ -1,168 +0,0 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import '../../../../appRouters.dart';
import '../../../../app_settings/app_colors.dart';
import '../../../../tools/titleAppBar.dart';
import '../../../../translations/trans_lib.dart';
class TransferSmartLockPage extends StatefulWidget {
const TransferSmartLockPage({Key? key}) : super(key: key);
@override
State<TransferSmartLockPage> createState() => _TransferSmartLockPageState();
}
class _TransferSmartLockPageState extends State<TransferSmartLockPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: AppColors.mainBackgroundColor,
appBar: TitleAppBar(
barTitle: TranslationLoader.lanKeys!.selectiveLock!.tr,
haveBack: true,
backgroundColor: AppColors.mainColor,
actionsList: [
TextButton(
onPressed: () {},
child: Text(
'全选',
style: TextStyle(color: Colors.white, fontSize: 24.sp),
))
],
),
body: Column(
children: [
_searchWidget(),
SizedBox(
height: 10.h,
),
Expanded(child: _buildMainUI()),
SizedBox(
height: 20.h,
),
_buildNextBtn(),
SizedBox(
height: 64.h,
)
],
),
);
}
Widget _searchWidget() {
return Container(
height: 60.h,
margin: EdgeInsets.only(top: 20.w, left: 20.w, right: 10.w),
decoration: BoxDecoration(
color: Colors.white, borderRadius: BorderRadius.circular(5)),
child: TextField(
//
maxLines: 1,
// controller: _controller,
autofocus: false,
decoration: InputDecoration(
//
contentPadding: const EdgeInsets.only(
top: 12.0, left: -19.0, right: -15.0, bottom: 8.0),
hintText: TranslationLoader.lanKeys!.pleaseEnter!.tr,
hintStyle: TextStyle(fontSize: 22.sp, height: 3.0),
//线
border: InputBorder.none,
//
icon: Padding(
padding: EdgeInsets.only(
top: 20.h, bottom: 20.h, right: 20.w, left: 10.w),
child: Image.asset(
'images/main/icon_main_search.png',
width: 40.w,
height: 40.w,
),
),
),
),
);
}
Widget _buildMainUI() {
return ListView.separated(
itemCount: 10,
separatorBuilder: (context, index) {
return Divider(
height: 1,
indent: 20.w,
endIndent: 20.w,
color: AppColors.greyLineColor,
);
},
itemBuilder: (c, index) {
return _electronicKeyItem('images/icon_lock.png', "张三",
"2023.6.21 11.15", "2023.6.21 11.15", () {
Navigator.pushNamed(context, Routers.authorizedAdminDetailPage);
});
});
}
Widget _electronicKeyItem(String lockTypeIcon, String lockTypeTitle,
String beginTime, String endTime, Function() action) {
return GestureDetector(
child: Container(
color: Colors.white,
height: 90.h,
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(
width: 20.w,
),
GestureDetector(
child: Image.asset(
'images/icon_round_unSelet.png',
width: 22,
height: 22,
),
),
SizedBox(
width: 16.w,
),
Image.asset(
'images/icon_lockGroup_item.png',
width: 36,
height: 36,
fit: BoxFit.fill,
),
SizedBox(
width: 10.w,
),
Text(
'Daisy',
style: TextStyle(fontSize: 22.sp, color: AppColors.blackColor),
)
],
),
),
onTap: () {},
);
}
Widget _buildNextBtn() {
return GestureDetector(
child: Container(
color: Colors.grey,
width: ScreenUtil().screenWidth,
height: 64.h,
child: TextButton(
onPressed: () {
Navigator.pushNamed(context, Routers.recipientInformationPage);
},
child: Text(
'下一步',
style: TextStyle(fontSize: 28.sp, color: Colors.white),
)),
),
);
}
}

View File

@ -89,6 +89,12 @@ abstract class Api {
final String deleteICCardURL = '/identityCard/delete'; // IC卡
final String updateICCardUserNoURL = '/identityCard/updatePwdUserNo'; // ic卡用户序号
final String transferLockListURL = '/room/listForTransfer'; //
final String transferLockConfirmURL = '/room/transferLockConfirm'; //
final String transferLockURL = '/room/transfer'; //
final String gatewaykListURL = '/plug/list'; //
final String getKeyDetailURL = '/key/get'; //
final String lockUserListURL = '/keyUser/listKeyUser'; //
final String canSendKeyURL = '/keyUser/canSendKey'; //

View File

@ -940,6 +940,53 @@ class ApiProvider extends BaseProvider {
})
);
//
Future<Response> getTransferLockListData() =>
post(
transferLockListURL.toUrl,
jsonEncode({})
);
//
Future<Response> transferLockConfirmInfoData(
String receiverUserid,
String type,
String countryCode) =>
post(
transferLockConfirmURL.toUrl,
jsonEncode({
'receiverUserid': receiverUserid,
'type': type,
'countryCode': countryCode
})
);
//
Future<Response> transferLockInfoData(
String receiverUserid,
List lockIdList,
String countryCode) =>
post(
transferLockURL.toUrl,
jsonEncode({
'receiverUserid': receiverUserid,
'lockIdList': lockIdList,
'countryCode': countryCode
})
);
//
Future<Response> getGatewayListData(
String pageNo,
String pageSize) =>
post(
gatewaykListURL.toUrl,
jsonEncode({
'pageNo': pageNo,
'pageSize': pageSize
})
);
Future<Response> listLockByGroup(String type, String keyGroupId) => post(
listLockByGroupURL.toUrl,
jsonEncode({'type': type, 'keyGroupId': keyGroupId}));

View File

@ -30,6 +30,9 @@ import '../main/lockDetail/lcokSet/normallyOpenMode/GetPassageModeConfigEntity.d
import '../main/lockDetail/otherTypeKey/otherTypeKeyList/fingerprintListData_entity.dart';
import '../main/lockMian/entity/lockInfoEntity.dart';
import '../mine/addLock/saveLock/entity/SaveLockEntity.dart';
import '../mine/mineSet/transferGateway/selectGetewayList_entity.dart';
import '../mine/mineSet/transferSmartLock/recipientInformation/recipientInformation_entity.dart';
import '../mine/mineSet/transferSmartLock/transferSmartLockList/transferSmartLock_entity.dart';
import 'api_provider.dart';
class ApiRepository {
@ -1005,4 +1008,39 @@ class ApiRepository {
return LoginEntity.fromJson(res.body);
}
//
Future<TransferSmartLockEntity> getTransferLockListData() async {
final res = await apiProvider.getTransferLockListData();
return TransferSmartLockEntity.fromJson(res.body);
}
//
Future<RecipientInformationEntity> transferLockConfirmInfoData({
required String receiverUserid,
required String type,
required String countryCode
}) async {
final res = await apiProvider.transferLockConfirmInfoData(receiverUserid, type, countryCode);
return RecipientInformationEntity.fromJson(res.body);
}
//
Future<RecipientInformationEntity> transferLockInfoData({
required String receiverUserid,
required List lockIdList,
required String countryCode
}) async {
final res = await apiProvider.transferLockInfoData(receiverUserid, lockIdList, countryCode);
return RecipientInformationEntity.fromJson(res.body);
}
//
Future<GetewayDataEntity> getGatewayListData({
required String pageNo,
required String pageSize
}) async {
final res = await apiProvider.getGatewayListData(pageNo, pageSize);
return GetewayDataEntity.fromJson(res.body);
}
}