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处于启动状态时,通知打开回调
|
||||
*/
|
||||
- (void)application:(UIApplication*)application didReceiveRemoteNotification:(NSDictionary*)userInfo {
|
||||
NSLog(@"Receive one notification.");
|
||||
// 取得APNS通知内容
|
||||
NSDictionary *aps = [userInfo valueForKey:@"aps"];
|
||||
// 内容
|
||||
NSString *content = [aps valueForKey:@"alert"];
|
||||
// badge数量
|
||||
NSInteger badge = [[aps valueForKey:@"badge"] integerValue];
|
||||
// 播放声音
|
||||
NSString *sound = [aps valueForKey:@"sound"];
|
||||
// 取得Extras字段内容
|
||||
NSString *Extras = [userInfo valueForKey:@"Extras"]; //服务端中Extras字段,key是自己定义的
|
||||
NSLog(@"content = [%@], badge = [%ld], sound = [%@], Extras = [%@]", content, (long)badge, sound, Extras);
|
||||
// iOS badge 清0
|
||||
application.applicationIconBadgeNumber = 0;
|
||||
// 通知打开回执上报
|
||||
// [CloudPushSDK handleReceiveRemoteNotification:userInfo];(Deprecated from v1.8.1)
|
||||
[CloudPushSDK sendNotificationAck:userInfo];
|
||||
}
|
||||
//- (void)application:(UIApplication*)application didReceiveRemoteNotification:(NSDictionary*)userInfo {
|
||||
// NSLog(@"Receive one notification.");
|
||||
// 取得APNS通知内容
|
||||
// NSDictionary *aps = [userInfo valueForKey:@"aps"];
|
||||
// // 内容
|
||||
// NSString *content = [aps valueForKey:@"alert"];
|
||||
// // badge数量
|
||||
// NSInteger badge = [[aps valueForKey:@"badge"] integerValue];
|
||||
// // 播放声音
|
||||
// NSString *sound = [aps valueForKey:@"sound"];
|
||||
// // 取得Extras字段内容
|
||||
// NSString *Extras = [userInfo valueForKey:@"Extras"]; //服务端中Extras字段,key是自己定义的
|
||||
// NSLog(@"content = [%@], badge = [%ld], sound = [%@], Extras = [%@]", content, (long)badge, sound, Extras);
|
||||
// // iOS badge 清0
|
||||
// application.applicationIconBadgeNumber = 0;
|
||||
// // 通知打开回执上报
|
||||
// // [CloudPushSDK handleReceiveRemoteNotification:userInfo];(Deprecated from v1.8.1)
|
||||
// [CloudPushSDK sendNotificationAck:userInfo];
|
||||
//}
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1,7 +1,9 @@
|
||||
import 'dart:async';
|
||||
|
||||
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/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_entity.dart';
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
|
||||
import '../../tools/baseGetXController.dart';
|
||||
@ -12,6 +14,16 @@ import 'starLockMine_state.dart';
|
||||
class StarLockMineLogic extends BaseGetXController {
|
||||
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 {
|
||||
LoginEntity entity = await ApiRepository.to.userLogout(deviceld: '');
|
||||
@ -22,7 +34,8 @@ class StarLockMineLogic extends BaseGetXController {
|
||||
StreamSubscription? _mineInfoChangeRefreshUIEvent;
|
||||
void _mineInfoChangeRefreshUIAction() {
|
||||
// 蓝牙协议通知传输跟蓝牙之外的数据传输类不一样 eventBus
|
||||
_mineInfoChangeRefreshUIEvent = eventBus.on<MineInfoChangeRefreshUI>().listen((event) {
|
||||
_mineInfoChangeRefreshUIEvent =
|
||||
eventBus.on<MineInfoChangeRefreshUI>().listen((event) {
|
||||
getMineInfoData();
|
||||
});
|
||||
}
|
||||
|
||||
@ -24,6 +24,12 @@ class StarLockMinePageState extends State<StarLockMinePage> with BaseWidget {
|
||||
final logic = Get.put(StarLockMineLogic());
|
||||
final state = Get.find<StarLockMineLogic>().state;
|
||||
|
||||
@override
|
||||
initState() {
|
||||
super.initState();
|
||||
logic.getUserInfoRequest();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
@ -57,19 +63,19 @@ class StarLockMinePageState extends State<StarLockMinePage> with BaseWidget {
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
Center(
|
||||
child: Column(
|
||||
// crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 120.h,
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
// Navigator.pushNamed(context, Routers.starLockLoginPage);
|
||||
Get.back();
|
||||
Get.toNamed(Routers.minePersonInfoPage);
|
||||
},
|
||||
child: Obx(() => Container(
|
||||
child: Column(
|
||||
// crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 120.h,
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
// Navigator.pushNamed(context, Routers.starLockLoginPage);
|
||||
Get.back();
|
||||
Get.toNamed(Routers.minePersonInfoPage);
|
||||
},
|
||||
child: Obx(() => Container(
|
||||
width: 105.w,
|
||||
height: 105.w,
|
||||
// decoration: BoxDecoration(
|
||||
@ -78,7 +84,11 @@ class StarLockMinePageState extends State<StarLockMinePage> with BaseWidget {
|
||||
// ),
|
||||
child: ClipRRect(
|
||||
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 ?
|
||||
// Image(image: NetworkImage(state.loginData.value.data!.headUrl!)) :
|
||||
@ -87,27 +97,42 @@ class StarLockMinePageState extends State<StarLockMinePage> with BaseWidget {
|
||||
// width: 60.w,
|
||||
// height: 60.w)
|
||||
)),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20.h,
|
||||
),
|
||||
Obx(() => Text(state.userNickName.value.isNotEmpty ? state.userNickName.value : (state.userMobile.value.isNotEmpty ? state.userMobile.value : state.userEmail.value),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20.h,
|
||||
),
|
||||
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(
|
||||
fontSize: 22.sp,
|
||||
color: Colors.white,
|
||||
))),
|
||||
SizedBox(
|
||||
height: 10.h,
|
||||
width: 5.w,
|
||||
),
|
||||
Obx(() => Text(
|
||||
"${TranslationLoader.lanKeys!.accountNumber!.tr}:${state.userMobile.value.isNotEmpty ? state.userMobile.value : state.userEmail.value}",
|
||||
style: TextStyle(
|
||||
fontSize: 18.sp,
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.w500))),
|
||||
Obx(() => !state.isVip.value
|
||||
? Image.asset(
|
||||
'images/mine/icon_mine_noPlus.png',
|
||||
width: 20.w,
|
||||
height: 20.w,
|
||||
)
|
||||
: 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:star_lock/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_entity.dart';
|
||||
|
||||
class StarLockMineState {
|
||||
// final loginData = LoginData().obs;
|
||||
final mineInfoData = MinePersonInfoData().obs;
|
||||
|
||||
var userNickName = "".obs;
|
||||
var userMobile = "".obs;
|
||||
var userEmail = "".obs;
|
||||
var userHeadUrl = "".obs;
|
||||
var isVip = false.obs;
|
||||
void onClose() {}
|
||||
}
|
||||
|
||||
@ -37,6 +37,7 @@ class MinePersonInfoData {
|
||||
int? countryId;
|
||||
String? email;
|
||||
String? countryName;
|
||||
int? isVip;
|
||||
|
||||
MinePersonInfoData(
|
||||
{this.mobile,
|
||||
@ -47,7 +48,8 @@ class MinePersonInfoData {
|
||||
this.accountName,
|
||||
this.countryId,
|
||||
this.email,
|
||||
this.countryName});
|
||||
this.countryName,
|
||||
this.isVip});
|
||||
|
||||
MinePersonInfoData.fromJson(Map<String, dynamic> json) {
|
||||
mobile = json['mobile'];
|
||||
@ -59,6 +61,7 @@ class MinePersonInfoData {
|
||||
countryId = json['countryId'];
|
||||
email = json['email'];
|
||||
countryName = json['countryName'];
|
||||
isVip = json['isVip'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
@ -72,6 +75,7 @@ class MinePersonInfoData {
|
||||
data['countryId'] = countryId;
|
||||
data['email'] = email;
|
||||
data['countryName'] = countryName;
|
||||
data['isVip'] = isVip;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user