# Conflicts:
#	star_lock/lib/main/lockDetail/lcokSet/basicInformation/basicInformation/basicInformation_page.dart
#	star_lock/lib/network/api.dart
This commit is contained in:
魏少阳 2024-01-18 11:35:26 +08:00
commit 8e57e6e459
30 changed files with 705 additions and 402 deletions

View File

@ -0,0 +1,49 @@
{
"config": {
"emas.appKey":"333904040",
"emas.appSecret":"c316965fe0a74fc9a481a5c44a535dc2",
"emas.packageName":"com.example.star_lock",
"hotfix.idSecret":"333904040-1",
"hotfix.rsaSecret":"MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCTjeqT4cX/VTcInnWLLxo2f+0W1vKfPLwpHr9rYeW1pELlySFFeDusdaV8vBBYRE2A4Mti6wuVRCw67YIif7gK+ZLipALWob/cPxC4pcbqJ0S5QznM8qPW2nheWhvuZA9SenO5OyNnQvhBeSMK0VaGBnCBrznm52Mq7yb1cQDlosGtTwDgezt5073xDJFhefYg7BzurAlCgmS4BRX0l1i5GWsv+R5hWLWyhO+dI2deArgbYiW0575f5L1zywJ4BJ/3qOgsJoSflLgtTVLlmbAXI1Xo023UWtfnnowH71avDn+SQ5agqZepp6pkoXiFhC7DN9gLTknHTb03mDHODOW1AgMBAAECggEADrs5c0A0M1S/pNWlKJswQ8ar1f7pxCodIwHV3JOuil726tgUwUnKs2Iffn+MJjPThQ1sYNjUlDd1LwDtYCJeLoJSPtxfCCyn6gZF1hl+7Xu0Kcbja2nCH746DDl01m0Y9oQRL6oO081k2ayNahQSTlkwPFJRNpNdXDj6K8D3dPWPCBw7ECFKYpoDmPt+lNwqPPIWlVwYFRwhhCRuSPZsejO+a65gWZhm6uWDkh/EtPzdCIkrpfxbfqSnM6t+WHKmA3Gmm6AiwNLrzUGJ5lIsLXNuvaXFpsjBpVq7x9Ff86Cj0vJ7wdIRn7sP1Wlw6SosKZZwn9+zDLQU0Prge0Mn9QKBgQDKFXnzWqdmG6PxykyHJrXeLvQyMBdy6x91lmNSYGxYYEG2Tr1LR+P5r1oL/VRmuT43qWxubL7gEMqMGOVEMwKN6cEBTFDIOyqpNgR5Nnt0DrYMDhca3Wxc1/SkzuaVsRPHAKn8bChWGtq58/VuuZIY8SRVTWLgRWrnXFWCbKq0QwKBgQC67AVJwymxxIYt7UVRxtihd84SIGhRluEXG3O8PzK7Je5qDgBkLc+khnTvnGQyG7AJwtMpIbzmzJyu76pjiga1XJnYCO1QXhayMRlieSkrk2C4u9hnmeni24iGDUkV7yCnwsTjFaQ3lq1XtrJJKB9rUeBndXwuN06lTIqokSuapwKBgQCYCEpEHCqediMEMDcc4rGmo1qSO34Yte1oEKlOez5nypsFZf2hmkdYPGUZahBKbAjz5WGvPd7oQZmwhrZNdbbxPzA2Is0Ppvu0a/A3pRaBvOOW9C7LxlPVEZ97MjFl4t/HMqewQUqjZPazOWenUrMoUpsMFflSUsdXoi6uvcQ7cwKBgGNS1tyDH7yeOM5erd7uUl46Uv2+yq/QBHtK0wzMaCCZ3z3rgrm4vgUmjSxlZbhajgghxiKtErtxLjCmmVubFEV6lyT8WV3DITw+asawqvfEsDh5WFx0pJsvHDRfCt7k2e1KyWQBM+l131Ykdkf5Ufis4RkYjIviR5/+NA+uVAUxAoGAEIrRsaTDij9AX3/wD0XpDavFJdHzkvX259b6v0aASVoYlzAfj5bh1fZI90ex+MDibx3UyhHOVS2kk6q/TPAoevVlfS6IDfV0VJJZvie52qumfhttBpvH302rzrdEiZEhRd2UuKkBw7hsW+NlJEmoV0tj3xiP2vLLPnsaua9F3/g=",
"httpdns.accountId":"125761",
"httpdns.secretKey":"f77f39c6f0e66d7c169aa7e8d87dfe13",
"appmonitor.tlog.rsaSecret":"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCEYcyLDY/8H6714r5FuRuv94oWLod90sa5dwcJ5l8GmRMscFPxMXt9cNiKwL7zqPCWws+ApSfHczFnRgvZQX/p/t0U1nPNdotLqkLuzXNBim+TpfNnCvIoiVujAGXwdIGo7oaxci9+VV/1TFs5lm9M1wsreT2u+62cCqi/h16ZkQIDAQAB",
"appmonitor.rsaSecret":"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCEYcyLDY/8H6714r5FuRuv94oWLod90sa5dwcJ5l8GmRMscFPxMXt9cNiKwL7zqPCWws+ApSfHczFnRgvZQX/p/t0U1nPNdotLqkLuzXNBim+TpfNnCvIoiVujAGXwdIGo7oaxci9+VV/1TFs5lm9M1wsreT2u+62cCqi/h16ZkQIDAQAB"
},
"services": {
"hotfix_service":{
"status":1,
"version":"3.3.9"
},
"ha-adapter_service":{
"status":1,
"version":"1.2.3.0-open"
},
"feedback_service":{
"status":1,
"version":"3.4.2"
},
"tlog_service":{
"status":1,
"version":"1.1.7.0-open"
},
"httpdns_service":{
"status":1,
"version":"2.3.3"
},
"apm_service":{
"status":1,
"version":"1.1.3.0-open"
},
"man_service":{
"status":1,
"version":"1.2.7"
},
"cps_service":{
"status":1,
"version":"3.8.8.1"
}
},
"use_maven":true,
"proguard_keeplist":"\n#httpdns\n-keep class com.taobao.** {*;}\n-keep class com.alibaba.** {*;}\n-keep class com.ta.**{*;}\n-keep class com.ut.**{*;}\n-dontwarn com.taobao.**\n-dontwarn com.alibaba.**\n-dontwarn com.ta.**\n-dontwarn com.ut.**\n\n#cps\n-keep class com.taobao.** {*;}\n-keep class com.alibaba.** {*;}\n-keep class com.ta.**{*;}\n-keep class com.ut.**{*;}\n-dontwarn com.taobao.**\n-dontwarn com.alibaba.**\n-dontwarn com.ta.**\n-dontwarn com.ut.**\n-keepclasseswithmembernames class ** {\nnative <methods>;\n}\n-keepattributes Signature\n-keep class sun.misc.Unsafe { *; }\n-keep class com.alipay.** {*;}\n-dontwarn com.alipay.**\n-keep class anet.**{*;}\n-keep class org.android.spdy.**{*;}\n-keep class org.android.agoo.**{*;}\n-dontwarn anet.**\n-dontwarn org.android.spdy.**\n-dontwarn org.android.agoo.**\n\n#hotfix\n#基线包使用生成mapping.txt\n-printmapping mapping.txt\n#生成的mapping.txt在app/buidl/outputs/mapping/release路径下移动到/app路径下\n#修复后的项目使用,保证混淆结果一致\n#-applymapping mapping.txt\n#hotfix\n-keep class com.taobao.sophix.**{*;}\n-keep class com.ta.utdid2.device.**{*;}\n#防止inline\n-dontoptimize\n\n#man\n-keep class com.taobao.** {*;}\n-keep class com.alibaba.** {*;}\n-keep class com.ta.**{*;}\n-keep class com.ut.**{*;}\n-dontwarn com.taobao.**\n-dontwarn com.alibaba.**\n-dontwarn com.ta.**\n-dontwarn com.ut.**\n\n#feedback\n-keep class com.taobao.** {*;}\n-keep class com.alibaba.** {*;}\n-keep class com.ta.**{*;}\n-keep class com.ut.**{*;}\n-dontwarn com.taobao.**\n-dontwarn com.alibaba.**\n-dontwarn com.ta.**\n-dontwarn com.ut.**\n"
}

View File

@ -52,7 +52,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 "cn.starlock.lock" applicationId "com.example.star_lock"
// 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-build-configuration. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
// minSdkVersion flutter.minSdkVersion // minSdkVersion flutter.minSdkVersion

View File

