collect_page.dart 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807
  1. import 'package:flutter/material.dart';
  2. import 'package:liftmanager/res/gaps.dart';
  3. import 'package:liftmanager/net/api_service.dart';
  4. import 'package:liftmanager/utils/toast.dart';
  5. import 'package:liftmanager/widgets/app_bar.dart';
  6. import 'package:liftmanager/internal/search/search_router.dart';
  7. import 'package:liftmanager/widgets/app_search_bar.dart';
  8. import 'package:liftmanager/res/resources.dart';
  9. import 'package:liftmanager/routers/fluro_navigator.dart';
  10. import 'package:liftmanager/widgets/load_image.dart';
  11. import 'package:liftmanager/internal/bbs/bbs_router.dart';
  12. import 'package:liftmanager/internal/means/means_router.dart';
  13. import 'package:liftmanager/widgets/bbs_content.dart';
  14. import 'package:liftmanager/internal/wode/page/video/my_video.dart';
  15. // import 'package:amap_all_fluttify/amap_all_fluttify.dart';
  16. import 'package:provider/provider.dart';
  17. import 'package:permission_handler/permission_handler.dart';
  18. import 'dart:async';
  19. import 'package:flutter_screenutil/flutter_screenutil.dart';
  20. import 'package:liftmanager/mvp/base_page_state.dart';
  21. import 'package:liftmanager/utils/time_format.dart';
  22. import 'package:liftmanager/internal/search/presenter/base_list_provider.dart';
  23. import 'package:liftmanager/widgets/state_layout.dart';
  24. import 'package:liftmanager/widgets/my_refresh_list.dart';
  25. import 'package:liftmanager/utils/url.dart';
  26. import 'package:flutter_spinkit/flutter_spinkit.dart';
  27. import 'dart:convert';
  28. import 'package:liftmanager/internal/wode/wode_router.dart';
  29. import 'package:liftmanager/utils/fast_notification.dart';
  30. import 'package:liftmanager/internal/bbs/model/mix_model.dart';
  31. import 'package:liftmanager/internal/bbs/presenter/mix_list_presenter.dart';
  32. import 'package:liftmanager/common/common.dart';
  33. import 'package:flustars/flustars.dart' as flustars;
  34. class CollectPage extends StatefulWidget {
  35. String index = "1";
  36. @override
  37. CollectPageState createState() => CollectPageState();
  38. }
  39. class CollectPageState extends BasePageState<CollectPage,MixListPresenter> {
  40. // NewsDetailItem item = NewsDetailItem();
  41. BaseListProvider<Records> provider = BaseListProvider<Records>();
  42. int checkIndex = 0;
  43. int _page = 1;
  44. List<String> titleList = [
  45. // "全部",
  46. "问答",
  47. "视频",
  48. "职位",
  49. "商品",
  50. ];
  51. @override
  52. void initState() {
  53. provider.setStateTypeNotNotify(StateType.loading);
  54. super.initState();
  55. _onRefresh();
  56. FastNotification.addListener("collectAction",(collectInit){
  57. if(mounted){
  58. setState(() {
  59. });
  60. _onRefresh();
  61. }
  62. });
  63. }
  64. @override
  65. void didChangeDependencies() {
  66. super.didChangeDependencies();
  67. print(12366);
  68. }
  69. @override
  70. void deactivate() {
  71. super.deactivate();
  72. print(123667);
  73. }
  74. @override
  75. Widget build(BuildContext context) {
  76. double width = MediaQuery.of(context).size.width;
  77. return Scaffold(
  78. appBar: MyAppBar(
  79. centerTitle: "我的收藏",
  80. ),
  81. body:Container(
  82. child: Stack(
  83. children: <Widget>[
  84. Positioned(
  85. child: Container(
  86. padding: EdgeInsets.only(bottom:5),
  87. // color:Color(0xffFAF7FA),
  88. decoration: BoxDecoration(
  89. border: Border(
  90. bottom: BorderSide(width: 0.5, color: Color(0xffeeeeee)),
  91. ),
  92. // color: Color(0xffffffff),
  93. ),
  94. child:Row(
  95. mainAxisAlignment: MainAxisAlignment.spaceAround,
  96. children:titleList.asMap().keys.map((i){
  97. return TabThis(item:titleList[i],tabIndex:i,checkIndex: checkIndex,fun:(){
  98. provider.list.clear();
  99. setState(() {
  100. checkIndex = i;
  101. });
  102. provider.setStateTypeNotNotify(StateType.loading);
  103. _onRefresh();
  104. print(checkIndex);
  105. });
  106. }).toList()
  107. )
  108. ),
  109. ),
  110. Container(
  111. child: ChangeNotifierProvider<BaseListProvider<Records>>(
  112. create: (_) => provider,
  113. child: Column(
  114. children: <Widget>[
  115. SizedBox(
  116. height:ScreenUtil().setWidth(50)
  117. ),
  118. Expanded(
  119. flex: 1,
  120. child: Consumer<BaseListProvider<Records>>(
  121. builder: (_, provider, __) {
  122. return MyListView(
  123. key: Key('mix_list'),
  124. itemCount: provider.list.length,
  125. stateType: provider.stateType,
  126. onRefresh: _onRefresh,
  127. loadMore: _loadMore,
  128. hasMore: provider.hasMore,
  129. itemBuilder: (_, index) {
  130. return Column(
  131. crossAxisAlignment: CrossAxisAlignment.start,
  132. children: <Widget>[
  133. checkIndex == 0?
  134. GestureDetector(
  135. child: provider.list[index]!=null?Container(
  136. padding: EdgeInsets.only(
  137. left: ScreenUtil().setWidth(15),
  138. right: ScreenUtil().setWidth(15),
  139. top: ScreenUtil().setHeight(10),
  140. bottom: ScreenUtil().setHeight(10)),
  141. decoration: BoxDecoration(
  142. border: Border(
  143. bottom: BorderSide(
  144. width: 0.5, color: Colours.line),
  145. ),
  146. ),
  147. child:
  148. Column(
  149. crossAxisAlignment: CrossAxisAlignment.start,
  150. children: <Widget>[
  151. Text(
  152. "[${provider.list[index].brandName??""}]${provider.list[index].title??""}",
  153. textAlign: TextAlign.left,
  154. style: TextStyle(
  155. fontSize: ScreenUtil().setSp(15)),
  156. maxLines: 1,
  157. overflow: TextOverflow.ellipsis,
  158. ),
  159. Container(
  160. padding: EdgeInsets.only(
  161. top: ScreenUtil().setHeight(10),
  162. bottom: ScreenUtil().setHeight(10)),
  163. child: Row(
  164. children: <Widget>[
  165. ClipRRect(
  166. borderRadius:
  167. BorderRadius.circular(
  168. ScreenUtil()
  169. .setWidth(18)),
  170. child: Container(
  171. child: LoadNetworkImage(
  172. provider.list[index].avatarUrl,
  173. width:
  174. ScreenUtil().setWidth(34),
  175. height:
  176. ScreenUtil().setWidth(34),
  177. ),
  178. )),
  179. Container(
  180. padding: EdgeInsets.only(
  181. left:
  182. ScreenUtil().setWidth(10)),
  183. child: Column(
  184. crossAxisAlignment:
  185. CrossAxisAlignment.start,
  186. children: <Widget>[
  187. Text(
  188. provider.list[index].userName??"",
  189. style: TextStyle(
  190. fontSize: ScreenUtil()
  191. .setSp(14),
  192. color: Color(0xff333333)),
  193. ),
  194. Text(
  195. provider
  196. .list[index]
  197. .createTime!=null?DateUtils.instance
  198. .getFormartData(
  199. timeSamp: provider
  200. .list[index]
  201. .createTime,
  202. format: "yyyy-MM-dd"):"",
  203. style: TextStyle(
  204. fontSize: ScreenUtil()
  205. .setSp(12),
  206. color: Color(0xffaaaaaa)),
  207. ),
  208. ],
  209. ),
  210. )
  211. ],
  212. ),
  213. ),
  214. Text(
  215. provider.list[index].expression??"",
  216. textAlign: TextAlign.left,
  217. style: TextStyle(
  218. color: Color(0xff666666),
  219. fontSize: ScreenUtil().setSp(14),
  220. ),
  221. maxLines: 2,
  222. overflow: TextOverflow.ellipsis,
  223. ),
  224. Container(
  225. padding: EdgeInsets.only(
  226. top: ScreenUtil().setHeight(5),
  227. bottom: ScreenUtil().setHeight(5)),
  228. child: Row(
  229. mainAxisAlignment:
  230. MainAxisAlignment.start,
  231. children: provider.list[index].imgs !=
  232. null &&
  233. provider.list[index].imgs
  234. .isNotEmpty
  235. ? List<Widget>.from(provider
  236. .list[index].imgs
  237. .split(",")
  238. .asMap().keys.map((subindex) {
  239. // print(item);
  240. return Container(
  241. padding:subindex<provider
  242. .list[index].imgs.split(",").length-1?EdgeInsets.only(right:6):EdgeInsets.only(right:0),
  243. // color:Colors.red,
  244. // decoration: BoxDecoration(
  245. // borderRadius: BorderRadius.circular(20.0),
  246. // ),
  247. child: ClipRRect(
  248. borderRadius:
  249. BorderRadius.circular(
  250. 10),
  251. child: LoadNetworkImage(
  252. provider
  253. .list[index].imgs.split(",")[subindex],
  254. // height: width/375*75,
  255. height: ScreenUtil()
  256. .setWidth(80),
  257. width: ScreenUtil()
  258. .setWidth(110),
  259. isWater: true,
  260. ),
  261. ),
  262. );
  263. }).toList())
  264. : <Widget>[]),
  265. ),
  266. Text(
  267. "${provider.list[index].likeNum.toString()}人赞",
  268. textAlign: TextAlign.right,
  269. style: TextStyle(
  270. color: Color(0xff999999),
  271. fontSize: ScreenUtil().setSp(14),
  272. ),
  273. )
  274. ]),
  275. ):Center(child: Text("加载中..."),),
  276. onTap: () {
  277. // print(item);
  278. if(provider.list[index].statuz == 1){
  279. NavigatorUtils.push(context,
  280. "${BbsRouter.questionDetail}?id=${provider.list[index].id.toString()}");
  281. }else {
  282. toasts("已下架");
  283. }
  284. },
  285. ):Container(child:null),
  286. checkIndex == 1?
  287. GestureDetector(
  288. child: provider.list[index]!=null?
  289. Container(
  290. padding: EdgeInsets.only(
  291. left: ScreenUtil().setWidth(15),
  292. // right: ScreenUtil().setWidth(15),
  293. top: ScreenUtil().setHeight(10),
  294. bottom: ScreenUtil().setHeight(10)),
  295. decoration: BoxDecoration(
  296. border: Border(
  297. bottom: BorderSide(
  298. width: 0.5, color: Colours.line),
  299. ),
  300. ),
  301. child:
  302. Row(
  303. crossAxisAlignment: CrossAxisAlignment.start,
  304. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  305. children: <Widget>[
  306. Container(
  307. padding: EdgeInsets.only(top:ScreenUtil().setWidth(8),bottom:ScreenUtil().setWidth(8)),
  308. height: width*0.24,
  309. child: Column(
  310. crossAxisAlignment: CrossAxisAlignment.start,
  311. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  312. children: <Widget>[
  313. Container(
  314. width:width*0.5,
  315. child: Text(
  316. "${provider.list[index].title??""}",
  317. style: TextStyle(
  318. fontWeight: FontWeight.w600,
  319. fontSize: ScreenUtil().setSp(17)),
  320. textAlign: TextAlign.start,
  321. maxLines: 1,
  322. overflow: TextOverflow.ellipsis,
  323. ),
  324. ),
  325. Container(
  326. width:width*0.5,
  327. child: Text(
  328. "${provider.list[index].descr??""}",
  329. style: TextStyle(
  330. fontSize: ScreenUtil().setSp(15)),
  331. textAlign: TextAlign.start,
  332. maxLines: 1,
  333. overflow: TextOverflow.ellipsis,
  334. ),
  335. ),
  336. Container(
  337. width: width*0.5,
  338. child: Row(
  339. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  340. children: <Widget>[
  341. Container(
  342. width:width*0.18,
  343. child: Text(
  344. "${provider.list[index].brandName??""}",
  345. style: TextStyle(
  346. color: Color(0xff999999),
  347. fontSize: ScreenUtil().setSp(14)),
  348. textAlign: TextAlign.start,
  349. maxLines: 1,
  350. overflow: TextOverflow.ellipsis,
  351. ),
  352. ),
  353. SizedBox(
  354. width:5
  355. ),
  356. Row(
  357. crossAxisAlignment: CrossAxisAlignment.start,
  358. children: <Widget>[
  359. Text(
  360. "${provider.list[index].likeNum??"0"}",
  361. style: TextStyle(
  362. color: Color(0xff999999),
  363. fontSize: ScreenUtil().setSp(14)),
  364. textAlign: TextAlign.start,
  365. ),
  366. SizedBox(
  367. width:3
  368. ),
  369. Icon(
  370. IconData(0xe7cd,
  371. fontFamily: "myfont"),
  372. size: 14.0,
  373. color: Color(0xff999999),
  374. ),
  375. ],
  376. ),
  377. SizedBox(
  378. width:5
  379. ),
  380. Row(
  381. crossAxisAlignment: CrossAxisAlignment.start,
  382. children: <Widget>[
  383. Text(
  384. "${provider.list[index].browseNum??"0"}",
  385. style: TextStyle(
  386. color: Color(0xff999999),
  387. fontSize: ScreenUtil().setSp(14)),
  388. textAlign: TextAlign.start,
  389. ),
  390. SizedBox(
  391. width:3
  392. ),
  393. Icon(
  394. IconData(0xe610,
  395. fontFamily: "myfont"),
  396. size: 14.0,
  397. color: Color(0xff999999),
  398. ),
  399. ],
  400. ),
  401. ],
  402. ),
  403. )
  404. ]),
  405. ),
  406. Container(
  407. padding: EdgeInsets.only(right:10),
  408. child: Stack(
  409. children: <Widget>[
  410. ClipRRect(
  411. borderRadius:
  412. BorderRadius.circular(1),
  413. child: Container(
  414. child: LoadNetworkImage(
  415. // imgFontUrl +
  416. // provider.list[index].cover,
  417. provider.list[index].cover,
  418. width: width*0.38,
  419. height: width*0.24,
  420. isWater: true,
  421. ),
  422. ),
  423. ),
  424. Positioned(
  425. left: width*0.17,
  426. top: width*0.08,
  427. child: Icon(
  428. IconData(0xe607,
  429. fontFamily: "myfont"),
  430. size: 26.0,
  431. color: Colors.white,
  432. ),
  433. )
  434. ],
  435. )),
  436. ],
  437. )
  438. )
  439. :Center(child:Text("加载中...")),
  440. onTap: () {
  441. if(provider.list[index].statuz == 1){
  442. NavigatorUtils.push(context,
  443. "${BbsRouter.videoDetail}?id=${provider.list[index].id.toString()}");
  444. }else {
  445. toasts("已下架");
  446. }
  447. },
  448. )
  449. :Container(child:null),
  450. checkIndex == 2?
  451. GestureDetector(
  452. child: provider.list[index]!=null?Container(
  453. padding: EdgeInsets.only(
  454. left: ScreenUtil().setWidth(15),
  455. right: ScreenUtil().setWidth(15),
  456. top: ScreenUtil().setHeight(10),
  457. bottom: ScreenUtil().setHeight(10)),
  458. decoration: BoxDecoration(
  459. border: Border(
  460. bottom: BorderSide(
  461. width: 0.5, color: Colours.line),
  462. ),
  463. ),
  464. child: Column(
  465. // crossAxisAlignment: CrossAxisAlignment.start,
  466. children: <Widget>[
  467. Container(
  468. padding: EdgeInsets.only(
  469. bottom: ScreenUtil().setHeight(5)),
  470. child: Row(
  471. mainAxisAlignment:
  472. MainAxisAlignment.spaceBetween,
  473. children: <Widget>[
  474. Container(
  475. width: width*0.4,
  476. child: Text(
  477. provider.list[index].job ?? '',
  478. textAlign: TextAlign.left,
  479. style: TextStyle(
  480. fontSize:
  481. ScreenUtil().setSp(17),
  482. color: Color(0xff333333),
  483. ),
  484. overflow: TextOverflow.ellipsis,
  485. ),
  486. ),
  487. Container(
  488. width:width*0.4,
  489. child:Text(
  490. // 'jiage',
  491. "¥" +
  492. provider
  493. .list[index].lowerSalary
  494. .toString() +
  495. "-" +
  496. provider
  497. .list[index].upperSalary
  498. .toString(),
  499. textAlign: TextAlign.right,
  500. style: TextStyle(
  501. fontSize:
  502. ScreenUtil().setSp(17),
  503. color: Color(0xffff0000),
  504. ),
  505. overflow: TextOverflow.ellipsis,
  506. ),
  507. )
  508. ],
  509. ),
  510. ),
  511. Row(
  512. mainAxisAlignment:
  513. MainAxisAlignment.spaceBetween,
  514. children: <Widget>[
  515. Container(
  516. width: width*0.5,
  517. child: Text(
  518. provider.list[index].companyName!=null ?provider.list[index].companyName:'',
  519. textAlign: TextAlign.left,
  520. overflow: TextOverflow.ellipsis,
  521. style: TextStyle(
  522. fontSize:
  523. ScreenUtil().setSp(14),
  524. color: Color(0xff999999),
  525. ),
  526. ),
  527. ),
  528. provider.list[index]
  529. .provinceName !=
  530. null?Container(
  531. width: width*0.35,
  532. child: Text(
  533. (provider.list[index]
  534. .provinceName !=
  535. null
  536. ? provider
  537. .list[index].provinceName
  538. : '') +
  539. "-" +
  540. (provider.list[index]
  541. .cityName !=
  542. null
  543. ? provider
  544. .list[index].cityName
  545. : ''),
  546. textAlign: TextAlign.right,
  547. overflow: TextOverflow.ellipsis,
  548. style: TextStyle(
  549. fontSize:
  550. ScreenUtil().setSp(14),
  551. color: Color(0xff999999),
  552. ),
  553. ),
  554. ):Container(child:null),
  555. ],
  556. ),
  557. Row(
  558. mainAxisAlignment:
  559. MainAxisAlignment.spaceBetween,
  560. children: <Widget>[
  561. Container(
  562. width: width * 0.65,
  563. child: Text(
  564. provider.list[index].info ?? '',
  565. textAlign: TextAlign.left,
  566. style: TextStyle(
  567. fontSize:
  568. ScreenUtil().setSp(14),
  569. color: Color(0xff999999),
  570. ),
  571. overflow: TextOverflow.ellipsis,
  572. ),
  573. ),
  574. Text(
  575. provider
  576. .list[index].createTime!=null?DateUtils.instance.getFormartData(
  577. timeSamp: provider
  578. .list[index].createTime,
  579. format: "yyyy-MM-dd"):"",
  580. textAlign: TextAlign.left,
  581. style: TextStyle(
  582. fontSize: ScreenUtil().setSp(14),
  583. color: Color(0xff999999),
  584. ),
  585. ),
  586. ],
  587. ),
  588. ]),
  589. ):Center(child: Text("加载中..."),),
  590. onTap: () {
  591. if(provider.list[index].statuz == 1){
  592. NavigatorUtils.push(context,
  593. "${BbsRouter.positionDetail}?id=${provider.list[index].id.toString()}");
  594. }else {
  595. toasts("已下架");
  596. }
  597. },
  598. )
  599. :Container(child:null),
  600. checkIndex == 3?
  601. InkWell(
  602. child: provider.list[index]!=null?Container(
  603. padding: EdgeInsets.only(
  604. left: ScreenUtil().setWidth(15),
  605. right: ScreenUtil().setWidth(15),
  606. top: ScreenUtil().setHeight(10),
  607. bottom: ScreenUtil().setHeight(10)),
  608. decoration: BoxDecoration(
  609. border: Border(
  610. bottom: BorderSide(
  611. width: 0.5, color: Colours.line),
  612. ),
  613. ),
  614. child: Row(
  615. crossAxisAlignment: CrossAxisAlignment.start,
  616. children: <Widget>[
  617. ClipRRect(
  618. borderRadius: BorderRadius.circular(5),
  619. child: Container(
  620. padding: EdgeInsets.only(
  621. right: ScreenUtil().setWidth(10)),
  622. child: LoadNetworkImage(
  623. provider.list[index].imgs.split(",")[0],
  624. width: ScreenUtil().setWidth(90),
  625. height: ScreenUtil().setWidth(90),
  626. isWater: true,
  627. ),
  628. ),
  629. ),
  630. Column(
  631. crossAxisAlignment:
  632. CrossAxisAlignment.start,
  633. children: <Widget>[
  634. Text(
  635. provider.list[index].sname??"",
  636. textAlign: TextAlign.left,
  637. style: TextStyle(
  638. fontSize: ScreenUtil().setSp(15),
  639. color: Color(0xff333333),
  640. ),
  641. ),
  642. Text(
  643. provider.list[index].bname??""
  644. .toString(),
  645. textAlign: TextAlign.left,
  646. style: TextStyle(
  647. fontSize: ScreenUtil().setSp(14),
  648. color: Color(0xff666666),
  649. ),
  650. ),
  651. Text(
  652. "供应商:${provider.list[index].manufacturer}",
  653. textAlign: TextAlign.left,
  654. style: TextStyle(
  655. fontSize: ScreenUtil().setSp(14),
  656. color: Color(0xff666666),
  657. ),
  658. ),
  659. Text(
  660. "Tel:${provider.list[index].telephone}",
  661. textAlign: TextAlign.left,
  662. style: TextStyle(
  663. fontSize: ScreenUtil().setSp(14),
  664. color: Color(0xff666666),
  665. ),
  666. ),
  667. ],
  668. ),
  669. ]),
  670. ):Center(child: Text("加载中..."),),
  671. onTap: () {
  672. print(index);
  673. if(provider.list[index].statuz == 1){
  674. NavigatorUtils.push(context,
  675. "${BbsRouter.productDetail}?id=${provider.list[index].id.toString()}");
  676. }else {
  677. toasts("已下架");
  678. }
  679. },
  680. )
  681. :Container(child:null),
  682. ],
  683. );
  684. },
  685. );
  686. }))
  687. ],
  688. )
  689. ))
  690. ],
  691. )
  692. )
  693. );
  694. }
  695. Future _onRefresh() async {
  696. _page = 1;
  697. if(checkIndex==0){
  698. await presenter.getQuestionList(_page);
  699. }
  700. else if(checkIndex==1){
  701. await presenter.getVideoList(_page);
  702. }
  703. else if(checkIndex==2){
  704. await presenter.getPositionList(_page);
  705. }
  706. else if(checkIndex==3){
  707. await presenter.getShopList(_page);
  708. }
  709. }
  710. Future _loadMore() async {
  711. _page++;
  712. if(checkIndex==0){
  713. await presenter.getQuestionList(_page);
  714. }else if(checkIndex==1){
  715. await presenter.getVideoList(_page);
  716. }
  717. else if(checkIndex==2){
  718. await presenter.getPositionList(_page);
  719. }
  720. else if(checkIndex==3){
  721. await presenter.getShopList(_page);
  722. }
  723. }
  724. @override
  725. MixListPresenter createPresenter() {
  726. return MixListPresenter();
  727. }
  728. }
  729. class TabThis extends StatelessWidget {
  730. TabThis({Key key,this.item,this.tabIndex,this.fun,this.checkIndex}) : super(key: key);
  731. String item;
  732. int tabIndex;
  733. int checkIndex;
  734. Function fun;
  735. @override
  736. Widget build(BuildContext context) {
  737. return Container(
  738. padding: EdgeInsets.only(top:ScreenUtil().setWidth(10)),
  739. child: Container(
  740. child:Row(
  741. mainAxisAlignment: MainAxisAlignment.center,
  742. children:<Widget>[
  743. GestureDetector(
  744. onTap: (){
  745. fun();
  746. },
  747. child: Container(
  748. padding: EdgeInsets.only(bottom:6),
  749. decoration: BoxDecoration(
  750. border: Border(
  751. bottom: BorderSide(width: 2, color: checkIndex==tabIndex? Color(0xff02A0FD):Colors.transparent),
  752. ),
  753. // color: Color(0xff9FD1FE),
  754. ),
  755. child:Text(
  756. item,
  757. style: TextStyle(
  758. color:checkIndex==tabIndex? Color(0xff02A0FD):Color(0xff666666),
  759. fontSize:ScreenUtil().setSp(14)
  760. ),
  761. textAlign:TextAlign.center,
  762. ),
  763. )
  764. )
  765. ]
  766. )
  767. ),
  768. );
  769. }
  770. }