|
@@ -31,6 +31,9 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
//组件自用字段-----------------------------
|
|
//组件自用字段-----------------------------
|
|
|
GlobalKey _sendPhoneKey = GlobalKey();
|
|
GlobalKey _sendPhoneKey = GlobalKey();
|
|
|
GlobalKey _getPhoneKey = GlobalKey();
|
|
GlobalKey _getPhoneKey = GlobalKey();
|
|
|
|
|
+ GlobalKey _sendCompanyCodeKey = GlobalKey();
|
|
|
|
|
+ GlobalKey _sendCompanyNameKey = GlobalKey();
|
|
|
|
|
+ GlobalKey _getCompanyNameKey = GlobalKey();
|
|
|
|
|
|
|
|
double tipWidth = 0;
|
|
double tipWidth = 0;
|
|
|
double tipHeight = 0;
|
|
double tipHeight = 0;
|
|
@@ -158,6 +161,8 @@ 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(checkedCompanyInfo){
|
|
if(checkedCompanyInfo){
|
|
|
return;
|
|
return;
|
|
@@ -202,6 +207,97 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+ //发件公司编码监听
|
|
|
|
|
+ sendCompanyCodeController.addListener(() {
|
|
|
|
|
+ if(checkedCompanyInfo){
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ setState(() {
|
|
|
|
|
+ sendCompanyCode = sendCompanyCodeController.text;
|
|
|
|
|
+
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ if (timer != null) {
|
|
|
|
|
+ timer.cancel();
|
|
|
|
|
+ }
|
|
|
|
|
+ if (sendCompanyCodeController.text.length < 2 || sendCompanyCodeController.text.length > 6) {
|
|
|
|
|
+ setState(() {
|
|
|
|
|
+ tipStatus = true;
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ timer = Timer(Duration(milliseconds: 250), () {
|
|
|
|
|
+ if (sendCompanyCodeController.text.length >= 2 && sendCompanyCodeController.text.length <= 6) {
|
|
|
|
|
+ likeCompanyCode(sendCompanyCodeController.text).then((resp) {
|
|
|
|
|
+ if (isNotError(context, resp) && this.mounted) {
|
|
|
|
|
+ LikePhone likePhoneObj = LikePhone.fromJson(resp.data);
|
|
|
|
|
+ likePhoneList = likePhoneObj.data;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (likePhoneList.length > 0) {
|
|
|
|
|
+ sendPhoneOrGetPhoneTab = true;
|
|
|
|
|
+ RenderObject sendPhoneObj = _sendCompanyCodeKey.currentContext.findRenderObject();
|
|
|
|
|
+ setState(() {
|
|
|
|
|
+ tipWidth = sendPhoneObj.paintBounds.size.width;
|
|
|
|
|
+ tipHeight = sendPhoneObj.paintBounds.size.height;
|
|
|
|
|
+ tipPosX = sendPhoneObj.getTransformTo(null).getTranslation().x;
|
|
|
|
|
+ tipPosY = sendPhoneObj.getTransformTo(null).getTranslation().y - ScreenUtil.getInstance().setHeight(90);
|
|
|
|
|
+ tipStatus = false;
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ setState(() {
|
|
|
|
|
+ tipStatus = true;
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ //发件公司名字监听
|
|
|
|
|
+ sendCompanyNameController.addListener(() {
|
|
|
|
|
+ if(checkedCompanyInfo){
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ setState(() {
|
|
|
|
|
+ sendCompanyName = sendCompanyNameController.text;
|
|
|
|
|
+
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ if (timer != null) {
|
|
|
|
|
+ timer.cancel();
|
|
|
|
|
+ }
|
|
|
|
|
+ if (sendCompanyNameController.text.length < 2 || sendCompanyNameController.text.length > 11) {
|
|
|
|
|
+ setState(() {
|
|
|
|
|
+ tipStatus = true;
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ timer = Timer(Duration(milliseconds: 250), () {
|
|
|
|
|
+ if (sendCompanyNameController.text.length >= 2 && sendCompanyNameController.text.length <= 11) {
|
|
|
|
|
+ likeCompanyName(sendCompanyNameController.text).then((resp) {
|
|
|
|
|
+ if (isNotError(context, resp) && this.mounted) {
|
|
|
|
|
+ LikePhone likePhoneObj = LikePhone.fromJson(resp.data);
|
|
|
|
|
+ likePhoneList = likePhoneObj.data;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (likePhoneList.length > 0) {
|
|
|
|
|
+ sendPhoneOrGetPhoneTab = true;
|
|
|
|
|
+ RenderObject sendPhoneObj = _sendCompanyNameKey.currentContext.findRenderObject();
|
|
|
|
|
+ setState(() {
|
|
|
|
|
+ tipWidth = sendPhoneObj.paintBounds.size.width;
|
|
|
|
|
+ tipHeight = sendPhoneObj.paintBounds.size.height;
|
|
|
|
|
+ tipPosX = sendPhoneObj.getTransformTo(null).getTranslation().x;
|
|
|
|
|
+ tipPosY = sendPhoneObj.getTransformTo(null).getTranslation().y - ScreenUtil.getInstance().setHeight(90);
|
|
|
|
|
+ tipStatus = false;
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ setState(() {
|
|
|
|
|
+ tipStatus = true;
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ //收件公司电话监听
|
|
|
receiptCompanyPhoneController.addListener(() {
|
|
receiptCompanyPhoneController.addListener(() {
|
|
|
if(checkedCompanyInfo){
|
|
if(checkedCompanyInfo){
|
|
|
return;
|
|
return;
|
|
@@ -246,6 +342,51 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+ //收件公司名称监听
|
|
|
|
|
+ receiptCompanyNameController.addListener(() {
|
|
|
|
|
+ if(checkedCompanyInfo){
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ setState(() {
|
|
|
|
|
+ receiptCompanyName = receiptCompanyNameController.text;
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ if (timer != null) {
|
|
|
|
|
+ timer.cancel();
|
|
|
|
|
+ }
|
|
|
|
|
+ if (receiptCompanyNameController.text.length < 2 || receiptCompanyNameController.text.length > 11) {
|
|
|
|
|
+ setState(() {
|
|
|
|
|
+ tipStatus = true;
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ timer = Timer(Duration(milliseconds: 250), () {
|
|
|
|
|
+ if (receiptCompanyNameController.text.length >= 2 && receiptCompanyNameController.text.length <= 11) {
|
|
|
|
|
+ likeCompanyName(receiptCompanyNameController.text).then((resp) {
|
|
|
|
|
+ if (isNotError(context, resp) && this.mounted) {
|
|
|
|
|
+ LikePhone likePhoneObj = LikePhone.fromJson(resp.data);
|
|
|
|
|
+ likePhoneList = likePhoneObj.data;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (likePhoneList.length > 0) {
|
|
|
|
|
+ sendPhoneOrGetPhoneTab = false;
|
|
|
|
|
+ RenderObject getPhoneKey = _getCompanyNameKey.currentContext.findRenderObject();
|
|
|
|
|
+ setState(() {
|
|
|
|
|
+ tipWidth = getPhoneKey.paintBounds.size.width;
|
|
|
|
|
+ tipHeight = getPhoneKey.paintBounds.size.height;
|
|
|
|
|
+ tipPosX = getPhoneKey.getTransformTo(null).getTranslation().x;
|
|
|
|
|
+ tipPosY = getPhoneKey.getTransformTo(null).getTranslation().y - ScreenUtil.getInstance().setHeight(90);
|
|
|
|
|
+ tipStatus = false;
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ setState(() {
|
|
|
|
|
+ tipStatus = true;
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
sendCompanyAddressController.addListener(() {
|
|
sendCompanyAddressController.addListener(() {
|
|
|
setState(() {
|
|
setState(() {
|
|
|
sendCompanyAddress = sendCompanyAddressController.text;
|
|
sendCompanyAddress = sendCompanyAddressController.text;
|
|
@@ -338,9 +479,9 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
children: < Widget > [
|
|
children: < Widget > [
|
|
|
_titleWidget('lib/images/icon_send.png', '发件信息'),
|
|
_titleWidget('lib/images/icon_send.png', '发件信息'),
|
|
|
_underLine(),
|
|
_underLine(),
|
|
|
- _inputWiget('电话', 'sendPhone'),
|
|
|
|
|
- _contentWiget('企业编码', 'send', true),
|
|
|
|
|
- _contentWiget('企业名称', 'send', true),
|
|
|
|
|
|
|
+ _inputWiget('send_phone','发件电话', _sendPhoneKey,sendCompanyPhoneController),
|
|
|
|
|
+ _inputWiget('send_code','企业编码', _sendCompanyCodeKey, sendCompanyCodeController,true),
|
|
|
|
|
+ _inputWiget('send_name','企业名称', _sendCompanyNameKey, sendCompanyNameController,true),
|
|
|
_cityWiget('城市/区域', context, 'send'),
|
|
_cityWiget('城市/区域', context, 'send'),
|
|
|
_lastContentWiget('详细地址', 'send')
|
|
_lastContentWiget('详细地址', 'send')
|
|
|
],
|
|
],
|
|
@@ -356,8 +497,8 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
children: < Widget > [
|
|
children: < Widget > [
|
|
|
_titleWidget('lib/images/icon_shoujian.png', '收件信息'),
|
|
_titleWidget('lib/images/icon_shoujian.png', '收件信息'),
|
|
|
_underLine(),
|
|
_underLine(),
|
|
|
- _inputWiget('电话', 'getPhone'),
|
|
|
|
|
- _contentWiget('企业名称', 'get', true),
|
|
|
|
|
|
|
+ _inputWiget('get_phone','收件电话', _getPhoneKey,receiptCompanyPhoneController),
|
|
|
|
|
+ _inputWiget('get_name','企业名称', _getCompanyNameKey,receiptCompanyNameController ,true),
|
|
|
_cityWiget('城市/区域', context, 'get'),
|
|
_cityWiget('城市/区域', context, 'get'),
|
|
|
_lastContentWiget('详细地址', 'get')
|
|
_lastContentWiget('详细地址', 'get')
|
|
|
],
|
|
],
|
|
@@ -439,9 +580,9 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- Widget _inputWiget(String key, String tab) {
|
|
|
|
|
|
|
+ Widget _inputWiget(String key,String title GlobalKey tab,TextEditingController tab1,[bool keyboardType = false]) {
|
|
|
return Padding(
|
|
return Padding(
|
|
|
- key: tab == 'sendPhone' ? _sendPhoneKey : _getPhoneKey,
|
|
|
|
|
|
|
+ key: tab,
|
|
|
padding: EdgeInsets.only(left: ScreenUtil.getInstance().setWidth(30)),
|
|
padding: EdgeInsets.only(left: ScreenUtil.getInstance().setWidth(30)),
|
|
|
child: Column(
|
|
child: Column(
|
|
|
children: < Widget > [
|
|
children: < Widget > [
|
|
@@ -453,7 +594,7 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
children: < Widget > [
|
|
children: < Widget > [
|
|
|
Expanded(
|
|
Expanded(
|
|
|
flex: 0,
|
|
flex: 0,
|
|
|
- child: Text(key, style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(74, 74, 74, 1)), ),
|
|
|
|
|
|
|
+ child: Text(title, style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(74, 74, 74, 1)), ),
|
|
|
),
|
|
),
|
|
|
Expanded(
|
|
Expanded(
|
|
|
child: Row(
|
|
child: Row(
|
|
@@ -464,8 +605,8 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
child: Padding(
|
|
child: Padding(
|
|
|
padding: EdgeInsets.only(right: ScreenUtil.getInstance().setWidth(30)),
|
|
padding: EdgeInsets.only(right: ScreenUtil.getInstance().setWidth(30)),
|
|
|
child: TextField(
|
|
child: TextField(
|
|
|
- controller: tab == 'sendPhone' ? sendCompanyPhoneController : receiptCompanyPhoneController,
|
|
|
|
|
- keyboardType: TextInputType.number,
|
|
|
|
|
|
|
+ controller: tab1,
|
|
|
|
|
+ keyboardType: keyboardType ? TextInputType.text : TextInputType.number,
|
|
|
textAlign: TextAlign.end,
|
|
textAlign: TextAlign.end,
|
|
|
decoration: InputDecoration(
|
|
decoration: InputDecoration(
|
|
|
border: InputBorder.none
|
|
border: InputBorder.none
|
|
@@ -478,7 +619,7 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
},
|
|
},
|
|
|
onChanged: (value){
|
|
onChanged: (value){
|
|
|
checkedCompanyInfo = false;
|
|
checkedCompanyInfo = false;
|
|
|
- if(tab=='sendPhone'){
|
|
|
|
|
|
|
+ if(key=='send_phone'){
|
|
|
sendCompanyCode = '';
|
|
sendCompanyCode = '';
|
|
|
sendCompanyName = '';
|
|
sendCompanyName = '';
|
|
|
sendCompanyId ='0';
|
|
sendCompanyId ='0';
|
|
@@ -499,7 +640,7 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
openBankPhoneController.text = '';
|
|
openBankPhoneController.text = '';
|
|
|
|
|
|
|
|
sendCompanyAddressController.text = '';
|
|
sendCompanyAddressController.text = '';
|
|
|
- }else if(tab=='getPhone'){
|
|
|
|
|
|
|
+ }else if(key=='get_phone'){
|
|
|
receiptCompanyName = '';
|
|
receiptCompanyName = '';
|
|
|
receiptCompanyNameController.text = '';
|
|
receiptCompanyNameController.text = '';
|
|
|
receiptCompanyId = '0';
|
|
receiptCompanyId = '0';
|
|
@@ -512,6 +653,62 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
receiptCompanyAreaName = '';
|
|
receiptCompanyAreaName = '';
|
|
|
receiptCompanyAreaCode = '';
|
|
receiptCompanyAreaCode = '';
|
|
|
|
|
|
|
|
|
|
+ receiptCompanyAddressController.text = '';
|
|
|
|
|
+ }else if(key=='send_code'){
|
|
|
|
|
+ sendCompanyPhone = '';
|
|
|
|
|
+ sendCompanyName = '';
|
|
|
|
|
+ sendCompanyId ='0';
|
|
|
|
|
+ sendCompanyPhoneController.text = '';
|
|
|
|
|
+ sendCompanyNameController.text = '';
|
|
|
|
|
+
|
|
|
|
|
+ sendPCA = '';
|
|
|
|
|
+ sendCompanyProvinceName = '';
|
|
|
|
|
+ sendCompanyProvinceCode = '';
|
|
|
|
|
+ sendCompanyCityName = '';
|
|
|
|
|
+ sendCompanyCityCode = '';
|
|
|
|
|
+ sendCompanyAreaName = '';
|
|
|
|
|
+ sendCompanyAreaCode = '';
|
|
|
|
|
+
|
|
|
|
|
+ bankCardController.text = '';
|
|
|
|
|
+ bankNameController.text = '';
|
|
|
|
|
+ openBankNameController.text = '';
|
|
|
|
|
+ openBankPhoneController.text = '';
|
|
|
|
|
+
|
|
|
|
|
+ sendCompanyAddressController.text = '';
|
|
|
|
|
+ }else if(key=='send_name'){
|
|
|
|
|
+ sendCompanyCode = '';
|
|
|
|
|
+ sendCompanyPhone = '';
|
|
|
|
|
+ sendCompanyId ='0';
|
|
|
|
|
+ sendCompanyCodeController.text = '';
|
|
|
|
|
+ sendCompanyPhoneController.text = '';
|
|
|
|
|
+
|
|
|
|
|
+ sendPCA = '';
|
|
|
|
|
+ sendCompanyProvinceName = '';
|
|
|
|
|
+ sendCompanyProvinceCode = '';
|
|
|
|
|
+ sendCompanyCityName = '';
|
|
|
|
|
+ sendCompanyCityCode = '';
|
|
|
|
|
+ sendCompanyAreaName = '';
|
|
|
|
|
+ sendCompanyAreaCode = '';
|
|
|
|
|
+
|
|
|
|
|
+ bankCardController.text = '';
|
|
|
|
|
+ bankNameController.text = '';
|
|
|
|
|
+ openBankNameController.text = '';
|
|
|
|
|
+ openBankPhoneController.text = '';
|
|
|
|
|
+
|
|
|
|
|
+ sendCompanyAddressController.text = '';
|
|
|
|
|
+ }else if(key=='get_name'){
|
|
|
|
|
+ receiptCompanyPhone = '';
|
|
|
|
|
+ receiptCompanyPhoneController.text = '';
|
|
|
|
|
+ receiptCompanyId = '0';
|
|
|
|
|
+
|
|
|
|
|
+ getPCA = '';
|
|
|
|
|
+ receiptCompanyProvinceName = '';
|
|
|
|
|
+ receiptCompanyProvinceCode = '';
|
|
|
|
|
+ receiptCompanyCityName = '';
|
|
|
|
|
+ receiptCompanyCityCode = '';
|
|
|
|
|
+ receiptCompanyAreaName = '';
|
|
|
|
|
+ receiptCompanyAreaCode = '';
|
|
|
|
|
+
|
|
|
receiptCompanyAddressController.text = '';
|
|
receiptCompanyAddressController.text = '';
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -537,102 +734,80 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- Widget _contentWiget(String key, String type, [bool keyboardType = false]) { //false是数字键盘
|
|
|
|
|
- return Padding(
|
|
|
|
|
- padding: EdgeInsets.only(left: ScreenUtil.getInstance().setWidth(30)),
|
|
|
|
|
- child: Column(
|
|
|
|
|
- children: < Widget > [
|
|
|
|
|
- SizedBox(
|
|
|
|
|
- height: ScreenUtil.getInstance().setHeight(89),
|
|
|
|
|
- child: Center(
|
|
|
|
|
- child: Row(
|
|
|
|
|
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
- children: < Widget > [
|
|
|
|
|
- Expanded(
|
|
|
|
|
- flex: 0,
|
|
|
|
|
- child: Text(key, style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(74, 74, 74, 1)), ),
|
|
|
|
|
- ),
|
|
|
|
|
- Expanded(
|
|
|
|
|
- child: Row(
|
|
|
|
|
- mainAxisAlignment: MainAxisAlignment.end,
|
|
|
|
|
- children: < Widget > [
|
|
|
|
|
- SizedBox(
|
|
|
|
|
- width: ScreenUtil.getInstance().setWidth(500),
|
|
|
|
|
- child:Padding(
|
|
|
|
|
- padding: EdgeInsets.only(right: ScreenUtil.getInstance().setWidth(30)),
|
|
|
|
|
- child:TextField(
|
|
|
|
|
- controller: (key == '企业名称') ? (type == 'send' ? sendCompanyNameController : receiptCompanyNameController) : (key == '企业编码' ? sendCompanyCodeController : null),
|
|
|
|
|
- keyboardType: keyboardType ? TextInputType.text : TextInputType.number,
|
|
|
|
|
- textAlign: TextAlign.end,
|
|
|
|
|
- decoration: InputDecoration(
|
|
|
|
|
- border: InputBorder.none
|
|
|
|
|
- ),
|
|
|
|
|
- onChanged: (value) {
|
|
|
|
|
- if (type == 'send') {
|
|
|
|
|
- if (key == '企业编码') {
|
|
|
|
|
- setState(() {
|
|
|
|
|
- sendCompanyCode = value;
|
|
|
|
|
- });
|
|
|
|
|
- } else if (key == '企业名称') {
|
|
|
|
|
- setState(() {
|
|
|
|
|
- sendCompanyName = value;
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- } else if (type == 'get') {
|
|
|
|
|
- if (key == '企业编码') {
|
|
|
|
|
- setState(() {
|
|
|
|
|
- sendCompanyCode = value;
|
|
|
|
|
- });
|
|
|
|
|
- } else if (key == '企业名称') {
|
|
|
|
|
- setState(() {
|
|
|
|
|
- receiptCompanyName = value;
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- } else if(type=='goods') {
|
|
|
|
|
- if (key == '货物名称') {
|
|
|
|
|
- goods = value;
|
|
|
|
|
- } else if (key == '数量') {
|
|
|
|
|
- goodsQuantity = int.parse(value);
|
|
|
|
|
- } else if (key == '运费') {
|
|
|
|
|
- goodsFreight = double.parse(value);
|
|
|
|
|
- String temp = goodsFreight.toStringAsFixed(1);
|
|
|
|
|
- goodsFreight = double.parse(temp);
|
|
|
|
|
- } else if (key == '代收') {
|
|
|
|
|
- goodsAgencyFund = double.parse(value);
|
|
|
|
|
- String temp = goodsAgencyFund.toStringAsFixed(1);
|
|
|
|
|
- goodsAgencyFund = double.parse(temp);
|
|
|
|
|
- } else if (key == '保价') {
|
|
|
|
|
- goodsPriceProtection = double.parse(value);
|
|
|
|
|
- String temp = goodsPriceProtection.toStringAsFixed(1);
|
|
|
|
|
- goodsPriceProtection = double.parse(temp);
|
|
|
|
|
- } else if (key == '重量') {
|
|
|
|
|
- goodsWeight = double.parse(value);
|
|
|
|
|
- String temp = goodsWeight.toStringAsFixed(1);
|
|
|
|
|
- goodsWeight = double.parse(temp);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- ),
|
|
|
|
|
- )
|
|
|
|
|
|
|
+ // Widget _contentWiget(String key, String type, [bool keyboardType = false]) { //false是数字键盘
|
|
|
|
|
+ // return Padding(
|
|
|
|
|
+ // padding: EdgeInsets.only(left: ScreenUtil.getInstance().setWidth(30)),
|
|
|
|
|
+ // child: Column(
|
|
|
|
|
+ // children: < Widget > [
|
|
|
|
|
+ // SizedBox(
|
|
|
|
|
+ // height: ScreenUtil.getInstance().setHeight(89),
|
|
|
|
|
+ // child: Center(
|
|
|
|
|
+ // child: Row(
|
|
|
|
|
+ // mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
+ // children: < Widget > [
|
|
|
|
|
+ // Expanded(
|
|
|
|
|
+ // flex: 0,
|
|
|
|
|
+ // child: Text(key, style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(74, 74, 74, 1)), ),
|
|
|
|
|
+ // ),
|
|
|
|
|
+ // Expanded(
|
|
|
|
|
+ // child: Row(
|
|
|
|
|
+ // mainAxisAlignment: MainAxisAlignment.end,
|
|
|
|
|
+ // children: < Widget > [
|
|
|
|
|
+ // SizedBox(
|
|
|
|
|
+ // width: ScreenUtil.getInstance().setWidth(500),
|
|
|
|
|
+ // child:Padding(
|
|
|
|
|
+ // padding: EdgeInsets.only(right: ScreenUtil.getInstance().setWidth(30)),
|
|
|
|
|
+ // child:TextField(
|
|
|
|
|
+ // controller: (key == '企业名称') ? (type == 'send' ? sendCompanyNameController : receiptCompanyNameController) : (key == '企业编码' ? sendCompanyCodeController : null),
|
|
|
|
|
+ // keyboardType: keyboardType ? TextInputType.text : TextInputType.number,
|
|
|
|
|
+ // textAlign: TextAlign.end,
|
|
|
|
|
+ // decoration: InputDecoration(
|
|
|
|
|
+ // border: InputBorder.none
|
|
|
|
|
+ // ),
|
|
|
|
|
+ // onChanged: (value) {
|
|
|
|
|
+ // if (key == '货物名称') {
|
|
|
|
|
+ // goods = value;
|
|
|
|
|
+ // } else if (key == '数量') {
|
|
|
|
|
+ // goodsQuantity = int.parse(value);
|
|
|
|
|
+ // } else if (key == '运费') {
|
|
|
|
|
+ // goodsFreight = double.parse(value);
|
|
|
|
|
+ // String temp = goodsFreight.toStringAsFixed(1);
|
|
|
|
|
+ // goodsFreight = double.parse(temp);
|
|
|
|
|
+ // } else if (key == '代收') {
|
|
|
|
|
+ // goodsAgencyFund = double.parse(value);
|
|
|
|
|
+ // String temp = goodsAgencyFund.toStringAsFixed(1);
|
|
|
|
|
+ // goodsAgencyFund = double.parse(temp);
|
|
|
|
|
+ // } else if (key == '保价') {
|
|
|
|
|
+ // goodsPriceProtection = double.parse(value);
|
|
|
|
|
+ // String temp = goodsPriceProtection.toStringAsFixed(1);
|
|
|
|
|
+ // goodsPriceProtection = double.parse(temp);
|
|
|
|
|
+ // } else if (key == '重量') {
|
|
|
|
|
+ // goodsWeight = double.parse(value);
|
|
|
|
|
+ // String temp = goodsWeight.toStringAsFixed(1);
|
|
|
|
|
+ // goodsWeight = double.parse(temp);
|
|
|
|
|
+ // }
|
|
|
|
|
+ // },
|
|
|
|
|
+ // ),
|
|
|
|
|
+ // )
|
|
|
|
|
|
|
|
- ),
|
|
|
|
|
-
|
|
|
|
|
- // Icon(Icons.keyboard_arrow_right, color: Color.fromRGBO(199, 199, 204, 1), )
|
|
|
|
|
- ],
|
|
|
|
|
- )
|
|
|
|
|
- )
|
|
|
|
|
- ],
|
|
|
|
|
- ),
|
|
|
|
|
- )
|
|
|
|
|
- ),
|
|
|
|
|
- Expanded(
|
|
|
|
|
- flex: 0,
|
|
|
|
|
- child: _underLine()
|
|
|
|
|
- )
|
|
|
|
|
- ],
|
|
|
|
|
- )
|
|
|
|
|
- );
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // ),
|
|
|
|
|
+
|
|
|
|
|
+ // // Icon(Icons.keyboard_arrow_right, color: Color.fromRGBO(199, 199, 204, 1), )
|
|
|
|
|
+ // ],
|
|
|
|
|
+ // )
|
|
|
|
|
+ // )
|
|
|
|
|
+ // ],
|
|
|
|
|
+ // ),
|
|
|
|
|
+ // )
|
|
|
|
|
+ // ),
|
|
|
|
|
+ // Expanded(
|
|
|
|
|
+ // flex: 0,
|
|
|
|
|
+ // child: _underLine()
|
|
|
|
|
+ // )
|
|
|
|
|
+ // ],
|
|
|
|
|
+ // )
|
|
|
|
|
+ // );
|
|
|
|
|
+ // }
|
|
|
|
|
|
|
|
Widget _itemContentWiget(String key,TextEditingController controller, [bool keyboardType = false]) { //false是数字键盘
|
|
Widget _itemContentWiget(String key,TextEditingController controller, [bool keyboardType = false]) { //false是数字键盘
|
|
|
return Padding(
|
|
return Padding(
|