lixianglan 7 年之前
父节点
当前提交
6591633a6f

二进制
ios/JianYuIOS/JianYuIOS.xcworkspace/xcuserdata/lxl.xcuserdatad/UserInterfaceState.xcuserstate


+ 0 - 32
ios/JianYuIOS/JianYuIOS.xcworkspace/xcuserdata/lxl.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -13,37 +13,5 @@
             stopOnStyle = "0">
          </BreakpointContent>
       </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            shouldBeEnabled = "Yes"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "JianYuIOS/ViewController.m"
-            timestampString = "541923783.255692"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "185"
-            endingLineNumber = "185"
-            landmarkName = "-click:"
-            landmarkType = "7">
-         </BreakpointContent>
-      </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            shouldBeEnabled = "Yes"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "JianYuIOS/AppDelegate.m"
-            timestampString = "541929952.687133"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "240"
-            endingLineNumber = "240"
-            landmarkName = "-application:didReceiveRemoteNotification:fetchCompletionHandler:"
-            landmarkType = "7">
-         </BreakpointContent>
-      </BreakpointProxy>
    </Breakpoints>
 </Bucket>

+ 2 - 2
ios/JianYuIOS/JianYuIOS/AppDelegate.m

@@ -57,7 +57,7 @@
     [JPUSHService setupWithOption:launchOptions appKey:@"5efa1257867cf5d77d007ce6"
                           channel:@"APP Store"
                  apsForProduction:1
-            advertisingIdentifier:nil]; // llxl
+            advertisingIdentifier:nil]; // llxl   0:开发环境 1:生产环境
     NSNotificationCenter *defaultCenter = [NSNotificationCenter defaultCenter];
     [defaultCenter addObserver:self selector:@selector(networkDidReceiveMessage:) name:kJPFNetworkDidReceiveMessageNotification object:nil];
     [JPUSHService registrationIDCompletionHandler:^(int resCode, NSString *registrationID) {
@@ -280,7 +280,7 @@ didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
 }
 
 
-
+// 极光消息
 - (void)networkDidReceiveMessage:(NSNotification *)notification {
     NSDictionary * userInfo = [notification userInfo];
     NSString *content = [userInfo valueForKey:@"content"];

+ 0 - 9
ios/JianYuIOS/JianYuIOS/Base.lproj/Main.storyboard

@@ -28,21 +28,12 @@
                                     <outlet property="delegate" destination="BYZ-38-t0r" id="KFh-B8-R7t"/>
                                 </connections>
                             </webView>
-                            <button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="e4B-3b-Lwa">
-                                <rect key="frame" x="164.5" y="318.5" width="46" height="30"/>
-                                <state key="normal" title="Button"/>
-                                <connections>
-                                    <action selector="click:" destination="BYZ-38-t0r" eventType="touchUpInside" id="KXR-7z-4yt"/>
-                                </connections>
-                            </button>
                         </subviews>
                         <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                         <constraints>
-                            <constraint firstItem="e4B-3b-Lwa" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="TlB-Qn-sjp"/>
                             <constraint firstItem="FYC-rR-cTH" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leading" id="Xir-CD-4sF"/>
                             <constraint firstItem="FYC-rR-cTH" firstAttribute="top" secondItem="8bC-Xf-vdC" secondAttribute="top" id="cVW-Na-SF6"/>
                             <constraint firstAttribute="trailing" secondItem="FYC-rR-cTH" secondAttribute="trailing" id="ewx-by-zn7"/>
-                            <constraint firstItem="e4B-3b-Lwa" firstAttribute="centerY" secondItem="8bC-Xf-vdC" secondAttribute="centerY" id="fLx-8C-V0G"/>
                             <constraint firstItem="mUM-zT-OLx" firstAttribute="top" secondItem="FYC-rR-cTH" secondAttribute="bottom" id="zCw-HF-R5H"/>
                         </constraints>
                     </view>

+ 4 - 2
ios/JianYuIOS/JianYuIOS/NewWebController.m

@@ -83,6 +83,7 @@
     }
 }
 
