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