xiongzhu 7 years ago
parent
commit
5cd51308b9

+ 1 - 14
千模/AppDelegate.m

@@ -71,26 +71,13 @@ NSString *NTESNotificationLogout = @"NTESNotificationLogout";
 #pragma mark - 注销
 
 - (void)logout:(NSNotification *)note {
-    [self doLogout];
-}
-
-- (void)doLogout {
-    //    [[NTESLoginManager sharedManager] setCurrentLoginData:nil];
-    //    [[NTESServiceManager sharedManager] destory];
-    [self setupLoginViewController];
+    // [self setupLoginViewController];
 }
 
 #pragma NIMLoginManagerDelegate
 
 - (void)onAutoLoginFailed:(NSError *)error {
     NSLog(@"AutoLoginFailed");
-    LoginViewController *loginVC = [[LoginViewController alloc] init];
-    [[[NIMSDK sharedSDK] loginManager] logout:^(NSError *error) {
-        [[NSNotificationCenter defaultCenter] postNotificationName:NTESNotificationLogout object:nil];
-        [self.window.rootViewController presentViewController:loginVC
-                                                     animated:YES
-                                                   completion:nil];
-    }];
 }
 
 - (void)onLogin:(NIMLoginStep)step {

+ 2 - 2
千模/Info.plist

@@ -17,7 +17,7 @@
 	<key>CFBundlePackageType</key>
 	<string>APPL</string>
 	<key>CFBundleShortVersionString</key>
-	<string>1.0.6</string>
+	<string>1.0.7</string>
 	<key>CFBundleURLTypes</key>
 	<array>
 		<dict>
@@ -52,7 +52,7 @@
 		</dict>
 	</array>
 	<key>CFBundleVersion</key>
-	<string>2</string>
+	<string>1</string>
 	<key>ITSAppUsesNonExemptEncryption</key>
 	<false/>
 	<key>LSApplicationCategoryType</key>

+ 55 - 53
千模/Main/Activity/ActivityListViewController.m

@@ -13,18 +13,18 @@
 #import "Masonry.h"
 #import "SDCycleScrollView.h"
 #import "WebViewController.h"
-@interface ActivityListViewController ()<UINavigationControllerDelegate,UITableViewDelegate,UITableViewDataSource, SDCycleScrollViewDelegate>
-{
+
+@interface ActivityListViewController () <UINavigationControllerDelegate, UITableViewDelegate, UITableViewDataSource, SDCycleScrollViewDelegate> {
     NSInteger index;
 }
 
-@property(nonatomic,weak)UINavigationController*navController;
-@property(nonatomic,strong)NSMutableArray *collectionSource;
-@property (weak, nonatomic) IBOutlet NSLayoutConstraint *bottom;
-@property (strong, nonatomic) UITableView *tableView;
-@property (strong, nonatomic) UIView *headerView;
-@property (nonatomic, strong) SDCycleScrollView *cycleScrollView;
-@property (nonatomic, strong) NSMutableArray* urlArr;
+@property(nonatomic, weak) UINavigationController *navController;
+@property(nonatomic, strong) NSMutableArray *collectionSource;
+@property(weak, nonatomic) IBOutlet NSLayoutConstraint *bottom;
+@property(strong, nonatomic) UITableView *tableView;
+@property(strong, nonatomic) UIView *headerView;
+@property(nonatomic, strong) SDCycleScrollView *cycleScrollView;
+@property(nonatomic, strong) NSMutableArray *topActivities;
 @end
 
 @implementation ActivityListViewController
@@ -38,17 +38,17 @@
 
 - (void)viewDidLoad {
     [super viewDidLoad];
-    
+
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(hideNavigationBar) name:@"hideNavigationBar" object:nil];
-    
+
     index = 1;
     self.extendedLayoutIncludesOpaqueBars = YES;
-    self.tableView = [[UITableView alloc]initWithFrame:CGRectZero style:UITableViewStylePlain];
-    
+    self.tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
+
     if ([UIScreen spt_currentScreenMode] == LESScreenModeIPhoneX) {
-        self.tableView.frame = CGRectMake(0, 0, ScreenWidth, ScreenHeight-88-83);
+        self.tableView.frame = CGRectMake(0, 0, ScreenWidth, ScreenHeight - 88 - 83);
     } else {
-        self.tableView.frame = CGRectMake(0, 0, ScreenWidth, ScreenHeight-64-49);
+        self.tableView.frame = CGRectMake(0, 0, ScreenWidth, ScreenHeight - 64 - 49);
     }
     self.tableView.backgroundColor = [UIColor colorWithHexString:@"#F2F4F5"];
     self.tableView.tableHeaderView = self.headerView;
@@ -62,42 +62,42 @@
     [self getList];
 }
 
--(void)hideNavigationBar{
+- (void)hideNavigationBar {
     self.navigationController.navigationBar.hidden = YES;
 }
 
-- (void)viewWillAppear:(BOOL)animated{
+- (void)viewWillAppear:(BOOL)animated {
     self.tabBarController.tabBar.hidden = YES;
 }
 
--(void)refreshList{
+- (void)refreshList {
     index = 1;
     [self.collectionSource removeAllObjects];
     [self getList];
 }
 
-- (void)loadMoreData{
+- (void)loadMoreData {
     index++;
     [self getList];
 }
 
-- (void)getList{
+- (void)getList {
     [MBProgressHUD showHUDAddedTo:self.view animated:YES];
-    NSString *indexStr = [NSString stringWithFormat:@"%zd",index];
-    NSString *str = [NSString stringWithFormat:@"%@activity?action=dogetpartty&memberpk=%@&index=%@&size=%@",webURL,[Helper sharedAccount].accid,indexStr,@"10"];
-    [[AHHttpManager sharedManager]POST:str parameters:nil success:^(id responseObject) {
-        NSLog(@"%@",responseObject);
+    NSString *indexStr = [NSString stringWithFormat:@"%zd", index];
+    NSString *str = [NSString stringWithFormat:@"%@activity?action=dogetpartty&memberpk=%@&index=%@&size=%@", webURL, [Helper sharedAccount].accid, indexStr, @"10"];
+    [[AHHttpManager sharedManager] POST:str parameters:nil success:^(id responseObject) {
+        NSLog(@"%@", responseObject);
         [MBProgressHUD hideHUDForView:self.view animated:YES];
-        
-        if ([[responseObject objectForKey:@"msg"]isEqualToString:@"success"]) {
+
+        if ([[responseObject objectForKey:@"msg"] isEqualToString:@"success"]) {
             NSArray *data = responseObject[@"data"];
-            NSArray * array = [ActivityModel arrayOfModelsFromDictionaries:data];
-            
+            NSArray *array = [ActivityModel arrayOfModelsFromDictionaries:data];
+
             [self.collectionSource addObjectsFromArray:array];
-            
+
             NSString *number = responseObject[@"count"];
             NSInteger num = [number integerValue];
-            
+
             [self.tableView.mj_header endRefreshing];
             if (num == self.collectionSource.count || num == 0) {
                 [self.tableView.mj_footer endRefreshingWithNoMoreData];
@@ -105,35 +105,35 @@
                 [self.tableView.mj_footer endRefreshing];
             }
             [self.tableView reloadData];
-        }else{
+        } else {
             [MBProgressHUD showTextHUD:@"超时" inView:self.view hideAfterDelay:1];
         }
-    } failure:^(NSError *error) {
-        NSLog(@"error = %@",error);
+    }                           failure:^(NSError *error) {
+        NSLog(@"error = %@", error);
         [MBProgressHUD hideHUDForView:self.view animated:YES];
     }];
-    
-    [[AHHttpManager sharedManager]POST:[NSString stringWithFormat:@"%@activity?action=dogettoppartty", webURL] parameters:nil success:^(id responseObject) {
-        if ([[responseObject objectForKey:@"msg"]isEqualToString:@"success"]) {
+
+    [[AHHttpManager sharedManager] POST:[NSString stringWithFormat:@"%@activity?action=dogettoppartty", webURL] parameters:nil success:^(id responseObject) {
+        if ([[responseObject objectForKey:@"msg"] isEqualToString:@"success"]) {
             NSArray *data = responseObject[@"data"];
-            NSMutableArray *urlArr = [NSMutableArray arrayWithCapacity:0];
+            NSMutableArray *topActivities = [NSMutableArray arrayWithCapacity:0];
             NSMutableArray *picArr = [NSMutableArray arrayWithCapacity:0];
             for (NSDictionary *dic in data) {
-                [urlArr addObject:dic[@"url"]];
+                [topActivities addObject:dic];
                 [picArr addObject:[NSString stringWithFormat:@"%@%@", imageURl, dic[@"Pic"]]];
-                self.urlArr = urlArr;
+                self.topActivities = topActivities;
                 [self.cycleScrollView setImageURLStringsGroup:picArr];
             }
         }
-    } failure:^(NSError *error) {
-        NSLog(@"error = %@",error);
+    }                           failure:^(NSError *error) {
+        NSLog(@"error = %@", error);
     }];
 }
 
 - (UIView *)headerView {
     if (!_headerView) {
         _headerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, 250)];
-        
+
         SDCycleScrollView *cycleScrollView = [SDCycleScrollView cycleScrollViewWithFrame:CGRectMake(0, 0, ScreenWidth, 210) imageURLStringsGroup:@[]];
         cycleScrollView.bannerImageViewContentMode = UIViewContentModeScaleAspectFill;
         cycleScrollView.showPageControl = NO;
@@ -141,7 +141,7 @@
         [_headerView addSubview:cycleScrollView];
         cycleScrollView.delegate = self;
         self.cycleScrollView = cycleScrollView;
-        
+
         UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 192, ScreenWidth, 57)];
         view.backgroundColor = [UIColor colorWithHexString:@"#F2F4F5"];
         UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:view.bounds
@@ -152,7 +152,7 @@
         maskLayer.path = maskPath.CGPath;
         view.layer.mask = maskLayer;
         [_headerView addSubview:view];
-        
+
         UILabel *label = [[UILabel alloc] init];
         label.font = [UIFont systemFontOfSize:22 weight:UIFontWeightMedium];
         label.textColor = [UIColor blackColor];
@@ -167,36 +167,38 @@
 }
 
 #pragma mark - deleDate
--(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
+
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
     return self.collectionSource.count;
 }
 
--(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
-    
-    ActivityCell * cell = [tableView dequeueReusableCellWithIdentifier:@"ActivityCell"];
+- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
+
+    ActivityCell *cell = [tableView dequeueReusableCellWithIdentifier:@"ActivityCell"];
     if (!cell) {
         cell.selectionStyle = UITableViewCellSelectionStyleNone;
-        cell = [[[UINib nibWithNibName:@"ActivityCell" bundle:nil]instantiateWithOwner:self options:nil]lastObject];
+        cell = [[[UINib nibWithNibName:@"ActivityCell" bundle:nil] instantiateWithOwner:self options:nil] lastObject];
         cell.model = [self.collectionSource objectAtIndex:indexPath.row];
     }
     return cell;
 }
 
--(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
+- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
     return 1;
 }
 
--(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
+- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
     return 266;
 }
 
 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
-    self.Pushblock([self.collectionSource objectAtIndex:indexPath.row]);
+    self.Pushblock(self.collectionSource[indexPath.row]);
 }
 
 - (void)cycleScrollView:(SDCycleScrollView *)cycleScrollView didSelectItemAtIndex:(NSInteger)index {
     WebViewController *webVC = [[WebViewController alloc] init];
-    webVC.url = self.urlArr[index];
+    webVC.url = self.topActivities[index][@"url"];
+    webVC.activityPK = self.topActivities[index][@"PK"];
     webVC.hidesBottomBarWhenPushed = YES;
     [self.findViewController pushViewController:webVC animated:YES];
 }

+ 1 - 0
千模/Main/ModelDetail/ModelDetailController.h

@@ -15,6 +15,7 @@ NS_ASSUME_NONNULL_BEGIN
 @property(nonatomic, assign) BOOL isAgentIn;
 @property(nonatomic, copy) NSString *modelPk;
 @property(nonatomic, strong) NSMutableArray *pushImage;
+@property(nonatomic, assign) BOOL sendVideo;
 @end
 
 NS_ASSUME_NONNULL_END

+ 65 - 25
千模/Main/ModelDetail/ModelDetailController.m

@@ -19,6 +19,8 @@
 #import "SharePopViewController.h"
 #import <WXApi.h>
 #import "ModelFansViewController.h"
+#import "SendGiftViewController.h"
+#import "WebViewController.h"
 
 @interface ModelDetailController () <NTESVideoChatBackDelegate, ShareDelegate, UIScrollViewDelegate>
 @property(weak, nonatomic) IBOutlet UIView *headView;
@@ -42,8 +44,8 @@
 @property(weak, nonatomic) IBOutlet DetailSectionView *profileSection;
 @property(weak, nonatomic) IBOutlet DetailSectionView *honorSection;
 @property(weak, nonatomic) IBOutlet UIScrollView *scrollView;
-@property (weak, nonatomic) IBOutlet UIView *activityBg;
-@property (weak, nonatomic) IBOutlet UILabel *activityLabel;
+@property(weak, nonatomic) IBOutlet UIView *activityBg;
+@property(weak, nonatomic) IBOutlet UILabel *activityLabel;
 
 @property(nonatomic, strong) SDCycleScrollView *cycleScrollView;
 
@@ -51,10 +53,11 @@
 @property(strong, nonatomic) NSString *vPrice;//视频价格
 @property(strong, nonatomic) NSString *videoDuration;//通话时长
 @property(strong, nonatomic) NSString *videoPk;//视频pk
-@property (weak, nonatomic) IBOutlet UIImageView *fans1;
-@property (weak, nonatomic) IBOutlet UIImageView *fans2;
-@property (weak, nonatomic) IBOutlet UIImageView *fans3;
-@property (nonatomic, strong) NSArray *fansArr;
+@property(weak, nonatomic) IBOutlet UIImageView *fans1;
+@property(weak, nonatomic) IBOutlet UIImageView *fans2;
+@property(weak, nonatomic) IBOutlet UIImageView *fans3;
+@property(nonatomic, strong) NSArray *fansArr;
+@property(nonatomic, strong) NSDictionary *topActivity;
 @end
 
 @implementation ModelDetailController
@@ -86,7 +89,7 @@
         iv.layer.borderColor = [UIColor whiteColor].CGColor;
         iv.clipsToBounds = YES;
     }
-                     
+
     // 网络加载图片的轮播器
     NSMutableArray *imageArr = [NSMutableArray arrayWithCapacity:0];
     for (NSDictionary *photo in self.model.modelphoto) {
@@ -102,6 +105,9 @@
 
     [self initView];
     [self getInformation];
+    
+    UITapGestureRecognizer* tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(activity:)];
+    [self.activityLabel addGestureRecognizer:tap];
 }
 
 - (UIImage *)imageWithCornerRadius:(CGFloat)radius size:(CGSize)size color:(UIColor *)color {
@@ -127,6 +133,14 @@
     self.navigationController.navigationBar.tintColor = [UIColor whiteColor];
 }
 
+- (void)viewDidAppear:(BOOL)animated{
+    [super viewDidAppear:YES];
+    if (self.sendVideo) {
+        self.sendVideo = NO;
+        [self videoChat:nil];
+    }
+}
+
 - (void)viewWillDisappear:(BOOL)animated {
     [super viewWillDisappear:animated];
     self.navigationController.navigationBar.barStyle = UIBarStyleDefault;
@@ -141,15 +155,16 @@
     maskLayer.frame = self.topView.bounds;
     maskLayer.path = maskPath.CGPath;
     self.topView.layer.mask = maskLayer;
-    
+
     // gradient
     CAGradientLayer *gl = [CAGradientLayer layer];
     gl.frame = self.activityBg.bounds;
     gl.startPoint = CGPointMake(0, 0.5);
     gl.endPoint = CGPointMake(1, 0.5);
-    gl.colors = @[(__bridge id)[UIColor colorWithRed:255/255.0 green:119/255.0 blue:122/255.0 alpha:1.0].CGColor, (__bridge id)[UIColor colorWithRed:255/255.0 green:34/255.0 blue:178/255.0 alpha:1.0].CGColor];
+    gl.colors = @[(__bridge id) [UIColor colorWithRed:255 / 255.0 green:119 / 255.0 blue:122 / 255.0 alpha:1.0].CGColor, (__bridge id) [UIColor colorWithRed:255 / 255.0 green:34 / 255.0 blue:178 / 255.0 alpha:1.0].CGColor];
     gl.locations = @[@(0), @(1.0f)];
     gl.cornerRadius = 19;
+    self.activityBg.clipsToBounds = YES;
     [self.activityBg.layer insertSublayer:gl atIndex:0];
 }
 
@@ -374,11 +389,34 @@
 }
 
 - (IBAction)fansList:(id)sender {
-    ModelFansViewController *vc =[[ModelFansViewController alloc] init];
-    vc.modelPK = _modelPk?_modelPk:self.model.modelpk;
+    ModelFansViewController *vc = [[ModelFansViewController alloc] init];
+    vc.modelPK = _modelPk ? _modelPk : self.model.modelpk;
     [self.navigationController pushViewController:vc animated:YES];
 }
 
+- (IBAction)sendGift:(id)sender {
+    AppDelegate *delegate = (AppDelegate *) [UIApplication sharedApplication].delegate;
+    if (![delegate isLogin]) {
+        [delegate showLoginAlert];
+        return;
+    }
+    NSString *modelpk = _model.modelpk;
+    NSString *activitypk = @"";
+    [SendGiftViewController presentInController:self modelPK:modelpk activityPK:activitypk];
+}
+
+- (IBAction)activity:(id)sender {
+
+    if (self.topActivity) {
+        WebViewController *vc = [[WebViewController alloc] init];
+        vc.url = self.topActivity[@"url"];
+        vc.activityPK = self.topActivity[@"PK"];
+        vc.modelPK = self.model.modelpk;
+        vc.hidesBottomBarWhenPushed = YES;
+        [self.navigationController pushViewController:vc animated:YES];
+    }
+}
+
 - (void)moreOptions {
     UIAlertController *alert = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet];
     [alert addAction:[UIAlertAction actionWithTitle:@"屏蔽" style:UIAlertActionStyleDefault handler:^(UIAlertAction *_Nonnull action) {
@@ -432,14 +470,15 @@
                                             [honors addObject:@[name, @""]];
                                         }
                                         self.honorSection.data = honors;
-                                        
+
                                         NSArray *fans = responseObject[@"fans"];
-                                        for (int i=0;i<fans.count;i++){
+                                        for (int i = 0; i < fans.count; i++) {
                                             UIImageView *iv = self.fansArr[i];
                                             iv.hidden = NO;
                                             NSString *url = [NSString stringWithFormat:@"%@%@", imageURl, fans[i][@"hPhoto"]];
                                             [iv sd_setImageWithURL:[NSURL URLWithString:url] placeholderImage:[UIImage imageNamed:@"default_avatar"]];
                                         }
+                                        
                                     } else {
                                         [MBProgressHUD showTextHUD:@"超时" inView:self.view hideAfterDelay:1];
                                     }
@@ -449,20 +488,21 @@
                                     [MBProgressHUD showTextHUD:@"超时" inView:self.view hideAfterDelay:1];
                                 }];
     [[AHHttpManager sharedManager]
-     POST:[NSString stringWithFormat:@"%@activity?action=dogetmodeltoppartty&modelpk=%@", webURL, _modelPk ? _modelPk : _model.modelpk]
-     parameters:nil
-     success:^(id responseObject) {
-         if ([[responseObject objectForKey:@"msg"] isEqualToString:@"success"]) {
-             NSArray *data = responseObject[@"data"];
-             if (data.count > 0){
-                 self.activityLabel.text = data[0][@"Intro"];
-                 self.activityBg.hidden = NO;
+            POST:[NSString stringWithFormat:@"%@activity?action=dogetmodeltoppartty&modelpk=%@", webURL, _modelPk ? _modelPk : _model.modelpk]
+      parameters:nil
+         success:^(id responseObject) {
+             if ([[responseObject objectForKey:@"msg"] isEqualToString:@"success"]) {
+                 NSArray *data = responseObject[@"data"];
+                 if (data.count > 0) {
+                     self.activityLabel.text = data[0][@"Intro"];
+                     self.activityBg.hidden = NO;
+                     self.topActivity = data[0];
+                 }
              }
          }
-     }
-     failure:^(NSError *error) {
-         
-     }];
+         failure:^(NSError *error) {
+
+         }];
 }
 
 - (void)searchModel:(NSString *)pk {

+ 19 - 6
千模/Main/ModelDetail/ModelDetailController.xib

@@ -59,10 +59,10 @@
                                         <constraint firstAttribute="width" constant="42" id="wv6-dv-2Oa"/>
                                     </constraints>
                                 </imageView>
-                                <view hidden="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Y67-Kw-ji6">
+                                <view hidden="YES" clipsSubviews="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Y67-Kw-ji6">
                                     <rect key="frame" x="20" y="368" width="382" height="54"/>
                                     <subviews>
-                                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="我正在参加“谁是舞王”大赛,快来给我加油" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="XKC-aJ-wXN">
+                                        <label opaque="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="我正在参加“谁是舞王”大赛,快来给我加油" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="XKC-aJ-wXN">
                                             <rect key="frame" x="15" y="0.0" width="352" height="34"/>
                                             <constraints>
                                                 <constraint firstAttribute="height" constant="34" id="5LO-ha-pno"/>
@@ -78,6 +78,11 @@
                                         <constraint firstAttribute="trailing" secondItem="XKC-aJ-wXN" secondAttribute="trailing" constant="15" id="fjX-Sp-mWA"/>
                                         <constraint firstItem="XKC-aJ-wXN" firstAttribute="top" secondItem="Y67-Kw-ji6" secondAttribute="top" id="z2u-ym-j3G"/>
                                     </constraints>
+                                    <userDefinedRuntimeAttributes>
+                                        <userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
+                                            <integer key="value" value="19"/>
+                                        </userDefinedRuntimeAttribute>
+                                    </userDefinedRuntimeAttributes>
                                 </view>
                             </subviews>
                             <color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
@@ -89,6 +94,9 @@
                                 <constraint firstAttribute="trailing" secondItem="eg7-cs-yH2" secondAttribute="trailing" constant="20" id="wGY-Pz-uHL"/>
                                 <constraint firstAttribute="width" secondItem="mWD-li-pqF" secondAttribute="height" multiplier="1:1" id="zoW-An-oBg"/>
                             </constraints>
+                            <connections>
+                                <outletCollection property="gestureRecognizers" destination="bl3-vH-YSG" appends="YES" id="4IC-U2-vGA"/>
+                            </connections>
                         </view>
                         <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="f72-GL-ho2">
                             <rect key="frame" x="0.0" y="402" width="422" height="294"/>
@@ -463,7 +471,7 @@
                             <rect key="frame" x="0.0" y="817" width="422" height="50"/>
                             <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                             <constraints>
-                                <constraint firstAttribute="height" relation="greaterThanOrEqual" constant="50" id="Yiq-Mg-mSf"/>
+                                <constraint firstAttribute="height" priority="250" constant="50" id="Yiq-Mg-mSf"/>
                             </constraints>
                             <userDefinedRuntimeAttributes>
                                 <userDefinedRuntimeAttribute type="string" keyPath="title" value="技能"/>
@@ -473,7 +481,7 @@
                             <rect key="frame" x="0.0" y="877" width="422" height="50"/>
                             <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                             <constraints>
-                                <constraint firstAttribute="height" relation="greaterThanOrEqual" constant="50" id="sUR-oI-yHI"/>
+                                <constraint firstAttribute="height" priority="250" constant="50" id="sUR-oI-yHI"/>
                             </constraints>
                             <userDefinedRuntimeAttributes>
                                 <userDefinedRuntimeAttribute type="string" keyPath="title" value="个人资料"/>
@@ -484,7 +492,7 @@
                             <rect key="frame" x="0.0" y="937" width="422" height="50"/>
                             <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                             <constraints>
-                                <constraint firstAttribute="height" relation="greaterThanOrEqual" constant="50" id="5Z3-9p-S05"/>
+                                <constraint firstAttribute="height" priority="250" constant="50" id="5Z3-9p-S05"/>
                             </constraints>
                             <userDefinedRuntimeAttributes>
                                 <userDefinedRuntimeAttribute type="string" keyPath="title" value="我的荣誉"/>
@@ -555,7 +563,7 @@
                                 </userDefinedRuntimeAttribute>
                             </userDefinedRuntimeAttributes>
                             <connections>
-                                <action selector="sendMsg:" destination="-1" eventType="touchUpInside" id="tsa-Kj-sP2"/>
+                                <action selector="sendGift:" destination="-1" eventType="touchUpInside" id="cXR-0D-Fns"/>
                             </connections>
                         </button>
                         <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="wGY-mw-LY6">
@@ -616,6 +624,11 @@
                 <action selector="fansList:" destination="-1" id="x0O-LX-2aD"/>
             </connections>
         </tapGestureRecognizer>
+        <tapGestureRecognizer id="bl3-vH-YSG">
+            <connections>
+                <action selector="activity:" destination="-1" id="9vA-4O-OuN"/>
+            </connections>
+        </tapGestureRecognizer>
     </objects>
     <resources>
         <image name="icon_inter" width="20" height="20"/>

+ 0 - 1
千模/Main/ModelDetail/SendGiftViewController.m

@@ -117,7 +117,6 @@
             [alert addAction:@"确认" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
                 [self dismissViewControllerAnimated:YES completion:^{
                     [MBProgressHUD showHUDAddedTo:[UIApplication sharedApplication].keyWindow animated:YES];
-                    [MBProgressHUD showMessage:<#(NSString *)message#>];
                     NSString *str = [NSString stringWithFormat:@"%@pay?action=sendgift&memberpk=%@&modelpk=%@&activitypk=%@&coin=%@&giftname=%@", webURL, [Helper sharedAccount].accid, self.modelpk, self.activitypk, price, name];
                     [[AHHttpManager sharedManager] POST:[str stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]
                                              parameters:nil

+ 2 - 0
千模/Main/WebViewController.h

@@ -12,6 +12,8 @@ NS_ASSUME_NONNULL_BEGIN
 
 @interface WebViewController : UIViewController
 @property(nonatomic, strong) NSString *url;
+@property(nonatomic, strong) NSString *activityPK;
+@property(nonatomic, strong) NSString *modelPK;
 @end
 
 NS_ASSUME_NONNULL_END

+ 59 - 2
千模/Main/WebViewController.m

@@ -13,6 +13,8 @@
 #import "SharePopViewController.h"
 #import "WeakScriptMessageDelegate.h"
 #import "SendGiftViewController.h"
+#import "ModelDetailController.h"
+#import "ModelFansViewController.h"
 
 @interface WebViewController () <ShareDelegate, WKUIDelegate, WKScriptMessageHandler>
 @property(nonatomic, strong) WKWebView *webView;
@@ -40,6 +42,14 @@
     [[webView configuration].userContentController addScriptMessageHandler:[[WeakScriptMessageDelegate alloc] initWithDelegate:self] name:@"chmo"];
 
     [webView addObserver:self forKeyPath:@"title" options:NSKeyValueObservingOptionNew context:NULL];
+    if ([self.url containsString:@"?"]) {
+        [NSString stringWithFormat:@"%@&memberpk=%@&activitypk=%@", self.url, [Helper sharedAccount].accid, self.activityPK];
+    } else {
+        self.url = [NSString stringWithFormat:@"%@?memberpk=%@&activitypk=%@", self.url, [Helper sharedAccount].accid, self.activityPK];
+    }
+    if (self.modelPK) {
+        self.url = [self.url stringByAppendingFormat:@"&modelpk=%@", self.modelPK];
+    }
     [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:self.url]]];
     self.webView = webView;
 }
@@ -51,6 +61,7 @@
 - (void)viewWillAppear:(BOOL)animated {
     [super viewWillAppear:animated];
     [self.navigationController setNavigationBarHidden:NO animated:YES];
+    self.navigationController.navigationBar.tintColor = [UIColor blackColor];
 }
 
 - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context {
@@ -70,9 +81,55 @@
     NSLog(@"name = %@, body = %@", message.name, message.body);
     NSString *action = message.body[@"action"];
     if ([@"sendGift" isEqualToString:action]) {
+        AppDelegate *delegate = (AppDelegate *) [UIApplication sharedApplication].delegate;
+        if (![delegate isLogin]) {
+            [delegate showLoginAlert];
+            return;
+        }
         NSString *modelpk = message.body[@"modelpk"];
         NSString *activitypk = message.body[@"activitypk"];
         [SendGiftViewController presentInController:self modelPK:modelpk activityPK:activitypk];
+    } else if ([@"detail" isEqualToString:action] || [@"video" isEqualToString:action]) {
+        NSString *modelpk = message.body[@"modelpk"];
+        NSString *str = [NSString stringWithFormat:@"%@modelInfo?action=doModelInfoByPk&ModelPK=%@&memberpk=%@", webURL, modelpk, [Helper sharedAccount].accid];
+        NSMutableArray *modelArray = [NSMutableArray new];
+        [[AHHttpManager sharedManager] POST:str
+                                 parameters:nil
+                                    success:^(id responseObject) {
+                                        NSLog(@"%@", responseObject);
+                                        if ([[responseObject objectForKey:@"msg"] isEqualToString:@"success"]) {
+                                            NSArray *data = responseObject[@"data"];
+                                            NSArray *array = [ActorModel arrayOfModelsFromDictionaries:data];
+                                            if (array.count == 0)
+                                                return;
+                                            [modelArray addObjectsFromArray:array];
+                                            NSMutableArray *images = [NSMutableArray new];
+                                            ActorModel *model = modelArray[0];
+                                            for (int i = 0; i < model.modelphoto.count; i++) {
+                                                NSString *urlString = [NSString stringWithFormat:@"%@%@", imageURl, [model.modelphoto[i] objectForKey:@"photo"]];
+                                                [images addObject:urlString];
+                                            }
+                                            ModelDetailController *detailVC = [[ModelDetailController alloc] init];
+                                            detailVC.model = model;
+                                            detailVC.modelPk = modelpk;
+                                            detailVC.pushImage = images;
+                                            detailVC.hidesBottomBarWhenPushed = YES;
+                                            detailVC.sendVideo = [@"video" isEqualToString:action];                                                                                                                              
+                                            [self.navigationController pushViewController:detailVC animated:YES];
+                                        } else {
+                                            [MBProgressHUD showTextHUD:@"超时" inView:self.view hideAfterDelay:1];
+                                        }
+                                    }
+                                    failure:^(NSError *error) {
+                                        NSLog(@"error = %@", error);
+                                        [MBProgressHUD showTextHUD:@"超时" inView:self.view hideAfterDelay:1];
+                                    }];
+    } else if ([@"fansList" isEqualToString:action]){
+        NSString *modelpk = message.body[@"modelpk"];
+        ModelFansViewController *modelFansVC = [[ModelFansViewController alloc] init];
+        modelFansVC.modelPK = modelpk;
+        modelFansVC.hidesBottomBarWhenPushed = YES;
+        [self.navigationController pushViewController:modelFansVC animated:YES];
     }
 }
 
@@ -83,11 +140,11 @@
 }
 
 - (void)shareWxSession {
-
+    [self shareToWechat:WXSceneSession withTitle:@"千模通告" description:self.title url:self.url];
 }
 
 - (void)shareWxTimeline {
-
+    [self shareToWechat:WXSceneTimeline withTitle:self.title description:self.title url:self.url];
 }
 
 - (void)shareToWechat:(enum WXScene)scene withTitle:(NSString *)title description:(NSString *)description url:(NSString *)url {

+ 6 - 6
千模/SettingHeader.h

@@ -128,9 +128,9 @@ alpha:alphaValue]
 #define ScreenWidth [UIScreen mainScreen].bounds.size.width
 #define ScreenHeight [UIScreen mainScreen].bounds.size.height
 
-// #define imageURl @"http://app.chmo.net/thmodel/"
-// #define webURL @"http://app.chmo.net/thmodel/"
-// #define apnsCernameStr @"member"
+#define imageURl @"http://app.chmo.net/thmodel/"
+#define webURL @"http://app.chmo.net/thmodel/"
+#define apnsCernameStr @"member"
 
 //#define imageURl @"http://118.190.49.85/thmodeltest/"
 //#define webURL @"http://118.190.49.85/thmodeltest/"
@@ -140,9 +140,9 @@ alpha:alphaValue]
 // #define webURL @"http://118.190.49.85:8080/thmodel/"
 // #define apnsCernameStr @"memberDev"
 
- #define imageURl @"http://192.168.50.132:8081/thmodel/"
- #define webURL @"http://192.168.50.132:8081/thmodel/"
- #define apnsCernameStr @"member"
+ // #define imageURl @"http://192.168.50.132:8081/thmodel/"
+ // #define webURL @"http://192.168.50.132:8081/thmodel/"
+ // #define apnsCernameStr @"member"
 
 // #define imageURl @"http://192.168.123.90:8080/"
 // #define webURL @"http://192.168.123.90:8080/"