Merge branch 'master_hyx'
This commit is contained in:
commit
3d491ffaf2
@ -687,6 +687,7 @@
|
|||||||
|
|
||||||
"虹膜":"虹膜",
|
"虹膜":"虹膜",
|
||||||
"手掌":"手掌",
|
"手掌":"手掌",
|
||||||
|
|
||||||
"商城":"商城",
|
"商城":"商城",
|
||||||
"我的":"我的"
|
"我的":"我的"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,25 @@
|
|||||||
|
class FaceAuthenticationEntity {
|
||||||
|
FaceAuthenticationEntity({
|
||||||
|
this.description,
|
||||||
|
this.errorCode,
|
||||||
|
this.errorMsg,
|
||||||
|
});
|
||||||
|
|
||||||
|
FaceAuthenticationEntity.fromJson(dynamic json) {
|
||||||
|
description = json['description'];
|
||||||
|
errorCode = json['errorCode'];
|
||||||
|
errorMsg = json['errorMsg'];
|
||||||
|
}
|
||||||
|
|
||||||
|
String? description;
|
||||||
|
int? errorCode;
|
||||||
|
String? errorMsg;
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final map = <String, dynamic>{};
|
||||||
|
map['description'] = description;
|
||||||
|
map['errorCode'] = errorCode;
|
||||||
|
map['errorMsg'] = errorMsg;
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,6 +1,7 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesRealName/value_added_services_real_name_logic.dart';
|
||||||
import '../../../app_settings/app_colors.dart';
|
import '../../../app_settings/app_colors.dart';
|
||||||
import '../../../tools/commonItem.dart';
|
import '../../../tools/commonItem.dart';
|
||||||
import '../../../tools/titleAppBar.dart';
|
import '../../../tools/titleAppBar.dart';
|
||||||
@ -18,29 +19,33 @@ class _ValueAddedServicesRealNamePageState
|
|||||||
extends State<ValueAddedServicesRealNamePage> {
|
extends State<ValueAddedServicesRealNamePage> {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return GetBuilder<ValueAddedServicesRealNameLogic>(
|
||||||
backgroundColor: AppColors.mainBackgroundColor,
|
init: ValueAddedServicesRealNameLogic(),
|
||||||
appBar: TitleAppBar(
|
builder: (ValueAddedServicesRealNameLogic logic) {
|
||||||
barTitle: TranslationLoader.lanKeys!.realNameAuthentication!.tr,
|
return Scaffold(
|
||||||
haveBack: true,
|
backgroundColor: AppColors.mainBackgroundColor,
|
||||||
backgroundColor: AppColors.mainColor),
|
appBar: TitleAppBar(
|
||||||
body: Column(
|
barTitle: TranslationLoader.lanKeys!.realNameAuthentication!.tr,
|
||||||
children: [
|
haveBack: true,
|
||||||
Container(
|
backgroundColor: AppColors.mainColor),
|
||||||
width: 1.sw,
|
body: Column(
|
||||||
// color: Colors.grey.shade300,
|
children: [
|
||||||
padding: EdgeInsets.only(
|
Container(
|
||||||
left: 25.h, right: 25.h, top: 25.h, bottom: 10.h),
|
width: 1.sw,
|
||||||
child: Text(
|
// color: Colors.grey.shade300,
|
||||||
TranslationLoader.lanKeys!.buyRealNameTip!.tr,
|
padding: EdgeInsets.only(
|
||||||
style: TextStyle(
|
left: 25.h, right: 25.h, top: 25.h, bottom: 10.h),
|
||||||
color: AppColors.darkGrayTextColor, fontSize: 20.sp),
|
child: Text(
|
||||||
)),
|
TranslationLoader.lanKeys!.buyRealNameTip!.tr,
|
||||||
middleWidget(),
|
style: TextStyle(
|
||||||
bottomWidget()
|
color: AppColors.darkGrayTextColor, fontSize: 20.sp),
|
||||||
],
|
)),
|
||||||
),
|
middleWidget(),
|
||||||
);
|
bottomWidget()
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget middleWidget() {
|
Widget middleWidget() {
|
||||||
@ -112,98 +117,65 @@ class _ValueAddedServicesRealNamePageState
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget bottomWidget() {
|
Widget bottomWidget() {
|
||||||
return Container(
|
return GetBuilder<ValueAddedServicesRealNameLogic>(
|
||||||
width: 1.sw,
|
builder: (ValueAddedServicesRealNameLogic logic) {
|
||||||
color: Colors.white,
|
return Container(
|
||||||
margin: EdgeInsets.all(20.h),
|
width: 1.sw,
|
||||||
child: Column(
|
color: Colors.white,
|
||||||
children: [
|
margin: EdgeInsets.all(20.h),
|
||||||
Column(
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Column(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
padding:
|
||||||
|
EdgeInsets.only(top: 20.h, bottom: 20.h, left: 30.w),
|
||||||
|
child: Text(
|
||||||
|
TranslationLoader
|
||||||
|
.lanKeys!.buyRealNameSelectYouWantBuyTip!.tr,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 24.sp, fontWeight: FontWeight.w600),
|
||||||
|
)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
checkCommonItem(
|
||||||
|
logic, TranslationLoader.lanKeys!.forTheFirstTime!.tr, 0),
|
||||||
|
checkCommonItem(logic, TranslationLoader.lanKeys!.onceDay!.tr, 1),
|
||||||
|
checkCommonItem(logic, TranslationLoader.lanKeys!.weekOnce!.tr, 2),
|
||||||
|
checkCommonItem(logic, TranslationLoader.lanKeys!.monthOnce!.tr, 3,
|
||||||
|
isHaveLine: false, isHaveRightWidget: true),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//选择组件
|
||||||
|
Widget checkCommonItem(
|
||||||
|
ValueAddedServicesRealNameLogic logic, String text, int index,
|
||||||
|
{bool isHaveLine = true, bool isHaveRightWidget = true}) {
|
||||||
|
bool check = logic.state.index == index;
|
||||||
|
return CommonItem(
|
||||||
|
leftTitel: text,
|
||||||
|
rightTitle: "",
|
||||||
|
allHeight: 60.h,
|
||||||
|
isHaveLine: isHaveLine,
|
||||||
|
isHaveRightWidget: isHaveRightWidget,
|
||||||
|
rightWidget: GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
logic.check(index);
|
||||||
|
},
|
||||||
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Image.asset(
|
||||||
padding: EdgeInsets.only(top: 20.h, bottom: 20.h, left: 30.w),
|
check
|
||||||
child: Text(
|
? 'images/icon_round_select.png'
|
||||||
TranslationLoader
|
: 'images/icon_round_unSelect.png',
|
||||||
.lanKeys!.buyRealNameSelectYouWantBuyTip!.tr,
|
width: 30.w,
|
||||||
style:
|
height: 30.w,
|
||||||
TextStyle(fontSize: 24.sp, fontWeight: FontWeight.w600),
|
),
|
||||||
)),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
CommonItem(
|
));
|
||||||
leftTitel: TranslationLoader.lanKeys!.forTheFirstTime!.tr,
|
|
||||||
rightTitle: "",
|
|
||||||
allHeight: 60.h,
|
|
||||||
isHaveLine: true,
|
|
||||||
isHaveRightWidget: true,
|
|
||||||
rightWidget: GestureDetector(
|
|
||||||
onTap: () {},
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
Image.asset(
|
|
||||||
'images/icon_round_unSelect.png',
|
|
||||||
width: 30.w,
|
|
||||||
height: 30.w,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
)),
|
|
||||||
CommonItem(
|
|
||||||
leftTitel: TranslationLoader.lanKeys!.onceDay!.tr,
|
|
||||||
rightTitle: "",
|
|
||||||
allHeight: 60.h,
|
|
||||||
isHaveLine: true,
|
|
||||||
isHaveRightWidget: true,
|
|
||||||
rightWidget: GestureDetector(
|
|
||||||
onTap: () {},
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
Image.asset(
|
|
||||||
'images/icon_round_unSelect.png',
|
|
||||||
width: 30.w,
|
|
||||||
height: 30.w,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
)),
|
|
||||||
CommonItem(
|
|
||||||
leftTitel: TranslationLoader.lanKeys!.weekOnce!.tr,
|
|
||||||
rightTitle: "",
|
|
||||||
allHeight: 60.h,
|
|
||||||
isHaveLine: true,
|
|
||||||
isHaveRightWidget: true,
|
|
||||||
rightWidget: GestureDetector(
|
|
||||||
onTap: () {},
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
Image.asset(
|
|
||||||
'images/icon_round_unSelect.png',
|
|
||||||
width: 30.w,
|
|
||||||
height: 30.w,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
)),
|
|
||||||
CommonItem(
|
|
||||||
leftTitel: TranslationLoader.lanKeys!.monthOnce!.tr,
|
|
||||||
rightTitle: "",
|
|
||||||
allHeight: 60.h,
|
|
||||||
isHaveLine: false,
|
|
||||||
isHaveRightWidget: true,
|
|
||||||
rightWidget: GestureDetector(
|
|
||||||
onTap: () {},
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
Image.asset(
|
|
||||||
'images/icon_round_unSelect.png',
|
|
||||||
width: 30.w,
|
|
||||||
height: 30.w,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
)),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,46 @@
|
|||||||
|
import 'dart:async';
|
||||||
|
|
||||||
|
import 'package:get/utils.dart';
|
||||||
|
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesRealName/face_authentication_entity.dart';
|
||||||
|
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesRealName/value_added_services_real_name_state.dart';
|
||||||
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
|
import '../../../network/api_repository.dart';
|
||||||
|
import '../../../tools/eventBusEventManage.dart';
|
||||||
|
|
||||||
|
class ValueAddedServicesRealNameLogic extends BaseGetXController {
|
||||||
|
final ValueAddedServicesRealNameState state =
|
||||||
|
ValueAddedServicesRealNameState();
|
||||||
|
|
||||||
|
//请求消息列表
|
||||||
|
Future<bool> setFaceAuthentication(int faceAuthFrequence) async {
|
||||||
|
FaceAuthenticationEntity entity =
|
||||||
|
await ApiRepository.to.setFaceAuthentication(
|
||||||
|
faceAuthFrequence: faceAuthFrequence,
|
||||||
|
);
|
||||||
|
return entity.errorCode!.codeIsSuccessful;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> check(int index) async {
|
||||||
|
bool isSuccessful = await setFaceAuthentication(state.index + 1);
|
||||||
|
if (isSuccessful) {
|
||||||
|
showToast('修改成功'.tr);
|
||||||
|
state.index = index;
|
||||||
|
}
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void onReady() {
|
||||||
|
super.onReady();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void onInit() {
|
||||||
|
super.onInit();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void onClose() {
|
||||||
|
super.onClose();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,3 @@
|
|||||||
|
class ValueAddedServicesRealNameState {
|
||||||
|
int index = 0;
|
||||||
|
}
|
||||||
@ -45,7 +45,8 @@ abstract class Api {
|
|||||||
|
|
||||||
final String passwordKeyGetURL = '/keyboardPwd/get'; //获取密码
|
final String passwordKeyGetURL = '/keyboardPwd/get'; //获取密码
|
||||||
final String passwordKeyAddURL = '/keyboardPwd/add'; //自定义密码
|
final String passwordKeyAddURL = '/keyboardPwd/add'; //自定义密码
|
||||||
final String passwordKeyCheckKeyboardpwdNameURL = '/keyboardPwd/checkKeyboardpwdName'; //自定义密码校验密码跟名字是否重复
|
final String passwordKeyCheckKeyboardpwdNameURL =
|
||||||
|
'/keyboardPwd/checkKeyboardpwdName'; //自定义密码校验密码跟名字是否重复
|
||||||
final String updatePasswordKeyURL = '/keyboardPwd/update'; //修改密码详情
|
final String updatePasswordKeyURL = '/keyboardPwd/update'; //修改密码详情
|
||||||
final String clearOperationRecordURL = '/lockRecords/clear'; //清空操作记录
|
final String clearOperationRecordURL = '/lockRecords/clear'; //清空操作记录
|
||||||
final String addlockGroupURL = '/keyGroup/add'; //创建锁分组
|
final String addlockGroupURL = '/keyGroup/add'; //创建锁分组
|
||||||
@ -175,7 +176,8 @@ abstract class Api {
|
|||||||
'/safeAnswer/getOwnQuestionList'; //获取已设置的安全信息
|
'/safeAnswer/getOwnQuestionList'; //获取已设置的安全信息
|
||||||
final String updateSafeAnswerURL = '/safeAnswer/update'; //修改安全信息
|
final String updateSafeAnswerURL = '/safeAnswer/update'; //修改安全信息
|
||||||
final String setSafeAnswerURL = '/safeAnswer/set'; //设置安全信息
|
final String setSafeAnswerURL = '/safeAnswer/set'; //设置安全信息
|
||||||
final String getUpTokenURL = '/file/getUploadParams'; //上传头像 先获取upToken 再调用updateUserInfo
|
final String getUpTokenURL =
|
||||||
|
'/file/getUploadParams'; //上传头像 先获取upToken 再调用updateUserInfo
|
||||||
final String unbindPhoneTokenURL = '/user/unbindPhoneToken'; //获取解绑手机号Token
|
final String unbindPhoneTokenURL = '/user/unbindPhoneToken'; //获取解绑手机号Token
|
||||||
final String unbindEmailTokenURL = '/user/unbindEmailToken'; //获取解绑邮箱Token
|
final String unbindEmailTokenURL = '/user/unbindEmailToken'; //获取解绑邮箱Token
|
||||||
final String pushBindAppIdURL = '/user/bindAppId'; //推送绑定APP设备
|
final String pushBindAppIdURL = '/user/bindAppId'; //推送绑定APP设备
|
||||||
@ -193,4 +195,7 @@ abstract class Api {
|
|||||||
|
|
||||||
final String getLockNoticeSettingURL =
|
final String getLockNoticeSettingURL =
|
||||||
'/lockSetting/getLockNoticeSetting'; //获取锁消息设置
|
'/lockSetting/getLockNoticeSetting'; //获取锁消息设置
|
||||||
|
|
||||||
|
final String setFaceAuthenticationURL =
|
||||||
|
'/v2/service/setFaceAuthentication'; //设置实名认证频次
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1779,6 +1779,13 @@ class ApiProvider extends BaseProvider {
|
|||||||
jsonEncode({
|
jsonEncode({
|
||||||
'lockId': lockId,
|
'lockId': lockId,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
// 设置实名认证频次
|
||||||
|
Future<Response> setFaceAuthentication(int faceAuthFrequence) => post(
|
||||||
|
setFaceAuthenticationURL.toUrl,
|
||||||
|
jsonEncode({
|
||||||
|
'face_auth_frequence': faceAuthFrequence,
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
extension ExtensionString on String {
|
extension ExtensionString on String {
|
||||||
|
|||||||
@ -21,6 +21,7 @@ import 'package:star_lock/mine/mineSet/lockUserManage/expireLockList/expireElect
|
|||||||
import 'package:star_lock/mine/mineSet/lockUserManage/expireLockList/expireFingerprint/expireFingerprint_entity.dart';
|
import 'package:star_lock/mine/mineSet/lockUserManage/expireLockList/expireFingerprint/expireFingerprint_entity.dart';
|
||||||
import 'package:star_lock/mine/mineSet/lockUserManage/lockUserManageList/keyListByUserEntity.dart';
|
import 'package:star_lock/mine/mineSet/lockUserManage/lockUserManageList/keyListByUserEntity.dart';
|
||||||
import 'package:star_lock/mine/mineSet/mineSet/userSettingInfoEntity.dart';
|
import 'package:star_lock/mine/mineSet/mineSet/userSettingInfoEntity.dart';
|
||||||
|
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesRealName/face_authentication_entity.dart';
|
||||||
import '../common/safetyVerification/entity/CheckSafetyVerificationEntity.dart';
|
import '../common/safetyVerification/entity/CheckSafetyVerificationEntity.dart';
|
||||||
import '../common/safetyVerification/entity/SafetyVerificationEntity.dart';
|
import '../common/safetyVerification/entity/SafetyVerificationEntity.dart';
|
||||||
import '../login/login/entity/LoginEntity.dart';
|
import '../login/login/entity/LoginEntity.dart';
|
||||||
@ -1813,4 +1814,12 @@ class ApiRepository {
|
|||||||
final res = await apiProvider.getLockNoticeSetting(lockId);
|
final res = await apiProvider.getLockNoticeSetting(lockId);
|
||||||
return VersionUndateEntity.fromJson(res.body);
|
return VersionUndateEntity.fromJson(res.body);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 获取锁消息设置
|
||||||
|
Future<FaceAuthenticationEntity> setFaceAuthentication(
|
||||||
|
{required int faceAuthFrequence}) async {
|
||||||
|
final res = await apiProvider.setFaceAuthentication(faceAuthFrequence);
|
||||||
|
return FaceAuthenticationEntity.fromJson(res.body);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user