Przeglądaj źródła

1.优化登录页面,增加跳转小程序入口

tags/0.0.9+2
“yanghuaxuan” 3 lat temu
rodzic
commit
836ffd6105
5 zmienionych plików z 94 dodań i 84 usunięć
  1. +58
    -73
      example/pubspec.lock
  2. +2
    -0
      lib/pages/login_page/login_page.dart
  3. +10
    -0
      lib/util/launcher_wx_mini_program.dart
  4. +22
    -10
      lib/util/mob_util/secverify/quick_login_util.dart
  5. +2
    -1
      pubspec.yaml

+ 58
- 73
example/pubspec.lock Wyświetl plik

@@ -10,27 +10,13 @@ packages:
url: "http://192.168.0.138:3000/FnuoOS_ZhiYing/zhiying_ali_auth_wbq.git"
source: git
version: "0.0.11"
archive:
dependency: transitive
description:
name: archive
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.13"
args:
dependency: transitive
description:
name: args
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.6.0"
async:
dependency: transitive
description:
name: async
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.4.1"
version: "2.5.0-nullsafety.1"
bloc:
dependency: transitive
description:
@@ -44,7 +30,7 @@ packages:
name: boolean_selector
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.0"
version: "2.1.0-nullsafety.1"
cached_network_image:
dependency: transitive
description:
@@ -52,27 +38,34 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.2.0+1"
characters:
dependency: transitive
description:
name: characters
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.0-nullsafety.3"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.3"
version: "1.2.0-nullsafety.1"
clock:
dependency: transitive
description:
name: clock
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.1"
version: "1.1.0-nullsafety.1"
collection:
dependency: transitive
description:
name: collection
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.14.12"
version: "1.15.0-nullsafety.3"
convert:
dependency: transitive
description:
@@ -143,6 +136,13 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.1"
fake_async:
dependency: transitive
description:
name: fake_async
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.2.0-nullsafety.1"
ffi:
dependency: transitive
description:
@@ -166,8 +166,8 @@ packages:
dependency: transitive
description:
path: "."
ref: "0.0.4"
resolved-ref: "9786cccfb44cd4b38f2ca3f1ff1dc139c4e09d61"
ref: "0.0.6"
resolved-ref: "159f123705b3e3dc28d6991df5b39b24a54c41a0"
url: "http://192.168.0.138:3000/FnuoOS_ZhiYing/zhiying_flutter_alibc.git"
source: git
version: "0.0.15"
@@ -232,6 +232,13 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "4.0.1"
fluwx:
dependency: transitive
description:
path: "../../fluwx"
relative: true
source: path
version: "0.0.1"
http:
dependency: transitive
description:
@@ -246,13 +253,6 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.1.4"
image:
dependency: transitive
description:
name: image
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.12"
imei_plugin:
dependency: transitive
description:
@@ -287,14 +287,14 @@ packages:
name: matcher
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.12.6"
version: "0.12.10-nullsafety.1"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.8"
version: "1.3.0-nullsafety.3"
moblink:
dependency: transitive
description:
@@ -331,7 +331,7 @@ packages:
name: path
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.6.4"
version: "1.8.0-nullsafety.1"
path_provider:
dependency: transitive
description:
@@ -390,13 +390,6 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.1"
petitparser:
dependency: transitive
description:
name: petitparser
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.4.0"
photo_view:
dependency: transitive
description:
@@ -431,14 +424,7 @@ packages:
name: provider
url: "https://pub.flutter-io.cn"
source: hosted
version: "4.3.2+2"
quiver:
dependency: transitive
description:
name: quiver
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.3"
version: "4.3.3"
rxdart:
dependency: transitive
description:
@@ -449,16 +435,20 @@ packages:
save_image:
dependency: transitive
description:
name: save_image
url: "https://pub.flutter-io.cn"
source: hosted
path: "."
ref: "0.0.1"
resolved-ref: b719ab2d77298cbfa5ce3397d83d5ba253ed29c1
url: "http://192.168.0.138:3000/FnuoOS_ZhiYing/save_image.git"
source: git
version: "1.0.1"
secverify:
dependency: transitive
description:
name: secverify
url: "https://pub.flutter-io.cn"
source: hosted
path: "."
ref: "0.0.2"
resolved-ref: "5ec756e9fe63339209cc6906a37a778952ac61f1"
url: "http://192.168.0.138:3000/FnuoOS_ZhiYing/secverify.git"
source: git
version: "1.0.2"
shared_preferences:
dependency: transitive
@@ -505,9 +495,11 @@ packages:
sharesdk_plugin:
dependency: transitive
description:
name: sharesdk_plugin
url: "https://pub.flutter-io.cn"
source: hosted
path: "."
ref: "0.0.1"
resolved-ref: f947c09803374acdc4fb720ccb5356d0779afe2f
url: "http://192.168.0.138:3000/FnuoOS_ZhiYing/sharesdk_plugin.git"
source: git
version: "1.2.9"
shimmer:
dependency: transitive
@@ -527,7 +519,7 @@ packages:
name: source_span
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.7.0"
version: "1.8.0-nullsafety.2"
sqflite:
dependency: transitive
description:
@@ -548,21 +540,21 @@ packages:
name: stack_trace
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.9.3"
version: "1.10.0-nullsafety.1"
stream_channel:
dependency: transitive
description:
name: stream_channel
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.0"
version: "2.1.0-nullsafety.1"
string_scanner:
dependency: transitive
description:
name: string_scanner
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.5"
version: "1.1.0-nullsafety.1"
synchronized:
dependency: transitive
description:
@@ -576,14 +568,14 @@ packages:
name: term_glyph
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.0"
version: "1.2.0-nullsafety.1"
test_api:
dependency: transitive
description:
name: test_api
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.2.15"
version: "0.2.19-nullsafety.2"
tobias:
dependency: transitive
description:
@@ -599,7 +591,7 @@ packages:
name: typed_data
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.6"
version: "1.3.0-nullsafety.3"
url_launcher:
dependency: transitive
description:
@@ -655,14 +647,14 @@ packages:
name: vector_math
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.8"
version: "2.1.0-nullsafety.3"
webview_flutter:
dependency: transitive
description:
name: webview_flutter
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.3.24"
version: "1.0.7"
win32:
dependency: transitive
description:
@@ -677,13 +669,6 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.1.0"
xml:
dependency: transitive
description:
name: xml
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.6.1"
zhiying_comm:
dependency: "direct dev"
description:
@@ -692,5 +677,5 @@ packages:
source: path
version: "0.0.1"
sdks:
dart: ">=2.8.0 <3.0.0"
flutter: ">=1.16.0 <2.0.0"
dart: ">=2.10.0-110 <2.11.0"
flutter: ">=1.22.0 <2.0.0"

