chore: import upstream snapshot with attribution
This commit is contained in:
+19
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// TLGroupQRCodeViewController.h
|
||||
// TLChat
|
||||
//
|
||||
// Created by 李伯坤 on 16/3/8.
|
||||
// Copyright © 2016年 李伯坤. All rights reserved.
|
||||
//
|
||||
|
||||
#import "TLViewController.h"
|
||||
#import "TLGroup.h"
|
||||
|
||||
@interface TLGroupQRCodeViewController : TLViewController
|
||||
|
||||
@property (nonatomic, strong) TLGroup *group;
|
||||
|
||||
- (instancetype)initWithGroupModel:(TLGroup *)groupModel;
|
||||
- (instancetype)init NS_UNAVAILABLE;
|
||||
|
||||
@end
|
||||
+70
@@ -0,0 +1,70 @@
|
||||
|
||||
//
|
||||
// TLGroupQRCodeViewController.m
|
||||
// TLChat
|
||||
//
|
||||
// Created by 李伯坤 on 16/3/8.
|
||||
// Copyright © 2016年 李伯坤. All rights reserved.
|
||||
//
|
||||
|
||||
#import "TLGroupQRCodeViewController.h"
|
||||
#import "TLQRCodeViewController.h"
|
||||
|
||||
@interface TLGroupQRCodeViewController () <TLActionSheetDelegate>
|
||||
|
||||
@property (nonatomic, strong) TLQRCodeViewController *qrCodeVC;
|
||||
|
||||
@end
|
||||
|
||||
@implementation TLGroupQRCodeViewController
|
||||
|
||||
- (instancetype)initWithGroupModel:(TLGroup *)groupModel
|
||||
{
|
||||
if (self = [super init]) {
|
||||
_group = groupModel;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)loadView
|
||||
{
|
||||
[super loadView];
|
||||
[self.view setBackgroundColor:[UIColor colorBlackBG]];
|
||||
[self setTitle:LOCSTR(@"群二维码名片")];
|
||||
|
||||
[self.view addSubview:self.qrCodeVC.view];
|
||||
[self addChildViewController:self.qrCodeVC];
|
||||
|
||||
@weakify(self);
|
||||
[self addRightBarButtonWithImage:TLImage(@"nav_more") actionBlick:^{
|
||||
TLActionSheet *actionSheet = [[TLActionSheet alloc] initWithTitle:nil clickAction:^(NSInteger buttonIndex) {
|
||||
@strongify(self);
|
||||
if (buttonIndex == 1) {
|
||||
[self.qrCodeVC saveQRCodeToSystemAlbum];
|
||||
}
|
||||
} cancelButtonTitle:@"取消" destructiveButtonTitle:nil otherButtonTitles:@"用邮件发送", @"保存图片", nil];
|
||||
[actionSheet show];
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)viewDidLoad
|
||||
{
|
||||
[super viewDidLoad];
|
||||
|
||||
self.qrCodeVC.avatarPath = self.group.groupAvatarPath;
|
||||
self.qrCodeVC.username = self.group.groupName;
|
||||
self.qrCodeVC.qrCode = self.group.groupID;
|
||||
NSDate *date = [NSDate dateWithDaysFromNow:7];
|
||||
self.qrCodeVC.introduction = [NSString stringWithFormat:@"该二维码7天内(%lu月%lu日前)有效,重新进入将更新", (long)date.month, (long)date.day];
|
||||
}
|
||||
|
||||
#pragma mark - # Getter
|
||||
- (TLQRCodeViewController *)qrCodeVC
|
||||
{
|
||||
if (_qrCodeVC == nil) {
|
||||
_qrCodeVC = [[TLQRCodeViewController alloc] init];
|
||||
}
|
||||
return _qrCodeVC;
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user