Merge branch 'develop_liyi' into 'build-addGateway-20240814'
fix:修复部分国际化内容 See merge request StarlockTeam/app-starlock!2
This commit is contained in:
commit
9fa56c11a8
4
android/app/src/dev/res/values-en-rUS/string.xml
Normal file
4
android/app/src/dev/res/values-en-rUS/string.xml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<string name="app_name">Star Lock</string>
|
||||||
|
</resources>
|
||||||
4
android/app/src/dev/res/values-zh-rCN/string.xml
Normal file
4
android/app/src/dev/res/values-zh-rCN/string.xml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<string name="app_name">星锁</string>
|
||||||
|
</resources>
|
||||||
4
android/app/src/local/res/values-en-rUS/string.xml
Normal file
4
android/app/src/local/res/values-en-rUS/string.xml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<string name="app_name">Star Lock</string>
|
||||||
|
</resources>
|
||||||
4
android/app/src/local/res/values-zh-rCN/string.xml
Normal file
4
android/app/src/local/res/values-zh-rCN/string.xml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<string name="app_name">星锁</string>
|
||||||
|
</resources>
|
||||||
4
android/app/src/main/res/values/values-en-rUS/string.xml
Normal file
4
android/app/src/main/res/values/values-en-rUS/string.xml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<string name="app_name">Star Lock</string>
|
||||||
|
</resources>
|
||||||
4
android/app/src/main/res/values/values-zh-rCN/string.xml
Normal file
4
android/app/src/main/res/values/values-zh-rCN/string.xml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<string name="app_name">星锁</string>
|
||||||
|
</resources>
|
||||||
4
android/app/src/pre/res/values-en-rUS/string.xml
Normal file
4
android/app/src/pre/res/values-en-rUS/string.xml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<string name="app_name">Star Lock</string>
|
||||||
|
</resources>
|
||||||
4
android/app/src/pre/res/values-zh-rCN/string.xml
Normal file
4
android/app/src/pre/res/values-zh-rCN/string.xml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<string name="app_name">星锁</string>
|
||||||
|
</resources>
|
||||||
4
android/app/src/sky/res/values-en-rUS/string.xml
Normal file
4
android/app/src/sky/res/values-en-rUS/string.xml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<string name="app_name">TTLock Pro</string>
|
||||||
|
</resources>
|
||||||
4
android/app/src/sky/res/values-zh-rCN/string.xml
Normal file
4
android/app/src/sky/res/values-zh-rCN/string.xml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<string name="app_name">锁通通</string>
|
||||||
|
</resources>
|
||||||
4
android/app/src/xhj/res/values-en-rUS/string.xml
Normal file
4
android/app/src/xhj/res/values-en-rUS/string.xml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<string name="app_name">Star Lock</string>
|
||||||
|
</resources>
|
||||||
4
android/app/src/xhj/res/values-zh-rCN/string.xml
Normal file
4
android/app/src/xhj/res/values-zh-rCN/string.xml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<string name="app_name">星星锁</string>
|
||||||
|
</resources>
|
||||||
@ -7,7 +7,7 @@
|
|||||||
<key>CFBundleDevelopmentRegion</key>
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||||
<key>CFBundleDisplayName</key>
|
<key>CFBundleDisplayName</key>
|
||||||
<string>$(BUNDLE_DISPLAY_NAME)</string>
|
<string>$(PRODUCT_NAME)</string>
|
||||||
<key>CFBundleExecutable</key>
|
<key>CFBundleExecutable</key>
|
||||||
<string>$(EXECUTABLE_NAME)</string>
|
<string>$(EXECUTABLE_NAME)</string>
|
||||||
<key>CFBundleIdentifier</key>
|
<key>CFBundleIdentifier</key>
|
||||||
@ -15,7 +15,7 @@
|
|||||||
<key>CFBundleInfoDictionaryVersion</key>
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
<string>6.0</string>
|
<string>6.0</string>
|
||||||
<key>CFBundleName</key>
|
<key>CFBundleName</key>
|
||||||
<string>$(BUNDLE_NAME)</string>
|
<string>$(PRODUCT_NAME)</string>
|
||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>APPL</string>
|
<string>APPL</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
|
|||||||
23
ios/Runner/InfoPlist.xcstrings
Normal file
23
ios/Runner/InfoPlist.xcstrings
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
{
|
||||||
|
"sourceLanguage" : "zh-Hans",
|
||||||
|
"strings" : {
|
||||||
|
"CFBundleDisplayName" : {
|
||||||
|
"extractionState" : "manual",
|
||||||
|
"localizations" : {
|
||||||
|
"en" : {
|
||||||
|
"stringUnit" : {
|
||||||
|
"state" : "translated",
|
||||||
|
"value" : "Star Lock"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"zh-Hans" : {
|
||||||
|
"stringUnit" : {
|
||||||
|
"state" : "translated",
|
||||||
|
"value" : "星锁"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"version" : "1.0"
|
||||||
|
}
|
||||||
8
ios/Runner/en.lproj/InfoPlist.strings
Normal file
8
ios/Runner/en.lproj/InfoPlist.strings
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
/*
|
||||||
|
InfoPlist.strings
|
||||||
|
Runner
|
||||||
|
|
||||||
|
Created by mac on 2024/11/21.
|
||||||
|
|
||||||
|
*/
|
||||||
|
"AppName"="Star Lock";
|
||||||
8
ios/Runner/zh-Hans.lproj/InfoPlist.strings
Normal file
8
ios/Runner/zh-Hans.lproj/InfoPlist.strings
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
/*
|
||||||
|
InfoPlist.strings
|
||||||
|
Runner
|
||||||
|
|
||||||
|
Created by mac on 2024/11/21.
|
||||||
|
|
||||||
|
*/
|
||||||
|
"AppName"="星锁";
|
||||||
@ -1087,7 +1087,8 @@
|
|||||||
"离线": "离线",
|
"离线": "离线",
|
||||||
"购买记录": "购买记录",
|
"购买记录": "购买记录",
|
||||||
"使用记录": "使用记录",
|
"使用记录": "使用记录",
|
||||||
|
|
||||||
"失效时间要大于当前时间": "失效时间要大于当前时间",
|
"失效时间要大于当前时间": "失效时间要大于当前时间",
|
||||||
"修改名字": "修改名字"
|
"修改名字": "修改名字",
|
||||||
|
"时": "时",
|
||||||
|
"分": "分"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1087,7 +1087,8 @@
|
|||||||
"离线": "离线",
|
"离线": "离线",
|
||||||
"购买记录": "购买记录",
|
"购买记录": "购买记录",
|
||||||
"使用记录": "使用记录",
|
"使用记录": "使用记录",
|
||||||
|
|
||||||
"失效时间要大于当前时间": "失效时间要大于当前时间",
|
"失效时间要大于当前时间": "失效时间要大于当前时间",
|
||||||
"修改名字": "修改名字"
|
"修改名字": "修改名字",
|
||||||
|
"时": "时",
|
||||||
|
"分": "分"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,10 +1,12 @@
|
|||||||
|
|
||||||
import 'package:date_format/date_format.dart';
|
import 'package:date_format/date_format.dart';
|
||||||
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';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:star_lock/main/lockDetail/checkingIn/checkingInHolidays/checkingInAddHolidays/checkingInAddHolidays_state.dart';
|
import 'package:star_lock/main/lockDetail/checkingIn/checkingInHolidays/checkingInAddHolidays/checkingInAddHolidays_state.dart';
|
||||||
|
import 'package:star_lock/tools/pickers/pickers.dart';
|
||||||
|
import 'package:star_lock/tools/pickers/time_picker/model/date_mode.dart';
|
||||||
|
import 'package:star_lock/tools/pickers/time_picker/model/pduration.dart';
|
||||||
|
|
||||||
import '../../../../../app_settings/app_colors.dart';
|
import '../../../../../app_settings/app_colors.dart';
|
||||||
import '../../../../../tools/commonItem.dart';
|
import '../../../../../tools/commonItem.dart';
|
||||||
@ -43,9 +45,7 @@ class _CheckingInAddHolidaysPageState extends State<CheckingInAddHolidaysPage> {
|
|||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
isHaveRightWidget: true,
|
isHaveRightWidget: true,
|
||||||
setHeight: false,
|
setHeight: false,
|
||||||
rightWidget: getTFWidget(
|
rightWidget: getTFWidget('(${"必填".tr})', maxSize: 50)),
|
||||||
'(${"必填".tr})',
|
|
||||||
maxSize: 50)),
|
|
||||||
Obx(() => CommonItem(
|
Obx(() => CommonItem(
|
||||||
leftTitel: '开始日期'.tr,
|
leftTitel: '开始日期'.tr,
|
||||||
rightTitle: state.beginDate.value.isEmpty
|
rightTitle: state.beginDate.value.isEmpty
|
||||||
@ -54,18 +54,10 @@ class _CheckingInAddHolidaysPageState extends State<CheckingInAddHolidaysPage> {
|
|||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
isHaveDirection: false,
|
isHaveDirection: false,
|
||||||
action: () async {
|
action: () async {
|
||||||
await showDialog(
|
Pickers.showDatePicker(context,
|
||||||
context: context,
|
selectDate: PDuration.now(),
|
||||||
builder: (BuildContext context) {
|
mode: DateMode.YMD, onConfirm: (PDuration p) {
|
||||||
return ShowCalendar(
|
state.beginDate.value = formatDate(p);
|
||||||
datePickerMode: DatePickerMode.day,
|
|
||||||
selectAction: (DateTime dateTime) {
|
|
||||||
final String beginDate = formatDate(
|
|
||||||
dateTime, <String>[yyyy, '-', mm, '-', dd]);
|
|
||||||
state.beginDate.value = beginDate;
|
|
||||||
Get.back();
|
|
||||||
// Navigator.of(context).pop(true);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
})),
|
})),
|
||||||
Obx(() => CommonItem(
|
Obx(() => CommonItem(
|
||||||
@ -76,17 +68,10 @@ class _CheckingInAddHolidaysPageState extends State<CheckingInAddHolidaysPage> {
|
|||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
isHaveDirection: false,
|
isHaveDirection: false,
|
||||||
action: () async {
|
action: () async {
|
||||||
await showDialog(
|
Pickers.showDatePicker(context,
|
||||||
context: context,
|
selectDate: PDuration.now(),
|
||||||
builder: (BuildContext context) {
|
mode: DateMode.YMD, onConfirm: (PDuration p) {
|
||||||
return ShowCalendar(
|
state.endDate.value = formatDate(p);
|
||||||
datePickerMode: DatePickerMode.day,
|
|
||||||
selectAction: (DateTime dateTime) {
|
|
||||||
final String endDate = formatDate(
|
|
||||||
dateTime, <String>[yyyy, '-', mm, '-', dd]);
|
|
||||||
state.endDate.value = endDate;
|
|
||||||
Get.back();
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
})),
|
})),
|
||||||
Obx(() => CommonItem(
|
Obx(() => CommonItem(
|
||||||
@ -95,17 +80,10 @@ class _CheckingInAddHolidaysPageState extends State<CheckingInAddHolidaysPage> {
|
|||||||
isHaveLine: false,
|
isHaveLine: false,
|
||||||
isHaveDirection: false,
|
isHaveDirection: false,
|
||||||
action: () async {
|
action: () async {
|
||||||
await showDialog(
|
Pickers.showDatePicker(context,
|
||||||
context: context,
|
selectDate: PDuration.now(),
|
||||||
builder: (BuildContext context) {
|
mode: DateMode.YMD, onConfirm: (PDuration p) {
|
||||||
return ShowCalendar(
|
state.makeUpWorkDate.value = formatDate(p);
|
||||||
datePickerMode: DatePickerMode.day,
|
|
||||||
selectAction: (DateTime dateTime) {
|
|
||||||
final String makeUpWorkDate = formatDate(
|
|
||||||
dateTime, <String>[yyyy, '-', mm, '-', dd]);
|
|
||||||
state.makeUpWorkDate.value = makeUpWorkDate;
|
|
||||||
Get.back();
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
})),
|
})),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
@ -168,4 +146,21 @@ class _CheckingInAddHolidaysPageState extends State<CheckingInAddHolidaysPage> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String formatDate(PDuration p) {
|
||||||
|
if (p == null) {
|
||||||
|
throw ArgumentError('Input must be a valid DateTime object');
|
||||||
|
}
|
||||||
|
|
||||||
|
String formatPart(int part) {
|
||||||
|
return part.toString().padLeft(2, '0');
|
||||||
|
}
|
||||||
|
|
||||||
|
String monthFormatted = formatPart(p.month!);
|
||||||
|
String dayFormatted = formatPart(p.day!);
|
||||||
|
String hourFormatted = formatPart(p.hour!);
|
||||||
|
String minuteFormatted = formatPart(p.minute!);
|
||||||
|
|
||||||
|
return '${p.year}-${monthFormatted}-${dayFormatted}';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
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';
|
||||||
@ -219,8 +218,6 @@ class _CheckingInSetHolidaysPageState extends State<CheckingInSetHolidaysPage> {
|
|||||||
context,
|
context,
|
||||||
// 模式,详见下方
|
// 模式,详见下方
|
||||||
mode: DateMode.Y,
|
mode: DateMode.Y,
|
||||||
// 后缀 默认Suffix.normal(),为空的话Suffix()
|
|
||||||
suffix: Suffix(years: ' 年'.tr),
|
|
||||||
// 样式 详见下方样式
|
// 样式 详见下方样式
|
||||||
pickerStyle: PickerStyle(
|
pickerStyle: PickerStyle(
|
||||||
cancelButton: GestureDetector(
|
cancelButton: GestureDetector(
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
|
|
||||||
import 'package:cached_network_image/cached_network_image.dart';
|
import 'package:cached_network_image/cached_network_image.dart';
|
||||||
import 'package:date_format/date_format.dart';
|
import 'package:date_format/date_format.dart';
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
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';
|
||||||
@ -101,7 +102,8 @@ class _CheckingInListPageState extends State<CheckingInListPage> {
|
|||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
// SizedBox(width: 30.w,),
|
// SizedBox(width: 30.w,),
|
||||||
Row(
|
Expanded(
|
||||||
|
child: Row(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 20.w,
|
width: 20.w,
|
||||||
@ -127,7 +129,7 @@ class _CheckingInListPageState extends State<CheckingInListPage> {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
width: 90.w,
|
|
||||||
// height: 100.h,
|
// height: 100.h,
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
child: Obx(() => Column(
|
child: Obx(() => Column(
|
||||||
@ -153,7 +155,7 @@ class _CheckingInListPageState extends State<CheckingInListPage> {
|
|||||||
)),
|
)),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
// SizedBox(width: 20.w,),
|
SizedBox(width: 20.w,),
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
final bool? isDemoMode =
|
final bool? isDemoMode =
|
||||||
@ -175,7 +177,7 @@ class _CheckingInListPageState extends State<CheckingInListPage> {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
width: 90.w,
|
|
||||||
// height: 100.h,
|
// height: 100.h,
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
child: Obx(() => Column(
|
child: Obx(() => Column(
|
||||||
@ -202,6 +204,7 @@ class _CheckingInListPageState extends State<CheckingInListPage> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
),
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
final bool? isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
final bool? isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
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';
|
||||||
@ -19,8 +18,10 @@ class CheckingInSetWorkdaySet extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _CheckingInSetWorkdaySetState extends State<CheckingInSetWorkdaySet> {
|
class _CheckingInSetWorkdaySetState extends State<CheckingInSetWorkdaySet> {
|
||||||
final CheckingInSetWorkdaySetLogic logic = Get.put(CheckingInSetWorkdaySetLogic());
|
final CheckingInSetWorkdaySetLogic logic =
|
||||||
final CheckingInSetWorkdaySetState state = Get.find<CheckingInSetWorkdaySetLogic>().state;
|
Get.put(CheckingInSetWorkdaySetLogic());
|
||||||
|
final CheckingInSetWorkdaySetState state =
|
||||||
|
Get.find<CheckingInSetWorkdaySetLogic>().state;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@ -33,12 +34,19 @@ class _CheckingInSetWorkdaySetState extends State<CheckingInSetWorkdaySet> {
|
|||||||
body: ListView(
|
body: ListView(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
topBtnWidget(),
|
topBtnWidget(),
|
||||||
Obx(() => Visibility(visible: state.isCustom.value, child: bottomCustomSelectBtn())),
|
Obx(() => Visibility(
|
||||||
Obx(() => Visibility(visible: !state.isCustom.value, child: bottomOddOrEvenDaysOffSelectBtn())),
|
visible: state.isCustom.value, child: bottomCustomSelectBtn())),
|
||||||
SizedBox(height: 50.h,),
|
Obx(() => Visibility(
|
||||||
|
visible: !state.isCustom.value,
|
||||||
|
child: bottomOddOrEvenDaysOffSelectBtn())),
|
||||||
|
SizedBox(
|
||||||
|
height: 50.h,
|
||||||
|
),
|
||||||
Container(
|
Container(
|
||||||
margin: EdgeInsets.only(left: 20.w, right: 20.w),
|
margin: EdgeInsets.only(left: 20.w, right: 20.w),
|
||||||
child: SubmitBtn(btnName: '确定'.tr, onClick: () {
|
child: SubmitBtn(
|
||||||
|
btnName: '确定'.tr,
|
||||||
|
onClick: () {
|
||||||
if (state.pushType.value == '2') {
|
if (state.pushType.value == '2') {
|
||||||
logic.editCheckInSetInfoData();
|
logic.editCheckInSetInfoData();
|
||||||
} else {
|
} else {
|
||||||
@ -47,7 +55,6 @@ class _CheckingInSetWorkdaySetState extends State<CheckingInSetWorkdaySet> {
|
|||||||
'weekDays': state.weekDays.value,
|
'weekDays': state.weekDays.value,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@ -58,7 +65,7 @@ class _CheckingInSetWorkdaySetState extends State<CheckingInSetWorkdaySet> {
|
|||||||
Widget topBtnWidget() {
|
Widget topBtnWidget() {
|
||||||
return Container(
|
return Container(
|
||||||
width: 1.sw,
|
width: 1.sw,
|
||||||
height: 100.h,
|
constraints: BoxConstraints(minHeight: 100.h),
|
||||||
// color: Colors.red,
|
// color: Colors.red,
|
||||||
padding: EdgeInsets.all(10.w),
|
padding: EdgeInsets.all(10.w),
|
||||||
child: Obx(() => Row(
|
child: Obx(() => Row(
|
||||||
@ -73,11 +80,16 @@ class _CheckingInSetWorkdaySetState extends State<CheckingInSetWorkdaySet> {
|
|||||||
child: Container(
|
child: Container(
|
||||||
width: (1.sw - 5.w * 2) / 2,
|
width: (1.sw - 5.w * 2) / 2,
|
||||||
height: 100.h,
|
height: 100.h,
|
||||||
color: state.isCustom.value ? AppColors.mainColor : AppColors.btnDisableColor,
|
color: state.isCustom.value
|
||||||
|
? AppColors.mainColor
|
||||||
|
: AppColors.btnDisableColor,
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Center(child: Text('自定义'.tr, style: TextStyle(fontSize: 26.sp, color: Colors.white))),
|
Center(
|
||||||
|
child: Text('自定义'.tr,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 26.sp, color: Colors.white))),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -91,8 +103,9 @@ class _CheckingInSetWorkdaySetState extends State<CheckingInSetWorkdaySet> {
|
|||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
width: (1.sw - 10 * 3) / 2,
|
width: (1.sw - 10 * 3) / 2,
|
||||||
height: 100.h,
|
color: state.isCustom.value
|
||||||
color: state.isCustom.value ? AppColors.btnDisableColor : AppColors.mainColor,
|
? AppColors.btnDisableColor
|
||||||
|
: AppColors.mainColor,
|
||||||
padding: EdgeInsets.all(10.w),
|
padding: EdgeInsets.all(10.w),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
@ -137,10 +150,15 @@ class _CheckingInSetWorkdaySetState extends State<CheckingInSetWorkdaySet> {
|
|||||||
},
|
},
|
||||||
rightWidget: Row(
|
rightWidget: Row(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Image.asset(state.isSingledayWeekend.value == 0 ? 'images/icon_round_select.png' : 'images/icon_round_unSelect.png', width: 30.w, height: 30.w,),
|
Image.asset(
|
||||||
|
state.isSingledayWeekend.value == 0
|
||||||
|
? 'images/icon_round_select.png'
|
||||||
|
: 'images/icon_round_unSelect.png',
|
||||||
|
width: 30.w,
|
||||||
|
height: 30.w,
|
||||||
|
),
|
||||||
],
|
],
|
||||||
)
|
))),
|
||||||
)),
|
|
||||||
Obx(() => CommonItem(
|
Obx(() => CommonItem(
|
||||||
leftTitel: '双休'.tr,
|
leftTitel: '双休'.tr,
|
||||||
rightTitle: '',
|
rightTitle: '',
|
||||||
@ -155,10 +173,15 @@ class _CheckingInSetWorkdaySetState extends State<CheckingInSetWorkdaySet> {
|
|||||||
},
|
},
|
||||||
rightWidget: Row(
|
rightWidget: Row(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Image.asset(state.isSingledayWeekend.value == 1 ? 'images/icon_round_select.png' : 'images/icon_round_unSelect.png', width: 30.w, height: 30.w,),
|
Image.asset(
|
||||||
|
state.isSingledayWeekend.value == 1
|
||||||
|
? 'images/icon_round_select.png'
|
||||||
|
: 'images/icon_round_unSelect.png',
|
||||||
|
width: 30.w,
|
||||||
|
height: 30.w,
|
||||||
|
),
|
||||||
],
|
],
|
||||||
)
|
))),
|
||||||
)),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@ -219,13 +242,16 @@ class _CheckingInSetWorkdaySetState extends State<CheckingInSetWorkdaySet> {
|
|||||||
},
|
},
|
||||||
rightWidget: Row(
|
rightWidget: Row(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Image.asset(state.weekDays.value.contains(index) ? 'images/icon_round_select.png' : 'images/icon_round_unSelect.png', width: 30.w, height: 30.w,),
|
Image.asset(
|
||||||
],
|
state.weekDays.value.contains(index)
|
||||||
)
|
? 'images/icon_round_select.png'
|
||||||
));
|
: 'images/icon_round_unSelect.png',
|
||||||
}
|
width: 30.w,
|
||||||
|
height: 30.w,
|
||||||
),
|
),
|
||||||
|
],
|
||||||
|
)));
|
||||||
|
}),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/widgets.dart';
|
||||||
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
import 'package:flutter_easyloading/flutter_easyloading.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';
|
||||||
@ -275,6 +277,9 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
return Container(
|
return Container(
|
||||||
width: 0.9.sw,
|
width: 0.9.sw,
|
||||||
height: 0.6.sw,
|
height: 0.6.sw,
|
||||||
|
constraints: BoxConstraints(
|
||||||
|
minHeight: 0.6.sw,
|
||||||
|
),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
image: const DecorationImage(
|
image: const DecorationImage(
|
||||||
image: AssetImage('images/xhj_main_bg.jpg'),
|
image: AssetImage('images/xhj_main_bg.jpg'),
|
||||||
@ -293,7 +298,6 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
const Spacer(),
|
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
ShowTipView().showSureAlertDialog(
|
ShowTipView().showSureAlertDialog(
|
||||||
@ -322,9 +326,6 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
SizedBox(width: 20.w),
|
SizedBox(width: 20.w),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
SizedBox(
|
|
||||||
height: 15.h,
|
|
||||||
),
|
|
||||||
Visibility(
|
Visibility(
|
||||||
visible: state
|
visible: state
|
||||||
.keyInfos.value.lockFeature!.isSupportBackupBattery ==
|
.keyInfos.value.lockFeature!.isSupportBackupBattery ==
|
||||||
@ -388,7 +389,6 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
spreadRadius: 0,
|
spreadRadius: 0,
|
||||||
),
|
),
|
||||||
]),
|
]),
|
||||||
margin: EdgeInsets.only(top: 0.h),
|
|
||||||
child: Stack(
|
child: Stack(
|
||||||
alignment: AlignmentDirectional.center,
|
alignment: AlignmentDirectional.center,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
@ -428,33 +428,19 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const Spacer(),
|
Expanded(
|
||||||
Padding(
|
child: Text(
|
||||||
padding: EdgeInsets.only(left: 15.w, right: 00.w, bottom: 15.h),
|
|
||||||
child: Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: <Widget>[
|
|
||||||
Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
|
||||||
children: <Widget>[
|
|
||||||
Text(
|
|
||||||
'点击开锁,长按闭锁'.tr,
|
'点击开锁,长按闭锁'.tr,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: AppColors.darkGrayTextColor,
|
color: AppColors.darkGrayTextColor,
|
||||||
fontSize: 20.sp,
|
fontSize: 20.sp,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(
|
|
||||||
height: 16.h,
|
|
||||||
),
|
),
|
||||||
adminInfoView(center: false, max: false),
|
adminInfoView(center: false, max: false),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
],
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -765,8 +751,10 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
return Row(
|
return Row(
|
||||||
mainAxisAlignment:
|
mainAxisAlignment:
|
||||||
center ? MainAxisAlignment.center : MainAxisAlignment.start,
|
center ? MainAxisAlignment.center : MainAxisAlignment.start,
|
||||||
mainAxisSize: max ? MainAxisSize.max : MainAxisSize.min,
|
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
|
Row(
|
||||||
|
mainAxisSize: max ? MainAxisSize.max : MainAxisSize.min,
|
||||||
|
children: [
|
||||||
Image.asset(
|
Image.asset(
|
||||||
'images/icon_electronicKey_admin.png',
|
'images/icon_electronicKey_admin.png',
|
||||||
width: 24.w,
|
width: 24.w,
|
||||||
@ -777,10 +765,18 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
Text(
|
Text(
|
||||||
state.keyInfos.value.isLockOwner == 1
|
state.keyInfos.value.isLockOwner == 1
|
||||||
? '超级管理员'.tr
|
? '超级管理员'.tr
|
||||||
: (state.keyInfos.value.keyRight == 1 ? '授权管理员'.tr : '普通用户'.tr),
|
: (state.keyInfos.value.keyRight == 1
|
||||||
style: TextStyle(fontSize: 20.sp, color: AppColors.darkGrayTextColor),
|
? '授权管理员'.tr
|
||||||
|
: '普通用户'.tr),
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 20.sp, color: AppColors.darkGrayTextColor),
|
||||||
),
|
),
|
||||||
if (add) SizedBox(width: 20.w) else SizedBox(width: 40.w),
|
if (add) SizedBox(width: 20.w) else SizedBox(width: 40.w),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
mainAxisSize: max ? MainAxisSize.max : MainAxisSize.min,
|
||||||
|
children: [
|
||||||
FlavorsImg(
|
FlavorsImg(
|
||||||
child: Image.asset(
|
child: Image.asset(
|
||||||
state.keyInfos.value.hasGateway == 1
|
state.keyInfos.value.hasGateway == 1
|
||||||
@ -800,6 +796,11 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
: AppColors.btnDisableColor),
|
: AppColors.btnDisableColor),
|
||||||
),
|
),
|
||||||
if (add) SizedBox(width: 20.w) else SizedBox(width: 20.w),
|
if (add) SizedBox(width: 20.w) else SizedBox(width: 20.w),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
mainAxisSize: max ? MainAxisSize.max : MainAxisSize.min,
|
||||||
|
children: [
|
||||||
FlavorsImg(
|
FlavorsImg(
|
||||||
child: Image.asset('images/main/icon_lockDetail_needNetwork.png',
|
child: Image.asset('images/main/icon_lockDetail_needNetwork.png',
|
||||||
width: 24.w,
|
width: 24.w,
|
||||||
@ -838,13 +839,16 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
Text(
|
Text(
|
||||||
'添加设备'.tr,
|
'添加设备'.tr,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 20.sp, color: AppColors.darkGrayTextColor),
|
fontSize: 20.sp,
|
||||||
|
color: AppColors.darkGrayTextColor),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
]
|
],
|
||||||
|
],
|
||||||
|
)
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
@ -32,7 +31,7 @@ class _FaceUnlockPageState extends State<FaceUnlockPage> {
|
|||||||
barTitle: '面容开锁设置'.tr,
|
barTitle: '面容开锁设置'.tr,
|
||||||
haveBack: true,
|
haveBack: true,
|
||||||
backgroundColor: AppColors.mainColor),
|
backgroundColor: AppColors.mainColor),
|
||||||
body: Obx(() => Column(
|
body: Obx(() => ListView(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Container(
|
Container(
|
||||||
margin: EdgeInsets.only(left: 20.w),
|
margin: EdgeInsets.only(left: 20.w),
|
||||||
@ -58,11 +57,15 @@ class _FaceUnlockPageState extends State<FaceUnlockPage> {
|
|||||||
'防误开'.tr,
|
'防误开'.tr,
|
||||||
state.antiMisoperation.value == 0
|
state.antiMisoperation.value == 0
|
||||||
? '防误开已关闭,关门后仍可使用面容开锁'.tr
|
? '防误开已关闭,关门后仍可使用面容开锁'.tr
|
||||||
:'防误开已打开,开锁后'.tr + state.antiMisoperation.value.toString() + '秒内不可使用面容开锁'.tr,
|
: '防误开已打开,开锁后'.tr +
|
||||||
|
state.antiMisoperation.value.toString() +
|
||||||
|
'秒内不可使用面容开锁'.tr,
|
||||||
// state.antiMisoperation.value == 0 ? '关闭' :
|
// state.antiMisoperation.value == 0 ? '关闭' :
|
||||||
'${state.antiMisoperation.value}' + '秒'.tr,
|
'${state.antiMisoperation.value}' + '秒'.tr,
|
||||||
state.faceOn.value, () {
|
state.faceOn.value, () {
|
||||||
Pickers.showSinglePicker(Get.context!, data: state.antiMisoperationStrList.value, onConfirm: (var data, int position) {
|
Pickers.showSinglePicker(Get.context!,
|
||||||
|
data: state.antiMisoperationStrList.value,
|
||||||
|
onConfirm: (var data, int position) {
|
||||||
AppLog.log('data = $data, position = $position');
|
AppLog.log('data = $data, position = $position');
|
||||||
state.antiMisoperation.value = position;
|
state.antiMisoperation.value = position;
|
||||||
state.setType.value = 2;
|
state.setType.value = 2;
|
||||||
@ -79,7 +82,8 @@ class _FaceUnlockPageState extends State<FaceUnlockPage> {
|
|||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildSubTitleItem(String leftStr, String subTitle, String rightStr, bool isAble, Function()? action) {
|
Widget _buildSubTitleItem(String leftStr, String subTitle, String rightStr,
|
||||||
|
bool isAble, Function()? action) {
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: isAble ? action : null,
|
onTap: isAble ? action : null,
|
||||||
child: Container(
|
child: Container(
|
||||||
@ -99,7 +103,11 @@ class _FaceUnlockPageState extends State<FaceUnlockPage> {
|
|||||||
alignment: Alignment.centerLeft,
|
alignment: Alignment.centerLeft,
|
||||||
child: Text(
|
child: Text(
|
||||||
leftStr,
|
leftStr,
|
||||||
style: TextStyle(fontSize: 24.sp, color: isAble ? Colors.black : AppColors.placeholderTextColor),
|
style: TextStyle(
|
||||||
|
fontSize: 24.sp,
|
||||||
|
color: isAble
|
||||||
|
? Colors.black
|
||||||
|
: AppColors.placeholderTextColor),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
@ -109,8 +117,6 @@ class _FaceUnlockPageState extends State<FaceUnlockPage> {
|
|||||||
alignment: Alignment.centerLeft,
|
alignment: Alignment.centerLeft,
|
||||||
child: Text(
|
child: Text(
|
||||||
subTitle,
|
subTitle,
|
||||||
maxLines: 2,
|
|
||||||
overflow: TextOverflow.ellipsis,
|
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 20.sp, color: AppColors.btnDisableColor),
|
fontSize: 20.sp, color: AppColors.btnDisableColor),
|
||||||
),
|
),
|
||||||
@ -123,7 +129,9 @@ class _FaceUnlockPageState extends State<FaceUnlockPage> {
|
|||||||
Text(
|
Text(
|
||||||
rightStr,
|
rightStr,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 22.sp, color: isAble ? Colors.black : AppColors.placeholderTextColor),
|
fontSize: 22.sp,
|
||||||
|
color:
|
||||||
|
isAble ? Colors.black : AppColors.placeholderTextColor),
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 10.w,
|
width: 10.w,
|
||||||
@ -159,7 +167,8 @@ class _FaceUnlockPageState extends State<FaceUnlockPage> {
|
|||||||
activeColor: CupertinoColors.activeBlue,
|
activeColor: CupertinoColors.activeBlue,
|
||||||
trackColor: CupertinoColors.systemGrey5,
|
trackColor: CupertinoColors.systemGrey5,
|
||||||
thumbColor: CupertinoColors.white,
|
thumbColor: CupertinoColors.white,
|
||||||
value: state.faceOn.value, // getIndex == 1 ? state.faceOn.value : state.autoBright.value,
|
value: state.faceOn.value,
|
||||||
|
// getIndex == 1 ? state.faceOn.value : state.autoBright.value,
|
||||||
onChanged: (bool value) {
|
onChanged: (bool value) {
|
||||||
if (getIndex == 1) {
|
if (getIndex == 1) {
|
||||||
//设置面容开锁开关
|
//设置面容开锁开关
|
||||||
@ -181,8 +190,7 @@ class _FaceUnlockPageState extends State<FaceUnlockPage> {
|
|||||||
topTitle: '',
|
topTitle: '',
|
||||||
items: bottomItemList,
|
items: bottomItemList,
|
||||||
chooseCallback: (int value) {
|
chooseCallback: (int value) {
|
||||||
state.senseDistance.value =
|
state.senseDistance.value = state.senseDistanceList.value[value];
|
||||||
state.senseDistanceList.value[value];
|
|
||||||
state.setType.value = 1;
|
state.setType.value = 1;
|
||||||
logic.sendFaceUnlock();
|
logic.sendFaceUnlock();
|
||||||
},
|
},
|
||||||
|
|||||||
@ -532,7 +532,7 @@ class LockSetLogic extends BaseGetXController {
|
|||||||
/// 以下为删除逻辑
|
/// 以下为删除逻辑
|
||||||
void deleyLockLogicOfRoles() {
|
void deleyLockLogicOfRoles() {
|
||||||
if (state.lockBasicInfo.value.isLockOwner == 1) {
|
if (state.lockBasicInfo.value.isLockOwner == 1) {
|
||||||
// 超级管理员必须通过连接蓝牙删除
|
// 超级管理员必须通过连接蓝牙删除q
|
||||||
state.showTipView.showIosTipWithContentDialog('删除锁后,所有信息都会一起删除,确定删除锁吗?'.tr, () {
|
state.showTipView.showIosTipWithContentDialog('删除锁后,所有信息都会一起删除,确定删除锁吗?'.tr, () {
|
||||||
// 删除锁
|
// 删除锁
|
||||||
state.showTipView.resetGetController();
|
state.showTipView.resetGetController();
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:star_lock/tools/baseGetXController.dart';
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
@ -8,14 +7,14 @@ import 'messageList_entity.dart';
|
|||||||
import 'messageList_state.dart';
|
import 'messageList_state.dart';
|
||||||
|
|
||||||
typedef BlockDeletSuccssCallback = void Function();
|
typedef BlockDeletSuccssCallback = void Function();
|
||||||
|
|
||||||
class MessageListLogic extends BaseGetXController {
|
class MessageListLogic extends BaseGetXController {
|
||||||
final MessageListState state = MessageListState();
|
final MessageListState state = MessageListState();
|
||||||
|
|
||||||
//请求消息列表
|
//请求消息列表
|
||||||
Future<MessageListEntity> messageListDataRequest() async {
|
Future<MessageListEntity> messageListDataRequest() async {
|
||||||
final MessageListEntity entity = await ApiRepository.to.messageListLoadData(
|
final MessageListEntity entity = await ApiRepository.to
|
||||||
pageNo:pageNo.toString(),
|
.messageListLoadData(pageNo: pageNo.toString(), pageSize: pageSize);
|
||||||
pageSize:pageSize);
|
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
if (pageNo == 1) {
|
if (pageNo == 1) {
|
||||||
state.itemDataList.value = entity.data!.list!;
|
state.itemDataList.value = entity.data!.list!;
|
||||||
@ -31,8 +30,10 @@ class MessageListLogic extends BaseGetXController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 删除消息
|
// 删除消息
|
||||||
Future<void> deletMessageDataRequest(String messageId, BlockDeletSuccssCallback blockDeletSuccssCallback) async {
|
Future<void> deletMessageDataRequest(String messageId,
|
||||||
final MessageListEntity entity = await ApiRepository.to.deletMessageLoadData(messageId:messageId);
|
BlockDeletSuccssCallback blockDeletSuccssCallback) async {
|
||||||
|
final MessageListEntity entity =
|
||||||
|
await ApiRepository.to.deletMessageLoadData(messageId: messageId);
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
blockDeletSuccssCallback();
|
blockDeletSuccssCallback();
|
||||||
}
|
}
|
||||||
@ -40,7 +41,8 @@ class MessageListLogic extends BaseGetXController {
|
|||||||
|
|
||||||
// 清空消息
|
// 清空消息
|
||||||
Future<void> deletAllMessageDataRequest() async {
|
Future<void> deletAllMessageDataRequest() async {
|
||||||
final MessageListEntity entity = await ApiRepository.to.deletAllMessageLoadData();
|
final MessageListEntity entity =
|
||||||
|
await ApiRepository.to.deletAllMessageLoadData();
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
pageNo = 1;
|
pageNo = 1;
|
||||||
messageListDataRequest();
|
messageListDataRequest();
|
||||||
@ -49,9 +51,11 @@ class MessageListLogic extends BaseGetXController {
|
|||||||
|
|
||||||
// 刷新消息列表
|
// 刷新消息列表
|
||||||
StreamSubscription? _readMessageRefreshUIEvent;
|
StreamSubscription? _readMessageRefreshUIEvent;
|
||||||
|
|
||||||
void _readMessageRefreshUIAction() {
|
void _readMessageRefreshUIAction() {
|
||||||
// 蓝牙协议通知传输跟蓝牙之外的数据传输类不一样 eventBus
|
// 蓝牙协议通知传输跟蓝牙之外的数据传输类不一样 eventBus
|
||||||
_readMessageRefreshUIEvent = eventBus.on<ReadMessageRefreshUI>().listen((event) {
|
_readMessageRefreshUIEvent =
|
||||||
|
eventBus.on<ReadMessageRefreshUI>().listen((event) {
|
||||||
pageNo = 1;
|
pageNo = 1;
|
||||||
messageListDataRequest();
|
messageListDataRequest();
|
||||||
});
|
});
|
||||||
@ -63,6 +67,14 @@ class MessageListLogic extends BaseGetXController {
|
|||||||
// messageListDataRequest();
|
// messageListDataRequest();
|
||||||
|
|
||||||
_readMessageRefreshUIAction();
|
_readMessageRefreshUIAction();
|
||||||
|
|
||||||
|
// 收到切换语言消息,重新拉取一下列表
|
||||||
|
eventBus
|
||||||
|
.on<ChangeLanguageBlockLastLanguageEvent>()
|
||||||
|
.listen((ChangeLanguageBlockLastLanguageEvent event) {
|
||||||
|
pageNo = 1;
|
||||||
|
messageListDataRequest();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -70,5 +82,4 @@ class MessageListLogic extends BaseGetXController {
|
|||||||
super.onClose();
|
super.onClose();
|
||||||
_readMessageRefreshUIEvent?.cancel();
|
_readMessageRefreshUIEvent?.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1,9 +1,9 @@
|
|||||||
|
|
||||||
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:flutter_slidable/flutter_slidable.dart';
|
import 'package:flutter_slidable/flutter_slidable.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:star_lock/mine/message/messageList/messageList_state.dart';
|
import 'package:star_lock/mine/message/messageList/messageList_state.dart';
|
||||||
|
import 'package:star_lock/tools/eventBusEventManage.dart';
|
||||||
import 'package:star_lock/tools/noData.dart';
|
import 'package:star_lock/tools/noData.dart';
|
||||||
|
|
||||||
import '../../../appRouters.dart';
|
import '../../../appRouters.dart';
|
||||||
@ -57,9 +57,11 @@ class _MessageListPageState extends State<MessageListPage>
|
|||||||
style: TextStyle(color: Colors.white, fontSize: 24.sp),
|
style: TextStyle(color: Colors.white, fontSize: 24.sp),
|
||||||
),
|
),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
final bool? isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
final bool? isDemoMode =
|
||||||
|
await Storage.getBool(ifIsDemoModeOrNot);
|
||||||
if (isDemoMode == false) {
|
if (isDemoMode == false) {
|
||||||
ShowTipView().showIosTipWithContentDialog('是否清空?'.tr, () async {
|
ShowTipView().showIosTipWithContentDialog('是否清空?'.tr,
|
||||||
|
() async {
|
||||||
logic.deletAllMessageDataRequest();
|
logic.deletAllMessageDataRequest();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@ -106,7 +108,8 @@ class _MessageListPageState extends State<MessageListPage>
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
child: _messageListItem(messageItemEntity, () {
|
child: _messageListItem(messageItemEntity, () {
|
||||||
Get.toNamed(Routers.messageDetailPage, arguments: <String, MessageItemEntity>{
|
Get.toNamed(Routers.messageDetailPage,
|
||||||
|
arguments: <String, MessageItemEntity>{
|
||||||
'messageItemEntity': messageItemEntity
|
'messageItemEntity': messageItemEntity
|
||||||
});
|
});
|
||||||
}),
|
}),
|
||||||
@ -137,15 +140,21 @@ class _MessageListPageState extends State<MessageListPage>
|
|||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Row(
|
Row(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
if (messageItemEntity.readAt! == 0) Container(
|
if (messageItemEntity.readAt! == 0)
|
||||||
|
Container(
|
||||||
width: 10.w,
|
width: 10.w,
|
||||||
height: 10.w,
|
height: 10.w,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.red,
|
color: Colors.red,
|
||||||
borderRadius: BorderRadius.circular(5.w),
|
borderRadius: BorderRadius.circular(5.w),
|
||||||
),
|
),
|
||||||
) else Container(),
|
)
|
||||||
if (messageItemEntity.readAt! == 0) SizedBox(width: 5.w) else Container(),
|
else
|
||||||
|
Container(),
|
||||||
|
if (messageItemEntity.readAt! == 0)
|
||||||
|
SizedBox(width: 5.w)
|
||||||
|
else
|
||||||
|
Container(),
|
||||||
Flexible(
|
Flexible(
|
||||||
child: Text(
|
child: Text(
|
||||||
messageItemEntity.data!,
|
messageItemEntity.data!,
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
import 'dart:ui';
|
import 'dart:ui';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:star_lock/app_settings/app_settings.dart';
|
import 'package:star_lock/app_settings/app_settings.dart';
|
||||||
@ -16,10 +15,12 @@ class MineMultiLanguageLogic extends GetxController {
|
|||||||
// AppLog.log('lanTypeTitle: $lanTypeTitle');
|
// AppLog.log('lanTypeTitle: $lanTypeTitle');
|
||||||
|
|
||||||
final String lang = l.toLanguageTag();
|
final String lang = l.toLanguageTag();
|
||||||
final PasswordKeyListEntity entity = await ApiRepository.to.updateUserLangInfo(lang: lang);
|
final PasswordKeyListEntity entity =
|
||||||
|
await ApiRepository.to.updateUserLangInfo(lang: lang);
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
await changeLanguage(l);
|
await changeLanguage(l);
|
||||||
eventBus.fire(ChangeLanguageBlockLastLanguageEvent());
|
eventBus.fire(ChangeLanguageBlockLastLanguageEvent());
|
||||||
|
print('发送语言变化事件');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
@ -25,6 +24,7 @@ import '../../../translations/app_dept.dart';
|
|||||||
|
|
||||||
class MineSetLogic extends BaseGetXController {
|
class MineSetLogic extends BaseGetXController {
|
||||||
final MineSetState state = MineSetState();
|
final MineSetState state = MineSetState();
|
||||||
|
|
||||||
//用户信息
|
//用户信息
|
||||||
Future<void> userSettingsInfoRequest() async {
|
Future<void> userSettingsInfoRequest() async {
|
||||||
final UserSettingInfoEntity entity =
|
final UserSettingInfoEntity entity =
|
||||||
@ -108,7 +108,8 @@ class MineSetLogic extends BaseGetXController {
|
|||||||
getPushDeviceID = value;
|
getPushDeviceID = value;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
final LoginEntity entity = await ApiRepository.to.userLogout(deviceld: getPushDeviceID);
|
final LoginEntity entity =
|
||||||
|
await ApiRepository.to.userLogout(deviceld: getPushDeviceID);
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
UdpHelp().closeUDP();
|
UdpHelp().closeUDP();
|
||||||
logOut();
|
logOut();
|
||||||
@ -151,7 +152,11 @@ class MineSetLogic extends BaseGetXController {
|
|||||||
if (languageCode!.isEmpty) {
|
if (languageCode!.isEmpty) {
|
||||||
languageCode = Get.deviceLocale!.languageCode;
|
languageCode = Get.deviceLocale!.languageCode;
|
||||||
}
|
}
|
||||||
final String currentLanguage = ExtensionLanguageType.fromLocale(appDept.deptSupportedLocales.where((Locale element) => element.languageCode == languageCode).first).lanTitle;
|
final String currentLanguage = ExtensionLanguageType.fromLocale(appDept
|
||||||
|
.deptSupportedLocales
|
||||||
|
.where((Locale element) => element.languageCode == languageCode)
|
||||||
|
.first)
|
||||||
|
.lanTitle;
|
||||||
return currentLanguage;
|
return currentLanguage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
@ -10,6 +11,7 @@ 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/langue/langue_tool.dart';
|
||||||
import 'package:star_lock/tools/wechat/customer_tool.dart';
|
import 'package:star_lock/tools/wechat/customer_tool.dart';
|
||||||
import '../../../appRouters.dart';
|
import '../../../appRouters.dart';
|
||||||
import '../../../app_settings/app_colors.dart';
|
import '../../../app_settings/app_colors.dart';
|
||||||
@ -149,6 +151,8 @@ class _MineSetPageState extends State<MineSetPage>
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget getListDataView() {
|
Widget getListDataView() {
|
||||||
|
// 检测系统语言是否为中文
|
||||||
|
bool isChinese = LanguageTool.instance.isChinese;
|
||||||
return Column(
|
return Column(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
/* 2024-01-12 会议确定去掉“提示音、触摸开锁” by DaisyWu
|
/* 2024-01-12 会议确定去掉“提示音、触摸开锁” by DaisyWu
|
||||||
@ -192,6 +196,7 @@ class _MineSetPageState extends State<MineSetPage>
|
|||||||
height: 50.h,
|
height: 50.h,
|
||||||
child: Obx(_isPushNotificationSwitch))),
|
child: Obx(_isPushNotificationSwitch))),
|
||||||
// if (F.appFlavor == Flavor.sky)
|
// if (F.appFlavor == Flavor.sky)
|
||||||
|
if (isChinese)
|
||||||
CommonItem(
|
CommonItem(
|
||||||
leftTitel: '微信公众号推送'.tr,
|
leftTitel: '微信公众号推送'.tr,
|
||||||
rightTitle: '',
|
rightTitle: '',
|
||||||
@ -200,9 +205,11 @@ class _MineSetPageState extends State<MineSetPage>
|
|||||||
rightWidget: SizedBox(
|
rightWidget: SizedBox(
|
||||||
width: 60.w,
|
width: 60.w,
|
||||||
height: 50.h,
|
height: 50.h,
|
||||||
child: Obx(_isWechatPublicAccountPushSwitch))),
|
child: Obx(_isWechatPublicAccountPushSwitch),
|
||||||
// else
|
),
|
||||||
// Container(),
|
)
|
||||||
|
else
|
||||||
|
Container(),
|
||||||
SizedBox(height: 10.h),
|
SizedBox(height: 10.h),
|
||||||
CommonItem(
|
CommonItem(
|
||||||
leftTitel: '锁用户管理'.tr,
|
leftTitel: '锁用户管理'.tr,
|
||||||
|
|||||||
16
lib/tools/langue/langue_tool.dart
Normal file
16
lib/tools/langue/langue_tool.dart
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
class LanguageTool {
|
||||||
|
LanguageTool._();
|
||||||
|
|
||||||
|
static LanguageTool? _instance;
|
||||||
|
|
||||||
|
static LanguageTool get instance => _instance ??= LanguageTool._();
|
||||||
|
|
||||||
|
String get currentLanguage => Get.locale?.languageCode ?? 'zh';
|
||||||
|
|
||||||
|
bool get isChinese => currentLanguage == 'zh';
|
||||||
|
|
||||||
|
bool get isArabic => currentLanguage == 'ar';
|
||||||
|
bool get isHebrew => currentLanguage == 'he';
|
||||||
|
}
|
||||||
@ -3,6 +3,7 @@ import 'package:flutter_easyloading/flutter_easyloading.dart';
|
|||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:star_lock/app_settings/app_colors.dart';
|
import 'package:star_lock/app_settings/app_colors.dart';
|
||||||
import 'package:star_lock/flavors.dart';
|
import 'package:star_lock/flavors.dart';
|
||||||
|
import 'package:star_lock/tools/langue/langue_tool.dart';
|
||||||
|
|
||||||
class TitleAppBar extends AppBar {
|
class TitleAppBar extends AppBar {
|
||||||
@override
|
@override
|
||||||
@ -40,13 +41,17 @@ class TitleAppBar extends AppBar {
|
|||||||
class _TitleAppBarState extends State<TitleAppBar> {
|
class _TitleAppBarState extends State<TitleAppBar> {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
bool isRTL =
|
||||||
|
LanguageTool.instance.isArabic || LanguageTool.instance.isHebrew;
|
||||||
|
|
||||||
return AppBar(
|
return AppBar(
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
leading: widget.haveOtherLeftWidget!
|
leading: widget.haveOtherLeftWidget!
|
||||||
? widget.leftWidget
|
? widget.leftWidget
|
||||||
: (widget.haveBack ?? false
|
: (widget.haveBack ?? false
|
||||||
? IconButton(
|
? IconButton(
|
||||||
icon: Icon(Icons.arrow_back_ios,
|
icon: Icon(
|
||||||
|
isRTL ? Icons.arrow_forward_ios : Icons.arrow_back_ios,
|
||||||
color: widget.iconColor ?? Colors.white),
|
color: widget.iconColor ?? Colors.white),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
if (widget.backAction != null) {
|
if (widget.backAction != null) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user