YSHelpPlane.dart 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642
  1. import 'package:flutter/material.dart';
  2. import 'package:flutter/cupertino.dart';
  3. import 'package:flutter/services.dart';
  4. import 'package:url_launcher/url_launcher.dart';
  5. import 'package:ysairplane2/base/YSBase.dart';
  6. import 'package:ysairplane2/tools/YSNetWorking.dart';
  7. import 'package:ysairplane2/tools/YSTools.dart';
  8. import 'YSChooseLocation.dart';
  9. import 'YSChoosePlane.dart';
  10. import 'YSPay.dart';
  11. class YSHelpPlane extends StatefulWidget {
  12. @override
  13. _YSHelpPlaneState createState() => _YSHelpPlaneState();
  14. }
  15. class _YSHelpPlaneState extends State<YSHelpPlane> {
  16. bool _isDetail = false;
  17. bool _isOrder = false;
  18. Map _msgDict,_typeDict,_startDict,_endDict;
  19. String _numStr,_priceStr;
  20. TextEditingController _phone = TextEditingController();
  21. TextEditingController _des = TextEditingController();
  22. MethodChannel channel;
  23. Map _planeType;
  24. String _noticeStr = '';
  25. @override
  26. void initState() {
  27. Future.delayed(Duration(seconds: 0)).then((value){
  28. _getHelpPlaneData();
  29. _getNoticeData();
  30. });
  31. super.initState();
  32. }
  33. @override
  34. Widget build(BuildContext context) {
  35. return YSBase(
  36. ystitle: '召唤直升机',
  37. yschild: Container(
  38. height: MediaQuery.of(context).size.height-MediaQuery.of(context).padding.top-44,
  39. width: MediaQuery.of(context).size.width,
  40. color: Color(0xFFF1F2F4),
  41. child: Stack(
  42. children: [
  43. Column(
  44. children: [
  45. Container(
  46. height: MediaQuery.of(context).size.height-MediaQuery.of(context).padding.top-44-hsp(150),
  47. width: MediaQuery.of(context).size.width,
  48. color: Colors.white,
  49. child: Stack(
  50. children: [
  51. Container(
  52. height: MediaQuery.of(context).size.height-MediaQuery.of(context).padding.top-44-hsp(150)-hsp(550),
  53. width: MediaQuery.of(context).size.width,
  54. color: Color(0xFFF1F2F3),
  55. child: platformView(
  56. platforms: (value){
  57. value.setMethodCallHandler((call) {
  58. if(call.method == "address"){
  59. print('===========================${call.arguments}');
  60. Map point = call.arguments;
  61. channel.invokeMethod('setLocation', {'lat': point['lat'],'lng': point['lng'],'title':
  62. point['title'],'content': point['content'],'type': 0});
  63. setState(() {
  64. _startDict = point;
  65. });
  66. }
  67. return;
  68. });
  69. channel = value;
  70. },
  71. )
  72. ),
  73. GestureDetector(
  74. onTap: (){
  75. if(_msgDict==null){
  76. ysFlutterToast(context, '呼叫信息获取失败');
  77. return;
  78. }
  79. showDialog(
  80. context: context,
  81. builder: (context){
  82. return CupertinoAlertDialog(
  83. title: Text('提示\n'),
  84. content: Text('是否拨打${_msgDict['emergencyCall']}'),
  85. actions: [
  86. CupertinoButton(
  87. child: Container(
  88. child: Text('取消',style: TextStyle(fontSize: 16,color: Color(0xFF292929),decoration: TextDecoration.none,fontWeight: FontWeight.normal),),
  89. height: 40,
  90. alignment: Alignment.center,
  91. ),
  92. padding: EdgeInsets.all(0),
  93. onPressed: (){
  94. Navigator.pop(context);
  95. },
  96. ),
  97. CupertinoButton(
  98. child: Container(
  99. child: Text('确定',style: TextStyle(fontSize: 16,color: Color(0xFF292929),decoration: TextDecoration.none,fontWeight: FontWeight.normal),),
  100. height: 40,
  101. alignment: Alignment.center,
  102. ),
  103. padding: EdgeInsets.all(0),
  104. onPressed: (){
  105. Navigator.pop(context);
  106. launch('tel:${_msgDict['emergencyCall']}');
  107. },
  108. )
  109. ],
  110. );
  111. }
  112. );
  113. },
  114. child: Container(
  115. margin: EdgeInsets.only(top: MediaQuery.of(context).size.height-MediaQuery.of(context).padding.top-44-hsp(150)-hsp(700),left: hsp(20)),
  116. width: wsp(250),
  117. height: hsp(70),
  118. alignment: Alignment.center,
  119. decoration: BoxDecoration(
  120. color: Color(0xFFF15204),
  121. borderRadius: BorderRadius.all(Radius.circular(50))
  122. ),
  123. child: Text('SOS 紧急呼叫',style: TextStyle(fontSize: zsp(30),color: Colors.white),),
  124. ),
  125. ),
  126. Container(
  127. margin: EdgeInsets.only(top: MediaQuery.of(context).size.height-MediaQuery.of(context).padding.top-44-hsp(150)-hsp(700),
  128. left: MediaQuery.of(context).size.width-wsp(270)),
  129. width: wsp(250),
  130. height: hsp(70),
  131. child: Row(
  132. children: [
  133. Container(
  134. height: hsp(70),
  135. width: hsp(70),
  136. color: Colors.white,
  137. child: Icon(Icons.flight,size: hsp(50),color: Color(0xFF3262FF),),
  138. alignment: Alignment.center,
  139. ),
  140. Container(
  141. height: hsp(70),
  142. width: hsp(170),
  143. color: Color(0xFFE8EFFD),
  144. child: Text('${_msgDict==null?0:_msgDict['airportNum']}架飞机',style: TextStyle(fontSize: zsp(26),color: Color(0xFF3856A0),fontWeight: FontWeight.bold),),
  145. alignment: Alignment.center,
  146. ),
  147. ],
  148. )
  149. ),
  150. Container(
  151. margin: EdgeInsets.only(top: MediaQuery.of(context).size.height-MediaQuery.of(context).padding.top-44-hsp(150)-hsp(600)-3),
  152. decoration: BoxDecoration(
  153. color: Colors.white,
  154. borderRadius: BorderRadius.only(topLeft: Radius.circular(10),topRight: Radius.circular(10)),
  155. ),
  156. height: hsp(600)+3,
  157. child: Column(
  158. children: [
  159. Container(
  160. child: Text('空中救援',style: TextStyle(fontSize: zsp(32),color: Color(0xFF212121),fontWeight: FontWeight.bold),),
  161. height: hsp(100),
  162. alignment: Alignment.center,
  163. ),
  164. Divider(color: Color(0xFFF1F2F4),height: 0.5,thickness: 0.5,),
  165. Container(
  166. height: hsp(500)+2.5,
  167. child: ListView.separated(
  168. itemBuilder: (context,index){
  169. return GestureDetector(
  170. onTap: (){
  171. if(index==0){
  172. Navigator.of(context).push(
  173. CupertinoPageRoute(
  174. builder: (context){
  175. return YSChooseLocation();
  176. }
  177. )
  178. ).then((value){
  179. if(value==null)return;
  180. setState(() {
  181. _startDict = value;
  182. });
  183. channel.invokeMethod('setLocation', {'lat': value['lat'],'lng': value['lng'],'title':
  184. value['title'],'content': value['content'],'type': index});
  185. });
  186. }else if(index==1||index==2){
  187. FocusScope.of(context).unfocus();
  188. showModalBottomSheet(
  189. context: context,
  190. builder: (context){
  191. return index==1?YSPicker(dataArray: _msgDict['dtRescueTypeList'],title: 'name',choose: (value){
  192. print(value);
  193. setState(() {
  194. _typeDict = value;
  195. });
  196. },):YSPicker(dataArray: [for(int i=0;i<30;i++){'title':'${i+1}','id':i+1}],title: 'title',choose: (value){
  197. print(value);
  198. setState(() {
  199. _numStr = value['title'];
  200. });
  201. },);
  202. }
  203. );
  204. }
  205. },
  206. behavior: HitTestBehavior.opaque,
  207. child: Container(
  208. height: hsp(100),
  209. padding: EdgeInsets.only(left: wsp(30),right: wsp(30)),
  210. child: Row(
  211. children: [
  212. Container(child: Text(index==0?'救援地点':index==1?'救援类型':index==2?
  213. '涉险人数':index==3?'联系方式':'描述',style: TextStyle(fontSize: zsp(30),color: Color(0xFFA7A7A7)),),width: wsp(150),),
  214. Container(
  215. margin: EdgeInsets.only(left: wsp(20)),
  216. width: MediaQuery.of(context).size.width-wsp(230),
  217. child: index==0?Text(
  218. _startDict==null?'请选择救援地点':'${_startDict['title']}',
  219. style: TextStyle(fontSize: zsp(30),color: Color(0xFF000000),fontWeight: FontWeight.bold),
  220. ):index==1||index==2?Row(
  221. children: [
  222. Text(index==1?
  223. (_typeDict==null?'请选择救援类型':_typeDict['name']):(_numStr==null?'请选择险人数式':_numStr),
  224. style: TextStyle(fontSize: zsp(30),color: Color(0xFF999999)),),
  225. Icon(Icons.keyboard_arrow_down,size: hsp(40),color: Color(0xFF999999),)
  226. ],
  227. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  228. ):CupertinoTextField(
  229. placeholder: index==3?'请输入联系方式':'请输入描述(20个字以内)',
  230. placeholderStyle: TextStyle(fontSize: zsp(30),color: Color(0xFF999999)),
  231. style: TextStyle(fontSize: zsp(30),color: Color(0xFF999999)),
  232. decoration: BoxDecoration(),
  233. keyboardType: index==3?TextInputType.phone:TextInputType.text,
  234. maxLength: index==3?11:20,
  235. controller: index==3?_phone:_des,
  236. padding: EdgeInsets.all(0),
  237. ),
  238. ),
  239. ],
  240. ),
  241. ),
  242. );
  243. },
  244. separatorBuilder: (context,index){
  245. return Divider(color: Color(0xFFF1F2F4),height: 0.5,thickness: 0.5,);
  246. },
  247. itemCount: 5,
  248. padding: EdgeInsets.all(0),
  249. ),
  250. )
  251. ],
  252. ),
  253. )
  254. ],
  255. ),
  256. ),
  257. GestureDetector(
  258. onTap: (){
  259. _getPriceData();
  260. },
  261. child: Container(
  262. height: hsp(100),
  263. margin: EdgeInsets.only(top: hsp(25)),
  264. width: MediaQuery.of(context).size.width-hsp(60),
  265. decoration: BoxDecoration(
  266. color: Color(0xFFF15103),
  267. borderRadius: BorderRadius.all(Radius.circular(5))
  268. ),
  269. child: Text('一键召唤直升机',style: TextStyle(fontSize: zsp(36),color: Colors.white,fontWeight: FontWeight.bold),),
  270. alignment: Alignment.center,
  271. ),
  272. ),
  273. ],
  274. ),
  275. if(_isOrder==true)GestureDetector(
  276. onTap: (){
  277. setState(() {
  278. _isOrder = false;
  279. });
  280. },
  281. child: Container(
  282. height: MediaQuery.of(context).size.height,
  283. width: MediaQuery.of(context).size.width,
  284. color: Colors.black54,
  285. child: GestureDetector(
  286. onTap: (){},
  287. child: Column(
  288. children: [
  289. Container(
  290. height: (MediaQuery.of(context).size.height-MediaQuery.of(context).padding.top-44)*0.8-hsp(120),
  291. width: MediaQuery.of(context).size.width,
  292. margin: EdgeInsets.only(top: (MediaQuery.of(context).size.height-MediaQuery.of(context).padding.top-44)*0.2),
  293. decoration: BoxDecoration(
  294. color: Color(0xFFF1F2F3),
  295. borderRadius: BorderRadius.only(topLeft: Radius.circular(10),topRight: Radius.circular(10))
  296. ),
  297. child: Column(
  298. crossAxisAlignment: CrossAxisAlignment.start,
  299. children: [
  300. Container(
  301. height: hsp(100),
  302. decoration: BoxDecoration(
  303. color: Colors.white,
  304. borderRadius: BorderRadius.only(topLeft: Radius.circular(10),topRight: Radius.circular(10))
  305. ),
  306. padding: EdgeInsets.only(left: 15,right: 15),
  307. child: Row(
  308. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  309. children: [
  310. Container(width: wsp(50),),
  311. Text('订单确认',style: TextStyle(fontSize: 15,color: Color(0xFF000000),decoration: TextDecoration.none,fontWeight: FontWeight.bold),),
  312. GestureDetector(
  313. child: Text('关闭',style: TextStyle(fontSize: 15,color: Color(0xFF007EFF),decoration: TextDecoration.none,fontWeight: FontWeight.bold),),
  314. onTap: (){
  315. setState(() {
  316. _isOrder = false;
  317. });
  318. },
  319. ),
  320. ],
  321. ),
  322. ),
  323. Divider(height: 0.5,thickness: 0.5,color: Color(0xFFE5E5E5),),
  324. Container(
  325. height: (MediaQuery.of(context).size.height-MediaQuery.of(context).padding.top-44)*0.8-hsp(220)-0.5,
  326. child: SingleChildScrollView(
  327. padding: EdgeInsets.all(0),
  328. child: Column(
  329. children: [
  330. Container(
  331. height: hsp(500)+2.5,
  332. child: ListView.separated(
  333. itemBuilder: (context,index){
  334. return Container(
  335. height: hsp(100),
  336. color: Colors.white,
  337. padding: EdgeInsets.only(left: wsp(30),right: wsp(30)),
  338. child: Row(
  339. children: [
  340. Container(child: Text(index==0?'救援地点':index==1?'救援类型':index==2?'涉险人数':
  341. index==3?'联系方式':'描述',style: TextStyle(fontSize: zsp(30),color: Color(0xFFA7A7A7)),),width: wsp(150),),
  342. Container(
  343. margin: EdgeInsets.only(left: wsp(20)),
  344. width: MediaQuery.of(context).size.width-wsp(230),
  345. child: Text(index==0?'${_startDict['title']}':index==1?'${_typeDict['name']}':index==2?_numStr:index==3?_phone.text:(_des.text.isEmpty?'无':_des.text),
  346. style: TextStyle(fontSize: zsp(30),color: Color(0xFF000000),fontWeight: FontWeight.bold),)
  347. ),
  348. ],
  349. ),
  350. );
  351. },
  352. separatorBuilder: (context,index){
  353. return Divider(color: Color(0xFFF1F2F4),height: 0.5,thickness: 0.5,);
  354. },
  355. itemCount: 5,
  356. padding: EdgeInsets.all(0),
  357. physics: NeverScrollableScrollPhysics(),
  358. ),
  359. ),
  360. GestureDetector(
  361. onTap: (){
  362. showInformAlert(context,title: '预订须知',content: _noticeStr);
  363. },
  364. child: Container(
  365. child: RichText(
  366. text: TextSpan(
  367. text: '预订须知',
  368. style: TextStyle(fontSize: zsp(28),color: Color(0xFF348AE1)),
  369. children: [
  370. TextSpan(
  371. text: ' >',
  372. style: TextStyle(color: Color(0xFF000000))
  373. ),
  374. ]
  375. ),
  376. ),
  377. padding: EdgeInsets.only(left: wsp(40),right: wsp(40)),
  378. margin: EdgeInsets.only(top: hsp(10),bottom: hsp(10)),
  379. height: hsp(80),
  380. width: MediaQuery.of(context).size.width,
  381. alignment: Alignment.centerLeft,
  382. color: Colors.white,
  383. ),
  384. ),
  385. Container(
  386. height: hsp(80),
  387. padding: EdgeInsets.only(left: wsp(40),right: wsp(40)),
  388. child: Text('说明',style: TextStyle(color: Color(0xFF333333),fontSize: zsp(30),fontWeight: FontWeight.bold),),
  389. margin: EdgeInsets.only(bottom: 0.5),
  390. alignment: Alignment.centerLeft,
  391. color: Colors.white,
  392. ),
  393. Container(
  394. padding: EdgeInsets.only(left: wsp(40),right: wsp(40),top: hsp(20),bottom: hsp(20)),
  395. child: Text('信息提交后,将有我们的工作人员联系您讨论具体的救援方案,请保证手机畅通',style: TextStyle(color: Color(0xFF999999),fontSize: zsp(30)),),
  396. alignment: Alignment.centerLeft,
  397. color: Colors.white,
  398. )
  399. ],
  400. ),
  401. ),
  402. ),
  403. ],
  404. ),
  405. ),
  406. Container(
  407. height: hsp(120),
  408. width: MediaQuery.of(context).size.width,
  409. color: Colors.white,
  410. padding: EdgeInsets.only(left: wsp(30),right: wsp(30)),
  411. child: Row(
  412. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  413. children: [
  414. // RichText(
  415. // text: TextSpan(
  416. // text: '参考价(¥) ',
  417. // style: TextStyle(fontSize: zsp(22),color: Color(0xFF181818)),
  418. // children: [
  419. // TextSpan(
  420. // text: _priceStr==null?'0':_priceStr,
  421. // style: TextStyle(fontSize: zsp(40),color: Color(0xFFFF6600)),
  422. // ),
  423. // TextSpan(
  424. // text: '元'
  425. // )
  426. // ]
  427. // ),
  428. // ),
  429. // GestureDetector(
  430. // child: Row(
  431. // children: [
  432. // Text('明细',style: TextStyle(fontSize: zsp(22),color: Color(0xFF181818)),),
  433. // Icon(Icons.keyboard_arrow_up,size: hsp(30),color: Color(0xFF007EFF),),
  434. // ],
  435. // ),
  436. // onTap: (){
  437. // setState(() {
  438. // _isDetail = !_isDetail;
  439. // });
  440. // },
  441. // ),
  442. GestureDetector(
  443. onTap: (){
  444. showNegotiateAlertDio(
  445. context,
  446. content: _noticeStr,
  447. sure: (){
  448. _postHelpPlaneOrderData();
  449. }
  450. );
  451. },
  452. child: Container(
  453. height: hsp(100),
  454. width: MediaQuery.of(context).size.width-wsp(60),
  455. padding: EdgeInsets.only(left: wsp(50),right: wsp(50)),
  456. decoration: BoxDecoration(
  457. color: Color(0xFF007EFF),
  458. borderRadius: BorderRadius.all(Radius.circular(5))
  459. ),
  460. alignment: Alignment.center,
  461. child: Text('立即预约',style: TextStyle(fontSize: zsp(30),color: Colors.white,fontWeight: FontWeight.bold),),
  462. ),
  463. )
  464. ],
  465. ),
  466. )
  467. ],
  468. ),
  469. ),
  470. ),
  471. ),
  472. if(_isDetail==true)GestureDetector(
  473. onTap: (){
  474. setState(() {
  475. _isDetail = false;
  476. });
  477. },
  478. child: Container(
  479. height: (MediaQuery.of(context).size.height-MediaQuery.of(context).padding.top-44)-hsp(120),
  480. color: Colors.black45,
  481. child: Container(
  482. margin: EdgeInsets.only(top: (MediaQuery.of(context).size.height-MediaQuery.of(context).padding.top-44)-hsp(120)-hsp(370)),
  483. height: hsp(370),
  484. decoration: BoxDecoration(
  485. color: Colors.white,
  486. borderRadius: BorderRadius.only(topLeft: Radius.circular(10),topRight: Radius.circular(10))
  487. ),
  488. child: GestureDetector(
  489. onTap: (){},
  490. behavior: HitTestBehavior.opaque,
  491. child: Column(
  492. children: [
  493. Container(
  494. height: hsp(100),
  495. padding: EdgeInsets.only(left: 15,right: 15),
  496. child: Row(
  497. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  498. children: [
  499. GestureDetector(
  500. child: Text('关闭',style: TextStyle(fontSize: 15,color: Color(0xFF007EFF),decoration: TextDecoration.none),),
  501. onTap: (){
  502. setState(() {
  503. _isDetail = false;
  504. });
  505. },
  506. ),
  507. Text('明细',style: TextStyle(fontSize: 15,color: Color(0xFF000000),decoration: TextDecoration.none,fontWeight: FontWeight.bold),),
  508. Container(width: wsp(50),),
  509. ],
  510. ),
  511. ),
  512. Container(
  513. height: hsp(100),
  514. color: Color(0xFFF7F8F9),
  515. padding: EdgeInsets.only(left: wsp(40),right: wsp(40),bottom: hsp(20),top: hsp(20)),
  516. child: Row(
  517. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  518. children: [
  519. Text('VIP尊享座位',style: TextStyle(fontSize: zsp(32),color: Color(0xFF000000),decoration: TextDecoration.none),),
  520. Text('¥ 780x 10人',style: TextStyle(fontSize: 15,color: Color(0xFF007EFF),decoration: TextDecoration.none),),
  521. ],
  522. ),
  523. ),
  524. Container(
  525. color: Color(0xFFF7F8F9),
  526. height: hsp(170),
  527. child: ListView.builder(
  528. padding: EdgeInsets.all(0),
  529. itemBuilder: (context,index){
  530. return Container(
  531. padding: EdgeInsets.only(left: wsp(40),right: wsp(40),bottom: hsp(10)),
  532. child: Row(
  533. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  534. children: [
  535. Text('票价',style: TextStyle(fontSize: zsp(28),color: Color(0xFF9A9A9A)),),
  536. Text('¥ 770x 10人',style: TextStyle(fontSize: zsp(28),color: Color(0xFF9A9A9A)),),
  537. ],
  538. ),
  539. );
  540. },
  541. itemCount: 3,
  542. ),
  543. )
  544. ],
  545. ),
  546. ),
  547. ),
  548. ),
  549. )
  550. ],
  551. ),
  552. ),
  553. );
  554. }
  555. _getHelpPlaneData() async{
  556. Map dict = await ysRequestHttp(context,type: requestType.get,api: '/app/applets/wallconfigure/get',parameter: {'type':2},isLoading: true,isToken: false);
  557. if(dict!=null){
  558. _msgDict = dict['data'];
  559. }
  560. }
  561. _postHelpPlaneOrderData() async{
  562. Map request = {};
  563. request['type'] = 2;
  564. request['travelersNumber'] = _numStr;
  565. request['phone'] = _phone.text;
  566. if(_des.text.isNotEmpty)request['des'] = _des.text;
  567. request['loactionSetout'] = '${_startDict['lat']},${_startDict['lng']}';
  568. // request['loactionArrive'] = '${_endDict['lat']},${_endDict['lng']}';
  569. request['citySetout'] = '${_startDict['title']}';
  570. // request['cityArrive'] = '${_endDict['title']}';
  571. request['rescueTypeId'] = _typeDict['id'];
  572. request['price'] = _priceStr;
  573. // request['modelId'] = _planeType['modelId'];
  574. Map dict = await ysRequestHttp(context,type: requestType.post,api: '/app/applets/airplaneorder/createOrder',parameter: request,isLoading: true,isToken: true);
  575. if(dict!=null){
  576. Navigator.of(context).push(
  577. CupertinoPageRoute(
  578. builder: (context){
  579. return YSPay(orderDict: dict['data'],type: payType.help,);
  580. }
  581. )
  582. );
  583. }
  584. }
  585. _getPriceData() async{
  586. FocusScope.of(context).unfocus();
  587. if(_startDict==null){
  588. ysFlutterToast(context,'请选择出发位置');
  589. return;
  590. }
  591. // if(_endDict==null){
  592. // ysFlutterToast(context,'请选择到达位置');
  593. // return;
  594. // }
  595. // if(_startDict['title']==_endDict['title']){
  596. // ysFlutterToast(context,'出发与到达位置不能相同');
  597. // return;
  598. // }
  599. // if(_planeType==null){
  600. // ysFlutterToast(context,'请选择飞机类型');
  601. // return;
  602. // }
  603. if(_typeDict==null){
  604. ysFlutterToast(context,'请选择救援类型');
  605. return;
  606. }
  607. if(_numStr==null){
  608. ysFlutterToast(context,'请选择救援人数');
  609. return;
  610. }
  611. if(_phone.text.isEmpty){
  612. ysFlutterToast(context,'电话号码不能为空');
  613. return;
  614. }
  615. if(isChinaPhoneLegal(_phone.text)==false){
  616. ysFlutterToast(context,'电话号码格式不正确');
  617. return;
  618. }
  619. Map dict = await ysRequestHttp(context,type: requestType.get,api: '/app/applets/wallconfigure/calculation',
  620. parameter: {'loactionSetout':'${_startDict['lat']},${_startDict['lng']}'},isLoading: true,isToken: false);
  621. if(dict!=null){
  622. _priceStr = '${dict['data']}';
  623. setState(() {
  624. _isOrder = true;
  625. });
  626. }
  627. }
  628. _getNoticeData() async{
  629. Map dict = await ysRequestHttp(context,type: requestType.get,api: '/app/applets/airplaneservice/ctrip',parameter: {'type':2});
  630. if(dict!=null){
  631. _noticeStr = dict['data']['value'];
  632. }
  633. }
  634. }