Преглед на файлове

[new]首页支付券增加光效

zk преди 5 месеца
родител
ревизия
8301ac2f40
променени са 1 файла, в които са добавени 95 реда и са изтрити 92 реда
  1. 95 92
      lib/module/main/main_page.dart

+ 95 - 92
lib/module/main/main_page.dart

@@ -15,6 +15,7 @@ import 'package:location/resource/assets.gen.dart';
 import 'package:location/resource/colors.gen.dart';
 import 'package:location/resource/string.gen.dart';
 import 'package:location/utils/common_expand.dart';
+import 'package:location/widget/shimmer_effect.dart';
 import 'package:sliding_sheet2/sliding_sheet2.dart';
 import 'package:visibility_detector/visibility_detector.dart';
 import '../../data/consts/constants.dart';
@@ -544,103 +545,105 @@ class MainPage extends BasePage<MainController> {
       behavior: HitTestBehavior.opaque,
       onTap: controller.onBuyMemberActivityClick,
       child: Container(
-          height: 58.w,
-          width: double.infinity,
-          margin: EdgeInsets.only(left: 12.w, right: 12.w),
-          child: Stack(
-            children: [
-              Row(
-                children: [
-                  SizedBox(width: 12.w),
-                  Assets.images.iconMemberActivityCoupon
-                      .image(width: 40.w, height: 40.w),
-                  SizedBox(width: 8.w),
-                  Column(
-                    crossAxisAlignment: CrossAxisAlignment.start,
-                    children: [
-                      Spacer(flex: 1),
-                      Row(
-                        children: [
-                          Text('您有一订单未支付专属优惠券',
+        height: 58.w,
+        margin: EdgeInsets.only(left: 12.w, right: 12.w),
+        child: ShimmerEffect(
+            image: Assets.images.imgMemberBtnShadow.provider(),
+            child: Stack(
+              children: [
+                Row(
+                  children: [
+                    SizedBox(width: 12.w),
+                    Assets.images.iconMemberActivityCoupon
+                        .image(width: 40.w, height: 40.w),
+                    SizedBox(width: 8.w),
+                    Column(
+                      crossAxisAlignment: CrossAxisAlignment.start,
+                      children: [
+                        Spacer(flex: 1),
+                        Row(
+                          children: [
+                            Text('您有一订单未支付专属优惠券',
+                                style: TextStyle(
+                                    fontSize: 10.sp,
+                                    color: ColorName.white87,
+                                    fontWeight: FontWeight.bold)),
+                            Obx(() {
+                              return Text(
+                                  ' -¥${(((controller.lastSelectedGoods?.originalAmount ?? 0) - (controller.lastSelectedGoods?.amount ?? 0)) / 100).toInt()}',
+                                  style: TextStyle(
+                                      fontSize: 20.sp,
+                                      color: '#E7DBA7'.color,
+                                      fontWeight: FontWeight.bold));
+                            })
+                          ],
+                        ),
+                        Row(
+                          children: [
+                            Obx(() {
+                              return ActivityCountdownTextView(
+                                  timeItemHeight: 15.w,
+                                  contentPadding: EdgeInsets.zero,
+                                  timeItemWidth: 16.w,
+                                  textStyle: TextStyle(
+                                      fontSize: 10.sp, color: '#322C54'.color),
+                                  duration: controller.activityDuration ??
+                                      Duration(seconds: 0),
+                                  separator: buildCountdownSeparator(),
+                                  timeBgBoxDecoration: BoxDecoration(
+                                    gradient: LinearGradient(
+                                        colors: [
+                                          ColorName.white,
+                                          ColorName.white87
+                                        ],
+                                        begin: Alignment.topCenter,
+                                        end: Alignment.bottomCenter),
+                                    borderRadius: BorderRadius.circular(3.w),
+                                  ));
+                            }),
+                            SizedBox(width: 4.w),
+                            Text(
+                              StringName.memberActivitySpeciallyPreferential,
                               style: TextStyle(
                                   fontSize: 10.sp,
                                   color: ColorName.white87,
-                                  fontWeight: FontWeight.bold)),
-                          Obx(() {
-                            return Text(
-                                ' -¥${(((controller.lastSelectedGoods?.originalAmount ?? 0) - (controller.lastSelectedGoods?.amount ?? 0)) / 100).toInt()}',
-                                style: TextStyle(
-                                    fontSize: 20.sp,
-                                    color: '#E7DBA7'.color,
-                                    fontWeight: FontWeight.bold));
-                          })
-                        ],
-                      ),
-                      Row(
-                        children: [
-                          Obx(() {
-                            return ActivityCountdownTextView(
-                                timeItemHeight: 15.w,
-                                contentPadding: EdgeInsets.zero,
-                                timeItemWidth: 16.w,
-                                textStyle: TextStyle(
-                                    fontSize: 10.sp, color: '#322C54'.color),
-                                duration: controller.activityDuration ??
-                                    Duration(seconds: 0),
-                                separator: buildCountdownSeparator(),
-                                timeBgBoxDecoration: BoxDecoration(
-                                  gradient: LinearGradient(
-                                      colors: [
-                                        ColorName.white,
-                                        ColorName.white87
-                                      ],
-                                      begin: Alignment.topCenter,
-                                      end: Alignment.bottomCenter),
-                                  borderRadius: BorderRadius.circular(3.w),
-                                ));
-                          }),
-                          SizedBox(width: 4.w),
-                          Text(
-                            StringName.memberActivitySpeciallyPreferential,
-                            style: TextStyle(
-                                fontSize: 10.sp,
-                                color: ColorName.white87,
-                                fontWeight: FontWeight.bold),
-                          )
-                        ],
-                      ),
-                      Spacer(flex: 4),
-                    ],
-                  ),
-                ],
-              ),
-              Positioned(
-                top: 15.w,
-                bottom: 14.w,
-                right: 10.w,
-                child: Container(
-                    decoration: BoxDecoration(
-                      borderRadius: BorderRadius.circular(100.w),
-                      gradient: LinearGradient(
-                          colors: [
-                            '#FFFEF3'.color,
-                            '#FFE5A3'.color,
+                                  fontWeight: FontWeight.bold),
+                            )
                           ],
-                          begin: Alignment.topCenter,
-                          end: Alignment.bottomCenter),
+                        ),
+                        Spacer(flex: 4),
+                      ],
                     ),
-                    padding: EdgeInsets.symmetric(horizontal: 12.w),
-                    child: Center(
-                      child: Text(StringName.memberActivityToBuy,
-                          style: TextStyle(
-                              fontSize: 14.sp,
-                              color: '#40338B'.color,
-                              height: 1,
-                              fontWeight: FontWeight.bold)),
-                    )),
-              )
-            ],
-          )),
+                  ],
+                ),
+                Positioned(
+                  top: 15.w,
+                  bottom: 14.w,
+                  right: 10.w,
+                  child: Container(
+                      decoration: BoxDecoration(
+                        borderRadius: BorderRadius.circular(100.w),
+                        gradient: LinearGradient(
+                            colors: [
+                              '#FFFEF3'.color,
+                              '#FFE5A3'.color,
+                            ],
+                            begin: Alignment.topCenter,
+                            end: Alignment.bottomCenter),
+                      ),
+                      padding: EdgeInsets.symmetric(horizontal: 12.w),
+                      child: Center(
+                        child: Text(StringName.memberActivityToBuy,
+                            style: TextStyle(
+                                fontSize: 14.sp,
+                                color: '#40338B'.color,
+                                height: 1,
+                                fontWeight: FontWeight.bold)),
+                      )),
+                )
+              ],
+            )),
+      ),
     );
   }