123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407 |
- import 'package:chewie/chewie.dart';
- import 'package:flutter/cupertino.dart';
- import 'package:flutter/material.dart';
- import 'package:flutter/services.dart';
- import 'package:flutter_screenutil/flutter_screenutil.dart';
- import 'package:liftmanager/internal/account/provider/user_provider.dart';
- import 'package:liftmanager/internal/bbs/bbs_router.dart';
- import 'package:liftmanager/internal/bbs/model/liftcase_model.dart';
- import 'package:liftmanager/internal/wode/order_const.dart';
- import 'package:liftmanager/internal/wode/wode_router.dart';
- import 'package:liftmanager/net/api_service.dart';
- import 'package:liftmanager/res/colors.dart';
- import 'package:liftmanager/routers/fluro_navigator.dart';
- import 'package:liftmanager/utils/theme_utils.dart';
- import 'package:liftmanager/utils/time_format.dart';
- import 'package:liftmanager/utils/toast.dart';
- import 'package:liftmanager/utils/utils.dart';
- import 'package:liftmanager/widgets/app_bar.dart';
- import 'package:liftmanager/widgets/bbs_content.dart';
- import 'package:liftmanager/widgets/load_image.dart';
- import 'package:oktoast/oktoast.dart';
- import 'package:orientation/orientation.dart';
- import 'package:provider/provider.dart';
- import 'package:shared_preferences/shared_preferences.dart';
- import 'package:umeng_common_sdk/umeng_common_sdk.dart';
- import 'package:video_player/video_player.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() {
- 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 (_controllerBefore == null && detailObj.beforeRepair != null) {
- _controllerBefore?.pause();
- _controllerBefore?.dispose();
- _controllerBefore = VideoPlayerController.network(
- Utils.getImagePath(detailObj.beforeRepair));
- }
- if (_controllerAfter == null && detailObj.afterRepair != null) {
- _controllerAfter?.pause();
- _controllerAfter?.dispose();
- _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() {
- UmengCommonSdk.onPageStart("订单详情");
- if (this.mounted) {
- getBrandDetail();
- }
- super.initState();
- }
- @override
- void dispose() {
- UmengCommonSdk.onPageEnd("订单详情");
- 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 deleteOrder() {
- showLoading(context);
- NewApiService().deleteOrder(widget.id, onSuccess: (res) {
- dismissLoading(context);
- toasts("订单删除成功");
- Navigator.pop(context);
- setState(() {});
- }, onError: (code, msg) {
- dismissLoading(context);
- toasts(msg);
- });
- }
- // 用户取消订单
- void cancelOrder() {
- showLoading(context);
- NewApiService().cancelOrder(widget.id, onSuccess: (res) {
- dismissLoading(context);
- toasts("订单取消成功");
- Navigator.pop(context);
- 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)) ||
- (OrderConstant.isShow(detailObj.statuz, detailObj.dataTable,
- 'showUserCancelOrderButton'))) {
- 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 SafeArea(
- child: Stack(
- children: <Widget>[
- ListView(
- padding: EdgeInsets.all(0.0),
- children: <Widget>[
- // OrderListItemWidget(detailObj),
- _orderTypeHead(),
- _lineSpase(),
- _orderUserDetail(),
- isShowMoneyDetail() ? _lineSpase() : Container(),
- isShowMoneyDetail()
- ? _orderMoneyDetail()
- : Container(),
- _lineSpase(),
- _orderTime(),
- _lineSpase(),
- detailObj.liftCaseAppealEntity != null
- ? 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),
- ),
- ),
- 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,
- ),
- isShowOrderLive() ? _orderLiveVideo() : Container(),
- OrderConstant.isShow(detailObj.statuz,
- detailObj.dataTable, 'showUserAppealInfo')
- ? _orderSSInfo()
- : 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: 7.5,
- bottom: 7.5,
- ),
- 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,
- 'showUserCancelOrderButton')
- ? BottomBtn(
- title: "取消订单",
- isBlueBtn: false,
- fun: () {
- showAlert(
- context,
- "提示",
- "确认取消吗?",
- "确认",
- () {
- cancelOrder();
- NavigatorUtils.goBack(context);
- },
- txt2: "取消",
- onPre2: () {
- NavigatorUtils.goBack(context);
- });
- },
- )
- : Container(child: null),
- OrderConstant.isShow(
- detailObj.statuz,
- detailObj.dataTable,
- 'showUserPaymentButton') &&
- detailObj.chargerId != null
- ? BottomBtn(
- title: "立即付款",
- fun: () {
- if (_controllerBefore != null) {
- _controllerBefore?.pause();
- }
- if (_controllerAfter != null) {
- _controllerAfter?.pause();
- }
- UmengCommonSdk.onEvent(
- detailObj.dataTable == 1
- ? 'ym_wenzhen_onClickPay'
- : 'ym_chuzhen_onClickPay',
- {},
- );
- 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: "提出申诉",
- isBlueBtn: false,
- fun: () {
- if (detailObj.liftCaseAppealEntity !=
- null) {
- toasts("当前诊单不能申诉");
- } else {
- if (_controllerBefore != null) {
- _controllerBefore?.pause();
- }
- if (_controllerAfter != null) {
- _controllerAfter?.pause();
- }
- NavigatorUtils.push(context,
- "${WodeRouter.representations}?id=${detailObj.id}");
- }
- },
- )
- : Container(child: null),
- OrderConstant.isShow(
- detailObj.statuz,
- detailObj.dataTable,
- 'showUserConfirmOrderButton')
- ? BottomBtn(
- title: "立即确认",
- fun: () {
- showAlert(
- context,
- "提示",
- "确认完成吗?",
- "确认",
- () {
- NavigatorUtils.goBack(context);
- confirmOrder();
- },
- txt2: "取消",
- onPre2: () {
- NavigatorUtils.goBack(context);
- });
- },
- )
- : Container(child: null),
- OrderConstant.isShow(
- detailObj.statuz,
- detailObj.dataTable,
- 'showUserEvaluationButton')
- ? BottomBtn(
- title: "立即评价",
- fun: () {
- if (_controllerBefore != null) {
- _controllerBefore?.pause();
- }
- if (_controllerAfter != null) {
- _controllerAfter?.pause();
- }
- NavigatorUtils.push(context,
- "${WodeRouter.comment}?id=${detailObj.id}");
- },
- )
- : Container(child: null),
- OrderConstant.isShow(
- detailObj.statuz,
- detailObj.dataTable,
- 'showUserDeleteOrderButton')
- ? BottomBtn(
- title: "删除订单",
- isBlueBtn: false,
- fun: () {
- showAlert(
- context,
- "提示",
- "确认删除吗?",
- "确认",
- () {
- deleteOrder();
- NavigatorUtils.goBack(context);
- },
- txt2: "取消",
- onPre2: () {
- NavigatorUtils.goBack(context);
- });
- },
- )
- : 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());
- if (_controllerBefore != null) {
- _controllerBefore?.pause();
- }
- if (_controllerAfter != null) {
- _controllerAfter?.pause();
- }
- NavigatorUtils.push(context,
- "${BbsRouter.expertList}?id=${detailObj.brandId}");
- },
- )
- : Container(child: null),
- ],
- ),
- ),
- ),
- ],
- ));
- },
- )
- : Center(
- child: Text("正在加载..."),
- ),
- ),
- );
- }
- _lineSpase() {
- return Container(
- color: ThemeUtils.getDialogTextFieldColor(context),
- height: ScreenUtil().setWidth(5),
- );
- }
- _orderTypeHead() {
- return Container(
- // decoration: BoxDecoration(
- // gradient: const LinearGradient(
- // colors: [Color(0xFF00D9FF), Color(0xFF0287FF)],
- // ),
- // ),
- padding: EdgeInsets.only(
- top: ScreenUtil().setWidth(10), left: ScreenUtil().setWidth(10)),
- height: ScreenUtil().setWidth(90),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: <Widget>[
- Row(
- // crossAxisAlignment: CrossAxisAlignment.start,
- // mainAxisAlignment: MainAxisAlignment.center,
- children: [
- Icon(
- // : 0xe604,
- OrderConstant.getIconFontCode(
- detailObj.statuz, detailObj.dataTable),
- size: 20.0,
- color: Color(0xff333333),
- ),
- SizedBox(
- width: 5,
- ),
- Text(
- OrderConstant.getStatusName(
- detailObj.statuz, detailObj.dataTable,
- arrivedFlag: detailObj.arrivedFlag, userType: 'USER'),
- textAlign: TextAlign.left,
- style: TextStyle(
- fontSize: ScreenUtil().setSp(14),
- color: Colours.text,
- ),
- ),
- Expanded(child: Container()),
- Text(
- '订单号:',
- textAlign: TextAlign.left,
- style: TextStyle(
- fontSize: ScreenUtil().setSp(14),
- color: Colours.text,
- ),
- ),
- Text(
- '${detailObj.orderNo ?? '无'}',
- textAlign: TextAlign.left,
- style: TextStyle(
- fontSize: ScreenUtil().setSp(14),
- color: Colours.text_gray,
- ),
- ),
- //
- SizedBox(
- width: 10,
- )
- ],
- ),
- Container(
- margin: EdgeInsets.only(left: 25, top: 10),
- child: Text(
- // '',
- OrderConstant.getdetailStatusName(
- detailObj.statuz, detailObj.dataTable,
- arrivedFlag: detailObj.arrivedFlag, userType: 'USER'),
- textAlign: TextAlign.left,
- style: TextStyle(
- fontSize: ScreenUtil().setSp(13),
- color: Colours.dark_text_gray,
- ),
- ),
- )
- // detailObj.statuz == 6
- // ? Text(
- // '还剩23小时59分钟自动确认',
- // textAlign: TextAlign.left,
- // style: TextStyle(
- // fontSize: ScreenUtil().setSp(13),
- // color: Color(0xffeeeeee),
- // ),
- // )
- // : Container(
- // child: null,
- // ),
- ],
- ),
- );
- }
- _orderUserDetail() {
- return 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: () {
- if (_controllerBefore != null) {
- _controllerBefore.pause();
- }
- if (_controllerAfter != null) {
- _controllerAfter.pause();
- }
- NavigatorUtils.push(context,
- "${BbsRouter.recommendAsk}?id=${detailObj.id}&type=3");
- },
- child: Row(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: <Widget>[
- SizedBox(
- width: 10,
- ),
- ClipRRect(
- borderRadius: BorderRadius.circular(20),
- child: LoadNetworkImage(
- detailObj.avatarUrl,
- width: ScreenUtil().setWidth(43),
- height: ScreenUtil().setWidth(43),
- // alignment: Alignment.centerLeft,
- ),
- // 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,
- // ),
- // ),
- ),
- SizedBox(
- width: 10,
- ),
- 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(
- decoration: BoxDecoration(
- //背景
- color: detailObj.dataTable == 1
- ? Colours.blue_app_main
- : Color(0xffFDAF2C),
- //设置四周圆角 角度
- borderRadius: BorderRadius.all(
- Radius.circular(4.0)),
- ),
- margin: EdgeInsets.only(left: 5),
- padding: EdgeInsets.only(
- left: 5, right: 5, top: 2, bottom: 2),
- child: Text(
- detailObj.dataTable == 1
- ? '问诊服务'
- : '出诊服务',
- style: TextStyle(
- color: Colors.white,
- fontSize: ScreenUtil().setSp(14),
- ),
- textAlign: TextAlign.start,
- ),
- ),
- ],
- ),
- ],
- ),
- ),
- Container(
- child: Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- 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.start,
- ),
- Container(
- padding: EdgeInsets.only(left: 5),
- child: Text(
- detailObj.brandName ?? '',
- style: TextStyle(
- color: Colours.blue_app_main,
- fontSize: ScreenUtil().setSp(13),
- ),
- textAlign: TextAlign.start,
- ),
- )
- ],
- ),
- ],
- ),
- ),
- detailObj.dataTable != 1
- ? Container(
- child: Row(
- mainAxisAlignment:
- MainAxisAlignment.spaceBetween,
- children: <Widget>[
- Row(
- crossAxisAlignment:
- CrossAxisAlignment.start,
- children: <Widget>[
- Container(
- // padding: EdgeInsets.only(left: 5),
- child: Text(
- '出诊时间:',
- style: TextStyle(
- color: Color(0xff999999),
- fontSize:
- ScreenUtil().setSp(13),
- ),
- textAlign: TextAlign.start,
- ),
- ),
- Text(
- detailObj.arrivedTime != null
- ? DateUtils.instance
- .getFormartData(
- timeSamp: detailObj
- .arrivedTime,
- format: "MM月dd日 HH:mm")
- : '',
- style: TextStyle(
- color: Color(0xff666666),
- fontSize: ScreenUtil().setSp(13),
- ),
- textAlign: TextAlign.start,
- ),
- ],
- ),
- ],
- ),
- )
- : Container(),
- detailObj.dataTable != 1
- ? Container(
- // margin: EdgeInsets.only(top: 6),
- child: Row(
- children: <Widget>[
- Container(
- // padding: EdgeInsets.only(left: 5),
- child: Text(
- '出诊地点:',
- style: TextStyle(
- color: Color(0xff999999),
- fontSize: ScreenUtil().setSp(13),
- ),
- textAlign: TextAlign.start,
- ),
- ),
- Container(
- width: ScreenUtil().setWidth(230),
- child: Text(
- '${detailObj.address ?? ''}',
- style: TextStyle(
- color: Color(0xff666666),
- fontSize: ScreenUtil().setSp(13),
- // color: Color(0xff666666),
- // fontSize: ScreenUtil().setSp(15),
- ),
- textAlign: TextAlign.start,
- maxLines: 1,
- overflow: TextOverflow.ellipsis,
- ),
- ),
- ],
- ),
- )
- : Container(),
- Container(
- // margin: EdgeInsets.only(top: 6),
- child: Row(
- children: <Widget>[
- Container(
- // padding: EdgeInsets.only(left: 5),
- child: Text(
- '问题描述:',
- style: TextStyle(
- color: Color(0xff999999),
- fontSize: ScreenUtil().setSp(13),
- ),
- textAlign: TextAlign.start,
- ),
- ),
- Container(
- width: ScreenUtil().setWidth(230),
- child: Text(
- '${detailObj.expression ?? ''}',
- style: TextStyle(
- color: Color(0xff666666),
- fontSize: ScreenUtil().setSp(13),
- // color: Color(0xff666666),
- // fontSize: ScreenUtil().setSp(15),
- ),
- textAlign: TextAlign.start,
- maxLines: 1,
- overflow: TextOverflow.ellipsis,
- ),
- ),
- ],
- ),
- ),
- Container(
- // margin: EdgeInsets.only(top: 6),
- child: Row(
- children: <Widget>[
- Container(
- // padding: EdgeInsets.only(left: 5),
- child: Text(
- '出厂日期:',
- style: TextStyle(
- color: Color(0xff999999),
- fontSize: ScreenUtil().setSp(13),
- ),
- textAlign: TextAlign.start,
- ),
- ),
- Container(
- width: ScreenUtil().setWidth(230),
- child: Text(
- '${detailObj.productionDate ?? ''}',
- style: TextStyle(
- color: Color(0xff666666),
- fontSize: ScreenUtil().setSp(13),
- // color: Color(0xff666666),
- // fontSize: ScreenUtil().setSp(15),
- ),
- textAlign: TextAlign.start,
- maxLines: 1,
- overflow: TextOverflow.ellipsis,
- ),
- ),
- ],
- ),
- ),
- // 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,
- // ),
- // ),
- // ],
- // ),
- ],
- ),
- ),
- )
- ],
- ),
- ),
- ),
- ],
- ),
- );
- }
- _orderMoneyDetail() {
- return Column(
- children: [
- detailObj.dataTable == 2
- ? Heng(
- left: "差旅费",
- right: detailObj.travelCost != null
- ? "¥" + detailObj.travelCost.toString()
- : '¥0',
- leftColor: 0xff333333,
- rightColor: 0xff333333,
- )
- : Container(),
- Heng(
- left: "技术服务费",
- right: detailObj.serviceCost != null
- ? "¥" + detailObj.serviceCost.toString()
- : '¥0',
- leftColor: 0xff333333,
- rightColor: 0xff333333,
- ),
- Heng(
- left: "优惠券抵扣",
- right: detailObj.couponDeduction != null
- ? "-¥" + detailObj.couponDeduction.toString()
- : '-¥0',
- leftColor: 0xff333333,
- rightColor: 0xff333333,
- ),
- Heng(
- left: "红包抵扣",
- right: detailObj.redEnvelopeDeduction != null
- ? "-¥" + detailObj.redEnvelopeDeduction.toString()
- : '-¥0',
- leftColor: 0xff333333,
- rightColor: 0xff333333,
- ),
- Heng(
- left: "实付款",
- right: detailObj.payCost != null && getPayCost()
- ? "¥" + detailObj.payCost.toString()
- : '¥' + totalPay.toStringAsFixed(2).toString(),
- leftColor: 0xff333333,
- rightColor: 0xffFD0808,
- ),
- ],
- );
- }
- _orderTime() {
- return Container(
- padding: EdgeInsets.only(
- left: ScreenUtil().setWidth(15),
- top: ScreenUtil().setWidth(10),
- bottom: ScreenUtil().setWidth(10)),
- child: Row(
- children: <Widget>[
- Text(
- '下单时间:',
- textAlign: TextAlign.left,
- style: TextStyle(
- fontSize: 14,
- color: Color(0xff333333),
- ),
- ),
- 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(0xff999999),
- ),
- ),
- ],
- ),
- );
- }
- ///现场视频维修前维修后
- _orderLiveVideo() {
- double width = MediaQuery.of(context).size.width;
- return 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("暂无"),
- ),
- ],
- );
- }
- _orderSSInfo() {
- return 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: 14,
- color: Color(0xff333333),
- ),
- ),
- Text(
- detailObj.liftCaseAppealEntity != null &&
- detailObj.liftCaseAppealEntity.content != null
- ? detailObj.liftCaseAppealEntity.content
- : '',
- textAlign: TextAlign.left,
- style: TextStyle(
- fontSize: 14,
- color: Color(0xff999999),
- ),
- ),
- ],
- ),
- Row(
- children: <Widget>[
- Text(
- '申诉时间:',
- textAlign: TextAlign.left,
- style: TextStyle(
- fontSize: 14,
- color: Color(0xff333333),
- ),
- ),
- 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: 14,
- color: Color(0xff999999),
- ),
- ),
- ],
- ),
- ],
- ),
- );
- }
- isShowMoneyDetail() {
- bool show = true;
- if (detailObj.dataTable == 2) {
- switch (detailObj.statuz) {
- case 0:
- case 1:
- show = false;
- break;
- default:
- }
- }
- // else if (detailObj.dataTable == 1) {
- // switch (detailObj.statuz) {
- // case 0:
- // case 1:
- // show = false;
- // break;
- // default:
- // }
- // }
- // if ((detailObj.dataTable == 2 && (detailObj.statuz == 2)) ||
- // (detailObj.dataTable == 2 && detailObj.statuz == 2)) {
- // show = false;
- // }
- return show;
- }
- isShowOrderLive() {
- bool show = false;
- if (detailObj.dataTable == 2) {
- show = true;
- switch (detailObj.statuz) {
- case 0:
- case 1:
- case 2:
- show = false;
- break;
- default:
- }
- }
- return show;
- }
- 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, this.isBlueBtn = true})
- : super(key: key);
- Function fun;
- String title;
- bool isBlueBtn;
- @override
- Widget build(BuildContext context) {
- return Expanded(
- // margin: EdgeInsets.only(left: 10),
- child: GestureDetector(
- onTap: () {
- fun();
- },
- child: Container(
- child: Container(
- margin: EdgeInsets.only(left: 15, right: 15),
- // 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(23),
- color: isBlueBtn ? Colours.blue_app_main : Color(0xffEEEEEE)),
- child: Column(
- mainAxisAlignment: MainAxisAlignment.center,
- children: <Widget>[
- Text(
- title,
- textAlign: TextAlign.center,
- style: TextStyle(
- fontSize: ScreenUtil().setSp(15),
- color: isBlueBtn ? Colors.white : Color(0xff666666),
- ),
- ),
- ],
- ),
- ),
- ),
- ),
- );
- }
- }
|