+ 2
- 0
lib/pages/login_page/login_page.dart Wyświetl plik

@@ -30,6 +30,8 @@ import 'model/login_style_model.dart';
class LoginPage extends StatelessWidget {
const LoginPage({Key key}) : super(key: key);



@override
Widget build(BuildContext context) {
return Scaffold(


+ 10
- 0
lib/util/launcher_wx_mini_program.dart Wyświetl plik

@@ -0,0 +1,10 @@
import 'package:fluwx/fluwx.dart';

class LauncherWxMiniProgram {
static Future open(Map<String, dynamic> data) async {
if (data == null) {
return false;
}
return await launchWeChatMiniProgram(username: data['user_name'],miniProgramType: data['miniprogram_type'],path: data['page']);
}
}

+ 22
- 10
lib/util/mob_util/secverify/quick_login_util.dart Wyświetl plik

@@ -1,3 +1,4 @@
import 'dart:async';
import 'dart:io';

import 'package:flutter/cupertino.dart';
@@ -34,6 +35,8 @@ class QuickLoginUtil {
/// 工厂构造方法,这里使用命名构造函数方式进行声明
factory QuickLoginUtil.getInstance() => _getInstance();

static bool sevIngSuccess = false;

/// 获取单例内部方法
static _getInstance() {
// 只能有一个实例
@@ -57,15 +60,23 @@ class QuickLoginUtil {

/// 打开秒验登录页面的方法
void openQuickLogin(BuildContext context, Quick model) async {
sevIngSuccess = false;
Timer(Duration(milliseconds: 3000), () {
if (!sevIngSuccess) {
Loading.dismiss();
_openSMSLoginPage(context);
}
});
Loading.show(context);
// 取号前设置
Secverify.autoFinishOauthPage(false);
//设置UI属性
_setPortraitLayout(model);
Secverify.isVerifySupport.then((bool value) {
await Secverify.isVerifySupport.then((bool value) {
if (value) {
_verify(context);
} else {
sevIngSuccess = true;
// showAlert("当前环境不支持", context);
Logger.warn("当前环境不支持");
Loading.dismiss();
@@ -93,7 +104,7 @@ class QuickLoginUtil {
}

// 需要自己实现这部分
Future _doLogin(Map ret, BuildContext context) async {
Future _doLogin(Map ret, BuildContext context) async {
var opToken = ret.containsKey("opToken") ? ret["opToken"] : "";
var token = ret.containsKey("token") ? ret["token"] : "";
var operator = ret.containsKey("operator") ? ret["operator"] : "";
@@ -106,12 +117,12 @@ class QuickLoginUtil {
params["operator"] = operator;
params["operator"] = phoneOperator;
params["token"] = token;
if(!EmptyUtil.isEmpty(md5)) params["md5"] = md5;
if (!EmptyUtil.isEmpty(md5)) params["md5"] = md5;
// params["appkey"] = appKey;

try {
BuildContext context1 = navigatorKey.currentState.overlay.context;
Loading.show(context1,msg: "加载中...");
Loading.show(context1, msg: "加载中...");
print("加载中...");
var result = await NetUtil.post('/api/v1/sign/mob/in', params: params, method: NetMethod.POST);
if (NetUtil.isSuccess(result) && !EmptyUtil.isEmpty(result[GlobalConfig.HTTP_RESPONSE_KEY_DATA])) {
@@ -130,7 +141,7 @@ class QuickLoginUtil {
return;
}
}
}else{
} else {
Loading.dismiss();
}
} catch (e, s) {
@@ -190,6 +201,7 @@ class QuickLoginUtil {
// 取号接口
void _verify(BuildContext context) {
Secverify.preVerify((ret, err) async {
sevIngSuccess = true;
if (err != null) {
// showAlert(err.toString(),context);
Logger.log(err.toString());
@@ -231,7 +243,7 @@ class QuickLoginUtil {
Secverify.finshOauthPage();
}
}
}).then((value){
}).then((value) {
print(value);
});
}
@@ -307,7 +319,7 @@ class QuickLoginUtil {
"switchAccTextSize": 13, //切换登录文字大小
"switchAccHidden": false, //切换登录是否隐藏
"switchAccAlignParentRight": false, //切换登录是否靠屏幕右侧
// "switchAccText": model?.textTip ?? '切换账号', //切换登录文本内容
// "switchAccText": model?.textTip ?? '切换账号', //切换登录文本内容
"switchAccText": ' ',
"switchAccTextBold": false, //切换登录文本是否加粗
"portraitLayout": {
@@ -542,8 +554,8 @@ class QuickLoginUtil {
// // 'secLayoutRight': -20, // 右边间距
// 'secLayoutWidth': 80, // 控件宽度
// 'secLayoutHeight': 80, // 控件高度
// 'secLayoutCenterX': 0, // 相对于父视图的CenterX的偏移量,0表示不偏移,即水平居中
// 'secLayoutCenterY': 0, // 相对于父视图的CenterY的偏移量,0表示不偏移,即垂直居中
// 'secLayoutCenterX': 0, // 相对于父视图的CenterX的偏移量,0表示不偏移,即水平居中
// 'secLayoutCenterY': 0, // 相对于父视图的CenterY的偏移量,0表示不偏移,即垂直居中
// },
};
// 手机号码
@@ -668,7 +680,7 @@ class QuickLoginUtil {
// 'customAnimation': customAnimation, // 自定义动画设置
'customNav': customNav, // 导航栏设置
// 'customAuthPage': customAuthPage, // 授权页
'customAuthPageLogo': customAuthPageLogo, // 授权页Logo
'customAuthPageLogo': customAuthPageLogo, // 授权页Logo
'customPhoneNumber': customPhoneNumber, // 手机号码
'customSwitchNumber': customSwitchNumber, // 切换帐号按钮
// 'customCheckBox': customCheckBox, // 隐私条款复选框


+ 2
- 1
pubspec.yaml Wyświetl plik

@@ -96,9 +96,10 @@ dependencies:
ref: '0.0.2'
#微信支付
fluwx:
# path: ../fluwx
git:
url: 'http://192.168.0.138:3000/FnuoOS_ZhiYing/fluwx.git'
ref: '0.0.1'
ref: '0.0.2'

event_bus: 1.1.1



Ładowanie…
Anuluj
Zapisz