瀏覽代碼

谁是舞王

xiongzhu 7 年之前
父節點
當前提交
07270990fa
共有 24 個文件被更改,包括 999 次插入61 次删除
  1. 34 0
      model.xcodeproj/project.pbxproj
  2. 23 0
      model/Assets.xcassets/icon_liaotian.imageset/Contents.json
  3. 二進制
      model/Assets.xcassets/icon_liaotian.imageset/icon_liaotian.png
  4. 二進制
      model/Assets.xcassets/icon_liaotian.imageset/icon_liaotian@2x.png
  5. 二進制
      model/Assets.xcassets/icon_liaotian.imageset/icon_liaotian@3x.png
  6. 23 0
      model/Assets.xcassets/img_xinbanben.imageset/Contents.json
  7. 二進制
      model/Assets.xcassets/img_xinbanben.imageset/img_xinbanben.png
  8. 二進制
      model/Assets.xcassets/img_xinbanben.imageset/img_xinbanben@2x.png
  9. 二進制
      model/Assets.xcassets/img_xinbanben.imageset/img_xinbanben@3x.png
  10. 1 57
      model/Classes/Application/AppDelegate.m
  11. 11 0
      model/Classes/Controllers/ActivityVC/GroupSendViewController.h
  12. 103 0
      model/Classes/Controllers/ActivityVC/GroupSendViewController.m
  13. 17 0
      model/Classes/Controllers/ActivityVC/ModelFansViewController.h
  14. 141 0
      model/Classes/Controllers/ActivityVC/ModelFansViewController.m
  15. 39 0
      model/Classes/Controllers/ActivityVC/ModelFansViewController.xib
  16. 20 0
      model/Classes/Public/AdViewController.h
  17. 213 0
      model/Classes/Public/AdViewController.m
  18. 87 0
      model/Classes/Public/ModelRootViewController.m
  19. 18 0
      model/Classes/Public/UpdateViewController.h
  20. 199 0
      model/Classes/Public/UpdateViewController.m
  21. 30 3
      model/Classes/Public/WebViewController.m
  22. 11 0
      model/Classes/Tools/Category/UIImage+Common.h
  23. 28 0
      model/Classes/Tools/Category/UIImage+Common.m
  24. 1 1
      model/Info.plist

+ 34 - 0
model.xcodeproj/project.pbxproj

@@ -16,7 +16,12 @@
 		2F168373210EA5EE00941193 /* Helper.m in Sources */ = {isa = PBXBuildFile; fileRef = 2F168372210EA5EE00941193 /* Helper.m */; };
 		2F16837921115BB900941193 /* UIColor+Hex.m in Sources */ = {isa = PBXBuildFile; fileRef = 2F16837821115BB900941193 /* UIColor+Hex.m */; };
 		2F2DC56573F0D91B44638027 /* WebViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2F2DCD440515C856BBDA9B1D /* WebViewController.m */; };
+		2F2DC8EF58561126AE9A42D3 /* UIImage+Common.m in Sources */ = {isa = PBXBuildFile; fileRef = 2F2DC4A5BC9011AC956D7B15 /* UIImage+Common.m */; };
+		2F2DCAE385C369FE8FBD3655 /* UpdateViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2F2DCDD934FC3D65EE555D50 /* UpdateViewController.m */; };
+		2F2DCBA036922E7E0D641754 /* AdViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2F2DCC66F11C1015F6404FE0 /* AdViewController.m */; };
+		2F2DCC290897002EACECD047 /* GroupSendViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2F2DC49D629E3F19ADA495FB /* GroupSendViewController.m */; };
 		2F2DCCF423A7BCD5C7A73F2F /* WeakScriptMessageDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 2F2DC77CFE857F42892EDE51 /* WeakScriptMessageDelegate.m */; };
+		2F2DCD7F52441035B078B07E /* ModelFansViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2F2DCF61108916BCA6D75442 /* ModelFansViewController.m */; };
 		2F4A8922211ADACF006D7DD3 /* DetailOnlyTextViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2F4A891C211ADACE006D7DD3 /* DetailOnlyTextViewController.m */; };
 		2F4A8923211ADACF006D7DD3 /* DetailOneImageViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2F4A891D211ADACE006D7DD3 /* DetailOneImageViewController.m */; };
 		2F4A8924211ADACF006D7DD3 /* DetailOneImageViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2F4A891E211ADACE006D7DD3 /* DetailOneImageViewController.xib */; };
@@ -388,6 +393,7 @@
 		3AC5CA09218BEB4B00D4ACAC /* RankHeader.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3AC5CA08218BEB4B00D4ACAC /* RankHeader.xib */; };
 		3ACF405621919448002C69D3 /* WithdrawController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3ACF405321919448002C69D3 /* WithdrawController.m */; };
 		3ACF405721919448002C69D3 /* WithdrawController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3ACF405521919448002C69D3 /* WithdrawController.xib */; };
+		3AD1252A21DF6BA500BD8ED7 /* ModelFansViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3AD1252921DF6BA500BD8ED7 /* ModelFansViewController.xib */; };
 		3AE8C7AA218B2E550069D147 /* ModelCardController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3AE8C7A9218B2E550069D147 /* ModelCardController.m */; };
 		3AE8C7AD218B49890069D147 /* IntroView.m in Sources */ = {isa = PBXBuildFile; fileRef = 3AE8C7AC218B49890069D147 /* IntroView.m */; };
 		3AE8C7AF218B49EC0069D147 /* IntroView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3AE8C7AE218B49EC0069D147 /* IntroView.xib */; };
