order_detail.dart 56 KB

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