From de88ae127e305e0b153c327b073645f9353cace5 Mon Sep 17 00:00:00 2001
From: 单军华 <WindShan@danjunhuas-MacBook-Pro.local>
Date: Wed, 18 Apr 2018 16:51:07 +0800
Subject: [PATCH] 新功能修改

---
 pregnancy_guard/BaseProject/Controller/Mine/HistoryRecordPage.m |   54 ++++++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 48 insertions(+), 6 deletions(-)

diff --git a/pregnancy_guard/BaseProject/Controller/Mine/HistoryRecordPage.m b/pregnancy_guard/BaseProject/Controller/Mine/HistoryRecordPage.m
index 5e30416..da6ff78 100644
--- a/pregnancy_guard/BaseProject/Controller/Mine/HistoryRecordPage.m
+++ b/pregnancy_guard/BaseProject/Controller/Mine/HistoryRecordPage.m
@@ -183,11 +183,7 @@
     
     [self GetUserDataList];
     
-    NoticeModel * model = [[NoticeModel alloc] init];
-    self.adNoticeView = [[AdNoticeView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT) dataModel:model];
-    //self.adNoticeView.delegate = self;
-    [self.view addSubview:self.adNoticeView];
-    
+    [self GetNoticeInfo];
     // Do any additional setup after loading the view.
 }
 
@@ -221,6 +217,52 @@
     }
 }
 
+
+-(void)GetNoticeInfo
+{
+    //[UserDefault stringForKey:@"user_id"]
+    NSString *path = [[NSString alloc] initWithFormat:GET_NOTICE];
+    
+    NSMutableDictionary * params = [[NSMutableDictionary alloc] init];
+    
+    MPWeakSelf(self);
+    [NetworkSingleton networkingGetMethod:params urlName:path success:^(id responseBody)
+     {
+         MPStrongSelf(self);
+         BaseResModel * resModel = [Global toBaseModel:responseBody];
+         
+         if(resModel.code == 0)
+         {
+             //[UserDefault setObject:self.is_open_upload forKey:@"is_open_upload"];
+             [UserDefault synchronize];
+             
+             
+             NoticeModel * model = [NoticeModel mj_objectWithKeyValues:resModel.content];
+             
+             if (self.adNoticeView == nil)
+             {
+                 self.adNoticeView = [[AdNoticeView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT) dataModel:model];
+                 //self.adNoticeView.delegate = self;
+                 [self.view addSubview:self.adNoticeView];
+             }
+            else
+            {
+               [self.adNoticeView setUIView:model];
+            }
+         }
+         else
+         {
+             //[Global alertMessageEx:resModel.desc title:@"������������" okTtitle:nil cancelTitle:@"OK" delegate:self];
+         }
+     }
+                                  failure:^(NSString *error)
+     {
+         
+         [Global alertMessageEx:error title:@"������������" okTtitle:nil cancelTitle:@"OK" delegate:self];
+     }];
+}
+
+
 -(void)GetUserDataList
 {
     //[UserDefault stringForKey:@"user_id"]
@@ -241,7 +283,7 @@
          {
              //[UserDefault setObject:self.is_open_upload forKey:@"is_open_upload"];
              [UserDefault synchronize];
-             
+
              //[self.tableView reloadData];
              [Global alertMessageEx:resModel.desc title:@"������������" okTtitle:nil cancelTitle:@"OK" delegate:self];
          }

--
Gitblit v1.8.0