expert_list.dart 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867
  1. import 'dart:async';
  2. import 'package:amap_location_flutter_plugin/amap_location_flutter_plugin.dart';
  3. import 'package:flutter/material.dart';
  4. import 'package:flutter_screenutil/flutter_screenutil.dart';
  5. import 'package:liftmanager/internal/bbs/bbs_router.dart';
  6. import 'package:liftmanager/internal/bbs/model/expert_model.dart';
  7. import 'package:liftmanager/internal/bbs/presenter/expert_list_presenter.dart';
  8. import 'package:liftmanager/internal/search/presenter/base_list_provider.dart';
  9. import 'package:liftmanager/mvp/base_page_state.dart';
  10. import 'package:liftmanager/net/api_service.dart';
  11. import 'package:liftmanager/res/resources.dart';
  12. import 'package:liftmanager/routers/fluro_navigator.dart';
  13. import 'package:liftmanager/utils/theme_utils.dart';
  14. import 'package:liftmanager/utils/toast.dart';
  15. import 'package:liftmanager/widgets/app_search_bar.dart';
  16. import 'package:liftmanager/widgets/load_image.dart';
  17. import 'package:liftmanager/widgets/my_refresh_list.dart';
  18. import 'package:liftmanager/widgets/star_item.dart';
  19. import 'package:permission_handler/permission_handler.dart';
  20. import 'package:provider/provider.dart';
  21. import 'package:shared_preferences/shared_preferences.dart';
  22. import 'package:umeng_common_sdk/umeng_common_sdk.dart';
  23. int dataId;
  24. String dataTable;
  25. class ExpertList extends StatefulWidget {
  26. ExpertList(this.id);
  27. final String id;
  28. @override
  29. ExpertListState createState() => ExpertListState();
  30. }
  31. class ExpertListState extends BasePageState<ExpertList, ExpertListPresenter> {
  32. BaseListProvider<Records> provider = BaseListProvider<Records>();
  33. // ExpertListState({Key key}) : super(key: key);
  34. AmapLocationFlutterPlugin _locationPlugin = new AmapLocationFlutterPlugin();
  35. StreamSubscription<Map<String, Object>> _locationListener;
  36. Map<String, Object> _locationResult;
  37. bool sortBool = true;
  38. String sortName = "排序";
  39. int indexNowConst = 999999;
  40. String checkId = "";
  41. int _page = 1;
  42. double apiExpertFee = 0.0;
  43. int sortNum = 0;
  44. List<String> sortListChiose = ["采纳排序", "咨询人数", "评论星级", "距离优先"];
  45. @override
  46. void initState() {
  47. super.initState();
  48. ///移除定位监听
  49. if (null != _locationListener) {
  50. _locationListener.cancel();
  51. }
  52. ///销毁定位
  53. if (null != _locationPlugin) {
  54. _locationPlugin.destroy();
  55. }
  56. _locationListener = _locationPlugin
  57. .onLocationChanged()
  58. .listen((Map<String, Object> result) {
  59. setState(() {
  60. _locationPlugin.stopLocation();
  61. _locationResult = result;
  62. // address latitude longitude
  63. lat = _locationResult["latitude"];
  64. lng = _locationResult["longitude"];
  65. _onRefresh();
  66. // _locationResult.forEach((key, value) {
  67. // if(key == 'city'){
  68. // cityName = '$value';
  69. // setState(() {
  70. // });
  71. // }
  72. // print(111);
  73. // print('key:$key :');
  74. // print('value:$value :');
  75. // });
  76. });
  77. });
  78. getDataId();
  79. getApiFee();
  80. getType();
  81. sortType = "adopt_counts";
  82. _onRefresh();
  83. }
  84. Future getApiFee() async {
  85. await NewApiService().getFee(onSuccess: (res) {
  86. if (res != null) {
  87. apiExpertFee = res;
  88. setExpertFee(apiExpertFee);
  89. setState(() {});
  90. print(res);
  91. print(6666544);
  92. }
  93. }, onError: (code, msg) {
  94. toasts(msg);
  95. });
  96. }
  97. void setExpertFee(double expertFee) async {
  98. SharedPreferences prefs = await SharedPreferences.getInstance();
  99. prefs.setDouble("expertFee", expertFee);
  100. }
  101. void getDataId() async {
  102. SharedPreferences prefs = await SharedPreferences.getInstance();
  103. dataId = prefs.getInt("dataId");
  104. }
  105. void getType() async {
  106. SharedPreferences prefs = await SharedPreferences.getInstance();
  107. dataTable = prefs.getString("questionType");
  108. }
  109. // 绑定专家
  110. void generateRoom(expertId) {
  111. NewApiService().generateRoom({
  112. "id": dataId,
  113. "chargerId": expertId,
  114. }, onSuccess: (res) {
  115. getRoom();
  116. }, onError: (code, msg) {
  117. toasts(msg);
  118. });
  119. }
  120. //用诊单Id获取房间号
  121. Future getRoom() async {
  122. await NewApiService().findOne(dataId, onSuccess: (res) {
  123. print(res);
  124. String roomId = res.sessionid;
  125. toasts("即将进入聊天室!");
  126. NavigatorUtils.push(context,
  127. "${BbsRouter.chatRoom}?id=$roomId&type=someToOne&toUserId=''");
  128. // toasts("欢迎使用,请在使用过程中注意个人信息及财产安全!");
  129. print(666);
  130. }, onError: (code, msg) {
  131. toasts(msg);
  132. });
  133. }
  134. ///获取定位权限
  135. Future<bool> requestPermission() async {
  136. final permissions = await PermissionHandler()
  137. .requestPermissions([PermissionGroup.location]);
  138. if (permissions[PermissionGroup.location] == PermissionStatus.granted) {
  139. return true;
  140. } else {
  141. toasts('需要定位权限!');
  142. return false;
  143. }
  144. }
  145. double lat;
  146. double lng;
  147. ///获取位置信息
  148. getLocation() async {
  149. if (await requestPermission()) {
  150. // final location = await AmapLocation.fetchLocation();
  151. // LatLng latlng = await location.latLng;
  152. // print(latlng.latitude);
  153. // print(latlng.longitude);
  154. // print(latlng);
  155. // lat = latlng.latitude;
  156. // lng = latlng.longitude;
  157. // _onRefresh();
  158. if (null != _locationPlugin) {
  159. _locationPlugin.startLocation();
  160. }
  161. }
  162. }
  163. @override
  164. void dispose() {
  165. ///移除定位监听
  166. if (null != _locationListener) {
  167. _locationListener.cancel();
  168. }
  169. ///销毁定位
  170. if (null != _locationPlugin) {
  171. _locationPlugin.destroy();
  172. }
  173. super.dispose();
  174. }
  175. String sortType = "create_time";
  176. @override
  177. Widget build(BuildContext context) {
  178. double width = MediaQuery.of(context).size.width;
  179. double height = MediaQuery.of(context).size.height;
  180. return Container(
  181. child: ChangeNotifierProvider<BaseListProvider<Records>>(
  182. create: (_) => provider,
  183. child: Scaffold(
  184. appBar: SearchAppBar2(
  185. backgroundColor: Colors.white,
  186. onPressed: (text) {
  187. //搜索逻辑未能实现
  188. // title = text;
  189. // getBrandList();
  190. },
  191. ),
  192. body: Container(
  193. child: Stack(
  194. children: <Widget>[
  195. Column(
  196. children: <Widget>[
  197. Container(
  198. height: ScreenUtil().setWidth(140),
  199. ),
  200. Expanded(
  201. flex: 1,
  202. child: Consumer<BaseListProvider<Records>>(
  203. builder: (_, provider, __) {
  204. return MyListView(
  205. key: Key('expert_list'),
  206. pageSize: 10,
  207. itemCount: provider.list.length,
  208. stateType: provider.stateType,
  209. onRefresh: _onRefresh,
  210. loadMore: _loadMore,
  211. hasMore: provider.hasMore,
  212. itemBuilder: (_, index) {
  213. return ExpertListWidget(
  214. changeState: (params, id) {
  215. setState(() {
  216. indexNowConst = params;
  217. checkId = id;
  218. if (dataTable != "2") {
  219. NavigatorUtils.push(context,
  220. "${BbsRouter.expertDetail}?id=$checkId");
  221. } else {
  222. // 绑定专家
  223. generateRoom(checkId);
  224. }
  225. });
  226. },
  227. indexNow: indexNowConst,
  228. checkIdConst: checkId,
  229. item: provider.list[index],
  230. index: index);
  231. },
  232. );
  233. }))
  234. ],
  235. ),
  236. !sortBool
  237. ? Positioned(
  238. top: ScreenUtil().setWidth(140),
  239. left: 0,
  240. child: GestureDetector(
  241. onTap: () {
  242. setState(() {
  243. sortBool = true;
  244. });
  245. },
  246. child: Container(
  247. width: width,
  248. height: height,
  249. color: Color.fromRGBO(0, 0, 0, 0.5)),
  250. ))
  251. : Container(child: null),
  252. Positioned(
  253. top: 0,
  254. left: 0,
  255. child: GestureDetector(
  256. onTap: () async {
  257. SharedPreferences prefs =
  258. await SharedPreferences.getInstance();
  259. prefs.remove("expertName");
  260. prefs.remove("expertFee");
  261. if (dataTable != "2") {
  262. UmengCommonSdk.onEvent(
  263. 'ym_wenzhen_onClickPay',
  264. {
  265. "formName": '专家:平台指定',
  266. },
  267. );
  268. NavigatorUtils.push(
  269. context, "${BbsRouter.buyService}?id=");
  270. } else {
  271. // 绑定专家
  272. generateRoom(null);
  273. }
  274. },
  275. child: Container(
  276. width: width,
  277. height: ScreenUtil().setWidth(70),
  278. decoration: BoxDecoration(
  279. border: Border(
  280. bottom: BorderSide(width: 0.5, color: Colours.line),
  281. ),
  282. ),
  283. padding: EdgeInsets.only(
  284. left: ScreenUtil().setWidth(15),
  285. right: ScreenUtil().setWidth(15)),
  286. child: Row(children: <Widget>[
  287. Container(
  288. padding:
  289. EdgeInsets.only(right: ScreenUtil().setWidth(10)),
  290. child: LoadAssetImage(
  291. // image: AssetImage(i['img']),
  292. "tab_first/zhiding",
  293. width: ScreenUtil().setWidth(36),
  294. height: ScreenUtil().setWidth(36),
  295. // alignment: Alignment.centerLeft,
  296. ),
  297. ),
  298. Container(
  299. child: Column(
  300. crossAxisAlignment: CrossAxisAlignment.start,
  301. mainAxisAlignment: MainAxisAlignment.center,
  302. children: <Widget>[
  303. Row(
  304. children: <Widget>[
  305. Text(
  306. "平台指定专家",
  307. style: TextStyle(
  308. fontSize: ScreenUtil().setSp(14)),
  309. textAlign: TextAlign.start,
  310. ),
  311. Text(
  312. dataTable != "2" ? "¥$apiExpertFee" : "",
  313. style: TextStyle(
  314. color: Color(0xffff0000),
  315. fontSize: ScreenUtil().setSp(14)),
  316. textAlign: TextAlign.start,
  317. ),
  318. ],
  319. ),
  320. SizedBox(height: 5),
  321. Text(
  322. "平台根据问题和品牌自动指定优质专家",
  323. style: TextStyle(
  324. color: Color(0xff999999),
  325. fontSize: ScreenUtil().setSp(14)),
  326. textAlign: TextAlign.start,
  327. ),
  328. ],
  329. ),
  330. ),
  331. Expanded(child: Container()),
  332. Icon(
  333. Icons.arrow_forward_ios,
  334. size: 13,
  335. color: Color(0xffcccccc),
  336. )
  337. ]),
  338. ),
  339. ),
  340. ),
  341. Positioned(
  342. left: 0,
  343. top: ScreenUtil().setWidth(70),
  344. child: Container(
  345. padding: EdgeInsets.symmetric(horizontal: 0),
  346. child: Container(
  347. width: width,
  348. height: ScreenUtil().setWidth(70),
  349. decoration: BoxDecoration(
  350. border: Border(
  351. bottom: BorderSide(width: 0.5, color: Colours.line),
  352. ),
  353. ),
  354. padding: EdgeInsets.only(
  355. // left: ScreenUtil().setWidth(15),
  356. right: ScreenUtil().setWidth(15)),
  357. child: Row(
  358. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  359. children: <Widget>[
  360. Container(
  361. child: Row(children: <Widget>[
  362. // Container(
  363. // padding: EdgeInsets.only(
  364. // right: ScreenUtil().setWidth(10)),
  365. // child: LoadAssetImage(
  366. // // image: AssetImage(i['img']),
  367. // "tab_first/tuijian",
  368. // width: ScreenUtil().setWidth(36),
  369. // height: ScreenUtil().setWidth(36),
  370. // // alignment: Alignment.centerLeft,
  371. // ),
  372. // ),
  373. Container(
  374. // margin: EdgeInsets.only(
  375. // top: ScreenUtil().setHeight(0)),
  376. width: ScreenUtil().setWidth(2),
  377. height: ScreenUtil().setHeight(13),
  378. color: Color(0xFF568AFF),
  379. ),
  380. SizedBox(
  381. width: 5,
  382. ),
  383. Text(
  384. "系统推荐专家",
  385. style: TextStyle(
  386. fontSize: ScreenUtil().setSp(15),
  387. fontWeight: FontWeight.w400),
  388. textAlign: TextAlign.start,
  389. ),
  390. ]),
  391. ),
  392. GestureDetector(
  393. onTap: () {
  394. print("7898");
  395. setState(() {
  396. sortBool = !sortBool;
  397. });
  398. },
  399. child: sortBool
  400. ? Container(
  401. child: Row(children: <Widget>[
  402. Text(
  403. '排序',
  404. style: TextStyle(
  405. fontSize: ScreenUtil().setSp(15),
  406. color: Color(0xff999999)),
  407. textAlign: TextAlign.start,
  408. ),
  409. Container(
  410. padding: EdgeInsets.only(top: 3),
  411. child: Icon(
  412. Icons.keyboard_arrow_down,
  413. size: 26.0,
  414. color: Color(0xffcccccc),
  415. ),
  416. )
  417. ]),
  418. )
  419. : Container(
  420. child: Row(children: <Widget>[
  421. Text(
  422. '排序',
  423. style: TextStyle(
  424. color: Color(0xff01A4FF),
  425. fontSize: ScreenUtil().setSp(15)),
  426. textAlign: TextAlign.start,
  427. ),
  428. Container(
  429. padding: EdgeInsets.only(top: 3),
  430. child: Icon(
  431. Icons.keyboard_arrow_up,
  432. size: 26.0,
  433. color: Color(0xff01A4FF),
  434. ),
  435. )
  436. ]),
  437. ),
  438. ),
  439. ],
  440. )),
  441. )),
  442. !sortBool
  443. ? Positioned(
  444. top: ScreenUtil().setWidth(140),
  445. left: 0,
  446. child: Container(
  447. width: width,
  448. color: Colors.white,
  449. padding: EdgeInsets.only(
  450. left: ScreenUtil().setWidth(15),
  451. right: ScreenUtil().setWidth(15),
  452. bottom: ScreenUtil().setWidth(10)),
  453. child: Column(
  454. crossAxisAlignment: CrossAxisAlignment.start,
  455. children: sortListChiose.asMap().keys.map((index) {
  456. return InkWell(
  457. onTap: () {
  458. print("666");
  459. setState(() {
  460. sortBool = true;
  461. sortName = sortListChiose[index];
  462. if (index == 0) {
  463. sortNum = 0;
  464. lat = null;
  465. lng = null;
  466. sortType = "adopt_counts";
  467. _onRefresh();
  468. } else if (index == 1) {
  469. sortNum = 1;
  470. lat = null;
  471. lng = null;
  472. sortType = "service_counts";
  473. _onRefresh();
  474. } else if (index == 2) {
  475. sortNum = 2;
  476. lat = null;
  477. lng = null;
  478. sortType = "average_score";
  479. _onRefresh();
  480. } else if (index == 3) {
  481. sortNum = 3;
  482. getLocation();
  483. }
  484. indexNowConst = 99999;
  485. checkId = "";
  486. });
  487. },
  488. child: Container(
  489. width: width,
  490. padding: EdgeInsets.only(
  491. bottom: ScreenUtil().setWidth(10),
  492. top: ScreenUtil().setWidth(5)),
  493. decoration: BoxDecoration(
  494. border: Border(
  495. bottom: BorderSide(
  496. width: 0.5, color: Colours.line),
  497. ),
  498. ),
  499. child: Row(
  500. mainAxisAlignment:
  501. MainAxisAlignment.spaceBetween,
  502. children: <Widget>[
  503. Text(
  504. sortListChiose[index],
  505. style: TextStyle(
  506. color: Color(0xff666666),
  507. fontSize: ScreenUtil().setSp(13)),
  508. textAlign: TextAlign.start,
  509. ),
  510. sortNum == index
  511. ? LoadAssetImage('icon_type_Select',
  512. fit: BoxFit.fill)
  513. // Icon(
  514. // const IconData(0xe6de,
  515. // fontFamily: "Iconfont"),
  516. // color: Colours.blue_app_main,
  517. // )
  518. // Text(
  519. // "√",
  520. // style: TextStyle(
  521. // color: sortNum == index
  522. // ? Colours.blue_app_main
  523. // : Colors.transparent,
  524. // fontSize:
  525. // ScreenUtil().setSp(20)),
  526. // textAlign: TextAlign.start,
  527. // )
  528. : Container(
  529. child: null,
  530. ),
  531. ],
  532. )),
  533. );
  534. }).toList(),
  535. )))
  536. : Container(child: null),
  537. ],
  538. ))),
  539. ));
  540. }
  541. Future _onRefresh() async {
  542. _page = 1;
  543. await presenter.getExpertList(
  544. _page, sortType, int.parse(widget.id), lat, lng);
  545. // await presenter.getExpertList(_page,sortType,int.parse(widget.id));
  546. }
  547. Future _loadMore() async {
  548. _page++;
  549. await presenter.getExpertList(
  550. _page, sortType, int.parse(widget.id), lat, lng);
  551. }
  552. @override
  553. ExpertListPresenter createPresenter() {
  554. return ExpertListPresenter();
  555. }
  556. }
  557. class ExpertListWidget extends StatelessWidget {
  558. ExpertListWidget(
  559. {Key key,
  560. this.changeState,
  561. this.indexNow,
  562. this.checkIdConst,
  563. this.item,
  564. this.index})
  565. : super(key: key);
  566. int indexNow;
  567. String checkFalse = "tab_first/check_false";
  568. String checkTrue = "tab_first/check_true";
  569. String checkIdConst;
  570. Function changeState;
  571. dynamic item;
  572. int index;
  573. getLevel(level) {
  574. String img;
  575. if (level == 1) {
  576. img = "L1@2x";
  577. } else if (level == 2) {
  578. img = "L2@2x";
  579. } else if (level == 3) {
  580. img = "L3@2x";
  581. } else if (level == 4) {
  582. img = "L4@2x";
  583. } else if (level == 5) {
  584. img = "L5@2x";
  585. }
  586. return img;
  587. }
  588. @override
  589. Widget build(BuildContext context) {
  590. double width = MediaQuery.of(context).size.width;
  591. return InkWell(
  592. onTap: () {
  593. changeState(index, item.userId.toString());
  594. print(indexNow);
  595. print(66663);
  596. print(item.userId);
  597. },
  598. child: Container(
  599. // height: 20,
  600. padding: EdgeInsets.only(
  601. bottom: ScreenUtil().setWidth(8), top: ScreenUtil().setWidth(10)),
  602. margin: EdgeInsets.only(left: ScreenUtil().setWidth(10)),
  603. decoration: BoxDecoration(
  604. border: Border(
  605. bottom: BorderSide(width: 0.5, color: Colours.line),
  606. ),
  607. ),
  608. child: Row(
  609. crossAxisAlignment: CrossAxisAlignment.start,
  610. children: <Widget>[
  611. // Container(
  612. // padding: EdgeInsets.only(
  613. // top: ScreenUtil().setWidth(10),
  614. // left: ScreenUtil().setWidth(5),
  615. // right: ScreenUtil().setWidth(5),
  616. // bottom: ScreenUtil().setWidth(10)),
  617. // child: LoadAssetImage(
  618. // // image: AssetImage(i['img']),
  619. // indexNow == index ? checkTrue : checkFalse,
  620. // width: ScreenUtil().setWidth(20),
  621. // height: ScreenUtil().setWidth(20),
  622. // // alignment: Alignment.centerLeft,
  623. // ),
  624. // ),
  625. Expanded(
  626. child:
  627. Row(crossAxisAlignment: CrossAxisAlignment.start, children: <
  628. Widget>[
  629. Container(
  630. margin: EdgeInsets.only(
  631. left: ScreenUtil().setWidth(5),
  632. right: ScreenUtil().setWidth(10),
  633. top: ScreenUtil().setWidth(5)),
  634. decoration: BoxDecoration(
  635. borderRadius:
  636. BorderRadius.circular(ScreenUtil().setWidth(27)),
  637. ),
  638. child: Container(
  639. width: ScreenUtil().setWidth(50),
  640. height: ScreenUtil().setWidth(70),
  641. child: Stack(
  642. children: <Widget>[
  643. Container(
  644. padding:
  645. EdgeInsets.only(left: ScreenUtil().setWidth(3)),
  646. child: ClipRRect(
  647. borderRadius:
  648. BorderRadius.all(Radius.circular(50)),
  649. child: LoadNetworkImage(
  650. // image: AssetImage(i['img']),
  651. item.avatarUrl,
  652. width: ScreenUtil().setWidth(44),
  653. height: ScreenUtil().setWidth(44),
  654. // alignment: Alignment.centerLeft,
  655. ),
  656. ),
  657. ),
  658. // Positioned(
  659. // top:ScreenUtil().setWidth(34),
  660. // left: 0,
  661. // child: LoadAssetImage(
  662. // // image: AssetImage(i['img']),
  663. // getLevel(item.expertLevel),
  664. // width: ScreenUtil().setWidth(50),
  665. // height: ScreenUtil().setWidth(13),
  666. // // alignment: Alignment.centerLeft,
  667. // ),
  668. // )
  669. ],
  670. ),
  671. )),
  672. Expanded(
  673. child: Container(
  674. padding:
  675. EdgeInsets.only(right: ScreenUtil().setWidth(15)),
  676. child: Column(
  677. crossAxisAlignment: CrossAxisAlignment.start,
  678. children: <Widget>[
  679. Container(
  680. child: Row(
  681. mainAxisAlignment:
  682. MainAxisAlignment.spaceBetween,
  683. children: <Widget>[
  684. Row(
  685. crossAxisAlignment:
  686. CrossAxisAlignment.center,
  687. children: <Widget>[
  688. Container(
  689. width: width * 0.3,
  690. // width: width * 0.2,
  691. child: Text(
  692. item.name ?? "",
  693. style: TextStyle(
  694. fontSize:
  695. ScreenUtil().setSp(18)),
  696. textAlign: TextAlign.start,
  697. maxLines: 1,
  698. overflow: TextOverflow.ellipsis,
  699. ),
  700. ),
  701. // Container(
  702. // padding: EdgeInsets.only(left: 5,right:5),
  703. // width: width * 0.2,
  704. // child: Text(
  705. // item.proficiencyBrandName ?? "",
  706. // style: TextStyle(
  707. // color: Color(0xff666666),
  708. // fontSize:
  709. // ScreenUtil().setSp(14)),
  710. // textAlign: TextAlign.start,
  711. // maxLines: 1,
  712. // overflow: TextOverflow.ellipsis,
  713. // ),
  714. // ),
  715. // item.platformInvitedFlag==0?Container(
  716. // padding:EdgeInsets.only(left:5,right:5),
  717. // margin: EdgeInsets.only(right:5),
  718. // // color:Colors.red,
  719. // decoration: BoxDecoration(
  720. // borderRadius: BorderRadius.circular(1.0),
  721. // border: Border.all(
  722. // width:0.5,
  723. // color:Color(0xffB0E2FF),
  724. // ),
  725. // ),
  726. // child:Text(
  727. // "特邀专家",
  728. // style: TextStyle(
  729. // color:Color(0xff01A7FF),
  730. // fontSize:ScreenUtil().setSp(12)
  731. // ),
  732. // textAlign:TextAlign.center,
  733. // ),
  734. // ):Container(child: null,)
  735. ]),
  736. // Container(
  737. // child: Text(
  738. // "${item.averageScore ?? 0}分",
  739. // style: TextStyle(
  740. // color: Colors.red,
  741. // fontSize: ScreenUtil().setSp(14)),
  742. // textAlign: TextAlign.end,
  743. // ),
  744. // )
  745. StarItemShow(
  746. starRating: item.averageScore != null
  747. ? double.parse(
  748. item.averageScore.toString())
  749. : 0.0,
  750. ),
  751. ])),
  752. Container(
  753. child: Text(
  754. "擅长品牌:" + (item.proficiencyBrandName ?? ''),
  755. // "擅长:"+(item.proficiency ?? ''),
  756. style: TextStyle(
  757. color: Color(0xff999999),
  758. fontSize: ScreenUtil().setSp(14)),
  759. textAlign: TextAlign.start,
  760. maxLines: 1,
  761. overflow: TextOverflow.ellipsis,
  762. ),
  763. ),
  764. item.platformInvitedFlag == 0
  765. ? Container(
  766. padding: EdgeInsets.only(left: 5, right: 5),
  767. margin: EdgeInsets.only(right: 5, top: 5),
  768. // color:Colors.red,
  769. decoration: BoxDecoration(
  770. borderRadius: BorderRadius.circular(1.0),
  771. border: Border.all(
  772. width: 0.5,
  773. color: Color(0xffB0E2FF),
  774. ),
  775. ),
  776. child: Text(
  777. "特邀专家",
  778. style: TextStyle(
  779. color: Color(0xff01A7FF),
  780. fontSize: ScreenUtil().setSp(12)),
  781. textAlign: TextAlign.center,
  782. ),
  783. )
  784. : Container(
  785. child: null,
  786. ),
  787. Container(
  788. margin: EdgeInsets.only(top: 6),
  789. padding: EdgeInsets.only(top: 6),
  790. decoration: BoxDecoration(
  791. border: Border(
  792. top: BorderSide(
  793. width: 0.5, color: Colours.line),
  794. ),
  795. ),
  796. child: Row(children: <Widget>[
  797. Container(
  798. padding: EdgeInsets.only(right: 5),
  799. child: Text(
  800. dataTable != "2"
  801. ? "¥${item.serviceFee ?? 0}"
  802. : "",
  803. style: TextStyle(
  804. color: Colors.red,
  805. fontSize: ScreenUtil().setSp(16)),
  806. textAlign: TextAlign.start,
  807. ),
  808. ),
  809. Container(
  810. child: Text(
  811. "服务次数${item.serviceCounts ?? 0}",
  812. style: TextStyle(
  813. color: Color(0xff666666),
  814. fontSize: ScreenUtil().setSp(14)),
  815. textAlign: TextAlign.start,
  816. ),
  817. )
  818. ]))
  819. ],
  820. )))
  821. ]),
  822. ),
  823. ],
  824. ),
  825. ),
  826. );
  827. }
  828. }