rewards_page.dart 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962
  1. import 'package:cpt_rewards/modules/rewards_address/rewards_address_page.dart';
  2. import 'package:cpt_rewards/modules/rewards_code/rewards_code_page.dart';
  3. import 'package:cpt_rewards/modules/rewards_history/rewards_history_page.dart';
  4. import 'package:cpt_rewards/modules/rewards_home/rewards_home_page.dart';
  5. import 'package:cpt_rewards/modules/rewards_list/rewards_list_page.dart';
  6. import 'package:cpt_rewards/modules/rewards_my/rewards_my_page.dart';
  7. import 'package:cs_resources/generated/assets.dart';
  8. import 'package:domain/entity/rewards_index_entity.dart';
  9. import 'package:flutter/material.dart';
  10. import 'package:auto_route/auto_route.dart';
  11. import 'package:flutter_hooks/flutter_hooks.dart';
  12. import 'package:hooks_riverpod/hooks_riverpod.dart';
  13. import 'package:plugin_platform/engine/image/image_nine_grid.dart';
  14. import 'package:router/ext/auto_router_extensions.dart';
  15. import 'package:shared/utils/color_utils.dart';
  16. import 'package:shared/utils/log_utils.dart';
  17. import 'package:widgets/ext/ex_widget.dart';
  18. import 'package:widgets/load_state_layout.dart';
  19. import 'package:widgets/my_load_image.dart';
  20. import 'package:widgets/widget_export.dart';
  21. import '../../../router/page/rewards_page_router.dart';
  22. import './rewards_vm.dart';
  23. @RoutePage()
  24. class RewardsPage extends HookConsumerWidget {
  25. const RewardsPage({Key? key}) : super(key: key);
  26. //启动当前页面
  27. static void startInstance({BuildContext? context}) {
  28. if (context != null) {
  29. context.router.push(const RewardsPageRoute());
  30. } else {
  31. appRouter.push(const RewardsPageRoute());
  32. }
  33. }
  34. Widget _buildTop(BuildContext context, WidgetRef ref, _vm) {
  35. // List itemsList = _vm.state.list.toList();
  36. return Container(
  37. decoration: BoxDecoration(
  38. border: Border(
  39. bottom: BorderSide(
  40. color: ColorUtils.string2Color('#4161D0'), // 设置bottom边框的颜色
  41. width: 45.0, // 设置bottom边框的宽度
  42. )),
  43. borderRadius: const BorderRadius.only(
  44. topLeft: Radius.circular(0.0),
  45. topRight: Radius.circular(0.0),
  46. bottomLeft: Radius.circular(30.0),
  47. bottomRight: Radius.circular(30.0),
  48. ), // 圆角
  49. ),
  50. child: Column(
  51. crossAxisAlignment: CrossAxisAlignment.start,
  52. children: [
  53. Row(
  54. crossAxisAlignment: CrossAxisAlignment.center,
  55. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  56. children: [
  57. const MyAssetImage(
  58. Assets.rewardsRewardsBack,
  59. width: 44,
  60. height: 44,
  61. ).onTap(() {
  62. // backCallback
  63. Navigator.pop(context);
  64. }),
  65. const Text(
  66. 'Daily Login',
  67. style: TextStyle(
  68. fontSize: 18.0,
  69. color: Colors.white,
  70. fontWeight: FontWeight.w500), // 设置字体大小
  71. ),
  72. const MyAssetImage(
  73. Assets.rewardsRewardsIconWen,
  74. width: 20,
  75. height: 20,
  76. )
  77. ],
  78. ),
  79. // const Text(
  80. // '1526 Available Points',
  81. // style: TextStyle(
  82. // fontSize: 18.0,
  83. // color: Colors.white,
  84. // fontWeight: FontWeight.w500), // 设置字体大小
  85. // ).paddingOnly(left: 10, top: 20, bottom: 18),
  86. Row(
  87. crossAxisAlignment: CrossAxisAlignment.center,
  88. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  89. children: [
  90. const Text(
  91. 'Available Points',
  92. style: TextStyle(
  93. fontSize: 17.0,
  94. color: Colors.white,
  95. fontWeight: FontWeight.w500), // 设置字体大小
  96. ),
  97. Container(
  98. decoration: BoxDecoration(
  99. border: Border.all(color: Colors.white, width: 1), // 边框
  100. borderRadius: BorderRadius.circular(8), // 圆角
  101. ),
  102. child: Row(
  103. children: [
  104. const MyAssetImage(
  105. Assets.rewardsRewardsIconJb,
  106. width: 23,
  107. height: 23,
  108. ).marginOnly(right: 5),
  109. const Text(
  110. '1022',
  111. style: TextStyle(
  112. fontSize: 15.0,
  113. color: Colors.white,
  114. fontWeight: FontWeight.w400), // 设置字体大小
  115. ),
  116. ],
  117. ).paddingOnly(left: 10, top: 7, bottom: 7, right: 10),
  118. ),
  119. ],
  120. ).paddingOnly(left: 10, top: 20, bottom: 18),
  121. ],
  122. )
  123. .paddingOnly(top: 15, left: 5, right: 15, bottom: 0)
  124. .border(bottom: 0, color: ColorUtils.string2Color('#4161D0'))
  125. .backgroundColor(ColorUtils.string2Color('#4161D0')));
  126. }
  127. Widget _buildSearch(BuildContext context, WidgetRef ref, _vm, list) {
  128. return Container(
  129. width: MediaQuery.of(context).size.width - 30,
  130. decoration: BoxDecoration(
  131. color: Colors.white,
  132. borderRadius: BorderRadius.circular(10),
  133. boxShadow: const [
  134. BoxShadow(color: Color.fromRGBO(184, 191, 217, 0.3), blurRadius: 6)
  135. ],
  136. ),
  137. child: Column(
  138. crossAxisAlignment: CrossAxisAlignment.start,
  139. mainAxisAlignment: MainAxisAlignment.center,
  140. children: [
  141. Text(
  142. 'Continuous Login 8 Day',
  143. style: TextStyle(
  144. fontSize: 15.0,
  145. color: ColorUtils.string2Color('#000000'),
  146. fontWeight: FontWeight.w500), // 设置字体大小
  147. ),
  148. Flex(
  149. direction: Axis.horizontal,
  150. children: [
  151. Expanded(
  152. flex: 1,
  153. child: Container(
  154. decoration: BoxDecoration(
  155. color: ColorUtils.string2Color('#F2F3F6'),
  156. borderRadius: BorderRadius.circular(10),
  157. border: Border.all(
  158. color: ColorUtils.string2Color('#4161D0'), width: 1),
  159. ),
  160. height: 78,
  161. child: Column(
  162. crossAxisAlignment: CrossAxisAlignment.center,
  163. mainAxisAlignment: MainAxisAlignment.center,
  164. children: [
  165. Text(
  166. '11/01',
  167. style: TextStyle(
  168. fontSize: 13.0,
  169. color: ColorUtils.string2Color('#4161D0'),
  170. fontWeight: FontWeight.w400), // 设置字体大小
  171. ),
  172. const MyAssetImage(
  173. Assets.rewardsRewardsIconJb,
  174. width: 23,
  175. height: 23,
  176. ),
  177. Text(
  178. '+2',
  179. style: TextStyle(
  180. fontSize: 15.0,
  181. color: ColorUtils.string2Color('#4161D0'),
  182. fontWeight: FontWeight.w500), // 设置字体大小
  183. ),
  184. ],
  185. ),
  186. ),
  187. ),
  188. const SizedBox(width: 15.0),
  189. Expanded(
  190. flex: 1,
  191. child: Container(
  192. decoration: BoxDecoration(
  193. color: ColorUtils.string2Color('#4161D0'),
  194. borderRadius: BorderRadius.circular(10),
  195. border: Border.all(
  196. color: ColorUtils.string2Color('#4161D0'), width: 1),
  197. ),
  198. height: 78,
  199. child: Column(
  200. crossAxisAlignment: CrossAxisAlignment.center,
  201. mainAxisAlignment: MainAxisAlignment.center,
  202. children: [
  203. Text(
  204. 'Today',
  205. style: TextStyle(
  206. fontSize: 13.0,
  207. color: ColorUtils.string2Color('#ffffff'),
  208. fontWeight: FontWeight.w400), // 设置字体大小
  209. ),
  210. const MyAssetImage(
  211. Assets.rewardsRewardsIconJb,
  212. width: 23,
  213. height: 23,
  214. ),
  215. Text(
  216. '+2',
  217. style: TextStyle(
  218. fontSize: 15.0,
  219. color: ColorUtils.string2Color('#ffffff'),
  220. fontWeight: FontWeight.w500), // 设置字体大小
  221. ),
  222. ],
  223. ),
  224. ),
  225. ),
  226. const SizedBox(width: 15.0),
  227. Expanded(
  228. flex: 1,
  229. child: Container(
  230. decoration: BoxDecoration(
  231. color: ColorUtils.string2Color('#F2F3F6'),
  232. borderRadius: BorderRadius.circular(10),
  233. border: Border.all(
  234. color: ColorUtils.string2Color('#F2F3F6'), width: 1),
  235. ),
  236. height: 78,
  237. child: Column(
  238. crossAxisAlignment: CrossAxisAlignment.center,
  239. mainAxisAlignment: MainAxisAlignment.center,
  240. children: [
  241. Text(
  242. 'Today',
  243. style: TextStyle(
  244. fontSize: 13.0,
  245. color: ColorUtils.string2Color('#000000'),
  246. fontWeight: FontWeight.w400), // 设置字体大小
  247. ),
  248. const MyAssetImage(
  249. Assets.rewardsRewardsIconJb,
  250. width: 23,
  251. height: 23,
  252. ),
  253. Text(
  254. '+2',
  255. style: TextStyle(
  256. fontSize: 15.0,
  257. color: ColorUtils.string2Color('#000000'),
  258. fontWeight: FontWeight.w500), // 设置字体大小
  259. ),
  260. ],
  261. ),
  262. ),
  263. ),
  264. const SizedBox(width: 15.0),
  265. Expanded(
  266. flex: 1,
  267. child: Container(
  268. decoration: BoxDecoration(
  269. color: ColorUtils.string2Color('#F2F3F6'),
  270. borderRadius: BorderRadius.circular(10),
  271. border: Border.all(
  272. color: ColorUtils.string2Color('#F2F3F6'), width: 1),
  273. ),
  274. height: 78,
  275. child: Column(
  276. crossAxisAlignment: CrossAxisAlignment.center,
  277. mainAxisAlignment: MainAxisAlignment.center,
  278. children: [
  279. Text(
  280. 'Today',
  281. style: TextStyle(
  282. fontSize: 13.0,
  283. color: ColorUtils.string2Color('#000000'),
  284. fontWeight: FontWeight.w400), // 设置字体大小
  285. ),
  286. const MyAssetImage(
  287. Assets.rewardsRewardsIconJb,
  288. width: 23,
  289. height: 23,
  290. ),
  291. Text(
  292. '+2',
  293. style: TextStyle(
  294. fontSize: 15.0,
  295. color: ColorUtils.string2Color('#000000'),
  296. fontWeight: FontWeight.w500), // 设置字体大小
  297. ),
  298. ],
  299. ),
  300. ),
  301. ),
  302. ],
  303. ).marginOnly(top: 13, bottom: 13),
  304. Flex(
  305. direction: Axis.horizontal,
  306. children: [
  307. Expanded(
  308. flex: 1,
  309. child: Container(
  310. decoration: BoxDecoration(
  311. color: ColorUtils.string2Color('#F2F3F6'),
  312. borderRadius: BorderRadius.circular(10),
  313. border: Border.all(
  314. color: ColorUtils.string2Color('#F2F3F6'), width: 1),
  315. ),
  316. height: 78,
  317. child: Column(
  318. crossAxisAlignment: CrossAxisAlignment.center,
  319. mainAxisAlignment: MainAxisAlignment.center,
  320. children: [
  321. Text(
  322. 'Today',
  323. style: TextStyle(
  324. fontSize: 13.0,
  325. color: ColorUtils.string2Color('#000000'),
  326. fontWeight: FontWeight.w400), // 设置字体大小
  327. ),
  328. const MyAssetImage(
  329. Assets.rewardsRewardsIconJb,
  330. width: 23,
  331. height: 23,
  332. ),
  333. Text(
  334. '+2',
  335. style: TextStyle(
  336. fontSize: 15.0,
  337. color: ColorUtils.string2Color('#000000'),
  338. fontWeight: FontWeight.w500), // 设置字体大小
  339. ),
  340. ],
  341. ),
  342. ),
  343. ),
  344. const SizedBox(width: 15.0),
  345. Expanded(
  346. flex: 1,
  347. child: Container(
  348. decoration: BoxDecoration(
  349. color: ColorUtils.string2Color('#F2F3F6'),
  350. borderRadius: BorderRadius.circular(10),
  351. border: Border.all(
  352. color: ColorUtils.string2Color('#F2F3F6'), width: 1),
  353. ),
  354. height: 78,
  355. child: Column(
  356. crossAxisAlignment: CrossAxisAlignment.center,
  357. mainAxisAlignment: MainAxisAlignment.center,
  358. children: [
  359. Text(
  360. 'Today',
  361. style: TextStyle(
  362. fontSize: 13.0,
  363. color: ColorUtils.string2Color('#000000'),
  364. fontWeight: FontWeight.w400), // 设置字体大小
  365. ),
  366. const MyAssetImage(
  367. Assets.rewardsRewardsIconJb,
  368. width: 23,
  369. height: 23,
  370. ),
  371. Text(
  372. '+2',
  373. style: TextStyle(
  374. fontSize: 15.0,
  375. color: ColorUtils.string2Color('#000000'),
  376. fontWeight: FontWeight.w500), // 设置字体大小
  377. ),
  378. ],
  379. ),
  380. ),
  381. ),
  382. const SizedBox(width: 15.0),
  383. Expanded(
  384. flex: 2,
  385. child: Container(
  386. decoration: BoxDecoration(
  387. color: ColorUtils.string2Color('#F2F3F6'),
  388. borderRadius: BorderRadius.circular(10),
  389. border: Border.all(
  390. color: ColorUtils.string2Color('#F2F3F6'), width: 1),
  391. ),
  392. height: 78,
  393. child: Row(
  394. crossAxisAlignment: CrossAxisAlignment.start,
  395. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  396. children: [
  397. Column(
  398. crossAxisAlignment: CrossAxisAlignment.center,
  399. // mainAxisAlignment: MainAxisAlignment.center,
  400. children: [
  401. Text(
  402. 'Today',
  403. style: TextStyle(
  404. fontSize: 13.0,
  405. color: ColorUtils.string2Color('#000000'),
  406. fontWeight: FontWeight.w400), // 设置字体大小
  407. ),
  408. Text(
  409. '+ More',
  410. style: TextStyle(
  411. fontSize: 12.0,
  412. color: ColorUtils.string2Color('#000000'),
  413. fontWeight: FontWeight.w500), // 设置字体大小
  414. ),
  415. ],
  416. ),
  417. const MyAssetImage(
  418. Assets.rewardsRewardsIconYdjb,
  419. width: 67,
  420. height: 57,
  421. ).paddingOnly(top: 7),
  422. ],
  423. ).paddingOnly(top: 8, left: 13, right: 4),
  424. ),
  425. ),
  426. ],
  427. ),
  428. ],
  429. ).paddingOnly(left: 15, right: 15, top: 15, bottom: 15),
  430. );
  431. }
  432. Widget _buildSwiper(BuildContext context, WidgetRef ref, _vm) {
  433. return Container(
  434. // color: Colors.white,
  435. height: 55,
  436. decoration: BoxDecoration(
  437. color: Colors.white,
  438. borderRadius: BorderRadius.circular(10),
  439. boxShadow: const [
  440. BoxShadow(color: Color.fromRGBO(184, 191, 217, 0.3), blurRadius: 6)
  441. ],
  442. ),
  443. child: Row(
  444. crossAxisAlignment: CrossAxisAlignment.center,
  445. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  446. children: [
  447. Text(
  448. 'How To Get Rewards?',
  449. style: TextStyle(
  450. fontSize: 15.0,
  451. color: ColorUtils.string2Color('#000000'),
  452. fontWeight: FontWeight.w500), // 设置字体大小
  453. ),
  454. Container(
  455. padding:
  456. const EdgeInsets.only(top: 10, bottom: 10, left: 17, right: 17),
  457. decoration: BoxDecoration(
  458. color: ColorUtils.string2Color('#4161D0'),
  459. borderRadius: BorderRadius.circular(5),
  460. ),
  461. child: Text(
  462. 'Rewards',
  463. style: TextStyle(
  464. fontSize: 14.0,
  465. color: ColorUtils.string2Color('#ffffff'),
  466. fontWeight: FontWeight.w400), // 设置字体大小
  467. ).onTap(() {
  468. RewardsHomePage.startInstance();
  469. }),
  470. ),
  471. ],
  472. ).paddingOnly(left: 15, right: 15),
  473. ).marginOnly(top: 12, bottom: 12);
  474. }
  475. Widget _buildList(BuildContext context, WidgetRef ref, _vm) {
  476. return Container(
  477. decoration: BoxDecoration(
  478. color: Colors.white,
  479. borderRadius: BorderRadius.circular(10),
  480. boxShadow: const [
  481. BoxShadow(color: Color.fromRGBO(184, 191, 217, 0.3), blurRadius: 6)
  482. ],
  483. ),
  484. child: Column(
  485. crossAxisAlignment: CrossAxisAlignment.center,
  486. mainAxisAlignment: MainAxisAlignment.center,
  487. children: [
  488. Container(
  489. padding:
  490. const EdgeInsets.only(top: 15, bottom: 15, left: 15, right: 15),
  491. decoration: BoxDecoration(
  492. border: Border(
  493. bottom: BorderSide(
  494. width: 1.0, // 底边边框的宽度
  495. color: ColorUtils.string2Color('#F2F3F6'), // 底边边框的颜色
  496. ))),
  497. child: Row(
  498. crossAxisAlignment: CrossAxisAlignment.center,
  499. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  500. children: [
  501. Row(
  502. children: [
  503. Container(
  504. padding: const EdgeInsets.only(
  505. top: 10, bottom: 10, left: 17, right: 17),
  506. decoration: BoxDecoration(
  507. color: ColorUtils.string2Color('#f2f3f6'),
  508. borderRadius: BorderRadius.circular(5),
  509. ),
  510. child: const MyAssetImage(
  511. Assets.rewardsRewardsIconIm,
  512. width: 29,
  513. height: 24,
  514. ),
  515. ).marginOnly(right: 12),
  516. Column(
  517. crossAxisAlignment: CrossAxisAlignment.start,
  518. mainAxisAlignment: MainAxisAlignment.center,
  519. children: [
  520. Text(
  521. 'Daily Login',
  522. style: TextStyle(
  523. fontSize: 15.0,
  524. color: ColorUtils.string2Color('#000000'),
  525. fontWeight: FontWeight.w500), // 设置字体大小
  526. ).marginOnly(bottom: 6),
  527. Row(
  528. children: [
  529. Text(
  530. '+2',
  531. style: TextStyle(
  532. fontSize: 15.0,
  533. color: ColorUtils.string2Color('#4161D0'),
  534. fontWeight: FontWeight.w500), // 设置字体大小
  535. ),
  536. const MyAssetImage(
  537. Assets.rewardsRewardsIconJb,
  538. width: 14,
  539. height: 14,
  540. )
  541. ],
  542. )
  543. ],
  544. )
  545. ],
  546. ),
  547. Container(
  548. width: 86,
  549. height: 30,
  550. decoration: BoxDecoration(
  551. color: ColorUtils.string2Color('#ffffff'),
  552. borderRadius: BorderRadius.circular(5),
  553. border: Border.all(
  554. color: ColorUtils.string2Color('#4161D0'), width: 1),
  555. ),
  556. child: Center(
  557. child: Text(
  558. 'Check In',
  559. style: TextStyle(
  560. fontSize: 14.0,
  561. color: ColorUtils.string2Color('#4161D0'),
  562. fontWeight: FontWeight.w400), // 设置字体大小
  563. ),
  564. ),
  565. ),
  566. ],
  567. ),
  568. ),
  569. Container(
  570. padding:
  571. const EdgeInsets.only(top: 15, bottom: 15, left: 15, right: 15),
  572. decoration: BoxDecoration(
  573. border: Border(
  574. bottom: BorderSide(
  575. width: 1.0, // 底边边框的宽度
  576. color: ColorUtils.string2Color('#F2F3F6'), // 底边边框的颜色
  577. ))),
  578. child: Row(
  579. crossAxisAlignment: CrossAxisAlignment.center,
  580. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  581. children: [
  582. Row(
  583. children: [
  584. Container(
  585. padding: const EdgeInsets.only(
  586. top: 10, bottom: 10, left: 17, right: 17),
  587. decoration: BoxDecoration(
  588. color: ColorUtils.string2Color('#f2f3f6'),
  589. borderRadius: BorderRadius.circular(5),
  590. ),
  591. child: const MyAssetImage(
  592. Assets.rewardsRewardsIconIm,
  593. width: 29,
  594. height: 24,
  595. ),
  596. ).marginOnly(right: 12),
  597. Column(
  598. crossAxisAlignment: CrossAxisAlignment.start,
  599. mainAxisAlignment: MainAxisAlignment.center,
  600. children: [
  601. Text(
  602. 'Daily Login',
  603. style: TextStyle(
  604. fontSize: 15.0,
  605. color: ColorUtils.string2Color('#000000'),
  606. fontWeight: FontWeight.w500), // 设置字体大小
  607. ).marginOnly(bottom: 6),
  608. Row(
  609. children: [
  610. Text(
  611. '+2',
  612. style: TextStyle(
  613. fontSize: 15.0,
  614. color: ColorUtils.string2Color('#4161D0'),
  615. fontWeight: FontWeight.w500), // 设置字体大小
  616. ),
  617. const MyAssetImage(
  618. Assets.rewardsRewardsIconJb,
  619. width: 14,
  620. height: 14,
  621. )
  622. ],
  623. )
  624. ],
  625. )
  626. ],
  627. ),
  628. Container(
  629. width: 86,
  630. height: 30,
  631. decoration: BoxDecoration(
  632. color: ColorUtils.string2Color('#ffffff'),
  633. borderRadius: BorderRadius.circular(5),
  634. border: Border.all(
  635. color: ColorUtils.string2Color('#4161D0'), width: 1),
  636. ),
  637. child: Center(
  638. child: Text(
  639. 'Check In',
  640. style: TextStyle(
  641. fontSize: 14.0,
  642. color: ColorUtils.string2Color('#4161D0'),
  643. fontWeight: FontWeight.w400), // 设置字体大小
  644. ),
  645. ),
  646. ),
  647. ],
  648. ),
  649. ),
  650. Container(
  651. padding:
  652. const EdgeInsets.only(top: 15, bottom: 15, left: 15, right: 15),
  653. decoration: BoxDecoration(
  654. border: Border(
  655. bottom: BorderSide(
  656. width: 1.0, // 底边边框的宽度
  657. color: ColorUtils.string2Color('#F2F3F6'), // 底边边框的颜色
  658. ))),
  659. child: Row(
  660. crossAxisAlignment: CrossAxisAlignment.center,
  661. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  662. children: [
  663. Row(
  664. children: [
  665. Container(
  666. padding: const EdgeInsets.only(
  667. top: 10, bottom: 10, left: 17, right: 17),
  668. decoration: BoxDecoration(
  669. color: ColorUtils.string2Color('#f2f3f6'),
  670. borderRadius: BorderRadius.circular(5),
  671. ),
  672. child: const MyAssetImage(
  673. Assets.rewardsRewardsIconIm,
  674. width: 29,
  675. height: 24,
  676. ),
  677. ).marginOnly(right: 12),
  678. Column(
  679. crossAxisAlignment: CrossAxisAlignment.start,
  680. mainAxisAlignment: MainAxisAlignment.center,
  681. children: [
  682. Text(
  683. 'Daily Login',
  684. style: TextStyle(
  685. fontSize: 15.0,
  686. color: ColorUtils.string2Color('#000000'),
  687. fontWeight: FontWeight.w500), // 设置字体大小
  688. ).marginOnly(bottom: 6),
  689. Row(
  690. children: [
  691. Text(
  692. '+2',
  693. style: TextStyle(
  694. fontSize: 15.0,
  695. color: ColorUtils.string2Color('#4161D0'),
  696. fontWeight: FontWeight.w500), // 设置字体大小
  697. ),
  698. const MyAssetImage(
  699. Assets.rewardsRewardsIconJb,
  700. width: 14,
  701. height: 14,
  702. )
  703. ],
  704. )
  705. ],
  706. )
  707. ],
  708. ),
  709. Container(
  710. width: 86,
  711. height: 30,
  712. decoration: BoxDecoration(
  713. color: ColorUtils.string2Color('#ffffff'),
  714. borderRadius: BorderRadius.circular(5),
  715. border: Border.all(
  716. color: ColorUtils.string2Color('#4161D0'), width: 1),
  717. ),
  718. child: Center(
  719. child: Text(
  720. 'Check In',
  721. style: TextStyle(
  722. fontSize: 14.0,
  723. color: ColorUtils.string2Color('#4161D0'),
  724. fontWeight: FontWeight.w400), // 设置字体大小
  725. ),
  726. ),
  727. ),
  728. ],
  729. ),
  730. )
  731. ],
  732. ),
  733. ).marginOnly(bottom: 12);
  734. }
  735. Widget _buildHistory(BuildContext context, WidgetRef ref, _vm) {
  736. return Container(
  737. decoration: BoxDecoration(
  738. color: Colors.white,
  739. borderRadius: BorderRadius.circular(10),
  740. boxShadow: const [
  741. BoxShadow(color: Color.fromRGBO(184, 191, 217, 0.3), blurRadius: 6)
  742. ],
  743. ),
  744. child: Column(
  745. crossAxisAlignment: CrossAxisAlignment.center,
  746. mainAxisAlignment: MainAxisAlignment.center,
  747. children: [
  748. Row(
  749. crossAxisAlignment: CrossAxisAlignment.center,
  750. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  751. children: [
  752. Text(
  753. 'Points History',
  754. style: TextStyle(
  755. fontSize: 15.0,
  756. color: ColorUtils.string2Color('#000000'),
  757. fontWeight: FontWeight.w500), // 设置字体大小
  758. ),
  759. Text(
  760. 'More >',
  761. style: TextStyle(
  762. fontSize: 15.0,
  763. color: ColorUtils.string2Color('#4161D0'),
  764. fontWeight: FontWeight.w500), // 设置字体大小
  765. ).onTap(() {
  766. RewardsHistoryPage.startInstance();
  767. })
  768. ]).paddingOnly(left: 15, right: 15, top: 15, bottom: 5),
  769. Container(
  770. padding:
  771. const EdgeInsets.only(top: 15, bottom: 15, left: 15, right: 15),
  772. decoration: BoxDecoration(
  773. border: Border(
  774. bottom: BorderSide(
  775. width: 1.0, // 底边边框的宽度
  776. color: ColorUtils.string2Color('#F2F3F6'), // 底边边框的颜色
  777. ))),
  778. child: Row(
  779. crossAxisAlignment: CrossAxisAlignment.center,
  780. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  781. children: [
  782. Column(
  783. crossAxisAlignment: CrossAxisAlignment.start,
  784. mainAxisAlignment: MainAxisAlignment.center,
  785. children: [
  786. Text(
  787. 'Daily Login',
  788. style: TextStyle(
  789. fontSize: 15.0,
  790. color: ColorUtils.string2Color('#000000'),
  791. fontWeight: FontWeight.w500), // 设置字体大小
  792. ).marginOnly(bottom: 6),
  793. Text(
  794. '14 Oct 2024 10:00PM',
  795. style: TextStyle(
  796. fontSize: 13.0,
  797. color: ColorUtils.string2Color('#808DAF'),
  798. fontWeight: FontWeight.w400), // 设置字体大小
  799. ),
  800. ],
  801. ),
  802. Text(
  803. '+2',
  804. style: TextStyle(
  805. fontSize: 20.0,
  806. color: ColorUtils.string2Color('#FDB429'),
  807. fontWeight: FontWeight.w500), // 设置字体大小
  808. ),
  809. ],
  810. ),
  811. ),
  812. Container(
  813. padding:
  814. const EdgeInsets.only(top: 15, bottom: 15, left: 15, right: 15),
  815. decoration: BoxDecoration(
  816. border: Border(
  817. bottom: BorderSide(
  818. width: 1.0, // 底边边框的宽度
  819. color: ColorUtils.string2Color('#F2F3F6'), // 底边边框的颜色
  820. ))),
  821. child: Row(
  822. crossAxisAlignment: CrossAxisAlignment.center,
  823. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  824. children: [
  825. Column(
  826. crossAxisAlignment: CrossAxisAlignment.start,
  827. mainAxisAlignment: MainAxisAlignment.center,
  828. children: [
  829. Text(
  830. 'Daily Login',
  831. style: TextStyle(
  832. fontSize: 15.0,
  833. color: ColorUtils.string2Color('#000000'),
  834. fontWeight: FontWeight.w500), // 设置字体大小
  835. ).marginOnly(bottom: 6),
  836. Text(
  837. '14 Oct 2024 10:00PM',
  838. style: TextStyle(
  839. fontSize: 13.0,
  840. color: ColorUtils.string2Color('#808DAF'),
  841. fontWeight: FontWeight.w400), // 设置字体大小
  842. ),
  843. ],
  844. ),
  845. Text(
  846. '+2',
  847. style: TextStyle(
  848. fontSize: 20.0,
  849. color: ColorUtils.string2Color('#FDB429'),
  850. fontWeight: FontWeight.w500), // 设置字体大小
  851. ),
  852. ],
  853. ),
  854. ),
  855. Container(
  856. padding:
  857. const EdgeInsets.only(top: 15, bottom: 15, left: 15, right: 15),
  858. decoration: BoxDecoration(
  859. border: Border(
  860. bottom: BorderSide(
  861. width: 1.0, // 底边边框的宽度
  862. color: ColorUtils.string2Color('#F2F3F6'), // 底边边框的颜色
  863. ))),
  864. child: Row(
  865. crossAxisAlignment: CrossAxisAlignment.center,
  866. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  867. children: [
  868. Column(
  869. crossAxisAlignment: CrossAxisAlignment.start,
  870. mainAxisAlignment: MainAxisAlignment.center,
  871. children: [
  872. Text(
  873. 'Daily Login',
  874. style: TextStyle(
  875. fontSize: 15.0,
  876. color: ColorUtils.string2Color('#000000'),
  877. fontWeight: FontWeight.w500), // 设置字体大小
  878. ).marginOnly(bottom: 6),
  879. Text(
  880. '14 Oct 2024 10:00PM',
  881. style: TextStyle(
  882. fontSize: 13.0,
  883. color: ColorUtils.string2Color('#808DAF'),
  884. fontWeight: FontWeight.w400), // 设置字体大小
  885. ),
  886. ],
  887. ),
  888. Text(
  889. '+2',
  890. style: TextStyle(
  891. fontSize: 20.0,
  892. color: ColorUtils.string2Color('#FDB429'),
  893. fontWeight: FontWeight.w500), // 设置字体大小
  894. ),
  895. ],
  896. ),
  897. ),
  898. ],
  899. ),
  900. ).marginOnly(bottom: 12);
  901. }
  902. @override
  903. Widget build(BuildContext context, WidgetRef ref) {
  904. final _vm = ref.read(rewardsVmProvider.notifier);
  905. final state = ref.watch(rewardsVmProvider);
  906. RewardsIndexEntity? list = state.list;
  907. useEffect(() {
  908. // 组件挂载时执行 - 执行接口请求
  909. Future.microtask(() => _vm.initPageData());
  910. return () {
  911. // 组件卸载时执行
  912. Log.d("property_news_page 组件卸载时执行");
  913. };
  914. }, []);
  915. return Scaffold(
  916. // appBar: AppBar(title: Text("奖励")),
  917. body: Column(children: [
  918. Expanded(
  919. child:
  920. LoadStateLayout(
  921. state: state.loadingState,
  922. errorMessage: state.errorMessage,
  923. errorRetry: () {
  924. _vm.retryRequest();
  925. },
  926. successWidget: SingleChildScrollView(
  927. scrollDirection: Axis.vertical,
  928. physics: const BouncingScrollPhysics(),
  929. clipBehavior: Clip.none,
  930. child: Column(
  931. children: [
  932. _buildTop(context, ref, _vm),
  933. Container(
  934. transform: Matrix4.translationValues(0.0, -45.0, 0.0),
  935. child: Column(
  936. children: [
  937. _buildSearch(context, ref, _vm, list),
  938. _buildSwiper(context, ref, _vm),
  939. _buildList(context, ref, _vm),
  940. _buildHistory(context, ref, _vm),
  941. ],
  942. ), // 使用负数margin
  943. ).paddingOnly(left: 15, right: 15),
  944. ],
  945. )
  946. ),
  947. ),
  948. ),
  949. ]).backgroundColor(ColorUtils.string2Color('#F2F3F6')),
  950. );
  951. }
  952. }