fix:修改 xhj 布局(我的,设置页),修复实名认证 bug

This commit is contained in:
anfe 2024-05-28 17:26:02 +08:00
parent 8df9c7e0ef
commit fbd1adf4e1
10 changed files with 909 additions and 900 deletions

File diff suppressed because it is too large Load Diff

View File

@ -239,9 +239,7 @@ class _StarLockLoginPageState extends State<StarLockLoginPage> {
child: SizedBox( child: SizedBox(
width: 10.sp, width: 10.sp,
)), )),
F.isLite if (F.isLite) Container() else GestureDetector(
? Container()
: GestureDetector(
child: SizedBox( child: SizedBox(
// width: 150.w, // width: 150.w,
height: 50.h, height: 50.h,

View File

@ -3,6 +3,7 @@ import 'package:flutter/services.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';
import 'package:star_lock/flavors.dart'; import 'package:star_lock/flavors.dart';
import 'package:star_lock/login/login/starLock_login_state.dart';
import '../../appRouters.dart'; import '../../appRouters.dart';
import '../../app_settings/app_colors.dart'; import '../../app_settings/app_colors.dart';
@ -22,10 +23,8 @@ class StarLockLoginXHJPage extends StatefulWidget {
} }
class _StarLockLoginPageState extends State<StarLockLoginXHJPage> { class _StarLockLoginPageState extends State<StarLockLoginXHJPage> {
final logic = Get.put(StarLockLoginLogic()); final StarLockLoginLogic logic = Get.put(StarLockLoginLogic());
final state = Get final StarLockLoginState state = Get.find<StarLockLoginLogic>().state;
.find<StarLockLoginLogic>()
.state;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -33,269 +32,291 @@ class _StarLockLoginPageState extends State<StarLockLoginXHJPage> {
resizeToAvoidBottomInset: false, resizeToAvoidBottomInset: false,
backgroundColor: const Color(0xFFFFFFFF), backgroundColor: const Color(0xFFFFFFFF),
body: ListView( body: ListView(
padding: EdgeInsets.only(top: 120.h, left: 40.w, right: 40.w), padding: EdgeInsets.only(
children: [ top: 120.h,
Text( ),
'${"欢迎使用".tr}${F.title}', children: <Widget>[
style: TextStyle( Padding(
color: AppColors.darkGrayTextColor, padding: EdgeInsets.symmetric(horizontal: 40.w),
fontSize: 48.sp, child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
'${"欢迎使用".tr}${F.title}',
style: TextStyle(
color: AppColors.darkGrayTextColor,
fontSize: 48.sp,
),
),
SizedBox(height: 30.h),
GestureDetector(
onTap: () async {
final result =
await Get.toNamed(Routers.selectCountryRegionPage);
if (result != null) {
result as Map<String, dynamic>;
state.countryCode.value = result['code'];
state.countryName.value = result['countryName'];
}
},
child: Container(
color: Colors.transparent,
child: Row(
children: <Widget>[
SizedBox(
width: 5.w,
),
Text(
TranslationLoader.lanKeys!.countryAndRegion!.tr,
style: TextStyle(
fontSize: 22.sp,
color: AppColors.darkGrayTextColor),
),
SizedBox(
width: 40.w,
),
Obx(() {
return Text(
'${state.countryName.value} +${state.countryCode.value}',
style: TextStyle(
fontSize: 22.sp, color: AppColors.mainColor),
);
})
],
),
),
),
LoginInput(
controller: state.emailOrPhoneController,
onchangeAction: (v) {
logic.checkNext(state.emailOrPhoneController);
},
leftWidget: Padding(
padding: EdgeInsets.only(
top: 30.w,
bottom: 20.w,
),
),
rightSlot: IconButton(
icon: const Icon(Icons.close),
onPressed: () {},
),
label: TranslationLoader
.lanKeys!.pleaseEnterNumberOrEmail!.tr,
// keyboardType: TextInputType.number,
inputFormatters: <TextInputFormatter>[
LengthLimitingTextInputFormatter(30),
]),
LoginInput(
controller: state.pwdController,
onchangeAction: (v) {
logic.checkNext(state.pwdController);
},
isPwd: true,
// isSuffixIcon: 2,
leftWidget: Padding(
padding: EdgeInsets.only(
top: 30.w,
bottom: 20.w,
),
),
label:
'${TranslationLoader.lanKeys!.pleaseEnter!.tr}${TranslationLoader.lanKeys!.password!.tr}',
inputFormatters: <TextInputFormatter>[
LengthLimitingTextInputFormatter(20),
]),
SizedBox(height: 10.h),
],
), ),
), ),
SizedBox(height: 30.h),
GestureDetector(
onTap: () async {
var result = await Get.toNamed(Routers.selectCountryRegionPage);
if (result != null) {
result as Map<String, dynamic>;
state.countryCode.value = result['code'];
state.countryName.value = result['countryName'];
}
},
child: Container(
color: Colors.transparent,
child: Row(
children: [
SizedBox(
width: 5.w,
),
Text(
TranslationLoader.lanKeys!.countryAndRegion!.tr,
style: TextStyle(
fontSize: 22.sp, color: AppColors.darkGrayTextColor),
),
SizedBox(
width: 40.w,
),
Obx(() {
return Text(
'${state.countryName.value} +${state.countryCode
.value}',
style: TextStyle(
fontSize: 22.sp, color: AppColors.mainColor),
);
})
],
),
),
),
LoginInput(
controller: state.emailOrPhoneController,
onchangeAction: (v) {
logic.checkNext(state.emailOrPhoneController);
},
leftWidget: Padding(
padding: EdgeInsets.only(
top: 30.w,
bottom: 20.w,
),
),
rightSlot: IconButton(
icon: Icon(Icons.close),
onPressed: () {},
),
label: TranslationLoader.lanKeys!.pleaseEnterNumberOrEmail!.tr,
// keyboardType: TextInputType.number,
inputFormatters: [
LengthLimitingTextInputFormatter(30),
]),
LoginInput(
controller: state.pwdController,
onchangeAction: (v) {
logic.checkNext(state.pwdController);
},
isPwd: true,
// isSuffixIcon: 2,
leftWidget: Padding(
padding: EdgeInsets.only(
top: 30.w,
bottom: 20.w,
),
),
label:
"${TranslationLoader.lanKeys!.pleaseEnter!
.tr}${TranslationLoader.lanKeys!.password!.tr}",
inputFormatters: [
LengthLimitingTextInputFormatter(20),
]),
SizedBox(height: 30.h),
GestureDetector( GestureDetector(
onTap: () { onTap: () {
state.agree.value = !state.agree.value; state.agree.value = !state.agree.value;
logic.changeAgreeState(); logic.changeAgreeState();
}, },
child: Padding( child: Container(
padding: EdgeInsets.symmetric(vertical: 10.h), color: Colors.transparent,
padding: EdgeInsets.symmetric(vertical: 30.h, horizontal: 40.w),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: <Widget>[
Obx( Obx(
() => () => Container(
Container( padding: EdgeInsets.only(
padding: EdgeInsets.only( left: 5.w,
left: 5.w, right: 10.w,
right: 10.w, ),
), child: Image.asset(
child: Image.asset( state.agree.value
state.agree.value ? 'images/icon_round_select.png'
? 'images/icon_round_select.png' : 'images/icon_round_unSelect.png',
: 'images/icon_round_unSelect.png', width: 20.w,
width: 20.w, height: 20.w,
height: 20.w, ),
), ),
),
), ),
Flexible( Flexible(
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: TranslationLoader.lanKeys!.readAndAgree!.tr, text: TranslationLoader.lanKeys!.readAndAgree!.tr,
style: TextStyle( style: TextStyle(
color: const Color(0xff333333), color: const Color(0xff333333), fontSize: 20.sp),
fontSize: 20.sp), children: <InlineSpan>[
children: [ WidgetSpan(
WidgetSpan( alignment: PlaceholderAlignment.middle,
alignment: PlaceholderAlignment.middle, child: GestureDetector(
child: GestureDetector( child: Text(
child: Text( '${TranslationLoader.lanKeys!.userAgreement!.tr}',
'${TranslationLoader.lanKeys! style: TextStyle(
.userAgreement!.tr}', color: AppColors.mainColor,
style: TextStyle( fontSize: 20.sp)),
color: AppColors.mainColor, onTap: () {
fontSize: 20.sp)), Get.toNamed(Routers.webviewShowPage,
onTap: () { arguments: <String, String>{
Get.toNamed(Routers.webviewShowPage, 'url': XSConstantMacro.userAgreementURL,
arguments: { 'title': '用户协议'.tr
"url": XSConstantMacro });
.userAgreementURL, },
"title": '用户协议'.tr )),
}); WidgetSpan(
}, alignment: PlaceholderAlignment.middle,
)), child: GestureDetector(
WidgetSpan( child: Text(
alignment: PlaceholderAlignment.middle, '${TranslationLoader.lanKeys!.privacyPolicy!.tr}',
child: GestureDetector( style: TextStyle(
child: Text( color: AppColors.mainColor,
'${TranslationLoader.lanKeys! fontSize: 20.sp)),
.privacyPolicy!.tr}', onTap: () {
style: TextStyle( Get.toNamed(Routers.webviewShowPage,
color: AppColors.mainColor, arguments: <String, String>{
fontSize: 20.sp)), 'url': XSConstantMacro.privacyPolicyURL,
onTap: () { 'title': '隐私政策'.tr
Get.toNamed(Routers.webviewShowPage, });
arguments: { },
"url": XSConstantMacro )),
.privacyPolicyURL, ],
"title": '隐私政策'.tr )),
});
},
)),
],
)),
) )
], ],
), ),
), ),
), ),
SizedBox(height: 15.w), Padding(
Obx(() => padding: EdgeInsets.symmetric(horizontal: 40.w),
SubmitBtn( child: Column(
btnName: TranslationLoader.lanKeys!.login!.tr, crossAxisAlignment: CrossAxisAlignment.start,
fontSize: 28.sp, children: <Widget>[
borderRadius: 20.w, SizedBox(height: 5.w),
padding: EdgeInsets.only(top: 25.w, bottom: 25.w), Obx(() => SubmitBtn(
isDisabled: state.canNext.value, btnName: TranslationLoader.lanKeys!.login!.tr,
onClick: state.canNext.value fontSize: 28.sp,
? () { borderRadius: 20.w,
if (state.agree.value == false) { padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
logic.showToast('请先同意用户协议及隐私政策'.tr); isDisabled: state.canNext.value,
return; onClick: state.canNext.value
} else { ? () {
logic.login(); if (state.agree.value == false) {
} logic.showToast('请先同意用户协议及隐私政策'.tr);
} return;
: null)), } else {
SizedBox(height: 10.h), logic.login();
ElevatedButton( }
onPressed: () async { }
var data = await Get.toNamed(Routers.starLockRegisterPage); : null)),
if (data != null) { SizedBox(height: 10.h),
state.emailOrPhoneController.text = data['phoneOrEmailStr']; SizedBox(
logic.checkNext(state.emailOrPhoneController); width: Get.width,
state.pwdController.text = data['pwd']; child: ElevatedButton(
logic.checkNext(state.pwdController); onPressed: () async {
setState(() {}); final dynamic data =
} await Get.toNamed(Routers.starLockRegisterPage);
}, if (data != null) {
style: ElevatedButton.styleFrom( state.emailOrPhoneController.text =
backgroundColor: AppColors.mainColor), data['phoneOrEmailStr'];
child: Text( logic.checkNext(state.emailOrPhoneController);
TranslationLoader.lanKeys!.register!.tr, state.pwdController.text = data['pwd'];
style: TextStyle(fontSize: 22.sp, color: Colors.white), logic.checkNext(state.pwdController);
), setState(() {});
), }
SizedBox(height: 5.w), },
Row( style: ElevatedButton.styleFrom(
mainAxisAlignment: MainAxisAlignment.center, backgroundColor: AppColors.mainColor),
children: [
GestureDetector(
child: SizedBox(
// width: 150.w,
height: 50.h,
// color: Colors.red,
child: Center(
child: Text( child: Text(
'${TranslationLoader.lanKeys!.forgetPassword!.tr}', TranslationLoader.lanKeys!.register!.tr,
style: TextStyle( style: TextStyle(fontSize: 22.sp, color: Colors.white),
fontSize: 22.sp, color: AppColors.mainColor)), ),
), ),
), ),
onTap: () { SizedBox(height: 5.w),
Navigator.pushNamed( Row(
context, Routers.starLockForgetPasswordPage); mainAxisAlignment: MainAxisAlignment.center,
}, children: <Widget>[
), GestureDetector(
Expanded( child: SizedBox(
child: SizedBox( // width: 150.w,
width: 10.sp, height: 50.h,
)), // color: Colors.red,
F.isLite child: Center(
? Container() child: Text(
: GestureDetector( '${TranslationLoader.lanKeys!.forgetPassword!.tr}',
child: SizedBox( style: TextStyle(
// width: 150.w, fontSize: 22.sp,
height: 50.h, color: AppColors.mainColor)),
// color: Colors.red, ),
child: Center( ),
child: Text('演示模式'.tr, onTap: () {
style: TextStyle( Navigator.pushNamed(
fontSize: 22.sp, context, Routers.starLockForgetPasswordPage);
color: AppColors.mainColor)), },
), ),
Expanded(
child: SizedBox(
width: 10.sp,
)),
if (F.isLite)
Container()
else
GestureDetector(
child: SizedBox(
// width: 150.w,
height: 50.h,
// color: Colors.red,
child: Center(
child: Text('演示模式'.tr,
style: TextStyle(
fontSize: 22.sp,
color: AppColors.mainColor)),
),
),
onTap: () {
Get.toNamed(Routers.demoModeLockDetailPage);
},
)
],
), ),
onTap: () { ],
Get.toNamed(Routers.demoModeLockDetailPage); ),
}, )
)
],
),
], ],
)); ));
} }
Widget loginInput({TextEditingController? controller, Widget loginInput(
List<TextInputFormatter>? inputFormatters, {TextEditingController? controller,
String? hintText, List<TextInputFormatter>? inputFormatters,
bool? isHaveLeftWidget, String? hintText,
Widget? leftWidget, bool? isHaveLeftWidget,
String? label, Widget? leftWidget,
bool? isPwd, String? label,
BlockStrCallback? onchangeAction}) { bool? isPwd,
BlockStrCallback? onchangeAction}) {
return Container( return Container(
width: 1.sp, width: 1.sp,
color: Colors.transparent,
child: Column( child: Column(
children: [ children: <Widget>[
Row( Row(
children: [ children: <Widget>[
Container( Container(
color: Colors.red, color: Colors.red,
child: Image.asset( child: Image.asset(

View File

@ -295,32 +295,6 @@ class LockDetailLogic extends BaseGetXController {
resetOpenDoorState(); resetOpenDoorState();
} }
}); });
// BlueManage()
// .blueStart((BluetoothConnectionState deviceConnectionState) async {
// if (deviceConnectionState == BluetoothConnectionState.connected) {
// BlueManage().writeDirectlyBLE(
// 'DC:8F:92:83:69:ED',
// OpenLockCommand(
// lockID: BlueManage().connectDeviceName,
// userID: await Storage.getUid(),
// openMode: state.openDoorModel,
// openTime: getUTCNetTime(),
// onlineToken: state.lockNetToken,
// token: getTokenList,
// needAuthor: 1,
// signKey: signKeyDataList,
// privateKey: getPrivateKeyList,
// ).packageData());
// } else if (deviceConnectionState ==
// BluetoothConnectionState.disconnected) {
// cancelBlueConnetctToastTimer();
// if (state.ifCurrentScreen.value == true) {
// showBlueConnetctToast();
// }
// resetOpenDoorState();
// }
// });
} }
// //
@ -530,8 +504,8 @@ class LockDetailLogic extends BaseGetXController {
void resetOpenDoorState() { void resetOpenDoorState() {
state.openLockBtnState.value = 0; state.openLockBtnState.value = 0;
state.openDoorBtnisUneable.value = false; state.openDoorBtnisUneable.value = false;
state.animationController!.reset(); state.animationController?.reset();
state.animationController!.forward(); state.animationController?.forward();
eventBus.fire(RefreshLockDetailInfoDataEvent()); eventBus.fire(RefreshLockDetailInfoDataEvent());
} }

View File

@ -14,7 +14,6 @@ import 'lockListGroup_view.dart';
import 'lockList_logic.dart'; import 'lockList_logic.dart';
class LockListXHJPage extends StatefulWidget { class LockListXHJPage extends StatefulWidget {
const LockListXHJPage({required this.lockListInfoGroupEntity, Key? key}) const LockListXHJPage({required this.lockListInfoGroupEntity, Key? key})
: super(key: key); : super(key: key);
final LockListInfoGroupEntity lockListInfoGroupEntity; final LockListInfoGroupEntity lockListInfoGroupEntity;
@ -120,9 +119,9 @@ class _LockListXHJPageState extends State<LockListXHJPage> with RouteAware {
isLast = true; isLast = true;
} }
list.add(Slidable( list.add(Slidable(
key: ValueKey(keyInfo.keyId), key: ValueKey<int?>(keyInfo.keyId),
endActionPane: ActionPane( endActionPane: ActionPane(
extentRatio: 0.2, extentRatio: 0.5,
motion: const ScrollMotion(), motion: const ScrollMotion(),
children: <Widget>[ children: <Widget>[
SlidableAction( SlidableAction(
@ -133,6 +132,7 @@ class _LockListXHJPageState extends State<LockListXHJPage> with RouteAware {
backgroundColor: Colors.red, backgroundColor: Colors.red,
foregroundColor: Colors.white, foregroundColor: Colors.white,
label: '删除'.tr, label: '删除'.tr,
borderRadius: BorderRadius.all(Radius.circular(20.w)),
padding: EdgeInsets.only(left: 5.w, right: 5.w), padding: EdgeInsets.only(left: 5.w, right: 5.w),
), ),
], ],

View File

@ -12,6 +12,7 @@ import 'package:star_lock/mine/mall/lockMall_page.dart';
import 'package:star_lock/mine/message/messageList/messageList_page.dart'; import 'package:star_lock/mine/message/messageList/messageList_page.dart';
import 'package:star_lock/mine/message/messageList/messageList_xhj_page.dart'; import 'package:star_lock/mine/message/messageList/messageList_xhj_page.dart';
import 'package:star_lock/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_page.dart'; import 'package:star_lock/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_page.dart';
import 'package:star_lock/mine/mineSet/mineSet/mineSet_page.dart';
import 'package:star_lock/tools/noData.dart'; import 'package:star_lock/tools/noData.dart';
import 'package:star_lock/tools/submitBtn.dart'; import 'package:star_lock/tools/submitBtn.dart';
import 'package:star_lock/translations/trans_lib.dart'; import 'package:star_lock/translations/trans_lib.dart';
@ -76,7 +77,7 @@ class _StarLockMainXHJPageState extends State<StarLockMainXHJPage>
pageView( pageView(
widget: SafeArea( widget: SafeArea(
bottom: false, bottom: false,
child: MinePersonInfoPage( child: MineSetPage(
showAppBar: false, showAppBar: false,
showAbout: true, showAbout: true,
), ),

View File

@ -100,7 +100,7 @@ class _MessageListXHJPageState extends State<MessageListXHJPage>
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Text( Text(
'智能分析', '智能分析'.tr,
style: TextStyle( style: TextStyle(
color: AppColors.blackColor, color: AppColors.blackColor,
fontSize: 28.sp, fontSize: 28.sp,
@ -108,7 +108,7 @@ class _MessageListXHJPageState extends State<MessageListXHJPage>
), ),
), ),
Text( Text(
'精准识别设备事件,过滤无效信息', '精准识别设备事件,过滤无效信息'.tr,
style: TextStyle( style: TextStyle(
color: AppColors.blackColor.withOpacity(0.6), color: AppColors.blackColor.withOpacity(0.6),
fontSize: 20.sp, fontSize: 20.sp,

View File

@ -4,7 +4,9 @@ import 'package:get/get.dart';
import 'package:permission_handler/permission_handler.dart'; import 'package:permission_handler/permission_handler.dart';
import 'package:star_lock/app_settings/app_colors.dart'; import 'package:star_lock/app_settings/app_colors.dart';
import 'package:star_lock/flavors.dart'; import 'package:star_lock/flavors.dart';
import 'package:star_lock/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_entity.dart';
import 'package:star_lock/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_logic.dart'; import 'package:star_lock/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_logic.dart';
import 'package:star_lock/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_state.dart';
import 'package:star_lock/tools/custom_bottom_sheet.dart'; import 'package:star_lock/tools/custom_bottom_sheet.dart';
import '../../../appRouters.dart'; import '../../../appRouters.dart';
@ -14,9 +16,8 @@ import '../../../tools/titleAppBar.dart';
import '../../../translations/trans_lib.dart'; import '../../../translations/trans_lib.dart';
class MinePersonInfoPage extends StatefulWidget { class MinePersonInfoPage extends StatefulWidget {
MinePersonInfoPage({Key? key, this.showAppBar = true, this.showAbout = false}) MinePersonInfoPage({Key? key, this.showAbout = false})
: super(key: key); : super(key: key);
bool showAppBar;
bool showAbout; bool showAbout;
@override @override
@ -24,8 +25,8 @@ class MinePersonInfoPage extends StatefulWidget {
} }
class _MinePersonInfoPageState extends State<MinePersonInfoPage> { class _MinePersonInfoPageState extends State<MinePersonInfoPage> {
final logic = Get.put(MinePersonInfoLogic()); final MinePersonInfoLogic logic = Get.put(MinePersonInfoLogic());
final state = Get.find<MinePersonInfoLogic>().state; final MinePersonInfoState state = Get.find<MinePersonInfoLogic>().state;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -33,60 +34,12 @@ class _MinePersonInfoPageState extends State<MinePersonInfoPage> {
backgroundColor: F.sw( backgroundColor: F.sw(
skyCall: () => AppColors.mainBackgroundColor, skyCall: () => AppColors.mainBackgroundColor,
xhjCall: () => AppColors.mainBackgroundColor), xhjCall: () => AppColors.mainBackgroundColor),
appBar: widget.showAppBar appBar: TitleAppBar(
? TitleAppBar(
barTitle: TranslationLoader.lanKeys!.personalInformation!.tr, barTitle: TranslationLoader.lanKeys!.personalInformation!.tr,
haveBack: true, haveBack: true,
backgroundColor: AppColors.mainColor) backgroundColor: AppColors.mainColor),
: null,
body: Column( body: Column(
children: [ children: <Widget>[
F.sw(
skyCall: () => SizedBox(),
xhjCall: () => Container(
width: 1.sw,
height: 0.2.sw,
margin:
EdgeInsets.only(top: 15.h, left: 20.w, right: 20.w),
padding: EdgeInsets.symmetric(horizontal: 25.w),
decoration: BoxDecoration(
image: const DecorationImage(
image: AssetImage('images/xhj_main_bg.jpg'),
fit: BoxFit.cover,
),
borderRadius: BorderRadius.circular(20.r),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.15),
offset: const Offset(0, 0),
blurRadius: 10.r,
spreadRadius: 0,
),
],
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'系统设置',
style: TextStyle(
color: AppColors.blackColor,
fontSize: 28.sp,
fontWeight: FontWeight.w600,
),
),
Text(
'系统的全局配置在此项内进行设置',
style: TextStyle(
color: AppColors.blackColor.withOpacity(0.6),
fontSize: 20.sp,
fontWeight: FontWeight.w600,
),
),
],
),
)),
SizedBox( SizedBox(
height: 20.h, height: 20.h,
), ),
@ -95,10 +48,10 @@ class _MinePersonInfoPageState extends State<MinePersonInfoPage> {
child: ClipRRect( child: ClipRRect(
borderRadius: BorderRadius.circular(20.r), borderRadius: BorderRadius.circular(20.r),
child: Column( child: Column(
children: [ children: <Widget>[
Obx(() => CommonItem( Obx(() => CommonItem(
leftTitel: TranslationLoader.lanKeys!.avatar!.tr, leftTitel: TranslationLoader.lanKeys!.avatar!.tr,
rightTitle: "", rightTitle: '',
allHeight: 100.h, allHeight: 100.h,
isHaveLine: true, isHaveLine: true,
isHaveDirection: true, isHaveDirection: true,
@ -119,15 +72,15 @@ class _MinePersonInfoPageState extends State<MinePersonInfoPage> {
leftTitel: TranslationLoader.lanKeys!.nickName!.tr, leftTitel: TranslationLoader.lanKeys!.nickName!.tr,
rightTitle: state.mineInfoData.value.nickname != null rightTitle: state.mineInfoData.value.nickname != null
? state.mineInfoData.value.nickname! ? state.mineInfoData.value.nickname!
: "", : '',
isHaveLine: true, isHaveLine: true,
isHaveDirection: true, isHaveDirection: true,
action: () { action: () {
Navigator.pushNamed( Navigator.pushNamed(
context, Routers.minePersonInfoEditNamePage, context, Routers.minePersonInfoEditNamePage,
arguments: { arguments: <String, MinePersonInfoData>{
'mineInfoData': state.mineInfoData.value 'mineInfoData': state.mineInfoData.value
}).then((value) => logic.getUserInfoRequest()); }).then((Object? value) => logic.getUserInfoRequest());
})), })),
Obx(() => CommonItem( Obx(() => CommonItem(
leftTitel: TranslationLoader.lanKeys!.mobileNumber!.tr, leftTitel: TranslationLoader.lanKeys!.mobileNumber!.tr,
@ -141,17 +94,17 @@ class _MinePersonInfoPageState extends State<MinePersonInfoPage> {
if (state.mineInfoData.value.mobile!.isNotEmpty) { if (state.mineInfoData.value.mobile!.isNotEmpty) {
Navigator.pushNamed( Navigator.pushNamed(
context, Routers.mineUnbindPhoneOrEmailPage, context, Routers.mineUnbindPhoneOrEmailPage,
arguments: { arguments: <String, String>{
'mobile': state.mineInfoData.value.mobile!, 'mobile': state.mineInfoData.value.mobile!,
'isFrom': '1' 'isFrom': '1'
}).then((value) => logic.getUserInfoRequest()); }).then((Object? value) => logic.getUserInfoRequest());
} else { } else {
Navigator.pushNamed( Navigator.pushNamed(
context, Routers.mineBindPhoneOrEmailPage, context, Routers.mineBindPhoneOrEmailPage,
arguments: { arguments: <String, String>{
'mobile': state.mineInfoData.value.mobile!, 'mobile': state.mineInfoData.value.mobile!,
'isFrom': '1' 'isFrom': '1'
}).then((value) => logic.getUserInfoRequest()); }).then((Object? value) => logic.getUserInfoRequest());
} }
})), })),
Obx(() => CommonItem( Obx(() => CommonItem(
@ -166,23 +119,23 @@ class _MinePersonInfoPageState extends State<MinePersonInfoPage> {
if (state.mineInfoData.value.email!.isNotEmpty) { if (state.mineInfoData.value.email!.isNotEmpty) {
Navigator.pushNamed( Navigator.pushNamed(
context, Routers.mineUnbindPhoneOrEmailPage, context, Routers.mineUnbindPhoneOrEmailPage,
arguments: { arguments: <String, String>{
'isFrom': '2', 'isFrom': '2',
'email': state.mineInfoData.value.email! 'email': state.mineInfoData.value.email!
}).then((value) => logic.getUserInfoRequest()); }).then((Object? value) => logic.getUserInfoRequest());
} else { } else {
Navigator.pushNamed( Navigator.pushNamed(
context, Routers.mineBindPhoneOrEmailPage, context, Routers.mineBindPhoneOrEmailPage,
arguments: { arguments: <String, String>{
'isFrom': '2', 'isFrom': '2',
'email': state.mineInfoData.value.email! 'email': state.mineInfoData.value.email!
}).then((value) => logic.getUserInfoRequest()); }).then((Object? value) => logic.getUserInfoRequest());
} }
})), })),
CommonItem( CommonItem(
leftTitel: leftTitel:
TranslationLoader.lanKeys!.resetPasswords!.tr, TranslationLoader.lanKeys!.resetPasswords!.tr,
rightTitle: "", rightTitle: '',
isHaveLine: true, isHaveLine: true,
isHaveDirection: true, isHaveDirection: true,
action: () { action: () {
@ -192,15 +145,15 @@ class _MinePersonInfoPageState extends State<MinePersonInfoPage> {
Obx(() => CommonItem( Obx(() => CommonItem(
leftTitel: TranslationLoader.lanKeys!.safetyProblem!.tr, leftTitel: TranslationLoader.lanKeys!.safetyProblem!.tr,
rightTitle: state.mineInfoData.value.haveSafeAnswer == 0 rightTitle: state.mineInfoData.value.haveSafeAnswer == 0
? "去设置".tr ? '去设置'.tr
: "", : '',
isHaveLine: true, isHaveLine: true,
isHaveDirection: true, isHaveDirection: true,
action: () { action: () {
if (state.mineInfoData.value.haveSafeAnswer == 0) { if (state.mineInfoData.value.haveSafeAnswer == 0) {
Navigator.pushNamed(context, Navigator.pushNamed(context,
Routers.minePersonInfoSetSafetyProblemPage) Routers.minePersonInfoSetSafetyProblemPage)
.then((value) => logic.getUserInfoRequest()); .then((Object? value) => logic.getUserInfoRequest());
} else { } else {
Navigator.pushNamed(context, Navigator.pushNamed(context,
Routers.minePersonInfoViewSafetyProblemPage); Routers.minePersonInfoViewSafetyProblemPage);
@ -211,40 +164,11 @@ class _MinePersonInfoPageState extends State<MinePersonInfoPage> {
TranslationLoader.lanKeys!.countryAndRegion!.tr, TranslationLoader.lanKeys!.countryAndRegion!.tr,
rightTitle: state.mineInfoData.value.countryName != null rightTitle: state.mineInfoData.value.countryName != null
? state.mineInfoData.value.countryName! ? state.mineInfoData.value.countryName!
: "", : '',
isHaveLine: true, isHaveLine: true,
isHaveDirection: false)), isHaveDirection: false)),
if (F.isLite == false && widget.showAbout)
CommonItem(
leftTitel:
TranslationLoader.lanKeys!.valueAddedServices!.tr,
isHaveLine: true,
isHaveDirection: true,
action: () {
Get.back();
Get.toNamed(Routers.valueAddedServicesPage);
},
),
if (widget.showAbout)
CommonItem(
leftTitel: TranslationLoader.lanKeys!.set!.tr,
isHaveLine: true,
isHaveDirection: true,
action: () {
Get.back();
Get.toNamed(Routers.mineSetPage);
},
),
if (widget.showAbout)
CommonItem(
leftTitel: TranslationLoader.lanKeys!.about!.tr,
isHaveLine: false,
isHaveDirection: true,
action: () {
Get.back();
Get.toNamed(Routers.aboutPage);
},
),
], ],
), ),
), ),
@ -261,7 +185,7 @@ class _MinePersonInfoPageState extends State<MinePersonInfoPage> {
builder: (BuildContext context) { builder: (BuildContext context) {
return AlertBottomWidget( return AlertBottomWidget(
topTitle: '', topTitle: '',
items: const ['拍照', '从相册选择'], items: const <String>['拍照', '从相册选择'],
chooseCallback: logic.chooseCallback, chooseCallback: logic.chooseCallback,
); );
}); });

View File

@ -8,6 +8,7 @@ import 'package:get/get.dart';
import 'package:permission_handler/permission_handler.dart'; import 'package:permission_handler/permission_handler.dart';
import 'package:star_lock/flavors.dart'; import 'package:star_lock/flavors.dart';
import 'package:star_lock/mine/mineSet/mineSet/mineSet_logic.dart'; import 'package:star_lock/mine/mineSet/mineSet/mineSet_logic.dart';
import 'package:star_lock/mine/mineSet/mineSet/mineSet_state.dart';
import 'package:star_lock/tools/appFirstEnterHandle.dart'; import 'package:star_lock/tools/appFirstEnterHandle.dart';
import '../../../appRouters.dart'; import '../../../appRouters.dart';
import '../../../app_settings/app_colors.dart'; import '../../../app_settings/app_colors.dart';
@ -18,15 +19,18 @@ import '../../../tools/titleAppBar.dart';
import '../../../translations/trans_lib.dart'; import '../../../translations/trans_lib.dart';
class MineSetPage extends StatefulWidget { class MineSetPage extends StatefulWidget {
const MineSetPage({Key? key}) : super(key: key); MineSetPage({Key? key, this.showAppBar = true, this.showAbout = false})
: super(key: key);
bool showAppBar;
bool showAbout;
@override @override
State<MineSetPage> createState() => _MineSetPageState(); State<MineSetPage> createState() => _MineSetPageState();
} }
class _MineSetPageState extends State<MineSetPage> with WidgetsBindingObserver { class _MineSetPageState extends State<MineSetPage> with WidgetsBindingObserver {
final logic = Get.put(MineSetLogic()); final MineSetLogic logic = Get.put(MineSetLogic());
final state = Get.find<MineSetLogic>().state; final MineSetState state = Get.find<MineSetLogic>().state;
@override @override
void initState() { void initState() {
@ -53,19 +57,21 @@ class _MineSetPageState extends State<MineSetPage> with WidgetsBindingObserver {
return Scaffold( return Scaffold(
backgroundColor: AppColors.mainBackgroundColor, backgroundColor: AppColors.mainBackgroundColor,
appBar: F.sw( appBar: widget.showAppBar
skyCall: () => TitleAppBar( ? F.sw(
barTitle: TranslationLoader.lanKeys!.moreSet!.tr, skyCall: () => TitleAppBar(
haveBack: true, barTitle: TranslationLoader.lanKeys!.moreSet!.tr,
backgroundColor: AppColors.mainColor, haveBack: true,
), backgroundColor: AppColors.mainColor,
xhjCall: () => TitleAppBar( ),
barTitle: TranslationLoader.lanKeys!.moreSet!.tr, xhjCall: () => TitleAppBar(
haveBack: true, barTitle: TranslationLoader.lanKeys!.moreSet!.tr,
backgroundColor: Colors.white, haveBack: true,
iconColor: AppColors.blackColor, backgroundColor: Colors.white,
titleColor: AppColors.blackColor, iconColor: AppColors.blackColor,
)), titleColor: AppColors.blackColor,
))
: null,
body: SingleChildScrollView( body: SingleChildScrollView(
child: styleHierarchy(), child: styleHierarchy(),
), ),
@ -77,23 +83,72 @@ class _MineSetPageState extends State<MineSetPage> with WidgetsBindingObserver {
Widget view = getListDataView(); Widget view = getListDataView();
view = F.sw( view = F.sw(
skyCall: () => view, skyCall: () => view,
xhjCall: () => Container( xhjCall: () => Column(
margin: EdgeInsets.only( children: <Widget>[
top: 20.h, left: 20.w, right: 20.w, bottom: 40.h), Container(
decoration: BoxDecoration( width: 1.sw,
color: Colors.white, height: 0.2.sw,
borderRadius: BorderRadius.all(Radius.circular(20.r))), margin: EdgeInsets.only(
child: ClipRRect( top: 15.h, left: 20.w, right: 20.w, bottom: 20.h),
borderRadius: BorderRadius.circular(20.r), padding: EdgeInsets.symmetric(horizontal: 25.w),
child: view, decoration: BoxDecoration(
), image: const DecorationImage(
image: AssetImage('images/xhj_main_bg.jpg'),
fit: BoxFit.cover,
),
borderRadius: BorderRadius.circular(20.r),
boxShadow: <BoxShadow>[
BoxShadow(
color: Colors.black.withOpacity(0.15),
offset: const Offset(0, 0),
blurRadius: 10.r,
spreadRadius: 0,
),
],
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text(
'系统设置'.tr,
style: TextStyle(
color: AppColors.blackColor,
fontSize: 28.sp,
fontWeight: FontWeight.w600,
),
),
Text(
'系统的全局配置在此项内进行设置'.tr,
style: TextStyle(
color: AppColors.blackColor.withOpacity(0.6),
fontSize: 20.sp,
fontWeight: FontWeight.w600,
),
),
],
),
),
Container(
margin: EdgeInsets.only(
top: 20.h, left: 20.w, right: 20.w, bottom: 40.h),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(20.r))),
child: ClipRRect(
borderRadius: BorderRadius.circular(20.r),
child: view,
),
),
F.sw(skyCall: () => const SizedBox(), xhjCall: keyBottomWidget),
],
)); ));
return view; return view;
} }
Widget getListDataView() { Widget getListDataView() {
return Column( return Column(
children: [ children: <Widget>[
/* 2024-01-12 by DaisyWu /* 2024-01-12 by DaisyWu
CommonItem( CommonItem(
leftTitel: TranslationLoader.lanKeys!.prompTone!.tr, leftTitel: TranslationLoader.lanKeys!.prompTone!.tr,
@ -114,29 +169,42 @@ class _MineSetPageState extends State<MineSetPage> with WidgetsBindingObserver {
height: 50.h, height: 50.h,
child: Obx(() => _isTouchUnlockSwitch()))), child: Obx(() => _isTouchUnlockSwitch()))),
*/ */
F.sw(
skyCall: () => const SizedBox(),
xhjCall: () => CommonItem(
leftTitel: TranslationLoader.lanKeys!.personalInformation!.tr,
rightTitle: '',
isHaveLine: true,
isHaveDirection: true,
action: () {
Get.toNamed(Routers.minePersonInfoPage);
})),
CommonItem( CommonItem(
leftTitel: TranslationLoader.lanKeys!.pushNotification!.tr, leftTitel: TranslationLoader.lanKeys!.pushNotification!.tr,
rightTitle: "", rightTitle: '',
isHaveRightWidget: true, isHaveRightWidget: true,
isHaveLine: F.appFlavor == Flavor.sky ? true : false, isHaveLine: F.sw(
skyCall: () => F.appFlavor == Flavor.sky, xhjCall: () => true),
rightWidget: SizedBox( rightWidget: SizedBox(
width: 60.w, width: 60.w,
height: 50.h, height: 50.h,
child: Obx(() => _isPushNotificationSwitch()))), child: Obx(_isPushNotificationSwitch))),
F.appFlavor == Flavor.sky if (F.appFlavor == Flavor.sky)
? CommonItem( CommonItem(
leftTitel: "微信公众号推送".tr, leftTitel: '微信公众号推送'.tr,
rightTitle: "", rightTitle: '',
isHaveRightWidget: true, isHaveLine: true,
rightWidget: SizedBox( isHaveRightWidget: true,
width: 60.w, rightWidget: SizedBox(
height: 50.h, width: 60.w,
child: Obx(() => _isWechatPublicAccountPushSwitch()))) height: 50.h,
: Container(), child: Obx(_isWechatPublicAccountPushSwitch)))
else
Container(),
SizedBox(height: 10.h), SizedBox(height: 10.h),
CommonItem( CommonItem(
leftTitel: TranslationLoader.lanKeys!.lockUserManagement!.tr, leftTitel: TranslationLoader.lanKeys!.lockUserManagement!.tr,
rightTitle: "", rightTitle: '',
isHaveLine: true, isHaveLine: true,
isHaveDirection: true, isHaveDirection: true,
action: () { action: () {
@ -144,7 +212,7 @@ class _MineSetPageState extends State<MineSetPage> with WidgetsBindingObserver {
}), }),
CommonItem( CommonItem(
leftTitel: TranslationLoader.lanKeys!.authorizedAdmin!.tr, leftTitel: TranslationLoader.lanKeys!.authorizedAdmin!.tr,
rightTitle: "", rightTitle: '',
isHaveLine: true, isHaveLine: true,
isHaveDirection: true, isHaveDirection: true,
action: () { action: () {
@ -153,7 +221,7 @@ class _MineSetPageState extends State<MineSetPage> with WidgetsBindingObserver {
//by DaisyWu -- //by DaisyWu --
CommonItem( CommonItem(
leftTitel: TranslationLoader.lanKeys!.authorityManagement!.tr, leftTitel: TranslationLoader.lanKeys!.authorityManagement!.tr,
rightTitle: "", rightTitle: '',
isHaveLine: true, isHaveLine: true,
isHaveDirection: true, isHaveDirection: true,
action: () { action: () {
@ -162,7 +230,7 @@ class _MineSetPageState extends State<MineSetPage> with WidgetsBindingObserver {
}), }),
CommonItem( CommonItem(
leftTitel: TranslationLoader.lanKeys!.lockGroup!.tr, leftTitel: TranslationLoader.lanKeys!.lockGroup!.tr,
rightTitle: "", rightTitle: '',
isHaveLine: true, isHaveLine: true,
isHaveDirection: true, isHaveDirection: true,
action: () { action: () {
@ -170,7 +238,7 @@ class _MineSetPageState extends State<MineSetPage> with WidgetsBindingObserver {
}), }),
CommonItem( CommonItem(
leftTitel: TranslationLoader.lanKeys!.transferSmartLock!.tr, leftTitel: TranslationLoader.lanKeys!.transferSmartLock!.tr,
rightTitle: "", rightTitle: '',
isHaveLine: true, isHaveLine: true,
isHaveDirection: true, isHaveDirection: true,
action: () { action: () {
@ -178,7 +246,8 @@ class _MineSetPageState extends State<MineSetPage> with WidgetsBindingObserver {
}), }),
CommonItem( CommonItem(
leftTitel: TranslationLoader.lanKeys!.transferGateway!.tr, leftTitel: TranslationLoader.lanKeys!.transferGateway!.tr,
rightTitle: "", rightTitle: '',
isHaveLine: true,
isHaveDirection: true, isHaveDirection: true,
action: () { action: () {
Get.toNamed(Routers.selectGetewayListPage); Get.toNamed(Routers.selectGetewayListPage);
@ -224,16 +293,17 @@ class _MineSetPageState extends State<MineSetPage> with WidgetsBindingObserver {
isHaveDirection: true, isHaveDirection: true,
action: () { action: () {
Navigator.pushNamed( Navigator.pushNamed(
context, Routers.hideInvalidUnlockPermissionsPage, context, Routers.hideInvalidUnlockPermissionsPage,
arguments: {'isOn': state.hideExpiredAccessFlag.value}) arguments: <String, int>{
.then((value) { 'isOn': state.hideExpiredAccessFlag.value
}).then((Object? value) {
logic.userSettingsInfoRequest(); logic.userSettingsInfoRequest();
}); });
})), })),
CommonItem( CommonItem(
leftTitel: TranslationLoader leftTitel: TranslationLoader
.lanKeys!.appUnlockRequiresMobilePhoneAccessToTheLock!.tr, .lanKeys!.appUnlockRequiresMobilePhoneAccessToTheLock!.tr,
rightTitle: "", rightTitle: '',
// allHeight: 100.h, // allHeight: 100.h,
isHaveLine: true, isHaveLine: true,
isHaveDirection: true, isHaveDirection: true,
@ -245,41 +315,58 @@ class _MineSetPageState extends State<MineSetPage> with WidgetsBindingObserver {
height: 10.h, height: 10.h,
), ),
// //
F.isLite if (!F.isLite)
? Container() CommonItem(
: CommonItem( leftTitel: 'Amazon Alexa',
leftTitel: "Amazon Alexa", rightTitle: '',
rightTitle: "", isHaveLine: true,
isHaveLine: true, isHaveDirection: true,
isHaveDirection: true, action: () {
action: () { logic.showToast('功能暂未开放'.tr);
logic.showToast("功能暂未开放".tr); }),
}), if (!F.isLite)
F.isLite CommonItem(
? Container() leftTitel: 'Google Home',
: CommonItem( rightTitle: '',
leftTitel: "Google Home", isHaveLine: true,
rightTitle: "", isHaveDirection: true,
isHaveLine: true, action: () {
isHaveDirection: true, logic.showToast('功能暂未开放'.tr);
action: () { }),
logic.showToast("功能暂未开放".tr); if (!F.isLite)
}), CommonItem(
F.isLite leftTitel: TranslationLoader.lanKeys!.xiaomiIOTPlatform!.tr,
? Container() rightTitle: '',
: CommonItem( isHaveLine: widget.showAbout,
leftTitel: TranslationLoader.lanKeys!.xiaomiIOTPlatform!.tr, isHaveDirection: true,
rightTitle: "", action: () {
isHaveLine: false, logic.showToast('功能暂未开放'.tr);
isHaveDirection: true, }),
action: () { if (!F.isLite && widget.showAbout)
logic.showToast("功能暂未开放".tr); CommonItem(
}), leftTitel: TranslationLoader.lanKeys!.valueAddedServices!.tr,
isHaveLine: true,
isHaveDirection: true,
action: () {
Get.back();
Get.toNamed(Routers.valueAddedServicesPage);
},
),
if (widget.showAbout)
CommonItem(
leftTitel: TranslationLoader.lanKeys!.about!.tr,
isHaveLine: false,
isHaveDirection: true,
action: () {
Get.back();
Get.toNamed(Routers.aboutPage);
},
),
// CommonItem(leftTitel:TranslationLoader.lanKeys!.valueAddedServices!.tr, rightTitle:"", isHaveDirection: true, action: (){ // CommonItem(leftTitel:TranslationLoader.lanKeys!.valueAddedServices!.tr, rightTitle:"", isHaveDirection: true, action: (){
// //
// }), // }),
SizedBox( SizedBox(
height: 50.h, height: F.sw(skyCall: () => 50.h, xhjCall: () => 0.0),
), ),
// CommonItem(leftTitel:TranslationLoader.lanKeys!.about!.tr, rightTitle:"", isHaveLine: true, isHaveDirection: true, action: (){ // CommonItem(leftTitel:TranslationLoader.lanKeys!.about!.tr, rightTitle:"", isHaveLine: true, isHaveDirection: true, action: (){
// //
@ -300,52 +387,56 @@ class _MineSetPageState extends State<MineSetPage> with WidgetsBindingObserver {
// CommonItem(leftTitel:TranslationLoader.lanKeys!.thirdPartyInformationSharingList!.tr, rightTitle:"", isHaveLine: true, isHaveDirection: true, action: (){ // CommonItem(leftTitel:TranslationLoader.lanKeys!.thirdPartyInformationSharingList!.tr, rightTitle:"", isHaveLine: true, isHaveDirection: true, action: (){
// //
// }), // }),
keyBottomWidget() F.sw(skyCall: keyBottomWidget, xhjCall: () => const SizedBox())
], ],
); );
} }
Widget keyBottomWidget() { Widget keyBottomWidget() {
return Column( return Padding(
children: [ padding: F.sw(
SubmitBtn( skyCall: () => EdgeInsets.zero,
btnName: TranslationLoader.lanKeys!.logout!.tr, xhjCall: () => EdgeInsets.symmetric(horizontal: 15.w)),
isDelete: true, child: Column(
padding: EdgeInsets.symmetric(horizontal: 15.w), children: <Widget>[
onClick: () { SubmitBtn(
//退 btnName: TranslationLoader.lanKeys!.logout!.tr,
ShowTipView().showIosTipWithContentDialog("确定要退出吗?".tr, () { isDelete: true,
logic.userLogoutRequest(); padding: EdgeInsets.symmetric(horizontal: 15.w),
}); onClick: () {
// showLoginOutAlertTipDialog(); //退
}), ShowTipView().showIosTipWithContentDialog(
Container( '确定要退出吗?'.tr, logic.userLogoutRequest);
padding: EdgeInsets.only(right: 30.w, top: 30.h), // showLoginOutAlertTipDialog();
// color: Colors.red, }),
child: Row( Container(
mainAxisAlignment: MainAxisAlignment.end, padding: EdgeInsets.only(right: 30.w, top: 30.h),
children: [ // color: Colors.red,
TextButton( child: Row(
child: Text( mainAxisAlignment: MainAxisAlignment.end,
TranslationLoader.lanKeys!.deleteAccount!.tr, children: <Widget>[
style: TextStyle( TextButton(
color: AppColors.darkGrayTextColor, fontSize: 18.sp), child: Text(
TranslationLoader.lanKeys!.deleteAccount!.tr,
style: TextStyle(
color: AppColors.darkGrayTextColor, fontSize: 18.sp),
),
onPressed: () {
ShowTipView().showIosTipWithContentDialog(
TranslationLoader.lanKeys!.deleteAccountTips!.tr, () {
//
Get.toNamed(Routers.safeVerifyPage);
});
},
), ),
onPressed: () { ],
ShowTipView().showIosTipWithContentDialog( ),
TranslationLoader.lanKeys!.deleteAccountTips!.tr, () {
//
Get.toNamed(Routers.safeVerifyPage);
});
},
),
],
), ),
), SizedBox(
SizedBox( height: 30.h,
height: 30.h, )
) ],
], ),
); );
} }
@ -411,7 +502,7 @@ class _MineSetPageState extends State<MineSetPage> with WidgetsBindingObserver {
trackColor: CupertinoColors.systemGrey5, trackColor: CupertinoColors.systemGrey5,
thumbColor: CupertinoColors.white, thumbColor: CupertinoColors.white,
value: state.isPrompTone.value, value: state.isPrompTone.value,
onChanged: (value) { onChanged: (bool value) {
state.isPrompTone.value = !state.isPrompTone.value; state.isPrompTone.value = !state.isPrompTone.value;
logic.updatePrompToneRequest(); logic.updatePrompToneRequest();
}, },
@ -424,7 +515,7 @@ class _MineSetPageState extends State<MineSetPage> with WidgetsBindingObserver {
trackColor: CupertinoColors.systemGrey5, trackColor: CupertinoColors.systemGrey5,
thumbColor: CupertinoColors.white, thumbColor: CupertinoColors.white,
value: state.isTouchUnlock.value, value: state.isTouchUnlock.value,
onChanged: (value) { onChanged: (bool value) {
state.isTouchUnlock.value = !state.isTouchUnlock.value; state.isTouchUnlock.value = !state.isTouchUnlock.value;
logic.updateTouchUnlockRequest(); logic.updateTouchUnlockRequest();
}, },
@ -438,7 +529,7 @@ class _MineSetPageState extends State<MineSetPage> with WidgetsBindingObserver {
trackColor: CupertinoColors.systemGrey5, trackColor: CupertinoColors.systemGrey5,
thumbColor: CupertinoColors.white, thumbColor: CupertinoColors.white,
value: state.isWechatPublicAccountPush.value, value: state.isWechatPublicAccountPush.value,
onChanged: (value) { onChanged: (bool value) {
state.isWechatPublicAccountPush.value = state.isWechatPublicAccountPush.value =
!state.isWechatPublicAccountPush.value; !state.isWechatPublicAccountPush.value;
logic.setMpWechatPushSwitchRequest(context); logic.setMpWechatPushSwitchRequest(context);
@ -452,7 +543,7 @@ class _MineSetPageState extends State<MineSetPage> with WidgetsBindingObserver {
trackColor: CupertinoColors.systemGrey5, trackColor: CupertinoColors.systemGrey5,
thumbColor: CupertinoColors.white, thumbColor: CupertinoColors.white,
value: state.isPushNotification.value, value: state.isPushNotification.value,
onChanged: (value) { onChanged: (bool value) {
// state.isPushNotification.value = !state.isPushNotification.value; // state.isPushNotification.value = !state.isPushNotification.value;
openAppSettings(); openAppSettings();
}, },

View File

@ -26,7 +26,7 @@ class BaseProvider extends GetConnect with Api {
Future<Response<T>> post<T>( Future<Response<T>> post<T>(
String? url, String? url,
body, { body, {
String? contentType = "application/json", String? contentType = 'application/json',
Map<String, String>? headers, Map<String, String>? headers,
Map<String, dynamic>? query, Map<String, dynamic>? query,
Decoder<T>? decoder, Decoder<T>? decoder,
@ -35,7 +35,7 @@ class BaseProvider extends GetConnect with Api {
bool? isUnShowLoading = false, // loading bool? isUnShowLoading = false, // loading
bool? isUserBaseUrl = true, // 使baseUrl bool? isUserBaseUrl = true, // 使baseUrl
}) async { }) async {
AppLog.log("post: url:$url body:$body"); AppLog.log('post: url:$url body:$body');
if (isUnShowLoading == false){ if (isUnShowLoading == false){
EasyLoading.show(); EasyLoading.show();
} }
@ -55,14 +55,14 @@ class BaseProvider extends GetConnect with Api {
// EasyLoading.showToast("Network Error!", duration: 2000.milliseconds); // EasyLoading.showToast("Network Error!", duration: 2000.milliseconds);
if (res.statusCode == null) { if (res.statusCode == null) {
EasyLoading.showToast("网络访问失败,请检查网络是否正常".tr, duration: 2000.milliseconds); EasyLoading.showToast('网络访问失败,请检查网络是否正常'.tr, duration: 2000.milliseconds);
// EasyLoading.showToast("Network Error!", duration: 2000.milliseconds); // EasyLoading.showToast("Network Error!", duration: 2000.milliseconds);
} }
var rs = { var rs = {
"errorMsg": "Network Error!", 'errorMsg': 'Network Error!',
"errorCode": -1, 'errorCode': -1,
"data": null, 'data': null,
"description": "表示成功或是。" 'description': '表示成功或是。'
}; };
return Response( return Response(
request: res.request, request: res.request,
@ -78,24 +78,24 @@ class BaseProvider extends GetConnect with Api {
} }
getDataResult(T) { getDataResult(T) {
switch (T["errorCode"]) { switch (T['errorCode']) {
case 403: case 403:
Get.offNamedUntil(Routers.starLockLoginPage, (route) => false); Get.offNamedUntil(Routers.starLockLoginPage, (route) => false);
break; break;
case 500: case 500:
EasyLoading.showToast("服务器错误", duration: 2000.milliseconds); EasyLoading.showToast('服务器错误', duration: 2000.milliseconds);
break; break;
case 421: case 421:
case 422: case 422:
case 430: //ErrorMsg case 430: //ErrorMsg
EasyLoading.showToast(T["errorMsg"], duration: 2000.milliseconds); EasyLoading.showToast(T['errorMsg'], duration: 2000.milliseconds);
break; break;
// //
// case 425: // case 425:
// Toast.show(msg: "用户不存在"); // Toast.show(msg: "用户不存在");
// break; // break;
case 10001: case 10001:
EasyLoading.showToast("数据不存在", duration: 2000.milliseconds); EasyLoading.showToast('数据不存在', duration: 2000.milliseconds);
break; break;
} }
} }