work_place.dart 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983
  1. import 'dart:async';
  2. import 'dart:convert';
  3. import 'package:flustars/flustars.dart' as FlutterStars;
  4. import 'package:flutter/material.dart';
  5. import 'package:flutter_screenutil/flutter_screenutil.dart';
  6. import 'package:liftmanager/common/common.dart';
  7. import 'package:liftmanager/internal/bbs/bbs_router.dart';
  8. import 'package:liftmanager/internal/bbs/model/liftcase_model.dart';
  9. import 'package:liftmanager/internal/bbs/presenter/liftcase_list_presenter.dart';
  10. import 'package:liftmanager/internal/search/presenter/base_list_provider.dart';
  11. import 'package:liftmanager/internal/wode/order_const.dart';
  12. import 'package:liftmanager/mvp/base_page_state.dart';
  13. import 'package:liftmanager/net/api_service.dart';
  14. import 'package:liftmanager/res/resources.dart';
  15. import 'package:liftmanager/routers/fluro_navigator.dart';
  16. import 'package:liftmanager/utils/theme_utils.dart';
  17. import 'package:liftmanager/utils/time_format.dart';
  18. import 'package:liftmanager/utils/toast.dart';
  19. import 'package:liftmanager/widgets/app_bar.dart';
  20. import 'package:liftmanager/widgets/clip_widgets.dart';
  21. import 'package:liftmanager/widgets/load_image.dart';
  22. import 'package:liftmanager/widgets/my_refresh_list.dart';
  23. import 'package:liftmanager/widgets/popup_window.dart';
  24. import 'package:provider/provider.dart';
  25. class WorkPlace extends StatefulWidget {
  26. @override
  27. WorkPlaceState createState() => WorkPlaceState();
  28. }
  29. class WorkPlaceState extends BasePageState<WorkPlace, LiftcaseListPresenter> {
  30. BaseListProvider<LiftCasesDetailModel> provider =
  31. BaseListProvider<LiftCasesDetailModel>();
  32. // ExpertListState({Key key}) : super(key: key);
  33. bool sortBool = true;
  34. String sortName = "排序";
  35. int indexNowConst = 999;
  36. String checkId = "";
  37. bool isOnline = true;
  38. bool isSelect = false;
  39. int _page = 1;
  40. List<String> labelList = ["特邀专家", "普通专家"];
  41. List<dynamic> expertType = [
  42. {"value": 0, "label": "特邀专家"},
  43. {"value": 1, "label": "普通专家"}
  44. ];
  45. GlobalKey _addKey = GlobalKey();
  46. @override
  47. void initState() {
  48. super.initState();
  49. getBrandDetail();
  50. _onRefresh();
  51. startTimer();
  52. }
  53. getLevel(level) {
  54. String img;
  55. if (level == 1) {
  56. img = "L1@2x";
  57. } else if (level == 2) {
  58. img = "L2@2x";
  59. } else if (level == 3) {
  60. img = "L3@2x";
  61. } else if (level == 4) {
  62. img = "L4@2x";
  63. } else if (level == 5) {
  64. img = "L5@2x";
  65. }
  66. return img;
  67. }
  68. bool _hasData = false;
  69. var detailObj;
  70. getBrandDetail() {
  71. NewApiService().getExpertDetail(
  72. FlutterStars.SpUtil.getString(Constant.userId), onSuccess: (res) {
  73. detailObj = res;
  74. print("获取详情成功");
  75. if (detailObj.statuz == 1) {
  76. isOnline = true;
  77. } else {
  78. isOnline = false;
  79. }
  80. print(JsonEncoder().convert(res));
  81. print(123123);
  82. _hasData = true;
  83. setState(() {});
  84. }, onError: (code, msg) {
  85. toasts(msg);
  86. });
  87. }
  88. updateUser(int status) {
  89. NewApiService().updateUser({
  90. "userId": FlutterStars.SpUtil.getString(Constant.userId),
  91. "statuz": status
  92. }, onSuccess: (res) {
  93. getBrandDetail();
  94. setState(() {});
  95. }, onError: (code, msg) {
  96. toasts(msg);
  97. });
  98. }
  99. Timer _timer;
  100. void startTimer() {
  101. //设置 30 秒回调一次
  102. const period = const Duration(seconds: 30);
  103. _timer = Timer.periodic(period, (timer) {
  104. _onRefresh();
  105. //更新界面
  106. setState(() {});
  107. });
  108. }
  109. void cancelTimer() {
  110. if (_timer != null) {
  111. _timer.cancel();
  112. _timer = null;
  113. }
  114. }
  115. @override
  116. void dispose() {
  117. super.dispose();
  118. cancelTimer();
  119. }
  120. Widget expertDetailWisget() {
  121. double width = MediaQuery.of(context).size.width;
  122. double height = MediaQuery.of(context).size.height;
  123. List<Widget> textWidgets = [Text('擅长品牌:')];
  124. detailObj.proficiencyBrandName.split(',').forEach((element) {
  125. if (element != '') {
  126. textWidgets.add(ClipText(title: element));
  127. }
  128. });
  129. return Column(
  130. children: <Widget>[
  131. Container(
  132. // height: ScreenUtil().setWidth(150),
  133. padding: EdgeInsets.only(bottom: 10),
  134. // decoration: BoxDecoration(
  135. // gradient: const LinearGradient(
  136. // colors: [Color(0xFF00D9FF), Color(0xFF0287FF)]),
  137. // ),
  138. child: Column(
  139. children: <Widget>[
  140. Container(
  141. child: Row(
  142. crossAxisAlignment: CrossAxisAlignment.start,
  143. children: <Widget>[
  144. Container(
  145. margin: EdgeInsets.only(
  146. left: ScreenUtil().setWidth(10),
  147. right: ScreenUtil().setWidth(10),
  148. top: ScreenUtil().setWidth(5)),
  149. decoration: BoxDecoration(
  150. borderRadius: BorderRadius.circular(
  151. ScreenUtil().setWidth(25)),
  152. ),
  153. child: Container(
  154. width: ScreenUtil().setWidth(50),
  155. height: ScreenUtil().setWidth(70),
  156. child: Stack(
  157. children: <Widget>[
  158. Container(
  159. padding: EdgeInsets.only(
  160. left: ScreenUtil().setWidth(3)),
  161. child: ClipRRect(
  162. borderRadius:
  163. BorderRadius.all(Radius.circular(50)),
  164. child: LoadNetworkImage(
  165. // image: AssetImage(i['img']),
  166. detailObj.avatarUrl,
  167. width: ScreenUtil().setWidth(44),
  168. height: ScreenUtil().setWidth(44),
  169. // alignment: Alignment.centerLeft,
  170. ),
  171. ),
  172. ),
  173. ],
  174. ),
  175. )),
  176. Expanded(
  177. child: Container(
  178. padding: EdgeInsets.only(
  179. right: ScreenUtil().setWidth(15)),
  180. child: Column(
  181. crossAxisAlignment: CrossAxisAlignment.start,
  182. children: <Widget>[
  183. Row(
  184. mainAxisAlignment:
  185. MainAxisAlignment.spaceBetween,
  186. children: <Widget>[
  187. Text(
  188. detailObj.name ?? "",
  189. style: TextStyle(
  190. color: Color(0xff333333),
  191. fontSize: ScreenUtil().setSp(18)),
  192. ),
  193. // StarItemShow(
  194. // starRating:
  195. // detailObj.averageScore != null
  196. // ? double.parse(detailObj
  197. // .averageScore
  198. // .toString())
  199. // : 0.0,
  200. // ),
  201. ],
  202. ),
  203. Container(
  204. alignment: Alignment.topLeft,
  205. child: Wrap(
  206. spacing: 2.0,
  207. runSpacing: 3.0,
  208. children: textWidgets),
  209. ),
  210. detailObj.platformInvitedFlag == 0
  211. ? Container(
  212. padding: EdgeInsets.only(
  213. left: 5, right: 5),
  214. margin: EdgeInsets.only(
  215. right: 5, top: 5),
  216. // color:Colors.red,
  217. decoration: BoxDecoration(
  218. borderRadius:
  219. BorderRadius.circular(1.0),
  220. border: Border.all(
  221. width: 0.5,
  222. color: Color(0xffB0E2FF),
  223. ),
  224. ),
  225. child: Text(
  226. "特邀专家",
  227. style: TextStyle(
  228. color: Colours.blue_app_main,
  229. fontSize:
  230. ScreenUtil().setSp(12)),
  231. textAlign: TextAlign.center,
  232. ),
  233. )
  234. : Container(
  235. child: null,
  236. ),
  237. Row(
  238. children: <Widget>[
  239. Expanded(
  240. child: Container(
  241. decoration: BoxDecoration(
  242. color: Color(0x195887FF),
  243. borderRadius:
  244. new BorderRadius.circular(
  245. (5.0))),
  246. padding: EdgeInsets.all(5),
  247. margin: EdgeInsets.only(
  248. right: 5, top: 5),
  249. child: Row(
  250. crossAxisAlignment:
  251. CrossAxisAlignment.start,
  252. children: <Widget>[
  253. Icon(
  254. const IconData(0xe64a,
  255. fontFamily: "Iconfont"),
  256. size: 17.0,
  257. color: Color(0x195887FF),
  258. ),
  259. SizedBox(
  260. width: 5,
  261. ),
  262. Expanded(
  263. child: Container(
  264. child: Text(
  265. // "detailObj",
  266. detailObj.address != null
  267. ? detailObj.address
  268. .split(",")[0]
  269. : "",
  270. style: TextStyle(
  271. color: Colours
  272. .blue_app_main,
  273. fontSize: ScreenUtil()
  274. .setSp(12)),
  275. textAlign: TextAlign.left,
  276. // overflow:TextOverflow.ellipsis,
  277. ),
  278. ))
  279. ],
  280. )),
  281. )
  282. ],
  283. ),
  284. ],
  285. )))
  286. ]),
  287. ),
  288. Container(
  289. padding: EdgeInsets.only(top: ScreenUtil().setWidth(10)),
  290. child: Row(
  291. crossAxisAlignment: CrossAxisAlignment.center,
  292. mainAxisAlignment: MainAxisAlignment.spaceAround,
  293. children: <Widget>[
  294. Container(
  295. child: Row(
  296. crossAxisAlignment: CrossAxisAlignment.center,
  297. children: <Widget>[
  298. Text(
  299. detailObj.workDate != null
  300. ? detailObj.workDate.toString()
  301. : "0",
  302. style: TextStyle(
  303. color: Color(0xff333333),
  304. fontSize: ScreenUtil().setSp(19),
  305. fontWeight: FontWeight.w500),
  306. textAlign: TextAlign.start,
  307. ),
  308. Text(
  309. " 从业年数",
  310. style: TextStyle(
  311. color: Color(0xff666666),
  312. fontSize: ScreenUtil().setSp(12),
  313. fontWeight: FontWeight.w400),
  314. textAlign: TextAlign.start,
  315. ),
  316. ])),
  317. Container(
  318. child: Row(
  319. crossAxisAlignment: CrossAxisAlignment.center,
  320. children: <Widget>[
  321. Text(
  322. detailObj.serviceCounts != null
  323. ? detailObj.serviceCounts.toString()
  324. : "0",
  325. style: TextStyle(
  326. color: Color(0xff333333),
  327. fontSize: ScreenUtil().setSp(19),
  328. fontWeight: FontWeight.w500),
  329. textAlign: TextAlign.start,
  330. ),
  331. Text(
  332. " 服务次数",
  333. style: TextStyle(
  334. color: Color(0xff666666),
  335. fontSize: ScreenUtil().setSp(12),
  336. fontWeight: FontWeight.w400),
  337. textAlign: TextAlign.start,
  338. ),
  339. ])),
  340. // Container(
  341. // child:Column(
  342. // crossAxisAlignment: CrossAxisAlignment.center,
  343. // children:<Widget>[
  344. // Text(
  345. // "99.9",
  346. // style: TextStyle(
  347. // color:Colors.white,
  348. // fontSize:ScreenUtil().setSp(16)
  349. // ),
  350. // textAlign:TextAlign.start,
  351. // ),
  352. // Text(
  353. // "好评率(%)",
  354. // style: TextStyle(
  355. // color:Colors.white,
  356. // fontSize:ScreenUtil().setSp(14)
  357. // ),
  358. // textAlign:TextAlign.start,
  359. // ),
  360. // ]
  361. // )
  362. // ),
  363. Container(
  364. child: Row(
  365. crossAxisAlignment: CrossAxisAlignment.center,
  366. children: <Widget>[
  367. Text(
  368. detailObj.adoptCounts != null
  369. ? detailObj.adoptCounts.toString()
  370. : "0",
  371. style: TextStyle(
  372. color: Color(0xff333333),
  373. fontSize: ScreenUtil().setSp(19),
  374. fontWeight: FontWeight.w500),
  375. textAlign: TextAlign.start,
  376. ),
  377. Text(
  378. " 采纳次数",
  379. style: TextStyle(
  380. color: Color(0xff666666),
  381. fontSize: ScreenUtil().setSp(12),
  382. fontWeight: FontWeight.w400),
  383. textAlign: TextAlign.start,
  384. ),
  385. ])),
  386. ])),
  387. ],
  388. )),
  389. ],
  390. );
  391. }
  392. _showAddMenu() {
  393. final RenderBox button = _addKey.currentContext.findRenderObject();
  394. final RenderBox overlay = Overlay.of(context).context.findRenderObject();
  395. var a = button.localToGlobal(
  396. Offset(button.size.width - 8.0, button.size.height - 0.0),
  397. ancestor: overlay);
  398. var b = button.localToGlobal(button.size.bottomLeft(Offset(0, -0.0)),
  399. ancestor: overlay);
  400. final RelativeRect position = RelativeRect.fromRect(
  401. Rect.fromPoints(a, b),
  402. Offset.zero & overlay.size,
  403. );
  404. final Color backgroundColor = ThemeUtils.getBackgroundColor(context);
  405. final Color _iconColor = ThemeUtils.getIconColor(context);
  406. showPopupWindow(
  407. context: context,
  408. fullWidth: false,
  409. isShowBg: false,
  410. position: position,
  411. elevation: 0.0,
  412. child: GestureDetector(
  413. onTap: () => NavigatorUtils.goBack(context),
  414. child: Column(
  415. crossAxisAlignment: CrossAxisAlignment.end,
  416. children: <Widget>[
  417. Padding(
  418. padding: const EdgeInsets.only(right: 12.0),
  419. child: LoadAssetImage(
  420. "icon_jt",
  421. width: 8.0,
  422. height: 4.0,
  423. ),
  424. ),
  425. SizedBox(
  426. width: 70.0,
  427. height: 40.0,
  428. child: InkWell(
  429. onTap: () {
  430. Navigator.pop(context);
  431. setState(() {
  432. isSelect = false;
  433. isOnline = true;
  434. updateUser(1);
  435. // if (isOnline == true) {
  436. // } else {
  437. // updateUser(0);
  438. // }
  439. });
  440. },
  441. child: Container(
  442. alignment: Alignment.center,
  443. child: Text(
  444. "在线",
  445. style: TextStyle(
  446. color: isOnline
  447. ? Colours.blue_app_main
  448. : Colours.text),
  449. ),
  450. decoration: BoxDecoration(
  451. color: backgroundColor,
  452. borderRadius: BorderRadius.only(
  453. topLeft: Radius.circular(8.0),
  454. topRight: Radius.circular(8.0)),
  455. ),
  456. ))
  457. // child: FlatButton.icon(
  458. // textColor: Theme.of(context).textTheme.body1.color,
  459. // onPressed: () {
  460. // Navigator.pop(context);
  461. // // NavigatorUtils.pushResult(
  462. // // context, '${TeamRouter.teamCreatePage}', (res) {
  463. // // _onRefresh();
  464. // // });
  465. // },
  466. // color: backgroundColor,
  467. // shape: RoundedRectangleBorder(
  468. // borderRadius: BorderRadius.only(
  469. // topLeft: Radius.circular(8.0),
  470. // topRight: Radius.circular(8.0)),
  471. // ),
  472. // icon: LoadAssetImage(
  473. // "wode/icon_team_add",
  474. // width: 16.0,
  475. // height: 16.0,
  476. // color: _iconColor,
  477. // ),
  478. // label: const Text("创建团队")),
  479. ),
  480. Container(width: 120.0, height: 0.6, color: Colours.line),
  481. SizedBox(
  482. width: 70.0,
  483. height: 40.0,
  484. child: InkWell(
  485. onTap: () {
  486. Navigator.pop(context);
  487. setState(() {
  488. isSelect = false;
  489. isOnline = false;
  490. updateUser(0);
  491. });
  492. },
  493. child: Container(
  494. alignment: Alignment.center,
  495. child: Text(
  496. "离线",
  497. style: TextStyle(
  498. color:
  499. !isOnline ? Colours.blue_app_main : Colours.text),
  500. ),
  501. decoration: BoxDecoration(
  502. color: backgroundColor,
  503. borderRadius: BorderRadius.only(
  504. bottomLeft: Radius.circular(8.0),
  505. bottomRight: Radius.circular(8.0)),
  506. ),
  507. ),
  508. )
  509. // FlatButton.icon(
  510. // textColor: Theme.of(context).textTheme.body1.color,
  511. // color: backgroundColor,
  512. // onPressed: () {
  513. // Navigator.pop(context);
  514. // // NavigatorUtils.push(
  515. // // context, '${TeamRouter.teamSearchPage}');
  516. // },
  517. // shape: RoundedRectangleBorder(
  518. // borderRadius: BorderRadius.only(
  519. // bottomLeft: Radius.circular(8.0),
  520. // bottomRight: Radius.circular(8.0)),
  521. // ),
  522. // // icon: LoadAssetImage(
  523. // // "wode/icon_team_add",
  524. // // width: 16.0,
  525. // // height: 16.0,
  526. // // color: _iconColor,
  527. // // ),
  528. // label: const Text("加入团队")),
  529. ),
  530. ],
  531. ),
  532. ),
  533. );
  534. }
  535. @override
  536. Widget build(BuildContext context) {
  537. double width = MediaQuery.of(context).size.width;
  538. double height = MediaQuery.of(context).size.height;
  539. return Container(
  540. child: ChangeNotifierProvider<BaseListProvider<LiftCasesDetailModel>>(
  541. create: (_) => provider,
  542. child: Scaffold(
  543. appBar: MyAppBar(
  544. centerTitle: '专家工单',
  545. isFun: true,
  546. fun: () {
  547. Navigator.popUntil(context, ModalRoute.withName('/home'));
  548. },
  549. actions: [
  550. ClipRRect(
  551. borderRadius: BorderRadius.circular(20),
  552. child: InkWell(
  553. key: _addKey,
  554. onTap: () {
  555. setState(() {
  556. isSelect = true;
  557. });
  558. _showAddMenu();
  559. },
  560. child: Container(
  561. padding:
  562. EdgeInsets.only(left: 5, right: 5, top: 2, bottom: 2),
  563. color: Colours.blue_app_main,
  564. child: Row(
  565. children: [
  566. Icon(
  567. isOnline
  568. ? const IconData(0xe62d, fontFamily: 'Iconfont')
  569. : const IconData(0xe6e0, fontFamily: 'Iconfont'),
  570. color: Colors.white,
  571. size: 14,
  572. ),
  573. SizedBox(
  574. width: 3,
  575. ),
  576. Text(
  577. isOnline ? '在线' : '离线',
  578. style: TextStyle(color: Colors.white),
  579. ),
  580. SizedBox(
  581. width: 3,
  582. ),
  583. Icon(
  584. isSelect ? Icons.expand_less : Icons.expand_more,
  585. color: Colors.white,
  586. size: 16,
  587. ),
  588. ],
  589. ),
  590. ),
  591. ),
  592. ),
  593. SizedBox(
  594. width: 10,
  595. ),
  596. ],
  597. ),
  598. body: Container(
  599. child: Stack(
  600. children: <Widget>[
  601. Column(
  602. children: <Widget>[
  603. _hasData ? expertDetailWisget() : Container(child: null),
  604. Container(
  605. color: Color(0xffF9F9F9),
  606. child: SizedBox(
  607. height: 10,
  608. ),
  609. ),
  610. Expanded(
  611. flex: 1,
  612. child: Consumer<BaseListProvider<LiftCasesDetailModel>>(
  613. builder: (_, provider, __) {
  614. return provider.list.length > 0
  615. ? MyListView(
  616. key: Key('liftcase_list'),
  617. pageSize: 10,
  618. itemCount: provider.list.length,
  619. stateType: provider.stateType,
  620. onRefresh: _onRefresh,
  621. loadMore: _loadMore,
  622. hasMore: provider.hasMore,
  623. itemBuilder: (_, index) {
  624. return WorkListWidget(
  625. item: provider.list[index]);
  626. },
  627. )
  628. : Container(
  629. child: Column(
  630. children: [
  631. Expanded(child: Container()),
  632. LoadAssetImage(
  633. "work/img_noworklist",
  634. width: 250,
  635. height: 150,
  636. ),
  637. Text(
  638. '您暂时还没有工单哦~',
  639. style:
  640. TextStyle(color: Colours.text_gray_c),
  641. ),
  642. Expanded(child: Container()),
  643. ],
  644. ));
  645. }))
  646. ],
  647. ),
  648. ],
  649. ))),
  650. ));
  651. }
  652. Future _onRefresh() async {
  653. _page = 1;
  654. await presenter.getLiftcaseList(_page);
  655. }
  656. Future _loadMore() async {
  657. _page++;
  658. await presenter.getLiftcaseList(_page);
  659. }
  660. @override
  661. LiftcaseListPresenter createPresenter() {
  662. return LiftcaseListPresenter();
  663. }
  664. }
  665. class WorkListWidget extends StatelessWidget {
  666. WorkListWidget({Key key, this.item}) : super(key: key);
  667. dynamic item;
  668. @override
  669. Widget build(BuildContext context) {
  670. double width = MediaQuery.of(context).size.width;
  671. return Container(
  672. // height: 20,
  673. padding: EdgeInsets.only(
  674. bottom: ScreenUtil().setWidth(20), top: ScreenUtil().setWidth(10)),
  675. decoration: BoxDecoration(
  676. border: Border(
  677. bottom: BorderSide(width: 0.5, color: Colours.line),
  678. ),
  679. ),
  680. child: Row(
  681. crossAxisAlignment: CrossAxisAlignment.start,
  682. children: <Widget>[
  683. Expanded(
  684. child: GestureDetector(
  685. behavior: HitTestBehavior.opaque,
  686. onTap: () {
  687. if (item.dataTable == 1) {
  688. NavigatorUtils.push(context,
  689. "${BbsRouter.recommendAsk}?id=${item.id}&type=1");
  690. } else if (item.dataTable == 2) {
  691. NavigatorUtils.push(context,
  692. "${BbsRouter.recommendAsk}?id=${item.id}&type=2");
  693. }
  694. },
  695. child: Row(
  696. crossAxisAlignment: CrossAxisAlignment.start,
  697. children: <Widget>[
  698. Container(
  699. margin: EdgeInsets.only(
  700. left: ScreenUtil().setWidth(10),
  701. right: ScreenUtil().setWidth(10),
  702. top: ScreenUtil().setWidth(5),
  703. ),
  704. decoration: BoxDecoration(
  705. borderRadius:
  706. BorderRadius.circular(ScreenUtil().setWidth(22)),
  707. ),
  708. child: ClipRRect(
  709. borderRadius: BorderRadius.all(Radius.circular(50)),
  710. child: LoadNetworkImage(
  711. // image: AssetImage(i['img']),
  712. item.avatarUrl,
  713. width: ScreenUtil().setWidth(43),
  714. height: ScreenUtil().setWidth(43),
  715. // alignment: Alignment.centerLeft,
  716. ),
  717. ),
  718. ),
  719. Expanded(
  720. child: Container(
  721. padding:
  722. EdgeInsets.only(right: ScreenUtil().setWidth(15)),
  723. child: Column(
  724. children: <Widget>[
  725. Container(
  726. child: Row(
  727. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  728. children: <Widget>[
  729. Row(
  730. crossAxisAlignment: CrossAxisAlignment.start,
  731. children: <Widget>[
  732. Container(
  733. // width: width * 0.3,
  734. child: Text(
  735. item.name ?? "",
  736. style: TextStyle(
  737. color: Color(0xff333333),
  738. fontSize: ScreenUtil().setSp(17),
  739. ),
  740. textAlign: TextAlign.start,
  741. maxLines: 1,
  742. overflow: TextOverflow.ellipsis,
  743. ),
  744. ),
  745. Container(
  746. decoration: BoxDecoration(
  747. //背景
  748. color: item.dataTable == 1
  749. ? Colours.blue_app_main
  750. : Color(0xffFDAF2C),
  751. //设置四周圆角 角度
  752. borderRadius: BorderRadius.all(
  753. Radius.circular(4.0)),
  754. ),
  755. margin: EdgeInsets.only(left: 5),
  756. padding: EdgeInsets.only(
  757. left: 5, right: 5, top: 2, bottom: 2),
  758. // padding: EdgeInsets.only(left: 5),
  759. // color: item.dataTable == 1,
  760. child: Text(
  761. item.dataTable == 1 ? "问诊服务" : "出诊服务",
  762. style: TextStyle(
  763. color: Colors.white,
  764. fontSize: ScreenUtil().setSp(14),
  765. ),
  766. textAlign: TextAlign.start,
  767. ),
  768. )
  769. ],
  770. ),
  771. Container(
  772. child: Text(
  773. OrderConstant.getStatusName(
  774. item.statuz, item.dataTable,
  775. arrivedFlag: item.arrivedFlag),
  776. style: TextStyle(
  777. color: Color(0xffF84203),
  778. fontSize: ScreenUtil().setSp(14),
  779. ),
  780. textAlign: TextAlign.end,
  781. ),
  782. )
  783. ],
  784. ),
  785. ),
  786. Container(
  787. child: Row(
  788. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  789. children: <Widget>[
  790. Row(
  791. crossAxisAlignment: CrossAxisAlignment.center,
  792. children: <Widget>[
  793. Text(
  794. item.createTime != null
  795. ? DateUtils.instance.getFormartData(
  796. timeSamp: item.createTime,
  797. format: "yyyy-MM-dd")
  798. : "",
  799. style: TextStyle(
  800. color: Color(0xff999999),
  801. fontSize: ScreenUtil().setSp(13),
  802. ),
  803. textAlign: TextAlign.start,
  804. ),
  805. Container(
  806. padding: EdgeInsets.only(left: 5),
  807. child: Text(
  808. item.brandName ?? "",
  809. style: TextStyle(
  810. color: Colours.blue_app_main,
  811. fontSize: ScreenUtil().setSp(13),
  812. ),
  813. textAlign: TextAlign.start,
  814. ),
  815. )
  816. ],
  817. ),
  818. ],
  819. ),
  820. ),
  821. item.dataTable == 2
  822. ? Container(
  823. child: Row(
  824. mainAxisAlignment:
  825. MainAxisAlignment.spaceBetween,
  826. children: <Widget>[
  827. Row(
  828. crossAxisAlignment:
  829. CrossAxisAlignment.center,
  830. children: <Widget>[
  831. Text(
  832. '出诊时间:',
  833. style: TextStyle(
  834. color: Color(0xff666666),
  835. fontSize: ScreenUtil().setSp(14),
  836. ),
  837. textAlign: TextAlign.start,
  838. ),
  839. Container(
  840. padding: EdgeInsets.only(left: 5),
  841. child: Text(
  842. item.arrivedTime != null
  843. ? DateUtils.instance
  844. .getFormartData(
  845. timeSamp:
  846. item.arrivedTime,
  847. format:
  848. "yyyy-MM-dd HH:mm")
  849. : "",
  850. style: TextStyle(
  851. color: Color(0xff666666),
  852. fontSize:
  853. ScreenUtil().setSp(14),
  854. ),
  855. textAlign: TextAlign.start,
  856. ),
  857. )
  858. ],
  859. ),
  860. ],
  861. ),
  862. )
  863. : Container(child: null),
  864. item.dataTable == 2
  865. ? Container(
  866. child: Row(
  867. mainAxisAlignment:
  868. MainAxisAlignment.spaceBetween,
  869. children: <Widget>[
  870. Row(
  871. crossAxisAlignment:
  872. CrossAxisAlignment.center,
  873. children: <Widget>[
  874. Text(
  875. '出诊地点:',
  876. style: TextStyle(
  877. color: Color(0xff666666),
  878. fontSize: ScreenUtil().setSp(14),
  879. ),
  880. textAlign: TextAlign.start,
  881. ),
  882. Container(
  883. width: width * 0.6,
  884. padding: EdgeInsets.only(left: 5),
  885. child: Text(
  886. item.address ?? "",
  887. style: TextStyle(
  888. color: Color(0xff666666),
  889. fontSize:
  890. ScreenUtil().setSp(14),
  891. ),
  892. textAlign: TextAlign.start,
  893. maxLines: 1,
  894. overflow: TextOverflow.ellipsis,
  895. ),
  896. )
  897. ],
  898. ),
  899. ],
  900. ),
  901. )
  902. : Container(child: null),
  903. Container(
  904. child: Row(
  905. crossAxisAlignment: CrossAxisAlignment.start,
  906. children: <Widget>[
  907. Container(
  908. width: width * 0.7,
  909. child: Text(
  910. '问题描述:' +
  911. (item.expression != null
  912. ? item.expression
  913. : ""),
  914. style: TextStyle(
  915. color: Color(0xff666666),
  916. fontSize: ScreenUtil().setSp(14),
  917. ),
  918. textAlign: TextAlign.start,
  919. maxLines: 1,
  920. overflow: TextOverflow.ellipsis,
  921. ),
  922. )
  923. ],
  924. ),
  925. ),
  926. // list[i]["type"] != "1"
  927. // ? Container(
  928. // margin: EdgeInsets.only(top: 6),
  929. // child: Row(
  930. // children: <Widget>[
  931. // Container(
  932. // padding:
  933. // EdgeInsets.only(right: 5),
  934. // child: Text(
  935. // "¥${list[i]["price"]}",
  936. // style: TextStyle(
  937. // color: Color(0xffFD0808),
  938. // fontSize:
  939. // ScreenUtil().setSp(15)),
  940. // textAlign: TextAlign.start,
  941. // ),
  942. // ),
  943. // ],
  944. // ),
  945. // )
  946. // : Container(child: null)
  947. ],
  948. ),
  949. ),
  950. )
  951. ],
  952. ),
  953. ),
  954. ),
  955. ],
  956. ),
  957. );
  958. }
  959. }