Browse Source

Merge branch 'v1.0.3' of git.atmob.com:Atmob-Flutter/ElectronicAssistant into v1.0.3

Destiny 1 year ago
parent
commit
84d24b2af7

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

@@ -122,7 +122,7 @@
     <string name="store_pay_error">支付失败,请稍后重试</string>
     <string name="store_pay_error">支付失败,请稍后重试</string>
     <string name="store_query_pay_state">正在查询订单状态..</string>
     <string name="store_query_pay_state">正在查询订单状态..</string>
     <string name="store_pay_success">充电成功</string>
     <string name="store_pay_success">充电成功</string>
-    <string name="talk_summary_todo_title">所有待办</string>
+    <string name="talk_summary_todo_title">我的待办</string>
     <string name="exit_app_tip">再按一次退出应用</string>
     <string name="exit_app_tip">再按一次退出应用</string>
     <string name="popup_nearly_a_week">近一周</string>
     <string name="popup_nearly_a_week">近一周</string>
     <string name="popup_nearly_two_week">近两周</string>
     <string name="popup_nearly_two_week">近两周</string>

+ 5 - 0
lib/module/home/controller.dart

@@ -23,6 +23,7 @@ import '../../data/repositories/account_repository.dart';
 import '../../resource/colors.gen.dart';
 import '../../resource/colors.gen.dart';
 import '../../utils/error_handler.dart';
 import '../../utils/error_handler.dart';
 import '../../utils/toast_util.dart';
 import '../../utils/toast_util.dart';
+import '../agenda/detail/view.dart';
 import '../audiopicker/view.dart';
 import '../audiopicker/view.dart';
 
 
 class HomePageController extends BaseController {
 class HomePageController extends BaseController {
@@ -163,4 +164,8 @@ class HomePageController extends BaseController {
         barrierColor: ColorName.black55,
         barrierColor: ColorName.black55,
         backgroundColor: ColorName.transparent);
         backgroundColor: ColorName.transparent);
   }
   }
+
+  void onAgendaItemClick(Agenda item) {
+    AgendaDetailPage.start(item);
+  }
 }
 }

+ 1 - 4
lib/module/home/view.dart

@@ -16,12 +16,9 @@ import 'package:flutter/material.dart';
 import 'package:flutter_screenutil/flutter_screenutil.dart';
 import 'package:flutter_screenutil/flutter_screenutil.dart';
 import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
 import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
 import 'package:get/get.dart';
 import 'package:get/get.dart';
-
 import '../../data/bean/agenda.dart';
 import '../../data/bean/agenda.dart';
 import '../../router/app_pages.dart';
 import '../../router/app_pages.dart';
-import '../agenda/detail/view.dart';
 import '../agenda/task_item_view.dart';
 import '../agenda/task_item_view.dart';
-import '../talk/view.dart';
 import 'controller.dart';
 import 'controller.dart';
 
 
 class HomePage extends BasePage<HomePageController> {
 class HomePage extends BasePage<HomePageController> {
@@ -388,7 +385,7 @@ class HomePage extends BasePage<HomePageController> {
       Agenda item = controller.agendaList[index];
       Agenda item = controller.agendaList[index];
       return GestureDetector(
       return GestureDetector(
         onTap: () {
         onTap: () {
-          AgendaDetailPage.start(item);
+          controller.onAgendaItemClick(item);
         },
         },
         child: taskItemView(
         child: taskItemView(
           item,
           item,

+ 5 - 1
lib/module/talk/controller.dart

@@ -552,11 +552,15 @@ class TalkController extends BaseController {
     }
     }
   }
   }
 
 
+  void backToSpecificPage(String targetRoute) {
+    Get.until((route) => Get.currentRoute == targetRoute);
+  }
+
   Future<bool> checkLogin() async {
   Future<bool> checkLogin() async {
     if (!accountRepository.isLogin.value) {
     if (!accountRepository.isLogin.value) {
       bool isLogin = await LoginPage.start(fromType: LoginFromType.talkDetail);
       bool isLogin = await LoginPage.start(fromType: LoginFromType.talkDetail);
       if (isLogin) {
       if (isLogin) {
-        Get.offNamed(RoutePath.mainTab);
+        backToSpecificPage(RoutePath.mainTab);
       }
       }
       return false;
       return false;
     }
     }

+ 4 - 2
lib/utils/system_share_util.dart

@@ -13,7 +13,8 @@ class SystemShareUtil {
       if (!isInstalled) {
       if (!isInstalled) {
         throw SystemShareException('未安装微信');
         throw SystemShareException('未安装微信');
       }
       }
-      SystemShare.shareFile(filePath, wechatPackageName, '分享到微信');
+      SystemShare.shareFile(filePath, wechatPackageName, '分享到微信',
+          shareFileType: 'text/*');
     }
     }
   }
   }
 
 
@@ -25,7 +26,8 @@ class SystemShareUtil {
       if (!isInstalled) {
       if (!isInstalled) {
         throw SystemShareException('未安装QQ');
         throw SystemShareException('未安装QQ');
       }
       }
-      SystemShare.shareFile(filePath, qqPackageName, '分享到QQ');
+      SystemShare.shareFile(filePath, qqPackageName, '分享到QQ',
+          shareFileType: 'text/*');
     }
     }
   }
   }
 
 

