|
...
|
...
|
@@ -290,7 +290,7 @@ class LoginState extends State<LoginPage> with WidgetsBindingObserver { |
|
|
|
}
|
|
|
|
|
|
|
|
///苹果登陆
|
|
|
|
_iosLogin() async {
|
|
|
|
_iosLogin(UserModel value) async {
|
|
|
|
String info = await Utils.getDeviceInfoSystem();
|
|
|
|
int systemInfo = info.compareTo('13');
|
|
|
|
if (systemInfo < 0) {
|
|
...
|
...
|
@@ -311,8 +311,9 @@ class LoginState extends State<LoginPage> with WidgetsBindingObserver { |
|
|
|
),
|
|
|
|
);
|
|
|
|
// _showLoading(context);
|
|
|
|
print(credential.userIdentifier);
|
|
|
|
NavigatorUtil.goBindingPhonePage(context, wechat: false);
|
|
|
|
// print(credential.userIdentifier);
|
|
|
|
_loginAppleData(value);
|
|
|
|
// NavigatorUtil.goBindingPhonePage(context, wechat: false);
|
|
|
|
// String mdString = Utils.generateMd5(credential.userIdentifier);
|
|
|
|
// String temp = mdString.substring(8, mdString.length - 2);
|
|
|
|
// String openid = 'IOSID_$temp';
|
|
...
|
...
|
@@ -344,6 +345,25 @@ class LoginState extends State<LoginPage> with WidgetsBindingObserver { |
|
|
|
// }
|
|
|
|
}
|
|
|
|
|
|
|
|
_loginAppleData(UserModel value) {
|
|
|
|
if (App.sp.containsKey('unionid')) {
|
|
|
|
//微信登陆的时候,退出清空数据
|
|
|
|
App.sp.remove('openid');
|
|
|
|
App.sp.remove("unionid");
|
|
|
|
}
|
|
|
|
Map<String, String> params = {
|
|
|
|
"seller_code": "001297",
|
|
|
|
"alias": "ssahdahgdafgahjkhakjgh",
|
|
|
|
"account": "0001",
|
|
|
|
"password": "123456"
|
|
|
|
};
|
|
|
|
value.login(context, params).then((value) {
|
|
|
|
// setState(() {
|
|
|
|
// // errorText = value ?? "";
|
|
|
|
// });
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
ScreenUtil.init(context, width: 750, height: 1334);
|
|
...
|
...
|
@@ -700,16 +720,19 @@ class LoginState extends State<LoginPage> with WidgetsBindingObserver { |
|
|
|
children: <Widget>[
|
|
|
|
Platform.isAndroid
|
|
|
|
? Text('')
|
|
|
|
: InkWell(
|
|
|
|
child: Image.asset(Utils.getImgPath('apple'),
|
|
|
|
width: ScreenUtil().setWidth(100)),
|
|
|
|
onTap: () {
|
|
|
|
if (!_check) {
|
|
|
|
Utils.showToast('请仔细阅读协议');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
_iosLogin();
|
|
|
|
}),
|
|
|
|
: Consumer<UserModel>(builder: (BuildContext context,
|
|
|
|
UserModel value, Widget child) {
|
|
|
|
return InkWell(
|
|
|
|
child: Image.asset(Utils.getImgPath('apple'),
|
|
|
|
width: ScreenUtil().setWidth(100)),
|
|
|
|
onTap: () {
|
|
|
|
if (!_check) {
|
|
|
|
Utils.showToast('请仔细阅读协议');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
_iosLogin(value);
|
|
|
|
});
|
|
|
|
}),
|
|
|
|
Offstage(
|
|
|
|
offstage: !App.isInstallWx,
|
|
|
|
child: InkWell(
|
...
|
...
|
|