@ -15,6 +15,7 @@
<!--允许获取设备和运营商信息用于问题排查和网络定位无gps情况下的定位若需网络定位功能则必选--> <!--允许获取设备和运营商信息用于问题排查和网络定位无gps情况下的定位若需网络定位功能则必选-->
<uses-permission android:name="android.permission.READ_PHONE_STATE" /> <uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_NUMBERS" />
<!--允许获取网络状态用于网络定位无gps情况下的定位若需网络定位功能则必选--> <!--允许获取网络状态用于网络定位无gps情况下的定位若需网络定位功能则必选-->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
@ -78,5 +79,23 @@
android:name="flutterEmbedding" android:name="flutterEmbedding"
android:value="2" /> android:value="2" />
<meta-data android:name="com.amap.api.v2.apikey" android:value="11d49b3f4fc09c04a02bbb7500925ba2"> </meta-data> <meta-data android:name="com.amap.api.v2.apikey" android:value="11d49b3f4fc09c04a02bbb7500925ba2"> </meta-data>
<!-- 请填写你自己的- appKey -->
<meta-data android:name="com.alibaba.app.appkey" android:value="333904040"/>
<!-- 请填写你自己的appSecret -->
<meta-data android:name="com.alibaba.app.appsecret" android:value="c316965fe0a74fc9a481a5c44a535dc2"/>
</application> </application>
<!-- 消息接收监听器 (用户可自主扩展) -->
<receiver
android:name="com.example.star_lock.MyMessageReceiver"
android:exported="false" > <!-- 为保证receiver安全建议设置不可导出如需对其他应用开放可通过androidpermission进行限制 -->
<intent-filter>
<action android:name="com.alibaba.push2.action.NOTIFICATION_OPENED" />
</intent-filter>
<intent-filter>
<action android:name="com.alibaba.push2.action.NOTIFICATION_REMOVED" />
</intent-filter>
<intent-filter>
<action android:name="com.alibaba.sdk.android.push.RECEIVE" />
</intent-filter>
</receiver>
</manifest> </manifest>

View File

@ -0,0 +1,72 @@
package com.example.star_lock
import android.content.Context
import android.util.Log
import com.alibaba.sdk.android.push.MessageReceiver
import com.alibaba.sdk.android.push.notification.CPushMessage
class MyMessageReceiver : MessageReceiver() {
override fun onNotification(
context: Context?,
title: String,
summary: String,
extraMap: Map<String?, String?>
) {
// TODO处理推送通知
Log.e(
"MyMessageReceiver",
"Receive notification, title: $title, summary: $summary, extraMap: $extraMap"
)
}
override fun onMessage(context: Context?, cPushMessage: CPushMessage) {
Log.e(
"MyMessageReceiver",
"onMessage, messageId: " + cPushMessage.getMessageId() + ", title: " + cPushMessage.getTitle() + ", content:" + cPushMessage.getContent()
)
}
override fun onNotificationOpened(context: Context?, title: String, summary: String, extraMap: String) {
Log.e(
"MyMessageReceiver",
"onNotificationOpened, title: $title, summary: $summary, extraMap:$extraMap"
)
}
protected override fun onNotificationClickedWithNoAction(
context: Context?,
title: String,
summary: String,
extraMap: String
) {
Log.e(
"MyMessageReceiver",
"onNotificationClickedWithNoAction, title: $title, summary: $summary, extraMap:$extraMap"
)
}
protected override fun onNotificationReceivedInApp(
context: Context?,
title: String,
summary: String,
extraMap: Map<String?, String?>,
openType: Int,
openActivity: String,
openUrl: String
) {
Log.e(
"MyMessageReceiver",
"onNotificationReceivedInApp, title: $title, summary: $summary, extraMap:$extraMap, openType:$openType, openActivity:$openActivity, openUrl:$openUrl"
)
}
protected override fun onNotificationRemoved(context: Context?, messageId: String?) {
Log.e("MyMessageReceiver", "onNotificationRemoved")
}
companion object {
// 消息接收部分的LOG_TAG
const val REC_TAG = "receiver"
}
}

View File

@ -9,31 +9,13 @@
<uses-permission android:name="android.permission.WRITE_CONTACTS"/> <uses-permission android:name="android.permission.WRITE_CONTACTS"/>
<uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.INTERNET"/>
<application android:name="*****"> <application android:name="*****">
<!-- 请填写你自己的- appKey --> <!-- 请填写你自己的- appKey -->
<meta-data android:name="com.alibaba.app.appkey" android:value="333895262"/> <meta-data android:name="com.alibaba.app.appkey" android:value="333904040"/>
<!-- 请填写你自己的appSecret --> <!-- 请填写你自己的appSecret -->
<meta-data android:name="com.alibaba.app.appsecret" android:value="a82105a258e54aa1a129238164e23a51"/> <meta-data android:name="com.alibaba.app.appsecret" android:value="c316965fe0a74fc9a481a5c44a535dc2"/>
</application>
<!-- 消息接收监听器 (用户可自主扩展) -->
<receiver
android:name=".MyMessageReceiver"
android:exported="false"> <!-- 为保证receiver安全建议设置不可导出如需对其他应用开放可通过androidpermission进行限制 -->
<intent-filter>
<action android:name="com.alibaba.push2.action.NOTIFICATION_OPENED" />
</intent-filter>
<intent-filter>
<action android:name="com.alibaba.push2.action.NOTIFICATION_REMOVED" />
</intent-filter>
<intent-filter>
<action android:name="com.alibaba.sdk.android.push.RECEIVE" />
</intent-filter>
</receiver>
<application android:name="*****">
<!-- 华为通道的参数appid --> <!-- 华为通道的参数appid -->
<meta-data android:name="com.huawei.hms.client.appid" android:value="appid=xxxxx" /> <meta-data android:name="com.huawei.hms.client.appid" android:value="appid=xxxxx" />
@ -60,6 +42,21 @@
<meta-data android:name="com.gcm.push.applicationid" android:value="" /> <meta-data android:name="com.gcm.push.applicationid" android:value="" />
<meta-data android:name="com.gcm.push.projectid" android:value="" /> <meta-data android:name="com.gcm.push.projectid" android:value="" />
<meta-data android:name="com.gcm.push.api.key" android:value="" /> <meta-data android:name="com.gcm.push.api.key" android:value="" />
<!-- 消息接收监听器 (用户可自主扩展) -->
<receiver
android:name="com.example.star_lock.MyMessageReceiver"
android:exported="false" > <!-- 为保证receiver安全建议设置不可导出如需对其他应用开放可通过androidpermission进行限制 -->
<intent-filter>
<action android:name="com.alibaba.push2.action.NOTIFICATION_OPENED" />
</intent-filter>
<intent-filter>
<action android:name="com.alibaba.push2.action.NOTIFICATION_REMOVED" />
</intent-filter>
<intent-filter>
<action android:name="com.alibaba.sdk.android.push.RECEIVE" />
</intent-filter>
</receiver>
</application> </application>
</manifest> </manifest>

View File

@ -202,6 +202,7 @@
"videoIntercomDoorLock":"Video intercom door lock", "videoIntercomDoorLock":"Video intercom door lock",
"NFCPassiveLock":"NFC Passive Lock", "NFCPassiveLock":"NFC Passive Lock",
"addDevice":"Add device", "addDevice":"Add device",
"shoppingCart":"Lock Mall",
"gateway":"Gateway", "gateway":"Gateway",
"message":"Message", "message":"Message",
"supportStaff":"Support Staff", "supportStaff":"Support Staff",

View File

@ -202,6 +202,7 @@
"videoIntercomDoorLock":"videoIntercomDoorLock", "videoIntercomDoorLock":"videoIntercomDoorLock",
"NFCPassiveLock":"NFCPassiveLock", "NFCPassiveLock":"NFCPassiveLock",
"addDevice":"addDevice", "addDevice":"addDevice",
"shoppingCart":"shoppingCart",
"gateway":"gateway", "gateway":"gateway",
"message":"message", "message":"message",
"supportStaff":"supportStaff", "supportStaff":"supportStaff",

View File

@ -202,6 +202,7 @@
"videoIntercomDoorLock":"可视对讲门锁", "videoIntercomDoorLock":"可视对讲门锁",
"NFCPassiveLock":"NFC无源锁", "NFCPassiveLock":"NFC无源锁",
"addDevice":"添加设备", "addDevice":"添加设备",
"shoppingCart":"配件商城",
"gateway":"网关", "gateway":"网关",
"message":"消息", "message":"消息",
"supportStaff":"客服", "supportStaff":"客服",

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

