fix: 删除macos平台的依赖,桌面平台一律跳转到网页
This commit is contained in:
@@ -14,7 +14,8 @@ class KRCommonUtil {
|
||||
|
||||
/// 预热客服(提前初始化控制器)
|
||||
static void kr_warmUpCustomerService() {
|
||||
if (Platform.isAndroid || Platform.isIOS || Platform.isMacOS) {
|
||||
// 桌面端全部使用外部浏览器打开,无需预热
|
||||
if (Platform.isAndroid || Platform.isIOS) {
|
||||
if (!Get.isRegistered<KRCrispController>()) {
|
||||
Get.put(KRCrispController(), permanent: true);
|
||||
debugPrint('客服系统预热中(持久模式)...');
|
||||
@@ -38,8 +39,8 @@ class KRCommonUtil {
|
||||
return;
|
||||
}
|
||||
|
||||
// 🔧 Windows 端直接跳转外部浏览器
|
||||
if (Platform.isWindows) {
|
||||
// 🔧 桌面端(Windows/macOS/Linux)直接跳转外部浏览器
|
||||
if (Platform.isWindows || Platform.isMacOS || Platform.isLinux) {
|
||||
_kr_isOpeningCustomerService = true;
|
||||
|
||||
// 显示加载提示
|
||||
@@ -96,15 +97,6 @@ class KRCommonUtil {
|
||||
return;
|
||||
}
|
||||
|
||||
// macOS/桌面平台:跳转内置页面 (WebView 实现)
|
||||
_kr_isOpeningCustomerService = true;
|
||||
|
||||
Get.toNamed(Routes.KR_CRISP);
|
||||
|
||||
// 延迟重置状态
|
||||
Future.delayed(const Duration(seconds: 2), () {
|
||||
_kr_isOpeningCustomerService = false;
|
||||
});
|
||||
}
|
||||
|
||||
/// 提示 meesage: 提示内容, toastPosition: 提示显示的位置, timeout: 显示时间(毫秒)
|
||||
|
||||
Reference in New Issue
Block a user