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