Drew 7 年 前
コミット
fa72d875f2

BIN
.DS_Store


+ 10 - 0
model.xcodeproj/project.pbxproj

@@ -359,6 +359,8 @@
 		3A44C12D218A0E7A0021DA3F /* MyMemberController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3A44C127218A0E790021DA3F /* MyMemberController.xib */; };
 		3A44C130218A10770021DA3F /* TabControl.m in Sources */ = {isa = PBXBuildFile; fileRef = 3A44C12F218A10770021DA3F /* TabControl.m */; };
 		3A44C132218A10800021DA3F /* TabControl.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3A44C131218A10800021DA3F /* TabControl.xib */; };
+		3A54C9FD218D960400EA297E /* ShareCardController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3A54C9FB218D960400EA297E /* ShareCardController.m */; };
+		3A54C9FE218D960400EA297E /* ShareCardController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3A54C9FC218D960400EA297E /* ShareCardController.xib */; };
 		3A5EC7472186AF5A00A9438E /* ShadowMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3A5EC7452186AF5900A9438E /* ShadowMenu.xib */; };
 		3A5EC7482186AF5A00A9438E /* ShadowMenu.m in Sources */ = {isa = PBXBuildFile; fileRef = 3A5EC7462186AF5A00A9438E /* ShadowMenu.m */; };
 		3A5EC74D2186F56C00A9438E /* MyTeamController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3A5EC74B2186F56C00A9438E /* MyTeamController.m */; };
@@ -1135,6 +1137,9 @@
 		3A44C12E218A10760021DA3F /* TabControl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TabControl.h; sourceTree = "<group>"; };
 		3A44C12F218A10770021DA3F /* TabControl.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TabControl.m; sourceTree = "<group>"; };
 		3A44C131218A10800021DA3F /* TabControl.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = TabControl.xib; sourceTree = "<group>"; };
+		3A54C9FA218D960400EA297E /* ShareCardController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ShareCardController.h; sourceTree = "<group>"; };
+		3A54C9FB218D960400EA297E /* ShareCardController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ShareCardController.m; sourceTree = "<group>"; };
+		3A54C9FC218D960400EA297E /* ShareCardController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ShareCardController.xib; sourceTree = "<group>"; };
 		3A5EC7442186AF5900A9438E /* ShadowMenu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShadowMenu.h; sourceTree = "<group>"; };
 		3A5EC7452186AF5900A9438E /* ShadowMenu.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ShadowMenu.xib; sourceTree = "<group>"; };
 		3A5EC7462186AF5A00A9438E /* ShadowMenu.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ShadowMenu.m; sourceTree = "<group>"; };
@@ -2544,6 +2549,9 @@
 				3AF44FFA2185AB9F00ABEAEB /* ChooseShareController.h */,
 				3AF44FFB2185AB9F00ABEAEB /* ChooseShareController.m */,
 				3AF44FFC2185AB9F00ABEAEB /* ChooseShareController.xib */,
+				3A54C9FA218D960400EA297E /* ShareCardController.h */,
+				3A54C9FB218D960400EA297E /* ShareCardController.m */,
+				3A54C9FC218D960400EA297E /* ShareCardController.xib */,
 			);
 			path = ShareVC;
 			sourceTree = "<group>";
@@ -2990,6 +2998,7 @@
 				2F4A8946211ADB00006D7DD3 /* DetailTwoImageCell.xib in Resources */,
 				2F8D24B721131B3900CD7347 /* ImageViewController.xib in Resources */,
 				3A5EC7562186F66500A9438E /* MyTeamCell.xib in Resources */,
+				3A54C9FE218D960400EA297E /* ShareCardController.xib in Resources */,
 				2F4A8950211ADB00006D7DD3 /* DetailOnlyTextCell.xib in Resources */,
 				2F4A896F211D9F04006D7DD3 /* ActivityDetailViewController.xib in Resources */,
 				8848C66B210813D300EDB121 /* PhotoCollectionViewCell.xib in Resources */,
@@ -3304,6 +3313,7 @@
 				2F8D270021183D7400CD7347 /* NIMAdvancedTeamCardViewController.m in Sources */,
 				2F8D256621146D1A00CD7347 /* PGPickerTableView.m in Sources */,
 				2F8D25432114691C00CD7347 /* PGDatePicker+Common.m in Sources */,
