fix: 星锁修复1.0.80版本提测问题

This commit is contained in:
“DaisyWu” 2024-09-23 18:20:18 +08:00
parent 22887609f5
commit 3e42092455
15 changed files with 155 additions and 38 deletions

View File

@ -911,13 +911,13 @@
"支持的国家": "Supported countries",
"支持的国家值":"United States, Canada, United Kingdom, Germany, France, Italy, Spain, Australia, New Zealand, India, Japan",
"操作流程": "Operation process",
"操作流程值": "1. Open the Alexa app and search for the Skye Smart Lock skill\n2. Click Enable Skill and log in to your Skye account\n3. Say 'Alexa, discover devices' to Alexa\n4. After discovering the device, you can use the voice command to control the lock"
"操作流程值": "1. Open the Alexa app and search for the Skye Smart Lock skill\n2. Click Enable Skill and log in to your Skye account\n3. Say 'Alexa, discover devices' to Alexa\n4. After discovering the device, you can use the voice command to control the lock",
"密码需至少包含数字/字母/字符中的2种组合": "The password must contain at least 2 combinations of numbers/letters/characters",
"Google Home": "Google Home",
"Action name": "Action name",
"ScienerSmart": "ScienerSmart",
"支持的语言": "Supported languages",
"英语": "English",
"Google Home操作流程的值": "1. Open the Google Home app and click the '+' in the upper left corner\n2. Click 'Set up device' and select 'Works with Google'\n3. Search for 'ScienerSmart' and log in to your Skye account\n4. After discovering the device, you can use the voice command to control the lock",
"Google Home操作流程的值": "1. Add the lock and gateway with the Smart lock APP\n\n2. Open the remote unlocking function of the lock in the APP (this function is turned off by default). Without this option, the lock does not support Google Home \n\n3. To install the Google Home APP, click the + button in the top left corner\n\n4. On the Settings page, select Work with Google\n\n5. Search for ScienerSmart and authorize with your Smart Lock APP account and password",
"开启": "Open"
}

View File

@ -947,8 +947,6 @@
"支持的国家":"支持的国家",
"支持的国家值":"支持的国家值",
"操作流程":"操作流程",
"操作流程值":"操作流程值",
"秒内不可使用面容开锁": "秒内不可使用面容开锁",
"密码需至少包含数字/字母/字符中的2种组合": "密码需至少包含数字/字母/字符中的2种组合",
"操作流程值":"操作流程值",

View File

@ -916,6 +916,6 @@
"ScienerSmart": "ScienerSmart",
"支持的语言": "支持的语言",
"英语": "英语",
"Google Home操作流程的值": "1.用智能锁APP添加锁和网关\n\n2.在APP里开启锁的远程开锁功能这个功能默认是关闭的。如果没有这个选项则锁不支持Google Home \n\n3.安装Google Home APP点击左上角的“+”按钮\n\n4.在设置页面选择“与Google协同工作”\n\n5.搜索“ScienerSmart”并用智能锁APP的账号和密码进行授权\n\n6.在智能锁APP里设置安全码使用Google Home开锁时提供此安全码",
"Google Home操作流程的值": "1.用智能锁APP添加锁和网关\n\n2.在APP里开启锁的远程开锁功能这个功能默认是关闭的。如果没有这个选项则锁不支持Google Home \n\n3.安装Google Home APP点击左上角的“+”按钮\n\n4.在设置页面选择“与Google协同工作”\n\n5.搜索“ScienerSmart”并用智能锁APP的账号和密码进行授权\n\n",
"开启": "开启"
}

View File

