Merge branch 'release' of gitee.com:starlock-cn/app-starlock into release
This commit is contained in:
commit
0a9aeb2027
@ -646,9 +646,9 @@
|
||||
"消息详情": "Message details",
|
||||
"创建时间": "Creation time",
|
||||
"管理员详情": "Administrator details",
|
||||
"当被胁迫要求强行开锁时,使用胁迫卡会触发报警,报警信息回推送给管理员,该功能需要锁联网。": "When being coerced to forcibly unlock, using a coercion card will trigger an alarm, and the alarm information will be pushed to the administrator. This function requires the lock to be networked.",
|
||||
"当被胁迫要求强行开锁时,使用胁迫卡会触发报警,报警信息会推送给管理员,该功能需要锁联网。": "When being coerced to forcibly unlock, using a coercion card will trigger an alarm, and the alarm information will be pushed to the administrator. This function requires the lock to be networked.",
|
||||
"请不要将胁迫卡用于日常开锁": "Please do not use coercion cards for daily unlocking",
|
||||
"当被胁迫要求强行开锁时,使用胁迫指纹会触发报警,报警信息回推送给管理员,该功能需要锁联网。": "When being coerced to forcibly unlock, using coercion fingerprints will trigger an alarm, and the alarm information will be pushed to the administrator. This function requires the lock to be networked.",
|
||||
"当被胁迫要求强行开锁时,使用胁迫指纹会触发报警,报警信息会推送给管理员,该功能需要锁联网。": "When being coerced to forcibly unlock, using coercion fingerprints will trigger an alarm, and the alarm information will be pushed to the administrator. This function requires the lock to be networked.",
|
||||
"请不要将胁迫指纹用于日常开锁": "Please do not use coercion fingerprints for daily unlocking",
|
||||
"创建公司": "Create company",
|
||||
"公司名称不能超过30个字符": "Company name cannot exceed 30 characters",
|
||||
|
||||
@ -671,9 +671,9 @@
|
||||
"消息详情": "消息详情",
|
||||
"创建时间": "创建时间",
|
||||
"管理员详情": "管理员详情",
|
||||
"当被胁迫要求强行开锁时,使用胁迫卡会触发报警,报警信息回推送给管理员,该功能需要锁联网。": "当被胁迫要求强行开锁时,使用胁迫卡会触发报警,报警信息回推送给管理员,该功能需要锁联网。",
|
||||
"当被胁迫要求强行开锁时,使用胁迫卡会触发报警,报警信息会推送给管理员,该功能需要锁联网。": "当被胁迫要求强行开锁时,使用胁迫卡会触发报警,报警信息会推送给管理员,该功能需要锁联网。",
|
||||
"请不要将胁迫卡用于日常开锁": "请不要将胁迫卡用于日常开锁",
|
||||
"当被胁迫要求强行开锁时,使用胁迫指纹会触发报警,报警信息回推送给管理员,该功能需要锁联网。": "当被胁迫要求强行开锁时,使用胁迫指纹会触发报警,报警信息回推送给管理员,该功能需要锁联网。",
|
||||
"当被胁迫要求强行开锁时,使用胁迫指纹会触发报警,报警信息会推送给管理员,该功能需要锁联网。": "当被胁迫要求强行开锁时,使用胁迫指纹会触发报警,报警信息会推送给管理员,该功能需要锁联网。",
|
||||
"请不要将胁迫指纹用于日常开锁": "请不要将胁迫指纹用于日常开锁",
|
||||
"创建公司": "创建公司",
|
||||
"公司名称不能超过30个字符": "公司名称不能超过30个字符",
|
||||
|
||||
@ -646,9 +646,9 @@
|
||||
"消息详情": "消息详情",
|
||||
"创建时间": "创建时间",
|
||||
"管理员详情": "管理员详情",
|
||||
"当被胁迫要求强行开锁时,使用胁迫卡会触发报警,报警信息回推送给管理员,该功能需要锁联网。": "当被胁迫要求强行开锁时,使用胁迫卡会触发报警,报警信息回推送给管理员,该功能需要锁联网。",
|
||||
"当被胁迫要求强行开锁时,使用胁迫卡会触发报警,报警信息会推送给管理员,该功能需要锁联网。": "当被胁迫要求强行开锁时,使用胁迫卡会触发报警,报警信息会推送给管理员,该功能需要锁联网。",
|
||||
"请不要将胁迫卡用于日常开锁": "请不要将胁迫卡用于日常开锁",
|
||||
"当被胁迫要求强行开锁时,使用胁迫指纹会触发报警,报警信息回推送给管理员,该功能需要锁联网。": "当被胁迫要求强行开锁时,使用胁迫指纹会触发报警,报警信息回推送给管理员,该功能需要锁联网。",
|
||||
"当被胁迫要求强行开锁时,使用胁迫指纹会触发报警,报警信息会推送给管理员,该功能需要锁联网。": "当被胁迫要求强行开锁时,使用胁迫指纹会触发报警,报警信息会推送给管理员,该功能需要锁联网。",
|
||||
"请不要将胁迫指纹用于日常开锁": "请不要将胁迫指纹用于日常开锁",
|
||||
"创建公司": "创建公司",
|
||||
"公司名称不能超过30个字符": "公司名称不能超过30个字符",
|
||||
|
||||
40
lib/login/login/app_get_version.dart
Normal file
40
lib/login/login/app_get_version.dart
Normal file
@ -0,0 +1,40 @@
|
||||
class GetAppInfo {
|
||||
GetAppInfo({this.errorCode, this.description, this.errorMsg, this.data});
|
||||
|
||||
GetAppInfo.fromJson(Map<String, dynamic> json) {
|
||||
errorCode = json['errorCode'];
|
||||
description = json['description'];
|
||||
errorMsg = json['errorMsg'];
|
||||
if (json['data'] is Map) {
|
||||
data = Data.fromJson(json['data']);
|
||||
}
|
||||
}
|
||||
|
||||
int? errorCode;
|
||||
String? description;
|
||||
String? errorMsg;
|
||||
Data? data;
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['errorCode'] = errorCode;
|
||||
data['description'] = description;
|
||||
data['errorMsg'] = errorMsg;
|
||||
data['data'] = this.data;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Data {
|
||||
Data.fromJson(Map<String, dynamic> json) {
|
||||
wechatServiceUrl = json['wechat_service_url'];
|
||||
}
|
||||
|
||||
String? wechatServiceUrl;
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['wechat_service_url'] = wechatServiceUrl;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -3,6 +3,7 @@ import 'package:flutter/services.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/flavors.dart';
|
||||
import 'package:star_lock/tools/customer_tool.dart';
|
||||
|
||||
import '../../appRouters.dart';
|
||||
import '../../app_settings/app_colors.dart';
|
||||
@ -35,6 +36,12 @@ class _StarLockLoginPageState extends State<StarLockLoginPage> {
|
||||
haveBack: false,
|
||||
backgroundColor: AppColors.mainColor,
|
||||
actionsList: [
|
||||
const IconButton(
|
||||
onPressed: CustomerTool.openCustomerService,
|
||||
icon: Icon(
|
||||
Icons.support_agent,
|
||||
color: Colors.white,
|
||||
)),
|
||||
TextButton(
|
||||
child: Text(
|
||||
TranslationLoader.lanKeys!.register!.tr,
|
||||
@ -239,22 +246,24 @@ class _StarLockLoginPageState extends State<StarLockLoginPage> {
|
||||
child: SizedBox(
|
||||
width: 10.sp,
|
||||
)),
|
||||
if (F.isLite) Container() else GestureDetector(
|
||||
child: SizedBox(
|
||||
// width: 150.w,
|
||||
height: 50.h,
|
||||
// color: Colors.red,
|
||||
child: Center(
|
||||
child: Text('演示模式'.tr,
|
||||
style: TextStyle(
|
||||
fontSize: 22.sp,
|
||||
color: AppColors.mainColor)),
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
Get.toNamed(Routers.demoModeLockDetailPage);
|
||||
},
|
||||
)
|
||||
if (F.isLite)
|
||||
Container()
|
||||
else
|
||||
GestureDetector(
|
||||
child: SizedBox(
|
||||
// width: 150.w,
|
||||
height: 50.h,
|
||||
// color: Colors.red,
|
||||
child: Center(
|
||||
child: Text('演示模式'.tr,
|
||||
style: TextStyle(
|
||||
fontSize: 22.sp, color: AppColors.mainColor)),
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
Get.toNamed(Routers.demoModeLockDetailPage);
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
|
||||
@ -1,9 +1,12 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/flavors.dart';
|
||||
import 'package:star_lock/login/login/starLock_login_state.dart';
|
||||
import 'package:star_lock/tools/customer_tool.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
import '../../appRouters.dart';
|
||||
import '../../app_settings/app_colors.dart';
|
||||
@ -33,7 +36,7 @@ class _StarLockLoginPageState extends State<StarLockLoginXHJPage> {
|
||||
backgroundColor: const Color(0xFFFFFFFF),
|
||||
body: ListView(
|
||||
padding: EdgeInsets.only(
|
||||
top: 120.h,
|
||||
top: 110.h,
|
||||
),
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
@ -41,12 +44,24 @@ class _StarLockLoginPageState extends State<StarLockLoginXHJPage> {
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
'${"欢迎使用".tr}${F.title}',
|
||||
style: TextStyle(
|
||||
color: AppColors.darkGrayTextColor,
|
||||
fontSize: 48.sp,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
'${"欢迎使用".tr}${F.title}',
|
||||
style: TextStyle(
|
||||
color: AppColors.darkGrayTextColor,
|
||||
fontSize: 48.sp,
|
||||
),
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
onPressed: CustomerTool.openCustomerService,
|
||||
icon: Icon(
|
||||
Icons.support_agent,
|
||||
color: AppColors.mainColor,
|
||||
)),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 30.h),
|
||||
GestureDetector(
|
||||
|
||||
@ -281,7 +281,7 @@ class _AddCardPageState extends State<AddCardPage>
|
||||
color: Colors.white,
|
||||
padding: EdgeInsets.only(left: 20.w, right: 20.w, bottom: 20.h),
|
||||
child: Text(
|
||||
"${"当被胁迫要求强行开锁时,使用胁迫卡会触发报警,报警信息回推送给管理员,该功能需要锁联网。".tr}\n${"请不要将胁迫卡用于日常开锁".tr}",
|
||||
"${"当被胁迫要求强行开锁时,使用胁迫卡会触发报警,报警信息会推送给管理员,该功能需要锁联网。".tr}\n${"请不要将胁迫卡用于日常开锁".tr}",
|
||||
style: TextStyle(
|
||||
fontSize: 22.sp, color: AppColors.darkGrayTextColor),
|
||||
)),
|
||||
|
||||
@ -271,7 +271,7 @@ class _AddFingerprintTypePageState extends State<AddFingerprintTypePage> with Si
|
||||
color: Colors.white,
|
||||
padding: EdgeInsets.only(left:20.w, right: 20.w, bottom: 20.h),
|
||||
child: Text(
|
||||
"${"当被胁迫要求强行开锁时,使用胁迫指纹会触发报警,报警信息回推送给管理员,该功能需要锁联网。".tr}\n${"请不要将胁迫指纹用于日常开锁".tr}",
|
||||
"${"当被胁迫要求强行开锁时,使用胁迫指纹会触发报警,报警信息会推送给管理员,该功能需要锁联网。".tr}\n${"请不要将胁迫指纹用于日常开锁".tr}",
|
||||
style: TextStyle(
|
||||
fontSize: 22.sp, color: AppColors.darkGrayTextColor),
|
||||
)
|
||||
|
||||
@ -10,6 +10,7 @@ import 'package:star_lock/flavors.dart';
|
||||
import 'package:star_lock/mine/mineSet/mineSet/mineSet_logic.dart';
|
||||
import 'package:star_lock/mine/mineSet/mineSet/mineSet_state.dart';
|
||||
import 'package:star_lock/tools/appFirstEnterHandle.dart';
|
||||
import 'package:star_lock/tools/customer_tool.dart';
|
||||
import '../../../appRouters.dart';
|
||||
import '../../../app_settings/app_colors.dart';
|
||||
import '../../../tools/commonItem.dart';
|
||||
@ -352,6 +353,12 @@ class _MineSetPageState extends State<MineSetPage> with WidgetsBindingObserver {
|
||||
action: () {
|
||||
logic.showToast('功能暂未开放'.tr);
|
||||
}),
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.supportStaff!.tr,
|
||||
isHaveLine: widget.showAbout,
|
||||
isHaveDirection: true,
|
||||
action: CustomerTool.openCustomerService,
|
||||
),
|
||||
if (widget.showAbout)
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.about!.tr,
|
||||
|
||||
@ -239,4 +239,5 @@ abstract class Api {
|
||||
|
||||
final String lockDataUploadUrl = '/lockRecords/lockDataUpload'; // 锁数据上传
|
||||
final String getNoticeTemplateURL = '/key/getNoticeTemplate'; //获取短信或者邮箱模板
|
||||
final String appGetAppInfoURL = '/app/getAppInfo'; //获取APP基本信息
|
||||
}
|
||||
|
||||
@ -2122,6 +2122,11 @@ class ApiProvider extends BaseProvider {
|
||||
'keyId': keyId,
|
||||
'channelType': channelType,
|
||||
}));
|
||||
|
||||
// 获取App基本信息
|
||||
Future<Response<dynamic>> getAppInfo() =>
|
||||
post(appGetAppInfoURL.toUrl, jsonEncode(<String, int>{}),
|
||||
isShowErrMsg: false);
|
||||
}
|
||||
|
||||
extension ExtensionString on String {
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/blue/entity/lock_user_no_list_entity.dart';
|
||||
import 'package:star_lock/login/login/app_get_version.dart';
|
||||
import 'package:star_lock/login/selectCountryRegion/common/countryRegionEntity.dart';
|
||||
import 'package:star_lock/main/lockDetail/authorizedAdmin/authorizedAdmin/notice_template_entity.dart';
|
||||
import 'package:star_lock/main/lockDetail/doorLockLog/doorLockLog_entity.dart';
|
||||
@ -2150,4 +2151,11 @@ class ApiRepository {
|
||||
await apiProvider.getNoticeTemplate(lockId, keyId, channelType);
|
||||
return NoticeTemplateEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
// 电子钥匙获取短信模板
|
||||
Future<GetAppInfo> getAppInfo() async {
|
||||
final Response<dynamic> res =
|
||||
await apiProvider.getAppInfo();
|
||||
return GetAppInfo.fromJson(res.body);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,10 +1,13 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:star_lock/flavors.dart';
|
||||
import 'package:star_lock/login/login/app_get_version.dart';
|
||||
import 'package:star_lock/login/login/starLock_login_page.dart';
|
||||
import 'package:star_lock/login/login/starLock_login_xhj_page.dart';
|
||||
import 'package:star_lock/main/lockMian/lockMain/xhj/lockMain_xhj_page.dart';
|
||||
import 'package:star_lock/mine/about/debug/debug_tool.dart';
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
import 'package:star_lock/tools/appFirstEnterHandle.dart';
|
||||
import 'package:star_lock/tools/customer_tool.dart';
|
||||
import 'package:star_lock/tools/storage.dart';
|
||||
|
||||
import '../main/lockMian/lockMain/lockMain_page.dart';
|
||||
@ -41,6 +44,7 @@ class _StarLockApplicationState extends State<StarLockApplication> {
|
||||
} else if (snapshot.hasData) {
|
||||
if (snapshot.data!) {
|
||||
// 如果用户已登录,返回主页面
|
||||
getAppInfo();
|
||||
return F.sw(
|
||||
skyCall: () => StarLockMainPage(),
|
||||
xhjCall: () => const StarLockMainXHJPage());
|
||||
@ -76,4 +80,9 @@ class _StarLockApplicationState extends State<StarLockApplication> {
|
||||
AppFirstEnterHandle().getAppFirstEnter(isShowUpdateVersion);
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> getAppInfo() async {
|
||||
final GetAppInfo entity = await ApiRepository.to.getAppInfo();
|
||||
CustomerTool.init(entity.data?.wechatServiceUrl ?? '');
|
||||
}
|
||||
}
|
||||
|
||||
@ -8,34 +8,36 @@ import 'package:star_lock/appRouters.dart';
|
||||
import 'package:star_lock/app_settings/app_colors.dart';
|
||||
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
|
||||
import 'package:star_lock/flavors.dart';
|
||||
import 'package:star_lock/login/login/app_get_version.dart';
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
import 'package:star_lock/tools/customer_tool.dart';
|
||||
import 'package:star_lock/tools/storage.dart';
|
||||
|
||||
import '../versionUndate/versionUndateTool.dart';
|
||||
|
||||
class AppFirstEnterHandle {
|
||||
Future getAppFirstEnter(String flagStr) async {
|
||||
var getFlag = await Storage.getString(flagStr);
|
||||
Future<void> getAppFirstEnter(String flagStr) async {
|
||||
final dynamic getFlag = await Storage.getString(flagStr);
|
||||
switch (flagStr) {
|
||||
case isAgreePrivacy: // 隐私协议
|
||||
{
|
||||
if (getFlag != isAgreePrivacy) {
|
||||
showPrivacyAgreementAlert();
|
||||
}
|
||||
if (getFlag != isAgreePrivacy) {
|
||||
await showPrivacyAgreementAlert();
|
||||
}
|
||||
getAppInfo();
|
||||
break;
|
||||
case isAgreePosition: // 位置权限
|
||||
{
|
||||
if (getFlag != isAgreePosition) showPositionAlert();
|
||||
if (getFlag != isAgreePosition) {
|
||||
showPositionAlert();
|
||||
}
|
||||
break;
|
||||
case isAgreeCamera: // 相机权限
|
||||
{
|
||||
if (getFlag != isAgreeCamera) showCameraAlert();
|
||||
if (getFlag != isAgreeCamera) {
|
||||
showCameraAlert();
|
||||
}
|
||||
break;
|
||||
case isShowUpdateVersion: // 版本更新
|
||||
{
|
||||
if (getFlag != isShowUpdateVersion) VersionUndateTool();
|
||||
if (getFlag != isShowUpdateVersion) {
|
||||
VersionUndateTool();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@ -44,8 +46,8 @@ class AppFirstEnterHandle {
|
||||
}
|
||||
|
||||
//隐私协议弹窗
|
||||
void showPrivacyAgreementAlert() {
|
||||
showCupertinoDialog(
|
||||
Future<void> showPrivacyAgreementAlert() async {
|
||||
await showCupertinoDialog(
|
||||
context: Get.context!,
|
||||
builder: (context) {
|
||||
return PopScope(
|
||||
@ -57,6 +59,11 @@ class AppFirstEnterHandle {
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> getAppInfo() async {
|
||||
final GetAppInfo entity = await ApiRepository.to.getAppInfo();
|
||||
CustomerTool.init(entity.data?.wechatServiceUrl ?? '');
|
||||
}
|
||||
|
||||
//默认布局
|
||||
Widget _defaultPrivacyAgreementAlert(BuildContext context) {
|
||||
return CupertinoAlertDialog(
|
||||
|
||||
18
lib/tools/customer_tool.dart
Normal file
18
lib/tools/customer_tool.dart
Normal file
@ -0,0 +1,18 @@
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
//客服工具类
|
||||
class CustomerTool {
|
||||
static String _customerServiceUrl = '';
|
||||
|
||||
//初始化
|
||||
static Future<void> init(String customerServiceUrl) async {
|
||||
_customerServiceUrl = customerServiceUrl;
|
||||
}
|
||||
|
||||
//打开客服
|
||||
static void openCustomerService() {
|
||||
if (_customerServiceUrl.isNotEmpty) {
|
||||
launchUrl(Uri.parse(_customerServiceUrl));
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user