修复眠花糖设置闹钟无效
This commit is contained in:
@@ -6,8 +6,10 @@ import 'package:EasyDartModule/base/logger/Logger.dart';
|
||||
import 'package:EasyDartModule/base/websocket/WebSocket.dart';
|
||||
import 'package:easyweb/utils/appmanger.dart';
|
||||
import 'package:ef/ef.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
|
||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||
import 'package:fluwx/fluwx.dart';
|
||||
import 'package:get_storage/get_storage.dart';
|
||||
@@ -98,6 +100,8 @@ Future<void> main() async {
|
||||
await initLanguageSetting();
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
initServiceAddress();
|
||||
|
||||
ApiService.init();
|
||||
await GetStorage.init();
|
||||
// 初始化登录
|
||||
@@ -111,7 +115,7 @@ Future<void> main() async {
|
||||
// 检查网络
|
||||
Checknetwork.checkNetwork();
|
||||
// 微信开放平台注册
|
||||
initWX();
|
||||
await initWX();
|
||||
// // 初始化 flutter_xupdate android app 更新
|
||||
// initXUpdate();
|
||||
|
||||
@@ -124,6 +128,20 @@ Future<void> main() async {
|
||||
});
|
||||
}
|
||||
|
||||
//初始化服务器地址
|
||||
void initServiceAddress() {
|
||||
if (AppConstants().ent_type == APPPackageType.MHT.code) {
|
||||
// 眠花糖
|
||||
ServiceConstant.baseHost = "zhmht.swes.com.cn:27020";
|
||||
} else if (AppConstants().ent_type == APPPackageType.TH.code) {
|
||||
// 太和
|
||||
ServiceConstant.baseHost = "vsbst-api.he-info.com";
|
||||
} else {
|
||||
//默认
|
||||
ServiceConstant.baseHost = "vsbst-api.he-info.com";
|
||||
}
|
||||
}
|
||||
|
||||
// languageCode 系统默认语言码 en/zh
|
||||
loadLanguageSetting(String? languageCode) async {
|
||||
int code = AppConstants().ent_type;
|
||||
@@ -185,17 +203,46 @@ initLanguageSetting() async {
|
||||
}
|
||||
|
||||
// 初始化微信开放平台注册
|
||||
// Future<void> initWX() async {
|
||||
// Fluwx fluwx = Fluwx();
|
||||
// fluwx.registerApi(
|
||||
// //请填写自己的微信appid
|
||||
// // appId: "wxeb2688220799e2c5", //太和
|
||||
// appId: "wx929c548fea6af9c7", //眠花糖
|
||||
// doOnAndroid: true,
|
||||
// doOnIOS: true,
|
||||
// // universalLink: "https://app.he-info.com/theh/",
|
||||
// universalLink: "https://zhmht.swes.com.cn/app/",
|
||||
// );
|
||||
// }
|
||||
|
||||
Future<void> initWX() async {
|
||||
Fluwx fluwx = Fluwx();
|
||||
fluwx.registerApi(
|
||||
//请填写自己的微信appid
|
||||
appId: "wxeb2688220799e2c5", //太和
|
||||
// appId: "wx929c548fea6af9c7", //眠花糖
|
||||
final fluwx = Fluwx();
|
||||
|
||||
String appId = "";
|
||||
String universalLink = "";
|
||||
|
||||
if (AppConstants().ent_type == APPPackageType.MHT.code) {
|
||||
// 眠花糖
|
||||
appId = "wx929c548fea6af9c7";
|
||||
universalLink = "https://zhmht.swes.com.cn/app/";
|
||||
} else if (AppConstants().ent_type == APPPackageType.TH.code) {
|
||||
// 太和
|
||||
appId = "wxeb2688220799e2c5";
|
||||
universalLink = "https://app.he-info.com/theh/";
|
||||
} else {
|
||||
ef.log("[initWX] 未匹配到有效的包类型 ent_type=${AppConstants().ent_type}");
|
||||
return;
|
||||
}
|
||||
|
||||
await fluwx.registerApi(
|
||||
appId: appId,
|
||||
doOnAndroid: true,
|
||||
doOnIOS: true,
|
||||
universalLink: "https://app.he-info.com/theh/",
|
||||
// universalLink: "https://zhmht.swes.com.cn/app/",
|
||||
universalLink: universalLink,
|
||||
);
|
||||
|
||||
ef.log("[initWX] 微信注册完成 -> appId: $appId, link: $universalLink");
|
||||
}
|
||||
|
||||
Timer? _messageTimer;
|
||||
@@ -628,11 +675,8 @@ messageStatus() async {
|
||||
void initEasyDartModule() {
|
||||
try {
|
||||
EasyDartModule.init(
|
||||
loggerConfig:
|
||||
// LoggerConfig(host: ServiceConstant.logService, serviceName: "智慧眠花糖在线2025-10-9"),
|
||||
LoggerConfig(
|
||||
host: ServiceConstant.logService,
|
||||
serviceName: "太和e护在线2025-10-14"),
|
||||
loggerConfig: LoggerConfig(
|
||||
host: ServiceConstant.logService, serviceName: "眠花糖在线2025-10-28"),
|
||||
webSocketConfig:
|
||||
WebSocketConfig(ServiceConstant.webSocketService, (data) {
|
||||
// 接收到服务消息
|
||||
|
||||
Reference in New Issue
Block a user