@ -1,9 +1,4 @@
class MinePersonInfoEntity {
int? errorCode;
String? description;
String? errorMsg;
MinePersonInfoData? data;
MinePersonInfoEntity(
{this.errorCode, this.description, this.errorMsg, this.data});
@ -14,6 +9,10 @@ class MinePersonInfoEntity {
data =
json['data'] != null ? MinePersonInfoData.fromJson(json['data']) : null;
}
int? errorCode;
String? description;
String? errorMsg;
MinePersonInfoData? data;
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
@ -28,18 +27,6 @@ class MinePersonInfoEntity {
}
class MinePersonInfoData {
String? mobile;
int? uid;
int? haveSafeAnswer;
String? nickname;
String? headUrl;
String? accountName;
int? countryId;
String? email;
String? countryName;
int? isVip;
String? deviceId;
MinePersonInfoData(
{this.mobile,
this.uid,
@ -51,7 +38,10 @@ class MinePersonInfoData {
this.email,
this.countryName,
this.isVip,
this.deviceId});
this.deviceId,
this.lang,
this.amazonAlexa,
this.googleHome});
MinePersonInfoData.fromJson(Map<String, dynamic> json) {
mobile = json['mobile'];
@ -65,7 +55,28 @@ class MinePersonInfoData {
countryName = json['countryName'];
isVip = json['isVip'];
deviceId = json['deviceId'];
lang = json['lang'];
amazonAlexa = json['amazonAlexa'] != null
? AmazonAlexa.fromJson(json['amazonAlexa'])
: null;
googleHome = json['googleHome'] != null
? GoogleHome.fromJson(json['googleHome'])
: null;
}
String? mobile;
int? uid;
int? haveSafeAnswer;
String? nickname;
String? headUrl;
String? accountName;
int? countryId;
String? email;
String? countryName;
int? isVip;
String? deviceId;
String? lang;
AmazonAlexa? amazonAlexa;
GoogleHome? googleHome;
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
@ -80,6 +91,50 @@ class MinePersonInfoData {
data['countryName'] = countryName;
data['isVip'] = isVip;
data['deviceId'] = deviceId;
data['lang'] = lang;
if (amazonAlexa != null) {
data['amazonAlexa'] = amazonAlexa!.toJson();
}
if (googleHome != null) {
data['googleHome'] = googleHome!.toJson();
}
return data;
}
}
class AmazonAlexa {
AmazonAlexa({this.skillName, this.langs});
AmazonAlexa.fromJson(Map<String, dynamic> json) {
skillName = json['skillName'];
langs = json['langs'].cast<String>();
}
String? skillName;
List<String>? langs;
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['skillName'] = skillName;
data['langs'] = langs;
return data;
}
}
class GoogleHome {
GoogleHome({this.actionName, this.langs});
GoogleHome.fromJson(Map<String, dynamic> json) {
actionName = json['actionName'];
langs = json['langs'].cast<String>();
}
String? actionName;
List<String>? langs;
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['actionName'] = actionName;
data['langs'] = langs;
return data;
}
}

View File

@ -0,0 +1,6 @@
import 'package:star_lock/mine/mineSet/amazon_alexa/amazon_alexa_state.dart';
import '../../../../tools/baseGetXController.dart';
class AmazonAlexaLogic extends BaseGetXController {
final AmazonAlexaState state = AmazonAlexaState();
}

View File

