1.新增外部的远程开锁转圈圈功能

2.取消注释的配件商城,只注释支付接口
This commit is contained in:
sky.min 2026-02-07 09:55:37 +08:00
parent 0814fee11e
commit 377fc0619e
3 changed files with 67 additions and 35 deletions

View File

@ -213,6 +213,9 @@ class LockDetailLogic extends BaseGetXController {
// //
await uploadElectricQuantityRequest(); await uploadElectricQuantityRequest();
//
_stopRemoteUnlockAnimation();
resetOpenDoorState(); resetOpenDoorState();
state.animationController?.stop(); state.animationController?.stop();
@ -908,6 +911,13 @@ class LockDetailLogic extends BaseGetXController {
eventBus.fire(RefreshLockDetailInfoDataEvent()); eventBus.fire(RefreshLockDetailInfoDataEvent());
} }
//
void _stopRemoteUnlockAnimation() {
state.openLockBtnState.value = 0;
state.animationController?.reset();
print("远程开锁动画已停止");
}
// /// // ///
// void requestDeviceNetworkInfo() async { // void requestDeviceNetworkInfo() async {
// final DeviceNetwork deviceNetworkInfo = // final DeviceNetwork deviceNetworkInfo =

View File

@ -700,9 +700,14 @@ class _LockDetailPageState extends State<LockDetailPage> with TickerProviderStat
child: GestureDetector( child: GestureDetector(
onTap: () { onTap: () {
ShowCupertinoAlertView().isToRemoteUnLockAlert(remoteUnlockAction: () { ShowCupertinoAlertView().isToRemoteUnLockAlert(remoteUnlockAction: () {
// if (state.keyInfos.value.hasGateway != 1) { // wifi锁
// logic.showToast('附近没有可用网关'.tr); if (state.keyInfos.value.network?.isOnline != 1 && state.keyInfos.value.hasGateway != 1) {
// } logic.showToast('附近没有可用网关'.tr);
return;
}
//----min
_startRemoteUnlockAnimation();
logic.remoteOpenLock(); logic.remoteOpenLock();
}); });
}, },
@ -851,7 +856,18 @@ class _LockDetailPageState extends State<LockDetailPage> with TickerProviderStat
); );
} }
// //
void _startRemoteUnlockAnimation() {
if (state.animationController != null) {
state.openLockBtnState.value = 1;
state.animationController?.forward();
print("启动动画控制器");
} else {
print("动画控制器为空,无法启动动画");
}
}
//
Widget buildRotationTransition({required double width, required double height}) { Widget buildRotationTransition({required double width, required double height}) {
// //
if (state.animationController == null) { if (state.animationController == null) {

View File

@ -62,41 +62,47 @@ class LockMallLogic extends BaseGetXController {
} }
} }
//webview的调用 //webview的调用()
Future<void> flutterBridge(JavaScriptMessage message) async { Future<void> flutterBridge(JavaScriptMessage message) async {
final dynamic obj = json.decode(message.message); // final dynamic obj = json.decode(message.message);
if (obj is! Map && obj['action'] is String) { // if (obj is! Map && obj['action'] is String) {
return; // return;
} // }
final String action = obj['action']; // final String action = obj['action'];
final dynamic data = obj['data']; // final dynamic data = obj['data'];
final String? callFun = obj['callFun']; // final String? callFun = obj['callFun'];
switch (action) { // switch (action) {
case 'WechatPayParams': // case 'WechatPayParams':
// // //
WechatManageTool.getAppInfo(() { // WechatManageTool.getAppInfo(() {
wxPay(data, callFun); // wxPay(data, callFun);
}); // });
// wxPay(data, callFun); // // wxPay(data, callFun);
break; // break;
} // }
//
showToast('支付功能暂未开放'.tr);
} }
// //()
Future<void> wxPay(dynamic data, String? callFun) async { Future<void> wxPay(dynamic data, String? callFun) async {
WxPayTool.pay(WxPayTool.mapToPayment(data), (WeChatResponse response) { // WxPayTool.pay(WxPayTool.mapToPayment(data), (WeChatResponse response) {
if (response is WeChatPaymentResponse) { // if (response is WeChatPaymentResponse) {
final Map data = <String, dynamic>{ // final Map data = <String, dynamic>{
'type': response.type, // 'type': response.type,
'extData': response.extData, // 'extData': response.extData,
'errCode': response.errCode, // 'errCode': response.errCode,
'errStr': response.errStr, // 'errStr': response.errStr,
}; // };
state.mallWebView.runJavaScript( // state.mallWebView.runJavaScript(
'window.$callFun(`${json.encode(data)}`)', // 'window.$callFun(`${json.encode(data)}`)',
); // );
} // }
}); // });
//
showToast('支付功能暂未开放'.tr);
} }
//webview 退退 //webview 退退