Merge branch 'master' of https://gitee.com/starlock-cn/app-starlock
This commit is contained in:
commit
9fa7a6560b
@ -704,5 +704,9 @@
|
|||||||
"去设置": "Go set it up",
|
"去设置": "Go set it up",
|
||||||
|
|
||||||
"虹膜":"iris",
|
"虹膜":"iris",
|
||||||
"手掌":"palm"
|
"手掌":"palm",
|
||||||
|
|
||||||
|
"商城":"mall",
|
||||||
|
"我的":"my",
|
||||||
|
"微信公众号推送":"Wechat public account"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -703,5 +703,9 @@
|
|||||||
"去设置": "去设置",
|
"去设置": "去设置",
|
||||||
|
|
||||||
"虹膜":"虹膜",
|
"虹膜":"虹膜",
|
||||||
"手掌":"手掌"
|
"手掌":"手掌",
|
||||||
|
|
||||||
|
"商城":"mall",
|
||||||
|
"我的":"my",
|
||||||
|
"微信公众号推送":"微信公众号推送"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -705,5 +705,9 @@
|
|||||||
"去设置": "去设置",
|
"去设置": "去设置",
|
||||||
|
|
||||||
"虹膜":"虹膜",
|
"虹膜":"虹膜",
|
||||||
"手掌":"手掌"
|
"手掌":"手掌",
|
||||||
|
|
||||||
|
"商城":"商城",
|
||||||
|
"我的":"我的",
|
||||||
|
"微信公众号推送":"微信公众号推送"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,6 +7,7 @@ import 'package:permission_handler/permission_handler.dart';
|
|||||||
import 'package:star_lock/flavors.dart';
|
import 'package:star_lock/flavors.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/storage.dart';
|
||||||
import 'package:star_lock/tools/xs_jPhush.dart';
|
import 'package:star_lock/tools/xs_jPhush.dart';
|
||||||
|
|
||||||
import 'package:star_lock/translations/app_dept.dart';
|
import 'package:star_lock/translations/app_dept.dart';
|
||||||
@ -106,9 +107,6 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver, BaseWidget {
|
|||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
WidgetsBinding.instance.addObserver(this);
|
WidgetsBinding.instance.addObserver(this);
|
||||||
|
|
||||||
// XSJPushProvider().initJPushService();
|
|
||||||
XSJPushProvider().initLocalNotification(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -136,6 +134,14 @@ void openBlueScan() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<bool> getLoginStatus() async {
|
||||||
|
final data = await Storage.getString(saveUserLoginData);
|
||||||
|
if (data != null && data.isNotEmpty) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
///请求蓝牙权限
|
///请求蓝牙权限
|
||||||
Future<bool> getMicrophonePermission() async {
|
Future<bool> getMicrophonePermission() async {
|
||||||
// You can request multiple permissions at once.
|
// You can request multiple permissions at once.
|
||||||
|
|||||||
@ -44,6 +44,7 @@ import 'package:star_lock/mine/mineSet/transferGateway/selectGetewayList_page.da
|
|||||||
import 'package:star_lock/mine/mineSet/transferSmartLock/recipientInformation/recipientInformation_page.dart';
|
import 'package:star_lock/mine/mineSet/transferSmartLock/recipientInformation/recipientInformation_page.dart';
|
||||||
import 'package:star_lock/mine/mineSet/transferSmartLock/selectBranch/selectBranch_page.dart';
|
import 'package:star_lock/mine/mineSet/transferSmartLock/selectBranch/selectBranch_page.dart';
|
||||||
import 'package:star_lock/mine/mineSet/transferSmartLock/transferSmartLockList/transferSmartLock_page.dart';
|
import 'package:star_lock/mine/mineSet/transferSmartLock/transferSmartLockList/transferSmartLock_page.dart';
|
||||||
|
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesRecord/value_added_services_record_page.dart';
|
||||||
|
|
||||||
import 'common/safetyVerification/safetyVerification_page.dart';
|
import 'common/safetyVerification/safetyVerification_page.dart';
|
||||||
import 'login/forgetPassword/starLock_forgetPassword_page.dart';
|
import 'login/forgetPassword/starLock_forgetPassword_page.dart';
|
||||||
@ -184,7 +185,7 @@ import 'mine/valueAddedServices/valueAddedServicesEmailTemplate/valueAddedServic
|
|||||||
import 'mine/valueAddedServices/valueAddedServicesHighFunction/valueAddedServicesHighFunction_page.dart';
|
import 'mine/valueAddedServices/valueAddedServicesHighFunction/valueAddedServicesHighFunction_page.dart';
|
||||||
import 'mine/valueAddedServices/valueAddedServicesList/valueAddedServicesList_page.dart';
|
import 'mine/valueAddedServices/valueAddedServicesList/valueAddedServicesList_page.dart';
|
||||||
import 'mine/valueAddedServices/valueAddedServicesNoteAndEmailDetail/valueAddedServicesNoteAndEmailDetail_page.dart';
|
import 'mine/valueAddedServices/valueAddedServicesNoteAndEmailDetail/valueAddedServicesNoteAndEmailDetail_page.dart';
|
||||||
import 'mine/valueAddedServices/valueAddedServicesRealName/valueAddedServicesRealName_page.dart';
|
import 'mine/valueAddedServices/valueAddedServicesRealName/value_added_services_real_name_page.dart';
|
||||||
import 'mine/valueAddedServices/valueAddedServicesSMSTemplate/valueAddedServicesAddSMSTemplate/valueAddedServicesAddSMSTemplate_page.dart';
|
import 'mine/valueAddedServices/valueAddedServicesSMSTemplate/valueAddedServicesAddSMSTemplate/valueAddedServicesAddSMSTemplate_page.dart';
|
||||||
import 'mine/valueAddedServices/valueAddedServicesSMSTemplate/valueAddedServicesListSMSTemplate/valueAddedServicesListSMSTemplate_page.dart';
|
import 'mine/valueAddedServices/valueAddedServicesSMSTemplate/valueAddedServicesListSMSTemplate/valueAddedServicesListSMSTemplate_page.dart';
|
||||||
import 'mine/mineSet/authorizedAdministrator/authorizedAdministrator/authorizedAdministratorList_page.dart';
|
import 'mine/mineSet/authorizedAdministrator/authorizedAdministrator/authorizedAdministratorList_page.dart';
|
||||||
@ -326,6 +327,8 @@ abstract class Routers {
|
|||||||
'/ValueAddedServicesNoteAndEmailDetailPage'; // 增值服务-短信邮件详情
|
'/ValueAddedServicesNoteAndEmailDetailPage'; // 增值服务-短信邮件详情
|
||||||
static const valueAddedServicesRealNamePage =
|
static const valueAddedServicesRealNamePage =
|
||||||
'/ValueAddedServicesRealNamePage'; // 增值服务-实名认证详情
|
'/ValueAddedServicesRealNamePage'; // 增值服务-实名认证详情
|
||||||
|
static const valueAddedServicesRecordPage =
|
||||||
|
'/valueAddedServicesRecordPage'; // 增值服务-记录
|
||||||
static const valueAddedServicesHighFunctionPage =
|
static const valueAddedServicesHighFunctionPage =
|
||||||
'/ValueAddedServicesHighFunctionPage'; // 增值服务-高级功能
|
'/ValueAddedServicesHighFunctionPage'; // 增值服务-高级功能
|
||||||
static const valueAddedServicesBuyPage =
|
static const valueAddedServicesBuyPage =
|
||||||
@ -811,6 +814,10 @@ abstract class AppRouters {
|
|||||||
name: Routers.valueAddedServicesRealNamePage,
|
name: Routers.valueAddedServicesRealNamePage,
|
||||||
page: () => const ValueAddedServicesRealNamePage(),
|
page: () => const ValueAddedServicesRealNamePage(),
|
||||||
),
|
),
|
||||||
|
GetPage(
|
||||||
|
name: Routers.valueAddedServicesRecordPage,
|
||||||
|
page: () => ValueAddedServicesRecordPage(),
|
||||||
|
),
|
||||||
GetPage(
|
GetPage(
|
||||||
name: Routers.valueAddedServicesBuyPage,
|
name: Routers.valueAddedServicesBuyPage,
|
||||||
page: () => const ValueAddedServicesBuyPage(),
|
page: () => const ValueAddedServicesBuyPage(),
|
||||||
|
|||||||
@ -132,10 +132,10 @@ class F {
|
|||||||
return const StarLockAMapKey(
|
return const StarLockAMapKey(
|
||||||
androidKey: 'fb0d2a3e4208b36452cf636aa025a24f',
|
androidKey: 'fb0d2a3e4208b36452cf636aa025a24f',
|
||||||
iosKey: '86ca725a12a629c280e116a317aaba19');
|
iosKey: '86ca725a12a629c280e116a317aaba19');
|
||||||
// case Flavor.xhj:
|
case Flavor.xhj:
|
||||||
// return const StarLockAMapKey(
|
return const StarLockAMapKey(
|
||||||
// androidKey: 'todo',
|
androidKey: '9dd8073a2e96870b206269bb562a887a',
|
||||||
// iosKey: 'todo');
|
iosKey: 'c70047e60ce704d945ea89d6c2763b82');
|
||||||
default:
|
default:
|
||||||
throw Exception('flavor[$name] aMapKey not found');
|
throw Exception('flavor[$name] aMapKey not found');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,16 +18,17 @@ class StarLockLoginLogic extends BaseGetXController {
|
|||||||
|
|
||||||
void login() async {
|
void login() async {
|
||||||
var entity = await ApiRepository.to.login(
|
var entity = await ApiRepository.to.login(
|
||||||
loginType:"1",
|
loginType: "1",
|
||||||
password:state.pwd.value,
|
password: state.pwd.value,
|
||||||
countryCode:state.countryCode.value,
|
countryCode: state.countryCode.value,
|
||||||
username:state.emailOrPhone.value);
|
username: state.emailOrPhone.value);
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
Storage.saveLoginData(entity.data);
|
Storage.saveLoginData(entity.data);
|
||||||
eventBus.fire(MineInfoChangeRefreshUI());
|
eventBus.fire(MineInfoChangeRefreshUI());
|
||||||
// Get.back();
|
// Get.back();
|
||||||
// Get.toNamed(Routers.starLockMain);
|
// Get.toNamed(Routers.starLockMain);
|
||||||
XSJPushProvider().initJPushService();
|
XSJPushProvider().initJPushService();
|
||||||
|
XSJPushProvider().initLocalNotification(false);
|
||||||
Get.offNamedUntil(Routers.starLockMain, (route) => false);
|
Get.offNamedUntil(Routers.starLockMain, (route) => false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -148,9 +148,9 @@ class LockMonitoringLogic extends BaseGetXController {
|
|||||||
|
|
||||||
//开始录音
|
//开始录音
|
||||||
Future<void> startProcessing() async {
|
Future<void> startProcessing() async {
|
||||||
if (state.isProcessing.value) {
|
// if (state.isProcessing.value) {
|
||||||
CallTalk().stopPlaySound();
|
// CallTalk().stopPlaySound();
|
||||||
}
|
// }
|
||||||
state.isButtonDisabled.value = true;
|
state.isButtonDisabled.value = true;
|
||||||
|
|
||||||
state.voiceProcessor?.addFrameListener(_onFrame);
|
state.voiceProcessor?.addFrameListener(_onFrame);
|
||||||
@ -171,9 +171,9 @@ class LockMonitoringLogic extends BaseGetXController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _onFrame(List<int> frame) async {
|
Future<void> _onFrame(List<int> frame) async {
|
||||||
if (state.isProcessing.value) {
|
// if (state.isProcessing.value) {
|
||||||
CallTalk().stopPlaySound();
|
// CallTalk().stopPlaySound();
|
||||||
}
|
// }
|
||||||
state.allFrames.add(frame); // 将帧添加到状态变量中
|
state.allFrames.add(frame); // 将帧添加到状态变量中
|
||||||
List<int> concatenatedFrames = concatenateFrames(state.allFrames); // 连接所有帧
|
List<int> concatenatedFrames = concatenateFrames(state.allFrames); // 连接所有帧
|
||||||
Get.log("pcm数据:$concatenatedFrames");
|
Get.log("pcm数据:$concatenatedFrames");
|
||||||
@ -204,9 +204,11 @@ class LockMonitoringLogic extends BaseGetXController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<void> stopProcessing() async {
|
Future<void> stopProcessing() async {
|
||||||
if (state.isProcessing.value) {
|
// if (state.isProcessing.value) {
|
||||||
CallTalk().stopPlaySound();
|
// CallTalk().stopPlaySound();
|
||||||
}
|
// } else {
|
||||||
|
// CallTalk().startPlaySound();
|
||||||
|
// }
|
||||||
state.isButtonDisabled.value = true;
|
state.isButtonDisabled.value = true;
|
||||||
try {
|
try {
|
||||||
await state.voiceProcessor?.stop();
|
await state.voiceProcessor?.stop();
|
||||||
|
|||||||
@ -13,6 +13,7 @@ import 'package:star_lock/mine/message/messageList/messageList_page.dart';
|
|||||||
import 'package:star_lock/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_page.dart';
|
import 'package:star_lock/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_page.dart';
|
||||||
import 'package:star_lock/tools/noData.dart';
|
import 'package:star_lock/tools/noData.dart';
|
||||||
import 'package:star_lock/tools/submitBtn.dart';
|
import 'package:star_lock/tools/submitBtn.dart';
|
||||||
|
import 'package:star_lock/translations/trans_lib.dart';
|
||||||
|
|
||||||
class StarLockMainXHJPage extends StatefulWidget {
|
class StarLockMainXHJPage extends StatefulWidget {
|
||||||
const StarLockMainXHJPage({Key? key}) : super(key: key);
|
const StarLockMainXHJPage({Key? key}) : super(key: key);
|
||||||
@ -93,16 +94,20 @@ class _StarLockMainXHJPageState extends State<StarLockMainXHJPage>
|
|||||||
// navigationBarItem(Icons.start, '场景', false, () {
|
// navigationBarItem(Icons.start, '场景', false, () {
|
||||||
// logic.setIndex(0);
|
// logic.setIndex(0);
|
||||||
// }),
|
// }),
|
||||||
navigationBarItem(Icons.devices, '设备', logic, 0, () {
|
|
||||||
|
navigationBarItem(Icons.devices,
|
||||||
|
TranslationLoader.lanKeys!.device!.tr, logic, 0, () {
|
||||||
logic.setIndex(0);
|
logic.setIndex(0);
|
||||||
}),
|
}),
|
||||||
navigationBarItem(Icons.message, '消息', logic, 1, () {
|
navigationBarItem(Icons.message,
|
||||||
|
TranslationLoader.lanKeys!.message!.tr, logic, 1, () {
|
||||||
logic.setIndex(1);
|
logic.setIndex(1);
|
||||||
}),
|
}),
|
||||||
navigationBarItem(Icons.shopping_cart, '商城', logic, 2, () {
|
navigationBarItem(Icons.shopping_cart, '商城'.tr, logic, 2, () {
|
||||||
logic.setIndex(2);
|
logic.setIndex(2);
|
||||||
}),
|
}),
|
||||||
navigationBarItem(Icons.account_circle, '我的', logic, 3, () {
|
navigationBarItem(Icons.account_circle, '我的'.tr, logic, 3,
|
||||||
|
() {
|
||||||
logic.setIndex(3);
|
logic.setIndex(3);
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
|
|||||||
@ -1,11 +1,15 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
import 'package:flutter/material.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/login/login/entity/LoginEntity.dart';
|
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
||||||
import 'package:star_lock/mine/mineSet/lockUserManage/expireLockList/expireElectronicKey/expireLockList_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/mineSet_state.dart';
|
||||||
|
import 'package:star_lock/mine/mineSet/mineSet/weChatQRCodeEntity.dart';
|
||||||
|
import 'package:star_lock/tools/appFirstEnterHandle.dart';
|
||||||
import 'package:star_lock/tools/storage.dart';
|
import 'package:star_lock/tools/storage.dart';
|
||||||
import 'package:star_lock/tools/xs_jPhush.dart';
|
import 'package:star_lock/tools/xs_jPhush.dart';
|
||||||
|
import 'package:star_lock/versionUndate/versionUndate_entity.dart';
|
||||||
import '../../../../network/api_repository.dart';
|
import '../../../../network/api_repository.dart';
|
||||||
import '../../../../tools/baseGetXController.dart';
|
import '../../../../tools/baseGetXController.dart';
|
||||||
import '../../../blue/blue_manage.dart';
|
import '../../../blue/blue_manage.dart';
|
||||||
@ -36,6 +40,12 @@ class MineSetLogic extends BaseGetXController {
|
|||||||
} else {
|
} else {
|
||||||
state.isTouchUnlock.value = false;
|
state.isTouchUnlock.value = false;
|
||||||
}
|
}
|
||||||
|
//微信公众号推送
|
||||||
|
if (entity.data!.mpWechatPushSwitch! == 1) {
|
||||||
|
state.isWechatPublicAccountPush.value = true;
|
||||||
|
} else {
|
||||||
|
state.isWechatPublicAccountPush.value = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -49,6 +59,33 @@ class MineSetLogic extends BaseGetXController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//设置微信公众号推送
|
||||||
|
Future<void> setMpWechatPushSwitchRequest(BuildContext widgetContext) async {
|
||||||
|
VersionUndateEntity entity = await ApiRepository.to.setMpWechatPushSwitch(
|
||||||
|
mpWechatPushSwitch:
|
||||||
|
state.isWechatPublicAccountPush.value == true ? 1 : 2);
|
||||||
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
|
showToast("设置成功".tr);
|
||||||
|
userSettingsInfoRequest();
|
||||||
|
} else if (entity.errorCode! == 421) {
|
||||||
|
//请先扫码绑定微信公众号
|
||||||
|
getMpWechatQrCodeRequest(widgetContext);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取微信公众号二维码
|
||||||
|
Future<void> getMpWechatQrCodeRequest(BuildContext widgetContext) async {
|
||||||
|
GetWechatQrCodeEntity entity = await ApiRepository.to.getMpWechatQrCode();
|
||||||
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
|
state.qrCodeUrl.value = entity.data!.qrCodeUrl!;
|
||||||
|
showQRImageAlert(state.qrCodeUrl.value, widgetContext);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void showQRImageAlert(String qrCodeUrl, BuildContext widgetContext) {
|
||||||
|
AppFirstEnterHandle().showQRImageAlert(widgetContext, qrCodeUrl);
|
||||||
|
}
|
||||||
|
|
||||||
//退出登录请求
|
//退出登录请求
|
||||||
Future<void> userLogoutRequest() async {
|
Future<void> userLogoutRequest() async {
|
||||||
var getPushDeviceID = '';
|
var getPushDeviceID = '';
|
||||||
|
|||||||
@ -89,10 +89,21 @@ class _MineSetPageState extends State<MineSetPage> with WidgetsBindingObserver {
|
|||||||
leftTitel: TranslationLoader.lanKeys!.pushNotification!.tr,
|
leftTitel: TranslationLoader.lanKeys!.pushNotification!.tr,
|
||||||
rightTitle: "",
|
rightTitle: "",
|
||||||
isHaveRightWidget: true,
|
isHaveRightWidget: true,
|
||||||
|
isHaveLine: F.appFlavor == Flavor.sky ? true : false,
|
||||||
rightWidget: SizedBox(
|
rightWidget: SizedBox(
|
||||||
width: 60.w,
|
width: 60.w,
|
||||||
height: 50.h,
|
height: 50.h,
|
||||||
child: Obx(() => _isPushNotificationSwitch()))),
|
child: Obx(() => _isPushNotificationSwitch()))),
|
||||||
|
F.appFlavor == Flavor.sky
|
||||||
|
? CommonItem(
|
||||||
|
leftTitel: "微信公众号推送".tr,
|
||||||
|
rightTitle: "",
|
||||||
|
isHaveRightWidget: true,
|
||||||
|
rightWidget: SizedBox(
|
||||||
|
width: 60.w,
|
||||||
|
height: 50.h,
|
||||||
|
child: Obx(() => _isWechatPublicAccountPushSwitch())))
|
||||||
|
: Container(),
|
||||||
SizedBox(height: 10.h),
|
SizedBox(height: 10.h),
|
||||||
CommonItem(
|
CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.lockUserManagement!.tr,
|
leftTitel: TranslationLoader.lanKeys!.lockUserManagement!.tr,
|
||||||
@ -273,7 +284,7 @@ class _MineSetPageState extends State<MineSetPage> with WidgetsBindingObserver {
|
|||||||
isDelete: true,
|
isDelete: true,
|
||||||
onClick: () {
|
onClick: () {
|
||||||
//退出登录
|
//退出登录
|
||||||
ShowTipView().showIosTipWithContentDialog("确定要退出吗?".tr, (){
|
ShowTipView().showIosTipWithContentDialog("确定要退出吗?".tr, () {
|
||||||
logic.userLogoutRequest();
|
logic.userLogoutRequest();
|
||||||
});
|
});
|
||||||
// showLoginOutAlertTipDialog();
|
// showLoginOutAlertTipDialog();
|
||||||
@ -291,7 +302,8 @@ class _MineSetPageState extends State<MineSetPage> with WidgetsBindingObserver {
|
|||||||
color: AppColors.darkGrayTextColor, fontSize: 18.sp),
|
color: AppColors.darkGrayTextColor, fontSize: 18.sp),
|
||||||
),
|
),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
ShowTipView().showIosTipWithContentDialog(TranslationLoader.lanKeys!.deleteAccountTips!.tr, (){
|
ShowTipView().showIosTipWithContentDialog(
|
||||||
|
TranslationLoader.lanKeys!.deleteAccountTips!.tr, () {
|
||||||
//安全验证
|
//安全验证
|
||||||
Get.toNamed(Routers.safeVerifyPage);
|
Get.toNamed(Routers.safeVerifyPage);
|
||||||
});
|
});
|
||||||
@ -389,6 +401,21 @@ class _MineSetPageState extends State<MineSetPage> with WidgetsBindingObserver {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//微信公众号推送开关
|
||||||
|
CupertinoSwitch _isWechatPublicAccountPushSwitch() {
|
||||||
|
return CupertinoSwitch(
|
||||||
|
activeColor: CupertinoColors.activeBlue,
|
||||||
|
trackColor: CupertinoColors.systemGrey5,
|
||||||
|
thumbColor: CupertinoColors.white,
|
||||||
|
value: state.isWechatPublicAccountPush.value,
|
||||||
|
onChanged: (value) {
|
||||||
|
state.isWechatPublicAccountPush.value =
|
||||||
|
!state.isWechatPublicAccountPush.value;
|
||||||
|
logic.setMpWechatPushSwitchRequest(context);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
CupertinoSwitch _isPushNotificationSwitch() {
|
CupertinoSwitch _isPushNotificationSwitch() {
|
||||||
return CupertinoSwitch(
|
return CupertinoSwitch(
|
||||||
activeColor: CupertinoColors.activeBlue,
|
activeColor: CupertinoColors.activeBlue,
|
||||||
|
|||||||
@ -9,6 +9,8 @@ class MineSetState {
|
|||||||
var isPrompTone = false.obs; //提示音
|
var isPrompTone = false.obs; //提示音
|
||||||
var isTouchUnlock = false.obs; //触摸开锁
|
var isTouchUnlock = false.obs; //触摸开锁
|
||||||
var isPushNotification = false.obs; //消息推送
|
var isPushNotification = false.obs; //消息推送
|
||||||
|
var isWechatPublicAccountPush = false.obs; //微信公众号推送
|
||||||
|
var qrCodeUrl = ''.obs; //二维码地址
|
||||||
|
|
||||||
var lockScreen = 2.obs; //锁屏
|
var lockScreen = 2.obs; //锁屏
|
||||||
var hideExpiredAccessFlag = 2.obs; //隐藏无效开锁
|
var hideExpiredAccessFlag = 2.obs; //隐藏无效开锁
|
||||||
|
|||||||
@ -41,6 +41,7 @@ class UserSettingInfoData {
|
|||||||
int? hasCameraLock;
|
int? hasCameraLock;
|
||||||
int? hasGoogleHome;
|
int? hasGoogleHome;
|
||||||
int? alertMode;
|
int? alertMode;
|
||||||
|
int? mpWechatPushSwitch;
|
||||||
|
|
||||||
UserSettingInfoData(
|
UserSettingInfoData(
|
||||||
{this.userSettings,
|
{this.userSettings,
|
||||||
@ -54,7 +55,8 @@ class UserSettingInfoData {
|
|||||||
this.hasPaidFeature,
|
this.hasPaidFeature,
|
||||||
this.hasCameraLock,
|
this.hasCameraLock,
|
||||||
this.hasGoogleHome,
|
this.hasGoogleHome,
|
||||||
this.alertMode});
|
this.alertMode,
|
||||||
|
this.mpWechatPushSwitch});
|
||||||
|
|
||||||
UserSettingInfoData.fromJson(Map<String, dynamic> json) {
|
UserSettingInfoData.fromJson(Map<String, dynamic> json) {
|
||||||
userSettings = json['userSettings'] != null
|
userSettings = json['userSettings'] != null
|
||||||
@ -71,6 +73,7 @@ class UserSettingInfoData {
|
|||||||
hasCameraLock = json['hasCameraLock'];
|
hasCameraLock = json['hasCameraLock'];
|
||||||
hasGoogleHome = json['hasGoogleHome'];
|
hasGoogleHome = json['hasGoogleHome'];
|
||||||
alertMode = json['alertMode'];
|
alertMode = json['alertMode'];
|
||||||
|
mpWechatPushSwitch = json['mpWechatPushSwitch'];
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
@ -89,6 +92,7 @@ class UserSettingInfoData {
|
|||||||
data['hasCameraLock'] = hasCameraLock;
|
data['hasCameraLock'] = hasCameraLock;
|
||||||
data['hasGoogleHome'] = hasGoogleHome;
|
data['hasGoogleHome'] = hasGoogleHome;
|
||||||
data['alertMode'] = alertMode;
|
data['alertMode'] = alertMode;
|
||||||
|
data['mpWechatPushSwitch'] = mpWechatPushSwitch;
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
43
star_lock/lib/mine/mineSet/mineSet/weChatQRCodeEntity.dart
Normal file
43
star_lock/lib/mine/mineSet/mineSet/weChatQRCodeEntity.dart
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
class GetWechatQrCodeEntity {
|
||||||
|
int? errorCode;
|
||||||
|
String? description;
|
||||||
|
String? errorMsg;
|
||||||
|
Data? data;
|
||||||
|
|
||||||
|
GetWechatQrCodeEntity(
|
||||||
|
{this.errorCode, this.description, this.errorMsg, this.data});
|
||||||
|
|
||||||
|
GetWechatQrCodeEntity.fromJson(Map<String, dynamic> json) {
|
||||||
|
errorCode = json['errorCode'];
|
||||||
|
description = json['description'];
|
||||||
|
errorMsg = json['errorMsg'];
|
||||||
|
data = json['data'] != null ? Data.fromJson(json['data']) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
data['errorCode'] = errorCode;
|
||||||
|
data['description'] = description;
|
||||||
|
data['errorMsg'] = errorMsg;
|
||||||
|
if (this.data != null) {
|
||||||
|
data['data'] = this.data!.toJson();
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class Data {
|
||||||
|
String? qrCodeUrl;
|
||||||
|
|
||||||
|
Data({this.qrCodeUrl});
|
||||||
|
|
||||||
|
Data.fromJson(Map<String, dynamic> json) {
|
||||||
|
qrCodeUrl = json['qrCodeUrl'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
data['qrCodeUrl'] = qrCodeUrl;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,25 @@
|
|||||||
|
class FaceAuthenticationEntity {
|
||||||
|
FaceAuthenticationEntity({
|
||||||
|
this.description,
|
||||||
|
this.errorCode,
|
||||||
|
this.errorMsg,
|
||||||
|
});
|
||||||
|
|
||||||
|
FaceAuthenticationEntity.fromJson(dynamic json) {
|
||||||
|
description = json['description'];
|
||||||
|
errorCode = json['errorCode'];
|
||||||
|
errorMsg = json['errorMsg'];
|
||||||
|
}
|
||||||
|
|
||||||
|
String? description;
|
||||||
|
int? errorCode;
|
||||||
|
String? errorMsg;
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final map = <String, dynamic>{};
|
||||||
|
map['description'] = description;
|
||||||
|
map['errorCode'] = errorCode;
|
||||||
|
map['errorMsg'] = errorMsg;
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,209 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
||||||
import 'package:get/get.dart';
|
|
||||||
import '../../../app_settings/app_colors.dart';
|
|
||||||
import '../../../tools/commonItem.dart';
|
|
||||||
import '../../../tools/titleAppBar.dart';
|
|
||||||
import '../../../translations/trans_lib.dart';
|
|
||||||
|
|
||||||
class ValueAddedServicesRealNamePage extends StatefulWidget {
|
|
||||||
const ValueAddedServicesRealNamePage({Key? key}) : super(key: key);
|
|
||||||
|
|
||||||
@override
|
|
||||||
State<ValueAddedServicesRealNamePage> createState() =>
|
|
||||||
_ValueAddedServicesRealNamePageState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _ValueAddedServicesRealNamePageState
|
|
||||||
extends State<ValueAddedServicesRealNamePage> {
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return Scaffold(
|
|
||||||
backgroundColor: AppColors.mainBackgroundColor,
|
|
||||||
appBar: TitleAppBar(
|
|
||||||
barTitle: TranslationLoader.lanKeys!.realNameAuthentication!.tr,
|
|
||||||
haveBack: true,
|
|
||||||
backgroundColor: AppColors.mainColor),
|
|
||||||
body: Column(
|
|
||||||
children: [
|
|
||||||
Container(
|
|
||||||
width: 1.sw,
|
|
||||||
// color: Colors.grey.shade300,
|
|
||||||
padding: EdgeInsets.only(
|
|
||||||
left: 25.h, right: 25.h, top: 25.h, bottom: 10.h),
|
|
||||||
child: Text(
|
|
||||||
TranslationLoader.lanKeys!.buyRealNameTip!.tr,
|
|
||||||
style: TextStyle(
|
|
||||||
color: AppColors.darkGrayTextColor, fontSize: 20.sp),
|
|
||||||
)),
|
|
||||||
middleWidget(),
|
|
||||||
bottomWidget()
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget middleWidget() {
|
|
||||||
return Container(
|
|
||||||
width: 1.sw,
|
|
||||||
// height: 100,
|
|
||||||
// color: Colors.grey.shade300,
|
|
||||||
margin: EdgeInsets.all(10.h),
|
|
||||||
decoration: const BoxDecoration(
|
|
||||||
image: DecorationImage(
|
|
||||||
image: AssetImage(
|
|
||||||
"images/mine/icon_mine_valueAddedServices_noteTop.png"),
|
|
||||||
fit: BoxFit.cover)),
|
|
||||||
child: Column(children: [
|
|
||||||
// SizedBox(height:10),
|
|
||||||
Container(
|
|
||||||
margin:
|
|
||||||
const EdgeInsets.only(top: 15, bottom: 15, left: 30, right: 30),
|
|
||||||
child: Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
"${TranslationLoader.lanKeys!.currentRemainingQuantity!.tr}:0",
|
|
||||||
style: TextStyle(fontSize: 24.sp),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
// SizedBox(height:20.h),
|
|
||||||
Container(
|
|
||||||
margin: const EdgeInsets.only(top: 10, bottom: 10),
|
|
||||||
// color: Colors.red,
|
|
||||||
// height: 100.h,
|
|
||||||
child: Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
|
||||||
children: [
|
|
||||||
GestureDetector(
|
|
||||||
onTap: () {},
|
|
||||||
child: Container(
|
|
||||||
width: 200.w,
|
|
||||||
// height: 70.h,
|
|
||||||
// color: Colors.red,
|
|
||||||
child: Center(
|
|
||||||
child: Text(TranslationLoader.lanKeys!.record!.tr,
|
|
||||||
style: TextStyle(
|
|
||||||
color: Colors.black, fontSize: 24.sp)))),
|
|
||||||
),
|
|
||||||
GestureDetector(
|
|
||||||
onTap: () {
|
|
||||||
// Navigator.pushNamed(
|
|
||||||
// context, Routers.valueAddedServicesBuyPage,
|
|
||||||
// arguments: 3);
|
|
||||||
},
|
|
||||||
child: Container(
|
|
||||||
width: 200.w,
|
|
||||||
// height: 70.h,
|
|
||||||
// color: Colors.red,
|
|
||||||
child: Center(
|
|
||||||
child: Text(TranslationLoader.lanKeys!.buy!.tr,
|
|
||||||
style: TextStyle(
|
|
||||||
// color: AppColors.mainColor,
|
|
||||||
color: AppColors.blackColor,
|
|
||||||
fontSize: 24.sp)))),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
]));
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget bottomWidget() {
|
|
||||||
return Container(
|
|
||||||
width: 1.sw,
|
|
||||||
color: Colors.white,
|
|
||||||
margin: EdgeInsets.all(20.h),
|
|
||||||
child: Column(
|
|
||||||
children: [
|
|
||||||
Column(
|
|
||||||
children: [
|
|
||||||
Container(
|
|
||||||
padding: EdgeInsets.only(top: 20.h, bottom: 20.h, left: 30.w),
|
|
||||||
child: Text(
|
|
||||||
TranslationLoader
|
|
||||||
.lanKeys!.buyRealNameSelectYouWantBuyTip!.tr,
|
|
||||||
style:
|
|
||||||
TextStyle(fontSize: 24.sp, fontWeight: FontWeight.w600),
|
|
||||||
)),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
CommonItem(
|
|
||||||
leftTitel: TranslationLoader.lanKeys!.forTheFirstTime!.tr,
|
|
||||||
rightTitle: "",
|
|
||||||
allHeight: 60.h,
|
|
||||||
isHaveLine: true,
|
|
||||||
isHaveRightWidget: true,
|
|
||||||
rightWidget: GestureDetector(
|
|
||||||
onTap: () {},
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
Image.asset(
|
|
||||||
'images/icon_round_unSelect.png',
|
|
||||||
width: 30.w,
|
|
||||||
height: 30.w,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
)),
|
|
||||||
CommonItem(
|
|
||||||
leftTitel: TranslationLoader.lanKeys!.onceDay!.tr,
|
|
||||||
rightTitle: "",
|
|
||||||
allHeight: 60.h,
|
|
||||||
isHaveLine: true,
|
|
||||||
isHaveRightWidget: true,
|
|
||||||
rightWidget: GestureDetector(
|
|
||||||
onTap: () {},
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
Image.asset(
|
|
||||||
'images/icon_round_unSelect.png',
|
|
||||||
width: 30.w,
|
|
||||||
height: 30.w,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
)),
|
|
||||||
CommonItem(
|
|
||||||
leftTitel: TranslationLoader.lanKeys!.weekOnce!.tr,
|
|
||||||
rightTitle: "",
|
|
||||||
allHeight: 60.h,
|
|
||||||
isHaveLine: true,
|
|
||||||
isHaveRightWidget: true,
|
|
||||||
rightWidget: GestureDetector(
|
|
||||||
onTap: () {},
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
Image.asset(
|
|
||||||
'images/icon_round_unSelect.png',
|
|
||||||
width: 30.w,
|
|
||||||
height: 30.w,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
)),
|
|
||||||
CommonItem(
|
|
||||||
leftTitel: TranslationLoader.lanKeys!.monthOnce!.tr,
|
|
||||||
rightTitle: "",
|
|
||||||
allHeight: 60.h,
|
|
||||||
isHaveLine: false,
|
|
||||||
isHaveRightWidget: true,
|
|
||||||
rightWidget: GestureDetector(
|
|
||||||
onTap: () {},
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
Image.asset(
|
|
||||||
'images/icon_round_unSelect.png',
|
|
||||||
width: 30.w,
|
|
||||||
height: 30.w,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
)),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -0,0 +1,46 @@
|
|||||||
|
import 'dart:async';
|
||||||
|
|
||||||
|
import 'package:get/utils.dart';
|
||||||
|
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesRealName/face_authentication_entity.dart';
|
||||||
|
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesRealName/value_added_services_real_name_state.dart';
|
||||||
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
|
import '../../../network/api_repository.dart';
|
||||||
|
import '../../../tools/eventBusEventManage.dart';
|
||||||
|
|
||||||
|
class ValueAddedServicesRealNameLogic extends BaseGetXController {
|
||||||
|
final ValueAddedServicesRealNameState state =
|
||||||
|
ValueAddedServicesRealNameState();
|
||||||
|
|
||||||
|
//请求消息列表
|
||||||
|
Future<bool> setFaceAuthentication(int faceAuthFrequence) async {
|
||||||
|
FaceAuthenticationEntity entity =
|
||||||
|
await ApiRepository.to.setFaceAuthentication(
|
||||||
|
faceAuthFrequence: faceAuthFrequence,
|
||||||
|
);
|
||||||
|
return entity.errorCode!.codeIsSuccessful;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> check(int index) async {
|
||||||
|
bool isSuccessful = await setFaceAuthentication(state.index + 1);
|
||||||
|
if (isSuccessful) {
|
||||||
|
showToast('修改成功'.tr);
|
||||||
|
state.index = index;
|
||||||
|
}
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void onReady() {
|
||||||
|
super.onReady();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void onInit() {
|
||||||
|
super.onInit();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void onClose() {
|
||||||
|
super.onClose();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,186 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:star_lock/appRouters.dart';
|
||||||
|
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesRealName/value_added_services_real_name_logic.dart';
|
||||||
|
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesRecord/use_record_list_arg.dart';
|
||||||
|
import '../../../app_settings/app_colors.dart';
|
||||||
|
import '../../../tools/commonItem.dart';
|
||||||
|
import '../../../tools/titleAppBar.dart';
|
||||||
|
import '../../../translations/trans_lib.dart';
|
||||||
|
|
||||||
|
class ValueAddedServicesRealNamePage extends StatefulWidget {
|
||||||
|
const ValueAddedServicesRealNamePage({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<ValueAddedServicesRealNamePage> createState() =>
|
||||||
|
_ValueAddedServicesRealNamePageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _ValueAddedServicesRealNamePageState
|
||||||
|
extends State<ValueAddedServicesRealNamePage> {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return GetBuilder<ValueAddedServicesRealNameLogic>(
|
||||||
|
init: ValueAddedServicesRealNameLogic(),
|
||||||
|
builder: (ValueAddedServicesRealNameLogic logic) {
|
||||||
|
return Scaffold(
|
||||||
|
backgroundColor: AppColors.mainBackgroundColor,
|
||||||
|
appBar: TitleAppBar(
|
||||||
|
barTitle: TranslationLoader.lanKeys!.realNameAuthentication!.tr,
|
||||||
|
haveBack: true,
|
||||||
|
backgroundColor: AppColors.mainColor),
|
||||||
|
body: Column(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
width: 1.sw,
|
||||||
|
// color: Colors.grey.shade300,
|
||||||
|
padding: EdgeInsets.only(
|
||||||
|
left: 25.h, right: 25.h, top: 25.h, bottom: 10.h),
|
||||||
|
child: Text(
|
||||||
|
TranslationLoader.lanKeys!.buyRealNameTip!.tr,
|
||||||
|
style: TextStyle(
|
||||||
|
color: AppColors.darkGrayTextColor, fontSize: 20.sp),
|
||||||
|
)),
|
||||||
|
middleWidget(),
|
||||||
|
bottomWidget()
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget middleWidget() {
|
||||||
|
return Container(
|
||||||
|
width: 1.sw,
|
||||||
|
// height: 100,
|
||||||
|
// color: Colors.grey.shade300,
|
||||||
|
margin: EdgeInsets.all(10.h),
|
||||||
|
decoration: const BoxDecoration(
|
||||||
|
image: DecorationImage(
|
||||||
|
image: AssetImage(
|
||||||
|
"images/mine/icon_mine_valueAddedServices_noteTop.png"),
|
||||||
|
fit: BoxFit.cover)),
|
||||||
|
child: Column(children: [
|
||||||
|
// SizedBox(height:10),
|
||||||
|
Container(
|
||||||
|
margin:
|
||||||
|
const EdgeInsets.only(top: 15, bottom: 15, left: 30, right: 30),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
"${TranslationLoader.lanKeys!.currentRemainingQuantity!.tr}:0",
|
||||||
|
style: TextStyle(fontSize: 24.sp),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
// SizedBox(height:20.h),
|
||||||
|
Container(
|
||||||
|
margin: const EdgeInsets.only(top: 10, bottom: 10),
|
||||||
|
// color: Colors.red,
|
||||||
|
// height: 100.h,
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
|
children: [
|
||||||
|
GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
Get.toNamed(Routers.valueAddedServicesRecordPage,
|
||||||
|
arguments: UseRecordListArg.cloudauth);
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
width: 200.w,
|
||||||
|
// height: 70.h,
|
||||||
|
// color: Colors.red,
|
||||||
|
child: Center(
|
||||||
|
child: Text(TranslationLoader.lanKeys!.record!.tr,
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.black, fontSize: 24.sp)))),
|
||||||
|
),
|
||||||
|
GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
// Navigator.pushNamed(
|
||||||
|
// context, Routers.valueAddedServicesBuyPage,
|
||||||
|
// arguments: 3);
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
width: 200.w,
|
||||||
|
// height: 70.h,
|
||||||
|
// color: Colors.red,
|
||||||
|
child: Center(
|
||||||
|
child: Text(TranslationLoader.lanKeys!.buy!.tr,
|
||||||
|
style: TextStyle(
|
||||||
|
// color: AppColors.mainColor,
|
||||||
|
color: AppColors.blackColor,
|
||||||
|
fontSize: 24.sp)))),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
]));
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget bottomWidget() {
|
||||||
|
return GetBuilder<ValueAddedServicesRealNameLogic>(
|
||||||
|
builder: (ValueAddedServicesRealNameLogic logic) {
|
||||||
|
return Container(
|
||||||
|
width: 1.sw,
|
||||||
|
color: Colors.white,
|
||||||
|
margin: EdgeInsets.all(20.h),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Column(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
padding:
|
||||||
|
EdgeInsets.only(top: 20.h, bottom: 20.h, left: 30.w),
|
||||||
|
child: Text(
|
||||||
|
TranslationLoader
|
||||||
|
.lanKeys!.buyRealNameSelectYouWantBuyTip!.tr,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 24.sp, fontWeight: FontWeight.w600),
|
||||||
|
)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
checkCommonItem(
|
||||||
|
logic, TranslationLoader.lanKeys!.forTheFirstTime!.tr, 0),
|
||||||
|
checkCommonItem(logic, TranslationLoader.lanKeys!.onceDay!.tr, 1),
|
||||||
|
checkCommonItem(logic, TranslationLoader.lanKeys!.weekOnce!.tr, 2),
|
||||||
|
checkCommonItem(logic, TranslationLoader.lanKeys!.monthOnce!.tr, 3,
|
||||||
|
isHaveLine: false, isHaveRightWidget: true),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//选择组件
|
||||||
|
Widget checkCommonItem(
|
||||||
|
ValueAddedServicesRealNameLogic logic, String text, int index,
|
||||||
|
{bool isHaveLine = true, bool isHaveRightWidget = true}) {
|
||||||
|
bool check = logic.state.index == index;
|
||||||
|
return CommonItem(
|
||||||
|
leftTitel: text,
|
||||||
|
rightTitle: "",
|
||||||
|
allHeight: 60.h,
|
||||||
|
isHaveLine: isHaveLine,
|
||||||
|
isHaveRightWidget: isHaveRightWidget,
|
||||||
|
rightWidget: GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
logic.check(index);
|
||||||
|
},
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Image.asset(
|
||||||
|
check
|
||||||
|
? 'images/icon_round_select.png'
|
||||||
|
: 'images/icon_round_unSelect.png',
|
||||||
|
width: 30.w,
|
||||||
|
height: 30.w,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,3 @@
|
|||||||
|
class ValueAddedServicesRealNameState {
|
||||||
|
int index = 0;
|
||||||
|
}
|
||||||
@ -0,0 +1,25 @@
|
|||||||
|
class BuyRecordListEntity {
|
||||||
|
BuyRecordListEntity({
|
||||||
|
this.description,
|
||||||
|
this.errorCode,
|
||||||
|
this.errorMsg,
|
||||||
|
});
|
||||||
|
|
||||||
|
BuyRecordListEntity.fromJson(dynamic json) {
|
||||||
|
description = json['description'];
|
||||||
|
errorCode = json['errorCode'];
|
||||||
|
errorMsg = json['errorMsg'];
|
||||||
|
}
|
||||||
|
|
||||||
|
String? description;
|
||||||
|
int? errorCode;
|
||||||
|
String? errorMsg;
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final map = <String, dynamic>{};
|
||||||
|
map['description'] = description;
|
||||||
|
map['errorCode'] = errorCode;
|
||||||
|
map['errorMsg'] = errorMsg;
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
class UseRecordListArg {
|
||||||
|
static Map<String, String> sms = {
|
||||||
|
'type': 'sms',
|
||||||
|
};
|
||||||
|
static Map<String, String> vip = {
|
||||||
|
'type': 'vip',
|
||||||
|
};
|
||||||
|
static Map<String, String> email = {
|
||||||
|
'type': 'email',
|
||||||
|
};
|
||||||
|
static Map<String, String> cloudauth = {
|
||||||
|
'type': 'cloudauth',
|
||||||
|
};
|
||||||
|
}
|
||||||
@ -0,0 +1,25 @@
|
|||||||
|
class UseRecordListEntity {
|
||||||
|
UseRecordListEntity({
|
||||||
|
this.description,
|
||||||
|
this.errorCode,
|
||||||
|
this.errorMsg,
|
||||||
|
});
|
||||||
|
|
||||||
|
UseRecordListEntity.fromJson(dynamic json) {
|
||||||
|
description = json['description'];
|
||||||
|
errorCode = json['errorCode'];
|
||||||
|
errorMsg = json['errorMsg'];
|
||||||
|
}
|
||||||
|
|
||||||
|
String? description;
|
||||||
|
int? errorCode;
|
||||||
|
String? errorMsg;
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final map = <String, dynamic>{};
|
||||||
|
map['description'] = description;
|
||||||
|
map['errorCode'] = errorCode;
|
||||||
|
map['errorMsg'] = errorMsg;
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,52 @@
|
|||||||
|
import 'dart:async';
|
||||||
|
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:get/utils.dart';
|
||||||
|
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesRealName/face_authentication_entity.dart';
|
||||||
|
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesRecord/buy_record_list_entity.dart';
|
||||||
|
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesRecord/value_added_services_record_state.dart';
|
||||||
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
|
import '../../../network/api_repository.dart';
|
||||||
|
import '../../../tools/eventBusEventManage.dart';
|
||||||
|
|
||||||
|
class ValueAddedServicesRecordLogic extends BaseGetXController {
|
||||||
|
ValueAddedServicesRecordLogic();
|
||||||
|
|
||||||
|
final ValueAddedServicesRecordState state = ValueAddedServicesRecordState();
|
||||||
|
int buyPageNo = 1;
|
||||||
|
late String type;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void onInit() {
|
||||||
|
super.onInit();
|
||||||
|
dynamic data = Get.arguments;
|
||||||
|
if (data is! Map && data['type'] is! String) {
|
||||||
|
Get.back();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
type = data['type'];
|
||||||
|
}
|
||||||
|
|
||||||
|
//请求消息列表
|
||||||
|
Future<void> loadBuyRecordList(bool load) async {
|
||||||
|
if (!load) {
|
||||||
|
buyPageNo = 1;
|
||||||
|
}
|
||||||
|
BuyRecordListEntity entity = await ApiRepository.to.getBuyRecordList(
|
||||||
|
type: type,
|
||||||
|
recordType: 10,
|
||||||
|
pageNo: buyPageNo,
|
||||||
|
);
|
||||||
|
if (entity.errorCode!.codeIsSuccessful) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void onReady() {
|
||||||
|
super.onReady();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void onClose() {
|
||||||
|
super.onClose();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,77 @@
|
|||||||
|
import 'package:easy_refresh/easy_refresh.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesRecord/value_added_services_record_logic.dart';
|
||||||
|
import '../../../app_settings/app_colors.dart';
|
||||||
|
import '../../../tools/titleAppBar.dart';
|
||||||
|
|
||||||
|
class ValueAddedServicesRecordPage extends StatefulWidget {
|
||||||
|
ValueAddedServicesRecordPage({
|
||||||
|
Key? key,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<ValueAddedServicesRecordPage> createState() =>
|
||||||
|
_ValueAddedServicesRealNamePageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _ValueAddedServicesRealNamePageState
|
||||||
|
extends State<ValueAddedServicesRecordPage> {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return GetBuilder<ValueAddedServicesRecordLogic>(
|
||||||
|
init: ValueAddedServicesRecordLogic(),
|
||||||
|
builder: (ValueAddedServicesRecordLogic logic) {
|
||||||
|
return Scaffold(
|
||||||
|
backgroundColor: AppColors.mainBackgroundColor,
|
||||||
|
appBar: TitleAppBar(
|
||||||
|
barTitle: '记录'.tr,
|
||||||
|
haveBack: true,
|
||||||
|
backgroundColor: AppColors.mainColor),
|
||||||
|
body: DefaultTabController(
|
||||||
|
length: 2,
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
TabBar(
|
||||||
|
tabs: [
|
||||||
|
Text('购买记录'.tr),
|
||||||
|
Text('使用记录'.tr),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: TabBarView(children: [
|
||||||
|
_PurchaseRecords(),
|
||||||
|
Text('使用记录'),
|
||||||
|
]),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class _PurchaseRecords extends StatefulWidget {
|
||||||
|
const _PurchaseRecords({key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<_PurchaseRecords> createState() => _PurchaseRecordsState();
|
||||||
|
}
|
||||||
|
|
||||||
|
//购买记录
|
||||||
|
class _PurchaseRecordsState extends State<_PurchaseRecords> {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return GetBuilder<ValueAddedServicesRecordLogic>(
|
||||||
|
builder: (ValueAddedServicesRecordLogic logic) {
|
||||||
|
return EasyRefresh(
|
||||||
|
onRefresh: () async {},
|
||||||
|
onLoad: () async {},
|
||||||
|
child: ListView.builder(itemBuilder: (BuildContext context, int index) {
|
||||||
|
return SizedBox();
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,3 @@
|
|||||||
|
class ValueAddedServicesRecordState {
|
||||||
|
int index = 0;
|
||||||
|
}
|
||||||
@ -45,7 +45,8 @@ abstract class Api {
|
|||||||
|
|
||||||
final String passwordKeyGetURL = '/keyboardPwd/get'; //获取密码
|
final String passwordKeyGetURL = '/keyboardPwd/get'; //获取密码
|
||||||
final String passwordKeyAddURL = '/keyboardPwd/add'; //自定义密码
|
final String passwordKeyAddURL = '/keyboardPwd/add'; //自定义密码
|
||||||
final String passwordKeyCheckKeyboardpwdNameURL = '/keyboardPwd/checkKeyboardpwdName'; //自定义密码校验密码跟名字是否重复
|
final String passwordKeyCheckKeyboardpwdNameURL =
|
||||||
|
'/keyboardPwd/checkKeyboardpwdName'; //自定义密码校验密码跟名字是否重复
|
||||||
final String updatePasswordKeyURL = '/keyboardPwd/update'; //修改密码详情
|
final String updatePasswordKeyURL = '/keyboardPwd/update'; //修改密码详情
|
||||||
final String clearOperationRecordURL = '/lockRecords/clear'; //清空操作记录
|
final String clearOperationRecordURL = '/lockRecords/clear'; //清空操作记录
|
||||||
final String addlockGroupURL = '/keyGroup/add'; //创建锁分组
|
final String addlockGroupURL = '/keyGroup/add'; //创建锁分组
|
||||||
@ -175,7 +176,8 @@ abstract class Api {
|
|||||||
'/safeAnswer/getOwnQuestionList'; //获取已设置的安全信息
|
'/safeAnswer/getOwnQuestionList'; //获取已设置的安全信息
|
||||||
final String updateSafeAnswerURL = '/safeAnswer/update'; //修改安全信息
|
final String updateSafeAnswerURL = '/safeAnswer/update'; //修改安全信息
|
||||||
final String setSafeAnswerURL = '/safeAnswer/set'; //设置安全信息
|
final String setSafeAnswerURL = '/safeAnswer/set'; //设置安全信息
|
||||||
final String getUpTokenURL = '/file/getUploadParams'; //上传头像 先获取upToken 再调用updateUserInfo
|
final String getUpTokenURL =
|
||||||
|
'/file/getUploadParams'; //上传头像 先获取upToken 再调用updateUserInfo
|
||||||
final String unbindPhoneTokenURL = '/user/unbindPhoneToken'; //获取解绑手机号Token
|
final String unbindPhoneTokenURL = '/user/unbindPhoneToken'; //获取解绑手机号Token
|
||||||
final String unbindEmailTokenURL = '/user/unbindEmailToken'; //获取解绑邮箱Token
|
final String unbindEmailTokenURL = '/user/unbindEmailToken'; //获取解绑邮箱Token
|
||||||
final String pushBindAppIdURL = '/user/bindAppId'; //推送绑定APP设备
|
final String pushBindAppIdURL = '/user/bindAppId'; //推送绑定APP设备
|
||||||
@ -194,4 +196,14 @@ abstract class Api {
|
|||||||
|
|
||||||
final String getLockNoticeSettingURL =
|
final String getLockNoticeSettingURL =
|
||||||
'/lockSetting/getLockNoticeSetting'; //获取锁消息设置
|
'/lockSetting/getLockNoticeSetting'; //获取锁消息设置
|
||||||
|
final String setWechatPushSwitchURL =
|
||||||
|
'/user/setMpWechatPushSwitch'; //设置微信公众号推送
|
||||||
|
final String getMpWechatQrCodeURL = '/user/getMpWechatQrCode'; //获取微信公众号二维码
|
||||||
|
|
||||||
|
final String setFaceAuthenticationURL =
|
||||||
|
'/v2/service/setFaceAuthentication'; //设置实名认证频次
|
||||||
|
|
||||||
|
final String getBuyRecordListURL = '/v2/service/getBuyRecordList'; //获取购买记录列表
|
||||||
|
|
||||||
|
final String getUseRecordListURL = '/v2/service/getUseRecordList'; //获取使用记录列表
|
||||||
}
|
}
|
||||||
|
|||||||
@ -281,6 +281,7 @@ class ApiProvider extends BaseProvider {
|
|||||||
"startDate": startDate,
|
"startDate": startDate,
|
||||||
'endDate': endDate,
|
'endDate': endDate,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// 锁记录上传
|
// 锁记录上传
|
||||||
Future<Response> lockRecordUploadData(String lockId, List records) => post(
|
Future<Response> lockRecordUploadData(String lockId, List records) => post(
|
||||||
lockRecordUploadURL.toUrl,
|
lockRecordUploadURL.toUrl,
|
||||||
@ -453,10 +454,7 @@ class ApiProvider extends BaseProvider {
|
|||||||
|
|
||||||
// 自定义密码校验名字密码是否重复
|
// 自定义密码校验名字密码是否重复
|
||||||
Future<Response> checkKeyboardpwdName(
|
Future<Response> checkKeyboardpwdName(
|
||||||
String lockId,
|
String lockId, String keyboardPwdName, String keyboardPwd) =>
|
||||||
String keyboardPwdName,
|
|
||||||
String keyboardPwd
|
|
||||||
) =>
|
|
||||||
post(
|
post(
|
||||||
passwordKeyCheckKeyboardpwdNameURL.toUrl,
|
passwordKeyCheckKeyboardpwdNameURL.toUrl,
|
||||||
jsonEncode({
|
jsonEncode({
|
||||||
@ -1556,14 +1554,16 @@ class ApiProvider extends BaseProvider {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
//更新个人信息-昵称
|
//更新个人信息-昵称
|
||||||
Future<Response> updateUserNameInfo(String nickname) =>
|
Future<Response> updateUserNameInfo(String nickname) => post(
|
||||||
post(updateUserInfoURL.toUrl, jsonEncode({
|
updateUserInfoURL.toUrl,
|
||||||
|
jsonEncode({
|
||||||
'nickname': nickname,
|
'nickname': nickname,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
//更新个人信息-头像
|
//更新个人信息-头像
|
||||||
Future<Response> updateUserHeadUrlInfo(String headUrl) =>
|
Future<Response> updateUserHeadUrlInfo(String headUrl) => post(
|
||||||
post(updateUserInfoURL.toUrl, jsonEncode({
|
updateUserInfoURL.toUrl,
|
||||||
|
jsonEncode({
|
||||||
'headUrl': headUrl,
|
'headUrl': headUrl,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
@ -1626,10 +1626,10 @@ class ApiProvider extends BaseProvider {
|
|||||||
|
|
||||||
// 获取上传文件的upToken 再调用updateUserInfo
|
// 获取上传文件的upToken 再调用updateUserInfo
|
||||||
Future<Response> getUpHeadToken(
|
Future<Response> getUpHeadToken(
|
||||||
String userId,
|
String userId,
|
||||||
String filename,
|
String filename,
|
||||||
int size,
|
int size,
|
||||||
) =>
|
) =>
|
||||||
post(
|
post(
|
||||||
getUpTokenURL.toUrl,
|
getUpTokenURL.toUrl,
|
||||||
jsonEncode({
|
jsonEncode({
|
||||||
@ -1641,7 +1641,9 @@ class ApiProvider extends BaseProvider {
|
|||||||
|
|
||||||
// 文件上传
|
// 文件上传
|
||||||
Future<Response> uploadFile(String url, dynamic boay) => post(url, boay,
|
Future<Response> uploadFile(String url, dynamic boay) => post(url, boay,
|
||||||
isUnUploadFile: false, contentType: 'multipart/form-data', isUserBaseUrl: false);
|
isUnUploadFile: false,
|
||||||
|
contentType: 'multipart/form-data',
|
||||||
|
isUserBaseUrl: false);
|
||||||
|
|
||||||
//获取解绑手机号Token
|
//获取解绑手机号Token
|
||||||
Future<Response> unbindPhoneToken(String verificationCode) => post(
|
Future<Response> unbindPhoneToken(String verificationCode) => post(
|
||||||
@ -1784,6 +1786,46 @@ class ApiProvider extends BaseProvider {
|
|||||||
jsonEncode({
|
jsonEncode({
|
||||||
'lockId': lockId,
|
'lockId': lockId,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
// 设置微信公众号推送
|
||||||
|
Future<Response> setMpWechatPushSwitch(int mpWechatPushSwitch) => post(
|
||||||
|
setWechatPushSwitchURL.toUrl,
|
||||||
|
jsonEncode({
|
||||||
|
'mpWechatPushSwitch': mpWechatPushSwitch,
|
||||||
|
}));
|
||||||
|
|
||||||
|
// 获取微信公众号二维码
|
||||||
|
Future<Response> getMpWechatQrCode() =>
|
||||||
|
post(getMpWechatQrCodeURL.toUrl, jsonEncode({}));
|
||||||
|
|
||||||
|
// 设置实名认证频次
|
||||||
|
Future<Response> setFaceAuthentication(int faceAuthFrequence) => post(
|
||||||
|
setFaceAuthenticationURL.toUrl,
|
||||||
|
jsonEncode({
|
||||||
|
'face_auth_frequence': faceAuthFrequence,
|
||||||
|
}));
|
||||||
|
|
||||||
|
// 获取使用记录列表
|
||||||
|
Future<Response> getBuyRecordList(
|
||||||
|
String type, int recordType, int pageNo, int pageSize) =>
|
||||||
|
post(
|
||||||
|
getBuyRecordListURL.toUrl,
|
||||||
|
jsonEncode({
|
||||||
|
'type': type,
|
||||||
|
'record_type': recordType,
|
||||||
|
'pageNo': pageNo,
|
||||||
|
'pageSize': pageSize,
|
||||||
|
}));
|
||||||
|
|
||||||
|
// 获取使用记录列表
|
||||||
|
Future<Response> getUseRecordList(String type, int pageNo, int pageSize) =>
|
||||||
|
post(
|
||||||
|
getUseRecordListURL.toUrl,
|
||||||
|
jsonEncode({
|
||||||
|
'type': type,
|
||||||
|
'pageNo': pageNo,
|
||||||
|
'pageSize': pageSize,
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
extension ExtensionString on String {
|
extension ExtensionString on String {
|
||||||
|
|||||||
@ -21,6 +21,10 @@ import 'package:star_lock/mine/mineSet/lockUserManage/expireLockList/expireElect
|
|||||||
import 'package:star_lock/mine/mineSet/lockUserManage/expireLockList/expireFingerprint/expireFingerprint_entity.dart';
|
import 'package:star_lock/mine/mineSet/lockUserManage/expireLockList/expireFingerprint/expireFingerprint_entity.dart';
|
||||||
import 'package:star_lock/mine/mineSet/lockUserManage/lockUserManageList/keyListByUserEntity.dart';
|
import 'package:star_lock/mine/mineSet/lockUserManage/lockUserManageList/keyListByUserEntity.dart';
|
||||||
import 'package:star_lock/mine/mineSet/mineSet/userSettingInfoEntity.dart';
|
import 'package:star_lock/mine/mineSet/mineSet/userSettingInfoEntity.dart';
|
||||||
|
import 'package:star_lock/mine/mineSet/mineSet/weChatQRCodeEntity.dart';
|
||||||
|
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesRealName/face_authentication_entity.dart';
|
||||||
|
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesRecord/buy_record_list_entity.dart';
|
||||||
|
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesRecord/use_record_list_entity.dart';
|
||||||
import '../common/safetyVerification/entity/CheckSafetyVerificationEntity.dart';
|
import '../common/safetyVerification/entity/CheckSafetyVerificationEntity.dart';
|
||||||
import '../common/safetyVerification/entity/SafetyVerificationEntity.dart';
|
import '../common/safetyVerification/entity/SafetyVerificationEntity.dart';
|
||||||
import '../login/login/entity/LoginEntity.dart';
|
import '../login/login/entity/LoginEntity.dart';
|
||||||
@ -58,6 +62,7 @@ class ApiRepository {
|
|||||||
final ApiProvider apiProvider;
|
final ApiProvider apiProvider;
|
||||||
|
|
||||||
static ApiRepository get to => Get.find<ApiRepository>();
|
static ApiRepository get to => Get.find<ApiRepository>();
|
||||||
|
|
||||||
ApiRepository(this.apiProvider);
|
ApiRepository(this.apiProvider);
|
||||||
|
|
||||||
// 发送验证码(登陆之前使用) 1注册,2找回密码
|
// 发送验证码(登陆之前使用) 1注册,2找回密码
|
||||||
@ -101,12 +106,10 @@ class ApiRepository {
|
|||||||
|
|
||||||
//登录
|
//登录
|
||||||
Future<LoginEntity> login(
|
Future<LoginEntity> login(
|
||||||
{
|
{required String loginType,
|
||||||
required String loginType,
|
required String password,
|
||||||
required String password,
|
required String countryCode,
|
||||||
required String countryCode,
|
required String username}) async {
|
||||||
required String username
|
|
||||||
}) async {
|
|
||||||
final res =
|
final res =
|
||||||
await apiProvider.login(loginType, password, countryCode, username);
|
await apiProvider.login(loginType, password, countryCode, username);
|
||||||
return LoginEntity.fromJson(res.body);
|
return LoginEntity.fromJson(res.body);
|
||||||
@ -274,7 +277,8 @@ class ApiRepository {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 更新锁用户NO
|
// 更新锁用户NO
|
||||||
Future<LockNetTokenEntity> updateLockUserNo({required String keyId, required String lockUserNo}) async {
|
Future<LockNetTokenEntity> updateLockUserNo(
|
||||||
|
{required String keyId, required String lockUserNo}) async {
|
||||||
final res = await apiProvider.updateLockUserNo(keyId, lockUserNo);
|
final res = await apiProvider.updateLockUserNo(keyId, lockUserNo);
|
||||||
return LockNetTokenEntity.fromJson(res.body);
|
return LockNetTokenEntity.fromJson(res.body);
|
||||||
}
|
}
|
||||||
@ -401,8 +405,7 @@ class ApiRepository {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 删除锁
|
// 删除锁
|
||||||
Future<LockListInfoEntity> deletOwnerLockData(
|
Future<LockListInfoEntity> deletOwnerLockData({required int lockId}) async {
|
||||||
{required int lockId}) async {
|
|
||||||
final res = await apiProvider.deletLockInfo(lockId);
|
final res = await apiProvider.deletLockInfo(lockId);
|
||||||
return LockListInfoEntity.fromJson(res.body);
|
return LockListInfoEntity.fromJson(res.body);
|
||||||
}
|
}
|
||||||
@ -456,13 +459,11 @@ class ApiRepository {
|
|||||||
|
|
||||||
//自定义密码校验密码名称或密码是否已存在
|
//自定义密码校验密码名称或密码是否已存在
|
||||||
Future<PasswordKeyEntity> checkKeyboardpwdName(
|
Future<PasswordKeyEntity> checkKeyboardpwdName(
|
||||||
{
|
{required String lockId,
|
||||||
required String lockId,
|
required String keyboardPwdName,
|
||||||
required String keyboardPwdName,
|
required String keyboardPwd}) async {
|
||||||
required String keyboardPwd
|
final res = await apiProvider.checkKeyboardpwdName(
|
||||||
}) async {
|
lockId, keyboardPwdName, keyboardPwd);
|
||||||
final res = await apiProvider.checkKeyboardpwdName(lockId, keyboardPwdName,
|
|
||||||
keyboardPwd);
|
|
||||||
return PasswordKeyEntity.fromJson(res.body);
|
return PasswordKeyEntity.fromJson(res.body);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1601,8 +1602,7 @@ class ApiRepository {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//更新个人信息-昵称
|
//更新个人信息-昵称
|
||||||
Future<PasswordKeyListEntity> updateUserNameInfo(
|
Future<PasswordKeyListEntity> updateUserNameInfo({
|
||||||
{
|
|
||||||
required String nickname,
|
required String nickname,
|
||||||
}) async {
|
}) async {
|
||||||
final res = await apiProvider.updateUserNameInfo(nickname);
|
final res = await apiProvider.updateUserNameInfo(nickname);
|
||||||
@ -1611,9 +1611,7 @@ class ApiRepository {
|
|||||||
|
|
||||||
//更新个人信息-头像
|
//更新个人信息-头像
|
||||||
Future<PasswordKeyListEntity> updateUserHeadUrlInfo(
|
Future<PasswordKeyListEntity> updateUserHeadUrlInfo(
|
||||||
{
|
{required String headUrl}) async {
|
||||||
required String headUrl
|
|
||||||
}) async {
|
|
||||||
final res = await apiProvider.updateUserHeadUrlInfo(headUrl);
|
final res = await apiProvider.updateUserHeadUrlInfo(headUrl);
|
||||||
return PasswordKeyListEntity.fromJson(res.body);
|
return PasswordKeyListEntity.fromJson(res.body);
|
||||||
}
|
}
|
||||||
@ -1673,8 +1671,7 @@ class ApiRepository {
|
|||||||
required String filename,
|
required String filename,
|
||||||
required int size,
|
required int size,
|
||||||
}) async {
|
}) async {
|
||||||
final res =
|
final res = await apiProvider.getUpHeadToken(userId, filename, size);
|
||||||
await apiProvider.getUpHeadToken(userId, filename, size);
|
|
||||||
return MinePersonGetUploadFileInfoEntity.fromJson(res.body);
|
return MinePersonGetUploadFileInfoEntity.fromJson(res.body);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1819,4 +1816,46 @@ class ApiRepository {
|
|||||||
final res = await apiProvider.getLockNoticeSetting(lockId);
|
final res = await apiProvider.getLockNoticeSetting(lockId);
|
||||||
return VersionUndateEntity.fromJson(res.body);
|
return VersionUndateEntity.fromJson(res.body);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 设置微信公众号推送
|
||||||
|
Future<VersionUndateEntity> setMpWechatPushSwitch(
|
||||||
|
{required int mpWechatPushSwitch}) async {
|
||||||
|
final res = await apiProvider.setMpWechatPushSwitch(mpWechatPushSwitch);
|
||||||
|
return VersionUndateEntity.fromJson(res.body);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取微信公众号二维码
|
||||||
|
Future<GetWechatQrCodeEntity> getMpWechatQrCode() async {
|
||||||
|
final res = await apiProvider.getMpWechatQrCode();
|
||||||
|
return GetWechatQrCodeEntity.fromJson(res.body);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 设置实名认证频次
|
||||||
|
Future<FaceAuthenticationEntity> setFaceAuthentication(
|
||||||
|
{required int faceAuthFrequence}) async {
|
||||||
|
final res = await apiProvider.setFaceAuthentication(faceAuthFrequence);
|
||||||
|
return FaceAuthenticationEntity.fromJson(res.body);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取使用记录
|
||||||
|
Future<BuyRecordListEntity> getBuyRecordList({
|
||||||
|
required String type,
|
||||||
|
required int pageNo,
|
||||||
|
required int recordType,
|
||||||
|
int pageSize = 10,
|
||||||
|
}) async {
|
||||||
|
final res =
|
||||||
|
await apiProvider.getBuyRecordList(type, recordType, pageNo, pageSize);
|
||||||
|
return BuyRecordListEntity.fromJson(res.body);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取购买记录
|
||||||
|
Future<UseRecordListEntity> getUseRecordList({
|
||||||
|
required String type,
|
||||||
|
required int pageNo,
|
||||||
|
int pageSize = 10,
|
||||||
|
}) async {
|
||||||
|
final res = await apiProvider.getUseRecordList(type, pageNo, pageSize);
|
||||||
|
return UseRecordListEntity.fromJson(res.body);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -123,26 +123,12 @@ class CallTalk {
|
|||||||
// Get.log('_initializeAudioPlayer audioData:$audioData');
|
// Get.log('_initializeAudioPlayer audioData:$audioData');
|
||||||
|
|
||||||
PcmArrayInt16 fromList = PcmArrayInt16.fromList(audioData);
|
PcmArrayInt16 fromList = PcmArrayInt16.fromList(audioData);
|
||||||
// FlutterPcmSound.setFeedCallback(onFeed);
|
|
||||||
await FlutterPcmSound.feed(fromList);
|
await FlutterPcmSound.feed(fromList);
|
||||||
FlutterPcmSound.play();
|
FlutterPcmSound.play();
|
||||||
}
|
}
|
||||||
|
|
||||||
void onFeed(int remainingFrames) async {
|
void startPlaySound() {
|
||||||
int framesToFeed = 320;
|
FlutterPcmSound.play();
|
||||||
|
|
||||||
if (allDataBytes.length >= framesToFeed) {
|
|
||||||
List<int> frames = allDataBytes.sublist(0, framesToFeed);
|
|
||||||
allDataBytes.removeRange(0, framesToFeed);
|
|
||||||
|
|
||||||
// 将数据传递给 FlutterPcmSound
|
|
||||||
PcmArrayInt16 fromList = PcmArrayInt16.fromList(frames);
|
|
||||||
await FlutterPcmSound.feed(fromList);
|
|
||||||
FlutterPcmSound.play();
|
|
||||||
} else {
|
|
||||||
// 处理长度不足的情况,可以等待更多数据或者采取其他措施
|
|
||||||
print("Not enough data in allPcmData.");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void stopPlaySound() {
|
void stopPlaySound() {
|
||||||
|
|||||||
@ -3,6 +3,7 @@ import 'dart:io';
|
|||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/gestures.dart';
|
import 'package:flutter/gestures.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.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/common/XSConstantMacro/XSConstantMacro.dart';
|
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
|
||||||
@ -179,6 +180,39 @@ class AppFirstEnterHandle {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//微信公众号二维码弹窗
|
||||||
|
void showQRImageAlert(BuildContext widgetContext, String qrCodeUrl) {
|
||||||
|
showCupertinoDialog(
|
||||||
|
context: widgetContext,
|
||||||
|
builder: (context) {
|
||||||
|
return PopScope(
|
||||||
|
canPop: false,
|
||||||
|
child: Center(
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Image.network(
|
||||||
|
qrCodeUrl,
|
||||||
|
width: 1.sw - 40.w,
|
||||||
|
height: 1.sw - 40.w,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 20.h,
|
||||||
|
),
|
||||||
|
//点击屏幕任意位置关闭弹窗
|
||||||
|
GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
},
|
||||||
|
child: Image.asset('images/icon_massSend_delete.png'),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)));
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// _launchURL(String url) async {
|
// _launchURL(String url) async {
|
||||||
// if (await canLaunchUrl(Uri.parse(url))) {
|
// if (await canLaunchUrl(Uri.parse(url))) {
|
||||||
// await launchUrl(Uri.parse(url));
|
// await launchUrl(Uri.parse(url));
|
||||||
|
|||||||
@ -65,9 +65,11 @@ class XSJPushProvider {
|
|||||||
FlutterLocalNotificationsPlugin();
|
FlutterLocalNotificationsPlugin();
|
||||||
const AndroidInitializationSettings initializationSettingsAndroid =
|
const AndroidInitializationSettings initializationSettingsAndroid =
|
||||||
AndroidInitializationSettings('app_icon');
|
AndroidInitializationSettings('app_icon');
|
||||||
const InitializationSettings initializationSettings =
|
if (Platform.isAndroid) {
|
||||||
InitializationSettings(android: initializationSettingsAndroid);
|
const InitializationSettings initializationSettings =
|
||||||
await flutterLocalNotificationsPlugin.initialize(initializationSettings);
|
InitializationSettings(android: initializationSettingsAndroid);
|
||||||
|
await flutterLocalNotificationsPlugin.initialize(initializationSettings);
|
||||||
|
}
|
||||||
|
|
||||||
if (isCancelLocalPush) {
|
if (isCancelLocalPush) {
|
||||||
await flutterLocalNotificationsPlugin.cancelAll();
|
await flutterLocalNotificationsPlugin.cancelAll();
|
||||||
|
|||||||
@ -148,7 +148,7 @@ dependencies:
|
|||||||
intl: ^0.18.0
|
intl: ^0.18.0
|
||||||
# flutter_audio_capture: <1.1.5
|
# flutter_audio_capture: <1.1.5
|
||||||
|
|
||||||
flutter_voice_processor: ^1.1.0
|
flutter_voice_processor: ^1.1.1
|
||||||
#监听网络连接状态
|
#监听网络连接状态
|
||||||
connectivity_plus: ^5.0.2
|
connectivity_plus: ^5.0.2
|
||||||
#flutter_advanced_calendar: ^1.4.1
|
#flutter_advanced_calendar: ^1.4.1
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user