@@ -57,12 +57,29 @@ android { | |||||
} | } | ||||
} | } | ||||
// 签名配置 | |||||
signingConfigs { | |||||
// 智夜生活 | |||||
zhiying { | |||||
storeFile file('zhiying.jks') | |||||
storePassword 'zhioscom' | |||||
keyAlias 'zysh' | |||||
keyPassword 'zhioscom' | |||||
v1SigningEnabled true | |||||
v2SigningEnabled true | |||||
} | |||||
} | |||||
flavorDimensions "app" | |||||
buildTypes { | buildTypes { | ||||
debug { | debug { | ||||
buildConfigField "boolean", "LOG_DEBUG", "true" | buildConfigField "boolean", "LOG_DEBUG", "true" | ||||
minifyEnabled false | minifyEnabled false | ||||
zipAlignEnabled true | zipAlignEnabled true | ||||
shrinkResources false | shrinkResources false | ||||
signingConfig signingConfigs.zhiying | |||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | ||||
} | } | ||||
release { | release { | ||||
@@ -70,6 +87,7 @@ android { | |||||
minifyEnabled false | minifyEnabled false | ||||
shrinkResources false | shrinkResources false | ||||
zipAlignEnabled true | zipAlignEnabled true | ||||
signingConfig signingConfigs.zhiying | |||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | ||||
} | } | ||||
} | } | ||||
@@ -189,6 +207,12 @@ MobSDK { | |||||
appKey "30dc33054b635" | appKey "30dc33054b635" | ||||
appSecret "396e98c293130c9976fb7428b6b434d6" | appSecret "396e98c293130c9976fb7428b6b434d6" | ||||
//手机验证登录 | |||||
SecVerify {} | |||||
//短信 | |||||
SMSSDK {} | |||||
ShareSDK { | ShareSDK { | ||||
// platform configuration information | // platform configuration information | ||||
@@ -28,8 +28,9 @@ | |||||
android:name="io.flutter.app.FlutterApplication" | android:name="io.flutter.app.FlutterApplication" | ||||
android:icon="@mipmap/ic_launcher" | android:icon="@mipmap/ic_launcher" | ||||
android:label="@string/app_name" | android:label="@string/app_name" | ||||
android:allowBackup="true" | |||||
android:usesCleartextTraffic="true" | android:usesCleartextTraffic="true" | ||||
tools:replace="android:name"> | |||||
tools:replace="android:name, android:allowBackup"> | |||||
<activity | <activity | ||||
android:name=".MainActivity" | android:name=".MainActivity" | ||||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" | android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" | ||||
@@ -49,13 +49,15 @@ class SecurityBindAlipayBloc extends BlocBase { | |||||
} | } | ||||
} | } | ||||
Future<bool> bindAlipay(String name, String account, String code) { | |||||
Future<bool> bindAlipay(String name, String account, String code, String phone) { | |||||
return NetUtil.post('/api/v1/settings/account/security/alipay', | return NetUtil.post('/api/v1/settings/account/security/alipay', | ||||
method: NetMethod.POST, | method: NetMethod.POST, | ||||
params: Map<String, dynamic>.from({ | params: Map<String, dynamic>.from({ | ||||
'alipay_real_name': name, | 'alipay_real_name': name, | ||||
'alipay_account': account, | 'alipay_account': account, | ||||
'valid_code': code, | 'valid_code': code, | ||||
'phone': phone, | |||||
'zone': '86' | |||||
})).then((result) { | })).then((result) { | ||||
if (result['code'] == 1) return true; | if (result['code'] == 1) return true; | ||||
return false; | return false; | ||||
@@ -12,8 +12,11 @@ import 'package:zhiying_base_widget/pages/security_page/widgets/security_code_bu | |||||
import 'package:zhiying_base_widget/pages/security_page/widgets/security_confirm_button.dart'; | import 'package:zhiying_base_widget/pages/security_page/widgets/security_confirm_button.dart'; | ||||
import 'package:zhiying_comm/util/base_bloc.dart'; | import 'package:zhiying_comm/util/base_bloc.dart'; | ||||
import 'package:zhiying_comm/zhiying_comm.dart'; | import 'package:zhiying_comm/zhiying_comm.dart'; | ||||
import 'package:zhiying_comm/util/mob_util/mob_util.dart'; | |||||
// 绑定支付宝 | |||||
/// | |||||
/// 绑定支付宝 | |||||
/// | |||||
class SecurityBindAlipayPage extends StatefulWidget { | class SecurityBindAlipayPage extends StatefulWidget { | ||||
final Map<String, dynamic> model; | final Map<String, dynamic> model; | ||||
@@ -34,7 +37,7 @@ class _SecurityBindAlipayPageState extends State<SecurityBindAlipayPage> { | |||||
} else { | } else { | ||||
return BlocProvider<SecurityBindAlipayBloc>( | return BlocProvider<SecurityBindAlipayBloc>( | ||||
bloc: SecurityBindAlipayBloc(), | bloc: SecurityBindAlipayBloc(), | ||||
child: _SecurityBindAlipayContainer(datas), | |||||
child: _SecurityBindAlipayContainer(datas, status['mobile_setting_text']), | |||||
); | ); | ||||
} | } | ||||
} | } | ||||
@@ -42,8 +45,9 @@ class _SecurityBindAlipayPageState extends State<SecurityBindAlipayPage> { | |||||
class _SecurityBindAlipayContainer extends StatefulWidget { | class _SecurityBindAlipayContainer extends StatefulWidget { | ||||
final Map<String, dynamic> model; | final Map<String, dynamic> model; | ||||
final String phone; | |||||
const _SecurityBindAlipayContainer(this.model, {Key key}) : super(key: key); | |||||
const _SecurityBindAlipayContainer(this.model, this.phone, {Key key}) : super(key: key); | |||||
@override | @override | ||||
_SecurityBindAlipayContainerState createState() => | _SecurityBindAlipayContainerState createState() => | ||||
@@ -140,7 +144,9 @@ class _SecurityBindAlipayContainerState | |||||
if (await _bloc.bindAlipay( | if (await _bloc.bindAlipay( | ||||
_nameController.text, | _nameController.text, | ||||
_accountController.text, | _accountController.text, | ||||
_codeController.text)) { | |||||
_codeController.text, | |||||
widget.phone | |||||
)) { | |||||
Fluttertoast.showToast(msg: '绑定成功'); | Fluttertoast.showToast(msg: '绑定成功'); | ||||
Navigator.of(context).pop(true); | Navigator.of(context).pop(true); | ||||
} | } | ||||
@@ -193,9 +199,22 @@ class _SecurityBindAlipayContainerState | |||||
} | } | ||||
void _sendCode() async { | void _sendCode() async { | ||||
NetUtil.request('/api/v1/settings/account/security/alipay/sms', | |||||
onSuccess: (result) { | |||||
Logger.debug(result); | |||||
// NetUtil.request('/api/v1/settings/account/security/alipay/sms', | |||||
// onSuccess: (result) { | |||||
// Logger.debug(result); | |||||
// Fluttertoast.showToast(msg: '发送成功'); | |||||
// _second = 60; | |||||
// Timer.periodic(Duration(seconds: 1), (timer) { | |||||
// _second--; | |||||
// if (_second <= 0) { | |||||
// timer.cancel(); | |||||
// } | |||||
// setState(() {}); | |||||
// }); | |||||
// }); | |||||
bool result = await MobUtil.getTextCode(widget.phone, smsCodeType: SMSCodeType.BIND_ALIPAY); | |||||
if(result){ | |||||
Fluttertoast.showToast(msg: '发送成功'); | Fluttertoast.showToast(msg: '发送成功'); | ||||
_second = 60; | _second = 60; | ||||
Timer.periodic(Duration(seconds: 1), (timer) { | Timer.periodic(Duration(seconds: 1), (timer) { | ||||
@@ -205,6 +224,8 @@ class _SecurityBindAlipayContainerState | |||||
} | } | ||||
setState(() {}); | setState(() {}); | ||||
}); | }); | ||||
}); | |||||
}else{ | |||||
Fluttertoast.showToast(msg: '获取验证码失败'); | |||||
} | |||||
} | } | ||||
} | } |
@@ -9,7 +9,11 @@ import 'package:zhiying_base_widget/pages/security_page/widgets/security_bind_in | |||||
import 'package:zhiying_base_widget/pages/security_page/widgets/security_code_button.dart'; | import 'package:zhiying_base_widget/pages/security_page/widgets/security_code_button.dart'; | ||||
import 'package:zhiying_base_widget/pages/security_page/widgets/security_confirm_button.dart'; | import 'package:zhiying_base_widget/pages/security_page/widgets/security_confirm_button.dart'; | ||||
import 'package:zhiying_comm/zhiying_comm.dart'; | import 'package:zhiying_comm/zhiying_comm.dart'; | ||||
import 'package:zhiying_comm/util/mob_util/mob_util.dart'; | |||||
/// | |||||
/// 绑定手机号 | |||||
/// | |||||
class SecurityMobile extends StatefulWidget { | class SecurityMobile extends StatefulWidget { | ||||
final Map<String, dynamic> model; | final Map<String, dynamic> model; | ||||
@@ -37,8 +41,7 @@ class _SecurityMobileContainer extends StatefulWidget { | |||||
const _SecurityMobileContainer(this.model, {Key key}) : super(key: key); | const _SecurityMobileContainer(this.model, {Key key}) : super(key: key); | ||||
@override | @override | ||||
_SecurityMobileContainerState createState() => | |||||
_SecurityMobileContainerState(); | |||||
_SecurityMobileContainerState createState() => _SecurityMobileContainerState(); | |||||
} | } | ||||
class _SecurityMobileContainerState extends State<_SecurityMobileContainer> { | class _SecurityMobileContainerState extends State<_SecurityMobileContainer> { | ||||
@@ -74,8 +77,7 @@ class _SecurityMobileContainerState extends State<_SecurityMobileContainer> { | |||||
? Container() | ? Container() | ||||
: Container( | : Container( | ||||
width: double.infinity, | width: double.infinity, | ||||
padding: EdgeInsets.only( | |||||
left: 12.5, right: 12.5, top: 10, bottom: 10), | |||||
padding: EdgeInsets.only(left: 12.5, right: 12.5, top: 10, bottom: 10), | |||||
child: Text( | child: Text( | ||||
'请绑定新的手机号码,如未完成绑定将继续使用原手机号码', | '请绑定新的手机号码,如未完成绑定将继续使用原手机号码', | ||||
style: TextStyle(fontSize: 12, color: Color(0xff999999)), | style: TextStyle(fontSize: 12, color: Color(0xff999999)), | ||||
@@ -157,8 +159,7 @@ class _SecurityMobileContainerState extends State<_SecurityMobileContainer> { | |||||
} | } | ||||
void _verifiy() { | void _verifiy() { | ||||
bool canConfirm = | |||||
_phoneController.text.length > 0 && _codeController.text.length == 6; | |||||
bool canConfirm = _phoneController.text.length > 0 && _codeController.text.length == 6; | |||||
if (canConfirm != _canConfirm) { | if (canConfirm != _canConfirm) { | ||||
setState(() { | setState(() { | ||||
_canConfirm = canConfirm; | _canConfirm = canConfirm; | ||||
@@ -167,12 +168,25 @@ class _SecurityMobileContainerState extends State<_SecurityMobileContainer> { | |||||
} | } | ||||
void _sendCode() async { | void _sendCode() async { | ||||
NetUtil.request('/api/v1/settings/account/security/mobile/sms', | |||||
params: Map<String, dynamic>.from({ | |||||
'mobile': _phoneController.text, | |||||
}), | |||||
method: NetMethod.POST, onSuccess: (result) { | |||||
Logger.debug(result); | |||||
// NetUtil.request('/api/v1/settings/account/security/mobile/sms', | |||||
// params: Map<String, dynamic>.from({ | |||||
// 'mobile': _phoneController.text, | |||||
// }), | |||||
// method: NetMethod.POST, onSuccess: (result) { | |||||
// Logger.debug(result); | |||||
// Fluttertoast.showToast(msg: '发送成功'); | |||||
// _second = 60; | |||||
// Timer.periodic(Duration(seconds: 1), (timer) { | |||||
// _second--; | |||||
// if (_second <= 0) { | |||||
// timer.cancel(); | |||||
// } | |||||
// setState(() {}); | |||||
// }); | |||||
// }); | |||||
bool result = await MobUtil.getTextCode(_phoneController.text, smsCodeType: SMSCodeType.BIND_PHONE); | |||||
if (result) { | |||||
Fluttertoast.showToast(msg: '发送成功'); | Fluttertoast.showToast(msg: '发送成功'); | ||||
_second = 60; | _second = 60; | ||||
Timer.periodic(Duration(seconds: 1), (timer) { | Timer.periodic(Duration(seconds: 1), (timer) { | ||||
@@ -182,7 +196,9 @@ class _SecurityMobileContainerState extends State<_SecurityMobileContainer> { | |||||
} | } | ||||
setState(() {}); | setState(() {}); | ||||
}); | }); | ||||
}); | |||||
} else { | |||||
Fluttertoast.showToast(msg: '获取验证码失败'); | |||||
} | |||||
} | } | ||||
// 设置手机号,没有手机号的调这个😵 | // 设置手机号,没有手机号的调这个😵 | ||||
@@ -205,6 +221,8 @@ class _SecurityMobileContainerState extends State<_SecurityMobileContainer> { | |||||
params: Map<String, dynamic>.from({ | params: Map<String, dynamic>.from({ | ||||
'mobile': _phoneController.text, | 'mobile': _phoneController.text, | ||||
'valid_code': _codeController.text, | 'valid_code': _codeController.text, | ||||
'phone': _phoneController.text, | |||||
'zone': '86' | |||||
}), | }), | ||||
method: NetMethod.POST, onSuccess: (result) { | method: NetMethod.POST, onSuccess: (result) { | ||||
Logger.debug(result); | Logger.debug(result); | ||||
@@ -9,7 +9,11 @@ import 'package:zhiying_base_widget/pages/security_page/widgets/security_bind_in | |||||
import 'package:zhiying_base_widget/pages/security_page/widgets/security_code_button.dart'; | import 'package:zhiying_base_widget/pages/security_page/widgets/security_code_button.dart'; | ||||
import 'package:zhiying_base_widget/pages/security_page/widgets/security_confirm_button.dart'; | import 'package:zhiying_base_widget/pages/security_page/widgets/security_confirm_button.dart'; | ||||
import 'package:zhiying_comm/zhiying_comm.dart'; | import 'package:zhiying_comm/zhiying_comm.dart'; | ||||
import 'package:zhiying_comm/util/mob_util/mob_util.dart'; | |||||
/// | |||||
/// 接绑手机号 | |||||
/// | |||||
class SecurityMobileUnbind extends StatefulWidget { | class SecurityMobileUnbind extends StatefulWidget { | ||||
final Map<String, dynamic> model; | final Map<String, dynamic> model; | ||||
@@ -45,8 +49,7 @@ class _SecurityMobileUnbindState extends State<SecurityMobileUnbind> { | |||||
children: <Widget>[ | children: <Widget>[ | ||||
Container( | Container( | ||||
width: double.infinity, | width: double.infinity, | ||||
padding: | |||||
EdgeInsets.only(left: 12.5, right: 12.5, top: 10, bottom: 10), | |||||
padding: EdgeInsets.only(left: 12.5, right: 12.5, top: 10, bottom: 10), | |||||
child: Text( | child: Text( | ||||
'为了您的账户安全,将对原有手机号进行验证', | '为了您的账户安全,将对原有手机号进行验证', | ||||
style: TextStyle(fontSize: 12, color: Color(0xff999999)), | style: TextStyle(fontSize: 12, color: Color(0xff999999)), | ||||
@@ -136,9 +139,21 @@ class _SecurityMobileUnbindState extends State<SecurityMobileUnbind> { | |||||
} | } | ||||
void _sendCode() async { | void _sendCode() async { | ||||
NetUtil.request('/api/v1/settings/account/security/mobile/sms', | |||||
method: NetMethod.GET, onSuccess: (result) { | |||||
Logger.debug(result); | |||||
// NetUtil.request('/api/v1/settings/account/security/mobile/sms', | |||||
// method: NetMethod.GET, onSuccess: (result) { | |||||
// Logger.debug(result); | |||||
// Fluttertoast.showToast(msg: '发送成功'); | |||||
// _second = 60; | |||||
// Timer.periodic(Duration(seconds: 1), (timer) { | |||||
// _second--; | |||||
// if (_second <= 0) { | |||||
// timer.cancel(); | |||||
// } | |||||
// setState(() {}); | |||||
// }); | |||||
// }); | |||||
bool result = await MobUtil.getTextCode(_phone, smsCodeType: SMSCodeType.UNBIND_PHONE); | |||||
if (result) { | |||||
Fluttertoast.showToast(msg: '发送成功'); | Fluttertoast.showToast(msg: '发送成功'); | ||||
_second = 60; | _second = 60; | ||||
Timer.periodic(Duration(seconds: 1), (timer) { | Timer.periodic(Duration(seconds: 1), (timer) { | ||||
@@ -148,7 +163,9 @@ class _SecurityMobileUnbindState extends State<SecurityMobileUnbind> { | |||||
} | } | ||||
setState(() {}); | setState(() {}); | ||||
}); | }); | ||||
}); | |||||
} else { | |||||
Fluttertoast.showToast(msg: '获取验证码失败'); | |||||
} | |||||
} | } | ||||
// 解绑手机号 | // 解绑手机号 | ||||
@@ -156,12 +173,13 @@ class _SecurityMobileUnbindState extends State<SecurityMobileUnbind> { | |||||
NetUtil.request('/api/v1/settings/account/security/mobile/unbind', | NetUtil.request('/api/v1/settings/account/security/mobile/unbind', | ||||
params: Map<String, dynamic>.from({ | params: Map<String, dynamic>.from({ | ||||
'valid_code': _codeController.text, | 'valid_code': _codeController.text, | ||||
'phone': _phone, | |||||
'zone': '86' | |||||
}), | }), | ||||
method: NetMethod.POST, onSuccess: (result) { | method: NetMethod.POST, onSuccess: (result) { | ||||
_status['mobile_setting'] = '0'; | _status['mobile_setting'] = '0'; | ||||
_status['code'] = _codeController.text; | _status['code'] = _codeController.text; | ||||
Navigator.of(context).pushReplacement(CupertinoPageRoute( | |||||
builder: (context) => SecurityMobile(widget.model))); | |||||
Navigator.of(context).pushReplacement(CupertinoPageRoute(builder: (context) => SecurityMobile(widget.model))); | |||||
}); | }); | ||||
} | } | ||||
} | } |
@@ -5,6 +5,9 @@ import 'package:zhiying_base_widget/pages/security_page/security_page_bloc.dart' | |||||
import 'package:zhiying_comm/util/base_bloc.dart'; | import 'package:zhiying_comm/util/base_bloc.dart'; | ||||
import 'package:zhiying_comm/zhiying_comm.dart'; | import 'package:zhiying_comm/zhiying_comm.dart'; | ||||
/// | |||||
/// 账号安全 | |||||
/// | |||||
class SecurityPage extends StatefulWidget { | class SecurityPage extends StatefulWidget { | ||||
final Map<String, dynamic> data; | final Map<String, dynamic> data; | ||||
@@ -8,7 +8,11 @@ import 'package:zhiying_base_widget/pages/security_page/widgets/security_bind_in | |||||
import 'package:zhiying_base_widget/pages/security_page/widgets/security_code_button.dart'; | import 'package:zhiying_base_widget/pages/security_page/widgets/security_code_button.dart'; | ||||
import 'package:zhiying_base_widget/pages/security_page/widgets/security_confirm_button.dart'; | import 'package:zhiying_base_widget/pages/security_page/widgets/security_confirm_button.dart'; | ||||
import 'package:zhiying_comm/zhiying_comm.dart'; | import 'package:zhiying_comm/zhiying_comm.dart'; | ||||
import 'package:zhiying_comm/util/mob_util/mob_util.dart'; | |||||
/// | |||||
/// 修改密码页面 | |||||
/// | |||||
class SecurityPassword extends StatefulWidget { | class SecurityPassword extends StatefulWidget { | ||||
final Map<String, dynamic> model; | final Map<String, dynamic> model; | ||||
@@ -149,10 +153,10 @@ class _SecurityPasswordState extends State<SecurityPassword> { | |||||
} | } | ||||
} | } | ||||
/// 获取验证码 | |||||
void _sendCode() async { | void _sendCode() async { | ||||
NetUtil.request('/api/v1/settings/account/security/password/sms', | |||||
method: NetMethod.POST, onSuccess: (result) { | |||||
Logger.debug(result); | |||||
bool result = await MobUtil.getTextCode(_phone, smsCodeType: SMSCodeType.NORMAL); | |||||
if(result){ | |||||
Fluttertoast.showToast(msg: '发送成功'); | Fluttertoast.showToast(msg: '发送成功'); | ||||
_second = 60; | _second = 60; | ||||
Timer.periodic(Duration(seconds: 1), (timer) { | Timer.periodic(Duration(seconds: 1), (timer) { | ||||
@@ -162,7 +166,23 @@ class _SecurityPasswordState extends State<SecurityPassword> { | |||||
} | } | ||||
setState(() {}); | setState(() {}); | ||||
}); | }); | ||||
}); | |||||
}else{ | |||||
Fluttertoast.showToast(msg: '获取验证码失败'); | |||||
} | |||||
// NetUtil.request('/api/v1/settings/account/security/password/sms', | |||||
// method: NetMethod.POST, onSuccess: (result) { | |||||
// Logger.debug(result); | |||||
// Fluttertoast.showToast(msg: '发送成功'); | |||||
// _second = 60; | |||||
// Timer.periodic(Duration(seconds: 1), (timer) { | |||||
// _second--; | |||||
// if (_second <= 0) { | |||||
// timer.cancel(); | |||||
// } | |||||
// setState(() {}); | |||||
// }); | |||||
// }); | |||||
} | } | ||||
void _confirm() async { | void _confirm() async { | ||||
@@ -171,6 +191,8 @@ class _SecurityPasswordState extends State<SecurityPassword> { | |||||
'new_password': _passwordController.text, | 'new_password': _passwordController.text, | ||||
'new_password_ack': _confirmController.text, | 'new_password_ack': _confirmController.text, | ||||
'valid_code': _codeController.text, | 'valid_code': _codeController.text, | ||||
'phone': _phone, | |||||
'zone': '86' | |||||
}), | }), | ||||
method: NetMethod.POST, onSuccess: (result) { | method: NetMethod.POST, onSuccess: (result) { | ||||
Logger.debug(result); | Logger.debug(result); | ||||
@@ -9,6 +9,7 @@ import 'package:zhiying_base_widget/pages/security_page/widgets/security_bind_in | |||||
import 'package:zhiying_base_widget/pages/security_page/widgets/security_code_button.dart'; | import 'package:zhiying_base_widget/pages/security_page/widgets/security_code_button.dart'; | ||||
import 'package:zhiying_base_widget/pages/security_page/widgets/security_confirm_button.dart'; | import 'package:zhiying_base_widget/pages/security_page/widgets/security_confirm_button.dart'; | ||||
import 'package:zhiying_comm/zhiying_comm.dart'; | import 'package:zhiying_comm/zhiying_comm.dart'; | ||||
import 'package:zhiying_comm/util/mob_util/mob_util.dart'; | |||||
class SecurityUnbinAlipay extends StatefulWidget { | class SecurityUnbinAlipay extends StatefulWidget { | ||||
final Map<String, dynamic> model; | final Map<String, dynamic> model; | ||||
@@ -128,9 +129,22 @@ class _SecurityUnbinAlipayState extends State<SecurityUnbinAlipay> { | |||||
} | } | ||||
void _sendCode() async { | void _sendCode() async { | ||||
NetUtil.request('/api/v1/settings/account/security/alipay/sms', | |||||
method: NetMethod.GET, onSuccess: (result) { | |||||
Logger.debug(result); | |||||
// NetUtil.request('/api/v1/settings/account/security/alipay/sms', | |||||
// method: NetMethod.GET, onSuccess: (result) { | |||||
// Logger.debug(result); | |||||
// Fluttertoast.showToast(msg: '发送成功'); | |||||
// _second = 60; | |||||
// Timer.periodic(Duration(seconds: 1), (timer) { | |||||
// _second--; | |||||
// if (_second <= 0) { | |||||
// timer.cancel(); | |||||
// } | |||||
// setState(() {}); | |||||
// }); | |||||
// }); | |||||
bool result = await MobUtil.getTextCode(_status['mobile_setting_text'], smsCodeType: SMSCodeType.BIND_ALIPAY); | |||||
if (result) { | |||||
Fluttertoast.showToast(msg: '发送成功'); | Fluttertoast.showToast(msg: '发送成功'); | ||||
_second = 60; | _second = 60; | ||||
Timer.periodic(Duration(seconds: 1), (timer) { | Timer.periodic(Duration(seconds: 1), (timer) { | ||||
@@ -140,18 +154,23 @@ class _SecurityUnbinAlipayState extends State<SecurityUnbinAlipay> { | |||||
} | } | ||||
setState(() {}); | setState(() {}); | ||||
}); | }); | ||||
}); | |||||
} else { | |||||
Fluttertoast.showToast(msg: '获取验证码失败'); | |||||
} | |||||
} | } | ||||
void _unbind() async { | void _unbind() async { | ||||
NetUtil.request('/api/v1/settings/account/security/alipay/unbind', | NetUtil.request('/api/v1/settings/account/security/alipay/unbind', | ||||
params: Map<String, dynamic>.from({'valid_code': _codeController.text}), | |||||
params: Map<String, dynamic>.from({ | |||||
'valid_code': _codeController.text, | |||||
'phone': _status['mobile_setting_text'], | |||||
'zone': '86', | |||||
}), | |||||
method: NetMethod.POST, onSuccess: (result) { | method: NetMethod.POST, onSuccess: (result) { | ||||
Logger.debug(result); | Logger.debug(result); | ||||
Fluttertoast.showToast(msg: '解绑成功'); | Fluttertoast.showToast(msg: '解绑成功'); | ||||
_status['alipay_setting'] = '0'; | _status['alipay_setting'] = '0'; | ||||
Navigator.of(context).pushReplacement(CupertinoPageRoute( | |||||
builder: (context) => SecurityBindAlipayPage(widget.model))); | |||||
Navigator.of(context).pushReplacement(CupertinoPageRoute(builder: (context) => SecurityBindAlipayPage(widget.model))); | |||||
}); | }); | ||||
} | } | ||||
} | } |
@@ -79,8 +79,7 @@ import 'widgets/search/input/search_input_widget.dart'; | |||||
import 'widgets/search/tabbar/search_tab_creater.dart'; | import 'widgets/search/tabbar/search_tab_creater.dart'; | ||||
import 'widgets/search_result/goods_list/search_result_goods_list_creater.dart'; | import 'widgets/search_result/goods_list/search_result_goods_list_creater.dart'; | ||||
import 'widgets/search_result/search_input/search_result_input.dart'; | import 'widgets/search_result/search_input/search_result_input.dart'; | ||||
import 'package:secverify/secverify.dart'; | |||||
import 'package:zhiying_comm/util/second_test/second_test_util.dart'; | |||||
import 'package:zhiying_comm/util/mob_util/mob_util.dart'; | |||||
class BaseWidgetRegister { | class BaseWidgetRegister { | ||||
/// 初始化方法 | /// 初始化方法 | ||||
@@ -129,7 +128,7 @@ class BaseWidgetRegister { | |||||
}); | }); | ||||
// MOB 秒验 | // MOB 秒验 | ||||
SecondTestUtil.getInstance().init(); | |||||
MobUtil.init(); | |||||
Application.addMethod(() async { | Application.addMethod(() async { | ||||
return Future.delayed(Duration(seconds: 1)); | return Future.delayed(Duration(seconds: 1)); | ||||