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 * 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"]; //Extraskey // NSString *Extras = [userInfo valueForKey:@"Extras"]; //Extraskey
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];
} //}

View File

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

View File

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

View File

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

View File

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