1,修改实名认证点击逻辑
2,授权管理员角色新增联系管理员
This commit is contained in:
parent
d23e0a121f
commit
317013eb98
@ -228,20 +228,23 @@ class AuthorizedAdminLogic extends BaseGetXController {
|
||||
//检测实名认证是否支持开启
|
||||
Future<void> keyCheckFace() async {
|
||||
AdvancedFunctionRecordEntity entity = await ApiRepository.to.keyCheckFace(
|
||||
countryCode: int.parse(state.countryCode.value),
|
||||
account: state.emailOrPhoneController.text);
|
||||
lockId: CommonDataManage().currentKeyInfo.lockId ?? 0,
|
||||
);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
//打开实名认证,需要弹出输入身份证信息框
|
||||
state.isRequireAuth.value = true;
|
||||
state.isAuthentication.value = true;
|
||||
} else {
|
||||
} else if (entity.errorCode == 432) {
|
||||
//432--余量不足,需购买
|
||||
ShowTipView().showBuyTipWithContentAlert(
|
||||
ShowCupertinoAlertView().showBuyTipWithContentAlert(
|
||||
titleStr: '实名认证为付费功能,请购买后再使用'.tr,
|
||||
sureClick: () {
|
||||
Get.toNamed(Routers.advancedFeaturesWebPage,
|
||||
arguments: {'isShop': false});
|
||||
});
|
||||
} else if (entity.errorCode == 433) {
|
||||
//需联系管理员购买
|
||||
ShowCupertinoAlertView().showContactAdministratorBuyAlert();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -185,20 +185,23 @@ class SendElectronicKeyViewLogic extends BaseGetXController {
|
||||
//检测实名认证是否支持开启
|
||||
Future<void> keyCheckFace() async {
|
||||
AdvancedFunctionRecordEntity entity = await ApiRepository.to.keyCheckFace(
|
||||
countryCode: int.parse(state.countryCode),
|
||||
account: state.emailOrPhoneController.text);
|
||||
lockId: CommonDataManage().currentKeyInfo.lockId ?? 0,
|
||||
);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
//打开实名认证,需要弹出输入身份证信息框
|
||||
state.isRequireAuth.value = true;
|
||||
state.isAuthentication.value = true;
|
||||
} else {
|
||||
} else if (entity.errorCode == 432) {
|
||||
//432--余量不足,需购买
|
||||
ShowTipView().showBuyTipWithContentAlert(
|
||||
ShowCupertinoAlertView().showBuyTipWithContentAlert(
|
||||
titleStr: '实名认证为付费功能,请购买后再使用'.tr,
|
||||
sureClick: () {
|
||||
Get.toNamed(Routers.advancedFeaturesWebPage,
|
||||
arguments: {'isShop': false});
|
||||
});
|
||||
} else if (entity.errorCode == 433) {
|
||||
//需联系管理员购买
|
||||
ShowCupertinoAlertView().showContactAdministratorBuyAlert();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -643,8 +643,8 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
: false,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
ShowCupertinoAlertView()
|
||||
.isToRemoteUnLockAlert((idCard, name) {
|
||||
ShowCupertinoAlertView().isToRemoteUnLockAlert(
|
||||
remoteUnlockAction: () {
|
||||
if (state.keyInfos.value.hasGateway != 1) {
|
||||
logic.showToast('附近没有可用网关');
|
||||
}
|
||||
@ -1316,7 +1316,9 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
//如果需要实名认证,需认证完成,方可开锁
|
||||
isNeedRealNameAuthThenOpenLock() {
|
||||
state.nextAuthTime.value = state.keyInfos.value.nextFaceValidateTime ?? 0;
|
||||
if (state.keyInfos.value.faceAuthentication == 1 && state.nextAuthTime.value > 0 && DateTool().compareTimeIsOvertime(state.nextAuthTime.value) == true) {
|
||||
if (state.keyInfos.value.faceAuthentication == 1 &&
|
||||
state.nextAuthTime.value > 0 &&
|
||||
DateTool().compareTimeIsOvertime(state.nextAuthTime.value) == true) {
|
||||
AliyunRealNameAuthProvider(
|
||||
getLockInfo: state.keyInfos.value,
|
||||
onCertifyResultWithTime: ((bool isSuccess, int getNextAuthTime) {
|
||||
|
||||
@ -184,8 +184,7 @@ class ApiProvider extends BaseProvider {
|
||||
'electricQuantityStandby': electricQuantityStandby,
|
||||
'lockId': lockId,
|
||||
}),
|
||||
isUnShowLoading: isUnShowLoading
|
||||
);
|
||||
isUnShowLoading: isUnShowLoading);
|
||||
|
||||
Future<Response> modifyKeyName(
|
||||
String keyId,
|
||||
@ -265,17 +264,17 @@ class ApiProvider extends BaseProvider {
|
||||
|
||||
Future<Response> lockRecordList(
|
||||
{required String lockId,
|
||||
required String pageNo,
|
||||
required String recordType,
|
||||
required String searchStr,
|
||||
required String startDate,
|
||||
required String endDate,
|
||||
required String keyboardPwdId,
|
||||
required String cardId,
|
||||
required String fingerprintId,
|
||||
required String keyId,
|
||||
required String faceId,
|
||||
required String pageSize}) =>
|
||||
required String pageNo,
|
||||
required String recordType,
|
||||
required String searchStr,
|
||||
required String startDate,
|
||||
required String endDate,
|
||||
required String keyboardPwdId,
|
||||
required String cardId,
|
||||
required String fingerprintId,
|
||||
required String keyId,
|
||||
required String faceId,
|
||||
required String pageSize}) =>
|
||||
post(
|
||||
keyOperationRecordURL.toUrl,
|
||||
jsonEncode({
|
||||
@ -809,10 +808,8 @@ class ApiProvider extends BaseProvider {
|
||||
}));
|
||||
|
||||
// 获取服务器当前时间
|
||||
Future<Response> getServerDatetimeLoadData() => post(
|
||||
getServerDatetimeUrl.toUrl,
|
||||
jsonEncode({}),
|
||||
isUnShowLoading: true);
|
||||
Future<Response> getServerDatetimeLoadData() =>
|
||||
post(getServerDatetimeUrl.toUrl, jsonEncode({}), isUnShowLoading: true);
|
||||
|
||||
// 锁诊断
|
||||
Future<Response> setLockDiagnoseData(
|
||||
@ -1611,12 +1608,12 @@ class ApiProvider extends BaseProvider {
|
||||
post(getUserInfoURL.toUrl, jsonEncode({'operatorUid': operatorUid}));
|
||||
|
||||
// 重置密码钥匙
|
||||
Future<Response> keyboardPwdReset(String lockId, List passwordKey) =>
|
||||
post(keyboardPwdResetURL.toUrl,
|
||||
jsonEncode({
|
||||
'lockId': lockId,
|
||||
'passwordKey': passwordKey,
|
||||
}));
|
||||
Future<Response> keyboardPwdReset(String lockId, List passwordKey) => post(
|
||||
keyboardPwdResetURL.toUrl,
|
||||
jsonEncode({
|
||||
'lockId': lockId,
|
||||
'passwordKey': passwordKey,
|
||||
}));
|
||||
|
||||
//登陆后可使用获取验证码,免图片滑动验证
|
||||
Future<Response> sendValidationCodeAuth(String countryCode, String account,
|
||||
@ -2042,14 +2039,12 @@ class ApiProvider extends BaseProvider {
|
||||
|
||||
// 检测实名认证是否支持开启
|
||||
Future<Response> keyCheckFace(
|
||||
int countryCode,
|
||||
String account,
|
||||
int lockId,
|
||||
) =>
|
||||
post(
|
||||
isFaceAuthenticationURL.toUrl,
|
||||
jsonEncode({
|
||||
'countryCode': countryCode,
|
||||
'account': account,
|
||||
'lockId': lockId,
|
||||
}));
|
||||
|
||||
// 获取人脸认证certifyId
|
||||
|
||||
@ -219,19 +219,19 @@ class ApiRepository {
|
||||
|
||||
//钥匙详情-操作记录
|
||||
Future<KeyOperationRecordEntity> lockRecordList({
|
||||
required String lockId,
|
||||
required String pageNo,
|
||||
required String recordType,
|
||||
required String searchStr,
|
||||
required String startDate,
|
||||
required String endDate,
|
||||
required String keyboardPwdId,
|
||||
required String cardId,
|
||||
required String fingerprintId,
|
||||
required String keyId,
|
||||
required String faceId,
|
||||
required String pageSize,
|
||||
}) async {
|
||||
required String lockId,
|
||||
required String pageNo,
|
||||
required String recordType,
|
||||
required String searchStr,
|
||||
required String startDate,
|
||||
required String endDate,
|
||||
required String keyboardPwdId,
|
||||
required String cardId,
|
||||
required String fingerprintId,
|
||||
required String keyId,
|
||||
required String faceId,
|
||||
required String pageSize,
|
||||
}) async {
|
||||
final res = await apiProvider.lockRecordList(
|
||||
lockId: lockId,
|
||||
pageNo: pageNo,
|
||||
@ -323,9 +323,9 @@ class ApiRepository {
|
||||
//锁电量更新
|
||||
Future<KeyOperationRecordEntity> uploadElectricQuantity(
|
||||
{required String? electricQuantity,
|
||||
required String? electricQuantityStandby,
|
||||
required String? lockId,
|
||||
required bool? isUnShowLoading}) async {
|
||||
required String? electricQuantityStandby,
|
||||
required String? lockId,
|
||||
required bool? isUnShowLoading}) async {
|
||||
final res = await apiProvider.uploadElectricQuantity(
|
||||
electricQuantity!, electricQuantityStandby!, lockId!, isUnShowLoading!);
|
||||
return KeyOperationRecordEntity.fromJson(res.body);
|
||||
@ -2075,10 +2075,9 @@ class ApiRepository {
|
||||
|
||||
// 检测实名认证是否支持开启
|
||||
Future<AdvancedFunctionRecordEntity> keyCheckFace({
|
||||
required int countryCode,
|
||||
required String account,
|
||||
required int lockId,
|
||||
}) async {
|
||||
final res = await apiProvider.keyCheckFace(countryCode, account);
|
||||
final res = await apiProvider.keyCheckFace(lockId);
|
||||
return AdvancedFunctionRecordEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
|
||||
@ -276,7 +276,7 @@ class ShowCupertinoAlertView {
|
||||
}
|
||||
|
||||
//是否要远程开锁弹窗
|
||||
void isToRemoteUnLockAlert(AuthInfoCallback callback) {
|
||||
void isToRemoteUnLockAlert({required Function remoteUnlockAction}) {
|
||||
showCupertinoDialog(
|
||||
context: Get.context!,
|
||||
builder: (BuildContext context) {
|
||||
@ -296,7 +296,7 @@ class ShowCupertinoAlertView {
|
||||
CupertinoDialogAction(
|
||||
onPressed: () {
|
||||
// 在这里处理确认按钮的逻辑
|
||||
callback(null, null);
|
||||
remoteUnlockAction();
|
||||
Get.back();
|
||||
},
|
||||
child: Text(
|
||||
@ -309,4 +309,59 @@ class ShowCupertinoAlertView {
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
// 购买按钮
|
||||
void showBuyTipWithContentAlert(
|
||||
{required String titleStr, required Function sureClick}) {
|
||||
showCupertinoDialog(
|
||||
context: Get.context!,
|
||||
builder: (context) {
|
||||
return CupertinoAlertDialog(
|
||||
title: Text(titleStr),
|
||||
actions: [
|
||||
CupertinoDialogAction(
|
||||
child: Text(
|
||||
'取消'.tr,
|
||||
style: TextStyle(color: AppColors.mainColor),
|
||||
),
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
},
|
||||
),
|
||||
CupertinoDialogAction(
|
||||
child:
|
||||
Text('购买'.tr, style: TextStyle(color: AppColors.mainColor)),
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
sureClick();
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
// 联系管理员购买
|
||||
void showContactAdministratorBuyAlert() {
|
||||
showCupertinoDialog(
|
||||
context: Get.context!,
|
||||
builder: (context) {
|
||||
return CupertinoAlertDialog(
|
||||
title: const Text('实名认证为付费功能,请联系锁的管理员购买后再使用'),
|
||||
actions: [
|
||||
CupertinoDialogAction(
|
||||
child: Text(
|
||||
'确定'.tr,
|
||||
style: TextStyle(color: AppColors.mainColor),
|
||||
),
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -122,36 +122,4 @@ class ShowTipView {
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
// 购买按钮
|
||||
void showBuyTipWithContentAlert(
|
||||
{required String titleStr, required Function sureClick}) {
|
||||
showCupertinoDialog(
|
||||
context: Get.context!,
|
||||
builder: (context) {
|
||||
return CupertinoAlertDialog(
|
||||
title: Text(titleStr),
|
||||
actions: [
|
||||
CupertinoDialogAction(
|
||||
child: Text(
|
||||
'取消'.tr,
|
||||
style: TextStyle(color: AppColors.mainColor),
|
||||
),
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
},
|
||||
),
|
||||
CupertinoDialogAction(
|
||||
child:
|
||||
Text('购买'.tr, style: TextStyle(color: AppColors.mainColor)),
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
sureClick();
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user