Commit 7e8ff7ba authored by 曹云霄's avatar 曹云霄

优化小红点图片提示、优化部分代码

parent 0029765a
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
static NSString * const reuseIdentifier = @"Cell"; static NSString * const reuseIdentifier = @"Cell";
#pragma mark -初始化 #pragma mark -初始化
- (instancetype)init - (instancetype)init
{ {
...@@ -46,6 +47,7 @@ static NSString * const reuseIdentifier = @"Cell"; ...@@ -46,6 +47,7 @@ static NSString * const reuseIdentifier = @"Cell";
return [super initWithCollectionViewLayout:layout]; return [super initWithCollectionViewLayout:layout];
} }
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
......
...@@ -194,13 +194,11 @@ ...@@ -194,13 +194,11 @@
SHARED_APPDELEGATE.lineView.hidden = YES; SHARED_APPDELEGATE.lineView.hidden = YES;
NSInteger selectedIndex = 7; NSInteger selectedIndex = 7;
if ([Name isEqualToString:@"体验中心"]) { if ([Name isEqualToString:@"体验中心"]) {
[Notification postNotificationName:OPENFOLLOWHEARTVC object:nil]; [Notification postNotificationName:OPENFOLLOWHEARTVC object:nil];
return; return;
}else if ([Name isEqualToString:@"体验中心3D"]) }else if ([Name isEqualToString:@"体验中心3D"])
{ {
[Notification postNotificationName:OPENFOLLOWHEART3DVC object:nil]; [Notification postNotificationName:OPENFOLLOWHEART3DVC object:nil];
return; return;
} }
......
...@@ -67,6 +67,7 @@ ...@@ -67,6 +67,7 @@
[super viewDidLoad]; [super viewDidLoad];
[self addaddObserver]; [self addaddObserver];
[self uiConfigAction];
} }
- (void)viewDidAppear:(BOOL)animated - (void)viewDidAppear:(BOOL)animated
...@@ -117,7 +118,6 @@ ...@@ -117,7 +118,6 @@
#pragma mark -省市区选择 #pragma mark -省市区选择
- (IBAction)addressChooseButtonClickAction:(UIButton *)sender { - (IBAction)addressChooseButtonClickAction:(UIButton *)sender {
[[MOFSPickerManager shareManger] showMOFSAddressPickerWithTitle:@"选择城市" cancelTitle:@"取消" commitTitle:@"完成" commitBlock:^(NSString *address, NSString *zipcode) { [[MOFSPickerManager shareManger] showMOFSAddressPickerWithTitle:@"选择城市" cancelTitle:@"取消" commitTitle:@"完成" commitBlock:^(NSString *address, NSString *zipcode) {
[sender setTitle:address forState:UIControlStateNormal]; [sender setTitle:address forState:UIControlStateNormal];
[self.changePersonInformationButton setTitle:@"保存" forState:UIControlStateNormal]; [self.changePersonInformationButton setTitle:@"保存" forState:UIControlStateNormal];
...@@ -225,7 +225,6 @@ ...@@ -225,7 +225,6 @@
return 100; return 100;
} }
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{ {
ClientdetailsViewController *clientdetails = [[[self class] getMainStoryboardClass] instantiateViewControllerWithIdentifier:@"clientdetails"]; ClientdetailsViewController *clientdetails = [[[self class] getMainStoryboardClass] instantiateViewControllerWithIdentifier:@"clientdetails"];
......
...@@ -180,7 +180,6 @@ ...@@ -180,7 +180,6 @@
[self presentViewController:fullScreenVC animated:YES completion:nil]; [self presentViewController:fullScreenVC animated:YES completion:nil];
} }
#pragma mark -切换显示风格 #pragma mark -切换显示风格
- (IBAction)SwitchdisplayStyleClick:(UIButton *)sender { - (IBAction)SwitchdisplayStyleClick:(UIButton *)sender {
...@@ -188,7 +187,6 @@ ...@@ -188,7 +187,6 @@
[self showPopoverViewController:CGSizeMake(55, 180) Withdatas:self.imageArray ShowButton:sender SelectedIndex:100]; [self showPopoverViewController:CGSizeMake(55, 180) Withdatas:self.imageArray ShowButton:sender SelectedIndex:100];
} }
#pragma mark -筛选风格 #pragma mark -筛选风格
- (void)screeningstyleButtonClick:(UIButton *)sender { - (void)screeningstyleButtonClick:(UIButton *)sender {
...@@ -200,7 +198,6 @@ ...@@ -200,7 +198,6 @@
[self showPopoverViewController:CGSizeMake(150, 200) Withdatas:styleArray ShowButton:sender SelectedIndex:0]; [self showPopoverViewController:CGSizeMake(150, 200) Withdatas:styleArray ShowButton:sender SelectedIndex:0];
} }
#pragma mark -空间风格 #pragma mark -空间风格
- (void)HousestyleButtonClick:(UIButton *)sender { - (void)HousestyleButtonClick:(UIButton *)sender {
...@@ -239,12 +236,10 @@ ...@@ -239,12 +236,10 @@
{ {
//空间code //空间code
if (selected) { if (selected) {
self.conditionModel.spaceEquals = type; self.conditionModel.spaceEquals = type;
[self.spaceButton setTitle:[title isEqualToString:@"全部"]?@"空间":title forState:UIControlStateNormal]; [self.spaceButton setTitle:[title isEqualToString:@"全部"]?@"空间":title forState:UIControlStateNormal];
}else }else
{//风格code {//风格code
self.conditionModel.styleEquals = type; self.conditionModel.styleEquals = type;
[self.styleButton setTitle:[title isEqualToString:@"全部"]?@"风格":title forState:UIControlStateNormal]; [self.styleButton setTitle:[title isEqualToString:@"全部"]?@"风格":title forState:UIControlStateNormal];
} }
......
...@@ -179,11 +179,8 @@ ...@@ -179,11 +179,8 @@
[self dismissViewControllerAnimated:NO completion:nil]; [self dismissViewControllerAnimated:NO completion:nil];
_Newbutton = button; _Newbutton = button;
switch (Buttontag) { switch (Buttontag) {
case MENU: case MENU:
[SHARED_APPDELEGATE.mmdrawer toggleDrawerSide:MMDrawerSideRight animated:YES completion:nil]; [SHARED_APPDELEGATE.mmdrawer toggleDrawerSide:MMDrawerSideRight animated:YES completion:nil];
break; break;
case MESSAGE: { case MESSAGE: {
self.selectedIndex = 7; self.selectedIndex = 7;
...@@ -192,7 +189,6 @@ ...@@ -192,7 +189,6 @@
self.selectedIndex = 6; self.selectedIndex = 6;
} break; } break;
case SHOPPING_GUIDE: case SHOPPING_GUIDE:
{ {
UserViewController *userVC = [[UserViewController alloc] init]; UserViewController *userVC = [[UserViewController alloc] init];
userVC.delegate = self; userVC.delegate = self;
...@@ -205,27 +201,22 @@ ...@@ -205,27 +201,22 @@
[self presentViewController:userVC animated:YES completion:nil]; [self presentViewController:userVC animated:YES completion:nil];
} break; } break;
case CUSTOMER: case CUSTOMER:
self.selectedIndex = 3; self.selectedIndex = 3;
break; break;
case SHOPPING_CAR: case SHOPPING_CAR:
//必须设置当前客户才能跳转到购物车 //必须设置当前客户才能跳转到购物车
if (![Shoppersmanager manager].currentCustomer) { if (![Shoppersmanager manager].currentCustomer) {
[XBLoadingView showHUDViewWithText:@"必须设置当前客户才能访问购物车"]; [XBLoadingView showHUDViewWithText:@"必须设置当前客户才能访问购物车"];
} else { } else {
self.selectedIndex = 2; self.selectedIndex = 2;
} }
break; break;
default: default:
break; break;
} }
} }
#pragma mark -修改密码点击 #pragma mark -修改密码点击
- (void)changPasswordButtonClick { - (void)changPasswordButtonClick {
[self dismissViewControllerAnimated:NO [self dismissViewControllerAnimated:NO
...@@ -258,6 +249,7 @@ ...@@ -258,6 +249,7 @@
}]; }];
} }
#pragma mark -二维码扫描 #pragma mark -二维码扫描
- (void)qrcodeButtonClick { - (void)qrcodeButtonClick {
WS(weakSelf); WS(weakSelf);
...@@ -336,7 +328,6 @@ ...@@ -336,7 +328,6 @@
webView.type = Announcement; webView.type = Announcement;
webView.urlString = [NSString stringWithFormat:BAJIE3D,user.fid,shopper.employee.departid,shopper.employee.fid]; webView.urlString = [NSString stringWithFormat:BAJIE3D,user.fid,shopper.employee.departid,shopper.employee.fid];
[self presentViewController:webView animated:YES completion:nil]; [self presentViewController:webView animated:YES completion:nil];
} }
......
...@@ -17,11 +17,9 @@ ...@@ -17,11 +17,9 @@
@implementation Toolview @implementation Toolview
- (instancetype)initWithFrame:(CGRect)frame - (instancetype)initWithFrame:(CGRect)frame
{ {
if (self = [super initWithFrame:frame]) { if (self = [super initWithFrame:frame]) {
self.backgroundColor = RGB(255, 255, 255,1); self.backgroundColor = RGB(255, 255, 255,1);
[self uiConfigAction]; [self uiConfigAction];
[self addNSNotificationCenter]; [self addNSNotificationCenter];
...@@ -36,14 +34,12 @@ ...@@ -36,14 +34,12 @@
self.layer.shadowColor = [UIColor blackColor].CGColor; self.layer.shadowColor = [UIColor blackColor].CGColor;
self.layer.shadowRadius = 10; self.layer.shadowRadius = 10;
self.layer.shadowOpacity = 0.5; self.layer.shadowOpacity = 0.5;
//图标 //图标
UIImageView *iconImage = [[UIImageView alloc]initWithFrame:CGRectMake(50, 13, 115, 35)]; UIImageView *iconImage = [[UIImageView alloc]initWithFrame:CGRectMake(50, 13, 115, 35)];
iconImage.image = TCImage(@"欧"); iconImage.image = TCImage(@"欧");
iconImage.userInteractionEnabled = YES; iconImage.userInteractionEnabled = YES;
[iconImage addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(showHomeController)]]; [iconImage addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(showHomeController)]];
[self addSubview:iconImage]; [self addSubview:iconImage];
//输入框背景 //输入框背景
UIView *backView = [[UIView alloc]initWithFrame:CGRectMake(200, (NavigationHeight-35)/2, 220, 35)]; UIView *backView = [[UIView alloc]initWithFrame:CGRectMake(200, (NavigationHeight-35)/2, 220, 35)];
backView.backgroundColor = RGB(242, 242, 242,1); backView.backgroundColor = RGB(242, 242, 242,1);
...@@ -52,12 +48,10 @@ ...@@ -52,12 +48,10 @@
backView.layer.borderWidth = 1; backView.layer.borderWidth = 1;
backView.layer.borderColor = RGB(209, 209, 209,1).CGColor; backView.layer.borderColor = RGB(209, 209, 209,1).CGColor;
[self addSubview:backView]; [self addSubview:backView];
//搜索图标 //搜索图标
UIImageView *imageview = [[UIImageView alloc]initWithFrame:CGRectMake(10, 7.5, 20, 20)]; UIImageView *imageview = [[UIImageView alloc]initWithFrame:CGRectMake(10, 7.5, 20, 20)];
imageview.image = TCImage(@"search"); imageview.image = TCImage(@"search");
[backView addSubview:imageview]; [backView addSubview:imageview];
//输入框 //输入框
self.inputField = [[UITextField alloc]initWithFrame:CGRectMake(45, 0, 170, 35)]; self.inputField = [[UITextField alloc]initWithFrame:CGRectMake(45, 0, 170, 35)];
self.inputField.borderStyle = UITextBorderStyleNone; self.inputField.borderStyle = UITextBorderStyleNone;
...@@ -65,21 +59,18 @@ ...@@ -65,21 +59,18 @@
self.inputField.font = [UIFont systemFontOfSize:12]; self.inputField.font = [UIFont systemFontOfSize:12];
self.inputField.returnKeyType = UIReturnKeySearch; self.inputField.returnKeyType = UIReturnKeySearch;
[backView addSubview:self.inputField]; [backView addSubview:self.inputField];
//扫描二维码 //扫描二维码
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
button.frame = CGRectMake(backView.frame.size.width+backView.frame.origin.x+15, (NavigationHeight-20)/2, 25, 20); button.frame = CGRectMake(backView.frame.size.width+backView.frame.origin.x+15, (NavigationHeight-20)/2, 25, 20);
[button setBackgroundImage:TCImage(@"圆角矩形-3") forState:UIControlStateNormal]; [button setBackgroundImage:TCImage(@"圆角矩形-3") forState:UIControlStateNormal];
[button addTarget:self action:@selector(qrCodeButtonClickAction) forControlEvents:UIControlEventTouchUpInside]; [button addTarget:self action:@selector(qrCodeButtonClickAction) forControlEvents:UIControlEventTouchUpInside];
[self addSubview:button]; [self addSubview:button];
//按钮 //按钮
NSString *realName = [[Shoppersmanager manager].shoppers.employee.realName length]?[Shoppersmanager manager].shoppers.employee.realName:@"服务导购"; NSString *realName = [[Shoppersmanager manager].shoppers.employee.realName length]?[Shoppersmanager manager].shoppers.employee.realName:@"服务导购";
NSArray *titleArray = [NSArray arrayWithObjects:@"功能菜单",@"消息",@"公告",realName,@"我的客户",@"购物袋", nil]; NSArray *titleArray = [NSArray arrayWithObjects:@"功能菜单",@"消息",@"公告",realName,@"我的客户",@"购物袋", nil];
//图片 //图片
NSArray *imageArray = [NSArray arrayWithObjects:@"dial",@"message",@"tips",@"矢量智能对象-1",@"data",@"ablum", nil]; NSArray *imageArray = [NSArray arrayWithObjects:@"dial",@"message",@"tips",@"矢量智能对象-1",@"data",@"ablum", nil];
for (int i=1; i<titleArray.count+1; i++) { for (int i=1; i<titleArray.count+1; i++) {
CustomButton *button = [CustomButton buttonWithType:UIButtonTypeCustom]; CustomButton *button = [CustomButton buttonWithType:UIButtonTypeCustom];
button.frame = CGRectMake(ScreenWidth-(i*ButtonWIDTH + Buttoninterval*(i-1)), 10, ButtonWIDTH, ButtonRIGHT); button.frame = CGRectMake(ScreenWidth-(i*ButtonWIDTH + Buttoninterval*(i-1)), 10, ButtonWIDTH, ButtonRIGHT);
[button setTitleColor:kMainBlueColor forState:UIControlStateNormal]; [button setTitleColor:kMainBlueColor forState:UIControlStateNormal];
...@@ -137,7 +128,8 @@ ...@@ -137,7 +128,8 @@
{ {
CustomButton *button = (CustomButton *)[self viewWithTag:105]; CustomButton *button = (CustomButton *)[self viewWithTag:105];
NSInteger number = [object.object integerValue]; NSInteger number = [object.object integerValue];
button.instructionsNumber = number; [button showBadgeWithStyle:WBadgeStyleNumber value:number animationType:WBadgeAnimTypeShake];
[Shoppersmanager manager].shoppers.hasNotReadNotice -= number;
} }
#pragma mark - 未读公告 #pragma mark - 未读公告
...@@ -145,8 +137,10 @@ ...@@ -145,8 +137,10 @@
{ {
CustomButton *button = (CustomButton *)[self viewWithTag:102]; CustomButton *button = (CustomButton *)[self viewWithTag:102];
NSInteger number = [object.object integerValue]; NSInteger number = [object.object integerValue];
button.instructionsNumber -= number; NSInteger oldNumber = button.instructionsNumber;
[Shoppersmanager manager].shoppers.hasNotReadAffiche -= number; oldNumber -= number;
[button showBadgeWithStyle:WBadgeStyleNumber value:oldNumber animationType:WBadgeAnimTypeScale];
[Shoppersmanager manager].shoppers.hasNotReadNotice -= number;
[self setBadge]; [self setBadge];
} }
...@@ -155,7 +149,9 @@ ...@@ -155,7 +149,9 @@
{ {
CustomButton *button = (CustomButton *)[self viewWithTag:101]; CustomButton *button = (CustomButton *)[self viewWithTag:101];
NSInteger number = [object.object integerValue]; NSInteger number = [object.object integerValue];
button.instructionsNumber -= number; NSInteger oldNumber = button.instructionsNumber;
oldNumber -= number;
[button showBadgeWithStyle:WBadgeStyleNumber value:oldNumber animationType:WBadgeAnimTypeScale];
[Shoppersmanager manager].shoppers.hasNotReadNotice -= number; [Shoppersmanager manager].shoppers.hasNotReadNotice -= number;
[self setBadge]; [self setBadge];
} }
......
...@@ -19,6 +19,4 @@ ...@@ -19,6 +19,4 @@
@end @end
...@@ -441,7 +441,6 @@ ...@@ -441,7 +441,6 @@
- (void)getStoreAddress:(void(^)())completed - (void)getStoreAddress:(void(^)())completed
{ {
[HTTP networkRequestWithURL:[NSString stringWithFormat:SERVERREQUESTURL(STOREADDRESS),[Shoppersmanager manager].shoppers.employee.currentDepart.fid] withRequestType:POST withParameter:nil withReturnValueBlock:^(id returnValue) { [HTTP networkRequestWithURL:[NSString stringWithFormat:SERVERREQUESTURL(STOREADDRESS),[Shoppersmanager manager].shoppers.employee.currentDepart.fid] withRequestType:POST withParameter:nil withReturnValueBlock:^(id returnValue) {
if (RESULT(returnValue)) { if (RESULT(returnValue)) {
ToStoreAddress *address = [[ToStoreAddress alloc] initWithDictionary:RESPONSE(returnValue) error:nil]; ToStoreAddress *address = [[ToStoreAddress alloc] initWithDictionary:RESPONSE(returnValue) error:nil];
[Shoppersmanager manager].storeAddress = address; [Shoppersmanager manager].storeAddress = address;
......
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