+// 显示加载进度条
 -(void)addProgressView{
     if (self.progressView) {
         [self.progressView removeFromSuperview];
@@ -93,6 +94,7 @@
     [self.view addSubview:self.progressView];
 }
 
+// 移除加载进度条
 -(void)removeProgresView{
     self.progressView.progress = .99;
     dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
@@ -104,9 +106,9 @@
 }
 
 - (IBAction)backBtnAction:(id)sender {
-    if (self.webView.canGoBack) {
+    if (self.webView.canGoBack) {// web能退 就后退
         [self.webView goBack];
-    }else{
+    }else{// 跳回上级页面
         [self dismissViewControllerAnimated:NO completion:nil];
     }
 }

+ 12 - 30
ios/JianYuIOS/JianYuIOS/ViewController.m

@@ -98,6 +98,7 @@ JSExportAs(isInstallWeixin, -(int)jsIsInstallWeixin:(NSString *)str);// 是否
     [self clearWeb];
 }
 
+// 监控网络状态变化
 -(void)netReachChanged:(NSNotification *)notificaition{
     NSDictionary *userInfo = notificaition.userInfo;
     if ([userInfo[@"AFNetworkingReachabilityNotificationStatusItem"] intValue] == 0 || [userInfo[@"AFNetworkingReachabilityNotificationStatusItem"] intValue] == -1) {
@@ -122,6 +123,7 @@ JSExportAs(isInstallWeixin, -(int)jsIsInstallWeixin:(NSString *)str);// 是否
 
 }
 
+// 首次加载web
 -(void)webViewFirstRequest{
     NSString *url = [NSString stringWithFormat:@"%@%@", kHost, @"jyapp/free/login"];
     NSString *token = [LXUserDefaults token];
@@ -179,13 +181,6 @@ JSExportAs(isInstallWeixin, -(int)jsIsInstallWeixin:(NSString *)str);// 是否
     [self jsRemoveUserToken:nil];
 }
 
-- (IBAction)click:(id)sender {
-//    [self jsLoginByWeixin:nil];
-//    [self clearWeb];
-    NewWebController *ctr = [[NewWebController alloc] init];
-    ctr.url = @"http://www.baidu.com";
-    [self presentViewController:ctr animated:NO completion:nil];
-}
 
 
 //捕获js中调用的方法
@@ -215,9 +210,9 @@ JSExportAs(isInstallWeixin, -(int)jsIsInstallWeixin:(NSString *)str);// 是否
     if (!url) {
         return;
     }
-    if ([url containsString:@"signOut"]) {
+    if ([url containsString:@"signOut"]) { // 收到退出消息后 跳转到登录页面
         [self webViewFirstRequest];
-    }else if ([url containsString:@"/free/login"]){
+    }else if ([url containsString:@"/free/login"]){ //  如果通过接收消息 跳转到登录页面 展示消息内容
         if (self.signOutContent && ![self.signOutContent isEqualToString:@"1"]) {
             [[LXViewControllerManager shareViewControllerManager] showAlertViewWithTitle:@"提示" message:self.signOutContent actions:@[[UIAlertAction actionWithTitle:@"确认" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
                 self.signOutContent = nil;
@@ -277,7 +272,7 @@ JSExportAs(isInstallWeixin, -(int)jsIsInstallWeixin:(NSString *)str);// 是否
 // 微信登录
 -(NSString *)jsLoginByWeixin:(NSString *)str{
 
-    if ([LXUserDefaults isInstallWeiXin] != 1) {
+    if ([LXUserDefaults isInstallWeiXin] != 1) { // 没有安装微信 不走友盟
         [[LXViewControllerManager shareViewControllerManager] showHudOnlyText:@"微信登录失败,没有安装微信" delay:1.5];
         return nil;
     }
@@ -288,22 +283,6 @@ JSExportAs(isInstallWeixin, -(int)jsIsInstallWeixin:(NSString *)str);// 是否
             
             UMSocialUserInfoResponse *resp = result;
             
-            // 第三方登录数据(为空表示平台未提供)
-            // 授权数据
-            NSLog(@" uid: %@", resp.uid);
-            NSLog(@" openid: %@", resp.openid);
-            [LXUserDefaults saveOpenID:resp.openid];
-            NSLog(@" accessToken: %@", resp.accessToken);
-            NSLog(@" refreshToken: %@", resp.refreshToken);
-            NSLog(@" expiration: %@", resp.expiration);
-            // 用户数据
-            NSLog(@" name: %@", resp.name);
-            NSLog(@" iconurl: %@", resp.iconurl);
-            NSLog(@" gender: %@", resp.unionGender);
-            
-            // 第三方平台SDK原始数据
-            NSLog(@" originalResponse: %@", resp.originalResponse);
-            
             [self dealWXDic:(NSDictionary *)resp.originalResponse];
             
             [[LXViewControllerManager shareViewControllerManager] hideHud];
@@ -328,7 +307,7 @@ JSExportAs(isInstallWeixin, -(int)jsIsInstallWeixin:(NSString *)str);// 是否
         double currDouble = [[NSDate date] timeIntervalSince1970];
         [dic setObject:[NSNumber numberWithLong:(long)currDouble] forKey:@"createtime"];
         
-        
+//         拼接标志位
         NSString *sign = [NSString stringWithFormat:@"city=%@&country=%@&createtime=%@&headimgurl=%@&nickname=%@&openid=%@&province=%@&sex=%@&unionid=%@", dic[@"city"], dic[@"country"], dic[@"createtime"], dic[@"headimgurl"], dic[@"nickname"], dic[@"openid"], dic[@"province"],dic[@"sex"],dic[@"unionid"]];
         sign = [LXMD5 md532BitLower:sign];
         [dic setObject:sign forKey:@"sign"];
@@ -349,11 +328,11 @@ JSExportAs(isInstallWeixin, -(int)jsIsInstallWeixin:(NSString *)str);// 是否
 -(void)jsShare:(NSString *)type title:(NSString *)title content:(NSString *)content link:(NSString *)link{
     UMSocialPlatformType shareType;
 
-    if ([type intValue] == 1) {
+    if ([type intValue] == 1) { // 微信好友
         shareType = UMSocialPlatformType_WechatSession;
-    }else if ([type intValue] == 2){
+    }else if ([type intValue] == 2){ /// qq好友
         shareType = UMSocialPlatformType_QQ;
-    }else if ([type intValue] == 3){
+    }else if ([type intValue] == 3){ // 朋友圈
         shareType = UMSocialPlatformType_WechatTimeLine;
     }else{
         shareType = UMSocialPlatformType_WechatSession;
@@ -361,12 +340,14 @@ JSExportAs(isInstallWeixin, -(int)jsIsInstallWeixin:(NSString *)str);// 是否
     
     kMainQueue(^{
         
+//         没有安装app 不走分享逻辑
         if ([type intValue] == 1 || [type intValue] == 3) {
             if ([LXUserDefaults isInstallWeiXin] != 1) {
                 [[LXViewControllerManager shareViewControllerManager] showHudOnlyText:@"没有安装微信" delay:1.5];
                 return;
             }
         }
+//         没有安装app 不走分享逻辑
         if ([type intValue] == 2) {
             if (![[UMSocialManager defaultManager] isInstall:UMSocialPlatformType_QQ]) {
                 [[LXViewControllerManager shareViewControllerManager] showHudOnlyText:@"没有安装QQ" delay:1.5];
@@ -506,6 +487,7 @@ JSExportAs(isInstallWeixin, -(int)jsIsInstallWeixin:(NSString *)str);// 是否
         }
         NewWebController *ctr = [[NewWebController alloc] init];
         ctr.url = url;
+//         有title的话 会显示自定义的导航栏 没有的话不显示导航栏 显示加载进度条
         if (!title || [title isEqualToString:@""] || [title isEqualToString:@"undefined"]) {
             ctr.titleShow = nil;
         }else{