Prechádzať zdrojové kódy

[feat]1.增加会员服务协议链接,2,去掉华为渠道的倒计时

云天逵 8 mesiacov pred
rodič
commit
58fa6a9058

BIN
assets/images/icon_keyboard_banner_no_countdown.webp


+ 1 - 0
assets/string/base/string.xml

@@ -181,6 +181,7 @@
     <string name="text_span_privacy_policy">《隐私政策》</string>
     <string name="text_span_service_terms">《服务条款》</string>
     <string name="text_span_user_agreement">《用户协议》</string>
+    <string name="text_span_membership_agreement">《会员服务协议》</string>
 
 
     <string name="member_continue_pay">继续支付</string>

+ 7 - 2
lib/data/consts/constants.dart

@@ -1,9 +1,11 @@
+import 'package:flutter/rendering.dart';
+
 import '../../utils/mmkv_util.dart';
 
 class Constants {
   Constants._();
 
-  static const String env = envTest;
+  static const String env = envProd;
 
   static const String envDev = 'dev';
 
@@ -94,6 +96,9 @@ void setFirstIntoDiscount(bool isFirst) {
 }
 
 
-
+bool isNotHWChannel() {
+  String? channel= KVUtil.getString(Constants.appChanelName, Constants.appDefaultChannel);
+      return  channel!= "SDZAXJPHW";
+}
 
 

+ 6 - 0
lib/data/consts/web_url.dart

@@ -17,6 +17,10 @@ class WebUrl {
   static const String _personalInformationList =
       "https://doc.v8dashen.com/doc/c463429ebb833508";
 
+  // 会员服务协议
+  static const String _memberServiceAgreement =
+      "https://doc.v8dashen.com/doc/188d18732e6611e8";
+
 
   // 第三方SDK共享清单
   static const String _thirdPartyList =
@@ -36,4 +40,6 @@ class WebUrl {
   static String get personalInformationList => _personalInformationList;
 
   static String get qiyuService => _qiyuService;
+
+  static String get memberServiceAgreement => _memberServiceAgreement;
 }

+ 7 - 7
lib/dialog/member_agreement_dialog.dart

@@ -66,7 +66,12 @@ class MemberAgreementDialog {
                                 text: StringName.textSpanPrivacyPolicy,
                                 url: WebUrl.privacyPolicy,
                               ),
-
+                              ClickTextSpan(
+                                fontSize: 14.sp,
+                                text:
+                                StringName.textSpanServiceTerms,
+                                url: WebUrl.serviceAgreement,
+                              ),
                               TextSpan(
                                 text: StringName.textSpanAnd,
                                 style: TextStyle(
@@ -75,13 +80,8 @@ class MemberAgreementDialog {
                                   fontWeight: FontWeight.w400,
                                 ),
                               ),
+                              ClickTextSpan( fontSize: 14.sp,text: StringName.textSpanMembershipAgreement, url: WebUrl.memberServiceAgreement),
 
-                              ClickTextSpan(
-                                fontSize: 14.sp,
-                                text:
-                                    StringName.textSpanServiceTerms,
-                                url: WebUrl.serviceAgreement,
-                              ),
                               TextSpan(
                                 text: "。",
                                 style: TextStyle(

+ 4 - 1
lib/module/keyboard/keyboard_controller.dart

@@ -15,6 +15,7 @@ import 'package:keyboard/module/user_profile/user_profile_page.dart';
 
 import '../../data/api/response/keyboard_love_index_response.dart';
 import '../../data/bean/member_info.dart';
+import '../../data/consts/constants.dart';
 import '../../plugins/keyboard_android_platform.dart';
 import '../../utils/default_keyboard_helper.dart';
 import '../../utils/keyboard_tutorial_util.dart';
@@ -82,7 +83,9 @@ class KeyBoardController extends BaseController {
         isShowBanner.value = true;
       }
       if (_timer == null || !_timer!.isActive) {
-        startCountdown();
+        if(isNotHWChannel()) {
+          startCountdown();
+        }
       }
     }
   }

+ 12 - 5
lib/module/keyboard/keyboard_view.dart

@@ -8,6 +8,7 @@ import 'package:keyboard/base/base_view.dart';
 import 'package:keyboard/data/bean/character_info.dart';
 import 'package:keyboard/resource/string.gen.dart';
 
+import '../../data/consts/constants.dart';
 import '../../resource/assets.gen.dart';
 import '../../utils/styles.dart';
 import '../../widget/avatar/avatar_image_widget.dart';
@@ -638,16 +639,21 @@ class KeyBoardView extends BaseView<KeyBoardController> {
             children: [
               Positioned(
                 top: 20.h,
-                child: Assets.images.iconKeyboardBanner.image(
+                child: Visibility( visible: isNotHWChannel(),replacement:Assets.images.iconKeyboardBannerNoCountdown.image(
                   width: 328.w,
                   height: 64.h,
-                ),
+                ) ,child: Assets.images.iconKeyboardBanner.image(
+                  width: 328.w,
+                  height: 64.h,
+                ),)
               ),
-              Positioned(
+              Visibility(
+                visible: isNotHWChannel(),
+                child:   Positioned(
                 right: 53.w,
                 bottom: 18.h,
                 child: Obx(
-                  () => Text(
+                      () => Text(
                     controller.formattedTime,
                     style: TextStyle(
                       color: Colors.white,
@@ -656,7 +662,8 @@ class KeyBoardView extends BaseView<KeyBoardController> {
                     ),
                   ),
                 ),
-              ),
+              ),),
+
               Positioned(
                 right: 6.w,
                 top: 0.h,

+ 5 - 5
lib/module/store/new_discount/new_discount_page.dart

@@ -703,6 +703,10 @@ class NewDiscountPage extends BasePage<NewDiscountController> {
                 url: WebUrl.privacyPolicy,
               ),
 
+              ClickTextSpan(
+                text: StringName.textSpanServiceTerms,
+                url: WebUrl.serviceAgreement,
+              ),
               TextSpan(
                 text: StringName.textSpanAnd,
                 style: TextStyle(
@@ -711,11 +715,7 @@ class NewDiscountPage extends BasePage<NewDiscountController> {
                   fontWeight: FontWeight.w400,
                 ),
               ),
-
-              ClickTextSpan(
-                text: StringName.textSpanServiceTerms,
-                url: WebUrl.serviceAgreement,
-              ),
+              ClickTextSpan(text: StringName.textSpanMembershipAgreement, url: WebUrl.memberServiceAgreement)
             ],
           ),
         ),

+ 88 - 81
lib/module/store/store_page.dart

@@ -782,43 +782,43 @@ class StorePage extends BasePage<StoreController> {
       child: Column(
         children: [
           GestureDetector(
-
             onTap: controller.clickPayNow,
             child: Container(
               alignment: Alignment.topCenter,
-                width: 328.w,
-                height: 56.w,
+              width: 328.w,
+              height: 56.w,
               decoration: ShapeDecoration(
                 color: const Color(0xFFFFF587),
                 shape: RoundedRectangleBorder(
                   borderRadius: BorderRadius.circular(30.55.r),
                 ),
               ),
-            child: Container(
-              width: 328.w,
-              height: 54.w,
-              decoration: ShapeDecoration(
-                gradient: LinearGradient(
-                  begin: Alignment(0.60, -0.39),
-                  end: Alignment(0.60, 0.95),
-                  colors: [
-                    const Color(0xFFF95FAC),
-                    const Color(0xFFFD5E4D),
-                    const Color(0xFFFD5E4D),
-                    const Color(0xFFFB8A3C),
-                  ],
-                ),
-                shape: RoundedRectangleBorder(
-                  borderRadius: BorderRadius.circular(30.55.r),
+              child: Container(
+                width: 328.w,
+                height: 54.w,
+                decoration: ShapeDecoration(
+                  gradient: LinearGradient(
+                    begin: Alignment(0.60, -0.39),
+                    end: Alignment(0.60, 0.95),
+                    colors: [
+                      const Color(0xFFF95FAC),
+                      const Color(0xFFFD5E4D),
+                      const Color(0xFFFD5E4D),
+                      const Color(0xFFFB8A3C),
+                    ],
+                  ),
+                  shape: RoundedRectangleBorder(
+                    borderRadius: BorderRadius.circular(30.55.r),
+                  ),
                 ),
-              ),
-              child: Center(
-                child: Text(
-                  StringName.storePayNow,
-                  style: Styles.getTextStyleWhiteW500(17.sp),
+                child: Center(
+                  child: Text(
+                    StringName.storePayNow,
+                    style: Styles.getTextStyleWhiteW500(17.sp),
+                  ),
                 ),
               ),
-            )),
+            ),
           ),
 
           _buildPrivacy(),
@@ -827,74 +827,81 @@ class StorePage extends BasePage<StoreController> {
     );
   }
 
-  Widget _buildPrivacy(){
+  Widget _buildPrivacy() {
     return Row(
       mainAxisAlignment: MainAxisAlignment.center,
       children: [
         Obx(() {
           return GestureDetector(
-              behavior: HitTestBehavior.opaque,
-              onTap: () {
-                controller.isAgree.value = !controller.isAgree.value;
-              },
-              child:Padding(
-                padding: EdgeInsets.symmetric(vertical: 10.w,horizontal: 10.w),child:
-              controller.isAgree.value
-                  ? Assets.images.iconStoreAgreePrivacy.image(
-                width: 16.w,
-                height: 16.w,
-              )
-                  : SizedBox(
-                child: Container(
-                  padding: EdgeInsets.all(1.w),
-                  width: 16.w,
-                  height: 16.w,
-                  child: Container(
-                    decoration: BoxDecoration(
-                      shape: BoxShape.circle,
-                      border: Border.all(
-                        color: Colors.black.withAlpha(153),
-                        width: 1.w,
+            behavior: HitTestBehavior.opaque,
+            onTap: () {
+              controller.isAgree.value = !controller.isAgree.value;
+            },
+            child: Padding(
+              padding: EdgeInsets.symmetric(vertical: 10.w, horizontal: 10.w),
+              child:
+                  controller.isAgree.value
+                      ? Assets.images.iconStoreAgreePrivacy.image(
+                        width: 16.w,
+                        height: 16.w,
+                      )
+                      : SizedBox(
+                        child: Container(
+                          padding: EdgeInsets.all(1.w),
+                          width: 16.w,
+                          height: 16.w,
+                          child: Container(
+                            decoration: BoxDecoration(
+                              shape: BoxShape.circle,
+                              border: Border.all(
+                                color: Colors.black.withAlpha(153),
+                                width: 1.w,
+                              ),
+                            ),
+                          ),
+                        ),
                       ),
-                    ),
-                  ),
-                ),
-              ),)
+            ),
           );
         }),
-        Transform.translate(offset: Offset(-10.w,0),child:
-        Text.rich(
-          TextSpan(
-            children: [
-              TextSpan(
-                text: StringName.textSpanIHaveReadAndAgree,
-                style: TextStyle(
-                  color: Colors.black.withAlpha(153),
-                  fontSize: 10.sp,
-                  fontWeight: FontWeight.w400,
+        Transform.translate(
+          offset: Offset(-10.w, 0),
+          child: Text.rich(
+            TextSpan(
+              children: [
+                TextSpan(
+                  text: StringName.textSpanIHaveReadAndAgree,
+                  style: TextStyle(
+                    color: Colors.black.withAlpha(153),
+                    fontSize: 10.sp,
+                    fontWeight: FontWeight.w400,
+                  ),
                 ),
-              ),
-              ClickTextSpan(
-                text: StringName.textSpanPrivacyPolicy,
-                url: WebUrl.privacyPolicy,
-              ),
-
-              TextSpan(
-                text: StringName.textSpanAnd,
-                style: TextStyle(
-                  color: Colors.black.withAlpha(153),
-                  fontSize: 10.sp,
-                  fontWeight: FontWeight.w400,
+                ClickTextSpan(
+                  text: StringName.textSpanPrivacyPolicy,
+                  url: WebUrl.privacyPolicy,
                 ),
-              ),
 
-              ClickTextSpan(
-                text: StringName.textSpanServiceTerms,
-                url: WebUrl.serviceAgreement,
-              ),
-            ],
+                ClickTextSpan(
+                  text: StringName.textSpanServiceTerms,
+                  url: WebUrl.serviceAgreement,
+                ),
+                TextSpan(
+                  text: StringName.textSpanAnd,
+                  style: TextStyle(
+                    color: Colors.black.withAlpha(153),
+                    fontSize: 10.sp,
+                    fontWeight: FontWeight.w400,
+                  ),
+                ),
+                ClickTextSpan(
+                  text: StringName.textSpanMembershipAgreement,
+                  url: WebUrl.memberServiceAgreement,
+                ),
+              ],
+            ),
           ),
-        ),)
+        ),
       ],
     );
   }

+ 6 - 1
lib/module/store/suprise/goods_surprise_controller.dart

@@ -6,6 +6,7 @@ import 'package:get/get.dart';
 import 'package:keyboard/module/store/suprise/surprise_dialog.dart';
 import '../../../base/base_controller.dart';
 import '../../../data/bean/goods_info.dart';
+import '../../../data/consts/constants.dart';
 import '../../../data/repository/store_repository.dart';
 import '../../../utils/async_util.dart';
 import '../../../utils/error_handler.dart';
@@ -18,6 +19,7 @@ class GoodsSurpriseController extends BaseController {
   final RxInt timeLeft = countdownTime.obs; // 剩余时间(10ms 为单位)
   Timer? _timer;
   final StoreRepository storeRepository;
+  // 华为不展示
 
   CancelableFuture? _storeDataFuture;
 
@@ -36,7 +38,10 @@ class GoodsSurpriseController extends BaseController {
 
   @override
   void onInit() {
-    startCountdown();
+    if (isNotHWChannel()) {
+      startCountdown();
+    }
+
     if (goodsInfoList.isEmpty) {
       return;
     }

+ 46 - 43
lib/module/store/suprise/surprise_dialog.dart

@@ -5,6 +5,7 @@ import 'package:get/get.dart';
 import 'package:keyboard/resource/string.gen.dart';
 import 'package:lottie/lottie.dart';
 
+import '../../../data/consts/constants.dart';
 import '../../../resource/assets.gen.dart';
 import '../../../resource/colors.gen.dart';
 import '../../../utils/styles.dart';
@@ -121,49 +122,51 @@ class SurpriseDialog {
                                           .iconSurpriseDialogButton
                                           .image(width: 120.w, height: 20.h),
                                     ),
-                                    Obx(() {
-                                      int totalMilliseconds =
-                                          controller.timeLeft.value;
-                                      int minutes = (totalMilliseconds ~/ 6000);
-                                      int seconds =
-                                          (totalMilliseconds ~/ 100) % 60;
-                                      int milliseconds =
-                                          (totalMilliseconds % 100); // 毫秒
-                                      return Row(
-                                        mainAxisAlignment:
-                                            MainAxisAlignment.center,
-                                        crossAxisAlignment:
-                                            CrossAxisAlignment.center,
-                                        children: [
-                                          _buildTimeBox(
-                                            minutes.toString().padLeft(2, '0'),
-                                          ),
-                                          VerticalDots(
-                                            height: 8.h,
-                                            dotSize: 2.w,
-                                          ),
-                                          _buildTimeBox(
-                                            seconds.toString().padLeft(2, '0'),
-                                          ),
-                                          VerticalDots(
-                                            height: 8.h,
-                                            dotSize: 2.w,
-                                          ),
-                                          _buildTimeBox(
-                                            milliseconds.toString().padLeft(
-                                              2,
-                                              '0',
-                                            ),
-                                          ),
-                                          Text(
-                                            StringName.surpriseDialogEndDesc,
-                                            style: Styles.getTextStyleWhiteW400(
-                                              10.sp,
-                                            ),
-                                          ),
-                                        ],
-                                      );
-                                    }),
+                                   Visibility(
+                                     visible: isNotHWChannel(),
+                                     child:  Obx(() {
+                                     int totalMilliseconds =
+                                         controller.timeLeft.value;
+                                     int minutes = (totalMilliseconds ~/ 6000);
+                                     int seconds =
+                                         (totalMilliseconds ~/ 100) % 60;
+                                     int milliseconds =
+                                     (totalMilliseconds % 100); // 毫秒
+                                     return Row(
+                                       mainAxisAlignment:
+                                       MainAxisAlignment.center,
+                                       crossAxisAlignment:
+                                       CrossAxisAlignment.center,
+                                       children: [
+                                         _buildTimeBox(
+                                           minutes.toString().padLeft(2, '0'),
+                                         ),
+                                         VerticalDots(
+                                           height: 8.h,
+                                           dotSize: 2.w,
+                                         ),
+                                         _buildTimeBox(
+                                           seconds.toString().padLeft(2, '0'),
+                                         ),
+                                         VerticalDots(
+                                           height: 8.h,
+                                           dotSize: 2.w,
+                                         ),
+                                         _buildTimeBox(
+                                           milliseconds.toString().padLeft(
+                                             2,
+                                             '0',
+                                           ),
+                                         ),
+                                         Text(
+                                           StringName.surpriseDialogEndDesc,
+                                           style: Styles.getTextStyleWhiteW400(
+                                             10.sp,
+                                           ),
+                                         ),
+                                       ],
+                                     );
+                                   }),)
                                   ],
                                 ),
                               ),

+ 47 - 42
lib/module/store/ticket/discount_ticket_dialog.dart

@@ -4,6 +4,7 @@ import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
 import 'package:get/get.dart';
 import 'package:lottie/lottie.dart';
 
+import '../../../data/consts/constants.dart';
 import '../../../resource/assets.gen.dart';
 import '../../../resource/colors.gen.dart';
 import '../../../utils/styles.dart';
@@ -13,7 +14,7 @@ import '../suprise/goods_surprise_controller.dart';
 class DiscountTicketDialog {
   static const String tag = 'DiscountTicketDialog';
 
-  static void show({VoidCallback? clickConfirm,VoidCallback? clickCancel}) {
+  static void show({VoidCallback? clickConfirm, VoidCallback? clickCancel}) {
     SmartDialog.show(
       tag: tag,
       backType: SmartBackType.block,
@@ -197,51 +198,55 @@ class DiscountTicketDialog {
                                 ),
 
                                 // 倒计时
-                                Positioned(
-                                  right: 40.w,
-                                  child: Container(
-                                    height: 24.h,
-                                    width: 107.w,
-                                    alignment: Alignment.center,
-                                    decoration: ShapeDecoration(
-                                      gradient: LinearGradient(
-                                        begin: Alignment.centerLeft,
-                                        end: Alignment.centerRight,
-                                        colors: [
-                                          const Color(0xFFFF68F4),
-                                          const Color(0xFFF96432),
-                                        ],
-                                      ),
-                                      shape: RoundedRectangleBorder(
-                                        side: BorderSide(
-                                          width: 1,
-                                          color: Colors.white,
+                                Visibility(
+                                  visible: isNotHWChannel(),
+                                  child: Positioned(
+                                    right: 40.w,
+                                    child: Container(
+                                      height: 24.h,
+                                      width: 107.w,
+                                      alignment: Alignment.center,
+                                      decoration: ShapeDecoration(
+                                        gradient: LinearGradient(
+                                          begin: Alignment.centerLeft,
+                                          end: Alignment.centerRight,
+                                          colors: [
+                                            const Color(0xFFFF68F4),
+                                            const Color(0xFFF96432),
+                                          ],
                                         ),
-                                        borderRadius: BorderRadius.only(
-                                          topLeft: Radius.circular(15.r),
-                                          topRight: Radius.circular(16.r),
-                                          bottomRight: Radius.circular(16.r),
+                                        shape: RoundedRectangleBorder(
+                                          side: BorderSide(
+                                            width: 1,
+                                            color: Colors.white,
+                                          ),
+                                          borderRadius: BorderRadius.only(
+                                            topLeft: Radius.circular(15.r),
+                                            topRight: Radius.circular(16.r),
+                                            bottomRight: Radius.circular(16.r),
+                                          ),
                                         ),
                                       ),
+                                      margin: EdgeInsets.only(top: 140.h),
+                                      child: Obx(() {
+                                        int totalMilliseconds =
+                                            controller.timeLeft.value;
+                                        int minutes =
+                                            (totalMilliseconds ~/ 6000);
+                                        int seconds =
+                                            (totalMilliseconds ~/ 100) % 60;
+                                        int milliseconds =
+                                            (totalMilliseconds % 100); // 毫秒
+                                        return Text(
+                                          "${minutes.toString().padLeft(2, '0')}:${seconds.toString().padLeft(2, '0')}:${milliseconds.toString().padLeft(2, '0')} 后过期",
+                                          style: TextStyle(
+                                            color: Colors.white,
+                                            fontSize: 12.sp,
+                                            fontWeight: FontWeight.w500,
+                                          ),
+                                        );
+                                      }),
                                     ),
-                                    margin: EdgeInsets.only(top: 140.h),
-                                    child: Obx(() {
-                                      int totalMilliseconds =
-                                          controller.timeLeft.value;
-                                      int minutes = (totalMilliseconds ~/ 6000);
-                                      int seconds =
-                                          (totalMilliseconds ~/ 100) % 60;
-                                      int milliseconds =
-                                          (totalMilliseconds % 100); // 毫秒
-                                      return Text(
-                                        "${minutes.toString().padLeft(2, '0')}:${seconds.toString().padLeft(2, '0')}:${milliseconds.toString().padLeft(2, '0')} 后过期",
-                                        style: TextStyle(
-                                          color: Colors.white,
-                                          fontSize: 12.sp,
-                                          fontWeight: FontWeight.w500,
-                                        ),
-                                      );
-                                    }),
                                   ),
                                 ),
                               ],

+ 6 - 0
lib/resource/assets.gen.dart

@@ -749,6 +749,11 @@ class $AssetsImagesGen {
   AssetGenImage get iconKeyboardBannerClose =>
       const AssetGenImage('assets/images/icon_keyboard_banner_close.webp');
 
+  /// File path: assets/images/icon_keyboard_banner_no_countdown.webp
+  AssetGenImage get iconKeyboardBannerNoCountdown => const AssetGenImage(
+    'assets/images/icon_keyboard_banner_no_countdown.webp',
+  );
+
   /// File path: assets/images/icon_keyboard_current_character_title.webp
   AssetGenImage get iconKeyboardCurrentCharacterTitle => const AssetGenImage(
     'assets/images/icon_keyboard_current_character_title.webp',
@@ -1409,6 +1414,7 @@ class $AssetsImagesGen {
     iconIntroTitle,
     iconKeyboardBanner,
     iconKeyboardBannerClose,
+    iconKeyboardBannerNoCountdown,
     iconKeyboardCurrentCharacterTitle,
     iconKeyboardCurrentGo,
     iconKeyboardDefaultAvatar,

+ 2 - 0
lib/resource/string.gen.dart

@@ -132,6 +132,7 @@ class StringName {
   static final String textSpanPrivacyPolicy = 'text_span_privacy_policy'.tr; // 《隐私政策》
   static final String textSpanServiceTerms = 'text_span_service_terms'.tr; // 《服务条款》
   static final String textSpanUserAgreement = 'text_span_user_agreement'.tr; // 《用户协议》
+  static final String textSpanMembershipAgreement = 'text_span_membership_agreement'.tr; // 《会员服务协议》
   static final String memberContinuePay = 'member_continue_pay'.tr; // 继续支付
   static final String memberPleaseChoiceGoods = 'member_please_choice_goods'.tr; // 请选择支付商品
   static final String memberPleaseChoicePayment = 'member_please_choice_payment'.tr; // 请选择支付方式
@@ -485,6 +486,7 @@ class StringMultiSource {
       'text_span_privacy_policy': '《隐私政策》',
       'text_span_service_terms': '《服务条款》',
       'text_span_user_agreement': '《用户协议》',
+      'text_span_membership_agreement': '《会员服务协议》',
       'member_continue_pay': '继续支付',
       'member_please_choice_goods': '请选择支付商品',
       'member_please_choice_payment': '请选择支付方式',

+ 1 - 0
lib/utils/channel_util.dart

@@ -1,4 +1,5 @@
 import 'package:atmob_channel_reader/atmob_channel_reader.dart';
+import 'package:flutter/cupertino.dart';
 
 import '../../device/atmob_platform_info.dart';
 import '../../utils/mmkv_util.dart';