123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425 |
- //
- // LZMMessageListController.m
- // YouHuiProject
- //
- // Created by 小花 on 2018/5/21.
- // Copyright © 2018年 kuxuan. All rights reserved.
- //
- #import "LZMMessageListController.h"
- #import "LZMMessageListCell.h"
- #import "LZMMessageModel.h"
- #import "LZMGoodDetailViewController.h"
- #import "LZMCommissionMainViewController.h"
- #import "LZMOrderMainViewController.h"
- #import "LZMMyFansViewController.h"
- #import "LZMCollectionMainViewController.h"
- #import "LZMAccountDetailController.h"
- #import "LZMGoodListViewController.h"
- @interface LZMMessageListController ()<UITableViewDelegate, UITableViewDataSource>
- {
- NSInteger _page;
- }
- @property (nonatomic, strong) UITableView *tableView;
- @property (nonatomic, strong) NSMutableArray *dataArr;
- @end
- @implementation LZMMessageListController
- - (void)viewDidLoad {
- [super viewDidLoad];
-
- [self configNavigationBar];
- [self configTableView];
- [self requestData];
- }
- -(void)viewWillAppear:(BOOL)animated{
- [super viewWillAppear:animated];
- [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
- }
- -(void)viewDidDisappear:(BOOL)animated{
- [super viewDidDisappear:animated];
- [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault];
- [SVProgressHUD dismiss];
- }
- - (void)configTableView {
- _page = 1;
- [self.view addSubview:self.tableView];
- }
- - (void)configNavigationBar {
- [self.navigationBar setNavTitle:@"我的消息"];
- self.navigationBar.backgroundColor = [UIColor changeColor];
- self.navigationBar.navTitleLabel.textColor = [UIColor whiteColor];
- UIButton *leftBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 40, 40)];
- [leftBtn setImage:[UIImage imageNamed:@"back_white"] forState:UIControlStateNormal];
- [leftBtn addTarget:self action:@selector(backAction) forControlEvents:UIControlEventTouchUpInside];
- [self.navigationBar setCustomLeftButtons:@[leftBtn]];
- }
- - (void)backAction {
- [SVProgressHUD dismiss];
- [self.navigationController popViewControllerAnimated:YES];
- }
- - (void)requestData {
-
- [SVProgressHUD show];
- NSString *url = [NSString stringWithFormat:@"%@/api/v2/message_push/MessagePushList",BaseURL];
- [LZMHttp post:url params:@{@"page":@(_page)} success:^(id json) {
-
- NSArray *list = [NSArray yy_modelArrayWithClass:[LZMMessageModel class] json:json[@"data"]];
-
- if (list.count>0) {
- [self.dataArr addObjectsFromArray:list];
- [self.tableView.mj_footer endRefreshing];;
- }else {
- if (_page==1) {
- [self setUpNoDataView];
- }
- [self.tableView.mj_footer endRefreshingWithNoMoreData];
- }
- [SVProgressHUD dismiss];
- [self.tableView reloadData];
- } failure:^(NSError *error) {
- [self.tableView.mj_footer endRefreshing];
- }];
- }
- - (void)setUpNoDataView {
- self.tableView.showNoDataView = YES;
- self.tableView.defaultNoDataText = @"您还没有任何记录";
- self.tableView.defaultNoDataImage = [UIImage imageNamed:@"noData"];
- }
- #pragma mark -------- UITableView Delegate -----
- - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
- if ([cell respondsToSelector:@selector(setSeparatorInset:)]) {
- [cell setSeparatorInset:UIEdgeInsetsMake(0, 15, 0, 15)];
- }
- }
- - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
- return self.dataArr.count;
- }
- - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
- return 120;
- }
- - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
- return .1;
- }
- - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
- return 0.1;
- }
- - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
-
- LZMMessageModel *model = self.dataArr[indexPath.row];
- LZMMessageListCell *cell = [LZMMessageListCell cellWithTableView:tableView];
- cell.model = model;
- return cell;
- }
- - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
- LZMMessageModel *model = self.dataArr[indexPath.row];
-
- NSString *url = [NSString stringWithFormat:@"%@/api/v2/message_push/MessageClick",BaseURL];
- NSDictionary *dict = @{
- @"message_id":model.Id,
- @"person_group":model.person_group,
- @"is_view":model.is_view
- };
-
- [LZMHttp post:url params:dict success:^(id json) {
- LZMMessageListCell *cell = [tableView cellForRowAtIndexPath:indexPath];
- [cell isRead];
- } failure:^(NSError *error) {
-
- }];
-
- switch ([model.message_type integerValue]) {
- case 1:
- [self gotoMyFans]; //我的粉丝
- break;
- case 2:
- [self gotoGoodDetailPage:model]; //商品详情或列表
- break;
- case 3:
- [self gotoUpdateApp]; //更新app
- break;
- case 4:
- [self gotoMyOrderPage]; // 收入结算
- break;
- case 5:
- [self gotoBackMoneyPage]; //提现完成
- break;
- case 6:
- [self gotoMyCollectionPage]; //我的收藏
- break;
-
- default:
- break;
- }
-
- }
- /**
- 去我的粉丝
- */
- - (void)gotoMyFans {
- LZMMyFansViewController *myFans = [[LZMMyFansViewController alloc] init];
- [self.navigationController pushViewController:myFans animated:YES];
- }
- /**
- 打开详情页
- */
- - (void)gotoGoodDetailPage:(LZMMessageModel *)model {
-
- if ([model.goods_or_group isEqualToString:@"1"]) {
- LZMGoodDetailViewController *goodDetail = [[LZMGoodDetailViewController alloc] init];
- DetailRequestModel *requestModel = [[DetailRequestModel alloc] initWithId:model.goods_id
- is_coupon:model.is_coupon
- coupon_price:model.coupon_price
- price:model.price
- discount_price:model.discount_price
- commission_rate:model.commission_rate
- coupon_start_time:model.coupon_start_time
- coupon_end_time:model.coupon_end_time];
- goodDetail.requestModel = requestModel;
- [self.navigationController pushViewController:goodDetail animated:YES];
- }else {
- //列表页
- LZMGoodListViewController *list = [[LZMGoodListViewController alloc] init];
- list.cate_id = model.group_id;
- list.topRequest = 2;
- [self.navigationController pushViewController:list animated:YES];
- }
-
-
-
- }
- /**
- 版本更新
- */
- - (void)gotoUpdateApp {
- [[UIApplication sharedApplication] openURL:[NSURL URLWithString:APP_STORE_URL]];
- }
- /**
- 我的订单
- */
- - (void)gotoMyOrderPage {
- LZMAccountDetailController *orderMain = [[LZMAccountDetailController alloc] init];
- [self.navigationController pushViewController:orderMain animated:YES];
- }
- /**
- 提现完成
- */
- - (void)gotoBackMoneyPage {
- [self gotoMyOrderPage];
- }
- /**
- 我的收藏
- */
- - (void)gotoMyCollectionPage {
- LZMCollectionMainViewController *collection = [[LZMCollectionMainViewController alloc] init];
- [self.navigationController pushViewController:collection animated:YES];
- }
- #pragma mark ------- layzer ------
- - (UITableView *)tableView {
- if (!_tableView) {
- _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, NavBarHeight, SCREEN_WIDTH, SCREEN_HEIGHT-NavBarHeight) style:UITableViewStyleGrouped];
- _tableView.estimatedSectionHeaderHeight = 0;
- _tableView.estimatedSectionFooterHeight = 0;
- _tableView.sectionFooterHeight = 0;
- _tableView.sectionHeaderHeight = 0;
- _tableView.estimatedRowHeight = 0;
- _tableView.delegate = self;
- _tableView.dataSource = self;
- _tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
- _tableView.backgroundColor = [UIColor yhGrayColor];
- _tableView.showsVerticalScrollIndicator = NO;
- _tableView.separatorStyle = UITableViewCellSeparatorStyleSingleLine;
- _tableView.separatorColor = [UIColor YHColorWithHex:0xEEEEEE];
- _tableView.mj_footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{
- _page ++;
- [self requestData];
- }];
-
- }
- return _tableView;
- }
- - (NSMutableArray *)dataArr {
- if (!_dataArr) {
- _dataArr = [NSMutableArray array];
- }
- return _dataArr;
- }
- - (void)didReceiveMemoryWarning {
- [super didReceiveMemoryWarning];
- // Dispose of any resources that can be recreated.
- }
- /*
- #pragma mark - Navigation
- // In a storyboard-based application, you will often want to do a little preparation before navigation
- - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
- // Get the new view controller using [segue destinationViewController].
- // Pass the selected object to the new view controller.
- }
- */
- -(void)acvwEBZ1sY:(UIKeyCommand*) acvwEBZ1sY aeuKj:(UIRegion*) aeuKj asqMi:(UIImage*) asqMi aHyB9D:(UIFont*) aHyB9D az42tcw:(UIBarButtonItem*) az42tcw aXmeMFu5:(UISearchBar*) aXmeMFu5 aLyVAgcdPki:(UIScreen*) aLyVAgcdPki alUo3p1:(UIButton*) alUo3p1 akLqv:(UIImageView*) akLqv acKTlB:(UIViewController*) acKTlB acCyghGxoZ:(UIFontWeight*) acCyghGxoZ a1F8MS5E:(UIView*) a1F8MS5E {
- NSLog(@"8sqWy1ZdKeVUBFX2MrlcOQiLwfI6");
- NSLog(@"MqtsoCWGnBmiYzcQjvehN2bO6P");
- NSLog(@"365NvpVrWxXZjo");
- NSLog(@"K28osG79v1UnS");
- NSLog(@"5a9CQRYwOnDIePyjkfSM");
- NSLog(@"cLWVOvy08Q");
- NSLog(@"87OMJNtqGSjvEu52HUcLkmTK");
- NSLog(@"VEZBUDLbtPQao0YvihOj");
- NSLog(@"e63FibwOGjCTo1VESHgD9J2yRmUsrKXzYlI");
- NSLog(@"ZkLQGNbf8B6El");
- NSLog(@"z25ewVEklNAOx3trD84FjLspSZv");
- NSLog(@"EZAFyWhDbN0j2Jv3x");
- }
- -(void)aVofqBhHi:(UIMotionEffect*) aVofqBhHi aZ6Kf3:(UIFontWeight*) aZ6Kf3 ae5fxNtg2W:(UIUserInterfaceIdiom*) ae5fxNtg2W anHvmQXD:(UIBarButtonItem*) anHvmQXD a1by8i:(UIFontWeight*) a1by8i {
- NSLog(@"pmwxzZGjygS5fba2k");
- NSLog(@"TqfhRksSeHV9mt1p7cX");
- NSLog(@"ItH7VkUjZAQshdOPBw8L");
- NSLog(@"EwqNTD4aetZn8fR236BkAxMsdmuiG");
- NSLog(@"nTld1aQjLhNpIg");
- NSLog(@"wtTBYxcXkmG1I9");
- NSLog(@"Lq17QC0Hkc2VDnYGFdzh");
- NSLog(@"o8cBK2j6y0daV");
- NSLog(@"on9Qf1XsBwVxEtW");
- NSLog(@"Xwv4D8dkRonGjq0bhM");
- NSLog(@"WacTMblU8AxJIBVmho169zPp57RHiYeyvNZFu");
- NSLog(@"aYkMht3UoyA");
- NSLog(@"dNEqrbXCL3954wixlQGsmB");
- NSLog(@"qaVFH8fOnELrgo1CBclvUT");
- NSLog(@"lw6fI8aqv0D5ARhsQSpCN1tx4n3Hom9bGk7JeYF");
- NSLog(@"3GRFnuQt2g");
- NSLog(@"jsLlxBPFhVn");
- }
- -(void)ahTp89:(UIViewController*) ahTp89 a06EXrKUP:(UIImageView*) a06EXrKUP aF9ml0p:(UIKeyCommand*) aF9ml0p a8713wSrg:(UIUserInterfaceIdiom*) a8713wSrg aWCNSk04z:(UIFont*) aWCNSk04z aaMFTs:(UIDocument*) aaMFTs {
- NSLog(@"HJcuXRtdsz17LYrOAUGPjQFqNWg3loxMZymED9T");
- NSLog(@"KFk39R4QapZOY6PSsBrWe2w1udf7nizCAX5hEtlH");
- NSLog(@"qegDWbdsRVz8QK2TLFvONJuanU43GfAZSwY0k1");
- NSLog(@"GzCoHUIklY09vQcKt34MONAumbTPJSB5");
- NSLog(@"LuehmfdEPyxHFak0JBwI16VDs");
- NSLog(@"j5PFCKxgd9bJVMwAsec8GTIvYo1BLWE");
- NSLog(@"OXGIheB0sz4WAFRc8MndaoUN5l6");
- NSLog(@"uJdYyxBCTrAsX5gic03U8mhqEpRQH2MNFtL");
- NSLog(@"mD6aohsA2KuBpCk1MPEYZr4");
- NSLog(@"6neEqPIsyhFdAU0JTX21K7z3vrR9jVkBScCfZQ");
- NSLog(@"eBbdaPflT5z8vnI0SshV4XiOrLmxN");
- NSLog(@"OJQmzNvj7eVkZ4PWhi3oAXtIq1pgsb");
- }
- -(void)a3HbUKEfZP:(UIRegion*) a3HbUKEfZP aAsWB3TD:(UIView*) aAsWB3TD a7krHg:(UIDevice*) a7krHg an0lM:(UIBezierPath*) an0lM acKTWSU:(UIFont*) acKTWSU aEGOhubfJez:(UIKeyCommand*) aEGOhubfJez a08OxU1RQ5:(UIEvent*) a08OxU1RQ5 aIXTJ7eAB4:(UIApplication*) aIXTJ7eAB4 a5l6v1L0Aaw:(UIBezierPath*) a5l6v1L0Aaw {
- NSLog(@"JXBjyR21U7olq");
- NSLog(@"ptMPe20aUoLvqyOksuWICYJ7n13h8Rx");
- NSLog(@"LVjw07MOK1");
- NSLog(@"JT8G0NDWzUk2Ff6IHaejwtRrB");
- NSLog(@"p6m0WgQyHsSbtJzeRPFx3lvZ1O");
- NSLog(@"gPv1DOK2UGkbh0er7J4uyYcINmAFVjn5");
- NSLog(@"kGnbYdQVlqxo9jFsO21RWz80meZuIiJAf");
- NSLog(@"ICLFP5bRHO9hewAor6jm27TJVz0yXf3a1G4");
- NSLog(@"bVwF5xfR72KtOpmHYW0");
- NSLog(@"rLnmTJqAYF0Hj8ZoEub7aX96IRV5");
- NSLog(@"Y4haWjnZMdJ6e0OKDC9XHbF");
- NSLog(@"WuOAJmaPsHKTXEnpUZI4L");
- NSLog(@"WE93RzKqkI");
- NSLog(@"2nDpx3WlK7SPhzu6BvUrXQtEV");
- NSLog(@"UdIgiDMmr5JesP3HuN");
- NSLog(@"gYlIsrGhXbzK7QmiT0a35pfCBAvM1");
- NSLog(@"qlAzTMREJ8yY2DihLZaCXnmGPHUfI1xvb");
- }
- -(void)aBTEMjUY8l5:(UIEdgeInsets*) aBTEMjUY8l5 aFw1B:(UIBarButtonItem*) aFw1B aJmBL8faM0G:(UIScreen*) aJmBL8faM0G asIaj:(UIButton*) asIaj aMeJL3K4Qw:(UISwitch*) aMeJL3K4Qw ajxQSdEOK:(UIBarButtonItem*) ajxQSdEOK aCneSXuK:(UIWindow*) aCneSXuK {
- NSLog(@"J1PevZkS6FHt");
- NSLog(@"AO28aBXjmtze6");
- NSLog(@"2ewENIx9LV1auRZU0p46D");
- NSLog(@"pRsrm5LaAVuvEzy6o3HiMxJ28Z9X1NfgG");
- NSLog(@"2GqdWFNmu1aVTwY69Cl5c4UZK8Rkio0IQ3DXy");
- NSLog(@"bcIetHAuTZ5JVsYCoQa");
- NSLog(@"xVygi59lnAMCoz6OZ0eRQW3v");
- NSLog(@"qkl1OdAfGX9");
- NSLog(@"sIvmBhqE8aX");
- NSLog(@"zRVrvYsZTPyk78fAlH2Bh3gaq5p4MQdKIub");
- NSLog(@"u8H43ImXZhwRLtpAV1x7sKornCgOq2vBGM");
- NSLog(@"HQxDh5guoweOpP");
- NSLog(@"VrPsotOuGAT9m7nKNR68Eb5pSa3Qvc");
- NSLog(@"ZJEd63l0pM8FCg1hVLkQnw2NvcmH");
- NSLog(@"C9vBy1lRTG");
- NSLog(@"DJAGZ3xUVoic6z1jHdvg8qC2TY0Rmawf94K7");
- NSLog(@"G01eX3tP7wvVOMb65EdfaQU");
- NSLog(@"EpV5jHJGv2RrDfqwzYhutcgQKU4nO3We1");
- NSLog(@"e05BpOHJtao1WirKc");
- NSLog(@"ADe5MFWnpxt1RlrqmojTCViNz");
- }
- -(void)a2U4NadGjJE:(UIWindow*) a2U4NadGjJE aRo7hZdgz8B:(UIColor*) aRo7hZdgz8B ayhH15A:(UIKeyCommand*) ayhH15A aJRHjFhOdAp:(UIButton*) aJRHjFhOdAp aJqTuIcY:(UIDocument*) aJqTuIcY alHkw74z5I:(UICollectionView*) alHkw74z5I asSYlktMx:(UIControl*) asSYlktMx aVXmqcsK9g:(UIEdgeInsets*) aVXmqcsK9g am0xNPn7:(UIDevice*) am0xNPn7 aMTka0gE4qn:(UIRegion*) aMTka0gE4qn a8j4ofa9hId:(UIColor*) a8j4ofa9hId ag5Pd6Tx21:(UIUserInterfaceIdiom*) ag5Pd6Tx21 aURhxF7b:(UIRegion*) aURhxF7b aa7uF:(UITableView*) aa7uF aZflX2QU:(UIScreen*) aZflX2QU a0Sx5b9eq:(UIUserInterfaceIdiom*) a0Sx5b9eq awYIMr5Fm:(UIEdgeInsets*) awYIMr5Fm {
- NSLog(@"ZOcAfWkJHbGm9vu2iTwxC3yB8I");
- NSLog(@"JvVzUxe0sqiDY4QZM7LmpKCTu5EgNb9");
- NSLog(@"AKOZTk7oWVMCDPRY9L");
- NSLog(@"uK3Enx4yji7QJfNc9rG");
- NSLog(@"ZeLUBnYJIaT576Ssqgf1u4");
- NSLog(@"kSXc0CshfE");
- NSLog(@"ezIdnmhf6w8xbElBCguLQ2WpqkJsDXciOVG7KyTj");
- NSLog(@"dyB2RPhsawukoH50qKt7Tr1mO");
- NSLog(@"o6H1pulr40mK5nCAYyjVht");
- NSLog(@"nB3sAPpQOolaKF5MCT2GYZHr0WqRh");
- NSLog(@"eiDoxtCw3gHpXTZrIWLAk76hvlPjd0aqFcbYNUu");
- NSLog(@"u31x9mtQoSq");
- NSLog(@"kfqIhUOdXDELJ6Az5Vter2ypGWv9");
- NSLog(@"1PoKRZMEhbjIzTdyJ95WYnQ30u4VSp");
- NSLog(@"dSGDifhOYW");
- NSLog(@"3hxu9LnqXwM71RFTl");
- }
- -(void)axptGwFs:(UIImage*) axptGwFs ahbagQl0m:(UIInputView*) ahbagQl0m aMA6CDJXziy:(UIMenuItem*) aMA6CDJXziy a1LmJ:(UIDocument*) a1LmJ aPdq49:(UIBarButtonItem*) aPdq49 abY2J:(UIEvent*) abY2J aJsR8X:(UIFontWeight*) aJsR8X aUkWY876:(UIBarButtonItem*) aUkWY876 aG4oq7pZ:(UIDevice*) aG4oq7pZ avVb18kfr:(UIFont*) avVb18kfr atSY5A:(UIControl*) atSY5A a864sHg:(UIButton*) a864sHg aiPsb:(UIMotionEffect*) aiPsb aH6qnEFW:(UIEvent*) aH6qnEFW aakP0yJ4RF:(UILabel*) aakP0yJ4RF a01lrCUW9s:(UIDocument*) a01lrCUW9s axTjQ:(UIButton*) axTjQ aAadH:(UIControlEvents*) aAadH azJ3sKV:(UIRegion*) azJ3sKV aoH6wA9dQn:(UIScreen*) aoH6wA9dQn {
- NSLog(@"utEAWh5VwS2dDGXmp3TR0CFzQ1Hfq6Ulni9j");
- NSLog(@"FzQraCBVZi6k0vX1pybsSTuOH");
- NSLog(@"VFeH6u2QNsy");
- NSLog(@"EgZ2Tz9YrJG");
- NSLog(@"Rs48F6wSLcXt27eE");
- NSLog(@"To7bl3qEMwnX9CNkxSFYOj4Uv");
- NSLog(@"7tuvkO31bWRVUFcJ0lEhnpMKq");
- NSLog(@"aJGY6Kp7j1nfcvEQ58NqBWL");
- NSLog(@"yVRqvXde84JIzjGu3rBNpw");
- NSLog(@"fyVrQqIiJsmDcAP4nh9oFKwzWla2jUE");
- NSLog(@"prOePvuX8BtERCT0cQ2iAlsUq17VKIm4YoD6hnJ3");
- NSLog(@"cgBnQsjVrL7TIltAE18voJZRuw5dfHCiYxXhbFS");
- NSLog(@"3ElW1RLjfUaVm7P");
- NSLog(@"XhfmKVUB0JHLivpY");
- NSLog(@"OiTe1dEv9aQVDnJjmgrPZ3Uc");
- NSLog(@"5e0qdXikKEGZDPoH37Il8vCfMsaz4txSrWwOJyp");
- }
- @end
|