ソースを参照

fix: 修复相册权限被限制无法打开的问题,修改UI问题

Destiny 6 ヶ月 前
コミット
9833b048e9

+ 1 - 0
lib/data/repository/store_repository.dart

@@ -155,6 +155,7 @@ class StoreRepository {
         )
         .then(HttpHandler.handle(true));
   }
+
   /// 检查当前是否有生效中的支付宝签约协议
   Future<MemberAgreementCheckResponse> checkMemberAgreement() async {
     return await atmobApi

+ 8 - 3
lib/module/keyboard/keyboard_view.dart

@@ -27,7 +27,10 @@ class KeyBoardView extends BaseView<KeyBoardController> {
       child: Stack(
         children: [
           IgnorePointer(
-            child: Assets.images.bgKeyboard.image(width: 360.w, fit: BoxFit.fill),
+            child: Assets.images.bgKeyboard.image(
+              width: 360.w,
+              fit: BoxFit.fill,
+            ),
           ),
           SafeArea(
             child: Stack(
@@ -399,7 +402,8 @@ class KeyBoardView extends BaseView<KeyBoardController> {
                                 ? controller.homeInfo!.intimacy! / 100
                                 : 0,
                         width: 88.w,
-                        onControllerCreated: (ctrl) => controller.heartController = ctrl,
+                        onControllerCreated:
+                            (ctrl) => controller.heartController = ctrl,
                       ),
                     ),
 
@@ -673,7 +677,8 @@ class KeyBoardView extends BaseView<KeyBoardController> {
               Visibility(
                 visible: isNotHWChannel(),
                 child: Positioned(
-                  right: 53.w,
+                  width: 57.w,
+                  right: 47.w,
                   bottom: 18.h,
                   child: Obx(
                     () => Text(

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

@@ -81,7 +81,7 @@ class NewDiscountPage extends BasePage<NewDiscountController> {
                             _buildSelectedDesc(),
                             SizedBox(height: 30.w),
                             _buildMemberCard(),
-                            SizedBox(height: 200.w),
+                            SizedBox(height: 110.w),
                           ],
                         ),
                       ),

+ 1 - 2
lib/module/store/store_page.dart

@@ -85,7 +85,6 @@ class StorePage extends BasePage<StoreController> {
               SizedBox(height: 12.h),
               _buildGoodsCard(),
               bottomArea,
-              SizedBox(height: 40.h),
             ],
           ),
         ),
@@ -1005,7 +1004,7 @@ class StorePage extends BasePage<StoreController> {
               style: Styles.getTextStyle99673300W400(10.sp),
             );
           }),
-          SizedBox(height: 150.h),
+          SizedBox(height: 110.h),
         ],
       ),
     );

+ 27 - 27
lib/utils/image_picker_util.dart

@@ -33,7 +33,7 @@ class ImagePickerUtil {
     } else {
       // iOS 请求照片权限
       final status = await Permission.photos.request();
-      return status.isGranted;
+      return status.isGranted || status.isLimited;
     }
   }
 
@@ -53,7 +53,7 @@ class ImagePickerUtil {
     } else {
       // iOS 判断照片权限
       final status = await Permission.photos.status;
-      return status.isGranted;
+      return status.isGranted || status.isLimited;
     }
   }
 
@@ -83,34 +83,34 @@ class ImagePickerUtil {
     required int maxAssetsCount,
     List<AssetEntity> selectedAssets = const [],
   }) async {
-    bool isAllow = await ImagePickerUtil.hasPermission();
+    bool isAllow = await ImagePickerUtil.requestPermissionExtend();
     if (!isAllow) {
-      bool shouldProceed = await PermissionDialog.showRequestDialog(
-        StringName.permissionDialogTitle,
-        PermissionDialog.buildStorageView(),
-        StringName.permissionDialogAuthorize,
-        "使用该功能App需要访问您设备“照片和媒体”权限,开启权限后,您可以上传图片使用该功能使用",
-        sureClick: () async {
-          bool granted = await ImagePickerUtil.requestPermissionExtend();
-          if (!granted &&
-              await ImagePickerUtil.isPermissionPermanentlyDenied()) {
-            Future.delayed(const Duration(milliseconds: 400), () {
-              AppSettingUtil.jumpSystemAppSetting();
-            });
-          }
-          return granted;
-        },
-      );
-      if (shouldProceed) {
-        return await pickImage(
-          context,
-          maxAssetsCount: maxAssetsCount,
-          selectedAssets: selectedAssets,
-        );
-      } else {
+      // bool shouldProceed = await PermissionDialog.showRequestDialog(
+      //   StringName.permissionDialogTitle,
+      //   PermissionDialog.buildStorageView(),
+      //   StringName.permissionDialogAuthorize,
+      //   "使用该功能App需要访问您设备“照片和媒体”权限,开启权限后,您可以上传图片使用该功能使用",
+      //   sureClick: () async {
+      //     bool granted = await ImagePickerUtil.requestPermissionExtend();
+      //     if (!granted &&
+      //         await ImagePickerUtil.isPermissionPermanentlyDenied()) {
+      //       Future.delayed(const Duration(milliseconds: 400), () {
+      //         AppSettingUtil.jumpSystemAppSetting();
+      //       });
+      //     }
+      //     return granted;
+      //   },
+      // );
+      // if (shouldProceed) {
+      //   return await pickImage(
+      //     context,
+      //     maxAssetsCount: maxAssetsCount,
+      //     selectedAssets: selectedAssets,
+      //   );
+      // } else {
         ToastUtil.show(StringName.pickerImagePermissionDeniedTip);
         return null;
-      }
+      // }
     }
     // 2. 权限已授权,打开选择器
     try {

+ 1 - 1
pubspec.yaml

@@ -3,7 +3,7 @@ description: "A new Flutter project."
 
 publish_to: 'none' # Remove this line if you wish to publish to pub.dev
 
-version: 1.0.1+6
+version: 1.0.1+7
 
 environment:
   sdk: ^3.7.0