feat: 1、添加跳转小程序。2、修改网关配网逻辑。3、修复电子钥匙、卡、指纹、密码模块国际化bug

This commit is contained in:
魏少阳 2024-11-18 15:29:08 +08:00
parent d6ca149344
commit 720406913a
18 changed files with 320 additions and 257 deletions

BIN
images/.DS_Store vendored

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

BIN
ios/.DS_Store vendored

Binary file not shown.

View File

@ -46,8 +46,8 @@ class GatewayConfiguringWifiCommand extends SenderProtocol {
subData = getFixedLengthList(subData, 20 - passwordLength); subData = getFixedLengthList(subData, 20 - passwordLength);
//gatewayConfigurationStr //gatewayConfigurationStr
final int clientIdLength = utf8.encode(gatewayConfigurationStr!).length; // final int clientIdLength = utf8.encode(gatewayConfigurationStr!).length;
subData.add(clientIdLength); // subData.add(clientIdLength);
subData.addAll(utf8.encode(gatewayConfigurationStr!)); subData.addAll(utf8.encode(gatewayConfigurationStr!));
// subData = getFixedLengthList(subData, 20 - clientIdLength); // subData = getFixedLengthList(subData, 20 - clientIdLength);

View File

@ -1,5 +1,5 @@
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:flutter_slidable/flutter_slidable.dart'; import 'package:flutter_slidable/flutter_slidable.dart';
@ -62,7 +62,8 @@ class _CardListPageState extends State<CardListPage> with RouteAware {
backgroundColor: AppColors.mainColor, backgroundColor: AppColors.mainColor,
actionsList: <Widget>[ actionsList: <Widget>[
TextButton( TextButton(
child: Text('重置'.tr, child: Text(
'重置'.tr,
style: TextStyle(color: Colors.white, fontSize: 24.sp), style: TextStyle(color: Colors.white, fontSize: 24.sp),
), ),
onPressed: () async { onPressed: () async {
@ -107,14 +108,13 @@ class _CardListPageState extends State<CardListPage> with RouteAware {
SizedBox(height: 20.h), SizedBox(height: 20.h),
Expanded(child: _buildMainUI()), Expanded(child: _buildMainUI()),
AddBottomWhiteBtn( AddBottomWhiteBtn(
btnName: btnName: '添加卡'.tr,
'添加卡'.tr,
onClick: () async { onClick: () async {
await Get.toNamed(Routers.addCardPage, await Get.toNamed(Routers.addCardPage, arguments: <String, int>{
arguments: <String, int>{ 'lockId': state.lockId.value,
'lockId': state.lockId.value, 'fromType': 1 // 1 2
'fromType': 1 // 1 2 })!
})!.then((value) { .then((value) {
getHttpData(isRefresh: true); getHttpData(isRefresh: true);
}); });
// if (data != null) { // if (data != null) {
@ -176,10 +176,11 @@ class _CardListPageState extends State<CardListPage> with RouteAware {
fingerprintItemData.cardName!, fingerprintItemData.cardName!,
logic.getKeyType(fingerprintItemData), logic.getKeyType(fingerprintItemData),
logic.getKeyDateType(fingerprintItemData), () async { logic.getKeyDateType(fingerprintItemData), () async {
await Get.toNamed(Routers.cardDetailPage, await Get.toNamed(Routers.cardDetailPage,
arguments: <String, FingerprintItemData>{ arguments: <String, FingerprintItemData>{
'fingerprintItemData': fingerprintItemData, 'fingerprintItemData': fingerprintItemData,
})!.then((value) => getHttpData(isRefresh: true)); })!
.then((value) => getHttpData(isRefresh: true));
// if (data != null) { // if (data != null) {
// getHttpData(isRefresh: true); // getHttpData(isRefresh: true);
// } // }
@ -207,39 +208,34 @@ class _CardListPageState extends State<CardListPage> with RouteAware {
return GestureDetector( return GestureDetector(
onTap: action, onTap: action,
child: Container( child: Container(
height: 90.h, // height: 90.h,
// margin: EdgeInsets.only(left: 20.w, right: 20.w, top: 20.w), // margin: EdgeInsets.only(left: 20.w, right: 20.w, top: 20.w),
padding: EdgeInsets.only(top: 10.h, bottom: 10.h),
color: Colors.white, color: Colors.white,
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
SizedBox(width: 30.w), SizedBox(width: 30.w),
Image.asset(lockTypeIcon, width: 60.w, height: 60.w), Image.asset(lockTypeIcon, width: 60.w, height: 60.w),
SizedBox(width: 20.w), SizedBox(width: 20.w),
Expanded( SizedBox(
width: 1.sw - 30.w - 20.w - 60.w - 20.w,
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
Row( Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween, // mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[ children: <Widget>[
SizedBox( Expanded(
width: 1.sw - 110.w - 100.w, child: Text(lockTypeTitle,
child: Row( maxLines: 1,
children: <Widget>[ overflow: TextOverflow.ellipsis,
Flexible( style: TextStyle(
child: Text(lockTypeTitle, fontSize: 24.sp, color: AppColors.blackColor)),
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 24.sp,
color: AppColors.blackColor)),
),
],
),
), ),
SizedBox(width: 10.w),
Text(ifInvalidation, Text(ifInvalidation,
style: TextStyle(fontSize: 22.sp, color: Colors.red)), style: TextStyle(fontSize: 22.sp, color: Colors.red)),
SizedBox(width: 10.w), // SizedBox(width: 10.w),
], ],
), ),
SizedBox(height: 5.h), SizedBox(height: 5.h),
@ -256,11 +252,11 @@ class _CardListPageState extends State<CardListPage> with RouteAware {
), ),
], ],
), ),
SizedBox(width: 20.h), // SizedBox(width: 20.h),
], ],
), ),
), ),
SizedBox(width: 20.h), SizedBox(width: 20.w),
], ],
), ),
), ),

View File

@ -1,4 +1,4 @@
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:flutter_slidable/flutter_slidable.dart'; import 'package:flutter_slidable/flutter_slidable.dart';
@ -69,7 +69,7 @@ class _ElectronicKeyListPageState extends State<ElectronicKeyListPage> {
await Storage.getBool(ifIsDemoModeOrNot); await Storage.getBool(ifIsDemoModeOrNot);
if (isDemoMode == false) { if (isDemoMode == false) {
final bool isNetWork = final bool isNetWork =
await LockMainLogic.to()?.judgeTheNetwork() ?? false; await LockMainLogic.to()?.judgeTheNetwork() ?? false;
if (!isNetWork) { if (!isNetWork) {
return; return;
} }
@ -191,9 +191,8 @@ class _ElectronicKeyListPageState extends State<ElectronicKeyListPage> {
}).then((Object? val) { }).then((Object? val) {
if (val == 'deletScuess') { if (val == 'deletScuess') {
state.itemDataList.removeWhere( state.itemDataList.removeWhere(
(ElectronicKeyListItem item) => (ElectronicKeyListItem item) =>
item.keyId == item.keyId == indexEntity.keyId!);
indexEntity.keyId!);
setState(() {}); setState(() {});
} else if (val != null) { } else if (val != null) {
logic logic
@ -258,7 +257,7 @@ class _ElectronicKeyListPageState extends State<ElectronicKeyListPage> {
onTap: action, onTap: action,
child: Container( child: Container(
color: Colors.white, color: Colors.white,
padding: EdgeInsets.only(top: 20.h, bottom: 20.h), padding: EdgeInsets.only(top: 15.h, bottom: 15.h),
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
SizedBox(width: 20.w), SizedBox(width: 20.w),
@ -277,28 +276,27 @@ class _ElectronicKeyListPageState extends State<ElectronicKeyListPage> {
), ),
SizedBox(width: 20.w), SizedBox(width: 20.w),
SizedBox( SizedBox(
width: 1.sw - 120.w, width: 1.sw - 20.w - 60.w - 20.w - 20.w,
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Row( Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween, // mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[ children: <Widget>[
Text(receiveUser, Expanded(
maxLines: 1, child: Text(receiveUser,
overflow: TextOverflow.ellipsis, maxLines: 1,
style: TextStyle( overflow: TextOverflow.ellipsis,
fontSize: 24.sp, style: TextStyle(
color: AppColors.blackColor)), fontSize: 24.sp, color: AppColors.blackColor)),
SizedBox(width: 5.w), ),
if (isRemteUnlocking) SizedBox(width: 5.w),
if (isRemteUnlocking) if (isRemteUnlocking)
Image.asset( Image.asset(
'images/icon_electronicKey_remteUnlocking.png', 'images/icon_electronicKey_remteUnlocking.png',
width: 24.w, width: 24.w,
height: 20.w, height: 20.w,
), ),
SizedBox(width: 5.w), if (isRemteUnlocking) SizedBox(width: 5.w),
if (isAdminKey) if (isAdminKey)
Image.asset( Image.asset(
'images/icon_electronicKey_admin.png', 'images/icon_electronicKey_admin.png',
@ -306,8 +304,8 @@ class _ElectronicKeyListPageState extends State<ElectronicKeyListPage> {
height: 20.w, height: 20.w,
), ),
// Expanded(child: SizedBox(width: 20.w,)), // Expanded(child: SizedBox(width: 20.w,)),
// SizedBox(width: 10.w), SizedBox(width: 10.w),
const Spacer(), // const Spacer(),
Text( Text(
keyStatus, keyStatus,
textAlign: TextAlign.end, textAlign: TextAlign.end,
@ -331,7 +329,7 @@ class _ElectronicKeyListPageState extends State<ElectronicKeyListPage> {
], ],
), ),
), ),
// SizedBox(width: 20.h), SizedBox(width: 20.w),
], ],
), ),
), ),

View File

@ -38,18 +38,16 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage>
haveBack: true, haveBack: true,
backgroundColor: AppColors.mainColor, backgroundColor: AppColors.mainColor,
), ),
body: Column( body: ListView(
children: <Widget>[ children: <Widget>[
Obx(() => CommonItem( Obx(() => CommonItem(
leftTitel:'指纹号'.tr, leftTitel: '指纹号'.tr,
rightTitle: state.typeNumber.value, rightTitle: state.typeNumber.value,
isHaveDirection: false, isHaveDirection: false,
isHaveLine: true)), isHaveLine: true)),
Obx(() => lockDataListItem('姓名'.tr, state.typeName.value, () { Obx(() => lockDataListItem('姓名'.tr, state.typeName.value, () {
ShowTipView().showTFViewAlertDialog( ShowTipView().showTFViewAlertDialog(
state.changeNameController, state.changeNameController, '修改姓名'.tr, '', () {
'修改姓名'.tr,
'', () {
if (state.changeNameController.text.isEmpty) { if (state.changeNameController.text.isEmpty) {
logic.showToast('请输入姓名'.tr); logic.showToast('请输入姓名'.tr);
return; return;

View File

@ -1,4 +1,3 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.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';
@ -110,14 +109,14 @@ class _FingerprintListPageState extends State<FingerprintListPage>
), ),
Expanded(child: _buildMainUI()), Expanded(child: _buildMainUI()),
AddBottomWhiteBtn( AddBottomWhiteBtn(
btnName: btnName: '添加指纹'.tr,
'添加指纹'.tr,
onClick: () async { onClick: () async {
await Get.toNamed(Routers.addFingerprintTypePage, await Get.toNamed(Routers.addFingerprintTypePage,
arguments: <String, int>{ arguments: <String, int>{
'lockId': state.lockId.value, 'lockId': state.lockId.value,
'fromType': 1 // 1 2 'fromType': 1 // 1 2
})!.then((value) => getHttpData(isRefresh: true)); })!
.then((value) => getHttpData(isRefresh: true));
// if (data != null) { // if (data != null) {
// getHttpData(isRefresh: true); // getHttpData(isRefresh: true);
// } // }
@ -175,11 +174,13 @@ class _FingerprintListPageState extends State<FingerprintListPage>
fingerprintItemData.fingerprintName!, fingerprintItemData.fingerprintName!,
logic.getKeyType(fingerprintItemData), logic.getKeyType(fingerprintItemData),
logic.getKeyDateType(fingerprintItemData), () async { logic.getKeyDateType(fingerprintItemData), () async {
await Get.toNamed(Routers.fingerprintDetailPage, arguments: <String, FingerprintItemData>{ await Get.toNamed(Routers.fingerprintDetailPage,
arguments: <String, FingerprintItemData>{
'fingerprintItemData': fingerprintItemData, 'fingerprintItemData': fingerprintItemData,
})!.then((value) { })!
getHttpData(isRefresh: true); .then((value) {
}); getHttpData(isRefresh: true);
});
// if (data == 'deletScuess') { // if (data == 'deletScuess') {
// // state.fingerprintItemListData.removeWhere((FingerprintItemData item) => item.fingerprintId == fingerprintItemData.fingerprintId!); // // state.fingerprintItemListData.removeWhere((FingerprintItemData item) => item.fingerprintId == fingerprintItemData.fingerprintId!);
// // setState(() {}); // // setState(() {});
@ -214,45 +215,34 @@ class _FingerprintListPageState extends State<FingerprintListPage>
return GestureDetector( return GestureDetector(
onTap: action, onTap: action,
child: Container( child: Container(
height: 90.h, // height: 90.h,
// margin: EdgeInsets.only(left: 20.w, right: 20.w, top: 20.w), // margin: EdgeInsets.only(left: 20.w, right: 20.w, top: 20.w),
padding: EdgeInsets.only(top: 10.h, bottom: 10.h),
color: Colors.white, color: Colors.white,
// decoration: BoxDecoration(
// color: Colors.white,
// // borderRadius: BorderRadius.circular(10.w),
// ),
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
SizedBox(width: 30.w), SizedBox(width: 30.w),
Image.asset(lockTypeIcon, width: 60.w, height: 60.w), Image.asset(lockTypeIcon, width: 60.w, height: 60.w),
SizedBox(width: 20.w), SizedBox(width: 20.w),
Expanded( SizedBox(
width: 1.sw - 30.w - 20.w - 60.w - 20.w,
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
Row( Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween, // mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[ children: <Widget>[
SizedBox( Expanded(
width: ifInvalidation.isNotEmpty child: Text(lockTypeTitle,
? 1.sw - 110.w - 100.w maxLines: 1,
: 1.sw - 110.w - 50.w, overflow: TextOverflow.ellipsis,
child: Row( style: TextStyle(
children: <Widget>[ fontSize: 24.sp, color: AppColors.blackColor)),
Flexible(
child: Text(lockTypeTitle,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 24.sp,
color: AppColors.blackColor)),
),
],
),
), ),
SizedBox(width: 10.w),
Text(ifInvalidation, Text(ifInvalidation,
style: TextStyle(fontSize: 22.sp, color: Colors.red)), style: TextStyle(fontSize: 22.sp, color: Colors.red)),
SizedBox(width: 10.w), // SizedBox(width: 10.w),
], ],
), ),
SizedBox(height: 5.h), SizedBox(height: 5.h),
@ -269,11 +259,11 @@ class _FingerprintListPageState extends State<FingerprintListPage>
), ),
], ],
), ),
SizedBox(width: 20.h), // SizedBox(width: 20.h),
], ],
), ),
), ),
SizedBox(width: 20.h), SizedBox(width: 20.w),
], ],
), ),
), ),

View File

@ -1,4 +1,3 @@
import 'dart:async'; import 'dart:async';
import 'package:flutter/scheduler.dart'; import 'package:flutter/scheduler.dart';
@ -43,7 +42,8 @@ class LockDetailLogic extends BaseGetXController {
// //
void initReplySubscription() { void initReplySubscription() {
state.replySubscription = EventBusManager().eventBus!.on<Reply>().listen((Reply reply) async { state.replySubscription =
EventBusManager().eventBus!.on<Reply>().listen((Reply reply) async {
// //
if (reply is OpenDoorReply && state.ifCurrentScreen.value == true) { if (reply is OpenDoorReply && state.ifCurrentScreen.value == true) {
_replyOpenLock(reply); _replyOpenLock(reply);
@ -179,7 +179,9 @@ class LockDetailLogic extends BaseGetXController {
} }
} }
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!;
CommonDataManage().initUserNo = state.keyInfos.value.initUserNo!; CommonDataManage().initUserNo = state.keyInfos.value.initUserNo!;
@ -187,7 +189,8 @@ class LockDetailLogic extends BaseGetXController {
state.lockUserNo = state.keyInfos.value.lockUserNo!; state.lockUserNo = state.keyInfos.value.lockUserNo!;
if (state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusWaitIneffective || if (state.keyInfos.value.keyStatus ==
XSConstantMacro.keyStatusWaitIneffective ||
state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusFrozen || state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusFrozen ||
state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusExpired || state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusExpired ||
state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusDeleted || state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusDeleted ||
@ -203,37 +206,37 @@ class LockDetailLogic extends BaseGetXController {
state.senderUserId = state.keyInfos.value.senderUserId!; state.senderUserId = state.keyInfos.value.senderUserId!;
state.isAttendance.value = state.keyInfos.value.lockSetting!.attendance!; state.isAttendance.value = state.keyInfos.value.lockSetting!.attendance!;
state.isOpenLockNeedOnline.value = state.isOpenLockNeedOnline.value =
state.keyInfos.value.lockSetting!.appUnlockOnline!; state.keyInfos.value.lockSetting!.appUnlockOnline!;
state.electricQuantity.value = state.keyInfos.value.electricQuantity!; state.electricQuantity.value = state.keyInfos.value.electricQuantity!;
state.isOpenPassageMode.value = state.keyInfos.value.passageMode!; state.isOpenPassageMode.value = state.keyInfos.value.passageMode!;
state.lockAlias.value = state.keyInfos.value.lockAlias!; state.lockAlias.value = state.keyInfos.value.lockAlias!;
Storage.setString(saveLockAlias, state.lockAlias.value); Storage.setString(saveLockAlias, state.lockAlias.value);
BlueManage().connectDeviceName = BlueManage().connectDeviceName =
state.keyInfos.value.bluetooth!.bluetoothDeviceName!; state.keyInfos.value.bluetooth!.bluetoothDeviceName!;
final List<int> publicKeyData = final List<int> publicKeyData =
state.keyInfos.value.bluetooth!.publicKey!.cast<int>(); state.keyInfos.value.bluetooth!.publicKey!.cast<int>();
final List<String> saveStrList = changeIntListToStringList(publicKeyData); final List<String> saveStrList = changeIntListToStringList(publicKeyData);
Storage.setStringList(saveBluePublicKey, saveStrList); Storage.setStringList(saveBluePublicKey, saveStrList);
// //
final List<int> privateKeyData = final List<int> privateKeyData =
state.keyInfos.value.bluetooth!.privateKey!.cast<int>(); state.keyInfos.value.bluetooth!.privateKey!.cast<int>();
final List<String> savePrivateKeyList = final List<String> savePrivateKeyList =
changeIntListToStringList(privateKeyData); changeIntListToStringList(privateKeyData);
Storage.setStringList(saveBluePrivateKey, savePrivateKeyList); Storage.setStringList(saveBluePrivateKey, savePrivateKeyList);
// signKey // signKey
final List<int> signKeyData = final List<int> signKeyData =
state.keyInfos.value.bluetooth!.signKey!.cast<int>(); state.keyInfos.value.bluetooth!.signKey!.cast<int>();
final List<String> saveSignKeyList = changeIntListToStringList(signKeyData); final List<String> saveSignKeyList = changeIntListToStringList(signKeyData);
Storage.setStringList(saveBlueSignKey, saveSignKeyList); Storage.setStringList(saveBlueSignKey, saveSignKeyList);
final bool ifHaveKey = await Storage.ifHaveKey(saveBlueToken); final bool ifHaveKey = await Storage.ifHaveKey(saveBlueToken);
if (!ifHaveKey) { if (!ifHaveKey) {
final List<String> saveTokenList = final List<String> saveTokenList =
changeIntListToStringList(<int>[0, 0, 0, 0]); changeIntListToStringList(<int>[0, 0, 0, 0]);
Storage.setStringList(saveBlueToken, saveTokenList); Storage.setStringList(saveBlueToken, saveTokenList);
} }
} }
@ -249,7 +252,9 @@ class LockDetailLogic extends BaseGetXController {
void closeLuckStatus() { void closeLuckStatus() {
state.openLockBtnState.value = 0; state.openLockBtnState.value = 0;
// state.openDoorBtnisUneable.value = true; // state.openDoorBtnisUneable.value = true;
state.animationController!.stop(canceled: true); if (state.animationController != null) {
state.animationController!.stop(canceled: true);
}
cancelBlueConnetctToastTimer(); cancelBlueConnetctToastTimer();
} }
@ -288,9 +293,9 @@ class LockDetailLogic extends BaseGetXController {
indexMap['success'] = '1'; indexMap['success'] = '1';
final int time = (0xff & indexList[3]) << 24 | final int time = (0xff & indexList[3]) << 24 |
(0xff & indexList[4]) << 16 | (0xff & indexList[4]) << 16 |
(0xff & indexList[5]) << 8 | (0xff & indexList[5]) << 8 |
(0xFF & indexList[6]); (0xFF & indexList[6]);
indexMap['date'] = '${time * 1000}'; indexMap['date'] = '${time * 1000}';
uploadList.add(indexMap); uploadList.add(indexMap);
@ -496,13 +501,14 @@ class LockDetailLogic extends BaseGetXController {
// //
Future<void> lockReportLockSuccessfullyUploadData() async { Future<void> lockReportLockSuccessfullyUploadData() async {
final KeyOperationRecordEntity entity = await ApiRepository.to.lockReportLockSuccessfullyUploadData( final KeyOperationRecordEntity entity = await ApiRepository.to
lockId: state.keyInfos.value.lockId ?? 0, .lockReportLockSuccessfullyUploadData(
keyId: state.keyInfos.value.keyId ?? 0 lockId: state.keyInfos.value.lockId ?? 0,
); keyId: state.keyInfos.value.keyId ?? 0);
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
// mockNetworkDataRequest(); // mockNetworkDataRequest();
AppLog.log('state.keyInfos.value.keyType:${state.keyInfos.value.keyType}'); AppLog.log(
'state.keyInfos.value.keyType:${state.keyInfos.value.keyType}');
if (state.keyInfos.value.keyType == XSConstantMacro.keyTypeOnce) { if (state.keyInfos.value.keyType == XSConstantMacro.keyTypeOnce) {
// //
deletKeyData(); deletKeyData();
@ -611,7 +617,6 @@ class LockDetailLogic extends BaseGetXController {
getServerDatetime(); getServerDatetime();
await PermissionDialog.request(Permission.location); await PermissionDialog.request(Permission.location);
await PermissionDialog.requestBluetooth(); await PermissionDialog.requestBluetooth();
} }
@override @override

View File

@ -1,4 +1,3 @@
import 'dart:async'; import 'dart:async';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -89,10 +88,17 @@ class _LockDetailPageState extends State<LockDetailPage>
// //
Widget xhjWidget() { Widget xhjWidget() {
final bool isShowTip = final bool isShowTip = (state.keyInfos.value.keyType ==
(state.keyInfos.value.keyType == XSConstantMacro.keyTypeTime || state.keyInfos.value.keyType == XSConstantMacro.keyTypeLoop) XSConstantMacro.keyTypeTime ||
&& (DateTool().compareTimeGetDaysFromNow(state.keyInfos.value.endDate!) <= 15 && DateTool().compareTimeGetDaysFromNow(state.keyInfos.value.endDate!) >= 0) state.keyInfos.value.keyType == XSConstantMacro.keyTypeLoop) &&
&& (state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusNormalUse || state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusWaitReceive); (DateTool().compareTimeGetDaysFromNow(state.keyInfos.value.endDate!) <=
15 &&
DateTool()
.compareTimeGetDaysFromNow(state.keyInfos.value.endDate!) >=
0) &&
(state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusNormalUse ||
state.keyInfos.value.keyStatus ==
XSConstantMacro.keyStatusWaitReceive);
return Scaffold( return Scaffold(
backgroundColor: Colors.white, backgroundColor: Colors.white,
body: Obx(() { body: Obx(() {
@ -771,9 +777,7 @@ class _LockDetailPageState extends State<LockDetailPage>
Text( Text(
state.keyInfos.value.isLockOwner == 1 state.keyInfos.value.isLockOwner == 1
? '超级管理员'.tr ? '超级管理员'.tr
: (state.keyInfos.value.keyRight == 1 : (state.keyInfos.value.keyRight == 1 ? '授权管理员'.tr : '普通用户'.tr),
? '授权管理员'.tr
: '普通用户'.tr),
style: TextStyle(fontSize: 20.sp, color: AppColors.darkGrayTextColor), 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),
@ -959,16 +963,36 @@ class _LockDetailPageState extends State<LockDetailPage>
Widget bottomWidget() { Widget bottomWidget() {
return SizedBox( return SizedBox(
width: ScreenUtil().screenWidth - 20.w, width: ScreenUtil().screenWidth,
child: GridView.count( child: GridView.builder(
crossAxisCount: 4, gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
// childAspectRatio: 3, crossAxisCount: 4,
crossAxisSpacing: 0.h, mainAxisSpacing: 0.h,
mainAxisSpacing: 0.h, crossAxisSpacing: 0.h,
shrinkWrap: true, mainAxisExtent: 90.0, // item
),
itemCount: (state.keyInfos.value.isLockOwner == 1 ||
state.keyInfos.value.keyRight == 1)
? getAllWidget().length
: getNormalWidget().length,
itemBuilder: (context, index) {
Widget widget = getBottomWidget()[index];
return widget;
},
physics: const NeverScrollableScrollPhysics(), physics: const NeverScrollableScrollPhysics(),
children: getBottomWidget()), shrinkWrap: true,
); )
// GridView.count(
// crossAxisCount: 4,
// // childAspectRatio: 3,
// crossAxisSpacing: 0.h,
// mainAxisSpacing: 0.h,
// shrinkWrap: true,
// physics: const NeverScrollableScrollPhysics(),
// children: getBottomWidget()),
);
} }
// //
@ -1004,8 +1028,8 @@ class _LockDetailPageState extends State<LockDetailPage>
// //
if (F.isSKY) { if (F.isSKY) {
showWidgetArr.add(bottomItem('images/main/icon_main_set.png', showWidgetArr
'设置'.tr, true, () { .add(bottomItem('images/main/icon_main_set.png', '设置'.tr, true, () {
Get.toNamed(Routers.lockSetPage, arguments: <String, Object?>{ Get.toNamed(Routers.lockSetPage, arguments: <String, Object?>{
'lockId': state.keyInfos.value.lockId, 'lockId': state.keyInfos.value.lockId,
'isOnlyOneData': state.isOnlyOneData 'isOnlyOneData': state.isOnlyOneData
@ -1077,9 +1101,8 @@ class _LockDetailPageState extends State<LockDetailPage>
if (state.keyInfos.value.lockFeature!.d3Face == 1) { if (state.keyInfos.value.lockFeature!.d3Face == 1) {
showWidgetArr.add( showWidgetArr.add(
bottomItem( bottomItem(
'images/main/icon_face.png', 'images/main/icon_face.png', '人脸'.tr, state.bottomBtnisEable.value,
'人脸'.tr, () {
state.bottomBtnisEable.value, () {
Get.toNamed(Routers.faceListPage, arguments: <String, int?>{ Get.toNamed(Routers.faceListPage, arguments: <String, int?>{
'lockId': state.keyInfos.value.lockId, 'lockId': state.keyInfos.value.lockId,
}); });
@ -1100,23 +1123,21 @@ class _LockDetailPageState extends State<LockDetailPage>
} }
// if (state.keyInfos.value.lockFeature!.palmVein == 1) { // if (state.keyInfos.value.lockFeature!.palmVein == 1) {
showWidgetArr.add( showWidgetArr.add(
bottomItem( bottomItem(
'images/main/icon_palm.png', '掌静脉'.tr, state.bottomBtnisEable.value, 'images/main/icon_palm.png', '掌静脉'.tr, state.bottomBtnisEable.value,
() { () {
Get.toNamed(Routers.palmListPage, arguments: <String, int?>{ Get.toNamed(Routers.palmListPage, arguments: <String, int?>{
'lockId': state.keyInfos.value.lockId, 'lockId': state.keyInfos.value.lockId,
}); });
}), }),
); );
// } // }
//-> //->
if (state.keyInfos.value.lockFeature!.videoIntercom == 1) { if (state.keyInfos.value.lockFeature!.videoIntercom == 1) {
showWidgetArr.add( showWidgetArr.add(
bottomItem( bottomItem('images/main/icon_catEyes.png', '监控'.tr,
'images/main/icon_catEyes.png',
'监控'.tr,
state.bottomBtnisEable.value, () { state.bottomBtnisEable.value, () {
Get.toNamed(Routers.realTimePicturePage, arguments: <String, Object?>{ Get.toNamed(Routers.realTimePicturePage, arguments: <String, Object?>{
'lockName': state.keyInfos.value.lockName, 'lockName': state.keyInfos.value.lockName,
@ -1128,10 +1149,8 @@ class _LockDetailPageState extends State<LockDetailPage>
// //
if (state.keyInfos.value.isLockOwner == 1) { if (state.keyInfos.value.isLockOwner == 1) {
showWidgetArr.add(bottomItem( showWidgetArr.add(bottomItem('images/main/icon_main_authorizedAdmin.png',
'images/main/icon_main_authorizedAdmin.png', '授权管理员'.tr, state.bottomBtnisEable.value, () {
'授权管理员'.tr,
state.bottomBtnisEable.value, () {
Get.toNamed(Routers.authorizedAdminListPage, Get.toNamed(Routers.authorizedAdminListPage,
arguments: <String, LockListInfoItemEntity>{ arguments: <String, LockListInfoItemEntity>{
'keyInfo': state.keyInfos.value 'keyInfo': state.keyInfos.value
@ -1155,10 +1174,8 @@ class _LockDetailPageState extends State<LockDetailPage>
if (state.keyInfos.value.lockFeature!.isSupportCatEye == 1) { if (state.keyInfos.value.lockFeature!.isSupportCatEye == 1) {
// //
endWiddget.add(bottomItem( endWiddget.add(bottomItem('images/main/icon_lockDetail_videoLog.png',
'images/main/icon_lockDetail_videoLog.png', '视频日志'.tr, state.bottomBtnisEable.value, () {
'视频日志'.tr,
state.bottomBtnisEable.value, () {
Get.toNamed(Routers.videoLogPage, arguments: <String, int?>{ Get.toNamed(Routers.videoLogPage, arguments: <String, int?>{
'lockId': state.keyInfos.value.lockId, 'lockId': state.keyInfos.value.lockId,
}); });
@ -1166,9 +1183,7 @@ class _LockDetailPageState extends State<LockDetailPage>
} }
endWiddget.add( endWiddget.add(
// //
bottomItem( bottomItem('images/main/icon_lockDetail_messageReminding.png', '消息提醒'.tr,
'images/main/icon_lockDetail_messageReminding.png',
'消息提醒'.tr,
state.bottomBtnisEable.value, () { state.bottomBtnisEable.value, () {
Get.toNamed(Routers.msgNotificationPage, arguments: <String, int?>{ Get.toNamed(Routers.msgNotificationPage, arguments: <String, int?>{
'lockId': state.keyInfos.value.lockId, 'lockId': state.keyInfos.value.lockId,
@ -1180,8 +1195,7 @@ class _LockDetailPageState extends State<LockDetailPage>
if (F.isSKY) { if (F.isSKY) {
endWiddget.add( endWiddget.add(
// //
bottomItem('images/main/icon_main_set.png', bottomItem('images/main/icon_main_set.png', '设置'.tr, true, () {
'设置'.tr, true, () {
// logic.clickItemBtnAction(10); // logic.clickItemBtnAction(10);
Get.toNamed(Routers.lockSetPage, arguments: <String, Object?>{ Get.toNamed(Routers.lockSetPage, arguments: <String, Object?>{
'lockId': state.keyInfos.value.lockId, 'lockId': state.keyInfos.value.lockId,
@ -1216,7 +1230,7 @@ class _LockDetailPageState extends State<LockDetailPage>
fit: BoxFit.fitWidth), fit: BoxFit.fitWidth),
), ),
), ),
SizedBox(height: 5.w), SizedBox(height: 5.h),
Expanded( Expanded(
child: Text(name, child: Text(name,
style: TextStyle( style: TextStyle(
@ -1230,9 +1244,10 @@ class _LockDetailPageState extends State<LockDetailPage>
), ),
xhjCall: () => Container( xhjCall: () => Container(
color: Colors.white, color: Colors.white,
padding: EdgeInsets.only(left: 3.w, right: 3.w, bottom: 5.h),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
SizedBox( SizedBox(
width: 42.w, width: 42.w,
@ -1248,12 +1263,16 @@ class _LockDetailPageState extends State<LockDetailPage>
fit: BoxFit.fitWidth), fit: BoxFit.fitWidth),
), ),
), ),
SizedBox(height: 5.h), SizedBox(height: 15.h),
Text( Text(
name, name,
// '哈水电费垃圾啊货到付款垃圾啊是老大开发机哈吉手打',
textAlign: TextAlign.center, textAlign: TextAlign.center,
maxLines: 4,
overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
fontSize: 20.sp, fontSize: 20.sp,
height: 1.0,
color: bottomBtnisEable color: bottomBtnisEable
? AppColors.blackColor ? AppColors.blackColor
: AppColors.lockDetailBottomBtnUneable), : AppColors.lockDetailBottomBtnUneable),

View File

@ -1,4 +1,3 @@
import 'dart:async'; import 'dart:async';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
@ -78,7 +77,7 @@ class LockMonitoringLogic extends BaseGetXController {
} }
/// ///
udpAnswerAction() async { Future<void> udpAnswerAction() async {
AppLog.log('点了接听么'); AppLog.log('点了接听么');
UDPSenderManage.sendMainProtocol( UDPSenderManage.sendMainProtocol(
command: 150, command: 150,
@ -177,7 +176,8 @@ class LockMonitoringLogic extends BaseGetXController {
// CallTalk().stopPlaySound(); // CallTalk().stopPlaySound();
// } // }
state.allFrames.add(frame); // state.allFrames.add(frame); //
final List<int> concatenatedFrames = concatenateFrames(state.allFrames); // final List<int> concatenatedFrames =
concatenateFrames(state.allFrames); //
AppLog.log('pcm数据:$concatenatedFrames'); AppLog.log('pcm数据:$concatenatedFrames');
final List<int> pcmBytes = listLinearToULaw(frame); final List<int> pcmBytes = listLinearToULaw(frame);

View File

@ -1,4 +1,4 @@
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:flutter_slidable/flutter_slidable.dart'; import 'package:flutter_slidable/flutter_slidable.dart';
@ -114,9 +114,10 @@ class _PasswordKeyListPageState extends State<PasswordKeyListPage>
btnName: '获取密码'.tr, btnName: '获取密码'.tr,
onClick: () async { onClick: () async {
await Get.toNamed(Routers.passwordKeyPerpetualPage, await Get.toNamed(Routers.passwordKeyPerpetualPage,
arguments: <String, LockListInfoItemEntity>{ arguments: <String, LockListInfoItemEntity>{
'keyInfo': state.keyInfo.value 'keyInfo': state.keyInfo.value
})!.then((Object? val) { })!
.then((Object? val) {
if (val != null) { if (val != null) {
getHttpData(isRefresh: true); getHttpData(isRefresh: true);
} }
@ -177,13 +178,17 @@ class _PasswordKeyListPageState extends State<PasswordKeyListPage>
), ),
], ],
), ),
child: _electronicKeyItem(index, 'images/icon_password.png', child: _electronicKeyItem(
passwordKeyListItem.keyboardPwdName!, useDateStr, () async { index,
await Get.toNamed(Routers.passwordKeyDetailPage, 'images/icon_password.png',
arguments: <String, PasswordKeyListItem>{ passwordKeyListItem.keyboardPwdName!,
useDateStr, () async {
await Get.toNamed(Routers.passwordKeyDetailPage,
arguments: <String, PasswordKeyListItem>{
'itemData': passwordKeyListItem 'itemData': passwordKeyListItem
})!.then((Object? val) { })!
getHttpData(isRefresh: true); .then((Object? val) {
getHttpData(isRefresh: true);
// if (val == 'deletScuess') { // if (val == 'deletScuess') {
// state.itemDataList.removeWhere( // state.itemDataList.removeWhere(
// (PasswordKeyListItem item) => // (PasswordKeyListItem item) =>
@ -220,8 +225,9 @@ class _PasswordKeyListPageState extends State<PasswordKeyListPage>
return GestureDetector( return GestureDetector(
onTap: action, onTap: action,
child: Container( child: Container(
height: 90.h, // height: 90.h,
// margin: EdgeInsets.only(left: 20.w, right: 20.w, top: 20.w), // margin: EdgeInsets.only(left: 20.w, right: 20.w, top: 20.w),
padding: EdgeInsets.only(top: 10.h, bottom: 10.h),
color: Colors.white, color: Colors.white,
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
@ -234,27 +240,19 @@ class _PasswordKeyListPageState extends State<PasswordKeyListPage>
SizedBox( SizedBox(
width: 20.w, width: 20.w,
), ),
Expanded( SizedBox(
width: 1.sw - 70.w - 60.w,
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
Row( Row(
children: <Widget>[ children: <Widget>[
SizedBox( Expanded(
width: passwordKeyListItem.keyboardPwdStatus == 2 || child: Text(lockTypeTitle,
passwordKeyListItem.keyboardPwdStatus == 3 maxLines: 1,
? 1.sw - 110.w - 100.w overflow: TextOverflow.ellipsis,
: 1.sw - 110.w - 50.w, style: TextStyle(
child: Row(children: <Widget>[ fontSize: 24.sp, color: AppColors.blackColor)),
Flexible(
child: Text(lockTypeTitle,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 24.sp,
color: AppColors.blackColor)),
)
]),
), ),
SizedBox(width: 10.w), SizedBox(width: 10.w),
if (passwordKeyListItem.keyboardPwdStatus == 2) if (passwordKeyListItem.keyboardPwdStatus == 2)
@ -279,8 +277,6 @@ class _PasswordKeyListPageState extends State<PasswordKeyListPage>
Flexible( Flexible(
child: Text( child: Text(
useDateStr, useDateStr,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
fontSize: 18.sp, fontSize: 18.sp,
color: AppColors.placeholderTextColor), color: AppColors.placeholderTextColor),
@ -292,7 +288,7 @@ class _PasswordKeyListPageState extends State<PasswordKeyListPage>
], ],
), ),
), ),
SizedBox(width: 20.h), SizedBox(width: 20.w),
], ],
), ),
), ),

View File

@ -1,4 +1,3 @@
import 'dart:async'; import 'dart:async';
import 'dart:io'; import 'dart:io';
import 'package:connectivity_plus/connectivity_plus.dart'; import 'package:connectivity_plus/connectivity_plus.dart';
@ -309,6 +308,7 @@ class LockMainLogic extends BaseGetXController {
await jpushProvider.initLocalNotification(isCancelLocalPush: false); await jpushProvider.initLocalNotification(isCancelLocalPush: false);
// UDP // UDP
// AppLog.log('onReady() LockMainLogic');
UdpHelp().openUDP(); UdpHelp().openUDP();
BlueManage(); BlueManage();
} }

View File

@ -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';

View File

@ -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_blue_plus/flutter_blue_plus.dart'; import 'package:flutter_blue_plus/flutter_blue_plus.dart';
@ -65,7 +64,8 @@ class _NearbyLockPageState extends State<NearbyLockPage> with RouteAware {
child: ListView.separated( child: ListView.separated(
itemCount: state.devices.length, itemCount: state.devices.length,
itemBuilder: (BuildContext c, int index) { itemBuilder: (BuildContext c, int index) {
return nearbyLockItem('images/icon_lockGroup_item.png', state.devices[index], () { return nearbyLockItem(
'images/icon_lockGroup_item.png', state.devices[index], () {
String advName = state.devices[index].advertisementData.advName; String advName = state.devices[index].advertisementData.advName;
state.selectLockName.value = advName; state.selectLockName.value = advName;
logic.getServerDatetime(); logic.getServerDatetime();

View File

@ -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';
@ -13,6 +12,7 @@ import '../../baseWidget.dart';
import '../../tools/customNetworkImage.dart'; import '../../tools/customNetworkImage.dart';
import '../../tools/submitBtn.dart'; import '../../tools/submitBtn.dart';
import '../../tools/wechat/wechatManageTool.dart'; import '../../tools/wechat/wechatManageTool.dart';
import '../../tools/wechat/wx_push_miniProgram/wx_push_miniProgram.dart';
import 'starLockMine_logic.dart'; import 'starLockMine_logic.dart';
class StarLockMinePage extends StatefulWidget { class StarLockMinePage extends StatefulWidget {
@ -43,7 +43,24 @@ class StarLockMinePageState extends State<StarLockMinePage> with BaseWidget {
topWidget(), topWidget(),
bottomListWidget(), bottomListWidget(),
SizedBox( SizedBox(
height: 40.h, height: 60.h,
),
GestureDetector(
onTap: () {
WechatManageTool.getAppInfo(() {
WxPushWeChatMiniProgramTool.pushWeChatMiniProgram(
'wxbe340095d2b8fd51');
});
},
child: Padding(
padding: EdgeInsets.only(left: 20.w, right: 20.w),
child: Image.asset(
'images/mine/icon_mine_wan_miniprogram.png',
// width: 400.w,
// height: 151.h,
fit: BoxFit.fill,
),
),
), ),
], ],
), ),
@ -152,71 +169,67 @@ class StarLockMinePageState extends State<StarLockMinePage> with BaseWidget {
} }
Widget bottomListWidget() { Widget bottomListWidget() {
return Expanded( return Container(
child: ListView(
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: 60.w, left: 60.w,
top: 50.h, top: 50.h,
), ),
children: <Widget>[ child: Column(
// mineItem('images/mine/icon_mine_main_personInfo.png', children: <Widget>[
// TranslationLoader.lanKeys!.personalInformation!.tr, () { // mineItem('images/mine/icon_mine_main_personInfo.png',
// Navigator.pushNamed(context, Routers.minePersonInfoPage); // TranslationLoader.lanKeys!.personalInformation!.tr, () {
// }), // Navigator.pushNamed(context, Routers.minePersonInfoPage);
mineItem('images/mine/icon_mine_main_addLock.png', // }),
'添加设备'.tr, () { mineItem('images/mine/icon_mine_main_addLock.png', '添加设备'.tr, () {
Get.back();
Get.toNamed(Routers.selectLockTypePage);
}),
// mineItem('images/mine/icon_mine_main_gateway.png',
// TranslationLoader.lanKeys!.gateway!.tr, () {
// Navigator.pushNamed(context, Routers.gatewayListPage);
// }),
mineItem('images/mine/icon_mine_main_message.png',
'消息'.tr, () {
Get.back();
Get.toNamed(Routers.messageListPage);
// Toast.show(msg: "功能暂未开放");
}),
//
// mineItem('images/mine/icon_mine_main_supportStaff.png',
// TranslationLoader.lanKeys!.supportStaff!.tr, () {
// Navigator.pushNamed(context, Routers.supportStaffPage);
// }),
mineItem('images/mine/icon_mine_main_set.png',
'设置'.tr, () {
Get.back();
Get.toNamed(Routers.mineSetPage);
}),
//
if (F.isLite)
Container()
else
mineItem('images/mine/icon_mine_main_vip.png', '增值服务'.tr, () {
Get.back(); Get.back();
Get.toNamed(Routers.valueAddedServicesPage); Get.toNamed(Routers.selectLockTypePage);
}), }),
if (F.isLite) // mineItem('images/mine/icon_mine_main_gateway.png',
Container() // TranslationLoader.lanKeys!.gateway!.tr, () {
else // Navigator.pushNamed(context, Routers.gatewayListPage);
mineItem('images/mine/icon_mine_main_shoppingcart.png', '配件商城'.tr, // }),
() { mineItem('images/mine/icon_mine_main_message.png', '消息'.tr, () {
Get.back(); Get.back();
Get.toNamed(Routers.lockMallPage); Get.toNamed(Routers.messageListPage);
// Toast.show(msg: "功能暂未开放");
}), }),
if (F.isSKY) //
mineItem('images/mine/icon_mine_main_shoppingcart.png', // mineItem('images/mine/icon_mine_main_supportStaff.png',
'客服'.tr, () { // TranslationLoader.lanKeys!.supportStaff!.tr, () {
// Navigator.pushNamed(context, Routers.supportStaffPage);
// }),
mineItem('images/mine/icon_mine_main_set.png', '设置'.tr, () {
Get.back(); Get.back();
WechatManageTool.getAppInfo(CustomerTool.openCustomerService); Get.toNamed(Routers.mineSetPage);
}), }),
mineItem('images/mine/icon_mine_main_about.png', '关于'.tr, () { //
Get.back(); if (F.isLite)
Get.toNamed(Routers.aboutPage); Container()
}), else
], mineItem('images/mine/icon_mine_main_vip.png', '增值服务'.tr, () {
), Get.back();
); Get.toNamed(Routers.valueAddedServicesPage);
}),
if (F.isLite)
Container()
else
mineItem('images/mine/icon_mine_main_shoppingcart.png', '配件商城'.tr,
() {
Get.back();
Get.toNamed(Routers.lockMallPage);
}),
if (F.isSKY)
mineItem('images/mine/icon_mine_main_shoppingcart.png', '客服'.tr,
() {
Get.back();
WechatManageTool.getAppInfo(CustomerTool.openCustomerService);
}),
mineItem('images/mine/icon_mine_main_about.png', '关于'.tr, () {
Get.back();
Get.toNamed(Routers.aboutPage);
}),
],
));
} }
Widget keyBottomWidget() { Widget keyBottomWidget() {

View File

@ -0,0 +1,49 @@
import 'package:fluwx/fluwx.dart';
import '../../storage.dart';
///
///
///
///
class WxPushWeChatMiniProgramTool {
static Fluwx fluwx = Fluwx();
static bool isInit = false;
static void setAssociationUrl(String associationUrl) {
Storage.saveAssociationUrl(associationUrl);
}
static Future<void> initWeChatMiniProgram(
String appId, String universalLink) async {
fluwx.registerApi(
appId: appId,
universalLink: universalLink,
doOnAndroid: true,
doOnIOS: true);
}
static Future<void> pushWeChatMiniProgram(String appId) async {
if (!isInit) {
isInit = true;
final String _associationUrl = await Storage.getAssociationUrl();
await initWeChatMiniProgram(appId, _associationUrl);
final MiniProgram miniProgram = MiniProgram(
username: 'gh_93a4493485e1', // ID
path: 'pages/index/index', //
miniProgramType: WXMiniProgramType.release, //
);
await fluwx.open(target: miniProgram);
} else {
final MiniProgram miniProgram = MiniProgram(
username: 'gh_93a4493485e1', // ID
path: 'pages/index/index', //
miniProgramType: WXMiniProgramType.release, //
);
await fluwx.open(target: miniProgram);
}
}
}

View File

@ -95,7 +95,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# 1.0.80+2024091902网关功能去掉网关通信不够16倍数凑够16倍数功能 # 1.0.80+2024091902网关功能去掉网关通信不够16倍数凑够16倍数功能
# 1.0.80+2024091902给欧阳打包测试国际化 # 1.0.80+2024091902给欧阳打包测试国际化
version: 1.0.84+2024101601 version: 1.0.84+2024111201
environment: environment:
sdk: '>=2.12.0 <3.0.0' sdk: '>=2.12.0 <3.0.0'