Browse Source

[new]调整会员页样式

zk 3 months ago
parent
commit
743cb778f5

+ 1 - 1
lib/module/member/activity/member_activity_controller.dart

@@ -55,7 +55,6 @@ class MemberActivityController extends BaseController {
   void onReady() {
     super.onReady();
     refreshMemberData();
-    memberRepository.startActivityCountdown();
     precacheImage(
         Assets.images.iconMemberSpecialProductsSelect.provider(), Get.context!);
     precacheImage(
@@ -88,6 +87,7 @@ class MemberActivityController extends BaseController {
       if (goodsList.isNotEmpty && payItemList.isNotEmpty) {
         memberRepository.setLastSelectedMember(
             goodsList.first, payItemList.first);
+        memberRepository.startActivityCountdown();
       }
     }).catchError((error) {
       ErrorHandler.toastError(error);

+ 2 - 25
lib/module/member/activity/member_activity_page.dart

@@ -246,7 +246,7 @@ class MemberActivityPage extends BasePage<MemberActivityController> {
                     ..onTap = () {
                       controller.onRenewalAgreementClick();
                     },
-                  text: '续费协议',
+                  text: '会员协议',
                   style: TextStyle(
                       color: ColorName.black60,
                       decoration: TextDecoration.underline)),
@@ -374,30 +374,7 @@ class MemberActivityPage extends BasePage<MemberActivityController> {
                 )
               ],
             ),
-          )
-
-          // Container(
-          //   color: ColorName.white,
-          //   padding:
-          //       EdgeInsets.only(left: 12.w, right: 12.w, bottom: 12.w, top: 8.w),
-          //   child: Container(
-          //     width: double.infinity,
-          //     height: 50.w,
-          //     padding: EdgeInsets.only(left: 20.w),
-          //     decoration: BoxDecoration(
-          //       image: DecorationImage(
-          //         image: Assets.images.iconMemberSettlementBg.provider(),
-          //         fit: BoxFit.fill,
-          //       ),
-          //     ),
-          //     child: Stack(
-          //       children: [
-          //         Assets.images.imgMemberBtnShadow.image(height: double.infinity)
-          //       ],
-          //     ),
-          //   ),
-          // ),
-          );
+          ));
     });
   }
 

+ 2 - 2
lib/module/member/member_controller.dart

