This commit is contained in:
魏少阳 2023-10-13 15:37:29 +08:00
commit ab40596dca
14 changed files with 289 additions and 78 deletions

View File

@ -58,7 +58,7 @@
"pleaseNameYourPassword":"请给密码命名",
"pleaseEnterDigitsNumber":"请输入6-9位数字",
"getPasswordTip1":"密码在24小时内至少要使用过一次否则将无效",
"getPasswordTip2":"限时密码可以再有下期内不限次数使用 \\n密码在生效后的24小时内至少要使用过一次否则将失效",
"getPasswordTip2":"限时密码可以再有下期内不限次数使用 \n密码在生效后的24小时内至少要使用过一次否则将失效",
"getPasswordTip3":"密码有限期为6个小时只能使用一次",
"getPasswordTip4":"可在锁旁边通过手机蓝牙添加,也可以通过网关远程添加",
"getPasswordTip5":"密码在生效后的24小时内至少要使用过一次,否则将失效",

View File

@ -22,6 +22,8 @@ PODS:
- fluttertoast (0.0.2):
- Flutter
- Toast
- fluwx_no_pay_rz (0.0.1):
- Flutter
- FMDB (2.7.5):
- FMDB/standard (= 2.7.5)
- FMDB/standard (2.7.5)
@ -71,6 +73,7 @@ DEPENDENCIES:
- Flutter (from `Flutter`)
- flutter_native_contact_picker (from `.symlinks/plugins/flutter_native_contact_picker/ios`)
- fluttertoast (from `.symlinks/plugins/fluttertoast/ios`)
- fluwx_no_pay_rz (from `.symlinks/plugins/fluwx_no_pay_rz/ios`)
- google_maps_flutter_ios (from `.symlinks/plugins/google_maps_flutter_ios/ios`)
- image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`)
- network_info_plus (from `.symlinks/plugins/network_info_plus/ios`)
@ -111,6 +114,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/flutter_native_contact_picker/ios"
fluttertoast:
:path: ".symlinks/plugins/fluttertoast/ios"
fluwx_no_pay_rz:
:path: ".symlinks/plugins/fluwx_no_pay_rz/ios"
google_maps_flutter_ios:
:path: ".symlinks/plugins/google_maps_flutter_ios/ios"
image_picker_ios:
@ -146,6 +151,7 @@ SPEC CHECKSUMS:
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
flutter_native_contact_picker: bd430ba0fbf82768bb50c2c52a69a65759a8f907
fluttertoast: fafc4fa4d01a6a9e4f772ecd190ffa525e9e2d9c
fluwx_no_pay_rz: afc11aac65505182bd887798fcdc4bbc9e35cd36
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
google_maps_flutter_ios: abdac20d6ce8931f6ebc5f46616df241bfaa2cfd
GoogleMaps: 025272d5876d3b32604e5c080dc25eaf68764693

View File

@ -163,7 +163,9 @@ class CheckingInAddStaffLogic extends BaseGetXController{
state.getKeyInfosData.value.lockId.toString(),
'0',
"0",
'0');
'0',
0,
0);
if (entity.errorCode!.codeIsSuccessful) {
print('获取密码成功');
if (entity.data != null) {

View File

@ -361,6 +361,7 @@ class _ElectronicKeyListPageState extends State<ElectronicKeyListPage> {
CupertinoDialogAction(
child: Text(TranslationLoader.lanKeys!.reset!.tr),
onPressed: () {
Navigator.of(context).pop();
logic.resetElectronicKeyListRequest();
setState(() {});
},

View File

@ -147,7 +147,9 @@ class _WirelessKeyboardPageState extends State<WirelessKeyboardPage> {
),
CupertinoDialogAction(
child: Text(TranslationLoader.lanKeys!.reset!.tr),
onPressed: () {},
onPressed: () {
Navigator.of(context).pop();
},
),
],
);

View File

@ -1,4 +1,3 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
@ -8,6 +7,7 @@ import 'package:star_lock/network/api_repository.dart';
import 'package:star_lock/tools/baseGetXController.dart';
import 'package:star_lock/tools/showTFView.dart';
import 'package:star_lock/tools/toast.dart';
import 'package:fluwx_no_pay_rz/fluwx_no_pay_rz.dart';
import '../../../../appRouters.dart';
import '../../../../app_settings/app_colors.dart';
@ -34,6 +34,13 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage> {
_inputPwdController = TextEditingController();
_inputNameController = TextEditingController();
// _initFluwx();
}
_initFluwx() async {
await registerWxApi(
appId: "", doOnAndroid: true, doOnIOS: true, universalLink: "");
}
@override
@ -42,6 +49,26 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage> {
if (obj != null && (obj["itemData"] != null)) {
itemData = obj["itemData"];
}
List<String> nameItems = <String>[
'微信',
'朋友圈',
'QQ',
'QQ空间',
'微博',
'FaceBook',
'邮件',
'链接'
];
List<String> urlItems = <String>[
'icon_wechat.png',
'icon_wechat_moments.png',
'icon_qq.png',
'icon_qzone.png',
'icon_sina.png',
'icon_facebook.png',
'icon_email.png',
'icon_copylink.png'
];
return Scaffold(
backgroundColor: AppColors.mainBackgroundColor,
@ -56,18 +83,33 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage> {
height: 30.h,
width: 30.w,
),
onPressed: () {},
onPressed: () {
/*
showModalBottomSheet(
context: context,
isScrollControlled: true,
builder: (context) {
return Container(
decoration: const BoxDecoration(
color: Colors.white,
),
constraints: const BoxConstraints(maxHeight: 700),
child: Row(
children: [
Image.asset(
'images/icon_wechat.png',
width: 50.0,
height: 50.0,
fit: BoxFit.fill,
)
],
),
); //maxHeight为你想要的数字就行
});
*/
},
),
],
// actionsList: [
// TextButton(
// child: Text(
// "分享",
// style: TextStyle(color: Colors.white, fontSize: 24.sp),
// ),
// onPressed: () {},
// ),
// ],
),
body: SingleChildScrollView(
child: Column(
@ -329,4 +371,92 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage> {
},
);
}
Widget _shareWidget(BuildContext context) {
List<String> nameItems = <String>[
'微信',
'朋友圈',
'QQ',
'QQ空间',
'微博',
'FaceBook',
'邮件',
'链接'
];
List<String> urlItems = <String>[
'icon_wechat.png',
'icon_wechat_moments.png',
'icon_qq.png',
'icon_qzone.png',
'icon_sina.png',
'icon_facebook.png',
'icon_email.png',
'icon_copylink.png'
];
return Container(
color: Colors.red,
height: 250.0,
child: GridView.builder(
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 4, mainAxisSpacing: 5.0, childAspectRatio: 1.0),
itemBuilder: (BuildContext context, int index) {
return Image.asset(
'images/${urlItems[index]}',
width: 50.0,
height: 50.0,
fit: BoxFit.fill,
);
},
itemCount: nameItems.length,
),
/*
child: Column(
children: <Widget>[
Padding(
padding: const EdgeInsets.fromLTRB(0.0, 10.0, 0.0, 0.0),
child: SizedBox(
height: 190.0,
child: GridView.builder(
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 4,
mainAxisSpacing: 5.0,
childAspectRatio: 1.0),
itemBuilder: (BuildContext context, int index) {
return Column(
children: <Widget>[
Padding(
padding:
const EdgeInsets.fromLTRB(0.0, 6.0, 0.0, 6.0),
child: Image.asset(
'images/${urlItems[index]}',
width: 50.0,
height: 50.0,
fit: BoxFit.fill,
)),
Text(nameItems[index])
],
);
},
itemCount: nameItems.length,
),
),
),
Container(
height: 0.5,
color: Colors.blueGrey,
),
const Center(
child: Padding(
padding: EdgeInsets.fromLTRB(0.0, 8.0, 0.0, 8.0),
child: Text(
'取 消',
style: TextStyle(fontSize: 18.0, color: Colors.blueGrey),
)),
)
],
),
*/
);
}
}

View File

@ -334,6 +334,7 @@ class _PasswordKeyListPageState extends State<PasswordKeyListPage> {
CupertinoDialogAction(
child: Text(TranslationLoader.lanKeys!.reset!.tr),
onPressed: () {
Navigator.of(context).pop();
logic.resetPasswordKeyListRequest();
setState(() {});
},

View File

@ -48,6 +48,8 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> {
late String cyclicModeStr; //
late String effectiveHourStr;
late String failureHourStr;
int startHours = 0;
int endHours = 0;
@override
Widget build(BuildContext context) {
@ -70,6 +72,8 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> {
_selectEffectiveDate = formatDate(dateTime, [HH, ':', nn]); //
_selectFailureDate = formatDate(dateTime, [HH, ':', nn]); //
startHours = _effectiveDateTime.hour;
endHours = _failureDateTime.hour;
} else {
_selectEffectiveDate = formatDate(
dateTime, [yyyy, '-', mm, '-', dd, ' ', HH, ':', nn]); //
@ -264,7 +268,7 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> {
children: [
CommonItem(
leftTitel: TranslationLoader.lanKeys!.recursiveDevice!.tr,
rightTitle: "周末",
rightTitle: cyclicModeStr,
isHaveLine: true,
isHaveDirection: true,
action: () {
@ -292,9 +296,10 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> {
onConfirm: (p) {
setState(() {
_effectiveDateTime = DateTime.parse(
'${intToStr(p.hour!)}:${intToStr(p.minute!)}');
'${_effectiveDateTime.year}-${intToStr(_effectiveDateTime.month)}-${intToStr(_effectiveDateTime.day)} ${intToStr(p.hour!)}:${intToStr(p.minute!)}');
_selectEffectiveDate =
formatDate(_effectiveDateTime, [HH, ':', nn]);
startHours = p.hour!;
});
});
}),
@ -307,9 +312,10 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> {
onConfirm: (p) {
setState(() {
_failureDateTime = DateTime.parse(
'${intToStr(p.hour!)}:${intToStr(p.minute!)}');
'${_failureDateTime.year}-${intToStr(_failureDateTime.month)}-${intToStr(_failureDateTime.day)} ${intToStr(p.hour!)}:${intToStr(p.minute!)}');
_selectFailureDate =
formatDate(_effectiveDateTime, [HH, ':', nn]);
formatDate(_failureDateTime, [HH, ':', nn]);
endHours = p.hour!;
});
});
}),
@ -323,7 +329,9 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> {
Pickers.showSinglePicker(context,
data: dataList,
pickerStyle: DefaultPickerStyle(), onConfirm: (p, position) {
setState(() {});
setState(() {
cyclicModeStr = p;
});
}, onChanged: (p, position) {
setState(() {});
});
@ -374,14 +382,21 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> {
}
}
*/
logic.getStartDate(_effectiveDateTime);
int passwordType = int.parse(widget.type);
if (passwordType == 3) {
//
addKeyboardPwdRequest();
if (_nameController.text.isNotEmpty) {
logic.getStartDate(_effectiveDateTime);
int passwordType = int.parse(widget.type);
if (passwordType == 3) {
if (_pwdController.text.isNotEmpty) {
//
addKeyboardPwdRequest();
} else {
Toast.show(msg: '请输入密码');
}
} else {
getKeyboardPwdRequest();
}
} else {
getKeyboardPwdRequest();
Toast.show(msg: '请给密码命名');
}
}),
],
@ -424,17 +439,33 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> {
//
} else if (passwordType == 4) {
//
getKeyType = '6';
if (cyclicModeStr == '每日') {
getKeyType = '6';
} else if (cyclicModeStr == '工作日') {
getKeyType = '7';
} else if (cyclicModeStr == '星期一') {
getKeyType = '8';
} else if (cyclicModeStr == '星期二') {
getKeyType = '9';
} else if (cyclicModeStr == '星期三') {
getKeyType = '10';
} else if (cyclicModeStr == '星期四') {
getKeyType = '11';
} else if (cyclicModeStr == '星期五') {
getKeyType = '12';
} else if (cyclicModeStr == '星期六') {
getKeyType = '13';
} else if (cyclicModeStr == '星期日') {
getKeyType = '14';
}
} else if (passwordType == 5) {
//
getKeyType = '4';
}
if (widget.type != '0' && widget.type != '2' && widget.type != '5') {
getFailureDateTime =
DateTime.parse(_selectFailureDate).millisecondsSinceEpoch.toString();
getEffectiveDateTime = DateTime.parse(_selectEffectiveDate)
.millisecondsSinceEpoch
.toString();
getFailureDateTime = _failureDateTime.millisecondsSinceEpoch.toString();
getEffectiveDateTime =
_effectiveDateTime.millisecondsSinceEpoch.toString();
}
var entity = await ApiRepository.to.getPasswordKey(
getFailureDateTime,
@ -445,7 +476,9 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> {
lockId,
'0',
getEffectiveDateTime,
'0');
'0',
startHours,
endHours);
if (entity.errorCode!.codeIsSuccessful) {
print('获取密码成功');
_isSendSuccess = true;

View File

@ -34,8 +34,8 @@ class SafeVerifyLogic extends BaseGetXController {
//
void sendValidationCode() async {
var entity = await ApiRepository.to.getValidationCodeAuth(
"+86",
state.loginData.value.mobile!,
"",
'',
'1',
state.codeType.value,
"B748F838-94EE-4BDB-A0E6-7B2D16849792",

View File

@ -92,13 +92,13 @@ class _MinePersonInfoPageState extends State<MinePersonInfoPage> {
arguments: {
'mobile': state.mobileStr.value,
'isFrom': '1'
});
}).then((value) => logic.getUserInfoRequest());
} else {
Navigator.pushNamed(
context, Routers.mineBindPhoneOrEmailPage, arguments: {
'mobile': state.mobileStr.value,
'isFrom': '1'
});
}).then((value) => logic.getUserInfoRequest());
}
})),
Obx(() => CommonItem(
@ -116,13 +116,13 @@ class _MinePersonInfoPageState extends State<MinePersonInfoPage> {
arguments: {
'isFrom': '2',
'email': state.emailStr.value
});
}).then((value) => logic.getUserInfoRequest());
} else {
Navigator.pushNamed(
context, Routers.mineBindPhoneOrEmailPage, arguments: {
'isFrom': '2',
'email': state.emailStr.value
});
}).then((value) => logic.getUserInfoRequest());
}
})),
CommonItem(
@ -134,7 +134,7 @@ class _MinePersonInfoPageState extends State<MinePersonInfoPage> {
Navigator.pushNamed(
context, Routers.minePersonInfoResetPasswordPage);
}),
CommonItem(
Obx(() => CommonItem(
leftTitel: TranslationLoader.lanKeys!.safetyProblem!.tr,
rightTitle: state.haveSafeAnswer.value == 0 ? "去设置" : "",
isHaveLine: true,
@ -148,7 +148,7 @@ class _MinePersonInfoPageState extends State<MinePersonInfoPage> {
Navigator.pushNamed(
context, Routers.minePersonInfoViewSafetyProblemPage);
}
}),
})),
Obx(() => CommonItem(
leftTitel: TranslationLoader.lanKeys!.countryAndRegion!.tr,
rightTitle: state.countryStr.value,

View File

@ -248,7 +248,7 @@ class _MineSetPageState extends State<MineSetPage> {
color: AppColors.darkGrayTextColor, fontSize: 18.sp),
),
onPressed: () {
showCupertinoAlertDialog(context);
_showDialog(context);
},
),
],
@ -261,25 +261,54 @@ class _MineSetPageState extends State<MineSetPage> {
);
}
void showCupertinoAlertDialog(BuildContext context) {
showDialog(
context: context,
builder: (BuildContext context) {
return ShowIosTipView(
title: "",
tipTitle: TranslationLoader.lanKeys!.deleteAccountTips!.tr,
sureClick: () {
//
Navigator.pushNamed(context, Routers.safeVerifyPage);
},
cancelClick: () {
Navigator.pop(context);
},
//
void _showDialog(widgetContext) {
showCupertinoDialog(
context: widgetContext,
builder: (context) {
return CupertinoAlertDialog(
title: Text(TranslationLoader.lanKeys!.deleteAccountTips!.tr),
actions: [
CupertinoDialogAction(
child: Text(TranslationLoader.lanKeys!.cancel!.tr),
onPressed: () {
Navigator.of(context).pop();
},
),
CupertinoDialogAction(
child: Text(TranslationLoader.lanKeys!.sure!.tr),
onPressed: () {
Navigator.of(context).pop();
//
Navigator.pushNamed(context, Routers.safeVerifyPage);
setState(() {});
},
),
],
);
},
);
}
// void showCupertinoAlertDialog(BuildContext context) {
// showDialog(
// context: context,
// builder: (BuildContext context) {
// return ShowIosTipView(
// title: "",
// tipTitle: TranslationLoader.lanKeys!.deleteAccountTips!.tr,
// sureClick: () {
// //
// Navigator.pushNamed(context, Routers.safeVerifyPage);
// },
// cancelClick: () {
// Navigator.pop(context);
// },
// );
// },
// );
// }
CupertinoSwitch _isPrompToneSwitch() {
return CupertinoSwitch(
activeColor: CupertinoColors.activeBlue,

View File

@ -337,16 +337,17 @@ class ApiProvider extends BaseProvider {
jsonEncode({'lockId': lockId, 'operatorUid': operatorUid}));
Future<Response> getKeyboardPwd(
String endDate,
String isExclusive,
String keyboardPwdName,
String keyboardPwdType,
String keyboardPwdVersion,
String lockId,
String operatorUid,
String startDate,
String timezoneRawOffSet,
) =>
String endDate,
String isExclusive,
String keyboardPwdName,
String keyboardPwdType,
String keyboardPwdVersion,
String lockId,
String operatorUid,
String startDate,
String timezoneRawOffSet,
int startHours,
int endHours) =>
post(
passwordKeyGetURL.toUrl,
jsonEncode({
@ -358,7 +359,9 @@ class ApiProvider extends BaseProvider {
'lockId': lockId,
'operatorUid': operatorUid,
'startDate': startDate,
'timezoneRawOffSet': timezoneRawOffSet
'timezoneRawOffSet': timezoneRawOffSet,
'hoursStart': startHours,
'hoursEnd': endHours
}));
Future<Response> addKeyboardPwd(

View File

@ -334,16 +334,17 @@ class ApiRepository {
//
Future<PasswordKeyEntity> getPasswordKey(
String endDate,
String isExclusive,
String keyboardPwdName,
String keyboardPwdType,
String keyboardPwdVersion,
String lockId,
String operatorUid,
String startDate,
String timezoneRawOffSet,
) async {
String endDate,
String isExclusive,
String keyboardPwdName,
String keyboardPwdType,
String keyboardPwdVersion,
String lockId,
String operatorUid,
String startDate,
String timezoneRawOffSet,
int startHours,
int endHours) async {
final res = await apiProvider.getKeyboardPwd(
endDate,
isExclusive,
@ -353,7 +354,9 @@ class ApiRepository {
lockId,
operatorUid,
startDate,
timezoneRawOffSet);
timezoneRawOffSet,
startHours,
endHours);
return PasswordKeyEntity.fromJson(res.body);
}

View File

@ -111,6 +111,7 @@ dependencies:
#网络图片缓存
cached_network_image: ^3.2.0
webview_flutter: ^4.2.3
fluwx_no_pay_rz: ^3.4.4+1
dev_dependencies:
flutter_test: