Merge branch 'master' of gitee.com:starlock-cn/app-starlock
This commit is contained in:
commit
0496bd9357
@ -43,6 +43,8 @@
|
|||||||
|
|
||||||
# 下面是安卓发布编译命令
|
# 下面是安卓发布编译命令
|
||||||
# flutter build apk --split-per-abi --release --flavor sky -t lib/main_sky.dart
|
# flutter build apk --split-per-abi --release --flavor sky -t lib/main_sky.dart
|
||||||
|
# flutter build apk --release --flavor sky -t lib/main_sky.dart
|
||||||
|
|
||||||
# IOS编译发布
|
# IOS编译发布
|
||||||
# TODO 待补充
|
# TODO 待补充
|
||||||
|
|
||||||
|
|||||||
@ -43,7 +43,8 @@ class Utils {
|
|||||||
BuildContext context, CountryRegionModel model, Function() onClick,
|
BuildContext context, CountryRegionModel model, Function() onClick,
|
||||||
{double susHeight = 40}) {
|
{double susHeight = 40}) {
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
child: SizedBox(
|
child: Container(
|
||||||
|
color: Colors.white,
|
||||||
height: 80.h,
|
height: 80.h,
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
@ -60,13 +61,13 @@ class Utils {
|
|||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
width: 30.w,
|
width: 30.w,
|
||||||
)),
|
)),
|
||||||
Text(
|
// Text(
|
||||||
'+${model.code}',
|
// '+${model.code}',
|
||||||
style: TextStyle(color: AppColors.blackColor, fontSize: 22.sp),
|
// style: TextStyle(color: AppColors.blackColor, fontSize: 22.sp),
|
||||||
),
|
// ),
|
||||||
SizedBox(
|
// SizedBox(
|
||||||
width: 60.w,
|
// width: 60.w,
|
||||||
)
|
// )
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@ -22,14 +22,14 @@ class SelectCountryRegionPage extends StatefulWidget {
|
|||||||
|
|
||||||
class _SelectCountryRegionPageState extends State<SelectCountryRegionPage> {
|
class _SelectCountryRegionPageState extends State<SelectCountryRegionPage> {
|
||||||
List<CountryRegionModel> countriesList = [];
|
List<CountryRegionModel> countriesList = [];
|
||||||
|
List<CountryRegionModel> topCountriesList = [];
|
||||||
TextEditingController searchController = TextEditingController();
|
TextEditingController searchController = TextEditingController();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
|
|
||||||
SuspensionUtil.setShowSuspensionStatus(
|
SuspensionUtil.setShowSuspensionStatus(countriesList.cast<ISuspensionBean>());
|
||||||
countriesList.cast<ISuspensionBean>());
|
|
||||||
Future.delayed(const Duration(milliseconds: 20), () {
|
Future.delayed(const Duration(milliseconds: 20), () {
|
||||||
getCountriesListRequest();
|
getCountriesListRequest();
|
||||||
});
|
});
|
||||||
@ -41,6 +41,12 @@ class _SelectCountryRegionPageState extends State<SelectCountryRegionPage> {
|
|||||||
countriesList.clear();
|
countriesList.clear();
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
countriesList.addAll(entity.dataList!);
|
countriesList.addAll(entity.dataList!);
|
||||||
|
for(CountryRegionModel model in countriesList){
|
||||||
|
if(model.name! == "中国"){
|
||||||
|
topCountriesList.add(model);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
_handleList(countriesList);
|
_handleList(countriesList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -87,19 +93,40 @@ class _SelectCountryRegionPageState extends State<SelectCountryRegionPage> {
|
|||||||
editingController: searchController,
|
editingController: searchController,
|
||||||
backgroundColor: AppColors.mainBackgroundColor,
|
backgroundColor: AppColors.mainBackgroundColor,
|
||||||
onSubmittedAction: () {
|
onSubmittedAction: () {
|
||||||
var searchList = <CountryRegionModel>[];
|
if(searchController.text.isEmpty){
|
||||||
for (int i = 0, length = countriesList.length; i < length; i++) {
|
getCountriesListRequest();
|
||||||
CountryRegionModel countryModel = countriesList[i];
|
}else{
|
||||||
if(countryModel.name!.contains(searchController.text) || countryModel.code!.contains(searchController.text)){
|
var searchList = <CountryRegionModel>[];
|
||||||
searchList.add(countryModel);
|
for (int i = 0, length = countriesList.length; i < length; i++) {
|
||||||
Get.log('countryModel.name:${countryModel.name} countryModel.code:${countryModel.code}');
|
CountryRegionModel countryModel = countriesList[i];
|
||||||
|
if(countryModel.name!.contains(searchController.text) || countryModel.code!.contains(searchController.text)){
|
||||||
|
searchList.add(countryModel);
|
||||||
|
Get.log('countryModel.name:${countryModel.name} countryModel.code:${countryModel.code}');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
countriesList= searchList;
|
||||||
|
Get.log('searchList.length:${searchList.length}');
|
||||||
|
_handleList(searchList);
|
||||||
}
|
}
|
||||||
Get.log('searchList.length:${searchList.length}');
|
setState(() {});
|
||||||
_handleList(searchList);
|
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
SizedBox(height:20.h),
|
SizedBox(height:20.h),
|
||||||
|
Visibility(
|
||||||
|
visible: searchController.text.isEmpty,
|
||||||
|
child: Utils.getSusItem(context, '★')
|
||||||
|
),
|
||||||
|
countriesList.isNotEmpty ? Visibility(
|
||||||
|
visible: searchController.text.isEmpty,
|
||||||
|
child: Utils.getListItem(context, topCountriesList[0], () {
|
||||||
|
CountryRegionModel model = topCountriesList[0];
|
||||||
|
Map<String, dynamic> resultMap = {};
|
||||||
|
resultMap['code'] = model.code ?? '';
|
||||||
|
resultMap['countryId'] = model.countryId.toString() ?? '';
|
||||||
|
resultMap['countryName'] = model.name ?? '' ;
|
||||||
|
Navigator.pop(context, resultMap);
|
||||||
|
})
|
||||||
|
): Container(),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: AzListView(
|
child: AzListView(
|
||||||
data: countriesList,
|
data: countriesList,
|
||||||
@ -111,6 +138,7 @@ class _SelectCountryRegionPageState extends State<SelectCountryRegionPage> {
|
|||||||
resultMap['code'] = model.code;
|
resultMap['code'] = model.code;
|
||||||
resultMap['countryId'] = model.countryId.toString();
|
resultMap['countryId'] = model.countryId.toString();
|
||||||
resultMap['countryName'] = model.name;
|
resultMap['countryName'] = model.name;
|
||||||
|
print("model.name:${model.name} model.code:${model.code} model.countryId:${model.countryId} model.flag:${model.flag} model.group:${model.group} model.tagIndex:${model.tagIndex}");
|
||||||
Navigator.pop(context, resultMap);
|
Navigator.pop(context, resultMap);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|||||||
@ -7,12 +7,28 @@ import 'package:star_lock/network/api_repository.dart';
|
|||||||
import 'package:star_lock/tools/baseGetXController.dart';
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
|
|
||||||
class MinePersonInfoResetPasswordLogic extends BaseGetXController {
|
class MinePersonInfoResetPasswordLogic extends BaseGetXController {
|
||||||
final MinePersonInfoResetPasswordState state =
|
final MinePersonInfoResetPasswordState state = MinePersonInfoResetPasswordState();
|
||||||
MinePersonInfoResetPasswordState();
|
|
||||||
|
|
||||||
void changePasswordRequest() async {
|
void changePasswordRequest() async {
|
||||||
|
if(state.newPwd.value.length < 8){
|
||||||
|
showToast("新密码长度不足8位");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(state.surePwd.value.length < 8){
|
||||||
|
showToast("确认长度不足8位");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(state.surePwd.value != state.newPwd.value){
|
||||||
|
showToast("两次密码不一致");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var entity = await ApiRepository.to.changePassword(
|
var entity = await ApiRepository.to.changePassword(
|
||||||
state.date.value, state.surePwd.value, state.oldPwd.value, "");
|
state.date.value,
|
||||||
|
state.surePwd.value,
|
||||||
|
state.oldPwd.value);
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
showToast("重置成功");
|
showToast("重置成功");
|
||||||
Get.back();
|
Get.back();
|
||||||
|
|||||||
@ -48,18 +48,20 @@ class _TransferSmartLockPageState extends State<TransferSmartLockPage> {
|
|||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
setState(() {
|
setState(() {
|
||||||
for (var element in state.transferSmartLockListData.value) {
|
if(state.isSelectAll == true){
|
||||||
if(state.isSelectAll == true){
|
for (var element in state.transferSmartLockListData.value) {
|
||||||
state.isSelectAll = false;
|
state.isSelectAll = false;
|
||||||
element.select = 0;
|
element.select = 0;
|
||||||
}else{
|
}
|
||||||
|
}else{
|
||||||
|
for (var element in state.transferSmartLockListData.value) {
|
||||||
state.isSelectAll = true;
|
state.isSelectAll = true;
|
||||||
element.select = 1;
|
element.select = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
child: Text(state.isSelectAll == true ? TranslationLoader.lanKeys!.checkAll!.tr : TranslationLoader.lanKeys!.cancel!.tr, style: TextStyle(color: Colors.white, fontSize: 24.sp)))
|
child: Text(state.isSelectAll == true ? TranslationLoader.lanKeys!.cancel!.tr : TranslationLoader.lanKeys!.checkAll!.tr, style: TextStyle(color: Colors.white, fontSize: 24.sp)))
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
body: EasyRefreshTool(
|
body: EasyRefreshTool(
|
||||||
|
|||||||
@ -1570,14 +1570,13 @@ class ApiProvider extends BaseProvider {
|
|||||||
|
|
||||||
//修改密码
|
//修改密码
|
||||||
Future<Response> changePassword(String date, String newPassword,
|
Future<Response> changePassword(String date, String newPassword,
|
||||||
String oldPassword, String operatorUid) =>
|
String oldPassword) =>
|
||||||
post(
|
post(
|
||||||
changePasswordURL.toUrl,
|
changePasswordURL.toUrl,
|
||||||
jsonEncode({
|
jsonEncode({
|
||||||
"date": date,
|
"date": date,
|
||||||
'newPassword': newPassword,
|
'newPassword': newPassword,
|
||||||
"oldPassword": oldPassword,
|
"oldPassword": oldPassword,
|
||||||
'operatorUid': operatorUid
|
|
||||||
}));
|
}));
|
||||||
|
|
||||||
//获取安全信息列表
|
//获取安全信息列表
|
||||||
|
|||||||
@ -1601,10 +1601,9 @@ class ApiRepository {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//重置密码
|
//重置密码
|
||||||
Future<LoginEntity> changePassword(String date, String newPassword,
|
Future<LoginEntity> changePassword(String date, String newPassword, String oldPassword) async {
|
||||||
String oldPassword, String operatorUid) async {
|
|
||||||
final res = await apiProvider.changePassword(
|
final res = await apiProvider.changePassword(
|
||||||
date, newPassword, oldPassword, operatorUid);
|
date, newPassword, oldPassword);
|
||||||
return LoginEntity.fromJson(res.body);
|
return LoginEntity.fromJson(res.body);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:device_info_plus/device_info_plus.dart';
|
import 'package:device_info_plus/device_info_plus.dart';
|
||||||
@ -9,7 +10,6 @@ import 'package:package_info_plus/package_info_plus.dart';
|
|||||||
import 'package:url_launcher/url_launcher.dart';
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
|
|
||||||
import '../network/api_repository.dart';
|
import '../network/api_repository.dart';
|
||||||
import '../tools/storage.dart';
|
|
||||||
import '../translations/trans_lib.dart';
|
import '../translations/trans_lib.dart';
|
||||||
import 'versionUndate_entity.dart';
|
import 'versionUndate_entity.dart';
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user