1,优化安卓平台呼叫提醒本地通知
2,新增微信公众号推送部分国际化 3,新增设置微信公众号推送开关接口对接 4,新增获取微信公众号二维码接口对接 5,新增微信公众号二维码部分显示逻辑
This commit is contained in:
parent
529d75f2fe
commit
502f3880b4
@ -688,5 +688,6 @@
|
|||||||
"手掌":"palm",
|
"手掌":"palm",
|
||||||
|
|
||||||
"商城":"mall",
|
"商城":"mall",
|
||||||
"我的":"my"
|
"我的":"my",
|
||||||
|
"微信公众号推送":"Wechat public account"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -687,5 +687,6 @@
|
|||||||
"手掌":"手掌",
|
"手掌":"手掌",
|
||||||
|
|
||||||
"商城":"mall",
|
"商城":"mall",
|
||||||
"我的":"my"
|
"我的":"my",
|
||||||
|
"微信公众号推送":"微信公众号推送"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -688,5 +688,6 @@
|
|||||||
"虹膜":"虹膜",
|
"虹膜":"虹膜",
|
||||||
"手掌":"手掌",
|
"手掌":"手掌",
|
||||||
"商城":"商城",
|
"商城":"商城",
|
||||||
"我的":"我的"
|
"我的":"我的",
|
||||||
|
"微信公众号推送":"微信公众号推送"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -107,16 +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();
|
|
||||||
loginInitLocalNotification();
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<void> loginInitLocalNotification() async {
|
|
||||||
bool isLoggedIn = await getLoginStatus();
|
|
||||||
if (isLoggedIn) {
|
|
||||||
XSJPushProvider().initLocalNotification(false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -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设备
|
||||||
@ -193,4 +195,7 @@ abstract class Api {
|
|||||||
|
|
||||||
final String getLockNoticeSettingURL =
|
final String getLockNoticeSettingURL =
|
||||||
'/lockSetting/getLockNoticeSetting'; //获取锁消息设置
|
'/lockSetting/getLockNoticeSetting'; //获取锁消息设置
|
||||||
|
final String setWechatPushSwitchURL =
|
||||||
|
'/user/setMpWechatPushSwitch'; //设置微信公众号推送
|
||||||
|
final String getMpWechatQrCodeURL = '/user/getMpWechatQrCode'; //获取微信公众号二维码
|
||||||
}
|
}
|
||||||
|
|||||||
@ -453,10 +453,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 +1553,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 +1625,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 +1640,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(
|
||||||
@ -1779,6 +1780,17 @@ 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({}));
|
||||||
}
|
}
|
||||||
|
|
||||||
extension ExtensionString on String {
|
extension ExtensionString on String {
|
||||||
|
|||||||
@ -21,6 +21,7 @@ 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 '../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';
|
||||||
@ -101,12 +102,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 +273,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 +401,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 +455,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 +1598,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 +1607,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 +1667,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);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1813,4 +1806,17 @@ 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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user