1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033 |
- import 'package:flutter/cupertino.dart';
- import 'package:flutter/material.dart';
- import 'package:liftmanager/common/common.dart';
- import 'package:liftmanager/internal/account/account_router.dart';
- import 'package:liftmanager/internal/account/model/user_info_entity.dart';
- import 'package:liftmanager/internal/account/provider/user_provider.dart';
- import 'package:liftmanager/internal/wode/wode_router.dart';
- import 'package:liftmanager/net/api_service.dart';
- import 'package:liftmanager/routers/fluro_navigator.dart';
- import 'package:liftmanager/utils/image_utils.dart';
- import 'package:liftmanager/widgets/app_bar.dart';
- import 'package:liftmanager/widgets/click_item.dart';
- import 'package:liftmanager/widgets/load_image.dart';
- import 'package:liftmanager/widgets/my_button.dart';
- import 'package:provider/provider.dart';
- import 'package:liftmanager/widgets/bbs_content.dart';
- import 'package:liftmanager/internal/bbs/bbs_router.dart';
- import 'package:flutter_screenutil/flutter_screenutil.dart';
- import 'package:liftmanager/internal/bbs/model/liftcase_model.dart';
- import 'package:liftmanager/utils/toast.dart';
- import 'package:liftmanager/utils/time_format.dart';
- import 'package:liftmanager/utils/url.dart';
- import 'package:liftmanager/internal/wode/order_const.dart';
- import 'package:shared_preferences/shared_preferences.dart';
- import 'package:video_player/video_player.dart';
- import 'package:chewie/chewie.dart';
- import 'package:liftmanager/utils/utils.dart';
- import 'package:liftmanager/utils/theme_utils.dart';
- import 'package:flutter/services.dart';
- import 'package:orientation/orientation.dart';
- class OrderDetail extends StatefulWidget {
- OrderDetail(this.id);
- final String id;
- @override
- State<StatefulWidget> createState() {
- return OrderDetailState();
- }
- }
- class OrderDetailState extends State<OrderDetail>
- with AutomaticKeepAliveClientMixin {
- UserProvider provider = UserProvider();
- bool _hasData = false;
- LiftCasesDetailModel detailObj;
- double totalPay;
- getBrandDetail() {
- if(_controllerBefore != null){
- _controllerBefore.pause();
- _controllerBefore = null;
- }
- if(_controllerAfter != null){
- _controllerAfter.pause();
- _controllerAfter = null;
- }
- NewApiService().getLiftcaseDetail(widget.id, onSuccess: (res) {
- detailObj = res;
- double serviceCost = detailObj.serviceCost!=null?detailObj.serviceCost:0.0;
- double travelCost = detailObj.travelCost!=null?detailObj.travelCost:0.0;
- double couponDeduction = detailObj.couponDeduction!=null?detailObj.couponDeduction:0.0;
- double redEnvelopeDeduction = detailObj.redEnvelopeDeduction!=null?detailObj.redEnvelopeDeduction:0.0;
- totalPay = (serviceCost + travelCost) - ( couponDeduction + redEnvelopeDeduction);
- print(serviceCost);
- print(travelCost);
- print(couponDeduction);
- print(redEnvelopeDeduction);
- print(totalPay);
- print("456456456465");
- if(totalPay < 0){
- totalPay = 0.0;
- }
- if(detailObj.beforeRepair!=null){
- _controllerBefore = VideoPlayerController.network(
- Utils.getImagePath(detailObj.beforeRepair)
- );
- }
- if(detailObj.afterRepair!=null){
- _controllerAfter = VideoPlayerController.network(
- Utils.getImagePath(detailObj.afterRepair)
- );
- }
-
- print(totalPay);
- print("totalPay-------------------------");
- _hasData = true;
- setState(() {});
- }, onError: (code, msg) {
- toasts(msg);
- });
- }
- getPayCost(){
- bool isPay = true;
- if((detailObj.dataTable == 1 && detailObj.statuz == 0) || (detailObj.dataTable == 2 && detailObj.statuz == 2)){
- isPay = false;
- }
- return isPay;
- }
- List<Widget> btnWidget = [];
- VideoPlayerController _controllerBefore;
- VideoPlayerController _controllerAfter;
- @override
- void initState() {
- if(this.mounted){
- getBrandDetail();
- }
-
-
- super.initState();
- }
- @override
- void dispose() {
- if(detailObj.beforeRepair!=null){
- _controllerBefore.pause();
- _controllerBefore.dispose();
- }
- if(detailObj.afterRepair!=null){
- _controllerAfter.pause();
- _controllerAfter.dispose();
- }
- // SystemChrome.setPreferredOrientations([
- // DeviceOrientation.portraitUp,
- // ]);
- OrientationPlugin.forceOrientation(DeviceOrientation.portraitUp);
- // provider.dispose();
- super.dispose();
- }
- // 用户确认订单
- void confirmOrder() {
- showLoading(context);
- NewApiService().userConfirmOrder(widget.id, onSuccess: (res) {
- dismissLoading(context);
- toasts("订单确认成功");
- getBrandDetail();
- setState(() {});
- }, onError: (code, msg) {
- dismissLoading(context);
- toasts(msg);
- });
- }
- // 用户确认打卡
- void confirmPunchin() {
- showLoading(context);
- NewApiService().userToClock(widget.id, onSuccess: (res) {
- dismissLoading(context);
- toasts("确认打卡成功");
- getBrandDetail();
- setState(() {});
- }, onError: (code, msg) {
- dismissLoading(context);
- toasts(msg);
- });
- }
- // 付款
- void payment() {
- showLoading(context);
- NewApiService().getTestAlipayNotify(detailObj.orderNo, onSuccess: (res) {
- dismissLoading(context);
- toasts("付款成功");
- getBrandDetail();
- setState(() {});
- }, onError: (code, msg) {
- dismissLoading(context);
- toasts(msg);
- });
- }
- getHeight(detailObj){
- bool isHeight = false;
- if((OrderConstant.isShow(detailObj.statuz,detailObj.dataTable,'showUserPaymentButton') && detailObj.chargerId!=null)||
- (OrderConstant.isShow(detailObj.statuz,detailObj.dataTable,'showUserConfirmPunchButton',arrivedFlag: detailObj.arrivedFlag))||
- (OrderConstant.isShow(detailObj.statuz,detailObj.dataTable,'showUserAppealButton'))||
- (OrderConstant.isShow(detailObj.statuz,detailObj.dataTable,'showUserConfirmOrderButton'))||
- (OrderConstant.isShow(detailObj.statuz,detailObj.dataTable,'showUserEvaluationButton'))||
- (OrderConstant.isShow(detailObj.statuz,detailObj.dataTable,'showUserChooseExpertButton') || (detailObj.chargerId==null && detailObj.isPlatformSpecified == 0))
- ){
- isHeight = true;
- }
- return isHeight;
- }
- @override
- Widget build(BuildContext context) {
- double width = MediaQuery.of(context).size.width;
- double height = MediaQuery.of(context).size.height;
- if(width > height){
- // SystemChrome.setPreferredOrientations([
- // DeviceOrientation.portraitUp,
- // ]);
- OrientationPlugin.forceOrientation(DeviceOrientation.portraitUp);
- }
- return
- // Center(child:new Text("个人中心"));
- ChangeNotifierProvider<UserProvider>(
- create: (_) => provider,
- child: Scaffold(
- appBar: MyAppBar(
- centerTitle: "订单详情",
- ),
- body: _hasData
- ? Consumer<UserProvider>(
- builder: (_, provider, __) {
- return Stack(
- children: <Widget>[
- ListView(
- padding: EdgeInsets.all(0.0),
- children: <Widget>[
- Container(
- decoration: BoxDecoration(
- gradient: const LinearGradient(
- colors: [Color(0xFF00D9FF), Color(0xFF0287FF)],
- ),
- ),
- padding: EdgeInsets.only(
- top: ScreenUtil().setWidth(10),
- left: ScreenUtil().setWidth(30)),
- height: ScreenUtil().setWidth(70),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: <Widget>[
- Text(
- OrderConstant.getStatusName(
- detailObj.statuz, detailObj.dataTable,
- arrivedFlag: detailObj.arrivedFlag,
- userType: 'USER'),
- textAlign: TextAlign.left,
- style: TextStyle(
- fontSize: ScreenUtil().setSp(17),
- color: Color(0xffffffff),
- ),
- ),
- // detailObj.statuz == 6
- // ? Text(
- // '还剩23小时59分钟自动确认',
- // textAlign: TextAlign.left,
- // style: TextStyle(
- // fontSize: ScreenUtil().setSp(13),
- // color: Color(0xffeeeeee),
- // ),
- // )
- // : Container(
- // child: null,
- // ),
- ],
- ),
- ),
- Container(
- // height: 20,
- padding: EdgeInsets.only(
- bottom: ScreenUtil().setWidth(20),
- top: ScreenUtil().setWidth(10)),
- child: Row(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: <Widget>[
- Expanded(
- child: GestureDetector(
- onTap: () {
- NavigatorUtils.push(context, "${BbsRouter.recommendAsk}?id=${detailObj.id}&type=3");
- },
- child: Row(
- crossAxisAlignment:
- CrossAxisAlignment.start,
- children: <Widget>[
- Container(
- margin: EdgeInsets.only(
- left: ScreenUtil().setWidth(15),
- right: ScreenUtil().setWidth(10),
- top: ScreenUtil().setWidth(5)),
- decoration: BoxDecoration(
- borderRadius: BorderRadius.circular(
- ScreenUtil().setWidth(22)),
- ),
- child: LoadNetworkImage(
- detailObj.avatarUrl,
- width: ScreenUtil().setWidth(43),
- height: ScreenUtil().setWidth(43),
- // alignment: Alignment.centerLeft,
- ),
- ),
- Expanded(
- child: Container(
- padding: EdgeInsets.only(
- right:
- ScreenUtil().setWidth(15)),
- child: Column(
- children: <Widget>[
- Container(
- child: Row(
- mainAxisAlignment:
- MainAxisAlignment.start,
- children: <Widget>[
- Row(
- crossAxisAlignment:
- CrossAxisAlignment
- .center,
- children: <Widget>[
- Text(
- detailObj.name ??
- '',
- style: TextStyle(
-
- fontSize:
- ScreenUtil()
- .setSp(
- 17),
- ),
- textAlign:
- TextAlign.start,
- ),
- Container(
- padding:
- EdgeInsets.only(
- left: 5),
- child: Text(
- detailObj.dataTable ==
- 1
- ? '问诊服务'
- : '出诊服务',
- style: TextStyle(
- color: Color(
- 0xff0288FF),
- fontSize:
- ScreenUtil()
- .setSp(
- 13),
- ),
- textAlign:
- TextAlign
- .start,
- ),
- ),
- ],
- ),
- ],
- ),
- ),
- Container(
- child: Row(
- mainAxisAlignment:
- MainAxisAlignment.start,
- children: <Widget>[
- Row(
- crossAxisAlignment:
- CrossAxisAlignment
- .center,
- children: <Widget>[
- Text(
- detailObj.createTime !=
- null
- ? DateUtils
- .instance
- .getFormartData(
- timeSamp:
- detailObj
- .createTime,
- format:
- "MM月dd日",
- )
- : '',
- style: TextStyle(
- color: Color(
- 0xff999999),
- fontSize:
- ScreenUtil()
- .setSp(
- 13),
- ),
- textAlign:
- TextAlign.left,
- ),
- Container(
- padding:
- EdgeInsets.only(
- left: 5),
- child: Text(
- detailObj
- .brandName ??
- '',
- style: TextStyle(
- color: Color(
- 0xff999999),
- fontSize:
- ScreenUtil()
- .setSp(
- 13),
- ),
- textAlign:
- TextAlign
- .left,
- ),
- )
- ],
- ),
- ],
- ),
- ),
- Row(
- mainAxisAlignment:
- MainAxisAlignment.start,
- children: <Widget>[
- Container(
- width: 260,
- child: Text(
- detailObj.expression ??
- '',
- style: TextStyle(
- color:
- Color(0xff0288FF),
- fontSize: ScreenUtil()
- .setSp(15),
- ),
- textAlign:
- TextAlign.left,
- maxLines: 1,
- overflow: TextOverflow
- .ellipsis,
- ),
- ),
- ],
- ),
- ],
- ),
- ),
- )
- ],
- ),
- ),
- ),
- ],
- ),
- ),
- Container(
- color: ThemeUtils.getDialogTextFieldColor(context),
- height: ScreenUtil().setWidth(5),
- ),
- detailObj.dataTable == 2
- ? Heng(
- left: "差旅费",
- right: detailObj.travelCost != null
- ? "¥" + detailObj.travelCost.toString()
- : '¥0',
- leftColor: 0xff666666,
- rightColor: 0xff666666,
- )
- : Container(),
- Heng(
- left: "技术服务费",
- right: detailObj.serviceCost != null
- ? "¥" + detailObj.serviceCost.toString()
- : '¥0',
- leftColor: 0xff666666,
- rightColor: 0xff666666,
- ),
- Heng(
- left: "优惠券抵扣",
- right: detailObj.couponDeduction != null
- ? "-¥" + detailObj.couponDeduction.toString()
- : '-¥0',
- leftColor: 0xff666666,
- rightColor: 0xff666666,
- ),
- Heng(
- left: "红包抵扣",
- right: detailObj.redEnvelopeDeduction != null
- ? "-¥" +
- detailObj.redEnvelopeDeduction.toString()
- : '-¥0',
- leftColor: 0xff666666,
- rightColor: 0xff666666,
- ),
- Heng(
- left: "实付款",
- right: detailObj.payCost != null && getPayCost()
- ? "¥" + detailObj.payCost.toString()
- : '¥' + totalPay.toStringAsFixed(2).toString(),
- leftColor: 0xff666666,
- rightColor: 0xffFD0808,
- ),
- Container(
- color: ThemeUtils.getDialogTextFieldColor(context),
- height: ScreenUtil().setWidth(5),
- ),
- Container(
- padding: EdgeInsets.only(
- left: ScreenUtil().setWidth(15),
- top: ScreenUtil().setWidth(10),
- bottom: ScreenUtil().setWidth(10),
- ),
- decoration: BoxDecoration(
- border: Border(
- bottom: BorderSide(
- width: .5,
- color:
- Color(0xffFAF7FA),
- ),
- ),
- ),
- child: Text(
- '订单信息',
- textAlign: TextAlign.left,
- style: TextStyle(
- fontSize: ScreenUtil().setSp(17),
- ),
- ),
- ),
- Container(
- padding: EdgeInsets.only(
- left: ScreenUtil().setWidth(15),
- top: ScreenUtil().setWidth(10),
- bottom: ScreenUtil().setWidth(10)),
- child: Column(
- children: <Widget>[
- Row(
- children: <Widget>[
- Text(
- '订单编号:',
- textAlign: TextAlign.left,
- style: TextStyle(
- fontSize: ScreenUtil().setSp(13),
- color: Color(0xff666666),
- ),
- ),
- Text(
- detailObj.orderNo ?? '',
- textAlign: TextAlign.left,
- style: TextStyle(
- fontSize: ScreenUtil().setSp(13),
- color: Color(0xff666666),
- ),
- ),
- ],
- ),
- Row(
- children: <Widget>[
- Text(
- '创建时间:',
- textAlign: TextAlign.left,
- style: TextStyle(
- fontSize: ScreenUtil().setSp(13),
- color: Color(0xff666666),
- ),
- ),
- Text(
- detailObj.createTime != null
- ? DateUtils.instance.getFormartData(
- timeSamp: detailObj.createTime,
- format: "yyyy-MM-dd HH:mm:ss")
- : '',
- textAlign: TextAlign.left,
- style: TextStyle(
- fontSize: ScreenUtil().setSp(13),
- color: Color(0xff666666),
- ),
- ),
- ],
- ),
- detailObj.liftCaseAppealEntity!=null? Row(
- children: <Widget>[
- Text(
- '驳回原因:',
- textAlign: TextAlign.left,
- style: TextStyle(
- fontSize: ScreenUtil().setSp(13),
- color: Color(0xff666666),
- ),
- ),
-
- Container(
- width: width*0.75,
- child: Text(
- detailObj.liftCaseAppealEntity?.cancelSeason??"",
- textAlign: TextAlign.left,
- style: TextStyle(
- fontSize: ScreenUtil().setSp(13),
- color: Color(0xff666666),
- ),
- ),
- )
- ],
- ):Container(child: null,),
- ],
- ),
- ),
- detailObj.dataTable==2? Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: <Widget>[
- Container(
- width: width,
- padding: EdgeInsets.only(left:ScreenUtil().setWidth(15),top:ScreenUtil().setWidth(10),bottom:ScreenUtil().setWidth(10)),
- decoration: BoxDecoration(
- border: Border(
- bottom: BorderSide(width: .5, color:Color(0xfff5f5f5)),
- ),
- ),
- child: Text(
- '现场情况(维修前)',
- textAlign: TextAlign.left,
- style: TextStyle(
- fontSize:ScreenUtil().setSp(17),
- color:Color(0xff333333),
- ),
- ),
- ),
- detailObj.beforeRepair!=null?Container(
- padding: EdgeInsets.only(
- left: ScreenUtil().setWidth(15),
- right: ScreenUtil().setWidth(15),
- top: ScreenUtil().setWidth(15)),
- child: ClipRRect(
- borderRadius: BorderRadius.circular(5),
- child: new Chewie(
- controller: ChewieController(
- videoPlayerController:
- // VideoPlayerController.network(
- // Utils.getImagePath(detailObj.beforeRepair)
- // // imgFontUrl + detailObj.url
- // )
- _controllerBefore,
- aspectRatio: 3 / 2,
- autoPlay: false,
- looping: true,
- showControls: true,
- deviceOrientationsAfterFullScreen:[DeviceOrientation.portraitUp,],
- // 占位图
- // placeholder: Image.network(
- // imgFontUrl+detailObj.cover,
- // fit: BoxFit.contain,
- // ),
- // 是否在 UI 构建的时候就加载视频
- autoInitialize: true,
- // 拖动条样式颜色
- materialProgressColors:
- new ChewieProgressColors(
- playedColor: Colors.red,
- handleColor: Colors.blue,
- backgroundColor: Colors.grey,
- bufferedColor: Colors.lightGreen,
- ),
- ),
- ),
- )):Container(
- padding: EdgeInsets.only(left:15),
- child: Text("暂无"),
- ),
- Container(
- width: width,
- padding: EdgeInsets.only(left:ScreenUtil().setWidth(15),top:ScreenUtil().setWidth(10),bottom:ScreenUtil().setWidth(10)),
- decoration: BoxDecoration(
- border: Border(
- bottom: BorderSide(width: .5, color:Color(0xfff5f5f5)),
- ),
- ),
- child: Text(
- '现场情况(维修后)',
- textAlign: TextAlign.left,
- style: TextStyle(
- fontSize:ScreenUtil().setSp(17),
- color:Color(0xff333333),
- ),
- ),
- ),
- detailObj.afterRepair!=null? Container(
- padding: EdgeInsets.only(
- left: ScreenUtil().setWidth(15),
- right: ScreenUtil().setWidth(15),
- top: ScreenUtil().setWidth(15)),
- child: ClipRRect(
- borderRadius: BorderRadius.circular(5),
- child: new Chewie(
- controller: ChewieController(
- videoPlayerController:
- // VideoPlayerController.network(
- // Utils.getImagePath(detailObj.afterRepair)
- // // imgFontUrl + detailObj.url
- // )
- _controllerAfter,
- aspectRatio: 3 / 2,
- autoPlay: false,
- looping: true,
- showControls: true,
- deviceOrientationsAfterFullScreen:[DeviceOrientation.portraitUp,],
- // 占位图
- // placeholder: Image.network(
- // imgFontUrl+detailObj.cover,
- // fit: BoxFit.contain,
- // ),
- // 是否在 UI 构建的时候就加载视频
- autoInitialize: true,
- // 拖动条样式颜色
- materialProgressColors:
- new ChewieProgressColors(
- playedColor: Colors.red,
- handleColor: Colors.blue,
- backgroundColor: Colors.grey,
- bufferedColor: Colors.lightGreen,
- ),
- ),
- ),
- )):Container(
- padding: EdgeInsets.only(left:15),
- child: Text("暂无"),
- ),
- ],
- ):Container(child: null,),
-
-
- OrderConstant.isShow(
- detailObj.statuz,
- detailObj.dataTable,
- 'showUserAppealInfo') ==
- false
- ? SizedBox(height: 80)
- : Container(child: null),
- OrderConstant.isShow(detailObj.statuz,
- detailObj.dataTable, 'showUserAppealInfo')
- ? Container(
- padding: EdgeInsets.only(
- left: ScreenUtil().setWidth(15),
- top: ScreenUtil().setWidth(10),
- bottom: ScreenUtil().setWidth(10)),
- decoration: BoxDecoration(
- border: Border(
- bottom: BorderSide(
- width: .5, color: Color(0xfff5f5f5)),
- ),
- ),
- child: Text(
- '申诉信息',
- textAlign: TextAlign.left,
- style: TextStyle(
- fontSize: ScreenUtil().setSp(17),
- ),
- ),
- )
- : Container(child: null),
- OrderConstant.isShow(detailObj.statuz,
- detailObj.dataTable, 'showUserAppealInfo')
- ? Container(
- padding: EdgeInsets.only(
- left: ScreenUtil().setWidth(15),
- top: ScreenUtil().setWidth(10),
- bottom: ScreenUtil().setWidth(10)),
- child: Column(
- children: <Widget>[
- Row(
- children: <Widget>[
- Text(
- '申诉内容:',
- textAlign: TextAlign.left,
- style: TextStyle(
- fontSize: ScreenUtil().setSp(12),
- color: Color(0xff666666),
- ),
- ),
- Text(
- detailObj.liftCaseAppealEntity !=
- null &&
- detailObj
- .liftCaseAppealEntity
- .content !=
- null
- ? detailObj.liftCaseAppealEntity
- .content
- : '',
- textAlign: TextAlign.left,
- style: TextStyle(
- fontSize: ScreenUtil().setSp(12),
- color: Color(0xff666666),
- ),
- ),
- ],
- ),
- Row(
- children: <Widget>[
- Text(
- '申诉时间:',
- textAlign: TextAlign.left,
- style: TextStyle(
- fontSize: ScreenUtil().setSp(12),
- color: Color(0xff666666),
- ),
- ),
- Text(
- detailObj.liftCaseAppealEntity !=
- null &&
- detailObj
- .liftCaseAppealEntity
- .createTime !=
- null
- ? DateUtils.instance.getFormartData(
- timeSamp: detailObj
- .liftCaseAppealEntity
- .createTime,
- format:
- "yyyy-MM-dd HH:mm:ss")
- : '',
- textAlign: TextAlign.left,
- style: TextStyle(
- fontSize: ScreenUtil().setSp(12),
- color: Color(0xff666666),
- ),
- ),
- ],
- ),
- ],
- ),
- )
- : Container(child: null),
- SizedBox(
- height: 70,
- )
- ],
- ),
- Positioned(
- bottom: 0,
- left: 0,
- child: Container(
- width: width,
- height:
- !getHeight(detailObj)?0:
- 60,
- padding: EdgeInsets.only(
- right: ScreenUtil().setWidth(15),
- left: ScreenUtil().setWidth(15),
- top: ScreenUtil().setWidth(12),
- bottom: ScreenUtil().setWidth(12),
- ),
- decoration: BoxDecoration(
- border: Border(
- top: BorderSide(
- width: 0.5,
- color: Color(0xffeeeeee),
- ),
- ),
- color: ThemeUtils.getDialogTextFieldColor(context),
- ),
- child: Row(
- mainAxisAlignment: MainAxisAlignment.end,
- crossAxisAlignment: CrossAxisAlignment.center,
- // children: btnWidget,
- children: <Widget>[
- OrderConstant.isShow(
- detailObj.statuz,
- detailObj.dataTable,
- 'showUserPaymentButton') && detailObj.chargerId!=null
- ? BottomBtn(
- title: "立即付款",
- fun: () {
- // showAlert(
- // context,
- // "提示",
- // "确认付款吗?",
- // "确认",
- // () {
- // // payment();
- // // NavigatorUtils.goBack(context);
- // NavigatorUtils.push(
- // context, "${WodeRouter.buyService}?id=${detailObj.id}");
- // },
- // txt2: "取消",
- // onPre2: () {
- // NavigatorUtils.goBack(context);
- // });
- NavigatorUtils.push(
- context, "${WodeRouter.buyService}?id=${detailObj.id}");
- },
- )
- : Container(child: null),
- OrderConstant.isShow(
- detailObj.statuz,
- detailObj.dataTable,
- 'showUserConfirmPunchButton',
- arrivedFlag: detailObj.arrivedFlag)
- ? BottomBtn(
- title: "确认打卡",
- fun: () {
- confirmPunchin();
- },
- )
- : Container(child: null),
- OrderConstant.isShow(
- detailObj.statuz,
- detailObj.dataTable,
- 'showUserAppealButton')
- ? BottomBtn(
- title: "提出申诉",
- fun: () {
- if(detailObj.liftCaseAppealEntity != null){
- toasts("当前诊单不能申诉");
- }else {
- NavigatorUtils.push(context,
- "${WodeRouter.representations}?id=${detailObj.id}");
- }
-
- },
- )
- : Container(child: null),
- OrderConstant.isShow(
- detailObj.statuz,
- detailObj.dataTable,
- 'showUserConfirmOrderButton')
- ? BottomBtn(
- title: "立即确认",
- fun: () {
- showAlert(
- context,
- "提示",
- "确认完成吗?",
- "确认",
- () {
- confirmOrder();
- NavigatorUtils.goBack(context);
- },
- txt2: "取消",
- onPre2: () {
- NavigatorUtils.goBack(context);
- });
- },
- )
- : Container(child: null),
- OrderConstant.isShow(
- detailObj.statuz,
- detailObj.dataTable,
- 'showUserEvaluationButton')
- ? BottomBtn(
- title: "评价",
- fun: () {
- NavigatorUtils.push(context,
- "${WodeRouter.comment}?id=${detailObj.id}");
- },
- )
- : Container(child: null),
- OrderConstant.isShow(
- detailObj.statuz,
- detailObj.dataTable,
- 'showUserChooseExpertButton') || (detailObj.chargerId==null && detailObj.isPlatformSpecified == 0)
- ? BottomBtn(
- title: "选择专家",
- fun: () {
- setDataId(detailObj.id);
- setType(detailObj.dataTable.toString());
- NavigatorUtils.push(context, "${BbsRouter.expertList}?id=${detailObj.brandId}");
- },
- )
- : Container(child: null),
-
- ],
- ),
- ),
- ),
- ],
- );
- },
- )
- : Center(
- child: Text("正在加载..."),
- ),
- ),
- );
- }
- void setDataId (int id)async{
- SharedPreferences prefs = await SharedPreferences.getInstance();
- prefs.setInt("dataId", id);
-
- }
- void setType (String type)async{
- SharedPreferences prefs = await SharedPreferences.getInstance();
- prefs.setString("questionType", type);
-
- }
- @override
- bool get wantKeepAlive => true;
- }
- class BottomBtn extends StatelessWidget {
- BottomBtn({Key key, this.title, this.fun}) : super(key: key);
- Function fun;
- String title;
- @override
- Widget build(BuildContext context) {
- return Container(
- margin: EdgeInsets.only(left: 10),
- child: GestureDetector(
- onTap: () {
- fun();
- },
- child: Container(
- child: Container(
- // height:22,
- padding: EdgeInsets.only(
- left: ScreenUtil().setWidth(20),
- right: ScreenUtil().setWidth(20)),
- decoration: BoxDecoration(
- border: Border.all(width: 1, color: Color(0xff1B87F6)),
- borderRadius: BorderRadius.circular(ScreenUtil().setWidth(17)),
- ),
- child: Column(
- mainAxisAlignment: MainAxisAlignment.center,
- children: <Widget>[
- Text(
- title,
- textAlign: TextAlign.center,
- style: TextStyle(
- fontSize: ScreenUtil().setSp(15),
- color: Color(0xff0288FF),
- ),
- ),
- ],
- ),
- ),
- ),
- ),
- );
- }
- }
|