@@ -88,10 +88,10 @@ class MemberController extends BaseController implements PaymentStatusCallback {
   ///评论
   final RxList<GoodsEvaluateInfo> evaluateList = <GoodsEvaluateInfo>[].obs;
 
-  final RxBool isShowCount = RxBool(true);
-
   CancelableFuture? _memberDataFuture;
 
+  Duration? get activityDuration => memberRepository.activityDuration.value;
+
   bool _isShowPayFailedDialog = false; // 是否已经展示过支付失败弹窗
 
   ///检查续订的状态

+ 131 - 122
lib/module/member/member_page.dart

@@ -24,7 +24,9 @@ import '../../data/consts/payment_type.dart';
 import '../../resource/string.gen.dart';
 import '../../router/app_pages.dart';
 import '../../utils/date_util.dart';
+import '../../widget/activity_countdown_txt_view.dart';
 import '../../widget/animated_switcher_widget.dart';
+import '../../widget/shimmer_effect.dart';
 import 'member_discount_countdown_widget.dart';
 import 'member_header_cycle_widget.dart';
 
@@ -413,128 +415,143 @@ class MemberPage extends BasePage<MemberController> {
       }
 
       return Align(
-        alignment: Alignment.bottomCenter,
-        child: Stack(
-          children: [
-            // 渐变遮罩层(透明可穿透)
-            IgnorePointer(
-              ignoring: true, // 不处理事件
-              child: Container(
-                height: 190.w + MediaQuery.of(Get.context!).padding.bottom,
-                decoration: BoxDecoration(
-                  gradient: LinearGradient(
-                    begin: Alignment.bottomCenter,
-                    end: Alignment.topCenter,
-                    colors: [
-                      Colors.white,
-                      "#00FFFFFF".color,
-                    ],
-                    stops: [0.4368, 1.0],
+          alignment: Alignment.bottomCenter,
+          child: Container(
+            margin: EdgeInsets.only(bottom: 15.w, left: 12.w, right: 12.w),
+            child: Stack(
+              children: [
+                Container(
+                  width: 336.w,
+                  height: 47.w,
+                  decoration: BoxDecoration(
+                      borderRadius: BorderRadius.only(
+                        topLeft: Radius.circular(30.w),
+                        topRight: Radius.circular(30.w),
+                      ),
+                      color: '#FFFED8'.color),
+                  child: Align(
+                    alignment: Alignment(0.0, -0.75),
+                    child: Row(
+                      mainAxisAlignment: MainAxisAlignment.center,
+                      children: [
+                        Text(
+                          StringName.memberActivityCountdown,
+                          style: TextStyle(
+                              fontSize: 11.sp, color: '#FF5656'.color),
+                        ),
+                        SizedBox(width: 4.w),
+                        Obx(() {
+                          return ActivityCountdownTextView(
+                              timeItemHeight: 15.w,
+                              contentPadding: EdgeInsets.zero,
+                              timeItemWidth: 16.w,
+                              textStyle: TextStyle(
+                                  fontSize: 10.sp, color: Colors.white),
+                              duration: controller.activityDuration ??
+                                  Duration(seconds: 0),
+                              separator: buildCountdownSeparator(),
+                              timeBgBoxDecoration: BoxDecoration(
+                                color: '#FF5656'.color,
+                                borderRadius: BorderRadius.circular(3.w),
+                              ));
+                        }),
+                        SizedBox(width: 4.w),
+                        Text(
+                          StringName.memberActivitySpeciallyPreferential,
+                          style: TextStyle(
+                              fontSize: 10.sp, color: '#FF5656'.color),
+                        )
+                      ],
+                    ),
                   ),
                 ),
-              ),
-            ),
-
-            // 按钮区域(可点击)
-            Positioned(
-              bottom: 0,
-              left: 0,
-              right: 0,
-              child: Container(
-                height: 190.w + MediaQuery.of(Get.context!).padding.bottom,
-                padding: EdgeInsets.only(
-                    left: 12.w,
-                    right: 12.w,
-                    bottom: 17.w + MediaQuery.of(Get.context!).padding.bottom),
-                alignment: Alignment.bottomCenter,
-                child: Column(
-                  mainAxisAlignment: MainAxisAlignment.end,
-                  children: [
-                    // bottom 按钮和价格栏
-                    Container(
-                      width: double.infinity,
-                      height: 50.w,
-                      padding: EdgeInsets.only(left: 20.w),
-                      decoration: BoxDecoration(
-                        image: DecorationImage(
-                          image:
-                              Assets.images.iconMemberSettlementBg.provider(),
-                          fit: BoxFit.fill,
-                        ),
-                      ),
-                      child: Row(
-                        children: [
-                          Transform.translate(
-                            offset: Offset(0, 3),
-                            child: Text('¥',
-                                style: TextStyle(
-                                    fontSize: 14.sp,
-                                    color: '#FFF8EF'.color,
-                                    fontWeight: FontWeight.bold)),
-                          ),
-                          SizedBox(width: 3.w),
-                          Text(
-                            controller.selectedGoods?.amount.divideBy100() ??
-                                '--',
-                            style: TextStyle(
-                                fontSize: 24.sp,
-                                color: '#FFF8EF'.color,
-                                fontWeight: FontWeight.bold),
-                          ),
-                          SizedBox(width: 3.w),
-                          Text(
-                            "/",
-                            style: TextStyle(
-                                fontSize: 12.sp,
-                                fontWeight: FontWeight.w400,
-                                color: "#FFF8EF".color),
-                          ),
-                          Text(
-                              '原价${controller.selectedGoods?.originalAmount.divideBy100()}',
-                              style: TextStyle(
-                                  decoration: TextDecoration.lineThrough,
-                                  decorationColor: Colors.white,
-                                  decorationThickness: 1.0,
-                                  fontSize: 12.sp,
-                                  fontWeight: FontWeight.w400,
-                                  color: "#FFF8EF".color)),
-                          Spacer(),
-                          GestureDetector(
-                            onTap: controller.onBuyClick,
-                            child: Container(
-                              decoration: BoxDecoration(
-                                  image: DecorationImage(
-                                image: Assets.images.iconMemberSettlementConfirm
+                GestureDetector(
+                  onTap: controller.onBuyClick,
+                  child: Container(
+                    margin: EdgeInsets.only(top: 24.w),
+                    height: 50.w,
+                    width: 336.w,
+                    child: ShimmerEffect(
+                      image: Assets.images.imgMemberBtnShadow.provider(),
+                      shimmerWidthFactor: 0.244047619047619,
+                      duration: Duration(milliseconds: 3000),
+                      delay: Duration(milliseconds: 800),
+                      child: Container(
+                        height: 50.w,
+                        width: 336.w,
+                        alignment: Alignment.center,
+                        decoration: BoxDecoration(
+                            image: DecorationImage(
+                                image: Assets.images.iconMemberSettlementBg
                                     .provider(),
-                                fit: BoxFit.fill,
-                              )),
-                              padding: EdgeInsets.only(left: 64.w, right: 29.w),
-                              child: Center(
-                                child: Text(
-                                  controller.memberStatusInfo?.expired == false
-                                      ? StringName.memberVipRenew
-                                      : StringName.memberVipUnlock,
-                                  style: TextStyle(
-                                      fontSize: 18.sp,
-                                      color: "#9B3800".color,
-                                      fontWeight: FontWeight.bold),
-                                ),
-                              ),
-                            ),
-                          )
-                        ],
+                                fit: BoxFit.fill)),
+                        child: Text(
+                          StringName.memberVipUnlock,
+                          style: TextStyle(
+                              fontSize: 18.sp,
+                              color: '#FFF8EF'.color,
+                              fontWeight: FontWeight.bold),
+                        ),
                       ),
                     ),
-                    SizedBox(height: 8.w),
-                    buildPrivacyPolicyView(),
-                  ],
-                ),
+                  ),
+                )
+              ],
+            ),
+          )
+
+          // Container(
+          //   color: ColorName.white,
+          //   padding:
+          //       EdgeInsets.only(left: 12.w, right: 12.w, bottom: 12.w, top: 8.w),
+          //   child: Container(
+          //     width: double.infinity,
+          //     height: 50.w,
+          //     padding: EdgeInsets.only(left: 20.w),
+          //     decoration: BoxDecoration(
+          //       image: DecorationImage(
+          //         image: Assets.images.iconMemberSettlementBg.provider(),
+          //         fit: BoxFit.fill,
+          //       ),
+          //     ),
+          //     child: Stack(
+          //       children: [
+          //         Assets.images.imgMemberBtnShadow.image(height: double.infinity)
+          //       ],
+          //     ),
+          //   ),
+          // ),
+          );
+    });
+  }
+
+  Widget buildCountdownSeparator() {
+    return Container(
+      margin: EdgeInsets.symmetric(horizontal: 2.w),
+      child: IntrinsicHeight(
+        child: Column(
+          children: [
+            Container(
+              width: 2.w,
+              height: 2.w,
+              decoration: BoxDecoration(
+                color: '#FF5656'.color,
+                shape: BoxShape.circle,
+              ),
+            ),
+            SizedBox(height: 3.w),
+            Container(
+              width: 2.w,
+              height: 2.w,
+              decoration: BoxDecoration(
+                color: '#FF5656'.color,
+                shape: BoxShape.circle,
               ),
             )
           ],
         ),
-      );
-    });
+      ),
+    );
   }
 
   Widget buildUserInfoView() {
@@ -591,14 +608,6 @@ class MemberPage extends BasePage<MemberController> {
                   ),
                   buildMemberCardVipDesc(),
                   Spacer(),
-                  Container(
-                    child: MemberDiscountCountdownWidget(
-                      onExpired: () {
-                        print("sssfsdfs");
-                        controller.isShowCount.value = false;
-                      },
-                    ),
-                  )
                 ],
               ),
             )
@@ -766,7 +775,7 @@ class MemberPage extends BasePage<MemberController> {
                     ..onTap = () {
                       controller.onRenewalAgreementClick();
                     },
-                  text: '续费协议',
+                  text: '会员协议',
                   style: TextStyle(
                       color: ColorName.black60,
                       decoration: TextDecoration.underline)),