update change tel phone page

hmxc
张萌 4 years ago
parent 26523115a7
commit 727333af5f

@ -22,6 +22,9 @@ class _Login {
/// app
String get signUp => '/login/register';
///
String get sendNewMSCode => '/user/personalData/sendTelUpdateCode';
}
class _User {
@ -38,15 +41,16 @@ class _User {
String get logout => '/user/signOut';
///
String get updateNickName =>'/user/personalData/updateNickName';
String get updateNickName => '/user/personalData/updateNickName';
///
String get updateTel =>'/user/personalData/updateTel';
String get updateTel => '/user/personalData/updateTel';
}
class _Manager {
///
String get commiteeStaff => '/ownersCommittee/findAll';
///便
String get convenientPhone => '/convenientTelephone/list';
}

@ -6,7 +6,6 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:multi_image_picker/multi_image_picker.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:akuCommunity/const/resource.dart';

@ -7,6 +7,7 @@ import 'package:akuCommunity/widget/bee_scaffold.dart';
import 'package:bot_toast/bot_toast.dart';
import 'package:flustars/flustars.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:get/get.dart';
import 'package:provider/provider.dart';
import 'package:velocity_x/velocity_x.dart';
@ -71,6 +72,9 @@ class _UpdateTelPageState extends State<UpdateTelPage> {
55.heightBox,
'旧号码'.text.black.size(28.sp).make(),
TextFormField(
inputFormatters: [
FilteringTextInputFormatter.allow(RegExp(r'[0-9]*'))
],
controller: _oldTelController,
decoration: InputDecoration(
contentPadding: EdgeInsets.zero,
@ -87,14 +91,20 @@ class _UpdateTelPageState extends State<UpdateTelPage> {
24.heightBox,
'新号码'.text.black.size(28.sp).make(),
TextFormField(
inputFormatters: [
FilteringTextInputFormatter.allow(RegExp(r'[0-9]*')),
],
controller: _newTelController,
onChanged: (value) {
setState(() {});
},
decoration: InputDecoration(
suffixIconConstraints:
BoxConstraints(minHeight: 0.w, minWidth: 0.w),
suffixIcon: MaterialButton(
onPressed: _canGetCode
? () {
SignFunc.sendMessageCode(_newTelController.text);
SignFunc.sendNewMessageCode(_newTelController.text);
startTick();
}
: () {},
@ -134,6 +144,9 @@ class _UpdateTelPageState extends State<UpdateTelPage> {
24.heightBox,
'验证码'.text.black.size(28.sp).make(),
TextFormField(
inputFormatters: [
FilteringTextInputFormatter.allow(RegExp(r'[0-9]*'))
],
controller: _codeController,
decoration: InputDecoration(
contentPadding: EdgeInsets.zero,

@ -19,7 +19,14 @@ class SignFunc {
);
return baseModel;
}
static Future sendNewMessageCode(String newTel) async{
BaseModel baseModel =await NetUtil().post(
API.login.sendNewMSCode,
params: {'newTel':newTel},
showMessage: true,
);
return baseModel;
}
static Future<Response> login(String phone, String code) async {
Response response = await NetUtil().dio.post(
API.login.loginBySMS,

Loading…
Cancel
Save