app年龄,星座,寻爱飘屏优化
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
///昵称
|
||||
@property (nonatomic,strong) UILabel *nickLabel;
|
||||
///性别
|
||||
@property (nonatomic,strong) UIImageView *sexImageView;
|
||||
@property (nonatomic,strong) UIButton *sexImageView;
|
||||
///等级
|
||||
@property (nonatomic,strong) NetImageView *experImageView;
|
||||
///魅力等级
|
||||
@@ -84,7 +84,10 @@
|
||||
make.top.mas_equalTo(self.avatarImageView.mas_centerY).offset(2);
|
||||
make.right.mas_equalTo(self.findButton.mas_left).mas_offset(-4);
|
||||
}];
|
||||
|
||||
[self.sexImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(28);
|
||||
make.height.mas_equalTo(14);
|
||||
}];
|
||||
[self.findButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(65);
|
||||
make.height.mas_equalTo(30);
|
||||
@@ -123,14 +126,9 @@
|
||||
self.experImageView.imageUrl = _fansInfo.experUrl;
|
||||
self.charmImageView.imageUrl = _fansInfo.charmUrl;
|
||||
self.nobleImageView.imageUrl = _fansInfo.userVipInfoVO.vipIcon;
|
||||
NSString *sexStr;
|
||||
if (_fansInfo.gender == GenderType_Male) {
|
||||
sexStr = @"common_male";
|
||||
} else {
|
||||
sexStr = @"common_female";
|
||||
}
|
||||
self.sexImageView.image = [UIImage imageNamed:sexStr];
|
||||
|
||||
[self.sexImageView setTitle:[NSString getAgeWithBirth:_fansInfo.birth] forState:UIControlStateNormal];
|
||||
self.sexImageView.backgroundColor = _fansInfo.gender == GenderType_Male ? UIColorFromRGB(0x6BB3FF) :UIColorFromRGB(0xFF80CC);
|
||||
self.findButton.hidden = _fansInfo.userInRoomUid.length <= 0;
|
||||
UIImage* image = self.experImageView.image;
|
||||
if (image) {
|
||||
@@ -239,10 +237,16 @@
|
||||
return _nickLabel;
|
||||
}
|
||||
|
||||
- (UIImageView *)sexImageView {
|
||||
- (UIButton *)sexImageView {
|
||||
if (!_sexImageView) {
|
||||
_sexImageView = [[UIImageView alloc] init];
|
||||
_sexImageView.userInteractionEnabled = YES;
|
||||
_sexImageView = [[UIButton alloc] init];
|
||||
[_sexImageView setImage:kImage(@"home_age_boy_icon") forState:UIControlStateNormal];
|
||||
[_sexImageView setImage:kImage(@"home_age_girl_icon") forState:UIControlStateSelected];
|
||||
_sexImageView.titleLabel.font = [UIFont systemFontOfSize:10 weight:UIFontWeightMedium];
|
||||
[_sexImageView setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
||||
_sexImageView.imageEdgeInsets = UIEdgeInsetsMake(0, 2, 0, 0);
|
||||
_sexImageView.layer.cornerRadius = 14/2;
|
||||
_sexImageView.layer.masksToBounds = YES;
|
||||
}
|
||||
return _sexImageView;
|
||||
}
|
||||
|
@@ -24,7 +24,7 @@
|
||||
///昵称
|
||||
@property (nonatomic,strong) UILabel *nickLabel;
|
||||
///性别
|
||||
@property (nonatomic,strong) UIImageView *sexImageView;
|
||||
@property (nonatomic,strong) UIButton *sexImageView;
|
||||
///等级
|
||||
@property (nonatomic,strong) NetImageView *experImageView;
|
||||
///魅力等级
|
||||
@@ -84,7 +84,10 @@
|
||||
make.top.mas_equalTo(self.avatarImageView.mas_centerY).offset(2);
|
||||
make.right.mas_equalTo(self.attentionButton.mas_left).mas_offset(-4);
|
||||
}];
|
||||
|
||||
[self.sexImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(28);
|
||||
make.height.mas_equalTo(14);
|
||||
}];
|
||||
[self.attentionButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(65);
|
||||
make.height.mas_equalTo(30);
|
||||
@@ -125,14 +128,10 @@
|
||||
self.experImageView.imageUrl = _fansInfo.experUrl;
|
||||
self.charmImageView.imageUrl = _fansInfo.charmUrl;
|
||||
self.nobleImageView.imageUrl = _fansInfo.userVipInfoVO.vipIcon;
|
||||
NSString *sexStr;
|
||||
if (_fansInfo.gender == GenderType_Male) {
|
||||
sexStr = @"common_male";
|
||||
} else {
|
||||
sexStr = @"common_female";
|
||||
}
|
||||
self.sexImageView.image = [UIImage imageNamed:sexStr];
|
||||
|
||||
|
||||
[self.sexImageView setTitle:[NSString getAgeWithBirth:_fansInfo.birth] forState:UIControlStateNormal];
|
||||
self.sexImageView.backgroundColor = _fansInfo.gender == GenderType_Male ? UIColorFromRGB(0x6BB3FF) :UIColorFromRGB(0xFF80CC);
|
||||
|
||||
BOOL isMyFriend = [[NIMSDK sharedSDK].userManager isMyFriend:_fansInfo.uid];
|
||||
self.attentionButton.enabled = !isMyFriend;
|
||||
@@ -245,10 +244,16 @@
|
||||
return _nickLabel;
|
||||
}
|
||||
|
||||
- (UIImageView *)sexImageView {
|
||||
- (UIButton *)sexImageView {
|
||||
if (!_sexImageView) {
|
||||
_sexImageView = [[UIImageView alloc] init];
|
||||
_sexImageView.userInteractionEnabled = YES;
|
||||
_sexImageView = [[UIButton alloc] init];
|
||||
[_sexImageView setImage:kImage(@"home_age_boy_icon") forState:UIControlStateNormal];
|
||||
[_sexImageView setImage:kImage(@"home_age_girl_icon") forState:UIControlStateSelected];
|
||||
_sexImageView.titleLabel.font = [UIFont systemFontOfSize:10 weight:UIFontWeightMedium];
|
||||
[_sexImageView setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
||||
_sexImageView.imageEdgeInsets = UIEdgeInsetsMake(0, 2, 0, 0);
|
||||
_sexImageView.layer.cornerRadius = 14/2;
|
||||
_sexImageView.layer.masksToBounds = YES;
|
||||
}
|
||||
return _sexImageView;
|
||||
}
|
||||
|
@@ -24,7 +24,7 @@
|
||||
///昵称
|
||||
@property (nonatomic,strong) UILabel *nickLabel;
|
||||
///性别
|
||||
@property (nonatomic,strong) UIImageView *sexImageView;
|
||||
@property (nonatomic,strong) UIButton *sexImageView;
|
||||
///等级
|
||||
@property (nonatomic,strong) NetImageView *experImageView;
|
||||
///魅力等级
|
||||
@@ -76,7 +76,10 @@
|
||||
make.left.mas_equalTo(self.stackView);
|
||||
make.top.mas_equalTo(self.avatarImageView.mas_centerY).offset(2);
|
||||
}];
|
||||
|
||||
[self.sexImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(28);
|
||||
make.height.mas_equalTo(14);
|
||||
}];
|
||||
[self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.stackView);
|
||||
make.bottom.mas_equalTo(self.contentView);
|
||||
@@ -98,13 +101,9 @@
|
||||
self.charmImageView.hidden = NO;
|
||||
self.experImageView.imageUrl = _userInfo.userLevelVo.experUrl;
|
||||
self.charmImageView.imageUrl = _userInfo.userLevelVo.charmUrl;
|
||||
NSString *sexStr;
|
||||
if (_userInfo.gender == GenderType_Male) {
|
||||
sexStr = @"common_male";
|
||||
} else {
|
||||
sexStr = @"common_female";
|
||||
}
|
||||
self.sexImageView.image = [UIImage imageNamed:sexStr];
|
||||
|
||||
[self.sexImageView setTitle:[NSString getAgeWithBirth:_userInfo.birth] forState:UIControlStateNormal];
|
||||
self.sexImageView.backgroundColor = _userInfo.gender == GenderType_Male ? UIColorFromRGB(0x6BB3FF) :UIColorFromRGB(0xFF80CC);
|
||||
UIImage* image = self.experImageView.image;
|
||||
if (image) {
|
||||
CGFloat scale = image.size.width / image.size.height;
|
||||
@@ -173,10 +172,16 @@
|
||||
return _nickLabel;
|
||||
}
|
||||
|
||||
- (UIImageView *)sexImageView {
|
||||
- (UIButton *)sexImageView {
|
||||
if (!_sexImageView) {
|
||||
_sexImageView = [[UIImageView alloc] init];
|
||||
_sexImageView.userInteractionEnabled = YES;
|
||||
_sexImageView = [[UIButton alloc] init];
|
||||
[_sexImageView setImage:kImage(@"home_age_boy_icon") forState:UIControlStateNormal];
|
||||
[_sexImageView setImage:kImage(@"home_age_girl_icon") forState:UIControlStateSelected];
|
||||
_sexImageView.titleLabel.font = [UIFont systemFontOfSize:10 weight:UIFontWeightMedium];
|
||||
[_sexImageView setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
||||
_sexImageView.imageEdgeInsets = UIEdgeInsetsMake(0, 2, 0, 0);
|
||||
_sexImageView.layer.cornerRadius = 14/2;
|
||||
_sexImageView.layer.masksToBounds = YES;
|
||||
}
|
||||
return _sexImageView;
|
||||
}
|
||||
|
@@ -25,8 +25,6 @@
|
||||
@property (nonatomic,strong) UILabel *starView;
|
||||
///星座背景图片
|
||||
@property (nonatomic,strong) UIImageView *starIconView;
|
||||
///星座
|
||||
@property (nonatomic,strong) UILabel *starTitleView;
|
||||
///生日
|
||||
@property (nonatomic,strong) UILabel *birthdayHeadView;
|
||||
@property (nonatomic,strong) UILabel *birthdayView;
|
||||
@@ -67,7 +65,6 @@
|
||||
[self.backView addSubview:self.titleLabel];
|
||||
[self.backView addSubview:self.starView];
|
||||
[self.backView addSubview:self.starIconView];
|
||||
[self.starIconView addSubview:self.starTitleView];
|
||||
[self.backView addSubview:self.birthdayHeadView];
|
||||
[self.backView addSubview:self.birthdayView];
|
||||
[self.backView addSubview:self.areaHeadView];
|
||||
@@ -103,16 +100,12 @@
|
||||
|
||||
}];
|
||||
[self.starIconView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.height.mas_equalTo(kGetScaleWidth(13));
|
||||
make.width.mas_equalTo(kGetScaleWidth(38));
|
||||
make.height.mas_equalTo(18);
|
||||
make.width.mas_equalTo(46);
|
||||
make.centerY.equalTo(self.starView);
|
||||
make.left.equalTo(self.starView.mas_right).mas_offset(kGetScaleWidth(10));
|
||||
}];
|
||||
[self.starTitleView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(kGetScaleWidth(5));
|
||||
make.right.mas_equalTo(-kGetScaleWidth(5));
|
||||
make.top.bottom.equalTo(self.starIconView);
|
||||
}];
|
||||
|
||||
[self.birthdayHeadView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.height.equalTo(self.titleLabel);
|
||||
make.top.equalTo(self.starView.mas_bottom).mas_offset(kGetScaleWidth(5));
|
||||
@@ -245,8 +238,10 @@
|
||||
-(void)setUserInfo:(UserInfoModel *)userInfo{
|
||||
_userInfo = userInfo;
|
||||
_starIconView.hidden = NO;
|
||||
NSString *dateStr = [NSString stringWithFormat:@"%@",[self calculateConstellationWithMonth:_userInfo.birth]];
|
||||
_starTitleView.text = dateStr;
|
||||
NSString *dateStr = [NSString stringWithFormat:@"%@",[NSString getCalculateConstellationImageWithMonth:_userInfo.birth]];
|
||||
if(dateStr.length > 0){
|
||||
_starIconView.image = kImage(dateStr);
|
||||
}
|
||||
_birthdayView.text = [NSDate timestampSwitchTime:_userInfo.birth / 1000 andFormatter:@"yyyy-MM-dd"];
|
||||
_areaView.text = _userInfo.region;
|
||||
}
|
||||
@@ -330,21 +325,11 @@
|
||||
-(UIImageView *)starIconView{
|
||||
if (!_starIconView){
|
||||
_starIconView = [[UIImageView alloc]init];
|
||||
UIImage *image = [UIImage gradientColorImageFromColors:@[UIColorFromRGB(0xA486FF),UIColorFromRGB(0xD3ACFE)] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(kGetScaleWidth(38), kGetScaleWidth(13))];
|
||||
_starIconView.layer.cornerRadius = kGetScaleWidth(6.5);
|
||||
_starIconView.layer.masksToBounds = YES;
|
||||
_starIconView.image = image;
|
||||
_starIconView.hidden = YES;
|
||||
}
|
||||
return _starIconView;
|
||||
}
|
||||
-(UILabel *)starTitleView{
|
||||
if (!_starTitleView){
|
||||
_starTitleView = [UILabel labelInitWithText:@"" font:kFontRegular(8.5) textColor:[UIColor whiteColor]];
|
||||
_starTitleView.textAlignment = NSTextAlignmentCenter;
|
||||
}
|
||||
return _starTitleView;
|
||||
}
|
||||
|
||||
- (UILabel *)birthdayHeadView{
|
||||
if (!_birthdayHeadView){
|
||||
_birthdayHeadView = [UILabel labelInitWithText:YMLocalizedString(@"XPMineDataClanTableViewCell8") font:kFontRegular(12) textColor:[DJDKMIMOMColor inputTextColor]];
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
@property (nonatomic, strong) UIView *bgView;
|
||||
@property (nonatomic ,strong) NetImageView *avaterImgView;
|
||||
@property (nonatomic, strong) UIImageView *genderImageView;
|
||||
@property (nonatomic, strong) UIButton *genderImageView;
|
||||
@property (nonatomic, strong) UILabel *nickLabel;
|
||||
@property (nonatomic ,strong) UILabel *memberIdLabel;
|
||||
@property (nonatomic ,strong) UIButton *tagPic;
|
||||
@@ -103,7 +103,8 @@
|
||||
}];
|
||||
[self.genderImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerY.mas_equalTo(self.nickLabel.mas_centerY);
|
||||
make.width.height.mas_equalTo(14);
|
||||
make.height.mas_equalTo(14);
|
||||
make.width.mas_equalTo(28);
|
||||
make.left.mas_equalTo(self.nickLabel.mas_right).mas_offset(5);
|
||||
make.right.mas_lessThanOrEqualTo(self.tagPic.mas_left).mas_offset(-5);
|
||||
}];
|
||||
@@ -180,7 +181,10 @@
|
||||
self.avaterImgView.imageUrl = item.avatar;
|
||||
self.memberIdLabel.text = [NSString stringWithFormat:@"ID:%zd", item.erbanNo];
|
||||
self.timeLabel.text = item.visitTimeDesc;
|
||||
self.genderImageView.image = [UIImage imageNamed:item.gender == 1 ? @"common_male" : @"common_female"];
|
||||
|
||||
[self.genderImageView setTitle:[NSString getAgeWithBirth:_item.birth] forState:UIControlStateNormal];
|
||||
self.genderImageView.backgroundColor = item.gender == GenderType_Male ? UIColorFromRGB(0x6BB3FF) :UIColorFromRGB(0xFF80CC);
|
||||
|
||||
}
|
||||
|
||||
- (NetImageView *)avaterImgView {
|
||||
@@ -212,10 +216,16 @@
|
||||
return _nickLabel;
|
||||
}
|
||||
|
||||
- (UIImageView *)genderImageView {
|
||||
- (UIButton *)genderImageView {
|
||||
if (!_genderImageView) {
|
||||
_genderImageView = [[UIImageView alloc] init];
|
||||
_genderImageView.contentMode = UIViewContentModeScaleAspectFit;
|
||||
_genderImageView = [[UIButton alloc] init];
|
||||
[_genderImageView setImage:kImage(@"home_age_boy_icon") forState:UIControlStateNormal];
|
||||
[_genderImageView setImage:kImage(@"home_age_girl_icon") forState:UIControlStateSelected];
|
||||
_genderImageView.titleLabel.font = [UIFont systemFontOfSize:10 weight:UIFontWeightMedium];
|
||||
[_genderImageView setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
||||
_genderImageView.imageEdgeInsets = UIEdgeInsetsMake(0, 2, 0, 0);
|
||||
_genderImageView.layer.cornerRadius = 14/2;
|
||||
_genderImageView.layer.masksToBounds = YES;
|
||||
}
|
||||
return _genderImageView;
|
||||
}
|
||||
|
@@ -25,7 +25,7 @@
|
||||
///昵称
|
||||
@property (nonatomic,strong) UILabel *nickLabel;
|
||||
///性别
|
||||
@property (nonatomic,strong) UIImageView *sexImageView;
|
||||
@property (nonatomic,strong) UIButton *sexImageView;
|
||||
///显示id
|
||||
@property (nonatomic,strong) UILabel *idLabel;
|
||||
///分割线
|
||||
@@ -51,7 +51,9 @@
|
||||
self.avatarImageView.imageUrl = data.avatar;
|
||||
self.nickLabel.text = data.nick;
|
||||
self.idLabel.text = [NSString stringWithFormat:@"%@%@:%@",AppName, YMLocalizedString(@"App_Common_hao"),data.erbanNo];
|
||||
self.sexImageView.image = data.gender == GenderType_Female ? [UIImage imageNamed:@"common_female"] : [UIImage imageNamed:@"common_male"];
|
||||
|
||||
[self.sexImageView setTitle:[NSString getAgeWithBirth:_data.birth] forState:UIControlStateNormal];
|
||||
self.sexImageView.backgroundColor = data.gender == GenderType_Male ? UIColorFromRGB(0x6BB3FF) :UIColorFromRGB(0xFF80CC);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,7 +87,10 @@
|
||||
make.left.mas_equalTo(self.nameStackView);
|
||||
make.top.mas_equalTo(self.avatarImageView.mas_centerY).offset(1.5);
|
||||
}];
|
||||
|
||||
[self.sexImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(28);
|
||||
make.height.mas_equalTo(14);
|
||||
}];
|
||||
[self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.nameStackView);
|
||||
make.right.mas_equalTo(self.contentView).offset(-15);
|
||||
@@ -142,9 +147,16 @@
|
||||
return _nickLabel;
|
||||
}
|
||||
|
||||
- (UIImageView *)sexImageView {
|
||||
- (UIButton *)sexImageView {
|
||||
if (!_sexImageView) {
|
||||
_sexImageView = [[UIImageView alloc] init];
|
||||
_sexImageView = [[UIButton alloc] init];
|
||||
[_sexImageView setImage:kImage(@"home_age_boy_icon") forState:UIControlStateNormal];
|
||||
[_sexImageView setImage:kImage(@"home_age_girl_icon") forState:UIControlStateSelected];
|
||||
_sexImageView.titleLabel.font = [UIFont systemFontOfSize:10 weight:UIFontWeightMedium];
|
||||
[_sexImageView setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
||||
_sexImageView.imageEdgeInsets = UIEdgeInsetsMake(0, 2, 0, 0);
|
||||
_sexImageView.layer.cornerRadius = 14/2;
|
||||
_sexImageView.layer.masksToBounds = YES;
|
||||
}
|
||||
return _sexImageView;
|
||||
}
|
||||
|
@@ -25,6 +25,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property (nonatomic,copy) NSString *erbanNo;
|
||||
///性别
|
||||
@property (nonatomic,assign) GenderType gender;
|
||||
///生日
|
||||
@property(nonatomic,assign) long birth;
|
||||
///公会名称
|
||||
@property (nonatomic, copy) NSString *hallName;
|
||||
///昵称
|
||||
|
@@ -12,6 +12,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@interface GuildSearchUserInfoModel : NSObject
|
||||
///用户的uid
|
||||
@property (nonatomic,copy) NSString *uid;
|
||||
///生日
|
||||
@property(nonatomic,assign) long birth;
|
||||
///头像
|
||||
@property (nonatomic,copy) NSString *avatar;
|
||||
///昵称
|
||||
|
@@ -19,6 +19,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property (nonatomic,copy) NSString *avatar;
|
||||
///性别
|
||||
@property (nonatomic,assign) GenderType gender;
|
||||
///生日
|
||||
@property(nonatomic,assign) long birth;
|
||||
///是否已经是超管
|
||||
@property (nonatomic,assign) BOOL hasSet;
|
||||
@end
|
||||
|
@@ -17,7 +17,7 @@
|
||||
///昵称的容器
|
||||
@property (nonatomic,strong) UIStackView *nickStackView;
|
||||
///性别
|
||||
@property (nonatomic,strong) UIImageView *sexImageView;
|
||||
@property (nonatomic,strong) UIButton *sexImageView;
|
||||
///魅力等级
|
||||
@property (nonatomic,strong) NetImageView *charmImageView;
|
||||
///等级
|
||||
@@ -90,7 +90,8 @@
|
||||
}];
|
||||
[self.sexImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(kGetScaleWidth(2));
|
||||
make.height.width.mas_equalTo(kGetScaleWidth(14));
|
||||
make.height.mas_equalTo(14);
|
||||
make.width.mas_equalTo(28);
|
||||
make.bottom.mas_equalTo(0);
|
||||
}];
|
||||
[self.experImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
@@ -142,7 +143,9 @@
|
||||
nick = [NSString stringWithFormat:@"%@...", [nick substringToIndex:8]];
|
||||
}
|
||||
_nameView.text = nick;
|
||||
self.sexImageView.image = _authorityModel.gender == GenderType_Female ? [UIImage imageNamed:@"common_female"] : [UIImage imageNamed:@"common_male"];
|
||||
|
||||
[self.sexImageView setTitle:[NSString getAgeWithBirth:_authorityModel.birth] forState:UIControlStateNormal];
|
||||
self.sexImageView.backgroundColor = _authorityModel.gender == GenderType_Male ? UIColorFromRGB(0x6BB3FF) :UIColorFromRGB(0xFF80CC);
|
||||
if (_authorityModel.userLevelVo.experUrl) {
|
||||
if (self.experImageView.state == NetImageStateLoaded) {
|
||||
self.experImageView.imageUrl = _authorityModel.userLevelVo.experUrl;
|
||||
@@ -295,10 +298,16 @@
|
||||
}
|
||||
return _lineView;
|
||||
}
|
||||
- (UIImageView *)sexImageView {
|
||||
- (UIButton *)sexImageView {
|
||||
if (!_sexImageView) {
|
||||
_sexImageView = [[UIImageView alloc] init];
|
||||
_sexImageView.userInteractionEnabled = YES;
|
||||
_sexImageView = [[UIButton alloc] init];
|
||||
[_sexImageView setImage:kImage(@"home_age_boy_icon") forState:UIControlStateNormal];
|
||||
[_sexImageView setImage:kImage(@"home_age_girl_icon") forState:UIControlStateSelected];
|
||||
_sexImageView.titleLabel.font = [UIFont systemFontOfSize:10 weight:UIFontWeightMedium];
|
||||
[_sexImageView setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
||||
_sexImageView.imageEdgeInsets = UIEdgeInsetsMake(0, 2, 0, 0);
|
||||
_sexImageView.layer.cornerRadius = 14/2;
|
||||
_sexImageView.layer.masksToBounds = YES;
|
||||
}
|
||||
return _sexImageView;
|
||||
}
|
||||
|
@@ -21,7 +21,7 @@
|
||||
///昵称
|
||||
@property (nonatomic,strong) UILabel *nickLabel;
|
||||
///性别
|
||||
@property (nonatomic,strong) UIImageView *sexImageView;
|
||||
@property (nonatomic,strong) UIButton *sexImageView;
|
||||
///id
|
||||
@property (nonatomic,strong) UILabel *idLabel;
|
||||
///设置超管
|
||||
@@ -64,7 +64,8 @@
|
||||
[self.sexImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerY.mas_equalTo(self.nickLabel.mas_centerY);
|
||||
make.left.mas_equalTo(self.nickLabel.mas_right).mas_offset(3);
|
||||
make.height.width.mas_equalTo(18);
|
||||
make.height.mas_equalTo(14);
|
||||
make.width.mas_equalTo(28);
|
||||
}];
|
||||
|
||||
[self.idLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
@@ -97,7 +98,8 @@
|
||||
nick = [nick substringToIndex:8];
|
||||
}
|
||||
self.nickLabel.text = nick;
|
||||
self.sexImageView.image = _userInfo.gender == GenderType_Female ? [UIImage imageNamed:@"common_female"] : [UIImage imageNamed:@"common_male"];
|
||||
[self.sexImageView setTitle:[NSString getAgeWithBirth:_userInfo.birth] forState:UIControlStateNormal];
|
||||
self.sexImageView.backgroundColor =_userInfo.gender == GenderType_Male ? UIColorFromRGB(0x6BB3FF) :UIColorFromRGB(0xFF80CC);
|
||||
self.idLabel.text = [NSString stringWithFormat:@"%@", _userInfo.erbanNo];
|
||||
self.superAdminButton.enabled = !_userInfo.hasSet;
|
||||
if(self.superAdminButton.enabled == NO){
|
||||
@@ -135,10 +137,16 @@
|
||||
return _nickLabel;
|
||||
}
|
||||
|
||||
- (UIImageView *)sexImageView {
|
||||
- (UIButton *)sexImageView {
|
||||
if (!_sexImageView) {
|
||||
_sexImageView = [[UIImageView alloc] init];
|
||||
_sexImageView.userInteractionEnabled = YES;
|
||||
_sexImageView = [[UIButton alloc] init];
|
||||
[_sexImageView setImage:kImage(@"home_age_boy_icon") forState:UIControlStateNormal];
|
||||
[_sexImageView setImage:kImage(@"home_age_girl_icon") forState:UIControlStateSelected];
|
||||
_sexImageView.titleLabel.font = [UIFont systemFontOfSize:10 weight:UIFontWeightMedium];
|
||||
[_sexImageView setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
||||
_sexImageView.imageEdgeInsets = UIEdgeInsetsMake(0, 2, 0, 0);
|
||||
_sexImageView.layer.cornerRadius = 14/2;
|
||||
_sexImageView.layer.masksToBounds = YES;
|
||||
}
|
||||
return _sexImageView;
|
||||
}
|
||||
|
@@ -32,7 +32,7 @@
|
||||
///id
|
||||
@property (nonatomic,strong) UILabel *idLabel;
|
||||
///性别
|
||||
@property (nonatomic,strong) UIImageView *sexImageView;
|
||||
@property (nonatomic,strong) UIButton *sexImageView;
|
||||
///魅力等级
|
||||
@property (nonatomic,strong) NetImageView *charmImageView;
|
||||
///等级
|
||||
@@ -99,7 +99,8 @@
|
||||
}];
|
||||
[self.sexImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(2);
|
||||
make.height.width.mas_equalTo(18);
|
||||
make.height.mas_equalTo(14);
|
||||
make.width.mas_equalTo(28);
|
||||
make.bottom.mas_equalTo(0);
|
||||
}];
|
||||
[self.experImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
@@ -153,7 +154,9 @@
|
||||
nick = [NSString stringWithFormat:@"%@...", [nick substringToIndex:8]];
|
||||
}
|
||||
self.nickLabel.text = nick;
|
||||
self.sexImageView.image = _memberInfo.gender == GenderType_Female ? [UIImage imageNamed:@"common_female"] : [UIImage imageNamed:@"common_male"];
|
||||
|
||||
[self.sexImageView setTitle:[NSString getAgeWithBirth:_memberInfo.birth] forState:UIControlStateNormal];
|
||||
self.sexImageView.backgroundColor = _memberInfo.gender == GenderType_Male ? UIColorFromRGB(0x6BB3FF) :UIColorFromRGB(0xFF80CC);
|
||||
if (_memberInfo.experUrl) {
|
||||
if (self.experImageView.state == NetImageStateLoaded) {
|
||||
self.experImageView.imageUrl = _memberInfo.experUrl;
|
||||
@@ -401,10 +404,16 @@
|
||||
return _nickLabel;
|
||||
}
|
||||
|
||||
- (UIImageView *)sexImageView {
|
||||
- (UIButton *)sexImageView {
|
||||
if (!_sexImageView) {
|
||||
_sexImageView = [[UIImageView alloc] init];
|
||||
_sexImageView.userInteractionEnabled = YES;
|
||||
_sexImageView = [[UIButton alloc] init];
|
||||
[_sexImageView setImage:kImage(@"home_age_boy_icon") forState:UIControlStateNormal];
|
||||
[_sexImageView setImage:kImage(@"home_age_girl_icon") forState:UIControlStateSelected];
|
||||
_sexImageView.titleLabel.font = [UIFont systemFontOfSize:10 weight:UIFontWeightMedium];
|
||||
[_sexImageView setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
||||
_sexImageView.imageEdgeInsets = UIEdgeInsetsMake(0, 2, 0, 0);
|
||||
_sexImageView.layer.cornerRadius = 14/2;
|
||||
_sexImageView.layer.masksToBounds = YES;
|
||||
}
|
||||
return _sexImageView;
|
||||
}
|
||||
|
@@ -21,7 +21,7 @@ UIKIT_EXTERN NSString *kInviteMemeberSuccess;
|
||||
///昵称
|
||||
@property (nonatomic,strong) UILabel *nickLabel;
|
||||
///显示性别
|
||||
@property (nonatomic,strong) UIImageView *sexImageView;
|
||||
@property (nonatomic,strong) UIButton *sexImageView;
|
||||
///显示id
|
||||
@property (nonatomic,strong) UILabel *idLabel;
|
||||
///邀请
|
||||
@@ -84,7 +84,7 @@ UIKIT_EXTERN NSString *kInviteMemeberSuccess;
|
||||
[self.sexImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.nickLabel.mas_right).offset(6);
|
||||
make.centerY.mas_equalTo(self.nickLabel);
|
||||
make.size.mas_equalTo(CGSizeMake(14, 14));
|
||||
make.size.mas_equalTo(CGSizeMake(28, 14));
|
||||
}];
|
||||
|
||||
[self.inviteButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
@@ -109,7 +109,9 @@ UIKIT_EXTERN NSString *kInviteMemeberSuccess;
|
||||
_userInfo = userInfo;
|
||||
if (_userInfo) {
|
||||
self.avatarImageView.imageUrl = _userInfo.avatar;
|
||||
self.sexImageView.image = _userInfo.gender == GenderType_Female ? [UIImage imageNamed:@"common_female"] : [UIImage imageNamed:@"common_male"];
|
||||
|
||||
[self.sexImageView setTitle:[NSString getAgeWithBirth:_userInfo.birth] forState:UIControlStateNormal];
|
||||
self.sexImageView.backgroundColor = _userInfo.gender == GenderType_Male ? UIColorFromRGB(0x6BB3FF) :UIColorFromRGB(0xFF80CC);
|
||||
self.nickLabel.text = _userInfo.nick;
|
||||
self.idLabel.text = [NSString stringWithFormat:YMLocalizedString(@"XPMineGuildSearchMemberTableViewCell0"), _userInfo.erbanNo];
|
||||
switch (_userInfo.hallBtnStatus) {
|
||||
@@ -173,10 +175,16 @@ UIKIT_EXTERN NSString *kInviteMemeberSuccess;
|
||||
return _nickLabel;
|
||||
}
|
||||
|
||||
- (UIImageView *)sexImageView {
|
||||
- (UIButton *)sexImageView {
|
||||
if (!_sexImageView) {
|
||||
_sexImageView = [[UIImageView alloc] init];
|
||||
_sexImageView.userInteractionEnabled = YES;
|
||||
_sexImageView = [[UIButton alloc] init];
|
||||
[_sexImageView setImage:kImage(@"home_age_boy_icon") forState:UIControlStateNormal];
|
||||
[_sexImageView setImage:kImage(@"home_age_girl_icon") forState:UIControlStateSelected];
|
||||
_sexImageView.titleLabel.font = [UIFont systemFontOfSize:10 weight:UIFontWeightMedium];
|
||||
[_sexImageView setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
||||
_sexImageView.imageEdgeInsets = UIEdgeInsetsMake(0, 2, 0, 0);
|
||||
_sexImageView.layer.cornerRadius = 14/2;
|
||||
_sexImageView.layer.masksToBounds = YES;
|
||||
}
|
||||
return _sexImageView;
|
||||
}
|
||||
|
@@ -25,10 +25,9 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
- (void)requestNobleIAPRechargeOrderWithChargeProdId:(NSString *)chargeProdId roomUid:(NSString *)roomUid ;
|
||||
|
||||
/// 充值成功二次验证
|
||||
/// @param receipt 凭据
|
||||
/// @param orderId 订单编号
|
||||
/// @param transcationId 商品id
|
||||
- (void)checkReceiptWithData:(NSString *)receipt orderId:(NSString *)orderId transcationId:(NSString *)transcationId;
|
||||
- (void)checkReceiptWithOrderId:(NSString *)orderId transcationId:(NSString *)transcationId errorToast:(BOOL)errorToast;
|
||||
|
||||
/// 批量验证内购掉单
|
||||
/// @param transcations 凭据的数组
|
||||
|
@@ -58,22 +58,25 @@
|
||||
NSString * clientIp= [YYUtility ipAddress];
|
||||
[Api requestNobleIAPRecharge:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
NSString *orderId = (NSString *)data.data[@"recordId"];
|
||||
[[self getView] requestIAPRechargeOrderSuccess:orderId chargeProdId:chargeProdId];
|
||||
NSString *uuid = (NSString *)data.data[@"appAccountToken"];
|
||||
[[self getView] requestIAPRechargeOrderSuccess:orderId chargeProdId:chargeProdId uuid:uuid];
|
||||
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
[[self getView] requestIAPRechargeOrderFail:msg code:code];
|
||||
} errorToast:YES] chargeProdId:chargeProdId uid:uid roomUid:roomUid ticket:ticket deviceInfo:deviceInfo clientIp:clientIp];
|
||||
}
|
||||
|
||||
/// 充值成功二次验证
|
||||
/// @param receipt 凭据
|
||||
|
||||
/// @param orderId 订单编号
|
||||
/// @param transcationId 商品id
|
||||
- (void)checkReceiptWithData:(NSString *)receipt orderId:(NSString *)orderId transcationId:(NSString *)transcationId {
|
||||
- (void)checkReceiptWithOrderId:(NSString *)orderId transcationId:(NSString *)transcationId errorToast:(BOOL)errorToast{
|
||||
NSString * uid = [AccountInfoStorage instance].getUid;
|
||||
NSString * ticket = [AccountInfoStorage instance].getTicket;
|
||||
[Api checkReceipt:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[[self getView] checkReceiptSuccess:transcationId];
|
||||
} showLoading:YES] receipt:receipt chooseEnv:@"true" chargeRecordId:orderId transcationId:transcationId uid:uid ticket:ticket];
|
||||
}fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
[[self getView]checkReceiptFailWithCode:code transcationId:transcationId];
|
||||
} showLoading:YES errorToast:errorToast] chooseEnv:@"true" chargeRecordId:orderId transcationId:transcationId uid:uid ticket:ticket];
|
||||
}
|
||||
|
||||
/// 批量验证内购掉单
|
||||
|
@@ -20,13 +20,14 @@
|
||||
- (void)onGetNobleRechargeDataSuccess:(NobleRechargeModel *)rechargeInfo;
|
||||
|
||||
///请求充值id的状态成功
|
||||
- (void)requestIAPRechargeOrderSuccess:(NSString *)orderId chargeProdId:(NSString *)chargeProdId;
|
||||
- (void)requestIAPRechargeOrderSuccess:(NSString *)orderId chargeProdId:(NSString *)chargeProdId uuid:(NSString *)uuid;
|
||||
///请求充值账单失败
|
||||
- (void)requestIAPRechargeOrderFail:(NSString *)message code:(NSInteger)code;
|
||||
|
||||
///二次校验成功
|
||||
- (void)checkReceiptSuccess:(NSString *)transcationId;
|
||||
|
||||
///二次校验失败
|
||||
- (void)checkReceiptFailWithCode:(NSInteger)code transcationId:(NSString *)transcationId;
|
||||
///批量验证凭据成功
|
||||
- (void)checkTranscationIdsSuccess;
|
||||
|
||||
|
@@ -18,7 +18,7 @@
|
||||
#import "ThemeColor+NobleCenter.h"
|
||||
#import "Api+NobleCenter.h"
|
||||
|
||||
#import "XPIAPHelper.h"
|
||||
|
||||
#import "RechargeStorage.h"
|
||||
#import "AccountInfoStorage.h"
|
||||
#import "UIImage+Utils.h"
|
||||
@@ -43,7 +43,8 @@
|
||||
#import "XPNobleCenterPayView.h"
|
||||
#import "XPNobleCenterProtocol.h"
|
||||
#import "XPIAPRechargeViewController.h"
|
||||
@interface XPNobleCenterViewController ()<XPNobleCenterProtocol,XPNobleCenterPayViewDelegate,JXCategoryViewDelegate, JXCategoryListContainerViewDelegate,XPNobleCenterNavViewDelegate, XPIAPHelperDelegate, NIMSystemNotificationManagerDelegate>
|
||||
#import "YuMi-swift.h"
|
||||
@interface XPNobleCenterViewController ()<XPNobleCenterProtocol,XPNobleCenterPayViewDelegate,JXCategoryViewDelegate, JXCategoryListContainerViewDelegate,XPNobleCenterNavViewDelegate, NIMSystemNotificationManagerDelegate>
|
||||
///分页标题
|
||||
@property (nonatomic, strong) NSArray<NSString *> *titles;
|
||||
///分页控件
|
||||
@@ -92,19 +93,18 @@
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
[XPIAPHelper shareHelper].delegate = nil;
|
||||
|
||||
}
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
|
||||
[XPIAPHelper shareHelper].delegate = self;
|
||||
[[NIMSDK sharedSDK].systemNotificationManager addDelegate:self];
|
||||
[self requestHttp];
|
||||
[self initSubViews];
|
||||
[self initSubViewConstraints];
|
||||
}
|
||||
|
||||
|
||||
- (BOOL)isHiddenNavBar {
|
||||
return YES;
|
||||
}
|
||||
@@ -116,8 +116,8 @@
|
||||
[self.presenter getUserInfo];
|
||||
}
|
||||
if([XPSkillCardPlayerManager shareInstance].isInRoom == YES && [XPSkillCardPlayerManager shareInstance].isInRoomFirstRecharge == NO){
|
||||
[XPSkillCardPlayerManager shareInstance].isInRoomFirstRecharge = YES;
|
||||
}
|
||||
[XPSkillCardPlayerManager shareInstance].isInRoomFirstRecharge = YES;
|
||||
}
|
||||
}
|
||||
|
||||
- (XPNobleCenterPresenter *)createPresenter {
|
||||
@@ -144,7 +144,7 @@
|
||||
make.leading.top.trailing.mas_equalTo(self.view);
|
||||
make.height.mas_equalTo(height);
|
||||
}];
|
||||
|
||||
|
||||
[self.navView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.leading.trailing.top.mas_equalTo(self.view);
|
||||
make.height.mas_equalTo(kNavigationHeight);
|
||||
@@ -154,7 +154,7 @@
|
||||
make.height.mas_equalTo(40);
|
||||
make.top.mas_equalTo(self.navView.mas_bottom);
|
||||
}];
|
||||
|
||||
|
||||
[self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.leading.trailing.bottom.mas_equalTo(self.view);
|
||||
make.top.mas_equalTo(self.titleView.mas_bottom);
|
||||
@@ -178,7 +178,7 @@
|
||||
make.width.height.mas_equalTo(20);
|
||||
make.centerY.equalTo(self.openNobleView);
|
||||
make.trailing.equalTo(self.openNobleButton.mas_leading).mas_offset(-2);
|
||||
|
||||
|
||||
}];
|
||||
[self.rankBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(57);
|
||||
@@ -186,7 +186,7 @@
|
||||
make.trailing.mas_equalTo(-24);
|
||||
make.top.mas_equalTo(139);
|
||||
}];
|
||||
|
||||
|
||||
}
|
||||
#pragma mark - XPNobleCenterPayViewDelegate
|
||||
- (void)payWithType:(NobleCenterPayType)type{
|
||||
@@ -196,12 +196,11 @@
|
||||
config.message = YMLocalizedString(@"XPNobleCenterViewController3");
|
||||
config.actionStyle = TTAlertActionBothStyle;
|
||||
[TTPopup alertWithConfig:config showBorder:NO confirmHandler:^{
|
||||
|
||||
|
||||
XPIAPRechargeViewController * webVC =[[XPIAPRechargeViewController alloc] init];
|
||||
webVC.type = @"5";
|
||||
[self.navigationController pushViewController:webVC animated:YES];
|
||||
} cancelHandler:^{
|
||||
|
||||
|
||||
}];
|
||||
return;
|
||||
}
|
||||
@@ -239,8 +238,11 @@
|
||||
- (void)checkTranscationIds {
|
||||
NSString * uid = [AccountInfoStorage instance].getUid;
|
||||
NSArray * array = [RechargeStorage getAllReciptsWithUid:uid];
|
||||
if (array.count > 0) {
|
||||
[self.presenter checkTranscationIds:array];
|
||||
for (NSDictionary *transcation in array) {
|
||||
NSString *orderId = transcation[@"orderId"];
|
||||
NSString *transcationId = transcation[@"transcationId"];
|
||||
///二次验证
|
||||
[self.presenter checkReceiptWithOrderId:orderId transcationId:transcationId errorToast:NO];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -286,10 +288,45 @@
|
||||
}
|
||||
|
||||
///请求充值id的状态成功
|
||||
- (void)requestIAPRechargeOrderSuccess:(NSString *)orderId chargeProdId:(NSString *)chargeProdId {
|
||||
- (void)requestIAPRechargeOrderSuccess:(NSString *)orderId chargeProdId:(NSString *)chargeProdId uuid:(NSString *)uuid{
|
||||
if (orderId.length > 0) {
|
||||
self.orderId = orderId;
|
||||
[[XPIAPHelper shareHelper] buyAppProductWithAppProductId:chargeProdId];
|
||||
if (@available(iOS 15.0, *)) {
|
||||
|
||||
PIIAPManagers *iap = [PIIAPManagers shared];
|
||||
[iap requestBuyProductWithProductId:chargeProdId uuid:uuid completionHandler:^(NSError * _Nullable error) {
|
||||
|
||||
}];
|
||||
@kWeakify(self);
|
||||
iap.stateBlock = ^(enum StoreStateResult state, NSDictionary<NSString *,id> * _Nullable result) {
|
||||
@kStrongify(self);
|
||||
|
||||
[self rechargeNewProcessStatus:state];
|
||||
switch (state) {
|
||||
case StoreStateResultVerifiedServer:
|
||||
{
|
||||
NSString *transactionId = result[@"transactionId"];
|
||||
|
||||
[self rechargeSuccess:transactionId];
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
} else {
|
||||
[self hideHUD];
|
||||
[self showErrorToast:YMLocalizedString(@"XPIAPRechargeViewController10")];
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
[self hideHUD];
|
||||
}
|
||||
@@ -302,6 +339,13 @@
|
||||
|
||||
///二次校验成功
|
||||
- (void)checkReceiptSuccess:(NSString *)transcationId {
|
||||
[self hideHUD];
|
||||
if (@available(iOS 15.0, *)) {
|
||||
PIIAPManagers *iap = [PIIAPManagers shared];
|
||||
[iap transactionFinishWithTransaction:[NSString stringWithFormat:@"%@",transcationId] completionHandler:^{
|
||||
|
||||
}];
|
||||
}
|
||||
[self deleteRechageReciptWithTransactionIdentifier:transcationId];
|
||||
self.orderId = nil;
|
||||
//5秒之后如果没有收到开通成功的云信消息,则请求一次用户信息
|
||||
@@ -312,7 +356,18 @@
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
- (void)checkReceiptFailWithCode:(NSInteger)code transcationId:(NSString *)transcationId{
|
||||
[self hideHUD];
|
||||
if(code == 1444){
|
||||
if (@available(iOS 15.0, *)) {
|
||||
PIIAPManagers *iap = [PIIAPManagers shared];
|
||||
[iap transactionFinishWithTransaction:[NSString stringWithFormat:@"%@",transcationId] completionHandler:^{
|
||||
|
||||
}];
|
||||
}
|
||||
[self deleteRechageReciptWithTransactionIdentifier:transcationId];
|
||||
}
|
||||
}
|
||||
///删除本地保存的
|
||||
- (void)deleteRechageReciptWithTransactionIdentifier:(NSString *)transactionIdentifier {
|
||||
NSString * uid = [AccountInfoStorage instance].getUid;
|
||||
@@ -333,16 +388,15 @@
|
||||
}
|
||||
#pragma mark - XPIAPHelperDelegate
|
||||
///当前充值的状态
|
||||
- (void)rechargeProcessStatus:(PaymentStatus)status {
|
||||
- (void)rechargeNewProcessStatus:(StoreStateResult)status {
|
||||
[self hideHUD];
|
||||
if (status == PaymentStatus_Purchased) {
|
||||
|
||||
if (status == StoreStateResultPay || status == StoreStateResultStart || status == StoreStateResultVerifiedServer) {
|
||||
[self showLoading];
|
||||
} else if (status == PaymentStatus_Purchasing) {
|
||||
[self showLoading];
|
||||
} else if (status == PaymentStatus_Failed) {
|
||||
[self showErrorToast:YMLocalizedString(@"XPNobleCenterViewController1")];
|
||||
} else if (status == PaymentStatus_Deferred) {
|
||||
[self showErrorToast:YMLocalizedString(@"XPNobleCenterViewController2")];
|
||||
}else if (status == StoreStateResultUnowned) {
|
||||
[self showErrorToast:YMLocalizedString(@"XPIAPRechargeViewController1")];
|
||||
}else{
|
||||
[self showErrorToast:YMLocalizedString(@"XPIAPRechargeViewController0")];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -350,10 +404,9 @@
|
||||
- (void)rechargeSuccess:(NSString *)transactionIdentifier {
|
||||
///保存唯一凭证
|
||||
[self saveRechageReciptWithTransactionIdentifier:transactionIdentifier];
|
||||
NSData *receiptData = [NSData dataWithContentsOfURL:[[NSBundle mainBundle] appStoreReceiptURL]];
|
||||
NSString * receipt = [MF_Base64Codec base64StringFromData:receiptData];
|
||||
[self showLoading];
|
||||
///二次验证
|
||||
[self.presenter checkReceiptWithData:receipt orderId:self.orderId transcationId:transactionIdentifier];
|
||||
[self.presenter checkReceiptWithOrderId:self.orderId transcationId:transactionIdentifier errorToast:YES];
|
||||
}
|
||||
|
||||
///充值成功之后保存订单到钥匙串
|
||||
@@ -443,7 +496,7 @@
|
||||
payView.delegate = self;
|
||||
[self.view addSubview:payView];
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
@@ -520,7 +573,7 @@
|
||||
_openNobleButton.textColor = [DJDKMIMOMColor mainTextColor];
|
||||
_openNobleButton.numberOfLines = 0;
|
||||
_openNobleButton.textAlignment = NSTextAlignmentCenter;
|
||||
|
||||
|
||||
}
|
||||
return _openNobleButton;
|
||||
}
|
||||
|
@@ -13,7 +13,6 @@
|
||||
#import "DJDKMIMOMColor.h"
|
||||
#import "YUMIMacroUitls.h"
|
||||
#import "YUMIHtmlUrl.h"
|
||||
#import "XPIAPHelper.h"
|
||||
#import "RechargeStorage.h"
|
||||
#import "AccountInfoStorage.h"
|
||||
#import "NSObject+MJExtension.h"
|
||||
@@ -34,9 +33,10 @@
|
||||
#import "SessionViewController.h"
|
||||
#import "ClientConfig.h"
|
||||
#import "Api+Main.h"
|
||||
#import "YuMi-swift.h"
|
||||
#define kHeaderViewHeight 220.0/375.0*KScreenWidth
|
||||
|
||||
@interface XPIAPRechargeViewController ()<UICollectionViewDelegate, UICollectionViewDataSource,UICollectionViewDelegateFlowLayout, XPMineRechargeProtocol, XPIAPHelperDelegate, XPMineRechargeNavViewDelegate,XPIAPRechargeHeadCellDelegate>
|
||||
@interface XPIAPRechargeViewController ()<UICollectionViewDelegate, UICollectionViewDataSource,UICollectionViewDelegateFlowLayout, XPMineRechargeProtocol, XPMineRechargeNavViewDelegate,XPIAPRechargeHeadCellDelegate>
|
||||
|
||||
@property (nonatomic, strong) UICollectionView *collectionView;
|
||||
/// 头部
|
||||
@@ -72,7 +72,7 @@
|
||||
@implementation XPIAPRechargeViewController
|
||||
|
||||
- (void)dealloc {
|
||||
[XPIAPHelper shareHelper].delegate = nil;
|
||||
|
||||
}
|
||||
|
||||
- (BOOL)isHiddenNavBar {
|
||||
@@ -113,7 +113,6 @@
|
||||
if(is == YES){
|
||||
[self createUI];
|
||||
[self initHttpData];
|
||||
[XPIAPHelper shareHelper].delegate = self;
|
||||
return;
|
||||
}
|
||||
XPWebViewController *vc = [[XPWebViewController alloc]init];
|
||||
@@ -249,9 +248,32 @@
|
||||
- (void)checkTranscationIds {
|
||||
NSString * uid = [AccountInfoStorage instance].getUid;
|
||||
NSArray * array = [RechargeStorage getAllReciptsWithUid:uid];
|
||||
if (array.count > 0) {
|
||||
[self.presenter checkTranscationIds:array];
|
||||
|
||||
// [self.presenter checkReceiptWithOrderId:self.orderId transcationId:transactionIdentifier];
|
||||
// NSMutableArray *list = [NSMutableArray array];
|
||||
// for (NSDictionary *transcationDic in array) {
|
||||
// NSString *transcationId = transcationDic[@"transcationId"];
|
||||
// if(transcationId){
|
||||
// [list addObject:transcationId];
|
||||
// }
|
||||
// }
|
||||
// if(list.count > 0){
|
||||
// if (@available(iOS 15.0, *)) {
|
||||
// PIIAPManagers *iap = [PIIAPManagers shared];
|
||||
// [iap allTransactionWithList:list completionHandler:^{
|
||||
//
|
||||
// }];
|
||||
//
|
||||
// }
|
||||
// }
|
||||
|
||||
for (NSDictionary *transcation in array) {
|
||||
NSString *orderId = transcation[@"orderId"];
|
||||
NSString *transcationId = transcation[@"transcationId"];
|
||||
///二次验证
|
||||
[self.presenter checkReceiptWithOrderId:orderId transcationId:transcationId errorToast:NO];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
///充值成功之后保存订单到钥匙串
|
||||
@@ -286,16 +308,15 @@
|
||||
|
||||
#pragma mark - XPIAPHelperDelegate
|
||||
///当前充值的状态
|
||||
- (void)rechargeProcessStatus:(PaymentStatus)status {
|
||||
- (void)rechargeNewProcessStatus:(StoreStateResult)status {
|
||||
[self hideHUD];
|
||||
if (status == PaymentStatus_Purchased) {
|
||||
|
||||
if (status == StoreStateResultPay || status == StoreStateResultStart || status == StoreStateResultVerifiedServer) {
|
||||
[self showLoading];
|
||||
} else if (status == PaymentStatus_Purchasing) {
|
||||
[self showLoading];
|
||||
} else if (status == PaymentStatus_Failed) {
|
||||
[self showErrorToast:YMLocalizedString(@"XPIAPRechargeViewController0")];
|
||||
} else if (status == PaymentStatus_Deferred) {
|
||||
}else if (status == StoreStateResultUnowned) {
|
||||
[self showErrorToast:YMLocalizedString(@"XPIAPRechargeViewController1")];
|
||||
}else{
|
||||
[self showErrorToast:YMLocalizedString(@"XPIAPRechargeViewController0")];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -303,22 +324,62 @@
|
||||
- (void)rechargeSuccess:(NSString *)transactionIdentifier {
|
||||
///保存唯一凭证
|
||||
[self saveRechageReciptWithTransactionIdentifier:transactionIdentifier];
|
||||
NSData *receiptData = [NSData dataWithContentsOfURL:[[NSBundle mainBundle] appStoreReceiptURL]];
|
||||
NSString * receipt = [MF_Base64Codec base64StringFromData:receiptData];
|
||||
[self showLoading];
|
||||
///二次验证
|
||||
[self.presenter checkReceiptWithData:receipt orderId:self.orderId transcationId:transactionIdentifier];
|
||||
}
|
||||
[self.presenter checkReceiptWithOrderId:self.orderId transcationId:transactionIdentifier errorToast:YES];
|
||||
|
||||
}
|
||||
#pragma mark - XPMineRechargeProtocol
|
||||
- (void)requestRechargeListSucccess:(NSArray *)list {
|
||||
self.dataSource = list;
|
||||
[self.collectionView reloadData];
|
||||
}
|
||||
|
||||
- (void)requestIAPRechargeOrderSuccess:(NSString *)orderId chargeProdId:(NSString *)chargeProdId {
|
||||
- (void)requestIAPRechargeOrderSuccess:(NSString *)orderId chargeProdId:(NSString *)chargeProdId uuid:(nonnull NSString *)uuid{
|
||||
|
||||
if (orderId.length > 0) {
|
||||
|
||||
self.orderId = orderId;
|
||||
[[XPIAPHelper shareHelper] buyAppProductWithAppProductId:chargeProdId];
|
||||
if (@available(iOS 15.0, *)) {
|
||||
|
||||
PIIAPManagers *iap = [PIIAPManagers shared];
|
||||
[iap requestBuyProductWithProductId:chargeProdId uuid:uuid completionHandler:^(NSError * _Nullable error) {
|
||||
|
||||
}];
|
||||
@kWeakify(self);
|
||||
iap.stateBlock = ^(enum StoreStateResult state, NSDictionary<NSString *,id> * _Nullable result) {
|
||||
@kStrongify(self);
|
||||
|
||||
[self rechargeNewProcessStatus:state];
|
||||
switch (state) {
|
||||
case StoreStateResultVerifiedServer:
|
||||
{
|
||||
NSString *transactionId = result[@"transactionId"];
|
||||
|
||||
[self rechargeSuccess:transactionId];
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
} else {
|
||||
[self hideHUD];
|
||||
[self showErrorToast:YMLocalizedString(@"XPIAPRechargeViewController10")];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}else{
|
||||
[self hideHUD];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -352,7 +413,15 @@
|
||||
}
|
||||
///二次验证成功
|
||||
- (void)checkReceiptSuccess:(NSString *)transcationId {
|
||||
[self hideHUD];
|
||||
if (@available(iOS 15.0, *)) {
|
||||
PIIAPManagers *iap = [PIIAPManagers shared];
|
||||
[iap transactionFinishWithTransaction:[NSString stringWithFormat:@"%@",transcationId] completionHandler:^{
|
||||
|
||||
}];
|
||||
}
|
||||
[self deleteRechageReciptWithTransactionIdentifier:transcationId];
|
||||
|
||||
///刷新一下用户的💎
|
||||
[self getUserWalletBalanceInfo];
|
||||
self.orderId = nil;
|
||||
@@ -361,7 +430,18 @@
|
||||
[self.delegate paySuccess];
|
||||
}
|
||||
}
|
||||
|
||||
-(void)checkReceiptFailWithCode:(NSInteger)code transcationId:(NSString *)transcationId{
|
||||
[self hideHUD];
|
||||
if(code == 1444){
|
||||
if (@available(iOS 15.0, *)) {
|
||||
PIIAPManagers *iap = [PIIAPManagers shared];
|
||||
[iap transactionFinishWithTransaction:[NSString stringWithFormat:@"%@",transcationId] completionHandler:^{
|
||||
|
||||
}];
|
||||
}
|
||||
[self deleteRechageReciptWithTransactionIdentifier:transcationId];
|
||||
}
|
||||
}
|
||||
- (void)getUserWalletInfo:(WalletInfoModel *)balanceInfo {
|
||||
self.headerView.walletInfo = balanceInfo;
|
||||
}
|
||||
|
@@ -208,7 +208,7 @@
|
||||
NSData *receiptData = [NSData dataWithContentsOfURL:[[NSBundle mainBundle] appStoreReceiptURL]];
|
||||
NSString * receipt = [MF_Base64Codec base64StringFromData:receiptData];
|
||||
///二次验证
|
||||
[self.presenter checkReceiptWithData:receipt orderId:self.orderId transcationId:transactionIdentifier];
|
||||
// [self.presenter checkReceiptWithData:receipt orderId:self.orderId transcationId:transactionIdentifier];
|
||||
}
|
||||
|
||||
#pragma mark - XPMineRechargeProtocol
|
||||
|
@@ -48,7 +48,7 @@
|
||||
///名字
|
||||
@property (nonatomic,strong) UILabel *nameLabel;
|
||||
///sex
|
||||
@property (nonatomic,strong) UIImageView *sexImageView;
|
||||
@property (nonatomic,strong) UIButton *sexImageView;
|
||||
|
||||
///正在直播父图
|
||||
@property (nonatomic,strong) UIImageView *onlineView;
|
||||
@@ -300,7 +300,7 @@
|
||||
}];
|
||||
|
||||
[self.sexImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(14, 14));
|
||||
make.size.mas_equalTo(CGSizeMake(28, 14));
|
||||
}];
|
||||
|
||||
|
||||
@@ -574,7 +574,8 @@
|
||||
|
||||
self.signLabel.text = _userInfo.userDesc.length > 0 ? _userInfo.userDesc : YMLocalizedString(@"XPTreasureFairyFriendCell0");
|
||||
self.fansNumLabel.text =[NSString stringWithFormat:YMLocalizedString(@"XPMineUserInfoHeaderView2"), _userInfo.fansNum];
|
||||
self.sexImageView.image = userInfo.gender == GenderType_Female ? [UIImage imageNamed:@"common_female"] : [UIImage imageNamed:@"common_male"];
|
||||
[self.sexImageView setTitle:[NSString getAgeWithBirth:_userInfo.birth] forState:UIControlStateNormal];
|
||||
self.sexImageView.backgroundColor = _userInfo.gender == GenderType_Male ? UIColorFromRGB(0x6BB3FF) :UIColorFromRGB(0xFF80CC);
|
||||
self.officalImageView.hidden = userInfo.defUser != UserLevelType_Offical;
|
||||
self.beautifulImageViw.hidden = !userInfo.hasPrettyErbanNo;
|
||||
self.newUserImageView.hidden = !userInfo.newUser;
|
||||
@@ -729,10 +730,16 @@
|
||||
return _nameLabel;
|
||||
}
|
||||
|
||||
- (UIImageView *)sexImageView {
|
||||
- (UIButton *)sexImageView {
|
||||
if (!_sexImageView) {
|
||||
_sexImageView = [[UIImageView alloc] init];
|
||||
_sexImageView.userInteractionEnabled = YES;
|
||||
_sexImageView = [[UIButton alloc] init];
|
||||
[_sexImageView setImage:kImage(@"home_age_boy_icon") forState:UIControlStateNormal];
|
||||
[_sexImageView setImage:kImage(@"home_age_girl_icon") forState:UIControlStateSelected];
|
||||
_sexImageView.titleLabel.font = [UIFont systemFontOfSize:10 weight:UIFontWeightMedium];
|
||||
[_sexImageView setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
||||
_sexImageView.imageEdgeInsets = UIEdgeInsetsMake(0, 2, 0, 0);
|
||||
_sexImageView.layer.cornerRadius = 14/2;
|
||||
_sexImageView.layer.masksToBounds = YES;
|
||||
}
|
||||
return _sexImageView;
|
||||
}
|
||||
|
@@ -36,7 +36,7 @@
|
||||
///id
|
||||
@property (nonatomic,strong) UILabel *idLabel;
|
||||
///性别
|
||||
@property (nonatomic,strong) UIImageView *sexImageView;
|
||||
@property (nonatomic,strong) UIButton *sexImageView;
|
||||
///星座
|
||||
@property(nonatomic,strong) UIImageView *starVeiw;
|
||||
|
||||
@@ -118,8 +118,12 @@
|
||||
make.height.mas_equalTo(16);
|
||||
}];
|
||||
[self.starVeiw mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(47);
|
||||
make.height.mas_equalTo(17);
|
||||
make.width.mas_equalTo(46);
|
||||
make.height.mas_equalTo(18);
|
||||
}];
|
||||
[self.sexImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(28);
|
||||
make.height.mas_equalTo(14);
|
||||
}];
|
||||
[self.levelLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.nobleImageView);
|
||||
@@ -213,35 +217,7 @@
|
||||
return day;
|
||||
}
|
||||
|
||||
- (NSString *)calculateConstellationWithMonth:(long)time
|
||||
{
|
||||
NSString *astroString = YMLocalizedString(@"XPMineHeadView0");
|
||||
NSString *astroFormat = @"102123444543";
|
||||
NSString *result;
|
||||
|
||||
NSInteger month = [self getMonth:time];
|
||||
NSInteger day = [self getDay:time];
|
||||
|
||||
if (month<1 || month>12 || day<1 || day>31){
|
||||
return YMLocalizedString(@"XPMineHeadView1");
|
||||
}
|
||||
|
||||
if(month==2 && day>29)
|
||||
{
|
||||
return YMLocalizedString(@"XPMineHeadView2");
|
||||
}else if(month==4 || month==6 || month==9 || month==11) {
|
||||
if (day>30) {
|
||||
return YMLocalizedString(@"XPMineHeadView3");
|
||||
}
|
||||
}
|
||||
|
||||
result=[NSString stringWithFormat:@"%@",[astroString substringWithRange:NSMakeRange(month*2-(day < [[astroFormat substringWithRange:NSMakeRange((month-1), 1)] intValue] - (-19))*2,2)]];
|
||||
NSDictionary *starDic = @{YMLocalizedString(@"XPMineHeadView9"):@"pi_capricorn",YMLocalizedString(@"XPMineHeadView10"):@"pi_water_bottle",YMLocalizedString(@"XPMineHeadView11"):@"pi_pisces",YMLocalizedString(@"XPMineHeadView12"):@"pi_aries",YMLocalizedString(@"XPMineHeadView13"):@"pi_taurus",YMLocalizedString(@"XPMineHeadView14"):@"pi_gemini",YMLocalizedString(@"XPMineHeadView15"):@"pi_cancer",YMLocalizedString(@"XPMineHeadView16"):@"pi_lion",YMLocalizedString(@"XPMineHeadView17"):@"pi_virgin",YMLocalizedString(@"XPMineHeadView18"):@"pi_libra",YMLocalizedString(@"XPMineHeadView19"):@"pi_scorpion",YMLocalizedString(@"XPMineHeadView20"):@"pi_shooter"};
|
||||
|
||||
|
||||
|
||||
return starDic[result];
|
||||
}
|
||||
|
||||
/// 生成一个图片的富文本
|
||||
/// @param imageUrl 网络图片的地址
|
||||
@@ -278,20 +254,7 @@
|
||||
return attribute;
|
||||
}
|
||||
|
||||
//dateLabel
|
||||
- (NSMutableAttributedString *)makeDateLabel:(long)birth{
|
||||
NSString *dateStr = [NSString stringWithFormat:@" %@ ",[self calculateConstellationWithMonth:birth]];
|
||||
UIButton *dataButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[dataButton setTitle:dateStr forState:UIControlStateNormal];
|
||||
dataButton.titleLabel.font = [UIFont boldSystemFontOfSize:10];
|
||||
[dataButton setTitleColor:UIColorFromRGB(0xFFFFFF) forState:UIControlStateNormal];
|
||||
dataButton.frame = CGRectMake(0, 0, 45, 17);
|
||||
dataButton.layer.masksToBounds = YES;
|
||||
dataButton.layer.cornerRadius = 17/2;
|
||||
[dataButton setBackgroundImage:[UIImage gradientColorImageFromColors:@[[DJDKMIMOMColor confirmButtonGradientStartColor], [DJDKMIMOMColor confirmButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)] forState:UIControlStateNormal];
|
||||
NSMutableAttributedString * dateLabelString = [NSMutableAttributedString yy_attachmentStringWithContent:dataButton contentMode:UIViewContentModeScaleAspectFit attachmentSize:CGSizeMake(dataButton.frame.size.width, dataButton.frame.size.height) alignToFont:[UIFont systemFontOfSize:11] alignment:YYTextVerticalAlignmentCenter];
|
||||
return dateLabelString;
|
||||
}
|
||||
|
||||
|
||||
///铭牌
|
||||
- (NSMutableAttributedString *)createNameplateAttibute:(NSString *)tagName image:(NSString *)imageName textFont:(UIFont *)textFont {
|
||||
@@ -425,14 +388,17 @@
|
||||
make.left.mas_equalTo(self.nobleImageView.mas_right);
|
||||
}];
|
||||
}
|
||||
NSString * sexName;
|
||||
if (userInfo.gender == GenderType_Male) {
|
||||
sexName = @"common_male";
|
||||
} else {
|
||||
sexName = @"common_female";
|
||||
}
|
||||
self.starVeiw.text = [NSString stringWithFormat:@" %@ ",[self calculateConstellationWithMonth:_userInfo.birth]];
|
||||
self.sexImageView.image = [UIImage imageNamed:sexName];
|
||||
|
||||
NSString *starImage = [NSString
|
||||
getCalculateConstellationImageWithMonth:_userInfo.birth];
|
||||
if(starImage.length > 0){
|
||||
self.starVeiw.image = kImage(starImage);
|
||||
}
|
||||
|
||||
|
||||
[self.sexImageView setTitle:[NSString getAgeWithBirth:userInfo.birth] forState:UIControlStateNormal];
|
||||
self.sexImageView.hidden = NO;
|
||||
self.sexImageView.backgroundColor = userInfo.gender == GenderType_Male ? UIColorFromRGB(0x6BB3FF) :UIColorFromRGB(0xFF80CC);
|
||||
self.levelLabel.attributedText = _userInfo.levelAtt;
|
||||
self.fansView.number = [NSString stringWithFormat:@"%ld",_userInfo.fansNum];
|
||||
self.attentionView.number = [NSString stringWithFormat:@"%ld",_userInfo.followNum];
|
||||
@@ -510,10 +476,18 @@
|
||||
return _idLabel;
|
||||
}
|
||||
|
||||
- (UIImageView *)sexImageView {
|
||||
- (UIButton *)sexImageView {
|
||||
if (!_sexImageView) {
|
||||
_sexImageView = [[UIImageView alloc] init];
|
||||
_sexImageView.userInteractionEnabled = YES;
|
||||
_sexImageView = [[UIButton alloc] init];
|
||||
[_sexImageView setImage:kImage(@"home_age_boy_icon") forState:UIControlStateNormal];
|
||||
[_sexImageView setImage:kImage(@"home_age_girl_icon") forState:UIControlStateSelected];
|
||||
_sexImageView.titleLabel.font = [UIFont systemFontOfSize:10 weight:UIFontWeightMedium];
|
||||
[_sexImageView setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
||||
_sexImageView.imageEdgeInsets = UIEdgeInsetsMake(0, 2, 0, 0);
|
||||
_sexImageView.layer.cornerRadius = 14/2;
|
||||
_sexImageView.layer.masksToBounds = YES;
|
||||
_sexImageView.hidden = YES;
|
||||
|
||||
}
|
||||
return _sexImageView;
|
||||
}
|
||||
|
Reference in New Issue
Block a user