@@ -480,10 +486,20 @@
 		2F168372210EA5EE00941193 /* Helper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Helper.m; sourceTree = "<group>"; };
 		2F16837721115BB900941193 /* UIColor+Hex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIColor+Hex.h"; sourceTree = "<group>"; };
 		2F16837821115BB900941193 /* UIColor+Hex.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIColor+Hex.m"; sourceTree = "<group>"; };
+		2F2DC2E1D9EAE5A3CA1DDA45 /* GroupSendViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GroupSendViewController.h; sourceTree = "<group>"; };
+		2F2DC3E3AF6DE60441AD2AAF /* AdViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AdViewController.h; sourceTree = "<group>"; };
+		2F2DC49D629E3F19ADA495FB /* GroupSendViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GroupSendViewController.m; sourceTree = "<group>"; };
+		2F2DC4A5BC9011AC956D7B15 /* UIImage+Common.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImage+Common.m"; sourceTree = "<group>"; };
 		2F2DC6350BD1314056B22F68 /* WeakScriptMessageDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WeakScriptMessageDelegate.h; sourceTree = "<group>"; };
 		2F2DC77CFE857F42892EDE51 /* WeakScriptMessageDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WeakScriptMessageDelegate.m; sourceTree = "<group>"; };
+		2F2DC865F65C3A6BD0F0681C /* UpdateViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UpdateViewController.h; sourceTree = "<group>"; };
+		2F2DC92B244EEEDB9859BF72 /* UIImage+Common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImage+Common.h"; sourceTree = "<group>"; };
+		2F2DCAA0574568B94F1D317B /* ModelFansViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ModelFansViewController.h; sourceTree = "<group>"; };
 		2F2DCAA19BC75E0F1AE6AA70 /* WebViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebViewController.h; sourceTree = "<group>"; };
+		2F2DCC66F11C1015F6404FE0 /* AdViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AdViewController.m; sourceTree = "<group>"; };
 		2F2DCD440515C856BBDA9B1D /* WebViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WebViewController.m; sourceTree = "<group>"; };
+		2F2DCDD934FC3D65EE555D50 /* UpdateViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UpdateViewController.m; sourceTree = "<group>"; };
+		2F2DCF61108916BCA6D75442 /* ModelFansViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ModelFansViewController.m; sourceTree = "<group>"; };
 		2F4A891C211ADACE006D7DD3 /* DetailOnlyTextViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DetailOnlyTextViewController.m; sourceTree = "<group>"; };
 		2F4A891D211ADACE006D7DD3 /* DetailOneImageViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DetailOneImageViewController.m; sourceTree = "<group>"; };
 		2F4A891E211ADACE006D7DD3 /* DetailOneImageViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = DetailOneImageViewController.xib; sourceTree = "<group>"; };
@@ -1196,6 +1212,7 @@
 		3ACF405321919448002C69D3 /* WithdrawController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WithdrawController.m; sourceTree = "<group>"; };
 		3ACF405421919448002C69D3 /* WithdrawController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WithdrawController.h; sourceTree = "<group>"; };
 		3ACF405521919448002C69D3 /* WithdrawController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = WithdrawController.xib; sourceTree = "<group>"; };
+		3AD1252921DF6BA500BD8ED7 /* ModelFansViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ModelFansViewController.xib; sourceTree = "<group>"; };
 		3AE8C7A8218B2E550069D147 /* ModelCardController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ModelCardController.h; sourceTree = "<group>"; };
 		3AE8C7A9218B2E550069D147 /* ModelCardController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ModelCardController.m; sourceTree = "<group>"; };
 		3AE8C7AB218B49890069D147 /* IntroView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IntroView.h; sourceTree = "<group>"; };
@@ -1415,6 +1432,11 @@
 				3A5C818A21DD9BF80019F82A /* UploadVideoViewController.h */,
 				3A5C818B21DD9BF80019F82A /* UploadVideoViewController.m */,
 				3A5C818C21DD9BF80019F82A /* UploadVideoViewController.xib */,
+				2F2DCF61108916BCA6D75442 /* ModelFansViewController.m */,
+				2F2DCAA0574568B94F1D317B /* ModelFansViewController.h */,
+				3AD1252921DF6BA500BD8ED7 /* ModelFansViewController.xib */,
+				2F2DC49D629E3F19ADA495FB /* GroupSendViewController.m */,
+				2F2DC2E1D9EAE5A3CA1DDA45 /* GroupSendViewController.h */,
 			);
 			path = ActivityVC;
 			sourceTree = "<group>";
@@ -2804,6 +2826,10 @@
 				2F2DCD440515C856BBDA9B1D /* WebViewController.m */,
 				2F2DC77CFE857F42892EDE51 /* WeakScriptMessageDelegate.m */,
 				2F2DC6350BD1314056B22F68 /* WeakScriptMessageDelegate.h */,
+				2F2DCDD934FC3D65EE555D50 /* UpdateViewController.m */,
+				2F2DC865F65C3A6BD0F0681C /* UpdateViewController.h */,
+				2F2DCC66F11C1015F6404FE0 /* AdViewController.m */,
+				2F2DC3E3AF6DE60441AD2AAF /* AdViewController.h */,
 			);
 			path = Public;
 			sourceTree = "<group>";
@@ -2872,6 +2898,8 @@
 				8848C6962108530600EDB121 /* UITextView+WZB.m */,
 				EF7B0C0520FC4B840078781D /* NSString+method.h */,
 				EF7B0C0420FC4B840078781D /* NSString+method.m */,
+				2F2DC4A5BC9011AC956D7B15 /* UIImage+Common.m */,
+				2F2DC92B244EEEDB9859BF72 /* UIImage+Common.h */,
 			);
 			path = Category;
 			sourceTree = "<group>";
@@ -3062,6 +3090,7 @@
 				2F4A8950211ADB00006D7DD3 /* DetailOnlyTextCell.xib in Resources */,
 				8848C66B210813D300EDB121 /* PhotoCollectionViewCell.xib in Resources */,
 				2F4A8973211D9F04006D7DD3 /* SignInfoCell.xib in Resources */,
+				3AD1252A21DF6BA500BD8ED7 /* ModelFansViewController.xib in Resources */,
 				3A5C818E21DD9BF80019F82A /* UploadVideoViewController.xib in Resources */,
 				2F4A8949211ADB00006D7DD3 /* OneImageCell.xib in Resources */,
 				3AC5CA04218BDDC700D4ACAC /* RankCell.xib in Resources */,
@@ -3554,6 +3583,11 @@
 				2F8D24592111895000CD7347 /* NSArray+Log.m in Sources */,
 				2F2DC56573F0D91B44638027 /* WebViewController.m in Sources */,
 				2F2DCCF423A7BCD5C7A73F2F /* WeakScriptMessageDelegate.m in Sources */,
