order_detail.dart 52 KB

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