1,iOS去掉通知数量角标显示

2,更新手掌、虹膜图片icon
3,个人用户设置页面根据是否为VIP显示标识
4,用户信息实体类新增是否为VIP用户字段
This commit is contained in:
Daisy 2024-04-28 14:12:50 +08:00
parent fcac101e72
commit d85104445d
9 changed files with 94 additions and 49 deletions

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

@ -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"]; //Extraskey
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"]; //Extraskey
// 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];
//}

View File

@ -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();
});
}

View File

@ -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,
)),
],
),
),
)
],
),
),
],
),
);

View File

@ -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() {}
}

View File

@ -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;
}
}