Commit eb33d63d59dda22983e06efc2c7e662cd65c41b1

Authored by liushiyu
1 parent 93a42607

0.0.8

CNLiveCMineModule.podspec
... ... @@ -8,7 +8,7 @@
8 8  
9 9 Pod::Spec.new do |s|
10 10 s.name = 'CNLiveCMineModule'
11   - s.version = '0.0.7'
  11 + s.version = '0.0.8'
12 12 s.summary = '网家家C端个人中心'
13 13  
14 14 # This description is used to generate tags and improve search results.
... ...
CNLiveCMineModule/Classes/inte/Controller/CNLiveCMineInteAnnouListViewController.m
... ... @@ -88,9 +88,9 @@
88 88 {
89 89 CNLiveCMineInteListSubModel * annouModel = self.annouModel.list[indexPath.row];
90 90 if ([annouModel.model isEqualToString:@"3"] || [annouModel.model isEqualToString:@"3_roof"]) {
91   - BOOL isCont = [annouModel.shareUrl cn_containsString:@"?"];
92   - NSString * shreUrl = [NSString stringWithFormat:@"%@%@contentId=%@",annouModel.shareUrl,isCont?@"&":@"?",annouModel.contentId];
93   - [[CNLiveCMineService shareMineProtocol] pushCMineInteContentForCMainWebViewWithURL:shreUrl statue:CNLiveCMineIntePushWebViewStatueAnnotationDetail];
  91 +// BOOL isCont = [annouModel.shareUrl cn_containsString:@"?"];
  92 + NSString * shreUrl = [NSString stringWithFormat:@"/cnPointsAnnouncement.html?contentId=%@&isShowTitle=true",annouModel.contentId];
  93 + [[CNLiveCMineService shareMineProtocol] pushCMineInteContentForCMainWebViewWithURL:cn_WjjH5_Host(shreUrl) statue:CNLiveCMineIntePushWebViewStatueAnnotationDetail];
94 94 }
95 95 }
96 96 -(UIStatusBarStyle)preferredStatusBarStyle
... ...
CNLiveCMineModule/Classes/inte/Controller/CNLiveCMineInteDetaiListlViewController.m
... ... @@ -11,6 +11,7 @@
11 11 @property (nonatomic, weak) CNLiveCMineInteDetailViewController * detailVC;
12 12 @property (nonatomic, strong) CNLiveCMineInteDetailModel * listModel;//数据源
13 13 @property (nonatomic, strong) CNLiveRefreshFooter * footerView;//加载
  14 +@property (nonatomic, strong) NSMutableArray * dataArray;
