order_detail.dart 51 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010
  1. import 'package:flutter/cupertino.dart';
  2. import 'package:flutter/material.dart';
  3. import 'package:liftmanager/common/common.dart';
  4. import 'package:liftmanager/internal/account/account_router.dart';
  5. import 'package:liftmanager/internal/account/model/user_info_entity.dart';
  6. import 'package:liftmanager/internal/account/provider/user_provider.dart';
  7. import 'package:liftmanager/internal/wode/wode_router.dart';
  8. import 'package:liftmanager/net/api_service.dart';
  9. import 'package:liftmanager/routers/fluro_navigator.dart';
  10. import 'package:liftmanager/utils/image_utils.dart';
  11. import 'package:liftmanager/widgets/app_bar.dart';
  12. import 'package:liftmanager/widgets/click_item.dart';
  13. import 'package:liftmanager/widgets/load_image.dart';
  14. import 'package:liftmanager/widgets/my_button.dart';
  15. import 'package:provider/provider.dart';
  16. import 'package:liftmanager/widgets/bbs_content.dart';
  17. import 'package:liftmanager/internal/bbs/bbs_router.dart';
  18. import 'package:flutter_screenutil/flutter_screenutil.dart';
  19. import 'package:liftmanager/internal/bbs/model/liftcase_model.dart';
  20. import 'package:liftmanager/utils/toast.dart';
  21. import 'package:liftmanager/utils/time_format.dart';
  22. import 'package:liftmanager/utils/url.dart';
  23. import 'package:liftmanager/internal/wode/order_const.dart';
  24. import 'package:shared_preferences/shared_preferences.dart';
  25. import 'package:video_player/video_player.dart';
  26. import 'package:chewie/chewie.dart';
  27. import 'package:liftmanager/utils/utils.dart';
  28. import 'package:liftmanager/utils/theme_utils.dart';
  29. class OrderDetail extends StatefulWidget {
  30. OrderDetail(this.id);
  31. final String id;
  32. @override
  33. State<StatefulWidget> createState() {
  34. return OrderDetailState();
  35. }
  36. }
  37. class OrderDetailState extends State<OrderDetail>
  38. with AutomaticKeepAliveClientMixin {
  39. UserProvider provider = UserProvider();
  40. bool _hasData = false;
  41. LiftCasesDetailModel detailObj;
  42. double totalPay;
  43. getBrandDetail() {
  44. NewApiService().getLiftcaseDetail(widget.id, onSuccess: (res) {
  45. detailObj = res;
  46. double serviceCost = detailObj.serviceCost!=null?detailObj.serviceCost:0.0;
  47. double travelCost = detailObj.travelCost!=null?detailObj.travelCost:0.0;
  48. double couponDeduction = detailObj.couponDeduction!=null?detailObj.couponDeduction:0.0;
  49. double redEnvelopeDeduction = detailObj.redEnvelopeDeduction!=null?detailObj.redEnvelopeDeduction:0.0;
  50. totalPay = (serviceCost + travelCost) - ( couponDeduction + redEnvelopeDeduction);
  51. print(serviceCost);
  52. print(travelCost);
  53. print(couponDeduction);
  54. print(redEnvelopeDeduction);
  55. print(totalPay);
  56. print("456456456465");
  57. if(totalPay < 0){
  58. totalPay = 0.0;
  59. }
  60. if(detailObj.beforeRepair!=null){
  61. _controllerBefore = VideoPlayerController.network(
  62. Utils.getImagePath(detailObj.beforeRepair)
  63. );
  64. }
  65. if(detailObj.afterRepair!=null){
  66. _controllerAfter = VideoPlayerController.network(
  67. Utils.getImagePath(detailObj.afterRepair)
  68. );
  69. }
  70. print(totalPay);
  71. print("totalPay-------------------------");
  72. _hasData = true;
  73. setState(() {});
  74. }, onError: (code, msg) {
  75. toasts(msg);
  76. });
  77. }
  78. getPayCost(){
  79. bool isPay = true;
  80. if((detailObj.dataTable == 1 && detailObj.statuz == 0) || (detailObj.dataTable == 2 && detailObj.statuz == 2)){
  81. isPay = false;
  82. }
  83. return isPay;
  84. }
  85. List<Widget> btnWidget = [];
  86. VideoPlayerController _controllerBefore;
  87. VideoPlayerController _controllerAfter;
  88. @override
  89. void initState() {
  90. if(this.mounted){
  91. getBrandDetail();
  92. }
  93. super.initState();
  94. }
  95. @override
  96. void dispose() {
  97. if(detailObj.beforeRepair!=null){
  98. _controllerBefore.pause();
  99. _controllerBefore.dispose();
  100. }
  101. if(detailObj.afterRepair!=null){
  102. _controllerAfter.pause();
  103. _controllerAfter.dispose();
  104. }
  105. super.dispose();
  106. }
  107. // 用户确认订单
  108. void confirmOrder() {
  109. showLoading(context);
  110. NewApiService().userConfirmOrder(widget.id, onSuccess: (res) {
  111. dismissLoading(context);
  112. toasts("订单确认成功");
  113. getBrandDetail();
  114. setState(() {});
  115. }, onError: (code, msg) {
  116. dismissLoading(context);
  117. toasts(msg);
  118. });
  119. }
  120. // 用户确认打卡
  121. void confirmPunchin() {
  122. showLoading(context);
  123. NewApiService().userToClock(widget.id, onSuccess: (res) {
  124. dismissLoading(context);
  125. toasts("确认打卡成功");
  126. getBrandDetail();
  127. setState(() {});
  128. }, onError: (code, msg) {
  129. dismissLoading(context);
  130. toasts(msg);
  131. });
  132. }
  133. // 付款
  134. void payment() {
  135. showLoading(context);
  136. NewApiService().getTestAlipayNotify(detailObj.orderNo, onSuccess: (res) {
  137. dismissLoading(context);
  138. toasts("付款成功");
  139. getBrandDetail();
  140. setState(() {});
  141. }, onError: (code, msg) {
  142. dismissLoading(context);
  143. toasts(msg);
  144. });
  145. }
  146. getHeight(detailObj){
  147. bool isHeight = false;
  148. if((OrderConstant.isShow(detailObj.statuz,detailObj.dataTable,'showUserPaymentButton') && detailObj.chargerId!=null)||
  149. (OrderConstant.isShow(detailObj.statuz,detailObj.dataTable,'showUserConfirmPunchButton',arrivedFlag: detailObj.arrivedFlag))||
  150. (OrderConstant.isShow(detailObj.statuz,detailObj.dataTable,'showUserAppealButton'))||
  151. (OrderConstant.isShow(detailObj.statuz,detailObj.dataTable,'showUserConfirmOrderButton'))||
  152. (OrderConstant.isShow(detailObj.statuz,detailObj.dataTable,'showUserEvaluationButton'))||
  153. (OrderConstant.isShow(detailObj.statuz,detailObj.dataTable,'showUserChooseExpertButton') || (detailObj.chargerId==null && detailObj.isPlatformSpecified == 0))
  154. ){
  155. isHeight = true;
  156. }
  157. return isHeight;
  158. }
  159. @override
  160. Widget build(BuildContext context) {
  161. double width = MediaQuery.of(context).size.width;
  162. return
  163. // Center(child:new Text("个人中心"));
  164. ChangeNotifierProvider<UserProvider>(
  165. create: (_) => provider,
  166. child: Scaffold(
  167. appBar: MyAppBar(
  168. centerTitle: "订单详情",
  169. ),
  170. body: _hasData
  171. ? Consumer<UserProvider>(
  172. builder: (_, provider, __) {
  173. return Stack(
  174. children: <Widget>[
  175. ListView(
  176. padding: EdgeInsets.all(0.0),
  177. children: <Widget>[
  178. Container(
  179. decoration: BoxDecoration(
  180. gradient: const LinearGradient(
  181. colors: [Color(0xFF00D9FF), Color(0xFF0287FF)],
  182. ),
  183. ),
  184. padding: EdgeInsets.only(
  185. top: ScreenUtil().setWidth(10),
  186. left: ScreenUtil().setWidth(30)),
  187. height: ScreenUtil().setWidth(70),
  188. child: Column(
  189. crossAxisAlignment: CrossAxisAlignment.start,
  190. children: <Widget>[
  191. Text(
  192. OrderConstant.getStatusName(
  193. detailObj.statuz, detailObj.dataTable,
  194. arrivedFlag: detailObj.arrivedFlag,
  195. userType: 'USER'),
  196. textAlign: TextAlign.left,
  197. style: TextStyle(
  198. fontSize: ScreenUtil().setSp(17),
  199. color: Color(0xffffffff),
  200. ),
  201. ),
  202. // detailObj.statuz == 6
  203. // ? Text(
  204. // '还剩23小时59分钟自动确认',
  205. // textAlign: TextAlign.left,
  206. // style: TextStyle(
  207. // fontSize: ScreenUtil().setSp(13),
  208. // color: Color(0xffeeeeee),
  209. // ),
  210. // )
  211. // : Container(
  212. // child: null,
  213. // ),
  214. ],
  215. ),
  216. ),
  217. Container(
  218. // height: 20,
  219. padding: EdgeInsets.only(
  220. bottom: ScreenUtil().setWidth(20),
  221. top: ScreenUtil().setWidth(10)),
  222. child: Row(
  223. crossAxisAlignment: CrossAxisAlignment.start,
  224. children: <Widget>[
  225. Expanded(
  226. child: GestureDetector(
  227. onTap: () {
  228. NavigatorUtils.push(context, "${BbsRouter.recommendAsk}?id=${detailObj.id}&type=3");
  229. },
  230. child: Row(
  231. crossAxisAlignment:
  232. CrossAxisAlignment.start,
  233. children: <Widget>[
  234. Container(
  235. margin: EdgeInsets.only(
  236. left: ScreenUtil().setWidth(15),
  237. right: ScreenUtil().setWidth(10),
  238. top: ScreenUtil().setWidth(5)),
  239. decoration: BoxDecoration(
  240. borderRadius: BorderRadius.circular(
  241. ScreenUtil().setWidth(22)),
  242. ),
  243. child: LoadNetworkImage(
  244. detailObj.avatarUrl,
  245. width: ScreenUtil().setWidth(43),
  246. height: ScreenUtil().setWidth(43),
  247. // alignment: Alignment.centerLeft,
  248. ),
  249. ),
  250. Expanded(
  251. child: Container(
  252. padding: EdgeInsets.only(
  253. right:
  254. ScreenUtil().setWidth(15)),
  255. child: Column(
  256. children: <Widget>[
  257. Container(
  258. child: Row(
  259. mainAxisAlignment:
  260. MainAxisAlignment.start,
  261. children: <Widget>[
  262. Row(
  263. crossAxisAlignment:
  264. CrossAxisAlignment
  265. .center,
  266. children: <Widget>[
  267. Text(
  268. detailObj.name ??
  269. '',
  270. style: TextStyle(
  271. fontSize:
  272. ScreenUtil()
  273. .setSp(
  274. 17),
  275. ),
  276. textAlign:
  277. TextAlign.start,
  278. ),
  279. Container(
  280. padding:
  281. EdgeInsets.only(
  282. left: 5),
  283. child: Text(
  284. detailObj.dataTable ==
  285. 1
  286. ? '问诊服务'
  287. : '出诊服务',
  288. style: TextStyle(
  289. color: Color(
  290. 0xff0288FF),
  291. fontSize:
  292. ScreenUtil()
  293. .setSp(
  294. 13),
  295. ),
  296. textAlign:
  297. TextAlign
  298. .start,
  299. ),
  300. ),
  301. ],
  302. ),
  303. ],
  304. ),
  305. ),
  306. Container(
  307. child: Row(
  308. mainAxisAlignment:
  309. MainAxisAlignment.start,
  310. children: <Widget>[
  311. Row(
  312. crossAxisAlignment:
  313. CrossAxisAlignment
  314. .center,
  315. children: <Widget>[
  316. Text(
  317. detailObj.createTime !=
  318. null
  319. ? DateUtils
  320. .instance
  321. .getFormartData(
  322. timeSamp:
  323. detailObj
  324. .createTime,
  325. format:
  326. "MM月dd日",
  327. )
  328. : '',
  329. style: TextStyle(
  330. color: Color(
  331. 0xff999999),
  332. fontSize:
  333. ScreenUtil()
  334. .setSp(
  335. 13),
  336. ),
  337. textAlign:
  338. TextAlign.left,
  339. ),
  340. Container(
  341. padding:
  342. EdgeInsets.only(
  343. left: 5),
  344. child: Text(
  345. detailObj
  346. .brandName ??
  347. '',
  348. style: TextStyle(
  349. color: Color(
  350. 0xff999999),
  351. fontSize:
  352. ScreenUtil()
  353. .setSp(
  354. 13),
  355. ),
  356. textAlign:
  357. TextAlign
  358. .left,
  359. ),
  360. )
  361. ],
  362. ),
  363. ],
  364. ),
  365. ),
  366. Row(
  367. mainAxisAlignment:
  368. MainAxisAlignment.start,
  369. children: <Widget>[
  370. Container(
  371. width: 260,
  372. child: Text(
  373. detailObj.expression ??
  374. '',
  375. style: TextStyle(
  376. color:
  377. Color(0xff0288FF),
  378. fontSize: ScreenUtil()
  379. .setSp(15),
  380. ),
  381. textAlign:
  382. TextAlign.left,
  383. maxLines: 1,
  384. overflow: TextOverflow
  385. .ellipsis,
  386. ),
  387. ),
  388. ],
  389. ),
  390. ],
  391. ),
  392. ),
  393. )
  394. ],
  395. ),
  396. ),
  397. ),
  398. ],
  399. ),
  400. ),
  401. Container(
  402. color: ThemeUtils.getDialogTextFieldColor(context),
  403. height: ScreenUtil().setWidth(5),
  404. ),
  405. detailObj.dataTable == 2
  406. ? Heng(
  407. left: "差旅费",
  408. right: detailObj.travelCost != null
  409. ? "¥" + detailObj.travelCost.toString()
  410. : '¥0',
  411. leftColor: 0xff666666,
  412. rightColor: 0xff666666,
  413. )
  414. : Container(),
  415. Heng(
  416. left: "技术服务费",
  417. right: detailObj.serviceCost != null
  418. ? "¥" + detailObj.serviceCost.toString()
  419. : '¥0',
  420. leftColor: 0xff666666,
  421. rightColor: 0xff666666,
  422. ),
  423. Heng(
  424. left: "优惠券抵扣",
  425. right: detailObj.couponDeduction != null
  426. ? "-¥" + detailObj.couponDeduction.toString()
  427. : '-¥0',
  428. leftColor: 0xff666666,
  429. rightColor: 0xff666666,
  430. ),
  431. Heng(
  432. left: "红包抵扣",
  433. right: detailObj.redEnvelopeDeduction != null
  434. ? "-¥" +
  435. detailObj.redEnvelopeDeduction.toString()
  436. : '-¥0',
  437. leftColor: 0xff666666,
  438. rightColor: 0xff666666,
  439. ),
  440. Heng(
  441. left: "实付款",
  442. right: detailObj.payCost != null && getPayCost()
  443. ? "¥" + detailObj.payCost.toString()
  444. : '¥' + totalPay.toStringAsFixed(2).toString(),
  445. leftColor: 0xff666666,
  446. rightColor: 0xffFD0808,
  447. ),
  448. Container(
  449. color: ThemeUtils.getDialogTextFieldColor(context),
  450. height: ScreenUtil().setWidth(5),
  451. ),
  452. Container(
  453. padding: EdgeInsets.only(
  454. left: ScreenUtil().setWidth(15),
  455. top: ScreenUtil().setWidth(10),
  456. bottom: ScreenUtil().setWidth(10),
  457. ),
  458. decoration: BoxDecoration(
  459. border: Border(
  460. bottom: BorderSide(
  461. width: .5,
  462. color:
  463. Color(0xffFAF7FA),
  464. ),
  465. ),
  466. ),
  467. child: Text(
  468. '订单信息',
  469. textAlign: TextAlign.left,
  470. style: TextStyle(
  471. fontSize: ScreenUtil().setSp(17),
  472. ),
  473. ),
  474. ),
  475. Container(
  476. padding: EdgeInsets.only(
  477. left: ScreenUtil().setWidth(15),
  478. top: ScreenUtil().setWidth(10),
  479. bottom: ScreenUtil().setWidth(10)),
  480. child: Column(
  481. children: <Widget>[
  482. Row(
  483. children: <Widget>[
  484. Text(
  485. '订单编号:',
  486. textAlign: TextAlign.left,
  487. style: TextStyle(
  488. fontSize: ScreenUtil().setSp(13),
  489. color: Color(0xff666666),
  490. ),
  491. ),
  492. Text(
  493. detailObj.orderNo ?? '',
  494. textAlign: TextAlign.left,
  495. style: TextStyle(
  496. fontSize: ScreenUtil().setSp(13),
  497. color: Color(0xff666666),
  498. ),
  499. ),
  500. ],
  501. ),
  502. Row(
  503. children: <Widget>[
  504. Text(
  505. '创建时间:',
  506. textAlign: TextAlign.left,
  507. style: TextStyle(
  508. fontSize: ScreenUtil().setSp(13),
  509. color: Color(0xff666666),
  510. ),
  511. ),
  512. Text(
  513. detailObj.createTime != null
  514. ? DateUtils.instance.getFormartData(
  515. timeSamp: detailObj.createTime,
  516. format: "yyyy-MM-dd HH:mm:ss")
  517. : '',
  518. textAlign: TextAlign.left,
  519. style: TextStyle(
  520. fontSize: ScreenUtil().setSp(13),
  521. color: Color(0xff666666),
  522. ),
  523. ),
  524. ],
  525. ),
  526. detailObj.liftCaseAppealEntity!=null? Row(
  527. children: <Widget>[
  528. Text(
  529. '驳回原因:',
  530. textAlign: TextAlign.left,
  531. style: TextStyle(
  532. fontSize: ScreenUtil().setSp(13),
  533. color: Color(0xff666666),
  534. ),
  535. ),
  536. Container(
  537. width: width*0.75,
  538. child: Text(
  539. detailObj.liftCaseAppealEntity?.cancelSeason??"",
  540. textAlign: TextAlign.left,
  541. style: TextStyle(
  542. fontSize: ScreenUtil().setSp(13),
  543. color: Color(0xff666666),
  544. ),
  545. ),
  546. )
  547. ],
  548. ):Container(child: null,),
  549. ],
  550. ),
  551. ),
  552. detailObj.dataTable==2? Column(
  553. crossAxisAlignment: CrossAxisAlignment.start,
  554. children: <Widget>[
  555. Container(
  556. width: width,
  557. padding: EdgeInsets.only(left:ScreenUtil().setWidth(15),top:ScreenUtil().setWidth(10),bottom:ScreenUtil().setWidth(10)),
  558. decoration: BoxDecoration(
  559. border: Border(
  560. bottom: BorderSide(width: .5, color:Color(0xfff5f5f5)),
  561. ),
  562. ),
  563. child: Text(
  564. '现场情况(维修前)',
  565. textAlign: TextAlign.left,
  566. style: TextStyle(
  567. fontSize:ScreenUtil().setSp(17),
  568. color:Color(0xff333333),
  569. ),
  570. ),
  571. ),
  572. detailObj.beforeRepair!=null?Container(
  573. padding: EdgeInsets.only(
  574. left: ScreenUtil().setWidth(15),
  575. right: ScreenUtil().setWidth(15),
  576. top: ScreenUtil().setWidth(15)),
  577. child: ClipRRect(
  578. borderRadius: BorderRadius.circular(5),
  579. child: new Chewie(
  580. controller: ChewieController(
  581. videoPlayerController:
  582. // VideoPlayerController.network(
  583. // Utils.getImagePath(detailObj.beforeRepair)
  584. // // imgFontUrl + detailObj.url
  585. // )
  586. _controllerBefore,
  587. aspectRatio: 3 / 2,
  588. autoPlay: false,
  589. looping: true,
  590. showControls: true,
  591. // 占位图
  592. // placeholder: Image.network(
  593. // imgFontUrl+detailObj.cover,
  594. // fit: BoxFit.contain,
  595. // ),
  596. // 是否在 UI 构建的时候就加载视频
  597. autoInitialize: true,
  598. // 拖动条样式颜色
  599. materialProgressColors:
  600. new ChewieProgressColors(
  601. playedColor: Colors.red,
  602. handleColor: Colors.blue,
  603. backgroundColor: Colors.grey,
  604. bufferedColor: Colors.lightGreen,
  605. ),
  606. ),
  607. ),
  608. )):Container(
  609. padding: EdgeInsets.only(left:15),
  610. child: Text("暂无"),
  611. ),
  612. Container(
  613. width: width,
  614. padding: EdgeInsets.only(left:ScreenUtil().setWidth(15),top:ScreenUtil().setWidth(10),bottom:ScreenUtil().setWidth(10)),
  615. decoration: BoxDecoration(
  616. border: Border(
  617. bottom: BorderSide(width: .5, color:Color(0xfff5f5f5)),
  618. ),
  619. ),
  620. child: Text(
  621. '现场情况(维修后)',
  622. textAlign: TextAlign.left,
  623. style: TextStyle(
  624. fontSize:ScreenUtil().setSp(17),
  625. color:Color(0xff333333),
  626. ),
  627. ),
  628. ),
  629. detailObj.afterRepair!=null? Container(
  630. padding: EdgeInsets.only(
  631. left: ScreenUtil().setWidth(15),
  632. right: ScreenUtil().setWidth(15),
  633. top: ScreenUtil().setWidth(15)),
  634. child: ClipRRect(
  635. borderRadius: BorderRadius.circular(5),
  636. child: new Chewie(
  637. controller: ChewieController(
  638. videoPlayerController:
  639. // VideoPlayerController.network(
  640. // Utils.getImagePath(detailObj.afterRepair)
  641. // // imgFontUrl + detailObj.url
  642. // )
  643. _controllerAfter,
  644. aspectRatio: 3 / 2,
  645. autoPlay: false,
  646. looping: true,
  647. showControls: true,
  648. // 占位图
  649. // placeholder: Image.network(
  650. // imgFontUrl+detailObj.cover,
  651. // fit: BoxFit.contain,
  652. // ),
  653. // 是否在 UI 构建的时候就加载视频
  654. autoInitialize: true,
  655. // 拖动条样式颜色
  656. materialProgressColors:
  657. new ChewieProgressColors(
  658. playedColor: Colors.red,
  659. handleColor: Colors.blue,
  660. backgroundColor: Colors.grey,
  661. bufferedColor: Colors.lightGreen,
  662. ),
  663. ),
  664. ),
  665. )):Container(
  666. padding: EdgeInsets.only(left:15),
  667. child: Text("暂无"),
  668. ),
  669. ],
  670. ):Container(child: null,),
  671. OrderConstant.isShow(
  672. detailObj.statuz,
  673. detailObj.dataTable,
  674. 'showUserAppealInfo') ==
  675. false
  676. ? SizedBox(height: 80)
  677. : Container(child: null),
  678. OrderConstant.isShow(detailObj.statuz,
  679. detailObj.dataTable, 'showUserAppealInfo')
  680. ? Container(
  681. padding: EdgeInsets.only(
  682. left: ScreenUtil().setWidth(15),
  683. top: ScreenUtil().setWidth(10),
  684. bottom: ScreenUtil().setWidth(10)),
  685. decoration: BoxDecoration(
  686. border: Border(
  687. bottom: BorderSide(
  688. width: .5, color: Color(0xfff5f5f5)),
  689. ),
  690. ),
  691. child: Text(
  692. '申诉信息',
  693. textAlign: TextAlign.left,
  694. style: TextStyle(
  695. fontSize: ScreenUtil().setSp(17),
  696. ),
  697. ),
  698. )
  699. : Container(child: null),
  700. OrderConstant.isShow(detailObj.statuz,
  701. detailObj.dataTable, 'showUserAppealInfo')
  702. ? Container(
  703. padding: EdgeInsets.only(
  704. left: ScreenUtil().setWidth(15),
  705. top: ScreenUtil().setWidth(10),
  706. bottom: ScreenUtil().setWidth(10)),
  707. child: Column(
  708. children: <Widget>[
  709. Row(
  710. children: <Widget>[
  711. Text(
  712. '申诉内容:',
  713. textAlign: TextAlign.left,
  714. style: TextStyle(
  715. fontSize: ScreenUtil().setSp(12),
  716. color: Color(0xff666666),
  717. ),
  718. ),
  719. Text(
  720. detailObj.liftCaseAppealEntity !=
  721. null &&
  722. detailObj
  723. .liftCaseAppealEntity
  724. .content !=
  725. null
  726. ? detailObj.liftCaseAppealEntity
  727. .content
  728. : '',
  729. textAlign: TextAlign.left,
  730. style: TextStyle(
  731. fontSize: ScreenUtil().setSp(12),
  732. color: Color(0xff666666),
  733. ),
  734. ),
  735. ],
  736. ),
  737. Row(
  738. children: <Widget>[
  739. Text(
  740. '申诉时间:',
  741. textAlign: TextAlign.left,
  742. style: TextStyle(
  743. fontSize: ScreenUtil().setSp(12),
  744. color: Color(0xff666666),
  745. ),
  746. ),
  747. Text(
  748. detailObj.liftCaseAppealEntity !=
  749. null &&
  750. detailObj
  751. .liftCaseAppealEntity
  752. .createTime !=
  753. null
  754. ? DateUtils.instance.getFormartData(
  755. timeSamp: detailObj
  756. .liftCaseAppealEntity
  757. .createTime,
  758. format:
  759. "yyyy-MM-dd HH:mm:ss")
  760. : '',
  761. textAlign: TextAlign.left,
  762. style: TextStyle(
  763. fontSize: ScreenUtil().setSp(12),
  764. color: Color(0xff666666),
  765. ),
  766. ),
  767. ],
  768. ),
  769. ],
  770. ),
  771. )
  772. : Container(child: null),
  773. SizedBox(
  774. height: 70,
  775. )
  776. ],
  777. ),
  778. Positioned(
  779. bottom: 0,
  780. left: 0,
  781. child: Container(
  782. width: width,
  783. height:
  784. !getHeight(detailObj)?0:
  785. 60,
  786. padding: EdgeInsets.only(
  787. right: ScreenUtil().setWidth(15),
  788. left: ScreenUtil().setWidth(15),
  789. top: ScreenUtil().setWidth(12),
  790. bottom: ScreenUtil().setWidth(12),
  791. ),
  792. decoration: BoxDecoration(
  793. border: Border(
  794. top: BorderSide(
  795. width: 0.5,
  796. color: Color(0xffeeeeee),
  797. ),
  798. ),
  799. color: ThemeUtils.getDialogTextFieldColor(context),
  800. ),
  801. child: Row(
  802. mainAxisAlignment: MainAxisAlignment.end,
  803. crossAxisAlignment: CrossAxisAlignment.center,
  804. // children: btnWidget,
  805. children: <Widget>[
  806. OrderConstant.isShow(
  807. detailObj.statuz,
  808. detailObj.dataTable,
  809. 'showUserPaymentButton') && detailObj.chargerId!=null
  810. ? BottomBtn(
  811. title: "立即付款",
  812. fun: () {
  813. // showAlert(
  814. // context,
  815. // "提示",
  816. // "确认付款吗?",
  817. // "确认",
  818. // () {
  819. // // payment();
  820. // // NavigatorUtils.goBack(context);
  821. // NavigatorUtils.push(
  822. // context, "${WodeRouter.buyService}?id=${detailObj.id}");
  823. // },
  824. // txt2: "取消",
  825. // onPre2: () {
  826. // NavigatorUtils.goBack(context);
  827. // });
  828. NavigatorUtils.push(
  829. context, "${WodeRouter.buyService}?id=${detailObj.id}");
  830. },
  831. )
  832. : Container(child: null),
  833. OrderConstant.isShow(
  834. detailObj.statuz,
  835. detailObj.dataTable,
  836. 'showUserConfirmPunchButton',
  837. arrivedFlag: detailObj.arrivedFlag)
  838. ? BottomBtn(
  839. title: "确认打卡",
  840. fun: () {
  841. confirmPunchin();
  842. },
  843. )
  844. : Container(child: null),
  845. OrderConstant.isShow(
  846. detailObj.statuz,
  847. detailObj.dataTable,
  848. 'showUserAppealButton')
  849. ? BottomBtn(
  850. title: "提出申诉",
  851. fun: () {
  852. if(detailObj.liftCaseAppealEntity != null){
  853. toasts("当前诊单不能申诉");
  854. }else {
  855. NavigatorUtils.push(context,
  856. "${WodeRouter.representations}?id=${detailObj.id}");
  857. }
  858. },
  859. )
  860. : Container(child: null),
  861. OrderConstant.isShow(
  862. detailObj.statuz,
  863. detailObj.dataTable,
  864. 'showUserConfirmOrderButton')
  865. ? BottomBtn(
  866. title: "立即确认",
  867. fun: () {
  868. showAlert(
  869. context,
  870. "提示",
  871. "确认完成吗?",
  872. "确认",
  873. () {
  874. confirmOrder();
  875. NavigatorUtils.goBack(context);
  876. },
  877. txt2: "取消",
  878. onPre2: () {
  879. NavigatorUtils.goBack(context);
  880. });
  881. },
  882. )
  883. : Container(child: null),
  884. OrderConstant.isShow(
  885. detailObj.statuz,
  886. detailObj.dataTable,
  887. 'showUserEvaluationButton')
  888. ? BottomBtn(
  889. title: "评价",
  890. fun: () {
  891. NavigatorUtils.push(context,
  892. "${WodeRouter.comment}?id=${detailObj.id}");
  893. },
  894. )
  895. : Container(child: null),
  896. OrderConstant.isShow(
  897. detailObj.statuz,
  898. detailObj.dataTable,
  899. 'showUserChooseExpertButton') || (detailObj.chargerId==null && detailObj.isPlatformSpecified == 0)
  900. ? BottomBtn(
  901. title: "选择专家",
  902. fun: () {
  903. setDataId(detailObj.id);
  904. setType(detailObj.dataTable.toString());
  905. NavigatorUtils.push(context, "${BbsRouter.expertList}?id=${detailObj.brandId}");
  906. },
  907. )
  908. : Container(child: null),
  909. ],
  910. ),
  911. ),
  912. ),
  913. ],
  914. );
  915. },
  916. )
  917. : Center(
  918. child: Text("正在加载..."),
  919. ),
  920. ),
  921. );
  922. }
  923. void setDataId (int id)async{
  924. SharedPreferences prefs = await SharedPreferences.getInstance();
  925. prefs.setInt("dataId", id);
  926. }
  927. void setType (String type)async{
  928. SharedPreferences prefs = await SharedPreferences.getInstance();
  929. prefs.setString("questionType", type);
  930. }
  931. @override
  932. bool get wantKeepAlive => true;
  933. }
  934. class BottomBtn extends StatelessWidget {
  935. BottomBtn({Key key, this.title, this.fun}) : super(key: key);
  936. Function fun;
  937. String title;
  938. @override
  939. Widget build(BuildContext context) {
  940. return Container(
  941. margin: EdgeInsets.only(left: 10),
  942. child: GestureDetector(
  943. onTap: () {
  944. fun();
  945. },
  946. child: Container(
  947. child: Container(
  948. // height:22,
  949. padding: EdgeInsets.only(
  950. left: ScreenUtil().setWidth(20),
  951. right: ScreenUtil().setWidth(20)),
  952. decoration: BoxDecoration(
  953. border: Border.all(width: 1, color: Color(0xff1B87F6)),
  954. borderRadius: BorderRadius.circular(ScreenUtil().setWidth(17)),
  955. ),
  956. child: Column(
  957. mainAxisAlignment: MainAxisAlignment.center,
  958. children: <Widget>[
  959. Text(
  960. title,
  961. textAlign: TextAlign.center,
  962. style: TextStyle(
  963. fontSize: ScreenUtil().setSp(15),
  964. color: Color(0xff0288FF),
  965. ),
  966. ),
  967. ],
  968. ),
  969. ),
  970. ),
  971. ),
  972. );
  973. }
  974. }