1,登录接口新增是否VIP标识
2,群发电子钥匙代码结构重构及高级功能相关逻辑处理 3,选择锁分组、用户管理高级功能相关逻辑增加 4,新增公用高级功能顶部提示框组件
This commit is contained in:
parent
f5963a166d
commit
6d186ec0a4
BIN
star_lock/images/icon_btn_disableAdd.png
Normal file
BIN
star_lock/images/icon_btn_disableAdd.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
@ -789,5 +789,6 @@
|
||||
"文件校验失败 0x03": "File verification failed 0x03",
|
||||
"固件升级完成": "Firmware upgrade completed",
|
||||
"记录":"Record",
|
||||
"开通高级功能后才可以对锁进行管理":"You can manage locks only after the advanced function is enabled"
|
||||
"开通高级功能后才可以对锁进行管理":"You can manage locks only after the advanced function is enabled",
|
||||
"去开通":"Go and Activate"
|
||||
}
|
||||
|
||||
@ -816,5 +816,6 @@
|
||||
"文件校验失败 0x03":"文件校验失败 0x03",
|
||||
"固件升级完成":"固件升级完成",
|
||||
"记录":"记录",
|
||||
"开通高级功能后才可以对锁进行管理":"开通高级功能后才可以对锁进行管理"
|
||||
"开通高级功能后才可以对锁进行管理":"开通高级功能后才可以对锁进行管理",
|
||||
"去开通":"去开通"
|
||||
}
|
||||
|
||||
@ -819,5 +819,6 @@
|
||||
"文件校验失败 0x02":"文件校验失败 0x02",
|
||||
"文件校验失败 0x03":"文件校验失败 0x03",
|
||||
"固件升级完成":"固件升级完成",
|
||||
"开通高级功能后才可以对锁进行管理":"开通高级功能后才可以对锁进行管理"
|
||||
"开通高级功能后才可以对锁进行管理":"开通高级功能后才可以对锁进行管理",
|
||||
"去开通":"去开通"
|
||||
}
|
||||
|
||||
@ -1,15 +1,16 @@
|
||||
class LoginData {
|
||||
LoginData({
|
||||
this.accessToken,
|
||||
this.userid,
|
||||
this.expiresAt,
|
||||
this.expiresAtString,
|
||||
this.mobile,
|
||||
this.headUrl,
|
||||
this.email,
|
||||
this.nickname,
|
||||
this.haveSafeAnswer,
|
||||
this.uid});
|
||||
LoginData(
|
||||
{this.accessToken,
|
||||
this.userid,
|
||||
this.expiresAt,
|
||||
this.expiresAtString,
|
||||
this.mobile,
|
||||
this.headUrl,
|
||||
this.email,
|
||||
this.nickname,
|
||||
this.haveSafeAnswer,
|
||||
this.uid,
|
||||
this.isVip});
|
||||
|
||||
LoginData.fromJson(dynamic json) {
|
||||
accessToken = json['accessToken'];
|
||||
@ -22,6 +23,7 @@ class LoginData {
|
||||
nickname = json['nickname'];
|
||||
haveSafeAnswer = json['haveSafeAnswer'];
|
||||
uid = json['uid'];
|
||||
isVip = json['isVip'];
|
||||
}
|
||||
String? accessToken;
|
||||
int? userid;
|
||||
@ -33,6 +35,7 @@ class LoginData {
|
||||
String? nickname;
|
||||
bool? haveSafeAnswer;
|
||||
int? uid;
|
||||
int? isVip;
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final map = <String, dynamic>{};
|
||||
@ -46,7 +49,7 @@ class LoginData {
|
||||
map['nickname'] = nickname;
|
||||
map['haveSafeAnswer'] = haveSafeAnswer;
|
||||
map['uid'] = uid;
|
||||
map['isVip'] = isVip;
|
||||
return map;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -24,6 +24,7 @@ class StarLockLoginLogic extends BaseGetXController {
|
||||
username: state.emailOrPhone.value);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
Storage.saveLoginData(entity.data);
|
||||
Storage.setBool(saveIsVip, entity.data!.isVip! == 0 ? false : true);
|
||||
eventBus.fire(MineInfoChangeRefreshUI());
|
||||
// Get.back();
|
||||
// Get.toNamed(Routers.starLockMain);
|
||||
|
||||
@ -1,37 +1,35 @@
|
||||
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
import '../../../../../common/XSConstantMacro/XSConstantMacro.dart';
|
||||
import '../../../../../network/api_repository.dart';
|
||||
import '../../../../../tools/dateTool.dart';
|
||||
import '../massSendLockGroupList/lockUserList/lockUserListEntity.dart';
|
||||
import '../massSendLockGroupList/lockUserList/lockUserList_entity.dart';
|
||||
import 'massSendElectronicKey_state.dart';
|
||||
|
||||
class MassSendElectronicKeyLogic extends BaseGetXController{
|
||||
class MassSendElectronicKeyLogic extends BaseGetXController {
|
||||
MassSendElectronicKeyState state = MassSendElectronicKeyState();
|
||||
|
||||
//群发钥匙检查
|
||||
Future<void> massKeyChecksRequest() async {
|
||||
String getFailureDateTime = '0';
|
||||
if (int.parse(state.type.value) != 1) {
|
||||
getFailureDateTime = DateTool().dateToTimestamp(state.endTime.value, 1).toString();
|
||||
getFailureDateTime =
|
||||
DateTool().dateToTimestamp(state.endTime.value, 1).toString();
|
||||
}
|
||||
if(state.lockIdList.isEmpty){
|
||||
if (state.lockIdList.isEmpty) {
|
||||
showToast("请选择锁".tr);
|
||||
return;
|
||||
}
|
||||
|
||||
if(state.receiverList.isEmpty){
|
||||
if (state.receiverList.isEmpty) {
|
||||
showToast("请选择接收者".tr);
|
||||
return;
|
||||
}
|
||||
var entity = await ApiRepository.to.canSendKey(
|
||||
getFailureDateTime,
|
||||
state.lockIdList
|
||||
);
|
||||
var entity =
|
||||
await ApiRepository.to.canSendKey(getFailureDateTime, state.lockIdList);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
for (int i = 0; i < state.receiverList.length; i++) {
|
||||
LockUserData data = state.receiverList[i];
|
||||
LockUserItemData data = state.receiverList[i];
|
||||
batchSendElectronicKeyRequest(data.userid ?? '', data.nickname ?? '');
|
||||
}
|
||||
} else {
|
||||
@ -40,7 +38,8 @@ class MassSendElectronicKeyLogic extends BaseGetXController{
|
||||
}
|
||||
|
||||
//批处理群发钥匙
|
||||
Future<void> batchSendElectronicKeyRequest(String receiverUserID, String receiverUserName) async {
|
||||
Future<void> batchSendElectronicKeyRequest(
|
||||
String receiverUserID, String receiverUserName) async {
|
||||
//发送钥匙请求
|
||||
var startDate = "0";
|
||||
var endDate = "0";
|
||||
@ -51,8 +50,10 @@ class MassSendElectronicKeyLogic extends BaseGetXController{
|
||||
case 0:
|
||||
{
|
||||
typeValue = XSConstantMacro.keyTypeTime;
|
||||
startDate = DateTool().dateToTimestamp(state.beginTime.value, 1).toString();
|
||||
endDate = DateTool().dateToTimestamp(state.endTime.value, 1).toString();
|
||||
startDate =
|
||||
DateTool().dateToTimestamp(state.beginTime.value, 1).toString();
|
||||
endDate =
|
||||
DateTool().dateToTimestamp(state.endTime.value, 1).toString();
|
||||
startTime = "0";
|
||||
endTime = "0";
|
||||
|
||||
@ -88,10 +89,15 @@ class MassSendElectronicKeyLogic extends BaseGetXController{
|
||||
showToast("请选择有效期".tr);
|
||||
return;
|
||||
}
|
||||
startDate = DateTool().dateToTimestamp(state.beginTime.value, 1).toString();
|
||||
startDate =
|
||||
DateTool().dateToTimestamp(state.beginTime.value, 1).toString();
|
||||
endDate = DateTool().dateToTimestamp(state.endTime.value, 1).toString();
|
||||
startTime = DateTool().dateToTimestamp(state.effectiveDateTime.value, 0).toString();
|
||||
endTime = DateTool().dateToTimestamp(state.failureDateTime.value, 0).toString();
|
||||
startTime = DateTool()
|
||||
.dateToTimestamp(state.effectiveDateTime.value, 0)
|
||||
.toString();
|
||||
endTime = DateTool()
|
||||
.dateToTimestamp(state.failureDateTime.value, 0)
|
||||
.toString();
|
||||
break;
|
||||
default:
|
||||
typeValue = XSConstantMacro.keyTypeTime;
|
||||
@ -112,8 +118,7 @@ class MassSendElectronicKeyLogic extends BaseGetXController{
|
||||
startTime: int.parse(startTime),
|
||||
endTime: int.parse(endTime),
|
||||
remoteUnlockSwitch: state.isRemoteUnlock.value ? 1 : 2,
|
||||
keyRight: 0
|
||||
);
|
||||
keyRight: 0);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
state.isSendSuccess.value = true;
|
||||
resetData();
|
||||
@ -128,12 +133,14 @@ class MassSendElectronicKeyLogic extends BaseGetXController{
|
||||
}
|
||||
|
||||
void resetData() {
|
||||
if(state.type.value == "0"){
|
||||
state.beginTime.value = DateTool().dateToYMDHNString(DateTime.now().millisecondsSinceEpoch.toString()); //默认为当前时间
|
||||
state.endTime.value = DateTool().dateToYMDHNString(DateTime.now().millisecondsSinceEpoch.toString());//默认为当前时间
|
||||
}else{
|
||||
if (state.type.value == "0") {
|
||||
state.beginTime.value = DateTool().dateToYMDHNString(
|
||||
DateTime.now().millisecondsSinceEpoch.toString()); //默认为当前时间
|
||||
state.endTime.value = DateTool().dateToYMDHNString(
|
||||
DateTime.now().millisecondsSinceEpoch.toString()); //默认为当前时间
|
||||
} else {
|
||||
state.beginTime.value = ""; //默认为当前时间
|
||||
state.endTime.value = "";//默认为当前时间
|
||||
state.endTime.value = ""; //默认为当前时间
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@ class LockUserListEntity {
|
||||
int? errorCode;
|
||||
String? description;
|
||||
String? errorMsg;
|
||||
List<LockUserData>? data;
|
||||
List<LockUserItemData>? data;
|
||||
|
||||
LockUserListEntity(
|
||||
{this.errorCode, this.description, this.errorMsg, this.data});
|
||||
@ -12,9 +12,9 @@ class LockUserListEntity {
|
||||
description = json['description'];
|
||||
errorMsg = json['errorMsg'];
|
||||
if (json['data'] != null) {
|
||||
data = <LockUserData>[];
|
||||
data = <LockUserItemData>[];
|
||||
json['data'].forEach((v) {
|
||||
data!.add(LockUserData.fromJson(v));
|
||||
data!.add(LockUserItemData.fromJson(v));
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -31,17 +31,17 @@ class LockUserListEntity {
|
||||
}
|
||||
}
|
||||
|
||||
class LockUserData {
|
||||
class LockUserItemData {
|
||||
int? uid;
|
||||
String? nickname;
|
||||
String? headUrl;
|
||||
String? userid;
|
||||
bool? isCheck = false;
|
||||
|
||||
LockUserData(
|
||||
LockUserItemData(
|
||||
{this.uid, this.nickname, this.headUrl, this.userid, this.isCheck});
|
||||
|
||||
LockUserData.fromJson(Map<String, dynamic> json) {
|
||||
LockUserItemData.fromJson(Map<String, dynamic> json) {
|
||||
uid = json['uid'];
|
||||
nickname = json['nickname'];
|
||||
headUrl = json['headUrl'];
|
||||
@ -0,0 +1,18 @@
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserList_entity.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserList_state.dart';
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
|
||||
class LockUserListLogic extends BaseGetXController {
|
||||
LockUserListState state = LockUserListState();
|
||||
|
||||
//请求锁用户列表
|
||||
Future<void> lockUserListRequest() async {
|
||||
LockUserListEntity entity = await ApiRepository.to.lockUserList(
|
||||
state.pageNo.value.toString(), state.pageSize.value.toString(), '');
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
state.dataList.value = entity.data!;
|
||||
state.dataList.refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,13 +1,12 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/utils.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/app_settings/app_colors.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserListEntity.dart';
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserList_entity.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserList_logic.dart';
|
||||
import 'package:star_lock/tools/keySearchWidget.dart';
|
||||
import 'package:star_lock/tools/noData.dart';
|
||||
import 'package:star_lock/tools/submitBtn.dart';
|
||||
import 'package:star_lock/translations/trans_lib.dart';
|
||||
|
||||
class LockUserListPage extends StatefulWidget {
|
||||
const LockUserListPage({Key? key}) : super(key: key);
|
||||
@ -19,14 +18,14 @@ class LockUserListPage extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _LockUserListPageState extends State<LockUserListPage> {
|
||||
List<LockUserData> dataList = [];
|
||||
List selectUserIdList = [];
|
||||
List<LockUserData> selectDataList = [];
|
||||
final logic = Get.put(LockUserListLogic());
|
||||
final state = Get.find<LockUserListLogic>().state;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
||||
lockUserListRequest();
|
||||
logic.lockUserListRequest();
|
||||
}
|
||||
|
||||
@override
|
||||
@ -52,24 +51,29 @@ class _LockUserListPageState extends State<LockUserListPage> {
|
||||
SizedBox(
|
||||
height: 20.h,
|
||||
),
|
||||
_searchWidget(),
|
||||
KeySearchWidget(
|
||||
editingController: state.searchController,
|
||||
onSubmittedAction: () {
|
||||
logic.lockUserListRequest();
|
||||
},
|
||||
),
|
||||
SizedBox(
|
||||
height: 20.h,
|
||||
),
|
||||
Expanded(
|
||||
child: dataList.isEmpty
|
||||
Obx(() => Expanded(
|
||||
child: state.dataList.isEmpty
|
||||
? NoData()
|
||||
: ListView.separated(
|
||||
itemBuilder: (context, index) {
|
||||
LockUserData indexEntity = dataList[index];
|
||||
LockUserItemData indexEntity = state.dataList[index];
|
||||
return _electronicKeyItem(indexEntity);
|
||||
},
|
||||
itemCount: dataList.length,
|
||||
itemCount: state.dataList.length,
|
||||
separatorBuilder: (context, index) {
|
||||
return const Divider(
|
||||
height: 1, color: AppColors.greyLineColor);
|
||||
},
|
||||
)),
|
||||
))),
|
||||
Container(
|
||||
height: 120.h,
|
||||
padding: EdgeInsets.only(left: 20.w, right: 20.w, top: 0.h),
|
||||
@ -77,22 +81,22 @@ class _LockUserListPageState extends State<LockUserListPage> {
|
||||
color: Colors.white,
|
||||
child: Row(
|
||||
children: [
|
||||
Text(
|
||||
'${"已选中".tr}:${selectUserIdList.length}',
|
||||
style: TextStyle(color: Colors.black, fontSize: 24.sp),
|
||||
),
|
||||
Obx(() => Text(
|
||||
'${"已选中".tr}:${state.selectUserIdList.length}',
|
||||
style: TextStyle(color: Colors.black, fontSize: 24.sp),
|
||||
)),
|
||||
Expanded(
|
||||
child: SizedBox(
|
||||
width: 20.w,
|
||||
)),
|
||||
SizedBox(
|
||||
width: 120.w,
|
||||
width: 160.w,
|
||||
height: 60.h,
|
||||
child: SubmitBtn(
|
||||
btnName: '确定'.tr,
|
||||
onClick: () {
|
||||
Map<String, dynamic> resultMap = {};
|
||||
resultMap['lockUserList'] = selectDataList;
|
||||
resultMap['lockUserList'] = state.selectDataList.value;
|
||||
Navigator.pop(context, resultMap);
|
||||
},
|
||||
),
|
||||
@ -104,42 +108,7 @@ class _LockUserListPageState extends State<LockUserListPage> {
|
||||
));
|
||||
}
|
||||
|
||||
Widget _searchWidget() {
|
||||
return Container(
|
||||
height: 60.h,
|
||||
margin: EdgeInsets.only(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 _electronicKeyItem(LockUserData itemData) {
|
||||
Widget _electronicKeyItem(LockUserItemData itemData) {
|
||||
return Container(
|
||||
color: Colors.white,
|
||||
height: 90.h,
|
||||
@ -188,16 +157,15 @@ class _LockUserListPageState extends State<LockUserListPage> {
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
itemData.isCheck = !itemData.isCheck!;
|
||||
if (itemData.isCheck == true) {
|
||||
selectUserIdList.add(itemData.userid);
|
||||
selectDataList.add(itemData);
|
||||
} else {
|
||||
selectUserIdList.remove(itemData.userid);
|
||||
selectDataList.remove(itemData);
|
||||
}
|
||||
});
|
||||
itemData.isCheck = !itemData.isCheck!;
|
||||
if (itemData.isCheck == true) {
|
||||
state.selectUserIdList.add(itemData.userid);
|
||||
state.selectDataList.add(itemData);
|
||||
} else {
|
||||
state.selectUserIdList.remove(itemData.userid);
|
||||
state.selectDataList.remove(itemData);
|
||||
}
|
||||
setState(() {});
|
||||
},
|
||||
child: Image.asset(
|
||||
itemData.isCheck!
|
||||
@ -211,16 +179,4 @@ class _LockUserListPageState extends State<LockUserListPage> {
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
//请求锁用户列表
|
||||
Future<List<LockUserData>> lockUserListRequest() async {
|
||||
LockUserListEntity entity =
|
||||
await ApiRepository.to.lockUserList('1', '20', '');
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
setState(() {
|
||||
dataList = entity.data!;
|
||||
});
|
||||
}
|
||||
return dataList;
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,12 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserList_entity.dart';
|
||||
|
||||
class LockUserListState {
|
||||
final TextEditingController searchController = TextEditingController();
|
||||
var dataList = <LockUserItemData>[].obs;
|
||||
var selectUserIdList = [].obs;
|
||||
var selectDataList = <LockUserItemData>[].obs;
|
||||
var pageNo = 1.obs;
|
||||
var pageSize = 20.obs;
|
||||
}
|
||||
@ -1,4 +1,3 @@
|
||||
import 'package:star_lock/app_settings/app_settings.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupListEntity.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupList_state.dart';
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
@ -26,6 +25,5 @@ class MassSendLockGroupListLogic extends BaseGetXController {
|
||||
|
||||
var isVip = await Storage.getBool(saveIsVip);
|
||||
state.isVip.value = isVip ?? false;
|
||||
AppLog.log('isVip: ${state.isVip.value}');
|
||||
}
|
||||
}
|
||||
|
||||
@ -7,6 +7,7 @@ import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/ma
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupListEntity.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupList_logic.dart';
|
||||
import 'package:star_lock/tools/ExpandedListView.dart';
|
||||
import 'package:star_lock/tools/advancedFunctionHandle.dart';
|
||||
import 'package:star_lock/tools/submitBtn.dart';
|
||||
import 'package:star_lock/translations/trans_lib.dart';
|
||||
|
||||
@ -53,39 +54,8 @@ class _MassSendLockGroupListPageState extends State<MassSendLockGroupListPage> {
|
||||
children: [
|
||||
Obx(() => Visibility(
|
||||
visible: state.isVip.value ? false : true,
|
||||
child: Container(
|
||||
color: AppColors.vipFeatureBgColor,
|
||||
padding: EdgeInsets.only(left: 20.w, right: 20.w),
|
||||
height: 80.h,
|
||||
child: Row(
|
||||
children: [
|
||||
Text('开通高级功能后才可以对锁进行管理'.tr,
|
||||
style: TextStyle(
|
||||
color: AppColors.vipFeatureBtnTextColor,
|
||||
fontSize: 22.sp)),
|
||||
Expanded(
|
||||
child: SizedBox(
|
||||
width: 10.w,
|
||||
)),
|
||||
SizedBox(
|
||||
width: 150.w,
|
||||
height: 46.h,
|
||||
child: ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: AppColors.vipFeatureBtnBgColor,
|
||||
),
|
||||
onPressed: () {
|
||||
Get.toNamed(Routers.advancedFeaturesWebPage);
|
||||
},
|
||||
child: Text(
|
||||
'去开通',
|
||||
style: TextStyle(
|
||||
color: Colors.white, fontSize: 22.sp),
|
||||
)),
|
||||
)
|
||||
],
|
||||
),
|
||||
))),
|
||||
child: AdvancedFunctionHandle()
|
||||
.topTipsAdvancedFeatures('开通高级功能后才可以对锁进行管理'.tr))),
|
||||
SizedBox(
|
||||
height: 10.h,
|
||||
),
|
||||
|
||||
@ -2,15 +2,14 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_native_contact_picker/flutter_native_contact_picker.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get_utils/get_utils.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserListEntity.dart';
|
||||
import 'package:star_lock/tools/commonItem.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserList_entity.dart';
|
||||
import 'package:star_lock/translations/trans_lib.dart';
|
||||
|
||||
import '../../../../../../app_settings/app_colors.dart';
|
||||
|
||||
class MassSendReceiverCell extends StatelessWidget {
|
||||
final int currentIndex;
|
||||
LockUserData userData;
|
||||
LockUserItemData userData;
|
||||
final VoidCallback clickDeleteUser;
|
||||
final FlutterContactPicker contactPicker = FlutterContactPicker();
|
||||
late Contact contact;
|
||||
@ -103,17 +102,16 @@ class MassSendReceiverCell extends StatelessWidget {
|
||||
return controller;
|
||||
}
|
||||
|
||||
Widget massSendReceiverCellWidget(
|
||||
{
|
||||
String? leftTitel,
|
||||
String? rightTitle,
|
||||
bool? isHaveDirection,
|
||||
bool? isHaveLine,
|
||||
bool? isHaveRightWidget,
|
||||
Widget? rightWidget,
|
||||
Function()? action,
|
||||
double? allHeight,
|
||||
}){
|
||||
Widget massSendReceiverCellWidget({
|
||||
String? leftTitel,
|
||||
String? rightTitle,
|
||||
bool? isHaveDirection,
|
||||
bool? isHaveLine,
|
||||
bool? isHaveRightWidget,
|
||||
Widget? rightWidget,
|
||||
Function()? action,
|
||||
double? allHeight,
|
||||
}) {
|
||||
return Column(
|
||||
// mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
@ -132,14 +130,14 @@ class MassSendReceiverCell extends StatelessWidget {
|
||||
isHaveRightWidget!
|
||||
? rightWidget!
|
||||
: Text(
|
||||
rightTitle ?? "",
|
||||
textAlign: TextAlign.end,
|
||||
// overflow: TextOverflow.ellipsis,
|
||||
// maxLines: 1,
|
||||
style: TextStyle(
|
||||
fontSize: 22.sp,
|
||||
color: AppColors.darkGrayTextColor),
|
||||
)
|
||||
rightTitle ?? "",
|
||||
textAlign: TextAlign.end,
|
||||
// overflow: TextOverflow.ellipsis,
|
||||
// maxLines: 1,
|
||||
style: TextStyle(
|
||||
fontSize: 22.sp,
|
||||
color: AppColors.darkGrayTextColor),
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
@ -151,7 +149,7 @@ class MassSendReceiverCell extends StatelessWidget {
|
||||
|
||||
// 接受者信息输入框
|
||||
Widget getTFWidget(
|
||||
bool isHaveBtn, String tfStr, int lineIndex, LockUserData userData) {
|
||||
bool isHaveBtn, String tfStr, int lineIndex, LockUserItemData userData) {
|
||||
return SizedBox(
|
||||
height: 50.h,
|
||||
width: 380.w,
|
||||
|
||||
@ -0,0 +1,20 @@
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserList_entity.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendReceiver/massSendReceiver_state.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
import 'package:star_lock/tools/storage.dart';
|
||||
|
||||
class MassSendReceiverLogic extends BaseGetXController {
|
||||
MassSendReceiverState state = MassSendReceiverState();
|
||||
|
||||
@override
|
||||
Future<void> onReady() async {
|
||||
super.onReady();
|
||||
|
||||
LockUserItemData data = LockUserItemData();
|
||||
state.lockUserList.add(data);
|
||||
|
||||
var isVip = await Storage.getBool(saveIsVip);
|
||||
state.isVip.value = isVip ?? false;
|
||||
state.isVip.refresh();
|
||||
}
|
||||
}
|
||||
@ -1,10 +1,12 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/utils.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/appRouters.dart';
|
||||
import 'package:star_lock/app_settings/app_colors.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserListEntity.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserList_entity.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendReceiver/massSendReceiverCell.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendReceiver/massSendReceiver_logic.dart';
|
||||
import 'package:star_lock/tools/advancedFunctionHandle.dart';
|
||||
import 'package:star_lock/tools/commonItem.dart';
|
||||
import 'package:star_lock/translations/trans_lib.dart';
|
||||
|
||||
@ -18,20 +20,8 @@ class MassSendReceiverPage extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _MassSendReceiverPageState extends State<MassSendReceiverPage> {
|
||||
late List<LockUserData> _lockUserList = [];
|
||||
TextEditingController emailOrPhoneController = TextEditingController();
|
||||
TextEditingController keyNameController = TextEditingController();
|
||||
|
||||
String countryCode = '86';
|
||||
String countryName = '中国';
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
||||
LockUserData data = LockUserData();
|
||||
_lockUserList.add(data);
|
||||
}
|
||||
final logic = Get.put(MassSendReceiverLogic());
|
||||
final state = Get.find<MassSendReceiverLogic>().state;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@ -57,8 +47,11 @@ class _MassSendReceiverPageState extends State<MassSendReceiverPage> {
|
||||
style: TextStyle(color: Colors.white, fontSize: 24.sp),
|
||||
),
|
||||
onPressed: () {
|
||||
if (!state.isVip.value) {
|
||||
return;
|
||||
}
|
||||
Map<String, dynamic> resultMap = {};
|
||||
resultMap['lockUserList'] = _lockUserList;
|
||||
resultMap['lockUserList'] = state.lockUserList.value;
|
||||
Navigator.pop(context, resultMap);
|
||||
},
|
||||
),
|
||||
@ -66,52 +59,60 @@ class _MassSendReceiverPageState extends State<MassSendReceiverPage> {
|
||||
),
|
||||
body: Column(
|
||||
children: [
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.countryAndRegion!.tr,
|
||||
rightTitle: "",
|
||||
isHaveLine: true,
|
||||
isHaveRightWidget: true,
|
||||
isHaveDirection: true,
|
||||
rightWidget: Text(
|
||||
'$countryName +$countryCode',
|
||||
textAlign: TextAlign.end,
|
||||
style: TextStyle(
|
||||
fontSize: 22.sp, color: AppColors.darkGrayTextColor),
|
||||
),
|
||||
action: () async {
|
||||
var result = await Navigator.pushNamed(
|
||||
context, Routers.selectCountryRegionPage);
|
||||
if (result != null) {
|
||||
result as Map<String, dynamic>;
|
||||
countryCode = result['code'];
|
||||
countryName = result['countryName'];
|
||||
setState(() {});
|
||||
}
|
||||
},
|
||||
),
|
||||
Row(
|
||||
children: [controlViewTitle(0), controlViewTitle(1)],
|
||||
),
|
||||
Obx(() => Visibility(
|
||||
visible: state.isVip.value ? false : true,
|
||||
child: AdvancedFunctionHandle()
|
||||
.topTipsAdvancedFeatures('开通高级功能后才可以选择和添加接收者'.tr))),
|
||||
Obx(() => Visibility(
|
||||
visible: state.isVip.value ? true : false,
|
||||
child: 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.selectCountryRegionPage);
|
||||
if (result != null) {
|
||||
result as Map<String, dynamic>;
|
||||
state.countryCode.value = result['code'];
|
||||
state.countryName.value = result['countryName'];
|
||||
setState(() {});
|
||||
}
|
||||
},
|
||||
))),
|
||||
Obx(() => Row(
|
||||
children: [controlViewTitle(0), controlViewTitle(1)],
|
||||
)),
|
||||
SizedBox(
|
||||
height: 2.h,
|
||||
),
|
||||
Expanded(
|
||||
child: ListView.separated(
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
LockUserData data = _lockUserList[index];
|
||||
emailOrPhoneController.text = data.userid ?? '';
|
||||
keyNameController.text = data.nickname ?? '';
|
||||
Obx(() => Visibility(
|
||||
visible: state.isVip.value ? true : false,
|
||||
child: Expanded(
|
||||
child: ListView.separated(
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
LockUserItemData data = state.lockUserList.value[index];
|
||||
state.emailOrPhoneController.text = data.userid ?? '';
|
||||
state.keyNameController.text = data.nickname ?? '';
|
||||
|
||||
return _itemBuilder(index, data);
|
||||
},
|
||||
itemCount: _lockUserList.length,
|
||||
separatorBuilder: (BuildContext context, int index) {
|
||||
return Divider(
|
||||
height: 20.h,
|
||||
color: AppColors.greyBackgroundColor,
|
||||
);
|
||||
},
|
||||
)),
|
||||
return _itemBuilder(index, data);
|
||||
},
|
||||
itemCount: state.lockUserList.value.length,
|
||||
separatorBuilder: (BuildContext context, int index) {
|
||||
return Divider(
|
||||
height: 20.h,
|
||||
color: AppColors.greyBackgroundColor,
|
||||
);
|
||||
},
|
||||
)))),
|
||||
],
|
||||
),
|
||||
);
|
||||
@ -130,7 +131,9 @@ class _MassSendReceiverPageState extends State<MassSendReceiverPage> {
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Image.asset(
|
||||
'images/icon_btn_add.png',
|
||||
state.isVip.value
|
||||
? 'images/icon_btn_add.png'
|
||||
: 'images/icon_btn_disableAdd.png',
|
||||
width: 28.w,
|
||||
height: 28.w,
|
||||
),
|
||||
@ -140,7 +143,9 @@ class _MassSendReceiverPageState extends State<MassSendReceiverPage> {
|
||||
Text(
|
||||
btnIndex == 0 ? '已有' : '新增',
|
||||
style: TextStyle(
|
||||
color: AppColors.mainColor,
|
||||
color: state.isVip.value
|
||||
? AppColors.mainColor
|
||||
: AppColors.placeholderTextColor,
|
||||
fontSize: 24.sp,
|
||||
fontWeight: FontWeight.bold),
|
||||
)
|
||||
@ -148,32 +153,35 @@ class _MassSendReceiverPageState extends State<MassSendReceiverPage> {
|
||||
),
|
||||
),
|
||||
onTap: () async {
|
||||
if (!state.isVip.value) {
|
||||
return;
|
||||
}
|
||||
if (btnIndex == 0) {
|
||||
//已有
|
||||
Navigator.pushNamed(context, Routers.lockUserListPage).then((val) {
|
||||
if (val != null) {
|
||||
val as Map<String, dynamic>;
|
||||
_lockUserList = val['lockUserList'];
|
||||
state.lockUserList.value = val['lockUserList'];
|
||||
|
||||
setState(() {});
|
||||
}
|
||||
});
|
||||
} else if (btnIndex == 1) {
|
||||
//新增
|
||||
_lockUserList.add(LockUserData());
|
||||
state.lockUserList.value.add(LockUserItemData());
|
||||
setState(() {});
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Widget _itemBuilder(int index, LockUserData userData) {
|
||||
Widget _itemBuilder(int index, LockUserItemData userData) {
|
||||
return MassSendReceiverCell(
|
||||
index,
|
||||
currentIndex: index,
|
||||
userData: userData,
|
||||
clickDeleteUser: () {
|
||||
_lockUserList.removeAt(index - 1);
|
||||
state.lockUserList.value.removeAt(index - 1);
|
||||
setState(() {});
|
||||
},
|
||||
);
|
||||
|
||||
@ -0,0 +1,13 @@
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserList_entity.dart';
|
||||
|
||||
class MassSendReceiverState {
|
||||
var isVip = false.obs;
|
||||
var lockUserList = <LockUserItemData>[].obs;
|
||||
TextEditingController emailOrPhoneController = TextEditingController();
|
||||
TextEditingController keyNameController = TextEditingController();
|
||||
|
||||
var countryCode = '86'.obs;
|
||||
var countryName = '中国'.obs;
|
||||
}
|
||||
@ -4,7 +4,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/appRouters.dart';
|
||||
import 'package:star_lock/main/lockDetail/messageWarn/addFamily/addFamily_logic.dart';
|
||||
import 'package:star_lock/tools/advancedFunctionAlert.dart';
|
||||
import 'package:star_lock/tools/advancedFunctionHandle.dart';
|
||||
import 'package:star_lock/tools/commonItem.dart';
|
||||
import 'package:star_lock/tools/showTFView.dart';
|
||||
import 'package:star_lock/tools/storage.dart';
|
||||
|
||||
@ -3,7 +3,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/appRouters.dart';
|
||||
import 'package:star_lock/main/lockDetail/messageWarn/msgNotification/coerceOpenDoor/coerceFingerprint/coerceFingerprint_logic.dart';
|
||||
import 'package:star_lock/tools/advancedFunctionAlert.dart';
|
||||
import 'package:star_lock/tools/advancedFunctionHandle.dart';
|
||||
import 'package:star_lock/tools/commonItem.dart';
|
||||
import 'package:star_lock/tools/storage.dart';
|
||||
import 'package:star_lock/tools/submitBtn.dart';
|
||||
|
||||
@ -3,7 +3,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/appRouters.dart';
|
||||
import 'package:star_lock/tools/advancedFunctionAlert.dart';
|
||||
import 'package:star_lock/tools/advancedFunctionHandle.dart';
|
||||
import 'package:star_lock/tools/commonItem.dart';
|
||||
import 'package:star_lock/tools/storage.dart';
|
||||
import 'package:star_lock/tools/submitBtn.dart';
|
||||
|
||||
@ -4,7 +4,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/appRouters.dart';
|
||||
import 'package:star_lock/main/lockDetail/messageWarn/msgNotification/msgNotification/msgNotification_entity.dart';
|
||||
import 'package:star_lock/tools/advancedFunctionAlert.dart';
|
||||
import 'package:star_lock/tools/advancedFunctionHandle.dart';
|
||||
import 'package:star_lock/tools/commonItem.dart';
|
||||
import 'package:star_lock/tools/pickers/pickers.dart';
|
||||
import 'package:star_lock/tools/pickers/style/default_style.dart';
|
||||
|
||||
@ -1,6 +1,4 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/main/lockMian/entity/lockListInfo_entity.dart';
|
||||
import 'package:star_lock/tools/dateTool.dart';
|
||||
@ -14,10 +12,10 @@ class PasswordKeyPerpetualState {
|
||||
final isPermanent = true.obs; //是否永久
|
||||
var getPwdStr = ''.obs;
|
||||
var pwdNameStr = '';
|
||||
final isAdministrator = false.obs;// 是否是管理员
|
||||
final isAdministrator = false.obs; // 是否是管理员
|
||||
|
||||
var beginTime = DateTool().getNowDateWithType(3).obs; //默认为当前时间 开始时间
|
||||
var endTime = DateTool().getNowDateWithType(3).obs;//默认为当前时间 结束时间
|
||||
var endTime = DateTool().getNowDateWithType(3).obs; //默认为当前时间 结束时间
|
||||
|
||||
var loopEffectiveDate = DateTool().getNowDateWithType(7).obs; //生效时间
|
||||
var loopFailureDate = DateTool().getNowDateWithType(7).obs; //失效时间
|
||||
@ -26,23 +24,22 @@ class PasswordKeyPerpetualState {
|
||||
var loopModeStr = '周末'.obs; //循环模式
|
||||
|
||||
var customBeginTime = DateTool().getNowDateWithType(2).obs; //默认为当前时间 开始时间
|
||||
var customEndTime = DateTool().getNowDateWithType(2).obs;//默认为当前时间 结束时间
|
||||
var customEndTime = DateTool().getNowDateWithType(2).obs; //默认为当前时间 结束时间
|
||||
|
||||
final widgetType = 0.obs;
|
||||
final sendSucceedType = 0.obs;
|
||||
final keyInfo = LockListInfoItemEntity().obs;
|
||||
|
||||
var ifCurrentScreen = true.obs; // 是否是当前界面,用于判断是否需要针对当前界面进行展示
|
||||
var sureBtnState = 0.obs;// 0普通状态(可用) 1连接中(不可用)
|
||||
var sureBtnState = 0.obs; // 0普通状态(可用) 1连接中(不可用)
|
||||
|
||||
var pwdNumber = 0.obs;// 密码编号
|
||||
var pwdNumber = 0.obs; // 密码编号
|
||||
late TabController tabController;
|
||||
|
||||
PasswordKeyPerpetualState() {
|
||||
Map map = Get.arguments;
|
||||
if(map["keyInfo"] != null){
|
||||
if (map["keyInfo"] != null) {
|
||||
keyInfo.value = map["keyInfo"];
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,7 +4,7 @@ import 'dart:async';
|
||||
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../../../main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserListEntity.dart';
|
||||
import '../../../../main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserList_entity.dart';
|
||||
import '../../../../network/api_repository.dart';
|
||||
import '../../../../tools/baseGetXController.dart';
|
||||
import '../../../../tools/eventBusEventManage.dart';
|
||||
|
||||
@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:flutter_slidable/flutter_slidable.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserListEntity.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserList_entity.dart';
|
||||
import 'package:star_lock/tools/noData.dart';
|
||||
|
||||
import '../../../../../appRouters.dart';
|
||||
@ -26,8 +26,8 @@ class _LockUserManageListPageState extends State<LockUserManageListPage> {
|
||||
final state = Get.find<LockUserManageListLogic>().state;
|
||||
|
||||
Future<void> getHttpData() async {
|
||||
logic.lockUserListRequest().then((LockUserListEntity value){
|
||||
if(mounted) setState(() {});
|
||||
logic.lockUserListRequest().then((LockUserListEntity value) {
|
||||
if (mounted) setState(() {});
|
||||
});
|
||||
}
|
||||
|
||||
@ -59,11 +59,11 @@ class _LockUserManageListPageState extends State<LockUserManageListPage> {
|
||||
],
|
||||
),
|
||||
body: EasyRefreshTool(
|
||||
onRefresh: (){
|
||||
onRefresh: () {
|
||||
logic.pageNo = 1;
|
||||
getHttpData();
|
||||
},
|
||||
onLoad: (){
|
||||
onLoad: () {
|
||||
getHttpData();
|
||||
},
|
||||
child: Column(
|
||||
@ -112,21 +112,26 @@ class _LockUserManageListPageState extends State<LockUserManageListPage> {
|
||||
|
||||
Widget _buildMainUI() {
|
||||
return state.dataList.isEmpty
|
||||
? NoData(noDataHeight: 1.sh - ScreenUtil().statusBarHeight - ScreenUtil().bottomBarHeight - 190.h - 64.h)
|
||||
? NoData(
|
||||
noDataHeight: 1.sh -
|
||||
ScreenUtil().statusBarHeight -
|
||||
ScreenUtil().bottomBarHeight -
|
||||
190.h -
|
||||
64.h)
|
||||
: SlidableAutoCloseBehavior(
|
||||
child: ListView.separated(
|
||||
child: ListView.separated(
|
||||
itemCount: state.dataList.length,
|
||||
itemBuilder: (c, index) {
|
||||
LockUserData indexEntity = state.dataList[index];
|
||||
LockUserItemData indexEntity = state.dataList[index];
|
||||
if (index < state.dataList.length) {
|
||||
return Slidable(
|
||||
key:ValueKey(indexEntity.uid),
|
||||
key: ValueKey(indexEntity.uid),
|
||||
endActionPane: ActionPane(
|
||||
extentRatio: 0.2,
|
||||
motion: const ScrollMotion(),
|
||||
children: [
|
||||
SlidableAction(
|
||||
onPressed: (BuildContext context){
|
||||
onPressed: (BuildContext context) {
|
||||
showIosTipViewDialog(context, indexEntity);
|
||||
},
|
||||
backgroundColor: Colors.red,
|
||||
@ -149,10 +154,10 @@ class _LockUserManageListPageState extends State<LockUserManageListPage> {
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
Widget _electronicKeyItem(LockUserData itemData) {
|
||||
Widget _electronicKeyItem(LockUserItemData itemData) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
Navigator.pushNamed(context, Routers.ownedKeyListPage,
|
||||
@ -220,7 +225,8 @@ class _LockUserManageListPageState extends State<LockUserManageListPage> {
|
||||
);
|
||||
}
|
||||
|
||||
void showIosTipViewDialog(BuildContext context, LockUserData lockUserData) {
|
||||
void showIosTipViewDialog(
|
||||
BuildContext context, LockUserItemData lockUserData) {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
@ -235,8 +241,6 @@ class _LockUserManageListPageState extends State<LockUserManageListPage> {
|
||||
Get.back();
|
||||
},
|
||||
);
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,11 +1,9 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../../../main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserListEntity.dart';
|
||||
import '../../../../main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserList_entity.dart';
|
||||
|
||||
class LockUserManageListState {
|
||||
final dataList = <LockUserData>[].obs;
|
||||
final dataList = <LockUserItemData>[].obs;
|
||||
final TextEditingController searchController = TextEditingController();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,7 +3,7 @@ import 'package:star_lock/login/selectCountryRegion/common/countryRegionEntity.d
|
||||
import 'package:star_lock/main/lockDetail/doorLockLog/doorLockLog_entity.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecord/keyOperationRecord_entity.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/entity/ElectronicKeyListEntity.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserListEntity.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserList_entity.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupListEntity.dart';
|
||||
import 'package:star_lock/main/lockDetail/face/addFace/addFace_entity.dart';
|
||||
import 'package:star_lock/main/lockDetail/lockSet/basicInformation/basicInformation/KeyDetailEntity.dart';
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/appRouters.dart';
|
||||
@ -43,4 +44,42 @@ class AdvancedFunctionHandle {
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
//高级功能顶部提示框
|
||||
Widget topTipsAdvancedFeatures(String tipsText) {
|
||||
return Container(
|
||||
color: AppColors.vipFeatureBgColor,
|
||||
padding: EdgeInsets.only(left: 20.w),
|
||||
height: 80.h,
|
||||
child: Row(
|
||||
children: [
|
||||
Text(tipsText,
|
||||
style: TextStyle(
|
||||
color: AppColors.vipFeatureBtnTextColor, fontSize: 22.sp)),
|
||||
SizedBox(
|
||||
width: 10.w,
|
||||
),
|
||||
SizedBox(
|
||||
width: 146.w,
|
||||
height: 46.h,
|
||||
child: ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: AppColors.vipFeatureBtnBgColor,
|
||||
),
|
||||
onPressed: () {
|
||||
Get.toNamed(Routers.advancedFeaturesWebPage);
|
||||
},
|
||||
child: Text(
|
||||
'去开通'.tr,
|
||||
style: TextStyle(color: Colors.white, fontSize: 22.sp),
|
||||
)),
|
||||
),
|
||||
Expanded(
|
||||
child: SizedBox(
|
||||
width: 2.w,
|
||||
))
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user