|
|
@@ -31,17 +31,26 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
//组件自用字段-----------------------------
|
|
|
GlobalKey _sendPhoneKey = GlobalKey();
|
|
|
GlobalKey _getPhoneKey = GlobalKey();
|
|
|
+ GlobalKey _sendCompanyCodeKey = GlobalKey();
|
|
|
+ GlobalKey _sendCompanyNameKey = GlobalKey();
|
|
|
+ GlobalKey _getCompanyNameKey = GlobalKey();
|
|
|
+ GlobalKey _goodsKey = GlobalKey();
|
|
|
|
|
|
double tipWidth = 0;
|
|
|
double tipHeight = 0;
|
|
|
double tipPosX = 0;
|
|
|
double tipPosY = 0;
|
|
|
|
|
|
- bool tipStatus = true;
|
|
|
+ bool tipStatus = true;//是否展示公司信息匹配列表,true为不展示
|
|
|
+ bool goodsTipStatus = true;//是否展示货物匹配列表,true为不展示
|
|
|
bool lineModalStatus = false;
|
|
|
bool submitStatus = true;
|
|
|
+ bool checkedLine = false;//当收件方有多条线路时,此状态表示是否已经选择过线路了
|
|
|
+
|
|
|
+ String stationId;//司机端站点id
|
|
|
|
|
|
List < LikePhoneList > likePhoneList = [];
|
|
|
+ List <GoodsPriceList> goodsPriceList = [];
|
|
|
var timer;
|
|
|
bool sendPhoneOrGetPhoneTab = true; //区分电话提示层点击时填入发件信息或手机信息的标记
|
|
|
|
|
|
@@ -123,12 +132,15 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
BluetoothUtils bluetooth = BluetoothUtils();
|
|
|
|
|
|
bool checkedCompanyInfo = false;//选择公司信息向sendCompanyPhoneController填充时不去模糊匹配
|
|
|
+ bool checkedGoodsName = false;//选择货物名称填充时不匹配
|
|
|
+
|
|
|
+ String likeWord ='';//以什么为匹配的字段用户控制高亮_tipsItem中的哪一个字段
|
|
|
|
|
|
@override
|
|
|
void initState() {
|
|
|
super.initState();
|
|
|
|
|
|
- goodsCategory().then((resp) {
|
|
|
+ goodsCategory().then((resp) {//获取商品类型
|
|
|
if (isNotError(context, resp) && this.mounted) {
|
|
|
GoodsCategory goodsCategoryObj = GoodsCategory.fromJson(resp.data);
|
|
|
setState(() {
|
|
|
@@ -139,7 +151,7 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- goodsPackage().then((resp) {
|
|
|
+ goodsPackage().then((resp) {//获取包装类型
|
|
|
if (isNotError(context, resp) && this.mounted) {
|
|
|
GoodsPackage goodsPackageObj = GoodsPackage.fromJson(resp.data);
|
|
|
setState(() {
|
|
|
@@ -149,6 +161,14 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
+ getKey('stationId').then((resp){
|
|
|
+ stationId = resp;
|
|
|
+ });
|
|
|
+ getKey('defaultFreightPrice').then((resp){
|
|
|
+ setState(() {
|
|
|
+ goodsFreightController.text = (double.parse(resp)/100).toString();
|
|
|
+ });
|
|
|
+ });
|
|
|
|
|
|
_scrollController.addListener(() {
|
|
|
if (!tipStatus) {
|
|
|
@@ -156,8 +176,15 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
tipStatus = true;
|
|
|
});
|
|
|
}
|
|
|
+ if(!goodsTipStatus){
|
|
|
+ setState(() {
|
|
|
+ goodsTipStatus = true;
|
|
|
+ });
|
|
|
+ }
|
|
|
//if (_scrollController.position.pixels == _scrollController.position.maxScrollExtent) {}
|
|
|
});
|
|
|
+
|
|
|
+ //发件公司电话监听
|
|
|
sendCompanyPhoneController.addListener(() {
|
|
|
if(checkedCompanyInfo){
|
|
|
return;
|
|
|
@@ -191,6 +218,99 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
tipPosX = sendPhoneObj.getTransformTo(null).getTranslation().x;
|
|
|
tipPosY = sendPhoneObj.getTransformTo(null).getTranslation().y - ScreenUtil.getInstance().setHeight(90);
|
|
|
tipStatus = false;
|
|
|
+ likeWord='phone';
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ setState(() {
|
|
|
+ tipStatus = true;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ //发件公司编码监听
|
|
|
+ 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;
|
|
|
+ likeWord='code';
|
|
|
+ });
|
|
|
+ } 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;
|
|
|
+ likeWord='name';
|
|
|
});
|
|
|
} else {
|
|
|
setState(() {
|
|
|
@@ -202,6 +322,7 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
});
|
|
|
});
|
|
|
|
|
|
+ //收件公司电话监听
|
|
|
receiptCompanyPhoneController.addListener(() {
|
|
|
if(checkedCompanyInfo){
|
|
|
return;
|
|
|
@@ -235,6 +356,7 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
tipPosX = getPhoneKey.getTransformTo(null).getTranslation().x;
|
|
|
tipPosY = getPhoneKey.getTransformTo(null).getTranslation().y - ScreenUtil.getInstance().setHeight(90);
|
|
|
tipStatus = false;
|
|
|
+ likeWord='phone';
|
|
|
});
|
|
|
} else {
|
|
|
setState(() {
|
|
|
@@ -246,6 +368,98 @@ 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;
|
|
|
+ likeWord='name';
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ setState(() {
|
|
|
+ tipStatus = true;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ //货物名称监听
|
|
|
+ goodsController.addListener(() {
|
|
|
+ if(checkedGoodsName){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ setState(() {
|
|
|
+ goods = goodsController.text;
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+ if (timer != null) {
|
|
|
+ timer.cancel();
|
|
|
+ }
|
|
|
+ if (goodsController.text.length < 1) {
|
|
|
+ setState(() {
|
|
|
+ goodsTipStatus = true;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ timer = Timer(Duration(milliseconds: 250), () {
|
|
|
+ if (goodsController.text.length >= 1) {
|
|
|
+ goodsNameLike(stationId,goodsController.text,lineId).then((resp) {
|
|
|
+ if (isNotError(context, resp) && this.mounted) {
|
|
|
+ GoodsPriceObj goodsPriceObj = GoodsPriceObj.fromJson(resp.data);
|
|
|
+ goodsPriceList = goodsPriceObj.data;
|
|
|
+ }
|
|
|
+ if (goodsPriceList.length > 0) {
|
|
|
+ RenderObject goodsKey = _goodsKey.currentContext.findRenderObject();
|
|
|
+ setState(() {
|
|
|
+ tipWidth = goodsKey.paintBounds.size.width;
|
|
|
+ tipHeight = goodsKey.paintBounds.size.height;
|
|
|
+ tipPosX = goodsKey.getTransformTo(null).getTranslation().x;
|
|
|
+ tipPosY = goodsKey.getTransformTo(null).getTranslation().y - ScreenUtil.getInstance().setHeight(90);
|
|
|
+ goodsTipStatus = false;
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ setState(() {
|
|
|
+ goodsTipStatus = true;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
sendCompanyAddressController.addListener(() {
|
|
|
setState(() {
|
|
|
sendCompanyAddress = sendCompanyAddressController.text;
|
|
|
@@ -322,6 +536,27 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
)
|
|
|
),
|
|
|
)
|
|
|
+ ),
|
|
|
+ Positioned(
|
|
|
+ top: tipPosY,
|
|
|
+ left: tipPosX,
|
|
|
+ child: Offstage(
|
|
|
+ offstage: goodsTipStatus,
|
|
|
+ child: Container(
|
|
|
+ width: tipWidth,
|
|
|
+ height: ScreenUtil.getInstance().setHeight(450),
|
|
|
+ padding: EdgeInsets.only(left: ScreenUtil.getInstance().setWidth(30)),
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ color: Color.fromRGBO(244, 248, 251, 1),
|
|
|
+ ),
|
|
|
+ child: ListView.builder(
|
|
|
+ itemCount: goodsPriceList.length,
|
|
|
+ itemBuilder: (BuildContext context, int index) {
|
|
|
+ return _goodsTipItem(goodsPriceList[index]);
|
|
|
+ },
|
|
|
+ )
|
|
|
+ ),
|
|
|
+ )
|
|
|
)
|
|
|
],
|
|
|
),
|
|
|
@@ -338,9 +573,9 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
children: < Widget > [
|
|
|
_titleWidget('lib/images/icon_send.png', '发件信息'),
|
|
|
_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'),
|
|
|
_lastContentWiget('详细地址', 'send')
|
|
|
],
|
|
|
@@ -356,8 +591,8 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
children: < Widget > [
|
|
|
_titleWidget('lib/images/icon_shoujian.png', '收件信息'),
|
|
|
_underLine(),
|
|
|
- _inputWiget('电话', 'getPhone'),
|
|
|
- _contentWiget('企业名称', 'get', true),
|
|
|
+ _inputWiget('get_phone','收件电话', _getPhoneKey,receiptCompanyPhoneController),
|
|
|
+ _inputWiget('get_name','企业名称', _getCompanyNameKey,receiptCompanyNameController ,true),
|
|
|
_cityWiget('城市/区域', context, 'get'),
|
|
|
_lastContentWiget('详细地址', 'get')
|
|
|
],
|
|
|
@@ -439,9 +674,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(
|
|
|
- key: tab == 'sendPhone' ? _sendPhoneKey : _getPhoneKey,
|
|
|
+ key: tab,
|
|
|
padding: EdgeInsets.only(left: ScreenUtil.getInstance().setWidth(30)),
|
|
|
child: Column(
|
|
|
children: < Widget > [
|
|
|
@@ -453,7 +688,7 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
children: < Widget > [
|
|
|
Expanded(
|
|
|
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(
|
|
|
child: Row(
|
|
|
@@ -464,8 +699,8 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
child: Padding(
|
|
|
padding: EdgeInsets.only(right: ScreenUtil.getInstance().setWidth(30)),
|
|
|
child: TextField(
|
|
|
- controller: tab == 'sendPhone' ? sendCompanyPhoneController : receiptCompanyPhoneController,
|
|
|
- keyboardType: TextInputType.number,
|
|
|
+ controller: tab1,
|
|
|
+ keyboardType: keyboardType ? TextInputType.text : TextInputType.number,
|
|
|
textAlign: TextAlign.end,
|
|
|
decoration: InputDecoration(
|
|
|
border: InputBorder.none
|
|
|
@@ -478,7 +713,7 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
},
|
|
|
onChanged: (value){
|
|
|
checkedCompanyInfo = false;
|
|
|
- if(tab=='sendPhone'){
|
|
|
+ if(key=='send_phone'){
|
|
|
sendCompanyCode = '';
|
|
|
sendCompanyName = '';
|
|
|
sendCompanyId ='0';
|
|
|
@@ -499,7 +734,7 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
openBankPhoneController.text = '';
|
|
|
|
|
|
sendCompanyAddressController.text = '';
|
|
|
- }else if(tab=='getPhone'){
|
|
|
+ }else if(key=='get_phone'){
|
|
|
receiptCompanyName = '';
|
|
|
receiptCompanyNameController.text = '';
|
|
|
receiptCompanyId = '0';
|
|
|
@@ -512,6 +747,62 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
receiptCompanyAreaName = '';
|
|
|
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 = '';
|
|
|
}
|
|
|
|
|
|
@@ -537,105 +828,9 @@ 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);
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- ),
|
|
|
- )
|
|
|
-
|
|
|
- ),
|
|
|
-
|
|
|
- // 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是数字键盘
|
|
|
return Padding(
|
|
|
+ key: key=='货物名称'?_goodsKey:null,
|
|
|
padding: EdgeInsets.only(left: ScreenUtil.getInstance().setWidth(30)),
|
|
|
child: Column(
|
|
|
children: < Widget > [
|
|
|
@@ -1057,7 +1252,7 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- if(lineList.length>1){
|
|
|
+ if(lineList.length>1 && !checkedLine){
|
|
|
showLineModal(lineList);
|
|
|
return;
|
|
|
}
|
|
|
@@ -1278,7 +1473,27 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
return ShowLineModal(
|
|
|
lineList: list, childCallback: (val) {
|
|
|
lineId = val;
|
|
|
- submitOrder();
|
|
|
+ goodsNameAccurate(stationId,goodsController.text,lineId).then((resp){
|
|
|
+ if(isNotError(context, resp) && this.mounted){
|
|
|
+ if(resp.data['data']['goods']!=null){
|
|
|
+ GoodsPriceList tempObj = GoodsPriceObjAccurate.fromJson(resp.data).data;
|
|
|
+ setState(() {
|
|
|
+ goods=tempObj.goods;
|
|
|
+ goodsController.text = tempObj.goods;
|
|
|
+ goodsFreight = tempObj.price/100;
|
|
|
+ goodsFreightController.text = (tempObj.price/100).toString();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ checkedLine = true;
|
|
|
+ // showDialog <Null> (
|
|
|
+ // context: context,
|
|
|
+ // barrierDismissible: false,
|
|
|
+ // builder: (BuildContext context) {
|
|
|
+ // return MyAlertDialog(text: '线路已变更,请确认运费是否正确',childCallback:(val){});
|
|
|
+ // }
|
|
|
+ // );
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
);
|
|
|
});
|
|
|
@@ -1306,16 +1521,16 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
padding: EdgeInsets.only(right: ScreenUtil.getInstance().setWidth(50)),
|
|
|
child: Text(obj.uzerPhone!=null?obj.uzerPhone:obj.companyPhone, style: TextStyle(
|
|
|
fontSize: ScreenUtil.getInstance().setSp(28),
|
|
|
- color: Color.fromRGBO(74, 74, 74, 1)
|
|
|
+ color: likeWord=='phone'?Color.fromRGBO(74, 74, 74, 1):Color.fromRGBO(155, 155, 155, 1)
|
|
|
), )
|
|
|
),
|
|
|
SizedBox(
|
|
|
width: ScreenUtil.getInstance().setWidth(185),
|
|
|
- child: Text(obj.areaCode,
|
|
|
+ child: Text(obj.companyCode,
|
|
|
textAlign: TextAlign.left,
|
|
|
style: TextStyle(
|
|
|
fontSize: ScreenUtil.getInstance().setSp(28),
|
|
|
- color: Color.fromRGBO(155, 155, 155, 1)
|
|
|
+ color: likeWord=='code'?Color.fromRGBO(74, 74, 74, 1):Color.fromRGBO(155, 155, 155, 1)
|
|
|
), ),
|
|
|
),
|
|
|
Text(obj.companyName,
|
|
|
@@ -1323,7 +1538,7 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
overflow: TextOverflow.ellipsis,
|
|
|
style: TextStyle(
|
|
|
fontSize: ScreenUtil.getInstance().setSp(28),
|
|
|
- color: Color.fromRGBO(155, 155, 155, 1)
|
|
|
+ color: likeWord=='name'?Color.fromRGBO(74, 74, 74, 1):Color.fromRGBO(155, 155, 155, 1)
|
|
|
),
|
|
|
)
|
|
|
],
|
|
|
@@ -1391,6 +1606,68 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
);
|
|
|
}
|
|
|
|
|
|
+ Widget _goodsTipItem(GoodsPriceList obj){
|
|
|
+ return Container(
|
|
|
+ child: Column(
|
|
|
+ children: < Widget > [
|
|
|
+ InkWell(
|
|
|
+ child: Container(
|
|
|
+ height: ScreenUtil.getInstance().setHeight(89),
|
|
|
+ child: Center(
|
|
|
+ child: Row(
|
|
|
+ mainAxisAlignment: MainAxisAlignment.start,
|
|
|
+ children: < Widget > [
|
|
|
+ SizedBox(
|
|
|
+ width: ScreenUtil.getInstance().setWidth(250),
|
|
|
+ child: Text(obj.goods,
|
|
|
+ textAlign: TextAlign.left,
|
|
|
+ overflow: TextOverflow.ellipsis,
|
|
|
+ style: TextStyle(
|
|
|
+ fontSize: ScreenUtil.getInstance().setSp(28),
|
|
|
+ color: Color.fromRGBO(74, 74, 74, 1)
|
|
|
+ ), )
|
|
|
+ ),
|
|
|
+ SizedBox(
|
|
|
+ width: ScreenUtil.getInstance().setWidth(250),
|
|
|
+ child: Text(obj.lineName,
|
|
|
+ textAlign: TextAlign.left,
|
|
|
+ overflow: TextOverflow.ellipsis,
|
|
|
+ style: TextStyle(
|
|
|
+ fontSize: ScreenUtil.getInstance().setSp(28),
|
|
|
+ color: Color.fromRGBO(155, 155, 155, 1)
|
|
|
+ ), ),
|
|
|
+ ),
|
|
|
+ Text((obj.price/100).toString(),
|
|
|
+ textAlign: TextAlign.left,
|
|
|
+ overflow: TextOverflow.ellipsis,
|
|
|
+ style: TextStyle(
|
|
|
+ fontSize: ScreenUtil.getInstance().setSp(28),
|
|
|
+ color: Color.fromRGBO(155, 155, 155, 1)
|
|
|
+ ),
|
|
|
+ )
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ onTap: () {
|
|
|
+ checkedGoodsName = true;
|
|
|
+ setState(() {
|
|
|
+ FocusScope.of(context).requestFocus(FocusNode());
|
|
|
+ goodsTipStatus = true;
|
|
|
+ goods = obj.goods;
|
|
|
+ goodsController.text = obj.goods;
|
|
|
+ goodsFreight = (obj.price/100);
|
|
|
+ goodsFreightController.text = (obj.price/100).toString();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ _underLine()
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
Widget _packageType(String key) {
|
|
|
return Padding(
|
|
|
padding: EdgeInsets.only(left: ScreenUtil.getInstance().setWidth(30)),
|