@ -1,6 +1,8 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:star_lock/mine/mineSet/amazon_alexa/amazon_alexa_logic.dart';
import 'package:star_lock/mine/mineSet/amazon_alexa/amazon_alexa_state.dart';
import '../../../../app_settings/app_colors.dart';
import '../../../../tools/titleAppBar.dart';
@ -25,6 +27,8 @@ class _AmazonAlexaPageState extends State<AmazonAlexaPage> {
final EdgeInsets _contentPadding =
EdgeInsets.symmetric(horizontal: 20.w, vertical: 20.h);
final AmazonAlexaLogic logic = Get.put(AmazonAlexaLogic());
final AmazonAlexaState state = Get.find<AmazonAlexaLogic>().state;
@override
Widget build(BuildContext context) {
@ -62,6 +66,11 @@ class _AmazonAlexaPageState extends State<AmazonAlexaPage> {
),
SizedBox(height: 30.h),
Text('Amazon Alexa'.tr, style: _titleStyle),
Obx(() => Text(
'(Skill name: ${state.amazonAlexaData.value.skillName ?? ''})',
style: _descriptionStyle,
textAlign: TextAlign.center,
)),
SizedBox(height: 10.h),
Text(
'您可以使用Alexa进行开锁、闭锁和查看锁状态'.tr,
@ -80,7 +89,8 @@ class _AmazonAlexaPageState extends State<AmazonAlexaPage> {
padding: _contentPadding,
child: Column(
children: [
_buildInfoSection('支持的国家'.tr, '支持的国家值'.tr),
_buildInfoSection(
'支持的国家'.tr, '${state.amazonAlexaData.value.langs?.join('')}'),
SizedBox(height: 20.h),
_buildInfoSection('操作流程'.tr, '操作流程值'.tr),
],

View File

@ -0,0 +1,13 @@
import 'package:get/get.dart';
import 'package:star_lock/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_entity.dart';
class AmazonAlexaState {
AmazonAlexaState() {
final Map map = Get.arguments;
if (map['amazonAlexaData'] != null) {
amazonAlexaData.value = map['amazonAlexaData'];
}
}
Rx<AmazonAlexa> amazonAlexaData = AmazonAlexa().obs;
}

View File

@ -38,7 +38,7 @@ class _GoogleHomePageState extends State<GoogleHomePage> {
children: [
_buildTopWidget(),
SizedBox(height: 20.h),
_buildBottomWidget(),
Obx(_buildBottomWidget),
],
),
),
@ -48,10 +48,10 @@ class _GoogleHomePageState extends State<GoogleHomePage> {
Widget _buildTopWidget() {
return Column(
children: [
CommonItem(
leftTitel: 'Action name'.tr,
rightTitle: 'ScienerSmart'.tr,
),
Obx(() => CommonItem(
leftTitel: 'Action name'.tr,
rightTitle: state.googleHomeData.value.actionName ?? '',
)),
SizedBox(
height: 20.h,
),
@ -76,15 +76,22 @@ class _GoogleHomePageState extends State<GoogleHomePage> {
}
Widget _buildBottomWidget() {
final String instructions = '1.用智能锁APP添加锁和网关\n\n'
'2.在APP里开启锁的远程开锁功能这个功能默认是关闭的。如果没有这个选项则锁不支持Google Home\n\n'
'3.安装Google Home APP点击左上角的“+”按钮\n\n'
'4.在设置页面选择“与Google协同工作”\n\n'
'5.搜索“${state.googleHomeData.value.actionName ?? ''}并用智能锁APP的账号和密码进行授权';
return Container(
color: Colors.white,
width: ScreenUtil().screenWidth,
padding: _contentPadding,
child: Column(
children: [
_buildInfoSection('支持的语言'.tr, '英语'.tr),
_buildInfoSection(
'支持的语言'.tr, state.googleHomeData.value.langs?.join('') ?? ''),
SizedBox(height: 20.h),
_buildInfoSection('操作流程'.tr, 'Google Home操作流程的值'.tr),
_buildInfoSection('操作流程'.tr, instructions),
],
),
);

View File

@ -1,4 +1,5 @@
import 'package:get/get.dart';
import 'package:star_lock/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_entity.dart';
class GoogleHomeState {
GoogleHomeState() {
@ -11,8 +12,12 @@ class GoogleHomeState {
isOpenedText.value = '开启';
}
}
if (map['googleHomeData'] != null) {
googleHomeData.value = map['googleHomeData'];
}
}
RxBool isGoogleHome = false.obs;
RxString isOpenedText = '开启'.obs;
Rx<GoogleHome> googleHomeData = GoogleHome().obs;
}

View File

@ -1,10 +1,10 @@
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:star_lock/appRouters.dart';
import 'package:star_lock/login/login/entity/LoginEntity.dart';
import 'package:star_lock/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_entity.dart';
import 'package:star_lock/mine/mineSet/lockUserManage/expireLockList/expireElectronicKey/expireLockList_entity.dart';
import 'package:star_lock/mine/mineSet/mineSet/mineSet_state.dart';
import 'package:star_lock/mine/mineSet/mineSet/userSettingInfoEntity.dart';
@ -66,6 +66,16 @@ class MineSetLogic extends BaseGetXController {
}
}
//
Future<void> getUserInfoRequest() async {
final MinePersonInfoEntity entity = await ApiRepository.to.getUserInfo();
if (entity.errorCode!.codeIsSuccessful) {
Storage.setBool(saveIsVip, entity.data!.isVip! == 1);
state.amazonAlexaData.value = entity.data!.amazonAlexa ?? AmazonAlexa();
state.googleHomeData.value = entity.data!.googleHome ?? GoogleHome();
}
}
//
Future<void> updatePrompToneRequest() async {
final ExpireLockListEntity entity = await ApiRepository.to
@ -170,6 +180,7 @@ class MineSetLogic extends BaseGetXController {
state.currentLanguage.value = _getCurrentLanguage();
_initLoadDataAction();
getUserInfoRequest();
}
@override

View File

@ -320,7 +320,7 @@ class _MineSetPageState extends State<MineSetPage>
Navigator.pushNamed(
context, Routers.aPPUnlockNeedMobileNetworkingLockPage);
}),
if(!F.isSKY)
if (!F.isSKY)
CommonItem(
leftTitel: '增值服务'.tr,
isHaveLine: true,
@ -340,7 +340,8 @@ class _MineSetPageState extends State<MineSetPage>
isHaveDirection: true,
action: () {
Get.toNamed(Routers.amazonAlexaPage, arguments: <String, dynamic>{
'isAmazonAlexa': state.isAmazonAlexa.value
'isAmazonAlexa': state.isAmazonAlexa.value,
'amazonAlexaData': state.amazonAlexaData.value
});
}),
CommonItem(
@ -350,7 +351,8 @@ class _MineSetPageState extends State<MineSetPage>
isHaveDirection: true,
action: () {
Get.toNamed(Routers.googleHomePage, arguments: <String, dynamic>{
'isGoogleHome': state.isGoogleHome.value
'isGoogleHome': state.isGoogleHome.value,
'googleHomeData': state.googleHomeData.value
})?.then((Object? value) {
logic.userSettingsInfoRequest();
});

View File

@ -1,5 +1,6 @@
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
import 'package:get/get.dart';
import 'package:star_lock/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_entity.dart';
import 'package:star_lock/mine/mineSet/mineSet/userSettingInfoEntity.dart';
class MineSetState {
@ -18,6 +19,8 @@ class MineSetState {
var currentLanguage = "".obs; //
RxBool isAmazonAlexa = false.obs; //Alexa
RxBool isGoogleHome = false.obs; //Home
Rx<AmazonAlexa> amazonAlexaData = AmazonAlexa().obs;
Rx<GoogleHome> googleHomeData = GoogleHome().obs;
late FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin =
FlutterLocalNotificationsPlugin();

View File

@ -21,10 +21,12 @@ class ValueAddedServicesListLogic extends BaseGetXController {
final MinePersonInfoEntity entity = await ApiRepository.to.getUserInfo();
if (entity.errorCode!.codeIsSuccessful) {
Storage.setBool(saveIsVip, entity.data!.isVip! == 1);
state.amazonAlexaData.value = entity.data!.amazonAlexa ?? AmazonAlexa();
state.googleHomeData.value = entity.data!.googleHome ?? GoogleHome();
}
}
//
//
Future<void> userSettingsInfoRequest() async {
final UserSettingInfoEntity entity =
await ApiRepository.to.userSettingsInfo();

View File

@ -117,7 +117,8 @@ class _ValueAddedServicesPageListState
),
'Amazon Alexa', () {
Get.toNamed(Routers.amazonAlexaPage, arguments: <String, dynamic>{
'isAmazonAlexa': state.isAmazonAlexa.value
'isAmazonAlexa': state.isAmazonAlexa.value,
'amazonAlexaData': state.amazonAlexaData.value
});
}),
if (!F.isProductionEnv)
@ -132,7 +133,8 @@ class _ValueAddedServicesPageListState
'Google Home', () {
// EasyLoading.showToast('功能暂未开放', duration: 2000.milliseconds);
Get.toNamed(Routers.googleHomePage, arguments: <String, dynamic>{
'isGoogleHome': state.isGoogleHome.value
'isGoogleHome': state.isGoogleHome.value,
'googleHomeData': state.googleHomeData.value
})?.then((Object? value) {
logic.userSettingsInfoRequest();
});

View File

@ -1,6 +1,9 @@
import 'package:get/get.dart';
import 'package:star_lock/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_entity.dart';
class ValueAddedServicesListState {
RxBool isAmazonAlexa = false.obs; //Alexa
RxBool isGoogleHome = false.obs; //Home
Rx<AmazonAlexa> amazonAlexaData = AmazonAlexa().obs;
Rx<GoogleHome> googleHomeData = GoogleHome().obs;
}