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