Merge branch 'optimized_startup_wei' into develop
# Conflicts: # lib/mine/mineSet/mineSet/mineSet_page.dart
This commit is contained in:
commit
6422935562
BIN
ios/.DS_Store
vendored
BIN
ios/.DS_Store
vendored
Binary file not shown.
@ -28,8 +28,6 @@ PODS:
|
||||
- AMapFoundation (>= 1.8.0)
|
||||
- app_settings (5.1.1):
|
||||
- Flutter
|
||||
- audio_service (0.0.1):
|
||||
- Flutter
|
||||
- audio_session (0.0.1):
|
||||
- Flutter
|
||||
- audioplayers_darwin (0.0.1):
|
||||
@ -166,7 +164,6 @@ DEPENDENCIES:
|
||||
- amap_flutter_location (from `.symlinks/plugins/amap_flutter_location/ios`)
|
||||
- amap_flutter_map (from `.symlinks/plugins/amap_flutter_map/ios`)
|
||||
- app_settings (from `.symlinks/plugins/app_settings/ios`)
|
||||
- audio_service (from `.symlinks/plugins/audio_service/ios`)
|
||||
- audio_session (from `.symlinks/plugins/audio_session/ios`)
|
||||
- audioplayers_darwin (from `.symlinks/plugins/audioplayers_darwin/ios`)
|
||||
- auto_orientation (from `.symlinks/plugins/auto_orientation/ios`)
|
||||
@ -237,8 +234,6 @@ EXTERNAL SOURCES:
|
||||
:path: ".symlinks/plugins/amap_flutter_map/ios"
|
||||
app_settings:
|
||||
:path: ".symlinks/plugins/app_settings/ios"
|
||||
audio_service:
|
||||
:path: ".symlinks/plugins/audio_service/ios"
|
||||
audio_session:
|
||||
:path: ".symlinks/plugins/audio_session/ios"
|
||||
audioplayers_darwin:
|
||||
@ -318,7 +313,6 @@ SPEC CHECKSUMS:
|
||||
AMapFoundation: 9885c48fc3a78fdfb84a0299a2293e56ea3c9fec
|
||||
AMapLocation: 5248aec2455ebb5d104b367813c946430a2ee033
|
||||
app_settings: 017320c6a680cdc94c799949d95b84cb69389ebc
|
||||
audio_service: f509d65da41b9521a61f1c404dd58651f265a567
|
||||
audio_session: 088d2483ebd1dc43f51d253d4a1c517d9a2e7207
|
||||
audioplayers_darwin: 877d9a4d06331c5c374595e46e16453ac7eafa40
|
||||
auto_orientation: 102ed811a5938d52c86520ddd7ecd3a126b5d39d
|
||||
|
||||
@ -3,18 +3,12 @@ import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:permission_handler/permission_handler.dart';
|
||||
import 'package:star_lock/app_settings/app_settings.dart';
|
||||
import 'package:star_lock/blue/blue_manage.dart';
|
||||
import 'package:star_lock/flavors.dart';
|
||||
import 'package:star_lock/login/login/app_get_version.dart';
|
||||
import 'package:star_lock/main/lockMian/lockMain/lockMain_logic.dart';
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
import 'package:star_lock/tools/appFirstEnterHandle.dart';
|
||||
import 'package:star_lock/tools/app_manager.dart';
|
||||
import 'package:star_lock/tools/bindings/app_binding.dart';
|
||||
import 'package:star_lock/tools/customer_tool.dart';
|
||||
import 'package:star_lock/tools/pay/wx_pay_tool.dart';
|
||||
import 'package:star_lock/tools/storage.dart';
|
||||
|
||||
import 'package:star_lock/translations/app_dept.dart';
|
||||
|
||||
@ -5,7 +5,7 @@ import 'package:get/get.dart';
|
||||
import 'package:star_lock/flavors.dart';
|
||||
import 'package:star_lock/login/login/starLock_login_state.dart';
|
||||
import 'package:star_lock/tools/appFirstEnterHandle.dart';
|
||||
import 'package:star_lock/tools/customer_tool.dart';
|
||||
import 'package:star_lock/tools/wechat/customer_tool.dart';
|
||||
import 'package:star_lock/tools/storage.dart';
|
||||
|
||||
import '../../appRouters.dart';
|
||||
@ -15,7 +15,7 @@ import '../../tools/commonItem.dart';
|
||||
import '../../tools/submitBtn.dart';
|
||||
import '../../tools/tf_loginInput.dart';
|
||||
import '../../tools/titleAppBar.dart';
|
||||
import '../../translations/trans_lib.dart';
|
||||
import '../../tools/wechat/wechatManageTool.dart';
|
||||
import 'starLock_login_logic.dart';
|
||||
|
||||
class StarLockLoginPage extends StatefulWidget {
|
||||
@ -43,19 +43,21 @@ class _StarLockLoginPageState extends State<StarLockLoginPage> {
|
||||
resizeToAvoidBottomInset: false,
|
||||
backgroundColor: const Color(0xFFFFFFFF),
|
||||
appBar: TitleAppBar(
|
||||
barTitle: TranslationLoader.lanKeys!.login!.tr,
|
||||
barTitle: '登录'.tr,
|
||||
haveBack: false,
|
||||
backgroundColor: AppColors.mainColor,
|
||||
actionsList: <Widget>[
|
||||
const IconButton(
|
||||
onPressed: CustomerTool.openCustomerService,
|
||||
icon: Icon(
|
||||
IconButton(
|
||||
onPressed: (){
|
||||
WechatManageTool.getAppInfo(CustomerTool.openCustomerService);
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.support_agent,
|
||||
color: Colors.white,
|
||||
)),
|
||||
TextButton(
|
||||
child: Text(
|
||||
TranslationLoader.lanKeys!.register!.tr,
|
||||
'注册'.tr,
|
||||
style: TextStyle(color: Colors.white, fontSize: 24.sp),
|
||||
),
|
||||
onPressed: () async {
|
||||
@ -82,7 +84,7 @@ class _StarLockLoginPageState extends State<StarLockLoginPage> {
|
||||
SizedBox(height: 50.w),
|
||||
Obx(() => CommonItem(
|
||||
leftTitel:
|
||||
"${"你所在的".tr}${TranslationLoader.lanKeys!.countryAndRegion!.tr}",
|
||||
'你所在的国家/地区'.tr,
|
||||
rightTitle: '',
|
||||
isHaveLine: true,
|
||||
isPadding: false,
|
||||
@ -175,7 +177,7 @@ class _StarLockLoginPageState extends State<StarLockLoginPage> {
|
||||
Flexible(
|
||||
child: RichText(
|
||||
text: TextSpan(
|
||||
text: TranslationLoader.lanKeys!.readAndAgree!.tr,
|
||||
text: '我已阅读并同意'.tr,
|
||||
style: TextStyle(
|
||||
color: const Color(0xff333333), fontSize: 20.sp),
|
||||
children: <InlineSpan>[
|
||||
@ -183,7 +185,7 @@ class _StarLockLoginPageState extends State<StarLockLoginPage> {
|
||||
alignment: PlaceholderAlignment.middle,
|
||||
child: GestureDetector(
|
||||
child: Text(
|
||||
'《${TranslationLoader.lanKeys!.userAgreement!.tr}》',
|
||||
'《${'用户协议'.tr}》',
|
||||
style: TextStyle(
|
||||
color: AppColors.mainColor,
|
||||
fontSize: 20.sp)),
|
||||
@ -199,7 +201,7 @@ class _StarLockLoginPageState extends State<StarLockLoginPage> {
|
||||
alignment: PlaceholderAlignment.middle,
|
||||
child: GestureDetector(
|
||||
child: Text(
|
||||
'《${TranslationLoader.lanKeys!.privacyPolicy!.tr}》',
|
||||
'《${'隐私政策'.tr}》',
|
||||
style: TextStyle(
|
||||
color: AppColors.mainColor,
|
||||
fontSize: 20.sp)),
|
||||
@ -218,7 +220,7 @@ class _StarLockLoginPageState extends State<StarLockLoginPage> {
|
||||
),
|
||||
SizedBox(height: 50.w),
|
||||
Obx(() => SubmitBtn(
|
||||
btnName: TranslationLoader.lanKeys!.login!.tr,
|
||||
btnName: '登录'.tr,
|
||||
fontSize: 28.sp,
|
||||
borderRadius: 20.w,
|
||||
padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
|
||||
@ -244,7 +246,7 @@ class _StarLockLoginPageState extends State<StarLockLoginPage> {
|
||||
// color: Colors.red,
|
||||
child: Center(
|
||||
child: Text(
|
||||
'${TranslationLoader.lanKeys!.forgetPassword!.tr}?',
|
||||
'${'忘记密码'.tr}?',
|
||||
style: TextStyle(
|
||||
fontSize: 22.sp, color: AppColors.mainColor)),
|
||||
),
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
@ -5,7 +6,7 @@ import 'package:get/get.dart';
|
||||
import 'package:star_lock/flavors.dart';
|
||||
import 'package:star_lock/login/login/starLock_login_state.dart';
|
||||
import 'package:star_lock/tools/appFirstEnterHandle.dart';
|
||||
import 'package:star_lock/tools/customer_tool.dart';
|
||||
import 'package:star_lock/tools/wechat/customer_tool.dart';
|
||||
import 'package:star_lock/tools/storage.dart';
|
||||
|
||||
import '../../appRouters.dart';
|
||||
@ -13,7 +14,7 @@ import '../../app_settings/app_colors.dart';
|
||||
import '../../common/XSConstantMacro/XSConstantMacro.dart';
|
||||
import '../../tools/submitBtn.dart';
|
||||
import '../../tools/tf_loginInput.dart';
|
||||
import '../../translations/trans_lib.dart';
|
||||
import '../../tools/wechat/wechatManageTool.dart';
|
||||
import 'starLock_login_logic.dart';
|
||||
|
||||
class StarLockLoginXHJPage extends StatefulWidget {
|
||||
@ -64,7 +65,9 @@ class _StarLockLoginPageState extends State<StarLockLoginXHJPage> {
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
onPressed: CustomerTool.openCustomerService,
|
||||
onPressed: (){
|
||||
WechatManageTool.getAppInfo(CustomerTool.openCustomerService);
|
||||
},
|
||||
icon: Icon(
|
||||
Icons.support_agent,
|
||||
color: AppColors.mainColor,
|
||||
@ -91,7 +94,7 @@ class _StarLockLoginPageState extends State<StarLockLoginXHJPage> {
|
||||
width: 5.w,
|
||||
),
|
||||
Text(
|
||||
TranslationLoader.lanKeys!.countryAndRegion!.tr,
|
||||
'国家/地区'.tr,
|
||||
style: TextStyle(
|
||||
fontSize: 22.sp,
|
||||
color: AppColors.darkGrayTextColor),
|
||||
@ -152,73 +155,7 @@ class _StarLockLoginPageState extends State<StarLockLoginXHJPage> {
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
color: Colors.transparent,
|
||||
padding:
|
||||
EdgeInsets.symmetric(vertical: 30.h, horizontal: 40.w),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Obx(() => GestureDetector(
|
||||
onTap: () {
|
||||
state.agree.value = !state.agree.value;
|
||||
logic.changeAgreeState();
|
||||
},
|
||||
child: Container(
|
||||
width: 40.w,
|
||||
height: 40.w,
|
||||
// color: Colors.red,
|
||||
padding: EdgeInsets.only(
|
||||
left: 5.w,
|
||||
right: 10.w,
|
||||
),
|
||||
child: Image.asset(
|
||||
state.agree.value
|
||||
? 'images/icon_round_select.png'
|
||||
: 'images/icon_round_unSelect.png',
|
||||
width: 20.w,
|
||||
height: 20.w,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Row(children: <Widget>[
|
||||
Text(TranslationLoader.lanKeys!.readAndAgree!.tr,
|
||||
style: TextStyle(
|
||||
color: const Color(0xff333333),
|
||||
fontSize: 20.sp)),
|
||||
GestureDetector(
|
||||
child: Text(
|
||||
'《${TranslationLoader.lanKeys!.userAgreement!.tr}》',
|
||||
style: TextStyle(
|
||||
color: AppColors.mainColor,
|
||||
fontSize: 20.sp)),
|
||||
onTap: () {
|
||||
Get.toNamed(Routers.webviewShowPage,
|
||||
arguments: <String, String>{
|
||||
'url': XSConstantMacro.userAgreementURL,
|
||||
'title': '用户协议'.tr
|
||||
});
|
||||
},
|
||||
),
|
||||
GestureDetector(
|
||||
child: Text(
|
||||
'《${TranslationLoader.lanKeys!.privacyPolicy!.tr}》',
|
||||
style: TextStyle(
|
||||
color: AppColors.mainColor,
|
||||
fontSize: 20.sp)),
|
||||
onTap: () {
|
||||
Get.toNamed(Routers.webviewShowPage,
|
||||
arguments: <String, String>{
|
||||
'url': XSConstantMacro.privacyPolicyURL,
|
||||
'title': '隐私政策'.tr
|
||||
});
|
||||
},
|
||||
),
|
||||
]),
|
||||
],
|
||||
),
|
||||
),
|
||||
_buildBottomAgreement(),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 40.w),
|
||||
child: Column(
|
||||
@ -226,7 +163,7 @@ class _StarLockLoginPageState extends State<StarLockLoginXHJPage> {
|
||||
children: <Widget>[
|
||||
SizedBox(height: 5.w),
|
||||
Obx(() => SubmitBtn(
|
||||
btnName: TranslationLoader.lanKeys!.login!.tr,
|
||||
btnName: '登录'.tr,
|
||||
fontSize: 28.sp,
|
||||
borderRadius: 20.w,
|
||||
padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
|
||||
@ -260,7 +197,7 @@ class _StarLockLoginPageState extends State<StarLockLoginXHJPage> {
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: AppColors.mainColor),
|
||||
child: Text(
|
||||
TranslationLoader.lanKeys!.register!.tr,
|
||||
'注册'.tr,
|
||||
style:
|
||||
TextStyle(fontSize: 22.sp, color: Colors.white),
|
||||
),
|
||||
@ -276,8 +213,7 @@ class _StarLockLoginPageState extends State<StarLockLoginXHJPage> {
|
||||
height: 50.h,
|
||||
// color: Colors.red,
|
||||
child: Center(
|
||||
child: Text(
|
||||
'${TranslationLoader.lanKeys!.forgetPassword!.tr}?',
|
||||
child: Text('${'忘记密码'.tr}?',
|
||||
style: TextStyle(
|
||||
fontSize: 22.sp,
|
||||
color: AppColors.mainColor)),
|
||||
@ -387,4 +323,113 @@ class _StarLockLoginPageState extends State<StarLockLoginXHJPage> {
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildBottomAgreement() {
|
||||
return Container(
|
||||
width: 1.sw,
|
||||
padding: EdgeInsets.only(left: 40.w, bottom:30.w, right: 40.w, top: 40.h),
|
||||
child: Wrap(
|
||||
// mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Obx(() => GestureDetector(
|
||||
onTap: () {
|
||||
state.agree.value = !state.agree.value;
|
||||
logic.changeAgreeState();
|
||||
},
|
||||
child: Container(
|
||||
width: 40.w,
|
||||
height: 40.w,
|
||||
// color: Colors.red,
|
||||
padding: EdgeInsets.only(
|
||||
left: 5.w,
|
||||
right: 10.w,
|
||||
),
|
||||
child: Image.asset(
|
||||
state.agree.value
|
||||
? 'images/icon_round_select.png'
|
||||
: 'images/icon_round_unSelect.png',
|
||||
width: 20.w,
|
||||
height: 20.w,
|
||||
),
|
||||
)
|
||||
)),
|
||||
SizedBox(
|
||||
width: 10.w,
|
||||
),
|
||||
Text(
|
||||
'我已阅读并同意'.tr,
|
||||
style:
|
||||
TextStyle(color: const Color(0xff333333), fontSize: 20.sp),
|
||||
),
|
||||
GestureDetector(
|
||||
child: Text(
|
||||
'《${'用户协议'.tr}》',
|
||||
style: TextStyle(
|
||||
color: AppColors.mainColor, fontSize: 20.sp)),
|
||||
onTap: () {
|
||||
Get.toNamed(Routers.webviewShowPage,
|
||||
arguments: <String, String>{
|
||||
'url': XSConstantMacro.userAgreementURL,
|
||||
'title': '用户协议'.tr
|
||||
});
|
||||
},
|
||||
),
|
||||
GestureDetector(
|
||||
child: Text(
|
||||
'《${'隐私政策'.tr}》',
|
||||
style: TextStyle(
|
||||
color: AppColors.mainColor, fontSize: 20.sp)),
|
||||
onTap: () {
|
||||
Get.toNamed(Routers.webviewShowPage,
|
||||
arguments: <String, String>{
|
||||
'url': XSConstantMacro.privacyPolicyURL,
|
||||
'title': '隐私政策'.tr
|
||||
});
|
||||
},
|
||||
)
|
||||
|
||||
// Flexible(
|
||||
// child: Text.rich(
|
||||
// TextSpan(
|
||||
// text: '我已阅读并同意'.tr,
|
||||
// style:
|
||||
// TextStyle(color: const Color(0xff333333), fontSize: 20.sp),
|
||||
// children: <InlineSpan>[
|
||||
// WidgetSpan(
|
||||
// alignment: PlaceholderAlignment.middle,
|
||||
// child: GestureDetector(
|
||||
// child: Text(
|
||||
// '《${'用户协议'.tr}》',
|
||||
// style: TextStyle(
|
||||
// color: AppColors.mainColor, fontSize: 20.sp)),
|
||||
// onTap: () {
|
||||
// Get.toNamed(Routers.webviewShowPage,
|
||||
// arguments: <String, String>{
|
||||
// 'url': XSConstantMacro.userAgreementURL,
|
||||
// 'title': '用户协议'.tr
|
||||
// });
|
||||
// },
|
||||
// )),
|
||||
// WidgetSpan(
|
||||
// alignment: PlaceholderAlignment.middle,
|
||||
// child: GestureDetector(
|
||||
// child: Text(
|
||||
// '《${'隐私政策'.tr}》',
|
||||
// style: TextStyle(
|
||||
// color: AppColors.mainColor, fontSize: 20.sp)),
|
||||
// onTap: () {
|
||||
// Get.toNamed(Routers.webviewShowPage,
|
||||
// arguments: <String, String>{
|
||||
// 'url': XSConstantMacro.privacyPolicyURL,
|
||||
// 'title': '隐私政策'.tr
|
||||
// });
|
||||
// },
|
||||
// )),
|
||||
// ],
|
||||
// )),
|
||||
// )
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,20 +1,20 @@
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:path/path.dart' as path;
|
||||
import 'package:star_lock/flavors.dart';
|
||||
import 'package:star_lock/login/login/app_get_version.dart';
|
||||
import 'package:star_lock/mine/about/debug/debug_tool.dart';
|
||||
import 'package:star_lock/network/api_provider.dart';
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
import 'package:star_lock/tools/bugly/bugly_tool.dart';
|
||||
import 'package:star_lock/tools/customer_tool.dart';
|
||||
import 'package:star_lock/tools/device_info_service.dart';
|
||||
import 'package:star_lock/tools/pay/wx_pay_tool.dart';
|
||||
import 'package:star_lock/tools/platform_info_services.dart';
|
||||
import 'package:star_lock/tools/storage.dart';
|
||||
import 'package:star_lock/tools/push/xs_jPhush.dart';
|
||||
import 'package:star_lock/tools/storage.dart';
|
||||
import 'package:star_lock/translations/trans_lib.dart';
|
||||
|
||||
import 'app.dart';
|
||||
@ -33,14 +33,6 @@ FutureOr<void> main() async {
|
||||
final bool isLogin = await getLoginStatus();
|
||||
if (isLogin) {
|
||||
await privacySDKInitialization();
|
||||
Future<void>.delayed(const Duration(milliseconds: 500), () async {
|
||||
AppLog.log('main函数调用了获取App信息接口');
|
||||
final GetAppInfo entity = await ApiRepository.to.getAppInfo();
|
||||
CustomerTool.init(entity.data?.wechatServiceUrl ?? '');
|
||||
if (entity.data?.appSiteUrl != null) {
|
||||
WxPayTool.setAssociationUrl(entity.data!.appSiteUrl!);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
||||
@ -57,6 +49,8 @@ FutureOr<void> main() async {
|
||||
SystemUiOverlayStyle(statusBarColor: Colors.transparent);
|
||||
SystemChrome.setSystemUIOverlayStyle(systemUiOverlayStyle);
|
||||
}
|
||||
|
||||
// checkChinese();
|
||||
}
|
||||
|
||||
// 设置国际化信息
|
||||
@ -87,3 +81,27 @@ Future<void> privacySDKInitialization() async {
|
||||
final XSJPushProvider jpushProvider = XSJPushProvider();
|
||||
await jpushProvider.initJPushService();
|
||||
}
|
||||
|
||||
void checkChinese(){
|
||||
// 获取当前脚本的目录
|
||||
final String scriptDir = path.dirname(Platform.script.path);
|
||||
|
||||
// 遍历这个目录下的所有 .dart 文件
|
||||
findChineseCharacters(Directory(scriptDir));
|
||||
}
|
||||
|
||||
void findChineseCharacters(Directory directory) {
|
||||
final List<FileSystemEntity> files = directory.listSync(recursive: true);
|
||||
for (FileSystemEntity file in files) {
|
||||
if (file is File && file.path.endsWith('.dart')) {
|
||||
final String content = file.readAsStringSync(encoding: utf8);
|
||||
if (hasChineseCharacters(content)) {
|
||||
print('Found Chinese characters in ${file.path}');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool hasChineseCharacters(String input) {
|
||||
return RegExp(r'[\u4e00-\u9fa5]').hasMatch(input);
|
||||
}
|
||||
@ -1,3 +1,4 @@
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/scheduler.dart';
|
||||
@ -17,7 +18,6 @@ import 'package:star_lock/widget/permission/permission_dialog.dart';
|
||||
import '../../../app_settings/app_settings.dart';
|
||||
import '../../../blue/blue_manage.dart';
|
||||
import '../../../blue/io_protocol/io_openLock.dart';
|
||||
import '../../../blue/io_protocol/io_referEventRecordTime.dart';
|
||||
import '../../../blue/io_reply.dart';
|
||||
import '../../../blue/io_tool/io_tool.dart';
|
||||
import '../../../blue/io_tool/manager_event_bus.dart';
|
||||
@ -27,9 +27,7 @@ import '../../../tools/baseGetXController.dart';
|
||||
import '../../../tools/commonDataManage.dart';
|
||||
import '../../../tools/eventBusEventManage.dart';
|
||||
import '../../../tools/storage.dart';
|
||||
import '../../../translations/trans_lib.dart';
|
||||
import '../lockOperatingRecord/keyOperationRecord_entity.dart';
|
||||
import '../lockOperatingRecord/lockOperatingRecordGetLastRecordTime_entity.dart';
|
||||
import '../lockSet/basicInformation/uploadElectricQuantity/uploadElectricQuantity_entity.dart';
|
||||
import 'lockDetail_state.dart';
|
||||
import 'lockNetToken_entity.dart';
|
||||
@ -43,8 +41,7 @@ class LockDetailLogic extends BaseGetXController {
|
||||
|
||||
// 监听设备返回的数据
|
||||
void initReplySubscription() {
|
||||
state.replySubscription =
|
||||
EventBusManager().eventBus!.on<Reply>().listen((Reply reply) async {
|
||||
state.replySubscription = EventBusManager().eventBus!.on<Reply>().listen((Reply reply) async {
|
||||
// 开门
|
||||
if (reply is OpenDoorReply && state.ifCurrentScreen.value == true) {
|
||||
_replyOpenLock(reply);
|
||||
@ -92,10 +89,12 @@ class LockDetailLogic extends BaseGetXController {
|
||||
|
||||
// 开锁成功上报
|
||||
lockReportLockSuccessfullyUploadData();
|
||||
//锁数据更新
|
||||
// getLockRecordLastUploadDataTime();
|
||||
|
||||
resetOpenDoorState();
|
||||
state.animationController!.stop();
|
||||
|
||||
//锁数据更新
|
||||
// getLockRecordLastUploadDataTime();
|
||||
break;
|
||||
case 0x06:
|
||||
//无权限
|
||||
@ -152,33 +151,32 @@ class LockDetailLogic extends BaseGetXController {
|
||||
break;
|
||||
case 0x0a:
|
||||
// 钥匙不存在
|
||||
showToast('钥匙不存在');
|
||||
showToast('钥匙不存在'.tr);
|
||||
openDoorError();
|
||||
break;
|
||||
case 0x0c:
|
||||
// 钥匙数量已到上限
|
||||
showToast('钥匙数量已到上限');
|
||||
showToast('钥匙数量已到上限'.tr);
|
||||
openDoorError();
|
||||
break;
|
||||
case 0x0e:
|
||||
// 钥匙已存在
|
||||
showToast('钥匙已存在');
|
||||
showToast('钥匙已存在'.tr);
|
||||
openDoorError();
|
||||
break;
|
||||
case 0x0f:
|
||||
// 用户已存在
|
||||
showToast('用户已存在');
|
||||
showToast('用户已存在'.tr);
|
||||
openDoorError();
|
||||
break;
|
||||
default:
|
||||
//失败
|
||||
AppLog.log('开锁失败');
|
||||
// AppLog.log('开锁失败');
|
||||
openDoorError();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Future<void> loadData({ required LockListInfoItemEntity lockListInfoItemEntity,required bool isOnlyOneData}) async {
|
||||
state.keyInfos.value = lockListInfoItemEntity;
|
||||
CommonDataManage().currentLockUserNo = state.keyInfos.value.lockUserNo!;
|
||||
@ -438,7 +436,7 @@ class LockDetailLogic extends BaseGetXController {
|
||||
.getLockNetToken(lockId: state.keyInfos.value.lockId.toString());
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
state.lockNetToken = entity.data!.token!.toString();
|
||||
AppLog.log('从服务器获取联网token:${state.lockNetToken}');
|
||||
// AppLog.log('从服务器获取联网token:${state.lockNetToken}');
|
||||
openDoorAction();
|
||||
} else {
|
||||
showToast('网络访问失败,请检查网络是否正常'.tr, something: () {
|
||||
|
||||
@ -326,7 +326,7 @@ class LockListLogic extends BaseGetXController {
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
AppLog.log('onInit调用了 setLockListInfoGroupEntity');
|
||||
// AppLog.log('onInit调用了 setLockListInfoGroupEntity');
|
||||
setLockListInfoGroupEntity(entity!);
|
||||
}
|
||||
|
||||
|
||||
@ -38,7 +38,7 @@ class LockMainLogic extends BaseGetXController {
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
// AppLog.log('请求列表调用 loadMainDataLogic');
|
||||
await loadMainDataLogic(entity.data!);
|
||||
updateZoneOffsetsAndLanguages();
|
||||
// updateZoneOffsetsAndLanguages();
|
||||
}
|
||||
return entity;
|
||||
}
|
||||
@ -108,24 +108,24 @@ class LockMainLogic extends BaseGetXController {
|
||||
}
|
||||
|
||||
/// 获取联网类型
|
||||
Future<void> getConnectType() async {
|
||||
final ConnectivityResult connectResult =
|
||||
await Connectivity().checkConnectivity();
|
||||
if (connectResult == ConnectivityResult.mobile) {
|
||||
// _netType = "4G";
|
||||
state.networkConnectionStatus.value = 1;
|
||||
AppLog.log('网络连接: 4G 4G 4G 4G 4G');
|
||||
} else if (connectResult == ConnectivityResult.wifi) {
|
||||
// _netType = "wifi";
|
||||
state.networkConnectionStatus.value = 1;
|
||||
AppLog.log('网络连接: wifi wifi wifi wifi wifi');
|
||||
} else {
|
||||
// _netType = "未连接";
|
||||
state.networkConnectionStatus.value = 0;
|
||||
AppLog.log('网络连接: 未连接 未连接 未连接 未连接 未连接');
|
||||
// showToast("网络访问失败,请检查网络是否正常");
|
||||
}
|
||||
}
|
||||
// Future<void> _getConnectType() async {
|
||||
// final ConnectivityResult connectResult =
|
||||
// await Connectivity().checkConnectivity();
|
||||
// if (connectResult == ConnectivityResult.mobile) {
|
||||
// // _netType = "4G";
|
||||
// state.networkConnectionStatus.value = 1;
|
||||
// AppLog.log('网络连接: 4G 4G 4G 4G 4G');
|
||||
// } else if (connectResult == ConnectivityResult.wifi) {
|
||||
// // _netType = "wifi";
|
||||
// state.networkConnectionStatus.value = 1;
|
||||
// AppLog.log('网络连接: wifi wifi wifi wifi wifi');
|
||||
// } else {
|
||||
// // _netType = "未连接";
|
||||
// state.networkConnectionStatus.value = 0;
|
||||
// AppLog.log('网络连接: 未连接 未连接 未连接 未连接 未连接');
|
||||
// // showToast("网络访问失败,请检查网络是否正常");
|
||||
// }
|
||||
// }
|
||||
|
||||
/// 判断网络是否连接
|
||||
Future<bool> isConnected() async {
|
||||
@ -135,19 +135,18 @@ class LockMainLogic extends BaseGetXController {
|
||||
}
|
||||
|
||||
/// 设置网络切换监听
|
||||
Future<void> connectListener() async {
|
||||
Connectivity().onConnectivityChanged.listen((ConnectivityResult result) {
|
||||
AppLog.log('设置网络切换监听:$result');
|
||||
if (state.networkConnectionStatus.value == 0 &&
|
||||
result != ConnectivityResult.none) {
|
||||
// 从无网络到有网络
|
||||
state.networkConnectionStatus.value = 1;
|
||||
getStarLockInfo(isUnShowLoading: true);
|
||||
} else if (result == ConnectivityResult.none) {
|
||||
state.networkConnectionStatus.value = 0;
|
||||
}
|
||||
});
|
||||
}
|
||||
// Future<void> connectListener() async {
|
||||
// Connectivity().onConnectivityChanged.listen((ConnectivityResult result) {
|
||||
// AppLog.log('设置网络切换监听:$result');
|
||||
// if (state.networkConnectionStatus.value == 0 && result != ConnectivityResult.none) {
|
||||
// // 从无网络到有网络
|
||||
// state.networkConnectionStatus.value = 1;
|
||||
// getStarLockInfo(isUnShowLoading: true);
|
||||
// } else if (result == ConnectivityResult.none) {
|
||||
// state.networkConnectionStatus.value = 0;
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
/// 判断是否有网络
|
||||
Future<bool> judgeTheNetwork() async {
|
||||
@ -314,7 +313,7 @@ class LockMainLogic extends BaseGetXController {
|
||||
super.onInit();
|
||||
checkWhetherPushIsEnabled();
|
||||
_initSubscription();
|
||||
connectListener();
|
||||
// connectListener();
|
||||
|
||||
// AppLog.log('onInit() updateZoneOffsetsAndLanguages');
|
||||
// updateZoneOffsetsAndLanguages();
|
||||
|
||||
@ -34,8 +34,7 @@ class StarLockMainPage extends StatefulWidget {
|
||||
State<StarLockMainPage> createState() => _StarLockMainPageState();
|
||||
}
|
||||
|
||||
class _StarLockMainPageState extends State<StarLockMainPage>
|
||||
with BaseWidget, AutomaticKeepAliveClientMixin {
|
||||
class _StarLockMainPageState extends State<StarLockMainPage> with BaseWidget, AutomaticKeepAliveClientMixin, WidgetsBindingObserver {
|
||||
final LockMainLogic logic = Get.put(LockMainLogic());
|
||||
final LockMainState state = Get.find<LockMainLogic>().state;
|
||||
|
||||
@ -244,6 +243,32 @@ class _StarLockMainPageState extends State<StarLockMainPage>
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
void didChangeAppLifecycleState(AppLifecycleState state) {
|
||||
super.didChangeAppLifecycleState(state);
|
||||
// AppLog.log('App--->state:$state');
|
||||
switch (state) {
|
||||
case AppLifecycleState.inactive:
|
||||
// AppLog.log('App--->进入非活动状态');
|
||||
break;
|
||||
case AppLifecycleState.paused:
|
||||
// AppLog.log('App--->进入后台');
|
||||
BlueManage().disconnect();
|
||||
break;
|
||||
case AppLifecycleState.resumed:
|
||||
// AppLog.log('App--->进入前台');
|
||||
logic.pageNo = 1;
|
||||
getHttpData();
|
||||
break;
|
||||
case AppLifecycleState.detached:
|
||||
// AppLog.log('App--->挂起');
|
||||
break;
|
||||
case AppLifecycleState.hidden:
|
||||
// AppLog.log('App--->隐藏');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:package_info_plus/package_info_plus.dart';
|
||||
@ -10,7 +12,6 @@ import '../../app_settings/app_colors.dart';
|
||||
import '../../flavors.dart';
|
||||
import '../../tools/commonItem.dart';
|
||||
import '../../tools/titleAppBar.dart';
|
||||
import '../../translations/trans_lib.dart';
|
||||
|
||||
class AboutPage extends StatefulWidget {
|
||||
const AboutPage({Key? key}) : super(key: key);
|
||||
@ -51,12 +52,12 @@ class _AboutPageState extends State<AboutPage> {
|
||||
backgroundColor: AppColors.mainBackgroundColor,
|
||||
appBar: F.sw(
|
||||
skyCall: () => TitleAppBar(
|
||||
barTitle: TranslationLoader.lanKeys!.about!.tr,
|
||||
barTitle: '关于'.tr,
|
||||
haveBack: true,
|
||||
backgroundColor: AppColors.mainColor,
|
||||
),
|
||||
xhjCall: () => TitleAppBar(
|
||||
barTitle: TranslationLoader.lanKeys!.about!.tr,
|
||||
barTitle: '关于'.tr,
|
||||
haveBack: true,
|
||||
backgroundColor: Colors.white,
|
||||
iconColor: AppColors.blackColor,
|
||||
@ -80,7 +81,7 @@ class _AboutPageState extends State<AboutPage> {
|
||||
Widget view = Column(
|
||||
children: [
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.introduce!.tr,
|
||||
leftTitel: '介绍'.tr,
|
||||
rightTitle: '',
|
||||
isHaveLine: false,
|
||||
isHaveDirection: true,
|
||||
@ -97,7 +98,7 @@ class _AboutPageState extends State<AboutPage> {
|
||||
endIndent: 20.w,
|
||||
),
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.userAgreement!.tr,
|
||||
leftTitel: '用户协议'.tr,
|
||||
rightTitle: '',
|
||||
isHaveLine: false,
|
||||
isHaveDirection: true,
|
||||
@ -114,7 +115,7 @@ class _AboutPageState extends State<AboutPage> {
|
||||
endIndent: 20.w,
|
||||
),
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.privacyPolicy!.tr,
|
||||
leftTitel: '隐私政策'.tr,
|
||||
rightTitle: '',
|
||||
isHaveLine: false,
|
||||
isHaveDirection: true,
|
||||
@ -131,8 +132,7 @@ class _AboutPageState extends State<AboutPage> {
|
||||
endIndent: 20.w,
|
||||
),
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader
|
||||
.lanKeys!.personalInformationCollectionList!.tr,
|
||||
leftTitel: '个人信息收集清单'.tr,
|
||||
rightTitle: '',
|
||||
isHaveLine: false,
|
||||
isHaveDirection: true,
|
||||
@ -149,8 +149,7 @@ class _AboutPageState extends State<AboutPage> {
|
||||
endIndent: 20.w,
|
||||
),
|
||||
CommonItem(
|
||||
leftTitel:
|
||||
TranslationLoader.lanKeys!.applicationPermissionDescription!.tr,
|
||||
leftTitel:'应用权限说明'.tr,
|
||||
rightTitle: '',
|
||||
isHaveLine: false,
|
||||
isHaveDirection: true,
|
||||
@ -167,8 +166,7 @@ class _AboutPageState extends State<AboutPage> {
|
||||
endIndent: 20.w,
|
||||
),
|
||||
CommonItem(
|
||||
leftTitel:
|
||||
TranslationLoader.lanKeys!.thirdPartyInformationSharingList!.tr,
|
||||
leftTitel:'第三方信息共享清单'.tr,
|
||||
rightTitle: '',
|
||||
isHaveLine: false,
|
||||
isHaveDirection: true,
|
||||
@ -213,14 +211,17 @@ class _AboutPageState extends State<AboutPage> {
|
||||
),
|
||||
),
|
||||
),
|
||||
ClipRRect(
|
||||
borderRadius: BorderRadius.circular(20.r),
|
||||
child: Image.asset(
|
||||
F.sw(
|
||||
skyCall: () => 'images/icon_main_sky_1024.png',
|
||||
xhjCall: () => 'images/icon_main_xhj_1024.png'),
|
||||
width: 160.w,
|
||||
height: 160.w),
|
||||
GestureDetector(
|
||||
onTap: logic.handleTap,
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(20.r),
|
||||
child: Image.asset(
|
||||
F.sw(
|
||||
skyCall: () => 'images/icon_main_sky_1024.png',
|
||||
xhjCall: () => 'images/icon_main_xhj_1024.png'),
|
||||
width: 160.w,
|
||||
height: 160.w),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 20.h),
|
||||
Text(
|
||||
|
||||
@ -10,11 +10,12 @@ import 'package:star_lock/mine/mall/lockMall_entity.dart';
|
||||
import 'package:star_lock/mine/mall/lockMall_state.dart';
|
||||
import 'package:star_lock/mine/mall/webview/webview_logic.dart';
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
import 'package:star_lock/tools/pay/wx_pay_tool.dart';
|
||||
import 'package:webview_flutter/webview_flutter.dart';
|
||||
|
||||
import '../../app_settings/app_settings.dart';
|
||||
import '../../tools/baseGetXController.dart';
|
||||
import '../../tools/wechat/pay/wx_pay_tool.dart';
|
||||
import '../../tools/wechat/wechatManageTool.dart';
|
||||
|
||||
class LockMallLogic extends BaseGetXController {
|
||||
late LockMallState state;
|
||||
@ -75,7 +76,10 @@ class LockMallLogic extends BaseGetXController {
|
||||
switch (action) {
|
||||
case 'WechatPayParams':
|
||||
//微信支付
|
||||
wxPay(data, callFun);
|
||||
WechatManageTool.getAppInfo(() {
|
||||
wxPay(data, callFun);
|
||||
});
|
||||
// wxPay(data, callFun);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,18 +1,18 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
|
||||
import 'package:star_lock/flavors.dart';
|
||||
import 'package:star_lock/mine/mine/starLockMine_state.dart';
|
||||
import 'package:star_lock/tools/commonItem.dart';
|
||||
import 'package:star_lock/tools/customer_tool.dart';
|
||||
import 'package:star_lock/tools/wechat/customer_tool.dart';
|
||||
|
||||
import '../../appRouters.dart';
|
||||
import '../../app_settings/app_colors.dart';
|
||||
import '../../baseWidget.dart';
|
||||
import '../../tools/customNetworkImage.dart';
|
||||
import '../../tools/submitBtn.dart';
|
||||
import '../../translations/trans_lib.dart';
|
||||
import '../../tools/wechat/wechatManageTool.dart';
|
||||
import 'starLockMine_logic.dart';
|
||||
|
||||
class StarLockMinePage extends StatefulWidget {
|
||||
@ -164,7 +164,7 @@ class StarLockMinePageState extends State<StarLockMinePage> with BaseWidget {
|
||||
// Navigator.pushNamed(context, Routers.minePersonInfoPage);
|
||||
// }),
|
||||
mineItem('images/mine/icon_mine_main_addLock.png',
|
||||
TranslationLoader.lanKeys!.addDevice!.tr, () {
|
||||
'添加设备'.tr, () {
|
||||
Get.back();
|
||||
Get.toNamed(Routers.selectLockTypePage);
|
||||
}),
|
||||
@ -173,7 +173,7 @@ class StarLockMinePageState extends State<StarLockMinePage> with BaseWidget {
|
||||
// Navigator.pushNamed(context, Routers.gatewayListPage);
|
||||
// }),
|
||||
mineItem('images/mine/icon_mine_main_message.png',
|
||||
TranslationLoader.lanKeys!.message!.tr, () {
|
||||
'消息'.tr, () {
|
||||
Get.back();
|
||||
Get.toNamed(Routers.messageListPage);
|
||||
// Toast.show(msg: "功能暂未开放");
|
||||
@ -184,7 +184,7 @@ class StarLockMinePageState extends State<StarLockMinePage> with BaseWidget {
|
||||
// Navigator.pushNamed(context, Routers.supportStaffPage);
|
||||
// }),
|
||||
mineItem('images/mine/icon_mine_main_set.png',
|
||||
TranslationLoader.lanKeys!.set!.tr, () {
|
||||
'设置'.tr, () {
|
||||
Get.back();
|
||||
Get.toNamed(Routers.mineSetPage);
|
||||
}),
|
||||
@ -192,8 +192,7 @@ class StarLockMinePageState extends State<StarLockMinePage> with BaseWidget {
|
||||
if (F.isLite)
|
||||
Container()
|
||||
else
|
||||
mineItem('images/mine/icon_mine_main_vip.png',
|
||||
TranslationLoader.lanKeys!.valueAddedServices!.tr, () {
|
||||
mineItem('images/mine/icon_mine_main_vip.png', '增值服务'.tr, () {
|
||||
Get.back();
|
||||
Get.toNamed(Routers.valueAddedServicesPage);
|
||||
}),
|
||||
@ -207,12 +206,11 @@ class StarLockMinePageState extends State<StarLockMinePage> with BaseWidget {
|
||||
}),
|
||||
if (F.isSKY)
|
||||
mineItem('images/mine/icon_mine_main_shoppingcart.png',
|
||||
TranslationLoader.lanKeys!.supportStaff!.tr, () {
|
||||
'客服'.tr, () {
|
||||
Get.back();
|
||||
CustomerTool.openCustomerService();
|
||||
WechatManageTool.getAppInfo(CustomerTool.openCustomerService);
|
||||
}),
|
||||
mineItem('images/mine/icon_mine_main_about.png',
|
||||
TranslationLoader.lanKeys!.about!.tr, () {
|
||||
mineItem('images/mine/icon_mine_main_about.png', '关于'.tr, () {
|
||||
Get.back();
|
||||
Get.toNamed(Routers.aboutPage);
|
||||
}),
|
||||
@ -225,7 +223,7 @@ class StarLockMinePageState extends State<StarLockMinePage> with BaseWidget {
|
||||
return Column(
|
||||
children: <Widget>[
|
||||
SubmitBtn(
|
||||
btnName: TranslationLoader.lanKeys!.logout!.tr,
|
||||
btnName: '退出'.tr,
|
||||
borderRadius: 20.w,
|
||||
fontSize: 32.sp,
|
||||
margin: EdgeInsets.only(left: 60.w, right: 60.w),
|
||||
@ -239,7 +237,7 @@ class StarLockMinePageState extends State<StarLockMinePage> with BaseWidget {
|
||||
children: <Widget>[
|
||||
TextButton(
|
||||
child: Text(
|
||||
TranslationLoader.lanKeys!.deleteAccount!.tr,
|
||||
'删除账号'.tr,
|
||||
style: TextStyle(
|
||||
color: AppColors.mainColor, fontWeight: FontWeight.w500),
|
||||
),
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/appRouters.dart';
|
||||
@ -7,15 +9,19 @@ import 'package:star_lock/mine/mineSet/lockUserManage/expireLockList/expireElect
|
||||
import 'package:star_lock/mine/mineSet/mineSet/mineSet_state.dart';
|
||||
import 'package:star_lock/mine/mineSet/mineSet/userSettingInfoEntity.dart';
|
||||
import 'package:star_lock/mine/mineSet/mineSet/weChatQRCodeEntity.dart';
|
||||
import 'package:star_lock/tools/push/xs_jPhush.dart';
|
||||
import 'package:star_lock/tools/showCupertinoAlertView.dart';
|
||||
import 'package:star_lock/tools/storage.dart';
|
||||
import 'package:star_lock/tools/push/xs_jPhush.dart';
|
||||
import 'package:star_lock/versionUndate/versionUndate_entity.dart';
|
||||
|
||||
import '../../../../network/api_repository.dart';
|
||||
import '../../../../tools/baseGetXController.dart';
|
||||
import '../../../app_settings/app_settings.dart';
|
||||
import '../../../blue/blue_manage.dart';
|
||||
import '../../../talk/udp/udp_help.dart';
|
||||
import '../../../tools/eventBusEventManage.dart';
|
||||
import '../../../tools/store_service.dart';
|
||||
import '../../../translations/app_dept.dart';
|
||||
|
||||
class MineSetLogic extends BaseGetXController {
|
||||
final MineSetState state = MineSetState();
|
||||
@ -96,20 +102,23 @@ class MineSetLogic extends BaseGetXController {
|
||||
|
||||
//退出登录请求
|
||||
Future<void> userLogoutRequest() async {
|
||||
var getPushDeviceID = '';
|
||||
await Storage.getString(pushDeviceID).then((value) {
|
||||
String getPushDeviceID = '';
|
||||
await Storage.getString(pushDeviceID).then((String? value) {
|
||||
if (value != null && value.isNotEmpty) {
|
||||
getPushDeviceID = value;
|
||||
}
|
||||
});
|
||||
LoginEntity entity =
|
||||
await ApiRepository.to.userLogout(deviceld: getPushDeviceID);
|
||||
final LoginEntity entity = await ApiRepository.to.userLogout(deviceld: getPushDeviceID);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
UdpHelp().closeUDP();
|
||||
logOut();
|
||||
|
||||
StoreService.to.saveLanguageCode('');
|
||||
Get.updateLocale(Get.deviceLocale!);
|
||||
|
||||
BlueManage().disconnect();
|
||||
XSJPushProvider().initLocalNotification(isCancelLocalPush: true);
|
||||
Get.offNamedUntil(Routers.starLockLoginPage, (route) => false);
|
||||
Get.offNamedUntil(Routers.starLockLoginPage, (Route route) => false);
|
||||
}
|
||||
}
|
||||
|
||||
@ -120,7 +129,7 @@ class MineSetLogic extends BaseGetXController {
|
||||
|
||||
//更新触摸开锁
|
||||
Future<void> updateTouchUnlockRequest() async {
|
||||
ExpireLockListEntity entity = await ApiRepository.to
|
||||
final ExpireLockListEntity entity = await ApiRepository.to
|
||||
.setTouchUnlockFlag(state.isTouchUnlock.value == true ? '1' : '2');
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
showToast('设置成功'.tr);
|
||||
@ -132,29 +141,30 @@ class MineSetLogic extends BaseGetXController {
|
||||
StreamSubscription? _getNumberEvent;
|
||||
void _initLoadDataAction() {
|
||||
// 蓝牙协议通知传输跟蓝牙之外的数据传输类不一样 eventBus
|
||||
_getNumberEvent =
|
||||
eventBus.on<ChangeLanguageBlockLastLanguageEvent>().listen((event) {
|
||||
state.currentLanguage.value = event.languageTitle;
|
||||
_getNumberEvent = eventBus.on<ChangeLanguageBlockLastLanguageEvent>().listen((ChangeLanguageBlockLastLanguageEvent event) {
|
||||
state.currentLanguage.value = _getCurrentLanguage();
|
||||
});
|
||||
}
|
||||
|
||||
String _getCurrentLanguage() {
|
||||
String? languageCode = StoreService.to.getLanguageCode();
|
||||
if(languageCode!.isEmpty){
|
||||
languageCode = Get.deviceLocale!.languageCode;
|
||||
}
|
||||
final String currentLanguage = ExtensionLanguageType.fromLocale(appDept.deptSupportedLocales.where((Locale element) => element.languageCode == languageCode).first).lanTitle;
|
||||
return currentLanguage;
|
||||
}
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
// TODO: implement onReady
|
||||
super.onReady();
|
||||
|
||||
state.currentLanguage.value = _getCurrentLanguage();
|
||||
_initLoadDataAction();
|
||||
}
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
// TODO: implement onInit
|
||||
super.onInit();
|
||||
}
|
||||
|
||||
@override
|
||||
void onClose() {
|
||||
// TODO: implement onClose
|
||||
super.onClose();
|
||||
|
||||
_getNumberEvent!.cancel();
|
||||
|
||||
@ -9,14 +9,14 @@ import 'package:permission_handler/permission_handler.dart';
|
||||
import 'package:star_lock/flavors.dart';
|
||||
import 'package:star_lock/mine/mineSet/mineSet/mineSet_logic.dart';
|
||||
import 'package:star_lock/mine/mineSet/mineSet/mineSet_state.dart';
|
||||
import 'package:star_lock/tools/appFirstEnterHandle.dart';
|
||||
import 'package:star_lock/tools/customer_tool.dart';
|
||||
import 'package:star_lock/tools/wechat/customer_tool.dart';
|
||||
import '../../../appRouters.dart';
|
||||
import '../../../app_settings/app_colors.dart';
|
||||
import '../../../tools/commonItem.dart';
|
||||
import '../../../tools/showTipView.dart';
|
||||
import '../../../tools/submitBtn.dart';
|
||||
import '../../../tools/titleAppBar.dart';
|
||||
import '../../../tools/wechat/wechatManageTool.dart';
|
||||
import '../../../translations/trans_lib.dart';
|
||||
|
||||
class MineSetPage extends StatefulWidget {
|
||||
@ -62,12 +62,12 @@ class _MineSetPageState extends State<MineSetPage>
|
||||
appBar: widget.showAppBar
|
||||
? F.sw(
|
||||
skyCall: () => TitleAppBar(
|
||||
barTitle: TranslationLoader.lanKeys!.moreSet!.tr,
|
||||
barTitle: '更多设置'.tr,
|
||||
haveBack: true,
|
||||
backgroundColor: AppColors.mainColor,
|
||||
),
|
||||
xhjCall: () => TitleAppBar(
|
||||
barTitle: TranslationLoader.lanKeys!.moreSet!.tr,
|
||||
barTitle: '更多设置'.tr,
|
||||
haveBack: true,
|
||||
backgroundColor: Colors.white,
|
||||
iconColor: AppColors.blackColor,
|
||||
@ -174,7 +174,7 @@ class _MineSetPageState extends State<MineSetPage>
|
||||
F.sw(
|
||||
skyCall: () => const SizedBox(),
|
||||
xhjCall: () => CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.personalInformation!.tr,
|
||||
leftTitel: '个人信息'.tr,
|
||||
rightTitle: '',
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
@ -182,7 +182,7 @@ class _MineSetPageState extends State<MineSetPage>
|
||||
Get.toNamed(Routers.minePersonInfoPage);
|
||||
})),
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.pushNotification!.tr,
|
||||
leftTitel: '消息推送'.tr,
|
||||
rightTitle: '',
|
||||
isHaveRightWidget: true,
|
||||
isHaveLine: F.sw(
|
||||
@ -205,7 +205,7 @@ class _MineSetPageState extends State<MineSetPage>
|
||||
// Container(),
|
||||
SizedBox(height: 10.h),
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.lockUserManagement!.tr,
|
||||
leftTitel: '锁用户管理'.tr,
|
||||
rightTitle: '',
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
@ -213,7 +213,7 @@ class _MineSetPageState extends State<MineSetPage>
|
||||
Get.toNamed(Routers.lockUserManageLisPage);
|
||||
}),
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.authorizedAdmin!.tr,
|
||||
leftTitel: '授权管理员'.tr,
|
||||
rightTitle: '',
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
@ -223,7 +223,7 @@ class _MineSetPageState extends State<MineSetPage>
|
||||
//by DaisyWu 新增--批量授权
|
||||
if (!F.isProductionEnv)
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.authorityManagement!.tr,
|
||||
leftTitel: '批量授权'.tr,
|
||||
rightTitle: '',
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
@ -232,7 +232,15 @@ class _MineSetPageState extends State<MineSetPage>
|
||||
// Toast.show(msg: "功能暂未开放");
|
||||
}),
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.lockGroup!.tr,
|
||||
leftTitel: '网关'.tr,
|
||||
rightTitle: '',
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
Get.toNamed(Routers.gatewayListPage);
|
||||
}),
|
||||
CommonItem(
|
||||
leftTitel: '锁分组'.tr,
|
||||
rightTitle: '',
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
@ -240,7 +248,7 @@ class _MineSetPageState extends State<MineSetPage>
|
||||
Get.toNamed(Routers.lockGroupListPage);
|
||||
}),
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.transferSmartLock!.tr,
|
||||
leftTitel: '转移智能锁'.tr,
|
||||
rightTitle: '',
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
@ -249,7 +257,7 @@ class _MineSetPageState extends State<MineSetPage>
|
||||
}),
|
||||
//暂无网关屏蔽
|
||||
// CommonItem(
|
||||
// leftTitel: TranslationLoader.lanKeys!.transferGateway!.tr,
|
||||
// leftTitel: '转移网关'.tr,
|
||||
// rightTitle: '',
|
||||
// isHaveLine: true,
|
||||
// isHaveDirection: true,
|
||||
@ -260,7 +268,7 @@ class _MineSetPageState extends State<MineSetPage>
|
||||
height: 10.h,
|
||||
),
|
||||
Obx(() => CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.multiLanguage!.tr,
|
||||
leftTitel: '多语言'.tr,
|
||||
rightTitle: state.currentLanguage.value,
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
@ -288,11 +296,10 @@ class _MineSetPageState extends State<MineSetPage>
|
||||
})),
|
||||
*/
|
||||
Obx(() => CommonItem(
|
||||
leftTitel:
|
||||
TranslationLoader.lanKeys!.hideInvalidUnlockPermissions!.tr,
|
||||
leftTitel:'隐藏无效开锁权限'.tr,
|
||||
rightTitle: (state.hideExpiredAccessFlag.value == 1
|
||||
? TranslationLoader.lanKeys!.opened!.tr
|
||||
: TranslationLoader.lanKeys!.closed!.tr),
|
||||
? '已开启'.tr
|
||||
: '已关闭'.tr),
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
@ -305,8 +312,7 @@ class _MineSetPageState extends State<MineSetPage>
|
||||
});
|
||||
})),
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader
|
||||
.lanKeys!.appUnlockRequiresMobilePhoneAccessToTheLock!.tr,
|
||||
leftTitel: 'APP开锁时需手机连网的锁'.tr,
|
||||
rightTitle: '',
|
||||
// allHeight: 100.h,
|
||||
isHaveLine: true,
|
||||
@ -316,7 +322,7 @@ class _MineSetPageState extends State<MineSetPage>
|
||||
context, Routers.aPPUnlockNeedMobileNetworkingLockPage);
|
||||
}),
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.valueAddedServices!.tr,
|
||||
leftTitel: '增值服务'.tr,
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
@ -327,42 +333,46 @@ class _MineSetPageState extends State<MineSetPage>
|
||||
SizedBox(
|
||||
height: 10.h,
|
||||
),
|
||||
CommonItem(
|
||||
leftTitel: 'Amazon Alexa'.tr,
|
||||
rightTitle: '',
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
// logic.showToast('功能暂未开放'.tr);
|
||||
Get.toNamed(Routers.amazonAlexaPage);
|
||||
}),
|
||||
CommonItem(
|
||||
leftTitel: 'Google Home',
|
||||
rightTitle: '',
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
logic.showToast('功能暂未开放'.tr);
|
||||
}),
|
||||
//上架审核注释
|
||||
if (!F.isProductionEnv)
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.xiaomiIOTPlatform!.tr,
|
||||
leftTitel: 'Amazon Alexa',
|
||||
rightTitle: '',
|
||||
isHaveLine: widget.showAbout,
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
logic.showToast('功能暂未开放'.tr);
|
||||
}),
|
||||
if (!F.isProductionEnv)
|
||||
CommonItem(
|
||||
leftTitel: 'Google Home',
|
||||
rightTitle: '',
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
logic.showToast('功能暂未开放'.tr);
|
||||
}),
|
||||
// if (!F.isProductionEnv)
|
||||
// CommonItem(
|
||||
// leftTitel: '小米IOT平台'.tr,
|
||||
// rightTitle: '',
|
||||
// isHaveLine: widget.showAbout,
|
||||
// isHaveDirection: true,
|
||||
// action: () {
|
||||
// logic.showToast('功能暂未开放'.tr);
|
||||
// }),
|
||||
if (F.isXHJ)
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.supportStaff!.tr,
|
||||
leftTitel: '客服'.tr,
|
||||
isHaveLine: widget.showAbout,
|
||||
isHaveDirection: true,
|
||||
action: CustomerTool.openCustomerService,
|
||||
action: (){
|
||||
WechatManageTool.getAppInfo(CustomerTool.openCustomerService);
|
||||
},
|
||||
),
|
||||
if (widget.showAbout)
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.about!.tr,
|
||||
leftTitel: '关于'.tr,
|
||||
isHaveLine: false,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
@ -408,7 +418,7 @@ class _MineSetPageState extends State<MineSetPage>
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
SubmitBtn(
|
||||
btnName: TranslationLoader.lanKeys!.logout!.tr,
|
||||
btnName: '退出'.tr,
|
||||
isDelete: true,
|
||||
padding: EdgeInsets.symmetric(horizontal: 15.w),
|
||||
onClick: () {
|
||||
@ -425,13 +435,13 @@ class _MineSetPageState extends State<MineSetPage>
|
||||
children: <Widget>[
|
||||
TextButton(
|
||||
child: Text(
|
||||
TranslationLoader.lanKeys!.deleteAccount!.tr,
|
||||
'删除账号'.tr,
|
||||
style: TextStyle(
|
||||
color: AppColors.darkGrayTextColor, fontSize: 18.sp),
|
||||
),
|
||||
onPressed: () {
|
||||
ShowTipView().showIosTipWithContentDialog(
|
||||
TranslationLoader.lanKeys!.deleteAccountTips!.tr, () {
|
||||
'删除账号后,你的所有信息及相关记录都会从平台彻底删除,且不可恢复,是否删除?'.tr, () {
|
||||
//安全验证
|
||||
Get.toNamed(Routers.safeVerifyPage);
|
||||
});
|
||||
@ -504,31 +514,31 @@ class _MineSetPageState extends State<MineSetPage>
|
||||
// );
|
||||
// }
|
||||
|
||||
CupertinoSwitch _isPrompToneSwitch() {
|
||||
return CupertinoSwitch(
|
||||
activeColor: CupertinoColors.activeBlue,
|
||||
trackColor: CupertinoColors.systemGrey5,
|
||||
thumbColor: CupertinoColors.white,
|
||||
value: state.isPrompTone.value,
|
||||
onChanged: (bool value) {
|
||||
state.isPrompTone.value = !state.isPrompTone.value;
|
||||
logic.updatePrompToneRequest();
|
||||
},
|
||||
);
|
||||
}
|
||||
// CupertinoSwitch _isPrompToneSwitch() {
|
||||
// return CupertinoSwitch(
|
||||
// activeColor: CupertinoColors.activeBlue,
|
||||
// trackColor: CupertinoColors.systemGrey5,
|
||||
// thumbColor: CupertinoColors.white,
|
||||
// value: state.isPrompTone.value,
|
||||
// onChanged: (bool value) {
|
||||
// state.isPrompTone.value = !state.isPrompTone.value;
|
||||
// logic.updatePrompToneRequest();
|
||||
// },
|
||||
// );
|
||||
// }
|
||||
|
||||
CupertinoSwitch _isTouchUnlockSwitch() {
|
||||
return CupertinoSwitch(
|
||||
activeColor: CupertinoColors.activeBlue,
|
||||
trackColor: CupertinoColors.systemGrey5,
|
||||
thumbColor: CupertinoColors.white,
|
||||
value: state.isTouchUnlock.value,
|
||||
onChanged: (bool value) {
|
||||
state.isTouchUnlock.value = !state.isTouchUnlock.value;
|
||||
logic.updateTouchUnlockRequest();
|
||||
},
|
||||
);
|
||||
}
|
||||
// CupertinoSwitch _isTouchUnlockSwitch() {
|
||||
// return CupertinoSwitch(
|
||||
// activeColor: CupertinoColors.activeBlue,
|
||||
// trackColor: CupertinoColors.systemGrey5,
|
||||
// thumbColor: CupertinoColors.white,
|
||||
// value: state.isTouchUnlock.value,
|
||||
// onChanged: (bool value) {
|
||||
// state.isTouchUnlock.value = !state.isTouchUnlock.value;
|
||||
// logic.updateTouchUnlockRequest();
|
||||
// },
|
||||
// );
|
||||
// }
|
||||
|
||||
//微信公众号推送开关
|
||||
CupertinoSwitch _isWechatPublicAccountPushSwitch() {
|
||||
|
||||
@ -3,7 +3,6 @@ import 'dart:convert';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:fluwx/fluwx.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/app_settings/app_settings.dart';
|
||||
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
|
||||
import 'package:star_lock/flavors.dart';
|
||||
import 'package:star_lock/mine/mall/webview/webview_logic.dart';
|
||||
@ -11,9 +10,11 @@ import 'package:star_lock/mine/valueAddedServices/advancedFeaturesWeb/advancedFe
|
||||
import 'package:star_lock/mine/valueAddedServices/advancedFeaturesWeb/advancedFeaturesWeb_state.dart';
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
import 'package:star_lock/tools/pay/wx_pay_tool.dart';
|
||||
import 'package:webview_flutter/webview_flutter.dart';
|
||||
|
||||
import '../../../tools/wechat/pay/wx_pay_tool.dart';
|
||||
import '../../../tools/wechat/wechatManageTool.dart';
|
||||
|
||||
class AdvancedFeaturesWebLogic extends BaseGetXController {
|
||||
late AdvancedFeaturesWebState state = AdvancedFeaturesWebState();
|
||||
|
||||
@ -86,7 +87,10 @@ class AdvancedFeaturesWebLogic extends BaseGetXController {
|
||||
switch (action) {
|
||||
case 'WechatPayParams':
|
||||
//微信支付
|
||||
wxPay(data, callFun);
|
||||
WechatManageTool.getAppInfo(() {
|
||||
wxPay(data, callFun);
|
||||
});
|
||||
// wxPay(data, callFun);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,6 +5,6 @@ import 'package:star_lock/app_settings/app_settings.dart';
|
||||
|
||||
FutureOr<Request> requestLogInterceptor(Request request) async {
|
||||
// AppLog.log('GET HTTP REQUEST \n${request.url} \n${request.headers} ${request.toString()} ');
|
||||
// AppLog.log(request.headers.toString());
|
||||
// AppLog.log('请求头:${request.headers.toString()}');
|
||||
return request;
|
||||
}
|
||||
|
||||
@ -8,7 +8,7 @@ import 'package:star_lock/main/lockMian/lockMain/xhj/lockMain_xhj_page.dart';
|
||||
import 'package:star_lock/mine/about/debug/debug_tool.dart';
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
import 'package:star_lock/tools/appFirstEnterHandle.dart';
|
||||
import 'package:star_lock/tools/customer_tool.dart';
|
||||
import 'package:star_lock/tools/wechat/customer_tool.dart';
|
||||
import 'package:star_lock/tools/storage.dart';
|
||||
|
||||
import '../main/lockMian/lockMain/lockMain_page.dart';
|
||||
|
||||
@ -1,22 +1,22 @@
|
||||
// Audio player task implementation
|
||||
import 'package:audio_service/audio_service.dart';
|
||||
// import 'package:audio_service/audio_service.dart';
|
||||
|
||||
class AudioPlayerTask extends BackgroundAudioTask {
|
||||
@override
|
||||
Future<void> onStart(Map<String, dynamic>? params) async {
|
||||
// Load and play audio here
|
||||
// Example:
|
||||
// AudioPlayer audioPlayer = AudioPlayer();
|
||||
// await audioPlayer.play('path_to_audio.mp3');
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> onStop() async {
|
||||
// Stop audio playback and clean up resources
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> onPause() async {
|
||||
// Pause audio playback
|
||||
}
|
||||
}
|
||||
// class AudioPlayerTask extends BackgroundAudioTask {
|
||||
// @override
|
||||
// Future<void> onStart(Map<String, dynamic>? params) async {
|
||||
// // Load and play audio here
|
||||
// // Example:
|
||||
// // AudioPlayer audioPlayer = AudioPlayer();
|
||||
// // await audioPlayer.play('path_to_audio.mp3');
|
||||
// }
|
||||
//
|
||||
// @override
|
||||
// Future<void> onStop() async {
|
||||
// // Stop audio playback and clean up resources
|
||||
// }
|
||||
//
|
||||
// @override
|
||||
// Future<void> onPause() async {
|
||||
// // Pause audio playback
|
||||
// }
|
||||
// }
|
||||
|
||||
@ -6,20 +6,16 @@ import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/appRouters.dart';
|
||||
import 'package:star_lock/app_settings/app_colors.dart';
|
||||
import 'package:star_lock/app_settings/app_settings.dart';
|
||||
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
|
||||
import 'package:star_lock/flavors.dart';
|
||||
import 'package:star_lock/login/login/app_get_version.dart';
|
||||
import 'package:star_lock/login/login/starLock_login_logic.dart';
|
||||
import 'package:star_lock/main.dart';
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
import 'package:star_lock/tools/customer_tool.dart';
|
||||
import 'package:star_lock/tools/pay/wx_pay_tool.dart';
|
||||
import 'package:star_lock/tools/storage.dart';
|
||||
import 'package:star_lock/tools/wechat/customer_tool.dart';
|
||||
|
||||
import '../versionUndate/versionUndateTool.dart';
|
||||
import 'bugly/bugly_tool.dart';
|
||||
import 'push/xs_jPhush.dart';
|
||||
|
||||
class AppFirstEnterHandle {
|
||||
Future<void> getAppFirstEnter(String flagStr) async {
|
||||
@ -29,7 +25,6 @@ class AppFirstEnterHandle {
|
||||
if (getFlag != isAgreePrivacy) {
|
||||
await showPrivacyAgreementAlert();
|
||||
}
|
||||
getAppInfo();
|
||||
await privacySDKInitialization();
|
||||
if (Get.isRegistered<StarLockLoginLogic>()) {
|
||||
Get.find<StarLockLoginLogic>().flushedDeviceInfo();
|
||||
@ -69,13 +64,6 @@ class AppFirstEnterHandle {
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> getAppInfo() async {
|
||||
AppLog.log('AppFirstEnterHandle调用了获取App信息接口');
|
||||
final GetAppInfo entity = await ApiRepository.to.getAppInfo();
|
||||
CustomerTool.init(entity.data?.wechatServiceUrl ?? '');
|
||||
WxPayTool.setAssociationUrl(entity.data!.appSiteUrl!);
|
||||
}
|
||||
|
||||
//默认布局
|
||||
Widget _defaultPrivacyAgreementAlert(BuildContext context) {
|
||||
return CupertinoAlertDialog(
|
||||
@ -94,8 +82,8 @@ class AppFirstEnterHandle {
|
||||
// 处理用户协议点击事件
|
||||
Get.toNamed(Routers.webviewShowPage,
|
||||
arguments: <String, String>{
|
||||
"url": XSConstantMacro.userAgreementURL,
|
||||
"title": '用户协议'.tr
|
||||
'url': XSConstantMacro.userAgreementURL,
|
||||
'title': '用户协议'.tr
|
||||
});
|
||||
},
|
||||
),
|
||||
@ -109,13 +97,13 @@ class AppFirstEnterHandle {
|
||||
// 处理隐私政策点击事件
|
||||
Get.toNamed(Routers.webviewShowPage,
|
||||
arguments: <String, String>{
|
||||
"url": XSConstantMacro.privacyPolicyURL,
|
||||
"title": '隐私政策'.tr
|
||||
'url': XSConstantMacro.privacyPolicyURL,
|
||||
'title': '隐私政策'.tr
|
||||
});
|
||||
},
|
||||
),
|
||||
TextSpan(
|
||||
text: '的全部内容。点击“同意”即表示您同意并接受全部条款。若选择不同意,将无法使用我们的产品和服务,并会退出应用。'
|
||||
text: '的全部内容。点击“同意”即表示您同意并接受全部条款。若选择不同意,将无法使用我们的产品和服务,并会退出应用。'.tr
|
||||
.tr),
|
||||
],
|
||||
),
|
||||
@ -124,14 +112,14 @@ class AppFirstEnterHandle {
|
||||
CupertinoDialogAction(
|
||||
child: Text(
|
||||
'不同意'.tr,
|
||||
style: TextStyle(color: Colors.black),
|
||||
style: const TextStyle(color: Colors.black),
|
||||
),
|
||||
onPressed: _exitApp,
|
||||
),
|
||||
CupertinoDialogAction(
|
||||
child: Text(
|
||||
'同意'.tr,
|
||||
style: TextStyle(color: Colors.blue),
|
||||
style: const TextStyle(color: Colors.blue),
|
||||
),
|
||||
onPressed: () {
|
||||
Storage.setString(isAgreePrivacy, isAgreePrivacy);
|
||||
@ -163,8 +151,8 @@ class AppFirstEnterHandle {
|
||||
// 处理用户协议点击事件
|
||||
Get.toNamed(Routers.webviewShowPage,
|
||||
arguments: <String, String>{
|
||||
"url": XSConstantMacro.userAgreementURL,
|
||||
"title": '用户协议'.tr
|
||||
'url': XSConstantMacro.userAgreementURL,
|
||||
'title': '用户协议'.tr
|
||||
});
|
||||
},
|
||||
),
|
||||
@ -179,13 +167,13 @@ class AppFirstEnterHandle {
|
||||
// 处理隐私政策点击事件
|
||||
Get.toNamed(Routers.webviewShowPage,
|
||||
arguments: <String, String>{
|
||||
"url": XSConstantMacro.privacyPolicyURL,
|
||||
"title": '隐私政策'.tr
|
||||
'url': XSConstantMacro.privacyPolicyURL,
|
||||
'title': '隐私政策'.tr
|
||||
});
|
||||
},
|
||||
),
|
||||
TextSpan(
|
||||
text: '的全部内容。点击“同意”即表示您同意并接受全部条款。若选择不同意,将无法使用我们的产品和服务,并会退出应用。'
|
||||
text: '的全部内容。点击“同意”即表示您同意并接受全部条款。若选择不同意,将无法使用我们的产品和服务,并会退出应用。'.tr
|
||||
.tr),
|
||||
],
|
||||
),
|
||||
@ -194,7 +182,7 @@ class AppFirstEnterHandle {
|
||||
CupertinoDialogAction(
|
||||
child: Text(
|
||||
'不同意'.tr,
|
||||
style: TextStyle(color: Colors.black),
|
||||
style: const TextStyle(color: Colors.black),
|
||||
),
|
||||
onPressed: _exitApp,
|
||||
),
|
||||
@ -221,8 +209,8 @@ class AppFirstEnterHandle {
|
||||
return PopScope(
|
||||
canPop: false,
|
||||
child: CupertinoAlertDialog(
|
||||
title: const Text('位置权限'),
|
||||
content: const Text('请开启位置权限,应用需要位置权限才可以完成智能锁和网关的蓝牙操作'),
|
||||
title: Text('位置权限'.tr),
|
||||
content: Text('请开启位置权限,应用需要位置权限才可以完成智能锁和网关的蓝牙操作'.tr),
|
||||
actions: <Widget>[
|
||||
CupertinoDialogAction(
|
||||
child: Text('取消'.tr),
|
||||
@ -251,17 +239,17 @@ class AppFirstEnterHandle {
|
||||
return PopScope(
|
||||
canPop: false,
|
||||
child: CupertinoAlertDialog(
|
||||
title: const Text('相机/相册权限'),
|
||||
content: const Text('请开启本地存储权限,允许应用读写设备上的照片及文件'),
|
||||
title: Text('相机/相册权限'.tr),
|
||||
content: Text('请开启本地存储权限,允许应用读写设备上的照片及文件'.tr),
|
||||
actions: <Widget>[
|
||||
CupertinoDialogAction(
|
||||
child: const Text('取消'),
|
||||
child: Text('取消'.tr),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
CupertinoDialogAction(
|
||||
child: const Text('确定'),
|
||||
child: Text('确定'.tr),
|
||||
onPressed: () {
|
||||
Storage.setString(isAgreeCamera, isAgreeCamera);
|
||||
Navigator.of(context).pop();
|
||||
|
||||
24
lib/tools/wechat/wechatManageTool.dart
Normal file
24
lib/tools/wechat/wechatManageTool.dart
Normal file
@ -0,0 +1,24 @@
|
||||
|
||||
|
||||
import '../../login/login/app_get_version.dart';
|
||||
import '../../network/api_repository.dart';
|
||||
import 'customer_tool.dart';
|
||||
import 'pay/wx_pay_tool.dart';
|
||||
|
||||
class WechatManageTool {
|
||||
static void init(String wechatServiceUrl) {
|
||||
// CustomerTool.init(wechatServiceUrl);
|
||||
}
|
||||
|
||||
static Future<void> getAppInfo(void Function() action) async {
|
||||
// AppLog.log('AppFirstEnterHandle调用了获取App信息接口');
|
||||
final GetAppInfo entity = await ApiRepository.to.getAppInfo();
|
||||
if(entity.errorCode == 0) {
|
||||
CustomerTool.init(entity.data?.wechatServiceUrl ?? '');
|
||||
WxPayTool.setAssociationUrl(entity.data!.appSiteUrl!);
|
||||
action();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -76,4 +76,22 @@ extension ExtensionLanguageType on LanguageType {
|
||||
return languageType;
|
||||
}
|
||||
|
||||
static LanguageType fromLocale(Locale locale) {
|
||||
LanguageType languageType = LanguageType.english;
|
||||
final String code = locale.languageCode;
|
||||
final String countryCode = locale.countryCode ?? '';
|
||||
switch(code.toLowerCase()){
|
||||
case 'en':
|
||||
languageType = LanguageType.english;
|
||||
break;
|
||||
case 'zh':
|
||||
if(countryCode.toLowerCase() == 'cn'){
|
||||
languageType = LanguageType.chinese;
|
||||
}else{
|
||||
// languageType = LanguageType.traditionalChinese;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return languageType;
|
||||
}
|
||||
}
|
||||
@ -88,8 +88,12 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
||||
# 1.0.76+2024081201:锁定版本,上架商城--最新版本(SKY上架苹果)
|
||||
# 1.0.76+2024082001:锁定版本,上架商城(SKY上架国内应用商城)
|
||||
# 1.0.76+2024082201:vivo被拒 修改构建号重新提交
|
||||
# 1.0.76+2024081201:锁定版本,上架商城--最新版本
|
||||
# 1.0.78+2024082701:测试国际化功能
|
||||
# 1.0.79+2024083001:测试所有国家国际化功能
|
||||
# 1.0.79+2024083001:测试开完锁数据上传功能
|
||||
|
||||
version: 1.0.76+2024082201
|
||||
version: 1.0.79+2024090201
|
||||
|
||||
environment:
|
||||
sdk: '>=2.12.0 <3.0.0'
|
||||
@ -221,7 +225,7 @@ dependencies:
|
||||
timelines: ^0.1.0
|
||||
#侧滑删除
|
||||
flutter_slidable: ^3.0.1
|
||||
audio_service: ^0.18.12
|
||||
# audio_service: ^0.18.12
|
||||
app_settings: ^5.1.1
|
||||
flutter_local_notifications: ^17.0.0
|
||||
fluwx: ^4.5.5
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user