|
@@ -1,4 +1,5 @@
|
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
+import 'package:flutter/services.dart';
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
import 'package:city_pickers/city_pickers.dart';
|
|
import 'package:city_pickers/city_pickers.dart';
|
|
|
import 'package:flutter_picker/flutter_picker.dart';
|
|
import 'package:flutter_picker/flutter_picker.dart';
|
|
@@ -64,7 +65,7 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
String sendCompanyAreaName = ''; //寄件公司区名称 不能为空
|
|
String sendCompanyAreaName = ''; //寄件公司区名称 不能为空
|
|
|
String sendCompanyAreaCode = ''; //寄件公司区编码 不能为空
|
|
String sendCompanyAreaCode = ''; //寄件公司区编码 不能为空
|
|
|
String sendCompanyAddress = ''; //寄件公司详细地址,不能为空
|
|
String sendCompanyAddress = ''; //寄件公司详细地址,不能为空
|
|
|
- String receiptCompanyId='0'; //收件公司id
|
|
|
|
|
|
|
+ String receiptCompanyId = '0'; //收件公司id
|
|
|
String receiptCompanyPhone = ''; //收件公司电话 不能为空
|
|
String receiptCompanyPhone = ''; //收件公司电话 不能为空
|
|
|
String receiptCompanyName = ''; //收件公司名称 不能为空
|
|
String receiptCompanyName = ''; //收件公司名称 不能为空
|
|
|
String receiptCompanyProvinceName = ''; //收件公司省名称 不能为空
|
|
String receiptCompanyProvinceName = ''; //收件公司省名称 不能为空
|
|
@@ -128,21 +129,15 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
//if (_scrollController.position.pixels == _scrollController.position.maxScrollExtent) {}
|
|
//if (_scrollController.position.pixels == _scrollController.position.maxScrollExtent) {}
|
|
|
});
|
|
});
|
|
|
sendCompanyPhoneController.addListener(() {
|
|
sendCompanyPhoneController.addListener(() {
|
|
|
- if(int.tryParse(sendCompanyPhoneController.text)==null){
|
|
|
|
|
- sendCompanyPhoneController.text = sendCompanyPhone;
|
|
|
|
|
- }
|
|
|
|
|
- if(sendCompanyPhoneController.text.length>11){
|
|
|
|
|
- sendCompanyPhoneController.text = sendCompanyPhone;
|
|
|
|
|
- }
|
|
|
|
|
- print(sendCompanyAddreddController);
|
|
|
|
|
- print(sendCompanyPhoneController.text);
|
|
|
|
|
- setState(() {
|
|
|
|
|
- sendCompanyPhone = sendCompanyPhoneController.text;
|
|
|
|
|
- });
|
|
|
|
|
|
|
+
|
|
|
|
|
+ setState(() {
|
|
|
|
|
+ sendCompanyPhone = sendCompanyPhoneController.text;
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
if (timer != null) {
|
|
if (timer != null) {
|
|
|
timer.cancel();
|
|
timer.cancel();
|
|
|
}
|
|
}
|
|
|
- if (sendCompanyPhoneController.text.length < 6 || sendCompanyPhoneController.text.length >= 11) {
|
|
|
|
|
|
|
+ if (sendCompanyPhoneController.text.length < 6 || sendCompanyPhoneController.text.length > 11) {
|
|
|
setState(() {
|
|
setState(() {
|
|
|
tipStatus = true;
|
|
tipStatus = true;
|
|
|
});
|
|
});
|
|
@@ -175,13 +170,16 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
receiptCompanyPhoneController.addListener(() {
|
|
receiptCompanyPhoneController.addListener(() {
|
|
|
- setState(() {
|
|
|
|
|
- receiptCompanyPhone = receiptCompanyPhoneController.text;
|
|
|
|
|
- });
|
|
|
|
|
|
|
+
|
|
|
|
|
+ setState(() {
|
|
|
|
|
+ receiptCompanyPhone = receiptCompanyPhoneController.text;
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
if (timer != null) {
|
|
if (timer != null) {
|
|
|
timer.cancel();
|
|
timer.cancel();
|
|
|
}
|
|
}
|
|
|
- if (receiptCompanyPhoneController.text.length < 6 || receiptCompanyPhoneController.text.length >= 11) {
|
|
|
|
|
|
|
+ if (receiptCompanyPhoneController.text.length < 6 || receiptCompanyPhoneController.text.length > 11) {
|
|
|
setState(() {
|
|
setState(() {
|
|
|
tipStatus = true;
|
|
tipStatus = true;
|
|
|
});
|
|
});
|
|
@@ -394,7 +392,6 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
child: Row(
|
|
child: Row(
|
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
|
children: < Widget > [
|
|
children: < Widget > [
|
|
|
- //Text('${value}', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(136, 136, 136, 1)), ),
|
|
|
|
|
SizedBox(
|
|
SizedBox(
|
|
|
width: ScreenUtil.getInstance().setWidth(500),
|
|
width: ScreenUtil.getInstance().setWidth(500),
|
|
|
child: TextField(
|
|
child: TextField(
|
|
@@ -429,8 +426,7 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
)
|
|
)
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
Widget _contentWiget(String key, String type, [bool keyboardType = false]) { //false是数字键盘
|
|
Widget _contentWiget(String key, String type, [bool keyboardType = false]) { //false是数字键盘
|
|
|
return Padding(
|
|
return Padding(
|
|
|
padding: EdgeInsets.only(left: ScreenUtil.getInstance().setWidth(30)),
|
|
padding: EdgeInsets.only(left: ScreenUtil.getInstance().setWidth(30)),
|
|
@@ -741,16 +737,23 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
if (goods == '') {
|
|
if (goods == '') {
|
|
|
errStr = '请填写货物名称';
|
|
errStr = '请填写货物名称';
|
|
|
}
|
|
}
|
|
|
- if (goodsQuantity == 0.0) {
|
|
|
|
|
|
|
+ if (goodsQuantity == 0) {
|
|
|
errStr = '请填写货物数量';
|
|
errStr = '请填写货物数量';
|
|
|
|
|
+ }
|
|
|
|
|
+ if(int.tryParse(goodsQuantity.toString())==null){
|
|
|
|
|
+ errStr='货物数量格式错误';
|
|
|
}
|
|
}
|
|
|
if (goodsFreight == 0.0) {
|
|
if (goodsFreight == 0.0) {
|
|
|
errStr = '请填写运费';
|
|
errStr = '请填写运费';
|
|
|
}
|
|
}
|
|
|
|
|
+ if(int.tryParse(sendCompanyPhone)==null || int.tryParse(receiptCompanyPhone)==null || sendCompanyPhone.length!=11 || receiptCompanyPhone.length!=11){
|
|
|
|
|
+ errStr='请输入正确的电话';
|
|
|
|
|
+ }
|
|
|
if (errStr != '') {
|
|
if (errStr != '') {
|
|
|
showError(errStr);
|
|
showError(errStr);
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
+ return;
|
|
|
setState(() {
|
|
setState(() {
|
|
|
submitStatus = false;
|
|
submitStatus = false;
|
|
|
});
|
|
});
|