2024-05-31 14:11:16 +08:00
|
|
|
|
import 'dart:io';
|
|
|
|
|
|
|
|
|
|
|
|
import 'package:device_info_plus/device_info_plus.dart';
|
2024-08-21 14:12:15 +08:00
|
|
|
|
import 'package:get/get.dart';
|
2024-05-31 14:11:16 +08:00
|
|
|
|
|
2024-01-27 16:05:17 +08:00
|
|
|
|
import '../../flavors.dart';
|
2023-10-18 11:42:45 +08:00
|
|
|
|
|
|
|
|
|
|
class XSConstantMacro {
|
|
|
|
|
|
// 网页的宏定义网址
|
2024-01-27 16:05:17 +08:00
|
|
|
|
static String baseWebURL = F.apiPrefix; //base地址
|
2023-10-18 11:42:45 +08:00
|
|
|
|
static String introduceURL = '$baseWebURL/app/introduce'; //介绍页
|
|
|
|
|
|
static String userAgreementURL = '$baseWebURL/app/userAgreement'; //用户协议
|
|
|
|
|
|
static String privacyPolicyURL = '$baseWebURL/app/privacy'; //隐私政策
|
|
|
|
|
|
static String collectionListURL =
|
|
|
|
|
|
'$baseWebURL/app/personalInformationCollectionList'; //个人信息收集清单
|
|
|
|
|
|
static String thirdPartyInfShareListURL =
|
|
|
|
|
|
'$baseWebURL/app/thirdPartyInformationSharingList'; //第三方信息共享清单
|
|
|
|
|
|
static String appPermissionDescURL =
|
|
|
|
|
|
'$baseWebURL/app/applicationPermissionDescription'; //应用权限说明
|
2024-05-04 10:33:35 +08:00
|
|
|
|
static String vipServiceDetailURL =
|
|
|
|
|
|
'$baseWebURL/value-added/vip-intro'; //增值服务特权详情页
|
2023-10-18 11:42:45 +08:00
|
|
|
|
|
|
|
|
|
|
// 钥匙类型 keyType 1-永久 2-限期 3-单次 4-循环
|
|
|
|
|
|
static int keyTypeLong = 1;
|
|
|
|
|
|
static int keyTypeTime = 2;
|
|
|
|
|
|
static int keyTypeOnce = 3;
|
|
|
|
|
|
static int keyTypeLoop = 4;
|
2024-02-01 11:22:44 +08:00
|
|
|
|
|
|
|
|
|
|
// "110401" 正常使用
|
|
|
|
|
|
// "110402" 待接收
|
|
|
|
|
|
// "110403" 待生效
|
|
|
|
|
|
// "110405" 已冻结
|
|
|
|
|
|
// "110412" 已过期
|
|
|
|
|
|
// "110408" 已删除
|
|
|
|
|
|
// "110410" 已重置
|
2024-03-27 17:40:31 +08:00
|
|
|
|
static int keyStatusNormalUse = 110401; // 正常使用
|
|
|
|
|
|
static int keyStatusWaitReceive = 110402; // 待接收
|
2024-02-01 11:22:44 +08:00
|
|
|
|
static int keyStatusWaitIneffective = 110403; // 待生效
|
2024-03-27 17:40:31 +08:00
|
|
|
|
static int keyStatusFrozen = 110405; // 已冻结
|
|
|
|
|
|
static int keyStatusExpired = 110412; // 已过期
|
|
|
|
|
|
static int keyStatusDeleted = 110408; // 已删除
|
|
|
|
|
|
static int keyStatusReset = 110410; // 已重置
|
2024-02-01 11:22:44 +08:00
|
|
|
|
|
2024-03-27 17:40:31 +08:00
|
|
|
|
static String getKeyStatusStr(int keyStatus) {
|
|
|
|
|
|
switch (keyStatus) {
|
2024-02-01 11:22:44 +08:00
|
|
|
|
case 110401:
|
2024-03-28 13:46:35 +08:00
|
|
|
|
// 正常使用
|
2024-05-30 11:53:25 +08:00
|
|
|
|
return '';
|
2024-02-01 11:22:44 +08:00
|
|
|
|
case 110402:
|
2024-08-21 14:12:15 +08:00
|
|
|
|
return '待接收'.tr;
|
2024-02-01 11:22:44 +08:00
|
|
|
|
case 110403:
|
2024-08-21 14:12:15 +08:00
|
|
|
|
return '未生效'.tr;
|
2024-02-01 11:22:44 +08:00
|
|
|
|
case 110405:
|
2024-08-21 14:12:15 +08:00
|
|
|
|
return '已冻结'.tr;
|
2024-02-01 11:22:44 +08:00
|
|
|
|
case 110408:
|
2024-08-21 14:12:15 +08:00
|
|
|
|
return '已删除'.tr;
|
2024-02-01 11:22:44 +08:00
|
|
|
|
// case 110410:
|
|
|
|
|
|
// return "已重置";
|
|
|
|
|
|
case 110412:
|
2024-08-21 14:12:15 +08:00
|
|
|
|
return '已过期'.tr;
|
2024-02-01 11:22:44 +08:00
|
|
|
|
default:
|
2024-08-21 14:12:15 +08:00
|
|
|
|
return '未知'.tr;
|
2024-02-01 11:22:44 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2024-03-27 17:40:31 +08:00
|
|
|
|
|
2024-02-01 10:52:23 +08:00
|
|
|
|
// 门锁事件类型 lockEventType 事件类型:0-全部事件;10-开门事件20-异常事件30-门铃事件40-视频事件
|
|
|
|
|
|
static int lockEventTypeAll = 0;
|
|
|
|
|
|
static int lockEventTypeOpenDoor = 10;
|
|
|
|
|
|
static int lockEventTypeAbnormal = 20;
|
|
|
|
|
|
static int lockEventTypeDoorbell = 30;
|
|
|
|
|
|
static int lockEventTypeVideo = 40;
|
2024-03-27 17:40:31 +08:00
|
|
|
|
|
|
|
|
|
|
//猫眼工作模式
|
|
|
|
|
|
static int catEyeWorkModePowerSaving = 1; //省电模式
|
|
|
|
|
|
static int catEyeWorkModeStayCapture = 2; //逗留抓拍模式
|
|
|
|
|
|
static int catEyeWorkModeRealTimeMonitoring = 3; //实时监控模式
|
|
|
|
|
|
static int catEyeWorkModeCustom = 4; //自定义模式
|
2024-05-21 17:11:56 +08:00
|
|
|
|
|
|
|
|
|
|
//管理员类型
|
|
|
|
|
|
static int userTypeSuperAdmin = 110301; //超级管理员
|
|
|
|
|
|
static int userTypeAuthorizedAdmin = 110302; //授权管理员
|
|
|
|
|
|
|
|
|
|
|
|
//电子钥匙类型
|
|
|
|
|
|
static int keyRightAdmin = 1; //管理钥匙
|
|
|
|
|
|
static int keyRightOrdinary = 2; //普通钥匙
|
2024-05-30 11:53:25 +08:00
|
|
|
|
|
|
|
|
|
|
//网页购买链接类型
|
|
|
|
|
|
static int webBuyTypeSMS = 1; //短信购买
|
|
|
|
|
|
static int webBuyTypeEmail = 2; //邮件购买
|
|
|
|
|
|
static int webBuyTypeVip = 3; //VIP购买
|
|
|
|
|
|
static int webBuyTypeAuth = 4; //实名购买
|
|
|
|
|
|
static int webBuyTypeShop = 5; //商城购买
|
2024-05-31 14:11:16 +08:00
|
|
|
|
|
|
|
|
|
|
//设备类型信息
|
|
|
|
|
|
Future<Map<String, dynamic>> getDeviceInfoData() async {
|
|
|
|
|
|
final DeviceInfoPlugin deviceInfo = DeviceInfoPlugin();
|
|
|
|
|
|
final Map<String, dynamic> deviceData = <String, dynamic>{};
|
|
|
|
|
|
|
|
|
|
|
|
if (Platform.isAndroid) {
|
|
|
|
|
|
final AndroidDeviceInfo androidInfo = await deviceInfo.androidInfo;
|
|
|
|
|
|
deviceData['deviceBrand'] = androidInfo.brand;
|
|
|
|
|
|
deviceData['deviceModel'] = androidInfo.model;
|
|
|
|
|
|
deviceData['deviceVersion'] = androidInfo.version.release;
|
2024-09-10 17:20:28 +08:00
|
|
|
|
deviceData['deviceID'] = androidInfo.id;
|
2024-05-31 14:11:16 +08:00
|
|
|
|
deviceData['deviceType'] = 10;
|
|
|
|
|
|
} else if (Platform.isIOS) {
|
|
|
|
|
|
final IosDeviceInfo iosInfo = await deviceInfo.iosInfo;
|
|
|
|
|
|
deviceData['deviceBrand'] = iosInfo.name;
|
2024-09-10 17:20:28 +08:00
|
|
|
|
deviceData['deviceModel'] = iosInfo.utsname.nodename;
|
2024-05-31 14:11:16 +08:00
|
|
|
|
deviceData['deviceVersion'] = iosInfo.systemVersion;
|
2024-09-10 17:20:28 +08:00
|
|
|
|
deviceData['deviceID'] = iosInfo.identifierForVendor;
|
2024-05-31 14:11:16 +08:00
|
|
|
|
deviceData['deviceType'] = 20;
|
|
|
|
|
|
}
|
|
|
|
|
|
return deviceData;
|
|
|
|
|
|
}
|
2023-10-18 11:42:45 +08:00
|
|
|
|
}
|