@ -12,6 +12,7 @@ import 'package:star_lock/main/lockDetail/lcokSet/catEyeSet/catEyeSet/catEyeSet_
import 'package:star_lock/main/lockDetail/lcokSet/catEyeSet/videoSlot/videoSlot_page.dart'; import 'package:star_lock/main/lockDetail/lcokSet/catEyeSet/videoSlot/videoSlot_page.dart';
import 'package:star_lock/main/lockDetail/lcokSet/faceUnlock/faceUnlock_page.dart'; import 'package:star_lock/main/lockDetail/lcokSet/faceUnlock/faceUnlock_page.dart';
import 'package:star_lock/main/lockDetail/lcokSet/familyDetails/familyDetails_page.dart'; import 'package:star_lock/main/lockDetail/lcokSet/familyDetails/familyDetails_page.dart';
import 'package:star_lock/main/lockDetail/lcokSet/liveVideo/liveVideo_page.dart';
import 'package:star_lock/main/lockDetail/lcokSet/lockUser/lockUser_page.dart'; import 'package:star_lock/main/lockDetail/lcokSet/lockUser/lockUser_page.dart';
import 'package:star_lock/main/lockDetail/lcokSet/motorPower/motorPower_page.dart'; import 'package:star_lock/main/lockDetail/lcokSet/motorPower/motorPower_page.dart';
import 'package:star_lock/main/lockDetail/lcokSet/msgNotification/msgNotification/msgNotification_page.dart'; import 'package:star_lock/main/lockDetail/lcokSet/msgNotification/msgNotification/msgNotification_page.dart';
@ -143,6 +144,7 @@ import 'mine/gateway/addGateway/seletGatewayTypeNextTip/seletGatewayTypeNextTip_
import 'mine/gateway/gatewayConnectionLock/gatewayConnectionLockList_page.dart'; import 'mine/gateway/gatewayConnectionLock/gatewayConnectionLockList_page.dart';
import 'mine/gateway/gatewayDetail/gatewayDetail_page.dart'; import 'mine/gateway/gatewayDetail/gatewayDetail_page.dart';
import 'mine/gateway/gatewayList/gatewayList_page.dart'; import 'mine/gateway/gatewayList/gatewayList_page.dart';
import 'mine/mall/mall_page.dart';
import 'mine/message/messageList_page.dart'; import 'mine/message/messageList_page.dart';
import 'mine/mine/starLockMine_page.dart'; import 'mine/mine/starLockMine_page.dart';
import 'mine/mineMultiLanguage/mineMultiLanguage_page.dart'; import 'mine/mineMultiLanguage/mineMultiLanguage_page.dart';
@ -182,6 +184,7 @@ abstract class Routers {
static const starLockMain = '/StarLockMain'; // static const starLockMain = '/StarLockMain'; //
static const starLockMinePage = '/StarLockMinePage'; // static const starLockMinePage = '/StarLockMinePage'; //
static const seletLockTypePage = '/SeletLockTypePage'; // static const seletLockTypePage = '/SeletLockTypePage'; //
static const LockMallPage = '/LockMallPage'; //
static const addLockPage = '/AddLockPage'; // static const addLockPage = '/AddLockPage'; //
static const nearbyLockPage = '/NearbyLockPage'; // static const nearbyLockPage = '/NearbyLockPage'; //
static const lockAddressPage = '/LockAddressPage'; // static const lockAddressPage = '/LockAddressPage'; //
@ -414,6 +417,7 @@ abstract class Routers {
static const doorLockLogPage = '/doorLockLogPage'; // static const doorLockLogPage = '/doorLockLogPage'; //
static const catEyeCustomModePage = '/catEyeCustomModePage'; // static const catEyeCustomModePage = '/catEyeCustomModePage'; //
static const videoSlotPage = '/videoSlotPage'; // static const videoSlotPage = '/videoSlotPage'; //
static const liveVideoPage = '/liveVideoPage'; //
} }
abstract class AppRouters { abstract class AppRouters {
@ -434,6 +438,10 @@ abstract class AppRouters {
name: Routers.seletLockTypePage, name: Routers.seletLockTypePage,
page: () => const SeletLockTypePage(), page: () => const SeletLockTypePage(),
), ),
GetPage(
name: Routers.LockMallPage,
page: () => const LockMallPage(),
),
GetPage( GetPage(
name: Routers.addLockPage, name: Routers.addLockPage,
page: () => const AddLockPage(), page: () => const AddLockPage(),
@ -1005,5 +1013,6 @@ abstract class AppRouters {
name: Routers.catEyeCustomModePage, name: Routers.catEyeCustomModePage,
page: () => const CatEyeCustomModePage()), page: () => const CatEyeCustomModePage()),
GetPage(name: Routers.videoSlotPage, page: (() => const VideoSlotPage())), GetPage(name: Routers.videoSlotPage, page: (() => const VideoSlotPage())),
GetPage(name: Routers.liveVideoPage, page: (() => const LiveVideoPage()))
]; ];
} }

View File

