From 274f77ecb89887d565b64af0f4f550815ef33124 Mon Sep 17 00:00:00 2001 From: meng-fucius <494089941@qq.com> Date: Mon, 11 Apr 2022 16:37:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=BC=B9=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pages/splash/app_verify_dialog.dart | 147 ++++++++++++++++++++++++ lib/pages/splash/splash_page.dart | 95 +++++++-------- pubspec.yaml | 1 - tool/_build.dart | 14 ++- tool/config.dart | 8 +- 5 files changed, 210 insertions(+), 55 deletions(-) create mode 100644 lib/pages/splash/app_verify_dialog.dart diff --git a/lib/pages/splash/app_verify_dialog.dart b/lib/pages/splash/app_verify_dialog.dart new file mode 100644 index 00000000..61459a6b --- /dev/null +++ b/lib/pages/splash/app_verify_dialog.dart @@ -0,0 +1,147 @@ +import 'package:aku_new_community/base/base_style.dart'; +import 'package:aku_new_community/extensions/num_ext.dart'; +import 'package:aku_new_community/pages/setting_page/agreement_page/agreement_page.dart'; +import 'package:aku_new_community/pages/setting_page/agreement_page/privacy_page.dart'; +import 'package:aku_new_community/widget/bee_divider.dart'; +import 'package:flutter/gestures.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +class AppVerifyDialog extends StatelessWidget { + const AppVerifyDialog({Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + return Center( + child: Container( + width: 600.w, + height: 700.w, + clipBehavior: Clip.antiAliasWithSaveLayer, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(24.w), + ), + child: Material( + child: Container( + decoration: BoxDecoration( + gradient: LinearGradient( + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + stops: [ + 0, + 0.3, + ], + colors: [ + Color(0x33FBE541), + Colors.white, + ])), + child: Column( + children: [ + Padding( + padding: EdgeInsets.symmetric(horizontal: 40.w), + child: Column( + children: [ + 52.hb, + Text( + '欢迎使用小蜜蜂', + style: TextStyle( + color: Colors.black.withOpacity(0.85), + fontSize: 28.sp, + fontWeight: FontWeight.bold), + ), + 45.hb, + Text( + ''' +在您使用小蜜蜂前,请认真阅读并同意小蜜蜂使用条款和隐私政策,授权位置、设备信息、储存信息等权限,包括: +【地理位置权限】:根据您所处的地理位置提供个性化的内容信息; +【相册访问权限】:在报事报修、社区等功能中需要访问相册上传图片信息; +【其他权限】:使用过程中可能需要调用相机、麦克风、系统通知、及安装的应用列表等权限。 + ''', + style: TextStyle( + color: Colors.black.withOpacity(0.85), + fontSize: 24.sp), + ), + 30.hb, + RichText( + text: TextSpan( + text: '更多详细信息,请您阅读', + style: TextStyle( + color: Colors.black.withOpacity(0.85), + fontSize: 24.sp), + children: [ + TextSpan( + text: '《用户协议》', + style: TextStyle( + color: kPrimaryColor, fontSize: 24.sp), + recognizer: TapGestureRecognizer() + ..onTap = () { + Get.to(() => AgreementPage()); + }, + ), + TextSpan( + text: '、', + style: TextStyle( + color: Colors.black.withOpacity(0.85), + fontSize: 24.sp), + ), + TextSpan( + text: '《小蜜蜂隐私保护政策》', + style: TextStyle( + color: kPrimaryColor, fontSize: 24.sp), + recognizer: TapGestureRecognizer() + ..onTap = () { + Get.to(() => PrivacyPage()); + }, + ), + ]), + ), + ], + ), + ), + Spacer(), + BeeDivider.horizontal(), + ConstrainedBox( + constraints: BoxConstraints(maxHeight: 100.w), + child: Row( + children: [ + Expanded( + child: MaterialButton( + padding: EdgeInsets.symmetric(vertical: 30.w), + onPressed: () { + Get.back(result: false); + }, + child: Text('退出', + style: TextStyle( + + fontSize: 24.sp + ),), + ), + ), + Container( + width: 2.w, + height: double.infinity, + color: Color(0xFFF0F0F0), + ), + Expanded( + child: MaterialButton( + padding: EdgeInsets.symmetric(vertical: 20.w), + onPressed: () { + Get.back(result: true); + }, + child: Text('确认',style: TextStyle( + fontSize: 24.sp + ),), + ), + ), + ], + ), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/splash/splash_page.dart b/lib/pages/splash/splash_page.dart index e546c4d6..9d9f03db 100644 --- a/lib/pages/splash/splash_page.dart +++ b/lib/pages/splash/splash_page.dart @@ -5,6 +5,7 @@ import 'package:aku_new_community/main_initialize.dart'; import 'package:aku_new_community/pages/setting_page/agreement_page/agreement_page.dart'; import 'package:aku_new_community/pages/setting_page/agreement_page/privacy_page.dart'; import 'package:aku_new_community/pages/sign/login/other_login_page.dart'; +import 'package:aku_new_community/pages/splash/app_verify_dialog.dart'; import 'package:aku_new_community/utils/developer_util.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/utils/hive_store.dart'; @@ -33,52 +34,54 @@ class _SplashPageState extends State { TapGestureRecognizer _privacyRecognizer = TapGestureRecognizer(); Future _showLoginVerify() async { - return await showCupertinoDialog( - barrierDismissible: false, - context: context, - builder: (context) { - return CupertinoAlertDialog( - title: Text('隐私政策和用户协议'), - content: RichText( - text: TextSpan( - text: '点击登录即表示您已阅读并同意', - style: TextStyle(color: Colors.black), - children: [ - TextSpan( - text: '《用户协议》', - style: TextStyle(color: Colors.blue), - recognizer: _agreementRecognizer - ..onTap = () { - Get.to(() => AgreementPage()); - }), - TextSpan( - text: '《隐私政策》', - style: TextStyle(color: Colors.blue), - recognizer: _privacyRecognizer - ..onTap = () { - Get.to(() => PrivacyPage()); - }), - TextSpan( - style: TextStyle(color: Colors.black), - text: - '(特别是免除或限制责任、管辖等粗体下划线标注的条款)。如您不同意上述协议的任何条款,您应立即停止登录及使用本软件及服务。') - ]), - ), - - // ), - actions: [ - CupertinoDialogAction( - child: Text('拒绝'), - onPressed: () => Get.back(result: false), - ), - CupertinoDialogAction( - child: Text('同意'), - onPressed: () => Get.back(result: true), - ), - ], - ); - }, - ); + var re = await Get.dialog(AppVerifyDialog()); + return re; + // return await showCupertinoDialog( + // barrierDismissible: false, + // context: context, + // builder: (context) { + // return CupertinoAlertDialog( + // title: Text('隐私政策和用户协议'), + // content: RichText( + // text: TextSpan( + // text: '点击登录即表示您已阅读并同意', + // style: TextStyle(color: Colors.black), + // children: [ + // TextSpan( + // text: '《用户协议》', + // style: TextStyle(color: Colors.blue), + // recognizer: _agreementRecognizer + // ..onTap = () { + // Get.to(() => AgreementPage()); + // }), + // TextSpan( + // text: '《隐私政策》', + // style: TextStyle(color: Colors.blue), + // recognizer: _privacyRecognizer + // ..onTap = () { + // Get.to(() => PrivacyPage()); + // }), + // TextSpan( + // style: TextStyle(color: Colors.black), + // text: + // '(特别是免除或限制责任、管辖等粗体下划线标注的条款)。如您不同意上述协议的任何条款,您应立即停止登录及使用本软件及服务。') + // ]), + // ), + // + // // ), + // actions: [ + // CupertinoDialogAction( + // child: Text('拒绝'), + // onPressed: () => Get.back(result: false), + // ), + // CupertinoDialogAction( + // child: Text('同意'), + // onPressed: () => Get.back(result: true), + // ), + // ], + // ); + // }, + // ); } @override diff --git a/pubspec.yaml b/pubspec.yaml index 2e493812..a96f4fae 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -150,7 +150,6 @@ flutter: - assets/tab/ - assets/applications/ - assets/static/ - - assets/json/ - assets/bracelet/ - assets/home/ - assets/newIcon/ diff --git a/tool/_build.dart b/tool/_build.dart index 249976df..8eae5ce4 100644 --- a/tool/_build.dart +++ b/tool/_build.dart @@ -16,11 +16,17 @@ buildApk() async { String date = DateUtil.formatDate(DateTime.now(), format: 'yy_MM_dd_HH_mm'); String version = await getVersion(); - await runAsync('rm', arguments: ['-rf', Config.apkDir]); - await runAsync('mkdir', arguments: ['-p', Config.apkDir]); - await runAsync('mv', arguments: [ + await runAsync('rmdir', arguments: [ Config.apkDir]); + await runAsync('mkdir', arguments: [ Config.apkDir]); + await runAsync('move', arguments: [ Config.buildPath, - '${Config.apkDir}/${Config.packageName}_${version}_release_$date.apk' + '${Config.apkDir}\\${Config.packageName}_${version}_release_$date.apk' + ]); + await runAsync('ren',arguments: [ + + '${Config.apkDir}\\app-release.apk', + + '${Config.apkDir}\\${Config.packageName}_${version}_release_$date.apk', ]); } diff --git a/tool/config.dart b/tool/config.dart index 0839c522..80e38aff 100644 --- a/tool/config.dart +++ b/tool/config.dart @@ -1,19 +1,19 @@ class Config { ///用户根目录 - static const String homeDir = '/users/zhangmeng'; + static const String homeDir = 'G:\\apk'; ///包名 static const String packageName = 'aku_new_community'; ///打包目录 static String get buildPath => - './build/app/outputs/flutter-apk/app-release.apk'; + '\\build\\app\\outputs\\flutter-apk\\app-release.apk'; ///测试包文件夹 static String get apkDevDir => - '/users/zhangmeng/team/bee/app/aku_new_community/dev'; + '$homeDir\\aku_new_community\\dev'; ///正式包文件夹 static String get apkDir => - '/users/zhangmeng/team/bee/app/aku_new_community/release'; + '$homeDir\\aku_new_community\\release'; }