1,iOS去掉通知数量角标显示
2,更新手掌、虹膜图片icon 3,个人用户设置页面根据是否为VIP显示标识 4,用户信息实体类新增是否为VIP用户字段
This commit is contained in:
parent
fcac101e72
commit
d85104445d
Binary file not shown.
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 4.0 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 3.6 KiB |
BIN
star_lock/images/mine/icon_mine_isPlus.png
Normal file
BIN
star_lock/images/mine/icon_mine_isPlus.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.6 KiB |
BIN
star_lock/images/mine/icon_mine_noPlus.png
Normal file
BIN
star_lock/images/mine/icon_mine_noPlus.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.2 KiB |
@ -127,25 +127,25 @@
|
|||||||
/*
|
/*
|
||||||
* App处于启动状态时,通知打开回调
|
* App处于启动状态时,通知打开回调
|
||||||
*/
|
*/
|
||||||
- (void)application:(UIApplication*)application didReceiveRemoteNotification:(NSDictionary*)userInfo {
|
//- (void)application:(UIApplication*)application didReceiveRemoteNotification:(NSDictionary*)userInfo {
|
||||||
NSLog(@"Receive one notification.");
|
// NSLog(@"Receive one notification.");
|
||||||
// 取得APNS通知内容
|
// 取得APNS通知内容
|
||||||
NSDictionary *aps = [userInfo valueForKey:@"aps"];
|
// NSDictionary *aps = [userInfo valueForKey:@"aps"];
|
||||||
// 内容
|
// // 内容
|
||||||
NSString *content = [aps valueForKey:@"alert"];
|
// NSString *content = [aps valueForKey:@"alert"];
|
||||||
// badge数量
|
// // badge数量
|
||||||
NSInteger badge = [[aps valueForKey:@"badge"] integerValue];
|
// NSInteger badge = [[aps valueForKey:@"badge"] integerValue];
|
||||||
// 播放声音
|
// // 播放声音
|
||||||
NSString *sound = [aps valueForKey:@"sound"];
|
// NSString *sound = [aps valueForKey:@"sound"];
|
||||||
// 取得Extras字段内容
|
// // 取得Extras字段内容
|
||||||
NSString *Extras = [userInfo valueForKey:@"Extras"]; //服务端中Extras字段,key是自己定义的
|
// NSString *Extras = [userInfo valueForKey:@"Extras"]; //服务端中Extras字段,key是自己定义的
|
||||||
NSLog(@"content = [%@], badge = [%ld], sound = [%@], Extras = [%@]", content, (long)badge, sound, Extras);
|
// NSLog(@"content = [%@], badge = [%ld], sound = [%@], Extras = [%@]", content, (long)badge, sound, Extras);
|
||||||
// iOS badge 清0
|
// // iOS badge 清0
|
||||||
application.applicationIconBadgeNumber = 0;
|
// application.applicationIconBadgeNumber = 0;
|
||||||
// 通知打开回执上报
|
// // 通知打开回执上报
|
||||||
// [CloudPushSDK handleReceiveRemoteNotification:userInfo];(Deprecated from v1.8.1)
|
// // [CloudPushSDK handleReceiveRemoteNotification:userInfo];(Deprecated from v1.8.1)
|
||||||
[CloudPushSDK sendNotificationAck:userInfo];
|
// [CloudPushSDK sendNotificationAck:userInfo];
|
||||||
}
|
//}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,9 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:star_lock/app_settings/app_settings.dart';
|
||||||
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
||||||
|
import 'package:star_lock/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_entity.dart';
|
||||||
import 'package:star_lock/network/api_repository.dart';
|
import 'package:star_lock/network/api_repository.dart';
|
||||||
|
|
||||||
import '../../tools/baseGetXController.dart';
|
import '../../tools/baseGetXController.dart';
|
||||||
@ -12,6 +14,16 @@ import 'starLockMine_state.dart';
|
|||||||
class StarLockMineLogic extends BaseGetXController {
|
class StarLockMineLogic extends BaseGetXController {
|
||||||
final StarLockMineState state = StarLockMineState();
|
final StarLockMineState state = StarLockMineState();
|
||||||
|
|
||||||
|
//用户信息
|
||||||
|
Future<void> getUserInfoRequest() async {
|
||||||
|
MinePersonInfoEntity entity = await ApiRepository.to.getUserInfo();
|
||||||
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
|
state.mineInfoData.value = entity.data!;
|
||||||
|
state.isVip.value = state.mineInfoData.value.isVip! == 0 ? false : true;
|
||||||
|
AppLog.log('isVip: ${state.isVip.value}');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//删除账号请求
|
//删除账号请求
|
||||||
Future<void> userLogoutRequest() async {
|
Future<void> userLogoutRequest() async {
|
||||||
LoginEntity entity = await ApiRepository.to.userLogout(deviceld: '');
|
LoginEntity entity = await ApiRepository.to.userLogout(deviceld: '');
|
||||||
@ -22,7 +34,8 @@ class StarLockMineLogic extends BaseGetXController {
|
|||||||
StreamSubscription? _mineInfoChangeRefreshUIEvent;
|
StreamSubscription? _mineInfoChangeRefreshUIEvent;
|
||||||
void _mineInfoChangeRefreshUIAction() {
|
void _mineInfoChangeRefreshUIAction() {
|
||||||
// 蓝牙协议通知传输跟蓝牙之外的数据传输类不一样 eventBus
|
// 蓝牙协议通知传输跟蓝牙之外的数据传输类不一样 eventBus
|
||||||
_mineInfoChangeRefreshUIEvent = eventBus.on<MineInfoChangeRefreshUI>().listen((event) {
|
_mineInfoChangeRefreshUIEvent =
|
||||||
|
eventBus.on<MineInfoChangeRefreshUI>().listen((event) {
|
||||||
getMineInfoData();
|
getMineInfoData();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -24,6 +24,12 @@ class StarLockMinePageState extends State<StarLockMinePage> with BaseWidget {
|
|||||||
final logic = Get.put(StarLockMineLogic());
|
final logic = Get.put(StarLockMineLogic());
|
||||||
final state = Get.find<StarLockMineLogic>().state;
|
final state = Get.find<StarLockMineLogic>().state;
|
||||||
|
|
||||||
|
@override
|
||||||
|
initState() {
|
||||||
|
super.initState();
|
||||||
|
logic.getUserInfoRequest();
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
@ -57,19 +63,19 @@ class StarLockMinePageState extends State<StarLockMinePage> with BaseWidget {
|
|||||||
fit: BoxFit.fill,
|
fit: BoxFit.fill,
|
||||||
),
|
),
|
||||||
Center(
|
Center(
|
||||||
child: Column(
|
child: Column(
|
||||||
// crossAxisAlignment: CrossAxisAlignment.center,
|
// crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 120.h,
|
height: 120.h,
|
||||||
),
|
),
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
// Navigator.pushNamed(context, Routers.starLockLoginPage);
|
// Navigator.pushNamed(context, Routers.starLockLoginPage);
|
||||||
Get.back();
|
Get.back();
|
||||||
Get.toNamed(Routers.minePersonInfoPage);
|
Get.toNamed(Routers.minePersonInfoPage);
|
||||||
},
|
},
|
||||||
child: Obx(() => Container(
|
child: Obx(() => Container(
|
||||||
width: 105.w,
|
width: 105.w,
|
||||||
height: 105.w,
|
height: 105.w,
|
||||||
// decoration: BoxDecoration(
|
// decoration: BoxDecoration(
|
||||||
@ -78,7 +84,11 @@ class StarLockMinePageState extends State<StarLockMinePage> with BaseWidget {
|
|||||||
// ),
|
// ),
|
||||||
child: ClipRRect(
|
child: ClipRRect(
|
||||||
borderRadius: BorderRadius.circular(52.5.w),
|
borderRadius: BorderRadius.circular(52.5.w),
|
||||||
child: CustomNetworkImage(url:state.userHeadUrl.value??"", defaultUrl: 'images/controls_user.png', width:105.w, height:105.h),
|
child: CustomNetworkImage(
|
||||||
|
url: state.userHeadUrl.value ?? "",
|
||||||
|
defaultUrl: 'images/controls_user.png',
|
||||||
|
width: 105.w,
|
||||||
|
height: 105.h),
|
||||||
),
|
),
|
||||||
// state.headUrl().isNotEmpty ?
|
// state.headUrl().isNotEmpty ?
|
||||||
// Image(image: NetworkImage(state.loginData.value.data!.headUrl!)) :
|
// Image(image: NetworkImage(state.loginData.value.data!.headUrl!)) :
|
||||||
@ -87,27 +97,42 @@ class StarLockMinePageState extends State<StarLockMinePage> with BaseWidget {
|
|||||||
// width: 60.w,
|
// width: 60.w,
|
||||||
// height: 60.w)
|
// height: 60.w)
|
||||||
)),
|
)),
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 20.h,
|
height: 20.h,
|
||||||
),
|
),
|
||||||
Obx(() => Text(state.userNickName.value.isNotEmpty ? state.userNickName.value : (state.userMobile.value.isNotEmpty ? state.userMobile.value : state.userEmail.value),
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Obx(() => Text(
|
||||||
|
state.userNickName.value.isNotEmpty
|
||||||
|
? state.userNickName.value
|
||||||
|
: (state.userMobile.value.isNotEmpty
|
||||||
|
? state.userMobile.value
|
||||||
|
: state.userEmail.value),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 22.sp,
|
fontSize: 22.sp,
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
))),
|
))),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 10.h,
|
width: 5.w,
|
||||||
),
|
),
|
||||||
Obx(() => Text(
|
Obx(() => !state.isVip.value
|
||||||
"${TranslationLoader.lanKeys!.accountNumber!.tr}:${state.userMobile.value.isNotEmpty ? state.userMobile.value : state.userEmail.value}",
|
? Image.asset(
|
||||||
style: TextStyle(
|
'images/mine/icon_mine_noPlus.png',
|
||||||
fontSize: 18.sp,
|
width: 20.w,
|
||||||
color: Colors.white,
|
height: 20.w,
|
||||||
fontWeight: FontWeight.w500))),
|
)
|
||||||
|
: Image.asset(
|
||||||
|
'images/mine/icon_mine_isPlus.png',
|
||||||
|
width: 20.w,
|
||||||
|
height: 20.w,
|
||||||
|
)),
|
||||||
],
|
],
|
||||||
),
|
)
|
||||||
),
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@ -1,11 +1,14 @@
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:star_lock/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_entity.dart';
|
||||||
|
|
||||||
class StarLockMineState {
|
class StarLockMineState {
|
||||||
// final loginData = LoginData().obs;
|
// final loginData = LoginData().obs;
|
||||||
|
final mineInfoData = MinePersonInfoData().obs;
|
||||||
|
|
||||||
var userNickName = "".obs;
|
var userNickName = "".obs;
|
||||||
var userMobile = "".obs;
|
var userMobile = "".obs;
|
||||||
var userEmail = "".obs;
|
var userEmail = "".obs;
|
||||||
var userHeadUrl = "".obs;
|
var userHeadUrl = "".obs;
|
||||||
|
var isVip = false.obs;
|
||||||
void onClose() {}
|
void onClose() {}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -37,6 +37,7 @@ class MinePersonInfoData {
|
|||||||
int? countryId;
|
int? countryId;
|
||||||
String? email;
|
String? email;
|
||||||
String? countryName;
|
String? countryName;
|
||||||
|
int? isVip;
|
||||||
|
|
||||||
MinePersonInfoData(
|
MinePersonInfoData(
|
||||||
{this.mobile,
|
{this.mobile,
|
||||||
@ -47,7 +48,8 @@ class MinePersonInfoData {
|
|||||||
this.accountName,
|
this.accountName,
|
||||||
this.countryId,
|
this.countryId,
|
||||||
this.email,
|
this.email,
|
||||||
this.countryName});
|
this.countryName,
|
||||||
|
this.isVip});
|
||||||
|
|
||||||
MinePersonInfoData.fromJson(Map<String, dynamic> json) {
|
MinePersonInfoData.fromJson(Map<String, dynamic> json) {
|
||||||
mobile = json['mobile'];
|
mobile = json['mobile'];
|
||||||
@ -59,6 +61,7 @@ class MinePersonInfoData {
|
|||||||
countryId = json['countryId'];
|
countryId = json['countryId'];
|
||||||
email = json['email'];
|
email = json['email'];
|
||||||
countryName = json['countryName'];
|
countryName = json['countryName'];
|
||||||
|
isVip = json['isVip'];
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
@ -72,6 +75,7 @@ class MinePersonInfoData {
|
|||||||
data['countryId'] = countryId;
|
data['countryId'] = countryId;
|
||||||
data['email'] = email;
|
data['email'] = email;
|
||||||
data['countryName'] = countryName;
|
data['countryName'] = countryName;
|
||||||
|
data['isVip'] = isVip;
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user