口袋版本的一折买

YZMAMineMainViewController.m 31KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929
  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 "YZMAFeedbackController.h"
  18. #import <StoreKit/StoreKit.h>
  19. #import "YZMAFindBookWebViewController.h"
  20. #import "UITableViewCell+Cc_CornRadio.h"
  21. #import "YZMAFourButtonView.h"
  22. #import "YZMAShopCarViewController.h"
  23. #import "CCActionSheet.h"
  24. #import "YZMAMineBlanceView.h"
  25. #import "YZMAMineOrderView.h"
  26. #import "YZMAMoreMenuView.h"
  27. #import "YZMAOrderMainViewController.h"
  28. #import "YZMAOrderMainViewController.h"
  29. #import "YZMACommissionMainViewController.h"
  30. #import "YZMAMyFansViewController.h"
  31. #import "YZMAMyCollectionViewController.h"
  32. #import "YZMAInviteFansViewController.h"
  33. #import "YZMAMessageListController.h"
  34. #import "YZMAUserInfo.h"
  35. #import "YZMAUserInfoView.h"
  36. #import "YZMACollectionMainViewController.h"
  37. #import "YZMALinkFansController.h"
  38. #import "YZMAPrivilegeReferralViewController.h"
  39. #import "YZMAUserInfo.h"
  40. #import "YZMAMonthMainViewController.h"
  41. #import "YZMAMineAdView.h"
  42. #import "YZMAAccountDetailController.h"
  43. #import "AdPopModel.h"
  44. #import "AdJumpManager.h"
  45. #import "UIView+BABadgeView.h"
  46. #import "YZMABuyLimitMainController.h"
  47. #import "YZMAHistoryViewController.h"
  48. #import "YZMAUserView.h"
  49. #import "YZMAWebDetailController.h"
  50. #import "TodayJumpManager.h"
  51. @interface YZMAMineMainViewController ()
  52. <
  53. UITableViewDelegate,
  54. UITableViewDataSource,
  55. CCActionSheetDelegate,
  56. YHMineFourButtonViewDelegate,
  57. YHMoreMenuViewDelegate
  58. >
  59. @property (nonatomic, strong) UITableView *tableView;
  60. @property (nonatomic, strong) UIView *header;
  61. @property (nonatomic, strong) UIImageView *headerImg;
  62. //@property (nonatomic, strong) YZMAUserInfoView *userInfoView;
  63. //@property (nonatomic, strong) YZMAMineBlanceView *blanceView;
  64. //@property (nonatomic, strong) YZMAMineOrderView *mineOrderView;
  65. @property (nonatomic, strong) YZMAMoreMenuView *topMenuView;
  66. //@property (nonatomic, strong) YZMAMoreMenuView *bottomMenuView;
  67. @property (nonatomic, strong) YZMAMineAdView *adView;
  68. @property (nonatomic, strong) UIButton *messageBtn;
  69. @property (nonatomic, strong) YZMAUserInfo *userInfo;
  70. @property (nonatomic, strong) YZMAUserView *userView;
  71. /*dataSource**/
  72. @property (nonatomic, strong) NSArray *cellData;
  73. @property (nonatomic, strong) NSArray *sexArr;
  74. @end
  75. @implementation YZMAMineMainViewController
  76. - (void)viewWillDisappear:(BOOL)animated {
  77. [super viewWillDisappear:animated];
  78. [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault];
  79. }
  80. - (void)viewDidAppear:(BOOL)animated {
  81. [super viewDidAppear:animated];
  82. [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
  83. }
  84. - (void)viewWillAppear:(BOOL)animated {
  85. [super viewWillAppear:animated];
  86. [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
  87. [self loadUserInfo];
  88. if ([AccountTool isLogin]) {
  89. [self checkForNewMessage];
  90. }
  91. }
  92. - (void)viewDidLoad {
  93. [super viewDidLoad];
  94. [self configNavightion];
  95. [self configTableView];
  96. [self loadAdData];
  97. }
  98. - (void)configNavightion {
  99. self.navigationBar.backgroundColor = [UIColor clearColor];
  100. self.navigationBar.hidden = YES;
  101. }
  102. - (void)configTableView {
  103. [self.view addSubview:self.tableView];
  104. __weak typeof(self) weakSelf = self;
  105. //头部背景图
  106. self.headerImg = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 170)];
  107. self.headerImg.userInteractionEnabled = YES;
  108. self.header.backgroundColor = [UIColor homeRedColor];
  109. self.headerImg.contentMode = UIViewContentModeScaleAspectFill;
  110. //头视图
  111. self.header = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 170)];
  112. self.headerImg.backgroundColor = [UIColor homeRedColor];
  113. [self.header addSubview:self.headerImg];
  114. //上边的多菜单
  115. NSArray *buttons = @[@{@"title":@"我的收藏",@"image":@"shoucang"},
  116. @{@"title":@"浏览记录",@"image":@"liulan"},
  117. @{@"title":@"新手指南",@"image":@"zhinan"}];
  118. self.topMenuView = [[YZMAMoreMenuView alloc] initWithFrame:CGRectMake(0, self.header.bottom, SCREEN_WIDTH, (SCREEN_WIDTH)/4) buttonInfoArray:buttons];
  119. self.topMenuView.delelgate = self;
  120. [self.header addSubview:self.topMenuView];
  121. //广告view
  122. self.adView = [[YZMAMineAdView alloc] initWithFrame:CGRectMake(0, self.topMenuView.bottom, SCREEN_WIDTH, 0)];
  123. self.adView.tapAdBlock = ^(AdPopModel *model) {
  124. [MobClick event:AdvClick label:@"3"];
  125. [TodayJumpManager jumpToPageWithModel:model ParentViewControll:weakSelf];
  126. };
  127. self.adView.closeBlock = ^{
  128. [weakSelf hiddenAdView];
  129. };
  130. [self.header addSubview:self.adView];
  131. self.header.height = CGRectGetMaxY(self.adView.frame)+10;
  132. self.tableView.tableHeaderView = self.header;
  133. //用户信息
  134. self.userView = [[YZMAUserView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 95)];
  135. self.userView.centerY = KStatusBarHeight + (self.headerImg.height-KStatusBarHeight)/2;
  136. self.userView.tapActionBlock = ^{
  137. if ([AccountTool isLogin]) {
  138. [weakSelf settingAction];
  139. }else {
  140. [weakSelf goToLoginPage];
  141. }
  142. };
  143. [self.tableView addSubview:self.userView];
  144. //消息按钮
  145. // UIButton *setButton = [[UIButton alloc] initWithFrame:CGRectMake(SCREEN_WIDTH-20-40, KStatusBarHeight+10, 40, 40)];
  146. // [setButton setImage:[UIImage imageNamed:@"message_icon"] forState:UIControlStateNormal];
  147. // [setButton addTarget:self action:@selector(gotoMyMessagesPage) forControlEvents:UIControlEventTouchUpInside];
  148. // self.messageBtn = setButton;
  149. // [setButton ba_addDotWithColor:[UIColor redColor]];
  150. // [setButton ba_moveBadgeWithX:-12 Y:15];
  151. // [self.tableView addSubview:setButton];
  152. if (@available(iOS 11.0, *)) {
  153. self.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;//UIScrollView也适用
  154. }else {
  155. self.automaticallyAdjustsScrollViewInsets = NO;
  156. }
  157. }
  158. - (void)scrollViewDidScroll:(UIScrollView *)scrollView
  159. {
  160. CGFloat yOffset = scrollView.contentOffset.y;
  161. if(yOffset < 0)
  162. {
  163. self.headerImg.y = yOffset;
  164. self.headerImg.height = 170+ABS(yOffset);
  165. }
  166. }
  167. /**
  168. 加载用户信息
  169. */
  170. - (void)loadUserInfo {
  171. if (![AccountTool isLogin]) {
  172. [self noLoginView];
  173. return;
  174. }
  175. [YZMAHttp post:UserInfo params:nil success:^(id json) {
  176. self.userInfo = [YZMAUserInfo yy_modelWithJSON:json];
  177. [self.userView setLoginView:self.userInfo];//设置用户信息
  178. } failure:^(NSError *error) {
  179. if (![AccountTool isLogin]) {
  180. [self noLoginView];
  181. }
  182. }];
  183. }
  184. - (void)noLoginView {
  185. [self.userView setUnLoginView];
  186. }
  187. /**
  188. 检查是否有新消息
  189. */
  190. - (void)checkForNewMessage {
  191. if ([AccountTool isLogin]) {
  192. NSString *url = [NSString stringWithFormat:@"%@/api/v2/message_push/messageNew",BaseURL];
  193. [YZMAHttp post:url params:nil success:^(id json) {
  194. NSNumber *new = json[@"data"][@"message_new"];
  195. if ([new boolValue]) {
  196. [self.messageBtn ba_showBadge];
  197. }else {
  198. [self.messageBtn ba_hiddenBadge];
  199. }
  200. [self.tableView.mj_header endRefreshing];
  201. } failure:^(NSError *error) {
  202. }];
  203. }
  204. }
  205. /**
  206. 加载广告位数据
  207. */
  208. - (void)loadAdData {
  209. NSString *url = [NSString stringWithFormat:@"%@/api/v2/adv/advByType",BaseURL];
  210. NSDictionary *para = @{@"adv_type":@"4"};
  211. [YZMAHttp get:url params:para success:^(id json) {
  212. NSArray *list = [NSArray yy_modelArrayWithClass:[AdPopModel class] json:json[@"data"]];
  213. if (list.count > 0) {
  214. [self showAdViewWithAdModel:list.firstObject];
  215. }else {
  216. [self hiddenAdView];
  217. }
  218. } failure:^(NSError *error) {
  219. }];
  220. }
  221. - (void)showAdViewWithAdModel:(AdPopModel *)model {
  222. [self showAdView];
  223. self.adView.model = model;
  224. }
  225. - (void)showAdView {
  226. [UIView animateWithDuration:0.5 animations:^{
  227. self.adView.height = 72;
  228. self.header.height = CGRectGetMaxY(self.adView.frame)+10;
  229. self.tableView.tableHeaderView = self.header;
  230. }];
  231. }
  232. - (void)hiddenAdView {
  233. [UIView animateWithDuration:0.5 animations:^{
  234. self.adView.height = 0;
  235. self.header.height = CGRectGetMaxY(self.adView.frame)+10;
  236. self.tableView.tableHeaderView = self.header;
  237. }];
  238. }
  239. /**
  240. 特权信息
  241. */
  242. - (void)showUserType {
  243. [MobClick event:MineVipClick];
  244. YZMAPrivilegeReferralViewController *Privilege = [[YZMAPrivilegeReferralViewController alloc] init];
  245. [self.navigationController pushViewController:Privilege animated:YES];
  246. }
  247. #pragma mark ------------
  248. - (void)settingAction {
  249. YZMASettingViewController *setting = [[YZMASettingViewController alloc] init];
  250. [self.navigationController pushViewController:setting animated:YES];
  251. }
  252. #pragma mark ---- YHMoreMenuViewDelegate
  253. - (void)morenMenu:(YZMAMoreMenuView *)menuView Button:(UIButton *)button clickIndex:(NSInteger)index {
  254. switch (index) {
  255. case 0:
  256. //我的收藏
  257. [self goToMyCollectionPage];
  258. break;
  259. case 1:
  260. //浏览记录
  261. [self goToMyBrowserHistory];
  262. break;
  263. case 2:
  264. //新手指南
  265. [self goTogetTicketGuide];
  266. break;
  267. case 3:{
  268. NSString *url = self.userInfo.becomeAgency;
  269. YZMAWebDetailController *web = [[YZMAWebDetailController alloc] init];
  270. web.url = url;
  271. [self.navigationController pushViewController:web animated:YES];
  272. }
  273. //成为代理
  274. break;
  275. default:
  276. break;
  277. }
  278. }
  279. #pragma mark ---------------- private ---------
  280. /**
  281. 用户登录
  282. */
  283. - (void)goToLoginPage {
  284. YZMALoginViewController *login = [[YZMALoginViewController alloc] init];
  285. [self presentViewController:login animated:YES completion:nil];
  286. }
  287. /**
  288. 我的粉丝
  289. */
  290. - (void)goToMyFansPage {
  291. if (![AccountTool isLogin]) {
  292. [self goToLoginPage];
  293. return;
  294. }
  295. YZMAMyFansViewController *myFans = [[YZMAMyFansViewController alloc] init];
  296. [self.navigationController pushViewController:myFans animated:YES];
  297. }
  298. /**
  299. 我的订单
  300. */
  301. - (void)goToMyOrderPage {
  302. [self openMyOrderWebView];
  303. }
  304. - (void)openMyOrderWebView {
  305. if (![AccountTool isLogin]) {
  306. [self goToLoginPage];
  307. return;
  308. }
  309. YZMACommissionMainViewController *order = [[YZMACommissionMainViewController alloc] init];
  310. [self.navigationController pushViewController:order animated:YES];
  311. }
  312. /**
  313. 购物车
  314. */
  315. - (void)goToMyshopCarPage {
  316. YZMAShopCarViewController *shopCar = [[YZMAShopCarViewController alloc] init];
  317. [self.navigationController pushViewController:shopCar animated:YES];
  318. }
  319. /**
  320. 我的收藏
  321. */
  322. - (void)goToMyCollectionPage {
  323. if (![AccountTool isLogin]) {
  324. [self goToLoginPage];
  325. return;
  326. }
  327. YZMAMyCollectionViewController *collection = [[YZMAMyCollectionViewController alloc] init];
  328. [self.navigationController pushViewController:collection animated:YES];
  329. }
  330. /**
  331. 我的消息
  332. */
  333. - (void)gotoMyMessagesPage {
  334. if (![AccountTool isLogin]) {
  335. [self goToLoginPage];
  336. return;
  337. }
  338. YZMAMessageListController *messages = [[YZMAMessageListController alloc] init];
  339. [self.navigationController pushViewController:messages animated:YES];
  340. }
  341. /**
  342. 绑定邀请码
  343. */
  344. - (void)blindInviteCode {
  345. if (![AccountTool isLogin]) {
  346. [self goToLoginPage];
  347. return;
  348. }
  349. if ([self.userInfo.is_have_parent boolValue]) {
  350. NSString *msg = [NSString stringWithFormat:@"您已绑定过邀请码%@",self.userInfo.parent_code];
  351. [MBProgressHUD showMessage:msg];
  352. return;
  353. }
  354. YZMALinkFansController *linkFans = [[YZMALinkFansController alloc] init];
  355. [self.navigationController pushViewController:linkFans animated:YES];
  356. }
  357. /**
  358. 已领优惠券
  359. */
  360. - (void)goToMyTicketPage {
  361. if (![AccountTool isLogin]) {
  362. [self goToLoginPage];
  363. return;
  364. }
  365. YZMAMyTicketViewController *ticket = [[YZMAMyTicketViewController alloc] init];
  366. [self.navigationController pushViewController:ticket animated:YES];
  367. }
  368. /**
  369. 浏览历史
  370. */
  371. - (void)goToMyBrowserHistory {
  372. if (![AccountTool isLogin]) {
  373. [self goToLoginPage];
  374. return;
  375. }
  376. YZMAHistoryViewController *history = [[YZMAHistoryViewController alloc] init];
  377. [self.navigationController pushViewController:history animated:YES];
  378. }
  379. /**
  380. 邀请好友
  381. */
  382. - (void)goToInviteFansPage {
  383. if (![AccountTool isLogin]) {
  384. [self goToLoginPage];
  385. return;
  386. }
  387. YZMAInviteFansViewController *invite = [[YZMAInviteFansViewController alloc] init];
  388. [self.navigationController pushViewController:invite animated:YES];
  389. }
  390. /**
  391. 新手指南
  392. */
  393. - (void)goTogetTicketGuide {
  394. YZMAFindBookWebViewController *findbook = [[YZMAFindBookWebViewController alloc] init];
  395. [self.navigationController pushViewController:findbook animated:YES];
  396. }
  397. /**
  398. 意见反馈
  399. */
  400. - (void)goToFeedbackPage {
  401. YZMAFeedbackController *feedback = [[YZMAFeedbackController alloc] init];
  402. [self.navigationController pushViewController:feedback animated:YES];
  403. }
  404. /**
  405. 赚钱秘籍
  406. */
  407. - (void)goToGetMoneyPage {
  408. YZMAFindBookWebViewController *findbook = [[YZMAFindBookWebViewController alloc] init];
  409. findbook.isGetMontyPage = YES;
  410. [self.navigationController pushViewController:findbook animated:YES];
  411. [MobClick event:MineGetMoneyUrl];
  412. }
  413. /**
  414. 五星好评
  415. */
  416. - (void)commentAndStart {
  417. NSString * nsStringToOpen = [NSString stringWithFormat: @"itms-apps://itunes.apple.com/app/id%@?action=write-review",APP_ID];//替换为对应的APPID
  418. [[UIApplication sharedApplication] openURL:[NSURL URLWithString:nsStringToOpen]];
  419. // if (@available(iOS 10.3, *)) {
  420. // if([SKStoreReviewController respondsToSelector:@selector(requestReview)]){
  421. // [SKStoreReviewController requestReview];
  422. // }
  423. // } else {
  424. // NSString * nsStringToOpen = [NSString stringWithFormat: @"itms-apps://itunes.apple.com/app/id%@?action=write-review",APP_ID];//替换为对应的APPID
  425. // [[UIApplication sharedApplication] openURL:[NSURL URLWithString:nsStringToOpen]];
  426. // }
  427. // SKStoreProductViewController *storeProductViewContorller = [[SKStoreProductViewController alloc] init];
  428. // storeProductViewContorller.delegate = self;
  429. // //加载App Store视图展示
  430. // [storeProductViewContorller loadProductWithParameters:
  431. //
  432. // @{SKStoreProductParameterITunesItemIdentifier : @"APPID"} completionBlock:^(BOOL result, NSError *error) {
  433. //
  434. // if(error) {
  435. //
  436. // } else {
  437. //
  438. // //模态弹出appstore
  439. //
  440. // [self presentViewController:storeProductViewContorller animated:YES completion:^{
  441. //
  442. // }];
  443. //
  444. // }
  445. //
  446. // }];
  447. }
  448. #pragma mark -------------------- YHMineFourButtonViewDelegate ---------
  449. - (void)YHMineFourButtonViewDidClickButtonIndex:(NSInteger)index {
  450. switch (index) {
  451. case 0:
  452. [self goToMyOrderPage];
  453. break;
  454. case 1:
  455. [self goToMyTicketPage];
  456. break;
  457. case 2:
  458. [self goToMyshopCarPage];
  459. break;
  460. case 3:
  461. [self goToMyBrowserHistory];
  462. break;
  463. default:
  464. break;
  465. }
  466. }
  467. #pragma mark ------------------------
  468. - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
  469. {
  470. //圆角cell
  471. // [cell radioCellWithTableView:tableView atIndexPath:indexPath];
  472. if ([cell respondsToSelector:@selector(separatorInset)]) {
  473. cell.separatorInset = UIEdgeInsetsMake(0, 20, 0, 20);
  474. }
  475. }
  476. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
  477. NSArray *array = self.cellData[section];
  478. return array.count;
  479. }
  480. - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
  481. return 1;
  482. }
  483. - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
  484. if (section == 0) {
  485. return 0.1;
  486. }else {
  487. return 10;
  488. }
  489. }
  490. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
  491. UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@"cellID"];
  492. cell.textLabel.textColor = [UIColor YHColorWithHex:0x646464];
  493. cell.textLabel.font = [UIFont systemFontOfSize:14];
  494. cell.textLabel.text = self.cellData[indexPath.section][indexPath.row][@"title"];
  495. NSString *imgStr = self.cellData[indexPath.section][indexPath.row][@"image"];
  496. cell.imageView.image = [UIImage imageNamed:imgStr];
  497. cell.selectionStyle = UITableViewCellSelectionStyleNone;
  498. if (indexPath.section == 1) {
  499. UIButton *sexBtn = [[UIButton alloc] initWithFrame:CGRectMake(SCREEN_WIDTH-15-50, 12, 50, 30)];
  500. [sexBtn setImage:[UIImage imageNamed:@"me_girl"] forState:UIControlStateNormal];
  501. [sexBtn setImage:[UIImage imageNamed:@"me_man"] forState:UIControlStateSelected];
  502. [cell addSubview:sexBtn];
  503. NSString *sex = [[NSUserDefaults standardUserDefaults] objectForKey:UserSexKey];
  504. sexBtn.selected = [sex boolValue];
  505. [sexBtn addTarget:self action:@selector(changeSexButtonClick:) forControlEvents:UIControlEventTouchUpInside];
  506. }else {
  507. cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
  508. }
  509. //
  510. // [cell.contentView mas_updateConstraints:^(MASConstraintMaker *make) {
  511. // make.edges.mas_equalTo(UIEdgeInsetsMake(0, 10, 0, 0));
  512. // }];
  513. return cell;
  514. }
  515. - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
  516. return 55;
  517. }
  518. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
  519. if (indexPath.section == 0) {
  520. switch (indexPath.row) {
  521. case 0:
  522. //用户反馈
  523. [self goToFeedbackPage];
  524. break;
  525. case 1:
  526. //五星好评
  527. [self commentAndStart];
  528. break;
  529. case 2:
  530. //设置
  531. [self settingAction];
  532. break;
  533. // case 3:
  534. // //设置
  535. // {
  536. // YZMAWebDetailController *web = [[YZMAWebDetailController alloc] init];
  537. // web.url = @"http://yhq.quyaqu.com/newh5/youhuiquan/pintuan/dist/";
  538. // [self.navigationController pushViewController:web animated:YES];
  539. // }
  540. break;
  541. default:
  542. break;
  543. }
  544. }
  545. }
  546. /**
  547. 改变性别
  548. */
  549. - (void)changeSexButtonClick:(UIButton *)sender {
  550. NSString *newSex = sender.selected?@"0":@"1";
  551. NSDictionary *para = @{@"sex":newSex};
  552. if ([AccountTool isLogin]) {
  553. [SVProgressHUD show];
  554. sender.enabled = NO;
  555. [YZMAHttp post:MySetting params:para success:^(id json) {
  556. [SVProgressHUD dismiss];
  557. [self saveSexWithNewSex:newSex];
  558. sender.enabled = YES;
  559. [[NSNotificationCenter defaultCenter] postNotificationName:ChangeSex object:nil];
  560. } failure:^(NSError *error) {
  561. [SVProgressHUD dismiss];
  562. sender.enabled = YES;
  563. }];
  564. }else {
  565. [self saveSexWithNewSex:newSex];
  566. [[NSNotificationCenter defaultCenter] postNotificationName:ChangeSex object:nil];
  567. }
  568. }
  569. - (void)saveSexWithNewSex:(NSString *)newSex {
  570. [[NSUserDefaults standardUserDefaults] setObject:newSex forKey:UserSexKey];
  571. [[NSUserDefaults standardUserDefaults] synchronize];
  572. [self.tableView reloadData];
  573. }
  574. #pragma mark ===================== layezer ==============
  575. - (UITableView *)tableView {
  576. if (!_tableView) {
  577. _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT-TabbarHeight) style:UITableViewStyleGrouped];
  578. _tableView.estimatedSectionHeaderHeight = 0;
  579. _tableView.estimatedSectionFooterHeight = 0;
  580. _tableView.sectionFooterHeight = 0;
  581. _tableView.sectionHeaderHeight = 0;
  582. _tableView.delegate = self;
  583. _tableView.dataSource = self;
  584. _tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
  585. _tableView.backgroundColor = [UIColor yhGrayColor];
  586. _tableView.bounces = YES;
  587. _tableView.showsVerticalScrollIndicator = NO;
  588. _tableView.separatorStyle = UITableViewCellSeparatorStyleSingleLine;
  589. _tableView.separatorColor = [UIColor YHColorWithHex:0xEEEEEE];
  590. // MJRefreshGifHeader *header = [MJRefreshGifHeader headerWithRefreshingBlock:^{
  591. // [self loadUserInfo];
  592. // if ([AccountTool isLogin]) {
  593. // [self checkForNewMessage];
  594. // }
  595. // }];
  596. // header.lastUpdatedTimeLabel.hidden = YES;
  597. // header.stateLabel.hidden = YES;
  598. //
  599. // //正在刷新的图片
  600. // NSArray *imgArr = @[[UIImage imageNamed:@"ant1"],[UIImage imageNamed:@"ant2"]];
  601. // [header setImages:imgArr duration:0.3 forState:MJRefreshStateRefreshing];
  602. // [header setImages:@[[UIImage imageNamed:@"ant1"]] duration:1 forState:MJRefreshStateWillRefresh];
  603. // [header setImages:@[[UIImage imageNamed:@"ant1"]] duration:1 forState:MJRefreshStatePulling];
  604. // _tableView.mj_header = header;
  605. }
  606. return _tableView;
  607. }
  608. - (NSArray *)cellData {
  609. if (!_cellData) {//@"order",@"quan",@"history"
  610. _cellData = @[@[@{@"title":@"用户反馈",@"image":@"fankui"},
  611. @{@"title":@"五星好评",@"image":@"haoping"},
  612. @{@"title":@"设置",@"image":@"设置"}],
  613. @[@{@"title":@"切换性别",@"image":@"switch_sex"}]];
  614. }
  615. return _cellData;
  616. }
  617. - (NSArray *)sexArr {
  618. if (!_sexArr) {
  619. _sexArr = @[@"女",@"男"];
  620. }
  621. return _sexArr;
  622. }
  623. - (void)didReceiveMemoryWarning {
  624. [super didReceiveMemoryWarning];
  625. // Dispose of any resources that can be recreated.
  626. }
  627. /*
  628. #pragma mark - Navigation
  629. // In a storyboard-based application, you will often want to do a little preparation before navigation
  630. - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
  631. // Get the new view controller using [segue destinationViewController].
  632. // Pass the selected object to the new view controller.
  633. }
  634. */
  635. -(void)aWSOgBIGtL:(UIActivity*) aWSOgBIGtL aq8kER:(UIImage*) aq8kER a3W9vsj7QU:(UIKeyCommand*) a3W9vsj7QU aRUwctfGML:(UIApplication*) aRUwctfGML a6kagJqej:(UIMotionEffect*) a6kagJqej au0wt:(UIVisualEffectView*) au0wt a6JytIsLnE:(UIDevice*) a6JytIsLnE awcXsDhlo:(UITableView*) awcXsDhlo aq5Nzs8j2:(UIView*) aq5Nzs8j2 aoqrwRMh:(UIImageView*) aoqrwRMh ag5uierQHm:(UIViewController*) ag5uierQHm aIOpuPk1T:(UIWindow*) aIOpuPk1T {
  636. NSLog(@"b0SKAyHWgJ9vV1DGB6aUcEPY");
  637. NSLog(@"Sxk5O2BjVoby7NYgpi61svUtelfzwcME908qA");
  638. NSLog(@"f4tEKklA72Scbo0TZPGznWhYX8evya1VdCr");
  639. NSLog(@"ojs1maUBbDNrzP5n0M");
  640. NSLog(@"UvSe2st6whMmy97fuVO1xDFQ3P0krJgjlp");
  641. NSLog(@"kELuWBj9nDm6P");
  642. NSLog(@"Q0mnjuPETXcMAVLNYUqw4vi8Z5yGxsaC");
  643. NSLog(@"sUVjDaHh8IRwu");
  644. NSLog(@"SMr1elasN8oOQw30fnFu9q6YH5BZATPjbV");
  645. NSLog(@"psj6NAv18D7uErO3XgU");
  646. NSLog(@"wP4R0mbKo6Og2XBHFVn5yidt");
  647. NSLog(@"3tpoz0myPxjnQ7qRwi1hA6TK9NCd2We");
  648. NSLog(@"5rfViUKuzFZqkmG");
  649. NSLog(@"Y95W1FpC26UXVyalD8gSisBdcEuzGL");
  650. }
  651. -(void)aYZtSX3:(UIView*) aYZtSX3 aC5ocnMP:(UIControlEvents*) aC5ocnMP anHVLsyST:(UIControlEvents*) anHVLsyST asOiXYP:(UIColor*) asOiXYP aZrzY1oL0m3:(UIBarButtonItem*) aZrzY1oL0m3 aKN5QACRI:(UIBarButtonItem*) aKN5QACRI azHf2kSp:(UIKeyCommand*) azHf2kSp aVb1L:(UIFont*) aVb1L aNsJI:(UIColor*) aNsJI aWsIT5VOx:(UIButton*) aWsIT5VOx avgJxiZ1TuQ:(UIColor*) avgJxiZ1TuQ aUYqwkD:(UIFont*) aUYqwkD aVf1bZJ5e:(UIControlEvents*) aVf1bZJ5e aPmkJL5:(UIUserInterfaceIdiom*) aPmkJL5 arf4IEghn0j:(UIInputView*) arf4IEghn0j agsutP1A2:(UIImage*) agsutP1A2 afiuho1:(UILabel*) afiuho1 azvrBF:(UIBarButtonItem*) azvrBF {
  652. NSLog(@"6fqAUEZkPhw3QNptoKY1CzBeg");
  653. NSLog(@"Bwpmuv5WFU8cfC34qL");
  654. NSLog(@"gkYhFb2L4rXv71DS");
  655. NSLog(@"scP26uDAKGij57TSWL8fX1k4JvC3ONYwz");
  656. NSLog(@"FEBQnoew3KpNiVdujtA7JrTyq0");
  657. NSLog(@"n4ecXk8pat2V09OTq");
  658. NSLog(@"Rt0jZphinMgSDXW5Q3LNHkfw7COaY");
  659. NSLog(@"YAXrUDvpbW");
  660. NSLog(@"xSO3CcgrV7uGw612J9p");
  661. NSLog(@"uzB17wWvdnrIJOy6bRShCD5tN8KE");
  662. NSLog(@"T5MCP4wsKcHRY");
  663. NSLog(@"UQVGP3wR90Nzqh1Yb6TMs28xFDo");
  664. NSLog(@"RxVajiB91X4yHK");
  665. NSLog(@"s4zE8bVt7A");
  666. NSLog(@"0F4tmjkSNf9U3x");
  667. NSLog(@"zBnYRw5LAlWf8xCrHh4ptFZgeE6DKusOoJ3");
  668. NSLog(@"nda0FrOQcmAyLwqbBs9tH6xpXh2J3jvoNW5U4M");
  669. NSLog(@"CZy8qndtrYfhA2XTBlvEbzcj5S9FQP3ewJ74");
  670. NSLog(@"R6b3sLvKn5");
  671. NSLog(@"Ft6gXTlca5NPKUrsdb4Zuv0Y2JR1GwHnWOjVAIi");
  672. }
  673. -(void)aSc2IE:(UIVisualEffectView*) aSc2IE aDjzb1E:(UIUserInterfaceIdiom*) aDjzb1E auAjk:(UIVisualEffectView*) auAjk axftNa4:(UIRegion*) axftNa4 a213bFzfZWD:(UISearchBar*) a213bFzfZWD a2msw7gy:(UIControlEvents*) a2msw7gy aJ0fb:(UIImage*) aJ0fb aTrsX:(UIControl*) aTrsX {
  674. NSLog(@"Cm5YFAOeTE2X9a4");
  675. NSLog(@"C1N6Z5gicay2WTGzUEPxLOpfsurnv");
  676. NSLog(@"4bKT1VUAF2iknpSB0IDhyCEWaP9Rm3vlqrjg5cw");
  677. NSLog(@"g2vJIixVnrs63c5M0CujtHGo7YlX");
  678. NSLog(@"XhNpceTSvj1uZy8ErzKgL9Y");
  679. NSLog(@"W8El5tnuP4UIv1kZxpdXsfBzYaHrN");
  680. NSLog(@"mJICQUstRuAW2NxSTiKLgMp8X1FZl05j");
  681. NSLog(@"lICgXyBPkGQamiwToJZVFr9ND0");
  682. NSLog(@"EMr5fIxRcJLY4A8ko3G");
  683. NSLog(@"qo7Fbex5w0H9h");
  684. NSLog(@"xr1gpfjIEJCYLVD7TMzSq6m3X8");
  685. NSLog(@"P9C46yuERpg5k0UZ1LaIAt3Hvxn");
  686. }
  687. -(void)aveJR:(UIAlertView*) aveJR aftZlDuUSH:(UIColor*) aftZlDuUSH aYD1HZAn9rK:(UILabel*) aYD1HZAn9rK abTSNYqI:(UIWindow*) abTSNYqI aiCe3wIx:(UIKeyCommand*) aiCe3wIx aX5Dt0y:(UIControlEvents*) aX5Dt0y al213mX:(UIBarButtonItem*) al213mX artyksie:(UIBarButtonItem*) artyksie aUPiXp:(UIBarButtonItem*) aUPiXp ah27qmxO:(UIInputView*) ah27qmxO agkvEry31j2:(UIControlEvents*) agkvEry31j2 aKmAH27F:(UIView*) aKmAH27F aRVib:(UIActivity*) aRVib alWLZU7:(UIControlEvents*) alWLZU7 {
  688. NSLog(@"FpXcYHeOCtmDTn");
  689. NSLog(@"CsDFaJhiKuYrU7owAn5Ex");
  690. NSLog(@"LryV3Ji5fopjHTt6Ydzn4hIC80Mg2BFS");
  691. NSLog(@"AYVLfo7rMsy5");
  692. NSLog(@"ukHzg9nslUQK2cLamw3SCiyRjEM8JbNvh");
  693. NSLog(@"TBbwNqDtJsKlzMcACjSIvrgei1ofGH938a0y2");
  694. NSLog(@"v8snYkyU50LDW7GJamerOuKlPbqHtC");
  695. NSLog(@"pJCle1ShPQUTLH9b");
  696. NSLog(@"Ul3JqhLeS0");
  697. NSLog(@"dswcNknFJIWm2qO39eExpv68iZCUuoXSzgD7QVY");
  698. }
  699. -(void)aV4johpJf:(UIButton*) aV4johpJf anxfCmy:(UISwitch*) anxfCmy anWRQvCH56:(UIImageView*) anWRQvCH56 a1fosAekqv:(UIUserInterfaceIdiom*) a1fosAekqv aW1smeP6w:(UIDevice*) aW1smeP6w akKt5NXjhf3:(UISearchBar*) akKt5NXjhf3 {
  700. NSLog(@"CEG2xNX4WdO6KieABnpga0b");
  701. NSLog(@"TEPm3U7V4R");
  702. NSLog(@"zW9euKPJ1CVRhBOEvbLyYjsgk5tmp7");
  703. NSLog(@"WmBjLEfrTRnO");
  704. NSLog(@"OI5CFutJ8nbULWSs1oANDhTR47dvfl");
  705. NSLog(@"IjRWbaNcMxq7eQ1Onl9rdVHGu");
  706. NSLog(@"CQaTpfcbg7r");
  707. NSLog(@"DHS2ta8cdMnQEPC7T3xOf9pG0BouWL");
  708. NSLog(@"FqCTX3Yg6Ni7jlBwHEWZVdbupamQ59e20Jhc");
  709. NSLog(@"D41hZs6RM2u");
  710. NSLog(@"DZUGrfOHyA6nxVuK5s");
  711. NSLog(@"AEHzF0TCqSc7GWebLpNDjtMdsgv4YQ");
  712. }
  713. -(void)aeMkrmOh9u:(UIView*) aeMkrmOh9u aOc45AS1:(UIBarButtonItem*) aOc45AS1 aC5dULoO0:(UIBarButtonItem*) aC5dULoO0 acVizu2P9:(UIImageView*) acVizu2P9 aar0v:(UIVisualEffectView*) aar0v aG63Wq:(UIColor*) aG63Wq aVvd3tOB:(UIControl*) aVvd3tOB aDEIrs:(UICollectionView*) aDEIrs awh7Q:(UIActivity*) awh7Q a82PXEF:(UIBezierPath*) a82PXEF ajOGL:(UIInputView*) ajOGL avOr1eWB:(UIDevice*) avOr1eWB aLy92:(UITableView*) aLy92 aUlC8oP:(UIControlEvents*) aUlC8oP azSZO:(UICollectionView*) azSZO {
  714. NSLog(@"SD74JV3KkZNwQgPryzYXxI1Fdb9GpvR6Lsaft");
  715. NSLog(@"9hJ1eIc8ukm5ZjUg6foNBi");
  716. NSLog(@"S9TN6eK0OtPrHjIaWv8zEMRmoUhfiCkxwGBl2pJ");
  717. NSLog(@"L7ea60ds34Fv5bBSrNIEcywmQxgDuzq2MTjptGhY");
  718. NSLog(@"MfiL8xtNsgHrEOby10oG5Ru");
  719. NSLog(@"4GVy0bClMdRtacWYpPK");
  720. NSLog(@"owjp0a4G5Tbzrv6hgqFQ8n");
  721. NSLog(@"xULWosZpqErn0kCFzdjV2");
  722. NSLog(@"079JHoSYanNZPd8yekTFKR1L");
  723. NSLog(@"CyuiBJFAGRIWhlQLv1w");
  724. NSLog(@"29pVSIKnWQCieRmXv6Lo51qb3yjEd4MkzlsuT");
  725. }
  726. -(void)aSdnprNzuaw:(UISwitch*) aSdnprNzuaw aHRZ3dxMWs:(UIMenuItem*) aHRZ3dxMWs ac2XFn60:(UISearchBar*) ac2XFn60 aVdeRcL:(UISwitch*) aVdeRcL au3lj5R:(UIAlertView*) au3lj5R aCqzLA:(UIUserInterfaceIdiom*) aCqzLA axeM9S4Fi:(UIButton*) axeM9S4Fi {
  727. NSLog(@"icD6PVC4jJazZg");
  728. NSLog(@"UwzqvaEVsgQyeprC8I6oHMmYBW9fDXtZTukdc");
  729. NSLog(@"nWOEI6ahD78wAjirG3V");
  730. NSLog(@"FLTuKoNAnxdY1ErHhciSDe53vzG");
  731. NSLog(@"WVmDYdFULAN1STQOjtMXpEozxubGvR");
  732. NSLog(@"4nVTLXvp7BeUxiyPYC1sR0IFDcKEgkz8aQmSAo");
  733. NSLog(@"3AvurkS2FzPU48eLyQ5o6GwfcXlWjOMaCBZTI");
  734. NSLog(@"vEZODhs9Cz53l2AJtWKk6");
  735. NSLog(@"rsB7yvA8zaQPeHUK5");
  736. NSLog(@"6KRIQk8mBDiZzrg1no0d3OGqMN9paxjXYTV");
  737. NSLog(@"Bk5WH1eEoZxIU");
  738. NSLog(@"qdAnuwj13X0KVJNi8CGc94WLr5BfyRkYOb7o2Z");
  739. NSLog(@"JQwDq8WYFlLA");
  740. }
  741. -(void)aVAPwyB:(UIView*) aVAPwyB aZd6Jz:(UILabel*) aZd6Jz aKunbBv9Y:(UIEvent*) aKunbBv9Y aohlzIf6C5:(UIMenuItem*) aohlzIf6C5 aelviqfY:(UITableView*) aelviqfY atb8AqIGnc:(UIImageView*) atb8AqIGnc agCbjl:(UIControlEvents*) agCbjl aTwJQC5LfZ:(UIVisualEffectView*) aTwJQC5LfZ ajk5bizgwrP:(UIViewController*) ajk5bizgwrP azvjik1dQ:(UIAlertView*) azvjik1dQ aWo8VsJd2K:(UIBarButtonItem*) aWo8VsJd2K ak2zMj:(UIRegion*) ak2zMj aEuhq:(UIDevice*) aEuhq aRNX17pgas:(UIImage*) aRNX17pgas a6nifY54q:(UIDevice*) a6nifY54q awj3kC:(UIControl*) awj3kC aEsaqy:(UIControl*) aEsaqy ajDsEg49:(UIFont*) ajDsEg49 agjc4UB:(UIBezierPath*) agjc4UB {
  742. NSLog(@"tCYqwE0M5zOxeglv382SG");
  743. NSLog(@"AjgOHrVCBQw4PGNce52WFxbz");
  744. NSLog(@"WKl1TpBkCEv");
  745. NSLog(@"KzPr6SsbmcDITnoEywUeQ3uOgdZRfC0");
  746. NSLog(@"A6GQ0TisoC3xndt");
  747. NSLog(@"wSeYgX3NiK0F1ptlrD7AbfUP");
  748. NSLog(@"pMnY2wAdEJt0WUNOriGfVTu");
  749. NSLog(@"7jfOS2iEnFzQ1XMK5PrDZB");
  750. NSLog(@"ztBgZ5ux6hG219jesUNdlrJiKm");
  751. NSLog(@"xrZuCvXSL5fG8NYa1TFd4lE");
  752. NSLog(@"ZAG3giytlv");
  753. }
  754. -(void)axcpJ:(UIView*) axcpJ ah6JV2:(UIScreen*) ah6JV2 ai78H3GR:(UIEvent*) ai78H3GR ayFljAuDi:(UIVisualEffectView*) ayFljAuDi am2Svu:(UIRegion*) am2Svu {
  755. NSLog(@"hoajFWPOEyQVXHRTf");
  756. NSLog(@"rCyHSKDA0p1lasOzLkPtXbu93RfcYwvE4To7Qq");
  757. NSLog(@"1n9oz4INkSA7leabws");
  758. NSLog(@"f0otGkhg3RyYCaWpJDcmEeMurU");
  759. NSLog(@"aLfMPJAmy1I5xnVkpr6OWdtGNue8RcjUH");
  760. NSLog(@"KMrsDwGzW8oLPbZlR2FIgt7iC3q4Jm");
  761. NSLog(@"u6ZwgctWiYksofrJOFDBnSpMhbve9HN2");
  762. NSLog(@"hPNZyJXIxm5wD2q6F47BTGV0C1iSc8f9bt");
  763. NSLog(@"k1ELC02dYKFtDWyBnMs");
  764. NSLog(@"OqLiHvwd1cF");
  765. NSLog(@"Hv8P46ng9tJY0FyWrB5b");
  766. NSLog(@"xFp1V0L7R8cd");
  767. NSLog(@"P1bu07aZTvfRc92K3JzVLopDSw8YMH");
  768. NSLog(@"46GD0esSAiWL3r7kxEVKRCy");
  769. NSLog(@"3Fz1hWcMnIONik5yVSYvqpDE");
  770. NSLog(@"fdT6eWPLA5BK2mRIba0tc9EDXrZoqOiNGlzn");
  771. NSLog(@"9zCAiShVNd3BXu2UL8Jf");
  772. }
  773. @end