1、修改锁分组bug。2、修改群发电子钥匙问题
This commit is contained in:
parent
54db74b4ba
commit
436ee3d50f
@ -325,21 +325,13 @@ class AuthorizedAdminLogic extends BaseGetXController {
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
// TODO: implement onReady
|
||||
super.onReady();
|
||||
|
||||
_initReplySubscription();
|
||||
}
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
// TODO: implement onInit
|
||||
super.onInit();
|
||||
}
|
||||
|
||||
@override
|
||||
void onClose() {
|
||||
// TODO: implement onClose
|
||||
_replySubscription.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
|
||||
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/main/lockDetail/lockSet/basicInformation/basicInformation/KeyDetailEntity.dart';
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
|
||||
import '../../../../tools/showTipView.dart';
|
||||
import 'volumeAuthorizationLock_state.dart';
|
||||
|
||||
class VolumeAuthorizationLockLogic extends BaseGetXController {
|
||||
@ -46,11 +46,13 @@ class VolumeAuthorizationLockLogic extends BaseGetXController {
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
state.isSendSuccess.value = true;
|
||||
} else {
|
||||
EasyLoading.showToast('${entity.errorMsg}', duration: 2000.milliseconds);
|
||||
if (entity.errorCode == 425) {
|
||||
//用户未注册
|
||||
state.isCreateUser.value = true;
|
||||
addAuthorizedAdminRequest();
|
||||
ShowTipView().showIosTipWithContentDialog(
|
||||
'${"是否发送电子钥匙给未注册账号".tr}\n${state.emailOrPhoneController.text}', () {
|
||||
state.isCreateUser.value = true;
|
||||
addAuthorizedAdminRequest();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -11,12 +11,14 @@ class massSendLockGroupCell extends StatelessWidget {
|
||||
required this.lockListByGroup,
|
||||
required this.selectLockAction,
|
||||
required this.isVip,
|
||||
required this.isShowBtn,
|
||||
Key? key})
|
||||
: super(key: key);
|
||||
final int currentIndex;
|
||||
List lockListByGroup;
|
||||
final _CallBack selectLockAction;
|
||||
bool isVip;
|
||||
bool isShowBtn;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@ -65,26 +67,28 @@ class massSendLockGroupCell extends StatelessWidget {
|
||||
child: SizedBox(
|
||||
width: 20.w,
|
||||
)),
|
||||
Image.asset(
|
||||
itemData.isChecked
|
||||
? 'images/icon_round_select.png'
|
||||
: 'images/icon_round_unSelect.png',
|
||||
width: 30.w,
|
||||
height: 30.w,
|
||||
color: !isVip ? Colors.grey : AppColors.mainColor,
|
||||
),
|
||||
Visibility(
|
||||
visible: isShowBtn,
|
||||
child: Image.asset(
|
||||
itemData.isChecked
|
||||
? 'images/icon_round_select.png'
|
||||
: 'images/icon_round_unSelect.png',
|
||||
width: 30.w,
|
||||
height: 30.w,
|
||||
color: !isVip ? Colors.grey : AppColors.mainColor,
|
||||
),),
|
||||
SizedBox(
|
||||
width: 30.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
onTap: isShowBtn ? () {
|
||||
if (isVip == false) {
|
||||
return;
|
||||
}
|
||||
selectLockAction(itemIndex, itemData.lockId.toString());
|
||||
},
|
||||
} : null,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -131,12 +131,14 @@ class _MassSendLockGroupListPageState extends State<MassSendLockGroupListPage> {
|
||||
}
|
||||
setState(() {});
|
||||
},
|
||||
isShowBtn: true,
|
||||
typeImgList: const [],
|
||||
groupItem: itemData,
|
||||
child: massSendLockGroupCell(index,
|
||||
currentIndex: index,
|
||||
lockListByGroup: lockItemList,
|
||||
isVip: state.isVip.value,
|
||||
isShowBtn: true,
|
||||
selectLockAction: (selectIndex, selectLockId) {
|
||||
LockListItem lockItem = lockItemList[selectIndex];
|
||||
lockItem.isChecked = !lockItem.isChecked;
|
||||
|
||||
@ -174,6 +174,7 @@ class _AuthorityManagementPageState extends State<AuthorityManagementPage>
|
||||
},
|
||||
// title: deviceName,
|
||||
// imgName: 'images/icon_lock.png',
|
||||
isShowBtn: true,
|
||||
typeImgList: const [],
|
||||
groupItem: GroupListItem(),
|
||||
child: ListView.separated(
|
||||
@ -214,6 +215,7 @@ class _AuthorityManagementPageState extends State<AuthorityManagementPage>
|
||||
},
|
||||
// title: deviceName,
|
||||
// imgName: 'images/controls_user.png',
|
||||
isShowBtn: true,
|
||||
typeImgList: const ['images/icon_password.png', 'images/icon_card.png'],
|
||||
groupItem: GroupListItem(),
|
||||
child: ListView.separated(
|
||||
|
||||
@ -75,12 +75,14 @@ class _AdministratorAssociationLockPageState
|
||||
onTap: () {
|
||||
|
||||
},
|
||||
isShowBtn: false,
|
||||
typeImgList: const [],
|
||||
groupItem: getItemData,
|
||||
child: massSendLockGroupCell(index,
|
||||
currentIndex: index,
|
||||
lockListByGroup: lockItemList,
|
||||
isVip: true,
|
||||
isShowBtn: false,
|
||||
selectLockAction: (int selectIndex, String selectLockId) {
|
||||
|
||||
}),
|
||||
|
||||
@ -12,31 +12,33 @@ class GroupEditLockLogic extends BaseGetXController {
|
||||
//锁分组里面添加锁
|
||||
Future<void> lockGroupAddLock(List lockIds) async {
|
||||
if (lockIds.isEmpty) {
|
||||
showToast("请选择锁".tr);
|
||||
showToast('请选择锁'.tr);
|
||||
return;
|
||||
}
|
||||
var entity = await ApiRepository.to.lockGroupAddLock(
|
||||
lockIds: lockIds, groupId: state.selectGroupListItem.keyGroupId!);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
showToast("添加成功");
|
||||
eventBus.fire(LockGroupEditGroupLockRefreshEvent());
|
||||
eventBus.fire(RefreshLockListInfoDataEvent());
|
||||
Get.close(2);
|
||||
showToast('添加成功', something: () {
|
||||
eventBus.fire(LockGroupEditGroupLockRefreshEvent());
|
||||
eventBus.fire(RefreshLockListInfoDataEvent());
|
||||
Get.close(2);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//锁分组里面添加锁
|
||||
Future<void> lockGroupDeletLock(List lockIds) async {
|
||||
if (lockIds.isEmpty) {
|
||||
showToast("请选择锁".tr);
|
||||
showToast('请选择锁'.tr);
|
||||
return;
|
||||
}
|
||||
var entity = await ApiRepository.to.lockGroupDeletLock(lockIds: lockIds);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
showToast("删除成功");
|
||||
eventBus.fire(LockGroupEditGroupLockRefreshEvent());
|
||||
eventBus.fire(RefreshLockListInfoDataEvent());
|
||||
Get.close(2);
|
||||
showToast('删除成功', something: () {
|
||||
eventBus.fire(LockGroupEditGroupLockRefreshEvent());
|
||||
eventBus.fire(RefreshLockListInfoDataEvent());
|
||||
Get.close(2);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupListEntity.dart';
|
||||
import 'package:star_lock/mine/mineSet/lockGroup/groupEditLock/groupEditLock_state.dart';
|
||||
import 'package:star_lock/tools/showCupertinoAlertView.dart';
|
||||
import 'package:star_lock/tools/noData.dart';
|
||||
|
||||
@ -19,8 +20,8 @@ class GroupEditLockPage extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _GroupEditLockPageState extends State<GroupEditLockPage> {
|
||||
final logic = Get.put(GroupEditLockLogic());
|
||||
final state = Get.find<GroupEditLockLogic>().state;
|
||||
final GroupEditLockLogic logic = Get.put(GroupEditLockLogic());
|
||||
final GroupEditLockState state = Get.find<GroupEditLockLogic>().state;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@ -33,15 +34,15 @@ class _GroupEditLockPageState extends State<GroupEditLockPage> {
|
||||
haveBack: true,
|
||||
backgroundColor: AppColors.mainColor),
|
||||
body: Column(
|
||||
children: [
|
||||
children: <Widget>[
|
||||
Obx(() => Visibility(
|
||||
visible: state.isVip.value ? false : true,
|
||||
visible: !state.isVip.value,
|
||||
child: ShowCupertinoAlertView()
|
||||
.topTipsAdvancedFeatures('开通高级功能后才可以对锁进行管理'.tr))),
|
||||
Container(
|
||||
margin: EdgeInsets.all(15.w),
|
||||
child: Row(
|
||||
children: [
|
||||
children: <Widget>[
|
||||
Text(
|
||||
TranslationLoader
|
||||
.lanKeys!.selectTheLockToJoinTheGroup!.tr,
|
||||
@ -51,13 +52,13 @@ class _GroupEditLockPageState extends State<GroupEditLockPage> {
|
||||
),
|
||||
Expanded(child: _buildMainUI()),
|
||||
Obx(() => Visibility(
|
||||
visible: state.isVip.value ? true : false,
|
||||
visible: state.isVip.value,
|
||||
child: SubmitBtn(
|
||||
btnName: TranslationLoader.lanKeys!.sure!.tr,
|
||||
onClick: () async {
|
||||
var idList = [];
|
||||
final List idList = [];
|
||||
for (int i = 0; i < state.lockList.length; i++) {
|
||||
LockListItem lockListItem = state.lockList[i];
|
||||
final LockListItem lockListItem = state.lockList[i];
|
||||
if (lockListItem.isChecked == true) {
|
||||
idList.add(lockListItem.lockId);
|
||||
}
|
||||
@ -78,8 +79,8 @@ class _GroupEditLockPageState extends State<GroupEditLockPage> {
|
||||
Widget _buildMainUI() {
|
||||
return state.lockList.isNotEmpty
|
||||
? ListView.separated(
|
||||
itemBuilder: (context, index) {
|
||||
LockListItem itemData = state.lockList[index];
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
final LockListItem itemData = state.lockList[index];
|
||||
return _listItemView(itemData);
|
||||
},
|
||||
itemCount: state.lockList.length,
|
||||
@ -109,24 +110,35 @@ class _GroupEditLockPageState extends State<GroupEditLockPage> {
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
children: <Widget>[
|
||||
SizedBox(
|
||||
width: 20.w,
|
||||
),
|
||||
Image.asset(
|
||||
'images/icon_lockGroup_item.png',
|
||||
width: 36,
|
||||
height: 36,
|
||||
width: 50.w,
|
||||
height: 50.w,
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
SizedBox(
|
||||
width: 10.w,
|
||||
),
|
||||
Text(
|
||||
itemData.lockAlias ?? '',
|
||||
style: TextStyle(fontSize: 24.sp),
|
||||
Expanded(
|
||||
child: SizedBox(
|
||||
width: 1.sw - 80.w - 75.w,
|
||||
child: Text(
|
||||
itemData.lockAlias ?? '',
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(fontSize: 24.sp),
|
||||
)
|
||||
)
|
||||
),
|
||||
Expanded(child: SizedBox(width: 10.w)),
|
||||
// Text(
|
||||
// itemData.lockAlias ?? '',
|
||||
// style: TextStyle(fontSize: 24.sp),
|
||||
// ),
|
||||
SizedBox(width: 10.w),
|
||||
Image.asset(
|
||||
itemData.isChecked
|
||||
? 'images/icon_round_select.png'
|
||||
|
||||
@ -108,17 +108,22 @@ class _LockItemListPageState extends State<LockItemListPage> {
|
||||
),
|
||||
Image.asset(
|
||||
'images/icon_lockGroup_item.png',
|
||||
width: 36,
|
||||
height: 36,
|
||||
width: 50.w,
|
||||
height: 50.w,
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
SizedBox(
|
||||
width: 10.w,
|
||||
),
|
||||
Text(
|
||||
itemData.lockAlias ?? '',
|
||||
style: TextStyle(fontSize: 24.sp),
|
||||
)
|
||||
Expanded(child:
|
||||
Text(itemData.lockAlias ?? '',
|
||||
style: TextStyle(fontSize: 24.sp),
|
||||
)
|
||||
),
|
||||
// Text(
|
||||
// itemData.lockAlias ?? '',
|
||||
// style: TextStyle(fontSize: 24.sp),
|
||||
// )
|
||||
],
|
||||
),
|
||||
),
|
||||
@ -142,7 +147,6 @@ class _LockItemListPageState extends State<LockItemListPage> {
|
||||
} else if (getSelectIndex == 1) {
|
||||
Get.toNamed(Routers.groupEditLockPage, arguments: {'groupListItem': groupListItem, 'ungrouped': ungrouped, 'type': 1});
|
||||
}
|
||||
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
@ -13,8 +13,8 @@ class LockGroupListLogic extends BaseGetXController {
|
||||
final LockGroupListState state = LockGroupListState();
|
||||
|
||||
//分组列表请求
|
||||
void mockNetworkDataRequest() async {
|
||||
var entity = await ApiRepository.to.lockGroupList('0');
|
||||
Future<void> mockNetworkDataRequest() async {
|
||||
final MassSendLockGroupListEntity entity = await ApiRepository.to.lockGroupList('0');
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
if (entity.data != null) {
|
||||
state.lockNum = 0;
|
||||
@ -25,58 +25,53 @@ class LockGroupListLogic extends BaseGetXController {
|
||||
|
||||
//创建锁分组请求
|
||||
Future<void> addLockGroupRequest() async {
|
||||
MassSendLockGroupListEntity entity =
|
||||
final MassSendLockGroupListEntity entity =
|
||||
await ApiRepository.to.addLockGroup(state.changeNameController.text, '0');
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
showToast("创建成功".tr);
|
||||
mockNetworkDataRequest();
|
||||
showToast('创建成功'.tr, something: (){
|
||||
mockNetworkDataRequest();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//编辑锁名字
|
||||
Future<void> editLockGroupRequest(int groupId) async {
|
||||
var entity = await ApiRepository.to.editLockGroupRequest(groupId:groupId, groupName:state.changeNameController.text);
|
||||
final MassSendLockGroupListEntity entity = await ApiRepository.to.editLockGroupRequest(groupId:groupId, groupName:state.changeNameController.text);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
showToast("编辑成功".tr);
|
||||
mockNetworkDataRequest();
|
||||
showToast('编辑成功'.tr, something: (){
|
||||
mockNetworkDataRequest();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//删除组
|
||||
Future<void> deleteLockGroupRequest(int groupId) async {
|
||||
var entity = await ApiRepository.to.deleteGroup(groupId);
|
||||
final MassSendLockGroupListEntity entity = await ApiRepository.to.deleteGroup(groupId);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
showToast("删除成功".tr);
|
||||
mockNetworkDataRequest();
|
||||
showToast('删除成功'.tr, something: (){
|
||||
mockNetworkDataRequest();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// 监听修改完详情之后刷新列表
|
||||
late StreamSubscription _teamEvent;
|
||||
void _initRefreshAction() {
|
||||
_teamEvent = eventBus.on<LockGroupEditGroupLockRefreshEvent>().listen((event) {
|
||||
_teamEvent = eventBus.on<LockGroupEditGroupLockRefreshEvent>().listen((LockGroupEditGroupLockRefreshEvent event) {
|
||||
mockNetworkDataRequest();
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
// TODO: implement onReady
|
||||
super.onReady();
|
||||
_initRefreshAction();
|
||||
|
||||
mockNetworkDataRequest();
|
||||
}
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
// TODO: implement onInit
|
||||
super.onInit();
|
||||
}
|
||||
|
||||
@override
|
||||
void onClose() {
|
||||
// TODO: implement onClose
|
||||
_teamEvent.cancel();
|
||||
}
|
||||
|
||||
|
||||
@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupListEntity.dart';
|
||||
import 'package:star_lock/mine/mineSet/lockGroup/lockGroupList/lockGroupList_state.dart';
|
||||
import 'package:star_lock/tools/showTipView.dart';
|
||||
|
||||
import '../../../../../../appRouters.dart';
|
||||
@ -11,7 +12,6 @@ import '../../../../../../tools/titleAppBar.dart';
|
||||
import '../../../../../../translations/trans_lib.dart';
|
||||
import '../../../../tools/left_slide_actions.dart';
|
||||
import '../../../../tools/noData.dart';
|
||||
import '../../../../tools/showIosTipView.dart';
|
||||
import 'lockGroupList_logic.dart';
|
||||
|
||||
class LockGroupListPage extends StatefulWidget {
|
||||
@ -22,8 +22,8 @@ class LockGroupListPage extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _LockGroupListPageState extends State<LockGroupListPage> {
|
||||
final logic = Get.put(LockGroupListLogic());
|
||||
final state = Get.find<LockGroupListLogic>().state;
|
||||
final LockGroupListLogic logic = Get.put(LockGroupListLogic());
|
||||
final LockGroupListState state = Get.find<LockGroupListLogic>().state;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@ -32,7 +32,7 @@ class _LockGroupListPageState extends State<LockGroupListPage> {
|
||||
appBar: TitleAppBar(
|
||||
barTitle: TranslationLoader.lanKeys!.lockGroup!.tr,
|
||||
haveBack: true,
|
||||
actionsList: [
|
||||
actionsList: <Widget>[
|
||||
IconButton(
|
||||
icon: Image.asset(
|
||||
'images/icon_add_white.png',
|
||||
@ -41,7 +41,7 @@ class _LockGroupListPageState extends State<LockGroupListPage> {
|
||||
),
|
||||
onPressed: () {
|
||||
// 处理操作按钮的点击事件-添加锁分组
|
||||
state.changeNameController.text = "";
|
||||
state.changeNameController.text = '';
|
||||
// showCupertinoAlertDialog(context, true, 0);
|
||||
ShowTipView().showTFViewAlertDialog(
|
||||
state.changeNameController,
|
||||
@ -61,7 +61,7 @@ class _LockGroupListPageState extends State<LockGroupListPage> {
|
||||
],
|
||||
backgroundColor: AppColors.mainColor),
|
||||
body: Column(
|
||||
children: [
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: Obx(() => state.itemDataList.value.isEmpty
|
||||
? NoData()
|
||||
@ -73,16 +73,16 @@ class _LockGroupListPageState extends State<LockGroupListPage> {
|
||||
|
||||
Widget _buildMainUI() {
|
||||
for (int i = 0; i < state.itemDataList.value.length; i++) {
|
||||
GroupListItem itemData = state.itemDataList.value[i];
|
||||
final GroupListItem itemData = state.itemDataList.value[i];
|
||||
state.lockNum += itemData.lockList!.length;
|
||||
}
|
||||
return ListView.separated(
|
||||
itemCount: state.itemDataList.value.length + 1,
|
||||
itemBuilder: (c, index) {
|
||||
itemBuilder: (BuildContext c, int index) {
|
||||
if (index == state.itemDataList.value.length) {
|
||||
return Center(
|
||||
child: Column(
|
||||
children: [
|
||||
children: <Widget>[
|
||||
SizedBox(
|
||||
height: 20.h,
|
||||
),
|
||||
@ -98,7 +98,7 @@ class _LockGroupListPageState extends State<LockGroupListPage> {
|
||||
),
|
||||
);
|
||||
} else {
|
||||
GroupListItem itemData = state.itemDataList.value[index];
|
||||
final GroupListItem itemData = state.itemDataList.value[index];
|
||||
if (itemData.groupType == 0) {
|
||||
state.ungrouped = itemData;
|
||||
}
|
||||
@ -107,23 +107,22 @@ class _LockGroupListPageState extends State<LockGroupListPage> {
|
||||
key: Key(itemData.keyGroupId!.toString()),
|
||||
actionsWidth: itemData.groupType != 0 ? 200.w : 0,
|
||||
actions: itemData.groupType != 0
|
||||
? [
|
||||
? <Widget>[
|
||||
_buildEditBtn(itemData),
|
||||
_buildDeleteBtn(itemData),
|
||||
]
|
||||
: [],
|
||||
: <Widget>[],
|
||||
decoration: const BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(1)),
|
||||
),
|
||||
child: CommonItem(
|
||||
leftTitel:
|
||||
'${itemData.keyGroupName}(${itemData.lockList?.length})',
|
||||
rightTitle: "",
|
||||
leftTitel: '${itemData.keyGroupName}(${itemData.lockList?.length})',
|
||||
rightTitle: '',
|
||||
allHeight: 70.h,
|
||||
action: () {
|
||||
Get.toNamed(Routers.lockItemListPage, arguments: {
|
||||
Get.toNamed(Routers.lockItemListPage, arguments: <String, GroupListItem>{
|
||||
'groupListItem': itemData,
|
||||
"ungrouped": state.ungrouped
|
||||
'ungrouped': state.ungrouped
|
||||
});
|
||||
}),
|
||||
);
|
||||
@ -139,41 +138,12 @@ class _LockGroupListPageState extends State<LockGroupListPage> {
|
||||
});
|
||||
}
|
||||
|
||||
// void showCupertinoAlertDialog(BuildContext context, bool isAdd, int groupId) {
|
||||
// showDialog(
|
||||
// context: context,
|
||||
// builder: (BuildContext context) {
|
||||
// return ShowTFView(
|
||||
// title: isAdd ? TranslationLoader.lanKeys!.createNewGroup!.tr : "修改名称",
|
||||
// tipTitle: TranslationLoader.lanKeys!.pleaseEnter!.tr,
|
||||
// controller: state.changeNameController,
|
||||
// sureClick: () {
|
||||
// //发送编辑钥匙名称请求
|
||||
// if (state.changeNameController.text.isNotEmpty) {
|
||||
// if(isAdd == true){
|
||||
// logic.addLockGroupRequest();
|
||||
// }else{
|
||||
// logic.editLockGroupRequest(groupId);
|
||||
// }
|
||||
// Get.back();
|
||||
// } else {
|
||||
// logic.showToast(TranslationLoader.lanKeys!.pleaseEnterAGroupName!.tr);
|
||||
// }
|
||||
// },
|
||||
// cancelClick: () {
|
||||
// Get.back();
|
||||
// },
|
||||
// );
|
||||
// },
|
||||
// );
|
||||
// }
|
||||
|
||||
Widget _buildDeleteBtn(GroupListItem groupListItem) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
// 省略: 弹出是否删除的确认对话框。
|
||||
// showIosTipViewDialog(context, groupListItem);
|
||||
ShowTipView().showIosTipWithContentDialog("分组下的锁将被移到未分组里".tr, () {
|
||||
ShowTipView().showIosTipWithContentDialog('分组下的锁将被移到未分组里'.tr, () {
|
||||
logic.deleteLockGroupRequest(groupListItem.keyGroupId!);
|
||||
});
|
||||
},
|
||||
@ -203,9 +173,10 @@ class _LockGroupListPageState extends State<LockGroupListPage> {
|
||||
|
||||
ShowTipView().showTFViewAlertDialog(
|
||||
state.changeNameController,
|
||||
TranslationLoader.lanKeys!.createNewGroup!.tr,
|
||||
'修改名称'.tr,
|
||||
TranslationLoader.lanKeys!.pleaseEnter!.tr, () {
|
||||
if (state.changeNameController.text.isNotEmpty) {
|
||||
Get.back();
|
||||
logic.editLockGroupRequest(groupListItem.keyGroupId!);
|
||||
} else {
|
||||
logic.showToast(
|
||||
@ -218,7 +189,7 @@ class _LockGroupListPageState extends State<LockGroupListPage> {
|
||||
color: AppColors.mainColor,
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
"重命名".tr,
|
||||
'重命名'.tr,
|
||||
style: const TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
@ -229,23 +200,4 @@ class _LockGroupListPageState extends State<LockGroupListPage> {
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// void showIosTipViewDialog(BuildContext context, GroupListItem groupListItem) {
|
||||
// showDialog(
|
||||
// context: context,
|
||||
// builder: (BuildContext context) {
|
||||
// return ShowIosTipView(
|
||||
// title: TranslationLoader.lanKeys!.hint!.tr,
|
||||
// tipTitle: "分组下的锁将被移到未分组里",
|
||||
// sureClick: () {
|
||||
// Get.back();
|
||||
// logic.deleteLockGroupRequest(groupListItem.keyGroupId!);
|
||||
// },
|
||||
// cancelClick: () {
|
||||
// Get.back();
|
||||
// },
|
||||
// );
|
||||
// }
|
||||
// );
|
||||
// }
|
||||
}
|
||||
|
||||
@ -6,8 +6,8 @@ import '../../../../main/lockDetail/electronicKey/massSendElectronicKey/massSend
|
||||
class LockGroupListState {
|
||||
|
||||
TextEditingController changeNameController = TextEditingController();
|
||||
var itemDataList = <GroupListItem>[].obs;
|
||||
RxList<GroupListItem> itemDataList = <GroupListItem>[].obs;
|
||||
int lockNum = 0;
|
||||
var ungrouped = GroupListItem();
|
||||
GroupListItem ungrouped = GroupListItem();
|
||||
|
||||
}
|
||||
@ -7,17 +7,16 @@ import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/ma
|
||||
|
||||
class ExpandedListTile extends StatefulWidget {
|
||||
const ExpandedListTile(
|
||||
{Key? key,
|
||||
{required this.isShowBtn, required this.groupItem, required this.typeImgList, Key? key,
|
||||
this.child,
|
||||
this.onTap,
|
||||
required this.groupItem,
|
||||
required this.typeImgList})
|
||||
this.onTap})
|
||||
: super(key: key);
|
||||
|
||||
final Widget? child;
|
||||
final List typeImgList;
|
||||
final Function()? onTap;
|
||||
final GroupListItem groupItem;
|
||||
final bool isShowBtn;
|
||||
|
||||
@override
|
||||
_ExpandedListTileState createState() => _ExpandedListTileState();
|
||||
@ -53,44 +52,48 @@ class _ExpandedListTileState extends State<ExpandedListTile> {
|
||||
|
||||
List<Widget> _buildExpandRowList() {
|
||||
List<Widget> widgetList = [];
|
||||
widgetList.add(GestureDetector(
|
||||
child: Container(
|
||||
color: Colors.white,
|
||||
width: 80.w,
|
||||
child: Row(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 30.w,
|
||||
),
|
||||
Image.asset(
|
||||
_isCheck
|
||||
? "images/icon_round_select.png"
|
||||
: "images/icon_round_unSelect.png",
|
||||
width: 30.w,
|
||||
height: 30.w,
|
||||
color: widget.groupItem.isVip ? AppColors.mainColor : Colors.grey,
|
||||
),
|
||||
SizedBox(
|
||||
width: 20.w,
|
||||
)
|
||||
],
|
||||
|
||||
if(widget.isShowBtn){
|
||||
widgetList.add(GestureDetector(
|
||||
child: Container(
|
||||
color: Colors.white,
|
||||
width: 80.w,
|
||||
child: Row(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 30.w,
|
||||
),
|
||||
Image.asset(
|
||||
_isCheck
|
||||
? 'images/icon_round_select.png'
|
||||
: 'images/icon_round_unSelect.png',
|
||||
width: 30.w,
|
||||
height: 30.w,
|
||||
color: widget.groupItem.isVip ? AppColors.mainColor : Colors.grey,
|
||||
),
|
||||
SizedBox(
|
||||
width: 20.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
if (widget.groupItem.isVip == false) {
|
||||
return;
|
||||
}
|
||||
//点击左侧是否勾选按钮
|
||||
setState(() {
|
||||
_isCheck = !_isCheck;
|
||||
widget.groupItem.isChecked = _isCheck;
|
||||
});
|
||||
widget.onTap?.call();
|
||||
},
|
||||
));
|
||||
onTap: () {
|
||||
if (widget.groupItem.isVip == false) {
|
||||
return;
|
||||
}
|
||||
//点击左侧是否勾选按钮
|
||||
setState(() {
|
||||
_isCheck = !_isCheck;
|
||||
widget.groupItem.isChecked = _isCheck;
|
||||
});
|
||||
widget.onTap?.call();
|
||||
},
|
||||
));
|
||||
}
|
||||
|
||||
widgetList.add(GestureDetector(
|
||||
child: Container(
|
||||
width: ScreenUtil().screenWidth - 80.w,
|
||||
width: ScreenUtil().screenWidth - (widget.isShowBtn ? 80.w : 0),
|
||||
color: Colors.white,
|
||||
child: Row(
|
||||
children: [
|
||||
@ -100,7 +103,7 @@ class _ExpandedListTileState extends State<ExpandedListTile> {
|
||||
// height: 36.w,
|
||||
// ),
|
||||
SizedBox(
|
||||
width: 10.w,
|
||||
width: widget.isShowBtn ? 10.w :30.w,
|
||||
),
|
||||
Text(
|
||||
widget.groupItem.keyGroupName ?? '',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user