+				2F2DC8EF58561126AE9A42D3 /* UIImage+Common.m in Sources */,
+				2F2DCAE385C369FE8FBD3655 /* UpdateViewController.m in Sources */,
+				2F2DCBA036922E7E0D641754 /* AdViewController.m in Sources */,
+				2F2DCD7F52441035B078B07E /* ModelFansViewController.m in Sources */,
+				2F2DCC290897002EACECD047 /* GroupSendViewController.m in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};

+ 23 - 0
model/Assets.xcassets/icon_liaotian.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "icon_liaotian.png",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "icon_liaotian@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "icon_liaotian@3x.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

二進制
model/Assets.xcassets/icon_liaotian.imageset/icon_liaotian.png


二進制
model/Assets.xcassets/icon_liaotian.imageset/icon_liaotian@2x.png


二進制
model/Assets.xcassets/icon_liaotian.imageset/icon_liaotian@3x.png


+ 23 - 0
model/Assets.xcassets/img_xinbanben.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "img_xinbanben.png",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "img_xinbanben@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "img_xinbanben@3x.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

二進制
model/Assets.xcassets/img_xinbanben.imageset/img_xinbanben.png


二進制
model/Assets.xcassets/img_xinbanben.imageset/img_xinbanben@2x.png


二進制
model/Assets.xcassets/img_xinbanben.imageset/img_xinbanben@3x.png


+ 1 - 57
model/Classes/Application/AppDelegate.m

@@ -17,13 +17,13 @@
 #import "NTESSessionUtil.h"
 #import "WXApi.h"
 #import "UIAlertView+NTESBlock.h"
+#import "UpdateViewController.h"
 
 @import PushKit;
 
 NSString *NTESNotificationLogout = @"NTESNotificationLogout";
 
 @interface AppDelegate () <NIMLoginManagerDelegate, PKPushRegistryDelegate, WXApiDelegate>
-@property(nonatomic, assign) BOOL checkUpdateWhenEnter;
 @end
 
 @implementation AppDelegate
@@ -92,7 +92,6 @@ NSString *NTESNotificationLogout = @"NTESNotificationLogout";
     [self.window makeKeyAndVisible];
 
     [WXApi registerApp:@"wx2a873aba839dbb4b" enableMTA:YES];
-    [self checkUpdate];
     return YES;
 }
 
@@ -156,9 +155,6 @@ NSString *NTESNotificationLogout = @"NTESNotificationLogout";
     [[NSNotificationCenter defaultCenter] postNotificationName:@"orderMsg" object:nil];
     [[NSNotificationCenter defaultCenter] postNotificationName:@"hideNavigationBar" object:nil];
     // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
-    if (self.checkUpdateWhenEnter) {
-        [self checkUpdate];
-    }
 }
 
 #pragma mark -
@@ -324,58 +320,6 @@ NSString *NTESNotificationLogout = @"NTESNotificationLogout";
                                              }];
 }
 
-#pragma mark - appUpdate
-
-- (void)checkUpdate {
-    [YanCNetWorkManager
-            requestPostWithURLStr:Url_checkUpdate(PublicUrl)
-                       parameters:nil
-                           finish:^(id dataDic) {
-                               if ([@"success" isEqualToString:dataDic[@"msg"]]) {
-                                   NSDictionary *data = dataDic[@"data"];
-                                   int currentVersion = [self versionExchangeType:[self getSystemVersion]];
-                                   int latestVersion = [self versionExchangeType:data[@"ios"][@"model"][@"version"]];
-                                   if (currentVersion < latestVersion) {
-                                       UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"提示" message:[NSString stringWithFormat:@"发现新版本%@", data[@"ios"][@"model"][@"version"]] preferredStyle:UIAlertControllerStyleAlert];
-                                       [alert addAction:@"立即更新" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
-                                           NSURL *url = [NSURL URLWithString:@"itms-apps://itunes.apple.com/app/id1434011196?mt=8"];
-                                           if (@available(iOS 10.0, *)) {
-                                               [[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil];
-                                           } else {
-                                               [[UIApplication sharedApplication] openURL:url];
-                                           }
-                                       }];
-                                       BOOL force = [data[@"ios"][@"model"][@"force"] boolValue];
-                                       if (force) {
-                                           self.checkUpdateWhenEnter = YES;
-                                       } else {
-                                           [alert addAction:@"取消" style:UIAlertActionStyleCancel handler:nil];
-                                       }
-                                       [self showAlert:alert];
-                                   }
-                               }
-                           }
-                          enError:^(NSError *error) {
-                          }];
-}
-
-- (NSString *)getSystemVersion {
-    NSDictionary *infoDic = [[NSBundle mainBundle] infoDictionary];
-    NSString *currentVersion = infoDic[@"CFBundleShortVersionString"];
-    return currentVersion;
-}
 
-- (int)versionExchangeType:(NSString *)version {
-    NSArray *subArr = [version componentsSeparatedByString:@"."];
-    if (subArr.count > 0) {
-        NSString *value = @"";
-        for (int i = 0; i < subArr.count; i++) {
-            value = [value stringByAppendingString:subArr[i]];
-        }
-        return value.intValue;
-    } else {
-        return 0;
-    }
-}
 
 @end

+ 11 - 0
model/Classes/Controllers/ActivityVC/GroupSendViewController.h

@@ -0,0 +1,11 @@
+//
+// Created by Drew on 2019-01-04.
+// Copyright (c) 2019 Mine. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+
+@interface GroupSendViewController : UIViewController
+@property (nonatomic, strong) NSString *modelPK;
+@end

+ 103 - 0
model/Classes/Controllers/ActivityVC/GroupSendViewController.m

@@ -0,0 +1,103 @@
+//
+// Created by Drew on 2019-01-04.
+// Copyright (c) 2019 Mine. All rights reserved.
+//
+
+#import "GroupSendViewController.h"
+#import "UITextView+NTES.h"
+
+@interface GroupSendViewController () {
+}
+@property(nonatomic, strong) UITextView *textField;
+@end
+
+@implementation GroupSendViewController
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    self.navigationItem.title = @"群发通知";
+    UIBarButtonItem *leftItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"icon_back"] style:UIBarButtonItemStylePlain target:self action:@selector(backClick)];
+    self.navigationItem.leftBarButtonItem = leftItem;
+    self.navigationController.navigationBar.tintColor = [UIColor blackColor];
+    self.view.backgroundColor = [UIColor colorWithHexString:@"#F2F4F5"];
+    UIView *view = [[UIView alloc] init];
+    [self.view addSubview:view];
+    [view mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.top.equalTo(self.mas_topLayoutGuide).offset(10);
+        make.left.equalTo(self.view).offset(20);
+        make.right.equalTo(self.view).offset(-20);
+        make.height.mas_equalTo(230);
+    }];
+    view.backgroundColor = [UIColor whiteColor];
+    view.layer.cornerRadius = 8;
+    view.clipsToBounds = YES;
+
+    UITextView *textField = [[UITextView alloc] init];
+    textField.font = [UIFont systemFontOfSize:14];
+    textField.placeholder = @"请输入你想发送的消息内容";
+    textField.placeholderLabel.font = [UIFont systemFontOfSize:13];
+    [view addSubview:textField];
+    self.textField = textField;
+    [textField mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.top.equalTo(view).offset(15);
+        make.left.equalTo(view).offset(20);
+        make.right.equalTo(view).offset(-20);
+        make.bottom.equalTo(view.mas_bottom).offset(-15);
+    }];
+
+    UIButton *button = [[UIButton alloc] init];
+    [button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
+    [button setTitle:@"确认发送" forState:UIControlStateNormal];
+    button.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium];
+    button.layer.backgroundColor = [UIColor colorWithRed:1.0 green:64 / 255.f blue:149 / 255.f alpha:1.0].CGColor;
+    button.layer.cornerRadius = 22;
+    button.layer.shadowColor = [UIColor colorWithRed:1.0 green:64 / 255.f blue:149 / 255.f alpha:0.36].CGColor;
+    button.layer.shadowOffset = CGSizeMake(0, 8);
+    button.layer.shadowOpacity = 1;
+    button.layer.shadowRadius = 10;
+    [self.view addSubview:button];
+    [button mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.equalTo(view).offset(20);
+        make.right.equalTo(view).offset(-20);
+        make.height.mas_equalTo(44);
+        make.top.equalTo(view.mas_bottom).offset(20);
+    }];
+    [button addTarget:self action:@selector(send) forControlEvents:UIControlEventTouchUpInside];
+
+    UILabel *tip = [[UILabel alloc] init];
+    tip.font = [UIFont systemFontOfSize:12];
+    tip.textColor = [UIColor colorWithHexString:@"#999999"];
+    [self.view addSubview:tip];
+    [tip mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.centerX.equalTo(self.view);
+        make.top.equalTo(button.mas_bottom).offset(20);
+    }];
+    tip.text = @"注:群发消息会通过千模小助手帮你通知到所有粉丝";
+}
+
+- (void)backClick {
+    [self.navigationController popViewControllerAnimated:YES];
+}
+
+- (void)send {
+    if (self.textField.text.length == 0) {
+        [MBProgressHUD showInfo:@"请输入内容"];
+    } else {
+        NSString *url = [NSString stringWithFormat:@"%@/modelInfo?action=sendMsgToFans&modelpk=%@&msg=你关注的%@群发了一条消息:%@", PublicUrl, [ModelUser user].modelpk, [ModelUser user].pet, self.textField.text];
+        url = [url stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
+        [[AHHttpManager sharedManager]
+                POST:url
+          parameters:nil
+             success:^(id responseObject) {
+                 if ([@"success" isEqualToString:responseObject[@"success"]]) {
+                     [self.navigationController popViewControllerAnimated:YES];
+                     [MBProgressHUD showInfo:@"发送成功"];
+                 } else {
+                     [MBProgressHUD showInfo:@"发送失败,请稍后再试"];
+                 }
+             }
+             failure:^(NSError *error) {
+                 [MBProgressHUD showInfo:@"发送失败,请稍后再试"];
+             }];
+    }
+}
+@end

+ 17 - 0
model/Classes/Controllers/ActivityVC/ModelFansViewController.h

@@ -0,0 +1,17 @@
+//
+//  ModelFansViewController.h
+//  千模
+//
+//  Created by Drew on 2018/12/24.
+//  Copyright © 2018 MUMEI. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface ModelFansViewController : UIViewController
+@property (nonatomic, strong) NSString *modelPK;
+@end
+
+NS_ASSUME_NONNULL_END

+ 141 - 0
model/Classes/Controllers/ActivityVC/ModelFansViewController.m

@@ -0,0 +1,141 @@
+//
+//  ModelFansViewController.m
+//  千模
+//
+//  Created by Drew on 2018/12/24.
+//  Copyright © 2018 MUMEI. All rights reserved.
+//
+
+#import "ModelFansViewController.h"
+#import "ModelFansTableViewCell.h"
+#import "Masonry.h"
+#import "GroupSendViewController.h"
+
+@interface ModelFansViewController () <UITableViewDelegate, UITableViewDataSource> {
+    NSInteger page;
+}
+@property(weak, nonatomic) IBOutlet UITableView *tableView;
+@property(nonatomic, strong) NSMutableArray *data;
+@property(nonatomic, strong) UIView *headView;
+@end
+
+@implementation ModelFansViewController
+
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    page = 1;
+    self.navigationItem.title = @"粉丝团";
+    UIBarButtonItem *leftItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"icon_back"] style:UIBarButtonItemStylePlain target:self action:@selector(backClick)];
+    self.navigationItem.leftBarButtonItem = leftItem;
+    self.navigationController.navigationBar.tintColor = [UIColor blackColor];
+
+    self.view.backgroundColor = [UIColor colorWithHexString:@"#F2F4F5"];
+    self.data = [NSMutableArray arrayWithCapacity:0];
+    self.tableView.backgroundColor = [UIColor clearColor];
+    self.tableView.delegate = self;
+    self.tableView.dataSource = self;
+    self.tableView.contentInset = UIEdgeInsetsMake(5, 0, 5, 0);
+    self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
+    self.tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingTarget:self refreshingAction:@selector(refresh)];
+    self.tableView.mj_footer = [MJRefreshAutoNormalFooter footerWithRefreshingTarget:self refreshingAction:@selector(loadMore)];
+    if ([self.modelPK isEqualToString:[ModelUser user].modelpk]) {
+        self.tableView.tableHeaderView = self.headView;
+    }
+    [self getData];
+}
+
+- (void)viewWillAppear:(BOOL)animated {
+    [super viewWillAppear:animated];
+    self.navigationController.navigationBar.tintColor = [UIColor blackColor];
+}
+
+- (void)backClick {
+    [self.navigationController popViewControllerAnimated:YES];
+}
+
+- (void)getData {
+    NSString *url = [NSString stringWithFormat:@"%@/modelInfo?action=modelfans&modelpk=%@&page=%zd&size=20", PublicUrl, self.modelPK, page];
+    [[AHHttpManager sharedManager]
+            POST:url
+      parameters:nil
+         success:^(id responseObject) {
+             if ([@"success" isEqualToString:responseObject[@"msg"]]) {
+                 [self.tableView reloadData];
+                 NSArray *data = responseObject[@"data"];
+                 if (page == 1) {
+                     [self.data removeAllObjects];
+                 }
+                 [self.data addObjectsFromArray:data];
+                 [self.tableView reloadData];
+                 [self.tableView.mj_header endRefreshing];
+                 if (data.count < 20) {
+                     [self.tableView.mj_footer endRefreshingWithNoMoreData];
+                 } else {
+                     [self.tableView.mj_footer endRefreshing];
+                 }
+             }
+         }
+         failure:^(NSError *error) {
+
+         }];
+}
+
+- (void)refresh {
+    page = 1;
+    [self getData];
+}
+
+- (void)loadMore {
+    page++;
+    [self getData];
+}
+
+- (UIView *)headView {
+    if (!_headView) {
+        _headView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, 64)];
+        UIButton *button = [[UIButton alloc] init];
+        button.layer.backgroundColor = [UIColor colorWithRed:1.0 green:64 / 255.f blue:149 / 255.f alpha:1.0].CGColor;
+        button.layer.cornerRadius = 22;
+        [button setImage:[UIImage imageNamed:@"icon_liaotian"] forState:UIControlStateNormal];
+        [button setTitle:@"群发消息" forState:UIControlStateNormal];
+        [button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
+        button.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium];
+        [_headView addSubview:button];
+        [button mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.left.equalTo(_headView).offset(20);
+            make.right.equalTo(_headView).offset(-20);
+            make.height.mas_equalTo(44);
+            make.centerY.equalTo(_headView);
+        }];
+        [button addTarget:self action:@selector(sendMsgToFans) forControlEvents:UIControlEventTouchUpInside];
+    }
+    return _headView;
+}
+
+- (void)sendMsgToFans {
+    GroupSendViewController *vc = [[GroupSendViewController alloc] init];
+    vc.modelPK = self.modelPK;
+    [self.navigationController pushViewController:vc animated:YES];
+
+}
+
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
+    return self.data.count;
+}
+
+- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
+    ModelFansTableViewCell *cell = [self.tableView dequeueReusableCellWithIdentifier:@"ModelFansTableViewCell"];
+    if (!cell) {
+        NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"ModelFansTableViewCell" owner:self options:nil];
+        cell = nib[0];
+        cell.selectionStyle = UITableViewCellSelectionStyleNone;
+        cell.data = self.data[indexPath.row];
+    }
+    return cell;
+}
+
+- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
+    return 70;
+}
+@end

+ 39 - 0
model/Classes/Controllers/ActivityVC/ModelFansViewController.xib

@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14313.18" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+    <device id="retina4_7" orientation="portrait">
+        <adaptation id="fullscreen"/>
+    </device>
+    <dependencies>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14283.14"/>
+        <capability name="Safe area layout guides" minToolsVersion="9.0"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="ModelFansViewController">
+            <connections>
+                <outlet property="tableView" destination="dEM-zY-aTS" id="L0I-vF-06U"/>
+                <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
+            </connections>
+        </placeholder>
+        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
+        <view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
+            <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
+            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+            <subviews>
+                <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="dEM-zY-aTS">
+                    <rect key="frame" x="0.0" y="20" width="375" height="647"/>
+                    <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                </tableView>
+            </subviews>
+            <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+            <constraints>
+                <constraint firstItem="Q5M-cg-NOt" firstAttribute="bottom" secondItem="dEM-zY-aTS" secondAttribute="bottom" id="IrW-zS-laX"/>
+                <constraint firstItem="Q5M-cg-NOt" firstAttribute="trailing" secondItem="dEM-zY-aTS" secondAttribute="trailing" id="R02-A9-wwi"/>
+                <constraint firstItem="dEM-zY-aTS" firstAttribute="leading" secondItem="Q5M-cg-NOt" secondAttribute="leading" id="cSS-Bg-Wfl"/>
+                <constraint firstItem="dEM-zY-aTS" firstAttribute="top" secondItem="Q5M-cg-NOt" secondAttribute="top" id="mna-Wb-zTB"/>
+            </constraints>
+            <viewLayoutGuide key="safeArea" id="Q5M-cg-NOt"/>
+        </view>
+    </objects>
+</document>

+ 20 - 0
model/Classes/Public/AdViewController.h

@@ -0,0 +1,20 @@
+//
+//  AdViewController.h
+//  千模
+//
+//  Created by Drew on 2019/1/4.
+//  Copyright © 2019 MUMEI. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface AdViewController : UIViewController
+@property(nonatomic, strong) UIImageView *img;
+@property(nonatomic, strong) UILabel *label;
+@property(nonatomic, strong) NSDictionary *model;
+@property(nonatomic, copy) void (^callback)();
+@end
+
+NS_ASSUME_NONNULL_END

+ 213 - 0
model/Classes/Public/AdViewController.m

@@ -0,0 +1,213 @@
+//
+//  AdViewController.m
+//  千模
+//
+//  Created by Drew on 2019/1/4.
+//  Copyright © 2019 MUMEI. All rights reserved.
+//
+
+#import "AdViewController.h"
+#import "Masonry.h"
+#import "WebViewController.h"
+
+@interface AdPresenter : UIPresentationController
+@property(nonatomic, strong) UIView *dimmingView;
+@end
+
+@implementation AdPresenter : UIPresentationController
+- (instancetype)initWithPresentedViewController:(UIViewController *)presentedViewController presentingViewController:(UIViewController *)presentingViewController {
+    self = [super initWithPresentedViewController:presentedViewController presentingViewController:presentingViewController];
+    if (self) {
+        // 必须设置 presentedViewController 的 modalPresentationStyle
+        // 在自定义动画效果的情况下,苹果强烈建议设置为 UIModalPresentationCustom
+        presentedViewController.modalPresentationStyle = UIModalPresentationCustom;
+    }
+    return self;
+}
+
+// 呈现过渡即将开始的时候被调用的
+// 可以在此方法创建和设置自定义动画所需的view
+- (void)presentationTransitionWillBegin {
+    self.containerView.layer.cornerRadius = 14;
+    // 背景遮罩
+    UIView *dimmingView = [[UIView alloc] initWithFrame:self.containerView.bounds];
+    dimmingView.backgroundColor = [UIColor blackColor];
+    dimmingView.opaque = NO; //是否透明
+    dimmingView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
+    [dimmingView addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(dimmingViewTapped:)]];
+    self.dimmingView = dimmingView;
+
+    [self.containerView addSubview:dimmingView]; // 添加到动画容器View中。
+
+    // 获取presentingViewController 的转换协调器,应该动画期间的一个类?上下文?之类的,负责动画的一个东西
+    id <UIViewControllerTransitionCoordinator> transitionCoordinator = self.presentingViewController.transitionCoordinator;
+
+    // 动画期间,背景View的动画方式
+    self.dimmingView.alpha = 0.f;
+    [transitionCoordinator animateAlongsideTransition:^(id <UIViewControllerTransitionCoordinatorContext> context) {
+        self.dimmingView.alpha = 0.4f;
+    }                                      completion:NULL];
+}
+
+#pragma mark 点击了背景遮罩view
+
+- (void)dimmingViewTapped:(UITapGestureRecognizer *)sender {
+    [self.presentingViewController dismissViewControllerAnimated:YES completion:NULL];
+}
+
+// 在呈现过渡结束时被调用的,并且该方法提供一个布尔变量来判断过渡效果是否完成
+- (void)presentationTransitionDidEnd:(BOOL)completed {
+    // 在取消动画的情况下,可能为NO,这种情况下,应该取消视图的引用,防止视图没有释放
+    if (!completed) {
+        self.dimmingView = nil;
+    }
+}
+
+// 消失过渡即将开始的时候被调用的
+- (void)dismissalTransitionWillBegin {
+    id <UIViewControllerTransitionCoordinator> transitionCoordinator = self.presentingViewController.transitionCoordinator;
+
+    [transitionCoordinator animateAlongsideTransition:^(id <UIViewControllerTransitionCoordinatorContext> context) {
+        self.dimmingView.alpha = 0.f;
+    }                                      completion:NULL];
+}
+
+// 消失过渡完成之后调用,此时应该将视图移除,防止强引用
+- (void)dismissalTransitionDidEnd:(BOOL)completed {
+    if (completed == YES) {
+        [self.dimmingView removeFromSuperview];
+        self.dimmingView = nil;
+    }
+}
+
+// 返回目标控制器Viewframe
+- (CGRect)frameOfPresentedViewInContainerView {
+    CGFloat width = ScreenWidth - 96;
+    CGFloat height = 386.f;
+    CGRect containerViewBounds = CGRectMake((self.containerView.bounds.size.width - width) / 2, (self.containerView.bounds.size.height - height) / 2, width, height);
+    return containerViewBounds;
+}
+
+//  建议就这样重写就行,这个应该是控制器内容大小变化时,就会调用这个方法, 比如适配横竖屏幕时,翻转屏幕时
+//  可以使用UIContentContainer的方法来调整任何子视图控制器的大小或位置。
+- (void)preferredContentSizeDidChangeForChildContentContainer:(id <UIContentContainer>)container {
+    [super preferredContentSizeDidChangeForChildContentContainer:container];
+    if (container == self.presentedViewController) [self.containerView setNeedsLayout];
+}
+
+- (void)containerViewWillLayoutSubviews {
+    [super containerViewWillLayoutSubviews];
+    self.dimmingView.frame = self.containerView.bounds;
+}
+@end
+
+@interface AdViewController () <UIViewControllerTransitioningDelegate>
+
+@end
+
+@implementation AdViewController
+- (instancetype)init {
+    if (self = [super init]) {
+        self.transitioningDelegate = self;
+        self.modalPresentationStyle = UIModalPresentationCustom;
+    }
+    return self;
+}
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    self.view.backgroundColor = [UIColor whiteColor];
+    self.view.layer.cornerRadius = 14;
+    self.view.clipsToBounds = YES;
+    self.img = [[UIImageView alloc] init];
+    self.img.contentMode = UIViewContentModeScaleAspectFill;
+    self.img.clipsToBounds = YES;
+    [self.view addSubview:self.img];
+    [self.img mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.top.right.equalTo(self.view);
+        make.height.mas_equalTo(210);
+    }];
+
+    self.label = [[UILabel alloc] init];
+    [self.view addSubview:self.label];
+    [self.label mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.equalTo(self.view).offset(25);
+        make.right.equalTo(self.view).offset(-25);
+        make.top.equalTo(self.img.mas_bottom).offset(16);
+        make.height.mas_equalTo(40);
+    }];
+    self.label.font = [UIFont systemFontOfSize:14];
+    self.label.textColor = [UIColor blackColor];
+
+    UIButton *detailBtn = [[UIButton alloc] init];
+    [self.view addSubview:detailBtn];
+    [detailBtn mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.equalTo(self.view).offset(25);
+        make.right.equalTo(self.view).offset(-25);
+        make.top.equalTo(self.label.mas_bottom).offset(20);
+        make.height.mas_equalTo(40);
+    }];
+    [detailBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
+    [detailBtn setTitle:@"立即查看" forState:UIControlStateNormal];
+    detailBtn.titleLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightMedium];
+    detailBtn.layer.backgroundColor = [UIColor colorWithRed:1.f green:64 / 255.f blue:149 / 255.f alpha:1.0].CGColor;
+    detailBtn.layer.cornerRadius = 22;
+    detailBtn.layer.shadowColor = [UIColor colorWithRed:1.f green:64 / 255.f blue:149 / 255.f alpha:0.36].CGColor;
+    detailBtn.layer.shadowOffset = CGSizeMake(0, 8);
+    detailBtn.layer.shadowOpacity = 1;
+    detailBtn.layer.shadowRadius = 10;
+    [detailBtn addTarget:self action:@selector(detail) forControlEvents:UIControlEventTouchUpInside];
+
+    UIButton *cancelBtn = [[UIButton alloc] init];
+    [self.view addSubview:cancelBtn];
+    [cancelBtn mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.centerX.equalTo(self.view);
+        make.top.equalTo(detailBtn.mas_bottom).offset(20);
+    }];
+    cancelBtn.titleLabel.font = [UIFont systemFontOfSize:14];
+    [cancelBtn setTitle:@"稍后再说" forState:UIControlStateNormal];
+    [cancelBtn setTitleColor:[UIColor colorWithHexString:@"#8F9294"] forState:UIControlStateNormal];
+    [cancelBtn addTarget:self action:@selector(dismiss) forControlEvents:UIControlEventTouchUpInside];
+
+    NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"%@%@", imageURl, self.model[@"Pic"]]];
+    [self.img sd_setImageWithURL:url placeholderImage:[UIImage imageNamed:@"jiazai"]];
+    self.label.text = self.model[@"Caption"];
+}
+
+- (void)detail {
+
+    [self dismissViewControllerAnimated:YES completion:^{
+        // WebViewController *webVC = [[WebViewController alloc] init];
+        // webVC.url = self.model[@"url"];
+        // webVC.activityPK = self.model[@"PK"];
+        // webVC.hidesBottomBarWhenPushed = YES;
+        // [self.navigationController pushViewController:webVC animated:YES];
+        // [[self findViewController].navigationController pushViewController:webVC animated:YES];
+        if (self.callback) {
+            self.callback();
+        }
+    }];
+}
+
+- (void)dismiss {
+    [self dismissViewControllerAnimated:YES completion:nil];
+}
+
+- (UIViewController *)findViewController {
+    id target = self;
+    while (target) {
+        target = ((UIResponder *) target).nextResponder;
+        if ([target isKindOfClass:[UIViewController class]]) {
+            break;
+        }
+    }
+    return target;
+}
+
+- (UIPresentationController *)presentationControllerForPresentedViewController:(UIViewController *)presented presentingViewController:(UIViewController *)presenting sourceViewController:(UIViewController *)source {
+    return [[AdPresenter alloc] initWithPresentedViewController:presented presentingViewController:self];
+}
+
+
+@end
+

+ 87 - 0
model/Classes/Public/ModelRootViewController.m

@@ -13,6 +13,9 @@
 #import "MessageListViewController.h"
 #import "AppDelegate.h"
 #import "MineNewViewController.h"
+#import "UpdateViewController.h"
+#import "AdViewController.h"
+#import "WebViewController.h"
 
 @interface ModelRootViewController () <NIMSystemNotificationManagerDelegate, NIMConversationManagerDelegate>
 @property(nonatomic, assign) NSInteger sessionUnreadCount;
@@ -44,6 +47,90 @@
     self.selectedIndex = 2;
 }
 
+- (void)viewDidAppear:(BOOL)animated {
+    [super viewDidAppear:animated];
+    [self checkUpdate];
+}
+
+#pragma mark - appUpdate
+
+- (void)checkUpdate {
+    [YanCNetWorkManager
+            requestPostWithURLStr:Url_checkUpdate(PublicUrl)
+                       parameters:nil
+                           finish:^(id dataDic) {
+                               if ([@"success" isEqualToString:dataDic[@"msg"]]) {
+                                   NSDictionary *data = dataDic[@"data"];
+                                   int currentVersion = [self versionExchangeType:[self getSystemVersion]];
+                                   int latestVersion = [self versionExchangeType:data[@"ios"][@"model"][@"version"]];
+                                   if (currentVersion < latestVersion) {
+                                       UpdateViewController *updateViewController = [[UpdateViewController alloc] init];
+                                       updateViewController.version = data[@"ios"][@"member"][@"version"];
+                                       updateViewController.desc = data[@"ios"][@"member"][@"desc"];
+                                       [self presentViewController:updateViewController animated:YES completion:nil];
+                                       return;
+                                   }
+                               }
+                               [self getTopActivity];
+                           }
+                          enError:^(NSError *error) {
+                              [self getTopActivity];
+                          }];
+}
+
+- (NSString *)getSystemVersion {
+    NSDictionary *infoDic = [[NSBundle mainBundle] infoDictionary];
+    NSString *currentVersion = infoDic[@"CFBundleShortVersionString"];
+    return currentVersion;
+}
+
+- (int)versionExchangeType:(NSString *)version {
+    NSArray *subArr = [version componentsSeparatedByString:@"."];
+    if (subArr.count > 0) {
+        NSString *value = @"";
+        for (int i = 0; i < subArr.count; i++) {
+            value = [value stringByAppendingString:subArr[i]];
+        }
+        return value.intValue;
+    } else {
+        return 0;
+    }
+}
+
+- (void)getTopActivity {
+    [[AHHttpManager sharedManager]
+            POST:[NSString
+                    stringWithFormat:@"%@/activity?action=dogettoppartty", PublicUrl]
+      parameters:nil
+         success:^(id responseObject) {
+             if ([[responseObject objectForKey:@"msg"] isEqualToString:@"success"]) {
+                 NSArray *data = responseObject[@"data"];
+                 for (NSUInteger i = 0; i < data.count; ++i) {
+                     long beg = MIN([data[i][@"SBeg"] longValue], [data[i][@"Beg"] longValue]);
+                     long end = MAX([data[i][@"Sendt"] longValue], [data[i][@"Endt"] longValue]);
+                     NSDate *date = [NSDate dateWithTimeIntervalSinceNow:0];
+                     NSTimeInterval time = [date timeIntervalSince1970] * 1000;
+                     if (time >= beg && time <= end) {
+                         AdViewController *adViewController = [[AdViewController alloc] init];
+                         adViewController.model = data[i];
+                         adViewController.callback = ^(void) {
+                             WebViewController *webVC = [[WebViewController alloc] init];
+                             webVC.url = data[i][@"url"];
+                             webVC.activityPK = data[i][@"PK"];
+                             webVC.hidesBottomBarWhenPushed = YES;
+                             [(UINavigationController *) self.selectedViewController pushViewController:webVC animated:YES];
+                         };
+                         [self presentViewController:adViewController animated:YES completion:nil];
+                         return;
+                     }
+                 }
+             }
+         }
+         failure:^(NSError *error) {
+             NSLog(@"error = %@", error);
+         }];
+}
+
 - (void)setupViewController:(UIViewController *)controller andTag:(NSInteger)tag andTitle:(NSString *)title andSelectImg:(NSString *)selectImg andImg:(NSString *)img {
     NSInteger count = [[[NIMSDK sharedSDK] conversationManager] allUnreadCount];
     self.sessionUnreadCount = [NIMSDK sharedSDK].conversationManager.allUnreadCount;

+ 18 - 0
model/Classes/Public/UpdateViewController.h

@@ -0,0 +1,18 @@
+//
+//  UpdateViewController.h
+//  千模
+//
+//  Created by Drew on 2019/1/4.
+//  Copyright © 2019 MUMEI. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface UpdateViewController : UIViewController
+@property(nonatomic, strong) NSString *version;
+@property(nonatomic, strong) NSString *desc;
+@end
+
+NS_ASSUME_NONNULL_END

+ 199 - 0
model/Classes/Public/UpdateViewController.m

@@ -0,0 +1,199 @@
+//
+//  UpdateViewController.m
+//  千模
+//
+//  Created by Drew on 2019/1/4.
+//  Copyright © 2019 MUMEI. All rights reserved.
+//
+
+#import "UpdateViewController.h"
+#import "Masonry.h"
+
+@interface UpdatePresenter : UIPresentationController
+@property(nonatomic, strong) UIView *dimmingView;
+@end
+
+@implementation UpdatePresenter : UIPresentationController
+- (instancetype)initWithPresentedViewController:(UIViewController *)presentedViewController presentingViewController:(UIViewController *)presentingViewController {
+    self = [super initWithPresentedViewController:presentedViewController presentingViewController:presentingViewController];
+    if (self) {
+        // 必须设置 presentedViewController 的 modalPresentationStyle
+        // 在自定义动画效果的情况下,苹果强烈建议设置为 UIModalPresentationCustom
+        presentedViewController.modalPresentationStyle = UIModalPresentationCustom;
+    }
+    return self;
+}
+
+// 呈现过渡即将开始的时候被调用的
+// 可以在此方法创建和设置自定义动画所需的view
+- (void)presentationTransitionWillBegin {
+    self.containerView.layer.cornerRadius = 14;
+    // 背景遮罩
+    UIView *dimmingView = [[UIView alloc] initWithFrame:self.containerView.bounds];
+    dimmingView.backgroundColor = [UIColor blackColor];
+    dimmingView.opaque = NO; //是否透明
+    dimmingView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
+    [dimmingView addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(dimmingViewTapped:)]];
+    self.dimmingView = dimmingView;
+
+    [self.containerView addSubview:dimmingView]; // 添加到动画容器View中。
+
+    // 获取presentingViewController 的转换协调器,应该动画期间的一个类?上下文?之类的,负责动画的一个东西
+    id <UIViewControllerTransitionCoordinator> transitionCoordinator = self.presentingViewController.transitionCoordinator;
+
+    // 动画期间,背景View的动画方式
+    self.dimmingView.alpha = 0.f;
+    [transitionCoordinator animateAlongsideTransition:^(id <UIViewControllerTransitionCoordinatorContext> context) {
+        self.dimmingView.alpha = 0.4f;
+    }                                      completion:NULL];
+}
+
+#pragma mark 点击了背景遮罩view
+
+- (void)dimmingViewTapped:(UITapGestureRecognizer *)sender {
+}
+
+// 在呈现过渡结束时被调用的,并且该方法提供一个布尔变量来判断过渡效果是否完成
+- (void)presentationTransitionDidEnd:(BOOL)completed {
+    // 在取消动画的情况下,可能为NO,这种情况下,应该取消视图的引用,防止视图没有释放
+    if (!completed) {
+        self.dimmingView = nil;
+    }
+}
+
+// 消失过渡即将开始的时候被调用的
+- (void)dismissalTransitionWillBegin {
+    id <UIViewControllerTransitionCoordinator> transitionCoordinator = self.presentingViewController.transitionCoordinator;
+
+    [transitionCoordinator animateAlongsideTransition:^(id <UIViewControllerTransitionCoordinatorContext> context) {
+        self.dimmingView.alpha = 0.f;
+    }                                      completion:NULL];
+}
+
+// 消失过渡完成之后调用,此时应该将视图移除,防止强引用
+- (void)dismissalTransitionDidEnd:(BOOL)completed {
+    if (completed == YES) {
+        [self.dimmingView removeFromSuperview];
+        self.dimmingView = nil;
+    }
+}
+
+// 返回目标控制器Viewframe
+- (CGRect)frameOfPresentedViewInContainerView {
+    CGFloat width = 280;
+    CGFloat height = 386.f;
+    CGRect containerViewBounds = CGRectMake((self.containerView.bounds.size.width - width) / 2, (self.containerView.bounds.size.height - height) / 2, width, height);
+    return containerViewBounds;
+}
+
+//  建议就这样重写就行,这个应该是控制器内容大小变化时,就会调用这个方法, 比如适配横竖屏幕时,翻转屏幕时
+//  可以使用UIContentContainer的方法来调整任何子视图控制器的大小或位置。
+- (void)preferredContentSizeDidChangeForChildContentContainer:(id <UIContentContainer>)container {
+    [super preferredContentSizeDidChangeForChildContentContainer:container];
+    if (container == self.presentedViewController) [self.containerView setNeedsLayout];
+}
+
+- (void)containerViewWillLayoutSubviews {
+    [super containerViewWillLayoutSubviews];
+    self.dimmingView.frame = self.containerView.bounds;
+}
+@end
+
+@interface UpdateViewController () <UIViewControllerTransitioningDelegate>
+
+@end
+
+@implementation UpdateViewController
+- (instancetype)init {
+    if (self = [super init]) {
+        self.transitioningDelegate = self;
+        self.modalPresentationStyle = UIModalPresentationCustom;
+    }
+    return self;
+}
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    self.view.backgroundColor = [UIColor whiteColor];
+    self.view.layer.cornerRadius = 14;
+    self.view.clipsToBounds = NO;
+
+    UIImageView *img = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"img_xinbanben"]];
+    [self.view addSubview:img];
+    [img mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.right.equalTo(self.view);
+        make.top.equalTo(self.view).offset(-27);
+        make.height.mas_equalTo(227);
+    }];
+
+    UILabel *newVersion = [[UILabel alloc] init];
+    newVersion.text = @"发现新版本";
+    newVersion.font = [UIFont systemFontOfSize:19 weight:UIFontWeightMedium];
+    newVersion.textColor = [UIColor whiteColor];
+    [self.view addSubview:newVersion];
+    [newVersion mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.equalTo(self.view).offset(20);
+        make.top.equalTo(self.view).offset(26);
+    }];
+
+    UIButton *version = [[UIButton alloc] init];
+    version.backgroundColor = [UIColor whiteColor];
+    version.layer.cornerRadius = 9;
+    [version setTitle:self.version forState:UIControlStateNormal];
+    [version setTitleColor:[UIColor colorWithHexString:@"#FF4095"] forState:UIControlStateNormal];
+    version.titleLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightMedium];
+    [self.view addSubview:version];
+    [version mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.width.mas_equalTo(44);
+        make.height.mas_equalTo(18);
+        make.left.equalTo(self.view).offset(20);
+        make.top.equalTo(self.view).offset(54);
+    }];
+
+    UILabel *label = [[UILabel alloc] init];
+    label.font = [UIFont systemFontOfSize:14];
+    label.textColor = [UIColor colorWithHexString:@"#4D4D4D"];
+    label.numberOfLines = 0;
+    label.text = self.desc ? self.desc : @"请立即更新";
+    [self.view addSubview:label];
+    [label mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.equalTo(self.view).offset(40);
+        make.right.equalTo(self.view).offset(-40);
+        make.top.equalTo(self.view).offset(175);
+    }];
+
+    UIButton *button = [[UIButton alloc] init];
+    [button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
+    [button setTitle:@"立即更新" forState:UIControlStateNormal];
+    button.titleLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightMedium];
+    button.layer.backgroundColor = [UIColor colorWithRed:1.0 green:64 / 255.f blue:149 / 255.f alpha:1.0].CGColor;
+    button.layer.cornerRadius = 22;
+    button.layer.shadowColor = [UIColor colorWithRed:1.0 green:64 / 255.f blue:149 / 255.f alpha:0.36].CGColor;
+    button.layer.shadowOffset = CGSizeMake(0, 8);
+    button.layer.shadowOpacity = 1;
+    button.layer.shadowRadius = 10;
+    [self.view addSubview:button];
+    [button mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.equalTo(self.view).offset(20);
+        make.right.equalTo(self.view).offset(-20);
+        make.bottom.equalTo(self.view.mas_bottom).offset(-25);
+        make.height.mas_equalTo(44);
+    }];
+    [button addTarget:self action:@selector(update) forControlEvents:UIControlEventTouchUpInside];
+}
+
+- (void)update {
+    NSURL *url = [NSURL URLWithString:@"itms-apps://itunes.apple.com/app/id1434011196?mt=8"];
+    if (@available(iOS 10.0, *)) {
+        [[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil];
+    } else {
+        [[UIApplication sharedApplication] openURL:url];
+    }
+}
+
+
+- (UIPresentationController *)presentationControllerForPresentedViewController:(UIViewController *)presented presentingViewController:(UIViewController *)presenting sourceViewController:(UIViewController *)source {
+    return [[UpdatePresenter alloc] initWithPresentedViewController:presented presentingViewController:self];
+}
+
+@end

+ 30 - 3
model/Classes/Public/WebViewController.m

@@ -13,6 +13,8 @@
 #import "SharePopViewController.h"
 #import "WeakScriptMessageDelegate.h"
 #import "UploadVideoViewController.h"
+#import "UIImage+Common.h"
+#import "ModelFansViewController.h"
 
 @interface WebViewController () <ShareDelegate, WKUIDelegate, WKScriptMessageHandler>
 @property(nonatomic, strong) WKWebView *webView;
@@ -26,7 +28,9 @@
     self.navigationItem.leftBarButtonItem = leftItem;
     UIBarButtonItem *rightItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"icon_share"] style:UIBarButtonItemStylePlain target:self action:@selector(share)];
     self.navigationItem.rightBarButtonItem = rightItem;
-    self.navigationController.navigationBar.tintColor = [UIColor blackColor];
+    self.navigationController.navigationBar.tintColor = [UIColor whiteColor];
+    self.navigationController.navigationBar.barTintColor = [UIColor whiteColor];
+    self.navigationController.navigationBar.translucent = NO;
 
     WKWebView *webView = [[WKWebView alloc] init];
     [self.view addSubview:webView];
@@ -53,13 +57,30 @@
 }
 
 - (void)backClick {
-    [self.navigationController popViewControllerAnimated:YES];
+    if ([self.webView canGoBack]) {
+        [self.webView goBack];
+    } else {
+        [self.navigationController popViewControllerAnimated:YES];
+    }
 }
 
 - (void)viewWillAppear:(BOOL)animated {
     [super viewWillAppear:animated];
     [self.navigationController setNavigationBarHidden:NO animated:YES];
-    self.navigationController.navigationBar.tintColor = [UIColor blackColor];
+    self.navigationController.navigationBar.tintColor = [UIColor whiteColor];
+    self.navigationController.navigationBar.barTintColor = [UIColor whiteColor];
+    [self.navigationController.navigationBar setBackgroundImage:[UIImage imageWithColor:[UIColor colorWithRed:1.0 green:64 / 255.f blue:149 / 255.f alpha:1.0]] forBarMetrics:UIBarMetricsDefault];
+    [self.navigationController.navigationBar setShadowImage:[UIImage new]];
+    self.navigationController.navigationBar.barStyle = UIBarStyleBlack;
+    self.navigationController.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName: [UIColor whiteColor]};
+}
+
+- (void)viewWillDisappear:(BOOL)animated {
+    [super viewWillDisappear:animated];
+    [self.navigationController.navigationBar setBackgroundImage:nil forBarMetrics:UIBarMetricsDefault];
+    [self.navigationController.navigationBar setShadowImage:nil];
+    self.navigationController.navigationBar.barStyle = UIBarStyleDefault;
+    self.navigationController.navigationBar.titleTextAttributes = nil;
 }
 
 - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context {
@@ -83,6 +104,12 @@
         UploadVideoViewController *vc = [[UploadVideoViewController alloc] init];
         vc.activitypk = activitypk;
         [self.navigationController pushViewController:vc animated:YES];
+    } else if ([@"fansList" isEqualToString:action]) {
+        NSString *modelpk = [message.body[@"modelpk"] stringValue];
+        ModelFansViewController *modelFansVC = [[ModelFansViewController alloc] init];
+        modelFansVC.modelPK = modelpk;
+        modelFansVC.hidesBottomBarWhenPushed = YES;
+        [self.navigationController pushViewController:modelFansVC animated:YES];
     }
 }
 

+ 11 - 0
model/Classes/Tools/Category/UIImage+Common.h

@@ -0,0 +1,11 @@
+//
+// Created by Drew on 2019-01-04.
+// Copyright (c) 2019 Mine. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+@interface UIImage (Common)
++ (UIImage *)imageWithColor:(UIColor *)color;
++ (UIImage *)imageWithColor:(UIColor *)color size:(CGSize)size;
+@end

+ 28 - 0
model/Classes/Tools/Category/UIImage+Common.m

@@ -0,0 +1,28 @@
+//
+// Created by Drew on 2019-01-04.
+// Copyright (c) 2019 Mine. All rights reserved.
+//
+
+#import "UIImage+Common.h"
+
+
+@implementation UIImage (Common)
+
++ (UIImage *)imageWithColor:(UIColor *)color {
+    return [UIImage imageWithColor:color size:CGSizeMake(1, 1)];
+}
+
++ (UIImage *)imageWithColor:(UIColor *)color size:(CGSize)size {
+    if (color == nil) {
+        return nil;
+    }
+    CGRect rect = CGRectMake(0.0f, 0.0f, size.width, size.height);
+    UIGraphicsBeginImageContext(rect.size);
+    CGContextRef context = UIGraphicsGetCurrentContext();
+    CGContextSetFillColorWithColor(context, [color CGColor]);
+    CGContextFillRect(context, rect);
+    UIImage *theImage = UIGraphicsGetImageFromCurrentImageContext();
+    UIGraphicsEndImageContext();
+    return theImage;
+}
+@end

+ 1 - 1
model/Info.plist

@@ -44,7 +44,7 @@
 		</dict>
 	</array>
 	<key>CFBundleVersion</key>
-	<string>1</string>
+	<string>2</string>
 	<key>ITSAppUsesNonExemptEncryption</key>
 	<false/>
 	<key>LSApplicationCategoryType</key>