homePageViewController.m 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756
  1. //
  2. // homePageViewController.m
  3. // ZhongJingLianMeng
  4. //
  5. // Created by youke on 2018/11/14.
  6. // Copyright © 2018 youke. All rights reserved.
  7. //
  8. #import "homePageViewController.h"
  9. #import "homeHeaderView.h"
  10. #import "newModel.h"
  11. #import "newImageCell.h"
  12. #import "newNoImageCell.h"
  13. #import "joinAllianceVController.h"
  14. #import "allianceNewsVController.h"
  15. #import "bannerModel.h"
  16. #import "BuyHouseController.h"
  17. #import "VipDemandController.h"
  18. #import "VipBenefitsController.h"
  19. #import "logInViewController.h"
  20. #import "newsDetailVController.h"
  21. #import "UserInfoModel.h"
  22. #import "OrderAirportPayCancelView.h"
  23. #import "applyForDirectorController.h"
  24. #import "activityDetailVController.h"
  25. #import <ShareSDK/ShareSDK.h>
  26. #import <ShareSDKUI/ShareSDK+SSUI.h>
  27. #import<ShareSDKUI/SSUIShareActionSheetStyle.h>//设置简单分享菜单样式
  28. #import "branchVController.h"
  29. #import "PrivacyAlertPopView.h"
  30. #import "VipMienViewController.h"
  31. #import "VipServiceViewController.h"
  32. #import "sendDemandVC.h"
  33. #import "sendDemandFriendVC.h"
  34. #import "sendHouseViewC.h"
  35. #import "sendOtherViewController.h"
  36. #import "singleViewController.h"
  37. #import "WebViewController.h"
  38. #import "joinLiancePopVew.h"
  39. @interface homePageViewController ()<UITableViewDelegate,UITableViewDataSource,HeadViewDelegate>
  40. @property(nonatomic,strong)UITableView *tab;
  41. @property(nonatomic,strong)homeHeaderView *headView;
  42. @property(nonatomic,strong)HttpRequestManger *sessionManager;
  43. @property(nonatomic,strong)NSMutableArray *bannerArr;
  44. @property(nonatomic,strong)NSMutableArray *dataArr;
  45. @property (strong, nonatomic) UserInfoModel*userInfoModel;
  46. @property (strong, nonatomic) OrderAirportPayCancelView *cancelView;
  47. @property(nonatomic ,strong)NSString *name;
  48. @property(nonatomic ,strong)NSString *company;
  49. @property(nonatomic ,strong)NSString *job;
  50. @property(nonatomic ,strong)NSString *phone;
  51. @property(nonatomic ,strong)NSString *peopleType;
  52. @property(nonatomic ,strong)NSString *catetoryType;
  53. @property(nonatomic ,strong)NSString *memberType;
  54. @property(nonatomic,strong)PrivacyAlertPopView *alertPopView;
  55. @property (nonatomic, copy) NSString *versionNum;
  56. @property (nonatomic, copy) NSString *Auditing;
  57. @property(nonatomic,strong)joinLiancePopVew *joinPopView;
  58. @end
  59. @implementation homePageViewController
  60. - (void)viewDidLoad {
  61. [super viewDidLoad];
  62. self.view.backgroundColor = [UIColor whiteColor];
  63. [self VIPhiddenOrNot];
  64. [self creatNav];
  65. // Do any additional setup after loading the view.
  66. }
  67. - (void)VIPhiddenOrNot
  68. {
  69. WS(weakSelf);
  70. NSMutableDictionary *params = [NSMutableDictionary dictionary];
  71. params[@"platform"] = @"2";
  72. _sessionManager = [[HttpRequestManger alloc] init];
  73. [self.sessionManager sendPostHttpRequestWithUrl:getUpgradeVersionInfo params:params bodyBlock:nil progress:nil success:^(NSDictionary *response) {
  74. DebugLog(@"请求成功");
  75. NSDictionary *data = [response objectForKeySafely:@"data"];
  76. weakSelf.versionNum = [data objectForKeySafely:@"versionNum"];
  77. weakSelf.Auditing = [NSString stringWithFormat:@"%@",[data objectForKeySafely:@"isAudit"]];
  78. // NSInteger versionNumBer = [[KAPP_VERSION stringByReplacingOccurrencesOfString:@"."withString:@""] integerValue];
  79. // 0未审核 1审核中
  80. if ([_Auditing isEqualToString:@"1"] && [KAPP_VERSION isEqualToString:_versionNum]) {
  81. _headView =[[homeHeaderView alloc]initWithFrame:CGRectMake(0, 0, kGScreenWidth, 400)];
  82. _headView.delegate = self;
  83. [_headView titleDataWithTitleNameArr:@"1"];
  84. _tab.tableHeaderView= _headView;
  85. [self loadHomeData];
  86. }else{
  87. _headView =[[homeHeaderView alloc]initWithFrame:CGRectMake(0, 0, kGScreenWidth, 400)];
  88. _headView.delegate = self;
  89. [_headView titleDataWithTitleNameArr:@"0"];
  90. _tab.tableHeaderView= _headView;
  91. [self loadHomeData];
  92. }
  93. } failure:^(NSError *error) {
  94. DebugLog(@"请求失败");
  95. _headView =[[homeHeaderView alloc]initWithFrame:CGRectMake(0, 0, kGScreenWidth, 400)];
  96. [_headView titleDataWithTitleNameArr:@"0"];
  97. _headView.delegate = self;
  98. _tab.tableHeaderView= _headView;
  99. [self loadHomeData];
  100. }];
  101. }
  102. -(void)viewWillAppear:(BOOL)animated{
  103. [super viewWillAppear:YES];
  104. [self PrivacyPopView];
  105. if (!IsStrEmpty([DKGlobal sharedInstance].token)) {
  106. [self joinLianceView];
  107. }
  108. }
  109. -(void)viewWillDisappear:(BOOL)animated{
  110. [super viewWillDisappear:YES];
  111. [self.alertPopView removeFromSuperview];
  112. }
  113. -(void)PrivacyPopView{
  114. NSString *key = @"CFBundleVersion";
  115. NSString *key1 = @"popBundleVersion";
  116. NSString *lastVersion = [[NSUserDefaults standardUserDefaults] objectForKey:key1];
  117. // 当前软件的版本号(从Info.plist中获得)
  118. NSString *currentVersion = [NSBundle mainBundle].infoDictionary[key];
  119. if ([currentVersion isEqualToString:lastVersion]) { // 版本号相同:这次打开和上次打开的是同一个版本
  120. //弹窗hide
  121. return;
  122. } else { // 这次打开的版本和上一次不一样,显示新特性
  123. _alertPopView = [[PrivacyAlertPopView alloc]initWithFrame:CGRectMake(0, 0, kGScreenWidth, kGScreenHeight)];
  124. [_alertPopView showAlertView];
  125. kWeakSelf(self);
  126. _alertPopView.contentLab.actionBlock = ^(NSString * _Nonnull LinkType) {
  127. newsDetailVController *newsDetail = [[newsDetailVController alloc]init];
  128. newsDetail.index =@"2";
  129. if ([LinkType isEqualToString:@"1"]) {
  130. newsDetail.titleStr = @"隐私协议";
  131. newsDetail.urlStr =[NSString stringWithFormat:@"%@/privacy?move=ios",baseH5];
  132. }else{
  133. newsDetail.titleStr = @"软件许可及服务协议";
  134. newsDetail.urlStr =[NSString stringWithFormat:@"%@/serviceagree?move=ios",baseH5];
  135. }
  136. [weakself.navigationController pushViewController:newsDetail animated:YES];
  137. };
  138. }
  139. }
  140. -(void)joinLianceView{
  141. NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
  142. NSString *istop = [userDefaults objectForKey:@"isTop"];
  143. if (IsStrEmpty(istop)) {
  144. [ProgressHUD show];
  145. _sessionManager =[[HttpRequestManger alloc]init];
  146. [_sessionManager sendPostHttpRequestWithUrl:getMemberInfo params:nil bodyBlock:nil progress:nil success:^(NSDictionary *response) {
  147. [ProgressHUD hide];
  148. NSLog(@"%@",response);
  149. NSDictionary *dic = [response objectForKeySafely:@"memberInfo"];
  150. self.userInfoModel = [UserInfoModel mj_objectWithKeyValues:dic];
  151. if ([self.userInfoModel.level isEqualToString:@"0"]) {
  152. //游客身份
  153. if ( [self.userInfoModel.auditStatus isEqualToString:@"0"]) {
  154. return;
  155. }else {
  156. _joinPopView = [[joinLiancePopVew alloc]init];
  157. [_joinPopView.closeBtn addTarget:self action:@selector(closeClick:) forControlEvents:UIControlEventTouchUpInside];
  158. [_joinPopView.joinBtn addTarget:self action:@selector(joinClick:) forControlEvents:UIControlEventTouchUpInside];
  159. [_joinPopView showAlertView];
  160. }
  161. }
  162. } failure:^(NSError *error) {
  163. NSLog(@"%@",error);
  164. [ProgressHUD hide];
  165. }];
  166. }
  167. }
  168. -(void)closeClick:(UIButton *)sender{
  169. NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
  170. [userDefaults setObject:@"1" forKey:@"isTop"];
  171. [userDefaults synchronize];
  172. [_joinPopView removeFromSuperview];
  173. _joinPopView = nil;
  174. }
  175. -(void)joinClick:(UIButton *)sender{
  176. NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
  177. [userDefaults setObject:@"1" forKey:@"isTop"];
  178. [userDefaults synchronize];
  179. [_joinPopView removeFromSuperview];
  180. _joinPopView = nil;
  181. joinAllianceVController *joinVC = [[joinAllianceVController alloc]init];
  182. joinVC.phone = self.userInfoModel.phone;
  183. joinVC.model = self.userInfoModel;
  184. [self.navigationController pushViewController:joinVC animated:YES];
  185. }
  186. -(void)creatNav{
  187. [self.navigationView setNavigationBackgroundAlpha:0];
  188. [self.navigationView removeAllLeftButton];
  189. _tab = [[UITableView alloc] initWithFrame:CGRectMake(0,0, kGScreenWidth, kGScreenHeight-kTabBarH) style:UITableViewStylePlain];
  190. _tab.delegate = self;
  191. _tab.dataSource = self;
  192. _tab.backgroundColor = [UIColor colorWithHexValue:0xf7f8fa];
  193. [self.view addSubview:_tab];
  194. if (@available(iOS 11.0, *)) {
  195. _tab.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
  196. }else {
  197. self.automaticallyAdjustsScrollViewInsets = NO;
  198. }
  199. _tab.separatorStyle = UITableViewCellSeparatorStyleNone;
  200. [_tab registerClass:[newImageCell class] forCellReuseIdentifier:@"CellID1"];
  201. [_tab registerClass:[newNoImageCell class] forCellReuseIdentifier:@"CellID2"];
  202. _tab.mj_header=[MJRefreshNormalHeader headerWithRefreshingBlock:^{
  203. [self.bannerArr removeAllObjects];
  204. [self.dataArr removeAllObjects];
  205. [self loadHomeData];
  206. }];
  207. // 设置自动切换透明度(在导航栏下面自动隐藏)
  208. _tab.mj_header.automaticallyChangeAlpha = YES;
  209. }
  210. - (HttpRequestManger*) sessionManager{
  211. if (!_sessionManager) {
  212. _sessionManager = [[HttpRequestManger alloc]init];
  213. }
  214. return _sessionManager;
  215. }
  216. - (NSMutableArray *)bannerArr
  217. {
  218. if (!_bannerArr) {
  219. _bannerArr = [NSMutableArray array];
  220. }
  221. return _bannerArr;
  222. }
  223. - (NSMutableArray *)dataArr
  224. {
  225. if (!_dataArr) {
  226. _dataArr = [NSMutableArray array];
  227. }
  228. return _dataArr;
  229. }
  230. -(void)loadHomeData{
  231. kWeakSelf(self);
  232. [ProgressHUD show];
  233. [weakself.sessionManager sendPostHttpRequestWithUrl:shouyeData params:nil bodyBlock:nil progress:nil success:^(NSDictionary *response) {
  234. NSLog(@"%@",response);
  235. [ProgressHUD hide];
  236. NSArray *arr =[NSArray arrayWithArray:response[@"data"][@"bannerList"]];
  237. if (!IsArrEmpty(arr)) {
  238. weakself.bannerArr = [bannerModel mj_objectArrayWithKeyValuesArray:arr];
  239. }
  240. NSArray *arr1 =[NSArray arrayWithArray:response[@"data"][@"informationList"]];
  241. if (!IsArrEmpty(arr1)) {
  242. weakself.dataArr =[newModel mj_objectArrayWithKeyValuesArray:arr1];
  243. }
  244. [_headView dataWithPIcArr:weakself.bannerArr];
  245. [_tab reloadData];
  246. [self.tab.mj_header endRefreshing];
  247. } failure:^(NSError *error) {
  248. NSLog(@"%@",error);
  249. [ProgressHUD hide];
  250. [self.tab.mj_header endRefreshing];
  251. }];
  252. }
  253. -(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
  254. return 1;
  255. }
  256. -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
  257. return _dataArr.count;
  258. }
  259. -(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
  260. return 0.001;
  261. }
  262. -(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
  263. return 0.0001;
  264. }
  265. -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
  266. return 115;
  267. }
  268. -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
  269. newModel *model = self.dataArr[indexPath.row];
  270. if ([model.img_path isEqualToString:@""]) {
  271. newNoImageCell *cell = [newNoImageCell cellWith:model tableView:tableView];
  272. tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
  273. cell.selectionStyle = UITableViewCellSelectionStyleNone;
  274. return cell;
  275. }else{
  276. newImageCell *cell = [newImageCell cellWith:model tableView:tableView];
  277. tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
  278. cell.selectionStyle = UITableViewCellSelectionStyleNone;
  279. return cell;
  280. }
  281. }
  282. -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
  283. newModel *model = self.dataArr[indexPath.row];
  284. newsDetailVController *newsDetail = [[newsDetailVController alloc]init];
  285. newsDetail.newsId = model.news_Id;
  286. newsDetail.titleStr = model.title;
  287. newsDetail.shareTitle = model.title;
  288. newsDetail.typeStr = @"0";
  289. newsDetail.ImgUrl = model.img_path;
  290. newsDetail.index =@"0";
  291. newsDetail.urlStr = [NSString stringWithFormat:@"%@/newsInfo?id=%@&move=ios",baseH5,model.news_Id];
  292. newsDetail.shareUrl = [NSString stringWithFormat:@"%@/newsInfo?id=%@",baseH5,model.news_Id];
  293. [self.navigationController pushViewController:newsDetail animated:YES];
  294. }
  295. -(void)selectedImageView:(NSInteger)number{
  296. bannerModel *model = self.bannerArr[number];
  297. if ([model.type isEqualToString:@"0"]) {
  298. newsDetailVController *webVC = [[newsDetailVController alloc]init];
  299. webVC.titleStr = model.title;
  300. webVC.shareTitle = model.title;
  301. webVC.ImgUrl = model.img_path;
  302. webVC.index = @"1";
  303. webVC.urlStr = [NSString stringWithFormat:@"%@",model.banner_url];
  304. [self.navigationController pushViewController:webVC animated:YES];
  305. }else if ([model.type isEqualToString:@"1"] ||[model.type isEqualToString:@"2"]){
  306. newsDetailVController *newsDetail = [[newsDetailVController alloc]init];
  307. newsDetail.newsId = model.banner_url;
  308. newsDetail.titleStr = model.title;
  309. newsDetail.shareTitle = model.title;
  310. newsDetail.ImgUrl = model.img_path;
  311. newsDetail.typeStr = @"0";
  312. newsDetail.index =@"0";
  313. newsDetail.urlStr = [NSString stringWithFormat:@"%@/newsInfo?id=%@&move=ios",baseH5,model.banner_url];
  314. newsDetail.shareUrl = [NSString stringWithFormat:@"%@/newsInfo?id=%@",baseH5,model.banner_url];
  315. [self.navigationController pushViewController:newsDetail animated:YES];
  316. }else if ([model.type isEqualToString:@"4"]){
  317. newsDetailVController *newsDetail = [[newsDetailVController alloc]init];
  318. newsDetail.newsId = model.banner_url;
  319. newsDetail.titleStr = model.title;
  320. newsDetail.shareTitle = model.title;
  321. newsDetail.ImgUrl = model.img_path;
  322. newsDetail.typeStr = @"2";
  323. newsDetail.index =@"0";
  324. newsDetail.urlStr = [NSString stringWithFormat:@"%@/reviewDetail?id=%@",baseH5,model.banner_url];
  325. newsDetail.shareUrl = [NSString stringWithFormat:@"%@/reviewDetail?id=%@",baseH5,model.banner_url];
  326. [self.navigationController pushViewController:newsDetail animated:YES];
  327. }else if ([model.type isEqualToString:@"5"]){
  328. newsDetailVController *webVC = [[newsDetailVController alloc]init];
  329. webVC.index = @"1";
  330. webVC.titleStr = model.title;
  331. webVC.shareTitle = model.title;
  332. webVC.ImgUrl = model.img_path;
  333. webVC.urlStr = [NSString stringWithFormat:@"%@?move=ios",model.banner_url];
  334. webVC.shareUrl = [NSString stringWithFormat:@"%@",model.banner_url];
  335. [self.navigationController pushViewController:webVC animated:YES];
  336. }else{
  337. activityDetailVController *activityDetail = [[activityDetailVController alloc]init];
  338. activityDetail.newsId = model.banner_url;
  339. activityDetail.titleStr = model.title;
  340. activityDetail.shareTitle = model.title;
  341. activityDetail.ImgUrl = model.img_path;
  342. activityDetail.index =@"0";
  343. activityDetail.urlStr = [NSString stringWithFormat:@"%@/applyDetail?id=%@&move=ios",baseH5,model.banner_url];
  344. activityDetail.shareUrl = [NSString stringWithFormat:@"%@/applyDetail?id=%@",baseH5,model.banner_url];
  345. [self.navigationController pushViewController:activityDetail animated:YES];
  346. }
  347. }
  348. -(void)selectedButton:(NSInteger)number{
  349. if (number == 0) {
  350. allianceNewsVController *allianceNewsVC =[[allianceNewsVController alloc]init];
  351. allianceNewsVC.typeString = @"1";
  352. [self.navigationController pushViewController:allianceNewsVC animated:YES];
  353. }else if (number == 1){
  354. // [ToastView showToast:@"联盟公告"];
  355. self.tabBarController.selectedIndex=1;
  356. }else if (number == 2){
  357. // [ToastView showToast:@"会员服务"];
  358. if (![DKGlobal sharedInstance].token) {
  359. logInViewController *control = [[logInViewController alloc] init];
  360. [self.navigationController pushViewController:control animated:YES];
  361. }else{
  362. VipServiceViewController *vc = [[VipServiceViewController alloc]init];
  363. [self.navigationController pushViewController:vc animated:YES];
  364. }
  365. }else if (number == 3){
  366. if (![DKGlobal sharedInstance].token ) {
  367. logInViewController *control = [[logInViewController alloc] init];
  368. [self.navigationController pushViewController:control animated:YES];
  369. }else{
  370. [self isPersionStatus:@"1"];
  371. }
  372. }else if (number == 4){
  373. // [ToastView showToast:@"新闻资讯"];
  374. allianceNewsVController *allianceNewsVC =[[allianceNewsVController alloc]init];
  375. allianceNewsVC.typeString = @"0";
  376. [self.navigationController pushViewController:allianceNewsVC animated:YES];
  377. }else if (number == 5){
  378. // [ToastView showToast:@"会员风采"];
  379. VipMienViewController *vip = [[VipMienViewController alloc]init];
  380. [self.navigationController pushViewController:vip animated:YES];
  381. }else if (number == 6){
  382. self.tabBarController.selectedIndex=2;
  383. }else if (number == 7){
  384. if (IsStrEmpty([DKGlobal sharedInstance].token)) {
  385. logInViewController *control = [[logInViewController alloc] init];
  386. [self.navigationController pushViewController:control animated:YES];
  387. }else{
  388. [self isPersionStatus:@"2"];
  389. }
  390. }
  391. }
  392. -(void)isPersionStatus:(NSString *)flag{
  393. kWeakSelf(self);
  394. [ProgressHUD show];
  395. _sessionManager =[[HttpRequestManger alloc]init];
  396. [_sessionManager sendPostHttpRequestWithUrl:getMemberInfo params:nil bodyBlock:nil progress:nil success:^(NSDictionary *response) {
  397. [ProgressHUD hide];
  398. NSLog(@"%@",response);
  399. NSDictionary *dic = [response objectForKeySafely:@"memberInfo"];
  400. weakself.userInfoModel = [UserInfoModel mj_objectWithKeyValues:dic];
  401. if ([flag isEqualToString:@"1"]) {
  402. if ([weakself.userInfoModel.level isEqualToString:@"0"]) {
  403. //游客身份
  404. if ( [weakself.userInfoModel.auditStatus isEqualToString:@"0"]) {
  405. [ToastView showToast:@"您的申请正在审核中,请等待审核"];
  406. }else {
  407. joinAllianceVController *joinVC = [[joinAllianceVController alloc]init];
  408. joinVC.phone = weakself.userInfoModel.phone;
  409. joinVC.model = weakself.userInfoModel;
  410. [self.navigationController pushViewController:joinVC animated:YES];
  411. }
  412. }else if ([weakself.userInfoModel.level isEqualToString:@"1"]){
  413. //普通会员
  414. //普通会员:type:个人
  415. if ([weakself.userInfoModel.auditStatus isEqualToString:@"0"]) {
  416. //申请理事审核中
  417. [ToastView showToast:@"您的申请正在审核中,请等待审核"];
  418. }else {
  419. //申请理事
  420. UIWindow *window = [[[UIApplication sharedApplication] delegate] window];
  421. [window addSubview: weakself.cancelView];
  422. }
  423. }else if ([weakself.userInfoModel.level isEqualToString:@"2"]){
  424. //企业会员
  425. [ToastView showToast:@"您已经是企业级会员,即享受常务理事的权益"];
  426. WebViewController *web = [[WebViewController alloc]init];
  427. web.index = @"0";
  428. web.titleStr = @"会员权益";
  429. web.urlStr = [NSString stringWithFormat:@"%@/memberBenefits?move=ios",baseH5];
  430. web.photoURL = @"";
  431. [self.navigationController pushViewController:web animated:YES];
  432. }else if ([weakself.userInfoModel.level isEqualToString:@"3"]){
  433. //常务理事
  434. [ToastView showToast:@"您已经是常务理事"];
  435. WebViewController *web = [[WebViewController alloc]init];
  436. web.index = @"0";
  437. web.titleStr = @"会员权益";
  438. web.urlStr = [NSString stringWithFormat:@"%@/memberBenefits?move=ios",baseH5];
  439. web.photoURL = @"";
  440. [self.navigationController pushViewController:web animated:YES];
  441. }
  442. }else if ([flag isEqualToString:@"2"]){
  443. NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
  444. WebViewController *web = [[WebViewController alloc]init];
  445. web.index = @"2";
  446. web.titleStr = @"邀请朋友";
  447. web.urlStr = [NSString stringWithFormat:@"%@/invite?userId=%@&move=ios",baseH5,[userDefaults objectForKey:@"UserId"]];
  448. web.photoURL = @"";
  449. web.shareUrl = [NSString stringWithFormat:@"%@/register?userId=%@",baseH5,[userDefaults objectForKey:@"UserId"]];
  450. if (IsStrEmpty(self.userInfoModel.name)) {
  451. web.shareTitle = @"连接、互助、赋能、共生 终于等到你,点击加入联盟";
  452. }else{
  453. web.shareTitle =[NSString stringWithFormat:@"连接、互助、赋能、共生 终于等到你 %@邀请你加入中经联盟",self.userInfoModel.name];
  454. }
  455. web.shareInfo = @"中经联盟";
  456. [self.navigationController pushViewController:web animated:YES];
  457. }
  458. } failure:^(NSError *error) {
  459. NSLog(@"%@",error);
  460. [ProgressHUD hide];
  461. }];
  462. }
  463. - (OrderAirportPayCancelView*)cancelView{
  464. WS(weakSelf);
  465. if (!_cancelView) {
  466. _cancelView = [[NSBundle mainBundle]loadNibNamed:@"OrderAirportPayCancelView" owner:self options:nil].firstObject;
  467. _cancelView.frame = self.view.bounds;
  468. // _cancelView.isFromOrder = self.isFromOrder;
  469. _cancelView.tipLabel.hidden = YES;
  470. _cancelView.contentLabel.hidden = YES;
  471. _cancelView.titleLabel.text = @"您已经加入联盟,是否要成为常务理事呢?";
  472. _cancelView.titleLabelTop.constant = 35;
  473. [_cancelView.rightBtn setBackgroundColor:[UIColor colorWithHexValue:0x3C915C]];
  474. [_cancelView.leftBtn setTitle:@"确定取消" forState:UIControlStateNormal];
  475. [_cancelView.rightBtn setTitle:@"继续申请" forState:UIControlStateNormal];
  476. _cancelView.leftBtnCallback = ^{
  477. [weakSelf.cancelView removeFromSuperview];
  478. };
  479. _cancelView.rightBtnCallback = ^{
  480. applyForDirectorController *applyFor = [[applyForDirectorController alloc]init];
  481. // applyFor.model = weakSelf.userInfoModel;
  482. [weakSelf.navigationController pushViewController:applyFor animated:YES];
  483. };
  484. }
  485. return _cancelView;
  486. }
  487. -(void)shareViewShow
  488. {
  489. NSArray *arr =@[[UIImage imageNamed:@"AppIcon"]];
  490. if (arr) {
  491. NSMutableDictionary *shareParams = [NSMutableDictionary dictionary];
  492. [shareParams SSDKSetupShareParamsByText:@"连接、互助、赋能、共生"
  493. images:arr
  494. url:[NSURL URLWithString:[NSString stringWithFormat:@"%@",baseH5]]
  495. title:@"中经联盟"
  496. type:SSDKContentTypeAuto];
  497. // [shareParams SSDKEnableUseClientShare];
  498. // [SSUIShareActionSheetStyle setShareActionSheetStyle:(ShareActionSheetStyle)ShareActionSheetStyleSimple];
  499. [ShareSDK showShareActionSheet:nil //要显示菜单的视图, iPad版中此参数作为弹出菜单的参照视图,只有传这个才可以弹出我们的分享菜单,可以传分享的按钮对象或者自己创建小的view 对象,iPhone可以传nil不会影响
  500. items:@[@(SSDKPlatformSubTypeWechatSession),@(SSDKPlatformSubTypeWechatTimeline)]
  501. shareParams:shareParams
  502. onShareStateChanged:^(SSDKResponseState state, SSDKPlatformType platformType, NSDictionary *userData, SSDKContentEntity *contentEntity, NSError *error, BOOL end) {
  503. switch (platformType) {
  504. case SSDKPlatformSubTypeWechatSession:
  505. break;
  506. case SSDKPlatformSubTypeWechatTimeline:
  507. break;
  508. default:
  509. break;
  510. }
  511. switch (state) {
  512. case SSDKResponseStateSuccess:
  513. // {
  514. // UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"分享成功"
  515. // message:nil
  516. // delegate:nil
  517. // cancelButtonTitle:@"确定"
  518. // otherButtonTitles:nil];
  519. // [alertView show];
  520. break;
  521. // }
  522. case SSDKResponseStateFail:
  523. // {
  524. // UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"分享失败"
  525. // message:nil
  526. // delegate:nil
  527. // cancelButtonTitle:@"OK"
  528. // otherButtonTitles:nil, nil];
  529. // [alert show];
  530. //
  531. //
  532. // NSLog(@"%@",error);
  533. break;
  534. // }
  535. default:
  536. break;
  537. }
  538. }
  539. ];
  540. }
  541. }
  542. - (void)dealloc {
  543. if (_sessionManager) {
  544. [_sessionManager cancelAllTask];
  545. }
  546. [[NSNotificationCenter defaultCenter] removeObserver:self];
  547. DebugLog(@"%@没有造成循环引用", [self class]);
  548. }
  549. - (void)didReceiveMemoryWarning {
  550. [super didReceiveMemoryWarning];
  551. // Dispose of any resources that can be recreated.
  552. }
  553. @end