统一修改发送验证码问题
This commit is contained in:
parent
0496bd9357
commit
84f7c6f1bb
@ -561,8 +561,10 @@ class BlueManage {
|
||||
try {
|
||||
// if(bluetoothConnectDevice != null && bluetoothConnectDevice!.connectionState == BluetoothConnectionState.connected){
|
||||
connectDeviceMacAddress = "";
|
||||
await bluetoothConnectDevice!.disconnect();
|
||||
Get.log("断开连接成功");
|
||||
if(bluetoothConnectionState == BluetoothConnectionState.connected){
|
||||
await bluetoothConnectDevice!.disconnect();
|
||||
Get.log("断开连接成功");
|
||||
}
|
||||
// }
|
||||
} on Exception catch (e, _) {
|
||||
Get.log("Error disconnecting from a device: $e");
|
||||
|
||||
@ -45,7 +45,7 @@ class StarLockForgetPasswordLogic extends BaseGetXController {
|
||||
}
|
||||
|
||||
void sendValidationCode() async {
|
||||
var entity = await ApiRepository.to.sendValidationCode(
|
||||
var entity = await ApiRepository.to.sendValidationCodeUnLogin(
|
||||
// state.countryCode.value,
|
||||
countryCode:state.countryCode.value,
|
||||
account:state.phoneStr.value,
|
||||
|
||||
@ -47,7 +47,7 @@ class StarLockRegisterLogic extends BaseGetXController {
|
||||
}
|
||||
|
||||
void sendValidationCode() async {
|
||||
var entity = await ApiRepository.to.sendValidationCode(
|
||||
var entity = await ApiRepository.to.sendValidationCodeUnLogin(
|
||||
// state.countryCode.value,
|
||||
countryCode: state.countryCode.value.toString(),
|
||||
account: state.phoneOrEmailStr.value,
|
||||
|
||||
@ -158,7 +158,7 @@ class _StarLockRegisterPageState extends State<StarLockRegisterPage> {
|
||||
children: [
|
||||
SizedBox(width: 5.w),
|
||||
Expanded(
|
||||
child: Text(TranslationLoader.lanKeys!.countryAndRegion!.tr,
|
||||
child: Text("你所在的${TranslationLoader.lanKeys!.countryAndRegion!.tr}",
|
||||
style: TextStyle(
|
||||
fontSize: 26.sp, color: AppColors.blackColor))),
|
||||
SizedBox(width: 20.w),
|
||||
|
||||
@ -110,14 +110,12 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
BlueManage().connectDeviceName =
|
||||
state.keyInfos.value.bluetooth!.bluetoothDeviceName!;
|
||||
|
||||
List<int> publicKeyData =
|
||||
state.keyInfos.value.bluetooth!.publicKey!.cast<int>();
|
||||
List<int> publicKeyData = state.keyInfos.value.bluetooth!.publicKey!.cast<int>();
|
||||
var saveStrList = changeIntListToStringList(publicKeyData);
|
||||
Storage.setStringList(saveBluePublicKey, saveStrList);
|
||||
|
||||
// 私钥
|
||||
List<int> privateKeyData =
|
||||
state.keyInfos.value.bluetooth!.privateKey!.cast<int>();
|
||||
List<int> privateKeyData = state.keyInfos.value.bluetooth!.privateKey!.cast<int>();
|
||||
var savePrivateKeyList = changeIntListToStringList(privateKeyData);
|
||||
Storage.setStringList(saveBluePrivateKey, savePrivateKeyList);
|
||||
|
||||
|
||||
@ -770,13 +770,13 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
|
||||
print("lockSet===didPop");
|
||||
logic.cancelBlueConnetctToastTimer();
|
||||
if (EasyLoading.isShow) EasyLoading.dismiss(animation: true);
|
||||
if (state.deletWaitScanTimer != null) {
|
||||
state.deletWaitScanTimer!.cancel();
|
||||
}
|
||||
if (state.deletWaitScanCompleter != null &&
|
||||
!state.deletWaitScanCompleter!.isCompleted) {
|
||||
state.deletWaitScanCompleter!.complete();
|
||||
}
|
||||
// if (state.deletWaitScanTimer != null) {
|
||||
// state.deletWaitScanTimer!.cancel();
|
||||
// }
|
||||
// if (state.deletWaitScanCompleter != null &&
|
||||
// !state.deletWaitScanCompleter!.isCompleted) {
|
||||
// state.deletWaitScanCompleter!.complete();
|
||||
// }
|
||||
// BlueManage().stopScan();
|
||||
state.ifCurrentScreen.value = false;
|
||||
}
|
||||
@ -797,13 +797,13 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
|
||||
logic.cancelBlueConnetctToastTimer();
|
||||
|
||||
if (EasyLoading.isShow) EasyLoading.dismiss(animation: true);
|
||||
if (state.deletWaitScanTimer != null) {
|
||||
state.deletWaitScanTimer!.cancel();
|
||||
}
|
||||
if (state.deletWaitScanCompleter != null &&
|
||||
!state.deletWaitScanCompleter!.isCompleted) {
|
||||
state.deletWaitScanCompleter!.complete();
|
||||
}
|
||||
// if (state.deletWaitScanTimer != null) {
|
||||
// state.deletWaitScanTimer!.cancel();
|
||||
// }
|
||||
// if (state.deletWaitScanCompleter != null &&
|
||||
// !state.deletWaitScanCompleter!.isCompleted) {
|
||||
// state.deletWaitScanCompleter!.complete();
|
||||
// }
|
||||
// BlueManage().stopScan();
|
||||
state.ifCurrentScreen.value = false;
|
||||
}
|
||||
|
||||
@ -31,8 +31,8 @@ class LockSetState {
|
||||
var ifCurrentScreen = true.obs; // 是否是当前界面,用于判断是否需要针对当前界面进行展示
|
||||
var deleteAdministratorIsHaveAllData = false.obs; // 删除管理员是否有所有数据
|
||||
|
||||
Completer? deletWaitScanCompleter;
|
||||
Timer? deletWaitScanTimer;
|
||||
// Completer? deletWaitScanCompleter;
|
||||
// Timer? deletWaitScanTimer;
|
||||
|
||||
LockSetState() {
|
||||
Map map = Get.arguments;
|
||||
|
||||
@ -1,13 +1,105 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/scheduler.dart';
|
||||
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/blue/io_type.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
|
||||
import '../../../blue/blue_manage.dart';
|
||||
import '../../../blue/io_protocol/io_factoryDataReset.dart';
|
||||
import '../../../blue/io_reply.dart';
|
||||
import '../../../blue/io_tool/io_tool.dart';
|
||||
import '../../../blue/io_tool/manager_event_bus.dart';
|
||||
import '../../../blue/sender_manage.dart';
|
||||
import '../../../common/XSConstantMacro/XSConstantMacro.dart';
|
||||
import '../../../network/api_repository.dart';
|
||||
import '../../../tools/dateTool.dart';
|
||||
import '../../../tools/eventBusEventManage.dart';
|
||||
import '../../../tools/showTFView.dart';
|
||||
import '../../../tools/storage.dart';
|
||||
import '../../../translations/trans_lib.dart';
|
||||
import '../entity/lockListInfo_entity.dart';
|
||||
import 'lockList_state.dart';
|
||||
|
||||
class LockListLogic extends BaseGetXController{
|
||||
LockListState state = LockListState();
|
||||
|
||||
// 监听蓝牙协议返回结果
|
||||
late StreamSubscription<Reply> _replySubscription;
|
||||
void _initReplySubscription() {
|
||||
_replySubscription =
|
||||
EventBusManager().eventBus!.on<Reply>().listen((reply) async {
|
||||
// 恢复出厂设置
|
||||
if (reply is FactoryDataResetReply) {
|
||||
_replyFactoryDataResetKey(reply);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
Future<void> _replyFactoryDataResetKey(Reply reply) async {
|
||||
var token = reply.data.sublist(2, 6);
|
||||
var saveStrList = changeIntListToStringList(token);
|
||||
print("_replyFactoryDataResetKeyToken:$token");
|
||||
Storage.setStringList(saveBlueToken, saveStrList);
|
||||
|
||||
int status = reply.data[6];
|
||||
print("status:$status");
|
||||
|
||||
switch (status) {
|
||||
case 0x00:
|
||||
//成功
|
||||
print("${reply.commandType!.typeValue} 数据解析成功");
|
||||
dismissEasyLoading();
|
||||
cancelBlueConnetctToastTimer();
|
||||
deletLockInfoData();
|
||||
break;
|
||||
case 0x06:
|
||||
//无权限
|
||||
print("${reply.commandType!.typeValue} 需要鉴权");
|
||||
// var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
// List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
//
|
||||
// var publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||
// List<int> publicKeyDataList = changeStringListToIntList(publicKey!);
|
||||
|
||||
var token = await Storage.getStringList(saveBlueToken);
|
||||
List<int> getTokenList = changeStringListToIntList(token!);
|
||||
|
||||
IoSenderManage.senderFactoryDataReset(
|
||||
lockID: BlueManage().connectDeviceName,
|
||||
userID: await Storage.getUid(),
|
||||
keyID: "1",
|
||||
needAuthor: 1,
|
||||
publicKey: state.lockListInfoItemEntity.bluetooth!.publicKey!.cast<int>(),
|
||||
privateKey: state.lockListInfoItemEntity.bluetooth!.privateKey!.cast<int>(),
|
||||
token: getTokenList);
|
||||
break;
|
||||
case 0x07:
|
||||
//无权限
|
||||
print("${reply.commandType!.typeValue} 用户无权限");
|
||||
dismissEasyLoading();
|
||||
showToast("用户无权限");
|
||||
break;
|
||||
case 0x09:
|
||||
// 权限校验错误
|
||||
print("${reply.commandType!.typeValue} ");
|
||||
dismissEasyLoading();
|
||||
showToast("权限校验错误");
|
||||
break;
|
||||
default:
|
||||
//失败
|
||||
print("${reply.commandType!.typeValue} 失败");
|
||||
dismissEasyLoading();
|
||||
showToast("权限校验错误");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
String showElectricIcon (int electricnumber){
|
||||
if(electricnumber >= 100){
|
||||
return 'images/main/icon_lockElectricLevel_5.png';
|
||||
@ -35,4 +127,270 @@ class LockListLogic extends BaseGetXController{
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
/// 以下为删除逻辑
|
||||
deleyLockLogicOfRoles(){
|
||||
if (state.lockListInfoItemEntity.isLockOwner == 1) {
|
||||
// 超级管理员必须通过连接蓝牙删除
|
||||
showDeletAlertDialog();
|
||||
} else if (state.lockListInfoItemEntity.keyRight == 1){
|
||||
// 授权管理员弹框提示
|
||||
showDeleteAdministratorIsHaveAllDataDialog();
|
||||
} else{
|
||||
// 普通用户直接删除
|
||||
deletKeyData();
|
||||
}
|
||||
}
|
||||
|
||||
//超级管理员 删除弹窗
|
||||
void showDeletAlertDialog() {
|
||||
showCupertinoDialog(
|
||||
context: Get.context!,
|
||||
builder: (context) {
|
||||
return CupertinoAlertDialog(
|
||||
title: const Text("提示"),
|
||||
content: const Text('删除锁后,所有信息都会一起删除,确定删除锁吗?'),
|
||||
actions: [
|
||||
CupertinoDialogAction(
|
||||
child: Text(TranslationLoader.lanKeys!.cancel!.tr),
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
},
|
||||
),
|
||||
CupertinoDialogAction(
|
||||
child: Text(TranslationLoader.lanKeys!.sure!.tr),
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
showDeletPasswordAlertDialog(context);
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
void showDeletPasswordAlertDialog(BuildContext context) {
|
||||
// 点击删除 开始扫描
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return ShowTFView(
|
||||
title: "请输入登录密码",
|
||||
tipTitle: "",
|
||||
controller: state.passwordTF,
|
||||
sureClick: () {
|
||||
//发送删除锁请求
|
||||
if (state.passwordTF.text.isEmpty) {
|
||||
showToast("请输入登录密码");
|
||||
return;
|
||||
}
|
||||
checkLoginPassword();
|
||||
},
|
||||
cancelClick: () {
|
||||
// 取消的时候停止扫描
|
||||
// BlueManage().stopScan();
|
||||
Get.back();
|
||||
},
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
// 授权管理员调用删除数据
|
||||
void showDeleteAdministratorIsHaveAllDataDialog() {
|
||||
showDialog(
|
||||
context: Get.context!,
|
||||
builder: (BuildContext context) {
|
||||
return CupertinoAlertDialog(
|
||||
title: const Text("提示"),
|
||||
content: Container(
|
||||
height: 100.h,
|
||||
child: Row(
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
state.deleteAdministratorIsHaveAllData.value = !state.deleteAdministratorIsHaveAllData.value;
|
||||
},
|
||||
child: Obx(() => Image.asset(
|
||||
state.deleteAdministratorIsHaveAllData.value
|
||||
? 'images/icon_round_select.png'
|
||||
: 'images/icon_round_unSelect.png',
|
||||
width: 30.w,
|
||||
height: 30.w,
|
||||
))),
|
||||
SizedBox(width: 15.w,),
|
||||
Expanded(child: Text('同时删除其发送的所有钥匙,钥匙删除后不能恢复', maxLines: 2, textAlign: TextAlign.start, style: TextStyle(fontSize: 24.sp))),
|
||||
],
|
||||
),
|
||||
),
|
||||
actions: [
|
||||
CupertinoDialogAction(
|
||||
child: Text(TranslationLoader.lanKeys!.cancel!.tr),
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
},
|
||||
),
|
||||
CupertinoDialogAction(
|
||||
child: Text(TranslationLoader.lanKeys!.delete!.tr),
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
deletKeyData();
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
// 查询账户密码
|
||||
void checkLoginPassword() async {
|
||||
var entity = await ApiRepository.to.checkLoginPassword(
|
||||
password: state.passwordTF.text,
|
||||
);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
Get.back();
|
||||
factoryDataResetAction();
|
||||
}
|
||||
}
|
||||
|
||||
// 当是锁拥有者的时候,删除锁
|
||||
void deletLockInfoData() async {
|
||||
var entity = await ApiRepository.to.deletOwnerLockData(
|
||||
lockId: state.lockListInfoItemEntity.lockId.toString(),
|
||||
);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
BlueManage().connectDeviceMacAddress = "";
|
||||
SchedulerBinding.instance.addPostFrameCallback((_) {
|
||||
eventBus.fire(RefreshLockListInfoDataEvent());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// 普通用户或者授权管理员删除钥匙
|
||||
void deletKeyData() async {
|
||||
var entity = await ApiRepository.to.deletOwnerKeyData(
|
||||
lockId: state.lockListInfoItemEntity.lockId.toString(),
|
||||
keyId: state.lockListInfoItemEntity.keyId.toString(),
|
||||
includeUnderlings: state.deleteAdministratorIsHaveAllData.value == true ? 1 : 0
|
||||
);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
BlueManage().connectDeviceMacAddress = "";
|
||||
SchedulerBinding.instance.addPostFrameCallback((_) {
|
||||
eventBus.fire(RefreshLockListInfoDataEvent());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// 恢复出厂设置
|
||||
Future<void> factoryDataResetAction() async {
|
||||
showEasyLoading();
|
||||
showBlueConnetctToastTimer(isShowBlueConnetctToast: false, action: (){
|
||||
dismissEasyLoading();
|
||||
showDeletAlertTipDialog();
|
||||
});
|
||||
BlueManage().bludSendData(state.lockListInfoItemEntity.lockName!, (BluetoothConnectionState connectionState) async {
|
||||
if (connectionState == BluetoothConnectionState.connected) {
|
||||
// var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
// List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
//
|
||||
// var publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||
// List<int> publicKeyDataList = changeStringListToIntList(publicKey!);
|
||||
//
|
||||
// var token = await Storage.getStringList(saveBlueToken);
|
||||
// List<int> getTokenList = changeStringListToIntList(token!);
|
||||
|
||||
List<int> publicKeyData = state.lockListInfoItemEntity.bluetooth!.publicKey!.cast<int>();
|
||||
var saveStrList = changeIntListToStringList(publicKeyData);
|
||||
Storage.setStringList(saveBluePublicKey, saveStrList);
|
||||
|
||||
// 私钥
|
||||
List<int> privateKeyData = state.lockListInfoItemEntity.bluetooth!.privateKey!.cast<int>();
|
||||
var savePrivateKeyList = changeIntListToStringList(privateKeyData);
|
||||
Storage.setStringList(saveBluePrivateKey, savePrivateKeyList);
|
||||
|
||||
// signKey
|
||||
List<int> signKeyData = state.lockListInfoItemEntity.bluetooth!.signKey!.cast<int>();
|
||||
var saveSignKeyList = changeIntListToStringList(signKeyData);
|
||||
Storage.setStringList(saveBlueSignKey, saveSignKeyList);
|
||||
|
||||
var saveTokenList = changeIntListToStringList([0, 0, 0, 0]);
|
||||
Storage.setStringList(saveBlueToken, saveTokenList);
|
||||
|
||||
IoSenderManage.senderFactoryDataReset(
|
||||
lockID: BlueManage().connectDeviceName,
|
||||
userID: await Storage.getUid(),
|
||||
keyID: "1",
|
||||
needAuthor: 1,
|
||||
publicKey: state.lockListInfoItemEntity.bluetooth!.publicKey!.cast<int>(),
|
||||
privateKey: state.lockListInfoItemEntity.bluetooth!.privateKey!.cast<int>(),
|
||||
token: [0,0,0,0]);
|
||||
} else if (connectionState == BluetoothConnectionState.disconnected) {
|
||||
dismissEasyLoading();
|
||||
cancelBlueConnetctToastTimer();
|
||||
if(state.ifCurrentScreen.value == true){
|
||||
showDeletAlertTipDialog();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void showDeletAlertTipDialog({String? showContent = ""}) {
|
||||
// bool isContains = BlueManage().connectDeviceName!.contains("T9A");
|
||||
var content = showContent!.isEmpty ? "删除设备失败,请确保在设备附近,设备未被连接,设备已打开${BlueManage().connectDeviceName!.contains("T9A") == true ? "。如果是全自动锁,请使屏幕变亮" : ""}" : showContent;
|
||||
showCupertinoDialog(
|
||||
context: Get.context!,
|
||||
builder: (context) {
|
||||
return CupertinoAlertDialog(
|
||||
title: const Text("提示"),
|
||||
content: Text(content),
|
||||
// content: const Text('删除门锁后如需重新添加需要在门锁设置的"蓝牙功能"选项下先"清除配对",确定吗?'),
|
||||
actions: [
|
||||
// CupertinoDialogAction(
|
||||
// child: Text(TranslationLoader.lanKeys!.cancel!.tr),
|
||||
// onPressed: () {
|
||||
// Navigator.pop(context);
|
||||
// },
|
||||
// ),
|
||||
CupertinoDialogAction(
|
||||
child: Text(TranslationLoader.lanKeys!.sure!.tr),
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
// if (state.lockSetInfoData.value.lockBasicInfo!.isLockOwner == 1) {
|
||||
// // 直接调用删除锁接口
|
||||
// deletLockInfoData();
|
||||
// } else {
|
||||
// // 直接调用删除要是接口
|
||||
// deletKeyData();
|
||||
// }
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
// TODO: implement onReady
|
||||
super.onReady();
|
||||
|
||||
_initReplySubscription();
|
||||
}
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
// TODO: implement onInit
|
||||
super.onInit();
|
||||
}
|
||||
|
||||
@override
|
||||
void onClose() {
|
||||
// TODO: implement onClose
|
||||
|
||||
_replySubscription.cancel();
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,11 +1,13 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:flutter_slidable/flutter_slidable.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../../appRouters.dart';
|
||||
import '../../../app_settings/app_colors.dart';
|
||||
import '../../../common/XSConstantMacro/XSConstantMacro.dart';
|
||||
import '../../../tools/appRouteObserver.dart';
|
||||
import '../../../tools/dateTool.dart';
|
||||
import '../entity/lockListInfo_entity.dart';
|
||||
import 'lockListGroup_page.dart';
|
||||
@ -20,7 +22,7 @@ class LockListPage extends StatefulWidget {
|
||||
State<LockListPage> createState() => _LockListPageState();
|
||||
}
|
||||
|
||||
class _LockListPageState extends State<LockListPage> {
|
||||
class _LockListPageState extends State<LockListPage> with RouteAware {
|
||||
final logic = Get.put(LockListLogic());
|
||||
final state = Get.find<LockListLogic>().state;
|
||||
|
||||
@ -97,37 +99,65 @@ class _LockListPageState extends State<LockListPage> {
|
||||
if (lockItemList.length == index+1){
|
||||
isLast = true;
|
||||
}
|
||||
// print("lockItemList.length:${lockItemList.length} == ${index+1} $isLast");
|
||||
return lockInfoListItem(keyInfo, isLast, () {
|
||||
// if(DateTool().compareTimeIsOvertime(keyInfo.endDate!) && keyInfo.keyType == XSConstantMacro.keyTypeTime){
|
||||
// logic.showToast("钥匙已过期");
|
||||
// return;
|
||||
// }
|
||||
|
||||
// var lockCount = 0;
|
||||
// for(GroupList itemData in groupDataList){
|
||||
// lockCount+=itemData.lockList!.length;
|
||||
// }
|
||||
return Slidable(
|
||||
key:ValueKey(keyInfo.keyId),
|
||||
endActionPane: ActionPane(
|
||||
extentRatio: 0.2,
|
||||
motion: const ScrollMotion(),
|
||||
children: [
|
||||
SlidableAction(
|
||||
onPressed: (BuildContext context){
|
||||
state.lockListInfoItemEntity = keyInfo;
|
||||
logic.deleyLockLogicOfRoles();
|
||||
},
|
||||
backgroundColor: Colors.red,
|
||||
foregroundColor: Colors.white,
|
||||
label: '删除',
|
||||
padding: EdgeInsets.only(left: 5.w, right: 5.w),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: lockInfoListItem(keyInfo, isLast, () {
|
||||
if((keyInfo.keyType == XSConstantMacro.keyTypeTime || keyInfo.keyType == XSConstantMacro.keyTypeLoop) && (keyInfo.keyStatus == XSConstantMacro.keyStatusWaitIneffective)){
|
||||
logic.showToast("您的钥匙未生效");
|
||||
return;
|
||||
}
|
||||
if((keyInfo.keyType == XSConstantMacro.keyTypeTime || keyInfo.keyType == XSConstantMacro.keyTypeLoop) && (keyInfo.keyStatus == XSConstantMacro.keyStatusFrozen)){
|
||||
logic.showToast("您的钥匙已冻结");
|
||||
return;
|
||||
}
|
||||
if((keyInfo.keyType == XSConstantMacro.keyTypeTime || keyInfo.keyType == XSConstantMacro.keyTypeLoop) && (keyInfo.keyStatus == XSConstantMacro.keyStatusExpired)){
|
||||
logic.showToast("您的钥匙已过期");
|
||||
return;
|
||||
}
|
||||
Get.toNamed(Routers.lockDetailMainPage, arguments: {
|
||||
// "lockMainEntity": widget.lockMainEntity,
|
||||
"keyInfo": keyInfo,
|
||||
"isOnlyOneData": false,
|
||||
});
|
||||
}),
|
||||
);
|
||||
|
||||
// || keyInfo.keyStatus == XSConstantMacro.keyStatusFrozen || keyInfo.keyStatus == XSConstantMacro.keyStatusExpired
|
||||
if((keyInfo.keyType == XSConstantMacro.keyTypeTime || keyInfo.keyType == XSConstantMacro.keyTypeLoop) && (keyInfo.keyStatus == XSConstantMacro.keyStatusWaitIneffective)){
|
||||
logic.showToast("您的钥匙未生效");
|
||||
// return;
|
||||
}
|
||||
if((keyInfo.keyType == XSConstantMacro.keyTypeTime || keyInfo.keyType == XSConstantMacro.keyTypeLoop) && (keyInfo.keyStatus == XSConstantMacro.keyStatusFrozen)){
|
||||
logic.showToast("您的钥匙已冻结");
|
||||
// return;
|
||||
}
|
||||
if((keyInfo.keyType == XSConstantMacro.keyTypeTime || keyInfo.keyType == XSConstantMacro.keyTypeLoop) && (keyInfo.keyStatus == XSConstantMacro.keyStatusExpired)){
|
||||
logic.showToast("您的钥匙已过期");
|
||||
// return;
|
||||
}
|
||||
Get.toNamed(Routers.lockDetailMainPage, arguments: {
|
||||
// "lockMainEntity": widget.lockMainEntity,
|
||||
"keyInfo": keyInfo,
|
||||
"isOnlyOneData": false,
|
||||
});
|
||||
});
|
||||
// return lockInfoListItem(keyInfo, isLast, () {
|
||||
// if((keyInfo.keyType == XSConstantMacro.keyTypeTime || keyInfo.keyType == XSConstantMacro.keyTypeLoop) && (keyInfo.keyStatus == XSConstantMacro.keyStatusWaitIneffective)){
|
||||
// logic.showToast("您的钥匙未生效");
|
||||
// // return;
|
||||
// }
|
||||
// if((keyInfo.keyType == XSConstantMacro.keyTypeTime || keyInfo.keyType == XSConstantMacro.keyTypeLoop) && (keyInfo.keyStatus == XSConstantMacro.keyStatusFrozen)){
|
||||
// logic.showToast("您的钥匙已冻结");
|
||||
// // return;
|
||||
// }
|
||||
// if((keyInfo.keyType == XSConstantMacro.keyTypeTime || keyInfo.keyType == XSConstantMacro.keyTypeLoop) && (keyInfo.keyStatus == XSConstantMacro.keyStatusExpired)){
|
||||
// logic.showToast("您的钥匙已过期");
|
||||
// // return;
|
||||
// }
|
||||
// Get.toNamed(Routers.lockDetailMainPage, arguments: {
|
||||
// // "lockMainEntity": widget.lockMainEntity,
|
||||
// "keyInfo": keyInfo,
|
||||
// "isOnlyOneData": false,
|
||||
// });
|
||||
// });
|
||||
}),
|
||||
);
|
||||
}
|
||||
@ -250,4 +280,59 @@ class _LockListPageState extends State<LockListPage> {
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void didChangeDependencies() {
|
||||
// TODO: implement didChangeDependencies
|
||||
super.didChangeDependencies();
|
||||
|
||||
/// 路由订阅
|
||||
AppRouteObserver().routeObserver.subscribe(this, ModalRoute.of(context)!);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
// TODO: implement dispose
|
||||
/// 取消路由订阅
|
||||
AppRouteObserver().routeObserver.unsubscribe(this);
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
/// 从上级界面进入 当前界面即将出现
|
||||
@override
|
||||
void didPush() {
|
||||
super.didPush();
|
||||
print("lockSet===didPush");
|
||||
state.ifCurrentScreen.value = true;
|
||||
}
|
||||
|
||||
/// 返回上一个界面 当前界面即将消失
|
||||
@override
|
||||
void didPop() {
|
||||
super.didPop();
|
||||
print("lockSet===didPop");
|
||||
logic.cancelBlueConnetctToastTimer();
|
||||
|
||||
// BlueManage().stopScan();
|
||||
state.ifCurrentScreen.value = false;
|
||||
}
|
||||
|
||||
/// 从下级返回 当前界面即将出现
|
||||
@override
|
||||
void didPopNext() {
|
||||
super.didPopNext();
|
||||
print("lockSet===didPopNext");
|
||||
state.ifCurrentScreen.value = true;
|
||||
}
|
||||
|
||||
/// 进入下级界面 当前界面即将消失
|
||||
@override
|
||||
void didPushNext() {
|
||||
super.didPushNext();
|
||||
print("lockSet===didPushNext");
|
||||
logic.cancelBlueConnetctToastTimer();
|
||||
|
||||
// BlueManage().stopScan();
|
||||
state.ifCurrentScreen.value = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,8 +1,15 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../entity/lockListInfo_entity.dart';
|
||||
|
||||
class LockListState{
|
||||
|
||||
var itemStatusIsEable = false.obs; // 列表里面item是否能点击
|
||||
LockListInfoItemEntity lockListInfoItemEntity = LockListInfoItemEntity(); // 当前选中要删除的item
|
||||
var passwordTF = TextEditingController();
|
||||
var deleteAdministratorIsHaveAllData = false.obs; // 删除管理员是否有所有数据
|
||||
var ifCurrentScreen = true.obs; // 是否是当前界面,用于判断是否需要针对当前界面进行展示
|
||||
|
||||
}
|
||||
@ -45,15 +45,16 @@ class LockMainLogic extends BaseGetXController {
|
||||
if (connectResult == ConnectivityResult.mobile) {
|
||||
// _netType = "4G";
|
||||
state.networkConnectionStatus.value = 1;
|
||||
// print("4G 4G 4G 4G 4G");
|
||||
print("4G 4G 4G 4G 4G");
|
||||
} else if (connectResult == ConnectivityResult.wifi) {
|
||||
// _netType = "wifi";
|
||||
state.networkConnectionStatus.value = 1;
|
||||
// print("wifi wifi wifi wifi wifi");
|
||||
print("wifi wifi wifi wifi wifi");
|
||||
} else {
|
||||
// _netType = "未连接";
|
||||
state.networkConnectionStatus.value = 0;
|
||||
// print("未连接 未连接 未连接 未连接 未连接");
|
||||
print("未连接 未连接 未连接 未连接 未连接");
|
||||
showToast("网络访问失败,请检查网络是否正常");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -10,6 +10,10 @@ import 'package:star_lock/mine/mine/safeVerify/safeVerify_state.dart';
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
|
||||
import '../../../login/login/entity/LoginData.dart';
|
||||
import 'package:star_lock/login/selectCountryRegion/common/index.dart';
|
||||
import 'package:star_lock/tools/storage.dart';
|
||||
|
||||
class SafeVerifyLogic extends BaseGetXController {
|
||||
final SafeVerifyState state = SafeVerifyState();
|
||||
|
||||
@ -32,13 +36,12 @@ class SafeVerifyLogic extends BaseGetXController {
|
||||
|
||||
//获取验证码请求
|
||||
void sendValidationCode() async {
|
||||
var entity = await ApiRepository.to.getValidationCodeAuth(
|
||||
"",
|
||||
'',
|
||||
'1',
|
||||
state.codeType.value,
|
||||
"B748F838-94EE-4BDB-A0E6-7B2D16849792",
|
||||
state.xWidth.value.toString());
|
||||
var entity = await ApiRepository.to.sendValidationCodeAuth(
|
||||
countryCode: "",
|
||||
account: "",
|
||||
channel: state.channel.value,
|
||||
codeType: state.codeType.value,
|
||||
xWidth: state.xWidth.value.toString());
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
_startTimer();
|
||||
} else {}
|
||||
@ -70,6 +73,43 @@ class SafeVerifyLogic extends BaseGetXController {
|
||||
state.canSub.value = state.codeIsOK;
|
||||
}
|
||||
|
||||
///本地存储 登录信息
|
||||
void saveLoginData(LoginData? data) async {
|
||||
print("saveLoginData:${data!.mobile}");
|
||||
await Storage.setString(saveUserLoginData, jsonEncode(data));
|
||||
state.loginData.value = data;
|
||||
}
|
||||
|
||||
///初始化本地数据
|
||||
void initLoginData() async {
|
||||
final data = await Storage.getString(saveUserLoginData);
|
||||
// print("getLoginData:$data");
|
||||
if (data != null && data.isNotEmpty) {
|
||||
state.loginData.value = LoginData.fromJson(jsonDecode(data));
|
||||
bool mobileIsNotEmpty = state.loginData.value.mobile != null && state.loginData.value.mobile!.isNotEmpty;
|
||||
bool emailIsNotEmpty = state.loginData.value.email != null && state.loginData.value.email!.isNotEmpty;
|
||||
//有手机号无邮箱 优先显示手机号 不可切换
|
||||
if (mobileIsNotEmpty == true && emailIsNotEmpty == false) {
|
||||
state.accountStr.value = state.loginData.value.mobile!;
|
||||
state.channel.value = '1';
|
||||
state.isToggle.value = false;
|
||||
Get.log("1111111 mobileIsNotEmpty:$mobileIsNotEmpty emailIsNotEmpty:$emailIsNotEmpty");
|
||||
} else if (mobileIsNotEmpty == true && emailIsNotEmpty == true) {
|
||||
//有手机号有邮箱 优先显示手机号 可切换至邮箱
|
||||
state.accountStr.value = state.loginData.value.mobile!;
|
||||
state.channel.value = '1';
|
||||
state.isToggle.value = true;
|
||||
Get.log("22222222 mobileIsNotEmpty:$mobileIsNotEmpty emailIsNotEmpty:$emailIsNotEmpty");
|
||||
} else if (mobileIsNotEmpty == false && emailIsNotEmpty == true) {
|
||||
//无手机号有邮箱 优先显示邮箱 不可切换
|
||||
state.accountStr.value = state.loginData.value.email!;
|
||||
state.channel.value = '2';
|
||||
state.isToggle.value = false;
|
||||
Get.log("33333333 mobileIsNotEmpty:$mobileIsNotEmpty emailIsNotEmpty:$emailIsNotEmpty");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
super.onReady();
|
||||
@ -78,7 +118,8 @@ class SafeVerifyLogic extends BaseGetXController {
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
state.initLoginData();
|
||||
|
||||
initLoginData();
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@ -57,7 +57,7 @@ class _SafeVerifyPageState extends State<SafeVerifyPage> {
|
||||
decoration: InputDecoration(
|
||||
contentPadding:
|
||||
const EdgeInsets.only(left: 5, top: -8, bottom: 6),
|
||||
hintText: TranslationLoader.lanKeys!.pleaseEnter!.tr,
|
||||
hintText: '${TranslationLoader.lanKeys!.pleaseEnter!.tr}${TranslationLoader.lanKeys!.verificationCode!.tr}',
|
||||
hintStyle: TextStyle(fontSize: 22.sp, height: 1.0),
|
||||
//不需要输入框下划线
|
||||
border: const OutlineInputBorder(),
|
||||
|
||||
@ -1,8 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/login/login/entity/LoginData.dart';
|
||||
import 'package:star_lock/login/selectCountryRegion/common/index.dart';
|
||||
import 'package:star_lock/tools/storage.dart';
|
||||
import 'package:star_lock/translations/trans_lib.dart';
|
||||
|
||||
class SafeVerifyState {
|
||||
@ -14,7 +12,7 @@ class SafeVerifyState {
|
||||
|
||||
var countryCode = '+86'.obs;
|
||||
var countryId = '9'.obs;
|
||||
var codeType = '5'.obs; //5删除账号
|
||||
var codeType = '5'.obs; // //1注册,2找回密码,3绑定手机号,4解绑手机(换绑),5删除账号,6 绑定邮箱,7解绑邮箱(换绑)
|
||||
var verificationCode = ''.obs;
|
||||
var xWidth = ''.obs; // 滑动验证码滑动位置
|
||||
var canSub = false.obs;
|
||||
@ -22,6 +20,7 @@ class SafeVerifyState {
|
||||
var accountStr = ''.obs;
|
||||
var toggleStr = ''.obs; //可切换字眼
|
||||
var isToggle = false.obs; //是否点击切换
|
||||
var channel = '1'.obs; //短信通道 1 短信,2 邮箱
|
||||
|
||||
bool get codeIsOK => verificationCode.value.isNotEmpty;
|
||||
|
||||
@ -32,39 +31,6 @@ class SafeVerifyState {
|
||||
|
||||
final loginData = LoginData().obs;
|
||||
|
||||
///本地存储 登录信息
|
||||
void saveLoginData(LoginData? data) async {
|
||||
print("saveLoginData:${data!.mobile}");
|
||||
await Storage.setString(saveUserLoginData, jsonEncode(data));
|
||||
loginData.value = data;
|
||||
}
|
||||
|
||||
///初始化本地数据
|
||||
void initLoginData() async {
|
||||
final data = await Storage.getString(saveUserLoginData);
|
||||
// print("getLoginData:$data");
|
||||
if (data != null && data.isNotEmpty) {
|
||||
loginData.value = LoginData.fromJson(jsonDecode(data));
|
||||
|
||||
//有手机号无邮箱 优先显示手机号 不可切换
|
||||
if (loginData.value.mobile!.isNotEmpty &&
|
||||
loginData.value.email!.isEmpty) {
|
||||
accountStr.value = loginData.value.mobile!;
|
||||
isToggle.value = false;
|
||||
} else if (loginData.value.mobile!.isNotEmpty &&
|
||||
loginData.value.email!.isNotEmpty) {
|
||||
//有手机号有邮箱 优先显示手机号 可切换至邮箱
|
||||
accountStr.value = loginData.value.mobile!;
|
||||
isToggle.value = true;
|
||||
} else if (loginData.value.mobile!.isNotEmpty &&
|
||||
loginData.value.email!.isNotEmpty) {
|
||||
//无手机号有邮箱 优先显示邮箱 不可切换
|
||||
accountStr.value = loginData.value.email!;
|
||||
isToggle.value = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SafeVerifyState() {
|
||||
resetResend();
|
||||
}
|
||||
|
||||
@ -1,7 +1,10 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
|
||||
import '../../tools/baseGetXController.dart';
|
||||
import '../../tools/eventBusEventManage.dart';
|
||||
import '../../tools/storage.dart';
|
||||
import 'starLockMine_state.dart';
|
||||
|
||||
@ -14,18 +17,16 @@ class StarLockMineLogic extends BaseGetXController {
|
||||
if (entity.errorCode!.codeIsSuccessful) {}
|
||||
}
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
print("ready home");
|
||||
super.onReady();
|
||||
|
||||
/// 刷新电子钥匙列表
|
||||
StreamSubscription? _mineInfoChangeRefreshUIEvent;
|
||||
void _mineInfoChangeRefreshUIAction() {
|
||||
// 蓝牙协议通知传输跟蓝牙之外的数据传输类不一样 eventBus
|
||||
_mineInfoChangeRefreshUIEvent = eventBus.on<MineInfoChangeRefreshUI>().listen((event) {
|
||||
getMineInfoData();
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> onInit() async {
|
||||
print("init home");
|
||||
super.onInit();
|
||||
|
||||
getMineInfoData() async {
|
||||
final data = await Storage.getString(saveUserLoginData);
|
||||
if (data != null && data.isNotEmpty) {
|
||||
state.userNickName.value = (await Storage.getNickname())!;
|
||||
@ -34,9 +35,26 @@ class StarLockMineLogic extends BaseGetXController {
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
print("ready home");
|
||||
super.onReady();
|
||||
|
||||
_mineInfoChangeRefreshUIAction();
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> onInit() async {
|
||||
print("init home");
|
||||
super.onInit();
|
||||
|
||||
getMineInfoData();
|
||||
}
|
||||
|
||||
@override
|
||||
void onClose() {
|
||||
print("close home");
|
||||
super.onClose();
|
||||
_mineInfoChangeRefreshUIEvent?.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
@ -55,7 +55,7 @@ class StarLockMinePageState extends State<StarLockMinePage> with BaseWidget {
|
||||
height: 380.h,
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
Obx(() => Center(
|
||||
Center(
|
||||
child: Column(
|
||||
// crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
@ -86,23 +86,23 @@ class StarLockMinePageState extends State<StarLockMinePage> with BaseWidget {
|
||||
SizedBox(
|
||||
height: 20.h,
|
||||
),
|
||||
Text(state.userNickName.value.isNotEmpty ? state.userNickName.value : (state.userMobile.value.isNotEmpty ? state.userMobile.value : state.userEmail.value),
|
||||
Obx(() => Text(state.userNickName.value.isNotEmpty ? state.userNickName.value : (state.userMobile.value.isNotEmpty ? state.userMobile.value : state.userEmail.value),
|
||||
style: TextStyle(
|
||||
fontSize: 22.sp,
|
||||
color: Colors.white,
|
||||
)),
|
||||
))),
|
||||
SizedBox(
|
||||
height: 10.h,
|
||||
),
|
||||
Text(
|
||||
Obx(() => Text(
|
||||
"${TranslationLoader.lanKeys!.accountNumber!.tr}:${state.userMobile.value.isNotEmpty ? state.userMobile.value : state.userEmail.value}",
|
||||
style: TextStyle(
|
||||
fontSize: 18.sp,
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.w500)),
|
||||
fontWeight: FontWeight.w500))),
|
||||
],
|
||||
),
|
||||
)),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
@ -31,13 +31,12 @@ class MineUnbindPhoneOrEmailLogic extends BaseGetXController {
|
||||
|
||||
//获取验证码请求
|
||||
void sendValidationCode() async {
|
||||
var entity = await ApiRepository.to.getValidationCodeAuth(
|
||||
'',
|
||||
'',
|
||||
state.channel.value,
|
||||
state.codeType.value,
|
||||
state.uniqueid.value,
|
||||
state.xWidth.value.toString());
|
||||
var entity = await ApiRepository.to.sendValidationCodeAuth(
|
||||
countryCode: '',
|
||||
account: '',
|
||||
channel:state.channel.value,
|
||||
codeType: state.codeType.value,
|
||||
xWidth: state.xWidth.value.toString());
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
_startTimer();
|
||||
} else {}
|
||||
|
||||
@ -2,8 +2,10 @@ import 'dart:async';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/mine/minePersonInfo/minePersonInfoEditName/minePersonInfoEditName_state.dart';
|
||||
import 'package:star_lock/tools/eventBusEventManage.dart';
|
||||
import '../../../../network/api_repository.dart';
|
||||
import '../../../../tools/baseGetXController.dart';
|
||||
import '../../../tools/storage.dart';
|
||||
|
||||
class MinePersonInfoEditNameLogic extends BaseGetXController {
|
||||
final MinePersonInfoEditNamePageState state =
|
||||
@ -14,6 +16,10 @@ class MinePersonInfoEditNameLogic extends BaseGetXController {
|
||||
await ApiRepository.to.updateUserInfo(state.inputNickName.value);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
showToast("操作成功");
|
||||
final loginData = await Storage.getLoginData();
|
||||
loginData!.nickname = state.inputNickName.value;
|
||||
Storage.saveLoginData(loginData);
|
||||
eventBus.fire(MineInfoChangeRefreshUI());
|
||||
Get.back();
|
||||
}
|
||||
}
|
||||
|
||||
@ -30,13 +30,12 @@ class MineBindPhoneOrEmailLogic extends BaseGetXController {
|
||||
|
||||
//获取验证码请求
|
||||
void sendValidationCode() async {
|
||||
var entity = await ApiRepository.to.getValidationCodeAuth(
|
||||
state.channel.value == '1' ? state.countryCode.value : '',
|
||||
state.inputAccount.value,
|
||||
state.channel.value,
|
||||
state.codeType.value,
|
||||
state.uniqueid.value,
|
||||
state.xWidth.value.toString());
|
||||
var entity = await ApiRepository.to.sendValidationCodeAuth(
|
||||
countryCode: state.channel.value == '1' ? state.countryCode.value : '',
|
||||
account: state.inputAccount.value,
|
||||
channel: state.channel.value,
|
||||
codeType: state.codeType.value,
|
||||
xWidth: state.xWidth.value.toString());
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
_startTimer();
|
||||
}
|
||||
|
||||
@ -122,9 +122,7 @@ class _MinePersonInfoPageState extends State<MinePersonInfoPage>
|
||||
action: () {
|
||||
//有手机号 则去修改手机号 否则去绑定新的手机号 isFrom:1 短信,2 邮箱
|
||||
if (state.mineInfoData.value.mobile!.isNotEmpty) {
|
||||
Navigator.pushNamed(
|
||||
context, Routers.mineUnbindPhoneOrEmailPage,
|
||||
arguments: {
|
||||
Navigator.pushNamed(context, Routers.mineUnbindPhoneOrEmailPage, arguments: {
|
||||
'mobile': state.mineInfoData.value.mobile!,
|
||||
'isFrom': '1'
|
||||
}).then((value) => logic.getUserInfoRequest());
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
abstract class Api {
|
||||
// 登录注册
|
||||
final String getVerificationCodeUrl = '/user/sendValidationCode';
|
||||
final String sendValidationCodeUrl = '/user/sendValidationCode';
|
||||
final String registerUrl = '/user/register';
|
||||
final String getSliderVerifyImgUrl = '/user/getSliderVerifyImg';
|
||||
final String checkImgUrl = '/user/isSliderValid';
|
||||
@ -161,7 +161,7 @@ abstract class Api {
|
||||
final String userLogoutURL = '/user/logout'; //退出登录
|
||||
final String deleteAccountURL = '/user/delete'; //删除账号
|
||||
final String getUserInfoURL = '/user/getUserInfo'; //获取个人信息
|
||||
final String getValidationCodeAuthURL =
|
||||
final String sendValidationCodeAuthURL =
|
||||
'/user/sendValidationCodeAuth'; //登录后使用,免图片滑动验证
|
||||
final String updateUserInfoURL = '/user/updateUserInfo'; //更新个人信息-昵称/头像
|
||||
// final String changeAccountURL = '/user/changeAccount'; //修改账号
|
||||
|
||||
@ -4,10 +4,10 @@ import 'package:get/get.dart';
|
||||
import 'api_provider_base.dart';
|
||||
|
||||
class ApiProvider extends BaseProvider {
|
||||
Future<Response> getVerificationCode(String countryCode, String account,
|
||||
Future<Response> sendValidationCode(String countryCode, String account,
|
||||
String channel, String codeType, String xWidth) =>
|
||||
post(
|
||||
getVerificationCodeUrl.toUrl,
|
||||
sendValidationCodeUrl.toUrl,
|
||||
jsonEncode({
|
||||
'countryCode': countryCode,
|
||||
'account': account,
|
||||
@ -1528,16 +1528,15 @@ class ApiProvider extends BaseProvider {
|
||||
post(keyboardPwdResetURL.toUrl, jsonEncode({'lockId': lockId}));
|
||||
|
||||
//登陆后可使用获取验证码,免图片滑动验证
|
||||
Future<Response> getValidationCodeAuth(String countryCode, String account,
|
||||
String channel, String codeType, String uniqueid, String xWidth) =>
|
||||
Future<Response> sendValidationCodeAuth(String countryCode, String account,
|
||||
String channel, String codeType, String xWidth) =>
|
||||
post(
|
||||
getValidationCodeAuthURL.toUrl,
|
||||
sendValidationCodeAuthURL.toUrl,
|
||||
jsonEncode({
|
||||
'countryCode': countryCode,
|
||||
'account': account,
|
||||
"channel": channel,
|
||||
'codeType': codeType,
|
||||
"uniqueid": uniqueid,
|
||||
'xWidth': xWidth,
|
||||
}));
|
||||
|
||||
|
||||
@ -43,6 +43,7 @@ class BaseProvider extends GetConnect with Api {
|
||||
// print('res.body======>${res.body}');
|
||||
if (res.body == null) {
|
||||
if (EasyLoading.isShow) EasyLoading.dismiss(animation: true);
|
||||
// EasyLoading.showToast("Network Error!", duration: 2000.milliseconds);
|
||||
var rs = {
|
||||
"errorMsg": "Network Error!",
|
||||
"errorCode": -1,
|
||||
|
||||
@ -60,14 +60,14 @@ class ApiRepository {
|
||||
static ApiRepository get to => Get.find<ApiRepository>();
|
||||
ApiRepository(this.apiProvider);
|
||||
|
||||
// 发送验证码 1注册,2找回密码,3绑定手机号,4解绑(换绑),5删除账号
|
||||
Future<SendValidationCodeEntity> sendValidationCode(
|
||||
// 发送验证码(登陆之前使用) 1注册,2找回密码
|
||||
Future<SendValidationCodeEntity> sendValidationCodeUnLogin(
|
||||
{required String countryCode,
|
||||
required String account,
|
||||
required String channel,
|
||||
required String codeType,
|
||||
required String xWidth}) async {
|
||||
final res = await apiProvider.getVerificationCode(
|
||||
final res = await apiProvider.sendValidationCode(
|
||||
countryCode, account, channel, codeType, xWidth);
|
||||
return SendValidationCodeEntity.fromJson(res.body);
|
||||
}
|
||||
@ -1566,15 +1566,16 @@ class ApiRepository {
|
||||
}
|
||||
|
||||
// 发送验证码 2、登陆后可使用 sendValidationCodeAuth 接口,免图片滑动验证 5删除账号
|
||||
Future<SendValidationCodeEntity> getValidationCodeAuth(
|
||||
String countryCode,
|
||||
String account,
|
||||
String channel,
|
||||
String codeType,
|
||||
String uniqueid,
|
||||
String xWidth) async {
|
||||
final res = await apiProvider.getValidationCodeAuth(
|
||||
countryCode, account, channel, codeType, uniqueid, xWidth);
|
||||
Future<SendValidationCodeEntity> sendValidationCodeAuth(
|
||||
{
|
||||
required String countryCode,
|
||||
required String account,
|
||||
required String channel,
|
||||
required String codeType,
|
||||
required String xWidth
|
||||
}) async {
|
||||
final res = await apiProvider.sendValidationCodeAuth(
|
||||
countryCode, account, channel, codeType, xWidth);
|
||||
return SendValidationCodeEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
|
||||
@ -129,4 +129,9 @@ class LockUserManageListRefreshUI {
|
||||
/// 刷新我的更多设置授权管理员列表
|
||||
class AuthorizedAdministratorListPageRefreshUI {
|
||||
AuthorizedAdministratorListPageRefreshUI();
|
||||
}
|
||||
|
||||
/// 个人信息修改时刷新我的界面的头像昵称等
|
||||
class MineInfoChangeRefreshUI {
|
||||
MineInfoChangeRefreshUI();
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user