+				3A54C9FD218D960400EA297E /* ShareCardController.m in Sources */,
 				2F8D278B21183D9000CD7347 /* yuv420sp.fsh.c in Sources */,
 				3AE8C7B4218B65860069D147 /* RankController.m in Sources */,
 				2F8D278721183D9000CD7347 /* shader.c in Sources */,

+ 19 - 1
model/Classes/Controllers/Controller/MineVC/MineNewViewController.m

@@ -200,7 +200,25 @@
             break;
         }
         case 3: {
-            
+            UIAlertController *alert = [UIAlertController alertControllerWithTitle:nil message:@"确定申请首页推荐展示?" preferredStyle:UIAlertControllerStyleAlert];
+            [alert addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:nil]];
+            [alert addAction:[UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+                NSDictionary *dic = [[NSDictionary alloc] initWithObjectsAndKeys:[ModelUser modelUser].modelpk,@"modelpk", nil];
+                [YanCNetWorkManager requestPostWithURLStr:Url_applyRecommend(PublicUrl)
+                                               parameters:dic
+                                                   finish:^(id res) {
+                                                       BOOL success = [res[@"success"] intValue] == 1;
+                                                       if (success) {
+                                                           [MBProgressHUD showInfo:@"申请已提交"];
+                                                       } else {
+                                                           [MBProgressHUD showInfo:@"请求失败!"];
+                                                       }
+                                                   }
+                                                  enError:^(NSError *error) {
+                                                      [MBProgressHUD hideHUDForView:self.view animated:YES];
+                                                  }];
+            }]];
+            [self presentViewController:alert animated:YES completion:nil];
         }
         case 4: {
             PromoteController* vc = [[PromoteController alloc] init];

+ 2 - 2
model/Classes/Controllers/Controller/MyProfileVC/InfoEditViewController.m

@@ -86,12 +86,12 @@
             break;
         case InfoEditTypeOccupation:
             self.title = @"职业";
-            self.infoTextField.text = [ModelUser modelUser].constellation;
+            self.infoTextField.text = [ModelUser modelUser].occupation;
             self.infoTextField.placeholder = @"请填写职业";
             break;
         case InfoEditTypeConstellation:
             self.title = @"星座";
-            self.infoTextField.text = [ModelUser modelUser].occupation;
+            self.infoTextField.text = [ModelUser modelUser].constellation;
             self.infoTextField.placeholder = @"请填写星座";
             break;
         default:

+ 1 - 1
model/Classes/Controllers/Controller/MyProfileVC/ModelCardController.h

@@ -9,5 +9,5 @@
 #import "ModelBaseViewController.h"
 
 @interface ModelCardController : ModelBaseViewController
-
+@property(nonatomic, strong) NSString* type;
 @end

+ 34 - 11
model/Classes/Controllers/Controller/MyProfileVC/ModelCardController.m

@@ -13,6 +13,9 @@
 #import "ModelHonorViewController.h"
 #import "InfoEditViewController.h"
 #import <BRPickerView.h>
+#import "MySkillsController.h"
+#import "ShareCardController.h"
+
 @interface ModelCardController ()<UITableViewDelegate, UITableViewDataSource, UITextFieldDelegate> {
     ModelUser *tempUser;
 }
@@ -56,13 +59,15 @@
     UIBarButtonItem *nagetiveSpacer = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil];
     self.navigationItem.leftBarButtonItems = @[nagetiveSpacer, leftItem];
     
