Merge branch 'develop_liyi' of code-internal.star-lock.cn:StarlockTeam/app-starlock into develop_liyi
This commit is contained in:
commit
d9aadc0cd1
@ -6,7 +6,7 @@
|
||||
<string>development</string>
|
||||
<key>com.apple.developer.associated-domains</key>
|
||||
<array>
|
||||
<string>applinks:lock.skychip.top</string>
|
||||
<string>applinks:lock.xhjcn.ltd</string>
|
||||
</array>
|
||||
<key>com.apple.external-accessory.wireless-configuration</key>
|
||||
<true/>
|
||||
|
||||
@ -30,10 +30,10 @@
|
||||
<key>CFBundleURLIconFile</key>
|
||||
<string></string>
|
||||
<key>CFBundleURLName</key>
|
||||
<string>com.sky.skysmartlock</string>
|
||||
<string>com.xhj.xhjsmartlock</string>
|
||||
<key>CFBundleURLSchemes</key>
|
||||
<array>
|
||||
<string>skysmartlock</string>
|
||||
<string>xhjsmartlock</string>
|
||||
<string></string>
|
||||
<string></string>
|
||||
</array>
|
||||
@ -45,7 +45,7 @@
|
||||
<string>weixin</string>
|
||||
<key>CFBundleURLSchemes</key>
|
||||
<array>
|
||||
<string>wxbe340095d2b8fd51</string>
|
||||
<string>wx8e48112e22343817</string>
|
||||
</array>
|
||||
</dict>
|
||||
</array>
|
||||
|
||||
@ -39,6 +39,13 @@ class UmengKey {
|
||||
|
||||
typedef dynamic fCallFunction();
|
||||
|
||||
class WechatAppInfo {
|
||||
WechatAppInfo({required this.wechatAppId, required this.universalLink});
|
||||
|
||||
String wechatAppId;
|
||||
String universalLink;
|
||||
}
|
||||
|
||||
class F {
|
||||
static Flavor? appFlavor;
|
||||
|
||||
@ -281,6 +288,37 @@ class F {
|
||||
}
|
||||
}
|
||||
|
||||
static WechatAppInfo get wechatAppInfo {
|
||||
switch (appFlavor) {
|
||||
case Flavor.local:
|
||||
return WechatAppInfo(
|
||||
wechatAppId: 'wxbe340095d2b8fd51',
|
||||
universalLink: 'https://apt.skychip.top/');
|
||||
case Flavor.dev:
|
||||
return WechatAppInfo(
|
||||
wechatAppId: 'wxbe340095d2b8fd51',
|
||||
universalLink: 'https://apt.skychip.top/');
|
||||
case Flavor.pre:
|
||||
case Flavor.sky_pre:
|
||||
case Flavor.xhj_pre:
|
||||
return WechatAppInfo(
|
||||
wechatAppId: 'wxbe340095d2b8fd51',
|
||||
universalLink: 'https://apt.skychip.top/');
|
||||
case Flavor.sky:
|
||||
return WechatAppInfo(
|
||||
wechatAppId: 'wxbe340095d2b8fd51',
|
||||
universalLink: 'https://lock.skychip.top/');
|
||||
case Flavor.xhj:
|
||||
case Flavor.xhj_bundle:
|
||||
return WechatAppInfo(
|
||||
wechatAppId: 'wx8e48112e22343817',
|
||||
universalLink: 'https://lock.xhjcn.ltd/');
|
||||
default:
|
||||
return WechatAppInfo(
|
||||
wechatAppId: 'wxbe340095d2b8fd51', universalLink: '');
|
||||
}
|
||||
}
|
||||
|
||||
// 是否是生产环境
|
||||
static bool get isProductionEnv {
|
||||
switch (appFlavor) {
|
||||
|
||||
@ -146,13 +146,48 @@ class CatEyeSetLogic extends BaseGetXController {
|
||||
|
||||
_getConfigAndGenerateBleData() async {
|
||||
// 假设 state.lockSetInfoData.value.lockSettingInfo!.catEyeConfig![0].catEyeMode 是一个整数
|
||||
int originalCatEyeMode = state
|
||||
.lockSetInfoData.value.lockSettingInfo!.catEyeConfig![0].catEyeMode!;
|
||||
int recordMode = state.lockSetInfoData.value.lockSettingInfo!
|
||||
.catEyeConfig![0].catEyeModeConfig!.recordMode ==
|
||||
0
|
||||
? 1
|
||||
: 0;
|
||||
|
||||
int originalCatEyeMode = 0;
|
||||
int recordMode = 0;
|
||||
int recordStartTime = 0;
|
||||
int recordEndTime = 0;
|
||||
int recordTime = 0;
|
||||
int detectionDistance = 0;
|
||||
int realTimeMode = 0;
|
||||
if (state.lockSetInfoData.value.lockSettingInfo!.catEyeConfig != null &&
|
||||
state.lockSetInfoData.value.lockSettingInfo!.catEyeConfig!.length > 0) {
|
||||
originalCatEyeMode = state
|
||||
.lockSetInfoData.value.lockSettingInfo!.catEyeConfig![0].catEyeMode!;
|
||||
recordMode = state.lockSetInfoData.value.lockSettingInfo!.catEyeConfig![0]
|
||||
.catEyeModeConfig!.recordMode ==
|
||||
0
|
||||
? 1
|
||||
: 0;
|
||||
recordStartTime = _handleTimeToM(state
|
||||
.lockSetInfoData
|
||||
.value
|
||||
.lockSettingInfo!
|
||||
.catEyeConfig![0]
|
||||
.catEyeModeConfig!
|
||||
.recordStartTime!);
|
||||
recordEndTime = _handleTimeToM(state.lockSetInfoData.value
|
||||
.lockSettingInfo!.catEyeConfig![0].catEyeModeConfig!.recordEndTime!);
|
||||
recordTime = _handleGetIntNumber(state.lockSetInfoData.value
|
||||
.lockSettingInfo!.catEyeConfig![0].catEyeModeConfig!.recordTime!);
|
||||
if (state.lockSetInfoData.value.lockSettingInfo!.catEyeConfig![0]!
|
||||
.catEyeModeConfig!.detectionDistance !=
|
||||
null) {
|
||||
detectionDistance = _handleDetectionDistance(state
|
||||
.lockSetInfoData
|
||||
.value
|
||||
.lockSettingInfo!
|
||||
.catEyeConfig![0]
|
||||
.catEyeModeConfig!
|
||||
.detectionDistance!);
|
||||
}
|
||||
realTimeMode = state.lockSetInfoData.value.lockSettingInfo!
|
||||
.catEyeConfig![0].catEyeModeConfig!.realTimeMode!;
|
||||
}
|
||||
|
||||
int stayWarn = state.lockSetInfoData.value.lockSettingInfo!.stayWarn!;
|
||||
int abnormalWarn =
|
||||
@ -160,30 +195,6 @@ class CatEyeSetLogic extends BaseGetXController {
|
||||
int autoLightScreen =
|
||||
state.lockSetInfoData.value.lockSettingInfo!.autoLightScreen!;
|
||||
|
||||
int recordStartTime = _handleTimeToM(state.lockSetInfoData.value
|
||||
.lockSettingInfo!.catEyeConfig![0].catEyeModeConfig!.recordStartTime!);
|
||||
int recordEndTime = _handleTimeToM(state.lockSetInfoData.value
|
||||
.lockSettingInfo!.catEyeConfig![0].catEyeModeConfig!.recordEndTime!);
|
||||
|
||||
int recordTime = _handleGetIntNumber(state.lockSetInfoData.value
|
||||
.lockSettingInfo!.catEyeConfig![0].catEyeModeConfig!.recordTime!);
|
||||
|
||||
int detectionDistance = 0;
|
||||
if (state.lockSetInfoData.value.lockSettingInfo!.catEyeConfig![0]!
|
||||
.catEyeModeConfig!.detectionDistance !=
|
||||
null) {
|
||||
detectionDistance = _handleDetectionDistance(state
|
||||
.lockSetInfoData
|
||||
.value
|
||||
.lockSettingInfo!
|
||||
.catEyeConfig![0]
|
||||
.catEyeModeConfig!
|
||||
.detectionDistance!);
|
||||
}
|
||||
|
||||
int realTimeMode = state.lockSetInfoData.value.lockSettingInfo!
|
||||
.catEyeConfig![0].catEyeModeConfig!.realTimeMode!;
|
||||
|
||||
// 根据需要调整 catEyeMode 的值
|
||||
int adjustedCatEyeMode =
|
||||
originalCatEyeMode > 0 ? originalCatEyeMode - 1 : originalCatEyeMode;
|
||||
|
||||
@ -49,7 +49,7 @@ class StarLockMinePageState extends State<StarLockMinePage> with BaseWidget {
|
||||
onTap: () {
|
||||
WechatManageTool.getAppInfo(() {
|
||||
WxPushWeChatMiniProgramTool.pushWeChatMiniProgram(
|
||||
'wxbe340095d2b8fd51');
|
||||
F.wechatAppInfo.wechatAppId, F.wechatAppInfo.universalLink);
|
||||
});
|
||||
},
|
||||
child: Padding(
|
||||
|
||||
@ -86,7 +86,8 @@ class _MineSetPageState extends State<MineSetPage>
|
||||
onTap: () {
|
||||
WechatManageTool.getAppInfo(() {
|
||||
WxPushWeChatMiniProgramTool.pushWeChatMiniProgram(
|
||||
'wxbe340095d2b8fd51');
|
||||
F.wechatAppInfo.wechatAppId,
|
||||
F.wechatAppInfo.universalLink);
|
||||
});
|
||||
},
|
||||
child: ClipRRect(
|
||||
|
||||
@ -59,10 +59,15 @@ class UdpRbcuInfoHandler extends ScpMessageBaseHandle
|
||||
|
||||
@override
|
||||
void handleResp(ScpMessage scpMessage) {
|
||||
final RbcuInfo rbcuInfo = scpMessage.Payload;
|
||||
final GenericResp genericResp = scpMessage.Payload;
|
||||
if (checkGenericRespSuccess(genericResp)) {
|
||||
// 收到回复之后停止重发
|
||||
startChartManage.stopSendingRbcuInfoMessages();
|
||||
if (rbcuInfo.isResp) {
|
||||
// 如果是回复的消息
|
||||
_handleResultRbcuInfo(rbcuInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -70,5 +75,6 @@ class UdpRbcuInfoHandler extends ScpMessageBaseHandle
|
||||
void _handleResultRbcuInfo(RbcuInfo rbcuInfo) {
|
||||
startChartManage.rbcuInfo = rbcuInfo;
|
||||
startChartManage.stopSendingRbcuInfoMessages();
|
||||
startChartManage.startSendingRbcuProbeTMessages();
|
||||
}
|
||||
}
|
||||
|
||||
@ -40,6 +40,9 @@ class UdpTalkAcceptHandler extends ScpMessageBaseHandle
|
||||
// 同意接听之后,停止对讲请求超时监听定时器
|
||||
talkeRequestOverTimeTimerManager.renew();
|
||||
talkeRequestOverTimeTimerManager.cancel();
|
||||
// 启动发送rbcuInfo数据
|
||||
startChartManage.startSendingRbcuInfoMessages(
|
||||
ToPeerId: startChartManage.lockPeerId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -15,7 +15,9 @@ class UdpTalkDataHandler extends ScpMessageBaseHandle
|
||||
factory UdpTalkDataHandler() {
|
||||
return _instance;
|
||||
}
|
||||
|
||||
UdpTalkDataHandler._internal();
|
||||
|
||||
static final UdpTalkDataHandler _instance = UdpTalkDataHandler._internal();
|
||||
|
||||
int _recentRecvDataRate = 0;
|
||||
@ -157,7 +159,7 @@ class UdpTalkDataHandler extends ScpMessageBaseHandle
|
||||
final TalkDataH264Frame talkDataH264Frame = TalkDataH264Frame();
|
||||
talkDataH264Frame.mergeFromBuffer(talkData.content);
|
||||
// AppLog.log('H264 TalkData :$talkDataH264Frame');
|
||||
talkDataRepository.addTalkData(talkData);
|
||||
// talkDataRepository.addTalkData(talkData);
|
||||
}
|
||||
|
||||
/// 处理图片数据
|
||||
|
||||
@ -34,6 +34,8 @@ class UdpTalkHangUpHandler extends ScpMessageBaseHandle
|
||||
talkDataOverTimeTimerManager.cancel();
|
||||
|
||||
EasyLoading.showToast('已挂断'.tr);
|
||||
startChartManage.stopSendingRbcuInfoMessages();
|
||||
startChartManage.stopSendingRbcuProBeMessages();
|
||||
Get.back();
|
||||
}
|
||||
}
|
||||
@ -49,6 +51,8 @@ class UdpTalkHangUpHandler extends ScpMessageBaseHandle
|
||||
talkeRequestOverTimeTimerManager.cancel();
|
||||
talkePingOverTimeTimerManager.cancel();
|
||||
talkDataOverTimeTimerManager.cancel();
|
||||
startChartManage.stopSendingRbcuInfoMessages();
|
||||
startChartManage.stopSendingRbcuProBeMessages();
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@ -31,6 +31,8 @@ class UdpTalkRejectHandler extends ScpMessageBaseHandle
|
||||
talkeRequestOverTimeTimerManager.cancel();
|
||||
talkePingOverTimeTimerManager.cancel();
|
||||
talkDataOverTimeTimerManager.cancel();
|
||||
startChartManage.stopSendingRbcuInfoMessages();
|
||||
startChartManage.stopSendingRbcuProBeMessages();
|
||||
}
|
||||
|
||||
@override
|
||||
@ -43,6 +45,8 @@ class UdpTalkRejectHandler extends ScpMessageBaseHandle
|
||||
talkeRequestOverTimeTimerManager.cancel();
|
||||
talkePingOverTimeTimerManager.cancel();
|
||||
talkDataOverTimeTimerManager.cancel();
|
||||
startChartManage.stopSendingRbcuInfoMessages();
|
||||
startChartManage.stopSendingRbcuProBeMessages();
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@ -33,6 +33,8 @@ class TalkDataOverTimeTimerManager {
|
||||
StartChartManage().sendTalkHangupMessage();
|
||||
StartChartManage().stopTalkPingMessageTimer();
|
||||
StartChartManage().stopTalkExpectMessageTimer();
|
||||
StartChartManage().stopSendingRbcuInfoMessages();
|
||||
StartChartManage().stopSendingRbcuProBeMessages();
|
||||
talkStatus.setNotTalkData();
|
||||
talkStatus.setEnd();
|
||||
AudioPlayerManager().stopRingtone();
|
||||
|
||||
@ -37,6 +37,8 @@ class TalkePingOverTimeTimerManager {
|
||||
StartChartManage().stopTalkExpectMessageTimer();
|
||||
// 如果通话异常,则发送通话中挂断
|
||||
StartChartManage().sendTalkHangupMessage();
|
||||
StartChartManage().stopSendingRbcuInfoMessages();
|
||||
StartChartManage().stopSendingRbcuProBeMessages();
|
||||
talkStatus.setNotTalkPing();
|
||||
talkStatus.setEnd();
|
||||
Get.back();
|
||||
|
||||
@ -32,6 +32,8 @@ class TalkeRequestOverTimeTimerManager {
|
||||
EasyLoading.showToast('通话未接通,已挂断'.tr, duration: 2000.milliseconds);
|
||||
// 超时未接听,发送挂断请求
|
||||
StartChartManage().sendTalkRejectMessage();
|
||||
StartChartManage().stopSendingRbcuInfoMessages();
|
||||
StartChartManage().stopSendingRbcuProBeMessages();
|
||||
talkStatus.setInitializationCompleted();
|
||||
Get.back();
|
||||
}
|
||||
|
||||
@ -314,9 +314,10 @@ class StartChartManage {
|
||||
);
|
||||
}
|
||||
|
||||
final info = rbcuInfo = RbcuInfo(address: ['119.137.55.161:62289']);
|
||||
if (info != null && info.address != null && info.address.length > 0) {
|
||||
info.address.forEach((element) {
|
||||
if (rbcuInfo != null &&
|
||||
rbcuInfo!.address != null &&
|
||||
rbcuInfo!.address.length > 0) {
|
||||
rbcuInfo!.address.forEach((element) {
|
||||
// 拆分 element 字符串
|
||||
final parts = element.split(':');
|
||||
final host = parts[0]; // IP 地址
|
||||
@ -345,6 +346,7 @@ class StartChartManage {
|
||||
rbcuInfoTimer ??=
|
||||
Timer.periodic(Duration(seconds: _defaultIntervalTime), (timer) {
|
||||
// 发送RbcuInfo 地址交换消息
|
||||
_log(text: '发送RbcuInfo 地址交换消息');
|
||||
_sendRbcuInfoMessage(ToPeerId: ToPeerId);
|
||||
});
|
||||
}
|
||||
@ -585,6 +587,8 @@ class StartChartManage {
|
||||
stopTalkExpectMessageTimer();
|
||||
stopTalkPingMessageTimer();
|
||||
stopCallRequestMessageTimer();
|
||||
stopSendingRbcuInfoMessages();
|
||||
stopSendingRbcuProBeMessages();
|
||||
// 取消定时器
|
||||
|
||||
talkePingOverTimeTimerManager.cancel();
|
||||
@ -665,6 +669,8 @@ class StartChartManage {
|
||||
stopTalkExpectMessageTimer();
|
||||
stopTalkPingMessageTimer();
|
||||
stopCallRequestMessageTimer();
|
||||
stopSendingRbcuInfoMessages();
|
||||
stopSendingRbcuProBeMessages();
|
||||
// 取消定时器
|
||||
talkePingOverTimeTimerManager.cancel();
|
||||
talkDataOverTimeTimerManager.cancel();
|
||||
@ -1101,7 +1107,7 @@ class StartChartManage {
|
||||
bluetoothDeviceName: bluetoothDeviceName,
|
||||
bleStructData: bleStructData,
|
||||
);
|
||||
await _sendMessage(message: message);
|
||||
await _sendMessage(message: message);
|
||||
}
|
||||
|
||||
/// 销毁资源
|
||||
|
||||
@ -58,6 +58,7 @@ class _TalkViewPageState extends State<TalkViewPage>
|
||||
|
||||
// _latencyStream = measureServerLatencyStream(F.apiPrefix); // 替换为你的服务器地址
|
||||
}
|
||||
|
||||
//
|
||||
// Stream<int> measureServerLatencyStream(String url) async* {
|
||||
// while (true) {
|
||||
@ -155,7 +156,7 @@ class _TalkViewPageState extends State<TalkViewPage>
|
||||
),
|
||||
Obx(() => state.listData.value.isEmpty
|
||||
? Positioned(
|
||||
bottom: 300.h,
|
||||
bottom: 310.h,
|
||||
child: Text(
|
||||
'正在创建安全连接...'.tr,
|
||||
style: TextStyle(color: Colors.black, fontSize: 26.sp),
|
||||
@ -509,13 +510,17 @@ class _TalkViewPageState extends State<TalkViewPage>
|
||||
onLongPress: longPress,
|
||||
onLongPressUp: longPressUp,
|
||||
child: SizedBox(
|
||||
height: 140.h,
|
||||
height: 160.w,
|
||||
width: 140.w,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
width: wh,
|
||||
height: wh,
|
||||
constraints: BoxConstraints(
|
||||
minWidth: wh,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: backgroundColor,
|
||||
borderRadius: BorderRadius.circular((wh + 10.w * 2) / 2),
|
||||
@ -524,10 +529,11 @@ class _TalkViewPageState extends State<TalkViewPage>
|
||||
child: Image.asset(iconUrl, fit: BoxFit.fitWidth),
|
||||
),
|
||||
SizedBox(height: 20.w),
|
||||
Expanded(
|
||||
child: Text(name,
|
||||
style: TextStyle(fontSize: 20.sp, color: Colors.white),
|
||||
textAlign: TextAlign.center),
|
||||
Text(
|
||||
name,
|
||||
style: TextStyle(fontSize: 20.sp, color: Colors.white),
|
||||
textAlign: TextAlign.center, // 当文本超出指定行数时,使用省略号表示
|
||||
maxLines: 2, // 设置最大行数为1
|
||||
)
|
||||
],
|
||||
),
|
||||
|
||||
@ -23,10 +23,9 @@ class WxPushWeChatMiniProgramTool {
|
||||
doOnIOS: true);
|
||||
}
|
||||
|
||||
static Future<void> pushWeChatMiniProgram(String appId) async {
|
||||
static Future<void> pushWeChatMiniProgram(String appId,String _associationUrl) async {
|
||||
if (!isInit) {
|
||||
isInit = true;
|
||||
final String _associationUrl = await Storage.getAssociationUrl();
|
||||
await initWeChatMiniProgram(appId, _associationUrl);
|
||||
|
||||
final MiniProgram miniProgram = MiniProgram(
|
||||
|
||||
12
pubspec.yaml
12
pubspec.yaml
@ -109,12 +109,12 @@ version: 1.0.85+2025010802
|
||||
environment:
|
||||
sdk: '>=2.12.0 <3.0.0'
|
||||
|
||||
fluwx:
|
||||
app_id: 'wxbe340095d2b8fd51'
|
||||
debug_logging: true
|
||||
android:
|
||||
ios:
|
||||
universal_link: https://lock.skychip.top/apple-app-site-association.json
|
||||
#fluwx:
|
||||
# app_id: 'wxbe340095d2b8fd51'
|
||||
# debug_logging: true
|
||||
# android:
|
||||
# ios:
|
||||
# universal_link: https://lock.skychip.top/apple-app-site-association.json
|
||||
|
||||
# Dependencies specify other packages that your package needs in order to work.
|
||||
# To automatically upgrade your package dependencies to the latest versions
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user