diff --git a/xplan-ios.xcodeproj/project.pbxproj b/xplan-ios.xcodeproj/project.pbxproj index ac4bc39f..e46b9811 100644 --- a/xplan-ios.xcodeproj/project.pbxproj +++ b/xplan-ios.xcodeproj/project.pbxproj @@ -137,6 +137,7 @@ 9B92A3442797EE6500AD168F /* XPMatchManagePresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B92A3432797EE6500AD168F /* XPMatchManagePresenter.m */; }; 9B92A3472797EECD00AD168F /* XPMatchManageViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B92A3462797EECD00AD168F /* XPMatchManageViewController.m */; }; 9B92A34A2797F35E00AD168F /* XPMatchManageTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B92A3492797F35E00AD168F /* XPMatchManageTableViewCell.m */; }; + 9B92A3392797BE4500AD168F /* XPMineSkillTipView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B92A3382797BE4500AD168F /* XPMineSkillTipView.m */; }; 9BAA5FED277A1BBE007453F3 /* XPPrivacyViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BAA5FEC277A1BBE007453F3 /* XPPrivacyViewController.m */; }; 9BAA5FF0277A23F4007453F3 /* XPPermissionsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BAA5FEF277A23F4007453F3 /* XPPermissionsViewController.m */; }; 9BB549592782E6A30090CD26 /* XPNobleCenterPresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BB549582782E6A30090CD26 /* XPNobleCenterPresenter.m */; }; @@ -770,6 +771,8 @@ 9B92A3462797EECD00AD168F /* XPMatchManageViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMatchManageViewController.m; sourceTree = ""; }; 9B92A3482797F35E00AD168F /* XPMatchManageTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMatchManageTableViewCell.h; sourceTree = ""; }; 9B92A3492797F35E00AD168F /* XPMatchManageTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMatchManageTableViewCell.m; sourceTree = ""; }; + 9B92A3372797BE4500AD168F /* XPMineSkillTipView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineSkillTipView.h; sourceTree = ""; }; + 9B92A3382797BE4500AD168F /* XPMineSkillTipView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineSkillTipView.m; sourceTree = ""; }; 9BAA5FEB277A1BBE007453F3 /* XPPrivacyViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPPrivacyViewController.h; sourceTree = ""; }; 9BAA5FEC277A1BBE007453F3 /* XPPrivacyViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPPrivacyViewController.m; sourceTree = ""; }; 9BAA5FEE277A23F4007453F3 /* XPPermissionsViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPPermissionsViewController.h; sourceTree = ""; }; @@ -4164,6 +4167,8 @@ E824544D26F5BC1A00BE8163 /* XPMineModifPayPwdView.m */, E824545726F5E65900BE8163 /* XPMineVerifIdentityView.h */, E824545826F5E65900BE8163 /* XPMineVerifIdentityView.m */, + 9B92A3372797BE4500AD168F /* XPMineSkillTipView.h */, + 9B92A3382797BE4500AD168F /* XPMineSkillTipView.m */, ); path = SubViews; sourceTree = ""; @@ -4558,6 +4563,7 @@ E824544326F58FCE00BE8163 /* XPMinePayPwdInputView.m in Sources */, 1808073027315E8E001FD836 /* NetImageView.m in Sources */, 18486235271EB794005FC5DC /* AgoraRtcImpl.m in Sources */, + 9B92A3392797BE4500AD168F /* XPMineSkillTipView.m in Sources */, E8A1E454276208E500B294CA /* CandyTreeInfoModel.m in Sources */, E8C1CD7A27D8B29E00376F83 /* RoomFaceInfoModel.m in Sources */, E81C1B1C27705F6B0020D1E4 /* XPArrangeMicPresenter.m in Sources */, diff --git a/xplan-ios/Assets.xcassets/Mine/mine_skillCard_guild.imageset/Contents.json b/xplan-ios/Assets.xcassets/Mine/mine_skillCard_guild.imageset/Contents.json new file mode 100644 index 00000000..3b3add14 --- /dev/null +++ b/xplan-ios/Assets.xcassets/Mine/mine_skillCard_guild.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "mine_skillCard_guild@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "mine_skillCard_guild@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/xplan-ios/Assets.xcassets/Mine/mine_skillCard_guild.imageset/mine_skillCard_guild@2x.png b/xplan-ios/Assets.xcassets/Mine/mine_skillCard_guild.imageset/mine_skillCard_guild@2x.png new file mode 100644 index 00000000..ff02ab7a Binary files /dev/null and b/xplan-ios/Assets.xcassets/Mine/mine_skillCard_guild.imageset/mine_skillCard_guild@2x.png differ diff --git a/xplan-ios/Assets.xcassets/Mine/mine_skillCard_guild.imageset/mine_skillCard_guild@3x.png b/xplan-ios/Assets.xcassets/Mine/mine_skillCard_guild.imageset/mine_skillCard_guild@3x.png new file mode 100644 index 00000000..8415c2b0 Binary files /dev/null and b/xplan-ios/Assets.xcassets/Mine/mine_skillCard_guild.imageset/mine_skillCard_guild@3x.png differ diff --git a/xplan-ios/Main/Mine/View/SubViews/XPMineSkillTipView.h b/xplan-ios/Main/Mine/View/SubViews/XPMineSkillTipView.h new file mode 100644 index 00000000..5f0c50e8 --- /dev/null +++ b/xplan-ios/Main/Mine/View/SubViews/XPMineSkillTipView.h @@ -0,0 +1,19 @@ +// +// XPMineSkillTipView.h +// xplan-ios +// +// Created by GreenLand on 2022/1/19. +// + +#import + +static NSString * const kYinyouSkillCardTipKey = @"kYinyouSkillCardTipKey"; + +NS_ASSUME_NONNULL_BEGIN + + +@interface XPMineSkillTipView : UIView + +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Mine/View/SubViews/XPMineSkillTipView.m b/xplan-ios/Main/Mine/View/SubViews/XPMineSkillTipView.m new file mode 100644 index 00000000..e29281bc --- /dev/null +++ b/xplan-ios/Main/Mine/View/SubViews/XPMineSkillTipView.m @@ -0,0 +1,85 @@ +// +// XPMineSkillTipView.m +// xplan-ios +// +// Created by GreenLand on 2022/1/19. +// + +#import "XPMineSkillTipView.h" +///Third +#import +///Tool +#import "ThemeColor.h" +#import "XPMacro.h" + +@interface XPMineSkillTipView() + +@property (nonatomic, strong) UIView *bgView; + +@property (nonatomic, strong) UIImageView *tipImageView; + +@end + +@implementation XPMineSkillTipView + +- (instancetype)initWithFrame:(CGRect)frame { + self = [super initWithFrame:frame]; + if (self) { + [self initSubViews]; + [self initSubViewConstraints]; + } + return self; +} + +#pragma mark - Response +- (void)onTapSkillTip:(UITapGestureRecognizer *)ges { + NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; + [defaults setObject:@"isShow" forKey:kYinyouSkillCardTipKey]; + [defaults synchronize]; + [self removeFromSuperview]; +} + +#pragma mark - Private Method +- (void)initSubViews { + [self addSubview:self.bgView]; + [self addSubview:self.tipImageView]; + UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onTapSkillTip:)]; + [self.tipImageView addGestureRecognizer:tap]; +} + +- (void)initSubViewConstraints { + CGFloat nobleH = (KScreenWidth - 30.0)/ 345.0 * 44; + [self.bgView mas_makeConstraints:^(MASConstraintMaker *make) { + make.edges.mas_equalTo(0); + }]; + + CGFloat margin = ((KScreenWidth - 30) / 3 - 40) * 0.5 * 0.5; + CGFloat mutiple = 405/292.0; + [self.tipImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(123 + nobleH + kSafeAreaTopHeight + kStatusBarHeight); + make.centerX.mas_equalTo(self); +// make.width.mas_equalTo(292); +// make.height.mas_equalTo(405); + make.height.mas_equalTo(self.tipImageView.mas_width).multipliedBy(mutiple); + make.right.mas_equalTo(-15 - margin); + }]; +} + +- (UIView *)bgView { + if (!_bgView) { + _bgView = [[UIView alloc] init]; + _bgView.backgroundColor = [ThemeColor tabbarNormalColor]; + } + return _bgView; +} + +- (UIImageView *)tipImageView { + if (!_tipImageView) { + _tipImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"mine_skillCard_guild"]]; + _tipImageView.contentMode = UIViewContentModeScaleAspectFit; + _tipImageView.userInteractionEnabled = YES; + } + return _tipImageView; +} + +@end diff --git a/xplan-ios/Main/Mine/View/XPMineViewController.m b/xplan-ios/Main/Mine/View/XPMineViewController.m index ae4fdcf1..4a269b06 100644 --- a/xplan-ios/Main/Mine/View/XPMineViewController.m +++ b/xplan-ios/Main/Mine/View/XPMineViewController.m @@ -24,6 +24,7 @@ #import "XPMineMenuTableViewCell.h" #import "XPMineHeadItemTableViewCell.h" #import "XPMineHeadView.h" +#import "XPMineSkillTipView.h" ///VC #import "XPMineSettingViewController.h" #import "XPMineTeenagerViewController.h" @@ -55,6 +56,8 @@ /// @property (nonatomic,strong) UserInfoModel *userInfo; +@property (nonatomic, strong) XPMineSkillTipView *skillTipView; + @end @implementation XPMineViewController @@ -71,6 +74,7 @@ [super viewDidLoad]; [self initSubViews]; [self initSubViewConstraints]; + [self showSkillCardTipView]; } - (void)viewWillAppear:(BOOL)animated { @@ -93,6 +97,9 @@ self.tableView.tableHeaderView = self.headView; [self.presenter getNormalItems]; [self.presenter getCardItems]; + if (@available(iOS 15.0, *)) {//移除iOS15列表头默认增加的22高度 + self.tableView.sectionHeaderTopPadding = 0; + } } - (void)initSubViewConstraints { @@ -111,6 +118,17 @@ }]; } +///展示技能卡引导 +- (void)showSkillCardTipView { + NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; + NSString *skillCardTip = [defaults objectForKey:kYinyouSkillCardTipKey]; + if (!skillCardTip) { + UIWindow *window = [UIApplication sharedApplication].delegate.window; + [window addSubview:self.skillTipView]; + [window bringSubviewToFront:self.skillTipView]; + } +} + - (void)pushViewControllerWithType:(XPMineItemType)type { switch (type) { case XPMineItemType_Match_Manage: { @@ -250,9 +268,9 @@ - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section { if (section == 1) { - return 0; + return 13; } - return 0; + return 16; } - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { @@ -307,6 +325,7 @@ - (void)onGetUserInfoSuccess:(UserInfoModel *)userInfo { self.userInfo = userInfo; self.headView.userInfo = userInfo; + [self.tableView reloadData]; } #pragma mark - XPMineHeadItemTableViewCellDelegate @@ -357,4 +376,11 @@ return _bgImageView; } +- (XPMineSkillTipView *)skillTipView { + if (!_skillTipView) { + _skillTipView = [[XPMineSkillTipView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight)]; + } + return _skillTipView; +} + @end