@ -1,22 +1,16 @@
import 'package:aliyun_push/aliyun_push.dart'; import 'package:aliyun_push/aliyun_push.dart';
import 'package:audioplayers/audioplayers.dart';
// import 'package:audioplayers/audioplayers.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:flutter_pcm_sound/flutter_pcm_sound.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_sound/flutter_sound.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:permission_handler/permission_handler.dart'; import 'package:permission_handler/permission_handler.dart';
import 'package:star_lock/talk/udp/udp_talkClass.dart';
import 'package:star_lock/tools/app_manager.dart'; import 'package:star_lock/tools/app_manager.dart';
import 'package:star_lock/tools/bindings/app_binding.dart'; import 'package:star_lock/tools/bindings/app_binding.dart';
import 'package:star_lock/tools/device_info_service.dart'; import 'package:star_lock/tools/device_info_service.dart';
import 'package:star_lock/tools/platform_info_services.dart'; import 'package:star_lock/tools/platform_info_services.dart';
import 'package:star_lock/tools/storage.dart'; import 'package:star_lock/tools/storage.dart';
import 'package:star_lock/tools/xs_aliyunPush.dart'; import 'package:star_lock/tools/xs_aliyunPush.dart';
// import 'package:star_lock/tools/store_service.dart';
import 'package:star_lock/translations/app_dept.dart'; import 'package:star_lock/translations/app_dept.dart';
import 'package:star_lock/translations/trans_lib.dart'; import 'package:star_lock/translations/trans_lib.dart';
@ -54,12 +48,6 @@ class MyApp extends StatefulWidget {
// final RouteObserver<PageRoute> routeObserver = RouteObserver<PageRoute>(); // final RouteObserver<PageRoute> routeObserver = RouteObserver<PageRoute>();
class _MyAppState extends State<MyApp> with WidgetsBindingObserver, BaseWidget { class _MyAppState extends State<MyApp> with WidgetsBindingObserver, BaseWidget {
final _aliyunPush = AliyunPush();
var _deviceId = "";
// final audioPlayer = AudioPlayer();
final FlutterSoundPlayer _audioPlayer = FlutterSoundPlayer();
late List<int> allDataBytes;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return ScreenUtilInit( return ScreenUtilInit(
@ -130,7 +118,7 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver, BaseWidget {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
WidgetsBinding.instance?.addObserver(this); WidgetsBinding.instance.addObserver(this);
openBlueScan(); openBlueScan();
@ -139,46 +127,30 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver, BaseWidget {
// //
void initAliyunPush() { void initAliyunPush() {
XSAliyunPushProvider().init(_aliyunPush); final aliyunPush = AliyunPush();
XSAliyunPushProvider().init(aliyunPush);
XSAliyunPushProvider().initAliyunPush(); XSAliyunPushProvider().initAliyunPush();
if (Platform.isAndroid) { if (Platform.isAndroid) {
XSAliyunPushProvider().initAliyunThirdPush(); XSAliyunPushProvider().initAliyunThirdPush();
} }
//使DeviceID推送 //使DeviceID推送
_aliyunPush.getDeviceId().then((deviceId) async { aliyunPush.getDeviceId().then((deviceId) async {
// print('得到的DeviceId$deviceId');
final data = await Storage.getString(saveUserLoginData); final data = await Storage.getString(saveUserLoginData);
if (data!.isNotEmpty) { if (data!.isNotEmpty && deviceId.isNotEmpty) {
XSAliyunPushProvider() XSAliyunPushProvider()
.pushBindDeviceID(deviceId, Platform.isAndroid ? 10 : 20); .pushBindDeviceID(deviceId, Platform.isAndroid ? 10 : 20);
} }
}); });
// //使userid根据账号推送
// _aliyunPush.bindAccount(Storage.getUid().toString()).then((value) {
// print("得到了value$value");
// });
} }
@override @override
void dispose() { void dispose() {
WidgetsBinding.instance?.removeObserver(this); WidgetsBinding.instance.removeObserver(this);
super.dispose(); super.dispose();
} }
void didChangeAppLifecycleState(AppLifecycleState state) {
if (state == AppLifecycleState.resumed) {
//
print("应用进入前台");
} else if (state == AppLifecycleState.paused) {
//
print("应用进入后台");
if (UDPTalkClass().isBeCall == true) {
UDPTalkClass().playLocalAudio();
}
}
}
} }
// //

View File

@ -244,9 +244,9 @@ class DoorLockLogLogic extends BaseGetXController {
// //
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot); var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
if (isDemoMode == false) { if (isDemoMode == false) {
_initReplySubscription(); // _initReplySubscription();
mockNetworkDataRequest(); // mockNetworkDataRequest();
} }
} }
@ -259,7 +259,7 @@ class DoorLockLogLogic extends BaseGetXController {
// //
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot); var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
if (isDemoMode == false) { if (isDemoMode == false) {
getLockRecordLastUploadDataTime(); // getLockRecordLastUploadDataTime();
// senderReferEventRecordTime(); // senderReferEventRecordTime();
// senderReferEventRecordNumber(); // senderReferEventRecordNumber();
} }

View File

@ -1,11 +1,9 @@
import 'package:cupertino_stepper/cupertino_stepper.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_advanced_calendar/flutter_advanced_calendar.dart'; import 'package:flutter_advanced_calendar/flutter_advanced_calendar.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:gzx_dropdown_menu/gzx_dropdown_menu.dart';
import 'package:star_lock/main/lockDetail/doorLockLog/doorLockLog_logic.dart'; import 'package:star_lock/main/lockDetail/doorLockLog/doorLockLog_logic.dart';
import 'package:timelines/timelines.dart';
import '../../../app_settings/app_colors.dart'; import '../../../app_settings/app_colors.dart';
import '../../../tools/storage.dart'; import '../../../tools/storage.dart';
@ -56,8 +54,7 @@ class _DoorLockLogPageState extends State<DoorLockLogPage> {
), ),
], ],
), ),
body: SingleChildScrollView( body: Column(
child: Column(
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -96,198 +93,81 @@ class _DoorLockLogPageState extends State<DoorLockLogPage> {
), ),
), ),
), ),
Stack( Row(children: [
key: state.stackKey, SizedBox(
children: <Widget>[ width: 30.w,
Column(
children: <Widget>[
_buildHeaderView(),
],
), ),
// GZXDropDownMenu目前只能在Stack内CustomScrollView和NestedScrollView Obx(() => DropdownButton<String>(
_buildDropDownMenu() value: state.dropdownValue.value,
], icon: const Icon(Icons.arrow_drop_down),
), iconSize: 40,
OrientationBuilder( elevation: 12,
builder: (BuildContext context, Orientation orientation) { style: TextStyle(fontSize: 26.sp, color: Colors.black),
switch (orientation) { iconEnabledColor: Colors.grey,
case Orientation.portrait: onChanged: (newValue) {
return _buildStepper(StepperType.vertical); state.dropdownValue.value = newValue!;
case Orientation.landscape:
return _buildStepper(StepperType.horizontal);
default:
throw UnimplementedError(orientation.toString());
}
}, },
), items: state.dropDownItemList.obs
], .map<DropdownMenuItem<String>>((item) {
), return DropdownMenuItem<String>(
), value: item,
child: Text(item),
); );
} }).toList(),
))
//GZXDropDownHeader ]),
Widget _buildHeaderView() { SizedBox(
return GZXDropDownHeader( height: 20.h,
// ),
items: [ Expanded(
GZXDropDownHeaderItem(state.dropDownDoorLockItem[0], iconSize: 36), child: Container(
], margin: EdgeInsets.only(left: 20.w, right: 20.w),
// GZXDropDownHeader对应第一父级Stack的key //contain设置一个10像素的圆角
stackKey: state.stackKey, decoration: BoxDecoration(
// controller用于控制menu的显示或隐藏 color: Colors.white, borderRadius: BorderRadius.circular(16.w)),
controller: state.dropdownMenuController, child: Timeline.tileBuilder(
// openEndDrawer builder: TimelineTileBuilder.fromStyle(
onItemTap: (index) {}, contentsAlign: ContentsAlign.basic,
// contentsBuilder: (context, index) => Padding(
height: 46, padding: EdgeInsets.all(24.0.w),
// child: Column(
color: Colors.white, mainAxisAlignment: MainAxisAlignment.start,
// crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('09:30 有人出现在门口',
textAlign: TextAlign.left,
style: TextStyle( style: TextStyle(
color: AppColors.darkGrayTextColor, fontSize: ScreenUtil().setSp(24)),
//
dropDownStyle: TextStyle(
fontSize: ScreenUtil().setSp(24),
color: AppColors.darkGrayTextColor, color: AppColors.darkGrayTextColor,
fontSize: 24.sp,
)),
SizedBox(
height: 10.h,
), ),
// const Image(
iconSize: 20, image: AssetImage(
// 'images/main/icon_lockDetail_monitoringvoiceFrist.png')),
iconColor: AppColors.greyBackgroundColor,
//
iconDropDownColor: AppColors.mainColor,
);
}
//
Widget _buildDropDownMenu() {
return Obx(() => GZXDropDownMenu(
// controller用于控制menu的显示或隐藏
controller: state.dropdownMenuController,
//
animationMilliseconds: 300,
//
// maskColor: Theme.of(context).primaryColor.withOpacity(0.5),
// maskColor: Colors.red.withOpacity(0.5),
dropdownMenuChanging: (isShow, index) {},
dropdownMenuChanged: (isShow, index) {},
// _dropdownMenuController.hide();
menus: [
GZXDropdownMenuBuilder(
dropDownHeight: 44.0.h * state.eventSortConditions.value.length,
dropDownWidget: _buildConditionListWidget(
state.eventSortConditions.value, (value) {
state.selectGroupSortCondition = value;
state.dropDownDoorLockItem[0] =
state.selectGroupSortCondition.name;
})),
], ],
));
}
_buildConditionListWidget(
items, void Function(SortCondition sortCondition) itemOnTap) {
return Container(
color: Colors.white,
child: ListView.separated(
physics: const NeverScrollableScrollPhysics(),
shrinkWrap: true,
scrollDirection: Axis.vertical,
itemCount: items.length,
// item
separatorBuilder: (BuildContext context, int index) =>
const Divider(height: 1.0),
// 线
itemBuilder: (BuildContext context, int index) {
return gestureDetector(items, index, itemOnTap, context);
},
), ),
); ),
} itemCount: 10,
),
GestureDetector gestureDetector( theme: TimelineThemeData(
items, nodePosition: 0.04, //
int index, connectorTheme: const ConnectorThemeData(
void Function(SortCondition sortCondition) itemOnTap, thickness: 2.0,
BuildContext context) { color: AppColors.greyBackgroundColor,
SortCondition goodsSortCondition = items[index]; indent: 0.5),
return GestureDetector( indicatorTheme: const IndicatorThemeData(
onTap: () { size: 16.0,
for (var value in items) { color: AppColors.greyBackgroundColor,
value.isSelected = false; position: 0.07),
} ),
goodsSortCondition.isSelected = true;
itemOnTap(goodsSortCondition);
},
child: SizedBox(
height: 44.h,
child: Center(
child: Obx(() => Text(
goodsSortCondition.name,
style: TextStyle(
color: goodsSortCondition.isSelected
? AppColors.mainColor
: Colors.black,
), ),
)), )),
),
));
}
CupertinoStepper _buildStepper(StepperType type) {
final canCancel = state.currentStep.value > 0;
final canContinue = state.currentStep.value < 3;
return CupertinoStepper(
type: type,
currentStep: state.currentStep.value,
onStepTapped: (step) => setState(() => state.currentStep.value = step),
onStepCancel:
canCancel ? () => setState(() => --state.currentStep.value) : null,
onStepContinue:
canContinue ? () => setState(() => ++state.currentStep.value) : null,
steps: [
for (var i = 0; i < 3; ++i)
_buildStep(
title: const Text(''),
isActive: i == state.currentStep.value,
state: i == state.currentStep.value
? StepState.editing
: i < state.currentStep.value
? StepState.complete
: StepState.indexed,
),
// _buildStep(
// title: Text('Error'),
// state: StepState.error,
// ),
// _buildStep(
// title: Text('Disabled'),
// state: StepState.disabled,
// )
], ],
);
}
Step _buildStep({
required Widget title,
StepState state = StepState.indexed,
bool isActive = false,
}) {
return Step(
title: title,
subtitle: const Text('10:45 有人出现在门口'),
state: state,
isActive: isActive,
content: LimitedBox(
maxWidth: 300,
maxHeight: 300,
child: Container(color: CupertinoColors.systemGrey),
), ),
); );
} }
}
String getTypeIcon(int type) { String getTypeIcon(int type) {
String title = 'images/controls_user.png'; String title = 'images/controls_user.png';
@ -313,13 +193,4 @@ String getTypeIcon(int type) {
} }
return title; return title;
} }
class SortCondition {
String name;
bool isSelected;
SortCondition({
required this.name,
required this.isSelected,
});
} }

