1,增加点击“重置”确认弹窗
2,部分传参异常判断 3,本地头像上传及更新(接口未给)
This commit is contained in:
parent
35d35c545d
commit
e4e2f71ab1
@ -72,9 +72,9 @@
|
|||||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||||
</array>
|
</array>
|
||||||
<key>io.flutter.embedded_views_preview</key>
|
|
||||||
<true/>
|
|
||||||
<key>UIViewControllerBasedStatusBarAppearance</key>
|
<key>UIViewControllerBasedStatusBarAppearance</key>
|
||||||
<false/>
|
<false/>
|
||||||
|
<key>io.flutter.embedded_views_preview</key>
|
||||||
|
<true/>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
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';
|
||||||
@ -45,8 +46,7 @@ class _ElectronicKeyListPageState extends State<ElectronicKeyListPage> {
|
|||||||
style: TextStyle(color: Colors.white, fontSize: 24.sp),
|
style: TextStyle(color: Colors.white, fontSize: 24.sp),
|
||||||
),
|
),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
logic.resetElectronicKeyListRequest();
|
_showDialog(context);
|
||||||
setState(() {});
|
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@ -343,4 +343,31 @@ class _ElectronicKeyListPageState extends State<ElectronicKeyListPage> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//是否重置弹窗
|
||||||
|
void _showDialog(widgetContext) {
|
||||||
|
showCupertinoDialog(
|
||||||
|
context: widgetContext,
|
||||||
|
builder: (context) {
|
||||||
|
return CupertinoAlertDialog(
|
||||||
|
title: const Text('该锁的电子钥匙都将被删除'),
|
||||||
|
actions: [
|
||||||
|
CupertinoDialogAction(
|
||||||
|
child: Text(TranslationLoader.lanKeys!.cancel!.tr),
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
CupertinoDialogAction(
|
||||||
|
child: Text(TranslationLoader.lanKeys!.reset!.tr),
|
||||||
|
onPressed: () {
|
||||||
|
logic.resetElectronicKeyListRequest();
|
||||||
|
setState(() {});
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
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';
|
||||||
@ -30,7 +31,9 @@ class _WirelessKeyboardPageState extends State<WirelessKeyboardPage> {
|
|||||||
TranslationLoader.lanKeys!.reset!.tr,
|
TranslationLoader.lanKeys!.reset!.tr,
|
||||||
style: TextStyle(color: Colors.white, fontSize: 24.sp),
|
style: TextStyle(color: Colors.white, fontSize: 24.sp),
|
||||||
),
|
),
|
||||||
onPressed: () {},
|
onPressed: () {
|
||||||
|
_showDialog(context);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@ -127,4 +130,28 @@ class _WirelessKeyboardPageState extends State<WirelessKeyboardPage> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//是否重置弹窗
|
||||||
|
void _showDialog(widgetContext) {
|
||||||
|
showCupertinoDialog(
|
||||||
|
context: widgetContext,
|
||||||
|
builder: (context) {
|
||||||
|
return CupertinoAlertDialog(
|
||||||
|
title: const Text('该锁的电子钥匙都将被删除'),
|
||||||
|
actions: [
|
||||||
|
CupertinoDialogAction(
|
||||||
|
child: Text(TranslationLoader.lanKeys!.cancel!.tr),
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
CupertinoDialogAction(
|
||||||
|
child: Text(TranslationLoader.lanKeys!.reset!.tr),
|
||||||
|
onPressed: () {},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -47,7 +47,7 @@ class _PasswordKeyListPageState extends State<PasswordKeyListPage> {
|
|||||||
style: TextStyle(color: Colors.white, fontSize: 24.sp),
|
style: TextStyle(color: Colors.white, fontSize: 24.sp),
|
||||||
),
|
),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
showCupertinoDialogStyle();
|
_showDialog(context);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@ -317,46 +317,30 @@ class _PasswordKeyListPageState extends State<PasswordKeyListPage> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void showCupertinoDialogStyle() async {
|
//是否重置弹窗
|
||||||
var result = await showCupertinoDialog(
|
void _showDialog(widgetContext) {
|
||||||
context: context,
|
showCupertinoDialog(
|
||||||
builder: (context) {
|
context: widgetContext,
|
||||||
return CupertinoAlertDialog(
|
builder: (context) {
|
||||||
title: const Text(''),
|
return CupertinoAlertDialog(
|
||||||
content: Text(
|
title: const Text('该锁的电子钥匙都将被删除'),
|
||||||
"该锁的密码钥匙都将被删除",
|
actions: [
|
||||||
style: TextStyle(
|
CupertinoDialogAction(
|
||||||
color: Colors.black,
|
child: Text(TranslationLoader.lanKeys!.cancel!.tr),
|
||||||
fontSize: 24.sp,
|
onPressed: () {
|
||||||
fontWeight: FontWeight.w700),
|
Navigator.of(context).pop();
|
||||||
|
},
|
||||||
),
|
),
|
||||||
actions: <Widget>[
|
CupertinoDialogAction(
|
||||||
CupertinoButton(
|
child: Text(TranslationLoader.lanKeys!.reset!.tr),
|
||||||
child: Text(
|
onPressed: () {
|
||||||
"取消",
|
logic.resetPasswordKeyListRequest();
|
||||||
style: TextStyle(
|
setState(() {});
|
||||||
color: Colors.blue,
|
},
|
||||||
fontSize: 24.sp,
|
),
|
||||||
fontWeight: FontWeight.w600),
|
],
|
||||||
),
|
);
|
||||||
onPressed: () {
|
},
|
||||||
Navigator.pop(context);
|
);
|
||||||
},
|
|
||||||
),
|
|
||||||
CupertinoButton(
|
|
||||||
child: Text(
|
|
||||||
"重置",
|
|
||||||
style: TextStyle(
|
|
||||||
color: Colors.blue,
|
|
||||||
fontSize: 24.sp,
|
|
||||||
fontWeight: FontWeight.w600),
|
|
||||||
),
|
|
||||||
onPressed: () {
|
|
||||||
logic.resetPasswordKeyListRequest();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -137,10 +137,11 @@ class _StarLockMinePageState extends State<StarLockMinePage> with BaseWidget {
|
|||||||
TranslationLoader.lanKeys!.message!.tr, () {
|
TranslationLoader.lanKeys!.message!.tr, () {
|
||||||
Navigator.pushNamed(context, Routers.messageListPage);
|
Navigator.pushNamed(context, Routers.messageListPage);
|
||||||
}),
|
}),
|
||||||
mineItem('images/mine/icon_mine_main_supportStaff.png',
|
//删除“客服”行
|
||||||
TranslationLoader.lanKeys!.supportStaff!.tr, () {
|
// mineItem('images/mine/icon_mine_main_supportStaff.png',
|
||||||
Navigator.pushNamed(context, Routers.supportStaffPage);
|
// TranslationLoader.lanKeys!.supportStaff!.tr, () {
|
||||||
}),
|
// Navigator.pushNamed(context, Routers.supportStaffPage);
|
||||||
|
// }),
|
||||||
mineItem('images/mine/icon_mine_main_set.png',
|
mineItem('images/mine/icon_mine_main_set.png',
|
||||||
TranslationLoader.lanKeys!.set!.tr, () {
|
TranslationLoader.lanKeys!.set!.tr, () {
|
||||||
Navigator.pushNamed(context, Routers.mineSetPage);
|
Navigator.pushNamed(context, Routers.mineSetPage);
|
||||||
|
|||||||
@ -32,7 +32,9 @@ class MineBindPhoneOrEmailState {
|
|||||||
|
|
||||||
MineBindPhoneOrEmailState() {
|
MineBindPhoneOrEmailState() {
|
||||||
Map map = Get.arguments;
|
Map map = Get.arguments;
|
||||||
unbindToken.value = map["unbindToken"];
|
if (map["unbindToken"] != null) {
|
||||||
|
unbindToken.value = map["unbindToken"];
|
||||||
|
}
|
||||||
channel.value = map["isFrom"];
|
channel.value = map["isFrom"];
|
||||||
//短信通道 1 短信,2 邮箱
|
//短信通道 1 短信,2 邮箱
|
||||||
//短信类型 1注册,2找回密码,3绑定手机号,4解绑(换绑),5删除账号,6 绑定邮箱
|
//短信类型 1注册,2找回密码,3绑定手机号,4解绑(换绑),5删除账号,6 绑定邮箱
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'package:star_lock/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_state.dart';
|
import 'package:star_lock/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_state.dart';
|
||||||
|
import 'package:star_lock/tools/toast.dart';
|
||||||
import '../../../../network/api_repository.dart';
|
import '../../../../network/api_repository.dart';
|
||||||
import '../../../../tools/baseGetXController.dart';
|
import '../../../../tools/baseGetXController.dart';
|
||||||
|
|
||||||
@ -17,4 +18,18 @@ class MinePersonInfoLogic extends BaseGetXController {
|
|||||||
state.haveSafeAnswer.value = entity.data!.haveSafeAnswer!;
|
state.haveSafeAnswer.value = entity.data!.haveSafeAnswer!;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//上传头像 先获取upToken 再调用updateUserInfo
|
||||||
|
Future<void> getUpTokenRequest() async {
|
||||||
|
var entity = await ApiRepository.to.getUpToken(state.typeStr.value);
|
||||||
|
if (entity.errorCode!.codeIsSuccessful) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
//更新个人信息-头像
|
||||||
|
Future<void> updateUserInfoRequest() async {
|
||||||
|
var entity = await ApiRepository.to.updateUserInfo(state.headUrl.value);
|
||||||
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
|
Toast.show(msg: '操作成功');
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -47,12 +47,20 @@ class _MinePersonInfoPageState extends State<MinePersonInfoPage> {
|
|||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
isHaveRightWidget: true,
|
isHaveRightWidget: true,
|
||||||
rightWidget: SizedBox(
|
rightWidget: ClipOval(
|
||||||
width: 75.w,
|
|
||||||
height: 75.h,
|
|
||||||
child: state.image != null
|
child: state.image != null
|
||||||
? Image.file(state.image as File)
|
? Image.file(
|
||||||
: Image.asset('images/controls_user.png'),
|
File(state.image!.path),
|
||||||
|
width: 72.w,
|
||||||
|
height: 72.w,
|
||||||
|
fit: BoxFit.fill,
|
||||||
|
)
|
||||||
|
: Image.asset(
|
||||||
|
'images/controls_user.png',
|
||||||
|
width: 72.w,
|
||||||
|
height: 72.w,
|
||||||
|
fit: BoxFit.fill,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
action: () {
|
action: () {
|
||||||
_openModalBottomSheet();
|
_openModalBottomSheet();
|
||||||
@ -128,7 +136,7 @@ class _MinePersonInfoPageState extends State<MinePersonInfoPage> {
|
|||||||
}),
|
}),
|
||||||
CommonItem(
|
CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.safetyProblem!.tr,
|
leftTitel: TranslationLoader.lanKeys!.safetyProblem!.tr,
|
||||||
rightTitle: "",
|
rightTitle: state.haveSafeAnswer.value == 0 ? "去设置" : "",
|
||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () {
|
action: () {
|
||||||
@ -178,6 +186,7 @@ class _MinePersonInfoPageState extends State<MinePersonInfoPage> {
|
|||||||
source: ImageSource.camera, preferredCameraDevice: CameraDevice.rear);
|
source: ImageSource.camera, preferredCameraDevice: CameraDevice.rear);
|
||||||
if (photo != null) {
|
if (photo != null) {
|
||||||
state.image = photo;
|
state.image = photo;
|
||||||
|
// logic.getUpTokenRequest();
|
||||||
setState(() {});
|
setState(() {});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,6 +10,8 @@ class MinePersonInfoState {
|
|||||||
var emailStr = ''.obs; //邮箱
|
var emailStr = ''.obs; //邮箱
|
||||||
var countryStr = ''.obs; //国家/地区
|
var countryStr = ''.obs; //国家/地区
|
||||||
var haveSafeAnswer = 0.obs; //是否已设置安全问题
|
var haveSafeAnswer = 0.obs; //是否已设置安全问题
|
||||||
|
var typeStr = '2'.obs; //2:上传头像
|
||||||
|
var headUrl = ''.obs; //头像url
|
||||||
|
|
||||||
// ImagePicker获取内容后返回的对象是XFile
|
// ImagePicker获取内容后返回的对象是XFile
|
||||||
XFile? image;
|
XFile? image;
|
||||||
|
|||||||
@ -33,15 +33,17 @@ class MineSetSafetyProblemState {
|
|||||||
var canSub = false.obs;
|
var canSub = false.obs;
|
||||||
|
|
||||||
MineSetSafetyProblemState() {
|
MineSetSafetyProblemState() {
|
||||||
Map map = Get.arguments;
|
if (Get.arguments != null) {
|
||||||
firstProblemStr.value = map["firstProblemStr"];
|
Map map = Get.arguments;
|
||||||
secondProblemStr.value = map["secondProblemStr"];
|
firstProblemStr.value = map["firstProblemStr"];
|
||||||
thirdProblemStr.value = map["thirdProblemStr"];
|
secondProblemStr.value = map["secondProblemStr"];
|
||||||
firstAnswerStr.value = map["firstAnswerStr"];
|
thirdProblemStr.value = map["thirdProblemStr"];
|
||||||
secondAnswerStr.value = map["secondAnswerStr"];
|
firstAnswerStr.value = map["firstAnswerStr"];
|
||||||
thirdAnswerStr.value = map["thirdAnswerStr"];
|
secondAnswerStr.value = map["secondAnswerStr"];
|
||||||
firstQuestionId.value = map["firstQuestionId"];
|
thirdAnswerStr.value = map["thirdAnswerStr"];
|
||||||
secondQuestionId.value = map["secondQuestionId"];
|
firstQuestionId.value = map["firstQuestionId"];
|
||||||
thirdQuestionId.value = map["thirdQuestionId"];
|
secondQuestionId.value = map["secondQuestionId"];
|
||||||
|
thirdQuestionId.value = map["thirdQuestionId"];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,7 +4,6 @@ abstract class Api {
|
|||||||
// final String baseUrl = "http://wenlin.lock.star-lock.cn/api"; //曾工
|
// final String baseUrl = "http://wenlin.lock.star-lock.cn/api"; //曾工
|
||||||
final String baseUrl = "http://192.168.56.101:8099/api"; //曾工本地
|
final String baseUrl = "http://192.168.56.101:8099/api"; //曾工本地
|
||||||
// final String baseUrl = "http://192.168.1.14:8099/api"; //葛工开发环境地址
|
// final String baseUrl = "http://192.168.1.14:8099/api"; //葛工开发环境地址
|
||||||
final String baseWebURL = 'http://192.168.56.101:8099'; //关于网页网址前缀
|
|
||||||
|
|
||||||
// 登录注册
|
// 登录注册
|
||||||
final String getVerificationCodeUrl = '/user/sendValidationCode';
|
final String getVerificationCodeUrl = '/user/sendValidationCode';
|
||||||
|
|||||||
@ -1226,7 +1226,7 @@ class ApiProvider extends BaseProvider {
|
|||||||
|
|
||||||
//上传头像 先获取upToken 再调用updateUserInfo
|
//上传头像 先获取upToken 再调用updateUserInfo
|
||||||
Future<Response> getUpToken(String type) =>
|
Future<Response> getUpToken(String type) =>
|
||||||
post(setSafeAnswerURL.toUrl, jsonEncode({"type": type}));
|
post(getUpTokenURL.toUrl, jsonEncode({"type": type}));
|
||||||
|
|
||||||
//获取解绑手机号Token
|
//获取解绑手机号Token
|
||||||
Future<Response> unbindPhoneToken(String verificationCode) => post(
|
Future<Response> unbindPhoneToken(String verificationCode) => post(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user