Merge branch 'master' of https://gitee.com/starlock-cn/app-starlock
This commit is contained in:
commit
a6ccd4d7f7
BIN
star_lock/images/icon_login_email.png
Normal file
BIN
star_lock/images/icon_login_email.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.5 KiB |
@ -316,7 +316,7 @@ SPEC CHECKSUMS:
|
||||
flutter_native_contact_picker: bd430ba0fbf82768bb50c2c52a69a65759a8f907
|
||||
flutter_pcm_sound: de0572ca4f99091cc2abfcc31601b8a4ddd33c0e
|
||||
flutter_voice_processor: 2b89b93d69b02227ae3fd58589ee0bcfa3ca2a82
|
||||
fluttertoast: 9f2f8e81bb5ce18facb9748d7855bf5a756fe3db
|
||||
fluttertoast: 31b00dabfa7fb7bacd9e7dbee580d7a2ff4bf265
|
||||
fluwx: daa284756ce53442b3d0417ceeda66e981906811
|
||||
google_maps_flutter_ios: d1318b4ff711612cab16862d7a87e31a7403d458
|
||||
GoogleMaps: 20d7b12be49a14287f797e88e0e31bc4156aaeb4
|
||||
|
||||
@ -28,6 +28,8 @@ class F {
|
||||
|
||||
static String get name => appFlavor?.name ?? '';
|
||||
|
||||
static bool get isXHJ => appFlavor == Flavor.xhj;
|
||||
|
||||
//便捷判断并返回值
|
||||
static dynamic sw(
|
||||
{required fCallFunction defaultCall, fCallFunction? xhjCall}) {
|
||||
|
||||
@ -78,7 +78,8 @@ class _StarLockRegisterPageState extends State<StarLockRegisterPage> {
|
||||
// color: Colors.red,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(30.h)),
|
||||
border: Border.all(width: 1.0, color: AppColors.greyLineColor)),
|
||||
border:
|
||||
Border.all(width: 1.0, color: AppColors.greyLineColor)),
|
||||
child: Row(
|
||||
children: [
|
||||
GestureDetector(
|
||||
@ -146,40 +147,42 @@ class _StarLockRegisterPageState extends State<StarLockRegisterPage> {
|
||||
state.countryCode.value = result['code'];
|
||||
state.countryName.value = result['countryName'];
|
||||
}
|
||||
AppLog.log("路由返回值: $result, countryCode:${logic.state.countryCode}");
|
||||
AppLog.log(
|
||||
"路由返回值: $result, countryCode:${logic.state.countryCode}");
|
||||
},
|
||||
child: Obx(() => SizedBox(
|
||||
height: 70.h,
|
||||
child: Row(
|
||||
children: [
|
||||
SizedBox(width: 5.w),
|
||||
Expanded(
|
||||
child: Text("${"你所在的".tr}${TranslationLoader.lanKeys!.countryAndRegion!.tr}",
|
||||
style: TextStyle(
|
||||
fontSize: 26.sp, color: AppColors.blackColor))),
|
||||
SizedBox(width: 20.w),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
height: 70.h,
|
||||
child: Row(
|
||||
children: [
|
||||
Text(
|
||||
state.isIphoneType.value
|
||||
? '${state.countryName.value} +${state.countryCode.value}'
|
||||
: state.countryName.value,
|
||||
textAlign: TextAlign.end,
|
||||
style: TextStyle(
|
||||
fontSize: 26.sp, color: AppColors.blackColor),
|
||||
)
|
||||
SizedBox(width: 5.w),
|
||||
Expanded(
|
||||
child: Text(
|
||||
"${"你所在的".tr}${TranslationLoader.lanKeys!.countryAndRegion!.tr}",
|
||||
style: TextStyle(
|
||||
fontSize: 26.sp, color: AppColors.blackColor))),
|
||||
SizedBox(width: 20.w),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
Text(
|
||||
state.isIphoneType.value
|
||||
? '${state.countryName.value} +${state.countryCode.value}'
|
||||
: state.countryName.value,
|
||||
textAlign: TextAlign.end,
|
||||
style: TextStyle(
|
||||
fontSize: 26.sp, color: AppColors.blackColor),
|
||||
)
|
||||
],
|
||||
),
|
||||
SizedBox(width: 5.w),
|
||||
Image.asset(
|
||||
'images/icon_right.png',
|
||||
width: 50.w,
|
||||
height: 50.w,
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(width: 5.w),
|
||||
Image.asset(
|
||||
'images/icon_right.png',
|
||||
width: 50.w,
|
||||
height: 50.w,
|
||||
),
|
||||
],
|
||||
),
|
||||
)),
|
||||
)),
|
||||
),
|
||||
Container(
|
||||
height: 0.5.h,
|
||||
@ -193,26 +196,29 @@ class _StarLockRegisterPageState extends State<StarLockRegisterPage> {
|
||||
return Column(
|
||||
children: [
|
||||
Obx(() => LoginInput(
|
||||
controller: state.phoneOrEmailController,
|
||||
onchangeAction: (v) {
|
||||
logic.checkNext(state.phoneOrEmailController);
|
||||
},
|
||||
leftWidget:
|
||||
// Image.asset('images/icon_login_account.png', width: 30.w, height: 30.w,),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(right: 10.w, left: 5.w),
|
||||
child: Image.asset(
|
||||
'images/icon_login_account.png',
|
||||
width: 30.w,
|
||||
height: 30.w,
|
||||
),
|
||||
),
|
||||
hintText: "${TranslationLoader.lanKeys!.pleaseEnter!.tr}${state.isIphoneType.value ? "手机号".tr : TranslationLoader.lanKeys!.email!.tr}",
|
||||
keyboardType: TextInputType.number,
|
||||
inputFormatters: [
|
||||
// FilteringTextInputFormatter.allow(RegExp('[0-9]')),
|
||||
LengthLimitingTextInputFormatter(30),
|
||||
])),
|
||||
controller: state.phoneOrEmailController,
|
||||
onchangeAction: (v) {
|
||||
logic.checkNext(state.phoneOrEmailController);
|
||||
},
|
||||
leftWidget:
|
||||
// Image.asset('images/icon_login_account.png', width: 30.w, height: 30.w,),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(right: 10.w, left: 5.w),
|
||||
child: Image.asset(
|
||||
state.isIphoneType.value
|
||||
? 'images/icon_login_account.png'
|
||||
: "images/icon_login_email.png",
|
||||
width: 30.w,
|
||||
height: 30.w,
|
||||
),
|
||||
),
|
||||
hintText:
|
||||
"${TranslationLoader.lanKeys!.pleaseEnter!.tr}${state.isIphoneType.value ? "手机号".tr : TranslationLoader.lanKeys!.email!.tr}",
|
||||
keyboardType: TextInputType.number,
|
||||
inputFormatters: [
|
||||
// FilteringTextInputFormatter.allow(RegExp('[0-9]')),
|
||||
LengthLimitingTextInputFormatter(30),
|
||||
])),
|
||||
SizedBox(height: 10.w),
|
||||
LoginInput(
|
||||
controller: state.pwdController,
|
||||
@ -285,20 +291,21 @@ class _StarLockRegisterPageState extends State<StarLockRegisterPage> {
|
||||
width: 20.w,
|
||||
),
|
||||
Obx(() => GestureDetector(
|
||||
onTap: state.phoneOrEmailStrIsOK.value && state.canResend.value
|
||||
? () async {
|
||||
// Navigator.pushNamed(context, Routers.safetyVerificationPage, arguments: {"countryCode":"+86", "account":state.phoneOrEmailStr.value});
|
||||
var result = await Navigator.pushNamed(
|
||||
context, Routers.safetyVerificationPage,
|
||||
arguments: {
|
||||
"countryCode": state.countryCode,
|
||||
"account": state.phoneOrEmailStr.value
|
||||
});
|
||||
state.xWidth.value =
|
||||
(result as Map<String, dynamic>)['xWidth'];
|
||||
logic.sendValidationCode();
|
||||
}
|
||||
: null,
|
||||
onTap:
|
||||
state.phoneOrEmailStrIsOK.value && state.canResend.value
|
||||
? () async {
|
||||
// Navigator.pushNamed(context, Routers.safetyVerificationPage, arguments: {"countryCode":"+86", "account":state.phoneOrEmailStr.value});
|
||||
var result = await Navigator.pushNamed(
|
||||
context, Routers.safetyVerificationPage,
|
||||
arguments: {
|
||||
"countryCode": state.countryCode,
|
||||
"account": state.phoneOrEmailStr.value
|
||||
});
|
||||
state.xWidth.value =
|
||||
(result as Map<String, dynamic>)['xWidth'];
|
||||
logic.sendValidationCode();
|
||||
}
|
||||
: null,
|
||||
child: Container(
|
||||
width: 180.w,
|
||||
// height: 60.h,
|
||||
|
||||
@ -15,6 +15,8 @@ class LockMainXHJLogic extends BaseGetXController {
|
||||
update();
|
||||
}
|
||||
|
||||
bool get isMall => state.index ==1;
|
||||
|
||||
//打开设备弹窗
|
||||
void openEquipment() {
|
||||
showModalBottomSheet(
|
||||
|
||||
@ -25,6 +25,7 @@ class StarLockMainXHJPage extends StatefulWidget {
|
||||
|
||||
class _StarLockMainXHJPageState extends State<StarLockMainXHJPage>
|
||||
with BaseWidget {
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
||||
@ -1,8 +1,12 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:fluttertoast/fluttertoast.dart';
|
||||
import 'package:fluwx/fluwx.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/flavors.dart';
|
||||
import 'package:star_lock/main/lockMian/lockMain/xhj/lockMain_xhj_logic.dart';
|
||||
import 'package:star_lock/mine/mall/lockMall_entity.dart';
|
||||
import 'package:star_lock/mine/mall/lockMall_state.dart';
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
@ -16,8 +20,10 @@ import '../../tools/baseGetXController.dart';
|
||||
class LockMallLogic extends BaseGetXController {
|
||||
late LockMallState state;
|
||||
|
||||
DateTime? _lastPressedAt; // 记录上一次按下返回键的时间
|
||||
|
||||
LockMallLogic({required bool allowReturn})
|
||||
: state = LockMallState(allowReturn: allowReturn );
|
||||
: state = LockMallState(allowReturn: allowReturn);
|
||||
|
||||
//获取商城跳转地址
|
||||
Future<void> getMallURLRequest() async {
|
||||
@ -98,19 +104,33 @@ class LockMallLogic extends BaseGetXController {
|
||||
//判断webview 是否可以有路由可以回退,无则退出当前页面
|
||||
Future<bool> canGoBack(bool didPop) async {
|
||||
bool canGoBack = await state.mallWebView.canGoBack();
|
||||
if (canGoBack) {
|
||||
bool isMall = true;
|
||||
if (Get.isRegistered<LockMainXHJLogic>() && F.isXHJ) {
|
||||
isMall = Get.find<LockMainXHJLogic>().isMall;
|
||||
}
|
||||
if (canGoBack && isMall) {
|
||||
await state.mallWebView.goBack();
|
||||
} else if (state.allowReturn) {
|
||||
} else if (state.allowReturn && isMall) {
|
||||
Get.back();
|
||||
} else {
|
||||
if (_lastPressedAt == null ||
|
||||
DateTime.now().difference(_lastPressedAt!) > Duration(seconds: 2)) {
|
||||
// 如果两次返回键时间间隔大于 2 秒,则提示再次按下返回键退出
|
||||
_lastPressedAt = DateTime.now();
|
||||
showToast('再返回一次退出${F.title}');
|
||||
return false; // 阻止返回操作
|
||||
}
|
||||
SystemNavigator.pop();
|
||||
return true;
|
||||
}
|
||||
refreshGoBack();
|
||||
return false;
|
||||
}
|
||||
|
||||
//刷新当前路由状态
|
||||
void refreshGoBack(){
|
||||
void refreshGoBack() {
|
||||
//如果属于一直返回按钮,则根据是否有路由可以回退刷新
|
||||
if(state.allowReturn){
|
||||
if (state.allowReturn) {
|
||||
return;
|
||||
}
|
||||
state.mallWebView.canGoBack().then((value) {
|
||||
|
||||
@ -38,8 +38,9 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
||||
# 1.0.28+2024042601 打包鑫锁提审华为
|
||||
# 1.0.29+2024042901 打包给欧阳测试
|
||||
# 1.0.30+2024043001 打包鑫锁提审ios
|
||||
# 1.0.31+2024050301 打包鑫锁提审华为
|
||||
|
||||
version: 1.0.30+2024043001
|
||||
version: 1.0.31+2024050301
|
||||
|
||||
environment:
|
||||
sdk: '>=2.12.0 <3.0.0'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user