+ 2 - 1
plugin/system_share/android/src/main/java/com/atmob/system_share/SystemSharePlugin.java

@@ -73,6 +73,7 @@ public class SystemSharePlugin implements FlutterPlugin, MethodCallHandler {
             String filePath = call.argument("filePath");
             String filePath = call.argument("filePath");
             String packageName = call.argument("packageName");
             String packageName = call.argument("packageName");
             String shareTitle = call.argument("shareTitle");
             String shareTitle = call.argument("shareTitle");
+            String shareFileType = call.argument("shareFileType");
             if (TextUtils.isEmpty(filePath) || TextUtils.isEmpty(packageName)) {
             if (TextUtils.isEmpty(filePath) || TextUtils.isEmpty(packageName)) {
                 result.error("-1", "SystemShare: filePath or packageName is empty or null", null);
                 result.error("-1", "SystemShare: filePath or packageName is empty or null", null);
                 return;
                 return;
@@ -86,7 +87,7 @@ public class SystemSharePlugin implements FlutterPlugin, MethodCallHandler {
                 result.error("-1", "SystemShare: app not installed", null);
                 result.error("-1", "SystemShare: app not installed", null);
                 return;
                 return;
             }
             }
-            SystemShareUtil.shareFile(applicationContext, file, packageName, shareTitle);
+            SystemShareUtil.shareFile(applicationContext, file, packageName, shareTitle,shareFileType);
             result.success(null);
             result.success(null);
         } catch (Exception e) {
         } catch (Exception e) {
             e.printStackTrace();
             e.printStackTrace();

+ 2 - 2
plugin/system_share/android/src/main/java/com/atmob/system_share/SystemShareUtil.java

@@ -22,9 +22,9 @@ public class SystemShareUtil {
         }
         }
     }
     }
 
 
-    static void shareFile(Context context, File file, String packageName, String shareTitle) {
+    static void shareFile(Context context, File file, String packageName, String shareTitle, String shareFileType) {
         Intent intent = new Intent(Intent.ACTION_SEND);
         Intent intent = new Intent(Intent.ACTION_SEND);
-        intent.setType("*/*");
+        intent.setType(shareFileType == null ? "*/*" : shareFileType);
         if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
         if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
             Uri fileUri = UriUtil.getFileUri(context, file);
             Uri fileUri = UriUtil.getFileUri(context, file);
             intent.putExtra(Intent.EXTRA_STREAM, fileUri);
             intent.putExtra(Intent.EXTRA_STREAM, fileUri);

+ 4 - 3
plugin/system_share/lib/system_share.dart

@@ -9,8 +9,9 @@ class SystemShare {
     return SystemSharePlatform.instance.isInstalled(packageName);
     return SystemSharePlatform.instance.isInstalled(packageName);
   }
   }
 
 
-  static void shareFile(
-      String filePath, String packageName, String? shareTitle) {
-    SystemSharePlatform.instance.shareFile(filePath, packageName, shareTitle);
+  static void shareFile(String filePath, String packageName, String? shareTitle,
+      {String? shareFileType}) {
+    SystemSharePlatform.instance.shareFile(
+        filePath, packageName, shareTitle, shareFileType: shareFileType);
   }
   }
 }
 }

+ 3 - 1
plugin/system_share/lib/system_share_method_channel.dart

@@ -17,11 +17,13 @@ class MethodChannelSystemShare extends SystemSharePlatform {
   }
   }
 
 
   @override
   @override
-  void shareFile(String filePath, String packageName, String? shareTitle) {
+  void shareFile(String filePath, String packageName, String? shareTitle,
+      {String? shareFileType}) {
     methodChannel.invokeMethod("shareFile", {
     methodChannel.invokeMethod("shareFile", {
       "filePath": filePath,
       "filePath": filePath,
       "packageName": packageName,
       "packageName": packageName,
       "shareTitle": shareTitle,
       "shareTitle": shareTitle,
+      "shareFileType": shareFileType,
     });
     });
   }
   }
 }
 }

+ 2 - 2
plugin/system_share/lib/system_share_platform_interface.dart

@@ -29,8 +29,8 @@ abstract class SystemSharePlatform extends PlatformInterface {
     throw UnimplementedError('isInstalled() has not been implemented.');
     throw UnimplementedError('isInstalled() has not been implemented.');
   }
   }
 
 
-  void shareFile(
-      String filePath, String packageName, String? shareTitle) async {
+  void shareFile(String filePath, String packageName, String? shareTitle,
+      {String? shareFileType}) async {
     throw UnimplementedError('shareFile() has not been implemented.');
     throw UnimplementedError('shareFile() has not been implemented.');
   }
   }
 }
 }