-    self.titlesArr = @[@[@"姓名"],
+    self.titlesArr = @[@[@"照片"],
+                       @[@"姓名"],
                        @[@"个性签名"],
                        @[@"视频单价"],
                        @[@"身高",@"体重",@"三围",@"地区",@"年龄",@"职业",@"星座",@"毕业院校",@"兴趣爱好"],
                        @[@"我的标签"],
                        @[@"我的荣誉"]];
     self.conentArr = @[@[@""],
+                       @[@""],
                        @[@""],
                        @[@""],
                        @[@"",@"",@"",@"",@"",@"",@"",@"",@""],
@@ -86,7 +91,11 @@
     bindingBtn.layer.shadowOffset = CGSizeMake(0,8);
     bindingBtn.layer.shadowOpacity = 1;
     bindingBtn.layer.shadowRadius = 10;
-    [bindingBtn setTitle:@"保存" forState:UIControlStateNormal];
+    if ([@"init" isEqualToString:self.type]) {
+        [bindingBtn setTitle:@"下一步" forState:UIControlStateNormal];
+    } else {
+        [bindingBtn setTitle:@"查看我的模卡" forState:UIControlStateNormal];
+    }
     bindingBtn.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium];
     [bindingBtn setTitleColor:RGBValueColor(0xffffff, 1.0) forState:UIControlStateNormal];
     [bindingBtn addTarget:self action:@selector(bindingBtnAction) forControlEvents:UIControlEventTouchUpInside];
@@ -171,7 +180,10 @@
     modelCell.textLabel.text = self.titlesArr[indexPath.section][indexPath.row];
     
     NSString *rowTitle = self.titlesArr[indexPath.section][indexPath.row];
-    if ([@"姓名" isEqualToString:rowTitle]) {
+    if ([@"照片" isEqualToString:rowTitle]) {
+        self.photoCell = modelCell;
+        modelCell.detailTextLabel.text = [NSString stringWithFormat:@"%@张照片",tempUser.photocount];
+    } else if ([@"姓名" isEqualToString:rowTitle]) {
         self.nameCell = modelCell;
         modelCell.detailTextLabel.text = tempUser.pet;
     } else if ([@"个性签名" isEqualToString:rowTitle]) {
@@ -191,6 +203,7 @@
         modelCell.detailTextLabel.text = [NSString stringWithFormat:@"%@/%@/%@",tempUser.bust,tempUser.wai,tempUser.hip];
     } else if ([@"地区" isEqualToString:rowTitle]) {
         self.areaCell = modelCell;
+        modelCell.detailTextLabel.text = @"";
         for (NSDictionary *dic in self.areaArray) {
             if ([dic[@"pk"] isEqual:tempUser.area]) {
                 modelCell.detailTextLabel.text = dic[@"name"];
@@ -214,7 +227,7 @@
     } else if ([@"我的标签" isEqualToString:rowTitle]) {
         self.fgbqCell = modelCell;
         modelCell.detailTextLabel.text = [NSString stringWithFormat:@"%@个标签", tempUser.stylecount];
-    } else if ([@"我的荣耀" isEqualToString:rowTitle]) {
+    } else if ([@"我的荣" isEqualToString:rowTitle]) {
         self.wdryCell = modelCell;
         modelCell.detailTextLabel.text = [NSString stringWithFormat:@"%@个荣誉", tempUser.honorcount];
     }
@@ -228,7 +241,10 @@
 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
     UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
     NSString *rowTitle = self.titlesArr[indexPath.section][indexPath.row];
-    if ([@"姓名" isEqualToString:rowTitle]) {
+    if ([@"照片" isEqualToString:rowTitle]) {
+        ModelPhotoViewController *photovc = [ModelPhotoViewController new];
+        [self.navigationController pushViewController:photovc animated:YES];
+    } else if ([@"姓名" isEqualToString:rowTitle]) {
         InfoEditViewController *infoVc = [InfoEditViewController new];
         infoVc.editType = InfoEditTypeName;
         [self.navigationController pushViewController:infoVc animated:YES];
@@ -243,6 +259,7 @@
     } else if ([@"身高" isEqualToString:rowTitle]) {
         InfoEditViewController *infoVc = [InfoEditViewController new];
         infoVc.editType = InfoEditTypeHeight;
+        [self.navigationController pushViewController:infoVc animated:YES];
     } else if ([@"体重" isEqualToString:rowTitle]) {
         InfoEditViewController *infoVc = [InfoEditViewController new];
         infoVc.editType = InfoEditTypeWeight;
@@ -296,9 +313,8 @@
         infoVc.editType = InfoEditTypeHobby;
         [self.navigationController pushViewController:infoVc animated:YES];
     } else if ([@"我的标签" isEqualToString:rowTitle]) {
-        InfoEditViewController *infoVc = [InfoEditViewController new];
-        infoVc.editType = InfoEditTypeSigature;
-        [self.navigationController pushViewController:infoVc animated:YES];
+        ModelTagViewController *tagVC = [ModelTagViewController new];
+        [self.navigationController pushViewController:tagVC animated:YES];
     } else if ([@"我的荣誉" isEqualToString:rowTitle]) {
         ModelHonorViewController *honorVc = [ModelHonorViewController new];
         [self.navigationController pushViewController:honorVc animated:YES];
@@ -307,7 +323,6 @@
 
 #pragma mark -- 保存按钮
 - (void)bindingBtnAction {
-    
     NSLog(@"name %@", self.nameCell.textLabel.text);
     if (self.nameCell.textLabel.text.length == 0) {
         [MBProgressHUD showOnlyText:@"请选择填写姓名" controller:self];
@@ -355,8 +370,16 @@
         [MBProgressHUD showOnlyText:@"请选择填写签名" controller:self];
         return;
     }
-    [MBProgressHUD showSuccess:@"保存成功"];
-    [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(backClick) userInfo:nil repeats:NO];
+//    [MBProgressHUD showSuccess:@"保存成功"];
+//    [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(backClick) userInfo:nil repeats:NO];
+    
+    if ([@"init" isEqualToString:self.type]) {
+        MySkillsController *mySkillsVC = [[MySkillsController alloc] init];
+        [self.navigationController pushViewController:mySkillsVC animated:YES];
+    } else {
+        ShareCardController *shareCardVC = [[ShareCardController alloc] init];
+        [self.navigationController pushViewController:shareCardVC animated:YES];
+    }
 }
 
 #pragma mark -- 网络请求

+ 60 - 9
model/Classes/Controllers/Controller/ShareVC/ShareCardController.m

@@ -7,8 +7,12 @@
 //
 
 #import "ShareCardController.h"
+#import "Masonry.h"
+#import <WebKit/WebKit.h>
+#import <WXApi.h>
+#import "SharePopViewController.h"
 
-@interface ShareCardController ()
+@interface ShareCardController ()<ShareDelegate>
 
 @end
 
@@ -16,17 +20,64 @@
 
 - (void)viewDidLoad {
     [super viewDidLoad];
-    // Do any additional setup after loading the view from its nib.
+    
+    self.title = @"我的模卡";
+    UIButton * btn = [UIButton buttonWithType:UIButtonTypeCustom];
+    btn.frame = CGRectMake(0, 0, 40, 40);
+    [btn setImage:[UIImage imageNamed:@"fanhui2"] forState:UIControlStateNormal];
+    btn.imageEdgeInsets =  UIEdgeInsetsMake(0, -20, 0, 0);
+    [btn addTarget:self action:@selector(backClick) forControlEvents:UIControlEventTouchUpInside];
+    UIBarButtonItem *leftItem = [[UIBarButtonItem alloc] initWithCustomView:btn];
+    UIBarButtonItem *nagetiveSpacer = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil];
+    self.navigationItem.leftBarButtonItems = @[nagetiveSpacer, leftItem];
+    UIBarButtonItem *rightItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"icon_fenxiang"] style:UIBarButtonItemStylePlain target:self action:@selector(share)];
+    rightItem.tintColor = [UIColor colorWithHexString:@"#666666"];
+    self.navigationItem.rightBarButtonItem = rightItem;
+    
+    WKWebView* webView = [[WKWebView alloc] init];
+    [self.view addSubview:webView];
+    [webView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.equalTo(self.view.mas_left);
+        make.right.equalTo(self.view.mas_right);
+        make.top.equalTo(self.mas_topLayoutGuide);
+        make.bottom.equalTo(self.mas_bottomLayoutGuide);
+    }];
+    
+    [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@%@?modelpk=%@&preview=1", PublicUrl, @"/modelCard.jsp", [ModelUser user].modelpk]]]];
+    
 }
 
-/*
-#pragma mark - Navigation
+- (void)backClick {
+    [self.navigationController popViewControllerAnimated:YES];
+}
+
+- (void)share {
+    SharePopViewController *shareVC = [[SharePopViewController alloc] init];
+    shareVC.delegate = self;
+    [self presentViewController:shareVC animated:NO completion:nil];
+}
+
+- (void)shareWxSession {
+    [self shareToWechat:WXSceneSession withTitle:@"我的模卡" description:@"千模" url:[NSString stringWithFormat:@"%@%@?modelpk=%@", PublicUrl, @"/modelCard.jsp", [ModelUser user].modelpk]];
+}
+
+- (void)shareWxTimeline {
+    [self shareToWechat:WXSceneTimeline withTitle:@"我的模卡" description:@"千模" url:[NSString stringWithFormat:@"%@%@?modelpk=%@", PublicUrl, @"/modelCard.jsp", [ModelUser user].modelpk]];
+}
 
-// In a storyboard-based application, you will often want to do a little preparation before navigation
-- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
-    // Get the new view controller using [segue destinationViewController].
-    // Pass the selected object to the new view controller.
+- (void)shareToWechat:(enum WXScene)scene withTitle:(NSString *)title description:(NSString *)description url:(NSString *)url {
+    SendMessageToWXReq *req = [[SendMessageToWXReq alloc] init];
+    req.bText = NO;
+    req.scene = scene;
+    WXMediaMessage *urlMessage = [WXMediaMessage message];
+    urlMessage.title = title;
+    urlMessage.description = description;
+    [urlMessage setThumbImage:[UIImage imageNamed:@"AppIcon"]];
+    WXWebpageObject *webObj = [WXWebpageObject object];
+    webObj.webpageUrl = url;
+    urlMessage.mediaObject = webObj;
+    req.message = urlMessage;
+    [WXApi sendReq:req];
 }
-*/
 
 @end

+ 7 - 3
model/Classes/Controllers/Controller/ShareVC/ShareCardController.xib

@@ -1,7 +1,11 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="13142" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+<?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>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12042"/>
+        <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>

+ 5 - 1
model/Classes/Controllers/Controller/ShareVC/SharePopViewController.h

@@ -7,7 +7,11 @@
 //
 
 #import <UIKit/UIKit.h>
+@protocol ShareDelegate <NSObject>
+-(void)shareWxSession;
+-(void)shareWxTimeline;
+@end
 
 @interface SharePopViewController : UIViewController
-@property(nonatomic, assign) NSInteger type;
+@property(nonatomic, retain) id<ShareDelegate> delegate;
 @end

+ 7 - 19
model/Classes/Controllers/Controller/ShareVC/SharePopViewController.m

@@ -7,7 +7,6 @@
 //
 
 #import "SharePopViewController.h"
-#import <WXApi.h>
 
 @interface SharePopViewController ()
 @property(weak, nonatomic) IBOutlet UIView *contentView;
@@ -60,12 +59,16 @@
 }
 
 - (IBAction)tapItem:(id)sender {
+    [self dismiss];
     if (((UITapGestureRecognizer *) sender).view.tag == 1) {
-        [self shareToWechat:WXSceneSession withTitle:@"千模" description:@"千模" url:shareUrl(@(self.type), [[NSUserDefaults standardUserDefaults] objectForKey:@"qrcode"])];
+        if (self.delegate) {
+            [self.delegate shareWxSession];
+        }
     } else if (((UITapGestureRecognizer *) sender).view.tag == 2) {
-        [self shareToWechat:WXSceneTimeline withTitle:@"千模" description:@"千模" url:shareUrl(@(self.type), [[NSUserDefaults standardUserDefaults] objectForKey:@"qrcode"])];
+        if (self.delegate) {
+            [self.delegate shareWxTimeline];
+        }
     }
-    [self dismiss];
 }
 
 - (void)dismiss {
@@ -80,21 +83,6 @@
                          [self dismissViewControllerAnimated:NO completion:nil];
                      }];
 }