View File

@ -1,8 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter_advanced_calendar/flutter_advanced_calendar.dart'; import 'package:flutter_advanced_calendar/flutter_advanced_calendar.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:gzx_dropdown_menu/gzx_dropdown_menu.dart';
import 'package:star_lock/main/lockDetail/doorLockLog/doorLockLog_page.dart';
import '../../lockMian/entity/lockListInfo_entity.dart'; import '../../lockMian/entity/lockListInfo_entity.dart';
import '../electronicKey/electronicKeyDetail/keyOperationRecordEntity.dart'; import '../electronicKey/electronicKeyDetail/keyOperationRecordEntity.dart';
@ -11,25 +8,14 @@ class DoorLockLogState {
final keyInfos = LockListInfoItemEntity().obs; final keyInfos = LockListInfoItemEntity().obs;
final lockOperatingRecordListData = <KeyRecordDataItem>[].obs; final lockOperatingRecordListData = <KeyRecordDataItem>[].obs;
final calendarControllerToday = AdvancedCalendarController.today(); final calendarControllerToday = AdvancedCalendarController.today();
final calendarControllerCustom = final calendarControllerCustom = AdvancedCalendarController.today();
AdvancedCalendarController(DateTime(2024, 01, 10));
final events = <DateTime>[ final events = <DateTime>[
DateTime.now(), DateTime.now(),
DateTime(2024, 10, 10), DateTime(2024, 10, 10),
]; ];
final eventSortConditions = [ var dropdownValue = '全部事件'.obs;
SortCondition(name: '全部事件', isSelected: true), final List dropDownItemList =
SortCondition(name: '门锁异常', isSelected: false), ['全部事件', '门锁异常', '有人出现', '有人按门铃', '一次性密码开门'].obs;
SortCondition(name: '有人出现', isSelected: false),
SortCondition(name: '有人按门铃', isSelected: false),
SortCondition(name: '一次性密码开门', isSelected: false)
].obs;
final List dropDownDoorLockItem = ['全部事件'];
final GZXDropdownMenuController dropdownMenuController =
GZXDropdownMenuController();
final scaffoldKey = GlobalKey<ScaffoldState>();
final GlobalKey stackKey = GlobalKey();
late SortCondition selectGroupSortCondition = eventSortConditions.value[0];
var currentStep = 0.obs; var currentStep = 0.obs;
DoorLockLogState() { DoorLockLogState() {

View File

@ -43,14 +43,14 @@ class _BasicInformationPageState extends State<BasicInformationPage> {
body: ListView( body: ListView(
children: [ children: [
CommonItem( CommonItem(
leftTitel: leftTitel: TranslationLoader.lanKeys!.lockNumber!.tr,
TranslationLoader.lanKeys!.lockNumber!.tr,
rightTitle: state.lockBasicInfo.value.lockName, rightTitle: state.lockBasicInfo.value.lockName,
allHeight: 70.h, allHeight: 70.h,
isHaveLine: true), isHaveLine: true),
CommonItem( CommonItem(
leftTitel: "MAC/ID", leftTitel: "MAC/ID",
rightTitle: "${state.lockBasicInfo.value.mac}/${state.lockBasicInfo.value.lockId}", rightTitle:
"${state.lockBasicInfo.value.mac}/${state.lockBasicInfo.value.lockId}",
allHeight: 70.h, allHeight: 70.h,
isHaveLine: false), isHaveLine: false),
SizedBox( SizedBox(
@ -62,22 +62,29 @@ class _BasicInformationPageState extends State<BasicInformationPage> {
isHaveLine: true, isHaveLine: true,
isHaveDirection: true, isHaveDirection: true,
action: () { action: () {
Get.toNamed(Routers.uploadElectricQuantityPage, arguments: {'lockSetInfoData': state.lockSetInfoData.value}); Get.toNamed(Routers.uploadElectricQuantityPage, arguments: {
'lockSetInfoData': state.lockSetInfoData.value
});
})), })),
CommonItem( CommonItem(
leftTitel: TranslationLoader.lanKeys!.periodValidity!.tr, leftTitel: TranslationLoader.lanKeys!.periodValidity!.tr,
rightTitle: logic.getUseKeyTypeStr(state.lockBasicInfo.value.startDate, state.lockBasicInfo.value.startDate, state.lockBasicInfo.value.keyType), rightTitle: logic.getUseKeyTypeStr(
state.lockBasicInfo.value.startDate,
state.lockBasicInfo.value.startDate,
state.lockBasicInfo.value.keyType),
allHeight: 70.h, allHeight: 70.h,
isHaveLine: false), isHaveLine: false),
SizedBox(height: 10.h), SizedBox(height: 10.h),
CommonItem( CommonItem(
leftTitel: leftTitel: TranslationLoader.lanKeys!.lockName!.tr,
TranslationLoader.lanKeys!.lockName!.tr,
rightTitle: state.lockBasicInfo.value.lockAlias, rightTitle: state.lockBasicInfo.value.lockAlias,
isHaveLine: true, isHaveLine: true,
isHaveDirection: true, isHaveDirection: true,
action: () async { action: () async {
var data = await Get.toNamed(Routers.editLockNamePage, arguments: {'lockSetInfoData': state.lockSetInfoData.value}); var data = await Get.toNamed(Routers.editLockNamePage,
arguments: {
'lockSetInfoData': state.lockSetInfoData.value
});
if (data != null) { if (data != null) {
setState(() { setState(() {
state.lockBasicInfo.value = data["lockBasicInfo"]; state.lockBasicInfo.value = data["lockBasicInfo"];
@ -90,10 +97,10 @@ class _BasicInformationPageState extends State<BasicInformationPage> {
isHaveLine: true, isHaveLine: true,
isHaveDirection: true, isHaveDirection: true,
action: () async { action: () async {
Get.toNamed(Routers.lockSeletGroupingPage, Get.toNamed(Routers.lockSeletGroupingPage, arguments: {
arguments: {
'lockSetInfoData': state.lockSetInfoData.value 'lockSetInfoData': state.lockSetInfoData.value
})!.then((val) { })!
.then((val) {
if (val != null) { if (val != null) {
// mockNetworkDataRequest(); // mockNetworkDataRequest();
setState(() {}); setState(() {});
@ -101,10 +108,15 @@ class _BasicInformationPageState extends State<BasicInformationPage> {
}); });
})), })),
Visibility( Visibility(
visible: (state.lockBasicInfo.value.isLockOwner == 1 || state.lockBasicInfo.value.keyRight == 1) ? true : false, visible: (state.lockBasicInfo.value.isLockOwner == 1 ||
state.lockBasicInfo.value.keyRight == 1)
? true
: false,
child: CommonItem( child: CommonItem(
leftTitel: TranslationLoader.lanKeys!.adminOpenLockPassword!.tr, leftTitel:
rightTitle: state.lockSetInfoData.value!.lockBasicInfo!.adminPwd, TranslationLoader.lanKeys!.adminOpenLockPassword!.tr,
rightTitle:
state.lockSetInfoData.value!.lockBasicInfo!.adminPwd,
isHaveLine: true, isHaveLine: true,
isHaveDirection: true, isHaveDirection: true,
action: () { action: () {
@ -113,6 +125,7 @@ class _BasicInformationPageState extends State<BasicInformationPage> {
}); });
}), }),
), ),
/* 2024-01-12 by DaisyWu
CommonItem( CommonItem(
leftTitel: leftTitel:
TranslationLoader.lanKeys!.unlockQRCode!.tr, TranslationLoader.lanKeys!.unlockQRCode!.tr,
@ -122,9 +135,9 @@ class _BasicInformationPageState extends State<BasicInformationPage> {
action: () { action: () {
Get.toNamed(Routers.unlockQRCodePage); Get.toNamed(Routers.unlockQRCodePage);
}), }),
*/
], ],
) ));
);
} }
//1: 2: 3: 4: //1: 2: 3: 4:

View File

@ -63,6 +63,9 @@ class _CatEyeCustomModePageState extends State<CatEyeCustomModePage> {
isHaveLine: false, isHaveLine: false,
isHaveDirection: true, isHaveDirection: true,
isHaveRightWidget: false, isHaveRightWidget: false,
action: () {
Get.toNamed(Routers.liveVideoPage);
},
) )
], ],
)); ));

