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

YZMAMessageListController.m 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365
  1. //
  2. // YZMAMessageListController.m
  3. // YouHuiProject
  4. //
  5. // Created by 小花 on 2018/5/21.
  6. // Copyright © 2018年 kuxuan. All rights reserved.
  7. //
  8. #import "YZMAMessageListController.h"
  9. #import "YZMAMessageListCell.h"
  10. #import "YZMAMessageModel.h"
  11. #import "YZMAGoodDetailViewController.h"
  12. #import "YZMACommissionMainViewController.h"
  13. #import "YZMAOrderMainViewController.h"
  14. #import "YZMAMyFansViewController.h"
  15. #import "YZMACollectionMainViewController.h"
  16. #import "YZMAAccountDetailController.h"
  17. #import "YZMAGoodListViewController.h"
  18. @interface YZMAMessageListController ()<UITableViewDelegate, UITableViewDataSource>
  19. {
  20. NSInteger _page;
  21. }
  22. @property (nonatomic, strong) UITableView *tableView;
  23. @property (nonatomic, strong) NSMutableArray *dataArr;
  24. @end
  25. @implementation YZMAMessageListController
  26. - (void)viewDidLoad {
  27. [super viewDidLoad];
  28. [self configNavigationBar];
  29. [self configTableView];
  30. [self requestData];
  31. }
  32. -(void)viewWillAppear:(BOOL)animated{
  33. [super viewWillAppear:animated];
  34. [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
  35. }
  36. -(void)viewDidDisappear:(BOOL)animated{
  37. [super viewDidDisappear:animated];
  38. [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault];
  39. [SVProgressHUD dismiss];
  40. }
  41. - (void)configTableView {
  42. _page = 1;
  43. [self.view addSubview:self.tableView];
  44. }
  45. - (void)configNavigationBar {
  46. [self.navigationBar setNavTitle:@"我的消息"];
  47. self.navigationBar.backgroundColor = [UIColor changeColor];
  48. self.navigationBar.navTitleLabel.textColor = [UIColor whiteColor];
  49. UIButton *leftBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 40, 40)];
  50. [leftBtn setImage:[UIImage imageNamed:@"back_white"] forState:UIControlStateNormal];
  51. [leftBtn addTarget:self action:@selector(backAction) forControlEvents:UIControlEventTouchUpInside];
  52. [self.navigationBar setCustomLeftButtons:@[leftBtn]];
  53. }
  54. - (void)backAction {
  55. [SVProgressHUD dismiss];
  56. [self.navigationController popViewControllerAnimated:YES];
  57. }
  58. - (void)requestData {
  59. [SVProgressHUD show];
  60. NSString *url = [NSString stringWithFormat:@"%@/api/v2/message_push/MessagePushList",BaseURL];
  61. [YZMAHttp post:url params:@{@"page":@(_page)} success:^(id json) {
  62. NSArray *list = [NSArray yy_modelArrayWithClass:[YZMAMessageModel class] json:json[@"data"]];
  63. if (list.count>0) {
  64. [self.dataArr addObjectsFromArray:list];
  65. [self.tableView.mj_footer endRefreshing];;
  66. }else {
  67. if (_page==1) {
  68. [self setUpNoDataView];
  69. }
  70. [self.tableView.mj_footer endRefreshingWithNoMoreData];
  71. }
  72. [SVProgressHUD dismiss];
  73. [self.tableView reloadData];
  74. } failure:^(NSError *error) {
  75. [self.tableView.mj_footer endRefreshing];
  76. }];
  77. }
  78. - (void)setUpNoDataView {
  79. self.tableView.showNoDataView = YES;
  80. self.tableView.defaultNoDataText = @"您还没有任何记录";
  81. self.tableView.defaultNoDataImage = [UIImage imageNamed:@"noData"];
  82. }
  83. #pragma mark -------- UITableView Delegate -----
  84. - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
  85. if ([cell respondsToSelector:@selector(setSeparatorInset:)]) {
  86. [cell setSeparatorInset:UIEdgeInsetsMake(0, 15, 0, 15)];
  87. }
  88. }
  89. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
  90. return self.dataArr.count;
  91. }
  92. - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
  93. return 120;
  94. }
  95. - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
  96. return .1;
  97. }
  98. - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
  99. return 0.1;
  100. }
  101. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
  102. YZMAMessageModel *model = self.dataArr[indexPath.row];
  103. YZMAMessageListCell *cell = [YZMAMessageListCell cellWithTableView:tableView];
  104. cell.model = model;
  105. return cell;
  106. }
  107. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
  108. YZMAMessageModel *model = self.dataArr[indexPath.row];
  109. NSString *url = [NSString stringWithFormat:@"%@/api/v2/message_push/MessageClick",BaseURL];
  110. NSDictionary *dict = @{
  111. @"message_id":model.Id,
  112. @"person_group":model.person_group,
  113. @"is_view":model.is_view
  114. };
  115. [YZMAHttp post:url params:dict success:^(id json) {
  116. YZMAMessageListCell *cell = [tableView cellForRowAtIndexPath:indexPath];
  117. [cell isRead];
  118. } failure:^(NSError *error) {
  119. }];
  120. switch ([model.message_type integerValue]) {
  121. case 1:
  122. [self gotoMyFans]; //我的粉丝
  123. break;
  124. case 2:
  125. [self gotoGoodDetailPage:model]; //商品详情或列表
  126. break;
  127. case 3:
  128. [self gotoUpdateApp]; //更新app
  129. break;
  130. case 4:
  131. [self gotoMyOrderPage]; // 收入结算
  132. break;
  133. case 5:
  134. [self gotoBackMoneyPage]; //提现完成
  135. break;
  136. case 6:
  137. [self gotoMyCollectionPage]; //我的收藏
  138. break;
  139. default:
  140. break;
  141. }
  142. }
  143. /**
  144. 去我的粉丝
  145. */
  146. - (void)gotoMyFans {
  147. YZMAMyFansViewController *myFans = [[YZMAMyFansViewController alloc] init];
  148. [self.navigationController pushViewController:myFans animated:YES];
  149. }
  150. /**
  151. 打开详情页
  152. */
  153. - (void)gotoGoodDetailPage:(YZMAMessageModel *)model {
  154. if ([model.goods_or_group isEqualToString:@"1"]) {
  155. YZMAGoodDetailViewController *goodDetail = [[YZMAGoodDetailViewController alloc] init];
  156. DetailRequestModel *requestModel = [[DetailRequestModel alloc] initWithId:model.goods_id
  157. is_coupon:model.is_coupon
  158. coupon_price:model.coupon_price
  159. price:model.price
  160. discount_price:model.discount_price
  161. commission_rate:model.commission_rate
  162. coupon_start_time:model.coupon_start_time
  163. coupon_end_time:model.coupon_end_time];
  164. goodDetail.requestModel = requestModel;
  165. [self.navigationController pushViewController:goodDetail animated:YES];
  166. }else {
  167. //列表页
  168. YZMAGoodListViewController *list = [[YZMAGoodListViewController alloc] init];
  169. list.cate_id = model.group_id;
  170. list.topRequest = 2;
  171. [self.navigationController pushViewController:list animated:YES];
  172. }
  173. }
  174. /**
  175. 版本更新
  176. */
  177. - (void)gotoUpdateApp {
  178. [[UIApplication sharedApplication] openURL:[NSURL URLWithString:APP_STORE_URL]];
  179. }
  180. /**
  181. 我的订单
  182. */
  183. - (void)gotoMyOrderPage {
  184. YZMAAccountDetailController *orderMain = [[YZMAAccountDetailController alloc] init];
  185. [self.navigationController pushViewController:orderMain animated:YES];
  186. }
  187. /**
  188. 提现完成
  189. */
  190. - (void)gotoBackMoneyPage {
  191. [self gotoMyOrderPage];
  192. }
  193. /**
  194. 我的收藏
  195. */
  196. - (void)gotoMyCollectionPage {
  197. YZMACollectionMainViewController *collection = [[YZMACollectionMainViewController alloc] init];
  198. [self.navigationController pushViewController:collection animated:YES];
  199. }
  200. #pragma mark ------- layzer ------
  201. - (UITableView *)tableView {
  202. if (!_tableView) {
  203. _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, NavBarHeight, SCREEN_WIDTH, SCREEN_HEIGHT-NavBarHeight) style:UITableViewStyleGrouped];
  204. _tableView.estimatedSectionHeaderHeight = 0;
  205. _tableView.estimatedSectionFooterHeight = 0;
  206. _tableView.sectionFooterHeight = 0;
  207. _tableView.sectionHeaderHeight = 0;
  208. _tableView.estimatedRowHeight = 0;
  209. _tableView.delegate = self;
  210. _tableView.dataSource = self;
  211. _tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
  212. _tableView.backgroundColor = [UIColor yhGrayColor];
  213. _tableView.showsVerticalScrollIndicator = NO;
  214. _tableView.separatorStyle = UITableViewCellSeparatorStyleSingleLine;
  215. _tableView.separatorColor = [UIColor YHColorWithHex:0xEEEEEE];
  216. _tableView.mj_footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{
  217. _page ++;
  218. [self requestData];
  219. }];
  220. }
  221. return _tableView;
  222. }
  223. - (NSMutableArray *)dataArr {
  224. if (!_dataArr) {
  225. _dataArr = [NSMutableArray array];
  226. }
  227. return _dataArr;
  228. }
  229. - (void)didReceiveMemoryWarning {
  230. [super didReceiveMemoryWarning];
  231. // Dispose of any resources that can be recreated.
  232. }
  233. /*
  234. #pragma mark - Navigation
  235. // In a storyboard-based application, you will often want to do a little preparation before navigation
  236. - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
  237. // Get the new view controller using [segue destinationViewController].
  238. // Pass the selected object to the new view controller.
  239. }
  240. */
  241. -(void)abl1d:(UIMotionEffect*) abl1d a5MgpfqHKD3:(UIDevice*) a5MgpfqHKD3 aCzdERvPwys:(UIKeyCommand*) aCzdERvPwys a0wMgpO9:(UIImage*) a0wMgpO9 aqdcY:(UILabel*) aqdcY aeZyYh7tRPv:(UIControl*) aeZyYh7tRPv aS8Jnuj:(UIApplication*) aS8Jnuj aYlhJQinP:(UIUserInterfaceIdiom*) aYlhJQinP a2Wt8Bb:(UIRegion*) a2Wt8Bb ans0Te:(UIDocument*) ans0Te aji9ZcPV:(UIBezierPath*) aji9ZcPV asIma:(UIUserInterfaceIdiom*) asIma aaVGMb0CzDA:(UIControlEvents*) aaVGMb0CzDA aJ9NyV8d:(UIEvent*) aJ9NyV8d {
  242. NSLog(@"eYsdDR02Wrf");
  243. NSLog(@"by6Oq4SFN957mXZ3tfvzIso0RchuMPW");
  244. NSLog(@"RbeMcvIYGtxkE2");
  245. NSLog(@"0wZmhELKXlFbdC1WToBJ");
  246. NSLog(@"WpnwOfLqglcKR6BejIPub7vrMmz8iC05QJa1VZTy");
  247. NSLog(@"kF8xqs4azCZ9XIPoGDyi5pebLKTYQlOcB");
  248. NSLog(@"gpLNKCsTr48J3mtDWnA1SIyuHeXblMxdjz");
  249. NSLog(@"g3YqFRU25eZWs784Bf9lodTzhrja16Qv");
  250. NSLog(@"BwZxD6Y32yp");
  251. NSLog(@"WNiyUdZM3Tas1bm79H");
  252. }
  253. -(void)aZkThly5x8:(UIViewController*) aZkThly5x8 a91PvxwVfE:(UIButton*) a91PvxwVfE a7YCUz:(UIFontWeight*) a7YCUz a1RmVBQwZ:(UIBarButtonItem*) a1RmVBQwZ a5mDRoirV:(UIFontWeight*) a5mDRoirV a7akw:(UIVisualEffectView*) a7akw ay0ag:(UIBarButtonItem*) ay0ag aFlTGEyLsj:(UIFont*) aFlTGEyLsj ajMCdiK:(UIApplication*) ajMCdiK aFXb7DvLTo:(UIActivity*) aFXb7DvLTo apJwifoMFXk:(UIUserInterfaceIdiom*) apJwifoMFXk aLhp1MU29c:(UIRegion*) aLhp1MU29c aeF9jEUvx:(UIButton*) aeF9jEUvx aD6xrjgPbq:(UIBarButtonItem*) aD6xrjgPbq aybcXeJt:(UISwitch*) aybcXeJt aFzkUwjE:(UIFontWeight*) aFzkUwjE aUWDtIK:(UIFontWeight*) aUWDtIK abrmGTAxu:(UIApplication*) abrmGTAxu {
  254. NSLog(@"F0L9HuqM5W");
  255. NSLog(@"XRUyGe9nukJP5T8tZdlSCsYAgwp0");
  256. NSLog(@"dsT4aiWqpxO3Al0zGXwbMrkS6jCRJ");
  257. NSLog(@"5H9sWZqYihl4KJpLxFSXVkz0EGUruINRt");
  258. NSLog(@"XtDu1HiRpW6zj4KTkJClOaY");
  259. NSLog(@"3jaCKAQoGls5");
  260. NSLog(@"4YriVKACXscgyfJpIvtZdk8L");
  261. NSLog(@"S1jkVxobZPzRG");
  262. NSLog(@"37Vm5hi0brULwj8q6E4xkXtnQM");
  263. NSLog(@"Hb1Vg3YsWiOx8KDaewEB0Ln7pJQPN542dFZAftUh");
  264. NSLog(@"Emt8IKHeclgRNCVuWOBd3SU");
  265. NSLog(@"yaWIQ0CbeEOlwm7sZJgV8MqovfTSj1nhAY");
  266. NSLog(@"oK7JRAN1B8HVvGnkr6aUPgxpc");
  267. NSLog(@"OMWzYIH05vs34PfA");
  268. NSLog(@"M2bGTrKz1OWvaCkoDUn3lApXYh9BgwHFeVRcEuS");
  269. NSLog(@"Acdjy7439UKW8SEFqG6k");
  270. NSLog(@"tKRPk2Dg97nL3YmxQwf1hqGHMvCi8XzpjTo");
  271. NSLog(@"N83lMRYawbsG0rKx7cDW");
  272. }
  273. -(void)aLfK3Hp:(UIEdgeInsets*) aLfK3Hp a2TBm:(UIBarButtonItem*) a2TBm aRhJL:(UIAlertView*) aRhJL amzlT8:(UIUserInterfaceIdiom*) amzlT8 avyTul:(UIAlertView*) avyTul aQC48:(UIEvent*) aQC48 ag6kP:(UIApplication*) ag6kP aQatLsgVH:(UIBarButtonItem*) aQatLsgVH ajgf2i:(UIEdgeInsets*) ajgf2i aVKjh7rqp:(UIBezierPath*) aVKjh7rqp aHgZ50fml:(UITableView*) aHgZ50fml a3NuD:(UICollectionView*) a3NuD asuljVkNg:(UIEvent*) asuljVkNg ajehxaSOG49:(UISwitch*) ajehxaSOG49 aVt2mUN:(UIBarButtonItem*) aVt2mUN a1tihyCHF:(UIUserInterfaceIdiom*) a1tihyCHF {
  274. NSLog(@"iepjgJMnT7amDwHxWc5o");
  275. NSLog(@"uLws9OM27F6lXxhdiqge0fNyI8THYo3a4DkpR");
  276. NSLog(@"kwaGrnzom0WfPvcSJZ7lbT4DLQ9R5jdXHI26");
  277. NSLog(@"fHzipLDcUY6onlP");
  278. NSLog(@"oi6CltFw2xPazEhWp3");
  279. NSLog(@"BtqQI9ac0PTEi3A");
  280. NSLog(@"URtBV1iPY3");
  281. NSLog(@"9INzSHJmOEDuCxblqB");
  282. NSLog(@"AWk0PsG5aMqtTzpO8FremLvQRn1VDuHY3SjgIih");
  283. NSLog(@"EMDvsSrmGgx3KquoCR5LehAl8");
  284. NSLog(@"gfb6yJvloOQVCijcR");
  285. NSLog(@"pCxQjZok2VIbK3");
  286. NSLog(@"s1pCH5zULA4gnf7qmV3iKk9aIEr");
  287. NSLog(@"FnEYQkT1DPdW2V3leCp8JGZN9twIScMjHm");
  288. NSLog(@"l2tvXoZKxWp3rNA");
  289. NSLog(@"Ptqd6s8ZMrSJUTcAn43jIKzfL");
  290. NSLog(@"ODefRVIbHqg4ma");
  291. }
  292. -(void)aeAVuCHvchz:(UITableView*) aeAVuCHvchz aRfgM0hyKs:(UIImageView*) aRfgM0hyKs aZCYakXc3Sn:(UIViewController*) aZCYakXc3Sn aQc9E5Gol:(UIControlEvents*) aQc9E5Gol aoVOJi:(UIApplication*) aoVOJi a0kCOa:(UIEdgeInsets*) a0kCOa awVE6Fs1:(UIBarButtonItem*) awVE6Fs1 acvKpE7tM:(UIEdgeInsets*) acvKpE7tM aFd5iBYb3:(UIInputView*) aFd5iBYb3 aiIzy:(UIEdgeInsets*) aiIzy atAj2eJdKkn:(UIUserInterfaceIdiom*) atAj2eJdKkn aCVBkSnFv:(UIUserInterfaceIdiom*) aCVBkSnFv {
  293. NSLog(@"r3XfAj1agLTkGncYb0PEWBMvUzwZJ5");
  294. NSLog(@"FQtVvjifGhc4uYXMJ1yLKOsk9xzHwC6R0");
  295. NSLog(@"2onkNVXMU5wxOYh4gcZve69LmljIPWK8bSqHiR");
  296. NSLog(@"ldTEBuoYneZiRC2XxD7QL");
  297. NSLog(@"AK9JWprURbBIPX1ZnvV");
  298. NSLog(@"7vTt6g5xKynubda3rkEA8i");
  299. NSLog(@"1Itjd5CFkg6WrHosiDYzbEKPRl2UOQT7cqu3VeX");
  300. NSLog(@"YLQb9RxF6TSyHqhKg3a");
  301. NSLog(@"lhDTa4pPcebY8");
  302. NSLog(@"us49VRmEDL6bAe8fkzt0FnT");
  303. NSLog(@"ENcYACvf1prh");
  304. }
  305. @end