Explorar el Código

首页打开资讯跳转外部链接

Steven hace 2 años
padre
commit
ec8b51e753

BIN
KulexiuForStudent/KulexiuForStudent.xcworkspace/xcuserdata/wangzhi.xcuserdatad/UserInterfaceState.xcuserstate


+ 14 - 14
KulexiuForStudent/KulexiuForStudent.xcworkspace/xcuserdata/wangzhi.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -181,31 +181,31 @@
          </BreakpointContent>
       </BreakpointProxy>
       <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         BreakpointExtensionID = "Xcode.Breakpoint.ExceptionBreakpoint">
          <BreakpointContent
-            uuid = "16180BE2-C69B-4F30-A349-32BEE2541200"
+            uuid = "B53C8936-0246-4C10-A4ED-11D513BBA445"
             shouldBeEnabled = "Yes"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "KulexiuForStudent/Common/KSImageShareViewController.m"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "109"
-            endingLineNumber = "109"
-            landmarkName = "-searchRequest:"
-            landmarkType = "7">
+            breakpointStackSelectionBehavior = "1"
+            scope = "1"
+            stopOnStyle = "1">
          </BreakpointContent>
       </BreakpointProxy>
       <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.ExceptionBreakpoint">
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          <BreakpointContent
-            uuid = "B53C8936-0246-4C10-A4ED-11D513BBA445"
+            uuid = "09C10380-97EA-4BF2-9EA5-659F5FD75E81"
             shouldBeEnabled = "Yes"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            breakpointStackSelectionBehavior = "1"
-            scope = "1"
-            stopOnStyle = "1">
+            filePath = "KulexiuForStudent/Module/Home/Controller/HomeViewController.m"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "727"
+            endingLineNumber = "727"
+            landmarkName = "-requestInformationList"
+            landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
    </Breakpoints>

+ 1 - 0
KulexiuForStudent/KulexiuForStudent/Module/Home/Model/HomeMessageModel.h

@@ -38,6 +38,7 @@
 @property (nonatomic, strong) NSString *attribute1;
 @property (nonatomic, strong) NSString *content;
 @property (nonatomic, strong) NSString *attribute2;
+@property (nonatomic, strong) NSString *linkType;
 
 + (instancetype)modelObjectWithDictionary:(NSDictionary *)dict;
 - (instancetype)initWithDictionary:(NSDictionary *)dict;

+ 7 - 4
KulexiuForStudent/KulexiuForStudent/Module/Home/Model/HomeMessageModel.m

@@ -35,7 +35,7 @@ NSString *const kHomeMessageModelOrder = @"order";
 NSString *const kHomeMessageModelAttribute1 = @"attribute1";
 NSString *const kHomeMessageModelContent = @"content";
 NSString *const kHomeMessageModelAttribute2 = @"attribute2";
-
+NSString *const kHomeMessageModelLinkType = @"linkType";
 
 @interface HomeMessageModel ()
 
@@ -72,7 +72,7 @@ NSString *const kHomeMessageModelAttribute2 = @"attribute2";
 @synthesize attribute1 = _attribute1;
 @synthesize content = _content;
 @synthesize attribute2 = _attribute2;
-
+@synthesize linkType = _linkType;
 
 + (instancetype)modelObjectWithDictionary:(NSDictionary *)dict
 {
@@ -113,7 +113,7 @@ NSString *const kHomeMessageModelAttribute2 = @"attribute2";
             self.attribute1 = [self objectOrNilForKey:kHomeMessageModelAttribute1 fromDictionary:dict];
             self.content = [self objectOrNilForKey:kHomeMessageModelContent fromDictionary:dict];
             self.attribute2 = [self objectOrNilForKey:kHomeMessageModelAttribute2 fromDictionary:dict];
-
+        self.linkType = [self objectOrNilForKey:kHomeMessageModelLinkType fromDictionary:dict];
     }
     
     return self;
@@ -150,7 +150,7 @@ NSString *const kHomeMessageModelAttribute2 = @"attribute2";
     [mutableDict setValue:self.attribute1 forKey:kHomeMessageModelAttribute1];
     [mutableDict setValue:self.content forKey:kHomeMessageModelContent];
     [mutableDict setValue:self.attribute2 forKey:kHomeMessageModelAttribute2];
-
+    [mutableDict setValue:self.linkType forKey:kHomeMessageModelLinkType];
     return [NSDictionary dictionaryWithDictionary:mutableDict];
 }
 
@@ -204,6 +204,7 @@ NSString *const kHomeMessageModelAttribute2 = @"attribute2";
     self.attribute1 = [aDecoder decodeObjectForKey:kHomeMessageModelAttribute1];
     self.content = [aDecoder decodeObjectForKey:kHomeMessageModelContent];
     self.attribute2 = [aDecoder decodeObjectForKey:kHomeMessageModelAttribute2];
+    self.linkType = [aDecoder decodeObjectForKey:kHomeMessageModelLinkType];
     return self;
 }
 
@@ -237,6 +238,7 @@ NSString *const kHomeMessageModelAttribute2 = @"attribute2";
     [aCoder encodeObject:_attribute1 forKey:kHomeMessageModelAttribute1];
     [aCoder encodeObject:_content forKey:kHomeMessageModelContent];
     [aCoder encodeObject:_attribute2 forKey:kHomeMessageModelAttribute2];
+    [aCoder encodeObject:_linkType forKey:kHomeMessageModelLinkType];
 }
 
 - (id)copyWithZone:(NSZone *)zone
@@ -272,6 +274,7 @@ NSString *const kHomeMessageModelAttribute2 = @"attribute2";
         copy.attribute1 = [self.attribute1 copyWithZone:zone];
         copy.content = [self.content copyWithZone:zone];
         copy.attribute2 = [self.attribute2 copyWithZone:zone];
+        copy.linkType = [self.linkType copyWithZone:zone];
     }
     
     return copy;

+ 11 - 4
KulexiuForStudent/KulexiuForStudent/Module/Home/View/HomePageView/HomeInformationBodyView.m

@@ -139,10 +139,17 @@
 
 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
     HomeMessageModel *model = self.informationArray[indexPath.row];
-    // 跳转
-    KSBaseWKWebViewController *webCtrl = [[KSBaseWKWebViewController alloc] init];
-    webCtrl.url = [NSString stringWithFormat:@"%@%@%@",WEBHOST,@"/#/specialdetail?id=",model.internalBaseClassIdentifier];
-    [self.naviController pushViewController:webCtrl animated:YES];
+    
+    if ([model.linkType isEqualToString:@"OUT"]) {
+        // 外部浏览器打开
+        [[UIApplication sharedApplication] openURL:[NSURL URLWithString:model.linkUrl] options: @{} completionHandler: nil];
+    }
+    else {
+        // 跳转
+        KSBaseWKWebViewController *webCtrl = [[KSBaseWKWebViewController alloc] init];
+        webCtrl.url = [NSString stringWithFormat:@"%@%@%@",WEBHOST,@"/#/specialdetail?id=",model.internalBaseClassIdentifier];
+        [self.naviController pushViewController:webCtrl animated:YES];
+    }
 }