1,修复开锁页-操作记录-点进去后圈几圈的加载图标后(也有提示操作失败后)空白显示,手动刷新后才出现数据
2,修复我的页-增值服务-邮件 购买后进入,短信当前剩余数量会先显示0再跳到500,有时只显示0不跳转到数量 问题 3,修复我的页-增值服务-短信 购买后进入,短信当前剩余数量会先显示0再跳到500,有时只显示0不跳转到数量 问题 4,操作记录实体类更新 新增keyboardPwd字段 5,增值服务--短信、邮件请求方法逻辑顺序更改
This commit is contained in:
parent
58fb182534
commit
89c7f57e2b
@ -1,9 +1,4 @@
|
||||
class DoorLockLogEntity {
|
||||
int? errorCode;
|
||||
String? description;
|
||||
String? errorMsg;
|
||||
Data? data;
|
||||
|
||||
DoorLockLogEntity(
|
||||
{this.errorCode, this.description, this.errorMsg, this.data});
|
||||
|
||||
@ -13,6 +8,10 @@ class DoorLockLogEntity {
|
||||
errorMsg = json['errorMsg'];
|
||||
data = json['data'] != null ? Data.fromJson(json['data']) : null;
|
||||
}
|
||||
int? errorCode;
|
||||
String? description;
|
||||
String? errorMsg;
|
||||
Data? data;
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
@ -27,12 +26,6 @@ class DoorLockLogEntity {
|
||||
}
|
||||
|
||||
class Data {
|
||||
List<DoorLockLogDataItem>? itemList;
|
||||
int? pageNo;
|
||||
int? pageSize;
|
||||
int? pages;
|
||||
int? total;
|
||||
|
||||
Data({this.itemList, this.pageNo, this.pageSize, this.pages, this.total});
|
||||
|
||||
Data.fromJson(Map<String, dynamic> json) {
|
||||
@ -47,6 +40,11 @@ class Data {
|
||||
pages = json['pages'];
|
||||
total = json['total'];
|
||||
}
|
||||
List<DoorLockLogDataItem>? itemList;
|
||||
int? pageNo;
|
||||
int? pageSize;
|
||||
int? pages;
|
||||
int? total;
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
@ -62,18 +60,6 @@ class Data {
|
||||
}
|
||||
|
||||
class DoorLockLogDataItem {
|
||||
int? recordId;
|
||||
int? lockId;
|
||||
String? lockAlias;
|
||||
int? recordType;
|
||||
String? recordTypeName;
|
||||
String? username;
|
||||
int? operateDate;
|
||||
String? imagesUrl;
|
||||
String? videoUrl;
|
||||
String? headUrl;
|
||||
String? userid;
|
||||
|
||||
DoorLockLogDataItem(
|
||||
{this.recordId,
|
||||
this.lockId,
|
||||
@ -85,7 +71,8 @@ class DoorLockLogDataItem {
|
||||
this.imagesUrl,
|
||||
this.videoUrl,
|
||||
this.headUrl,
|
||||
this.userid});
|
||||
this.userid,
|
||||
this.keyboardPwd});
|
||||
|
||||
DoorLockLogDataItem.fromJson(Map<String, dynamic> json) {
|
||||
recordId = json['recordId'];
|
||||
@ -99,7 +86,20 @@ class DoorLockLogDataItem {
|
||||
videoUrl = json['videoUrl'];
|
||||
headUrl = json['headUrl'];
|
||||
userid = json['userid'];
|
||||
keyboardPwd = json['keyboardPwd'];
|
||||
}
|
||||
int? recordId;
|
||||
int? lockId;
|
||||
String? lockAlias;
|
||||
int? recordType;
|
||||
String? recordTypeName;
|
||||
String? username;
|
||||
int? operateDate;
|
||||
String? imagesUrl;
|
||||
String? videoUrl;
|
||||
String? headUrl;
|
||||
String? userid;
|
||||
String? keyboardPwd;
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
@ -114,6 +114,7 @@ class DoorLockLogDataItem {
|
||||
data['videoUrl'] = videoUrl;
|
||||
data['headUrl'] = headUrl;
|
||||
data['userid'] = userid;
|
||||
data['keyboardPwd'] = keyboardPwd;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
@ -37,11 +37,11 @@ class DoorLockLogLogic extends BaseGetXController {
|
||||
// 根据时间查解析数据
|
||||
Future<void> _replyReferEventRecordTime(Reply reply) async {
|
||||
cancelBlueConnetctToastTimer();
|
||||
int status = reply.data[2];
|
||||
final int status = reply.data[2];
|
||||
switch (status) {
|
||||
case 0x00:
|
||||
//成功
|
||||
int dataLength = (reply.data[5] << 8) + reply.data[6];
|
||||
final int dataLength = (reply.data[5] << 8) + reply.data[6];
|
||||
// AppLog.log("dataLength:$dataLength");
|
||||
// var dataLength = reply.data[5];
|
||||
if (dataLength > 0) {
|
||||
@ -50,27 +50,27 @@ class DoorLockLogLogic extends BaseGetXController {
|
||||
if (reply.data.length < 17) {
|
||||
return;
|
||||
}
|
||||
var getList = splitList(reply.data, 17);
|
||||
final getList = splitList(reply.data, 17);
|
||||
// AppLog.log("getList:$getList");
|
||||
var uploadList = [];
|
||||
final uploadList = [];
|
||||
for (int i = 0; i < getList.length; i++) {
|
||||
var indexList = getList[i];
|
||||
final indexList = getList[i];
|
||||
// AppLog.log("indexList:$indexList");
|
||||
var indexMap = {};
|
||||
final indexMap = {};
|
||||
indexMap['type'] = indexList[0].toString();
|
||||
int operateDate = 0;
|
||||
final int operateDate = 0;
|
||||
if (indexList[0] == 2) {
|
||||
var passwordData = indexList.sublist(7, 17);
|
||||
var password = utf8String(passwordData);
|
||||
final passwordData = indexList.sublist(7, 17);
|
||||
final password = utf8String(passwordData);
|
||||
indexMap['user'] = password.toString();
|
||||
} else {
|
||||
int userNo = (indexList[1] * 256) + indexList[2];
|
||||
final int userNo = (indexList[1] * 256) + indexList[2];
|
||||
indexMap['user'] = userNo.toString();
|
||||
}
|
||||
|
||||
indexMap['success'] = '1';
|
||||
|
||||
int time = ((0xff & indexList[(3)]) << 24 |
|
||||
final int time = ((0xff & indexList[(3)]) << 24 |
|
||||
(0xff & indexList[4]) << 16 |
|
||||
(0xff & indexList[5]) << 8 |
|
||||
(0xFF & indexList[6]));
|
||||
@ -108,14 +108,16 @@ class DoorLockLogLogic extends BaseGetXController {
|
||||
BlueManage().blueSendData(BlueManage().connectDeviceName,
|
||||
(BluetoothConnectionState connectionStateState) async {
|
||||
if (connectionStateState == BluetoothConnectionState.connected) {
|
||||
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
final privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
final List<int> getPrivateKeyList =
|
||||
changeStringListToIntList(privateKey!);
|
||||
|
||||
var token = await Storage.getStringList(saveBlueToken);
|
||||
List<int> getTokenList = changeStringListToIntList(token!);
|
||||
final token = await Storage.getStringList(saveBlueToken);
|
||||
final List<int> getTokenList = changeStringListToIntList(token!);
|
||||
|
||||
var publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||
List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
|
||||
final publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||
final List<int> getPublicKeyList =
|
||||
changeStringListToIntList(publicKey!);
|
||||
|
||||
IoSenderManage.senderReferEventRecordTimeCommand(
|
||||
keyID: BlueManage().connectDeviceName,
|
||||
@ -156,6 +158,7 @@ class DoorLockLogLogic extends BaseGetXController {
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
// 更新数据列表
|
||||
state.lockLogItemList.addAll(entity.data!.itemList!);
|
||||
state.lockLogItemList.refresh();
|
||||
// 更新页码
|
||||
pageNo++;
|
||||
}
|
||||
@ -231,7 +234,7 @@ class DoorLockLogLogic extends BaseGetXController {
|
||||
super.onReady();
|
||||
|
||||
// 获取是否是演示模式 演示模式不获取接口
|
||||
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||
final isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||
if (isDemoMode == false) {
|
||||
// _initReplySubscription();
|
||||
|
||||
@ -245,22 +248,20 @@ class DoorLockLogLogic extends BaseGetXController {
|
||||
super.onInit();
|
||||
|
||||
// 获取是否是演示模式 演示模式不获取接口
|
||||
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||
final bool? isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||
if (isDemoMode == false) {
|
||||
getLockRecordLastUploadDataTime();
|
||||
// senderReferEventRecordTime();
|
||||
// senderReferEventRecordNumber();
|
||||
_initReplySubscription();
|
||||
mockNetworkDataRequest(isRefresh: true);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> onClose() async {
|
||||
// TODO: implement onClose
|
||||
super.onClose();
|
||||
|
||||
//获取是否是演示模式 演示模式不获取接口
|
||||
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||
final bool? isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||
if (isDemoMode == false) {
|
||||
_replySubscription.cancel();
|
||||
_getDoorLockLogListRefreshUIEvent?.cancel();
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
import 'dart:async';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/advancedFeaturesWeb/advancedFeaturesWeb_entity.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesHighFunction/valueAddedServicesHighFunction_entity.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesNoteAndEmailDetail/valueAddedServicesNoteAndEmailDetail_state.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
import '../../../network/api_repository.dart';
|
||||
@ -10,7 +12,8 @@ class ValueAddedServicesNoteAndEmailDetailLogic extends BaseGetXController {
|
||||
|
||||
//获取增值服务用户余量包
|
||||
Future<void> getServiceUserPackage() async {
|
||||
var entity = await ApiRepository.to.getServiceUserPackage();
|
||||
final ValueAddedServicesHighFunctionEntity entity =
|
||||
await ApiRepository.to.getServiceUserPackage();
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
if (state.selectType.value == 1) {
|
||||
state.remainCount.value = entity.data!.smsCount!;
|
||||
@ -19,6 +22,7 @@ class ValueAddedServicesNoteAndEmailDetailLogic extends BaseGetXController {
|
||||
}
|
||||
state.remainCount.refresh();
|
||||
}
|
||||
getServicePackageBuyUrl();
|
||||
}
|
||||
|
||||
//增值服务套餐购包链接
|
||||
@ -36,9 +40,19 @@ class ValueAddedServicesNoteAndEmailDetailLogic extends BaseGetXController {
|
||||
}
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
void onReady() {
|
||||
super.onReady();
|
||||
|
||||
getServiceUserPackage();
|
||||
// 监听 selectType 的变化
|
||||
ever(state.selectType, (_) {
|
||||
getServiceUserPackage();
|
||||
});
|
||||
|
||||
if (Get.arguments != null && Get.arguments['type'] != null) {
|
||||
state.selectType.value = Get.arguments['type'];
|
||||
state.selectType.refresh();
|
||||
} else {
|
||||
getServiceUserPackage();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -8,7 +8,6 @@ import 'package:star_lock/mine/valueAddedServices/valueAddedServicesRecord/use_r
|
||||
|
||||
import '../../../appRouters.dart';
|
||||
import '../../../app_settings/app_colors.dart';
|
||||
import '../../../tools/commonItem.dart';
|
||||
import '../../../tools/titleAppBar.dart';
|
||||
import '../../../translations/trans_lib.dart';
|
||||
|
||||
@ -30,7 +29,8 @@ class _ValueAddedServicesNoteAndEmailDetailPageState
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
logic.getServicePackageBuyUrl();
|
||||
// logic.getServicePackageBuyUrl();
|
||||
logic.getServiceUserPackage();
|
||||
}
|
||||
|
||||
@override
|
||||
@ -84,11 +84,12 @@ class _ValueAddedServicesNoteAndEmailDetailPageState
|
||||
))),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(Routers.advancedFeaturesWebPage, arguments: {
|
||||
'webBuyType': state.selectType.value == 1
|
||||
? XSConstantMacro.webBuyTypeSMS
|
||||
: XSConstantMacro.webBuyTypeEmail,
|
||||
});
|
||||
Get.toNamed(Routers.advancedFeaturesWebPage,
|
||||
arguments: <String, int>{
|
||||
'webBuyType': state.selectType.value == 1
|
||||
? XSConstantMacro.webBuyTypeSMS
|
||||
: XSConstantMacro.webBuyTypeEmail,
|
||||
});
|
||||
},
|
||||
child: Container(
|
||||
width: 50,
|
||||
|
||||
@ -5,6 +5,7 @@ class ValueAddedServicesNoteAndEmailDetailState {
|
||||
if (Get.arguments is Map && Get.arguments.isNotEmpty) {
|
||||
if (Get.arguments['type'] != null) {
|
||||
selectType.value = Get.arguments['type'];
|
||||
selectType.refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user