-
-- (void)shareToWechat:(enum WXScene)scene withTitle:(NSString *)title description:(NSString *)description url:(NSString *)url {
-    SendMessageToWXReq *req = [[SendMessageToWXReq alloc] init];
-    req.bText = NO;
-    req.scene = scene;
-    WXMediaMessage *urlMessage = [WXMediaMessage message];
-    urlMessage.title = title;
-    urlMessage.description = description;
-    [urlMessage setThumbImage:[UIImage imageNamed:@"AppIcon"]];
-    WXWebpageObject *webObj = [WXWebpageObject object];
-    webObj.webpageUrl = url;
-    urlMessage.mediaObject = webObj;
-    req.message = urlMessage;
-    [WXApi sendReq:req];
-}
 /*
 #pragma mark - Navigation
 

+ 23 - 9
model/Classes/Controllers/Controller/ShareVC/ShareViewController.m

@@ -8,8 +8,9 @@
 
 #import "ShareViewController.h"
 #import "SharePopViewController.h"
+#import <WXApi.h>
 
-@interface ShareViewController ()
+@interface ShareViewController() <ShareDelegate>
 @property (weak, nonatomic) IBOutlet UIView *qrcodeContainer;
 
 @end
@@ -108,18 +109,31 @@
 
 - (IBAction)share:(id)sender {
     SharePopViewController *shareVC = [[SharePopViewController alloc] init];
-    shareVC.type = self.type;
+    shareVC.delegate = self;
     [self presentViewController:shareVC animated:NO completion:nil];
 }
 
-/*
-#pragma mark - Navigation
+- (void)shareWxSession {
+    [self shareToWechat:WXSceneSession withTitle:@"千模" description:@"千模" url:shareUrl(@(self.type), [[NSUserDefaults standardUserDefaults] objectForKey:@"qrcode"])];
+}
+
+- (void)shareWxTimeline {
+    [self shareToWechat:WXSceneTimeline withTitle:@"千模" description:@"千模" url:shareUrl(@(self.type), [[NSUserDefaults standardUserDefaults] objectForKey:@"qrcode"])];
+}
 
-// In a storyboard-based application, you will often want to do a little preparation before navigation
-- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
-    // Get the new view controller using [segue destinationViewController].
-    // Pass the selected object to the new view controller.
+- (void)shareToWechat:(enum WXScene)scene withTitle:(NSString *)title description:(NSString *)description url:(NSString *)url {
+    SendMessageToWXReq *req = [[SendMessageToWXReq alloc] init];
+    req.bText = NO;
+    req.scene = scene;
+    WXMediaMessage *urlMessage = [WXMediaMessage message];
+    urlMessage.title = title;
+    urlMessage.description = description;
+    [urlMessage setThumbImage:[UIImage imageNamed:@"AppIcon"]];
+    WXWebpageObject *webObj = [WXWebpageObject object];
+    webObj.webpageUrl = url;
+    urlMessage.mediaObject = webObj;
+    req.message = urlMessage;
+    [WXApi sendReq:req];
 }
-*/
 
 @end

