Commit f420e0ce authored by pete谢兆麟's avatar pete谢兆麟

资讯跳转逻辑添加

parent 0188ada1
...@@ -2904,7 +2904,7 @@ ...@@ -2904,7 +2904,7 @@
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual; CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 9; CURRENT_PROJECT_VERSION = 10;
DEVELOPMENT_TEAM = ""; DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = RXHYW88XR7; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = RXHYW88XR7;
ENABLE_USER_SCRIPT_SANDBOXING = NO; ENABLE_USER_SCRIPT_SANDBOXING = NO;
...@@ -3105,7 +3105,7 @@ ...@@ -3105,7 +3105,7 @@
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual; CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 9; CURRENT_PROJECT_VERSION = 10;
DEVELOPMENT_TEAM = ""; DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = RXHYW88XR7; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = RXHYW88XR7;
ENABLE_USER_SCRIPT_SANDBOXING = NO; ENABLE_USER_SCRIPT_SANDBOXING = NO;
...@@ -3147,7 +3147,7 @@ ...@@ -3147,7 +3147,7 @@
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual; CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 9; CURRENT_PROJECT_VERSION = 10;
DEVELOPMENT_TEAM = ""; DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = RXHYW88XR7; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = RXHYW88XR7;
ENABLE_USER_SCRIPT_SANDBOXING = NO; ENABLE_USER_SCRIPT_SANDBOXING = NO;
......
...@@ -121,7 +121,7 @@ extension YHHomePageViewController: UICollectionViewDelegate, UICollectionViewDa ...@@ -121,7 +121,7 @@ extension YHHomePageViewController: UICollectionViewDelegate, UICollectionViewDa
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
let model = self.viewModel.arrHomeNewsData[indexPath.row] let model = self.viewModel.arrHomeNewsData[indexPath.row]
let vc = YHHomeWebViewController() let vc = YHHomeWebViewController()
vc.url = "https://test-hkdiy-h5.galaxy-immi.com/articleDetail.html?id=3000" vc.url = "https://test-hkdiy-h5.galaxy-immi.com/articleDetail.html?id=\(model?.id ?? 0)"
vc.id = model?.id ?? 0 vc.id = model?.id ?? 0
self.navigationController?.pushViewController(vc) self.navigationController?.pushViewController(vc)
} }
......
...@@ -26,7 +26,7 @@ class YHHomeWebViewController: YHBaseViewController, WKUIDelegate, WKNavigationD ...@@ -26,7 +26,7 @@ class YHHomeWebViewController: YHBaseViewController, WKUIDelegate, WKNavigationD
let statusHeight = k_Height_statusBar() let statusHeight = k_Height_statusBar()
// 创建wkwebview // 创建wkwebview
webview = WKWebView(frame: CGRect(x: 0, y: statusHeight + navHeight!, width: self.view.frame.width, height: self.view.frame.height)) webview = WKWebView(frame: CGRect(x: 0, y: statusHeight + navHeight!, width: self.view.frame.width, height: self.view.frame.height - statusHeight - navHeight! - 59 - k_Height_safeAreaInsetsBottom()))
webview.navigationDelegate = self webview.navigationDelegate = self
// 创建网址 // 创建网址
let url = NSURL(string: url) let url = NSURL(string: url)
...@@ -71,13 +71,17 @@ class YHHomeWebViewController: YHBaseViewController, WKUIDelegate, WKNavigationD ...@@ -71,13 +71,17 @@ class YHHomeWebViewController: YHBaseViewController, WKUIDelegate, WKNavigationD
make.bottom.left.right.equalToSuperview() make.bottom.left.right.equalToSuperview()
make.height.equalTo(59 + k_Height_safeAreaInsetsBottom()) make.height.equalTo(59 + k_Height_safeAreaInsetsBottom())
} }
getData()
} }
deinit { deinit {
webview.removeObserver(self, forKeyPath: "estimatedProgress") webview.removeObserver(self, forKeyPath: "estimatedProgress")
} }
func getData() {
}
// MARK: - WKNavigationDelegate // MARK: - WKNavigationDelegate
func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) { func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
......
...@@ -53,25 +53,6 @@ class YHServiceTableFootView: UIView { ...@@ -53,25 +53,6 @@ class YHServiceTableFootView: UIView {
// self.loadFakeData() // self.loadFakeData()
// } // }
} }
func getImageSize(_ url: String?) -> CGSize {
guard let urlStr = url, urlStr.count != 0 else {
return CGSize.zero
}
let tempUrl = URL(string: urlStr)
let imageSourceRef = CGImageSourceCreateWithURL(tempUrl! as CFURL, nil)
var width: CGFloat = 0
var height: CGFloat = 0
if let imageSRef = imageSourceRef {
let imageProperties = CGImageSourceCopyPropertiesAtIndex(imageSRef, 0, nil)
if let imageP = imageProperties {
let imageDict = imageP as Dictionary
width = imageDict[kCGImagePropertyPixelWidth] as! CGFloat
height = imageDict[kCGImagePropertyPixelHeight] as! CGFloat
}
}
return CGSize(width: width, height: height)
}
} }
extension YHServiceTableFootView: UICollectionViewDelegate, UICollectionViewDataSource { extension YHServiceTableFootView: UICollectionViewDelegate, UICollectionViewDataSource {
...@@ -91,9 +72,13 @@ extension YHServiceTableFootView: UICollectionViewDelegate, UICollectionViewData ...@@ -91,9 +72,13 @@ extension YHServiceTableFootView: UICollectionViewDelegate, UICollectionViewData
print("index is \(indexPath.row)") print("index is \(indexPath.row)")
} }
// func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
// let model = items[indexPath.row]
// } let vc = YHHomeWebViewController()
vc.url = "https://test-hkdiy-h5.galaxy-immi.com/articleDetail.html?id=\(model?.id ?? 0)"
vc.id = model?.id ?? 0
UIViewController.current?.navigationController?.pushViewController(vc)
}
} }
extension YHServiceTableFootView: CollectionViewWaterfallLayoutDelegate { extension YHServiceTableFootView: CollectionViewWaterfallLayoutDelegate {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment