|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
|
|
|
import 'package:huixiang/generated/l10n.dart';
|
|
|
|
import 'package:huixiang/utils/font_weight.dart';
|
|
|
|
import 'package:pin_input_text_field/pin_input_text_field.dart';
|
|
|
|
|
|
|
|
class PlatformPayCode extends StatefulWidget {
|
|
|
|
final Map<String, dynamic> arguments;
|
|
|
|
PlatformPayCode({required this.arguments});
|
|
|
|
|
|
|
|
@override
|
|
|
|
State<StatefulWidget> createState() {
|
|
|
|
return _PlatformPayCode();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class _PlatformPayCode extends State<PlatformPayCode> {
|
|
|
|
String inputCode = "";
|
|
|
|
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
super.initState();
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return GestureDetector(
|
|
|
|
behavior: HitTestBehavior.translucent,
|
|
|
|
onTap: () {
|
|
|
|
FocusScope.of(context).requestFocus(FocusNode());
|
|
|
|
},
|
|
|
|
child: Scaffold(
|
|
|
|
appBar: AppBar(
|
|
|
|
backgroundColor: Colors.white,
|
|
|
|
leading: GestureDetector(
|
|
|
|
child: Icon(
|
|
|
|
Icons.arrow_back_ios,
|
|
|
|
color: Colors.black,
|
|
|
|
),
|
|
|
|
onTap: () {
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
}),
|
|
|
|
title: Text(
|
|
|
|
S.of(context).pingtaizhifumima,
|
|
|
|
style: TextStyle(
|
|
|
|
fontWeight: MyFontWeight.regular,
|
|
|
|
fontSize: 17,
|
|
|
|
color: Color(0xFF0D0D0D),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
centerTitle: true,
|
|
|
|
elevation: 0.0,
|
|
|
|
),
|
|
|
|
body: Column(
|
|
|
|
children: [
|
|
|
|
settingCode(),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
));
|
|
|
|
}
|
|
|
|
|
|
|
|
///设置密码
|
|
|
|
Widget settingCode(){
|
|
|
|
return Container(
|
|
|
|
alignment: Alignment.center,
|
|
|
|
margin: EdgeInsets.only(top: 28),
|
|
|
|
child: Column(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
"请输入6位数字密码",
|
|
|
|
style: TextStyle(
|
|
|
|
fontWeight: MyFontWeight.semi_bold,
|
|
|
|
fontSize: 18,
|
|
|
|
color: Color(0xFF353535),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
SizedBox(
|
|
|
|
height: 12,
|
|
|
|
),
|
|
|
|
Text(
|
|
|
|
"将用于海峡姐妹APP下单时平台余额消费",
|
|
|
|
style: TextStyle(
|
|
|
|
fontWeight: MyFontWeight.medium,
|
|
|
|
fontSize: 14,
|
|
|
|
color: Color(0xFFA29E9E),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
margin: EdgeInsets.only(top: 24, bottom: 31,right: 35,left: 35),
|
|
|
|
height: 45,
|
|
|
|
child: PinInputTextField(
|
|
|
|
onChanged: (txtCode){
|
|
|
|
print(txtCode);
|
|
|
|
setState(() {
|
|
|
|
inputCode = txtCode;
|
|
|
|
});
|
|
|
|
},
|
|
|
|
decoration: BoxLooseDecoration(
|
|
|
|
strokeColorBuilder: FixedColorBuilder(Color(0xFFEBEAEA)),
|
|
|
|
textStyle: TextStyle(
|
|
|
|
fontWeight: MyFontWeight.medium,
|
|
|
|
fontSize: 18,
|
|
|
|
color: Color(0xFF353535),
|
|
|
|
),
|
|
|
|
radius: Radius.circular(4),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
GestureDetector(
|
|
|
|
onTap: (){
|
|
|
|
setState(() {
|
|
|
|
if(inputCode.length == 6){
|
|
|
|
Navigator.of(context).pushReplacementNamed('/router/platform_pay_code_success',arguments:{
|
|
|
|
"inputCode":inputCode,
|
|
|
|
"inputText":widget.arguments["inputText"]
|
|
|
|
});
|
|
|
|
}else{
|
|
|
|
SmartDialog.showToast("请输入6位数字密码", alignment: Alignment.center);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
width: 163,
|
|
|
|
height: 46,
|
|
|
|
alignment: Alignment.center,
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: inputCode.length == 6 ? Color(0xFF32A060):Color(0xFFBBE7CC),
|
|
|
|
borderRadius: BorderRadius.circular(23),
|
|
|
|
),
|
|
|
|
child: Text(
|
|
|
|
"下一步",
|
|
|
|
style: TextStyle(
|
|
|
|
fontWeight: MyFontWeight.semi_bold,
|
|
|
|
fontSize: 18,
|
|
|
|
color: Color(0xFFFFFFFF),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|