Browse Source

处理rewards问题

“shanwenxin” 2 months ago
parent
commit
ed718b0abe

+ 1 - 1
packages/cpt_rewards/lib/modules/rewards_detail/rewards_detail_page.dart

@@ -154,7 +154,7 @@ class RewardsDetailPage extends HookConsumerWidget {
                               overflow: TextOverflow.ellipsis, // 超出部分用省略号表示
                               redeemedDate,
                               style: TextStyle(
-                                  fontSize: 14.0,
+                                  fontSize: 12.0,
                                   color: ColorUtils.string2Color('#808DAF'),
                                   fontWeight: FontWeight.w400),
                             )

+ 6 - 6
packages/cpt_rewards/lib/modules/rewards_history/rewards_history_earned/rewards_history_earned_page.dart

@@ -104,7 +104,10 @@ class RewardsHistoryEarnedPage extends HookConsumerWidget {
       body: SizedBox(
           width: double.infinity,
           height: double.infinity,
-          child: EasyRefresh(
+          child: Container(
+              color: ColorUtils.string2Color('#F2F3F6'),
+              padding: const EdgeInsets.only(top: 15),
+              child: EasyRefresh(
               controller: vm.refreshController,
               // 上拉加载
               onLoad: () async {
@@ -116,10 +119,7 @@ class RewardsHistoryEarnedPage extends HookConsumerWidget {
                 Log.d("----onRefresh");
                 vm.onRefresh();
               },
-              child: Container(
-                color: ColorUtils.string2Color('#F2F3F6'),
-                padding: const EdgeInsets.only(top: 15),
-                child: Container(
+              child:  Container(
                     decoration: BoxDecoration(
                       color: Colors.white,
                       borderRadius: BorderRadius.circular(10),
@@ -136,7 +136,7 @@ class RewardsHistoryEarnedPage extends HookConsumerWidget {
                         vm.retryRequest();
                       },
                       successSliverWidget: [_buildSaleList(context, ref, vm)],
-                    )),
+                    )).marginOnly(left: 20, right: 20),
               ))),
     );
   }

+ 13 - 11
packages/cpt_rewards/lib/modules/rewards_history/rewards_history_spent/rewards_history_spent_page.dart

@@ -28,8 +28,11 @@ class RewardsHistorySpentPage extends HookConsumerWidget {
     }
   }
 
-  // listitem
+   // listitem
   Widget _buildSaleItem(BuildContext context, WidgetRef ref, item, _vm) {
+    String shortDescription = item['short_description'] ?? '';
+    String createdAt = item['created_at'] ?? '';
+    int point = item['point'] ?? 0;
     return Container(
       padding: const EdgeInsets.only(top: 15, bottom: 15, left: 18, right: 18),
       decoration: BoxDecoration(
@@ -47,14 +50,14 @@ class RewardsHistorySpentPage extends HookConsumerWidget {
             mainAxisAlignment: MainAxisAlignment.center,
             children: [
               Text(
-                'Daily Login',
+                shortDescription,
                 style: TextStyle(
                     fontSize: 15.0,
                     color: ColorUtils.string2Color('#000000'),
                     fontWeight: FontWeight.w500), // 设置字体大小
               ).marginOnly(bottom: 6),
               Text(
-                '14 Oct 2024  10:00PM',
+                createdAt,
                 style: TextStyle(
                     fontSize: 13.0,
                     color: ColorUtils.string2Color('#808DAF'),
@@ -63,7 +66,7 @@ class RewardsHistorySpentPage extends HookConsumerWidget {
             ],
           ),
           Text(
-            '-4.500',
+            '$point',
             style: TextStyle(
                 fontSize: 20.0,
                 color: ColorUtils.string2Color('#4161D0'),
@@ -73,7 +76,6 @@ class RewardsHistorySpentPage extends HookConsumerWidget {
       ),
     );
   }
-
   // list
   Widget _buildSaleList(BuildContext context, WidgetRef ref, _vm) {
     final state = ref.watch(rewardsHistorySpentVmProvider);
@@ -100,7 +102,10 @@ class RewardsHistorySpentPage extends HookConsumerWidget {
       body: SizedBox(
           width: double.infinity,
           height: double.infinity,
-          child: EasyRefresh(
+          child: Container(
+              color: ColorUtils.string2Color('#F2F3F6'),
+              padding: const EdgeInsets.only(top: 15),
+              child: EasyRefresh(
               controller: vm.refreshController,
               // 上拉加载
               onLoad: () async {
@@ -112,10 +117,7 @@ class RewardsHistorySpentPage extends HookConsumerWidget {
                 Log.d("----onRefresh");
                 vm.onRefresh();
               },
-              child: Container(
-                color: ColorUtils.string2Color('#F2F3F6'),
-                padding: const EdgeInsets.only(top: 15),
-                child: Container(
+              child:  Container(
                     decoration: BoxDecoration(
                       color: Colors.white,
                       borderRadius: BorderRadius.circular(10),
@@ -132,7 +134,7 @@ class RewardsHistorySpentPage extends HookConsumerWidget {
                         vm.retryRequest();
                       },
                       successSliverWidget: [_buildSaleList(context, ref, vm)],
-                    )),
+                    )).marginOnly(left: 20,right: 20),
               ))),
     );
   }

+ 16 - 7
packages/cpt_rewards/lib/modules/rewards_home/rewards_home_page.dart

@@ -269,8 +269,11 @@ class RewardsHomePage extends HookConsumerWidget {
                                   blurRadius: 6)
                             ],
                           ),
-                          child: _buildItem(
-                              context, ref, _vm, hg, list['rewards'][index]));
+                          child: ClipRRect(
+                              borderRadius:
+                                  const BorderRadius.all(Radius.circular(6.0)),
+                              child: _buildItem(
+                              context, ref, _vm, hg, list['rewards'][index])));
                     }))
               ],
             ),
