更新安卓通知栏提示
This commit is contained in:
96
android/agconnect-services.json
Normal file
96
android/agconnect-services.json
Normal file
@@ -0,0 +1,96 @@
|
|||||||
|
{
|
||||||
|
"agcgw": {
|
||||||
|
"url": "connect-drcn.dbankcloud.cn",
|
||||||
|
"backurl": "connect-drcn.hispace.hicloud.com",
|
||||||
|
"websocketurl": "connect-ws-drcn.hispace.dbankcloud.cn",
|
||||||
|
"websocketbackurl": "connect-ws-drcn.hispace.dbankcloud.com"
|
||||||
|
},
|
||||||
|
"agcgw_all": {
|
||||||
|
"SG": "connect-dra.dbankcloud.cn",
|
||||||
|
"SG_back": "connect-dra.hispace.hicloud.com",
|
||||||
|
"CN": "connect-drcn.dbankcloud.cn",
|
||||||
|
"CN_back": "connect-drcn.hispace.hicloud.com",
|
||||||
|
"RU": "connect-drru.hispace.dbankcloud.ru",
|
||||||
|
"RU_back": "connect-drru.hispace.dbankcloud.cn",
|
||||||
|
"DE": "connect-dre.dbankcloud.cn",
|
||||||
|
"DE_back": "connect-dre.hispace.hicloud.com"
|
||||||
|
},
|
||||||
|
"websocketgw_all": {
|
||||||
|
"SG": "connect-ws-dra.hispace.dbankcloud.cn",
|
||||||
|
"SG_back": "connect-ws-dra.hispace.dbankcloud.com",
|
||||||
|
"CN": "connect-ws-drcn.hispace.dbankcloud.cn",
|
||||||
|
"CN_back": "connect-ws-drcn.hispace.dbankcloud.com",
|
||||||
|
"RU": "connect-ws-drru.hispace.dbankcloud.ru",
|
||||||
|
"RU_back": "connect-ws-drru.hispace.dbankcloud.cn",
|
||||||
|
"DE": "connect-ws-dre.hispace.dbankcloud.cn",
|
||||||
|
"DE_back": "connect-ws-dre.hispace.dbankcloud.com"
|
||||||
|
},
|
||||||
|
"client": {
|
||||||
|
"cp_id": "30086000818558366",
|
||||||
|
"product_id": "461323198430218911",
|
||||||
|
"client_id": "1752291009686950144",
|
||||||
|
"client_secret": "2D92A4B951C2B074A5234F598A0E44013881695DBA64641CE8DC3C634D34F9A0",
|
||||||
|
"project_id": "461323198430218911",
|
||||||
|
"app_id": "112547949",
|
||||||
|
"api_key": "DgEDACTa5j3V2cs2rlYwcsYwsuVj29t4cw4JDcBeRG1H3YurPML3W8D5iS6whNQPnwpZTrvPZiGoRF9bDVvi/hDJSJZp+/D+T71/lw==",
|
||||||
|
"package_name": "com.taihe.mianhuatang"
|
||||||
|
},
|
||||||
|
"oauth_client": {
|
||||||
|
"client_id": "112547949",
|
||||||
|
"client_type": 1
|
||||||
|
},
|
||||||
|
"app_info": {
|
||||||
|
"app_id": "112547949",
|
||||||
|
"package_name": "com.taihe.mianhuatang"
|
||||||
|
},
|
||||||
|
"service": {
|
||||||
|
"analytics": {
|
||||||
|
"collector_url": "datacollector-drcn.dt.hicloud.com,datacollector-drcn.dt.dbankcloud.cn",
|
||||||
|
"collector_url_cn": "datacollector-drcn.dt.hicloud.com,datacollector-drcn.dt.dbankcloud.cn",
|
||||||
|
"collector_url_de": "datacollector-dre.dt.hicloud.com,datacollector-dre.dt.dbankcloud.cn",
|
||||||
|
"collector_url_ru": "datacollector-drru.dt.dbankcloud.ru,datacollector-drru.dt.hicloud.com",
|
||||||
|
"collector_url_sg": "datacollector-dra.dt.hicloud.com,datacollector-dra.dt.dbankcloud.cn",
|
||||||
|
"resource_id": "p1",
|
||||||
|
"channel_id": ""
|
||||||
|
},
|
||||||
|
"ml": {
|
||||||
|
"mlservice_url": "ml-api-drcn.ai.dbankcloud.com,ml-api-drcn.ai.dbankcloud.cn"
|
||||||
|
},
|
||||||
|
"cloudstorage": {
|
||||||
|
"storage_url": "https://agc-storage-drcn.platform.dbankcloud.cn",
|
||||||
|
"storage_url_ru": "https://agc-storage-drru.cloud.huawei.ru",
|
||||||
|
"storage_url_sg": "https://ops-dra.agcstorage.link",
|
||||||
|
"storage_url_de": "https://ops-dre.agcstorage.link",
|
||||||
|
"storage_url_cn": "https://agc-storage-drcn.platform.dbankcloud.cn",
|
||||||
|
"storage_url_ru_back": "https://agc-storage-drru.cloud.huawei.ru",
|
||||||
|
"storage_url_sg_back": "https://agc-storage-dra.cloud.huawei.asia",
|
||||||
|
"storage_url_de_back": "https://agc-storage-dre.cloud.huawei.eu",
|
||||||
|
"storage_url_cn_back": "https://agc-storage-drcn.cloud.huawei.com.cn"
|
||||||
|
},
|
||||||
|
"search": {
|
||||||
|
"url": "https://search-drcn.cloud.huawei.com"
|
||||||
|
},
|
||||||
|
"edukit": {
|
||||||
|
"edu_url": "edukit.cloud.huawei.com.cn",
|
||||||
|
"dh_url": "edukit.cloud.huawei.com.cn"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"region": "CN",
|
||||||
|
"configuration_version": "3.0",
|
||||||
|
"appInfos": [
|
||||||
|
{
|
||||||
|
"package_name": "com.taihe.mianhuatang",
|
||||||
|
"client": {
|
||||||
|
"app_id": "112547949"
|
||||||
|
},
|
||||||
|
"app_info": {
|
||||||
|
"package_name": "com.taihe.mianhuatang",
|
||||||
|
"app_id": "112547949"
|
||||||
|
},
|
||||||
|
"oauth_client": {
|
||||||
|
"client_type": 1,
|
||||||
|
"client_id": "112547949"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
96
android/app/agconnect-services.json
Normal file
96
android/app/agconnect-services.json
Normal file
@@ -0,0 +1,96 @@
|
|||||||
|
{
|
||||||
|
"agcgw": {
|
||||||
|
"url": "connect-drcn.dbankcloud.cn",
|
||||||
|
"backurl": "connect-drcn.hispace.hicloud.com",
|
||||||
|
"websocketurl": "connect-ws-drcn.hispace.dbankcloud.cn",
|
||||||
|
"websocketbackurl": "connect-ws-drcn.hispace.dbankcloud.com"
|
||||||
|
},
|
||||||
|
"agcgw_all": {
|
||||||
|
"SG": "connect-dra.dbankcloud.cn",
|
||||||
|
"SG_back": "connect-dra.hispace.hicloud.com",
|
||||||
|
"CN": "connect-drcn.dbankcloud.cn",
|
||||||
|
"CN_back": "connect-drcn.hispace.hicloud.com",
|
||||||
|
"RU": "connect-drru.hispace.dbankcloud.ru",
|
||||||
|
"RU_back": "connect-drru.hispace.dbankcloud.cn",
|
||||||
|
"DE": "connect-dre.dbankcloud.cn",
|
||||||
|
"DE_back": "connect-dre.hispace.hicloud.com"
|
||||||
|
},
|
||||||
|
"websocketgw_all": {
|
||||||
|
"SG": "connect-ws-dra.hispace.dbankcloud.cn",
|
||||||
|
"SG_back": "connect-ws-dra.hispace.dbankcloud.com",
|
||||||
|
"CN": "connect-ws-drcn.hispace.dbankcloud.cn",
|
||||||
|
"CN_back": "connect-ws-drcn.hispace.dbankcloud.com",
|
||||||
|
"RU": "connect-ws-drru.hispace.dbankcloud.ru",
|
||||||
|
"RU_back": "connect-ws-drru.hispace.dbankcloud.cn",
|
||||||
|
"DE": "connect-ws-dre.hispace.dbankcloud.cn",
|
||||||
|
"DE_back": "connect-ws-dre.hispace.dbankcloud.com"
|
||||||
|
},
|
||||||
|
"client": {
|
||||||
|
"cp_id": "30086000818558366",
|
||||||
|
"product_id": "461323198430218911",
|
||||||
|
"client_id": "1752291009686950144",
|
||||||
|
"client_secret": "2D92A4B951C2B074A5234F598A0E44013881695DBA64641CE8DC3C634D34F9A0",
|
||||||
|
"project_id": "461323198430218911",
|
||||||
|
"app_id": "112547949",
|
||||||
|
"api_key": "DgEDACTa5j3V2cs2rlYwcsYwsuVj29t4cw4JDcBeRG1H3YurPML3W8D5iS6whNQPnwpZTrvPZiGoRF9bDVvi/hDJSJZp+/D+T71/lw==",
|
||||||
|
"package_name": "com.taihe.mianhuatang"
|
||||||
|
},
|
||||||
|
"oauth_client": {
|
||||||
|
"client_id": "112547949",
|
||||||
|
"client_type": 1
|
||||||
|
},
|
||||||
|
"app_info": {
|
||||||
|
"app_id": "112547949",
|
||||||
|
"package_name": "com.taihe.mianhuatang"
|
||||||
|
},
|
||||||
|
"service": {
|
||||||
|
"analytics": {
|
||||||
|
"collector_url": "datacollector-drcn.dt.hicloud.com,datacollector-drcn.dt.dbankcloud.cn",
|
||||||
|
"collector_url_cn": "datacollector-drcn.dt.hicloud.com,datacollector-drcn.dt.dbankcloud.cn",
|
||||||
|
"collector_url_de": "datacollector-dre.dt.hicloud.com,datacollector-dre.dt.dbankcloud.cn",
|
||||||
|
"collector_url_ru": "datacollector-drru.dt.dbankcloud.ru,datacollector-drru.dt.hicloud.com",
|
||||||
|
"collector_url_sg": "datacollector-dra.dt.hicloud.com,datacollector-dra.dt.dbankcloud.cn",
|
||||||
|
"resource_id": "p1",
|
||||||
|
"channel_id": ""
|
||||||
|
},
|
||||||
|
"ml": {
|
||||||
|
"mlservice_url": "ml-api-drcn.ai.dbankcloud.com,ml-api-drcn.ai.dbankcloud.cn"
|
||||||
|
},
|
||||||
|
"cloudstorage": {
|
||||||
|
"storage_url": "https://agc-storage-drcn.platform.dbankcloud.cn",
|
||||||
|
"storage_url_ru": "https://agc-storage-drru.cloud.huawei.ru",
|
||||||
|
"storage_url_sg": "https://ops-dra.agcstorage.link",
|
||||||
|
"storage_url_de": "https://ops-dre.agcstorage.link",
|
||||||
|
"storage_url_cn": "https://agc-storage-drcn.platform.dbankcloud.cn",
|
||||||
|
"storage_url_ru_back": "https://agc-storage-drru.cloud.huawei.ru",
|
||||||
|
"storage_url_sg_back": "https://agc-storage-dra.cloud.huawei.asia",
|
||||||
|
"storage_url_de_back": "https://agc-storage-dre.cloud.huawei.eu",
|
||||||
|
"storage_url_cn_back": "https://agc-storage-drcn.cloud.huawei.com.cn"
|
||||||
|
},
|
||||||
|
"search": {
|
||||||
|
"url": "https://search-drcn.cloud.huawei.com"
|
||||||
|
},
|
||||||
|
"edukit": {
|
||||||
|
"edu_url": "edukit.cloud.huawei.com.cn",
|
||||||
|
"dh_url": "edukit.cloud.huawei.com.cn"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"region": "CN",
|
||||||
|
"configuration_version": "3.0",
|
||||||
|
"appInfos": [
|
||||||
|
{
|
||||||
|
"package_name": "com.taihe.mianhuatang",
|
||||||
|
"client": {
|
||||||
|
"app_id": "112547949"
|
||||||
|
},
|
||||||
|
"app_info": {
|
||||||
|
"package_name": "com.taihe.mianhuatang",
|
||||||
|
"app_id": "112547949"
|
||||||
|
},
|
||||||
|
"oauth_client": {
|
||||||
|
"client_type": 1,
|
||||||
|
"client_id": "112547949"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -4,6 +4,8 @@ plugins {
|
|||||||
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
|
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
|
||||||
id "dev.flutter.flutter-gradle-plugin"
|
id "dev.flutter.flutter-gradle-plugin"
|
||||||
}
|
}
|
||||||
|
//打包太和e护需要屏蔽这个插件
|
||||||
|
apply plugin: 'com.huawei.agconnect'
|
||||||
|
|
||||||
def localProperties = new Properties()
|
def localProperties = new Properties()
|
||||||
def localPropertiesFile = rootProject.file("local.properties")
|
def localPropertiesFile = rootProject.file("local.properties")
|
||||||
@@ -36,8 +38,8 @@ if (flutterVersionName == null) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
namespace = "com.taihe.vbvs_app"
|
// namespace = "com.taihe.vbvs_app"
|
||||||
// namespace = "com.taihe.mianhuatang"
|
namespace = "com.taihe.mianhuatang"
|
||||||
// compileSdk = flutter.compileSdkVersion
|
// compileSdk = flutter.compileSdkVersion
|
||||||
compileSdk = localProperties.getProperty('flutter.compileSdkVersion').toInteger()
|
compileSdk = localProperties.getProperty('flutter.compileSdkVersion').toInteger()
|
||||||
|
|
||||||
@@ -56,8 +58,8 @@ android {
|
|||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
||||||
applicationId "com.taihe.vbvs_app"
|
// applicationId "com.taihe.vbvs_app"
|
||||||
// applicationId "com.taihe.mianhuatang"
|
applicationId "com.taihe.mianhuatang"
|
||||||
// You can update the following values to match your application needs.
|
// You can update the following values to match your application needs.
|
||||||
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
|
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
|
||||||
// minSdk = flutter.minSdkVersion
|
// minSdk = flutter.minSdkVersion
|
||||||
@@ -66,6 +68,27 @@ android {
|
|||||||
targetSdk = localProperties.getProperty('flutter.targetSdkVersion').toInteger()
|
targetSdk = localProperties.getProperty('flutter.targetSdkVersion').toInteger()
|
||||||
versionCode = flutterVersionCode.toInteger()
|
versionCode = flutterVersionCode.toInteger()
|
||||||
versionName = flutterVersionName
|
versionName = flutterVersionName
|
||||||
|
|
||||||
|
ndk {
|
||||||
|
//选择要添加的对应 cpu 类型的 .so 库。
|
||||||
|
abiFilters 'armeabi', 'armeabi-v7a', 'x86', 'x86_64', 'mips', 'mips64', 'arm64-v8a'
|
||||||
|
}
|
||||||
|
|
||||||
|
manifestPlaceholders = [
|
||||||
|
JPUSH_PKGNAME : "com.taihe.mianhuatang",
|
||||||
|
JPUSH_APPKEY : "ef31d487137311ed3d63ea7d", // NOTE: JPush 上注册的包名对应的 Appkey.
|
||||||
|
JPUSH_CHANNEL : "developer-default", //暂时填写默认值即可.
|
||||||
|
XIAOMI_APPKEY : "MI-5152036593702", // 小米平台注册的appkey,注意不要将前缀去掉 MI-appkey
|
||||||
|
XIAOMI_APPID : "MI-2882303761520365702", // 小米平台注册的appid,注意不要将前缀去掉 MI-appid
|
||||||
|
VIVO_APPKEY : "a296a05be8eca520e4d44b0c6495353f",
|
||||||
|
VIVO_APPID : "105824696",
|
||||||
|
HONOR_APPID : "900905976",
|
||||||
|
OPPO_APPKEY : "OP-5233131f213a440dbdb74eb1552b9dee", // OPPO平台注册的appkey
|
||||||
|
OPPO_APPID : "OP-32509325", // OPPO平台注册的appid
|
||||||
|
OPPO_APPSECRET: "OP-ba89d834fa4248318074dd19d2f1ac92"//OPPO平台注册的appsecret
|
||||||
|
]
|
||||||
|
|
||||||
|
resValue "string", "applicationName", "com.taihe.mianhuatang.MyApplication"
|
||||||
}
|
}
|
||||||
|
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
@@ -107,3 +130,40 @@ static def releaseTime() {
|
|||||||
flutter {
|
flutter {
|
||||||
source = "../.."
|
source = "../.."
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
// implementation fileTree(dir: "libs", include: ["*.jar", "*.aar"])
|
||||||
|
// 此处以JPush 5.6.0 版本为例,注意:从 5.0.0 版本开始可以自动拉取 JCore 包,无需另外配置
|
||||||
|
implementation 'cn.jiguang.sdk:jpush:5.6.0'
|
||||||
|
|
||||||
|
//若不集成厂商通道,可直接跳过以下依赖
|
||||||
|
// 极光厂商插件版本与接入 JPush 版本保持一致,下同
|
||||||
|
// 接入华为厂商
|
||||||
|
implementation 'com.huawei.hms:push:6.13.0.300'
|
||||||
|
implementation 'cn.jiguang.sdk.plugin:huawei:5.6.0'
|
||||||
|
|
||||||
|
// 接入 FCM 厂商
|
||||||
|
implementation 'com.google.firebase:firebase-messaging:24.1.0'
|
||||||
|
implementation 'cn.jiguang.sdk.plugin:fcm:5.6.0'
|
||||||
|
|
||||||
|
// 接入 VIVO 厂商
|
||||||
|
implementation 'cn.jiguang.sdk.plugin:vivo:5.6.0'
|
||||||
|
|
||||||
|
|
||||||
|
// 接入小米厂商
|
||||||
|
implementation 'cn.jiguang.sdk.plugin:xiaomi:5.6.0'
|
||||||
|
|
||||||
|
// // 接入 OPPO 厂商
|
||||||
|
implementation 'cn.jiguang.sdk.plugin:oppo:5.6.0'
|
||||||
|
// // JPush Android SDK v4.6.0 开始,需要单独引入 oppo 厂商 aar ,请下载官网 SDK 包并把 jpush-android-xxx-release/third-push/oppo/libs 下的 aar 文件单独拷贝一份到应用 module/libs 下
|
||||||
|
implementation(name: 'com.heytap.msp_3.5.3', ext: 'aar')
|
||||||
|
// //以下为 OPPO 3.1.0 aar需要依赖
|
||||||
|
implementation 'com.google.code.gson:gson:2.10.1'
|
||||||
|
implementation 'commons-codec:commons-codec:1.6'
|
||||||
|
implementation 'androidx.annotation:annotation:1.1.0'
|
||||||
|
|
||||||
|
// 接入荣耀厂商
|
||||||
|
implementation 'cn.jiguang.sdk.plugin:honor:5.6.0'
|
||||||
|
// //需要单独引入荣耀厂商 aar ,请下载官网 SDK 包并把 jpush-android-xxx-release/third-push/honor/libs 下的 aar 文件单独拷贝一份到应用 module/libs 下
|
||||||
|
implementation(name: 'HiPushSDK-8.0.12.307', ext: 'aar')
|
||||||
|
}
|
||||||
@@ -6,7 +6,7 @@ plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
namespace = "com.taihe.vbvs_app"
|
namespace = "com.taihe.mianhuatang"
|
||||||
compileSdk = flutter.compileSdkVersion
|
compileSdk = flutter.compileSdkVersion
|
||||||
ndkVersion = flutter.ndkVersion
|
ndkVersion = flutter.ndkVersion
|
||||||
|
|
||||||
@@ -21,7 +21,7 @@ android {
|
|||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
||||||
applicationId = "com.taihe.vbvs_app"
|
applicationId = "com.taihe.mianhuatang"
|
||||||
// You can update the following values to match your application needs.
|
// You can update the following values to match your application needs.
|
||||||
// For more information, see: https://flutter.dev/to/review-gradle-config.
|
// For more information, see: https://flutter.dev/to/review-gradle-config.
|
||||||
minSdk = flutter.minSdkVersion
|
minSdk = flutter.minSdkVersion
|
||||||
|
|||||||
BIN
android/app/libs/HiPushSDK-8.0.12.307.aar
Normal file
BIN
android/app/libs/HiPushSDK-8.0.12.307.aar
Normal file
Binary file not shown.
BIN
android/app/libs/com.heytap.msp_3.5.3.aar
Normal file
BIN
android/app/libs/com.heytap.msp_3.5.3.aar
Normal file
Binary file not shown.
1
android/app/src/agconnect-services.json
Normal file
1
android/app/src/agconnect-services.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"agcgw":{"url":"connect-drcn.dbankcloud.cn","backurl":"connect-drcn.hispace.hicloud.com","websocketurl":"connect-ws-drcn.hispace.dbankcloud.cn","websocketbackurl":"connect-ws-drcn.hispace.dbankcloud.com"},"agcgw_all":{"SG":"connect-dra.dbankcloud.cn","SG_back":"connect-dra.hispace.hicloud.com","CN":"connect-drcn.dbankcloud.cn","CN_back":"connect-drcn.hispace.hicloud.com","RU":"connect-drru.hispace.dbankcloud.ru","RU_back":"connect-drru.hispace.dbankcloud.cn","DE":"connect-dre.dbankcloud.cn","DE_back":"connect-dre.hispace.hicloud.com"},"websocketgw_all":{"SG":"connect-ws-dra.hispace.dbankcloud.cn","SG_back":"connect-ws-dra.hispace.dbankcloud.com","CN":"connect-ws-drcn.hispace.dbankcloud.cn","CN_back":"connect-ws-drcn.hispace.dbankcloud.com","RU":"connect-ws-drru.hispace.dbankcloud.ru","RU_back":"connect-ws-drru.hispace.dbankcloud.cn","DE":"connect-ws-dre.hispace.dbankcloud.cn","DE_back":"connect-ws-dre.hispace.dbankcloud.com"},"client":{"cp_id":"30086000818558366","product_id":"461323198430218911","client_id":"1752291009686950144","client_secret":"2D92A4B951C2B074A5234F598A0E44013881695DBA64641CE8DC3C634D34F9A0","project_id":"461323198430218911","app_id":"112547949","api_key":"DgEDACTa5j3V2cs2rlYwcsYwsuVj29t4cw4JDcBeRG1H3YurPML3W8D5iS6whNQPnwpZTrvPZiGoRF9bDVvi/hDJSJZp+/D+T71/lw==","package_name":"com.taihe.mianhuatang"},"oauth_client":{"client_id":"112547949","client_type":1},"app_info":{"app_id":"112547949","package_name":"com.taihe.mianhuatang"},"service":{"analytics":{"collector_url":"datacollector-drcn.dt.hicloud.com,datacollector-drcn.dt.dbankcloud.cn","collector_url_cn":"datacollector-drcn.dt.hicloud.com,datacollector-drcn.dt.dbankcloud.cn","collector_url_de":"datacollector-dre.dt.hicloud.com,datacollector-dre.dt.dbankcloud.cn","collector_url_ru":"datacollector-drru.dt.dbankcloud.ru,datacollector-drru.dt.hicloud.com","collector_url_sg":"datacollector-dra.dt.hicloud.com,datacollector-dra.dt.dbankcloud.cn","resource_id":"p1","channel_id":""},"ml":{"mlservice_url":"ml-api-drcn.ai.dbankcloud.com,ml-api-drcn.ai.dbankcloud.cn"},"cloudstorage":{"storage_url":"https://agc-storage-drcn.platform.dbankcloud.cn","storage_url_ru":"https://agc-storage-drru.cloud.huawei.ru","storage_url_sg":"https://ops-dra.agcstorage.link","storage_url_de":"https://ops-dre.agcstorage.link","storage_url_cn":"https://agc-storage-drcn.platform.dbankcloud.cn","storage_url_ru_back":"https://agc-storage-drru.cloud.huawei.ru","storage_url_sg_back":"https://agc-storage-dra.cloud.huawei.asia","storage_url_de_back":"https://agc-storage-dre.cloud.huawei.eu","storage_url_cn_back":"https://agc-storage-drcn.cloud.huawei.com.cn"},"search":{"url":"https://search-drcn.cloud.huawei.com"},"edukit":{"edu_url":"edukit.cloud.huawei.com.cn","dh_url":"edukit.cloud.huawei.com.cn"}},"region":"CN","configuration_version":"3.0","appInfos":[{"package_name":"com.taihe.mianhuatang","client":{"app_id":"112547949"},"app_info":{"package_name":"com.taihe.mianhuatang","app_id":"112547949"},"oauth_client":{"client_type":1,"client_id":"112547949"}}]}
|
||||||
@@ -40,15 +40,18 @@
|
|||||||
<uses-permission android:name="android.permission.CAMERA"/>
|
<uses-permission android:name="android.permission.CAMERA"/>
|
||||||
<uses-feature android:name="android.hardware.camera" android:required="false" />
|
<uses-feature android:name="android.hardware.camera" android:required="false" />
|
||||||
|
|
||||||
|
<!-- oppo推送通知权限 -->
|
||||||
|
<uses-permission android:name="com.coloros.mcs.permission.RECIEVE_MCS_MESSAGE"/>
|
||||||
|
<uses-permission android:name="com.heytap.mcs.permission.RECIEVE_MCS_MESSAGE"/>
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:usesCleartextTraffic="true"
|
android:usesCleartextTraffic="true"
|
||||||
android:name="${applicationName}"
|
android:icon="@mipmap/ic_launchermh"
|
||||||
android:icon="@mipmap/ic_launcher"
|
android:label="智慧眠花糖"
|
||||||
android:label="太和e护"
|
|
||||||
android:enableOnBackInvokedCallback="true"
|
android:enableOnBackInvokedCallback="true"
|
||||||
>
|
>
|
||||||
<activity
|
<activity
|
||||||
android:name="com.taihe.vbvs_app.MainActivity"
|
android:name="com.taihe.mianhuatang.MainActivity"
|
||||||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
|
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.taihe.vbvs_app
|
package com.taihe.mianhuatang
|
||||||
|
|
||||||
import io.flutter.embedding.android.FlutterActivity
|
import io.flutter.embedding.android.FlutterActivity
|
||||||
|
|
||||||
|
|||||||
6
android/app/src/mcs-services.json
Normal file
6
android/app/src/mcs-services.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"developer_id": "110000095215",
|
||||||
|
"app_id": "900905976",
|
||||||
|
"package_name": "com.taihe.mianhuatang",
|
||||||
|
"version": "1.0"
|
||||||
|
}
|
||||||
@@ -8,8 +8,12 @@ allprojects {
|
|||||||
maven { url 'https://maven.aliyun.com/repository/center' }
|
maven { url 'https://maven.aliyun.com/repository/center' }
|
||||||
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
|
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
|
||||||
maven { url 'https://jitpack.io' }
|
maven { url 'https://jitpack.io' }
|
||||||
|
maven { url 'https://developer.huawei.com/repo/'}
|
||||||
google()
|
google()
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
|
flatDir {
|
||||||
|
dirs 'libs'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修复由于高版本导致namespace检测为空的问题,没遇到可不添加
|
// 修复由于高版本导致namespace检测为空的问题,没遇到可不添加
|
||||||
@@ -56,4 +60,18 @@ subprojects {
|
|||||||
|
|
||||||
tasks.register("clean", Delete) {
|
tasks.register("clean", Delete) {
|
||||||
delete rootProject.buildDir
|
delete rootProject.buildDir
|
||||||
|
}
|
||||||
|
|
||||||
|
buildscript {
|
||||||
|
repositories {
|
||||||
|
google()
|
||||||
|
mavenCentral()
|
||||||
|
maven {url 'https://developer.huawei.com/repo/'}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
buildscript {
|
||||||
|
dependencies {
|
||||||
|
classpath 'com.android.tools.build:gradle:8.2.1'
|
||||||
|
classpath 'com.huawei.agconnect:agcp:1.9.1.301'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
# 太和e护
|
# 太和e护
|
||||||
storePassword=taihe601
|
# storePassword=taihe601
|
||||||
keyPassword=taihe601
|
# keyPassword=taihe601
|
||||||
keyAlias=testalias
|
# keyAlias=testalias
|
||||||
storeFile=test.keystore
|
# storeFile=test.keystore
|
||||||
|
|
||||||
# 眠花糖
|
# 眠花糖
|
||||||
# storePassword=mht@123456
|
storePassword=mht@123456
|
||||||
# keyPassword=mht@123456
|
keyPassword=mht@123456
|
||||||
# keyAlias=mianhuatang
|
keyAlias=mianhuatang
|
||||||
# storeFile=AppKeys.jks
|
storeFile=AppKeys.jks
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
sdk.dir=C:\\Users\\wyf\\AppData\\Local\\Android\\sdk
|
sdk.dir=C:\\Users\\wyf\\AppData\\Local\\Android\\sdk
|
||||||
flutter.sdk=D:\\flutter_res\\flutter
|
flutter.sdk=D:\\flutter_res\\flutter
|
||||||
flutter.buildMode=debug
|
flutter.buildMode=release
|
||||||
flutter.versionName=1.0.0
|
flutter.versionName=1.0.0
|
||||||
flutter.versionCode=1
|
flutter.versionCode=1
|
||||||
flutter.minSdkVersion=22
|
flutter.minSdkVersion=22
|
||||||
|
|||||||
6
android/mcs-services.json
Normal file
6
android/mcs-services.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"developer_id": "110000095215",
|
||||||
|
"app_id": "900905976",
|
||||||
|
"package_name": "com.taihe.mianhuatang",
|
||||||
|
"version": "1.0"
|
||||||
|
}
|
||||||
@@ -1,2 +1,2 @@
|
|||||||
flutter.android.versionName=2.0.3
|
flutter.android.versionName=2.0.5
|
||||||
flutter.android.versionCode=8
|
flutter.android.versionCode=10
|
||||||
@@ -1,3 +1,3 @@
|
|||||||
[
|
[
|
||||||
"assets/miniapp/mhtControl_1.0.74.zip"
|
"assets/miniapp/mhtControl_1.0.83.zip"
|
||||||
]
|
]
|
||||||
@@ -624,5 +624,7 @@
|
|||||||
"最新版本": "Latest Version",
|
"最新版本": "Latest Version",
|
||||||
"升级进度": "Upgrade Progress",
|
"升级进度": "Upgrade Progress",
|
||||||
"立即升级": "Upgrade Now",
|
"立即升级": "Upgrade Now",
|
||||||
"取消升级": "Cancel Upgrade"
|
"取消升级": "Cancel Upgrade",
|
||||||
|
"通知设置": "Notification Setting",
|
||||||
|
"睡眠报告通知":"Sleep Report Notification"
|
||||||
}
|
}
|
||||||
@@ -624,5 +624,7 @@
|
|||||||
"最新版本": "最新版本",
|
"最新版本": "最新版本",
|
||||||
"升级进度": "升级进度",
|
"升级进度": "升级进度",
|
||||||
"立即升级": "立即升级",
|
"立即升级": "立即升级",
|
||||||
"取消升级": "取消升级"
|
"取消升级": "取消升级",
|
||||||
|
"通知设置": "通知设置",
|
||||||
|
"睡眠报告通知":"睡眠报告通知"
|
||||||
}
|
}
|
||||||
@@ -623,5 +623,7 @@
|
|||||||
"最新版本": "最新版本",
|
"最新版本": "最新版本",
|
||||||
"升级进度": "升級進度",
|
"升级进度": "升級進度",
|
||||||
"立即升级": "立即升級",
|
"立即升级": "立即升級",
|
||||||
"取消升级": "取消升級"
|
"取消升级": "取消升級",
|
||||||
|
"通知设置": "通知設置",
|
||||||
|
"睡眠报告通知":"睡眠報告通知"
|
||||||
}
|
}
|
||||||
Binary file not shown.
@@ -1,7 +1,7 @@
|
|||||||
class ServiceConstant {
|
class ServiceConstant {
|
||||||
// static const String baseHost = "zhmht.swes.com.cn:27021"; //服务地址 眠花糖测试地址
|
// static const String baseHost = "zhmht.swes.com.cn:27021"; //服务地址 眠花糖测试地址
|
||||||
// static const String baseHost = "zhmht.swes.com.cn:27020"; //服务地址 眠花糖正式地址
|
static const String baseHost = "zhmht.swes.com.cn:27020"; //服务地址 眠花糖正式地址
|
||||||
static const String baseHost = "vsbs-test.he-info.cn"; //服务地址 本地测试地址
|
// static const String baseHost = "vsbs-test.he-info.cn"; //服务地址 本地测试地址
|
||||||
// static const String baseHost = "vsbst-api.he-info.cn";//服务地址
|
// static const String baseHost = "vsbst-api.he-info.cn";//服务地址
|
||||||
// static const String service_address = "http://$baseHost";
|
// static const String service_address = "http://$baseHost";
|
||||||
static const String service_address = "https://$baseHost";
|
static const String service_address = "https://$baseHost";
|
||||||
@@ -53,5 +53,8 @@ class ServiceConstant {
|
|||||||
|
|
||||||
static const String weather_url =
|
static const String weather_url =
|
||||||
"/api/weather/info"; //天气信息
|
"/api/weather/info"; //天气信息
|
||||||
|
|
||||||
|
static const String app_system_push_message =
|
||||||
|
"/api/user/push/info"; //系统消息推送
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,8 +54,8 @@ class AppConstants {
|
|||||||
|
|
||||||
//系统参数
|
//系统参数
|
||||||
//运行打包APP模式
|
//运行打包APP模式
|
||||||
// int ent_type = APPPackageType.MHT.code; //1.默认太和 2.欢睡 3.眠花糖
|
int ent_type = APPPackageType.MHT.code; //1.默认太和 2.欢睡 3.眠花糖
|
||||||
int ent_type = APPPackageType.TH.code; //1.默认太和 2.欢睡 3.眠花糖
|
// int ent_type = APPPackageType.TH.code; //1.默认太和 2.欢睡 3.眠花糖
|
||||||
// int ent_type = APPPackageType.HUANSHUI.code; //1.默认太和 2.欢睡 3.眠花糖
|
// int ent_type = APPPackageType.HUANSHUI.code; //1.默认太和 2.欢睡 3.眠花糖
|
||||||
int text_length = 8;
|
int text_length = 8;
|
||||||
|
|
||||||
|
|||||||
@@ -1,66 +1,67 @@
|
|||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
import 'package:img_picker/img_picker.dart';
|
import 'package:archive/archive_io.dart';
|
||||||
import 'package:path_provider/path_provider.dart';
|
import 'package:path_provider/path_provider.dart';
|
||||||
import 'package:intl/intl.dart';
|
import 'package:intl/intl.dart';
|
||||||
|
import 'package:share_plus/share_plus.dart';
|
||||||
|
import 'dart:convert';
|
||||||
|
|
||||||
class DailyLogUtils {
|
class DailyLogUtils {
|
||||||
// 获取日志文件路径(按日期命名)
|
// 获取当天日志文件路径
|
||||||
static Future<File> _getLogFile() async {
|
static Future<File> _getLogFile() async {
|
||||||
final dir = await getApplicationDocumentsDirectory();
|
final dir = await getApplicationDocumentsDirectory();
|
||||||
final date = DateFormat('yyyy-MM-dd').format(DateTime.now());
|
final date = DateFormat('yyyy-MM-dd').format(DateTime.now());
|
||||||
final filePath = '${dir.path}/$date.log';
|
final file = File('${dir.path}/$date.log');
|
||||||
final file = File(filePath);
|
|
||||||
if (!await file.exists()) {
|
if (!await file.exists()) {
|
||||||
await file.create(recursive: true);
|
await file.create(recursive: true);
|
||||||
}
|
}
|
||||||
return file;
|
return file;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 写入日志核心方法,带日志等级
|
// 写日志核心方法,带日志等级,固定 UTF-8
|
||||||
static Future<void> _writeLogWithLevel(String level, String content) async {
|
static Future<void> _writeLogWithLevel(String level, String content) async {
|
||||||
final file = await _getLogFile();
|
final file = await _getLogFile();
|
||||||
final now = DateTime.now();
|
final now = DateTime.now();
|
||||||
final time = DateFormat('HH:mm:ss').format(now);
|
final time = DateFormat('HH:mm:ss').format(now);
|
||||||
final logLine = '[$time][$level] $content\n';
|
final logLine = '[$time][$level] $content\n';
|
||||||
await file.writeAsString(logLine, mode: FileMode.append);
|
await file.writeAsString(logLine, mode: FileMode.append, encoding: utf8);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 写入 info 日志(原 writeLog 保留)
|
// Info 日志
|
||||||
static Future<void> writeLog(String content) async {
|
static Future<void> writeLog(String content) async {
|
||||||
print("[dailylog-->info] $content]");
|
print("[dailylog-->info] $content");
|
||||||
await _writeLogWithLevel('INFO', content);
|
await _writeLogWithLevel('INFO', content);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 写入 warning 日志
|
// Warning 日志
|
||||||
static Future<void> writeWarning(String content) async {
|
static Future<void> writeWarning(String content) async {
|
||||||
print("[dailylog-->waring] $content]");
|
print("[dailylog-->warning] $content");
|
||||||
await _writeLogWithLevel('WARNING', content);
|
await _writeLogWithLevel('WARNING', content);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 写入 error 日志
|
// Error 日志
|
||||||
static Future<void> writeError(String content) async {
|
static Future<void> writeError(String content) async {
|
||||||
print("[dailylog-->error] $content]");
|
print("[dailylog-->error] $content");
|
||||||
await _writeLogWithLevel('ERROR', content);
|
await _writeLogWithLevel('ERROR', content);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 写入 debug 日志
|
// Debug 日志
|
||||||
static Future<void> writeDebug(String content) async {
|
static Future<void> writeDebug(String content) async {
|
||||||
print("[dailylog-->debug] $content]");
|
print("[dailylog-->debug] $content");
|
||||||
await _writeLogWithLevel('DEBUG', content);
|
await _writeLogWithLevel('DEBUG', content);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<void> printLog(String content) async {
|
// 读取当天日志,容错 UTF-8
|
||||||
print("logger--->" + content);
|
|
||||||
// await writeLog(content);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 读取当天日志
|
|
||||||
static Future<String> readTodayLog() async {
|
static Future<String> readTodayLog() async {
|
||||||
final file = await _getLogFile();
|
final file = await _getLogFile();
|
||||||
return await file.readAsString();
|
try {
|
||||||
|
return await file.readAsString(encoding: utf8);
|
||||||
|
} catch (e) {
|
||||||
|
final bytes = await file.readAsBytes();
|
||||||
|
return utf8.decode(bytes, allowMalformed: true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取所有日志文件(返回 File 列表)
|
// 获取所有日志文件
|
||||||
static Future<List<FileSystemEntity>> listLogFiles() async {
|
static Future<List<FileSystemEntity>> listLogFiles() async {
|
||||||
final dir = await getApplicationDocumentsDirectory();
|
final dir = await getApplicationDocumentsDirectory();
|
||||||
final files = dir.listSync();
|
final files = dir.listSync();
|
||||||
@@ -75,7 +76,7 @@ class DailyLogUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// 获取指定日期范围内的日志文件(包含起止日期)
|
// 获取指定日期范围内日志文件
|
||||||
static Future<List<File>> getLogsBetween(
|
static Future<List<File>> getLogsBetween(
|
||||||
DateTime fromDate, DateTime toDate) async {
|
DateTime fromDate, DateTime toDate) async {
|
||||||
final dir = await getApplicationDocumentsDirectory();
|
final dir = await getApplicationDocumentsDirectory();
|
||||||
@@ -85,16 +86,14 @@ class DailyLogUtils {
|
|||||||
for (DateTime date = fromDate;
|
for (DateTime date = fromDate;
|
||||||
!date.isAfter(toDate);
|
!date.isAfter(toDate);
|
||||||
date = date.add(Duration(days: 1))) {
|
date = date.add(Duration(days: 1))) {
|
||||||
final fileName = '${dateFormat.format(date)}.log';
|
final file = File('${dir.path}/${dateFormat.format(date)}.log');
|
||||||
final file = File('${dir.path}/$fileName');
|
if (await file.exists()) logFiles.add(file);
|
||||||
if (await file.exists()) {
|
|
||||||
logFiles.add(file);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return logFiles;
|
return logFiles;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 读取日期范围内日志,合并返回
|
||||||
static Future<String> readLogsByDateRange(
|
static Future<String> readLogsByDateRange(
|
||||||
DateTime fromDate, DateTime toDate) async {
|
DateTime fromDate, DateTime toDate) async {
|
||||||
try {
|
try {
|
||||||
@@ -102,43 +101,80 @@ class DailyLogUtils {
|
|||||||
final dateFormat = DateFormat('yyyy-MM-dd');
|
final dateFormat = DateFormat('yyyy-MM-dd');
|
||||||
String combinedLogs = '';
|
String combinedLogs = '';
|
||||||
|
|
||||||
// 遍历从 fromDate 到 toDate 的日期
|
|
||||||
for (DateTime date = fromDate;
|
for (DateTime date = fromDate;
|
||||||
!date.isAfter(toDate);
|
!date.isAfter(toDate);
|
||||||
date = date.add(Duration(days: 1))) {
|
date = date.add(Duration(days: 1))) {
|
||||||
final dateStr = dateFormat.format(date); // 格式化日期
|
final file = File('${dir.path}/${dateFormat.format(date)}.log');
|
||||||
final file = File('${dir.path}/$dateStr.log'); // 日志文件路径
|
|
||||||
|
|
||||||
if (await file.exists()) {
|
if (await file.exists()) {
|
||||||
final logContent = await file.readAsString();
|
String content;
|
||||||
combinedLogs += '日志日期: $dateStr\n$logContent\n\n'; // 合并日志内容
|
try {
|
||||||
|
content = await file.readAsString(encoding: utf8);
|
||||||
|
} catch (_) {
|
||||||
|
final bytes = await file.readAsBytes();
|
||||||
|
content = utf8.decode(bytes, allowMalformed: true);
|
||||||
|
}
|
||||||
|
combinedLogs += '日志日期: ${dateFormat.format(date)}\n$content\n\n';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (combinedLogs.isNotEmpty) {
|
return combinedLogs.isNotEmpty ? combinedLogs : '该时间段内没有日志记录';
|
||||||
return combinedLogs; // 返回合并后的日志
|
|
||||||
} else {
|
|
||||||
return '该时间段内没有日志记录'; // 如果没有日志
|
|
||||||
}
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return '读取日志失败: $e';
|
return '读取日志失败: $e';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 添加分享功能
|
// 导出所有日志为 zip 并分享(系统分享)
|
||||||
// static Future<void> exportLog(DateTime date) async {
|
static Future<void> exportAllLogs() async {
|
||||||
// try {
|
try {
|
||||||
// final dir = await getApplicationDocumentsDirectory();
|
final dir = await getApplicationDocumentsDirectory();
|
||||||
// final dateStr = DateFormat('yyyy-MM-dd').format(date);
|
final dateStr = DateFormat('yyyy-MM-dd_HH-mm-ss').format(DateTime.now());
|
||||||
// final file = File('${dir.path}/$dateStr.log');
|
final zipPath = '${dir.path}/logs_$dateStr.zip';
|
||||||
// if (await file.exists()) {
|
|
||||||
// await Share.shareXFiles(
|
final archive = Archive();
|
||||||
// [XFile(file.path)],
|
|
||||||
// text: '应用日志 $dateStr',
|
// 遍历日志文件
|
||||||
// );
|
final logFiles = dir
|
||||||
// }
|
.listSync()
|
||||||
// } catch (e) {
|
.whereType<File>()
|
||||||
// print('导出日志失败: $e');
|
.where((f) => f.path.endsWith('.log') && f.existsSync());
|
||||||
// }
|
|
||||||
// }
|
if (logFiles.isEmpty) {
|
||||||
|
print("没有日志文件可压缩!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (var file in logFiles) {
|
||||||
|
final name = file.path.split('/').last;
|
||||||
|
final bytes = await file.readAsBytes(); // 读取原始字节
|
||||||
|
final content =
|
||||||
|
utf8.decode(bytes, allowMalformed: true); // 转 UTF-8,允许非 UTF-8
|
||||||
|
final utf8Bytes = utf8.encode(content); // 写入压缩包
|
||||||
|
archive.addFile(ArchiveFile(name, utf8Bytes.length, utf8Bytes));
|
||||||
|
print("添加日志文件: ${file.path}, 大小: ${utf8Bytes.length}");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 写入 zip 文件
|
||||||
|
final zipData = ZipEncoder().encode(archive);
|
||||||
|
final zipFile = File(zipPath);
|
||||||
|
await zipFile.writeAsBytes(zipData!);
|
||||||
|
|
||||||
|
print("压缩包生成成功: ${zipFile.path}, 大小: ${await zipFile.length()} 字节");
|
||||||
|
|
||||||
|
// 分享
|
||||||
|
await Share.shareXFiles([XFile(zipFile.path)], text: '应用日志打包 $dateStr');
|
||||||
|
} catch (e) {
|
||||||
|
print('导出日志失败: $e');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static Future<void> printLog(String content) async {
|
||||||
|
print("logger---> $content");
|
||||||
|
// 如果你希望顺便写入 info 日志,也可以取消下面注释
|
||||||
|
// await writeLog(content);
|
||||||
|
}
|
||||||
|
|
||||||
|
static Future<String> readLogByDate(DateTime date) async {
|
||||||
|
// 调用 readLogsByDateRange,fromDate 和 toDate 都是同一天
|
||||||
|
return await readLogsByDateRange(date, date);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
196
lib/common/util/JPushUtil.dart
Normal file
196
lib/common/util/JPushUtil.dart
Normal file
@@ -0,0 +1,196 @@
|
|||||||
|
import 'dart:convert';
|
||||||
|
import 'dart:io';
|
||||||
|
|
||||||
|
import 'package:EasyDartModule/EasyDartModule.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:get_storage/get_storage.dart';
|
||||||
|
import 'package:jpush_flutter/jpush_flutter.dart';
|
||||||
|
import 'package:jpush_flutter/jpush_interface.dart';
|
||||||
|
import 'package:permission_handler/permission_handler.dart';
|
||||||
|
import 'package:vbvs_app/common/util/DailyLogUtils.dart';
|
||||||
|
import 'package:vbvs_app/common/util/NotificationRouteManager.dart';
|
||||||
|
import 'package:vbvs_app/controller/user_info_controller.dart';
|
||||||
|
|
||||||
|
class JPushUtil {
|
||||||
|
static final JPushFlutterInterface _jpush = JPush.newJPush();
|
||||||
|
static final GetStorage box = GetStorage();
|
||||||
|
|
||||||
|
/// 初始化极光推送
|
||||||
|
static Future<void> initJPush() async {
|
||||||
|
// 先申请通知权限
|
||||||
|
await _requestNotificationPermission();
|
||||||
|
|
||||||
|
// 初始化 JPush
|
||||||
|
_jpush.setup(
|
||||||
|
appKey: 'ef31d487137311ed3d63ea7d', // 替换为你在极光控制台获取的 appKey
|
||||||
|
channel: 'developer-default',
|
||||||
|
production: true,
|
||||||
|
debug: false,
|
||||||
|
);
|
||||||
|
|
||||||
|
// 获取 RegistrationID
|
||||||
|
_jpush.getRegistrationID().then((rid) {
|
||||||
|
EasyDartModule.logger.info("[消息推送]flutter get registration id: $rid");
|
||||||
|
print("flutter get registration id : $rid");
|
||||||
|
box.write('rid', rid);
|
||||||
|
});
|
||||||
|
|
||||||
|
// 添加推送消息回调
|
||||||
|
_jpush.addEventHandler(
|
||||||
|
onReceiveNotification: (Map<String, dynamic> message) async {
|
||||||
|
print("接收到通知: $message");
|
||||||
|
EasyDartModule.logger.info("[消息推送]接收到通知: $message");
|
||||||
|
},
|
||||||
|
onOpenNotification: (Map<String, dynamic> message) async {
|
||||||
|
print("通知打开: $message");
|
||||||
|
EasyDartModule.logger.info("[消息推送]通知打开: $message");
|
||||||
|
openAppRouteByNotification(message);
|
||||||
|
},
|
||||||
|
onReceiveMessage: (Map<String, dynamic> message) async {
|
||||||
|
print("接收到自定义消息: $message");
|
||||||
|
EasyDartModule.logger.info("[消息推送]接收到自定义消息: $message");
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 请求通知权限
|
||||||
|
static Future<void> _requestNotificationPermission() async {
|
||||||
|
if (Platform.isIOS) {
|
||||||
|
_jpush.applyPushAuthority(const NotificationSettingsIOS(
|
||||||
|
sound: true,
|
||||||
|
alert: true,
|
||||||
|
badge: true,
|
||||||
|
));
|
||||||
|
} else if (Platform.isAndroid) {
|
||||||
|
var status = await Permission.notification.status;
|
||||||
|
if (status.isDenied) {
|
||||||
|
await Permission.notification.request();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 根据通知跳转页面
|
||||||
|
// static Future<void> openAppRouteByNotification(
|
||||||
|
// Map<String, dynamic> message) async {
|
||||||
|
// try {
|
||||||
|
// int type = message['extras']['cn.jpush.android.EXTRA']['mType'];
|
||||||
|
// if (type == 1) {
|
||||||
|
// var person =
|
||||||
|
// jsonDecode(message['extras']['cn.jpush.android.EXTRA']['person']);
|
||||||
|
// String mac = person['mac'];
|
||||||
|
// UserInfoController userInfoController = Get.find();
|
||||||
|
|
||||||
|
// if (userInfoController.model.login == 0) {
|
||||||
|
// box.write("needSleepReport", "true");
|
||||||
|
// box.write("needSleepReport_person", person);
|
||||||
|
// box.write("needSleepReport_mac", mac);
|
||||||
|
// Get.toNamed("/loginPage");
|
||||||
|
// } else {
|
||||||
|
// Get.toNamed(
|
||||||
|
// "/newSleepReportPage",
|
||||||
|
// arguments: {
|
||||||
|
// 'mac': mac,
|
||||||
|
// 'type': 1,
|
||||||
|
// "person": person,
|
||||||
|
// 'backgroundImg': 'assets/images/new_background.png',
|
||||||
|
// 'date': DateTime.now().millisecondsSinceEpoch,
|
||||||
|
// 'person_show': false,
|
||||||
|
// 'reportPadding': false,
|
||||||
|
// },
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// } catch (e) {
|
||||||
|
// EasyDartModule.logger.error("[打开APP异常]:$e");
|
||||||
|
// DailyLogUtils.writeError("[打开APP异常]:$e");
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// static Future<void> openAppRouteByNotification(
|
||||||
|
// Map<String, dynamic> message) async {
|
||||||
|
// try {
|
||||||
|
// int type = message['extras']['cn.jpush.android.EXTRA']['mType'];
|
||||||
|
// if (type == 1) {
|
||||||
|
// var person =
|
||||||
|
// jsonDecode(message['extras']['cn.jpush.android.EXTRA']['person']);
|
||||||
|
// String mac = person['mac'];
|
||||||
|
// UserInfoController userInfoController = Get.find();
|
||||||
|
|
||||||
|
// if (userInfoController.model.login == 0) {
|
||||||
|
// // 登录状态为 0,先保存需要跳转的标记
|
||||||
|
// box.write("needSleepReport", "true");
|
||||||
|
// box.write("needSleepReport_person", person);
|
||||||
|
// box.write("needSleepReport_mac", mac);
|
||||||
|
|
||||||
|
// // 这里不要直接跳转,改为保存一个待跳转路由
|
||||||
|
// box.write("pendingRoute", {
|
||||||
|
// "route": "/loginPage",
|
||||||
|
// "arguments": null,
|
||||||
|
// });
|
||||||
|
// } else {
|
||||||
|
// // 已登录,保存跳转参数
|
||||||
|
// box.write("pendingRoute", {
|
||||||
|
// "route": "/newSleepReportPage",
|
||||||
|
// "arguments": {
|
||||||
|
// 'mac': mac,
|
||||||
|
// 'type': 1,
|
||||||
|
// "person": person,
|
||||||
|
// 'backgroundImg': 'assets/images/new_background.png',
|
||||||
|
// 'date': DateTime.now().millisecondsSinceEpoch,
|
||||||
|
// 'person_show': false,
|
||||||
|
// 'reportPadding': false,
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// } catch (e) {
|
||||||
|
// EasyDartModule.logger.error("[打开APP异常]:$e");
|
||||||
|
// DailyLogUtils.writeError("[打开APP异常]:$e");
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
static Future<void> openAppRouteByNotification(
|
||||||
|
Map<String, dynamic> message) async {
|
||||||
|
try {
|
||||||
|
int type = message['extras']['cn.jpush.android.EXTRA']['mType'];
|
||||||
|
if (type == 1) {
|
||||||
|
var person =
|
||||||
|
jsonDecode(message['extras']['cn.jpush.android.EXTRA']['person']);
|
||||||
|
String mac = person['mac'];
|
||||||
|
UserInfoController userInfoController = Get.find();
|
||||||
|
|
||||||
|
if (userInfoController.model.login == 0) {
|
||||||
|
NotificationRouteManager().box.write("needSleepReport", "true");
|
||||||
|
NotificationRouteManager()
|
||||||
|
.box
|
||||||
|
.write("needSleepReport_person", person);
|
||||||
|
NotificationRouteManager().box.write("needSleepReport_mac", mac);
|
||||||
|
|
||||||
|
NotificationRouteManager().savePendingRoute("/loginPage");
|
||||||
|
} else {
|
||||||
|
NotificationRouteManager().savePendingRoute(
|
||||||
|
"/newSleepReportPage",
|
||||||
|
arguments: {
|
||||||
|
'mac': mac,
|
||||||
|
'type': 1,
|
||||||
|
"person": person,
|
||||||
|
'backgroundImg': 'assets/images/new_background.png',
|
||||||
|
'date': DateTime.now().millisecondsSinceEpoch,
|
||||||
|
'person_show': false,
|
||||||
|
'reportPadding': false,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 如果 APP 已经在前台,立即处理跳转
|
||||||
|
NotificationRouteManager().handlePendingRoute();
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
EasyDartModule.logger.error("[打开APP异常]:$e");
|
||||||
|
DailyLogUtils.writeError("[打开APP异常]:$e");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 获取 RegistrationID
|
||||||
|
static Future<String?> getRegistrationID() async {
|
||||||
|
return await _jpush.getRegistrationID();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -20,6 +20,11 @@ LanguageController languageController = Get.find();
|
|||||||
MHLanguageController mhLanguageController = Get.find();
|
MHLanguageController mhLanguageController = Get.find();
|
||||||
|
|
||||||
class MyUtils {
|
class MyUtils {
|
||||||
|
|
||||||
|
static String formatTimestampToSleep(int milliseconds) {
|
||||||
|
final date = DateTime.fromMillisecondsSinceEpoch(milliseconds);
|
||||||
|
return "${date.year}-${date.month}-${date.day}";
|
||||||
|
}
|
||||||
static String formatDate(DateTime dateTime) {
|
static String formatDate(DateTime dateTime) {
|
||||||
return "${dateTime.year}-${dateTime.month}-${dateTime.day.toString().padLeft(2, '0')}";
|
return "${dateTime.year}-${dateTime.month}-${dateTime.day.toString().padLeft(2, '0')}";
|
||||||
}
|
}
|
||||||
|
|||||||
33
lib/common/util/NotificationRouteManager.dart
Normal file
33
lib/common/util/NotificationRouteManager.dart
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
import 'package:ef/ef.dart';
|
||||||
|
import 'package:get_storage/get_storage.dart';
|
||||||
|
|
||||||
|
/// 单例通知路由管理
|
||||||
|
class NotificationRouteManager {
|
||||||
|
static final NotificationRouteManager _instance =
|
||||||
|
NotificationRouteManager._internal();
|
||||||
|
factory NotificationRouteManager() => _instance;
|
||||||
|
NotificationRouteManager._internal();
|
||||||
|
|
||||||
|
final box = GetStorage();
|
||||||
|
|
||||||
|
/// 保存待跳转的路由
|
||||||
|
void savePendingRoute(String route, {Map<String, dynamic>? arguments}) {
|
||||||
|
box.write("pendingRoute", {
|
||||||
|
"route": route,
|
||||||
|
"arguments": arguments,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 立即尝试执行跳转(如果 GetMaterialApp 已就绪)
|
||||||
|
void handlePendingRoute() {
|
||||||
|
var pending = box.read("pendingRoute");
|
||||||
|
if (pending != null) {
|
||||||
|
String route = pending["route"];
|
||||||
|
var args = pending["arguments"];
|
||||||
|
Future.delayed(const Duration(milliseconds: 200), () {
|
||||||
|
Get.toNamed(route, arguments: args);
|
||||||
|
});
|
||||||
|
box.remove("pendingRoute");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -110,8 +110,8 @@ class BlueteethBindController extends GetControllerEx<BlueteethBindModel> {
|
|||||||
updateAll();
|
updateAll();
|
||||||
} else {
|
} else {
|
||||||
safeShowNotification(res.msg ?? "获取设备状态异常");
|
safeShowNotification(res.msg ?? "获取设备状态异常");
|
||||||
EasyDartModule.logger.info("获取设备状态异常: $res");
|
// EasyDartModule.logger.info("获取设备状态异常: $res");
|
||||||
DailyLogUtils.writeLog("获取设备状态异常: $res");
|
// DailyLogUtils.writeLog("获取设备状态异常: $res");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -122,8 +122,8 @@ class BlueteethBindController extends GetControllerEx<BlueteethBindModel> {
|
|||||||
updateAll();
|
updateAll();
|
||||||
} else {
|
} else {
|
||||||
safeShowNotification(res.msg ?? "获取设备状态异常");
|
safeShowNotification(res.msg ?? "获取设备状态异常");
|
||||||
EasyDartModule.logger.info("获取设备状态异常: $res");
|
// EasyDartModule.logger.info("获取设备状态异常: $res");
|
||||||
DailyLogUtils.writeLog("获取设备状态异常: $res");
|
// DailyLogUtils.writeLog("获取设备状态异常: $res");
|
||||||
}
|
}
|
||||||
}).catchError((e, stack) {
|
}).catchError((e, stack) {
|
||||||
print("updateDeviceStatus 执行异常: $e\n$stack");
|
print("updateDeviceStatus 执行异常: $e\n$stack");
|
||||||
@@ -140,127 +140,6 @@ class BlueteethBindController extends GetControllerEx<BlueteethBindModel> {
|
|||||||
_statusTimer = null;
|
_statusTimer = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Future<ApiResponse> updateDeviceStatus() async {
|
|
||||||
// try {
|
|
||||||
// String serviceAddress = ServiceConstant.service_address;
|
|
||||||
// String serviceName = ServiceConstant.server_service;
|
|
||||||
// String serviceApi = ServiceConstant.get_bluetooth_device_status;
|
|
||||||
// String queryUrl = "$serviceAddress$serviceName$serviceApi";
|
|
||||||
|
|
||||||
// if (model.devicelist != null && model.devicelist!.isNotEmpty) {
|
|
||||||
// final macParams = model.devicelist!
|
|
||||||
// .map((device) => "mac=${Uri.encodeQueryComponent(device.mac!)}")
|
|
||||||
// .join("&");
|
|
||||||
|
|
||||||
// if (queryUrl.contains('?')) {
|
|
||||||
// queryUrl += '&$macParams';
|
|
||||||
// } else {
|
|
||||||
// queryUrl += '?$macParams';
|
|
||||||
// }
|
|
||||||
// String? language = "";
|
|
||||||
// if (languageController.selectLanguage != null) {
|
|
||||||
// language = languageController.selectLanguage.value!.language_code;
|
|
||||||
// }
|
|
||||||
// if (language != null && language.isNotEmpty) {
|
|
||||||
// if (queryUrl.contains("?")) {
|
|
||||||
// queryUrl += "&lang=$language";
|
|
||||||
// } else {
|
|
||||||
// queryUrl += "?lang=$language";
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// var response = await EasyDartModule.dio.get(queryUrl);
|
|
||||||
// var responseData =
|
|
||||||
// response.data is String ? jsonDecode(response.data) : response.data;
|
|
||||||
// ApiResponse res =
|
|
||||||
// ApiResponse.fromJson(responseData, (object) => object);
|
|
||||||
// if (res.code != HttpStatusCodes.ok) return res;
|
|
||||||
|
|
||||||
// if (response.data['data'] != null && response.data['data'] is List) {
|
|
||||||
// List<dynamic> responseList = response.data['data'];
|
|
||||||
|
|
||||||
// // 构建 mac -> 设备的映射
|
|
||||||
// Map<String, BleDeviceData> deviceMap = {
|
|
||||||
// for (var d in model.devicelist!)
|
|
||||||
// if (d.mac != null) d.mac!.toLowerCase(): d,
|
|
||||||
// };
|
|
||||||
|
|
||||||
// // 用于记录已经设置过主从关系的 mac,避免重复
|
|
||||||
// Set<String> processedMacs = {};
|
|
||||||
|
|
||||||
// for (var item in responseList) {
|
|
||||||
// String mac = item['mac'].toLowerCase();
|
|
||||||
// String? bindMac = item['bindMac']?.toLowerCase();
|
|
||||||
// bool? bind = item['bind'];
|
|
||||||
|
|
||||||
// if (!deviceMap.containsKey(mac)) continue;
|
|
||||||
|
|
||||||
// BleDeviceData currentDevice = deviceMap[mac]!;
|
|
||||||
// currentDevice.bind = bind;
|
|
||||||
|
|
||||||
// if (bindMac != null && deviceMap.containsKey(bindMac)) {
|
|
||||||
// final isMutualBind = responseList.any((e) =>
|
|
||||||
// e['mac']?.toString().toLowerCase() == bindMac &&
|
|
||||||
// e['bindMac']?.toString().toLowerCase() == mac);
|
|
||||||
|
|
||||||
// if (isMutualBind) {
|
|
||||||
// if (processedMacs.contains(mac) ||
|
|
||||||
// processedMacs.contains(bindMac)) {
|
|
||||||
// continue;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// final masterMac = (mac.compareTo(bindMac) < 0) ? mac : bindMac;
|
|
||||||
// final slaveMac = (mac.compareTo(bindMac) < 0) ? bindMac : mac;
|
|
||||||
|
|
||||||
// if (deviceMap.containsKey(masterMac) &&
|
|
||||||
// deviceMap.containsKey(slaveMac)) {
|
|
||||||
// deviceMap[masterMac]!.slave = deviceMap[slaveMac];
|
|
||||||
// processedMacs.add(masterMac);
|
|
||||||
// processedMacs.add(slaveMac);
|
|
||||||
// }
|
|
||||||
// } else {
|
|
||||||
// if (!processedMacs.contains(mac)) {
|
|
||||||
// BleDeviceData masterDevice = deviceMap[bindMac]!;
|
|
||||||
// masterDevice.slave = currentDevice;
|
|
||||||
// processedMacs.add(mac);
|
|
||||||
// processedMacs.add(bindMac);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// // 获取所有被作为 slave 的 mac,用于排除掉
|
|
||||||
// final Set<String> allSlaveMacs = {
|
|
||||||
// for (var d in deviceMap.values)
|
|
||||||
// if (d.slave?.mac != null) d.slave!.mac!.toLowerCase()
|
|
||||||
// };
|
|
||||||
|
|
||||||
// // 构造最终列表,只保留主设备和未被作为 slave 的独立设备
|
|
||||||
// final List<BleDeviceData> finalList = deviceMap.values.where((d) {
|
|
||||||
// final mac = d.mac?.toLowerCase();
|
|
||||||
// if (mac == null) return false;
|
|
||||||
// if (d.slave != null) return true; // 主设备
|
|
||||||
// return !allSlaveMacs.contains(mac); // 不是别人 slave 的独立设备
|
|
||||||
// }).toList();
|
|
||||||
|
|
||||||
// model.betDevicelist = finalList;
|
|
||||||
// } else {
|
|
||||||
// model.betDevicelist = [];
|
|
||||||
// }
|
|
||||||
|
|
||||||
// updateAll();
|
|
||||||
// return res;
|
|
||||||
// }
|
|
||||||
// } catch (e) {
|
|
||||||
// print("获取设备状态异常: $e");
|
|
||||||
// EasyDartModule.logger.info("获取设备状态异常: $e");
|
|
||||||
// DailyLogUtils.writeLog("获取设备状态异常: $e");
|
|
||||||
// return ApiResponse(code: -1, msg: "请求失败".tr);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// return ApiResponse(code: -1, msg: "未知错误".tr);
|
|
||||||
// }
|
|
||||||
|
|
||||||
Future<ApiResponse> updateDeviceStatus() async {
|
Future<ApiResponse> updateDeviceStatus() async {
|
||||||
try {
|
try {
|
||||||
String serviceAddress = ServiceConstant.service_address;
|
String serviceAddress = ServiceConstant.service_address;
|
||||||
@@ -334,8 +213,8 @@ class BlueteethBindController extends GetControllerEx<BlueteethBindModel> {
|
|||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("获取设备状态异常: $e");
|
print("获取设备状态异常: $e");
|
||||||
EasyDartModule.logger.info("获取设备状态异常: $e");
|
// EasyDartModule.logger.info("获取设备状态异常: $e");
|
||||||
DailyLogUtils.writeLog("获取设备状态异常: $e");
|
// DailyLogUtils.writeLog("获取设备状态异常: $e");
|
||||||
return ApiResponse(code: -1, msg: "请求失败".tr);
|
return ApiResponse(code: -1, msg: "请求失败".tr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,17 +1,19 @@
|
|||||||
import 'package:ef/ef.dart';
|
import 'package:ef/ef.dart';
|
||||||
import 'package:json_annotation/json_annotation.dart';
|
import 'package:json_annotation/json_annotation.dart';
|
||||||
|
import 'package:vbvs_app/common/color/ServiceConstant.dart';
|
||||||
|
import 'package:vbvs_app/common/util/requestWithLog.dart';
|
||||||
|
|
||||||
part 'common_message_setting_controller.g.dart'; // 由json_serializable自动生成的部分
|
part 'common_message_setting_controller.g.dart'; // 由json_serializable自动生成的部分
|
||||||
|
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
class CommonMessageSettingModel {
|
class CommonMessageSettingModel {
|
||||||
int? setting = 0;//总设置 0 关闭 1 开启
|
int? setting = 0; //总设置 0 关闭 1 开启
|
||||||
int? appSetting = 0;//app消息设置
|
int? appSetting = 0; //app消息设置
|
||||||
int? serviceSetting = 0;//服务号消息
|
int? serviceSetting = 0; //服务号消息
|
||||||
int? tipSetting = 0;//设备放置说明
|
int? tipSetting = 0; //设备放置说明
|
||||||
int? deviceUpgradeSetting = 0;//设备升级提示
|
int? deviceUpgradeSetting = 0; //设备升级提示
|
||||||
int? deviceIssueSetting = 0;//设备故障提示
|
int? deviceIssueSetting = 0; //设备故障提示
|
||||||
|
int? sleepReportSetting = 0; //睡眠报告通知
|
||||||
|
|
||||||
CommonMessageSettingModel();
|
CommonMessageSettingModel();
|
||||||
|
|
||||||
@@ -30,9 +32,58 @@ class CommonMessageSettingModel {
|
|||||||
Map<String, dynamic> toJson() => _$CommonMessageSettingModelToJson(this);
|
Map<String, dynamic> toJson() => _$CommonMessageSettingModelToJson(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
class CommonMessageSettingController extends GetControllerEx<CommonMessageSettingModel> {
|
class CommonMessageSettingController
|
||||||
|
extends GetControllerEx<CommonMessageSettingModel> {
|
||||||
CommonMessageSettingController() {
|
CommonMessageSettingController() {
|
||||||
attr = GetModel(CommonMessageSettingModel()).obs;
|
attr = GetModel(CommonMessageSettingModel()).obs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> getAppSleepNotify() async {
|
||||||
|
String serviceAddress = ServiceConstant.service_address;
|
||||||
|
String serviceName = ServiceConstant.server_service;
|
||||||
|
String serviceApi = ServiceConstant.user_setting;
|
||||||
|
String type = "sleep_report_notify";
|
||||||
|
String queryUrl = "${serviceAddress}${serviceName}${serviceApi}?type=$type";
|
||||||
|
await requestWithLog(
|
||||||
|
logTitle: "查询用户睡眠通知消息配置",
|
||||||
|
method: MyHttpMethod.get,
|
||||||
|
queryUrl: queryUrl,
|
||||||
|
onSuccess: (res) {
|
||||||
|
if (res.data == null) {
|
||||||
|
model.sleepReportSetting = 1;
|
||||||
|
} else {
|
||||||
|
model.sleepReportSetting = res.data["setting"];
|
||||||
|
}
|
||||||
|
updateAll();
|
||||||
|
},
|
||||||
|
onFailure: (res) {
|
||||||
|
print(res);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> updateSleepNotify(bool val) async {
|
||||||
|
String serviceAddress = ServiceConstant.service_address;
|
||||||
|
String serviceName = ServiceConstant.server_service;
|
||||||
|
String serviceApi = ServiceConstant.user_setting;
|
||||||
|
String type = "sleep_report_notify";
|
||||||
|
String queryUrl = "${serviceAddress}${serviceName}${serviceApi}?type=$type";
|
||||||
|
var data = {
|
||||||
|
"type": type,
|
||||||
|
"setting": val == true ? 1 : 0,
|
||||||
|
"time": DateTime.now().millisecondsSinceEpoch,
|
||||||
|
};
|
||||||
|
await requestWithLog(
|
||||||
|
logTitle: "查询用户睡眠通知消息配置",
|
||||||
|
method: MyHttpMethod.put,
|
||||||
|
queryUrl: queryUrl,
|
||||||
|
data: data,
|
||||||
|
onSuccess: (res) {
|
||||||
|
updateAll();
|
||||||
|
},
|
||||||
|
onFailure: (res) {
|
||||||
|
print(res);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ import 'package:vbvs_app/enum/APPPackageType.dart';
|
|||||||
import 'package:vbvs_app/model/api_response.dart';
|
import 'package:vbvs_app/model/api_response.dart';
|
||||||
import 'package:vbvs_app/model/user_data.dart';
|
import 'package:vbvs_app/model/user_data.dart';
|
||||||
import 'package:vbvs_app/pages/mh_page/homepage/controller/mht_home_controller.dart';
|
import 'package:vbvs_app/pages/mh_page/homepage/controller/mht_home_controller.dart';
|
||||||
|
import 'package:vbvs_app/pages/mh_page/user/controller/mht_login_controller.dart';
|
||||||
|
|
||||||
part 'user_info_controller.g.dart';
|
part 'user_info_controller.g.dart';
|
||||||
|
|
||||||
@@ -241,6 +242,7 @@ class UserInfoController extends GetControllerEx<UserInfoModel> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ApiResponse logOut() {
|
ApiResponse logOut() {
|
||||||
|
updateAppSystemNotify(false);
|
||||||
int code = AppConstants().ent_type;
|
int code = AppConstants().ent_type;
|
||||||
if (APPPackageType.MHT.code == code) {
|
if (APPPackageType.MHT.code == code) {
|
||||||
MHTHomeController mhtHomeController = Get.find();
|
MHTHomeController mhtHomeController = Get.find();
|
||||||
@@ -266,6 +268,7 @@ class UserInfoController extends GetControllerEx<UserInfoModel> {
|
|||||||
messageController.model.system_message_read = 0;
|
messageController.model.system_message_read = 0;
|
||||||
CountdownController countdownController = Get.find();
|
CountdownController countdownController = Get.find();
|
||||||
countdownController.countdown.value = 0;
|
countdownController.countdown.value = 0;
|
||||||
|
|
||||||
return apiResponse;
|
return apiResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,8 +18,10 @@ import 'package:vbvs_app/common/color/appConstants.dart';
|
|||||||
import 'package:vbvs_app/common/color/app_uri_status.dart';
|
import 'package:vbvs_app/common/color/app_uri_status.dart';
|
||||||
import 'package:vbvs_app/common/util/CheckNetwork.dart';
|
import 'package:vbvs_app/common/util/CheckNetwork.dart';
|
||||||
import 'package:vbvs_app/common/util/CommonVariables.dart';
|
import 'package:vbvs_app/common/util/CommonVariables.dart';
|
||||||
|
import 'package:vbvs_app/common/util/DailyLogUtils.dart';
|
||||||
import 'package:vbvs_app/common/util/Dio.dart';
|
import 'package:vbvs_app/common/util/Dio.dart';
|
||||||
import 'package:vbvs_app/common/util/FitTool.dart';
|
import 'package:vbvs_app/common/util/FitTool.dart';
|
||||||
|
import 'package:vbvs_app/common/util/JPushUtil.dart';
|
||||||
import 'package:vbvs_app/common/util/requestWithLog.dart';
|
import 'package:vbvs_app/common/util/requestWithLog.dart';
|
||||||
import 'package:vbvs_app/controller/date/CalendarController.dart';
|
import 'package:vbvs_app/controller/date/CalendarController.dart';
|
||||||
import 'package:vbvs_app/controller/device/blueteeth_bind_controller.dart';
|
import 'package:vbvs_app/controller/device/blueteeth_bind_controller.dart';
|
||||||
@@ -187,8 +189,8 @@ Future<void> initWX() async {
|
|||||||
Fluwx fluwx = Fluwx();
|
Fluwx fluwx = Fluwx();
|
||||||
fluwx.registerApi(
|
fluwx.registerApi(
|
||||||
//请填写自己的微信appid
|
//请填写自己的微信appid
|
||||||
appId: "wxeb2688220799e2c5", //太和
|
// appId: "wxeb2688220799e2c5", //太和
|
||||||
// appId: "wx929c548fea6af9c7", //眠花糖
|
appId: "wx929c548fea6af9c7", //眠花糖
|
||||||
doOnAndroid: true,
|
doOnAndroid: true,
|
||||||
doOnIOS: true,
|
doOnIOS: true,
|
||||||
// universalLink: "https://app.he-info.com/theh/",
|
// universalLink: "https://app.he-info.com/theh/",
|
||||||
@@ -627,17 +629,21 @@ void initEasyDartModule() {
|
|||||||
try {
|
try {
|
||||||
EasyDartModule.init(
|
EasyDartModule.init(
|
||||||
loggerConfig:
|
loggerConfig:
|
||||||
LoggerConfig(host: ServiceConstant.logService, serviceName: "web"),
|
LoggerConfig(host: ServiceConstant.logService, serviceName: "智慧眠花糖在线"),
|
||||||
webSocketConfig:
|
webSocketConfig:
|
||||||
WebSocketConfig(ServiceConstant.webSocketService, (data) {
|
WebSocketConfig(ServiceConstant.webSocketService, (data) {
|
||||||
// 接收到服务消息
|
// 接收到服务消息
|
||||||
var json = jsonDecode(data);
|
var json = jsonDecode(data);
|
||||||
ef.log("[websokcet]:${json}");
|
ef.log("[websokcet]:${json}");
|
||||||
|
EasyDartModule.logger.info("[websokcet数据]:${json}");
|
||||||
|
DailyLogUtils.writeLog("[websokcet数据]:${json}");
|
||||||
if (json['wsId'] != null) {
|
if (json['wsId'] != null) {
|
||||||
ef.kvRoot.websocketId = json['wsId'];
|
ef.kvRoot.websocketId = json['wsId'];
|
||||||
}
|
}
|
||||||
if (json['code'] != null && json['code'] != 200) {
|
if (json['code'] != null && json['code'] != 200) {
|
||||||
EasyDartModule.logger.error("websocket连接失败--》" + json);
|
EasyDartModule.logger
|
||||||
|
.error("[websokcet数据]:websocket连接失败--》" + json);
|
||||||
|
DailyLogUtils.writeLog("[websokcet数据]:websocket连接失败--》" + json);
|
||||||
}
|
}
|
||||||
if (json["path"] != null) {
|
if (json["path"] != null) {
|
||||||
var call = CommonVariables.callMap[json["path"]];
|
var call = CommonVariables.callMap[json["path"]];
|
||||||
@@ -653,6 +659,8 @@ void initEasyDartModule() {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
print("未找到当前路径: ${json["path"]} 回调函数");
|
print("未找到当前路径: ${json["path"]} 回调函数");
|
||||||
|
EasyDartModule.logger.error("未找到当前路径: ${json["path"]} 回调函数");
|
||||||
|
DailyLogUtils.writeLog("未找到当前路径: ${json["path"]} 回调函数");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// print(data);
|
// print(data);
|
||||||
@@ -664,8 +672,9 @@ void initEasyDartModule() {
|
|||||||
}));
|
}));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print(e);
|
print(e);
|
||||||
|
EasyDartModule.logger.error("websocket连接失败--》:$e");
|
||||||
|
DailyLogUtils.writeLog("websocket连接失败--》:$e");
|
||||||
}
|
}
|
||||||
//初始化
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> initLogin() async {
|
Future<void> initLogin() async {
|
||||||
@@ -692,6 +701,8 @@ Future<void> initLogin() async {
|
|||||||
EasyDartModule.dio.token = null;
|
EasyDartModule.dio.token = null;
|
||||||
} else {
|
} else {
|
||||||
userInfoController.model.login = 1;
|
userInfoController.model.login = 1;
|
||||||
|
await JPushUtil.initJPush();
|
||||||
|
updateAppSystemNotify(true);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// 如果没有 token,则将用户标记为未登录
|
// 如果没有 token,则将用户标记为未登录
|
||||||
@@ -836,6 +847,7 @@ class MyApp extends StatelessWidget {
|
|||||||
Get.lazyPut(() => UserPdfController()),
|
Get.lazyPut(() => UserPdfController()),
|
||||||
Get.lazyPut(() => PrivacyPdfController()),
|
Get.lazyPut(() => PrivacyPdfController()),
|
||||||
Get.lazyPut(() => AuthBindTelController()),
|
Get.lazyPut(() => AuthBindTelController()),
|
||||||
|
Get.lazyPut(() => CommonMessageSettingController()),
|
||||||
]));
|
]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -40,14 +40,6 @@ class _InstantBodyPageState extends State<InstantBodyPage>
|
|||||||
DeviceTypeController deviceTypeController = Get.find();
|
DeviceTypeController deviceTypeController = Get.find();
|
||||||
|
|
||||||
int maxBodyMotion = 1;
|
int maxBodyMotion = 1;
|
||||||
// String breathState = "否";
|
|
||||||
// String inBed = "离床".tr;
|
|
||||||
// String onlineState = "离线".tr;
|
|
||||||
// Timer? _onlineTimer; // 添加 Timer 引用
|
|
||||||
// int bodyMotion = 0;
|
|
||||||
// int breathrate = 0;
|
|
||||||
// String snores = "否".tr;
|
|
||||||
// int heartrate = 0;
|
|
||||||
String breathState = "-";
|
String breathState = "-";
|
||||||
String inBed = "-";
|
String inBed = "-";
|
||||||
String onlineState = "离线".tr;
|
String onlineState = "离线".tr;
|
||||||
@@ -71,9 +63,22 @@ class _InstantBodyPageState extends State<InstantBodyPage>
|
|||||||
|
|
||||||
void _initWebSocket() {
|
void _initWebSocket() {
|
||||||
// 发送WebSocket请求
|
// 发送WebSocket请求
|
||||||
|
if (widget.personInfo['status'] != null) {
|
||||||
|
try {
|
||||||
|
onlineState =
|
||||||
|
widget.personInfo['status']['status'] == 1 ? "在线".tr : "离线".tr;
|
||||||
|
if (widget.personInfo['status']['status'] != 0) {
|
||||||
|
inBed = widget.personInfo['status']['inBed'] == 1 ? "在床".tr : "离床".tr;
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
edm.EasyDartModule.logger
|
||||||
|
.error("[webscoekt]格式化数据错误-->${{"mac": widget.personInfo['mac']}}");
|
||||||
|
}
|
||||||
|
}
|
||||||
edm.EasyDartModule.logger
|
edm.EasyDartModule.logger
|
||||||
.info("[webscoekt]发送请求:数据-->${{"mac": widget.personInfo['mac']}}");
|
.info("[webscoekt]发送请求:数据-->${{"mac": widget.personInfo['mac']}}");
|
||||||
DailyLogUtils.writeLog("[webscoekt]发送请求:数据-->${{"mac": widget.personInfo['mac']}}");
|
DailyLogUtils.writeLog(
|
||||||
|
"[webscoekt]发送请求:数据-->${{"mac": widget.personInfo['mac']}}");
|
||||||
edm.EasyDartModule.websocket.sendData(jsonEncode(WebSocketMessage(
|
edm.EasyDartModule.websocket.sendData(jsonEncode(WebSocketMessage(
|
||||||
path: "/vsbs/web/rt/marttress",
|
path: "/vsbs/web/rt/marttress",
|
||||||
type: 1,
|
type: 1,
|
||||||
@@ -105,10 +110,10 @@ class _InstantBodyPageState extends State<InstantBodyPage>
|
|||||||
|
|
||||||
void _startOnlineTimer() {
|
void _startOnlineTimer() {
|
||||||
_onlineTimer?.cancel(); // 取消之前的定时器
|
_onlineTimer?.cancel(); // 取消之前的定时器
|
||||||
_onlineTimer = Timer.periodic(Duration(seconds: 30), (timer) {
|
_onlineTimer = Timer.periodic(Duration(seconds: 60), (timer) {
|
||||||
if (mounted) {
|
if (mounted) {
|
||||||
setState(() {
|
setState(() {
|
||||||
edm.EasyDartModule.logger.info("30 秒内没有接收到数据,设置为离线");
|
edm.EasyDartModule.logger.info("60 秒内没有接收到数据,设置为离线");
|
||||||
onlineState = "离线".tr; // 30 秒内没有接收到数据,设置为离线
|
onlineState = "离线".tr; // 30 秒内没有接收到数据,设置为离线
|
||||||
inBed = "-";
|
inBed = "-";
|
||||||
bodyMotion = -1;
|
bodyMotion = -1;
|
||||||
@@ -124,35 +129,50 @@ class _InstantBodyPageState extends State<InstantBodyPage>
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
Map device = widget.personInfo;
|
Map device = widget.personInfo;
|
||||||
CommonVariables.callMap["/vsbs/web/rt/marttress"] = (data) {
|
try {
|
||||||
inBed = data["inBed"];
|
CommonVariables.callMap["/vsbs/web/rt/marttress"] = (data) {
|
||||||
// 心率 呼吸 体动 呼吸暂停
|
if (data['status'] == "离线") {
|
||||||
if ("离床".tr == inBed) {
|
inBed = "-";
|
||||||
breathState = "否".tr;
|
bodyMotion = -1;
|
||||||
bodyMotion = 0;
|
heartrate = -1;
|
||||||
breathrate = 0;
|
snores = "-";
|
||||||
heartrate = 0;
|
breathrate = -1;
|
||||||
snores = "否".tr;
|
breathState = "-";
|
||||||
} else {
|
return;
|
||||||
breathState = data["breathState"] == null || data["breathState"] == ""
|
}
|
||||||
? "-"
|
inBed = data["inBed"];
|
||||||
: data["breathState"].toString().tr;
|
// 心率 呼吸 体动 呼吸暂停
|
||||||
|
if ("离床".tr == inBed) {
|
||||||
bodyMotion = data['bodyMotion'] == null ? 0 : data['bodyMotion'];
|
breathState = "否".tr;
|
||||||
breathrate = data["breathRate"] == null ? 0 : data["breathRate"];
|
bodyMotion = 0;
|
||||||
heartrate = data['heartRate'] == null ? 0 : data['heartRate'];
|
breathrate = 0;
|
||||||
snores = data['snores'] == null || data['snores'] == ""
|
heartrate = 0;
|
||||||
? "否".tr
|
snores = "否".tr;
|
||||||
: data['snores'].tr;
|
} else {
|
||||||
}
|
|
||||||
|
|
||||||
if (mounted) {
|
|
||||||
setState(() {
|
|
||||||
onlineState = "在线".tr; // 接收到数据,设置为在线
|
onlineState = "在线".tr; // 接收到数据,设置为在线
|
||||||
});
|
breathState = data["breathState"] == null || data["breathState"] == ""
|
||||||
}
|
? "-"
|
||||||
_startOnlineTimer(); // 重置定时器
|
: data["breathState"].toString().tr;
|
||||||
};
|
|
||||||
|
bodyMotion = data['bodyMotion'] == null ? -1 : data['bodyMotion'];
|
||||||
|
breathrate = data["breathRate"] == null ? -1 : data["breathRate"];
|
||||||
|
heartrate = data['heartRate'] == null ? -1 : data['heartRate'];
|
||||||
|
snores =
|
||||||
|
data['snores'] == null || data['snores'] == "" ? "否".tr : "是".tr;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mounted) {
|
||||||
|
setState(() {
|
||||||
|
onlineState = "在线".tr; // 接收到数据,设置为在线
|
||||||
|
});
|
||||||
|
}
|
||||||
|
_startOnlineTimer(); // 重置定时器
|
||||||
|
};
|
||||||
|
} catch (e) {
|
||||||
|
print(e);
|
||||||
|
edm.EasyDartModule.logger
|
||||||
|
.error("[webscoekt]格式化数据错误-->${{"mac": widget.personInfo['mac']}}");
|
||||||
|
}
|
||||||
|
|
||||||
return LayoutBuilder(
|
return LayoutBuilder(
|
||||||
builder: (context, bodySize) => GestureDetector(
|
builder: (context, bodySize) => GestureDetector(
|
||||||
@@ -215,20 +235,6 @@ class _InstantBodyPageState extends State<InstantBodyPage>
|
|||||||
top: true,
|
top: true,
|
||||||
child: Stack(
|
child: Stack(
|
||||||
children: [
|
children: [
|
||||||
// 背景图只占一半高度
|
|
||||||
// Align(
|
|
||||||
// alignment: Alignment.center,
|
|
||||||
// child: SizedBox(
|
|
||||||
// height: 1000.rpx, // 你可以根据需要调整图片最大高度
|
|
||||||
// width: 1000.rpx, // 或设置 double.infinity 占满宽度
|
|
||||||
// child: Image.asset(
|
|
||||||
// (onlineState == "离线".tr || inBed == '离床'.tr)
|
|
||||||
// ? 'assets/img/black_body_still.png'
|
|
||||||
// : 'assets/img/body_black.gif',
|
|
||||||
// fit: BoxFit.contain, // 保持原始比例,不拉伸
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
Align(
|
Align(
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
child: FractionallySizedBox(
|
child: FractionallySizedBox(
|
||||||
@@ -435,16 +441,6 @@ class _InstantBodyPageState extends State<InstantBodyPage>
|
|||||||
padding: EdgeInsetsDirectional.fromSTEB(
|
padding: EdgeInsetsDirectional.fromSTEB(
|
||||||
30.rpx, 0, 30.rpx, 0),
|
30.rpx, 0, 30.rpx, 0),
|
||||||
child: Container(
|
child: Container(
|
||||||
// decoration: BoxDecoration(
|
|
||||||
// image: DecorationImage(
|
|
||||||
// image: AssetImage(
|
|
||||||
// onlineState == "离线".tr
|
|
||||||
// ? 'assets/img/black_body_still.png' // 静态图
|
|
||||||
// : 'assets/img/body_black.gif', // 动图
|
|
||||||
// ),
|
|
||||||
// fit: BoxFit.cover,
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Row(
|
Row(
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import 'package:flutter_svg/svg.dart';
|
|||||||
import 'package:flutterflow_ui/flutterflow_ui.dart';
|
import 'package:flutterflow_ui/flutterflow_ui.dart';
|
||||||
import 'package:vbvs_app/common/color/ServiceConstant.dart';
|
import 'package:vbvs_app/common/color/ServiceConstant.dart';
|
||||||
import 'package:vbvs_app/common/color/appConstants.dart';
|
import 'package:vbvs_app/common/color/appConstants.dart';
|
||||||
|
import 'package:vbvs_app/common/util/DailyLogUtils.dart';
|
||||||
import 'package:vbvs_app/common/util/FitTool.dart';
|
import 'package:vbvs_app/common/util/FitTool.dart';
|
||||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||||
import 'package:vbvs_app/common/util/requestWithLog.dart';
|
import 'package:vbvs_app/common/util/requestWithLog.dart';
|
||||||
@@ -23,6 +24,7 @@ import 'package:vbvs_app/controller/user_info_controller.dart';
|
|||||||
import 'package:vbvs_app/model/BleDeviceData.dart';
|
import 'package:vbvs_app/model/BleDeviceData.dart';
|
||||||
import 'package:vbvs_app/pages/device_bind/blueteeth_device_page.dart';
|
import 'package:vbvs_app/pages/device_bind/blueteeth_device_page.dart';
|
||||||
import 'package:vbvs_app/pages/device_bind/componnet/bind_dialog.dart';
|
import 'package:vbvs_app/pages/device_bind/componnet/bind_dialog.dart';
|
||||||
|
import 'package:EasyDartModule/EasyDartModule.dart' as edm;
|
||||||
|
|
||||||
class AfterWifiPagePerson extends StatefulWidget {
|
class AfterWifiPagePerson extends StatefulWidget {
|
||||||
var type;
|
var type;
|
||||||
@@ -118,24 +120,24 @@ class _AfterWifiPagePersonState extends State<AfterWifiPagePerson> {
|
|||||||
return SizedBox(
|
return SizedBox(
|
||||||
width: 24.rpx,
|
width: 24.rpx,
|
||||||
height: 24.rpx,
|
height: 24.rpx,
|
||||||
child:CircularProgressIndicator(
|
child: CircularProgressIndicator(
|
||||||
strokeWidth: 2,
|
strokeWidth: 2,
|
||||||
valueColor: AlwaysStoppedAnimation<Color>(
|
valueColor: AlwaysStoppedAnimation<Color>(
|
||||||
themeController.currentColor.sc1,
|
themeController.currentColor.sc1,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (blueteethBindController.netType.value == 0) {
|
if (blueteethBindController.netType.value == 0) {
|
||||||
return SizedBox(
|
return SizedBox(
|
||||||
width: 24.rpx,
|
width: 24.rpx,
|
||||||
height: 24.rpx,
|
height: 24.rpx,
|
||||||
child:CircularProgressIndicator(
|
child: CircularProgressIndicator(
|
||||||
strokeWidth: 2,
|
strokeWidth: 2,
|
||||||
valueColor: AlwaysStoppedAnimation<Color>(
|
valueColor: AlwaysStoppedAnimation<Color>(
|
||||||
themeController.currentColor.sc1,
|
themeController.currentColor.sc1,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (blueteethBindController.wifiConnectStatus.value ==
|
if (blueteethBindController.wifiConnectStatus.value ==
|
||||||
@@ -143,12 +145,12 @@ class _AfterWifiPagePersonState extends State<AfterWifiPagePerson> {
|
|||||||
return SizedBox(
|
return SizedBox(
|
||||||
width: 24.rpx,
|
width: 24.rpx,
|
||||||
height: 24.rpx,
|
height: 24.rpx,
|
||||||
child:CircularProgressIndicator(
|
child: CircularProgressIndicator(
|
||||||
strokeWidth: 2,
|
strokeWidth: 2,
|
||||||
valueColor: AlwaysStoppedAnimation<Color>(
|
valueColor: AlwaysStoppedAnimation<Color>(
|
||||||
themeController.currentColor.sc1,
|
themeController.currentColor.sc1,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return Container();
|
return Container();
|
||||||
@@ -638,12 +640,16 @@ class _AfterWifiPagePersonState extends State<AfterWifiPagePerson> {
|
|||||||
width: 32.rpx,
|
width: 32.rpx,
|
||||||
height: 32.rpx,
|
height: 32.rpx,
|
||||||
child:
|
child:
|
||||||
CircularProgressIndicator(
|
CircularProgressIndicator(
|
||||||
strokeWidth: 2,
|
strokeWidth: 2,
|
||||||
valueColor: AlwaysStoppedAnimation<Color>(
|
valueColor:
|
||||||
themeController.currentColor.sc1,
|
AlwaysStoppedAnimation<
|
||||||
),
|
Color>(
|
||||||
),
|
themeController
|
||||||
|
.currentColor
|
||||||
|
.sc1,
|
||||||
|
),
|
||||||
|
),
|
||||||
)
|
)
|
||||||
else
|
else
|
||||||
getWifiIconByRsso(
|
getWifiIconByRsso(
|
||||||
@@ -835,6 +841,8 @@ class _AfterWifiPagePersonState extends State<AfterWifiPagePerson> {
|
|||||||
if (onData.status == BleEventType.recvLineLog) {
|
if (onData.status == BleEventType.recvLineLog) {
|
||||||
final line = onData.val;
|
final line = onData.val;
|
||||||
print("[bleee]:" + line);
|
print("[bleee]:" + line);
|
||||||
|
edm.EasyDartModule.logger.info("[bleee]:" + line);
|
||||||
|
DailyLogUtils.writeLog("[bleee]:" + line);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -980,6 +988,8 @@ class _AfterWifiPagePersonState extends State<AfterWifiPagePerson> {
|
|||||||
if (onData.status == BleEventType.recvLineLog) {
|
if (onData.status == BleEventType.recvLineLog) {
|
||||||
final line = onData.val;
|
final line = onData.val;
|
||||||
print("[bleee]:" + line);
|
print("[bleee]:" + line);
|
||||||
|
edm.EasyDartModule.logger.info("[bleee]:" + line);
|
||||||
|
DailyLogUtils.writeLog("[bleee]:" + line);
|
||||||
}
|
}
|
||||||
if (onData.status == BleEventType.ready) {
|
if (onData.status == BleEventType.ready) {
|
||||||
aa = await getDeviceNetVersion(
|
aa = await getDeviceNetVersion(
|
||||||
|
|||||||
@@ -172,24 +172,29 @@ class _BlueteethDevicePageState extends State<BlueteethDevicePage> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 显示权限被拒绝的提示
|
// 显示权限被拒绝的提示
|
||||||
|
// void _showPermissionDeniedDialog(BuildContext context) {
|
||||||
|
// showDialog(
|
||||||
|
// context: context,
|
||||||
|
// builder: (BuildContext context) {
|
||||||
|
// return AlertDialog(
|
||||||
|
// title: Text("权限提示".tr),
|
||||||
|
// content: Text("应用需要蓝牙和位置权限才能扫描设备。请授予权限。".tr),
|
||||||
|
// actions: [
|
||||||
|
// TextButton(
|
||||||
|
// onPressed: () {
|
||||||
|
// Navigator.of(context).pop();
|
||||||
|
// },
|
||||||
|
// child: Text("确定".tr),
|
||||||
|
// ),
|
||||||
|
// ],
|
||||||
|
// );
|
||||||
|
// },
|
||||||
|
// );
|
||||||
|
// }
|
||||||
void _showPermissionDeniedDialog(BuildContext context) {
|
void _showPermissionDeniedDialog(BuildContext context) {
|
||||||
showDialog(
|
TopSlideNotification.show(context,
|
||||||
context: context,
|
text: "应用需要蓝牙和位置权限才能扫描设备。请授予权限。".tr,
|
||||||
builder: (BuildContext context) {
|
textColor: themeController.currentColor.sc9);
|
||||||
return AlertDialog(
|
|
||||||
title: Text("权限提示".tr),
|
|
||||||
content: Text("应用需要蓝牙和位置权限才能扫描设备。请授予权限。".tr),
|
|
||||||
actions: [
|
|
||||||
TextButton(
|
|
||||||
onPressed: () {
|
|
||||||
Navigator.of(context).pop();
|
|
||||||
},
|
|
||||||
child: Text("确定".tr),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 开始扫描蓝牙设备
|
// 开始扫描蓝牙设备
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import 'package:flutter_svg/svg.dart';
|
|||||||
import 'package:flutterflow_ui/flutterflow_ui.dart';
|
import 'package:flutterflow_ui/flutterflow_ui.dart';
|
||||||
import 'package:vbvs_app/common/color/ServiceConstant.dart';
|
import 'package:vbvs_app/common/color/ServiceConstant.dart';
|
||||||
import 'package:vbvs_app/common/color/appConstants.dart';
|
import 'package:vbvs_app/common/color/appConstants.dart';
|
||||||
|
import 'package:vbvs_app/common/util/DailyLogUtils.dart';
|
||||||
import 'package:vbvs_app/common/util/FitTool.dart';
|
import 'package:vbvs_app/common/util/FitTool.dart';
|
||||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||||
import 'package:vbvs_app/common/util/requestWithLog.dart';
|
import 'package:vbvs_app/common/util/requestWithLog.dart';
|
||||||
@@ -23,6 +24,7 @@ import 'package:vbvs_app/controller/user_info_controller.dart';
|
|||||||
import 'package:vbvs_app/model/BleDeviceData.dart';
|
import 'package:vbvs_app/model/BleDeviceData.dart';
|
||||||
import 'package:vbvs_app/pages/device_bind/blueteeth_device_page.dart';
|
import 'package:vbvs_app/pages/device_bind/blueteeth_device_page.dart';
|
||||||
import 'package:vbvs_app/pages/device_bind/componnet/bind_dialog.dart';
|
import 'package:vbvs_app/pages/device_bind/componnet/bind_dialog.dart';
|
||||||
|
import 'package:EasyDartModule/EasyDartModule.dart' as edm;
|
||||||
|
|
||||||
class WifiPage extends StatefulWidget {
|
class WifiPage extends StatefulWidget {
|
||||||
var type; //为空,首次绑定 不为空,从设备列表进入
|
var type; //为空,首次绑定 不为空,从设备列表进入
|
||||||
@@ -64,6 +66,8 @@ class _WifiPageState extends State<WifiPage> {
|
|||||||
if (onData.status == BleEventType.recvLineLog) {
|
if (onData.status == BleEventType.recvLineLog) {
|
||||||
final line = onData.val;
|
final line = onData.val;
|
||||||
print("[bleee]:" + line);
|
print("[bleee]:" + line);
|
||||||
|
edm.EasyDartModule.logger.info("[bleee]:" + line);
|
||||||
|
DailyLogUtils.writeLog("[bleee]:" + line);
|
||||||
}
|
}
|
||||||
if (onData.status == BleEventType.ready) {
|
if (onData.status == BleEventType.ready) {
|
||||||
aa = await getDeviceNetVersion(
|
aa = await getDeviceNetVersion(
|
||||||
@@ -880,6 +884,8 @@ class _WifiPageState extends State<WifiPage> {
|
|||||||
if (onData.status == BleEventType.recvLineLog) {
|
if (onData.status == BleEventType.recvLineLog) {
|
||||||
final line = onData.val;
|
final line = onData.val;
|
||||||
print("[bleee]:" + line);
|
print("[bleee]:" + line);
|
||||||
|
edm.EasyDartModule.logger.info("[bleee]:" + line);
|
||||||
|
DailyLogUtils.writeLog("[bleee]:" + line);
|
||||||
}
|
}
|
||||||
// if (onData.status == BleEventType.ready) {
|
// if (onData.status == BleEventType.ready) {
|
||||||
// // showLoadingDialog(context, title: "获取wifi列表中...".tr);
|
// // showLoadingDialog(context, title: "获取wifi列表中...".tr);
|
||||||
@@ -965,7 +971,7 @@ class _WifiPageState extends State<WifiPage> {
|
|||||||
decoration: BoxDecoration(shape: BoxShape.circle),
|
decoration: BoxDecoration(shape: BoxShape.circle),
|
||||||
child: Image.asset("assets/img/wifi3.png"),
|
child: Image.asset("assets/img/wifi3.png"),
|
||||||
);
|
);
|
||||||
} else if (rssi >=AppConstants().wifi3) {
|
} else if (rssi >= AppConstants().wifi3) {
|
||||||
return Container(
|
return Container(
|
||||||
width: 40.rpx,
|
width: 40.rpx,
|
||||||
height: 40.rpx,
|
height: 40.rpx,
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import 'package:flutter_svg/svg.dart';
|
|||||||
import 'package:flutterflow_ui/flutterflow_ui.dart';
|
import 'package:flutterflow_ui/flutterflow_ui.dart';
|
||||||
import 'package:vbvs_app/common/color/ServiceConstant.dart';
|
import 'package:vbvs_app/common/color/ServiceConstant.dart';
|
||||||
import 'package:vbvs_app/common/color/appConstants.dart';
|
import 'package:vbvs_app/common/color/appConstants.dart';
|
||||||
|
import 'package:vbvs_app/common/util/DailyLogUtils.dart';
|
||||||
import 'package:vbvs_app/common/util/FitTool.dart';
|
import 'package:vbvs_app/common/util/FitTool.dart';
|
||||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||||
import 'package:vbvs_app/common/util/requestWithLog.dart';
|
import 'package:vbvs_app/common/util/requestWithLog.dart';
|
||||||
@@ -23,6 +24,7 @@ import 'package:vbvs_app/controller/user_info_controller.dart';
|
|||||||
import 'package:vbvs_app/model/BleDeviceData.dart';
|
import 'package:vbvs_app/model/BleDeviceData.dart';
|
||||||
import 'package:vbvs_app/pages/device_bind/blueteeth_device_page.dart';
|
import 'package:vbvs_app/pages/device_bind/blueteeth_device_page.dart';
|
||||||
import 'package:vbvs_app/pages/device_bind/componnet/bind_dialog.dart';
|
import 'package:vbvs_app/pages/device_bind/componnet/bind_dialog.dart';
|
||||||
|
import 'package:EasyDartModule/EasyDartModule.dart' as edm;
|
||||||
|
|
||||||
class WifiPagePerson extends StatefulWidget {
|
class WifiPagePerson extends StatefulWidget {
|
||||||
var type;
|
var type;
|
||||||
@@ -835,6 +837,8 @@ class _WifiPagePersonState extends State<WifiPagePerson> {
|
|||||||
if (onData.status == BleEventType.recvLineLog) {
|
if (onData.status == BleEventType.recvLineLog) {
|
||||||
final line = onData.val;
|
final line = onData.val;
|
||||||
print("[bleee]:" + line);
|
print("[bleee]:" + line);
|
||||||
|
edm.EasyDartModule.logger.info("[bleee]:" + line);
|
||||||
|
DailyLogUtils.writeLog("[bleee]:" + line);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -980,6 +984,8 @@ class _WifiPagePersonState extends State<WifiPagePerson> {
|
|||||||
if (onData.status == BleEventType.recvLineLog) {
|
if (onData.status == BleEventType.recvLineLog) {
|
||||||
final line = onData.val;
|
final line = onData.val;
|
||||||
print("[bleee]:" + line);
|
print("[bleee]:" + line);
|
||||||
|
edm.EasyDartModule.logger.info("[bleee]:" + line);
|
||||||
|
DailyLogUtils.writeLog("[bleee]:" + line);
|
||||||
}
|
}
|
||||||
if (onData.status == BleEventType.ready) {
|
if (onData.status == BleEventType.ready) {
|
||||||
aa = await getDeviceNetVersion(
|
aa = await getDeviceNetVersion(
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import 'package:ef/ef.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:get_storage/get_storage.dart';
|
import 'package:get_storage/get_storage.dart';
|
||||||
|
import 'package:vbvs_app/common/color/appConstants.dart';
|
||||||
import 'package:vbvs_app/common/util/CommonVariables.dart';
|
import 'package:vbvs_app/common/util/CommonVariables.dart';
|
||||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||||
import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
|
import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
|
||||||
@@ -13,6 +14,7 @@ import 'package:vbvs_app/controller/mh_controller/mh_language_controller.dart';
|
|||||||
import 'package:vbvs_app/controller/user_info_controller.dart';
|
import 'package:vbvs_app/controller/user_info_controller.dart';
|
||||||
import 'package:vbvs_app/model/WebSocketMessage.dart';
|
import 'package:vbvs_app/model/WebSocketMessage.dart';
|
||||||
import 'package:vbvs_app/pages/common/bezier_bottom_navigation_bar.dart';
|
import 'package:vbvs_app/pages/common/bezier_bottom_navigation_bar.dart';
|
||||||
|
import 'package:vbvs_app/pages/common/selectDialog.dart';
|
||||||
import 'package:vbvs_app/pages/mh_page/MattressControl.dart';
|
import 'package:vbvs_app/pages/mh_page/MattressControl.dart';
|
||||||
import 'package:vbvs_app/pages/mh_page/homepage/mht_sleep_report_page.dart';
|
import 'package:vbvs_app/pages/mh_page/homepage/mht_sleep_report_page.dart';
|
||||||
import 'package:vbvs_app/pages/mh_page/homepage/new_Home_page.dart';
|
import 'package:vbvs_app/pages/mh_page/homepage/new_Home_page.dart';
|
||||||
@@ -124,27 +126,27 @@ class _HomePageState extends State<MainPageBBottomChange>
|
|||||||
final getStorage = GetStorage();
|
final getStorage = GetStorage();
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
// Future.delayed(const Duration(milliseconds: 0), () {
|
Future.delayed(const Duration(milliseconds: 0), () {
|
||||||
// String? isShowYingShiDialog = getStorage.read("isShowYingShiDialog");
|
String? isShowYingShiDialog = getStorage.read("isShowYingShiDialog");
|
||||||
// if (isShowYingShiDialog == null || isShowYingShiDialog != "true") {
|
if (isShowYingShiDialog == null || isShowYingShiDialog != "true") {
|
||||||
// String btnName = "同意".tr;
|
String btnName = "同意".tr;
|
||||||
// String cancelName = "取消".tr;
|
String cancelName = "取消".tr;
|
||||||
// if (Platform.isAndroid) {
|
if (Platform.isAndroid) {
|
||||||
// cancelName = "退出".tr;
|
cancelName = "退出".tr;
|
||||||
// }
|
}
|
||||||
// showCustomConfirmOfWebViewDialog(context, "隐私协议".tr, getPrivacy(1),
|
showCustomConfirmOfWebViewDialog(context, "隐私协议".tr, getPrivacy(1),
|
||||||
// btnName: btnName, showCancel: true, cancelName: cancelName)
|
btnName: btnName, showCancel: true, cancelName: cancelName)
|
||||||
// .then((e) {
|
.then((e) {
|
||||||
// if (e == "confirm") {
|
if (e == "confirm") {
|
||||||
// getStorage.write("isShowYingShiDialog", "true");
|
getStorage.write("isShowYingShiDialog", "true");
|
||||||
// } else {
|
} else {
|
||||||
// if (cancelName == "退出") {
|
if (cancelName == "退出") {
|
||||||
// SystemNavigator.pop();
|
SystemNavigator.pop();
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// });
|
});
|
||||||
// }
|
}
|
||||||
// });
|
});
|
||||||
return Obx(() {
|
return Obx(() {
|
||||||
final currentLanguage =
|
final currentLanguage =
|
||||||
languageController.selectLanguage.value; // 监听此变量变化
|
languageController.selectLanguage.value; // 监听此变量变化
|
||||||
|
|||||||
@@ -383,7 +383,7 @@ class _HomePageState extends State<HomePage> {
|
|||||||
.currentColor.sc4,
|
.currentColor.sc4,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
].divide(SizedBox(
|
].divide(SizedBox(
|
||||||
width: 20.rpx,
|
width: 20.rpx,
|
||||||
)),
|
)),
|
||||||
|
|||||||
@@ -81,27 +81,27 @@ class MainPageBottomChange extends GetView<MainPageController> {
|
|||||||
final getStorage = GetStorage();
|
final getStorage = GetStorage();
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
Future.delayed(const Duration(milliseconds: 0), () {
|
// Future.delayed(const Duration(milliseconds: 0), () {
|
||||||
String? isShowYingShiDialog = getStorage.read("isShowYingShiDialog");
|
// String? isShowYingShiDialog = getStorage.read("isShowYingShiDialog");
|
||||||
if (isShowYingShiDialog == null || isShowYingShiDialog != "true") {
|
// if (isShowYingShiDialog == null || isShowYingShiDialog != "true") {
|
||||||
String btnName = "同意".tr;
|
// String btnName = "同意".tr;
|
||||||
String cancelName = "取消".tr;
|
// String cancelName = "取消".tr;
|
||||||
if (Platform.isAndroid) {
|
// if (Platform.isAndroid) {
|
||||||
cancelName = "退出".tr;
|
// cancelName = "退出".tr;
|
||||||
}
|
// }
|
||||||
showCustomConfirmOfWebViewDialog(context, "隐私协议".tr, getPrivacy(1),
|
// showCustomConfirmOfWebViewDialog(context, "隐私协议".tr, getPrivacy(1),
|
||||||
btnName: btnName, showCancel: true, cancelName: cancelName)
|
// btnName: btnName, showCancel: true, cancelName: cancelName)
|
||||||
.then((e) {
|
// .then((e) {
|
||||||
if (e == "confirm") {
|
// if (e == "confirm") {
|
||||||
getStorage.write("isShowYingShiDialog", "true");
|
// getStorage.write("isShowYingShiDialog", "true");
|
||||||
} else {
|
// } else {
|
||||||
if (cancelName == "退出") {
|
// if (cancelName == "退出") {
|
||||||
SystemNavigator.pop();
|
// SystemNavigator.pop();
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
|
|
||||||
return PopScope(
|
return PopScope(
|
||||||
canPop: false,
|
canPop: false,
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import 'package:flutter_svg/svg.dart';
|
|||||||
import 'package:flutterflow_ui/flutterflow_ui.dart';
|
import 'package:flutterflow_ui/flutterflow_ui.dart';
|
||||||
import 'package:vbvs_app/common/color/ServiceConstant.dart';
|
import 'package:vbvs_app/common/color/ServiceConstant.dart';
|
||||||
import 'package:vbvs_app/common/color/appConstants.dart';
|
import 'package:vbvs_app/common/color/appConstants.dart';
|
||||||
|
import 'package:vbvs_app/common/util/DailyLogUtils.dart';
|
||||||
import 'package:vbvs_app/common/util/FitTool.dart';
|
import 'package:vbvs_app/common/util/FitTool.dart';
|
||||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||||
import 'package:vbvs_app/common/util/requestWithLog.dart';
|
import 'package:vbvs_app/common/util/requestWithLog.dart';
|
||||||
@@ -610,7 +611,7 @@ class _MinePageState extends State<MinePage> {
|
|||||||
.currentColor.sc21, // 点击时的背景色
|
.currentColor.sc21, // 点击时的背景色
|
||||||
padding: EdgeInsetsDirectional.fromSTEB(
|
padding: EdgeInsetsDirectional.fromSTEB(
|
||||||
40.rpx, 0.rpx, 40.rpx, 0.rpx),
|
40.rpx, 0.rpx, 40.rpx, 0.rpx),
|
||||||
onTap: () {
|
onTap: () async {
|
||||||
UserInfoController userInfoController =
|
UserInfoController userInfoController =
|
||||||
Get.find();
|
Get.find();
|
||||||
if (userInfoController.model.login !=
|
if (userInfoController.model.login !=
|
||||||
@@ -622,7 +623,20 @@ class _MinePageState extends State<MinePage> {
|
|||||||
themeController.currentColor.sc9,
|
themeController.currentColor.sc9,
|
||||||
);
|
);
|
||||||
Get.toNamed("/loginPage");
|
Get.toNamed("/loginPage");
|
||||||
} else {}
|
} else {
|
||||||
|
String logContent =
|
||||||
|
await DailyLogUtils.readLogByDate(
|
||||||
|
DateTime(2025, 9, 4));
|
||||||
|
print(logContent);
|
||||||
|
// DailyLogUtils.readTodayLog();
|
||||||
|
// DailyLogUtils.listLogFiles();
|
||||||
|
await DailyLogUtils.writeLog(
|
||||||
|
"测试日志内容"); // 确保写入日志
|
||||||
|
await DailyLogUtils
|
||||||
|
.exportAllLogs(); // 导出并分享
|
||||||
|
|
||||||
|
// DailyLogUtils.exportAllLogs();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
@@ -660,7 +674,7 @@ class _MinePageState extends State<MinePage> {
|
|||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'V1.0.2506.06',
|
'V1.0.2509.04',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontFamily: 'Inter',
|
fontFamily: 'Inter',
|
||||||
color: Color(0xFFD9E3EB),
|
color: Color(0xFFD9E3EB),
|
||||||
|
|||||||
282
lib/pages/mh_page/CommonMessageSettingPage.dart
Normal file
282
lib/pages/mh_page/CommonMessageSettingPage.dart
Normal file
@@ -0,0 +1,282 @@
|
|||||||
|
import 'dart:async';
|
||||||
|
|
||||||
|
import 'package:ef/ef.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutterflow_ui/flutterflow_ui.dart';
|
||||||
|
import 'package:vbvs_app/common/color/ServiceConstant.dart';
|
||||||
|
import 'package:vbvs_app/common/color/appConstants.dart';
|
||||||
|
import 'package:vbvs_app/common/util/FitTool.dart';
|
||||||
|
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||||
|
import 'package:vbvs_app/common/util/requestWithLog.dart';
|
||||||
|
import 'package:vbvs_app/component/base/GradientSwitch.dart';
|
||||||
|
import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
|
||||||
|
import 'package:vbvs_app/controller/message/common_message_setting_controller.dart';
|
||||||
|
import 'package:vbvs_app/controller/theme_controller/ThemeController.dart';
|
||||||
|
import 'package:vbvs_app/pages/mh_page/user/controller/mht_login_controller.dart';
|
||||||
|
|
||||||
|
class MHTCommonMessageSettingPage extends StatefulWidget {
|
||||||
|
MHTCommonMessageSettingPage({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<MHTCommonMessageSettingPage> createState() =>
|
||||||
|
_CommonMessageSettingPageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _CommonMessageSettingPageState
|
||||||
|
extends State<MHTCommonMessageSettingPage> {
|
||||||
|
final ThemeController themeController = Get.find();
|
||||||
|
CommonMessageSettingController commonMessageSettingController = Get.find();
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
commonMessageSettingController.getAppSleepNotify();
|
||||||
|
_fetchDeviceList();
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> _fetchDeviceList() async {
|
||||||
|
String serviceAddress = ServiceConstant.service_address;
|
||||||
|
String serviceName = ServiceConstant.server_service;
|
||||||
|
String serviceApi = ServiceConstant.user_setting;
|
||||||
|
String type = "user_message_setting";
|
||||||
|
String queryUrl = "${serviceAddress}${serviceName}${serviceApi}?type=$type";
|
||||||
|
requestWithLog(
|
||||||
|
logTitle: "查询用户消息配置",
|
||||||
|
method: MyHttpMethod.get,
|
||||||
|
queryUrl: queryUrl,
|
||||||
|
onSuccess: (res) {
|
||||||
|
if (res.data == null || res.data.isEmpty) {
|
||||||
|
var data = {
|
||||||
|
"type": type,
|
||||||
|
"setting": 1,
|
||||||
|
"appSetting": 1,
|
||||||
|
"serviceSetting": 1,
|
||||||
|
"tipSetting": 1,
|
||||||
|
"deviceUpgradeSetting": 1,
|
||||||
|
"deviceIssueSetting": 1,
|
||||||
|
};
|
||||||
|
requestWithLog(
|
||||||
|
logTitle: "更新用户消息配置",
|
||||||
|
method: MyHttpMethod.put,
|
||||||
|
queryUrl: queryUrl,
|
||||||
|
data: data,
|
||||||
|
onSuccess: (res) {
|
||||||
|
requestWithLog(
|
||||||
|
logTitle: "查询用户消息配置",
|
||||||
|
method: MyHttpMethod.get,
|
||||||
|
queryUrl: queryUrl,
|
||||||
|
onSuccess: (res) {
|
||||||
|
if (res.data != null && res.data.isNotEmpty) {
|
||||||
|
var datalist = res.data;
|
||||||
|
commonMessageSettingController.model.setting =
|
||||||
|
datalist['setting'];
|
||||||
|
commonMessageSettingController.model.appSetting =
|
||||||
|
datalist['appSetting'];
|
||||||
|
commonMessageSettingController.model.serviceSetting =
|
||||||
|
datalist['serviceSetting'];
|
||||||
|
commonMessageSettingController.model.tipSetting =
|
||||||
|
datalist['tipSetting'];
|
||||||
|
commonMessageSettingController.model.deviceUpgradeSetting =
|
||||||
|
datalist['deviceUpgradeSetting'];
|
||||||
|
commonMessageSettingController.model.deviceIssueSetting =
|
||||||
|
datalist['deviceIssueSetting'];
|
||||||
|
commonMessageSettingController.updateAll();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
},
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
var datalist = res.data;
|
||||||
|
commonMessageSettingController.model.setting = datalist['setting'];
|
||||||
|
commonMessageSettingController.model.appSetting =
|
||||||
|
datalist['appSetting'];
|
||||||
|
commonMessageSettingController.model.serviceSetting =
|
||||||
|
datalist['serviceSetting'];
|
||||||
|
commonMessageSettingController.model.tipSetting =
|
||||||
|
datalist['tipSetting'];
|
||||||
|
commonMessageSettingController.model.deviceUpgradeSetting =
|
||||||
|
datalist['deviceUpgradeSetting'];
|
||||||
|
commonMessageSettingController.model.deviceIssueSetting =
|
||||||
|
datalist['deviceIssueSetting'];
|
||||||
|
commonMessageSettingController.updateAll();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onFailure: (res) {
|
||||||
|
print(res);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return LayoutBuilder(
|
||||||
|
builder: (context, bodysize) => GestureDetector(
|
||||||
|
// onTap: () => FocusScope.of(context).unfocus(),,
|
||||||
|
child: Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
image: DecorationImage(
|
||||||
|
image: AssetImage('assets/images/new_background.png'), // 本地图片
|
||||||
|
fit: BoxFit.fill,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Scaffold(
|
||||||
|
backgroundColor: Colors.transparent,
|
||||||
|
appBar: AppBar(
|
||||||
|
backgroundColor: Colors.transparent,
|
||||||
|
automaticallyImplyLeading: false,
|
||||||
|
iconTheme: IconThemeData(
|
||||||
|
color: themeController.currentColor.sc3,
|
||||||
|
),
|
||||||
|
titleSpacing: 0,
|
||||||
|
title: Container(
|
||||||
|
width: double.infinity,
|
||||||
|
height: 180.rpx,
|
||||||
|
child: Stack(
|
||||||
|
alignment: Alignment.center,
|
||||||
|
children: [
|
||||||
|
/// 居中标题
|
||||||
|
Text(
|
||||||
|
'消息通知'.tr,
|
||||||
|
style: TextStyle(
|
||||||
|
fontFamily: 'ReadexPro',
|
||||||
|
color: themeController.currentColor.sc3,
|
||||||
|
letterSpacing: 0,
|
||||||
|
fontSize: 30.rpx,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Positioned(
|
||||||
|
left: 0,
|
||||||
|
child: returnIconButtomAddCallback(() {}),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
actions: [],
|
||||||
|
centerTitle: false,
|
||||||
|
),
|
||||||
|
body: GestureDetector(
|
||||||
|
child: SafeArea(
|
||||||
|
top: true,
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsetsDirectional.fromSTEB(0.rpx, 0, 0.rpx, 0),
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding:
|
||||||
|
EdgeInsetsDirectional.fromSTEB(0, 30.rpx, 0, 0),
|
||||||
|
child: Container(
|
||||||
|
width: double.infinity,
|
||||||
|
constraints: BoxConstraints(
|
||||||
|
minHeight: 90.rpx,
|
||||||
|
),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: themeController.currentColor.sc5),
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsetsDirectional.fromSTEB(
|
||||||
|
30.rpx, 15.rpx, 30.rpx, 15.rpx),
|
||||||
|
child: Row(
|
||||||
|
mainAxisSize: MainAxisSize.max,
|
||||||
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: Text(
|
||||||
|
"睡眠报告通知".tr,
|
||||||
|
style: TextStyle(
|
||||||
|
color:
|
||||||
|
themeController.currentColor.sc3,
|
||||||
|
fontSize: AppConstants()
|
||||||
|
.title_text_fontSize),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Obx(() {
|
||||||
|
return GradientSwitch(
|
||||||
|
value: commonMessageSettingController
|
||||||
|
.model.sleepReportSetting ==
|
||||||
|
1
|
||||||
|
? true
|
||||||
|
: false,
|
||||||
|
onChanged: (val) async {
|
||||||
|
// String serviceAddress =
|
||||||
|
// ServiceConstant.service_address;
|
||||||
|
// String serviceName =
|
||||||
|
// ServiceConstant.server_service;
|
||||||
|
// String serviceApi = ServiceConstant
|
||||||
|
// .app_system_push_message;
|
||||||
|
// String queryUrl =
|
||||||
|
// "${serviceAddress}${serviceName}${serviceApi}";
|
||||||
|
// var data = {
|
||||||
|
// "type": type,
|
||||||
|
// "setting": val == true ? 1 : 0,
|
||||||
|
// "appSetting":
|
||||||
|
// commonMessageSettingController
|
||||||
|
// .model.appSetting,
|
||||||
|
// "serviceSetting":
|
||||||
|
// commonMessageSettingController
|
||||||
|
// .model.serviceSetting,
|
||||||
|
// "tipSetting":
|
||||||
|
// commonMessageSettingController
|
||||||
|
// .model.tipSetting,
|
||||||
|
// "deviceUpgradeSetting":
|
||||||
|
// commonMessageSettingController
|
||||||
|
// .model.deviceUpgradeSetting,
|
||||||
|
// "deviceIssueSetting":
|
||||||
|
// commonMessageSettingController
|
||||||
|
// .model.deviceIssueSetting,
|
||||||
|
// };
|
||||||
|
// requestWithLog(
|
||||||
|
// logTitle: "更新消息推送状态",
|
||||||
|
// method: MyHttpMethod.put,
|
||||||
|
// queryUrl: queryUrl,
|
||||||
|
// data: data,
|
||||||
|
// onSuccess: (res) {
|
||||||
|
// _fetchDeviceList();
|
||||||
|
// commonMessageSettingController
|
||||||
|
// .updateAll();
|
||||||
|
// });
|
||||||
|
await commonMessageSettingController
|
||||||
|
.updateSleepNotify(val);
|
||||||
|
await commonMessageSettingController
|
||||||
|
.getAppSleepNotify();
|
||||||
|
commonMessageSettingController
|
||||||
|
.updateAll();
|
||||||
|
},
|
||||||
|
activeGradient: LinearGradient(
|
||||||
|
colors: [
|
||||||
|
themeController.currentColor.sc1,
|
||||||
|
themeController.currentColor.sc2
|
||||||
|
],
|
||||||
|
),
|
||||||
|
activeThumbColor: Colors.white,
|
||||||
|
inactiveThumbColor:
|
||||||
|
stringToColor("#A2A4A9"),
|
||||||
|
inactiveColor: stringToColor("#161B28"),
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -25,6 +25,7 @@ import 'package:vbvs_app/model/BleDeviceData.dart';
|
|||||||
import 'package:vbvs_app/pages/device_bind/blueteeth_device_page.dart';
|
import 'package:vbvs_app/pages/device_bind/blueteeth_device_page.dart';
|
||||||
import 'package:vbvs_app/pages/mh_page/component/mht_bind_dialog.dart';
|
import 'package:vbvs_app/pages/mh_page/component/mht_bind_dialog.dart';
|
||||||
import 'package:vbvs_app/pages/mh_page/device/model/BlueToothDataModel.dart';
|
import 'package:vbvs_app/pages/mh_page/device/model/BlueToothDataModel.dart';
|
||||||
|
import 'package:EasyDartModule/EasyDartModule.dart' as edm;
|
||||||
|
|
||||||
class MHTWifiPage extends StatefulWidget {
|
class MHTWifiPage extends StatefulWidget {
|
||||||
BlueToothDataModel deviceInfo;
|
BlueToothDataModel deviceInfo;
|
||||||
@@ -648,7 +649,7 @@ class _MHTWifiPageState extends State<MHTWifiPage> {
|
|||||||
valueColor:
|
valueColor:
|
||||||
AlwaysStoppedAnimation<
|
AlwaysStoppedAnimation<
|
||||||
Color>(
|
Color>(
|
||||||
Colors.white,
|
Colors.white,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
@@ -847,6 +848,8 @@ class _MHTWifiPageState extends State<MHTWifiPage> {
|
|||||||
if (onData.status == BleEventType.recvLineLog) {
|
if (onData.status == BleEventType.recvLineLog) {
|
||||||
final line = onData.val;
|
final line = onData.val;
|
||||||
print("[bleee]:" + line);
|
print("[bleee]:" + line);
|
||||||
|
edm.EasyDartModule.logger.info("[bleee]:" + line);
|
||||||
|
DailyLogUtils.writeLog("[bleee]:" + line);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -982,6 +985,8 @@ class _MHTWifiPageState extends State<MHTWifiPage> {
|
|||||||
if (onData.status == BleEventType.recvLineLog) {
|
if (onData.status == BleEventType.recvLineLog) {
|
||||||
final line = onData.val;
|
final line = onData.val;
|
||||||
print("[bleee]:" + line);
|
print("[bleee]:" + line);
|
||||||
|
edm.EasyDartModule.logger.info("[bleee]:" + line);
|
||||||
|
DailyLogUtils.writeLog("[bleee]:" + line);
|
||||||
}
|
}
|
||||||
if (onData.status == BleEventType.ready) {
|
if (onData.status == BleEventType.ready) {
|
||||||
var aa = await getDeviceNetVersion(
|
var aa = await getDeviceNetVersion(
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import 'package:vbvs_app/controller/user_info_controller.dart';
|
|||||||
import 'package:vbvs_app/model/BleDeviceData.dart';
|
import 'package:vbvs_app/model/BleDeviceData.dart';
|
||||||
import 'package:vbvs_app/pages/device_bind/blueteeth_device_page.dart';
|
import 'package:vbvs_app/pages/device_bind/blueteeth_device_page.dart';
|
||||||
import 'package:vbvs_app/pages/mh_page/component/mht_bind_dialog.dart';
|
import 'package:vbvs_app/pages/mh_page/component/mht_bind_dialog.dart';
|
||||||
|
import 'package:EasyDartModule/EasyDartModule.dart' as edm;
|
||||||
|
|
||||||
class MHTWifiAfterPage extends StatefulWidget {
|
class MHTWifiAfterPage extends StatefulWidget {
|
||||||
var deviceInfo;
|
var deviceInfo;
|
||||||
@@ -823,6 +824,8 @@ class _MHTWifiAfterPageState extends State<MHTWifiAfterPage> {
|
|||||||
if (onData.status == BleEventType.recvLineLog) {
|
if (onData.status == BleEventType.recvLineLog) {
|
||||||
final line = onData.val;
|
final line = onData.val;
|
||||||
print("[bleee]:" + line);
|
print("[bleee]:" + line);
|
||||||
|
edm.EasyDartModule.logger.info("[bleee]:" + line);
|
||||||
|
DailyLogUtils.writeLog("[bleee]:" + line);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -917,8 +920,6 @@ class _MHTWifiAfterPageState extends State<MHTWifiAfterPage> {
|
|||||||
_scanSubscription = FlutterBluePlus.scanResults.listen((results) async {
|
_scanSubscription = FlutterBluePlus.scanResults.listen((results) async {
|
||||||
if (_isDisposed) return;
|
if (_isDisposed) return;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for (var r in results) {
|
for (var r in results) {
|
||||||
if (r.advertisementData.manufacturerData.containsKey(0xFFED)) {
|
if (r.advertisementData.manufacturerData.containsKey(0xFFED)) {
|
||||||
List<int> rawData = r.advertisementData.manufacturerData[0xFFED]!;
|
List<int> rawData = r.advertisementData.manufacturerData[0xFFED]!;
|
||||||
@@ -958,6 +959,8 @@ class _MHTWifiAfterPageState extends State<MHTWifiAfterPage> {
|
|||||||
if (onData.status == BleEventType.recvLineLog) {
|
if (onData.status == BleEventType.recvLineLog) {
|
||||||
final line = onData.val;
|
final line = onData.val;
|
||||||
print("[bleee]:" + line);
|
print("[bleee]:" + line);
|
||||||
|
edm.EasyDartModule.logger.info("[bleee]:" + line);
|
||||||
|
DailyLogUtils.writeLog("[bleee]:" + line);
|
||||||
}
|
}
|
||||||
if (onData.status == BleEventType.ready) {
|
if (onData.status == BleEventType.ready) {
|
||||||
var aa = await getDeviceNetVersion(
|
var aa = await getDeviceNetVersion(
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import 'package:vbvs_app/common/util/MyUtils.dart';
|
|||||||
import 'package:vbvs_app/common/util/requestWithLog.dart';
|
import 'package:vbvs_app/common/util/requestWithLog.dart';
|
||||||
import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
|
import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
|
||||||
import 'package:vbvs_app/model/api_response.dart';
|
import 'package:vbvs_app/model/api_response.dart';
|
||||||
|
import 'package:vbvs_app/pages/main_bottom/component/main_page_b_bottom_change.dart';
|
||||||
|
|
||||||
part 'mht_home_controller.g.dart'; // 由json_serializable自动生成的部分
|
part 'mht_home_controller.g.dart'; // 由json_serializable自动生成的部分
|
||||||
|
|
||||||
@@ -59,6 +60,15 @@ class MHTHomeController extends GetControllerEx<MHTHomeModel> {
|
|||||||
|
|
||||||
bool initDeviceFlag = false;
|
bool initDeviceFlag = false;
|
||||||
|
|
||||||
|
RxMap selectedReportData = {}.obs;
|
||||||
|
RxInt refreshReportTrigger = 0.obs;
|
||||||
|
|
||||||
|
void openReport(Map<String, dynamic> data) {
|
||||||
|
selectedReportData.value = data;
|
||||||
|
refreshReportTrigger.value++; // 每次+1,触发监听
|
||||||
|
MainPageBBottomChange.jumpTo(1); // 切到报告页
|
||||||
|
}
|
||||||
|
|
||||||
Future<ApiResponse> getDeviceNum() async {
|
Future<ApiResponse> getDeviceNum() async {
|
||||||
try {
|
try {
|
||||||
ApiResponse apiResponse = ApiResponse(code: -1, msg: "设备列表请求失败".tr);
|
ApiResponse apiResponse = ApiResponse(code: -1, msg: "设备列表请求失败".tr);
|
||||||
|
|||||||
@@ -8,13 +8,12 @@ import 'package:flutterflow_ui/flutterflow_ui.dart';
|
|||||||
import 'package:vbvs_app/common/color/appConstants.dart';
|
import 'package:vbvs_app/common/color/appConstants.dart';
|
||||||
import 'package:vbvs_app/common/color/app_uri_status.dart';
|
import 'package:vbvs_app/common/color/app_uri_status.dart';
|
||||||
import 'package:vbvs_app/common/util/FitTool.dart';
|
import 'package:vbvs_app/common/util/FitTool.dart';
|
||||||
|
import 'package:vbvs_app/common/util/JPushUtil.dart';
|
||||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||||
import 'package:vbvs_app/component/NullDataComponentWidget.dart';
|
|
||||||
import 'package:vbvs_app/component/tool/ClickableContainer.dart';
|
import 'package:vbvs_app/component/tool/ClickableContainer.dart';
|
||||||
import 'package:vbvs_app/controller/user_info_controller.dart';
|
import 'package:vbvs_app/controller/user_info_controller.dart';
|
||||||
import 'package:vbvs_app/controller/weather/weather_controller.dart';
|
import 'package:vbvs_app/controller/weather/weather_controller.dart';
|
||||||
import 'package:vbvs_app/enum/APPPackageType.dart';
|
import 'package:vbvs_app/enum/APPPackageType.dart';
|
||||||
import 'package:vbvs_app/pages/mh_page/FloatingSvgIcon.dart';
|
|
||||||
import 'package:vbvs_app/pages/mh_page/component/mht_bind_dialog.dart';
|
import 'package:vbvs_app/pages/mh_page/component/mht_bind_dialog.dart';
|
||||||
import 'package:vbvs_app/pages/mh_page/homepage/component/HomeDeviceWidget.dart';
|
import 'package:vbvs_app/pages/mh_page/homepage/component/HomeDeviceWidget.dart';
|
||||||
import 'package:vbvs_app/pages/mh_page/homepage/controller/mht_home_controller.dart';
|
import 'package:vbvs_app/pages/mh_page/homepage/controller/mht_home_controller.dart';
|
||||||
@@ -75,6 +74,9 @@ class _NewHomePageState extends State<NewHomePage> {
|
|||||||
homeController.homeSleepDays.value.length - 1;
|
homeController.homeSleepDays.value.length - 1;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||||
|
_onReady();
|
||||||
|
});
|
||||||
try {
|
try {
|
||||||
_newVersionSubscription =
|
_newVersionSubscription =
|
||||||
ef.kvRoot.appmanger.onAppUpdate.listen((MiniAppPkg pkg) {
|
ef.kvRoot.appmanger.onAppUpdate.listen((MiniAppPkg pkg) {
|
||||||
@@ -573,7 +575,19 @@ class _NewHomePageState extends State<NewHomePage> {
|
|||||||
'reportPadding': false,
|
'reportPadding': false,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
// 保存当前选中的mac到全局状态
|
||||||
|
// homeController.selectDevcie
|
||||||
|
// .value =
|
||||||
|
// formFieldController
|
||||||
|
// .value!;
|
||||||
|
// homeController.selectPerson
|
||||||
|
// .value =
|
||||||
|
// personInfo.value;
|
||||||
|
|
||||||
|
// // 使用底部tab跳转到第二个页面
|
||||||
|
// MainPageBBottomChange
|
||||||
|
// .jumpTo(1);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisSize:
|
mainAxisSize:
|
||||||
@@ -983,6 +997,23 @@ class _NewHomePageState extends State<NewHomePage> {
|
|||||||
if (value is String) return int.tryParse(value);
|
if (value is String) return int.tryParse(value);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void _onReady() {
|
||||||
|
// 页面渲染完成后执行的逻辑,比如处理通知跳转
|
||||||
|
_handlePendingRoute();
|
||||||
|
}
|
||||||
|
|
||||||
|
void _handlePendingRoute() {
|
||||||
|
var pending = JPushUtil.box.read("pendingRoute");
|
||||||
|
if (pending != null) {
|
||||||
|
String route = pending["route"];
|
||||||
|
var args = pending["arguments"];
|
||||||
|
Future.delayed(const Duration(milliseconds: 300), () {
|
||||||
|
Get.toNamed(route, arguments: args);
|
||||||
|
});
|
||||||
|
JPushUtil.box.remove("pendingRoute");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class ScoreItem {
|
class ScoreItem {
|
||||||
|
|||||||
@@ -156,6 +156,67 @@ class _SettingPageState extends State<SettingPage> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
ClickableContainer(
|
||||||
|
backgroundColor:
|
||||||
|
Colors.transparent, // 容器背景色
|
||||||
|
highlightColor: themeController
|
||||||
|
.currentColor.sc21, // 点击时的背景色
|
||||||
|
padding: EdgeInsetsDirectional.fromSTEB(
|
||||||
|
40.rpx, 0.rpx, 40.rpx, 0.rpx),
|
||||||
|
onTap: () {
|
||||||
|
Get.toNamed("/commonMessageSettingPage");
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsetsDirectional.fromSTEB(
|
||||||
|
0.rpx, 30.rpx, 0.rpx, 30.rpx),
|
||||||
|
child: Row(
|
||||||
|
mainAxisSize: MainAxisSize.max,
|
||||||
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
mainAxisSize: MainAxisSize.max,
|
||||||
|
children: [
|
||||||
|
Text('通知设置'.tr,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 30.rpx,
|
||||||
|
color: Colors.white,
|
||||||
|
height: 1)),
|
||||||
|
].divide(SizedBox(width: 22.rpx)),
|
||||||
|
),
|
||||||
|
SvgPicture.asset(
|
||||||
|
'assets/img/icon/arrow_right.svg',
|
||||||
|
width: 8.rpx,
|
||||||
|
height: 15
|
||||||
|
.rpx, // 如果 SVG 中没有固定颜色,可以这样设置
|
||||||
|
color: themeController
|
||||||
|
.currentColor.sc3,
|
||||||
|
),
|
||||||
|
// Row(
|
||||||
|
// mainAxisSize: MainAxisSize.max,
|
||||||
|
// children: [
|
||||||
|
// Text(
|
||||||
|
// '深色',
|
||||||
|
// style: FlutterFlowTheme.of(
|
||||||
|
// context)
|
||||||
|
// .bodyMedium
|
||||||
|
// .override(
|
||||||
|
// fontFamily: 'Inter',
|
||||||
|
// color:
|
||||||
|
// Color(0xFFD9E3EB),
|
||||||
|
// fontSize: 26.rpx,
|
||||||
|
// letterSpacing: 0.0,
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
|
||||||
|
// ].divide(SizedBox(width: 28.rpx)),
|
||||||
|
// ),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
ClickableContainer(
|
ClickableContainer(
|
||||||
backgroundColor:
|
backgroundColor:
|
||||||
Colors.transparent, // 容器背景色
|
Colors.transparent, // 容器背景色
|
||||||
|
|||||||
@@ -45,8 +45,8 @@ class WebviewTestController extends GetControllerEx<WebviewTestModel> {
|
|||||||
isheadless: false,
|
isheadless: false,
|
||||||
jsbridge: buildsdk(
|
jsbridge: buildsdk(
|
||||||
// father: this,
|
// father: this,
|
||||||
// clientId: '123',
|
|
||||||
// clientId: '494641114',
|
// clientId: '494641114',
|
||||||
|
// clientId: '123',
|
||||||
// dbgserverUrl: 'ws://192.168.1.2:9001',
|
// dbgserverUrl: 'ws://192.168.1.2:9001',
|
||||||
),
|
),
|
||||||
settings: buildsettings(),
|
settings: buildsettings(),
|
||||||
@@ -69,9 +69,7 @@ class WebviewTestController extends GetControllerEx<WebviewTestModel> {
|
|||||||
bridge: bridge,
|
bridge: bridge,
|
||||||
onConnect: (args1, args2) {
|
onConnect: (args1, args2) {
|
||||||
final devices = args1.devices as Map<String, dynamic>;
|
final devices = args1.devices as Map<String, dynamic>;
|
||||||
final mac = args2 as String;
|
final mac = args2 as String;
|
||||||
|
|
||||||
// Android: key 就是 mac,直接找
|
|
||||||
if (devices.containsKey(mac)) {
|
if (devices.containsKey(mac)) {
|
||||||
final device = devices[mac];
|
final device = devices[mac];
|
||||||
ef.log('Minibleapp connected(Android): $mac -> $device');
|
ef.log('Minibleapp connected(Android): $mac -> $device');
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ class MHTLoginController extends GetControllerEx<LoginModel> {
|
|||||||
"type": type,
|
"type": type,
|
||||||
"userName": account,
|
"userName": account,
|
||||||
"password": password,
|
"password": password,
|
||||||
'khCode':'mht',
|
'khCode': 'mht',
|
||||||
};
|
};
|
||||||
String serviceAddress = ServiceConstant.service_address;
|
String serviceAddress = ServiceConstant.service_address;
|
||||||
String serviceName = ServiceConstant.server_service;
|
String serviceName = ServiceConstant.server_service;
|
||||||
@@ -164,6 +164,8 @@ class MHTLoginController extends GetControllerEx<LoginModel> {
|
|||||||
final box = GetStorage();
|
final box = GetStorage();
|
||||||
box.write('token', token); // 存储 token
|
box.write('token', token); // 存储 token
|
||||||
box.write('user', userInfoController.model.user!.toJson()); // 存储用户信息
|
box.write('user', userInfoController.model.user!.toJson()); // 存储用户信息
|
||||||
|
//todo 更新消息通知
|
||||||
|
updateAppSystemNotify(true);
|
||||||
},
|
},
|
||||||
onFailure: (res) {
|
onFailure: (res) {
|
||||||
message = res.msg!;
|
message = res.msg!;
|
||||||
@@ -341,3 +343,26 @@ class MHTLoginController extends GetControllerEx<LoginModel> {
|
|||||||
corpId: CommonVariables.wxCorpId, url: CommonVariables.wxKfUrl));
|
corpId: CommonVariables.wxCorpId, url: CommonVariables.wxKfUrl));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> updateAppSystemNotify(bool status) async {
|
||||||
|
final box = GetStorage();
|
||||||
|
var data = {
|
||||||
|
"pid": box.read("rid"),
|
||||||
|
"status": status,
|
||||||
|
};
|
||||||
|
String serviceAddress = ServiceConstant.service_address;
|
||||||
|
String serviceName = ServiceConstant.server_service;
|
||||||
|
String serviceApi = ServiceConstant.app_system_push_message;
|
||||||
|
String queryUrl = "${serviceAddress}${serviceName}${serviceApi}";
|
||||||
|
await requestWithLog(
|
||||||
|
logTitle: "激活消息通知",
|
||||||
|
method: MyHttpMethod.put,
|
||||||
|
queryUrl: queryUrl,
|
||||||
|
data: data,
|
||||||
|
onSuccess: (res) {
|
||||||
|
print(res);
|
||||||
|
},
|
||||||
|
onFailure: (res) {
|
||||||
|
print(res);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|||||||
@@ -8,12 +8,14 @@ import 'package:vbvs_app/common/color/appFontsize.dart';
|
|||||||
import 'package:vbvs_app/common/util/CheckNetwork.dart';
|
import 'package:vbvs_app/common/util/CheckNetwork.dart';
|
||||||
import 'package:vbvs_app/common/util/CommonVariables.dart';
|
import 'package:vbvs_app/common/util/CommonVariables.dart';
|
||||||
import 'package:vbvs_app/common/util/FitTool.dart';
|
import 'package:vbvs_app/common/util/FitTool.dart';
|
||||||
|
import 'package:vbvs_app/common/util/JPushUtil.dart';
|
||||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||||
import 'package:vbvs_app/component/tool/ClickableContainer.dart';
|
import 'package:vbvs_app/component/tool/ClickableContainer.dart';
|
||||||
import 'package:vbvs_app/component/tool/CustomCard.dart';
|
import 'package:vbvs_app/component/tool/CustomCard.dart';
|
||||||
import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
|
import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
|
||||||
import 'package:vbvs_app/controller/time/countdown_controller.dart';
|
import 'package:vbvs_app/controller/time/countdown_controller.dart';
|
||||||
import 'package:vbvs_app/controller/user_info_controller.dart';
|
import 'package:vbvs_app/controller/user_info_controller.dart';
|
||||||
|
import 'package:vbvs_app/enum/APPPackageType.dart';
|
||||||
import 'package:vbvs_app/pages/mh_page/user/controller/mht_login_controller.dart';
|
import 'package:vbvs_app/pages/mh_page/user/controller/mht_login_controller.dart';
|
||||||
import 'package:vbvs_app/pages/mh_page/user/controller/mht_register_controller.dart';
|
import 'package:vbvs_app/pages/mh_page/user/controller/mht_register_controller.dart';
|
||||||
|
|
||||||
@@ -95,6 +97,9 @@ class MHTLoginPage extends GetView<MHTLoginController> {
|
|||||||
controller.fluwxCancelable?.cancel();
|
controller.fluwxCancelable?.cancel();
|
||||||
// 登录成功移出网络检查监听
|
// 登录成功移出网络检查监听
|
||||||
Checknetwork.subscription?.cancel();
|
Checknetwork.subscription?.cancel();
|
||||||
|
if (AppConstants().ent_type == APPPackageType.MHT.code) {
|
||||||
|
await JPushUtil.initJPush();
|
||||||
|
}
|
||||||
Get.offAndToNamed("/mianPageBottomChange");
|
Get.offAndToNamed("/mianPageBottomChange");
|
||||||
}
|
}
|
||||||
// TODO 操作全部跳转页面前成功以后移除监听,防止重复监听,其他方式登录成功也需要移出监听
|
// TODO 操作全部跳转页面前成功以后移除监听,防止重复监听,其他方式登录成功也需要移出监听
|
||||||
@@ -1261,10 +1266,39 @@ class MHTLoginPage extends GetView<MHTLoginController> {
|
|||||||
registerController = Get.find();
|
registerController = Get.find();
|
||||||
registerController
|
registerController
|
||||||
.model.register_agree = false;
|
.model.register_agree = false;
|
||||||
|
if (AppConstants().ent_type ==
|
||||||
|
APPPackageType.MHT.code) {
|
||||||
|
await JPushUtil.initJPush();
|
||||||
|
}
|
||||||
Get.offAndToNamed(
|
Get.offAndToNamed(
|
||||||
"/mianPageBottomChange");
|
"/mianPageBottomChange");
|
||||||
//登陆成功
|
// box.write(
|
||||||
//
|
// "needSleepReport", "true");
|
||||||
|
// if (box.read("needSleepReport") !=
|
||||||
|
// null &&
|
||||||
|
// box.read("needSleepReport") ==
|
||||||
|
// "true") {
|
||||||
|
// box.remove("needSleepReport");
|
||||||
|
// await box.save();
|
||||||
|
// var person = box.read(
|
||||||
|
// "needSleepReport_person");
|
||||||
|
// var mac = box
|
||||||
|
// .read("needSleepReport_mac");
|
||||||
|
// Get.toNamed(
|
||||||
|
// "/newSleepReportPage",
|
||||||
|
// arguments: {
|
||||||
|
// 'mac': mac,
|
||||||
|
// 'type': 1,
|
||||||
|
// "person": person,
|
||||||
|
// 'backgroundImg':
|
||||||
|
// 'assets/images/new_background.png',
|
||||||
|
// 'date': DateTime.now()
|
||||||
|
// .millisecondsSinceEpoch,
|
||||||
|
// 'person_show': false,
|
||||||
|
// 'reportPadding': false,
|
||||||
|
// },
|
||||||
|
// );
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
colors: [
|
colors: [
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ class _CommonMessageSettingPageState extends State<CommonMessageSettingPage> {
|
|||||||
children: [
|
children: [
|
||||||
/// 居中标题
|
/// 居中标题
|
||||||
Text(
|
Text(
|
||||||
'消息通知'.tr,
|
'通知设置'.tr,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontFamily: 'ReadexPro',
|
fontFamily: 'ReadexPro',
|
||||||
color: themeController.currentColor.sc3,
|
color: themeController.currentColor.sc3,
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import 'package:vbvs_app/controller/theme_controller/ThemeController.dart';
|
|||||||
import 'package:vbvs_app/controller/user_info_controller.dart';
|
import 'package:vbvs_app/controller/user_info_controller.dart';
|
||||||
import 'package:vbvs_app/main.dart';
|
import 'package:vbvs_app/main.dart';
|
||||||
import 'package:vbvs_app/pages/main_bottom/component/main_page_b_bottom_change.dart';
|
import 'package:vbvs_app/pages/main_bottom/component/main_page_b_bottom_change.dart';
|
||||||
|
import 'package:vbvs_app/pages/mh_page/CommonMessageSettingPage.dart';
|
||||||
import 'package:vbvs_app/pages/mh_page/HomeDeviceType.dart';
|
import 'package:vbvs_app/pages/mh_page/HomeDeviceType.dart';
|
||||||
import 'package:vbvs_app/pages/mh_page/LanguagePage.dart';
|
import 'package:vbvs_app/pages/mh_page/LanguagePage.dart';
|
||||||
import 'package:vbvs_app/pages/mh_page/ShareDeviceDetailWidget.dart';
|
import 'package:vbvs_app/pages/mh_page/ShareDeviceDetailWidget.dart';
|
||||||
@@ -138,6 +139,7 @@ var mhroutes = {
|
|||||||
UserPrivacyNewPage(sleepUri: arguments),
|
UserPrivacyNewPage(sleepUri: arguments),
|
||||||
"/privacyPolicyPageNew": (contxt, {arguments}) =>
|
"/privacyPolicyPageNew": (contxt, {arguments}) =>
|
||||||
PrivacyPolicyNewPage(sleepUri: arguments),
|
PrivacyPolicyNewPage(sleepUri: arguments),
|
||||||
|
"/commonMessageSettingPage": (contxt) => MHTCommonMessageSettingPage(),
|
||||||
};
|
};
|
||||||
var mhonGenerateRoute = (RouteSettings settings) {
|
var mhonGenerateRoute = (RouteSettings settings) {
|
||||||
final String? name = settings.name; // 获取路由名称,如 /news 或 /search
|
final String? name = settings.name; // 获取路由名称,如 /news 或 /search
|
||||||
@@ -159,8 +161,7 @@ var mhonGenerateRoute = (RouteSettings settings) {
|
|||||||
settings.name != "/privacyPolicyPage" &&
|
settings.name != "/privacyPolicyPage" &&
|
||||||
settings.name != "/auth_bind_tel" &&
|
settings.name != "/auth_bind_tel" &&
|
||||||
settings.name != "/userPolicyPageNew" &&
|
settings.name != "/userPolicyPageNew" &&
|
||||||
settings.name != "/privacyPolicyPageNew"
|
settings.name != "/privacyPolicyPageNew") {
|
||||||
) {
|
|
||||||
// TopSlideNotification.show(
|
// TopSlideNotification.show(
|
||||||
// navigatorKey.currentContext!,
|
// navigatorKey.currentContext!,
|
||||||
// text: "必须登录提示".tr,
|
// text: "必须登录提示".tr,
|
||||||
|
|||||||
@@ -12,14 +12,12 @@ import flutter_inappwebview_macos
|
|||||||
import flutter_localization
|
import flutter_localization
|
||||||
import geolocator_apple
|
import geolocator_apple
|
||||||
import mobile_scanner
|
import mobile_scanner
|
||||||
import package_info_plus
|
|
||||||
import path_provider_foundation
|
import path_provider_foundation
|
||||||
import rive_common
|
import rive_common
|
||||||
|
import share_plus
|
||||||
import shared_preferences_foundation
|
import shared_preferences_foundation
|
||||||
import sqflite_darwin
|
import sqflite_darwin
|
||||||
import url_launcher_macos
|
import url_launcher_macos
|
||||||
import video_player_avfoundation
|
|
||||||
import wakelock_plus
|
|
||||||
import webview_flutter_wkwebview
|
import webview_flutter_wkwebview
|
||||||
|
|
||||||
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
||||||
@@ -30,13 +28,11 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
|||||||
FlutterLocalizationPlugin.register(with: registry.registrar(forPlugin: "FlutterLocalizationPlugin"))
|
FlutterLocalizationPlugin.register(with: registry.registrar(forPlugin: "FlutterLocalizationPlugin"))
|
||||||
GeolocatorPlugin.register(with: registry.registrar(forPlugin: "GeolocatorPlugin"))
|
GeolocatorPlugin.register(with: registry.registrar(forPlugin: "GeolocatorPlugin"))
|
||||||
MobileScannerPlugin.register(with: registry.registrar(forPlugin: "MobileScannerPlugin"))
|
MobileScannerPlugin.register(with: registry.registrar(forPlugin: "MobileScannerPlugin"))
|
||||||
FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin"))
|
|
||||||
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
|
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
|
||||||
RivePlugin.register(with: registry.registrar(forPlugin: "RivePlugin"))
|
RivePlugin.register(with: registry.registrar(forPlugin: "RivePlugin"))
|
||||||
|
SharePlusMacosPlugin.register(with: registry.registrar(forPlugin: "SharePlusMacosPlugin"))
|
||||||
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
|
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
|
||||||
SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin"))
|
SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin"))
|
||||||
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
|
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
|
||||||
FVPVideoPlayerPlugin.register(with: registry.registrar(forPlugin: "FVPVideoPlayerPlugin"))
|
|
||||||
WakelockPlusMacosPlugin.register(with: registry.registrar(forPlugin: "WakelockPlusMacosPlugin"))
|
|
||||||
WebViewFlutterPlugin.register(with: registry.registrar(forPlugin: "WebViewFlutterPlugin"))
|
WebViewFlutterPlugin.register(with: registry.registrar(forPlugin: "WebViewFlutterPlugin"))
|
||||||
}
|
}
|
||||||
|
|||||||
104
pubspec.lock
104
pubspec.lock
@@ -271,14 +271,6 @@ packages:
|
|||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.3"
|
version: "2.0.3"
|
||||||
chewie:
|
|
||||||
dependency: "direct main"
|
|
||||||
description:
|
|
||||||
name: chewie
|
|
||||||
sha256: "645fbca3f22309381edb5af59a4c8aa544a3d3872d7b7b7c986c2b18b3bdd265"
|
|
||||||
url: "https://pub.flutter-io.cn"
|
|
||||||
source: hosted
|
|
||||||
version: "1.10.0"
|
|
||||||
clock:
|
clock:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -1087,6 +1079,14 @@ packages:
|
|||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.1.2"
|
version: "0.1.2"
|
||||||
|
jpush_flutter:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: jpush_flutter
|
||||||
|
sha256: "1cb79c45351bca20861fece94d4cf92e6330e95f0a3e15893cca0ce877f54cb4"
|
||||||
|
url: "https://pub.flutter-io.cn"
|
||||||
|
source: hosted
|
||||||
|
version: "3.3.6"
|
||||||
js:
|
js:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -1335,22 +1335,6 @@ packages:
|
|||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.2.0"
|
version: "2.2.0"
|
||||||
package_info_plus:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: package_info_plus
|
|
||||||
sha256: "16eee997588c60225bda0488b6dcfac69280a6b7a3cf02c741895dd370a02968"
|
|
||||||
url: "https://pub.flutter-io.cn"
|
|
||||||
source: hosted
|
|
||||||
version: "8.3.1"
|
|
||||||
package_info_plus_platform_interface:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: package_info_plus_platform_interface
|
|
||||||
sha256: "202a487f08836a592a6bd4f901ac69b3a8f146af552bbd14407b6b41e1c3f086"
|
|
||||||
url: "https://pub.flutter-io.cn"
|
|
||||||
source: hosted
|
|
||||||
version: "3.2.1"
|
|
||||||
packages_extensions:
|
packages_extensions:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -1703,6 +1687,22 @@ packages:
|
|||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.2.3"
|
version: "0.2.3"
|
||||||
|
share_plus:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: share_plus
|
||||||
|
sha256: d7dc0630a923883c6328ca31b89aa682bacbf2f8304162d29f7c6aaff03a27a1
|
||||||
|
url: "https://pub.flutter-io.cn"
|
||||||
|
source: hosted
|
||||||
|
version: "11.1.0"
|
||||||
|
share_plus_platform_interface:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: share_plus_platform_interface
|
||||||
|
sha256: "88023e53a13429bd65d8e85e11a9b484f49d4c190abbd96c7932b74d6927cc9a"
|
||||||
|
url: "https://pub.flutter-io.cn"
|
||||||
|
source: hosted
|
||||||
|
version: "6.1.0"
|
||||||
shared_preferences:
|
shared_preferences:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -2132,46 +2132,6 @@ packages:
|
|||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.4"
|
version: "2.1.4"
|
||||||
video_player:
|
|
||||||
dependency: "direct main"
|
|
||||||
description:
|
|
||||||
name: video_player
|
|
||||||
sha256: "7d78f0cfaddc8c19d4cb2d3bebe1bfef11f2103b0a03e5398b303a1bf65eeb14"
|
|
||||||
url: "https://pub.flutter-io.cn"
|
|
||||||
source: hosted
|
|
||||||
version: "2.9.5"
|
|
||||||
video_player_android:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: video_player_android
|
|
||||||
sha256: "391e092ba4abe2f93b3e625bd6b6a6ec7d7414279462c1c0ee42b5ab8d0a0898"
|
|
||||||
url: "https://pub.flutter-io.cn"
|
|
||||||
source: hosted
|
|
||||||
version: "2.7.16"
|
|
||||||
video_player_avfoundation:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: video_player_avfoundation
|
|
||||||
sha256: "9ee764e5cd2fc1e10911ae8ad588e1a19db3b6aa9a6eb53c127c42d3a3c3f22f"
|
|
||||||
url: "https://pub.flutter-io.cn"
|
|
||||||
source: hosted
|
|
||||||
version: "2.7.1"
|
|
||||||
video_player_platform_interface:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: video_player_platform_interface
|
|
||||||
sha256: df534476c341ab2c6a835078066fc681b8265048addd853a1e3c78740316a844
|
|
||||||
url: "https://pub.flutter-io.cn"
|
|
||||||
source: hosted
|
|
||||||
version: "6.3.0"
|
|
||||||
video_player_web:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: video_player_web
|
|
||||||
sha256: e8bba2e5d1e159d5048c9a491bb2a7b29c535c612bb7d10c1e21107f5bd365ba
|
|
||||||
url: "https://pub.flutter-io.cn"
|
|
||||||
source: hosted
|
|
||||||
version: "2.3.5"
|
|
||||||
vm_service:
|
vm_service:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -2188,22 +2148,6 @@ packages:
|
|||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.4.6"
|
version: "0.4.6"
|
||||||
wakelock_plus:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: wakelock_plus
|
|
||||||
sha256: a474e314c3e8fb5adef1f9ae2d247e57467ad557fa7483a2b895bc1b421c5678
|
|
||||||
url: "https://pub.flutter-io.cn"
|
|
||||||
source: hosted
|
|
||||||
version: "1.3.2"
|
|
||||||
wakelock_plus_platform_interface:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: wakelock_plus_platform_interface
|
|
||||||
sha256: e10444072e50dbc4999d7316fd303f7ea53d31c824aa5eb05d7ccbdd98985207
|
|
||||||
url: "https://pub.flutter-io.cn"
|
|
||||||
source: hosted
|
|
||||||
version: "1.2.3"
|
|
||||||
watcher:
|
watcher:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|||||||
12
pubspec.yaml
12
pubspec.yaml
@@ -8,8 +8,8 @@ environment:
|
|||||||
sdk: ^3.5.4
|
sdk: ^3.5.4
|
||||||
|
|
||||||
fluwx:
|
fluwx:
|
||||||
# app_id: 'wx929c548fea6af9c7' #填写自己的 WeChat app id.眠花糖
|
app_id: 'wx929c548fea6af9c7' #填写自己的 WeChat app id.眠花糖
|
||||||
app_id: 'wxeb2688220799e2c5' #填写自己的 WeChat app id.太和e护
|
# app_id: 'wxeb2688220799e2c5' #填写自己的 WeChat app id.太和e护
|
||||||
debug_logging: false # Logging in debug mode.
|
debug_logging: false # Logging in debug mode.
|
||||||
android:
|
android:
|
||||||
# interrupt_wx_request: true # Defaults to true.
|
# interrupt_wx_request: true # Defaults to true.
|
||||||
@@ -70,17 +70,17 @@ dependencies:
|
|||||||
weather: ^3.1.1
|
weather: ^3.1.1
|
||||||
lpinyin: ^2.0.3
|
lpinyin: ^2.0.3
|
||||||
geocoding: ^4.0.0
|
geocoding: ^4.0.0
|
||||||
video_player: ^2.9.5
|
# video_player: ^2.9.5
|
||||||
chewie: ^1.10.0
|
# chewie: ^1.10.0
|
||||||
map_launcher: ^3.5.0
|
map_launcher: ^3.5.0
|
||||||
|
|
||||||
|
|
||||||
gif: ^2.3.0
|
gif: ^2.3.0
|
||||||
easyweb:
|
easyweb:
|
||||||
git:
|
git:
|
||||||
url: https://gitea.wslpc.real.he-info.cn:94/flutter/easyweb.git
|
url: https://gitea.wslpc.real.he-info.cn:94/flutter/easyweb.git
|
||||||
ref: main
|
ref: main
|
||||||
archive: ^4.0.0
|
archive: ^4.0.0
|
||||||
|
jpush_flutter: ^3.3.6
|
||||||
|
share_plus: ^11.1.0
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
#include <geolocator_windows/geolocator_windows.h>
|
#include <geolocator_windows/geolocator_windows.h>
|
||||||
#include <permission_handler_windows/permission_handler_windows_plugin.h>
|
#include <permission_handler_windows/permission_handler_windows_plugin.h>
|
||||||
#include <rive_common/rive_plugin.h>
|
#include <rive_common/rive_plugin.h>
|
||||||
|
#include <share_plus/share_plus_windows_plugin_c_api.h>
|
||||||
#include <url_launcher_windows/url_launcher_windows.h>
|
#include <url_launcher_windows/url_launcher_windows.h>
|
||||||
|
|
||||||
void RegisterPlugins(flutter::PluginRegistry* registry) {
|
void RegisterPlugins(flutter::PluginRegistry* registry) {
|
||||||
@@ -27,6 +28,8 @@ void RegisterPlugins(flutter::PluginRegistry* registry) {
|
|||||||
registry->GetRegistrarForPlugin("PermissionHandlerWindowsPlugin"));
|
registry->GetRegistrarForPlugin("PermissionHandlerWindowsPlugin"));
|
||||||
RivePluginRegisterWithRegistrar(
|
RivePluginRegisterWithRegistrar(
|
||||||
registry->GetRegistrarForPlugin("RivePlugin"));
|
registry->GetRegistrarForPlugin("RivePlugin"));
|
||||||
|
SharePlusWindowsPluginCApiRegisterWithRegistrar(
|
||||||
|
registry->GetRegistrarForPlugin("SharePlusWindowsPluginCApi"));
|
||||||
UrlLauncherWindowsRegisterWithRegistrar(
|
UrlLauncherWindowsRegisterWithRegistrar(
|
||||||
registry->GetRegistrarForPlugin("UrlLauncherWindows"));
|
registry->GetRegistrarForPlugin("UrlLauncherWindows"));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ list(APPEND FLUTTER_PLUGIN_LIST
|
|||||||
geolocator_windows
|
geolocator_windows
|
||||||
permission_handler_windows
|
permission_handler_windows
|
||||||
rive_common
|
rive_common
|
||||||
|
share_plus
|
||||||
url_launcher_windows
|
url_launcher_windows
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -90,12 +90,12 @@ BEGIN
|
|||||||
BLOCK "040904e4"
|
BLOCK "040904e4"
|
||||||
BEGIN
|
BEGIN
|
||||||
VALUE "CompanyName", "com.example" "\0"
|
VALUE "CompanyName", "com.example" "\0"
|
||||||
VALUE "FileDescription", "com.taihe.vbvs_app" "\0"
|
VALUE "FileDescription", "com.taihe.mianhuatang" "\0"
|
||||||
VALUE "FileVersion", VERSION_AS_STRING "\0"
|
VALUE "FileVersion", VERSION_AS_STRING "\0"
|
||||||
VALUE "InternalName", "com.taihe.vbvs_app" "\0"
|
VALUE "InternalName", "com.taihe.mianhuatang" "\0"
|
||||||
VALUE "LegalCopyright", "Copyright (C) 2025 com.example. All rights reserved." "\0"
|
VALUE "LegalCopyright", "Copyright (C) 2025 com.example. All rights reserved." "\0"
|
||||||
VALUE "OriginalFilename", "com.taihe.vbvs_app.exe" "\0"
|
VALUE "OriginalFilename", "com.taihe.mianhuatang.exe" "\0"
|
||||||
VALUE "ProductName", "com.taihe.vbvs_app" "\0"
|
VALUE "ProductName", "com.taihe.mianhuatang" "\0"
|
||||||
VALUE "ProductVersion", VERSION_AS_STRING "\0"
|
VALUE "ProductVersion", VERSION_AS_STRING "\0"
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
|
|||||||
Reference in New Issue
Block a user