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