1.新增外部的远程开锁转圈圈功能
2.取消注释的配件商城,只注释支付接口
This commit is contained in:
parent
0814fee11e
commit
377fc0619e
@ -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 =
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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 是否可以有路由可以回退,无则退出当前页面
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user