Merge branch 'master_hyx'
This commit is contained in:
commit
912475dab5
@ -109,8 +109,8 @@ class F {
|
|||||||
case Flavor.sky:
|
case Flavor.sky:
|
||||||
return 'https://lock.skychip.top';
|
return 'https://lock.skychip.top';
|
||||||
case Flavor.xhj:
|
case Flavor.xhj:
|
||||||
// return 'https://lock.xhjcn.ltd';
|
return 'https://lock.xhjcn.ltd';
|
||||||
return 'https://pre.lock.star-lock.cn';
|
// return 'https://pre.lock.star-lock.cn';
|
||||||
default:
|
default:
|
||||||
throw Exception('flavor[$name] apiPrefix not found');
|
throw Exception('flavor[$name] apiPrefix not found');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -99,7 +99,7 @@ class _LockListXHJPageState extends State<LockListXHJPage> with RouteAware {
|
|||||||
child: GridView.extent(
|
child: GridView.extent(
|
||||||
padding: EdgeInsets.symmetric(vertical: 15.h, horizontal: 15.w),
|
padding: EdgeInsets.symmetric(vertical: 15.h, horizontal: 15.w),
|
||||||
maxCrossAxisExtent: Get.width * .6,
|
maxCrossAxisExtent: Get.width * .6,
|
||||||
childAspectRatio: 1.4,
|
childAspectRatio: 1.2,
|
||||||
crossAxisSpacing: 15.w,
|
crossAxisSpacing: 15.w,
|
||||||
mainAxisSpacing: 15.h,
|
mainAxisSpacing: 15.h,
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
@ -185,9 +185,10 @@ class _LockListXHJPageState extends State<LockListXHJPage> with RouteAware {
|
|||||||
borderRadius: BorderRadius.circular(20.w),
|
borderRadius: BorderRadius.circular(20.w),
|
||||||
),
|
),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 30.w, vertical: 20.h),
|
padding: EdgeInsets.symmetric(horizontal: 30.w, vertical: 10.h),
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
@ -197,13 +198,6 @@ class _LockListXHJPageState extends State<LockListXHJPage> with RouteAware {
|
|||||||
height: 32.r,
|
height: 32.r,
|
||||||
color: AppColors.mainColor,
|
color: AppColors.mainColor,
|
||||||
),
|
),
|
||||||
Spacer(),
|
|
||||||
Text(
|
|
||||||
logic.getUseKeyTypeStr(
|
|
||||||
keyInfo.startDate, keyInfo.endDate, keyInfo.keyType),
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 18.sp, color: AppColors.darkGrayTextColor),
|
|
||||||
)
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
@ -313,6 +307,13 @@ class _LockListXHJPageState extends State<LockListXHJPage> with RouteAware {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
Text(
|
||||||
|
Characters(logic.getUseKeyTypeStr(
|
||||||
|
keyInfo.startDate, keyInfo.endDate, keyInfo.keyType))
|
||||||
|
.join('\u{200B}'),
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 18.sp, color: AppColors.darkGrayTextColor),
|
||||||
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@ -56,7 +56,7 @@ class _StarLockMainXHJPageState extends State<StarLockMainXHJPage>
|
|||||||
widget: SafeArea(
|
widget: SafeArea(
|
||||||
bottom: false,
|
bottom: false,
|
||||||
child: LockMallPage(
|
child: LockMallPage(
|
||||||
showAppBar: false,
|
allowReturn: false,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
logic: logic,
|
logic: logic,
|
||||||
|
|||||||
@ -17,7 +17,7 @@ class LockMallLogic extends BaseGetXController {
|
|||||||
late LockMallState state;
|
late LockMallState state;
|
||||||
|
|
||||||
LockMallLogic({required bool allowReturn})
|
LockMallLogic({required bool allowReturn})
|
||||||
: state = LockMallState(allowReturn: allowReturn);
|
: state = LockMallState(allowReturn: allowReturn );
|
||||||
|
|
||||||
//获取商城跳转地址
|
//获取商城跳转地址
|
||||||
Future<void> getMallURLRequest() async {
|
Future<void> getMallURLRequest() async {
|
||||||
@ -35,6 +35,7 @@ class LockMallLogic extends BaseGetXController {
|
|||||||
},
|
},
|
||||||
onPageFinished: (String url) {
|
onPageFinished: (String url) {
|
||||||
state.webProgress.value = 1.0;
|
state.webProgress.value = 1.0;
|
||||||
|
refreshGoBack();
|
||||||
},
|
},
|
||||||
onWebResourceError: (WebResourceError error) {},
|
onWebResourceError: (WebResourceError error) {},
|
||||||
onNavigationRequest: (NavigationRequest request) async {
|
onNavigationRequest: (NavigationRequest request) async {
|
||||||
@ -99,12 +100,25 @@ class LockMallLogic extends BaseGetXController {
|
|||||||
bool canGoBack = await state.mallWebView.canGoBack();
|
bool canGoBack = await state.mallWebView.canGoBack();
|
||||||
if (canGoBack) {
|
if (canGoBack) {
|
||||||
await state.mallWebView.goBack();
|
await state.mallWebView.goBack();
|
||||||
} else {
|
} else if (state.allowReturn) {
|
||||||
if (state.allowReturn) Get.back();
|
Get.back();
|
||||||
}
|
}
|
||||||
|
refreshGoBack();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//刷新当前路由状态
|
||||||
|
void refreshGoBack(){
|
||||||
|
//如果属于一直返回按钮,则根据是否有路由可以回退刷新
|
||||||
|
if(state.allowReturn){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
state.mallWebView.canGoBack().then((value) {
|
||||||
|
state.canGoBack = value;
|
||||||
|
update();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<void> onReady() async {
|
Future<void> onReady() async {
|
||||||
super.onReady();
|
super.onReady();
|
||||||
|
|||||||
@ -2,6 +2,7 @@ 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';
|
||||||
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/mine/mall/lockMall_logic.dart';
|
import 'package:star_lock/mine/mall/lockMall_logic.dart';
|
||||||
import 'package:star_lock/tools/titleAppBar.dart';
|
import 'package:star_lock/tools/titleAppBar.dart';
|
||||||
import 'package:webview_flutter/webview_flutter.dart';
|
import 'package:webview_flutter/webview_flutter.dart';
|
||||||
@ -30,36 +31,46 @@ class _LockMallPageState extends State<LockMallPage> {
|
|||||||
return GetBuilder<LockMallLogic>(
|
return GetBuilder<LockMallLogic>(
|
||||||
init: LockMallLogic(allowReturn: widget.allowReturn),
|
init: LockMallLogic(allowReturn: widget.allowReturn),
|
||||||
builder: (LockMallLogic logic) {
|
builder: (LockMallLogic logic) {
|
||||||
return PopScope(
|
return Scaffold(
|
||||||
onPopInvoked: logic.canGoBack,
|
resizeToAvoidBottomInset: false,
|
||||||
canPop: false,
|
backgroundColor: const Color(0xFFFFFFFF),
|
||||||
child: Scaffold(
|
appBar: widget.showAppBar
|
||||||
resizeToAvoidBottomInset: false,
|
? TitleAppBar(
|
||||||
backgroundColor: const Color(0xFFFFFFFF),
|
barTitle: getWebTitle(logic),
|
||||||
appBar: widget.showAppBar
|
haveBack: logic.state.canGoBack || logic.state.allowReturn,
|
||||||
? TitleAppBar(
|
backgroundColor: F.sw(
|
||||||
barTitle: getWebTitle(logic),
|
defaultCall: () => AppColors.mainColor,
|
||||||
haveBack: true,
|
xhjCall: () => Colors.white),
|
||||||
backgroundColor: AppColors.mainColor,
|
titleColor: F.sw(
|
||||||
)
|
defaultCall: () => null,
|
||||||
: null,
|
xhjCall: () => AppColors.blackColor),
|
||||||
body: Obx(() => Column(
|
iconColor: F.sw(
|
||||||
children: <Widget>[
|
defaultCall: () => null,
|
||||||
Container(
|
xhjCall: () => AppColors.blackColor),
|
||||||
padding: EdgeInsets.only(bottom: 10.w),
|
backAction: () => logic.canGoBack(false),
|
||||||
child: LinearProgressIndicator(
|
)
|
||||||
value: logic.state.webProgress.value,
|
: null,
|
||||||
backgroundColor: Colors.grey,
|
body: Obx(() => Column(
|
||||||
valueColor: AlwaysStoppedAnimation<Color>(
|
children: <Widget>[
|
||||||
AppColors.mainColor),
|
PopScope(
|
||||||
),
|
onPopInvoked: logic.canGoBack,
|
||||||
),
|
canPop: false,
|
||||||
Expanded(
|
child: SizedBox(),
|
||||||
child: WebViewWidget(
|
),
|
||||||
controller: logic.state.mallWebView),
|
Container(
|
||||||
),
|
padding: EdgeInsets.only(bottom: 10.w),
|
||||||
],
|
child: LinearProgressIndicator(
|
||||||
))),
|
value: logic.state.webProgress.value,
|
||||||
|
backgroundColor: Colors.grey,
|
||||||
|
valueColor:
|
||||||
|
AlwaysStoppedAnimation<Color>(AppColors.mainColor),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: WebViewWidget(controller: logic.state.mallWebView),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,6 +9,7 @@ class LockMallState {
|
|||||||
var lockMallUrl = "".obs;
|
var lockMallUrl = "".obs;
|
||||||
var webProgress = 0.0.obs;
|
var webProgress = 0.0.obs;
|
||||||
bool allowReturn;
|
bool allowReturn;
|
||||||
|
bool canGoBack = false;
|
||||||
late WebViewController mallWebView = initWebViewController();
|
late WebViewController mallWebView = initWebViewController();
|
||||||
|
|
||||||
//初始化webView控制器
|
//初始化webView控制器
|
||||||
|
|||||||
@ -39,174 +39,215 @@ class _MinePersonInfoPageState extends State<MinePersonInfoPage> {
|
|||||||
: null,
|
: null,
|
||||||
body: Column(
|
body: Column(
|
||||||
children: [
|
children: [
|
||||||
Obx(() => CommonItem(
|
Container(
|
||||||
leftTitel: TranslationLoader.lanKeys!.avatar!.tr,
|
width: 1.sw,
|
||||||
rightTitle: "",
|
height: 0.2.sw,
|
||||||
allHeight: 100.h,
|
margin: EdgeInsets.symmetric(horizontal: 15.w),
|
||||||
isHaveLine: true,
|
padding: EdgeInsets.symmetric(horizontal: 25.w),
|
||||||
isHaveDirection: true,
|
decoration: BoxDecoration(
|
||||||
isHaveRightWidget: true,
|
image: const DecorationImage(
|
||||||
rightWidget: ClipRRect(
|
image: AssetImage('images/xhj_main_bg.jpg'),
|
||||||
borderRadius: BorderRadius.circular(36.w),
|
fit: BoxFit.cover,
|
||||||
child: CustomNetworkImage(
|
),
|
||||||
url: state.headUrl.value,
|
borderRadius: BorderRadius.circular(20.r),
|
||||||
defaultUrl: 'images/controls_user.png',
|
boxShadow: [
|
||||||
width: 72.w,
|
BoxShadow(
|
||||||
height: 72.w),
|
color: Colors.black.withOpacity(0.15),
|
||||||
|
offset: const Offset(0, 0),
|
||||||
|
blurRadius: 10.r,
|
||||||
|
spreadRadius: 0,
|
||||||
),
|
),
|
||||||
action: () async {
|
],
|
||||||
_openModalBottomSheet();
|
|
||||||
},
|
|
||||||
)),
|
|
||||||
Obx(() => CommonItem(
|
|
||||||
leftTitel: TranslationLoader.lanKeys!.nickName!.tr,
|
|
||||||
rightTitle: state.mineInfoData.value.nickname != null
|
|
||||||
? state.mineInfoData.value.nickname!
|
|
||||||
: "",
|
|
||||||
isHaveLine: true,
|
|
||||||
isHaveDirection: true,
|
|
||||||
action: () {
|
|
||||||
Navigator.pushNamed(
|
|
||||||
context, Routers.minePersonInfoEditNamePage,
|
|
||||||
arguments: {'mineInfoData': state.mineInfoData.value})
|
|
||||||
.then((value) => logic.getUserInfoRequest());
|
|
||||||
})),
|
|
||||||
Obx(() => CommonItem(
|
|
||||||
leftTitel: TranslationLoader.lanKeys!.mobileNumber!.tr,
|
|
||||||
rightTitle: state.mineInfoData.value.mobile != null
|
|
||||||
? state.mineInfoData.value.mobile!
|
|
||||||
: TranslationLoader.lanKeys!.goBind!.tr,
|
|
||||||
isHaveLine: true,
|
|
||||||
isHaveDirection: true,
|
|
||||||
action: () {
|
|
||||||
//有手机号 则去修改手机号 否则去绑定新的手机号 isFrom:1 短信,2 邮箱
|
|
||||||
if (state.mineInfoData.value.mobile!.isNotEmpty) {
|
|
||||||
Navigator.pushNamed(
|
|
||||||
context, Routers.mineUnbindPhoneOrEmailPage,
|
|
||||||
arguments: {
|
|
||||||
'mobile': state.mineInfoData.value.mobile!,
|
|
||||||
'isFrom': '1'
|
|
||||||
}).then((value) => logic.getUserInfoRequest());
|
|
||||||
} else {
|
|
||||||
Navigator.pushNamed(
|
|
||||||
context, Routers.mineBindPhoneOrEmailPage, arguments: {
|
|
||||||
'mobile': state.mineInfoData.value.mobile!,
|
|
||||||
'isFrom': '1'
|
|
||||||
}).then((value) => logic.getUserInfoRequest());
|
|
||||||
}
|
|
||||||
})),
|
|
||||||
Obx(() => CommonItem(
|
|
||||||
leftTitel: TranslationLoader.lanKeys!.email!.tr,
|
|
||||||
rightTitle: state.mineInfoData.value.email != null
|
|
||||||
? state.mineInfoData.value.email!
|
|
||||||
: TranslationLoader.lanKeys!.goBind!.tr,
|
|
||||||
isHaveLine: true,
|
|
||||||
isHaveDirection: true,
|
|
||||||
action: () {
|
|
||||||
//有邮箱 则去修改邮箱 否则去绑定新的邮箱 isFrom:1 短信,2 邮箱
|
|
||||||
if (state.mineInfoData.value.email!.isNotEmpty) {
|
|
||||||
Navigator.pushNamed(
|
|
||||||
context, Routers.mineUnbindPhoneOrEmailPage,
|
|
||||||
arguments: {
|
|
||||||
'isFrom': '2',
|
|
||||||
'email': state.mineInfoData.value.email!
|
|
||||||
}).then((value) => logic.getUserInfoRequest());
|
|
||||||
} else {
|
|
||||||
Navigator.pushNamed(
|
|
||||||
context, Routers.mineBindPhoneOrEmailPage, arguments: {
|
|
||||||
'isFrom': '2',
|
|
||||||
'email': state.mineInfoData.value.email!
|
|
||||||
}).then((value) => logic.getUserInfoRequest());
|
|
||||||
}
|
|
||||||
})),
|
|
||||||
CommonItem(
|
|
||||||
leftTitel: TranslationLoader.lanKeys!.resetPasswords!.tr,
|
|
||||||
rightTitle: "",
|
|
||||||
isHaveLine: true,
|
|
||||||
isHaveDirection: true,
|
|
||||||
action: () {
|
|
||||||
Navigator.pushNamed(
|
|
||||||
context, Routers.minePersonInfoResetPasswordPage);
|
|
||||||
}),
|
|
||||||
Obx(() => CommonItem(
|
|
||||||
leftTitel: TranslationLoader.lanKeys!.safetyProblem!.tr,
|
|
||||||
rightTitle:
|
|
||||||
state.mineInfoData.value.haveSafeAnswer == 0 ? "去设置".tr : "",
|
|
||||||
isHaveLine: true,
|
|
||||||
isHaveDirection: true,
|
|
||||||
action: () {
|
|
||||||
if (state.mineInfoData.value.haveSafeAnswer == 0) {
|
|
||||||
Navigator.pushNamed(
|
|
||||||
context, Routers.minePersonInfoSetSafetyProblemPage)
|
|
||||||
.then((value) => logic.getUserInfoRequest());
|
|
||||||
} else {
|
|
||||||
Navigator.pushNamed(
|
|
||||||
context, Routers.minePersonInfoViewSafetyProblemPage);
|
|
||||||
}
|
|
||||||
})),
|
|
||||||
Obx(() => CommonItem(
|
|
||||||
leftTitel: TranslationLoader.lanKeys!.countryAndRegion!.tr,
|
|
||||||
rightTitle: state.mineInfoData.value.countryName != null
|
|
||||||
? state.mineInfoData.value.countryName!
|
|
||||||
: "",
|
|
||||||
isHaveLine: true,
|
|
||||||
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)
|
child: Column(
|
||||||
CommonItem(
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
leftTitel: TranslationLoader.lanKeys!.set!.tr,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
isHaveLine: true,
|
children: [
|
||||||
isHaveDirection: true,
|
Text(
|
||||||
action: () {
|
'系统设置',
|
||||||
Get.back();
|
style: TextStyle(
|
||||||
Get.toNamed(Routers.mineSetPage);
|
color: AppColors.blackColor,
|
||||||
},
|
fontSize: 28.sp,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'系统的全局配置在此项内进行设置',
|
||||||
|
style: TextStyle(
|
||||||
|
color: AppColors.blackColor.withOpacity(0.6),
|
||||||
|
fontSize: 20.sp,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
if (widget.showAbout)
|
),
|
||||||
CommonItem(
|
SizedBox(
|
||||||
leftTitel: TranslationLoader.lanKeys!.about!.tr,
|
height: 20.h,
|
||||||
isHaveLine: false,
|
),
|
||||||
isHaveDirection: true,
|
Container(
|
||||||
action: () {
|
margin: EdgeInsets.symmetric(vertical: 10.h, horizontal: 15.w),
|
||||||
Get.back();
|
child: ClipRRect(
|
||||||
Get.toNamed(Routers.aboutPage);
|
borderRadius: BorderRadius.circular(20.r),
|
||||||
},
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Obx(() => CommonItem(
|
||||||
|
leftTitel: TranslationLoader.lanKeys!.avatar!.tr,
|
||||||
|
rightTitle: "",
|
||||||
|
allHeight: 100.h,
|
||||||
|
isHaveLine: true,
|
||||||
|
isHaveDirection: true,
|
||||||
|
isHaveRightWidget: true,
|
||||||
|
rightWidget: ClipRRect(
|
||||||
|
borderRadius: BorderRadius.circular(36.w),
|
||||||
|
child: CustomNetworkImage(
|
||||||
|
url: state.headUrl.value,
|
||||||
|
defaultUrl: 'images/controls_user.png',
|
||||||
|
width: 72.w,
|
||||||
|
height: 72.w),
|
||||||
|
),
|
||||||
|
action: () async {
|
||||||
|
_openModalBottomSheet();
|
||||||
|
},
|
||||||
|
)),
|
||||||
|
Obx(() => CommonItem(
|
||||||
|
leftTitel: TranslationLoader.lanKeys!.nickName!.tr,
|
||||||
|
rightTitle: state.mineInfoData.value.nickname != null
|
||||||
|
? state.mineInfoData.value.nickname!
|
||||||
|
: "",
|
||||||
|
isHaveLine: true,
|
||||||
|
isHaveDirection: true,
|
||||||
|
action: () {
|
||||||
|
Navigator.pushNamed(
|
||||||
|
context, Routers.minePersonInfoEditNamePage,
|
||||||
|
arguments: {
|
||||||
|
'mineInfoData': state.mineInfoData.value
|
||||||
|
}).then((value) => logic.getUserInfoRequest());
|
||||||
|
})),
|
||||||
|
Obx(() => CommonItem(
|
||||||
|
leftTitel: TranslationLoader.lanKeys!.mobileNumber!.tr,
|
||||||
|
rightTitle: state.mineInfoData.value.mobile != null
|
||||||
|
? state.mineInfoData.value.mobile!
|
||||||
|
: TranslationLoader.lanKeys!.goBind!.tr,
|
||||||
|
isHaveLine: true,
|
||||||
|
isHaveDirection: true,
|
||||||
|
action: () {
|
||||||
|
//有手机号 则去修改手机号 否则去绑定新的手机号 isFrom:1 短信,2 邮箱
|
||||||
|
if (state.mineInfoData.value.mobile!.isNotEmpty) {
|
||||||
|
Navigator.pushNamed(
|
||||||
|
context, Routers.mineUnbindPhoneOrEmailPage,
|
||||||
|
arguments: {
|
||||||
|
'mobile': state.mineInfoData.value.mobile!,
|
||||||
|
'isFrom': '1'
|
||||||
|
}).then((value) => logic.getUserInfoRequest());
|
||||||
|
} else {
|
||||||
|
Navigator.pushNamed(
|
||||||
|
context, Routers.mineBindPhoneOrEmailPage,
|
||||||
|
arguments: {
|
||||||
|
'mobile': state.mineInfoData.value.mobile!,
|
||||||
|
'isFrom': '1'
|
||||||
|
}).then((value) => logic.getUserInfoRequest());
|
||||||
|
}
|
||||||
|
})),
|
||||||
|
Obx(() => CommonItem(
|
||||||
|
leftTitel: TranslationLoader.lanKeys!.email!.tr,
|
||||||
|
rightTitle: state.mineInfoData.value.email != null
|
||||||
|
? state.mineInfoData.value.email!
|
||||||
|
: TranslationLoader.lanKeys!.goBind!.tr,
|
||||||
|
isHaveLine: true,
|
||||||
|
isHaveDirection: true,
|
||||||
|
action: () {
|
||||||
|
//有邮箱 则去修改邮箱 否则去绑定新的邮箱 isFrom:1 短信,2 邮箱
|
||||||
|
if (state.mineInfoData.value.email!.isNotEmpty) {
|
||||||
|
Navigator.pushNamed(
|
||||||
|
context, Routers.mineUnbindPhoneOrEmailPage,
|
||||||
|
arguments: {
|
||||||
|
'isFrom': '2',
|
||||||
|
'email': state.mineInfoData.value.email!
|
||||||
|
}).then((value) => logic.getUserInfoRequest());
|
||||||
|
} else {
|
||||||
|
Navigator.pushNamed(
|
||||||
|
context, Routers.mineBindPhoneOrEmailPage,
|
||||||
|
arguments: {
|
||||||
|
'isFrom': '2',
|
||||||
|
'email': state.mineInfoData.value.email!
|
||||||
|
}).then((value) => logic.getUserInfoRequest());
|
||||||
|
}
|
||||||
|
})),
|
||||||
|
CommonItem(
|
||||||
|
leftTitel:
|
||||||
|
TranslationLoader.lanKeys!.resetPasswords!.tr,
|
||||||
|
rightTitle: "",
|
||||||
|
isHaveLine: true,
|
||||||
|
isHaveDirection: true,
|
||||||
|
action: () {
|
||||||
|
Navigator.pushNamed(
|
||||||
|
context, Routers.minePersonInfoResetPasswordPage);
|
||||||
|
}),
|
||||||
|
Obx(() => CommonItem(
|
||||||
|
leftTitel: TranslationLoader.lanKeys!.safetyProblem!.tr,
|
||||||
|
rightTitle: state.mineInfoData.value.haveSafeAnswer == 0
|
||||||
|
? "去设置".tr
|
||||||
|
: "",
|
||||||
|
isHaveLine: true,
|
||||||
|
isHaveDirection: true,
|
||||||
|
action: () {
|
||||||
|
if (state.mineInfoData.value.haveSafeAnswer == 0) {
|
||||||
|
Navigator.pushNamed(context,
|
||||||
|
Routers.minePersonInfoSetSafetyProblemPage)
|
||||||
|
.then((value) => logic.getUserInfoRequest());
|
||||||
|
} else {
|
||||||
|
Navigator.pushNamed(context,
|
||||||
|
Routers.minePersonInfoViewSafetyProblemPage);
|
||||||
|
}
|
||||||
|
})),
|
||||||
|
Obx(() => CommonItem(
|
||||||
|
leftTitel:
|
||||||
|
TranslationLoader.lanKeys!.countryAndRegion!.tr,
|
||||||
|
rightTitle: state.mineInfoData.value.countryName != null
|
||||||
|
? state.mineInfoData.value.countryName!
|
||||||
|
: "",
|
||||||
|
isHaveLine: true,
|
||||||
|
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);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
// 显示权限被永久拒绝的提示对话框
|
|
||||||
// void showPermissionDeniedDialog() {
|
|
||||||
// showDialog(
|
|
||||||
// context: context,
|
|
||||||
// builder: (BuildContext context) {
|
|
||||||
// return AlertDialog(
|
|
||||||
// title: const Text('权限被拒绝'),
|
|
||||||
// content: const Text('请手动在系统设置中开启相册权限以继续使用应用。'),
|
|
||||||
// actions: <Widget>[
|
|
||||||
// TextButton(
|
|
||||||
// child: const Text('去设置'),
|
|
||||||
// onPressed: () {
|
|
||||||
// Navigator.of(context).pop(); // 关闭对话框
|
|
||||||
// openAppSettings(); // 打开系统设置页面
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// );
|
|
||||||
// },
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
|
|
||||||
Future _openModalBottomSheet() async {
|
Future _openModalBottomSheet() async {
|
||||||
showModalBottomSheet(
|
showModalBottomSheet(
|
||||||
context: context,
|
context: context,
|
||||||
|
|||||||
@ -83,7 +83,7 @@ class CommonItem extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
isHaveDirection! ? SizedBox(width: 3.w) : Container(),
|
isHaveDirection! ? SizedBox(width: 15.w) : Container(),
|
||||||
isHaveDirection!
|
isHaveDirection!
|
||||||
? Image.asset(
|
? Image.asset(
|
||||||
'images/icon_right_grey.png',
|
'images/icon_right_grey.png',
|
||||||
|
|||||||
@ -40,8 +40,6 @@ class TitleAppBar extends AppBar {
|
|||||||
class _TitleAppBarState extends State<TitleAppBar> {
|
class _TitleAppBarState extends State<TitleAppBar> {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
Color defaultColor = F.sw(
|
|
||||||
defaultCall: () => Colors.white, xhjCall: () => AppColors.blackColor);
|
|
||||||
return AppBar(
|
return AppBar(
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
leading: widget.haveOtherLeftWidget!
|
leading: widget.haveOtherLeftWidget!
|
||||||
@ -49,7 +47,7 @@ class _TitleAppBarState extends State<TitleAppBar> {
|
|||||||
: (widget.haveBack ?? false
|
: (widget.haveBack ?? false
|
||||||
? IconButton(
|
? IconButton(
|
||||||
icon: Icon(Icons.arrow_back_ios,
|
icon: Icon(Icons.arrow_back_ios,
|
||||||
color: widget.iconColor ?? defaultColor),
|
color: widget.iconColor ?? Colors.white),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
if (widget.backAction != null) {
|
if (widget.backAction != null) {
|
||||||
widget.backAction!();
|
widget.backAction!();
|
||||||
@ -61,14 +59,12 @@ class _TitleAppBarState extends State<TitleAppBar> {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
: Container()),
|
: Container()),
|
||||||
backgroundColor: F.sw(
|
backgroundColor: widget.backgroundColor ?? Colors.white,
|
||||||
defaultCall: () => widget.backgroundColor ?? defaultColor,
|
|
||||||
xhjCall: () => Colors.white),
|
|
||||||
title: widget.haveTitleWidget!
|
title: widget.haveTitleWidget!
|
||||||
? widget.titleWidget
|
? widget.titleWidget
|
||||||
: Text(widget.barTitle ?? '',
|
: Text(widget.barTitle ?? '',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: widget.titleColor ?? defaultColor,
|
color: widget.titleColor ?? Colors.white,
|
||||||
fontSize: 28.sp,
|
fontSize: 28.sp,
|
||||||
fontWeight: FontWeight.w600)),
|
fontWeight: FontWeight.w600)),
|
||||||
centerTitle: true,
|
centerTitle: true,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user