fix: - 一键登录逻辑,UI完善

- 一键登录页面以及二次协议确认页面UI样式完善
         - 一键登录逻辑完善,边界异常处理
This commit is contained in:
Liuyf 2025-04-22 16:49:34 +08:00
parent 60a6666d22
commit 841ef69381
9 changed files with 149 additions and 70 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 B

View File

@ -74,8 +74,6 @@ PODS:
- SDWebImage
- SwiftyGif
- EMASRest (11.1.1.2)
- fast_rsa (0.6.0):
- Flutter
- file_picker (0.0.1):
- DKImagePickerController/PhotoGallery
- Flutter
@ -146,6 +144,8 @@ PODS:
- fluwx/pay (0.0.1):
- Flutter
- WechatOpenSDK-XCFramework (~> 2.0.4)
- gallery_saver (0.0.1):
- Flutter
- google_maps_flutter_ios (0.0.1):
- Flutter
- GoogleMaps (< 9.0)
@ -215,6 +215,24 @@ PODS:
- JPush (= 5.3.0)
- just_audio (0.0.1):
- Flutter
- JVerification (3.2.4):
- JCore (>= 2.1.6)
- jverify (0.0.1):
- Flutter
- JCore (>= 4.6.2)
- JVerification (= 3.2.4)
- libwebp (1.3.2):
- libwebp/demux (= 1.3.2)
- libwebp/mux (= 1.3.2)
- libwebp/sharpyuv (= 1.3.2)
- libwebp/webp (= 1.3.2)
- libwebp/demux (1.3.2):
- libwebp/webp
- libwebp/mux (1.3.2):
- libwebp/demux
- libwebp/sharpyuv (1.3.2)
- libwebp/webp (1.3.2):
- libwebp/sharpyuv
- nanopb (3.30910.0):
- nanopb/decode (= 3.30910.0)
- nanopb/encode (= 3.30910.0)
@ -257,6 +275,9 @@ PODS:
- video_player_avfoundation (0.0.1):
- Flutter
- FlutterMacOS
- video_thumbnail (0.0.1):
- Flutter
- libwebp
- webview_flutter_wkwebview (0.0.1):
- Flutter
- WechatOpenSDK-XCFramework (2.0.4)
@ -274,7 +295,6 @@ DEPENDENCIES:
- camera_avfoundation (from `.symlinks/plugins/camera_avfoundation/ios`)
- connectivity_plus (from `.symlinks/plugins/connectivity_plus/darwin`)
- device_info_plus (from `.symlinks/plugins/device_info_plus/ios`)
- fast_rsa (from `.symlinks/plugins/fast_rsa/ios`)
- file_picker (from `.symlinks/plugins/file_picker/ios`)
- firebase_analytics (from `.symlinks/plugins/firebase_analytics/ios`)
- firebase_core (from `.symlinks/plugins/firebase_core/ios`)
@ -287,12 +307,14 @@ DEPENDENCIES:
- flutter_voice_processor (from `.symlinks/plugins/flutter_voice_processor/ios`)
- fluttertoast (from `.symlinks/plugins/fluttertoast/ios`)
- fluwx (from `.symlinks/plugins/fluwx/ios`)
- gallery_saver (from `.symlinks/plugins/gallery_saver/ios`)
- google_maps_flutter_ios (from `.symlinks/plugins/google_maps_flutter_ios/ios`)
- image_gallery_saver (from `.symlinks/plugins/image_gallery_saver/ios`)
- image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`)
- JPush
- jpush_flutter (from `.symlinks/plugins/jpush_flutter/ios`)
- just_audio (from `.symlinks/plugins/just_audio/ios`)
- jverify (from `.symlinks/plugins/jverify/ios`)
- network_info_plus (from `.symlinks/plugins/network_info_plus/ios`)
- open_filex (from `.symlinks/plugins/open_filex/ios`)
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
@ -306,6 +328,7 @@ DEPENDENCIES:
- umeng_common_sdk (from `.symlinks/plugins/umeng_common_sdk/ios`)
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
- video_player_avfoundation (from `.symlinks/plugins/video_player_avfoundation/darwin`)
- video_thumbnail (from `.symlinks/plugins/video_thumbnail/ios`)
- webview_flutter_wkwebview (from `.symlinks/plugins/webview_flutter_wkwebview/ios`)
SPEC REPOS:
@ -334,6 +357,8 @@ SPEC REPOS:
- ios-voice-processor
- JCore
- JPush
- JVerification
- libwebp
- nanopb
- PromisesObjC
- SDWebImage
@ -366,8 +391,6 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/connectivity_plus/darwin"
device_info_plus:
:path: ".symlinks/plugins/device_info_plus/ios"
fast_rsa:
:path: ".symlinks/plugins/fast_rsa/ios"
file_picker:
:path: ".symlinks/plugins/file_picker/ios"
firebase_analytics:
@ -392,6 +415,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/fluttertoast/ios"
fluwx:
:path: ".symlinks/plugins/fluwx/ios"
gallery_saver:
:path: ".symlinks/plugins/gallery_saver/ios"
google_maps_flutter_ios:
:path: ".symlinks/plugins/google_maps_flutter_ios/ios"
image_gallery_saver:
@ -402,6 +427,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/jpush_flutter/ios"
just_audio:
:path: ".symlinks/plugins/just_audio/ios"
jverify:
:path: ".symlinks/plugins/jverify/ios"
network_info_plus:
:path: ".symlinks/plugins/network_info_plus/ios"
open_filex:
@ -424,6 +451,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/url_launcher_ios/ios"
video_player_avfoundation:
:path: ".symlinks/plugins/video_player_avfoundation/darwin"
video_thumbnail:
:path: ".symlinks/plugins/video_thumbnail/ios"
webview_flutter_wkwebview:
:path: ".symlinks/plugins/webview_flutter_wkwebview/ios"
@ -451,7 +480,6 @@ SPEC CHECKSUMS:
DKImagePickerController: 946cec48c7873164274ecc4624d19e3da4c1ef3c
DKPhotoGallery: b3834fecb755ee09a593d7c9e389d8b5d6deed60
EMASRest: 8df6f87836767a9415ad5cc4af739bc9d215b475
fast_rsa: a1fed69b074093d2e2e3fefae6b821a071649d4c
file_picker: ce3938a0df3cc1ef404671531facef740d03f920
Firebase: 9f574c08c2396885b5e7e100ed4293d956218af9
firebase_analytics: 1a66fe8d4375eccff44671ea37897683a78b2675
@ -468,7 +496,8 @@ SPEC CHECKSUMS:
flutter_pcm_sound: de0572ca4f99091cc2abfcc31601b8a4ddd33c0e
flutter_voice_processor: 2b89b93d69b02227ae3fd58589ee0bcfa3ca2a82
fluttertoast: e9a18c7be5413da53898f660530c56f35edfba9c
fluwx: c18fd6c16b03a2187cd07d6e48e32a7801962849
fluwx: daa284756ce53442b3d0417ceeda66e981906811
gallery_saver: 9fc173c9f4fcc48af53b2a9ebea1b643255be542
google_maps_flutter_ios: f135b968a67c05679e0a53538e900b5c174b0d99
GoogleAppMeasurement: 6e49ffac7d3f2c3ded9cc663f912a13b67bbd0de
GoogleMaps: 20d7b12be49a14287f797e88e0e31bc4156aaeb4
@ -480,6 +509,9 @@ SPEC CHECKSUMS:
JPush: b71f497a3c1b825c7843fd97f290b05d5cd75f2e
jpush_flutter: c87be254790933c0363684169ef9d3d279a5adc5
just_audio: baa7252489dbcf47a4c7cc9ca663e9661c99aafa
JVerification: 0774807f44dd788c78d50303a14e133735807856
jverify: 337ea43ac1e16f9484f4195abe787d1b6241163c
libwebp: 1786c9f4ff8a279e4dac1e8f385004d5fc253009
nanopb: fad817b59e0457d11a5dfbde799381cd727c1275
network_info_plus: 6d0c3eb8367b8164fa3fb0c19875e3f59d49697f
open_filex: 6e26e659846ec990262224a12ef1c528bb4edbe4
@ -498,9 +530,10 @@ SPEC CHECKSUMS:
umeng_common_sdk: a8abd7f86dfd013dbbeeae587ee143760c6582f2
url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe
video_player_avfoundation: 7c6c11d8470e1675df7397027218274b6d2360b3
video_thumbnail: c4e2a3c539e247d4de13cd545344fd2d26ffafd1
webview_flutter_wkwebview: 2a23822e9039b7b1bc52e5add778e5d89ad488d1
WechatOpenSDK-XCFramework: 36fb2bea0754266c17184adf4963d7e6ff98b69f
PODFILE CHECKSUM: 728f9c851a19709391c77c54ed3556e484b54db6
COCOAPODS: 1.16.2
COCOAPODS: 1.14.3

View File

@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "icon_left_grey.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 B

View File

@ -103,8 +103,8 @@ class StarLockLoginLogic extends BaseGetXController {
}
}
Future<void> oneClickLoginAction() async {
await JverifyOneClickLoginManage().loginAuth((e) async {
Future<void> oneClickLoginAction(BuildContext context) async {
await JverifyOneClickLoginManage().loginAuth(context,(e) async {
final int? code = e.code;
final String? content = e.message;
// final String operator = map['operator'];
@ -142,7 +142,7 @@ class StarLockLoginLogic extends BaseGetXController {
// showToast('用户取消一键登录'.tr);
break;
default:
showToast('一键登录失败,请重试'.tr);
showToast('一键登录失败,请使用账号/密码登录'.tr);
break;
}
});

View File

@ -283,7 +283,8 @@ class _StarLockLoginPageState extends State<StarLockLoginPage> {
width: 10.sp,
)),
Obx(() => Visibility(
visible: state.isCheckVerifyEnable.value && state.currentLanguage == 'zh_CN',
visible: state.isCheckVerifyEnable.value &&
state.currentLanguage == 'zh_CN',
child: GestureDetector(
child: SizedBox(
// width: 150.w,
@ -296,7 +297,9 @@ class _StarLockLoginPageState extends State<StarLockLoginPage> {
color: AppColors.mainColor)),
),
),
onTap: logic.oneClickLoginAction,
onTap: () {
logic.oneClickLoginAction(context);
},
),
))
],

View File

@ -243,7 +243,7 @@ class _StarLockLoginPageState extends State<StarLockLoginXHJPage> {
),
),
onTap: () async {
logic.oneClickLoginAction();
logic.oneClickLoginAction(context);
},
),
))

View File

@ -142,7 +142,7 @@ class JverifyOneClickLoginManage {
}
/// SDK
Future<void> loginAuth(
Future<void> loginAuth(BuildContext context,
Function(JVListenerEvent jvListenerEvent) action) async {
Map map = await jverify.checkVerifyEnable();
final bool result = map[f_result_key];
@ -154,6 +154,9 @@ class JverifyOneClickLoginManage {
// return null;
if (result) {
final screenSize = MediaQuery.of(context).size;
final screenWidth = screenSize.width;
final screenHeight = screenSize.height;
bool isiOS = Platform.isIOS;
/// UI
@ -163,13 +166,13 @@ class JverifyOneClickLoginManage {
// uiConfig.authBGGifPath = "main_gif";
// uiConfig.authBGVideoPath="main_vi";
// uiConfig.authBGVideoPath = 'http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4';
uiConfig.authBackgroundImage = 'images/icon_left_grey.png';
// uiConfig.authBackgroundImage = 'images/icon_left_grey.png';
// uiConfig.navHidden = !isiOS;
uiConfig.navColor = Colors.white.value;
uiConfig.navColor = AppColors.mainColor.value;
uiConfig.navText = '一键登录'.tr;
uiConfig.navTextColor = Colors.white.value;
uiConfig.navReturnImgPath = 'return_bg'; //
uiConfig.navReturnImgPath = 'icon_left_grey'; //
uiConfig.logoWidth = 100;
uiConfig.logoHeight = 100;
@ -194,11 +197,11 @@ class JverifyOneClickLoginManage {
// uiConfig.slogan
//uiConfig.sloganHidden = 0;
uiConfig.logBtnOffsetX = 20;
// uiConfig.logBtnOffsetX = 20;
uiConfig.logBtnWidth = double.parse('${1.sw - 20 * 2}').toInt();
uiConfig.logBtnHeight = 50;
//uiConfig.logBtnOffsetX = isiOS ? 0 : null;//(screenWidth/2 - uiConfig.logBtnWidth/2).toInt();
uiConfig.logBtnOffsetY = isiOS ? 120 : 330;
uiConfig.logBtnOffsetY = isiOS ? 140 : 330;
uiConfig.logBtnVerticalLayoutItem = JVIOSLayoutItem.ItemNumber;
uiConfig.logBtnText = '一键登录'.tr;
uiConfig.logBtnTextColor = AppColors.mainColor.value;
@ -221,6 +224,7 @@ class JverifyOneClickLoginManage {
uiConfig.isAlertPrivacyVc = true;
//uiConfig.privacyOffsetX = isiOS ? (20 + uiConfig.privacyCheckboxSize) : null;
uiConfig.privacyNavReturnBtnImage = 'icon_left_grey'; //;
uiConfig.privacyOffsetY = 30; //
uiConfig.privacyOffsetX = 15; //
uiConfig.privacyVerticalLayoutItem = JVIOSLayoutItem.ItemSuper;
@ -259,8 +263,73 @@ class JverifyOneClickLoginManage {
uiConfig.privacyNavTitleTextColor = Colors.white.value;
uiConfig.privacyNavTitleTextSize = 16;
// -Android
final JVPrivacyCheckDialogConfig privacyCheckDialogConfig =
JVPrivacyCheckDialogConfig();
privacyCheckDialogConfig.width = 250; //
privacyCheckDialogConfig.height = 100; //
privacyCheckDialogConfig.title = '请阅读并同意一下条款'; //
privacyCheckDialogConfig.offsetX = 0; // x轴偏移量
privacyCheckDialogConfig.offsetY = 0; // y轴偏移量
privacyCheckDialogConfig.logBtnText = '同意并登录'; //
privacyCheckDialogConfig.titleTextSize = 24; //
privacyCheckDialogConfig.gravity = 'center'; //
privacyCheckDialogConfig.titleTextColor = Colors.black.value; //
privacyCheckDialogConfig.contentTextGravity = 'left'; //
privacyCheckDialogConfig.contentTextSize = 16; //
// privacyCheckDialogConfig.logBtnImgPath = "login_btn_normal";//
privacyCheckDialogConfig.logBtnTextColor =
Colors.black.value; //
privacyCheckDialogConfig.logBtnMarginT = 20; //
privacyCheckDialogConfig.logBtnMarginB = 20; //
privacyCheckDialogConfig.logBtnMarginL = 40; //
privacyCheckDialogConfig.logBtnWidth = 140; //
privacyCheckDialogConfig.logBtnHeight = 40; //
/// dialog
final List<JVCustomWidget> dialogWidgetList = <JVCustomWidget>[];
const String btnDialogWidgetid = 'jv_add_custom_dialog_button'; // id
final JVCustomWidget buttonDialogWidget =
JVCustomWidget(btnDialogWidgetid, JVCustomWidgetType.button);
buttonDialogWidget.title = '取消';
buttonDialogWidget.titleFont = 16;
buttonDialogWidget.left = 80;
buttonDialogWidget.top = 180;
buttonDialogWidget.width = 140;
buttonDialogWidget.height = 40;
buttonDialogWidget.textAlignment = JVTextAlignmentType.center;
buttonDialogWidget.titleColor = Colors.black.value;
// buttonDialogWidget.btnNormalImageName = "main_btn_other";
// buttonDialogWidget.btnPressedImageName = "main_btn_other";
// buttonDialogWidget.backgroundColor = Colors.yellow.value;
// buttonWidget.textAlignment = JVTextAlignmentType.left;
//
jverify.addClikWidgetEventListener(btnDialogWidgetid, (eventId) {
print('receive listener - click dialog widget event :$eventId');
if (btnDialogWidgetid == eventId) {
print('receive listener - 点击【新加 dialog button】');
}
});
dialogWidgetList.add(buttonDialogWidget);
privacyCheckDialogConfig.widgets = dialogWidgetList;
uiConfig.privacyCheckDialogConfig = privacyCheckDialogConfig;
// iOS
uiConfig.isAlertPrivacyVc = true;
uiConfig.agreementAlertViewWidgets = dialogWidgetList;
uiConfig.agreementAlertViewLogBtnTextFontSize = 16;
uiConfig.agreementAlertViewTitleTexSize = 18;
uiConfig.agreementAlertViewContentTextFontSize = 14;
final alertLeft = (screenWidth / 2 - 300 / 2).toInt();
uiConfig.agreementAlertViewUIFrames = {
'superViewFrame': [alertLeft, 100, 300, 220],
'titleFrame': [20, 10, 260, 40],
'contentFrame': [25, 70, 250, 120],
'buttonFrame': [80, 142, 140, 40]
};
/// UI
jverify.setCustomAuthorizationView(true, uiConfig,
jverify.setCustomAuthorizationView(false, uiConfig,
landscapeConfig: uiConfig);
jverify.loginAuthSyncApi2(
autoDismiss: true,
@ -270,7 +339,8 @@ class JverifyOneClickLoginManage {
});
} else {
// -10000
action(JVListenerEvent.fromJson(<String,dynamic >{'code': -10000, 'message': ''}));
action(JVListenerEvent.fromJson(
<String, dynamic>{'code': -10000, 'message': ''}));
}
}
}

View File

@ -621,14 +621,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.2.3"
flutter_foreground_task:
dependency: transitive
description:
name: flutter_foreground_task
sha256: "6cf10a27f5e344cd2ecad0752d3a5f4ec32846d82fda8753b3fe2480ebb832a3"
url: "https://pub.dev"
source: hosted
version: "6.5.0"
flutter_hooks:
dependency: transitive
description:
@ -714,30 +706,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.0.18"
flutter_screen_recording:
dependency: "direct main"
description:
name: flutter_screen_recording
sha256: "672a3f6c9e7b7438461a3a18ba36d8586189adcb716911d4c41d5d88592fbdda"
url: "https://pub.dev"
source: hosted
version: "2.0.16"
flutter_screen_recording_platform_interface:
dependency: transitive
description:
name: flutter_screen_recording_platform_interface
sha256: "9e07f78a2529bc5b6c77d045b392ed4062445543613fcad431c4cc1da57558d7"
url: "https://pub.dev"
source: hosted
version: "1.0.3"
flutter_screen_recording_web:
dependency: transitive
description:
name: flutter_screen_recording_web
sha256: f0a1b141beb1a64d8087c5871949a11ea6bf5d2a2fcd9d1341a7cf7b11e41aab
url: "https://pub.dev"
source: hosted
version: "1.0.7"
flutter_screenutil:
dependency: "direct main"
description:
@ -1341,14 +1309,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.1.6"
platform_detect:
dependency: transitive
description:
name: platform_detect
sha256: a62f99417fc4fa2d099ce0ccdbb1bd3977920f2a64292c326271f049d4bc3a4f
url: "https://pub.dev"
source: hosted
version: "2.1.0"
plugin_platform_interface:
dependency: transitive
description:
@ -1389,14 +1349,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "6.1.2"
pub_semver:
dependency: transitive
description:
name: pub_semver
sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c"
url: "https://pub.dev"
source: hosted
version: "2.1.4"
qr:
dependency: transitive
description: