Browse Source

短信验证码更改

dev
huixiang_app 1 year ago
parent
commit
89f5f58acc
  1. 47
      lib/login/captcha/block_puzzle_captcha.dart
  2. 5
      lib/login/captcha/click_word_captcha.dart
  3. 6
      lib/login/new_login_page.dart
  4. 6
      lib/setting/logout_ing.dart

47
lib/login/captcha/block_puzzle_captcha.dart

@ -3,6 +3,7 @@ import 'dart:math';
import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import '../../retrofit/retrofit_api.dart';
import '../../utils/captcha_util.dart';
@ -58,7 +59,7 @@ class _BlockPuzzleCaptchaPageState extends State<BlockPuzzleCaptchaPage>
//
GlobalKey _slideImageKey = new GlobalKey();
double _bottomSliderSize = 60;
double _bottomSliderSize = 60.h;
//------------------------
@ -293,7 +294,7 @@ class _BlockPuzzleCaptchaPageState extends State<BlockPuzzleCaptchaPage>
child: Container(
key: _containerKey,
width: dialogWidth,
height: 340,
height: 340.h,
color: Colors.white,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
@ -312,10 +313,10 @@ class _BlockPuzzleCaptchaPageState extends State<BlockPuzzleCaptchaPage>
///+
_topContainer() {
return Container(
height: 50,
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
height: 50.h,
padding: EdgeInsets.fromLTRB(10.w, 0, 10.w, 0),
decoration: BoxDecoration(
border: Border(bottom: BorderSide(width: 1, color: Color(0xffe5e5e5))),
border: Border(bottom: BorderSide(width: 1.w, color: Color(0xffe5e5e5))),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -340,7 +341,7 @@ class _BlockPuzzleCaptchaPageState extends State<BlockPuzzleCaptchaPage>
_middleContainer() {
////
return Container(
margin: EdgeInsets.symmetric(vertical: 10),
margin: EdgeInsets.symmetric(vertical: 10.h),
child: Stack(
children: <Widget>[
/// 310*155
@ -352,14 +353,14 @@ class _BlockPuzzleCaptchaPageState extends State<BlockPuzzleCaptchaPage>
gaplessPlayback: true,
)
: Container(
width: 310,
height: 155,
width: 310.w,
height: 155.h,
alignment: Alignment.center,
child: CircularProgressIndicator(),
),
///
slideImageBase64.length > 0
(baseImageBase64.length > 0 && slideImageBase64.length > 0)
? Container(
margin: EdgeInsets.fromLTRB(sliderXMoved, 0, 0, 0),
child: Image.memory(
@ -386,15 +387,15 @@ class _BlockPuzzleCaptchaPageState extends State<BlockPuzzleCaptchaPage>
),
Positioned(
bottom: 0,
left: -10,
right: -10,
left: -10.w,
right: -10.w,
child: Offstage(
offstage: !_showTimeLine,
child: FractionalTranslation(
translation: Offset(0, offsetAnimation.value),
child: Container(
margin: EdgeInsets.only(left: 10, right: 10),
height: 40,
margin: EdgeInsets.only(left: 10.w, right: 10.w),
height: 40.h,
color: _checkSuccess
? Color(0x7F66BB6A)
: Color.fromRGBO(200, 100, 100, 0.4),
@ -409,14 +410,14 @@ class _BlockPuzzleCaptchaPageState extends State<BlockPuzzleCaptchaPage>
),
)),
Positioned(
bottom: -20,
bottom: -20.h,
left: 0,
right: 0,
child: Offstage(
offstage: !_showTimeLine,
child: Container(
margin: EdgeInsets.only(left: 10, right: 10),
height: 20,
margin: EdgeInsets.only(left: 10.w, right: 10.w),
height: 20.h,
color: Colors.white,
),
))
@ -429,7 +430,7 @@ class _BlockPuzzleCaptchaPageState extends State<BlockPuzzleCaptchaPage>
_bottomContainer() {
return baseSize.width > 0
? Container(
height: 70,
height: 70.h,
width: baseSize.width,
// color: Colors.cyanAccent,
child: Stack(
@ -439,7 +440,7 @@ class _BlockPuzzleCaptchaPageState extends State<BlockPuzzleCaptchaPage>
height: _bottomSliderSize,
decoration: BoxDecoration(
border: Border.all(
width: 1,
width: 1.w,
color: Color(0xffe5e5e5),
),
color: Color(0xfff8f9fb),
@ -449,12 +450,12 @@ class _BlockPuzzleCaptchaPageState extends State<BlockPuzzleCaptchaPage>
alignment: Alignment.center,
child: Text(
'向右拖动滑块填充拼图',
style: TextStyle(fontSize: 16),
style: TextStyle(fontSize: 16.sp),
),
),
Container(
width: sliderXMoved,
height: _bottomSliderSize - 2,
height: _bottomSliderSize - 2.h,
decoration: BoxDecoration(
border: Border.all(
width: sliderXMoved > 0 ? 1 : 0,
@ -506,15 +507,15 @@ class _BlockPuzzleCaptchaPageState extends State<BlockPuzzleCaptchaPage>
decoration: BoxDecoration(
border: Border(
top: BorderSide(
width: 1,
width: 1.w,
color: Color(0xffe5e5e5),
),
right: BorderSide(
width: 1,
width: 1.w,
color: Color(0xffe5e5e5),
),
bottom: BorderSide(
width: 1,
width: 1.w,
color: Color(0xffe5e5e5),
),
),

5
lib/login/captcha/click_word_captcha.dart

@ -2,6 +2,7 @@ import 'dart:convert';
import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import '../../retrofit/retrofit_api.dart';
import '../../utils/captcha_util.dart';
@ -178,7 +179,7 @@ class _ClickWordCaptchaState extends State<ClickWordCaptcha> {
body: Center(
child: Container(
width: dialogWidth,
height: 320,
height: 320.h,
color: Colors.white,
child: Column(
children: <Widget>[
@ -264,7 +265,7 @@ class _ClickWordCaptchaState extends State<ClickWordCaptcha> {
//
_bottomContainer() {
return Container(
height: 50,
height: 50.h,
margin: EdgeInsets.only(top: 10),
alignment: Alignment.center,
width: baseSize.width,

6
lib/login/new_login_page.dart

@ -961,7 +961,7 @@ class _NewLoginPage extends State<NewLoginPage> {
builder: (BuildContext context) {
return BlockPuzzleCaptchaPage(
onSuccess: (v) {
sendSms();
sendSms(v);
},
onFail: () {
print("onFail");
@ -971,8 +971,8 @@ class _NewLoginPage extends State<NewLoginPage> {
);
}
sendSms() async{
BaseData baseData = await apiService.sendVerify({"areaCode":area, "mobile": mobile, "verification": ""}).catchError((onError) {
sendSms(v) async{
BaseData baseData = await apiService.sendVerify({"areaCode":area, "mobile": mobile, "verification": v}).catchError((onError) {
SmartDialog.showToast(AppUtils.dioErrorTypeToString(onError.type),
alignment: Alignment.center);});
if (baseData != null && baseData.isSuccess) {

6
lib/setting/logout_ing.dart

@ -77,7 +77,7 @@ class _LogoutIng extends State<LogoutIng> {
loadingBlockPuzzle(context);
}
sendProving() async{
sendProving(v) async{
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(
@ -87,7 +87,7 @@ class _LogoutIng extends State<LogoutIng> {
showLoading: true
);
}
BaseData baseData = await apiService.sendVerify({"areaCode": "+86", "mobile": phoneController.text, "verification": ""}).catchError((onError) {});
BaseData baseData = await apiService.sendVerify({"areaCode": "+86", "mobile": phoneController.text, "verification": v}).catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
countdown();
SmartDialog.showToast(baseData.data,
@ -512,7 +512,7 @@ class _LogoutIng extends State<LogoutIng> {
builder: (BuildContext context) {
return BlockPuzzleCaptchaPage(
onSuccess: (v) {
sendProving();
sendProving(v);
},
onFail: () {
print("onFail");

Loading…
Cancel
Save