@@ -339,7 +342,7 @@ class RewardsHomePage extends HookConsumerWidget {
           item?['resources']?[0] ?? '',
           width: MediaQuery.of(context).size.width,
           height: hg,
-          cornerRadius:6,
+          // cornerRadius:6,
         ),
         Column(
           crossAxisAlignment: CrossAxisAlignment.start,
@@ -423,7 +426,7 @@ class RewardsHomePage extends HookConsumerWidget {
                       double hg = 70;
                       return Container(
                           width: MediaQuery.of(context).size.width / 2 - 25,
-                          height: 185,
+                          height: 155,
                           decoration: const BoxDecoration(
                             color: Colors.white,
                             borderRadius:
@@ -434,8 +437,11 @@ class RewardsHomePage extends HookConsumerWidget {
                                   blurRadius: 6)
                             ],
                           ),
-                          child: _buildItem(
-                              context, ref, _vm, hg, list['rewards'][index]));
+                          child:ClipRRect(
+                              borderRadius:
+                                  const BorderRadius.all(Radius.circular(6.0)),
+                              child: _buildItem(
+                              context, ref, _vm, hg, list['rewards'][index])));
                     }))
               ],
             ),
@@ -486,8 +492,11 @@ class RewardsHomePage extends HookConsumerWidget {
                                       blurRadius: 6)
                                 ],
                               ),
+                              child:ClipRRect(
+                              borderRadius:
+                                  const BorderRadius.all(Radius.circular(6.0)),
                               child: _buildItem(context, ref, _vm, hg,
-                                  list['rewards'][index]))
+                                  list['rewards'][index])))
                           .marginOnly(bottom: 13);
                     }))
               ],

+ 7 - 4
packages/cpt_rewards/lib/modules/rewards_list/rewards_list_page.dart

@@ -55,7 +55,7 @@ class RewardsListPage extends HookConsumerWidget {
                   fontSize: 16.0,
                   color: Colors.black,
                   fontWeight: FontWeight.w500),
-            ).marginOnly(bottom: 5, top: 10),
+            ).marginOnly(bottom: 5, top: 10).paddingOnly(left: 20, right: 20),
             Row(
               children: [
                 Text(
@@ -83,7 +83,7 @@ class RewardsListPage extends HookConsumerWidget {
                       fontWeight: FontWeight.w400),
                 ),
               ],
-            ),
+            ).paddingOnly(left: 20, right: 20),
           ],
         ).onTap(() {
           RewardsDetailPage.startInstance(id: id);
@@ -112,10 +112,13 @@ class RewardsListPage extends HookConsumerWidget {
               crossAxisAlignment: CrossAxisAlignment.start,
               mainAxisAlignment: MainAxisAlignment.start,
               children: [
-                _buildItemLeftSection(context, ref, item, _vm)
+                ClipRRect(
+                              borderRadius:
+                                  const BorderRadius.all(Radius.circular(6.0)),
+                              child:_buildItemLeftSection(context, ref, item, _vm))
                 // .marginOnly(bottom: 5),
               ],
-            ).paddingOnly(left: 20, right: 20),
+            ),
           ).constrained(
             minHeight: 235,
           ),