14 15 @property (nonatomic, assign) NSInteger pageNo;
15 16 @end
16 17  
... ... @@ -23,6 +24,7 @@
23 24 {
24 25 self = [super init];
25 26 if (self) {
  27 + _dataArray = [[NSMutableArray alloc] init];
26 28 _currentMonth = currentMonth;
27 29 _currentInte = currentInte;
28 30 _currentType = currentType;
... ... @@ -46,11 +48,13 @@
46 48 self.pageNo = pageNo;
47 49 self.currentType = currentType;
48 50 self.currentMonth = currentMonth;
49   - [CNLiveCMineInteViewModel requestWithIntegraDetailWithCurrentMonth:currentMonth currentType:currentType pageNo:pageNo CompleterBlock:^(CNLiveCMineInteDetailModel * _Nonnull listModel, NSError * _Nonnull error) {
  51 + [CNLiveCMineInteViewModel requestWithIntegraDetailWithCurrentMonth:currentMonth currentType:currentType pageNo:pageNo CompleterBlock:^(CNLiveCMineInteDetailModel * _Nonnull listModel, NSArray * _Nonnull dataArray, NSError * _Nonnull error) {
50 52 [self addMainRefreshView];
51 53 if (!error && listModel) {
52 54 listModel.currentInte = weakSelf.currentInte;
53 55 weakSelf.listModel = listModel;
  56 + if (pageNo == 1) weakSelf.dataArray = dataArray.mutableCopy;
  57 + if (pageNo > 1) [weakSelf.dataArray addObjectsFromArray:dataArray];
54 58 weakSelf.detailVC.headerView.detailModel = listModel;
55 59 [weakSelf.tableView reloadData];
56 60 [weakSelf.tableView.mj_footer endRefreshing];
... ... @@ -101,7 +105,7 @@
101 105 -(void)layoutTableView
102 106 {
103 107 [super layoutTableView];
104   - self.tableView.height = kScreenHeight - kNavigationBarHeight - 44;
  108 + self.tableView.height = kScreenHeight - kNavigationBarHeight - kVerticalBottomSafeHeight - 44;
105 109 }
106 110 #pragma mark - DZNEmptyDataSetSource Methods
107 111 - (NSAttributedString *)titleForEmptyDataSet:(UIScrollView *)scrollView
... ... @@ -146,7 +150,7 @@
146 150  
147 151 -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
148 152 {
149   - return self.listModel.integralList.count;
  153 + return self.dataArray.count;
150 154 }
151 155  
152 156 -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
... ... @@ -155,7 +159,7 @@
155 159 if (!cell) {
156 160 cell = [[CNLiveCMineDetailTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"];
157 161 }
158   - cell.listModel = self.listModel.integralList[indexPath.row];
  162 + cell.listModel = self.dataArray[indexPath.row];
159 163 return cell;
160 164 }
161 165  
... ... @@ -166,9 +170,11 @@
166 170  
167 171 -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
168 172 {
169   - CNLiveCMineInteDetailListModel * listModel = self.listModel.integralList[indexPath.row];
  173 + CNLiveCMineInteDetailListModel * listModel = self.dataArray[indexPath.row];
170 174 if ([listModel.state isEqualToString:@"1"]) {
171   - [[CNLiveCMineService shareMineProtocol] pushCMineInteContentForCMainWebViewWithURL:cn_API_Managemall(@"/html/select_good/1/#/pointsExchangeRecords?type=3") statue:CNLiveCMineIntePushWebViewStatueTask];
  175 + [[CNLiveCMineService shareMineProtocol] pushCMineInteContentForCMainWebViewWithURL:@"" statue:CNLiveCMineIntePushWebViewStatueCoupons];
  176 + } else if ([listModel.state isEqualToString:@"2"]) {
  177 + [[CNLiveCMineService shareMineProtocol] pushCMineInteContentForCMainWebViewWithURL:@"" statue:CNLiveCMineIntePushWebViewStatueOrderList];
172 178 }
173 179 }
174 180  
... ...
CNLiveCMineModule/Classes/inte/Controller/CNLiveCMineInteTaskListViewController.m
... ... @@ -69,7 +69,7 @@
69 69 -(void)layoutTableView
70 70 {
71 71 [super layoutTableView];
72   - self.tableView.height = kScreenHeight - kNavigationBarHeight - 184;
  72 + self.tableView.height = kScreenHeight - kNavigationBarHeight - kVerticalBottomSafeHeight - 184;
73 73 }
74 74 #pragma mark - DZNEmptyDataSetSource Methods
75 75 - (NSAttributedString *)titleForEmptyDataSet:(UIScrollView *)scrollView
... ...
CNLiveCMineModule/Classes/inte/Model/CNLiveCMineInteModel.h
... ... @@ -182,7 +182,7 @@ NS_ASSUME_NONNULL_BEGIN
182 182 @property (nonatomic, copy) NSString *currentInte;
183 183 @end
184 184 @interface CNLiveCMineInteDetailListModel : NSObject<NSCoding>
185   -/**1-跳转 2-不跳转*/
  185 +/**1-跳转优惠券 2-跳订单列表 3-不跳转*/
186 186 @property (nonatomic, copy) NSString *state;
187 187 /**积分*/
188 188 @property (nonatomic, copy) NSString *integral;
... ...
CNLiveCMineModule/Classes/inte/View/CNLiveCMineInteCollectionViewCell.m
... ... @@ -169,8 +169,8 @@
169 169 self.dateLabel.text = listModel.exchangeTime;
170 170 self.coinsLabel.text = listModel.integral;
171 171 self.coinsLabel.textColor = [listModel.integral cn_containsString:@"-"]?UIColorHex(0x00C657):UIColorHex(0xF5A623);
172   - self.lookButton.hidden = [listModel.state isEqualToString:@"2"];
173   - if ([listModel.state isEqualToString:@"1"]) {
  172 + self.lookButton.hidden = [listModel.state isEqualToString:@"3"];
  173 + if ([listModel.state isEqualToString:@"1"] || [listModel.state isEqualToString:@"2"]) {
174 174 __weak typeof(self) weakSelf = self;
175 175 [self.coinsLabel mas_updateConstraints:^(MASConstraintMaker *make) {
176 176 make.centerY.mas_equalTo(weakSelf.contentView).offset(-10);
... ...
CNLiveCMineModule/Classes/inte/View/CNLiveCMineInteHeaderSignView.m
... ... @@ -56,7 +56,7 @@
56 56 [self.topView addSubview:coinsView];
57 57  
58 58 CGFloat item_w = (SCREEN_WIDTH - 60)/7;
59   - CGFloat item_h = item_w * 1.33;
  59 + CGFloat item_h = 60.0f;//item_w * 1.33;
60 60 for (int i = 0; i < 7; i++) {
61 61 UIView * temp_v = [[UIView alloc] initWithFrame:CGRectMake(i * (item_w + 5), 0, item_w, 90)];
62 62 temp_v.backgroundColor = [UIColor clearColor];
... ... @@ -69,12 +69,12 @@
69 69 [temp_v addSubview:coinsV];
70 70 [self.coinsViews addObject:coinsV];
71 71  
72   - UIImageView * coins = [[UIImageView alloc] initWithFrame:CGRectMake((item_w - 30)/2, 10, 30, 30)];
  72 + UIImageView * coins = [[UIImageView alloc] initWithFrame:CGRectMake((item_w - 30)/2, 5, 30, 30)];
73 73 coins.image = [CNLiveCMineService imageWithMineName:@"c_mine_content_gold_coins"];
74 74 coins.backgroundColor = [UIColor clearColor];
75 75 [coinsV addSubview:coins];
76 76  
77   - UILabel * numberLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 40, item_w, 20)];
  77 + UILabel * numberLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 35, item_w, 20)];
78 78 numberLabel.backgroundColor = [UIColor clearColor];
79 79 numberLabel.textColor = [UIColor whiteColor];
80 80 numberLabel.textAlignment = NSTextAlignmentCenter;
... ... @@ -114,15 +114,18 @@
114 114 }];
115 115 [self.iconView mas_makeConstraints:^(MASConstraintMaker *make) {
116 116 make.centerY.mas_equalTo(weakSelf.bottemView).offset(5);
117   - make.left.mas_equalTo(weakSelf.bottemView.mas_left).offset(30);
  117 + make.left.mas_equalTo(weakSelf.bottemView.mas_left).offset(10);
  118 + make.height.mas_equalTo(30);
  119 + make.width.mas_equalTo(40);
118 120 }];
119 121 [self.moreView mas_makeConstraints:^(MASConstraintMaker *make) {
120 122 make.centerY.mas_equalTo(weakSelf.iconView);
121 123 make.right.mas_equalTo(weakSelf.bottemView.mas_right).offset(-20);
  124 + make.size.mas_equalTo(20);
122 125 }];
123 126 [self.annouLabel mas_makeConstraints:^(MASConstraintMaker *make) {
124 127 make.centerY.mas_equalTo(weakSelf.iconView);
125   - make.left.mas_equalTo(weakSelf.iconView.mas_right).offset(20);
  128 + make.left.mas_equalTo(weakSelf.iconView.mas_right).offset(10);
126 129 make.right.mas_equalTo(weakSelf.moreView.mas_left).offset(-10);
127 130 }];
128 131 [self.clearButton mas_makeConstraints:^(MASConstraintMaker *make) {
... ... @@ -232,7 +235,7 @@
232 235 {
233 236 if (!_iconView) {
234 237 _iconView = [[UIImageView alloc] initWithFrame:CGRectZero];
235   - _iconView.contentMode = UIViewContentModeScaleAspectFill;
  238 + _iconView.contentMode = UIViewContentModeScaleAspectFit;
236 239 _iconView.backgroundColor = [UIColor whiteColor];
237 240 _iconView.image = [CNLiveCMineService imageWithMineName:@"c_mine_content_announ"];
238 241 }
... ... @@ -242,7 +245,7 @@
242 245 {
243 246 if (!_moreView) {
244 247 _moreView = [[UIImageView alloc] initWithFrame:CGRectZero];
245   - _moreView.contentMode = UIViewContentModeScaleAspectFill;
  248 + _moreView.contentMode = UIViewContentModeScaleAspectFit;
246 249 _moreView.backgroundColor = [UIColor whiteColor];
247 250 _moreView.image = [CNLiveCMineService imageWithMineName:@"c_mine_skip_more"];
248 251 }
... ...
CNLiveCMineModule/Classes/inte/ViewModel/CNLiveCMineInteViewModel.h
... ... @@ -23,7 +23,9 @@ typedef enum : NSUInteger {
23 23 typedef enum : NSUInteger {
24 24 CNLiveCMineIntePushWebViewStatueMall,//商城 调主工程
25 25 CNLiveCMineIntePushWebViewStatueRule,//积分规则 调主工程
26   - CNLiveCMineIntePushWebViewStatueTask,//积分乐园 调主工程
  26 + CNLiveCMineIntePushWebViewStatueTask,//积分任务 调主工程
  27 + CNLiveCMineIntePushWebViewStatueCoupons,//优惠券 调主工程
  28 + CNLiveCMineIntePushWebViewStatueOrderList,//订单列表 调主工程
27 29 CNLiveCMineIntePushWebViewStatueExchange,//积分兑换 调主工程
28 30 CNLiveCMineIntePushWebViewStatueAnnotationDetail,//公告详情页 调主工程
29 31 } CNLiveCMineIntePushWebViewStatue;
... ... @@ -45,7 +47,7 @@ typedef void(^ClickActionBlock)(CNLiveCMineInteScoreModel * scoreModel,
45 47 /// @param currentType 1-全部 2-获取 3-支出
46 48 /// @param pageNo 页码(默认1)
47 49 /// @param completerBlock 结果返回
48   -+(void)requestWithIntegraDetailWithCurrentMonth:(NSString *)currentMonth currentType:(NSInteger)currentType pageNo:(NSInteger)pageNo CompleterBlock:(void(^)(CNLiveCMineInteDetailModel * listModel,NSError *error))completerBlock;
  50 ++(void)requestWithIntegraDetailWithCurrentMonth:(NSString *)currentMonth currentType:(NSInteger)currentType pageNo:(NSInteger)pageNo CompleterBlock:(void(^)(CNLiveCMineInteDetailModel * listModel,NSArray * dataArray,NSError *error))completerBlock;
49 51  
50 52 @end
51 53  
... ...
CNLiveCMineModule/Classes/inte/ViewModel/CNLiveCMineInteViewModel.m
... ... @@ -148,7 +148,7 @@
148 148 /// @param currentType 1-全部 2-获取 3-支出
149 149 /// @param pageNo 页码(默认1)
150 150 /// @param completerBlock 结果返回
151   -+(void)requestWithIntegraDetailWithCurrentMonth:(NSString *)currentMonth currentType:(NSInteger)currentType pageNo:(NSInteger)pageNo CompleterBlock:(void(^)(CNLiveCMineInteDetailModel *, NSError *))completerBlock
  151 ++(void)requestWithIntegraDetailWithCurrentMonth:(NSString *)currentMonth currentType:(NSInteger)currentType pageNo:(NSInteger)pageNo CompleterBlock:(void(^)(CNLiveCMineInteDetailModel *, NSArray *,NSError *))completerBlock
152 152 {
153 153 NSDictionary * paramDict = @{
154 154 @"sid":[CNUserInfoManager manager].userInfoModel.uid,
... ... @@ -162,7 +162,8 @@
162 162 [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodPOST URLString:cn_API_Host(@"/Daren/integral/integralRecordNew.action") Param:paramDict CacheType:CNLiveNetworkCacheTypeNetworkOnly CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) {
163 163 CNLiveCMineInteDetailModel * listModel = [CNLiveCMineInteDetailModel mj_objectWithKeyValues:responseObject];
164 164 listModel.date_string = currentMonth;
165   - if (completerBlock) completerBlock(listModel,error);
  165 + NSMutableArray * tempArray = listModel.integralList.mutableCopy;
  166 + if (completerBlock) completerBlock(listModel,tempArray,error);
166 167 }];
167 168 }
168 169  
... ...
Example/CNLiveCMineModule/CNLIVEAppDelegate.m
... ... @@ -28,7 +28,7 @@
28 28  
29 29 [super application:application didFinishLaunchingWithOptions:launchOptions];
30 30  
31   - [CNUserInfoManager manager].userInfoModel.uid = @"353001";
  31 + [CNUserInfoManager manager].userInfoModel.uid = @"10510277";//@"353001";
32 32  
33 33 self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
34 34 self.window.backgroundColor = [UIColor whiteColor];
... ...