order_detail.dart 57 KB

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