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

View File

@ -700,9 +700,14 @@ class _LockDetailPageState extends State<LockDetailPage> with TickerProviderStat
child: GestureDetector(
onTap: () {
ShowCupertinoAlertView().isToRemoteUnLockAlert(remoteUnlockAction: () {
// if (state.keyInfos.value.hasGateway != 1) {
// logic.showToast('附近没有可用网关'.tr);
// }
// wifi锁
if (state.keyInfos.value.network?.isOnline != 1 && state.keyInfos.value.hasGateway != 1) {
logic.showToast('附近没有可用网关'.tr);
return;
}
//----min
_startRemoteUnlockAnimation();
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}) {
//
if (state.animationController == null) {

View File

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