|
|
@@ -6,6 +6,8 @@ import 'dart:async';
|
|
|
import '../util/util.dart';
|
|
|
import '../util/api.dart';
|
|
|
import '../util/models.dart';
|
|
|
+import '../showAlert.dart';
|
|
|
+import '../showDialog.dart';
|
|
|
|
|
|
class SendExpressPage extends StatefulWidget {
|
|
|
final Widget child;
|
|
|
@@ -32,14 +34,29 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
double tipPosY = 0;
|
|
|
|
|
|
bool tipStatus = true;
|
|
|
+ bool submitStatus = true;
|
|
|
|
|
|
List < LikePhoneList > likePhoneList = [];
|
|
|
var timer;
|
|
|
+ bool sendPhoneOrGetPhoneTab = true; //区分电话提示层点击时填入发件信息或手机信息的标记
|
|
|
+
|
|
|
+ TextEditingController sendCompanyPhoneController = TextEditingController();
|
|
|
+ TextEditingController sendCompanyCodeController = TextEditingController();
|
|
|
+ TextEditingController sendCompanyNameController = TextEditingController();
|
|
|
+
|
|
|
+ TextEditingController receiptCompanyPhoneController = TextEditingController();
|
|
|
+ TextEditingController receiptCompanyNameController = TextEditingController();
|
|
|
+
|
|
|
+ TextEditingController sendCompanyAddreddController = TextEditingController();
|
|
|
+ TextEditingController receiptCompanyAddressController = TextEditingController();
|
|
|
+
|
|
|
+ List<dynamic> goodsCateGoryList = [];
|
|
|
+ List<dynamic> goodsPackageList = [];
|
|
|
//请求字段-------------------------
|
|
|
int sendCompanyId; //寄件公司Id
|
|
|
String sendCompanyName; //寄件公司名称 不能为空
|
|
|
String sendCompanyPhone; //寄件公司电话 不能为空
|
|
|
- String sendCompanyCode; //寄件公司编码 不能为空
|
|
|
+ String sendCompanyCode; //寄件公司编码
|
|
|
String sendCompanyProvinceName; //寄件公司省名称 不能为空
|
|
|
String sendCompanyProvinceCode; //寄件公司省编码 不能为空
|
|
|
String sendCompanyCityName; //寄件公司市名称 不能为空
|
|
|
@@ -61,7 +78,7 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
int goodsQuantity; //商品数量 不能为空
|
|
|
int goodsPackingId; //商品包装ID
|
|
|
int goodsCategoryId; //商品类别ID
|
|
|
- int goodsPaymentMethod; //付款方式
|
|
|
+ int goodsPaymentMethod = 1; //付款方式 1,现付 2 到付
|
|
|
double goodsWeight; //商品重量
|
|
|
double goodsPriceProtection; //商品保价
|
|
|
double goodsAgencyFund; //商品代收款
|
|
|
@@ -72,16 +89,131 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
String sendPCA = ' '; //Text组件内容必须有空格,否则报null
|
|
|
String getPCA = ' ';
|
|
|
|
|
|
+ String showTextGoodsCategory = ' ';
|
|
|
+ String showTextGoodsPackage = ' ';
|
|
|
+ String showTextPaymentMehod = '现付';
|
|
|
+
|
|
|
@override
|
|
|
void initState() {
|
|
|
super.initState();
|
|
|
+
|
|
|
+ goodsCategory().then((resp){
|
|
|
+ if(isNotError(context, resp)){
|
|
|
+ GoodsCategory goodsCategoryObj = GoodsCategory.fromJson(resp.data);
|
|
|
+ setState(() {
|
|
|
+ goodsCateGoryList = goodsCategoryObj.data;
|
|
|
+ showTextGoodsCategory = goodsCateGoryList[0].name;
|
|
|
+ goodsCategoryId = goodsCateGoryList[0].id;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ goodsPackage().then((resp){
|
|
|
+ if(isNotError(context, resp)){
|
|
|
+ GoodsPackage goodsPackageObj = GoodsPackage.fromJson(resp.data);
|
|
|
+ setState(() {
|
|
|
+ goodsPackageList = goodsPackageObj.data;
|
|
|
+ showTextGoodsPackage = goodsPackageList[0].name;
|
|
|
+ goodsPackingId = goodsPackageList[0].id;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
_scrollController.addListener(() {
|
|
|
if (!tipStatus) {
|
|
|
setState(() {
|
|
|
tipStatus = true;
|
|
|
});
|
|
|
}
|
|
|
- if (_scrollController.position.pixels == _scrollController.position.maxScrollExtent) {}
|
|
|
+ //if (_scrollController.position.pixels == _scrollController.position.maxScrollExtent) {}
|
|
|
+ });
|
|
|
+ sendCompanyPhoneController.addListener(() {
|
|
|
+ setState(() {
|
|
|
+ sendCompanyPhone = sendCompanyPhoneController.text;
|
|
|
+ });
|
|
|
+ if (timer != null) {
|
|
|
+ timer.cancel();
|
|
|
+ }
|
|
|
+ if (sendCompanyPhoneController.text.length < 6 || sendCompanyPhoneController.text.length >= 11) {
|
|
|
+ setState(() {
|
|
|
+ tipStatus = true;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ timer = Timer(Duration(milliseconds: 500), () {
|
|
|
+ if (sendCompanyPhoneController.text.length >= 6 && sendCompanyPhoneController.text.length < 11) {
|
|
|
+ likePhone(sendCompanyPhoneController.text).then((resp) {
|
|
|
+ if (isNotError(context, resp)) {
|
|
|
+ LikePhone likePhoneObj = LikePhone.fromJson(resp.data);
|
|
|
+ likePhoneList = likePhoneObj.data;
|
|
|
+ }
|
|
|
+ if (likePhoneList.length > 0) {
|
|
|
+ sendPhoneOrGetPhoneTab = true;
|
|
|
+ RenderObject sendPhoneObj = _sendPhoneKey.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(() {
|
|
|
+ setState(() {
|
|
|
+ receiptCompanyPhone = receiptCompanyPhoneController.text;
|
|
|
+ });
|
|
|
+ if (timer != null) {
|
|
|
+ timer.cancel();
|
|
|
+ }
|
|
|
+ if (receiptCompanyPhoneController.text.length < 6 || receiptCompanyPhoneController.text.length >= 11) {
|
|
|
+ setState(() {
|
|
|
+ tipStatus = true;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ timer = Timer(Duration(milliseconds: 500), () {
|
|
|
+ if (receiptCompanyPhoneController.text.length >= 6 && receiptCompanyPhoneController.text.length < 11) {
|
|
|
+ likePhone(receiptCompanyPhoneController.text).then((resp) {
|
|
|
+ if (isNotError(context, resp)) {
|
|
|
+ LikePhone likePhoneObj = LikePhone.fromJson(resp.data);
|
|
|
+ likePhoneList = likePhoneObj.data;
|
|
|
+ }
|
|
|
+ if (likePhoneList.length > 0) {
|
|
|
+ sendPhoneOrGetPhoneTab = false;
|
|
|
+ RenderObject getPhoneKey = _getPhoneKey.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;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ sendCompanyAddreddController.addListener((){
|
|
|
+ setState(() {
|
|
|
+ sendCompanyAddress =sendCompanyAddreddController.text;
|
|
|
+ });
|
|
|
+ });
|
|
|
+ receiptCompanyAddressController.addListener((){
|
|
|
+ setState(() {
|
|
|
+ receiptCompanyAddress =receiptCompanyAddressController.text;
|
|
|
+ });
|
|
|
});
|
|
|
}
|
|
|
|
|
|
@@ -195,6 +327,7 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
_contentWiget("重量", 'goods'),
|
|
|
_packageType('包装类型'),
|
|
|
_packageType('商品类型'),
|
|
|
+ _packageType('付款方式'),
|
|
|
_descWidget()
|
|
|
],
|
|
|
),
|
|
|
@@ -257,91 +390,12 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
SizedBox(
|
|
|
width: ScreenUtil.getInstance().setWidth(500),
|
|
|
child: TextField(
|
|
|
+ controller: tab == 'sendPhone' ? sendCompanyPhoneController : receiptCompanyPhoneController,
|
|
|
keyboardType: TextInputType.number,
|
|
|
textAlign: TextAlign.end,
|
|
|
decoration: InputDecoration(
|
|
|
border: InputBorder.none
|
|
|
),
|
|
|
- onChanged: ((value) {
|
|
|
- if (tab == 'sendPhone') {
|
|
|
- setState(() {
|
|
|
- sendCompanyPhone = value;
|
|
|
- });
|
|
|
- timer.cancel();
|
|
|
- if (value.length < 6) {
|
|
|
- setState(() {
|
|
|
- tipStatus = true;
|
|
|
- });
|
|
|
- }
|
|
|
- timer = Timer(Duration(milliseconds: 500), () {
|
|
|
- if (value.length >= 6) {
|
|
|
- likePhone(value).then((resp) {
|
|
|
- if (isNotError(context, resp)) {
|
|
|
- LikePhone likePhoneObj = LikePhone.fromJson(resp.data);
|
|
|
- likePhoneList = likePhoneObj.data;
|
|
|
- }
|
|
|
- if (likePhoneList.length > 0) {
|
|
|
- RenderObject sendPhoneObj = _sendPhoneKey.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;
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- // print(tipWidth);
|
|
|
- // print(tipHeight);
|
|
|
- // print(tipPosX);
|
|
|
- // print(tipPosY);
|
|
|
- } else if (tab == 'getPhone') {
|
|
|
- setState(() {
|
|
|
- receiptCompanyPhone = value;
|
|
|
- });
|
|
|
- timer.cancel();
|
|
|
- if (value.length < 6) {
|
|
|
- setState(() {
|
|
|
- tipStatus = true;
|
|
|
- });
|
|
|
- }
|
|
|
- timer = Timer(Duration(milliseconds: 500), () {
|
|
|
- if (value.length >= 6) {
|
|
|
- likePhone(value).then((resp) {
|
|
|
- if (isNotError(context, resp)) {
|
|
|
- LikePhone likePhoneObj = LikePhone.fromJson(resp.data);
|
|
|
- likePhoneList = likePhoneObj.data;
|
|
|
- }
|
|
|
- if (likePhoneList.length > 0) {
|
|
|
- RenderObject getPhoneKey = _getPhoneKey.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;
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
- // print(tipWidth);
|
|
|
- // print(tipHeight);
|
|
|
- // print(tipPosX);
|
|
|
- // print(tipPosY);
|
|
|
- }
|
|
|
- }),
|
|
|
onEditingComplete: () {
|
|
|
setState(() {
|
|
|
FocusScope.of(context).requestFocus(FocusNode());
|
|
|
@@ -391,6 +445,7 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
SizedBox(
|
|
|
width: ScreenUtil.getInstance().setWidth(500),
|
|
|
child: TextField(
|
|
|
+ controller: (key == '企业名称') ? (type == 'send' ? sendCompanyNameController : receiptCompanyNameController) : (key == '企业编码' ? sendCompanyCodeController : null),
|
|
|
keyboardType: keyboardType ? TextInputType.text : TextInputType.number,
|
|
|
textAlign: TextAlign.end,
|
|
|
decoration: InputDecoration(
|
|
|
@@ -547,25 +602,13 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
SizedBox(
|
|
|
width: ScreenUtil.getInstance().setWidth(500),
|
|
|
child: TextField(
|
|
|
- //keyboardType: TextInputType.number,
|
|
|
+ controller: type=='send'?sendCompanyAddreddController:receiptCompanyAddressController,
|
|
|
textAlign: TextAlign.end,
|
|
|
decoration: InputDecoration(
|
|
|
border: InputBorder.none
|
|
|
),
|
|
|
- onChanged: (value) {
|
|
|
- if (type == 'send') {
|
|
|
- setState(() {
|
|
|
- sendCompanyAddress = value;
|
|
|
- });
|
|
|
- } else {
|
|
|
- setState(() {
|
|
|
- receiptCompanyAddress = value;
|
|
|
- });
|
|
|
- }
|
|
|
- },
|
|
|
),
|
|
|
),
|
|
|
-
|
|
|
Icon(Icons.keyboard_arrow_right, color: Color.fromRGBO(199, 199, 204, 1), )
|
|
|
],
|
|
|
)
|
|
|
@@ -607,10 +650,30 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
color: Color.fromRGBO(37, 102, 242, 1),
|
|
|
),
|
|
|
child: Center(
|
|
|
- child: Text("提交", style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(32), color: Colors.white), ),
|
|
|
+ child:Row(
|
|
|
+ mainAxisAlignment: MainAxisAlignment.center,
|
|
|
+ children: <Widget>[
|
|
|
+ Offstage(
|
|
|
+ offstage: submitStatus,
|
|
|
+ child: SizedBox(
|
|
|
+ width: ScreenUtil.getInstance().setWidth(45),
|
|
|
+ height: ScreenUtil.getInstance().setHeight(45),
|
|
|
+ child: Image.asset('lib/images/loading.gif'),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ Text("提交", style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(32), color: Colors.white), ),
|
|
|
+ ],
|
|
|
+ )
|
|
|
),
|
|
|
),
|
|
|
onTap: () {
|
|
|
+ if(!submitStatus){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ setState(() {
|
|
|
+ submitStatus = false;
|
|
|
+ });
|
|
|
+ String errStr ='';
|
|
|
print('sendCompanyId---${sendCompanyId}');
|
|
|
print('sendCompanyName---${sendCompanyName}');
|
|
|
print('sendCompanyPhone---${sendCompanyPhone}');
|
|
|
@@ -642,9 +705,109 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
print('goodsAgencyFund---${goodsAgencyFund}');
|
|
|
print('goodsFreight---${goodsFreight}');
|
|
|
print('memo---${memo}');
|
|
|
+ // if (!isChinaPhoneLegal(sendCompanyPhone)) {
|
|
|
+
|
|
|
+ // }
|
|
|
+ if(sendCompanyPhone==null){
|
|
|
+ errStr ='请填写发件电话';
|
|
|
+ }
|
|
|
+ if(sendCompanyName==null){
|
|
|
+ errStr = '请填写发件企业名称';
|
|
|
+ }
|
|
|
+ if(sendCompanyProvinceName==null){
|
|
|
+ errStr ='请填写发件城市/区域';
|
|
|
+ }
|
|
|
+ if(sendCompanyAddress==null){
|
|
|
+ errStr ='请填写发件详细地址';
|
|
|
+ }
|
|
|
+ if(receiptCompanyPhone==null){
|
|
|
+ errStr='请填写收件电话';
|
|
|
+ }
|
|
|
+ if(receiptCompanyName==null){
|
|
|
+ errStr='请填写收件企业名称';
|
|
|
+ }
|
|
|
+ if(receiptCompanyProvinceName==null){
|
|
|
+ errStr ='请填写收件城市/区域';
|
|
|
+ }
|
|
|
+ if(receiptCompanyAddress==null){
|
|
|
+ errStr ='请填写收件详细地址';
|
|
|
+ }
|
|
|
+ if(goods==null){
|
|
|
+ errStr ='请填写货物名称';
|
|
|
+ }
|
|
|
+ if(goodsQuantity==null){
|
|
|
+ errStr ='请填写货物数量';
|
|
|
+ }
|
|
|
+ if(goodsFreight==null){
|
|
|
+ errStr = '请填写运费';
|
|
|
+ }
|
|
|
+ if(errStr!=''){
|
|
|
+ showError(errStr);
|
|
|
+ }
|
|
|
+ createOrder(
|
|
|
+ sendCompanyId??"",//寄件公司Id
|
|
|
+ sendCompanyName,//寄件公司名称 不能为空
|
|
|
+ sendCompanyPhone,//寄件公司电话 不能为空
|
|
|
+ sendCompanyCode??'',//寄件公司编码
|
|
|
+ sendCompanyProvinceName,//寄件公司省名称 不能为空
|
|
|
+ sendCompanyProvinceCode, //寄件公司省编码 不能为空
|
|
|
+ sendCompanyCityName, //寄件公司市名称 不能为空
|
|
|
+ sendCompanyCityCode, //寄件公司市编码 不能为空
|
|
|
+ sendCompanyAreaName, //寄件公司区名称 不能为空
|
|
|
+ sendCompanyAreaCode, //寄件公司区编码 不能为空
|
|
|
+ sendCompanyAddress, //寄件公司详细地址,不能为空
|
|
|
+ receiptCompanyId, //收件公司id
|
|
|
+ receiptCompanyPhone,//收件公司电话 不能为空
|
|
|
+ receiptCompanyName, //收件公司名称 不能为空
|
|
|
+ receiptCompanyProvinceName,//收件公司省名称 不能为空
|
|
|
+ receiptCompanyProvinceCode, //收件公司省编码 不能为空
|
|
|
+ receiptCompanyCityName, //收件公司市名称 不能为空
|
|
|
+ receiptCompanyCityCode, //收件公市编码 不能为空
|
|
|
+ receiptCompanyAreaName,//收件公区名称 不能为空
|
|
|
+ receiptCompanyAreaCode, //收件公司区编码 不能为空
|
|
|
+ receiptCompanyAddress, //收件公司地址详情 不能为空
|
|
|
+ goods, //商品名称 不能为空
|
|
|
+ goodsQuantity, //商品数量 不能为空
|
|
|
+ goodsPackingId,//商品包装ID
|
|
|
+ goodsCategoryId, //商品类别ID
|
|
|
+ goodsPaymentMethod, //付款方式 1,现付 2 到付
|
|
|
+ goodsWeight??'', //商品重量
|
|
|
+ goodsPriceProtection!=null?goodsPriceProtection*100:'', //商品保价,已分为单位
|
|
|
+ goodsAgencyFund!=null?goodsAgencyFund*100:'', //商品代收款,已分为单位
|
|
|
+ goodsFreight*100,//商品运费 不能为空 ,已分为单位
|
|
|
+ memo,//备注
|
|
|
+ ).then((resp){
|
|
|
+ if(isNotError(context, resp)){
|
|
|
+ setState(() {
|
|
|
+ submitStatus = true;
|
|
|
+ });
|
|
|
+ showDialog < Null > (
|
|
|
+ context: context, //BuildContext对象
|
|
|
+ barrierDismissible: false,
|
|
|
+ builder: (BuildContext context) {
|
|
|
+ return MyAlertDialog( //调用对话框
|
|
|
+ text: '订单提交成功!', childCallback: (val) {
|
|
|
+
|
|
|
+ },
|
|
|
+ );
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
);
|
|
|
}
|
|
|
+
|
|
|
+ showError(String str){
|
|
|
+ showDialog < Null > (
|
|
|
+ context: context, //BuildContext对象
|
|
|
+ barrierDismissible: false,
|
|
|
+ builder: (BuildContext context) {
|
|
|
+ return MyAlertDialog( //调用对话框
|
|
|
+ text: str, childCallback: (val) {},
|
|
|
+ );
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
Future getCity(context) async {
|
|
|
Result result = await CityPickers.showCityPicker(
|
|
|
context: context,
|
|
|
@@ -656,39 +819,62 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
return Container(
|
|
|
child: Column(
|
|
|
children: < Widget > [
|
|
|
- Container(
|
|
|
- height: ScreenUtil.getInstance().setHeight(89),
|
|
|
- child: Center(
|
|
|
- child: Row(
|
|
|
- mainAxisAlignment: MainAxisAlignment.start,
|
|
|
- children: < Widget > [
|
|
|
- Padding(
|
|
|
- padding: EdgeInsets.only(right: ScreenUtil.getInstance().setWidth(50)),
|
|
|
- child: Text(obj.uzerPhone, style: TextStyle(
|
|
|
- fontSize: ScreenUtil.getInstance().setSp(28),
|
|
|
- color: Color.fromRGBO(74, 74, 74, 1)
|
|
|
- ), )
|
|
|
- ),
|
|
|
- SizedBox(
|
|
|
- width: ScreenUtil.getInstance().setWidth(185),
|
|
|
- child: Text(obj.areaCode,
|
|
|
+ InkWell(
|
|
|
+ child: Container(
|
|
|
+ height: ScreenUtil.getInstance().setHeight(89),
|
|
|
+ child: Center(
|
|
|
+ child: Row(
|
|
|
+ mainAxisAlignment: MainAxisAlignment.start,
|
|
|
+ children: < Widget > [
|
|
|
+ Padding(
|
|
|
+ padding: EdgeInsets.only(right: ScreenUtil.getInstance().setWidth(50)),
|
|
|
+ child: Text(obj.uzerPhone, style: TextStyle(
|
|
|
+ fontSize: ScreenUtil.getInstance().setSp(28),
|
|
|
+ color: Color.fromRGBO(74, 74, 74, 1)
|
|
|
+ ), )
|
|
|
+ ),
|
|
|
+ SizedBox(
|
|
|
+ width: ScreenUtil.getInstance().setWidth(185),
|
|
|
+ child: Text(obj.areaCode,
|
|
|
+ textAlign: TextAlign.left,
|
|
|
+ style: TextStyle(
|
|
|
+ fontSize: ScreenUtil.getInstance().setSp(28),
|
|
|
+ color: Color.fromRGBO(155, 155, 155, 1)
|
|
|
+ ), ),
|
|
|
+ ),
|
|
|
+ Text(obj.companyName,
|
|
|
textAlign: TextAlign.left,
|
|
|
+ overflow: TextOverflow.ellipsis,
|
|
|
style: TextStyle(
|
|
|
fontSize: ScreenUtil.getInstance().setSp(28),
|
|
|
color: Color.fromRGBO(155, 155, 155, 1)
|
|
|
- ), ),
|
|
|
- ),
|
|
|
- Text(obj.companyName,
|
|
|
- textAlign: TextAlign.left,
|
|
|
- overflow: TextOverflow.ellipsis,
|
|
|
- style: TextStyle(
|
|
|
- fontSize: ScreenUtil.getInstance().setSp(28),
|
|
|
- color: Color.fromRGBO(155, 155, 155, 1)
|
|
|
- ),
|
|
|
- )
|
|
|
- ],
|
|
|
+ ),
|
|
|
+ )
|
|
|
+ ],
|
|
|
+ ),
|
|
|
),
|
|
|
),
|
|
|
+ onTap: () {
|
|
|
+ if (sendPhoneOrGetPhoneTab) {
|
|
|
+ sendCompanyPhone = obj.uzerPhone;
|
|
|
+ sendCompanyCode = obj.companyCode;
|
|
|
+ sendCompanyName = obj.companyName;
|
|
|
+ sendCompanyId = obj.id;
|
|
|
+ sendCompanyPhoneController.text = obj.uzerPhone;
|
|
|
+ sendCompanyCodeController.text = obj.companyCode;
|
|
|
+ sendCompanyNameController.text = obj.companyName;
|
|
|
+ } else {
|
|
|
+ receiptCompanyPhone = obj.uzerPhone;
|
|
|
+ receiptCompanyName = obj.companyName;
|
|
|
+ receiptCompanyPhoneController.text = obj.uzerPhone;
|
|
|
+ receiptCompanyNameController.text = obj.companyName;
|
|
|
+ receiptCompanyId = obj.id;
|
|
|
+ }
|
|
|
+ setState(() {
|
|
|
+ FocusScope.of(context).requestFocus(FocusNode());
|
|
|
+ tipStatus = true;
|
|
|
+ });
|
|
|
+ },
|
|
|
),
|
|
|
_underLine()
|
|
|
],
|
|
|
@@ -719,7 +905,7 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
//Text('${value}', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(136, 136, 136, 1)), ),
|
|
|
SizedBox(
|
|
|
width: ScreenUtil.getInstance().setWidth(500),
|
|
|
- child: Text('纸箱', textAlign: TextAlign.end, )
|
|
|
+ child: Text(key=='包装类型'?showTextGoodsPackage:key=='商品类型'?showTextGoodsCategory:showTextPaymentMehod, textAlign: TextAlign.end, )
|
|
|
),
|
|
|
Icon(Icons.keyboard_arrow_right, color: Color.fromRGBO(199, 199, 204, 1), )
|
|
|
],
|
|
|
@@ -744,8 +930,20 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
}
|
|
|
|
|
|
showPickerModal(BuildContext context, String type) {
|
|
|
+ List<dynamic> data = [];
|
|
|
+ if(type=='包装类型'){
|
|
|
+ for(int i=0;i<goodsPackageList.length;i++){
|
|
|
+ data.add(goodsPackageList[i].name);
|
|
|
+ }
|
|
|
+ }else if(type=='商品类型'){
|
|
|
+ for(int i=0;i<goodsCateGoryList.length;i++){
|
|
|
+ data.add(goodsCateGoryList[i].name);
|
|
|
+ }
|
|
|
+ }else if(type=='付款方式'){
|
|
|
+ data = ['现付','到付'];
|
|
|
+ }
|
|
|
new Picker(
|
|
|
- adapter: PickerDataAdapter < String > (pickerdata: ['纸箱', '木箱']),
|
|
|
+ adapter: PickerDataAdapter < String > (pickerdata: data),
|
|
|
height: ScreenUtil.getInstance().setHeight(450),
|
|
|
confirmText: '确定',
|
|
|
confirmTextStyle: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(64, 98, 254, 1)),
|
|
|
@@ -757,10 +955,22 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
|
|
|
changeToFirst: true,
|
|
|
hideHeader: false,
|
|
|
onConfirm: (Picker picker, List value) {
|
|
|
- // setState(() {
|
|
|
- // _siteName = stationObj.data[value[0]].name;
|
|
|
- // });
|
|
|
- // setKey('stationId', stationObj.data[value[0]].id.toString());
|
|
|
+ if(type=='包装类型'){
|
|
|
+ setState(() {
|
|
|
+ showTextGoodsPackage =goodsPackageList[value[0]].name;
|
|
|
+ goodsPackingId = goodsPackageList[value[0]].id;
|
|
|
+ });
|
|
|
+ }else if(type=='商品类型'){
|
|
|
+ showTextGoodsCategory =goodsCateGoryList[value[0]].name;
|
|
|
+ goodsCategoryId =goodsCateGoryList[value[0]].id;
|
|
|
+ }else if(type=='付款方式'){
|
|
|
+ showTextPaymentMehod = data[value[0]];
|
|
|
+ if(showTextPaymentMehod=='现付'){
|
|
|
+ goodsPaymentMethod = 1;
|
|
|
+ }else{
|
|
|
+ goodsPaymentMethod = 2;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
).showModal(this.context); //_scaffoldKey.currentState);
|
|
|
}
|