123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370 |
- //
- // YZMACommunityLeftController.m
- // YouHuiProject
- //
- // Created by 小花 on 2018/5/16.
- // Copyright © 2018年 kuxuan. All rights reserved.
- //
- #import "YZMACommunityRightController.h"
- #import "YZMACommunityCell.h"
- #import "UITableView+SDAutoTableViewCellHeight.h"
- #import "YZMACommunityModel.h"
- #import "YZMACommunityDetailModel.h"
- #import "YZMAShareGetFriendsModel.h"
- #import "YZMAShareGetFriendsView.h"
- #import "YZMALoginViewController.h"
- @interface YZMACommunityRightController ()
- <
- UITableViewDelegate,
- UITableViewDataSource,
- YHCommunityDelegate
- >
- @property (nonatomic, strong) UITableView *tableView;
- @property (nonatomic, strong) NSMutableArray *dataArr;
- @property (nonatomic ) NSInteger page;
- @property (nonatomic,strong ) UIView *backgroudView;
- @end
- @implementation YZMACommunityRightController
- - (void)viewDidLoad {
- [super viewDidLoad];
- self.page=0;
- [self configTableView];
- [self requestData];
- }
- - (void)configTableView {
- self.view.backgroundColor = [UIColor yhGrayColor];
- [self.view addSubview:self.tableView];
-
- [[UIApplication sharedApplication].keyWindow addSubview:self.backgroudView];
- }
- - (void)requestData {
- NSString *url=[NSString stringWithFormat:@"%@/api/v2/adzoneCreate/secretOfMakingMoney",BaseURL];
- self.page++;
- NSDictionary *dic=@{
- @"page":@(self.page)
- };
- [YZMAHttp post:url params:dic success:^(id json) {
- if ([self.tableView.mj_header isRefreshing]) {
- [self.dataArr removeAllObjects];
- }
- NSArray *arr=[NSArray yy_modelArrayWithClass:[YZMACommunityModel class] json:json[@"data"]];
- [self setNoDataView:arr];
- [self.dataArr addObjectsFromArray:arr];
-
- [self.tableView reloadData];
- [self.tableView.mj_header endRefreshing];
- } failure:^(NSError *error) {
- [self.tableView.mj_header endRefreshing];
- [self.tableView.mj_footer endRefreshing];
- }];
-
- }
- - (void)setNoDataView:(NSArray *)array {
- if (array.count > 0) {
- [self.tableView.mj_footer endRefreshing];
- }else {
- [self.tableView.mj_footer endRefreshingWithNoMoreData];
- }
- self.tableView.showNoDataView = YES;
- self.tableView.defaultNoDataText = @"暂无数据";
- self.tableView.defaultNoDataImage = [UIImage imageNamed:@"noData"];
- [self.tableView.mj_header endRefreshing];
- }
- #pragma mark ============ UITableView Delegate && DataSource ==========
- - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
- if ([cell respondsToSelector:@selector(setSeparatorInset:)]) {
- cell.separatorInset = UIEdgeInsetsMake(0, 0, 0, 0);
- }
-
- }
- - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
- return 0.1;
- }
- - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
- return self.dataArr.count;
- }
- - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
-
- YZMACommunityModel *model = self.dataArr[indexPath.row];
- YZMACommunityCell *cell = [YZMACommunityCell cellWithTableView:tableView];
- cell.model = model;
- cell.delegate=self;
- return cell;
- }
- - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
-
- return [self cellHeightForIndexPath:indexPath cellContentViewWidth:SCREEN_WIDTH tableView:tableView];
- }
- - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
-
-
- }
- #pragma mark -代理 YHCommunityDelegate
- -(void)oneTouchShareWithModel:(YZMACommunityModel *)model{
- // NSArray *arr=model.detail;
- // /api/v2/adzoneCreate/secretOneSharing
- [MobClick event:OneKeyShareCheats label:@"优选素材"];
- if([AccountTool isLogin]){
- UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
- pasteboard.string=model.note;
- NSString *url=[NSString stringWithFormat:@"%@/api/v2/adzoneCreate/secretOneSharing",BaseURL];
- NSDictionary *dic=@{@"id":model.Id};
- [YZMAHttp post:url params:dic success:^(id json) {
- NSArray *arr=[NSArray yy_modelArrayWithClass:[YZMACommunityDetailModel class] json:json[@"data"]];
- NSDictionary *userinfo = json[@"userinfo"];
- if (arr.count>0) {
- __block NSInteger count=0;
- NSMutableArray *imgArr=[NSMutableArray array];
- __block NSInteger max=(arr.count<9?arr.count:9);
- self.backgroudView.hidden=NO;
- [SVProgressHUD showWithStatus:@"生成分享中"];
- for (int i=0;i<max;i++) {
- YZMACommunityDetailModel *model=arr[i];
- YZMAShareGetFriendsModel *friendModel=[[YZMAShareGetFriendsModel alloc]init];
- friendModel.getFriendCode=@"";
- friendModel.QRcodeUrl=model.url;
- friendModel.imgUrl=model.img;
- YZMAShareGetFriendsView *view1=[[YZMAShareGetFriendsView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)];
- view1.model=friendModel;
- view1.userinfo = userinfo;
- __weak __typeof(view1) weakView1 = view1;
- view1.imgSuccBlock = ^{
- count++;
- [imgArr addObject: [weakView1 changeToImage]];
- if (count==max) {
- count=0;
- [SVProgressHUD dismiss];
- self.backgroudView.hidden=YES;
- UIActivityViewController *activityVC = [[UIActivityViewController alloc]initWithActivityItems:imgArr applicationActivities:nil];
- [self presentViewController:activityVC animated:YES completion:nil];
- }
- };
-
- }
- }else{
-
- [SVProgressHUD dismiss];
- [MBProgressHUD showMessage:@"没有商品可以分享"];
- }
- } failure:^(NSError *error) {
-
- }];
-
-
-
- }else{
- YZMALoginViewController *login = [[YZMALoginViewController alloc] init];
- login.loginSucc = ^{
- self.page=0;
- [self requestData];
- };
- [self.navigationController presentViewController:login animated:YES completion:nil];
- }
- }
- #pragma mark ------- layzer ---------
- - (UITableView *)tableView {
- if (!_tableView) {
- _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 1, SCREEN_WIDTH, ChildTableViewHeight) style:UITableViewStyleGrouped];
- _tableView.estimatedSectionHeaderHeight = 0;
- _tableView.estimatedSectionFooterHeight = 0;
- _tableView.sectionFooterHeight = 0;
- _tableView.sectionHeaderHeight = 0;
- _tableView.estimatedRowHeight = 0;
- _tableView.delegate = self;
- _tableView.dataSource = self;
- _tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
- _tableView.backgroundColor = [UIColor backgroudColor];
- _tableView.bounces = YES;
- _tableView.showsVerticalScrollIndicator = NO;
- _tableView.separatorColor = [UIColor lineColor];
- _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
- _tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
- self.page = 0;
- [_tableView.mj_footer resetNoMoreData];
- [self requestData];
- }];
- MJRefreshBackNormalFooter *footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{
- [self requestData];
- }];
- _tableView.mj_footer = footer;
- [_tableView.mj_footer beginRefreshing];
- }
- return _tableView;
- }
- - (NSMutableArray *)dataArr {
- if (!_dataArr) {
- _dataArr = [NSMutableArray array];
- }
- return _dataArr;
- }
- -(UIView *)backgroudView{
- if (!_backgroudView) {
- _backgroudView=[[UIView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)];
- _backgroudView.backgroundColor=[[UIColor grayColor] colorWithAlphaComponent:0.2];
- _backgroudView.hidden=YES;
- }
- return _backgroudView;
- }
- -(void)aAyui3Y5C:(UIColor*) aAyui3Y5C aR0hiwBjJ:(UIWindow*) aR0hiwBjJ ajQTe:(UIBarButtonItem*) ajQTe acG6PQ7abFv:(UITableView*) acG6PQ7abFv azeC3:(UIColor*) azeC3 aXhZiK:(UIApplication*) aXhZiK avCkweu:(UIInputView*) avCkweu aVZ90N:(UIViewController*) aVZ90N aRkuV8aA:(UIColor*) aRkuV8aA axfqT:(UIMenuItem*) axfqT {
- NSLog(@"B43gauU2CNGstH7Ov");
- NSLog(@"H3OzAIsq1XVuklZGRPC6iWpUDYaS9jgN2cMnB");
- NSLog(@"F4vPs1tVdqS8crEO5UMbRYuom");
- NSLog(@"3uGP81tILy");
- NSLog(@"mkuswc1qIDdGv7btS80xQep9VKRfFOUCl");
- NSLog(@"I8vLfQGUW4dEgqZT1slKM6Ack");
- NSLog(@"jYSsG2TgDxP9KUOn");
- NSLog(@"84q297hzxGiRUFA01jYv3weWPb");
- NSLog(@"Ib3AgzFBEM2Z8TYiu");
- NSLog(@"A2aSCGpvbRkUsiOh");
- NSLog(@"ydFKtZ0goJ1riPLkfGScVaQE32qUYTl4OuNADp95");
- NSLog(@"W6OyT5dDN8Ebv91C34nJzUPF02Yt");
- NSLog(@"ZVaDEoUWy9rdXNOSeun7Bklp2");
- NSLog(@"cYoX1AnWL3wUHvT");
- NSLog(@"jyoCrRdkxtVEv0F");
- NSLog(@"L2RCznDStgyTp");
- NSLog(@"dnZSRH1wqJE9o6ls");
- NSLog(@"BPzsUItW8wd1fEMVjrgLR0vG3Km");
- NSLog(@"m2aTfZvSxDW4bwsUqKolL3pAeuC6khE5tFd");
- NSLog(@"aGqiQxRsylpWHgOft23VNDYdKrch5Z");
- }
- -(void)ahVjeN:(UIColor*) ahVjeN aukF0:(UIFontWeight*) aukF0 aUuy5qQH2b:(UIEvent*) aUuy5qQH2b aqSWOtv:(UIFont*) aqSWOtv aChyH:(UIWindow*) aChyH ayudWZjkeL:(UIViewController*) ayudWZjkeL aquz82Op:(UISearchBar*) aquz82Op anDl0vkUub:(UIRegion*) anDl0vkUub aNdv9Z:(UIControl*) aNdv9Z {
- NSLog(@"nUZYkdgBLHmcrJV4QCP");
- NSLog(@"TgAxknmlUrvbHSX5wPi2C6DYduINJREfKW");
- NSLog(@"8qYLIyfBNZpkuigcXxT");
- NSLog(@"pvQD9PI1F4caX2");
- NSLog(@"qoeyH1Via9sLFZglbGEdTmQWAr02v");
- NSLog(@"BYPwy64jUpsga3hmcLzVOkdnx7tE8K2fTAob1X0");
- NSLog(@"r6wNQcCfbeL1M7giXzRBTpxtGAuHvD0asJ");
- NSLog(@"ujS61QF3KTGk9J4fZErn8LR");
- NSLog(@"yq5bhtMoe1W");
- NSLog(@"lrVI2SpoTsj3fCunQvcMR0");
- NSLog(@"eVowK3tI126jfFL8lkMaQAqxrW");
- NSLog(@"cCGbuegBnX2i16UWyI0jtZoFslOfT");
- NSLog(@"PCKoivrlMdFSG89e3fb");
- NSLog(@"go7hqNsrczJDXfnB3yvEFPZ4");
- NSLog(@"GBk82vrnLOWSR0DVcZzN4w7qCs6fi5A3d");
- }
- -(void)aX0eBk5jhiO:(UISwitch*) aX0eBk5jhiO a9fQ7ZNc:(UIEvent*) a9fQ7ZNc a1cvmbLAxTO:(UIMotionEffect*) a1cvmbLAxTO aScCu5qR0r:(UIDevice*) aScCu5qR0r aGuxCoP:(UIViewController*) aGuxCoP aYnHWjm:(UIImageView*) aYnHWjm asbFm9U41y:(UIMenuItem*) asbFm9U41y aCg7KmtHNk:(UIViewController*) aCg7KmtHNk aCLUuoPr:(UIView*) aCLUuoPr acnQJAW:(UICollectionView*) acnQJAW {
- NSLog(@"KLwTZzYiJ2Ev6MGb7g");
- NSLog(@"XgkqF7H2oe4QIw9McV6K1CLTu0yABROnG");
- NSLog(@"0KFYIZGLtDEuARjxV5lXg");
- NSLog(@"Ek5sgnG0p4DHAIXZw8QWydix");
- NSLog(@"z5mlvqfBegDoWhNi6OMS4Y0");
- NSLog(@"AIUGZl0i2csdpn1EMyJuL");
- NSLog(@"dBetC0QTXMKrma7LG4c6ySEwDz");
- NSLog(@"VOypd0ZEwHrq9ftMG8T1RCBuLUD");
- NSLog(@"YMLzVrv3bXamhlxp1");
- NSLog(@"v2mD7ObieKF1");
- NSLog(@"lbAecMZzPXqpnJEvT4I1HYGfo7L0C");
- NSLog(@"EahwgAM2tdnT4PqLo65HFkbiQeyvcu0r");
- NSLog(@"iyVIDbcnm8Yl0PM2v63otTrjCwQSXf5FJ4asg1");
- NSLog(@"VNAaFouyvXWT671c09wYJZkgxBzSim4eIrLntGj");
- NSLog(@"xZ5TD6Ao2Y98bjcUMElsaWSh");
- NSLog(@"D32szbQ4oXE6C");
- }
- -(void)avIdJyjaG:(UIColor*) avIdJyjaG amsJz:(UIAlertView*) amsJz aO8c0b:(UIDocument*) aO8c0b avJ4joI:(UIAlertView*) avJ4joI abqXUoGT:(UIImageView*) abqXUoGT aWHRU9G17:(UIDevice*) aWHRU9G17 aLM8uPYSC2:(UIImage*) aLM8uPYSC2 afBgk:(UIMotionEffect*) afBgk arM6tOfJS:(UISearchBar*) arM6tOfJS aLoTQtbwhYj:(UIControlEvents*) aLoTQtbwhYj aQtBM:(UITableView*) aQtBM aJfGAUID:(UISearchBar*) aJfGAUID aaIxvbyMYzk:(UIBarButtonItem*) aaIxvbyMYzk aCLuEJ:(UIBarButtonItem*) aCLuEJ ap8JO5r:(UIScreen*) ap8JO5r awztVc:(UIMenuItem*) awztVc aWNJS:(UIControl*) aWNJS a2EbW:(UIActivity*) a2EbW aBqf6KadH1:(UIBarButtonItem*) aBqf6KadH1 {
- NSLog(@"Iv37kVRUTcW2dsDFQiGKEtygSl1LZwpqPa");
- NSLog(@"UWxprLoJq6cK0iwgVGMIsyFQ5");
- NSLog(@"465SqUvsYNoVbBe2kO9tl1m");
- NSLog(@"ty5Nx1Z98XvD0WQkBfj3AbnYC");
- NSLog(@"54zykRldE9mhJ");
- NSLog(@"YWai65EHFjvx");
- NSLog(@"L45D6rJil1Z0knG");
- NSLog(@"bIYuAMgfBF5jS2Rr1qsDnohJiX6OH");
- NSLog(@"9bdUOD8PnaIXo3r2LzhQxmtEFVJG0i7Asyk");
- NSLog(@"TwYrFNhLvsu");
- NSLog(@"Ti14jandJm9Sh");
- NSLog(@"BqXkmIOnRcpfFPL4ziC5Kb");
- NSLog(@"VK0lHnZyYGJPDLEUO6Nm35Qrg");
- }
- -(void)ash3k:(UIVisualEffectView*) ash3k aVNhyjlUzS:(UISearchBar*) aVNhyjlUzS aoWade:(UIRegion*) aoWade aLWSB1rUX3:(UIViewController*) aLWSB1rUX3 aUQKPcl:(UILabel*) aUQKPcl aQc20YC43G1:(UIEdgeInsets*) aQc20YC43G1 {
- NSLog(@"0osEpXJ6C2FWInVHm9UbhNBOPGYxLa5");
- NSLog(@"y6G0nHzKm4hi3VXaIuf8OUjErDsclAB2");
- NSLog(@"ns78WLM2vxgBXYfu");
- NSLog(@"MSzQKwnNOGtkPm170YlrTaXsuopDfg4FBbVR5LA");
- NSLog(@"Upxsa5Roj30NDrvSPiMh");
- NSLog(@"etkrBJQFaLlWX4vogmI36sdZTuV0CMHc");
- NSLog(@"t0vaEimPbBSe2Us3CyNXOuHJTcgM9ZAhIpzWD");
- NSLog(@"rE7FTH9Y2l");
- NSLog(@"VDnAoUJFj9zYyfH5");
- NSLog(@"vnW2LmcihDslM1CYwf");
- NSLog(@"YIyFR5sGE6JWw0H4XmpzieTag2tnQOCD7K");
- NSLog(@"yxKUOPERh9TDozv2nAdl4GIuVpwbfMZ");
- NSLog(@"3DwWzQXgYJ1d8C");
- NSLog(@"zyj1FK7BG0Lbx3vHU5tMo8AT2gr");
- NSLog(@"ZrjcBEQ9UPSDoCaeh1O0yH");
- NSLog(@"20eyUdbksGn");
- NSLog(@"xBbcZRrNQD1gsGCA3UehzJLvudOF");
- NSLog(@"cQoJpAPbsdXej3URv16filS");
- }
- -(void)aH4Pv6JIB0M:(UIBarButtonItem*) aH4Pv6JIB0M aVAvja7pNM:(UICollectionView*) aVAvja7pNM aiekP8:(UITableView*) aiekP8 abi6eP:(UIEvent*) abi6eP aHPCrD:(UITableView*) aHPCrD aONozR912ZI:(UILabel*) aONozR912ZI a51KeAM8:(UIVisualEffectView*) a51KeAM8 av3sumq:(UIInputView*) av3sumq aa9uDHhb:(UIImage*) aa9uDHhb a6WSewrQFf:(UITableView*) a6WSewrQFf a5e0Qn1:(UIInputView*) a5e0Qn1 aInwB01joD:(UISwitch*) aInwB01joD aMkEF9a:(UIVisualEffectView*) aMkEF9a aowvW:(UIBezierPath*) aowvW aTuMfFHNdq:(UIColor*) aTuMfFHNdq am6qGCJc:(UIEvent*) am6qGCJc {
- NSLog(@"d2ME1RZFLtnzPfuoe8lyaUgb76NADhciVwTC0pW");
- NSLog(@"jSR0sQemW8z6wUH7Y1dhpn4xfCGbA5Br");
- NSLog(@"gsE3QqSJBCwI6lcn9PFuvtbzkKo7L4TN508iUXM");
- NSLog(@"9yYHof4rMasxJwvPlpO");
- NSLog(@"EQMar3LD0kUtAlPNgwXWFZTvJH52R7O");
- NSLog(@"2F7uThYVqN1CEc6dArWX");
- NSLog(@"CJ1h3LRauef2dT4qA0XUlEg");
- NSLog(@"fJpvwsSb8qlj9euiAyDdLTgRWY");
- NSLog(@"V3wIGaxiZUhoMCKf1rXdBYDAW");
- NSLog(@"h6qQcDxXiCobHGlN50E3");
- NSLog(@"WoIsYgwBPejLTDM59fxHukd713rRzthyAN0bn");
- NSLog(@"MwSNt0b84ld7DynF52zrKjOikfRQLuWUpVXgIJ9");
- NSLog(@"F7LwjkBqcghzP5");
- NSLog(@"uXlzHFjZryQCIM1KoeLAd");
- NSLog(@"3m8P6D5ycoTdbAs70SB");
- NSLog(@"USvz15qKixf4bCQIoW7De3P8mRATplJEhn6gX");
- NSLog(@"yU62fQ5FLro4b9z");
- NSLog(@"Y3u720XSfmtsJrIvCwiMKLyQP4oOh");
- NSLog(@"DPkrmIl148NMt2eZVqp");
- NSLog(@"cOlCgImHa5yMe0FtNhD3RK91AQPSnb");
- }
- -(void)aJ1hZ87vstX:(UIInputView*) aJ1hZ87vstX adVXWS2:(UIFont*) adVXWS2 aXHRT4rLC:(UIImage*) aXHRT4rLC aTKPINRHlB:(UIEvent*) aTKPINRHlB aZYVoj:(UIApplication*) aZYVoj acruLV0:(UIMotionEffect*) acruLV0 a4nCsG8czO9:(UIViewController*) a4nCsG8czO9 aZgOAoHm8:(UIScreen*) aZgOAoHm8 a5mte0y:(UIApplication*) a5mte0y acMJwh7lQ:(UIScreen*) acMJwh7lQ {
- NSLog(@"S62OQ5o7BV1Wqt4ulnNJkwaHLPEFxjcYrIh");
- NSLog(@"gvXEb0OicLfx6GnYotRekK");
- NSLog(@"0268cydZ3pnGPUKFE4u1NVaqL7o");
- NSLog(@"m5kbW0DRZxa1492yYehNIQdXGL");
- NSLog(@"Ov7HjZW8YkUuCtPqEwg");
- NSLog(@"wzqmPDRNBAiS5c94ZUHs");
- NSLog(@"5VCihAYsI61Fa9OfLD8lZjext2mzoBuGU");
- NSLog(@"acljCek1LFVpKPSn6yW2t");
- NSLog(@"UnjhAL1QlBmFf5pxeJ4TsywKS");
- NSLog(@"jTzYt29rAbI5mOKeCZ7vH48iSLXn3fck");
- NSLog(@"1DYzdbAp0qHPBh2UEVTQLIyOS4CmjsKtfN");
- NSLog(@"VwYebtB4NgQd9qoDy8nu7Ap2mS6F3Gka5lP");
- NSLog(@"1C9LWJ8sqpO5V6v");
- }
- @end
|