send_express_page.dart 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767
  1. import 'package:flutter/material.dart';
  2. import 'package:flutter_screenutil/flutter_screenutil.dart';
  3. import 'package:city_pickers/city_pickers.dart';
  4. import 'package:flutter_picker/flutter_picker.dart';
  5. import 'dart:async';
  6. import '../util/util.dart';
  7. import '../util/api.dart';
  8. import '../util/models.dart';
  9. class SendExpressPage extends StatefulWidget {
  10. final Widget child;
  11. SendExpressPage({
  12. Key key,
  13. this.child
  14. }): super(key: key);
  15. _SendExpressPageState createState() => _SendExpressPageState();
  16. }
  17. class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeepAliveClientMixin {
  18. ScrollController _scrollController = ScrollController();
  19. //组件自用字段-----------------------------
  20. GlobalKey _sendPhoneKey = GlobalKey();
  21. GlobalKey _getPhoneKey = GlobalKey();
  22. double tipWidth = 0;
  23. double tipHeight = 0;
  24. double tipPosX = 0;
  25. double tipPosY = 0;
  26. bool tipStatus = true;
  27. List < LikePhoneList > likePhoneList = [];
  28. var timer;
  29. //请求字段-------------------------
  30. int sendCompanyId; //寄件公司Id
  31. String sendCompanyName; //寄件公司名称 不能为空
  32. String sendCompanyPhone; //寄件公司电话 不能为空
  33. String sendCompanyCode; //寄件公司编码 不能为空
  34. String sendCompanyProvinceName; //寄件公司省名称 不能为空
  35. String sendCompanyProvinceCode; //寄件公司省编码 不能为空
  36. String sendCompanyCityName; //寄件公司市名称 不能为空
  37. String sendCompanyCityCode; //寄件公司市编码 不能为空
  38. String sendCompanyAreaName; //寄件公司区名称 不能为空
  39. String sendCompanyAreaCode; //寄件公司区编码 不能为空
  40. String sendCompanyAddress; //寄件公司详细地址,不能为空
  41. int receiptCompanyId; //收件公司id
  42. String receiptCompanyPhone; //收件公司电话 不能为空
  43. String receiptCompanyName; //收件公司名称 不能为空
  44. String receiptCompanyProvinceName; //收件公司省名称 不能为空
  45. String receiptCompanyProvinceCode; //收件公司省编码 不能为空
  46. String receiptCompanyCityName; //收件公司市名称 不能为空
  47. String receiptCompanyCityCode; //收件公市编码 不能为空
  48. String receiptCompanyAreaName; //收件公区名称 不能为空
  49. String receiptCompanyAreaCode; //收件公司区编码 不能为空
  50. String receiptCompanyAddress; //收件公司地址详情 不能为空
  51. String goods; //商品名称 不能为空
  52. int goodsQuantity; //商品数量 不能为空
  53. int goodsPackingId; //商品包装ID
  54. int goodsCategoryId; //商品类别ID
  55. int goodsPaymentMethod; //付款方式
  56. double goodsWeight; //商品重量
  57. double goodsPriceProtection; //商品保价
  58. double goodsAgencyFund; //商品代收款
  59. double goodsFreight; //商品运费 不能为空
  60. String memo; //备注
  61. String sendPCA = ' '; //Text组件内容必须有空格,否则报null
  62. String getPCA = ' ';
  63. @override
  64. void initState() {
  65. super.initState();
  66. _scrollController.addListener(() {
  67. if (!tipStatus) {
  68. setState(() {
  69. tipStatus = true;
  70. });
  71. }
  72. if (_scrollController.position.pixels == _scrollController.position.maxScrollExtent) {}
  73. });
  74. }
  75. @override
  76. bool get wantKeepAlive => true;
  77. @override
  78. Widget build(BuildContext context) {
  79. return Container(
  80. child: Scaffold(
  81. appBar: AppBar(
  82. title: Text('发件', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(36)), ),
  83. centerTitle: true,
  84. backgroundColor: Color.fromRGBO(64, 98, 254, 1),
  85. ),
  86. body:
  87. Stack(
  88. children: < Widget > [
  89. Container(
  90. color: Color.fromRGBO(246, 246, 254, 1),
  91. padding: EdgeInsets.fromLTRB(0, ScreenUtil.getInstance().setHeight(20), 0, ScreenUtil.getInstance().setHeight(20)),
  92. child: ListView(
  93. controller: _scrollController,
  94. children: < Widget > [
  95. _sendInfo(context),
  96. _getInfo(context),
  97. _itemInfoWidget(),
  98. _submitBtn()
  99. ],
  100. ),
  101. ),
  102. Positioned(
  103. top: tipPosY,
  104. left: tipPosX,
  105. child: Offstage(
  106. offstage: tipStatus,
  107. child: Container(
  108. width: tipWidth,
  109. height: ScreenUtil.getInstance().setHeight(450),
  110. padding: EdgeInsets.only(left: ScreenUtil.getInstance().setWidth(30)),
  111. decoration: BoxDecoration(
  112. color: Color.fromRGBO(244, 248, 251, 1),
  113. ),
  114. child: ListView.builder(
  115. itemCount: likePhoneList.length,
  116. itemBuilder: (BuildContext context, int index) {
  117. return _tipItem(likePhoneList[index]);
  118. },
  119. )
  120. ),
  121. )
  122. )
  123. ],
  124. ),
  125. resizeToAvoidBottomPadding: false //键盘弹出,页面不跟随向上滑动,防止出现溢出错误
  126. ),
  127. );
  128. }
  129. Widget _sendInfo(BuildContext context) {
  130. return Container(
  131. color: Colors.white,
  132. margin: EdgeInsets.only(bottom: ScreenUtil.getInstance().setHeight(20)),
  133. child: Column(
  134. children: < Widget > [
  135. _titleWidget('lib/images/icon_send.png', '发件信息'),
  136. _underLine(),
  137. _inputWiget('电话', 'sendPhone'),
  138. _contentWiget('企业编码', 'send', true),
  139. _contentWiget('企业名称', 'send', true),
  140. _cityWiget('城市/区域', context, 'send'),
  141. _lastContentWiget('详细地址', 'send')
  142. ],
  143. )
  144. );
  145. }
  146. Widget _getInfo(BuildContext context) {
  147. return Container(
  148. color: Colors.white,
  149. margin: EdgeInsets.only(bottom: ScreenUtil.getInstance().setHeight(20)),
  150. child: Column(
  151. children: < Widget > [
  152. _titleWidget('lib/images/icon_shoujian.png', '收件信息'),
  153. _underLine(),
  154. _inputWiget('电话', 'getPhone'),
  155. //_contentWiget('企业编码', 'get', true),
  156. _contentWiget('企业名称', 'get', true),
  157. _cityWiget('城市/区域', context, 'get'),
  158. _lastContentWiget('详细地址', 'get')
  159. ],
  160. )
  161. );
  162. }
  163. Widget _itemInfoWidget() {
  164. return Container(
  165. child: Container(
  166. color: Colors.white,
  167. child: Column(
  168. crossAxisAlignment: CrossAxisAlignment.start,
  169. children: < Widget > [
  170. _titleWidget('lib/images/icon_huowu.png', "货物信息"),
  171. _underLine(),
  172. _contentWiget("货物名称", 'goods', true),
  173. _contentWiget("数量", 'goods'),
  174. _contentWiget("运费", 'goods'),
  175. _contentWiget("代收", 'goods'),
  176. _contentWiget("保价", 'goods'),
  177. _contentWiget("重量", 'goods'),
  178. _packageType('包装类型'),
  179. _packageType('商品类型'),
  180. _descWidget()
  181. ],
  182. ),
  183. )
  184. );
  185. }
  186. Widget _titleWidget(String iconUrl, String str) {
  187. return Container(
  188. height: ScreenUtil.getInstance().setHeight(90),
  189. padding: EdgeInsets.only(left: ScreenUtil.getInstance().setWidth(30)),
  190. child: Center(
  191. child: Row(
  192. mainAxisAlignment: MainAxisAlignment.start,
  193. children: < Widget > [
  194. Padding(
  195. padding: EdgeInsets.only(right: ScreenUtil.getInstance().setHeight(20)),
  196. child: Image.asset(
  197. iconUrl,
  198. width: ScreenUtil.getInstance().setWidth(40),
  199. height: ScreenUtil.getInstance().setHeight(40),
  200. )
  201. ),
  202. Text(str, style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(32)), )
  203. ],
  204. ),
  205. ),
  206. );
  207. }
  208. Widget _underLine() {
  209. return Container(
  210. color: Color.fromRGBO(223, 223, 223, 1),
  211. height: ScreenUtil.getInstance().setHeight(1),
  212. );
  213. }
  214. Widget _inputWiget(String key, String tab) {
  215. return Padding(
  216. key: tab == 'sendPhone' ? _sendPhoneKey : _getPhoneKey,
  217. padding: EdgeInsets.only(left: ScreenUtil.getInstance().setWidth(30)),
  218. child: Column(
  219. children: < Widget > [
  220. SizedBox(
  221. height: ScreenUtil.getInstance().setHeight(89),
  222. child: Center(
  223. child: Row(
  224. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  225. children: < Widget > [
  226. Expanded(
  227. flex: 0,
  228. child: Text(key, style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(74, 74, 74, 1)), ),
  229. ),
  230. Expanded(
  231. child: Row(
  232. mainAxisAlignment: MainAxisAlignment.end,
  233. children: < Widget > [
  234. //Text('${value}', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(136, 136, 136, 1)), ),
  235. SizedBox(
  236. width: ScreenUtil.getInstance().setWidth(500),
  237. child: TextField(
  238. keyboardType: TextInputType.number,
  239. textAlign: TextAlign.end,
  240. decoration: InputDecoration(
  241. border: InputBorder.none
  242. ),
  243. onChanged: ((value) {
  244. if (tab == 'sendPhone') {
  245. setState(() {
  246. sendCompanyPhone = value;
  247. });
  248. timer.cancel();
  249. if (value.length < 6) {
  250. setState(() {
  251. tipStatus = true;
  252. });
  253. }
  254. timer = Timer(Duration(milliseconds: 500), () {
  255. if (value.length >= 6) {
  256. likePhone(value).then((resp) {
  257. if (isNotError(context, resp)) {
  258. LikePhone likePhoneObj = LikePhone.fromJson(resp.data);
  259. likePhoneList = likePhoneObj.data;
  260. }
  261. if (likePhoneList.length > 0) {
  262. RenderObject sendPhoneObj = _sendPhoneKey.currentContext.findRenderObject();
  263. setState(() {
  264. tipWidth = sendPhoneObj.paintBounds.size.width;
  265. tipHeight = sendPhoneObj.paintBounds.size.height;
  266. tipPosX = sendPhoneObj.getTransformTo(null).getTranslation().x;
  267. tipPosY = sendPhoneObj.getTransformTo(null).getTranslation().y - ScreenUtil.getInstance().setHeight(90);
  268. tipStatus = false;
  269. });
  270. }else{
  271. setState(() {
  272. tipStatus =true;
  273. });
  274. }
  275. });
  276. }
  277. });
  278. // print(tipWidth);
  279. // print(tipHeight);
  280. // print(tipPosX);
  281. // print(tipPosY);
  282. } else if (tab == 'getPhone') {
  283. setState(() {
  284. receiptCompanyPhone = value;
  285. });
  286. timer.cancel();
  287. if (value.length < 6) {
  288. setState(() {
  289. tipStatus = true;
  290. });
  291. }
  292. timer = Timer(Duration(milliseconds: 500), () {
  293. if (value.length >= 6) {
  294. likePhone(value).then((resp) {
  295. if (isNotError(context, resp)) {
  296. LikePhone likePhoneObj = LikePhone.fromJson(resp.data);
  297. likePhoneList = likePhoneObj.data;
  298. }
  299. if (likePhoneList.length > 0) {
  300. RenderObject getPhoneKey = _getPhoneKey.currentContext.findRenderObject();
  301. setState(() {
  302. tipWidth = getPhoneKey.paintBounds.size.width;
  303. tipHeight = getPhoneKey.paintBounds.size.height;
  304. tipPosX = getPhoneKey.getTransformTo(null).getTranslation().x;
  305. tipPosY = getPhoneKey.getTransformTo(null).getTranslation().y - ScreenUtil.getInstance().setHeight(90);
  306. tipStatus = false;
  307. });
  308. }else{
  309. setState(() {
  310. tipStatus =true;
  311. });
  312. }
  313. });
  314. }
  315. });
  316. // print(tipWidth);
  317. // print(tipHeight);
  318. // print(tipPosX);
  319. // print(tipPosY);
  320. }
  321. }),
  322. onEditingComplete: () {
  323. setState(() {
  324. FocusScope.of(context).requestFocus(FocusNode());
  325. tipStatus = true;
  326. });
  327. },
  328. ),
  329. ),
  330. Icon(Icons.keyboard_arrow_right, color: Color.fromRGBO(199, 199, 204, 1), )
  331. ],
  332. )
  333. )
  334. ],
  335. ),
  336. )
  337. ),
  338. Expanded(
  339. flex: 0,
  340. child: _underLine()
  341. )
  342. ],
  343. )
  344. );
  345. }
  346. Widget _contentWiget(String key, String type, [bool keyboardType = false]) { //false是数字键盘
  347. return Padding(
  348. padding: EdgeInsets.only(left: ScreenUtil.getInstance().setWidth(30)),
  349. child: Column(
  350. children: < Widget > [
  351. SizedBox(
  352. height: ScreenUtil.getInstance().setHeight(89),
  353. child: Center(
  354. child: Row(
  355. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  356. children: < Widget > [
  357. Expanded(
  358. flex: 0,
  359. child: Text(key, style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(74, 74, 74, 1)), ),
  360. ),
  361. Expanded(
  362. child: Row(
  363. mainAxisAlignment: MainAxisAlignment.end,
  364. children: < Widget > [
  365. SizedBox(
  366. width: ScreenUtil.getInstance().setWidth(500),
  367. child: TextField(
  368. keyboardType: keyboardType ? TextInputType.text : TextInputType.number,
  369. textAlign: TextAlign.end,
  370. decoration: InputDecoration(
  371. border: InputBorder.none
  372. ),
  373. onChanged: (value) {
  374. if (type == 'send') {
  375. if (key == '企业编码') {
  376. setState(() {
  377. sendCompanyCode = value;
  378. });
  379. } else if (key == '企业名称') {
  380. setState(() {
  381. sendCompanyName = value;
  382. });
  383. }
  384. } else if (type == 'get') {
  385. if (key == '企业编码') {
  386. setState(() {
  387. sendCompanyCode = value;
  388. });
  389. } else if (key == '企业名称') {
  390. setState(() {
  391. receiptCompanyName = value;
  392. });
  393. }
  394. } else {
  395. if (key == '货物名称') {
  396. goods = value;
  397. } else if (key == '数量') {
  398. goodsQuantity = int.parse(value);
  399. } else if (key == '运费') {
  400. goodsFreight = double.parse(value);
  401. } else if (key == '代收') {
  402. goodsAgencyFund = double.parse(value);
  403. } else if (key == '保价') {
  404. goodsPriceProtection = double.parse(value);
  405. } else if (key == '重量') {
  406. goodsWeight = double.parse(value);
  407. }
  408. }
  409. },
  410. ),
  411. ),
  412. Icon(Icons.keyboard_arrow_right, color: Color.fromRGBO(199, 199, 204, 1), )
  413. ],
  414. )
  415. )
  416. ],
  417. ),
  418. )
  419. ),
  420. Expanded(
  421. flex: 0,
  422. child: _underLine()
  423. )
  424. ],
  425. )
  426. );
  427. }
  428. Widget _cityWiget(String key, BuildContext context, String type) {
  429. return
  430. GestureDetector(
  431. child: Padding(
  432. padding: EdgeInsets.only(left: ScreenUtil.getInstance().setWidth(30)),
  433. child: Column(
  434. children: < Widget > [
  435. SizedBox(
  436. height: ScreenUtil.getInstance().setHeight(89),
  437. child: Center(
  438. child: Row(
  439. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  440. children: < Widget > [
  441. Expanded(
  442. flex: 0,
  443. child: Text(key, style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(74, 74, 74, 1)), ),
  444. ),
  445. Expanded(
  446. child: Row(
  447. mainAxisAlignment: MainAxisAlignment.end,
  448. children: < Widget > [
  449. //Text('${value}', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(136, 136, 136, 1)), ),
  450. SizedBox(
  451. width: ScreenUtil.getInstance().setWidth(500),
  452. child: Text(type == 'send' ? sendPCA : getPCA, textAlign: TextAlign.end, overflow: TextOverflow.ellipsis, )
  453. ),
  454. Icon(Icons.keyboard_arrow_right, color: Color.fromRGBO(199, 199, 204, 1), )
  455. ],
  456. )
  457. )
  458. ],
  459. ),
  460. )
  461. ),
  462. Expanded(
  463. flex: 0,
  464. child: _underLine()
  465. )
  466. ],
  467. )
  468. ),
  469. onTap: () {
  470. getCity(context).then((resp) {
  471. if (resp == null) {
  472. return;
  473. }
  474. print(resp.toString());
  475. setState(() {
  476. if (type == 'send') {
  477. sendPCA = resp.provinceName + ' ' + resp.cityName + ' ' + ' ' + resp.areaName;
  478. sendCompanyProvinceName = resp.provinceName;
  479. sendCompanyProvinceCode = resp.provinceId;
  480. sendCompanyCityName = resp.cityName;
  481. sendCompanyCityCode = resp.cityId;
  482. sendCompanyAreaName = resp.areaName;
  483. sendCompanyAreaCode = resp.areaId;
  484. } else {
  485. getPCA = resp.provinceName + ' ' + resp.cityName + ' ' + ' ' + resp.areaName;
  486. receiptCompanyProvinceName = resp.provinceName;
  487. receiptCompanyProvinceCode = resp.provinceId;
  488. receiptCompanyCityName = resp.cityName;
  489. receiptCompanyCityCode = resp.cityId;
  490. receiptCompanyAreaName = resp.areaName;
  491. receiptCompanyAreaCode = resp.areaId;
  492. }
  493. });
  494. //print(value);
  495. });
  496. },
  497. );
  498. }
  499. Widget _lastContentWiget(String key, String type) {
  500. return Padding(
  501. padding: EdgeInsets.only(left: ScreenUtil.getInstance().setWidth(30)),
  502. child: SizedBox(
  503. height: ScreenUtil.getInstance().setHeight(89),
  504. child: Center(
  505. child: Row(
  506. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  507. children: < Widget > [
  508. Expanded(
  509. flex: 0,
  510. child: Text(key, style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(74, 74, 74, 1)), ),
  511. ),
  512. Expanded(
  513. child: Row(
  514. mainAxisAlignment: MainAxisAlignment.end,
  515. children: < Widget > [
  516. //Text('${value}', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(136, 136, 136, 1)), ),
  517. SizedBox(
  518. width: ScreenUtil.getInstance().setWidth(500),
  519. child: TextField(
  520. //keyboardType: TextInputType.number,
  521. textAlign: TextAlign.end,
  522. decoration: InputDecoration(
  523. border: InputBorder.none
  524. ),
  525. onChanged: (value) {
  526. if (type == 'send') {
  527. setState(() {
  528. sendCompanyAddress = value;
  529. });
  530. } else {
  531. setState(() {
  532. receiptCompanyAddress = value;
  533. });
  534. }
  535. },
  536. ),
  537. ),
  538. Icon(Icons.keyboard_arrow_right, color: Color.fromRGBO(199, 199, 204, 1), )
  539. ],
  540. )
  541. )
  542. ],
  543. ),
  544. )
  545. )
  546. );
  547. }
  548. Widget _descWidget() {
  549. return
  550. Container(
  551. padding: EdgeInsets.all(ScreenUtil.getInstance().setWidth(30)),
  552. //child: Text(str, maxLines: 100, style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(74, 74, 74, 1)), ),
  553. child: TextField(
  554. maxLines: 3,
  555. decoration: InputDecoration(
  556. border: InputBorder.none,
  557. hintText: "请输入备注内容"
  558. ),
  559. onChanged: (value) {
  560. setState(() {
  561. memo = value;
  562. });
  563. },
  564. ),
  565. );
  566. }
  567. Widget _submitBtn() {
  568. return GestureDetector(
  569. child: Container(
  570. margin: EdgeInsets.fromLTRB(ScreenUtil.getInstance().setWidth(30), ScreenUtil.getInstance().setWidth(50), ScreenUtil.getInstance().setWidth(30), ScreenUtil.getInstance().setWidth(40)),
  571. height: ScreenUtil.getInstance().setHeight(88),
  572. decoration: BoxDecoration(
  573. borderRadius: BorderRadius.all(Radius.circular(4)),
  574. color: Color.fromRGBO(37, 102, 242, 1),
  575. ),
  576. child: Center(
  577. child: Text("提交", style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(32), color: Colors.white), ),
  578. ),
  579. ),
  580. onTap: () {
  581. print('sendCompanyId---${sendCompanyId}');
  582. print('sendCompanyName---${sendCompanyName}');
  583. print('sendCompanyPhone---${sendCompanyPhone}');
  584. print('sendCompanyCode---${sendCompanyCode}');
  585. print('sendCompanyProvinceName---${sendCompanyProvinceName}');
  586. print('sendCompanyProvinceCode---${sendCompanyProvinceCode}');
  587. print('sendCompanyCityName---${sendCompanyCityName}');
  588. print('sendCompanyCityCode---${sendCompanyCityCode}');
  589. print('sendCompanyAreaName---${sendCompanyAreaName}');
  590. print('sendCompanyAreaCode---${sendCompanyAreaCode}');
  591. print('sendCompanyAddress---${sendCompanyAddress}');
  592. print('receiptCompanyId---${receiptCompanyId}');
  593. print('receiptCompanyPhone---${receiptCompanyPhone}');
  594. print('receiptCompanyName---${receiptCompanyName}');
  595. print('receiptCompanyProvinceName---${receiptCompanyProvinceName}');
  596. print('receiptCompanyProvinceCode---${receiptCompanyProvinceCode}');
  597. print('receiptCompanyCityName---${receiptCompanyCityName}');
  598. print('receiptCompanyCityCode---${receiptCompanyCityCode}');
  599. print('receiptCompanyAreaName---${receiptCompanyAreaName}');
  600. print('receiptCompanyAreaCode---${receiptCompanyAreaCode}');
  601. print('receiptCompanyAddress---${receiptCompanyAddress}');
  602. print('goods---${goods}');
  603. print('goodsQuantity---${goodsQuantity}');
  604. print('goodsPackingId---${goodsPackingId}');
  605. print('goodsCategoryId---${goodsCategoryId}');
  606. print('goodsPaymentMethod---${goodsPaymentMethod}');
  607. print('goodsWeight---${goodsWeight}');
  608. print('goodsPriceProtection---${goodsPriceProtection}');
  609. print('goodsAgencyFund---${goodsAgencyFund}');
  610. print('goodsFreight---${goodsFreight}');
  611. print('memo---${memo}');
  612. },
  613. );
  614. }
  615. Future getCity(context) async {
  616. Result result = await CityPickers.showCityPicker(
  617. context: context,
  618. );
  619. return result;
  620. }
  621. Widget _tipItem(LikePhoneList obj) {
  622. return Container(
  623. child: Column(
  624. children: < Widget > [
  625. Container(
  626. height: ScreenUtil.getInstance().setHeight(89),
  627. child: Center(
  628. child: Row(
  629. mainAxisAlignment: MainAxisAlignment.start,
  630. children: < Widget > [
  631. Padding(
  632. padding: EdgeInsets.only(right: ScreenUtil.getInstance().setWidth(50)),
  633. child: Text(obj.uzerPhone, style: TextStyle(
  634. fontSize: ScreenUtil.getInstance().setSp(28),
  635. color: Color.fromRGBO(74, 74, 74, 1)
  636. ), )
  637. ),
  638. SizedBox(
  639. width: ScreenUtil.getInstance().setWidth(185),
  640. child: Text(obj.areaCode,
  641. textAlign: TextAlign.left,
  642. style: TextStyle(
  643. fontSize: ScreenUtil.getInstance().setSp(28),
  644. color: Color.fromRGBO(155, 155, 155, 1)
  645. ), ),
  646. ),
  647. Text(obj.companyName,
  648. textAlign: TextAlign.left,
  649. overflow: TextOverflow.ellipsis,
  650. style: TextStyle(
  651. fontSize: ScreenUtil.getInstance().setSp(28),
  652. color: Color.fromRGBO(155, 155, 155, 1)
  653. ),
  654. )
  655. ],
  656. ),
  657. ),
  658. ),
  659. _underLine()
  660. ],
  661. ),
  662. );
  663. }
  664. Widget _packageType(String key) {
  665. return Padding(
  666. padding: EdgeInsets.only(left: ScreenUtil.getInstance().setWidth(30)),
  667. child: Column(
  668. children: < Widget > [
  669. InkWell(
  670. child: SizedBox(
  671. height: ScreenUtil.getInstance().setHeight(89),
  672. child: Center(
  673. child: Row(
  674. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  675. children: < Widget > [
  676. Expanded(
  677. flex: 0,
  678. child: Text(key, style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(74, 74, 74, 1)), ),
  679. ),
  680. Expanded(
  681. child: Row(
  682. mainAxisAlignment: MainAxisAlignment.end,
  683. children: < Widget > [
  684. //Text('${value}', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(136, 136, 136, 1)), ),
  685. SizedBox(
  686. width: ScreenUtil.getInstance().setWidth(500),
  687. child: Text('纸箱', textAlign: TextAlign.end, )
  688. ),
  689. Icon(Icons.keyboard_arrow_right, color: Color.fromRGBO(199, 199, 204, 1), )
  690. ],
  691. )
  692. )
  693. ],
  694. ),
  695. )
  696. ),
  697. onTap: () {
  698. showPickerModal(context, key);
  699. },
  700. ),
  701. Expanded(
  702. flex: 0,
  703. child: _underLine()
  704. )
  705. ],
  706. )
  707. );
  708. }
  709. showPickerModal(BuildContext context, String type) {
  710. new Picker(
  711. adapter: PickerDataAdapter < String > (pickerdata: ['纸箱', '木箱']),
  712. height: ScreenUtil.getInstance().setHeight(450),
  713. confirmText: '确定',
  714. confirmTextStyle: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(64, 98, 254, 1)),
  715. cancelText: '取消',
  716. cancelTextStyle: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(153, 153, 153, 1)),
  717. headercolor: Color.fromRGBO(245, 245, 245, 1),
  718. itemExtent: ScreenUtil.getInstance().setHeight(80),
  719. textStyle: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(42, 42, 42, 1)),
  720. changeToFirst: true,
  721. hideHeader: false,
  722. onConfirm: (Picker picker, List value) {
  723. // setState(() {
  724. // _siteName = stationObj.data[value[0]].name;
  725. // });
  726. // setKey('stationId', stationObj.data[value[0]].id.toString());
  727. }
  728. ).showModal(this.context); //_scaffoldKey.currentState);
  729. }
  730. }