View File

@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:star_lock/appRouters.dart'; import 'package:star_lock/appRouters.dart';
import 'package:star_lock/tools/submitBtn.dart';
import '../../../../../app_settings/app_colors.dart'; import '../../../../../app_settings/app_colors.dart';
import '../../../../../tools/titleAppBar.dart'; import '../../../../../tools/titleAppBar.dart';
@ -114,10 +115,12 @@ class _CatEyeWorkModePageState extends State<CatEyeWorkModePage> {
), ),
), ),
onTap: () { onTap: () {
//
if (clickIndex == 3) { if (clickIndex == 3) {
Get.toNamed(Routers.catEyeCustomModePage); Get.toNamed(Routers.catEyeCustomModePage);
} else { } else {
// Get.toNamed(Routes.catEyeWorkModeDetailPage); //
showBottomSheet(context, clickIndex);
} }
}, },
), ),
@ -159,34 +162,119 @@ class _CatEyeWorkModePageState extends State<CatEyeWorkModePage> {
} }
// //
void showBottomSheet(BuildContext context) { void showBottomSheet(BuildContext context, int clickIndex) {
//
showModalBottomSheet( showModalBottomSheet(
builder: (BuildContext context) { builder: (BuildContext context) {
// //
return _buildBottomSheetWidget(context); if (clickIndex == 0) {
return _buildBottomSheetWidget(context, '省电模式', '有人按门铃或发生\n异常事件时',
'不录像', '/', '有人按门铃或发生\n异常事件时');
} else if (clickIndex == 1) {
return _buildBottomSheetWidget(context, '逗留抓拍模式',
'有人出现、按门铃\n或发生异常事件时', '逗留达到10秒', '约1.5米', '随时');
} else if (clickIndex == 2) {
return _buildBottomSheetWidget(
context, '实时监控模式', '有人出现、按门铃\n或发生异常事件时', '立即录像', '约1.5米', '随时');
} else {
return Container();
}
}, },
context: context); context: context);
} }
_buildBottomSheetWidget(BuildContext context) { _buildBottomSheetWidget(BuildContext context, String modeTitle, String tips1,
String tips2, String tips3, String tips4) {
return Container( return Container(
margin: EdgeInsets.only(left: 20.w, right: 20.w, top: 20.h), margin: EdgeInsets.only(left: 20.w, right: 20.w, top: 20.h),
child: Column( child: Column(
children: [ children: [
Row( Row(
children: [ children: [
Text( //
'省电模式', Expanded(
child: Center(
child: Text(
modeTitle,
style: TextStyle( style: TextStyle(
fontSize: 24.sp, fontSize: 26.sp,
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.w500), fontWeight: FontWeight.w600),
) ),
),
),
], ],
) ),
SizedBox(
height: 40.h,
),
_buildRowWidget('录像时机', tips1),
_buildRowWidget('有人出现时录像', tips2),
_buildRowWidget('人体侦测距离', tips3),
_buildRowWidget('查看实时画面', tips4),
_buildIKnowBtn(),
], ],
), ),
); );
} }
_buildRowWidget(String titleStr, String subTitleStr) {
return Container(
margin: EdgeInsets.only(top: 26.h, bottom: 26.h),
child: Row(
//Row两端对齐的方法
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
titleStr,
style: TextStyle(
fontSize: 24.sp,
color: Colors.black,
fontWeight: FontWeight.w600),
),
Expanded(
child: SizedBox(
width: 20.sp,
),
),
Text(
subTitleStr,
textAlign: TextAlign.right,
style: TextStyle(
fontSize: 20.sp,
color: AppColors.placeholderTextColor,
),
),
SizedBox(
width: 20.sp,
),
],
),
);
}
_buildIKnowBtn() {
return GestureDetector(
child: Container(
width: ScreenUtil().screenWidth - 40.w,
height: 80.h,
margin: EdgeInsets.only(top: 40.h, bottom: 40.h),
decoration: BoxDecoration(
color: AppColors.btnDisableColor,
borderRadius: BorderRadius.circular(80.h / 2),
),
child: Center(
child: Text(
'我知道了',
style: TextStyle(
color: AppColors.darkGrayTextColor,
fontSize: 24.sp,
fontWeight: FontWeight.w500),
),
),
),
onTap: () {
Navigator.pop(context);
},
);
}
} }

View File

@ -0,0 +1,6 @@
import 'package:star_lock/main/lockDetail/lcokSet/liveVideo/liveVideo_state.dart';
import 'package:star_lock/tools/baseGetXController.dart';
class LiveVideoLogic extends BaseGetXController {
final LiveVideoState state = LiveVideoState();
}

View File

@ -0,0 +1,144 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:star_lock/main/lockDetail/lcokSet/liveVideo/liveVideo_logic.dart';
import 'package:star_lock/translations/trans_lib.dart';
import '../../../../../app_settings/app_colors.dart';
import '../../../../../tools/titleAppBar.dart';
class LiveVideoPage extends StatefulWidget {
const LiveVideoPage({Key? key}) : super(key: key);
@override
State<LiveVideoPage> createState() => _LiveVideoPageState();
}
class _LiveVideoPageState extends State<LiveVideoPage> {
final logic = Get.put(LiveVideoLogic());
final state = Get.find<LiveVideoLogic>().state;
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: AppColors.mainBackgroundColor,
appBar: TitleAppBar(
barTitle: '实时画面',
haveBack: true,
backgroundColor: AppColors.mainColor,
actionsList: [
TextButton(
child: Text(
TranslationLoader.lanKeys!.save!.tr,
style: TextStyle(color: Colors.white, fontSize: 24.sp),
),
onPressed: () {
Get.back();
},
),
],
),
body: Column(
children: [
SizedBox(
height: 80.h,
),
Image.asset(
'images/lockSet_liveVideo.png',
height: 541.h,
width: 255.w,
),
SizedBox(
height: 86.h,
),
_buildTipsView('发生事件时查看\n', '仅当门锁发生事件或有人按门铃时,才能在门锁首页查看实时画面。', 0),
SizedBox(
height: 16.h,
),
_buildTipsView('实时查看\n',
'指定时问内,无论门锁是否发生安全事件或有人按门铃,都能在门锁首页随时查看实时画面;电池续航时问将会缩短。', 1),
],
));
}
Widget _buildTipsView(String titleStr, String subTitle, int clickIndex) {
return Obx(() => GestureDetector(
child: Container(
width: ScreenUtil().screenWidth - 40.w,
margin: EdgeInsets.only(left: 20.w, right: 20.w, bottom: 10.h),
decoration: BoxDecoration(
color: clickIndex == 0
? (state.isLiveView.value == false
? AppColors.blueViewBgColor
: AppColors.greyBackgroundColor)
: (state.isLiveView.value == true
? AppColors.blueViewBgColor
: AppColors.greyBackgroundColor),
borderRadius: BorderRadius.circular(10.0),
),
child: Padding(
padding: EdgeInsets.only(
left: 20.w, top: 30.h, bottom: 30.h, right: 20.w),
child: Row(
children: [
clickIndex == 0
? (state.isLiveView.value == false
? Image.asset(
'images/mine/icon_mine_blueSelect.png',
width: 20.w,
height: 14.w,
)
: SizedBox(
width: 20.w,
height: 14.w,
))
: (state.isLiveView.value == true
? Image.asset(
'images/mine/icon_mine_blueSelect.png',
width: 20.w,
height: 14.w,
)
: SizedBox(
width: 20.w,
height: 14.w,
)),
SizedBox(width: 10.w),
Expanded(
child: _buildRichText(
titleStr,
subTitle,
clickIndex == 0
? (state.isLiveView.value == false ? true : false)
: (state.isLiveView.value == true
? true
: false)),
),
],
)),
),
onTap: () {
state.isLiveView.value = !state.isLiveView.value;
},
));
}
Widget _buildRichText(String titleStr, String subTitle, bool isClick) {
//
final TextStyle titleStyle = TextStyle(
color: isClick ? AppColors.blueTextTipsColor : Colors.black,
fontSize: 24.sp,
fontWeight: FontWeight.w500);
//
final TextStyle subTipsStyle = TextStyle(
color: isClick
? AppColors.blueTextTipsColor
: AppColors.placeholderTextColor,
fontSize: 20.sp);
late InlineSpan tipsPreviewSpan = TextSpan(children: [
TextSpan(text: titleStr, style: titleStyle),
TextSpan(text: subTitle, style: subTipsStyle),
]);
return RichText(text: tipsPreviewSpan);
}
}