+ 4 - 11
model/Classes/Tools/MBProgressHUD/MBProgressHUD+YanC.m

@@ -16,21 +16,14 @@
 + (void)show:(NSString *)text icon:(NSString *)icon view:(UIView *)view {
     
     if (view == nil) view = [UIApplication sharedApplication].keyWindow;
-    // 快速显示一个提示信息
     MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:view animated:YES];
-     hud.labelText = text;
-    // 设置图片
+    hud.label.text = text;
     hud.customView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:[NSString stringWithFormat:@"MBProgressHUD.bundle/%@", icon]]];
-
-    // 设置模式
+    [hud.bezelView setBackgroundColor:[UIColor colorWithRed:0/255.0 green:0/255.0 blue:0/255.0 alpha:0.8]];
+    hud.contentColor = [UIColor whiteColor];
     hud.mode = MBProgressHUDModeCustomView;
-
-    // 隐藏时候从父控件中移除
     hud.removeFromSuperViewOnHide = YES;
-
-    // 1秒之后再消失
-    // 1秒之后再消失
-    [hud hide:YES afterDelay:1.0];
+    [hud hideAnimated:YES afterDelay:2.0];
 }
 
 /** 显示成功 */

+ 8 - 6
model/ModelHeader.h

@@ -19,14 +19,14 @@
 //#define imageURl @"http://118.190.49.85:8080/thmodeltest/"
 //#define apnsCernameStr @"chmoModelTest"
 
-#define PublicUrl @"http://192.168.50.132:8081"
-#define imageURl @"http://192.168.50.132:8081/"
-#define apnsCernameStr @"chmoMemberTest"
-
-//#define PublicUrl @"http://192.168.123.90:8080"
-//#define imageURl @"http://192.168.123.90:8080/"
+//#define PublicUrl @"http://192.168.50.132:8081"
+//#define imageURl @"http://192.168.50.132:8081/"
 //#define apnsCernameStr @"chmoMemberTest"
 
+#define PublicUrl @"http://192.168.123.90:8080"
+#define imageURl @"http://192.168.123.90:8080/"
+#define apnsCernameStr @"chmoMemberTest"
+
 #define shareUrl(type,code) [NSString stringWithFormat:@"%@/share.jsp?type=%@&code=%@", PublicUrl, type, code]
 
 //应用下载地址 https://itunes.apple.com/cn/app/id1434011196?mt=8
@@ -142,6 +142,8 @@
 
 #define Url_setOnline(x)  [NSString stringWithFormat:@"%@/model?action=setOnline", x]
 
+#define Url_applyRecommend(x)  [NSString stringWithFormat:@"%@/modelInfo?action=applyRecommend", x]
+
 #endif /* ModelHeader_h */