send_express_page.dart 71 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760
  1. import 'package:flutter/material.dart';
  2. import 'package:flutter/services.dart';
  3. import 'package:flutter_screenutil/flutter_screenutil.dart';
  4. import 'package:city_pickers/city_pickers.dart';
  5. import 'package:flutter_picker/flutter_picker.dart';
  6. import 'dart:async';
  7. import 'send_express_page/order_detail_page.dart';
  8. import '../util/util.dart';
  9. import '../util/api.dart';
  10. import '../util/models.dart';
  11. import '../showAlert.dart';
  12. import '../send_Dialog.dart';
  13. import '../util/session.dart';
  14. import '../showLineModal.dart';
  15. import '../util/bluetooth_utils.dart';
  16. class SendExpressPage extends StatefulWidget {
  17. final Widget child;
  18. SendExpressPage({
  19. Key key,
  20. this.child
  21. }): super(key: key);
  22. _SendExpressPageState createState() => _SendExpressPageState();
  23. }
  24. class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeepAliveClientMixin {
  25. ScrollController _scrollController = ScrollController();
  26. //组件自用字段-----------------------------
  27. GlobalKey _sendPhoneKey = GlobalKey();
  28. GlobalKey _getPhoneKey = GlobalKey();
  29. GlobalKey _sendCompanyCodeKey = GlobalKey();
  30. GlobalKey _sendCompanyNameKey = GlobalKey();
  31. GlobalKey _getCompanyNameKey = GlobalKey();
  32. GlobalKey _goodsKey = GlobalKey();
  33. double tipWidth = 0;
  34. double tipHeight = 0;
  35. double tipPosX = 0;
  36. double tipPosY = 0;
  37. bool tipStatus = true;//是否展示公司信息匹配列表,true为不展示
  38. bool goodsTipStatus = true;//是否展示货物匹配列表,true为不展示
  39. bool lineModalStatus = false;
  40. bool submitStatus = true;
  41. bool checkedLine = false;//当收件方有多条线路时,此状态表示是否已经选择过线路了
  42. String stationId;//司机端站点id
  43. List < LikePhoneList > likePhoneList = [];
  44. List <GoodsPriceList> goodsPriceList = [];
  45. var timer;
  46. bool sendPhoneOrGetPhoneTab = true; //区分电话提示层点击时填入发件信息或手机信息的标记
  47. TextEditingController sendCompanyPhoneController = TextEditingController();
  48. TextEditingController sendCompanyCodeController = TextEditingController();
  49. TextEditingController sendCompanyNameController = TextEditingController();
  50. TextEditingController receiptCompanyPhoneController = TextEditingController();
  51. TextEditingController receiptCompanyNameController = TextEditingController();
  52. TextEditingController sendCompanyAddressController = TextEditingController();
  53. TextEditingController receiptCompanyAddressController = TextEditingController();
  54. TextEditingController bankCardController = TextEditingController();
  55. TextEditingController bankNameController = TextEditingController();
  56. TextEditingController openBankNameController = TextEditingController();
  57. TextEditingController openBankPhoneController = TextEditingController();
  58. TextEditingController goodsController = TextEditingController();
  59. TextEditingController goodsQuantityController = TextEditingController();
  60. TextEditingController goodsFreightController = TextEditingController();
  61. TextEditingController goodsAgencyFundController = TextEditingController();
  62. TextEditingController goodsPriceProtectionController = TextEditingController();
  63. TextEditingController goodsWeightController = TextEditingController();
  64. TextEditingController memoController = TextEditingController();
  65. FocusNode bankCardFocusNode = FocusNode();
  66. List < dynamic > goodsCateGoryList = [];
  67. List < dynamic > goodsPackageList = [];
  68. //请求字段-------------------------
  69. String lineId = '-1';//收件公司匹配的线路id
  70. String sendCompanyId = '0'; //寄件公司Id
  71. String sendCompanyName = ''; //寄件公司名称 不能为空
  72. String sendCompanyPhone = ''; //寄件公司电话 不能为空
  73. String sendCompanyCode = ''; //寄件公司编码
  74. String sendCompanyProvinceName = ''; //寄件公司省名称 不能为空
  75. String sendCompanyProvinceCode = ''; //寄件公司省编码 不能为空
  76. String sendCompanyCityName = ''; //寄件公司市名称 不能为空
  77. String sendCompanyCityCode = ''; //寄件公司市编码 不能为空
  78. String sendCompanyAreaName = ''; //寄件公司区名称 不能为空
  79. String sendCompanyAreaCode = ''; //寄件公司区编码 不能为空
  80. String sendCompanyAddress = ''; //寄件公司详细地址,不能为空
  81. String receiptCompanyId = '0'; //收件公司id
  82. String receiptCompanyPhone = ''; //收件公司电话 不能为空
  83. String receiptCompanyName = ''; //收件公司名称 不能为空
  84. String receiptCompanyProvinceName = ''; //收件公司省名称 不能为空
  85. String receiptCompanyProvinceCode = ''; //收件公司省编码 不能为空
  86. String receiptCompanyCityName = ''; //收件公司市名称 不能为空
  87. String receiptCompanyCityCode = ''; //收件公市编码 不能为空
  88. String receiptCompanyAreaName = ''; //收件公区名称 不能为空
  89. String receiptCompanyAreaCode = ''; //收件公司区编码 不能为空
  90. String receiptCompanyAddress = ''; //收件公司地址详情 不能为空
  91. String goods = ''; //商品名称 不能为空
  92. int goodsQuantity = 1; //商品数量 不能为空
  93. int goodsPackingId; //商品包装ID
  94. int goodsCategoryId; //商品类别ID
  95. int goodsPaymentMethod = 2; //付款方式 1,现付 2 到付
  96. double goodsWeight = 0.0; //商品重量
  97. double goodsPriceProtection = 0.0; //商品保价
  98. double goodsAgencyFund = 0.0; //商品代收款
  99. double goodsFreight = 0.0; //商品运费 不能为空
  100. String memo = ''; //备注
  101. String bankCard = '';//银行卡号
  102. String bankName = '';//所属银行
  103. String openBankName = '';//开户人
  104. String openBankPhone = '';//开户电话
  105. List<CompanyOfLineList> lineList = [];
  106. String sendPCA = ' '; //Text组件内容必须有空格,否则报null
  107. String getPCA = ' ';
  108. String showTextGoodsCategory = ' ';
  109. String showTextGoodsPackage = ' ';
  110. String showTextPaymentMehod = '到付';
  111. BluetoothUtils bluetooth = BluetoothUtils();
  112. bool checkedCompanyInfo = false;//选择公司信息向sendCompanyPhoneController填充时不去模糊匹配
  113. bool checkedGoodsName = false;//选择货物名称填充时不匹配
  114. String likeWord ='';//以什么为匹配的字段用户控制高亮_tipsItem中的哪一个字段
  115. @override
  116. void initState() {
  117. super.initState();
  118. goodsCategory().then((resp) {//获取商品类型
  119. if (isNotError(context, resp) && this.mounted) {
  120. GoodsCategory goodsCategoryObj = GoodsCategory.fromJson(resp.data);
  121. setState(() {
  122. goodsCateGoryList = goodsCategoryObj.data;
  123. showTextGoodsCategory = goodsCateGoryList[0].name;
  124. goodsCategoryId = goodsCateGoryList[0].id;
  125. });
  126. }
  127. });
  128. goodsPackage().then((resp) {//获取包装类型
  129. if (isNotError(context, resp) && this.mounted) {
  130. GoodsPackage goodsPackageObj = GoodsPackage.fromJson(resp.data);
  131. setState(() {
  132. goodsPackageList = goodsPackageObj.data;
  133. showTextGoodsPackage = goodsPackageList[0].name;
  134. goodsPackingId = goodsPackageList[0].id;
  135. });
  136. }
  137. });
  138. getKey('stationId').then((resp){
  139. stationId = resp;
  140. });
  141. getKey('defaultFreightPrice').then((resp){
  142. setState(() {
  143. goodsFreightController.text = (double.parse(resp)/100).toString();
  144. });
  145. });
  146. _scrollController.addListener(() {
  147. if (!tipStatus) {
  148. setState(() {
  149. tipStatus = true;
  150. });
  151. }
  152. if(!goodsTipStatus){
  153. setState(() {
  154. goodsTipStatus = true;
  155. });
  156. }
  157. //if (_scrollController.position.pixels == _scrollController.position.maxScrollExtent) {}
  158. });
  159. //发件公司电话监听
  160. sendCompanyPhoneController.addListener(() {
  161. if(checkedCompanyInfo){
  162. return;
  163. }
  164. setState(() {
  165. sendCompanyPhone = sendCompanyPhoneController.text;
  166. });
  167. if (timer != null) {
  168. timer.cancel();
  169. }
  170. if (sendCompanyPhoneController.text.length < 6 || sendCompanyPhoneController.text.length > 11) {
  171. setState(() {
  172. tipStatus = true;
  173. });
  174. }
  175. timer = Timer(Duration(milliseconds: 250), () {
  176. if (sendCompanyPhoneController.text.length >= 6 && sendCompanyPhoneController.text.length <= 11) {
  177. likePhone(sendCompanyPhoneController.text).then((resp) {
  178. if (isNotError(context, resp) && this.mounted) {
  179. LikePhone likePhoneObj = LikePhone.fromJson(resp.data);
  180. likePhoneList = likePhoneObj.data;
  181. }
  182. if (likePhoneList.length > 0) {
  183. sendPhoneOrGetPhoneTab = true;
  184. RenderObject sendPhoneObj = _sendPhoneKey.currentContext.findRenderObject();
  185. setState(() {
  186. tipWidth = sendPhoneObj.paintBounds.size.width;
  187. tipHeight = sendPhoneObj.paintBounds.size.height;
  188. tipPosX = sendPhoneObj.getTransformTo(null).getTranslation().x;
  189. tipPosY = sendPhoneObj.getTransformTo(null).getTranslation().y - ScreenUtil.getInstance().setHeight(90);
  190. tipStatus = false;
  191. likeWord='phone';
  192. });
  193. } else {
  194. setState(() {
  195. tipStatus = true;
  196. });
  197. }
  198. });
  199. }
  200. });
  201. });
  202. //发件公司编码监听
  203. sendCompanyCodeController.addListener(() {
  204. if(checkedCompanyInfo){
  205. return;
  206. }
  207. setState(() {
  208. sendCompanyCode = sendCompanyCodeController.text;
  209. });
  210. if (timer != null) {
  211. timer.cancel();
  212. }
  213. if (sendCompanyCodeController.text.length < 2 || sendCompanyCodeController.text.length > 6) {
  214. setState(() {
  215. tipStatus = true;
  216. });
  217. }
  218. timer = Timer(Duration(milliseconds: 250), () {
  219. if (sendCompanyCodeController.text.length >= 2 && sendCompanyCodeController.text.length <= 6) {
  220. likeCompanyCode(sendCompanyCodeController.text).then((resp) {
  221. if (isNotError(context, resp) && this.mounted) {
  222. LikePhone likePhoneObj = LikePhone.fromJson(resp.data);
  223. likePhoneList = likePhoneObj.data;
  224. }
  225. if (likePhoneList.length > 0) {
  226. sendPhoneOrGetPhoneTab = true;
  227. RenderObject sendPhoneObj = _sendCompanyCodeKey.currentContext.findRenderObject();
  228. setState(() {
  229. tipWidth = sendPhoneObj.paintBounds.size.width;
  230. tipHeight = sendPhoneObj.paintBounds.size.height;
  231. tipPosX = sendPhoneObj.getTransformTo(null).getTranslation().x;
  232. tipPosY = sendPhoneObj.getTransformTo(null).getTranslation().y - ScreenUtil.getInstance().setHeight(90);
  233. tipStatus = false;
  234. likeWord='code';
  235. });
  236. } else {
  237. setState(() {
  238. tipStatus = true;
  239. });
  240. }
  241. });
  242. }
  243. });
  244. });
  245. //发件公司名字监听
  246. sendCompanyNameController.addListener(() {
  247. if(checkedCompanyInfo){
  248. return;
  249. }
  250. setState(() {
  251. sendCompanyName = sendCompanyNameController.text;
  252. });
  253. if (timer != null) {
  254. timer.cancel();
  255. }
  256. if (sendCompanyNameController.text.length < 2 || sendCompanyNameController.text.length > 11) {
  257. setState(() {
  258. tipStatus = true;
  259. });
  260. }
  261. timer = Timer(Duration(milliseconds: 250), () {
  262. if (sendCompanyNameController.text.length >= 2 && sendCompanyNameController.text.length <= 11) {
  263. likeCompanyName(sendCompanyNameController.text).then((resp) {
  264. if (isNotError(context, resp) && this.mounted) {
  265. LikePhone likePhoneObj = LikePhone.fromJson(resp.data);
  266. likePhoneList = likePhoneObj.data;
  267. }
  268. if (likePhoneList.length > 0) {
  269. sendPhoneOrGetPhoneTab = true;
  270. RenderObject sendPhoneObj = _sendCompanyNameKey.currentContext.findRenderObject();
  271. setState(() {
  272. tipWidth = sendPhoneObj.paintBounds.size.width;
  273. tipHeight = sendPhoneObj.paintBounds.size.height;
  274. tipPosX = sendPhoneObj.getTransformTo(null).getTranslation().x;
  275. tipPosY = sendPhoneObj.getTransformTo(null).getTranslation().y - ScreenUtil.getInstance().setHeight(90);
  276. tipStatus = false;
  277. likeWord='name';
  278. });
  279. } else {
  280. setState(() {
  281. tipStatus = true;
  282. });
  283. }
  284. });
  285. }
  286. });
  287. });
  288. //收件公司电话监听
  289. receiptCompanyPhoneController.addListener(() {
  290. if(checkedCompanyInfo){
  291. return;
  292. }
  293. setState(() {
  294. receiptCompanyPhone = receiptCompanyPhoneController.text;
  295. });
  296. if (timer != null) {
  297. timer.cancel();
  298. }
  299. if (receiptCompanyPhoneController.text.length < 6 || receiptCompanyPhoneController.text.length > 11) {
  300. setState(() {
  301. tipStatus = true;
  302. });
  303. }
  304. timer = Timer(Duration(milliseconds: 250), () {
  305. if (receiptCompanyPhoneController.text.length >= 6 && receiptCompanyPhoneController.text.length <= 11) {
  306. likePhone(receiptCompanyPhoneController.text).then((resp) {
  307. if (isNotError(context, resp) && this.mounted) {
  308. LikePhone likePhoneObj = LikePhone.fromJson(resp.data);
  309. likePhoneList = likePhoneObj.data;
  310. }
  311. if (likePhoneList.length > 0) {
  312. sendPhoneOrGetPhoneTab = false;
  313. RenderObject getPhoneKey = _getPhoneKey.currentContext.findRenderObject();
  314. setState(() {
  315. tipWidth = getPhoneKey.paintBounds.size.width;
  316. tipHeight = getPhoneKey.paintBounds.size.height;
  317. tipPosX = getPhoneKey.getTransformTo(null).getTranslation().x;
  318. tipPosY = getPhoneKey.getTransformTo(null).getTranslation().y - ScreenUtil.getInstance().setHeight(90);
  319. tipStatus = false;
  320. likeWord='phone';
  321. });
  322. } else {
  323. setState(() {
  324. tipStatus = true;
  325. });
  326. }
  327. });
  328. }
  329. });
  330. });
  331. //收件公司名称监听
  332. receiptCompanyNameController.addListener(() {
  333. if(checkedCompanyInfo){
  334. return;
  335. }
  336. setState(() {
  337. receiptCompanyName = receiptCompanyNameController.text;
  338. });
  339. if (timer != null) {
  340. timer.cancel();
  341. }
  342. if (receiptCompanyNameController.text.length < 2 || receiptCompanyNameController.text.length > 11) {
  343. setState(() {
  344. tipStatus = true;
  345. });
  346. }
  347. timer = Timer(Duration(milliseconds: 250), () {
  348. if (receiptCompanyNameController.text.length >= 2 && receiptCompanyNameController.text.length <= 11) {
  349. likeCompanyName(receiptCompanyNameController.text).then((resp) {
  350. if (isNotError(context, resp) && this.mounted) {
  351. LikePhone likePhoneObj = LikePhone.fromJson(resp.data);
  352. likePhoneList = likePhoneObj.data;
  353. }
  354. if (likePhoneList.length > 0) {
  355. sendPhoneOrGetPhoneTab = false;
  356. RenderObject getPhoneKey = _getCompanyNameKey.currentContext.findRenderObject();
  357. setState(() {
  358. tipWidth = getPhoneKey.paintBounds.size.width;
  359. tipHeight = getPhoneKey.paintBounds.size.height;
  360. tipPosX = getPhoneKey.getTransformTo(null).getTranslation().x;
  361. tipPosY = getPhoneKey.getTransformTo(null).getTranslation().y - ScreenUtil.getInstance().setHeight(90);
  362. tipStatus = false;
  363. likeWord='name';
  364. });
  365. } else {
  366. setState(() {
  367. tipStatus = true;
  368. });
  369. }
  370. });
  371. }
  372. });
  373. });
  374. //货物名称监听
  375. goodsController.addListener(() {
  376. if(checkedGoodsName){
  377. return;
  378. }
  379. setState(() {
  380. goods = goodsController.text;
  381. });
  382. if (timer != null) {
  383. timer.cancel();
  384. }
  385. if (goodsController.text.length < 1) {
  386. setState(() {
  387. goodsTipStatus = true;
  388. });
  389. }
  390. timer = Timer(Duration(milliseconds: 250), () {
  391. if (goodsController.text.length >= 1) {
  392. goodsNameLike(stationId,goodsController.text,lineId).then((resp) {
  393. if (isNotError(context, resp) && this.mounted) {
  394. GoodsPriceObj goodsPriceObj = GoodsPriceObj.fromJson(resp.data);
  395. goodsPriceList = goodsPriceObj.data;
  396. }
  397. if (goodsPriceList.length > 0) {
  398. RenderObject goodsKey = _goodsKey.currentContext.findRenderObject();
  399. setState(() {
  400. tipWidth = goodsKey.paintBounds.size.width;
  401. tipHeight = goodsKey.paintBounds.size.height;
  402. tipPosX = goodsKey.getTransformTo(null).getTranslation().x;
  403. tipPosY = goodsKey.getTransformTo(null).getTranslation().y - ScreenUtil.getInstance().setHeight(90);
  404. goodsTipStatus = false;
  405. });
  406. } else {
  407. setState(() {
  408. goodsTipStatus = true;
  409. });
  410. }
  411. });
  412. }
  413. });
  414. });
  415. sendCompanyAddressController.addListener(() {
  416. setState(() {
  417. sendCompanyAddress = sendCompanyAddressController.text;
  418. });
  419. });
  420. receiptCompanyAddressController.addListener(() {
  421. setState(() {
  422. receiptCompanyAddress = receiptCompanyAddressController.text;
  423. });
  424. });
  425. bankCardFocusNode.addListener((){
  426. if(!bankCardFocusNode.hasFocus){
  427. if(bankCardController.text!=''){
  428. getBankName(bankCardController.text).then((resp){
  429. if(isNotError(context, resp) && this.mounted){
  430. BankNameObj obj = BankNameObj.fromJson(resp.data);
  431. setState(() {
  432. bankNameController.text = obj.data;
  433. });
  434. }
  435. });
  436. }
  437. }
  438. });
  439. }
  440. @override
  441. bool get wantKeepAlive => true;
  442. @override
  443. Widget build(BuildContext context) {
  444. return Container(
  445. child: Scaffold(
  446. appBar: AppBar(
  447. title: Text('发件', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(36)), ),
  448. centerTitle: true,
  449. backgroundColor: Color.fromRGBO(64, 98, 254, 1),
  450. ),
  451. body:
  452. Stack(
  453. children: < Widget > [
  454. Container(
  455. color: Color.fromRGBO(246, 246, 254, 1),
  456. padding: EdgeInsets.fromLTRB(0, ScreenUtil.getInstance().setHeight(20), 0, ScreenUtil.getInstance().setHeight(20)),
  457. child: ListView(
  458. controller: _scrollController,
  459. children: < Widget > [
  460. _sendInfo(context),
  461. _getInfo(context),
  462. _itemInfoWidget(),
  463. _bankInfo(context),
  464. _submitBtn()
  465. ],
  466. ),
  467. ),
  468. Positioned(
  469. top: tipPosY,
  470. left: tipPosX,
  471. child: Offstage(
  472. offstage: tipStatus,
  473. child: Container(
  474. width: tipWidth,
  475. height: ScreenUtil.getInstance().setHeight(450),
  476. padding: EdgeInsets.only(left: ScreenUtil.getInstance().setWidth(30)),
  477. decoration: BoxDecoration(
  478. color: Color.fromRGBO(244, 248, 251, 1),
  479. ),
  480. child: ListView.builder(
  481. itemCount: likePhoneList.length,
  482. itemBuilder: (BuildContext context, int index) {
  483. return _tipItem(likePhoneList[index]);
  484. },
  485. )
  486. ),
  487. )
  488. ),
  489. Positioned(
  490. top: tipPosY,
  491. left: tipPosX,
  492. child: Offstage(
  493. offstage: goodsTipStatus,
  494. child: Container(
  495. width: tipWidth,
  496. height: ScreenUtil.getInstance().setHeight(450),
  497. padding: EdgeInsets.only(left: ScreenUtil.getInstance().setWidth(30)),
  498. decoration: BoxDecoration(
  499. color: Color.fromRGBO(244, 248, 251, 1),
  500. ),
  501. child: ListView.builder(
  502. itemCount: goodsPriceList.length,
  503. itemBuilder: (BuildContext context, int index) {
  504. return _goodsTipItem(goodsPriceList[index]);
  505. },
  506. )
  507. ),
  508. )
  509. )
  510. ],
  511. ),
  512. resizeToAvoidBottomPadding: false //键盘弹出,页面不跟随向上滑动,防止出现溢出错误
  513. ),
  514. );
  515. }
  516. Widget _sendInfo(BuildContext context) {
  517. return Container(
  518. color: Colors.white,
  519. margin: EdgeInsets.only(bottom: ScreenUtil.getInstance().setHeight(20)),
  520. child: Column(
  521. children: < Widget > [
  522. _titleWidget('lib/images/icon_send.png', '发件信息'),
  523. _underLine(),
  524. _inputWiget('send_phone','发件电话', _sendPhoneKey,sendCompanyPhoneController),
  525. _inputWiget('send_code','企业编码', _sendCompanyCodeKey, sendCompanyCodeController,true),
  526. _inputWiget('send_name','企业名称', _sendCompanyNameKey, sendCompanyNameController,true),
  527. _cityWiget('城市/区域', context, 'send'),
  528. _lastContentWiget('详细地址', 'send')
  529. ],
  530. )
  531. );
  532. }
  533. Widget _getInfo(BuildContext context) {
  534. return Container(
  535. color: Colors.white,
  536. margin: EdgeInsets.only(bottom: ScreenUtil.getInstance().setHeight(20)),
  537. child: Column(
  538. children: < Widget > [
  539. _titleWidget('lib/images/icon_shoujian.png', '收件信息'),
  540. _underLine(),
  541. _inputWiget('get_phone','收件电话', _getPhoneKey,receiptCompanyPhoneController),
  542. _inputWiget('get_name','企业名称', _getCompanyNameKey,receiptCompanyNameController ,true),
  543. _cityWiget('城市/区域', context, 'get'),
  544. _lastContentWiget('详细地址', 'get')
  545. ],
  546. )
  547. );
  548. }
  549. Widget _itemInfoWidget() {
  550. return Container(
  551. child: Container(
  552. color: Colors.white,
  553. margin: EdgeInsets.only(bottom: ScreenUtil.getInstance().setHeight(20)),
  554. child: Column(
  555. crossAxisAlignment: CrossAxisAlignment.start,
  556. children: < Widget > [
  557. _titleWidget('lib/images/icon_huowu.png', "货物信息"),
  558. _underLine(),
  559. _itemContentWiget("货物名称", goodsController, true),
  560. _itemContentWiget("数量", goodsQuantityController),
  561. _itemContentWiget("运费", goodsFreightController),
  562. _itemContentWiget("代收", goodsAgencyFundController),
  563. _itemContentWiget("保价", goodsPriceProtectionController),
  564. _itemContentWiget("重量", goodsWeightController),
  565. _packageType('包装类型'),
  566. _packageType('货物类型'),
  567. _packageType('付款方式'),
  568. _descWidget()
  569. ],
  570. ),
  571. )
  572. );
  573. }
  574. Widget _bankInfo(BuildContext context) {
  575. return Container(
  576. color: Colors.white,
  577. margin: EdgeInsets.only(bottom: ScreenUtil.getInstance().setHeight(20)),
  578. child: Column(
  579. children: < Widget > [
  580. _titleWidget('lib/images/icon_bank.png', '银行信息'),
  581. _underLine(),
  582. _contentBankWiget('银行卡号', 'bank'),
  583. _contentBankWiget('银行名称', 'bank',true),
  584. _contentBankWiget('开户人', 'bank',true),
  585. _lastBankContentWiget('开户电话', 'bank'),
  586. ],
  587. )
  588. );
  589. }
  590. Widget _titleWidget(String iconUrl, String str) {
  591. return Container(
  592. height: ScreenUtil.getInstance().setHeight(90),
  593. padding: EdgeInsets.only(left: ScreenUtil.getInstance().setWidth(30)),
  594. child: Center(
  595. child: Row(
  596. mainAxisAlignment: MainAxisAlignment.start,
  597. children: < Widget > [
  598. Padding(
  599. padding: EdgeInsets.only(right: ScreenUtil.getInstance().setHeight(20)),
  600. child: Image.asset(
  601. iconUrl,
  602. width: ScreenUtil.getInstance().setWidth(40),
  603. height: ScreenUtil.getInstance().setHeight(40),
  604. )
  605. ),
  606. Text(str, style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(32)), )
  607. ],
  608. ),
  609. ),
  610. );
  611. }
  612. Widget _underLine() {
  613. return Container(
  614. color: Color.fromRGBO(223, 223, 223, 1),
  615. height: ScreenUtil.getInstance().setHeight(1),
  616. );
  617. }
  618. Widget _inputWiget(String key,String title GlobalKey tab,TextEditingController tab1,[bool keyboardType = false]) {
  619. return Padding(
  620. key: tab,
  621. padding: EdgeInsets.only(left: ScreenUtil.getInstance().setWidth(30)),
  622. child: Column(
  623. children: < Widget > [
  624. SizedBox(
  625. height: ScreenUtil.getInstance().setHeight(89),
  626. child: Center(
  627. child: Row(
  628. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  629. children: < Widget > [
  630. Expanded(
  631. flex: 0,
  632. child: Text(title, style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(74, 74, 74, 1)), ),
  633. ),
  634. Expanded(
  635. child: Row(
  636. mainAxisAlignment: MainAxisAlignment.end,
  637. children: < Widget > [
  638. SizedBox(
  639. width: ScreenUtil.getInstance().setWidth(500),
  640. child: Padding(
  641. padding: EdgeInsets.only(right: ScreenUtil.getInstance().setWidth(30)),
  642. child: TextField(
  643. controller: tab1,
  644. keyboardType: keyboardType ? TextInputType.text : TextInputType.number,
  645. textAlign: TextAlign.end,
  646. decoration: InputDecoration(
  647. border: InputBorder.none
  648. ),
  649. onEditingComplete: () {
  650. setState(() {
  651. FocusScope.of(context).requestFocus(FocusNode());
  652. tipStatus = true;
  653. });
  654. },
  655. onChanged: (value){
  656. checkedCompanyInfo = false;
  657. if(key=='send_phone'){
  658. sendCompanyCode = '';
  659. sendCompanyName = '';
  660. sendCompanyId ='0';
  661. sendCompanyCodeController.text = '';
  662. sendCompanyNameController.text = '';
  663. sendPCA = '';
  664. sendCompanyProvinceName = '';
  665. sendCompanyProvinceCode = '';
  666. sendCompanyCityName = '';
  667. sendCompanyCityCode = '';
  668. sendCompanyAreaName = '';
  669. sendCompanyAreaCode = '';
  670. bankCardController.text = '';
  671. bankNameController.text = '';
  672. openBankNameController.text = '';
  673. openBankPhoneController.text = '';
  674. sendCompanyAddressController.text = '';
  675. }else if(key=='get_phone'){
  676. receiptCompanyName = '';
  677. receiptCompanyNameController.text = '';
  678. receiptCompanyId = '0';
  679. getPCA = '';
  680. receiptCompanyProvinceName = '';
  681. receiptCompanyProvinceCode = '';
  682. receiptCompanyCityName = '';
  683. receiptCompanyCityCode = '';
  684. receiptCompanyAreaName = '';
  685. receiptCompanyAreaCode = '';
  686. receiptCompanyAddressController.text = '';
  687. }else if(key=='send_code'){
  688. sendCompanyPhone = '';
  689. sendCompanyName = '';
  690. sendCompanyId ='0';
  691. sendCompanyPhoneController.text = '';
  692. sendCompanyNameController.text = '';
  693. sendPCA = '';
  694. sendCompanyProvinceName = '';
  695. sendCompanyProvinceCode = '';
  696. sendCompanyCityName = '';
  697. sendCompanyCityCode = '';
  698. sendCompanyAreaName = '';
  699. sendCompanyAreaCode = '';
  700. bankCardController.text = '';
  701. bankNameController.text = '';
  702. openBankNameController.text = '';
  703. openBankPhoneController.text = '';
  704. sendCompanyAddressController.text = '';
  705. }else if(key=='send_name'){
  706. sendCompanyCode = '';
  707. sendCompanyPhone = '';
  708. sendCompanyId ='0';
  709. sendCompanyCodeController.text = '';
  710. sendCompanyPhoneController.text = '';
  711. sendPCA = '';
  712. sendCompanyProvinceName = '';
  713. sendCompanyProvinceCode = '';
  714. sendCompanyCityName = '';
  715. sendCompanyCityCode = '';
  716. sendCompanyAreaName = '';
  717. sendCompanyAreaCode = '';
  718. bankCardController.text = '';
  719. bankNameController.text = '';
  720. openBankNameController.text = '';
  721. openBankPhoneController.text = '';
  722. sendCompanyAddressController.text = '';
  723. }else if(key=='get_name'){
  724. receiptCompanyPhone = '';
  725. receiptCompanyPhoneController.text = '';
  726. receiptCompanyId = '0';
  727. getPCA = '';
  728. receiptCompanyProvinceName = '';
  729. receiptCompanyProvinceCode = '';
  730. receiptCompanyCityName = '';
  731. receiptCompanyCityCode = '';
  732. receiptCompanyAreaName = '';
  733. receiptCompanyAreaCode = '';
  734. receiptCompanyAddressController.text = '';
  735. }
  736. },
  737. ),
  738. )
  739. ),
  740. // Icon(Icons.keyboard_arrow_right, color: Color.fromRGBO(199, 199, 204, 1), )
  741. ],
  742. )
  743. )
  744. ],
  745. ),
  746. )
  747. ),
  748. Expanded(
  749. flex: 0,
  750. child: _underLine()
  751. )
  752. ],
  753. )
  754. );
  755. }
  756. Widget _itemContentWiget(String key,TextEditingController controller, [bool keyboardType = false]) { //false是数字键盘
  757. return Padding(
  758. key: key=='货物名称'?_goodsKey:null,
  759. padding: EdgeInsets.only(left: ScreenUtil.getInstance().setWidth(30)),
  760. child: Column(
  761. children: < Widget > [
  762. SizedBox(
  763. height: ScreenUtil.getInstance().setHeight(89),
  764. child: Center(
  765. child: Row(
  766. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  767. children: < Widget > [
  768. Expanded(
  769. flex: 0,
  770. child: Text(key, style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(74, 74, 74, 1)), ),
  771. ),
  772. Expanded(
  773. child: Row(
  774. mainAxisAlignment: MainAxisAlignment.end,
  775. children: < Widget > [
  776. SizedBox(
  777. width: ScreenUtil.getInstance().setWidth(500),
  778. child: Padding(
  779. padding: EdgeInsets.only(right: ScreenUtil.getInstance().setWidth(30)),
  780. child:TextField(
  781. controller: controller,
  782. keyboardType: keyboardType ? TextInputType.text : TextInputType.number,
  783. textAlign: TextAlign.end,
  784. decoration: InputDecoration(
  785. border: InputBorder.none
  786. ),
  787. onChanged: (value) {
  788. if (key == '货物名称') {
  789. goods = value;
  790. } else if (key == '数量') {
  791. goodsQuantity = int.parse(value);
  792. } else if (key == '运费') {
  793. goodsFreight = double.parse(value);
  794. String temp = goodsFreight.toStringAsFixed(1);
  795. goodsFreight = double.parse(temp);
  796. } else if (key == '代收') {
  797. goodsAgencyFund = double.parse(value);
  798. String temp = goodsAgencyFund.toStringAsFixed(1);
  799. goodsAgencyFund = double.parse(temp);
  800. } else if (key == '保价') {
  801. goodsPriceProtection = double.parse(value);
  802. String temp = goodsPriceProtection.toStringAsFixed(1);
  803. goodsPriceProtection = double.parse(temp);
  804. } else if (key == '重量') {
  805. goodsWeight = double.parse(value);
  806. String temp = goodsWeight.toStringAsFixed(1);
  807. goodsWeight = double.parse(temp);
  808. }
  809. },
  810. ),
  811. )
  812. ),
  813. // Icon(Icons.keyboard_arrow_right, color: Color.fromRGBO(199, 199, 204, 1), )
  814. ],
  815. )
  816. )
  817. ],
  818. ),
  819. )
  820. ),
  821. Expanded(
  822. flex: 0,
  823. child: _underLine()
  824. )
  825. ],
  826. )
  827. );
  828. }
  829. Widget _contentBankWiget(String key, String type, [bool keyboardType = false]) { //false是数字键盘
  830. return Padding(
  831. padding: EdgeInsets.only(left: ScreenUtil.getInstance().setWidth(30)),
  832. child: Column(
  833. children: < Widget > [
  834. SizedBox(
  835. height: ScreenUtil.getInstance().setHeight(89),
  836. child: Center(
  837. child: Row(
  838. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  839. children: < Widget > [
  840. Expanded(
  841. flex: 0,
  842. child: Text(key, style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(74, 74, 74, 1)), ),
  843. ),
  844. Expanded(
  845. child: Row(
  846. mainAxisAlignment: MainAxisAlignment.end,
  847. children: < Widget > [
  848. SizedBox(
  849. width: ScreenUtil.getInstance().setWidth(500),
  850. child:
  851. Padding(
  852. padding: EdgeInsets.only(right: ScreenUtil.getInstance().setWidth(30)),
  853. child:TextField(
  854. focusNode: key == '银行卡号'?bankCardFocusNode:null,
  855. controller: key == '银行卡号'?bankCardController:key=='银行名称'?bankNameController:openBankNameController,
  856. keyboardType: keyboardType ? TextInputType.text : TextInputType.number,
  857. textAlign: TextAlign.end,
  858. decoration: InputDecoration(
  859. border: InputBorder.none
  860. ),
  861. ),
  862. )
  863. ),
  864. // Icon(Icons.keyboard_arrow_right, color: Color.fromRGBO(199, 199, 204, 1), )
  865. ],
  866. )
  867. )
  868. ],
  869. ),
  870. )
  871. ),
  872. Expanded(
  873. flex: 0,
  874. child: _underLine()
  875. )
  876. ],
  877. )
  878. );
  879. }
  880. Widget _cityWiget(String key, BuildContext context, String type) {
  881. return
  882. GestureDetector(
  883. child: Padding(
  884. padding: EdgeInsets.only(left: ScreenUtil.getInstance().setWidth(30)),
  885. child: Column(
  886. children: < Widget > [
  887. SizedBox(
  888. height: ScreenUtil.getInstance().setHeight(89),
  889. child: Center(
  890. child: Row(
  891. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  892. children: < Widget > [
  893. Expanded(
  894. flex: 0,
  895. child: Text(key, style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(74, 74, 74, 1)), ),
  896. ),
  897. Expanded(
  898. child: Row(
  899. mainAxisAlignment: MainAxisAlignment.end,
  900. children: < Widget > [
  901. //Text('${value}', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(136, 136, 136, 1)), ),
  902. SizedBox(
  903. width: ScreenUtil.getInstance().setWidth(500),
  904. child: Text(type == 'send' ? sendPCA : getPCA, textAlign: TextAlign.end, overflow: TextOverflow.ellipsis, )
  905. ),
  906. Icon(Icons.keyboard_arrow_right, color: Color.fromRGBO(199, 199, 204, 1), )
  907. ],
  908. )
  909. )
  910. ],
  911. ),
  912. )
  913. ),
  914. Expanded(
  915. flex: 0,
  916. child: _underLine()
  917. )
  918. ],
  919. )
  920. ),
  921. onTap: () {
  922. getCity(context).then((resp) {
  923. if (resp == null) {
  924. return;
  925. }
  926. print(resp.toString());
  927. setState(() {
  928. if (type == 'send') {
  929. sendPCA = resp.provinceName + ' ' + resp.cityName + ' ' + ' ' + resp.areaName;
  930. sendCompanyProvinceName = resp.provinceName;
  931. sendCompanyProvinceCode = resp.provinceId;
  932. sendCompanyCityName = resp.cityName;
  933. sendCompanyCityCode = resp.cityId;
  934. sendCompanyAreaName = resp.areaName;
  935. sendCompanyAreaCode = resp.areaId;
  936. } else {
  937. getPCA = resp.provinceName + ' ' + resp.cityName + ' ' + ' ' + resp.areaName;
  938. receiptCompanyProvinceName = resp.provinceName;
  939. receiptCompanyProvinceCode = resp.provinceId;
  940. receiptCompanyCityName = resp.cityName;
  941. receiptCompanyCityCode = resp.cityId;
  942. receiptCompanyAreaName = resp.areaName;
  943. receiptCompanyAreaCode = resp.areaId;
  944. }
  945. });
  946. //print(value);
  947. });
  948. },
  949. );
  950. }
  951. Widget _lastContentWiget(String key, String type) {
  952. return Padding(
  953. padding: EdgeInsets.only(left: ScreenUtil.getInstance().setWidth(30)),
  954. child: SizedBox(
  955. height: ScreenUtil.getInstance().setHeight(89),
  956. child: Center(
  957. child: Row(
  958. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  959. children: < Widget > [
  960. Expanded(
  961. flex: 0,
  962. child: Text(key, style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(74, 74, 74, 1)), ),
  963. ),
  964. Expanded(
  965. child: Row(
  966. mainAxisAlignment: MainAxisAlignment.end,
  967. children: < Widget > [
  968. //Text('${value}', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(136, 136, 136, 1)), ),
  969. SizedBox(
  970. width: ScreenUtil.getInstance().setWidth(500),
  971. child: Padding(
  972. padding: EdgeInsets.only(right: ScreenUtil.getInstance().setWidth(30)),
  973. child: TextField(
  974. controller: type == 'send' ? sendCompanyAddressController : receiptCompanyAddressController,
  975. textAlign: TextAlign.end,
  976. decoration: InputDecoration(
  977. border: InputBorder.none
  978. ),
  979. ),
  980. )
  981. ),
  982. // Icon(Icons.keyboard_arrow_right, color: Color.fromRGBO(199, 199, 204, 1), )
  983. ],
  984. )
  985. )
  986. ],
  987. ),
  988. )
  989. )
  990. );
  991. }
  992. Widget _lastBankContentWiget(String key, String type) {
  993. return Padding(
  994. padding: EdgeInsets.only(left: ScreenUtil.getInstance().setWidth(30)),
  995. child: SizedBox(
  996. height: ScreenUtil.getInstance().setHeight(89),
  997. child: Center(
  998. child: Row(
  999. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  1000. children: < Widget > [
  1001. Expanded(
  1002. flex: 0,
  1003. child: Text(key, style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(74, 74, 74, 1)), ),
  1004. ),
  1005. Expanded(
  1006. child: Row(
  1007. mainAxisAlignment: MainAxisAlignment.end,
  1008. children: < Widget > [
  1009. //Text('${value}', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(136, 136, 136, 1)), ),
  1010. SizedBox(
  1011. width: ScreenUtil.getInstance().setWidth(500),
  1012. child: Padding(
  1013. padding: EdgeInsets.only(right: ScreenUtil.getInstance().setWidth(30)),
  1014. child: TextField(
  1015. controller: openBankPhoneController,
  1016. textAlign: TextAlign.end,
  1017. keyboardType: TextInputType.number,
  1018. decoration: InputDecoration(
  1019. border: InputBorder.none
  1020. ),
  1021. ),
  1022. )
  1023. ),
  1024. // Icon(Icons.keyboard_arrow_right, color: Color.fromRGBO(199, 199, 204, 1), )
  1025. ],
  1026. )
  1027. )
  1028. ],
  1029. ),
  1030. )
  1031. )
  1032. );
  1033. }
  1034. Widget _descWidget() {
  1035. return
  1036. Container(
  1037. padding: EdgeInsets.all(ScreenUtil.getInstance().setWidth(30)),
  1038. //child: Text(str, maxLines: 100, style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(74, 74, 74, 1)), ),
  1039. child: TextField(
  1040. maxLines: 3,
  1041. controller: memoController,
  1042. decoration: InputDecoration(
  1043. border: InputBorder.none,
  1044. hintText: "请输入备注内容"
  1045. ),
  1046. onChanged: (value) {
  1047. setState(() {
  1048. memo = value;
  1049. });
  1050. },
  1051. ),
  1052. );
  1053. }
  1054. Widget _submitBtn() {
  1055. return GestureDetector(
  1056. child: Container(
  1057. margin: EdgeInsets.fromLTRB(ScreenUtil.getInstance().setWidth(30), ScreenUtil.getInstance().setWidth(50), ScreenUtil.getInstance().setWidth(30), ScreenUtil.getInstance().setWidth(40)),
  1058. height: ScreenUtil.getInstance().setHeight(88),
  1059. decoration: BoxDecoration(
  1060. borderRadius: BorderRadius.all(Radius.circular(4)),
  1061. color: Color.fromRGBO(37, 102, 242, 1),
  1062. ),
  1063. child: Center(
  1064. child: Row(
  1065. mainAxisAlignment: MainAxisAlignment.center,
  1066. children: < Widget > [
  1067. Offstage(
  1068. offstage: submitStatus,
  1069. child: SizedBox(
  1070. width: ScreenUtil.getInstance().setWidth(45),
  1071. height: ScreenUtil.getInstance().setHeight(45),
  1072. child: Image.asset('lib/images/loading.gif'),
  1073. ),
  1074. ),
  1075. Text("提交", style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(32), color: Colors.white), ),
  1076. ],
  1077. )
  1078. ),
  1079. ),
  1080. onTap: () {
  1081. if (!submitStatus) {
  1082. return;
  1083. }
  1084. String errStr = '';
  1085. print('sendCompanyId---${sendCompanyId}');
  1086. print('sendCompanyName---${sendCompanyName}');
  1087. print('sendCompanyPhone---${sendCompanyPhone}');
  1088. print('sendCompanyCode---${sendCompanyCode}');
  1089. print('sendCompanyProvinceName---${sendCompanyProvinceName}');
  1090. print('sendCompanyProvinceCode---${sendCompanyProvinceCode}');
  1091. print('sendCompanyCityName---${sendCompanyCityName}');
  1092. print('sendCompanyCityCode---${sendCompanyCityCode}');
  1093. print('sendCompanyAreaName---${sendCompanyAreaName}');
  1094. print('sendCompanyAreaCode---${sendCompanyAreaCode}');
  1095. print('sendCompanyAddress---${sendCompanyAddress}');
  1096. print('receiptCompanyId---${receiptCompanyId}');
  1097. print('receiptCompanyPhone---${receiptCompanyPhone}');
  1098. print('receiptCompanyName---${receiptCompanyName}');
  1099. print('receiptCompanyProvinceName---${receiptCompanyProvinceName}');
  1100. print('receiptCompanyProvinceCode---${receiptCompanyProvinceCode}');
  1101. print('receiptCompanyCityName---${receiptCompanyCityName}');
  1102. print('receiptCompanyCityCode---${receiptCompanyCityCode}');
  1103. print('receiptCompanyAreaName---${receiptCompanyAreaName}');
  1104. print('receiptCompanyAreaCode---${receiptCompanyAreaCode}');
  1105. print('receiptCompanyAddress---${receiptCompanyAddress}');
  1106. print('goods---${goods}');
  1107. print('goodsQuantity---${goodsQuantity}');
  1108. print('goodsPackingId---${goodsPackingId}');
  1109. print('goodsCategoryId---${goodsCategoryId}');
  1110. print('goodsPaymentMethod---${goodsPaymentMethod}');
  1111. print('goodsWeight---${goodsWeight}');
  1112. print('goodsPriceProtection---${goodsPriceProtection}');
  1113. print('goodsAgencyFund---${goodsAgencyFund}');
  1114. print('goodsFreight---${goodsFreight}');
  1115. print('memo---${memo}');
  1116. if (sendCompanyPhone == '') {
  1117. errStr = '请填写发件电话';
  1118. }
  1119. if (sendCompanyName == '') {
  1120. errStr = '请填写发件企业名称';
  1121. }
  1122. if (sendCompanyProvinceName == '') {
  1123. errStr = '请填写发件城市/区域';
  1124. }
  1125. if (sendCompanyAddress == '') {
  1126. errStr = '请填写发件详细地址';
  1127. }
  1128. if (receiptCompanyPhone == '') {
  1129. errStr = '请填写收件电话';
  1130. }
  1131. if (receiptCompanyName == '') {
  1132. errStr = '请填写收件企业名称';
  1133. }
  1134. if (receiptCompanyProvinceName == '') {
  1135. errStr = '请填写收件城市/区域';
  1136. }
  1137. if (receiptCompanyAddress == '') {
  1138. errStr = '请填写收件详细地址';
  1139. }
  1140. // if (goods == '') {
  1141. // errStr = '请填写货物名称';
  1142. // }
  1143. if (goodsQuantity == 0) {
  1144. errStr = '请填写货物数量';
  1145. }
  1146. if (int.tryParse(goodsQuantity.toString()) == null) {
  1147. errStr = '货物数量格式错误';
  1148. }
  1149. if (goodsFreight == 0.0) {
  1150. errStr = '请填写运费';
  1151. }
  1152. if (sendCompanyPhone == '' || receiptCompanyPhone == '' ) {
  1153. errStr = '请输入正确的电话';
  1154. }
  1155. if (goodsAgencyFund>0) {//如果有代收
  1156. if(bankNameController.text=='' || bankCardController.text=='' || openBankNameController.text=='' || openBankPhoneController.text==''){
  1157. errStr = "请补全银行卡信息";
  1158. }
  1159. }
  1160. if (errStr != '') {
  1161. showError(errStr);
  1162. return;
  1163. }
  1164. if(lineList.length>1 && !checkedLine){
  1165. showLineModal(lineList);
  1166. return;
  1167. }
  1168. submitOrder();
  1169. },
  1170. );
  1171. }
  1172. submitOrder(){
  1173. setState(() {
  1174. submitStatus = false;
  1175. });
  1176. getKey('stationId').then((value) {
  1177. createOrder(
  1178. lineId,//收件线路Id
  1179. value,//当前用户选择的站点id
  1180. sendCompanyId, //寄件公司Id
  1181. sendCompanyName, //寄件公司名称 不能为空
  1182. sendCompanyPhone, //寄件公司电话 不能为空
  1183. sendCompanyCode ?? '', //寄件公司编码
  1184. sendCompanyProvinceName, //寄件公司省名称 不能为空
  1185. sendCompanyProvinceCode, //寄件公司省编码 不能为空
  1186. sendCompanyCityName, //寄件公司市名称 不能为空
  1187. sendCompanyCityCode, //寄件公司市编码 不能为空
  1188. sendCompanyAreaName, //寄件公司区名称 不能为空
  1189. sendCompanyAreaCode, //寄件公司区编码 不能为空
  1190. sendCompanyAddress, //寄件公司详细地址,不能为空
  1191. receiptCompanyId, //收件公司id
  1192. receiptCompanyPhone, //收件公司电话 不能为空
  1193. receiptCompanyName, //收件公司名称 不能为空
  1194. receiptCompanyProvinceName, //收件公司省名称 不能为空
  1195. receiptCompanyProvinceCode, //收件公司省编码 不能为空
  1196. receiptCompanyCityName, //收件公司市名称 不能为空
  1197. receiptCompanyCityCode, //收件公市编码 不能为空
  1198. receiptCompanyAreaName, //收件公区名称 不能为空
  1199. receiptCompanyAreaCode, //收件公司区编码 不能为空
  1200. receiptCompanyAddress, //收件公司地址详情 不能为空
  1201. goods, //商品名称 不能为空
  1202. goodsQuantity, //商品数量 不能为空
  1203. goodsPackingId, //商品包装ID
  1204. goodsCategoryId, //商品类别ID
  1205. goodsPaymentMethod, //付款方式 1,现付 2 到付
  1206. goodsWeight, //商品重量
  1207. goodsPriceProtection * 100, //商品保价,已分为单位
  1208. goodsAgencyFund * 100, //商品代收款,已分为单位
  1209. goodsFreight * 100, //商品运费 不能为空 ,已分为单位
  1210. memo, //备注
  1211. bankCardController.text,
  1212. bankNameController.text,
  1213. openBankNameController.text,
  1214. openBankPhoneController.text
  1215. ).then((resp) {
  1216. if (isNotError(context, resp) && this.mounted) {
  1217. setState(() {
  1218. submitStatus = true;
  1219. });
  1220. OrderDetailData data = OrderDetailObj.fromJson(resp.data).data;
  1221. showDialog < Null > (
  1222. context: context, //BuildContext对象
  1223. barrierDismissible: false,
  1224. builder: (BuildContext context) {
  1225. //打印
  1226. getKey('printType').then((printType){
  1227. getKey('stationName').then((stationName){
  1228. getKey('nickName').then((nickName){
  1229. getKey('companyName').then((companyName){
  1230. getKey('companyCustomerPhone').then((companyCustomerPhone){
  1231. double goodsYs = data.goodsPaymentMethod==2?(data.goodsFreight/100)+(data.goodsAgencyFund/100):data.goodsAgencyFund/100;
  1232. String nowDate = fromatDate( DateTime.now().millisecondsSinceEpoch);//打印时间
  1233. String createTime = fromatDate(data.createTime);
  1234. double goodsAgencyFunds = data.goodsAgencyFund/100;
  1235. double goodsDFreight = data.goodsPaymentMethod==2?data.goodsFreight/100:0;
  1236. double goodsXFreight = data.goodsPaymentMethod==1?data.goodsFreight/100:0;
  1237. String receiptAddress = data.receiptCompanyAddress.length>10?data.receiptCompanyAddress.substring(0,10):data.receiptCompanyAddress;
  1238. Map<String, String> pum = {
  1239. "[logisticsNo]": "${data.orderNo ?? ''}",
  1240. "[createTime]": "$createTime",
  1241. "[sendStationName]": "$stationName",
  1242. "[dealerCode]": "${data.sendCompanyCode ?? ''}",
  1243. "[dealerName]": "${data.sendCompanyName}",
  1244. "[dealerTel]": "${data.sendCompanyPhone ?? ''}",
  1245. "[repairName]": "${data.receiptCompanyName ?? ''}",
  1246. "[repairTel]": "${data.receiptCompanyPhone ?? ''}",
  1247. "[endStationName]": "${data.receiptStationName ?? ''}",
  1248. "[goodsLineCode]": "${data.lineCode ?? ''}",
  1249. "[goodsLine]": "${data.lineName ?? ''}",
  1250. "[repairAddress]": "${receiptAddress?? ''}",
  1251. "[goodsQuantity]": "${data.goodsQuantity ?? ''}",
  1252. "[goodsInsurance]": "${data.goodsInsurance ?? ''}",
  1253. "[goodsFlatCost]": "${data.goodsFlatCost ?? ''}",
  1254. // 到付 现付 金额
  1255. "[goodsDFreight]": "$goodsDFreight",
  1256. "[goodsXFreight]": "$goodsXFreight",
  1257. "[goodsAgencyFund]": "$goodsAgencyFunds",
  1258. "[goodsYs]": "$goodsYs",
  1259. "[dealerBankAccount]": "${data.sendCompanyBankCard ?? ''}",
  1260. "[goodsRemark]": "${data.memo ?? ''}",
  1261. "[realName]": "${nickName?? ''}",
  1262. "[currentTime]": "$nowDate",
  1263. "[currentGoodNumber]": "1/1",
  1264. "[companyCustomerPhone]":"$companyCustomerPhone",
  1265. "[companyName]":"$companyName"
  1266. };
  1267. bluetooth.printOrder(pum, int.parse(printType)).then((value){
  1268. if(value==null){
  1269. showDialog <Null> (
  1270. context: context,
  1271. barrierDismissible: false,
  1272. builder: (BuildContext context) {
  1273. return MyAlertDialog(text: '未连接打印机',childCallback:(val){});
  1274. }
  1275. );
  1276. }
  1277. });
  1278. });
  1279. });
  1280. });
  1281. });
  1282. });
  1283. return SendDialog( //调用对话框
  1284. orderNo: data.orderNo,
  1285. childCallback: (val) {
  1286. if (!val) {
  1287. //跳转
  1288. Navigator.push(context, MaterialPageRoute(builder: (context) {
  1289. return OrderDetail(orderNo: data.orderNo, );
  1290. }));
  1291. }else{
  1292. setState(() {
  1293. //----------------清除信息--------------------
  1294. lineId = '-1';
  1295. sendCompanyCode = '';
  1296. sendCompanyName = '';
  1297. sendCompanyId ='0';
  1298. sendCompanyPhoneController.text= '';
  1299. sendCompanyCodeController.text = '';
  1300. sendCompanyNameController.text = '';
  1301. sendPCA = '';
  1302. sendCompanyProvinceName = '';
  1303. sendCompanyProvinceCode = '';
  1304. sendCompanyCityName = '';
  1305. sendCompanyCityCode = '';
  1306. sendCompanyAreaName = '';
  1307. sendCompanyAreaCode = '';
  1308. bankCardController.text = '';
  1309. bankNameController.text = '';
  1310. openBankNameController.text = '';
  1311. openBankPhoneController.text = '';
  1312. sendCompanyAddressController.text = '';
  1313. receiptCompanyName = '';
  1314. receiptCompanyPhoneController.text= '';
  1315. receiptCompanyNameController.text = '';
  1316. receiptCompanyId = '0';
  1317. getPCA = '';
  1318. receiptCompanyProvinceName = '';
  1319. receiptCompanyProvinceCode = '';
  1320. receiptCompanyCityName = '';
  1321. receiptCompanyCityCode = '';
  1322. receiptCompanyAreaName = '';
  1323. receiptCompanyAreaCode = '';
  1324. receiptCompanyAddressController.text = '';
  1325. goods = ''; //商品名称 不能为空
  1326. goodsQuantity = 1; //商品数量 不能为空
  1327. goodsPaymentMethod = 2; //付款方式 1,现付 2 到付
  1328. goodsWeight = 0.0; //商品重量
  1329. goodsPriceProtection = 0.0; //商品保价
  1330. goodsAgencyFund = 0.0; //商品代收款
  1331. goodsFreight = 0.0; //商品运费 不能为空
  1332. memo = ''; //备注
  1333. goodsController.text = '';
  1334. goodsQuantityController.text = '';
  1335. goodsFreightController.text = '';
  1336. goodsAgencyFundController.text = '';
  1337. goodsPriceProtectionController.text = '';
  1338. goodsWeightController.text = '';
  1339. memoController.text = '';
  1340. //---------------------------------------------
  1341. });
  1342. }
  1343. },
  1344. );
  1345. });
  1346. } else {
  1347. setState(() {
  1348. submitStatus = true;
  1349. });
  1350. }
  1351. });
  1352. });
  1353. }
  1354. showError(String str) {
  1355. showDialog < Null > (
  1356. context: context, //BuildContext对象
  1357. barrierDismissible: false,
  1358. builder: (BuildContext context) {
  1359. return MyAlertDialog( //调用对话框
  1360. text: str, childCallback: (val) {},
  1361. );
  1362. });
  1363. }
  1364. showLineModal(List<CompanyOfLineList> list){
  1365. showDialog < Null > (
  1366. context: context, //BuildContext对象
  1367. barrierDismissible: false,
  1368. builder: (BuildContext context) {
  1369. return ShowLineModal(
  1370. lineList: list, childCallback: (val) {
  1371. lineId = val;
  1372. goodsNameAccurate(stationId,goodsController.text,lineId).then((resp){
  1373. if(isNotError(context, resp) && this.mounted){
  1374. if(resp.data['data']['goods']!=null){
  1375. GoodsPriceList tempObj = GoodsPriceObjAccurate.fromJson(resp.data).data;
  1376. setState(() {
  1377. goods=tempObj.goods;
  1378. goodsController.text = tempObj.goods;
  1379. goodsFreight = tempObj.price/100;
  1380. goodsFreightController.text = (tempObj.price/100).toString();
  1381. });
  1382. }
  1383. checkedLine = true;
  1384. }
  1385. });
  1386. },
  1387. );
  1388. });
  1389. }
  1390. Future getCity(context) async {
  1391. Result result = await CityPickers.showCityPicker(
  1392. context: context,
  1393. );
  1394. return result;
  1395. }
  1396. Widget _tipItem(LikePhoneList obj) {
  1397. return Container(
  1398. child: Column(
  1399. children: < Widget > [
  1400. InkWell(
  1401. child: Container(
  1402. height: ScreenUtil.getInstance().setHeight(89),
  1403. child: Center(
  1404. child: Row(
  1405. mainAxisAlignment: MainAxisAlignment.start,
  1406. children: < Widget > [
  1407. Padding(
  1408. padding: EdgeInsets.only(right: ScreenUtil.getInstance().setWidth(50)),
  1409. child: Text(obj.uzerPhone!=null?obj.uzerPhone:obj.companyPhone, style: TextStyle(
  1410. fontSize: ScreenUtil.getInstance().setSp(28),
  1411. color: likeWord=='phone'?Color.fromRGBO(74, 74, 74, 1):Color.fromRGBO(155, 155, 155, 1)
  1412. ), )
  1413. ),
  1414. SizedBox(
  1415. width: ScreenUtil.getInstance().setWidth(185),
  1416. child: Text(obj.companyCode,
  1417. textAlign: TextAlign.left,
  1418. style: TextStyle(
  1419. fontSize: ScreenUtil.getInstance().setSp(28),
  1420. color: likeWord=='code'?Color.fromRGBO(74, 74, 74, 1):Color.fromRGBO(155, 155, 155, 1)
  1421. ), ),
  1422. ),
  1423. Text(obj.companyName,
  1424. textAlign: TextAlign.left,
  1425. overflow: TextOverflow.ellipsis,
  1426. style: TextStyle(
  1427. fontSize: ScreenUtil.getInstance().setSp(28),
  1428. color: likeWord=='name'?Color.fromRGBO(74, 74, 74, 1):Color.fromRGBO(155, 155, 155, 1)
  1429. ),
  1430. )
  1431. ],
  1432. ),
  1433. ),
  1434. ),
  1435. onTap: () {
  1436. checkedCompanyInfo = true;
  1437. if (sendPhoneOrGetPhoneTab) {
  1438. sendCompanyPhone = obj.uzerPhone!=null?obj.uzerPhone:obj.companyPhone;
  1439. sendCompanyCode = obj.companyCode;
  1440. sendCompanyName = obj.companyName;
  1441. sendCompanyId = obj.id.toString();
  1442. sendCompanyPhoneController.text = obj.uzerPhone!=null?obj.uzerPhone:obj.companyPhone;
  1443. sendCompanyCodeController.text = obj.companyCode;
  1444. sendCompanyNameController.text = obj.companyName;
  1445. sendPCA = obj.provinceName + ' ' + obj.cityName + ' ' + ' ' + obj.areaName;
  1446. sendCompanyProvinceName = obj.provinceName;
  1447. sendCompanyProvinceCode = obj.provinceCode;
  1448. sendCompanyCityName = obj.cityName;
  1449. sendCompanyCityCode = obj.cityCode;
  1450. sendCompanyAreaName = obj.areaName;
  1451. sendCompanyAreaCode = obj.areaCode;
  1452. sendCompanyAddressController.text = obj.address;
  1453. bankCardController.text = obj.bankCard;
  1454. bankNameController.text = obj.bankName;
  1455. openBankNameController.text = obj.openBankName;
  1456. openBankPhoneController.text = obj.openBankPhone;
  1457. } else {
  1458. receiptCompanyPhone = obj.uzerPhone!=null?obj.uzerPhone:obj.companyPhone;
  1459. receiptCompanyName = obj.companyName;
  1460. receiptCompanyPhoneController.text = obj.uzerPhone!=null?obj.uzerPhone:obj.companyPhone;
  1461. receiptCompanyNameController.text = obj.companyName;
  1462. receiptCompanyId = obj.id.toString();
  1463. getLineOfCompanyId(receiptCompanyId).then((resp){
  1464. if(isNotError(context, resp) && this.mounted){
  1465. CompanyOfLine obj = CompanyOfLine.fromJson(resp.data);
  1466. setState(() {
  1467. lineList = obj.data;
  1468. });
  1469. }
  1470. });
  1471. getPCA = obj.provinceName + ' ' + obj.cityName + ' ' + ' ' + obj.areaName;
  1472. receiptCompanyProvinceName = obj.provinceName;
  1473. receiptCompanyProvinceCode = obj.provinceCode;
  1474. receiptCompanyCityName = obj.cityName;
  1475. receiptCompanyCityCode = obj.cityCode;
  1476. receiptCompanyAreaName = obj.areaName;
  1477. receiptCompanyAreaCode = obj.areaCode;
  1478. receiptCompanyAddressController.text = obj.address;
  1479. }
  1480. setState(() {
  1481. FocusScope.of(context).requestFocus(FocusNode());
  1482. tipStatus = true;
  1483. });
  1484. },
  1485. ),
  1486. _underLine()
  1487. ],
  1488. ),
  1489. );
  1490. }
  1491. Widget _goodsTipItem(GoodsPriceList obj){
  1492. return Container(
  1493. child: Column(
  1494. children: < Widget > [
  1495. InkWell(
  1496. child: Container(
  1497. height: ScreenUtil.getInstance().setHeight(89),
  1498. child: Center(
  1499. child: Row(
  1500. mainAxisAlignment: MainAxisAlignment.start,
  1501. children: < Widget > [
  1502. SizedBox(
  1503. width: ScreenUtil.getInstance().setWidth(250),
  1504. child: Text(obj.goods,
  1505. textAlign: TextAlign.left,
  1506. overflow: TextOverflow.ellipsis,
  1507. style: TextStyle(
  1508. fontSize: ScreenUtil.getInstance().setSp(28),
  1509. color: Color.fromRGBO(74, 74, 74, 1)
  1510. ), )
  1511. ),
  1512. SizedBox(
  1513. width: ScreenUtil.getInstance().setWidth(250),
  1514. child: Text(obj.lineName,
  1515. textAlign: TextAlign.left,
  1516. overflow: TextOverflow.ellipsis,
  1517. style: TextStyle(
  1518. fontSize: ScreenUtil.getInstance().setSp(28),
  1519. color: Color.fromRGBO(155, 155, 155, 1)
  1520. ), ),
  1521. ),
  1522. Text((obj.price/100).toString(),
  1523. textAlign: TextAlign.left,
  1524. overflow: TextOverflow.ellipsis,
  1525. style: TextStyle(
  1526. fontSize: ScreenUtil.getInstance().setSp(28),
  1527. color: Color.fromRGBO(155, 155, 155, 1)
  1528. ),
  1529. )
  1530. ],
  1531. ),
  1532. ),
  1533. ),
  1534. onTap: () {
  1535. checkedGoodsName = true;
  1536. setState(() {
  1537. FocusScope.of(context).requestFocus(FocusNode());
  1538. goodsTipStatus = true;
  1539. goods = obj.goods;
  1540. goodsController.text = obj.goods;
  1541. goodsFreight = (obj.price/100);
  1542. goodsFreightController.text = (obj.price/100).toString();
  1543. });
  1544. },
  1545. ),
  1546. _underLine()
  1547. ],
  1548. ),
  1549. );
  1550. }
  1551. Widget _packageType(String key) {
  1552. return Padding(
  1553. padding: EdgeInsets.only(left: ScreenUtil.getInstance().setWidth(30)),
  1554. child: Column(
  1555. children: < Widget > [
  1556. InkWell(
  1557. child: SizedBox(
  1558. height: ScreenUtil.getInstance().setHeight(89),
  1559. child: Center(
  1560. child: Row(
  1561. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  1562. children: < Widget > [
  1563. Expanded(
  1564. flex: 0,
  1565. child: Text(key, style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(74, 74, 74, 1)), ),
  1566. ),
  1567. Expanded(
  1568. child: Row(
  1569. mainAxisAlignment: MainAxisAlignment.end,
  1570. children: < Widget > [
  1571. //Text('${value}', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(136, 136, 136, 1)), ),
  1572. SizedBox(
  1573. width: ScreenUtil.getInstance().setWidth(500),
  1574. child: Text(key == '包装类型' ? showTextGoodsPackage : key == '货物类型' ? showTextGoodsCategory : showTextPaymentMehod, textAlign: TextAlign.end, )
  1575. ),
  1576. Icon(Icons.keyboard_arrow_right, color: Color.fromRGBO(199, 199, 204, 1), )
  1577. ],
  1578. )
  1579. )
  1580. ],
  1581. ),
  1582. )
  1583. ),
  1584. onTap: () {
  1585. showPickerModal(context, key);
  1586. },
  1587. ),
  1588. Expanded(
  1589. flex: 0,
  1590. child: _underLine()
  1591. )
  1592. ],
  1593. )
  1594. );
  1595. }
  1596. showPickerModal(BuildContext context, String type) {
  1597. List < dynamic > data = [];
  1598. if (type == '包装类型') {
  1599. for (int i = 0; i < goodsPackageList.length; i++) {
  1600. data.add(goodsPackageList[i].name);
  1601. }
  1602. } else if (type == '货物类型') {
  1603. for (int i = 0; i < goodsCateGoryList.length; i++) {
  1604. data.add(goodsCateGoryList[i].name);
  1605. }
  1606. } else if (type == '付款方式') {
  1607. data = ['现付', '到付'];
  1608. }
  1609. new Picker(
  1610. adapter: PickerDataAdapter < String > (pickerdata: data),
  1611. height: ScreenUtil.getInstance().setHeight(450),
  1612. confirmText: '确定',
  1613. confirmTextStyle: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(64, 98, 254, 1)),
  1614. cancelText: '取消',
  1615. cancelTextStyle: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(153, 153, 153, 1)),
  1616. headercolor: Color.fromRGBO(245, 245, 245, 1),
  1617. itemExtent: ScreenUtil.getInstance().setHeight(80),
  1618. textStyle: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(42, 42, 42, 1)),
  1619. changeToFirst: true,
  1620. hideHeader: false,
  1621. onConfirm: (Picker picker, List value) {
  1622. if (type == '包装类型') {
  1623. setState(() {
  1624. showTextGoodsPackage = goodsPackageList[value[0]].name;
  1625. goodsPackingId = goodsPackageList[value[0]].id;
  1626. });
  1627. } else if (type == '货物类型') {
  1628. setState(() {
  1629. showTextGoodsCategory = goodsCateGoryList[value[0]].name;
  1630. goodsCategoryId = goodsCateGoryList[value[0]].id;
  1631. });
  1632. } else if (type == '付款方式') {
  1633. setState(() {
  1634. showTextPaymentMehod = data[value[0]];
  1635. });
  1636. if (showTextPaymentMehod == '现付') {
  1637. goodsPaymentMethod = 1;
  1638. } else {
  1639. goodsPaymentMethod = 2;
  1640. }
  1641. }
  1642. }
  1643. ).showModal(this.context); //_scaffoldKey.currentState);
  1644. }
  1645. }