1,新增检测是否支持开启实名认证接口对接
2,发送电子钥匙根据数据新增键入真实姓名和身份证号 3,编辑锁分组页面新增高级功能相应权限及开通处理
This commit is contained in:
parent
bff61936e1
commit
69c6c3e1dd
@ -795,5 +795,9 @@
|
||||
"当前剩余数量":"Current surplus quantity",
|
||||
"购买":"Buy",
|
||||
"实名认证为付费功能,请购买后再使用":"Real-name authentication is a paid function, please use it after purchase",
|
||||
"密码不一致哦":"The passwords are inconsistent"
|
||||
"密码不一致哦":"The passwords are inconsistent",
|
||||
"真实姓名":"Real name",
|
||||
"身份证号":"ID number",
|
||||
"请输入真实姓名":"Please enter your real name",
|
||||
"请输入身份证号":"Please enter your ID number"
|
||||
}
|
||||
|
||||
@ -822,5 +822,9 @@
|
||||
"实名认证":"实名认证",
|
||||
"当前剩余数量":"当前剩余数量",
|
||||
"购买":"购买",
|
||||
"实名认证为付费功能,请购买后再使用":"实名认证为付费功能,请购买后再使用"
|
||||
"实名认证为付费功能,请购买后再使用":"实名认证为付费功能,请购买后再使用",
|
||||
"真实姓名":"真实姓名",
|
||||
"身份证号":"身份证号",
|
||||
"请输入真实姓名":"请输入真实姓名",
|
||||
"请输入身份证号":"请输入身份证号"
|
||||
}
|
||||
|
||||
@ -825,5 +825,9 @@
|
||||
"实名认证":"实名认证",
|
||||
"当前剩余数量":"当前剩余数量",
|
||||
"购买":"购买",
|
||||
"实名认证为付费功能,请购买后再使用":"实名认证为付费功能,请购买后再使用"
|
||||
"实名认证为付费功能,请购买后再使用":"实名认证为付费功能,请购买后再使用",
|
||||
"真实姓名":"真实姓名",
|
||||
"身份证号":"身份证号",
|
||||
"请输入真实姓名":"请输入真实姓名",
|
||||
"请输入身份证号":"请输入身份证号"
|
||||
}
|
||||
|
||||
@ -1,10 +1,8 @@
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/app_settings/app_settings.dart';
|
||||
import 'package:star_lock/blue/io_type.dart';
|
||||
import 'package:star_lock/tools/dateTool.dart';
|
||||
|
||||
import '../../../../blue/blue_manage.dart';
|
||||
@ -117,7 +115,8 @@ class AuthorizedAdminLogic extends BaseGetXController {
|
||||
if (state.seletType.value == 0) {
|
||||
getKeyType = "2";
|
||||
|
||||
startDate = DateTool().dateToTimestamp(state.beginDate.value, 1).toString();
|
||||
startDate =
|
||||
DateTool().dateToTimestamp(state.beginDate.value, 1).toString();
|
||||
endDate = DateTool().dateToTimestamp(state.endDate.value, 1).toString();
|
||||
startTime = "0";
|
||||
endTime = "0";
|
||||
@ -156,7 +155,9 @@ class AuthorizedAdminLogic extends BaseGetXController {
|
||||
weekDays: state.weekdaysList,
|
||||
startTime: int.parse(startTime),
|
||||
endTime: int.parse(endTime),
|
||||
isOnlyManageSelf: state.onlyManageYouCreatesUser.value ? 1 : 0);
|
||||
isOnlyManageSelf: state.onlyManageYouCreatesUser.value ? 1 : 0,
|
||||
realName: '',
|
||||
idCardNumber: '');
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
state.isCreateUser.value = false;
|
||||
state.isSendSuccess.value = true;
|
||||
@ -169,7 +170,9 @@ class AuthorizedAdminLogic extends BaseGetXController {
|
||||
//用户未注册
|
||||
state.isCreateUser.value = true;
|
||||
// _showDialog('${entity.errorMsg}');
|
||||
ShowTipView().showIosTipWithContentDialog('${"是否发送授权管理员给未注册账号".tr}\n${state.emailOrPhoneController.text}', (){
|
||||
ShowTipView().showIosTipWithContentDialog(
|
||||
'${"是否发送授权管理员给未注册账号".tr}\n${state.emailOrPhoneController.text}',
|
||||
() {
|
||||
sendElectronicKeyRequest();
|
||||
});
|
||||
}
|
||||
|
||||
@ -1,14 +1,5 @@
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicKey/sendElectronicKey_state.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicKey/view/sendElectronicKeyView_state.dart';
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
import 'package:star_lock/tools/commonDataManage.dart';
|
||||
import 'package:star_lock/tools/dateTool.dart';
|
||||
import 'package:star_lock/tools/eventBusEventManage.dart';
|
||||
|
||||
import '../../../../../tools/showTipView.dart';
|
||||
|
||||
class SendElectronicKeyLogic extends BaseGetXController {
|
||||
final SendElectronicKeyState state = SendElectronicKeyState();
|
||||
|
||||
@ -1,28 +1,11 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/app_settings/app_colors.dart';
|
||||
import 'package:flutter_native_contact_picker/flutter_native_contact_picker.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicKey/sendElectronicKey_logic.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicKey/view/sendElectronicKeyView_page.dart';
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
import 'package:star_lock/tools/pickers/pickers.dart';
|
||||
import 'package:star_lock/tools/pickers/time_picker/model/date_mode.dart';
|
||||
import 'package:star_lock/tools/pickers/time_picker/model/pduration.dart';
|
||||
import 'package:star_lock/tools/showTipView.dart';
|
||||
import 'package:star_lock/tools/storage.dart';
|
||||
|
||||
import '../../../../../appRouters.dart';
|
||||
import '../../../../../tools/CustomUnderlineTabIndicator.dart';
|
||||
import '../../../../../tools/NativeInteractionTool.dart';
|
||||
import '../../../../../tools/commonDataManage.dart';
|
||||
import '../../../../../tools/commonItem.dart';
|
||||
import '../../../../../tools/dateTool.dart';
|
||||
import '../../../../../tools/submitBtn.dart';
|
||||
import '../../../../../tools/titleAppBar.dart';
|
||||
import '../../../../../translations/trans_lib.dart';
|
||||
|
||||
@ -107,8 +90,8 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage>
|
||||
controller: state.tabController,
|
||||
children: _itemTabs
|
||||
.map((ItemView item) => SendElectronicKeyView(
|
||||
type: item.type,
|
||||
))
|
||||
type: item.type,
|
||||
))
|
||||
.toList()),
|
||||
);
|
||||
}
|
||||
@ -119,7 +102,6 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage>
|
||||
ItemView(title: TranslationLoader.lanKeys!.once!.tr, type: "2"),
|
||||
ItemView(title: TranslationLoader.lanKeys!.circulation!.tr, type: "3"),
|
||||
];
|
||||
|
||||
}
|
||||
|
||||
class ItemView {
|
||||
|
||||
@ -1,27 +1,16 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_native_contact_picker/flutter_native_contact_picker.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../../../../tools/dateTool.dart';
|
||||
import '../../../../lockMian/entity/lockListInfo_entity.dart';
|
||||
|
||||
class SendElectronicKeyState {
|
||||
|
||||
late TabController tabController;
|
||||
|
||||
final FlutterContactPicker contactPicker = FlutterContactPicker();
|
||||
late Contact contact;
|
||||
|
||||
|
||||
final timeLimitTips = '接收者在有效期内可以不限次数使用'; //限时
|
||||
final permanentTips = '接收者可以使用此App开关锁'; //永久
|
||||
final onceLimitTips = '单次钥匙有效期为1小时,只能使用一次'; //单次
|
||||
final cycleLimitTips = '接收者可以在有效期内的固定时间段里,不限次数使用'; //循环
|
||||
|
||||
SendElectronicKeyState() {
|
||||
// Map map = Get.arguments;
|
||||
// if ((map["keyInfo"] != null)) {
|
||||
// keyInfo.value = map["keyInfo"];
|
||||
// }
|
||||
}
|
||||
SendElectronicKeyState() {}
|
||||
}
|
||||
|
||||
@ -1,7 +1,9 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/appRouters.dart';
|
||||
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicKey/sendElectronicKey_state.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicKey/view/sendElectronicKeyView_state.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/advancedFunctionRecord/advancedFunctionRecord_entity.dart';
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
import 'package:star_lock/tools/commonDataManage.dart';
|
||||
@ -50,12 +52,10 @@ class SendElectronicKeyViewLogic extends BaseGetXController {
|
||||
}
|
||||
|
||||
typeValue = XSConstantMacro.keyTypeTime;
|
||||
startDate = DateTool()
|
||||
.dateToTimestamp(state.timeLimitBeginTime, 1)
|
||||
.toString();
|
||||
endDate = DateTool()
|
||||
.dateToTimestamp(state.timeLimitEndTime, 1)
|
||||
.toString();
|
||||
startDate =
|
||||
DateTool().dateToTimestamp(state.timeLimitBeginTime, 1).toString();
|
||||
endDate =
|
||||
DateTool().dateToTimestamp(state.timeLimitEndTime, 1).toString();
|
||||
startTime = "0";
|
||||
endTime = "0";
|
||||
|
||||
@ -77,17 +77,13 @@ class SendElectronicKeyViewLogic extends BaseGetXController {
|
||||
showToast("请选择有效期".tr);
|
||||
return;
|
||||
}
|
||||
startDate = DateTool()
|
||||
.dateToTimestamp(state.cycleBeginTime, 1)
|
||||
.toString();
|
||||
endDate =
|
||||
DateTool().dateToTimestamp(state.cycleEndTime, 1).toString();
|
||||
startTime = DateTool()
|
||||
.dateToTimestamp(state.effectiveDateTime, 0)
|
||||
.toString();
|
||||
endTime = DateTool()
|
||||
.dateToTimestamp(state.failureDateTime, 0)
|
||||
.toString();
|
||||
startDate =
|
||||
DateTool().dateToTimestamp(state.cycleBeginTime, 1).toString();
|
||||
endDate = DateTool().dateToTimestamp(state.cycleEndTime, 1).toString();
|
||||
startTime =
|
||||
DateTool().dateToTimestamp(state.effectiveDateTime, 0).toString();
|
||||
endTime =
|
||||
DateTool().dateToTimestamp(state.failureDateTime, 0).toString();
|
||||
break;
|
||||
default:
|
||||
typeValue = XSConstantMacro.keyTypeTime;
|
||||
@ -116,7 +112,13 @@ class SendElectronicKeyViewLogic extends BaseGetXController {
|
||||
weekDays: state.weekdaysList,
|
||||
startTime: int.parse(startTime),
|
||||
endTime: int.parse(endTime),
|
||||
isOnlyManageSelf: 0);
|
||||
isOnlyManageSelf: 0,
|
||||
realName: state.isRequireAuth.value == true
|
||||
? state.realNameController.text
|
||||
: "",
|
||||
idCardNumber: state.isRequireAuth.value == true
|
||||
? state.idCardController.text
|
||||
: "");
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
state.isSendSuccess = true;
|
||||
resetData();
|
||||
@ -135,6 +137,24 @@ class SendElectronicKeyViewLogic extends BaseGetXController {
|
||||
}
|
||||
}
|
||||
|
||||
//检测实名认证是否支持开启
|
||||
Future<void> keyCheckFace() async {
|
||||
AdvancedFunctionRecordEntity entity = await ApiRepository.to.keyCheckFace(
|
||||
countryCode: int.parse(state.countryCode),
|
||||
account: state.emailOrPhoneController.text);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
ShowTipView().showBuyTipWithContentAlert(
|
||||
titleStr: '实名认证为付费功能,请购买后再使用'.tr,
|
||||
sureClick: () {
|
||||
Get.toNamed(Routers.advancedFeaturesWebPage,
|
||||
arguments: {'isShop': false});
|
||||
});
|
||||
} else if (entity.errorCode! == 431) {
|
||||
//431代表改用户没有身份证信息,需要弹出输入身份证信息框
|
||||
state.isRequireAuth.value = true;
|
||||
}
|
||||
}
|
||||
|
||||
bool isPhoneNumber(String input) {
|
||||
// 手机号正则表达式,这里简化为11位数字
|
||||
final RegExp phoneRegExp = RegExp(r'^\d{11}$');
|
||||
@ -148,15 +168,33 @@ class SendElectronicKeyViewLogic extends BaseGetXController {
|
||||
return emailRegExp.hasMatch(input);
|
||||
}
|
||||
|
||||
TextEditingController getCurrentController(int lineIndex) {
|
||||
TextEditingController currentController = TextEditingController();
|
||||
switch (lineIndex) {
|
||||
case 1:
|
||||
currentController = state.emailOrPhoneController;
|
||||
break;
|
||||
case 2:
|
||||
currentController = state.keyNameController;
|
||||
break;
|
||||
case 3:
|
||||
currentController = state.realNameController;
|
||||
break;
|
||||
case 4:
|
||||
currentController = state.idCardController;
|
||||
break;
|
||||
default:
|
||||
}
|
||||
return currentController;
|
||||
}
|
||||
|
||||
void resetData() {
|
||||
state.emailOrPhoneController.text = "";
|
||||
state.keyNameController.text = "";
|
||||
state.timeLimitBeginTime = DateTool()
|
||||
.dateToYMDHNString(DateTime.now().millisecondsSinceEpoch.toString())
|
||||
; // 限时开始时间
|
||||
state.timeLimitEndTime = DateTool()
|
||||
.dateToYMDHNString(DateTime.now().millisecondsSinceEpoch.toString())
|
||||
; // 限时结束时间
|
||||
state.timeLimitBeginTime = DateTool().dateToYMDHNString(
|
||||
DateTime.now().millisecondsSinceEpoch.toString()); // 限时开始时间
|
||||
state.timeLimitEndTime = DateTool().dateToYMDHNString(
|
||||
DateTime.now().millisecondsSinceEpoch.toString()); // 限时结束时间
|
||||
state.cycleBeginTime = ""; // 循环开始时间
|
||||
state.cycleEndTime = ""; // 循环结束时间
|
||||
state.effectiveDateTime = ""; // 生效时间
|
||||
|
||||
@ -17,7 +17,6 @@ import 'package:star_lock/tools/pickers/pickers.dart';
|
||||
import 'package:star_lock/tools/pickers/time_picker/model/date_mode.dart';
|
||||
import 'package:star_lock/tools/pickers/time_picker/model/pduration.dart';
|
||||
import 'package:star_lock/tools/showTipView.dart';
|
||||
import 'package:star_lock/tools/storage.dart';
|
||||
import 'package:star_lock/tools/submitBtn.dart';
|
||||
import 'package:star_lock/translations/trans_lib.dart';
|
||||
|
||||
@ -34,6 +33,7 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
||||
with AutomaticKeepAliveClientMixin {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
super.build(context);
|
||||
return GetBuilder<SendElectronicKeyViewLogic>(
|
||||
tag: widget.type,
|
||||
init: SendElectronicKeyViewLogic(widget.type),
|
||||
@ -43,7 +43,7 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
||||
} else {
|
||||
switch (widget.type) {
|
||||
case '0':
|
||||
// 限时
|
||||
// 限时
|
||||
return SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
@ -56,7 +56,7 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
||||
),
|
||||
);
|
||||
case '1':
|
||||
// 永久
|
||||
// 永久
|
||||
return SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
@ -68,7 +68,7 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
||||
),
|
||||
);
|
||||
case '2':
|
||||
// 单次
|
||||
// 单次
|
||||
return SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
@ -80,7 +80,7 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
||||
),
|
||||
);
|
||||
case '3':
|
||||
// 循环
|
||||
// 循环
|
||||
return SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
@ -124,7 +124,7 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
||||
'${logic.state.countryName} +${logic.state.countryCode}',
|
||||
textAlign: TextAlign.end,
|
||||
style:
|
||||
TextStyle(fontSize: 22.sp, color: AppColors.darkGrayTextColor),
|
||||
TextStyle(fontSize: 22.sp, color: AppColors.darkGrayTextColor),
|
||||
),
|
||||
action: () async {
|
||||
var result = await Navigator.pushNamed(
|
||||
@ -161,13 +161,11 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
||||
PDuration selectDate = PDuration.parse(
|
||||
DateTime.parse(logic.state.timeLimitBeginTime));
|
||||
Pickers.showDatePicker(context,
|
||||
selectDate: selectDate,
|
||||
mode: DateMode.YMDHM,
|
||||
onConfirm: (p) {
|
||||
logic.state.timeLimitBeginTime =
|
||||
DateTool().getYMDHNDateString(p, 1);
|
||||
logic.update();
|
||||
});
|
||||
selectDate: selectDate, mode: DateMode.YMDHM, onConfirm: (p) {
|
||||
logic.state.timeLimitBeginTime =
|
||||
DateTool().getYMDHNDateString(p, 1);
|
||||
logic.update();
|
||||
});
|
||||
}),
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.failureTime!.tr,
|
||||
@ -177,13 +175,11 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
||||
PDuration selectDate = PDuration.parse(
|
||||
DateTime.tryParse(logic.state.timeLimitEndTime));
|
||||
Pickers.showDatePicker(context,
|
||||
selectDate: selectDate,
|
||||
mode: DateMode.YMDHM,
|
||||
onConfirm: (p) {
|
||||
logic.state.timeLimitEndTime =
|
||||
DateTool().getYMDHNDateString(p, 1);
|
||||
logic.update();
|
||||
});
|
||||
selectDate: selectDate, mode: DateMode.YMDHM, onConfirm: (p) {
|
||||
logic.state.timeLimitEndTime =
|
||||
DateTool().getYMDHNDateString(p, 1);
|
||||
logic.update();
|
||||
});
|
||||
}),
|
||||
Container(height: 10.h),
|
||||
],
|
||||
@ -194,19 +190,37 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
||||
Widget keyRealNameWidget(SendElectronicKeyViewLogic logic) {
|
||||
return Column(
|
||||
children: [
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.realNameAuthentication!.tr,
|
||||
rightTitle: "",
|
||||
isTipsImg: true,
|
||||
tipsImgAction: () {
|
||||
ShowTipView().showSureAlertDialog(
|
||||
"人脸实名认证指的是用户在使用手机APP开锁时,需要先进行本人人脸验证,验证通过才能开锁。"
|
||||
.tr);
|
||||
},
|
||||
isHaveRightWidget: true,
|
||||
rightWidget: SizedBox(
|
||||
width: 60.w, height: 50.h, child: _remoteSwitch(false, logic)),
|
||||
),
|
||||
Obx(() => CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.realNameAuthentication!.tr,
|
||||
rightTitle: "",
|
||||
isTipsImg: true,
|
||||
isHaveLine:
|
||||
logic.state.isRequireAuth.value == true ? true : false,
|
||||
tipsImgAction: () {
|
||||
ShowTipView().showSureAlertDialog(
|
||||
"人脸实名认证指的是用户在使用手机APP开锁时,需要先进行本人人脸验证,验证通过才能开锁。".tr);
|
||||
},
|
||||
isHaveRightWidget: true,
|
||||
rightWidget: SizedBox(
|
||||
width: 60.w,
|
||||
height: 50.h,
|
||||
child: _remoteSwitch(false, logic)),
|
||||
)),
|
||||
Obx(() => Visibility(
|
||||
visible: logic.state.isRequireAuth.value,
|
||||
child: CommonItem(
|
||||
leftTitel: '真实姓名'.tr,
|
||||
rightTitle: "",
|
||||
isHaveRightWidget: true,
|
||||
isHaveLine: true,
|
||||
rightWidget: getTFWidget(false, '请输入真实姓名'.tr, 3, logic)))),
|
||||
Obx(() => Visibility(
|
||||
visible: logic.state.isRequireAuth.value,
|
||||
child: CommonItem(
|
||||
leftTitel: '身份证号'.tr,
|
||||
rightTitle: "",
|
||||
isHaveRightWidget: true,
|
||||
rightWidget: getTFWidget(false, '请输入身份证号'.tr, 4, logic)))),
|
||||
],
|
||||
);
|
||||
}
|
||||
@ -218,13 +232,12 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.periodValidity!.tr,
|
||||
rightTitle:
|
||||
"${logic.state.cycleBeginTime}\n${logic.state.cycleEndTime}",
|
||||
"${logic.state.cycleBeginTime}\n${logic.state.cycleEndTime}",
|
||||
isHaveDirection: true,
|
||||
isHaveLine: true,
|
||||
action: () async {
|
||||
var result =
|
||||
await Get.toNamed(
|
||||
Routers.seletKeyCyclicDatePage, arguments: {
|
||||
await Get.toNamed(Routers.seletKeyCyclicDatePage, arguments: {
|
||||
'validityValue': logic.state.weekdaysList,
|
||||
'starDate': logic.state.cycleBeginTime,
|
||||
'endDate': logic.state.cycleEndTime,
|
||||
@ -248,8 +261,7 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
||||
isHaveDirection: true,
|
||||
isHaveLine: true,
|
||||
action: () async {
|
||||
var result = await Get.toNamed(
|
||||
Routers.seletKeyCyclicDatePage,
|
||||
var result = await Get.toNamed(Routers.seletKeyCyclicDatePage,
|
||||
arguments: {
|
||||
'validityValue': logic.state.weekdaysList,
|
||||
'starDate': logic.state.cycleBeginTime,
|
||||
@ -258,12 +270,10 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
||||
'endTime': logic.state.failureDateTime
|
||||
});
|
||||
if (result != null && result.isNotEmpty) {
|
||||
logic.state.weekdaysList =
|
||||
result['validityValue'];
|
||||
logic.state.weekdaysList = result['validityValue'];
|
||||
logic.state.cycleBeginTime = result['starDate'];
|
||||
logic.state.cycleEndTime = result['endDate'];
|
||||
logic.state.effectiveDateTime =
|
||||
result['starTime'];
|
||||
logic.state.effectiveDateTime = result['starTime'];
|
||||
logic.state.failureDateTime = result['endTime'];
|
||||
logic.update();
|
||||
}
|
||||
@ -273,12 +283,10 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
||||
child: CommonItem(
|
||||
leftTitel: "有效时间".tr,
|
||||
rightTitle:
|
||||
"${logic.state.effectiveDateTime}-${logic.state
|
||||
.failureDateTime}",
|
||||
"${logic.state.effectiveDateTime}-${logic.state.failureDateTime}",
|
||||
isHaveDirection: true,
|
||||
action: () async {
|
||||
var result = await Get.toNamed(
|
||||
Routers.seletKeyCyclicDatePage,
|
||||
var result = await Get.toNamed(Routers.seletKeyCyclicDatePage,
|
||||
arguments: {
|
||||
'validityValue': logic.state.weekdaysList,
|
||||
'starDate': logic.state.cycleBeginTime,
|
||||
@ -287,12 +295,10 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
||||
'endTime': logic.state.failureDateTime
|
||||
});
|
||||
if (result != null && result.isNotEmpty) {
|
||||
logic.state.weekdaysList =
|
||||
result['validityValue'];
|
||||
logic.state.weekdaysList = result['validityValue'];
|
||||
logic.state.cycleBeginTime = result['starDate'];
|
||||
logic.state.cycleEndTime = result['endDate'];
|
||||
logic.state.effectiveDateTime =
|
||||
result['starTime'];
|
||||
logic.state.effectiveDateTime = result['starTime'];
|
||||
logic.state.failureDateTime = result['endTime'];
|
||||
logic.update();
|
||||
}
|
||||
@ -301,8 +307,8 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
||||
);
|
||||
}
|
||||
|
||||
Widget keyBottomWidget(String sendElectronicKeyTips,
|
||||
SendElectronicKeyViewLogic logic) {
|
||||
Widget keyBottomWidget(
|
||||
String sendElectronicKeyTips, SendElectronicKeyViewLogic logic) {
|
||||
return Column(
|
||||
children: [
|
||||
Container(
|
||||
@ -311,11 +317,11 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
sendElectronicKeyTips,
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(
|
||||
fontSize: 18.sp, color: AppColors.darkGrayTextColor),
|
||||
)),
|
||||
sendElectronicKeyTips,
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(
|
||||
fontSize: 18.sp, color: AppColors.darkGrayTextColor),
|
||||
)),
|
||||
],
|
||||
),
|
||||
),
|
||||
@ -348,7 +354,7 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
||||
child: Text(
|
||||
TranslationLoader.lanKeys!.sendGroupKey!.tr,
|
||||
style:
|
||||
TextStyle(color: AppColors.mainColor, fontSize: 22.sp),
|
||||
TextStyle(color: AppColors.mainColor, fontSize: 22.sp),
|
||||
)),
|
||||
],
|
||||
),
|
||||
@ -440,9 +446,7 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
||||
children: [
|
||||
Expanded(
|
||||
child: TextField(
|
||||
controller: lineIndex == 1
|
||||
? logic.state.emailOrPhoneController
|
||||
: logic.state.keyNameController,
|
||||
controller: logic.getCurrentController(lineIndex),
|
||||
//输入框一行
|
||||
maxLines: 1,
|
||||
inputFormatters: <TextInputFormatter>[
|
||||
@ -458,16 +462,16 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
||||
hintStyle: TextStyle(fontSize: 22.sp),
|
||||
focusedBorder: const OutlineInputBorder(
|
||||
borderSide:
|
||||
BorderSide(width: 0, color: Colors.transparent)),
|
||||
BorderSide(width: 0, color: Colors.transparent)),
|
||||
disabledBorder: const OutlineInputBorder(
|
||||
borderSide:
|
||||
BorderSide(width: 0, color: Colors.transparent)),
|
||||
BorderSide(width: 0, color: Colors.transparent)),
|
||||
enabledBorder: const OutlineInputBorder(
|
||||
borderSide:
|
||||
BorderSide(width: 0, color: Colors.transparent)),
|
||||
BorderSide(width: 0, color: Colors.transparent)),
|
||||
border: const OutlineInputBorder(
|
||||
borderSide:
|
||||
BorderSide(width: 0, color: Colors.transparent)),
|
||||
BorderSide(width: 0, color: Colors.transparent)),
|
||||
contentPadding: const EdgeInsets.symmetric(vertical: 0),
|
||||
),
|
||||
style: TextStyle(
|
||||
@ -479,32 +483,32 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
||||
),
|
||||
isHaveBtn
|
||||
? Container(
|
||||
width: 32.w,
|
||||
height: 32.w,
|
||||
decoration: const BoxDecoration(
|
||||
color: Colors.white,
|
||||
image: DecorationImage(
|
||||
image: AssetImage('images/icon_addressBook.png'),
|
||||
fit: BoxFit.fill),
|
||||
),
|
||||
alignment: Alignment.center,
|
||||
child: InkWell(
|
||||
onTap: () async {
|
||||
Contact? currentContact =
|
||||
await logic.state.contactPicker.selectContact();
|
||||
logic.state.contact = currentContact!;
|
||||
if (currentContact.phoneNumbers!.isNotEmpty) {
|
||||
logic.state.emailOrPhoneController.text = currentContact
|
||||
.phoneNumbers![0]
|
||||
.replaceAll(RegExp(r"\s+\b|\b\s"), "");
|
||||
}
|
||||
if (currentContact.fullName!.isNotEmpty) {
|
||||
logic.state.keyNameController.text =
|
||||
currentContact.fullName!;
|
||||
}
|
||||
},
|
||||
),
|
||||
)
|
||||
width: 32.w,
|
||||
height: 32.w,
|
||||
decoration: const BoxDecoration(
|
||||
color: Colors.white,
|
||||
image: DecorationImage(
|
||||
image: AssetImage('images/icon_addressBook.png'),
|
||||
fit: BoxFit.fill),
|
||||
),
|
||||
alignment: Alignment.center,
|
||||
child: InkWell(
|
||||
onTap: () async {
|
||||
Contact? currentContact =
|
||||
await logic.state.contactPicker.selectContact();
|
||||
logic.state.contact = currentContact!;
|
||||
if (currentContact.phoneNumbers!.isNotEmpty) {
|
||||
logic.state.emailOrPhoneController.text = currentContact
|
||||
.phoneNumbers![0]
|
||||
.replaceAll(RegExp(r"\s+\b|\b\s"), "");
|
||||
}
|
||||
if (currentContact.fullName!.isNotEmpty) {
|
||||
logic.state.keyNameController.text =
|
||||
currentContact.fullName!;
|
||||
}
|
||||
},
|
||||
),
|
||||
)
|
||||
: Container()
|
||||
],
|
||||
),
|
||||
@ -517,8 +521,8 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
||||
visible: logic.state.isDemoMode
|
||||
? false
|
||||
: (CommonDataManage().currentKeyInfo.lockSetting!.remoteUnlock == 1
|
||||
? true
|
||||
: false),
|
||||
? true
|
||||
: false),
|
||||
child: Column(
|
||||
children: [
|
||||
CommonItem(
|
||||
@ -535,28 +539,23 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
||||
}
|
||||
|
||||
//isRemote true:远程开锁 false:实名认证
|
||||
CupertinoSwitch _remoteSwitch(bool isRemote,
|
||||
SendElectronicKeyViewLogic logic) {
|
||||
CupertinoSwitch _remoteSwitch(
|
||||
bool isRemote, SendElectronicKeyViewLogic logic) {
|
||||
return CupertinoSwitch(
|
||||
activeColor: CupertinoColors.activeBlue,
|
||||
trackColor: CupertinoColors.systemGrey5,
|
||||
thumbColor: CupertinoColors.white,
|
||||
value: isRemote
|
||||
? logic.state.isRemoteUnlock
|
||||
: logic.state.isAuthentication,
|
||||
value:
|
||||
isRemote ? logic.state.isRemoteUnlock : logic.state.isAuthentication,
|
||||
onChanged: (value) {
|
||||
if (isRemote) {
|
||||
logic.state.isRemoteUnlock = !logic.state.isRemoteUnlock;
|
||||
} else {
|
||||
logic.state.isAuthentication =
|
||||
!logic.state.isAuthentication;
|
||||
logic.state.isAuthentication = !logic.state.isAuthentication;
|
||||
if (logic.state.isAuthentication) {
|
||||
ShowTipView().showBuyTipWithContentAlert(
|
||||
titleStr: '实名认证为付费功能,请购买后再使用'.tr,
|
||||
sureClick: () {
|
||||
Get.toNamed(Routers.advancedFeaturesWebPage,
|
||||
arguments: {'isShop': false});
|
||||
});
|
||||
logic.keyCheckFace();
|
||||
} else {
|
||||
logic.state.isRequireAuth.value = false;
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -586,7 +585,7 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
||||
TextButton(
|
||||
style: ButtonStyle(
|
||||
overlayColor:
|
||||
MaterialStateProperty.all<Color>(Colors.white)),
|
||||
MaterialStateProperty.all<Color>(Colors.white)),
|
||||
child: Text(
|
||||
'取消'.tr,
|
||||
style: TextStyle(
|
||||
@ -610,14 +609,14 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
||||
return widgetList;
|
||||
}
|
||||
|
||||
GestureDetector buildCenter3(String imageName, String titleStr,
|
||||
int itemIndex) {
|
||||
GestureDetector buildCenter3(
|
||||
String imageName, String titleStr, int itemIndex) {
|
||||
return GestureDetector(
|
||||
child: Container(
|
||||
width: 120.w,
|
||||
// height: 64.h,
|
||||
margin:
|
||||
EdgeInsets.only(top: 20.w, bottom: 20.w, left: 10.w, right: 10.w),
|
||||
EdgeInsets.only(top: 20.w, bottom: 20.w, left: 10.w, right: 10.w),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
@ -645,21 +644,21 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
||||
Get.back();
|
||||
switch (itemIndex) {
|
||||
case 0:
|
||||
//微信好友
|
||||
//微信好友
|
||||
String pwdShareStr = '您好,您的电子钥匙生成成功'.tr;
|
||||
NativeInteractionTool().loadNativeShare(shareText: pwdShareStr);
|
||||
break;
|
||||
case 1:
|
||||
//短信
|
||||
//短信
|
||||
String pwdShareStr = '您好,您的电子钥匙生成成功'.tr;
|
||||
NativeInteractionTool().loadNativeShare(shareText: pwdShareStr);
|
||||
break;
|
||||
case 2:
|
||||
//邮件
|
||||
//邮件
|
||||
Get.toNamed(Routers.sendEmailNotificationPage);
|
||||
break;
|
||||
case 3:
|
||||
//更多
|
||||
//更多
|
||||
String pwdShareStr = '您好,您的电子钥匙生成成功'.tr;
|
||||
NativeInteractionTool().loadNativeShare(shareText: pwdShareStr);
|
||||
break;
|
||||
|
||||
@ -7,6 +7,8 @@ class SendElectronicKeyViewState {
|
||||
TextEditingController emailOrPhoneController =
|
||||
TextEditingController(); //邮箱/手机号输入框
|
||||
TextEditingController keyNameController = TextEditingController(); //钥匙名输入框
|
||||
TextEditingController realNameController = TextEditingController(); //真实姓名输入框
|
||||
TextEditingController idCardController = TextEditingController(); //身份证号输入框
|
||||
|
||||
final FlutterContactPicker contactPicker = FlutterContactPicker();
|
||||
late Contact contact;
|
||||
@ -29,6 +31,7 @@ class SendElectronicKeyViewState {
|
||||
var countryCode = '86';
|
||||
var isCreateUser = false; //用户未注册时传1 已注册传0
|
||||
var isDemoMode = false;
|
||||
var isRequireAuth = false.obs; //是否需要实名认证的必填项
|
||||
|
||||
final timeLimitTips = '接收者在有效期内可以不限次数使用'; //限时
|
||||
final permanentTips = '接收者可以使用此App开关锁'; //永久
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/tools/storage.dart';
|
||||
|
||||
import '../../../../network/api_repository.dart';
|
||||
import '../../../../tools/baseGetXController.dart';
|
||||
@ -11,13 +11,12 @@ class GroupEditLockLogic extends BaseGetXController {
|
||||
|
||||
//锁分组里面添加锁
|
||||
Future<void> lockGroupAddLock(List lockIds) async {
|
||||
if(lockIds.isEmpty){
|
||||
if (lockIds.isEmpty) {
|
||||
showToast("请选择锁".tr);
|
||||
return;
|
||||
}
|
||||
var entity = await ApiRepository.to.lockGroupAddLock(
|
||||
lockIds: lockIds,
|
||||
groupId: state.selectGroupListItem.keyGroupId!);
|
||||
lockIds: lockIds, groupId: state.selectGroupListItem.keyGroupId!);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
showToast("添加成功");
|
||||
eventBus.fire(LockGroupEditGroupLockRefreshEvent());
|
||||
@ -28,7 +27,7 @@ class GroupEditLockLogic extends BaseGetXController {
|
||||
|
||||
//锁分组里面添加锁
|
||||
Future<void> lockGroupDeletLock(List lockIds) async {
|
||||
if(lockIds.isEmpty){
|
||||
if (lockIds.isEmpty) {
|
||||
showToast("请选择锁".tr);
|
||||
return;
|
||||
}
|
||||
@ -41,4 +40,11 @@ class GroupEditLockLogic extends BaseGetXController {
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
onReady() async {
|
||||
super.onReady();
|
||||
|
||||
var isVip = await Storage.getBool(saveIsVip);
|
||||
state.isVip.value = isVip ?? false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -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/tools/advancedFunctionHandle.dart';
|
||||
import 'package:star_lock/tools/noData.dart';
|
||||
|
||||
import '../../../../../../app_settings/app_colors.dart';
|
||||
@ -26,61 +27,78 @@ class _GroupEditLockPageState extends State<GroupEditLockPage> {
|
||||
return Scaffold(
|
||||
backgroundColor: AppColors.mainBackgroundColor,
|
||||
appBar: TitleAppBar(
|
||||
barTitle: state.type == 0 ? TranslationLoader.lanKeys!.add!.tr : TranslationLoader.lanKeys!.delete!.tr,
|
||||
barTitle: state.type == 0
|
||||
? TranslationLoader.lanKeys!.add!.tr
|
||||
: TranslationLoader.lanKeys!.delete!.tr,
|
||||
haveBack: true,
|
||||
backgroundColor: AppColors.mainColor),
|
||||
body: Column(
|
||||
children: [
|
||||
Obx(() => Visibility(
|
||||
visible: state.isVip.value ? false : true,
|
||||
child: AdvancedFunctionHandle()
|
||||
.topTipsAdvancedFeatures('开通高级功能后才可以对锁进行管理'.tr))),
|
||||
Container(
|
||||
margin: EdgeInsets.all(15.w),
|
||||
child: Row(
|
||||
children: [
|
||||
Text(TranslationLoader.lanKeys!.selectTheLockToJoinTheGroup!.tr, style: TextStyle(fontSize: 25.sp)),
|
||||
Text(
|
||||
TranslationLoader
|
||||
.lanKeys!.selectTheLockToJoinTheGroup!.tr,
|
||||
style: TextStyle(fontSize: 25.sp)),
|
||||
],
|
||||
),
|
||||
),
|
||||
Expanded(child: _buildMainUI()),
|
||||
SubmitBtn(btnName: TranslationLoader.lanKeys!.sure!.tr, onClick: () async {
|
||||
var idList = [];
|
||||
for(int i = 0; i<state.lockList.length; i++){
|
||||
LockListItem lockListItem = state.lockList[i];
|
||||
if(lockListItem.isChecked == true){
|
||||
idList.add(lockListItem.lockId);
|
||||
}
|
||||
}
|
||||
if(state.type == 0){
|
||||
// 添加
|
||||
logic.lockGroupAddLock(idList);
|
||||
}else if(state.type == 1){
|
||||
// 删除
|
||||
logic.lockGroupDeletLock(idList);
|
||||
}
|
||||
}),
|
||||
Obx(() => Visibility(
|
||||
visible: state.isVip.value ? true : false,
|
||||
child: SubmitBtn(
|
||||
btnName: TranslationLoader.lanKeys!.sure!.tr,
|
||||
onClick: () async {
|
||||
var idList = [];
|
||||
for (int i = 0; i < state.lockList.length; i++) {
|
||||
LockListItem lockListItem = state.lockList[i];
|
||||
if (lockListItem.isChecked == true) {
|
||||
idList.add(lockListItem.lockId);
|
||||
}
|
||||
}
|
||||
if (state.type == 0) {
|
||||
// 添加
|
||||
logic.lockGroupAddLock(idList);
|
||||
} else if (state.type == 1) {
|
||||
// 删除
|
||||
logic.lockGroupDeletLock(idList);
|
||||
}
|
||||
}))),
|
||||
SizedBox(height: 20.h)
|
||||
],
|
||||
));
|
||||
}
|
||||
|
||||
Widget _buildMainUI(){
|
||||
Widget _buildMainUI() {
|
||||
return state.lockList.isNotEmpty
|
||||
? ListView.separated(
|
||||
itemBuilder: (context, index) {
|
||||
LockListItem itemData = state.lockList[index];
|
||||
return _listItemView(itemData);
|
||||
},
|
||||
itemCount: state.lockList.length,
|
||||
separatorBuilder: (BuildContext context, int index) {
|
||||
return Divider(
|
||||
height: 1.h,
|
||||
color: AppColors.greyLineColor,
|
||||
);
|
||||
},
|
||||
) : NoData();
|
||||
itemBuilder: (context, index) {
|
||||
LockListItem itemData = state.lockList[index];
|
||||
return _listItemView(itemData);
|
||||
},
|
||||
itemCount: state.lockList.length,
|
||||
separatorBuilder: (BuildContext context, int index) {
|
||||
return Divider(
|
||||
height: 1.h,
|
||||
color: AppColors.greyLineColor,
|
||||
);
|
||||
},
|
||||
)
|
||||
: NoData();
|
||||
}
|
||||
|
||||
Widget _listItemView(LockListItem itemData) {
|
||||
return GestureDetector(
|
||||
onTap: (){
|
||||
onTap: () {
|
||||
if (!state.isVip.value) {
|
||||
return;
|
||||
}
|
||||
setState(() {
|
||||
itemData.isChecked = !itemData.isChecked;
|
||||
});
|
||||
@ -92,9 +110,18 @@ class _GroupEditLockPageState extends State<GroupEditLockPage> {
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(width: 20.w,),
|
||||
Image.asset('images/icon_lockGroup_item.png', width: 36, height: 36, fit: BoxFit.fill,),
|
||||
SizedBox(width: 10.w,),
|
||||
SizedBox(
|
||||
width: 20.w,
|
||||
),
|
||||
Image.asset(
|
||||
'images/icon_lockGroup_item.png',
|
||||
width: 36,
|
||||
height: 36,
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
SizedBox(
|
||||
width: 10.w,
|
||||
),
|
||||
Text(
|
||||
itemData.lockAlias ?? '',
|
||||
style: TextStyle(fontSize: 24.sp),
|
||||
@ -113,5 +140,4 @@ class _GroupEditLockPageState extends State<GroupEditLockPage> {
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,24 +1,25 @@
|
||||
|
||||
import 'package:get/get.dart';
|
||||
import '../../../../main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupListEntity.dart';
|
||||
|
||||
class GroupEditLockState {
|
||||
var lockList = <LockListItem>[];
|
||||
var type = 0;// 0添加 1删除
|
||||
var type = 0; // 0添加 1删除
|
||||
var selectGroupListItem = GroupListItem();
|
||||
var ungrouped = GroupListItem();
|
||||
var isVip = false.obs;
|
||||
|
||||
GroupEditLockState() {
|
||||
Map map = Get.arguments;
|
||||
type = map["type"];
|
||||
selectGroupListItem = map["groupListItem"];
|
||||
ungrouped = map["ungrouped"];
|
||||
if(type == 0){
|
||||
if (type == 0) {
|
||||
lockList = ungrouped.lockList!;
|
||||
}else{
|
||||
} else {
|
||||
lockList = selectGroupListItem.lockList!;
|
||||
}
|
||||
|
||||
for(int i = 0; i<lockList.length; i++){
|
||||
for (int i = 0; i < lockList.length; i++) {
|
||||
LockListItem lockListItem = lockList[i];
|
||||
lockListItem.isChecked = false;
|
||||
}
|
||||
|
||||
@ -43,12 +43,17 @@ class _LockGroupListPageState extends State<LockGroupListPage> {
|
||||
// 处理操作按钮的点击事件-添加锁分组
|
||||
state.changeNameController.text = "";
|
||||
// showCupertinoAlertDialog(context, true, 0);
|
||||
ShowTipView().showTFViewAlertDialog(state.changeNameController, TranslationLoader.lanKeys!.createNewGroup!.tr, TranslationLoader.lanKeys!.pleaseEnter!.tr, (){
|
||||
ShowTipView().showTFViewAlertDialog(
|
||||
state.changeNameController,
|
||||
TranslationLoader.lanKeys!.createNewGroup!.tr,
|
||||
TranslationLoader.lanKeys!.pleaseEnter!.tr, () {
|
||||
//发送编辑钥匙名称请求
|
||||
if (state.changeNameController.text.isNotEmpty) {
|
||||
Navigator.of(context).pop();
|
||||
logic.addLockGroupRequest();
|
||||
} else {
|
||||
logic.showToast(TranslationLoader.lanKeys!.pleaseEnterAGroupName!.tr);
|
||||
logic.showToast(
|
||||
TranslationLoader.lanKeys!.pleaseEnterAGroupName!.tr);
|
||||
}
|
||||
});
|
||||
},
|
||||
@ -57,7 +62,10 @@ class _LockGroupListPageState extends State<LockGroupListPage> {
|
||||
backgroundColor: AppColors.mainColor),
|
||||
body: Column(
|
||||
children: [
|
||||
Expanded(child: Obx(() => state.itemDataList.value.isEmpty ? NoData(): _buildMainUI())),
|
||||
Expanded(
|
||||
child: Obx(() => state.itemDataList.value.isEmpty
|
||||
? NoData()
|
||||
: _buildMainUI())),
|
||||
],
|
||||
),
|
||||
);
|
||||
@ -81,7 +89,7 @@ class _LockGroupListPageState extends State<LockGroupListPage> {
|
||||
SizedBox(
|
||||
height: 40.h,
|
||||
child: Text(
|
||||
'${TranslationLoader.lanKeys!.lockTrCount!.tr}:${state.lockNum.toString()}',
|
||||
'${TranslationLoader.lanKeys!.lockTrCount!.tr}:${state.lockNum.toString()}',
|
||||
style: TextStyle(
|
||||
color: AppColors.darkGrayTextColor, fontSize: 20.sp),
|
||||
),
|
||||
@ -91,28 +99,32 @@ class _LockGroupListPageState extends State<LockGroupListPage> {
|
||||
);
|
||||
} else {
|
||||
GroupListItem itemData = state.itemDataList.value[index];
|
||||
if(itemData.groupType == 0){
|
||||
if (itemData.groupType == 0) {
|
||||
state.ungrouped = itemData;
|
||||
}
|
||||
if (index < state.itemDataList.value.length) {
|
||||
return LeftSlideActions(
|
||||
key: Key(itemData.keyGroupId!.toString()),
|
||||
actionsWidth: itemData.groupType != 0 ? 200.w : 0,
|
||||
actions: itemData.groupType != 0 ? [
|
||||
_buildEditBtn(itemData),
|
||||
_buildDeleteBtn(itemData),
|
||||
] : [],
|
||||
actions: itemData.groupType != 0
|
||||
? [
|
||||
_buildEditBtn(itemData),
|
||||
_buildDeleteBtn(itemData),
|
||||
]
|
||||
: [],
|
||||
decoration: const BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(1)),
|
||||
),
|
||||
child: CommonItem(
|
||||
leftTitel:
|
||||
'${itemData.keyGroupName}(${itemData.lockList?.length})',
|
||||
'${itemData.keyGroupName}(${itemData.lockList?.length})',
|
||||
rightTitle: "",
|
||||
allHeight: 70.h,
|
||||
action: () {
|
||||
|
||||
Get.toNamed(Routers.lockItemListPage, arguments: {'groupListItem': itemData, "ungrouped": state.ungrouped});
|
||||
Get.toNamed(Routers.lockItemListPage, arguments: {
|
||||
'groupListItem': itemData,
|
||||
"ungrouped": state.ungrouped
|
||||
});
|
||||
}),
|
||||
);
|
||||
}
|
||||
@ -161,7 +173,7 @@ class _LockGroupListPageState extends State<LockGroupListPage> {
|
||||
onTap: () {
|
||||
// 省略: 弹出是否删除的确认对话框。
|
||||
// showIosTipViewDialog(context, groupListItem);
|
||||
ShowTipView().showIosTipWithContentDialog("分组下的锁将被移到未分组里".tr, (){
|
||||
ShowTipView().showIosTipWithContentDialog("分组下的锁将被移到未分组里".tr, () {
|
||||
logic.deleteLockGroupRequest(groupListItem.keyGroupId!);
|
||||
});
|
||||
},
|
||||
@ -189,11 +201,15 @@ class _LockGroupListPageState extends State<LockGroupListPage> {
|
||||
state.changeNameController.text = groupListItem.keyGroupName!;
|
||||
// showCupertinoAlertDialog(context, false, groupListItem.keyGroupId!);
|
||||
|
||||
ShowTipView().showTFViewAlertDialog(state.changeNameController, TranslationLoader.lanKeys!.createNewGroup!.tr, TranslationLoader.lanKeys!.pleaseEnter!.tr, (){
|
||||
ShowTipView().showTFViewAlertDialog(
|
||||
state.changeNameController,
|
||||
TranslationLoader.lanKeys!.createNewGroup!.tr,
|
||||
TranslationLoader.lanKeys!.pleaseEnter!.tr, () {
|
||||
if (state.changeNameController.text.isNotEmpty) {
|
||||
logic.editLockGroupRequest(groupListItem.keyGroupId!);
|
||||
} else {
|
||||
logic.showToast(TranslationLoader.lanKeys!.pleaseEnterAGroupName!.tr);
|
||||
logic.showToast(
|
||||
TranslationLoader.lanKeys!.pleaseEnterAGroupName!.tr);
|
||||
}
|
||||
});
|
||||
},
|
||||
@ -232,5 +248,4 @@ class _LockGroupListPageState extends State<LockGroupListPage> {
|
||||
// }
|
||||
// );
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
@ -227,6 +227,5 @@ abstract class Api {
|
||||
final String deleteLockCloudStorageURL = '/lockCloudStorage/delete'; //删除云存
|
||||
final String getServiceUserPackageURL =
|
||||
'/v2/service/getUserPackage'; //获取增值服务用户余量包
|
||||
final String isFaceAuthenticationURL =
|
||||
'/key/isFaceAuthentication'; //检测实名认证是否支持开启
|
||||
final String isFaceAuthenticationURL = '/key/checkFace'; //检测实名认证是否支持开启
|
||||
}
|
||||
|
||||
@ -142,7 +142,9 @@ class ApiProvider extends BaseProvider {
|
||||
List weekDays,
|
||||
int startTime,
|
||||
int endTime,
|
||||
int isOnlyManageSelf) =>
|
||||
int isOnlyManageSelf,
|
||||
String realName,
|
||||
String idCardNumber) =>
|
||||
post(
|
||||
sendElectronicKeyURL.toUrl,
|
||||
jsonEncode({
|
||||
@ -165,6 +167,8 @@ class ApiProvider extends BaseProvider {
|
||||
'startTime': startTime,
|
||||
'endTime': endTime,
|
||||
'isOnlyManageSelf': isOnlyManageSelf,
|
||||
'realName': realName,
|
||||
'idCardNumber': idCardNumber
|
||||
}));
|
||||
|
||||
Future<Response> uploadElectricQuantity(
|
||||
@ -452,7 +456,7 @@ class ApiProvider extends BaseProvider {
|
||||
String startDate,
|
||||
String endDate,
|
||||
String addType,
|
||||
int? pwdRight,
|
||||
int? pwdRight,
|
||||
) =>
|
||||
post(
|
||||
passwordKeyAddURL.toUrl,
|
||||
@ -2028,7 +2032,7 @@ class ApiProvider extends BaseProvider {
|
||||
}));
|
||||
|
||||
// 检测实名认证是否支持开启
|
||||
Future<Response> isFaceAuthentication(
|
||||
Future<Response> keyCheckFace(
|
||||
int countryCode,
|
||||
String account,
|
||||
) =>
|
||||
|
||||
@ -179,7 +179,9 @@ class ApiRepository {
|
||||
required List weekDays,
|
||||
required int startTime,
|
||||
required int endTime,
|
||||
required int isOnlyManageSelf}) async {
|
||||
required int isOnlyManageSelf,
|
||||
required String realName,
|
||||
required String idCardNumber}) async {
|
||||
final res = await apiProvider.sendElectronicKey(
|
||||
createUser,
|
||||
countryCode,
|
||||
@ -199,7 +201,9 @@ class ApiRepository {
|
||||
weekDays,
|
||||
startTime,
|
||||
endTime,
|
||||
isOnlyManageSelf);
|
||||
isOnlyManageSelf,
|
||||
realName,
|
||||
idCardNumber);
|
||||
return AuthorizedAdminSendEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
@ -2055,11 +2059,11 @@ class ApiRepository {
|
||||
}
|
||||
|
||||
// 检测实名认证是否支持开启
|
||||
Future<AdvancedFunctionRecordEntity> isFaceAuthentication({
|
||||
Future<AdvancedFunctionRecordEntity> keyCheckFace({
|
||||
required int countryCode,
|
||||
required String account,
|
||||
}) async {
|
||||
final res = await apiProvider.isFaceAuthentication(countryCode, account);
|
||||
final res = await apiProvider.keyCheckFace(countryCode, account);
|
||||
return AdvancedFunctionRecordEntity.fromJson(res.body);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user