View File

@ -0,0 +1,5 @@
import 'package:get/get.dart';
class LiveVideoState {
var isLiveView = false.obs; //
}

View File

@ -60,7 +60,8 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
List<Widget> getListWidget() { List<Widget> getListWidget() {
print( print(
"state.lockBasicInfo.value.isLockOwner:${state.lockBasicInfo.value.isLockOwner} state.lockBasicInfo.value.keyRight:${state.lockBasicInfo.value.keyRight}"); "state.lockBasicInfo.value.isLockOwner:${state.lockBasicInfo.value.isLockOwner} state.lockBasicInfo.value.keyRight:${state.lockBasicInfo.value.keyRight}");
if (state.lockBasicInfo.value.isLockOwner == 1 || state.lockBasicInfo.value.keyRight == 1) { if (state.lockBasicInfo.value.isLockOwner == 1 ||
state.lockBasicInfo.value.keyRight == 1) {
// //
return getAllWidget(); return getAllWidget();
} else { } else {
@ -418,6 +419,7 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
Get.toNamed(Routers.motorPowerPage); Get.toNamed(Routers.motorPowerPage);
})), })),
// 广使 // 广使
/* 2024-01-12 广 by DaisyWu
Obx(() => Visibility( Obx(() => Visibility(
visible: true, visible: true,
child: CommonItem( child: CommonItem(
@ -427,6 +429,7 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
isHaveRightWidget: true, isHaveRightWidget: true,
rightWidget: _lockBlueBroadcastSwitch()))), rightWidget: _lockBlueBroadcastSwitch()))),
SizedBox(height: 10.h), SizedBox(height: 10.h),
*/
//----- //-----
// //
Obx(() { Obx(() {
@ -450,7 +453,8 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
})); }));
}), }),
// //
Obx(() => Visibility( Obx(
() => Visibility(
visible: state.lockFeature.value.attendance == 1 ? true : false, visible: state.lockFeature.value.attendance == 1 ? true : false,
child: CommonItem( child: CommonItem(
leftTitel: TranslationLoader.lanKeys!.checkingIn!.tr, leftTitel: TranslationLoader.lanKeys!.checkingIn!.tr,
@ -596,7 +600,8 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
// //
CupertinoSwitch _openCheckInSwitch() { CupertinoSwitch _openCheckInSwitch() {
print("111111state.lockSettingInfo.value.attendance:${state.lockSettingInfo.value.attendance}"); print(
"111111state.lockSettingInfo.value.attendance:${state.lockSettingInfo.value.attendance}");
return CupertinoSwitch( return CupertinoSwitch(
activeColor: CupertinoColors.activeBlue, activeColor: CupertinoColors.activeBlue,
trackColor: CupertinoColors.systemGrey5, trackColor: CupertinoColors.systemGrey5,
@ -817,7 +822,8 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
if (state.deletWaitScanTimer != null) { if (state.deletWaitScanTimer != null) {
state.deletWaitScanTimer!.cancel(); state.deletWaitScanTimer!.cancel();
} }
if(state.deletWaitScanCompleter != null && !state.deletWaitScanCompleter!.isCompleted){ if (state.deletWaitScanCompleter != null &&
!state.deletWaitScanCompleter!.isCompleted) {
state.deletWaitScanCompleter!.complete(); state.deletWaitScanCompleter!.complete();
} }
BlueManage().stopScan(); BlueManage().stopScan();
@ -843,7 +849,8 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
if (state.deletWaitScanTimer != null) { if (state.deletWaitScanTimer != null) {
state.deletWaitScanTimer!.cancel(); state.deletWaitScanTimer!.cancel();
} }
if(state.deletWaitScanCompleter != null && !state.deletWaitScanCompleter!.isCompleted){ if (state.deletWaitScanCompleter != null &&
!state.deletWaitScanCompleter!.isCompleted) {
state.deletWaitScanCompleter!.complete(); state.deletWaitScanCompleter!.complete();
} }
BlueManage().stopScan(); BlueManage().stopScan();

View File

@ -3,7 +3,6 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:star_lock/appRouters.dart'; import 'package:star_lock/appRouters.dart';
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart'; import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
import 'package:star_lock/network/api.dart';
import '../../app_settings/app_colors.dart'; import '../../app_settings/app_colors.dart';
import '../../tools/commonItem.dart'; import '../../tools/commonItem.dart';
@ -68,6 +67,7 @@ class _AbountPageState extends State<AbountPage> {
isHaveLine: false, isHaveLine: false,
isHaveDirection: true, isHaveDirection: true,
action: () { action: () {
print("用户协议${XSConstantMacro.userAgreementURL}");
Navigator.pushNamed(context, Routers.webviewShowPage, Navigator.pushNamed(context, Routers.webviewShowPage,
arguments: { arguments: {
"url": XSConstantMacro.userAgreementURL, "url": XSConstantMacro.userAgreementURL,

View File

@ -0,0 +1,50 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:star_lock/app_settings/app_colors.dart';
import 'package:star_lock/tools/titleAppBar.dart';
import 'package:webview_flutter/webview_flutter.dart';
import '../../translations/trans_lib.dart';
class LockMallPage extends StatefulWidget {
const LockMallPage({Key? key}) : super(key: key);
@override
State<LockMallPage> createState() => _LockMallPageState();
}
class _LockMallPageState extends State<LockMallPage> {
late WebViewController _webViewController;
@override
void initState() {
super.initState();
_webViewController = WebViewController()
..setJavaScriptMode(JavaScriptMode.unrestricted);
}
@override
Widget build(BuildContext context) {
// FIXME
// FIXME url应该使用接口获取 /mall/getUrl POST请求
String url = 'https://ge.mall.star-lock.cn/quick_login?id=4&key=1ffb9d37109b8351ebb04ccfcca02c8e';
_webViewController.loadRequest(Uri.parse(url));
return Scaffold(
resizeToAvoidBottomInset: false,
backgroundColor: const Color(0xFFFFFFFF),
appBar: TitleAppBar(
barTitle: getWebTitle(),
haveBack: true,
backgroundColor: AppColors.mainColor,
),
body: WebViewWidget(controller: _webViewController));
}
String getWebTitle() {
String webTitleStr = TranslationLoader.lanKeys!.shoppingCart!.tr;
_webViewController.getTitle().then((result) {
webTitleStr = result!;
});
return webTitleStr;
}
}

View File

@ -147,6 +147,11 @@ class _StarLockMinePageState extends State<StarLockMinePage> with BaseWidget {
Get.back(); Get.back();
Get.toNamed(Routers.valueAddedServicesPage); Get.toNamed(Routers.valueAddedServicesPage);
}), }),
mineItem('images/mine/icon_mine_main_shoppingcart.png',
TranslationLoader.lanKeys!.shoppingCart!.tr, () {
Get.back();
Get.toNamed(Routers.LockMallPage);
}),
mineItem('images/mine/icon_mine_main_about.png', mineItem('images/mine/icon_mine_main_about.png',
TranslationLoader.lanKeys!.about!.tr, () { TranslationLoader.lanKeys!.about!.tr, () {
Get.back(); Get.back();

View File

@ -45,6 +45,7 @@ class _MineSetPageState extends State<MineSetPage> {
Widget getListDataView() { Widget getListDataView() {
return Column( return Column(
children: [ children: [
/* 2024-01-12 by DaisyWu
CommonItem( CommonItem(
leftTitel: TranslationLoader.lanKeys!.prompTone!.tr, leftTitel: TranslationLoader.lanKeys!.prompTone!.tr,
rightTitle: "", rightTitle: "",
@ -63,6 +64,7 @@ class _MineSetPageState extends State<MineSetPage> {
width: 60.w, width: 60.w,
height: 50.h, height: 50.h,
child: Obx(() => _isTouchUnlockSwitch()))), child: Obx(() => _isTouchUnlockSwitch()))),
*/
CommonItem( CommonItem(
leftTitel: TranslationLoader.lanKeys!.pushNotification!.tr, leftTitel: TranslationLoader.lanKeys!.pushNotification!.tr,
rightTitle: "", rightTitle: "",
@ -137,6 +139,7 @@ class _MineSetPageState extends State<MineSetPage> {
state.currentLanguage.value = result['currentLanguage']; state.currentLanguage.value = result['currentLanguage'];
} }
})), })),
/* 2024-01-12 by DaisyWu
Obx(() => CommonItem( Obx(() => CommonItem(
leftTitel: TranslationLoader.lanKeys!.lockScreen!.tr, leftTitel: TranslationLoader.lanKeys!.lockScreen!.tr,
rightTitle: (state.lockScreen.value == 1 rightTitle: (state.lockScreen.value == 1
@ -150,6 +153,7 @@ class _MineSetPageState extends State<MineSetPage> {
logic.userSettingsInfoRequest(); logic.userSettingsInfoRequest();
}); });
})), })),
*/
Obx(() => CommonItem( Obx(() => CommonItem(
leftTitel: leftTitel:
TranslationLoader.lanKeys!.hideInvalidUnlockPermissions!.tr, TranslationLoader.lanKeys!.hideInvalidUnlockPermissions!.tr,
@ -197,8 +201,7 @@ class _MineSetPageState extends State<MineSetPage> {
logic.showToast("功能暂未开放"); logic.showToast("功能暂未开放");
}), }),
CommonItem( CommonItem(
leftTitel: TranslationLoader leftTitel: TranslationLoader.lanKeys!.xiaomiIOTPlatform!.tr,
.lanKeys!.xiaomiIOTPlatform!.tr,
rightTitle: "", rightTitle: "",
isHaveLine: false, isHaveLine: false,
isHaveDirection: true, isHaveDirection: true,

View File

@ -2,15 +2,10 @@ abstract class Api {
// static String baseAddress = "https://pre.lock.star-lock.cn:8093"; // // static String baseAddress = "https://pre.lock.star-lock.cn:8093"; //
static String baseAddress = "https://dev.lock.star-lock.cn"; // static String baseAddress = "https://dev.lock.star-lock.cn"; //
// static String baseAddress = "http://192.168.1.15:8022"; // // static String baseAddress = "http://192.168.1.15:8022"; //
// static String baseAddress = "https://ge.lock.star-lock.cn:8100"; //
final String baseUrl = "$baseAddress/api"; final String baseUrl = "$baseAddress/api";
// final String baseUrl = "http://test.lock.star-lock.cn/api"; //
// final String baseUrl = "https://lock.star-lock.cn/api"; //
// final String baseUrl = "http://wenlin.lock.star-lock.cn/api"; //
// final String baseUrl = "http://192.168.56.101:8099/api"; //
// final String baseUrl = "http://192.168.1.14:8099/api"; //
// //
final String getVerificationCodeUrl = '/user/sendValidationCode'; final String getVerificationCodeUrl = '/user/sendValidationCode';
final String registerUrl = '/user/register'; final String registerUrl = '/user/register';
@ -105,15 +100,19 @@ abstract class Api {
final String addFingerprintURL = '/fingerprint/add'; // final String addFingerprintURL = '/fingerprint/add'; //
final String editFingerprintURL = '/fingerprint/changePeriod'; // final String editFingerprintURL = '/fingerprint/changePeriod'; //
final String deleteFingerprintURL = '/fingerprint/delete'; // final String deleteFingerprintURL = '/fingerprint/delete'; //
final String updateFingerprintUserNoURL = '/fingerprint/updateFingerprintUserNo'; // final String updateFingerprintUserNoURL =
final String checkFingerprintNameURL = '/fingerprint/checkFingerprintName'; // '/fingerprint/updateFingerprintUserNo'; //
final String checkFingerprintNameURL =
'/fingerprint/checkFingerprintName'; //
final String getICCardListURL = '/identityCard/list'; // IC卡列表 final String getICCardListURL = '/identityCard/list'; // IC卡列表
final String addICCardURL = '/identityCard/add'; // IC卡 final String addICCardURL = '/identityCard/add'; // IC卡
final String editICCardURL = '/identityCard/update'; // IC卡 final String editICCardURL = '/identityCard/update'; // IC卡
final String deleteICCardURL = '/identityCard/delete'; // IC卡 final String deleteICCardURL = '/identityCard/delete'; // IC卡
final String updateICCardUserNoURL = '/identityCard/updateCardUserNo'; // ic卡用户序号 final String updateICCardUserNoURL =
final String checkCardNameURL = '/identityCard/checkIdentityCardName'; // '/identityCard/updateCardUserNo'; // ic卡用户序号
final String checkCardNameURL =
'/identityCard/checkIdentityCardName'; //
final String transferLockListURL = '/room/listForTransfer'; // final String transferLockListURL = '/room/listForTransfer'; //
final String transferLockConfirmURL = '/room/transferLockConfirm'; // final String transferLockConfirmURL = '/room/transferLockConfirm'; //

View File

@ -16,29 +16,29 @@ class XSAliyunPushProvider {
} }
Future<void> _onNotification(Map<dynamic, dynamic> message) async { Future<void> _onNotification(Map<dynamic, dynamic> message) async {
// Toast.show(msg: 'onNotification: $message'); print('onNotification: $message');
} }
Future<void> _onAndroidNotificationReceivedInApp( Future<void> _onAndroidNotificationReceivedInApp(
Map<dynamic, dynamic> message) async { Map<dynamic, dynamic> message) async {
// Toast.show(msg: 'onAndroidNotificationReceivedInApp: $message'); print('onAndroidNotificationReceivedInApp: $message');
} }
Future<void> _onMessage(Map<dynamic, dynamic> message) async { Future<void> _onMessage(Map<dynamic, dynamic> message) async {
// Toast.show(msg: 'onMessage: $message'); print('onMessage: $message');
} }
Future<void> _onNotificationOpened(Map<dynamic, dynamic> message) async { Future<void> _onNotificationOpened(Map<dynamic, dynamic> message) async {
// Toast.show(msg: 'onNotificationOpened: $message'); print('onNotificationOpened: $message');
} }
Future<void> _onNotificationRemoved(Map<dynamic, dynamic> message) async { Future<void> _onNotificationRemoved(Map<dynamic, dynamic> message) async {
// Toast.show(msg: 'onNotificationRemoved: $message'); print('onNotificationRemoved: $message');
} }
Future<void> _onAndroidNotificationClickedWithNoAction( Future<void> _onAndroidNotificationClickedWithNoAction(
Map<dynamic, dynamic> message) async { Map<dynamic, dynamic> message) async {
// Toast.show(msg: 'onAndroidNotificationClickedWithNoAction: $message'); print('onAndroidNotificationClickedWithNoAction: $message');
} }
Future<void> _onIOSChannelOpened(Map<dynamic, dynamic> message) async {} Future<void> _onIOSChannelOpened(Map<dynamic, dynamic> message) async {}

View File

@ -198,6 +198,7 @@ class LanKeyEntity {
this.videoIntercomDoorLock, this.videoIntercomDoorLock,
this.NFCPassiveLock, this.NFCPassiveLock,
this.addDevice, this.addDevice,
this.shoppingCart,
this.gateway, this.gateway,
this.message, this.message,
this.supportStaff, this.supportStaff,
@ -661,6 +662,7 @@ class LanKeyEntity {
videoIntercomDoorLock = json['videoIntercomDoorLock']; videoIntercomDoorLock = json['videoIntercomDoorLock'];
NFCPassiveLock = json['NFCPassiveLock']; NFCPassiveLock = json['NFCPassiveLock'];
addDevice = json['addDevice']; addDevice = json['addDevice'];
shoppingCart = json['shoppingCart'];
gateway = json['gateway']; gateway = json['gateway'];
message = json['message']; message = json['message'];
supportStaff = json['supportStaff']; supportStaff = json['supportStaff'];
@ -1147,6 +1149,7 @@ class LanKeyEntity {
String? videoIntercomDoorLock; String? videoIntercomDoorLock;
String? NFCPassiveLock; String? NFCPassiveLock;
String? addDevice; String? addDevice;
String? shoppingCart;
String? gateway; String? gateway;
String? message; String? message;
String? supportStaff; String? supportStaff;
@ -1629,6 +1632,7 @@ class LanKeyEntity {
map['videoIntercomDoorLock'] = videoIntercomDoorLock; map['videoIntercomDoorLock'] = videoIntercomDoorLock;
map['NFCPassiveLock'] = NFCPassiveLock; map['NFCPassiveLock'] = NFCPassiveLock;
map['addDevice'] = addDevice; map['addDevice'] = addDevice;
map['shoppingCart'] = shoppingCart;
map['gateway'] = gateway; map['gateway'] = gateway;
map['message'] = message; map['message'] = message;
map['supportStaff'] = supportStaff; map['supportStaff'] = supportStaff;

View File

@ -135,9 +135,7 @@ dependencies:
#监听网络连接状态 #监听网络连接状态
connectivity_plus: ^5.0.2 connectivity_plus: ^5.0.2
flutter_advanced_calendar: ^1.4.1 flutter_advanced_calendar: ^1.4.1
#下拉选择菜单框 timelines: ^0.1.0
gzx_dropdown_menu: ^3.1.0
cupertino_stepper: ^0.2.1
dev_dependencies: dev_dependencies:
flutter_test: flutter_test: