Переглянути джерело

[fit]修改首次启动展示活动页

云天逵 9 місяців тому
батько
коміт
60aeec2d34

+ 6 - 1
lib/handler/photo_scan_handler.dart

@@ -162,7 +162,12 @@ class PhotoScanHandler {
     ImagePickerUtil.peoplePhotos.value = result ?? [];
     ImagePickerUtil.locationPhotos['location'] = result ?? [];
     ImagePickerUtil.screenshotPhotos.value = result ?? [];
-    ImagePickerUtil.similarPhotos.add(result ?? []);
+    const int batchSize = 10;
+    for (int i = 0; i < result.length; i += batchSize) {
+      int end = (i + batchSize < result.length) ? i + batchSize : result.length;
+      List<AssetEntity> batch = result.sublist(i, end);
+      ImagePickerUtil.similarPhotos.add(batch);
+    }
     ImagePickerUtil.blurryPhotos.value = result ?? [];
 
     print("handleAndroidPhotos $result");

+ 1 - 1
lib/module/home/home_controller.dart

@@ -125,7 +125,7 @@ class HomeController extends BaseController {
 
     EventHandler.pushInstall();
 
-    if (!isFirstIntoApp() && !userRepository.isVip()) {
+    if (!userRepository.isVip()) {
       Get.toNamed(RoutePath.discount);
     }
     setFirstIntoApp(false);

+ 14 - 8
lib/module/similar_photo/similar_photo_view.dart

@@ -46,6 +46,11 @@ class SimilarPhotoPage extends BasePage<SimilarPhotoController> {
                               _buildPhotoGroup(
                                 imagesList: group.images,
                                 imageCount: group.images.length,
+                                  selectCount:group.selectedImages
+                                      .asMap()
+                                      .entries
+                                      .where((entry) => entry.value && entry.key < group.images.length)
+                                      .length,
                               ),
                               SizedBox(height: 15.h),
                             ],
@@ -175,6 +180,7 @@ class SimilarPhotoPage extends BasePage<SimilarPhotoController> {
   Widget _buildPhotoGroup({
     required List<AssetEntity> imagesList,
     required int imageCount,
+    required int selectCount,
   }) {
     return Container(
       padding: EdgeInsets.symmetric(horizontal: 12.w),
@@ -440,14 +446,14 @@ class SimilarPhotoPage extends BasePage<SimilarPhotoController> {
                 ),
               ),
               child: Center(
-                child: Obx(() => Text(
-                      'Move ${controller.getGroupByImages(imagesList).selectedImages.where((e) => e).length} to trash',
-                      style: TextStyle(
-                        color: Colors.white,
-                        fontSize: 16.sp,
-                        fontWeight: FontWeight.w500,
-                      ),
-                    )),
+                child:  Text(
+                  'Move $selectCount to trash',
+                  style: TextStyle(
+                    color: Colors.white,
+                    fontSize: 16.sp,
+                    fontWeight: FontWeight.w500,
+                  ),
+                ),
               ),
             ),
           )