1,实名认证使用记录接口对接及布局修改
2,电子钥匙修改认证信息部分流程优化
This commit is contained in:
parent
4837cd58dd
commit
43155d2c67
@ -349,7 +349,7 @@
|
||||
"customMailTemplate":"自定义邮件模版",
|
||||
"record":"记录",
|
||||
|
||||
"buyRealNameTip":"给用户发送电子钥匙时,可以要求其开锁前先进行实名认证,以保证是他本人在操作。实名认证调用国家公安系统接口,为付费功能,请购买次数后再使用。",
|
||||
"buyRealNameTip":"给用户发送电子钥匙时,可以要求其开锁前先进行人脸识别,以保证是他本人在操作。人脸实名认证调用国家公安系统接口,为付费功能,请购买次数后再使用。",
|
||||
"buyRealNameSelectYouWantBuyTip":"请选择你希望的实名认证频数",
|
||||
"forTheFirstTime":"仅首次",
|
||||
"onceDay":"每日一次",
|
||||
|
||||
@ -168,7 +168,6 @@ class ElectronicKeyDetailLogic extends BaseGetXController {
|
||||
showToast("修改成功".tr, something: () {
|
||||
eventBus.fire(ElectronicKeyListRefreshUI());
|
||||
eventBus.fire(AuthorizedAdminPageRefreshUI());
|
||||
Get.back();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,9 +2,7 @@ import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get/get_rx/src/rx_typedefs/rx_typedefs.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetail/electronicKeyDetail_logic.dart';
|
||||
import 'package:star_lock/tools/showCupertinoAlertView.dart';
|
||||
|
||||
import '../../../../../appRouters.dart';
|
||||
import '../../../../../app_settings/app_colors.dart';
|
||||
@ -326,6 +324,7 @@ class _ElectronicKeyDetailPageState extends State<ElectronicKeyDetailPage> {
|
||||
if (alertEnum == ShowAlertEnum.name) {
|
||||
logic.modifyKeyNameRequest();
|
||||
} else {
|
||||
Get.back();
|
||||
logic.updateRealNameInfoRequest(alertEnum);
|
||||
}
|
||||
},
|
||||
|
||||
@ -35,7 +35,9 @@ class ElectronicKeyDetailState {
|
||||
keyName.value = itemData.value.keyName!;
|
||||
if (itemData.value.userIdCard != null) {
|
||||
getRealName.value = itemData.value.userIdCard!.realName ?? "";
|
||||
changeRealNameController.text = getRealName.value;
|
||||
getIDCardNumber.value = itemData.value.userIdCard!.idCardNumber ?? "";
|
||||
changeIDCardController.text = getIDCardNumber.value;
|
||||
}
|
||||
|
||||
isRemoteUnlock.value = itemData.value.remoteEnable! == 1 ? true : false;
|
||||
|
||||
@ -1,25 +1,116 @@
|
||||
class UseRecordListEntity {
|
||||
UseRecordListEntity({
|
||||
this.description,
|
||||
this.errorCode,
|
||||
this.errorMsg,
|
||||
});
|
||||
|
||||
UseRecordListEntity.fromJson(dynamic json) {
|
||||
description = json['description'];
|
||||
errorCode = json['errorCode'];
|
||||
errorMsg = json['errorMsg'];
|
||||
}
|
||||
|
||||
String? description;
|
||||
int? errorCode;
|
||||
String? description;
|
||||
String? errorMsg;
|
||||
Data? data;
|
||||
|
||||
UseRecordListEntity(
|
||||
{this.errorCode, this.description, this.errorMsg, this.data});
|
||||
|
||||
UseRecordListEntity.fromJson(Map<String, dynamic> json) {
|
||||
errorCode = json['errorCode'];
|
||||
description = json['description'];
|
||||
errorMsg = json['errorMsg'];
|
||||
data = json['data'] != null ? Data.fromJson(json['data']) : null;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final map = <String, dynamic>{};
|
||||
map['description'] = description;
|
||||
map['errorCode'] = errorCode;
|
||||
map['errorMsg'] = errorMsg;
|
||||
return map;
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['errorCode'] = errorCode;
|
||||
data['description'] = description;
|
||||
data['errorMsg'] = errorMsg;
|
||||
if (this.data != null) {
|
||||
data['data'] = this.data!.toJson();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Data {
|
||||
int? pageNo;
|
||||
int? pageSize;
|
||||
int? total;
|
||||
List<UseItemData>? useRecordList;
|
||||
|
||||
Data({this.pageNo, this.pageSize, this.total, this.useRecordList});
|
||||
|
||||
Data.fromJson(Map<String, dynamic> json) {
|
||||
pageNo = json['pageNo'];
|
||||
pageSize = json['pageSize'];
|
||||
total = json['total'];
|
||||
if (json['list'] != null) {
|
||||
useRecordList = <UseItemData>[];
|
||||
json['list'].forEach((v) {
|
||||
useRecordList!.add(UseItemData.fromJson(v));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['pageNo'] = pageNo;
|
||||
data['pageSize'] = pageSize;
|
||||
data['total'] = total;
|
||||
if (useRecordList != null) {
|
||||
data['list'] = useRecordList!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class UseItemData {
|
||||
int? id;
|
||||
int? userId;
|
||||
String? type;
|
||||
String? receiverAccount;
|
||||
String? realName;
|
||||
int? authStatus;
|
||||
int? lockId;
|
||||
String? lockName;
|
||||
int? consCount;
|
||||
String? createdAt;
|
||||
String? updatedAt;
|
||||
|
||||
UseItemData(
|
||||
{this.id,
|
||||
this.userId,
|
||||
this.type,
|
||||
this.receiverAccount,
|
||||
this.realName,
|
||||
this.authStatus,
|
||||
this.lockId,
|
||||
this.lockName,
|
||||
this.consCount,
|
||||
this.createdAt,
|
||||
this.updatedAt});
|
||||
|
||||
UseItemData.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
userId = json['user_id'];
|
||||
type = json['type'];
|
||||
receiverAccount = json['receiver_account'];
|
||||
realName = json['real_name'];
|
||||
authStatus = json['status'];
|
||||
lockId = json['lock_id'];
|
||||
lockName = json['lock_name'];
|
||||
consCount = json['cons_count'];
|
||||
createdAt = json['created_at'];
|
||||
updatedAt = json['updated_at'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['user_id'] = userId;
|
||||
data['type'] = type;
|
||||
data['receiver_account'] = receiverAccount;
|
||||
data['real_name'] = realName;
|
||||
data['status'] = authStatus;
|
||||
data['lock_id'] = lockId;
|
||||
data['lock_name'] = lockName;
|
||||
data['cons_count'] = consCount;
|
||||
data['created_at'] = createdAt;
|
||||
data['updated_at'] = updatedAt;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,6 +2,7 @@ import 'dart:async';
|
||||
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/advancedFunctionRecord/advancedFunctionRecord_entity.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesRecord/use_record_list_entity.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesRecord/value_added_services_record_state.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
import '../../../network/api_repository.dart';
|
||||
@ -11,6 +12,7 @@ class ValueAddedServicesRecordLogic extends BaseGetXController {
|
||||
|
||||
final ValueAddedServicesRecordState state = ValueAddedServicesRecordState();
|
||||
int buyPageNo = 1;
|
||||
int usePageNo = 1;
|
||||
late String type;
|
||||
|
||||
@override
|
||||
@ -41,10 +43,26 @@ class ValueAddedServicesRecordLogic extends BaseGetXController {
|
||||
}
|
||||
}
|
||||
|
||||
//请求使用记录列表
|
||||
Future<void> loadUseRecordList(bool load) async {
|
||||
if (!load) {
|
||||
usePageNo = 1;
|
||||
}
|
||||
UseRecordListEntity entity = await ApiRepository.to.getUseRecordList(
|
||||
type: type,
|
||||
pageNo: buyPageNo,
|
||||
);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
state.useRecordList.value = entity.data!.useRecordList!;
|
||||
state.useRecordList.refresh();
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
super.onReady();
|
||||
|
||||
loadBuyRecordList(true);
|
||||
loadUseRecordList(true);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/advancedFunctionRecord/advancedFunctionRecord_entity.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesRecord/use_record_list_entity.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesRecord/value_added_services_record_logic.dart';
|
||||
import 'package:star_lock/tools/noData.dart';
|
||||
import '../../../app_settings/app_colors.dart';
|
||||
@ -45,10 +46,10 @@ class _ValueAddedServicesRealNamePageState
|
||||
Obx(() => Expanded(
|
||||
child: TabBarView(children: [
|
||||
_PurchaseRecords(
|
||||
getRecordList: logic.state.buyRecordList.value,
|
||||
buyRecordList: logic.state.buyRecordList.value,
|
||||
),
|
||||
_PurchaseRecords(
|
||||
getRecordList: logic.state.useRecordList.value,
|
||||
_UseRecordsTable(
|
||||
useRecordList: logic.state.useRecordList.value,
|
||||
),
|
||||
]),
|
||||
)),
|
||||
@ -70,11 +71,11 @@ Widget tabTextItem(String tabText) {
|
||||
);
|
||||
}
|
||||
|
||||
//购买记录、使用记录
|
||||
//购买记录
|
||||
class _PurchaseRecords extends StatefulWidget {
|
||||
final List getRecordList;
|
||||
final List buyRecordList;
|
||||
|
||||
const _PurchaseRecords({required this.getRecordList});
|
||||
const _PurchaseRecords({required this.buyRecordList});
|
||||
|
||||
@override
|
||||
State<_PurchaseRecords> createState() => _PurchaseRecordsState();
|
||||
@ -88,11 +89,11 @@ class _PurchaseRecordsState extends State<_PurchaseRecords> {
|
||||
return EasyRefresh(
|
||||
onRefresh: () async {},
|
||||
onLoad: () async {},
|
||||
child: widget.getRecordList.isNotEmpty
|
||||
child: widget.buyRecordList.isNotEmpty
|
||||
? ListView.builder(
|
||||
itemCount: widget.getRecordList.length,
|
||||
itemCount: widget.buyRecordList.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return _recordKeyItem(widget.getRecordList[index]);
|
||||
return _recordKeyItem(widget.buyRecordList[index]);
|
||||
})
|
||||
: NoData(),
|
||||
);
|
||||
@ -143,3 +144,82 @@ class _PurchaseRecordsState extends State<_PurchaseRecords> {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
//使用记录
|
||||
class _UseRecordsTable extends StatefulWidget {
|
||||
final List useRecordList;
|
||||
|
||||
const _UseRecordsTable({required this.useRecordList});
|
||||
|
||||
@override
|
||||
State<_UseRecordsTable> createState() => _UseRecordsTableState();
|
||||
}
|
||||
|
||||
class _UseRecordsTableState extends State<_UseRecordsTable> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return EasyRefresh(
|
||||
onRefresh: () async {},
|
||||
onLoad: () async {},
|
||||
child: widget.useRecordList.isNotEmpty
|
||||
? ListView.builder(
|
||||
itemCount: widget.useRecordList.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return _recordKeyItem(widget.useRecordList[index]);
|
||||
})
|
||||
: NoData(),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _recordKeyItem(UseItemData itemData) {
|
||||
return Container(
|
||||
color: Colors.white,
|
||||
margin: EdgeInsets.only(left: 20.w, right: 20.w, top: 10.h),
|
||||
padding:
|
||||
EdgeInsets.only(left: 20.w, right: 20.w, top: 16.h, bottom: 16.h),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
'${itemData.lockName ?? ""} ${itemData.realName ?? ""}',
|
||||
style: TextStyle(
|
||||
fontSize: 24.sp,
|
||||
color: AppColors.blackColor,
|
||||
fontWeight: FontWeight.bold),
|
||||
),
|
||||
Expanded(child: Container()),
|
||||
itemData.authStatus == 0
|
||||
? Container(
|
||||
padding: EdgeInsets.only(
|
||||
right: 6.w, left: 6.w, top: 2.h, bottom: 2.h),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(5.w),
|
||||
color: AppColors.toBeReceiveBgColor,
|
||||
),
|
||||
child: Text('失败',
|
||||
style: TextStyle(fontSize: 16.sp, color: Colors.red)),
|
||||
)
|
||||
: Container()
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 8.h,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
itemData.createdAt!.length > 10
|
||||
? itemData.createdAt!.substring(0, 10)
|
||||
: itemData.createdAt!,
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
fontSize: 22.sp, color: AppColors.darkGrayTextColor))
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1387,8 +1387,19 @@ class ApiRepository {
|
||||
required int startTime,
|
||||
required int endTime,
|
||||
required int faceRight}) async {
|
||||
final res = await apiProvider.addFaceData(lockId, faceName, faceNumber,
|
||||
faceType, startDate, endDate, featureData, addType, weekDay, startTime, endTime, faceRight);
|
||||
final res = await apiProvider.addFaceData(
|
||||
lockId,
|
||||
faceName,
|
||||
faceNumber,
|
||||
faceType,
|
||||
startDate,
|
||||
endDate,
|
||||
featureData,
|
||||
addType,
|
||||
weekDay,
|
||||
startTime,
|
||||
endTime,
|
||||
faceRight);
|
||||
return AddFaceEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
@ -1652,10 +1663,8 @@ class ApiRepository {
|
||||
}
|
||||
|
||||
//重置密码钥匙
|
||||
Future<PasswordKeyListEntity> keyboardPwdReset({
|
||||
required String lockId,
|
||||
required List passwordKey
|
||||
}) async {
|
||||
Future<PasswordKeyListEntity> keyboardPwdReset(
|
||||
{required String lockId, required List passwordKey}) async {
|
||||
final res = await apiProvider.keyboardPwdReset(lockId, passwordKey);
|
||||
return PasswordKeyListEntity.fromJson(res.body);
|
||||
}
|
||||
@ -2031,7 +2040,7 @@ class ApiRepository {
|
||||
return FaceAuthenticationEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
// 获取使用记录
|
||||
// 获取购买记录
|
||||
Future<AdvancedFunctionRecordEntity> getBuyRecordList({
|
||||
required String type,
|
||||
required int pageNo,
|
||||
@ -2043,7 +2052,7 @@ class ApiRepository {
|
||||
return AdvancedFunctionRecordEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
// 获取购买记录
|
||||
// 获取使用记录
|
||||
Future<UseRecordListEntity> getUseRecordList({
|
||||
required String type,
|
||||
required int pageNo,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user