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_screenutil/flutter_screenutil.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 '../../../tools/commonItem.dart';
|
||||
import '../../../tools/titleAppBar.dart';
|
||||
@ -18,29 +19,33 @@ class _ValueAddedServicesRealNamePageState
|
||||
extends State<ValueAddedServicesRealNamePage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: AppColors.mainBackgroundColor,
|
||||
appBar: TitleAppBar(
|
||||
barTitle: TranslationLoader.lanKeys!.realNameAuthentication!.tr,
|
||||
haveBack: true,
|
||||
backgroundColor: AppColors.mainColor),
|
||||
body: Column(
|
||||
children: [
|
||||
Container(
|
||||
width: 1.sw,
|
||||
// color: Colors.grey.shade300,
|
||||
padding: EdgeInsets.only(
|
||||
left: 25.h, right: 25.h, top: 25.h, bottom: 10.h),
|
||||
child: Text(
|
||||
TranslationLoader.lanKeys!.buyRealNameTip!.tr,
|
||||
style: TextStyle(
|
||||
color: AppColors.darkGrayTextColor, fontSize: 20.sp),
|
||||
)),
|
||||
middleWidget(),
|
||||
bottomWidget()
|
||||
],
|
||||
),
|
||||
);
|
||||
return GetBuilder<ValueAddedServicesRealNameLogic>(
|
||||
init: ValueAddedServicesRealNameLogic(),
|
||||
builder: (ValueAddedServicesRealNameLogic logic) {
|
||||
return Scaffold(
|
||||
backgroundColor: AppColors.mainBackgroundColor,
|
||||
appBar: TitleAppBar(
|
||||
barTitle: TranslationLoader.lanKeys!.realNameAuthentication!.tr,
|
||||
haveBack: true,
|
||||
backgroundColor: AppColors.mainColor),
|
||||
body: Column(
|
||||
children: [
|
||||
Container(
|
||||
width: 1.sw,
|
||||
// color: Colors.grey.shade300,
|
||||
padding: EdgeInsets.only(
|
||||
left: 25.h, right: 25.h, top: 25.h, bottom: 10.h),
|
||||
child: Text(
|
||||
TranslationLoader.lanKeys!.buyRealNameTip!.tr,
|
||||
style: TextStyle(
|
||||
color: AppColors.darkGrayTextColor, fontSize: 20.sp),
|
||||
)),
|
||||
middleWidget(),
|
||||
bottomWidget()
|
||||
],
|
||||
),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
Widget middleWidget() {
|
||||
@ -112,98 +117,65 @@ class _ValueAddedServicesRealNamePageState
|
||||
}
|
||||
|
||||
Widget bottomWidget() {
|
||||
return Container(
|
||||
width: 1.sw,
|
||||
color: Colors.white,
|
||||
margin: EdgeInsets.all(20.h),
|
||||
child: Column(
|
||||
children: [
|
||||
Column(
|
||||
return GetBuilder<ValueAddedServicesRealNameLogic>(
|
||||
builder: (ValueAddedServicesRealNameLogic logic) {
|
||||
return Container(
|
||||
width: 1.sw,
|
||||
color: Colors.white,
|
||||
margin: EdgeInsets.all(20.h),
|
||||
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: [
|
||||
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),
|
||||
)),
|
||||
Image.asset(
|
||||
check
|
||||
? 'images/icon_round_select.png'
|
||||
: 'images/icon_round_unSelect.png',
|
||||
width: 30.w,
|
||||
height: 30.w,
|
||||
),
|
||||
],
|
||||
),
|
||||
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 passwordKeyAddURL = '/keyboardPwd/add'; //自定义密码
|
||||
final String passwordKeyCheckKeyboardpwdNameURL = '/keyboardPwd/checkKeyboardpwdName'; //自定义密码校验密码跟名字是否重复
|
||||
final String passwordKeyCheckKeyboardpwdNameURL =
|
||||
'/keyboardPwd/checkKeyboardpwdName'; //自定义密码校验密码跟名字是否重复
|
||||
final String updatePasswordKeyURL = '/keyboardPwd/update'; //修改密码详情
|
||||
final String clearOperationRecordURL = '/lockRecords/clear'; //清空操作记录
|
||||
final String addlockGroupURL = '/keyGroup/add'; //创建锁分组
|
||||
@ -175,7 +176,8 @@ abstract class Api {
|
||||
'/safeAnswer/getOwnQuestionList'; //获取已设置的安全信息
|
||||
final String updateSafeAnswerURL = '/safeAnswer/update'; //修改安全信息
|
||||
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 unbindEmailTokenURL = '/user/unbindEmailToken'; //获取解绑邮箱Token
|
||||
final String pushBindAppIdURL = '/user/bindAppId'; //推送绑定APP设备
|
||||
@ -193,4 +195,7 @@ abstract class Api {
|
||||
|
||||
final String getLockNoticeSettingURL =
|
||||
'/lockSetting/getLockNoticeSetting'; //获取锁消息设置
|
||||
|
||||
final String setFaceAuthenticationURL =
|
||||
'/v2/service/setFaceAuthentication'; //设置实名认证频次
|
||||
}
|
||||
|
||||
@ -1779,6 +1779,13 @@ class ApiProvider extends BaseProvider {
|
||||
jsonEncode({
|
||||
'lockId': lockId,
|
||||
}));
|
||||
|
||||
// 设置实名认证频次
|
||||
Future<Response> setFaceAuthentication(int faceAuthFrequence) => post(
|
||||
setFaceAuthenticationURL.toUrl,
|
||||
jsonEncode({
|
||||
'face_auth_frequence': faceAuthFrequence,
|
||||
}));
|
||||
}
|
||||
|
||||
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/lockUserManageList/keyListByUserEntity.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/SafetyVerificationEntity.dart';
|
||||
import '../login/login/entity/LoginEntity.dart';
|
||||
@ -1813,4 +1814,12 @@ class ApiRepository {
|
||||
final res = await apiProvider.getLockNoticeSetting(lockId);
|
||||
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