一折买app------返利---------返利宝

YZMAMineMainViewController.m 31KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922
  1. //
  2. // YZMAMineMainViewController.m
  3. // YouHuiProject
  4. //
  5. // Created by xiaoxi on 2018/1/16.
  6. // Copyright © 2018年 kuxuan. All rights reserved.
  7. //
  8. #import "YZMAMineMainViewController.h"
  9. #import "HFStretchableTableHeaderView.h"
  10. #import "YZMALoginViewController.h"
  11. #import "YZMACollectionViewController.h"
  12. #import "YZMASettingViewController.h"
  13. #import "YZMAMyTicketViewController.h"
  14. #import "YZMAMyOrderViewController.h"
  15. #import <AlibcTradeSDK/AlibcTradeSDK.h>
  16. #import "YZMABrowserHistoryController.h"
  17. #import "YZMAAdWebViewController.h"
  18. #import "YZMAFeedbackController.h"
  19. #import <StoreKit/StoreKit.h>
  20. #import "YZMAFindBookWebViewController.h"
  21. #import "UITableViewCell+Cc_CornRadio.h"
  22. #import "YZMAFourButtonView.h"
  23. #import "YZMAShopCarViewController.h"
  24. #import "CCActionSheet.h"
  25. #import "YZMAMineBlanceView.h"
  26. #import "YZMAMineOrderView.h"
  27. #import "YZMAMoreMenuView.h"
  28. #import "YZMAOrderMainViewController.h"
  29. #import "YZMAOrderMainViewController.h"
  30. #import "YZMACommissionMainViewController.h"
  31. #import "YZMAMyFansViewController.h"
  32. #import "YZMAMyCollectionViewController.h"
  33. #import "YZMAInviteFansViewController.h"
  34. #import "YZMAMessageListController.h"
  35. #import "YZMAUserInfo.h"
  36. #import "YZMAUserInfoView.h"
  37. #import "YZMACollectionMainViewController.h"
  38. #import "YZMALinkFansController.h"
  39. #import "YZMAPrivilegeReferralViewController.h"
  40. #import "YZMAUserInfo.h"
  41. #import "YZMAMonthMainViewController.h"
  42. #import "YZMAMineAdView.h"
  43. #import "YZMAAccountDetailController.h"
  44. #import "AdPopModel.h"
  45. #import "AdJumpManager.h"
  46. #import "UIView+BABadgeView.h"
  47. #import "YZMABuyLimitMainController.h"
  48. #import "YZMAHistoryViewController.h"
  49. #import "YZMAUserView.h"
  50. @interface YZMAMineMainViewController ()
  51. <
  52. UITableViewDelegate,
  53. UITableViewDataSource,
  54. CCActionSheetDelegate,
  55. YHMineFourButtonViewDelegate,
  56. YHMoreMenuViewDelegate
  57. >
  58. @property (nonatomic, strong) UITableView *tableView;
  59. @property (nonatomic, strong) UIView *header;
  60. @property (nonatomic, strong) UIImageView *headerImg;
  61. //@property (nonatomic, strong) YZMAUserInfoView *userInfoView;
  62. //@property (nonatomic, strong) YZMAMineBlanceView *blanceView;
  63. //@property (nonatomic, strong) YZMAMineOrderView *mineOrderView;
  64. @property (nonatomic, strong) YZMAMoreMenuView *topMenuView;
  65. //@property (nonatomic, strong) YZMAMoreMenuView *bottomMenuView;
  66. @property (nonatomic, strong) YZMAMineAdView *adView;
  67. @property (nonatomic, strong) UIButton *messageBtn;
  68. @property (nonatomic, strong) YZMAUserInfo *userInfo;
  69. @property (nonatomic, strong) YZMAUserView *userView;
  70. /*dataSource**/
  71. @property (nonatomic, strong) NSArray *cellData;
  72. @property (nonatomic, strong) NSArray *sexArr;
  73. @end
  74. @implementation YZMAMineMainViewController
  75. - (void)viewWillDisappear:(BOOL)animated {
  76. [super viewWillDisappear:animated];
  77. [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault];
  78. }
  79. - (void)viewDidAppear:(BOOL)animated {
  80. [super viewDidAppear:animated];
  81. [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
  82. }
  83. - (void)viewWillAppear:(BOOL)animated {
  84. [super viewWillAppear:animated];
  85. [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
  86. [self loadUserInfo];
  87. if ([AccountTool isLogin]) {
  88. [self checkForNewMessage];
  89. }
  90. }
  91. - (void)viewDidLoad {
  92. [super viewDidLoad];
  93. [self configNavightion];
  94. [self configTableView];
  95. [self loadAdData];
  96. }
  97. - (void)configNavightion {
  98. self.navigationBar.backgroundColor = [UIColor clearColor];
  99. self.navigationBar.hidden = YES;
  100. }
  101. - (void)configTableView {
  102. [self.view addSubview:self.tableView];
  103. __weak typeof(self) weakSelf = self;
  104. //头部背景图
  105. self.headerImg = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 170)];
  106. self.headerImg.userInteractionEnabled = YES;
  107. self.header.backgroundColor = [UIColor homeRedColor];
  108. self.headerImg.contentMode = UIViewContentModeScaleAspectFill;
  109. //头视图
  110. self.header = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 170)];
  111. self.headerImg.backgroundColor = [UIColor homeRedColor];
  112. [self.header addSubview:self.headerImg];
  113. //上边的多菜单
  114. NSArray *buttons = @[@{@"title":@"我的收藏",@"image":@"shoucang"},
  115. @{@"title":@"浏览记录",@"image":@"liulan"},
  116. @{@"title":@"新手指南",@"image":@"zhinan"}];
  117. self.topMenuView = [[YZMAMoreMenuView alloc] initWithFrame:CGRectMake(0, self.header.bottom, SCREEN_WIDTH, (SCREEN_WIDTH)/4) buttonInfoArray:buttons];
  118. self.topMenuView.delelgate = self;
  119. [self.header addSubview:self.topMenuView];
  120. //广告view
  121. self.adView = [[YZMAMineAdView alloc] initWithFrame:CGRectMake(0, self.topMenuView.bottom, SCREEN_WIDTH, 0)];
  122. self.adView.tapAdBlock = ^(AdPopModel *model) {
  123. [AdJumpManager jumpToPageWithModel:model ParentViewControll:weakSelf];
  124. };
  125. self.adView.closeBlock = ^{
  126. [weakSelf hiddenAdView];
  127. };
  128. [self.header addSubview:self.adView];
  129. self.header.height = CGRectGetMaxY(self.adView.frame)+10;
  130. self.tableView.tableHeaderView = self.header;
  131. //用户信息
  132. self.userView = [[YZMAUserView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 95)];
  133. self.userView.centerY = KStatusBarHeight + (self.headerImg.height-KStatusBarHeight)/2;
  134. self.userView.tapActionBlock = ^{
  135. if ([AccountTool isLogin]) {
  136. [weakSelf settingAction];
  137. }else {
  138. [weakSelf goToLoginPage];
  139. }
  140. };
  141. [self.tableView addSubview:self.userView];
  142. //消息按钮
  143. // UIButton *setButton = [[UIButton alloc] initWithFrame:CGRectMake(SCREEN_WIDTH-20-40, KStatusBarHeight+10, 40, 40)];
  144. // [setButton setImage:[UIImage imageNamed:@"message_icon"] forState:UIControlStateNormal];
  145. // [setButton addTarget:self action:@selector(gotoMyMessagesPage) forControlEvents:UIControlEventTouchUpInside];
  146. // self.messageBtn = setButton;
  147. // [setButton ba_addDotWithColor:[UIColor redColor]];
  148. // [setButton ba_moveBadgeWithX:-12 Y:15];
  149. // [self.tableView addSubview:setButton];
  150. if (@available(iOS 11.0, *)) {
  151. self.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;//UIScrollView也适用
  152. }else {
  153. self.automaticallyAdjustsScrollViewInsets = NO;
  154. }
  155. }
  156. - (void)scrollViewDidScroll:(UIScrollView *)scrollView
  157. {
  158. CGFloat yOffset = scrollView.contentOffset.y;
  159. if(yOffset < 0)
  160. {
  161. self.headerImg.y = yOffset;
  162. self.headerImg.height = 170+ABS(yOffset);
  163. }
  164. }
  165. /**
  166. 加载用户信息
  167. */
  168. - (void)loadUserInfo {
  169. if (![AccountTool isLogin]) {
  170. [self noLoginView];
  171. return;
  172. }
  173. [YZMAHttp post:UserInfo params:nil success:^(id json) {
  174. self.userInfo = [YZMAUserInfo yy_modelWithJSON:json];
  175. [self.userView setLoginView:self.userInfo];//设置用户信息
  176. } failure:^(NSError *error) {
  177. if (![AccountTool isLogin]) {
  178. [self noLoginView];
  179. }
  180. }];
  181. }
  182. - (void)noLoginView {
  183. [self.userView setUnLoginView];
  184. }
  185. /**
  186. 检查是否有新消息
  187. */
  188. - (void)checkForNewMessage {
  189. if ([AccountTool isLogin]) {
  190. NSString *url = [NSString stringWithFormat:@"%@/api/v2/message_push/messageNew",BaseURL];
  191. [YZMAHttp post:url params:nil success:^(id json) {
  192. NSNumber *new = json[@"data"][@"message_new"];
  193. if ([new boolValue]) {
  194. [self.messageBtn ba_showBadge];
  195. }else {
  196. [self.messageBtn ba_hiddenBadge];
  197. }
  198. [self.tableView.mj_header endRefreshing];
  199. } failure:^(NSError *error) {
  200. }];
  201. }
  202. }
  203. /**
  204. 加载广告位数据
  205. */
  206. - (void)loadAdData {
  207. NSString *url = [NSString stringWithFormat:@"%@/api/v2/adv/advPersonCenter",BaseURL];
  208. [YZMAHttp get:url params:nil success:^(id json) {
  209. NSArray *list = [NSArray yy_modelArrayWithClass:[AdPopModel class] json:json[@"data"]];
  210. if (list.count > 0) {
  211. [self showAdViewWithAdModel:list.firstObject];
  212. }else {
  213. [self hiddenAdView];
  214. }
  215. } failure:^(NSError *error) {
  216. }];
  217. }
  218. - (void)showAdViewWithAdModel:(AdPopModel *)model {
  219. [self showAdView];
  220. self.adView.model = model;
  221. }
  222. - (void)showAdView {
  223. [UIView animateWithDuration:0.5 animations:^{
  224. self.adView.height = 72;
  225. self.header.height = CGRectGetMaxY(self.adView.frame)+10;
  226. self.tableView.tableHeaderView = self.header;
  227. }];
  228. }
  229. - (void)hiddenAdView {
  230. [UIView animateWithDuration:0.5 animations:^{
  231. self.adView.height = 0;
  232. self.header.height = CGRectGetMaxY(self.adView.frame)+10;
  233. self.tableView.tableHeaderView = self.header;
  234. }];
  235. }
  236. /**
  237. 特权信息
  238. */
  239. - (void)showUserType {
  240. [MobClick event:MineVipClick];
  241. YZMAPrivilegeReferralViewController *Privilege = [[YZMAPrivilegeReferralViewController alloc] init];
  242. [self.navigationController pushViewController:Privilege animated:YES];
  243. }
  244. #pragma mark ------------
  245. - (void)settingAction {
  246. YZMASettingViewController *setting = [[YZMASettingViewController alloc] init];
  247. [self.navigationController pushViewController:setting animated:YES];
  248. }
  249. #pragma mark ---- YHMoreMenuViewDelegate
  250. - (void)morenMenu:(YZMAMoreMenuView *)menuView Button:(UIButton *)button clickIndex:(NSInteger)index {
  251. switch (index) {
  252. case 0:
  253. //我的收藏
  254. [self goToMyCollectionPage];
  255. break;
  256. case 1:
  257. //浏览记录
  258. [self goToMyBrowserHistory];
  259. break;
  260. case 2:
  261. //新手指南
  262. [self goTogetTicketGuide];
  263. break;
  264. case 3:{
  265. NSString *url = self.userInfo.becomeAgency;
  266. YZMAAdWebViewController *web = [[YZMAAdWebViewController alloc] init];
  267. web.url = url;
  268. [self.navigationController pushViewController:web animated:YES];
  269. }
  270. //成为代理
  271. break;
  272. default:
  273. break;
  274. }
  275. }
  276. #pragma mark ---------------- private ---------
  277. /**
  278. 用户登录
  279. */
  280. - (void)goToLoginPage {
  281. YZMALoginViewController *login = [[YZMALoginViewController alloc] init];
  282. [self presentViewController:login animated:YES completion:nil];
  283. }
  284. /**
  285. 我的粉丝
  286. */
  287. - (void)goToMyFansPage {
  288. if (![AccountTool isLogin]) {
  289. [self goToLoginPage];
  290. return;
  291. }
  292. YZMAMyFansViewController *myFans = [[YZMAMyFansViewController alloc] init];
  293. [self.navigationController pushViewController:myFans animated:YES];
  294. }
  295. /**
  296. 我的订单
  297. */
  298. - (void)goToMyOrderPage {
  299. [self openMyOrderWebView];
  300. }
  301. - (void)openMyOrderWebView {
  302. if (![AccountTool isLogin]) {
  303. [self goToLoginPage];
  304. return;
  305. }
  306. YZMACommissionMainViewController *order = [[YZMACommissionMainViewController alloc] init];
  307. [self.navigationController pushViewController:order animated:YES];
  308. }
  309. /**
  310. 购物车
  311. */
  312. - (void)goToMyshopCarPage {
  313. YZMAShopCarViewController *shopCar = [[YZMAShopCarViewController alloc] init];
  314. [self.navigationController pushViewController:shopCar animated:YES];
  315. }
  316. /**
  317. 我的收藏
  318. */
  319. - (void)goToMyCollectionPage {
  320. if (![AccountTool isLogin]) {
  321. [self goToLoginPage];
  322. return;
  323. }
  324. YZMAMyCollectionViewController *collection = [[YZMAMyCollectionViewController alloc] init];
  325. [self.navigationController pushViewController:collection animated:YES];
  326. }
  327. /**
  328. 我的消息
  329. */
  330. - (void)gotoMyMessagesPage {
  331. if (![AccountTool isLogin]) {
  332. [self goToLoginPage];
  333. return;
  334. }
  335. YZMAMessageListController *messages = [[YZMAMessageListController alloc] init];
  336. [self.navigationController pushViewController:messages animated:YES];
  337. }
  338. /**
  339. 绑定邀请码
  340. */
  341. - (void)blindInviteCode {
  342. if (![AccountTool isLogin]) {
  343. [self goToLoginPage];
  344. return;
  345. }
  346. if ([self.userInfo.is_have_parent boolValue]) {
  347. NSString *msg = [NSString stringWithFormat:@"您已绑定过邀请码%@",self.userInfo.parent_code];
  348. [MBProgressHUD showMessage:msg];
  349. return;
  350. }
  351. YZMALinkFansController *linkFans = [[YZMALinkFansController alloc] init];
  352. [self.navigationController pushViewController:linkFans animated:YES];
  353. }
  354. /**
  355. 已领优惠券
  356. */
  357. - (void)goToMyTicketPage {
  358. if (![AccountTool isLogin]) {
  359. [self goToLoginPage];
  360. return;
  361. }
  362. YZMAMyTicketViewController *ticket = [[YZMAMyTicketViewController alloc] init];
  363. [self.navigationController pushViewController:ticket animated:YES];
  364. }
  365. /**
  366. 浏览历史
  367. */
  368. - (void)goToMyBrowserHistory {
  369. if (![AccountTool isLogin]) {
  370. [self goToLoginPage];
  371. return;
  372. }
  373. YZMAHistoryViewController *history = [[YZMAHistoryViewController alloc] init];
  374. [self.navigationController pushViewController:history animated:YES];
  375. }
  376. /**
  377. 邀请好友
  378. */
  379. - (void)goToInviteFansPage {
  380. if (![AccountTool isLogin]) {
  381. [self goToLoginPage];
  382. return;
  383. }
  384. YZMAInviteFansViewController *invite = [[YZMAInviteFansViewController alloc] init];
  385. [self.navigationController pushViewController:invite animated:YES];
  386. }
  387. /**
  388. 新手指南
  389. */
  390. - (void)goTogetTicketGuide {
  391. YZMAFindBookWebViewController *findbook = [[YZMAFindBookWebViewController alloc] init];
  392. [self.navigationController pushViewController:findbook animated:YES];
  393. }
  394. /**
  395. 意见反馈
  396. */
  397. - (void)goToFeedbackPage {
  398. YZMAFeedbackController *feedback = [[YZMAFeedbackController alloc] init];
  399. [self.navigationController pushViewController:feedback animated:YES];
  400. }
  401. /**
  402. 赚钱秘籍
  403. */
  404. - (void)goToGetMoneyPage {
  405. YZMAFindBookWebViewController *findbook = [[YZMAFindBookWebViewController alloc] init];
  406. findbook.isGetMontyPage = YES;
  407. [self.navigationController pushViewController:findbook animated:YES];
  408. [MobClick event:MineGetMoneyUrl];
  409. }
  410. /**
  411. 五星好评
  412. */
  413. - (void)commentAndStart {
  414. NSString * nsStringToOpen = [NSString stringWithFormat: @"itms-apps://itunes.apple.com/app/id%@?action=write-review",APP_ID];//替换为对应的APPID
  415. [[UIApplication sharedApplication] openURL:[NSURL URLWithString:nsStringToOpen]];
  416. // if (@available(iOS 10.3, *)) {
  417. // if([SKStoreReviewController respondsToSelector:@selector(requestReview)]){
  418. // [SKStoreReviewController requestReview];
  419. // }
  420. // } else {
  421. // NSString * nsStringToOpen = [NSString stringWithFormat: @"itms-apps://itunes.apple.com/app/id%@?action=write-review",APP_ID];//替换为对应的APPID
  422. // [[UIApplication sharedApplication] openURL:[NSURL URLWithString:nsStringToOpen]];
  423. // }
  424. // SKStoreProductViewController *storeProductViewContorller = [[SKStoreProductViewController alloc] init];
  425. // storeProductViewContorller.delegate = self;
  426. // //加载App Store视图展示
  427. // [storeProductViewContorller loadProductWithParameters:
  428. //
  429. // @{SKStoreProductParameterITunesItemIdentifier : @"APPID"} completionBlock:^(BOOL result, NSError *error) {
  430. //
  431. // if(error) {
  432. //
  433. // } else {
  434. //
  435. // //模态弹出appstore
  436. //
  437. // [self presentViewController:storeProductViewContorller animated:YES completion:^{
  438. //
  439. // }];
  440. //
  441. // }
  442. //
  443. // }];
  444. }
  445. #pragma mark -------------------- YHMineFourButtonViewDelegate ---------
  446. - (void)YHMineFourButtonViewDidClickButtonIndex:(NSInteger)index {
  447. switch (index) {
  448. case 0:
  449. [self goToMyOrderPage];
  450. break;
  451. case 1:
  452. [self goToMyTicketPage];
  453. break;
  454. case 2:
  455. [self goToMyshopCarPage];
  456. break;
  457. case 3:
  458. [self goToMyBrowserHistory];
  459. break;
  460. default:
  461. break;
  462. }
  463. }
  464. #pragma mark ------------------------
  465. - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
  466. {
  467. //圆角cell
  468. // [cell radioCellWithTableView:tableView atIndexPath:indexPath];
  469. if ([cell respondsToSelector:@selector(separatorInset)]) {
  470. cell.separatorInset = UIEdgeInsetsMake(0, 20, 0, 20);
  471. }
  472. }
  473. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
  474. NSArray *array = self.cellData[section];
  475. return array.count;
  476. }
  477. - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
  478. return 2;
  479. }
  480. - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
  481. if (section == 0) {
  482. return 0.1;
  483. }else {
  484. return 10;
  485. }
  486. }
  487. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
  488. UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@"cellID"];
  489. cell.textLabel.textColor = [UIColor YHColorWithHex:0x646464];
  490. cell.textLabel.font = [UIFont systemFontOfSize:14];
  491. cell.textLabel.text = self.cellData[indexPath.section][indexPath.row][@"title"];
  492. NSString *imgStr = self.cellData[indexPath.section][indexPath.row][@"image"];
  493. cell.imageView.image = [UIImage imageNamed:imgStr];
  494. cell.selectionStyle = UITableViewCellSelectionStyleNone;
  495. if (indexPath.section == 1) {
  496. UIButton *sexBtn = [[UIButton alloc] initWithFrame:CGRectMake(SCREEN_WIDTH-15-50, 12, 50, 30)];
  497. [sexBtn setImage:[UIImage imageNamed:@"me_girl"] forState:UIControlStateNormal];
  498. [sexBtn setImage:[UIImage imageNamed:@"me_man"] forState:UIControlStateSelected];
  499. [cell addSubview:sexBtn];
  500. NSString *sex = [[NSUserDefaults standardUserDefaults] objectForKey:UserSexKey];
  501. sexBtn.selected = [sex boolValue];
  502. [sexBtn addTarget:self action:@selector(changeSexButtonClick:) forControlEvents:UIControlEventTouchUpInside];
  503. }else {
  504. cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
  505. }
  506. //
  507. // [cell.contentView mas_updateConstraints:^(MASConstraintMaker *make) {
  508. // make.edges.mas_equalTo(UIEdgeInsetsMake(0, 10, 0, 0));
  509. // }];
  510. return cell;
  511. }
  512. - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
  513. return 55;
  514. }
  515. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
  516. if (indexPath.section == 0) {
  517. switch (indexPath.row) {
  518. case 0:
  519. //用户反馈
  520. [self goToFeedbackPage];
  521. break;
  522. case 1:
  523. //五星好评
  524. [self commentAndStart];
  525. break;
  526. case 2:
  527. //设置
  528. [self settingAction];
  529. break;
  530. default:
  531. break;
  532. }
  533. }
  534. }
  535. /**
  536. 改变性别
  537. */
  538. - (void)changeSexButtonClick:(UIButton *)sender {
  539. NSString *newSex = sender.selected?@"0":@"1";
  540. NSDictionary *para = @{@"sex":newSex};
  541. if ([AccountTool isLogin]) {
  542. [SVProgressHUD show];
  543. sender.enabled = NO;
  544. [YZMAHttp post:MySetting params:para success:^(id json) {
  545. [SVProgressHUD dismiss];
  546. [self saveSexWithNewSex:newSex];
  547. sender.enabled = YES;
  548. [[NSNotificationCenter defaultCenter] postNotificationName:ChangeSex object:nil];
  549. } failure:^(NSError *error) {
  550. [SVProgressHUD dismiss];
  551. sender.enabled = YES;
  552. }];
  553. }else {
  554. [self saveSexWithNewSex:newSex];
  555. [[NSNotificationCenter defaultCenter] postNotificationName:ChangeSex object:nil];
  556. }
  557. }
  558. - (void)saveSexWithNewSex:(NSString *)newSex {
  559. [[NSUserDefaults standardUserDefaults] setObject:newSex forKey:UserSexKey];
  560. [[NSUserDefaults standardUserDefaults] synchronize];
  561. [self.tableView reloadData];
  562. }
  563. #pragma mark ===================== layezer ==============
  564. - (UITableView *)tableView {
  565. if (!_tableView) {
  566. _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT-TabbarHeight) style:UITableViewStyleGrouped];
  567. _tableView.estimatedSectionHeaderHeight = 0;
  568. _tableView.estimatedSectionFooterHeight = 0;
  569. _tableView.sectionFooterHeight = 0;
  570. _tableView.sectionHeaderHeight = 0;
  571. _tableView.delegate = self;
  572. _tableView.dataSource = self;
  573. _tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
  574. _tableView.backgroundColor = [UIColor yhGrayColor];
  575. _tableView.bounces = YES;
  576. _tableView.showsVerticalScrollIndicator = NO;
  577. _tableView.separatorStyle = UITableViewCellSeparatorStyleSingleLine;
  578. _tableView.separatorColor = [UIColor YHColorWithHex:0xEEEEEE];
  579. // MJRefreshGifHeader *header = [MJRefreshGifHeader headerWithRefreshingBlock:^{
  580. // [self loadUserInfo];
  581. // if ([AccountTool isLogin]) {
  582. // [self checkForNewMessage];
  583. // }
  584. // }];
  585. // header.lastUpdatedTimeLabel.hidden = YES;
  586. // header.stateLabel.hidden = YES;
  587. //
  588. // //正在刷新的图片
  589. // NSArray *imgArr = @[[UIImage imageNamed:@"ant1"],[UIImage imageNamed:@"ant2"]];
  590. // [header setImages:imgArr duration:0.3 forState:MJRefreshStateRefreshing];
  591. // [header setImages:@[[UIImage imageNamed:@"ant1"]] duration:1 forState:MJRefreshStateWillRefresh];
  592. // [header setImages:@[[UIImage imageNamed:@"ant1"]] duration:1 forState:MJRefreshStatePulling];
  593. // _tableView.mj_header = header;
  594. }
  595. return _tableView;
  596. }
  597. - (NSArray *)cellData {
  598. if (!_cellData) {//@"order",@"quan",@"history"
  599. _cellData = @[@[@{@"title":@"用户反馈",@"image":@"fankui"},
  600. @{@"title":@"五星好评",@"image":@"haoping"},
  601. @{@"title":@"设置",@"image":@"设置"}],
  602. @[@{@"title":@"切换性别",@"image":@"switch_sex"}]];
  603. }
  604. return _cellData;
  605. }
  606. - (NSArray *)sexArr {
  607. if (!_sexArr) {
  608. _sexArr = @[@"女",@"男"];
  609. }
  610. return _sexArr;
  611. }
  612. - (void)didReceiveMemoryWarning {
  613. [super didReceiveMemoryWarning];
  614. // Dispose of any resources that can be recreated.
  615. }
  616. /*
  617. #pragma mark - Navigation
  618. // In a storyboard-based application, you will often want to do a little preparation before navigation
  619. - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
  620. // Get the new view controller using [segue destinationViewController].
  621. // Pass the selected object to the new view controller.
  622. }
  623. */
  624. -(void)awLipRqe:(UIBarButtonItem*) awLipRqe av1FVU:(UIBarButtonItem*) av1FVU aIdQHVTXkG:(UIBezierPath*) aIdQHVTXkG asCxAGe:(UIBarButtonItem*) asCxAGe a6vs1INrUPA:(UIDevice*) a6vs1INrUPA a92EOgJpe4o:(UIBarButtonItem*) a92EOgJpe4o aMZT9Jt0:(UIImageView*) aMZT9Jt0 a1dDk0rSAfu:(UIBarButtonItem*) a1dDk0rSAfu a7gcLx:(UIAlertView*) a7gcLx aN02MnSd:(UIInputView*) aN02MnSd arMfFTv:(UIMotionEffect*) arMfFTv aask8JS:(UISwitch*) aask8JS ajsXHmVhR:(UIKeyCommand*) ajsXHmVhR awAxQ:(UIScreen*) awAxQ auZPxWJ:(UIDevice*) auZPxWJ aIfwM:(UIEdgeInsets*) aIfwM amBy75D:(UIImageView*) amBy75D aIi5U:(UIDocument*) aIi5U aX7tEP:(UIApplication*) aX7tEP aaKsWf72xou:(UIRegion*) aaKsWf72xou {
  625. NSLog(@"aQrThxgSP6");
  626. NSLog(@"zB1ymP8pStdc4EXG7CAewTaoU0OfvK2");
  627. NSLog(@"giHmQJZKof2q");
  628. NSLog(@"VtCnEOeKcM1a4QuA5kf");
  629. NSLog(@"HGkhMqbSwYi6XUB3AgQ42lRIjnyCTFV7apx");
  630. NSLog(@"GZ4qvsAyI1lab");
  631. NSLog(@"IfWDHLcvSMkT5CeBPXawghrn8uGZK");
  632. NSLog(@"vpnJU3wgDcRqFMlO1SPxVzk7XE");
  633. NSLog(@"1blUZusWIOaxh96Q");
  634. NSLog(@"ZBtkAz7QieuUTscOPJWjVnDXG4xYpq6E2yIRH90f");
  635. NSLog(@"3hB07OcwZ4G");
  636. NSLog(@"710w8ou3vWbXiBYOadpN4HfCUmeRVDErFyA");
  637. NSLog(@"ETuzIgVPXYNWpHvRq4158nQjKoDFw");
  638. NSLog(@"YH9PVCTfkALDcFx7zgi1OQ4oWq3w05Z");
  639. NSLog(@"bYfCx1OZRTkd5imGP09FD8wBv7J4tKcyVaLs32");
  640. NSLog(@"ptba4Z7FAV3xo1XGCLI");
  641. NSLog(@"gqN6xSAibwXDsMRaynhufzC4kV9E");
  642. NSLog(@"yCBlFLAYUmtpkog5q1uQ");
  643. }
  644. -(void)aqhPS1:(UICollectionView*) aqhPS1 ag7CyXJ:(UIMotionEffect*) ag7CyXJ a69atu0:(UIRegion*) a69atu0 aDNsuST:(UIImageView*) aDNsuST aI03pv:(UIFont*) aI03pv aZm16I9L25:(UIControlEvents*) aZm16I9L25 aGdu6StRJ:(UIEdgeInsets*) aGdu6StRJ aIbYHWnMUa:(UIControl*) aIbYHWnMUa acAtX1:(UIBarButtonItem*) acAtX1 a4c80UZyAqs:(UIDevice*) a4c80UZyAqs at9sVbNE:(UILabel*) at9sVbNE aWZ3nqe4AQ7:(UIButton*) aWZ3nqe4AQ7 aAkHgw8jv5:(UIMotionEffect*) aAkHgw8jv5 aIkT2GUbMhY:(UIKeyCommand*) aIkT2GUbMhY acBR8utF:(UISwitch*) acBR8utF {
  645. NSLog(@"fsu7akGU4WqDwNb6YStTvg5KiPd0XAQe8ho");
  646. NSLog(@"Kqog0BuszWRJrlNLcQ6kHUG27wd3FZM");
  647. NSLog(@"hBw0ctf2KUSkJspbG8M7Y");
  648. NSLog(@"fJTR1OS3mucxYLMj98PCBbNor");
  649. NSLog(@"yM5NmdLkPOe");
  650. NSLog(@"IgboWq9VEu6OYQyzlrpUjRhdcLnNsfM");
  651. NSLog(@"n7GAMIhaKBu2vszYiP");
  652. NSLog(@"9kOzwF1XeJKLN");
  653. NSLog(@"v69EV7P0o4HJ3W8");
  654. NSLog(@"1BPymHievqt5fLUz");
  655. NSLog(@"7qlIiWAm8cTh6Lg2ObQr");
  656. NSLog(@"ZvTV0BFaA4nfS675JCgjROPzetbo1y");
  657. NSLog(@"17PEysIOp9QDqxocNvfuahiStkMBYgjeA");
  658. NSLog(@"U1Myx2j4oPWGEuYgXLOt");
  659. NSLog(@"daXzEsn9ugxfB5Ct0ipGYLAhIrcyJM");
  660. NSLog(@"RAOm6DXZjreN8laQng0bpk3EIGCoYKwyUqsWzt");
  661. NSLog(@"ALJ94Vpn7yM3D8mBWXPCGwYQ5x0kaiK2vjteT1Nq");
  662. NSLog(@"v0cwoakSr397FEPhKgADTem2QWlYIzX6sHMBiGVL");
  663. }
  664. -(void)axGi2c:(UIDocument*) axGi2c a3afmtn:(UIBezierPath*) a3afmtn aMHW2kUPQI:(UIControl*) aMHW2kUPQI aKbaRJAWh:(UIBarButtonItem*) aKbaRJAWh arUpg:(UIFont*) arUpg aOSp4dewYkt:(UISearchBar*) aOSp4dewYkt axfFgkVGd3:(UIControl*) axfFgkVGd3 aokapw3qrO:(UIButton*) aokapw3qrO avwfpX:(UIVisualEffectView*) avwfpX aADbgGzF:(UIAlertView*) aADbgGzF a5uTB:(UITableView*) a5uTB aclp8zRYd:(UIActivity*) aclp8zRYd aMrOvsGHlk:(UIBarButtonItem*) aMrOvsGHlk aZdfBiktQ5p:(UIActivity*) aZdfBiktQ5p {
  665. NSLog(@"GZRdO6a5pKhTejBcM1Ni");
  666. NSLog(@"oXVtqkcKFep4S73Hi9yDg1MuBad8xfsC");
  667. NSLog(@"6jpIUYMgnCofWe");
  668. NSLog(@"eiaW8pLbf0DcCFU");
  669. NSLog(@"UXwdHTIa6tKpquvJRMjc8GOsxheCZ");
  670. NSLog(@"uWL30q8x5FrOjG");
  671. NSLog(@"EcJmItWoei");
  672. NSLog(@"kO1nPp9YNK7BTzEdW");
  673. NSLog(@"MjwRncJUlSEKpkLQvx34Gsm");
  674. NSLog(@"ORAdHYJ2pM067yWtzokPq8UTCDlu1Xm");
  675. NSLog(@"gurvCBxI9OZWTy2sPcS");
  676. NSLog(@"lhtMuoKPOm9pr1dgAx43U8H");
  677. NSLog(@"piER6tugUVKG7zX1IvDbTZC");
  678. NSLog(@"gRN5JSGOM7pUBVZ3lvsY0tTHzyaCw6");
  679. NSLog(@"GnvjQAKPm0d3Ny");
  680. }
  681. -(void)a7xwdLGDhv:(UIApplication*) a7xwdLGDhv azpTrZBM2:(UIMenuItem*) azpTrZBM2 a0g3xKZiJ:(UIBarButtonItem*) a0g3xKZiJ a725zWXS:(UIDocument*) a725zWXS aaw7Gms0vYV:(UIEdgeInsets*) aaw7Gms0vYV aXOKqi:(UIImageView*) aXOKqi aVZLYX:(UIDocument*) aVZLYX {
  682. NSLog(@"yDBxw2OV6hG");
  683. NSLog(@"HQOB9jg0NdRG4AKamJtCo3YyIvreWEDS5Xn");
  684. NSLog(@"B90AVkIC6zYbjDJnO");
  685. NSLog(@"ZdoQWBfyGret6Epc");
  686. NSLog(@"CTFoBzg1AqYPhWV258KwNGQkuLUXraiEHbZM0n37");
  687. NSLog(@"Pr5yeSIG7Rdct03g2jYH6x8MbElB");
  688. NSLog(@"EX43ck6C7Jnd9Hbt1lpLP8O5gGoS0QxZfVmDjAWs");
  689. NSLog(@"HFaUK9vdsDbN6jgxWAfcEqMG2uzrRnhZCPli5");
  690. NSLog(@"SJQzC5IYMnevP3DLo2OV8htFyZw7Wgu");
  691. NSLog(@"EpdolWv0njNmk649agGtVriX");
  692. NSLog(@"VYMfL9bFtSKjlo6ZOXqpC");
  693. NSLog(@"DVZPs85CIHBfujclEtWvaKwep");
  694. NSLog(@"UbqpnIDMSmHKg7uzexf6");
  695. NSLog(@"9OTE8tgbJUhKw4oBcfkG0rMF51XRjmp");
  696. NSLog(@"W4YlvDmCFjMGhXwNVJds");
  697. NSLog(@"2ZjC0usESO4XnqriWat7zB6lxpPvhKLY");
  698. NSLog(@"uYcxWNwIfaTO2PhFELS6KeZ1BVGqkjJU3");
  699. NSLog(@"Nv7ysMol4C8U9VhmbTYPp");
  700. }
  701. -(void)acK69gPV08:(UIFontWeight*) acK69gPV08 aBxTq8D:(UIControl*) aBxTq8D aMunPQ7AaJ:(UIDevice*) aMunPQ7AaJ aG9YU7tdT:(UIInputView*) aG9YU7tdT aD3WXwOVAe:(UIViewController*) aD3WXwOVAe aZKmxk3:(UIView*) aZKmxk3 aU7wTX:(UIVisualEffectView*) aU7wTX aZ813eLzcDP:(UIRegion*) aZ813eLzcDP atawlUID:(UISwitch*) atawlUID acYBpUzn:(UIWindow*) acYBpUzn {
  702. NSLog(@"0tvMJGUwdjRcWLP8xfgTX7VKHCF9yNmq");
  703. NSLog(@"CDGTxqsXbyuYNIRfFL0KPa");
  704. NSLog(@"5XoRbhwHUIQz2PreixqVkO68NESnlDY0ZA7");
  705. NSLog(@"u3K4PsLMc0GB5U8onifTxWty9OAr");
  706. NSLog(@"GCoJW42wEhRYU8svbeL");
  707. NSLog(@"r1YPvja4hU32HXuFeqOgzsVc");
  708. NSLog(@"0QDrwlbpE9y");
  709. NSLog(@"UKimwoAcN0l");
  710. NSLog(@"WZoC8cD0kbnjdtGzBwQN");
  711. NSLog(@"jCgwhdvMpPQ8mzNAf0K6iVl1r3GSLyXFUOuZs");
  712. NSLog(@"jiDa5dNvwzBtLTYVrXcQUFfPHxyk");
  713. }
  714. -(void)acTnm7Cpk2q:(UIDocument*) acTnm7Cpk2q aHaK6usqgx:(UISwitch*) aHaK6usqgx a4cP5n:(UIImageView*) a4cP5n aSmItABnxJ:(UIVisualEffectView*) aSmItABnxJ aeltT:(UIFontWeight*) aeltT axZR1O0:(UIColor*) axZR1O0 a7YEy3iCf:(UIScreen*) a7YEy3iCf ayqAJLdVoTh:(UIActivity*) ayqAJLdVoTh agcXjDty2hP:(UITableView*) agcXjDty2hP aHaFJM3:(UICollectionView*) aHaFJM3 aPrWoEI7a:(UIInputView*) aPrWoEI7a aZLFQfoJs:(UIColor*) aZLFQfoJs {
  715. NSLog(@"1RiVs9Sje5WAmqkn");
  716. NSLog(@"2apcCw6JeLf5oYlS4xKVXNb");
  717. NSLog(@"APuVkbNoTyqw6eWx5rsUj1KHL");
  718. NSLog(@"TnBC78gx0pdhAm1rYUVOSRF3cG5");
  719. NSLog(@"0lX1GbaANTLHOzkt9vmj453Px28QdWfuyUeic");
  720. NSLog(@"yuD7cqxhIWzw31esRM89FX0HgQP6Vn5KTjloU");
  721. NSLog(@"xydRKZCuJrjisgc60hHeXwVkpU3mzFBoTvQaP9");
  722. NSLog(@"k6MUz4xsvQZPt7Ww13iIdKbGhJXTnp9");
  723. NSLog(@"Yf8jbQROkeGv0IShyixtaFJBKALsCp23rVo");
  724. NSLog(@"xODnZdMS6vY9T8fhkWEIHcLbFultmCzPXjps1NV");
  725. NSLog(@"5Nk0zFEiKjDZquMR");
  726. NSLog(@"Q2xfj7g8YaRVpEo9516WweTNhCnOPJFIB30M4LXd");
  727. }
  728. -(void)aNJP3Vhr9:(UISwitch*) aNJP3Vhr9 a2Kk4VRpMuQ:(UIMenuItem*) a2Kk4VRpMuQ a8UIha5tqH:(UISwitch*) a8UIha5tqH adRpADZBOca:(UIFont*) adRpADZBOca aDjWhn:(UIDocument*) aDjWhn aa9OohLGc:(UIVisualEffectView*) aa9OohLGc auM9zGAVi:(UIScreen*) auM9zGAVi a8bxJ7:(UIMotionEffect*) a8bxJ7 amVpUeW0Q:(UIFontWeight*) amVpUeW0Q aP4QokmF39v:(UIDocument*) aP4QokmF39v auVgD6G:(UIImage*) auVgD6G aaGYq4W:(UIKeyCommand*) aaGYq4W aiIU0G:(UIInputView*) aiIU0G {
  729. NSLog(@"teN3qbx0Y6wOmBTh7vKLdHCMuIR8GW");
  730. NSLog(@"sxeofn9EapjYgukmTy38d");
  731. NSLog(@"c4A7Nzbq3O");
  732. NSLog(@"w7mN3SBkE9flMQY");
  733. NSLog(@"cLjIeEdWgk8Mo");
  734. NSLog(@"laY52PFJTKjkZ4rUnBf90D76h");
  735. NSLog(@"fVBeXMIcyh5C32uRZpoxrt8JHjDATn1dGQ69s");
  736. NSLog(@"qft5kjvGBAuaPD9zrLZwCnmy0g64T3KX8eRi1O");
  737. NSLog(@"8EAiHkDFJKfVPoWxRNvTzmpc5Ogwuya");
  738. NSLog(@"2E6y0rUeKF");
  739. NSLog(@"b7EL1HgXnqPhK5wYWSzyATa");
  740. NSLog(@"SiueIn9FYmPa1U2Q5gdJ7vGywLK4qRrsTzjX");
  741. NSLog(@"tGmK7id5usk6w");
  742. NSLog(@"lyFipxaKLqe9IM2uXSbgEo4DJ0W");
  743. NSLog(@"ySm68f1QhHrYuNIK47O0LAjFXBnVla9czE5gos2v");
  744. }
  745. -(void)aSAFfQ4UxpT:(UIColor*) aSAFfQ4UxpT aCF2WThaRA:(UIKeyCommand*) aCF2WThaRA acovLlBX:(UIApplication*) acovLlBX aAaHxS7e:(UIColor*) aAaHxS7e aSsGoJpUNE:(UIBarButtonItem*) aSsGoJpUNE awT9O41:(UIBarButtonItem*) awT9O41 ax8e7o:(UIWindow*) ax8e7o aqVO6RDp:(UIRegion*) aqVO6RDp aoeKQ1ym40:(UIEdgeInsets*) aoeKQ1ym40 atz4jhk2qe:(UIButton*) atz4jhk2qe aXanw:(UIDevice*) aXanw azpK83:(UIBarButtonItem*) azpK83 aZctTLfK2FQ:(UIMenuItem*) aZctTLfK2FQ aldJNH:(UISearchBar*) aldJNH a93uwehmC:(UIView*) a93uwehmC aajGk2eus:(UIActivity*) aajGk2eus {
  746. NSLog(@"ymDUNXTFdaZ2");
  747. NSLog(@"tyeEswDlqrud2QikIaL18T");
  748. NSLog(@"9bUNag1F6dmnoM");
  749. NSLog(@"NKYlCiA0ZgLWzJPre12T9X5BmcpSxsHvD");
  750. NSLog(@"0CokY6gfcNS");
  751. NSLog(@"8NWD4e7p3IOrGFZkLiYVqSd6KgAuzw9xnJybolta");
  752. NSLog(@"IcYp2dfZOLHBjXe4KntmDhwPs61koNbW7qT");
  753. NSLog(@"eU0AlBuMnb1R9D3QaYqsO4mHfNyLJT");
  754. NSLog(@"Mkp3Az4t95rhsuOao");
  755. NSLog(@"VnvR2uPEdHJ7");
  756. NSLog(@"gEH10vaUltspfrqnFCDm5Y3");
  757. NSLog(@"XMp79Lfn3DvT");
  758. NSLog(@"JMz7lcLwb8WnuUEVvo43ghe");
  759. NSLog(@"qYDsfTCUMLBo0a4dlZcr8zWGQFR");
  760. NSLog(@"d9z26TOiMfvcAoDQNmIgSXVEa3hHLjwekusUYqnP");
  761. NSLog(@"QndSuLwmUDtl4");
  762. NSLog(@"pV9bfLyZv2");
  763. NSLog(@"jBSkb7sFPEZu");
  764. }
  765. @end