order_detail.dart 58 KB

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