Commit cc24e7cb authored by lihaiwei's avatar lihaiwei

feat [] 个人中心改造

parent 51e3cbab
Pipeline #448 failed with stages
......@@ -5,7 +5,7 @@
"scale" : "1x"
},
{
"filename" : "bg_my.png",
"filename" : "ic_video-disc@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
......
......@@ -5,11 +5,11 @@
"scale" : "1x"
},
{
"filename" : "ic_my_avat.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "mine_header_bg@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
......
......@@ -33,6 +33,7 @@
#import "NSArray+Safe.h"
#import "NSNotificationCenter+Safe.h"
#import "NSUserDefaults+Safe.h"
#import "UIColor+SPHex.h"
#endif /* PrefixHeader_pch */
......@@ -74,11 +74,7 @@
[self.navigationController pushViewController:feedbackController animated:YES];
}
break;
// case 2:{
// SPOrdersViewController * order = [[SPOrdersViewController alloc]init];
// [self.navigationController pushViewController:order animated:YES];
// }
// break;
case 2:{
MTSettingsController * settingsController = [[MTSettingsController alloc]init];
settingsController.delegate = self;
......@@ -87,20 +83,6 @@
[self.navigationController pushViewController:settingsController animated:YES];
}
break;
// case 4:{
// UIAlertController * sheet = [UIAlertController alertControllerWithTitle:@"客服联系方式" message:@"点击拨打" preferredStyle:UIAlertControllerStyleActionSheet];
// UIAlertAction * phone = [UIAlertAction actionWithTitle:@"4000969950" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
// NSString * phoneString = @"telprompt://4000969950";
// [[UIApplication sharedApplication] openURL:[NSURL URLWithString:phoneString] options:@{} completionHandler:nil];
// }];
// UIAlertAction * cancel = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
//
// }];
// [sheet addAction:phone];
// [sheet addAction:cancel];
// [self presentViewController:sheet animated:YES completion:nil];
// }
// break;
default:
break;
}
......@@ -143,11 +125,14 @@
make.left.top.right.equalTo(self.view);
make.height.mas_equalTo(160);
}];
[self.unlockVipView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.view).offset(10);
make.top.equalTo(self.headerView.mas_bottom);
make.right.equalTo(self.view).offset(-10);
make.height.mas_equalTo(165);
}];
[self.listView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.equalTo(self.unlockVipView);
make.top.equalTo(self.unlockVipView.mas_bottom).offset(15);
......
......@@ -7,6 +7,7 @@
//
#import "MTMineHeaderCustomView.h"
#import "YYLabel.h"
@interface MTMineHeaderCustomView ()
......@@ -20,6 +21,9 @@
@property (nonatomic, strong) UIImageView * bindPhoneIcon;
@property (nonatomic, strong) YYLabel * bindLabel;
@end
@implementation MTMineHeaderCustomView
......@@ -31,10 +35,12 @@
[self.bgImageView addSubview:self.headerIcon];
[self.bgImageView addSubview:self.userIdLabel];
[self.bgImageView addSubview:self.phoneLabel];
[self.bgImageView addSubview:self.bindPhoneIcon];
// [self.bgImageView addSubview:self.bindPhoneIcon];
[self.bgImageView addSubview:self.bindLabel];
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.left.right.equalTo(self);
make.top.left.right.bottom.equalTo(self);
}];
[self.headerIcon mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.bgImageView).with.offset(30);
......@@ -53,12 +59,13 @@
make.bottom.equalTo(self.headerIcon).offset(-7);
}];
[self.bindPhoneIcon mas_makeConstraints:^(MASConstraintMaker *make) {
[self.bindLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.phoneLabel.mas_right).offset(10);
make.centerY.equalTo(self.phoneLabel);
make.height.mas_equalTo(19);
}];
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(headerDidClicked)];
[self.bgImageView addGestureRecognizer:tap];
......@@ -77,11 +84,7 @@
- (void)setUserInfo:(MTUserInfoBean *)userInfo{
_userInfo = userInfo;
self.userIdLabel.text = [NSString stringWithFormat:@"用户ID:%@",userInfo.idcode];
if (userInfo.head) {
[self.headerIcon sd_setImageWithURL:[NSURL URLWithString:userInfo.head] placeholderImage:[UIImage imageNamed:@"ic_my_avat"]];
}else{
self.headerIcon.image = [UIImage imageNamed:@"ic_my_avat"];
}
[self.headerIcon sd_setImageWithURL:[NSURL URLWithString:userInfo.head? : @""] placeholderImage:[UIImage imageNamed:@"ic_video-disc"]];
if (userInfo.mobile.length > 0) {
self.bindPhoneIcon.hidden = YES;
......@@ -95,7 +98,7 @@
- (UIImageView *)bgImageView{
if (!_bgImageView) {
_bgImageView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"bg_my"]];
_bgImageView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"mine_header_bg"]];
_bgImageView.userInteractionEnabled = YES;
}
return _bgImageView;
......@@ -103,7 +106,7 @@
- (UIImageView *)headerIcon{
if (!_headerIcon) {
_headerIcon = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"ic_my_avat"]];
_headerIcon = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"ic_video-disc"]];
}
return _headerIcon;
}
......@@ -131,4 +134,17 @@
return _bindPhoneIcon;
}
- (YYLabel *)bindLabel{
if (!_bindLabel) {
_bindLabel = [YYLabel new];
_bindLabel.text = @"绑定账号";
_bindLabel.textColor = [UIColor colorFromHexCode:@"#784CFA"];
_bindLabel.backgroundColor = [UIColor colorWithRed:120/255.0 green:76.0/255.0 blue:250.0/255 alpha:0.2];
_bindLabel.textContainerInset = UIEdgeInsetsMake(5, 10, 5, 10);
_bindLabel.font = [UIFont systemFontOfSize:12];
_bindLabel.layer.cornerRadius = 2.0f;
}
return _bindLabel;
}
@end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment