Commit 93286e3f8646336e15086f42d90885dcf7d31a99

Authored by “张旭”
1 parent 4f1146f8

网页分享到微信变为图片的问题

metaCode.xcodeproj/project.pbxproj
... ... @@ -71,7 +71,6 @@
71 71 191733642B392011007BCC04 /* CNLiveShopGoodsSearchViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 191733632B392011007BCC04 /* CNLiveShopGoodsSearchViewController.swift */; };
72 72 191733662B39237D007BCC04 /* CNLiveShopGoodsManageListTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 191733652B39237D007BCC04 /* CNLiveShopGoodsManageListTableViewCell.swift */; };
73 73 192336EB2AD9224300D47CD4 /* CNUpSlideViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 192336EA2AD9224300D47CD4 /* CNUpSlideViewController.swift */; };
74   - 19269AED2BB3F334004A28FA /* LaunchImage.png in Resources */ = {isa = PBXBuildFile; fileRef = 19269AEC2BB3F334004A28FA /* LaunchImage.png */; };
75 74 1926C28F2AE0D76C00C71DC3 /* CNLiveDownSlideViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1926C28E2AE0D76C00C71DC3 /* CNLiveDownSlideViewModel.swift */; };
76 75 1926C2912AE0FD4500C71DC3 /* CNLiveDownSlideModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1926C2902AE0FD4500C71DC3 /* CNLiveDownSlideModel.swift */; };
77 76 1938BD172B3D6C7F00390A34 /* CNLiveAuthViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1938BD162B3D6C7F00390A34 /* CNLiveAuthViewController.swift */; };
... ... @@ -131,6 +130,7 @@
131 130 19E9D1602B3A98C200D0FB30 /* CNLiveShopAssociatedGoodsTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19E9D15F2B3A98C200D0FB30 /* CNLiveShopAssociatedGoodsTableViewCell.swift */; };
132 131 19E9D1622B3BBB2E00D0FB30 /* CNLiveFileManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19E9D1612B3BBB2E00D0FB30 /* CNLiveFileManager.swift */; };
133 132 19F1C2332AB5728B0083D06C /* CNIDCardView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19F1C2322AB5728B0083D06C /* CNIDCardView.swift */; };
  133 + 19F2E53F2BB3F863006AAAD6 /* LaunchImage.png in Resources */ = {isa = PBXBuildFile; fileRef = 19F2E53E2BB3F863006AAAD6 /* LaunchImage.png */; };
134 134 19FA20172AE22D3C001F7186 /* CNLiveDownSlideRecommendCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19FA20162AE22D3C001F7186 /* CNLiveDownSlideRecommendCell.swift */; };
135 135 19FA20192AE22D98001F7186 /* CNLiveDownSlideTodayRecommendCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19FA20182AE22D98001F7186 /* CNLiveDownSlideTodayRecommendCell.swift */; };
136 136 19FA201B2AE60423001F7186 /* CNLiveDownSlideModelLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19FA201A2AE60423001F7186 /* CNLiveDownSlideModelLayout.swift */; };
... ... @@ -338,7 +338,6 @@
338 338 191733632B392011007BCC04 /* CNLiveShopGoodsSearchViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveShopGoodsSearchViewController.swift; sourceTree = "<group>"; };
339 339 191733652B39237D007BCC04 /* CNLiveShopGoodsManageListTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveShopGoodsManageListTableViewCell.swift; sourceTree = "<group>"; };
340 340 192336EA2AD9224300D47CD4 /* CNUpSlideViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNUpSlideViewController.swift; sourceTree = "<group>"; };
341   - 19269AEC2BB3F334004A28FA /* LaunchImage.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = LaunchImage.png; sourceTree = "<group>"; };
342 341 1926C28E2AE0D76C00C71DC3 /* CNLiveDownSlideViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveDownSlideViewModel.swift; sourceTree = "<group>"; };
343 342 1926C2902AE0FD4500C71DC3 /* CNLiveDownSlideModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveDownSlideModel.swift; sourceTree = "<group>"; };
344 343 1938BD162B3D6C7F00390A34 /* CNLiveAuthViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveAuthViewController.swift; sourceTree = "<group>"; };
... ... @@ -398,6 +397,7 @@
398 397 19E9D15F2B3A98C200D0FB30 /* CNLiveShopAssociatedGoodsTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveShopAssociatedGoodsTableViewCell.swift; sourceTree = "<group>"; };
399 398 19E9D1612B3BBB2E00D0FB30 /* CNLiveFileManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveFileManager.swift; sourceTree = "<group>"; };
400 399 19F1C2322AB5728B0083D06C /* CNIDCardView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNIDCardView.swift; sourceTree = "<group>"; };
  400 + 19F2E53E2BB3F863006AAAD6 /* LaunchImage.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = LaunchImage.png; sourceTree = "<group>"; };
401 401 19FA20162AE22D3C001F7186 /* CNLiveDownSlideRecommendCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveDownSlideRecommendCell.swift; sourceTree = "<group>"; };
402 402 19FA20182AE22D98001F7186 /* CNLiveDownSlideTodayRecommendCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveDownSlideTodayRecommendCell.swift; sourceTree = "<group>"; };
403 403 19FA201A2AE60423001F7186 /* CNLiveDownSlideModelLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveDownSlideModelLayout.swift; sourceTree = "<group>"; };
... ... @@ -1239,7 +1239,7 @@
1239 1239 796398952A260C3700D045EB /* Supporting Files */ = {
1240 1240 isa = PBXGroup;
1241 1241 children = (
1242   - 19269AEC2BB3F334004A28FA /* LaunchImage.png */,
  1242 + 19F2E53E2BB3F863006AAAD6 /* LaunchImage.png */,
1243 1243 818163C42A25CFCF00579C86 /* Assets.xcassets */,
1244 1244 818163C12A25CFCC00579C86 /* Main.storyboard */,
1245 1245 818163C62A25CFCF00579C86 /* LaunchScreen.storyboard */,
... ... @@ -1582,7 +1582,7 @@
1582 1582 818163C82A25CFCF00579C86 /* LaunchScreen.storyboard in Resources */,
1583 1583 790D01A72A2DF84C00C5978D /* countries.plist in Resources */,
1584 1584 818163C52A25CFCF00579C86 /* Assets.xcassets in Resources */,
1585   - 19269AED2BB3F334004A28FA /* LaunchImage.png in Resources */,
  1585 + 19F2E53F2BB3F863006AAAD6 /* LaunchImage.png in Resources */,
1586 1586 7C4931342A307B58000E44B4 /* slide_down.gif in Resources */,
1587 1587 818163C32A25CFCC00579C86 /* Main.storyboard in Resources */,
1588 1588 7C4931362A307B60000E44B4 /* slide_up.gif in Resources */,
... ...
metaCode/Classes/Main/HomePage/Controller/WebController/CNWebView.swift
... ... @@ -16,6 +16,9 @@ import SKPhotoBrowser
16 16 //更新Web控制器导航回调
17 17 typealias cnWebControllerUpdateNavBlock = (_ isFinish:Bool , _ titleName:String ,_ isDecidePolicy:Bool , _ urlStr:String)->Void
18 18  
  19 +//更新Web控制器 currentUrl
  20 +typealias cnWebControllerUpdateCurrentUrlBlock = (_ currentUrl:String)->Void
  21 +
19 22 class CNWebView:UIView,WKNavigationDelegate{
20 23  
21 24 var configuration:WKWebViewConfiguration?
... ... @@ -32,6 +35,7 @@ class CNWebView:UIView,WKNavigationDelegate{
32 35 //CNWebController
33 36 var isCNWebController:Bool = false//是否网页控制器
34 37 var webControllerUpdateNavBlock:cnWebControllerUpdateNavBlock?
  38 + var webControllerUpdateCurrentUrlBlock:cnWebControllerUpdateCurrentUrlBlock?
35 39  
36 40  
37 41 init(frame: CGRect, configuration: WKWebViewConfiguration ,url:URL?) {
... ... @@ -221,6 +225,10 @@ class CNWebView:UIView,WKNavigationDelegate{
221 225  
222 226 urlStr = self.checkURLWithStr(urlStr: urlStr)
223 227 self.currentUrl = urlStr
  228 + if ((self.webControllerUpdateCurrentUrlBlock?("")) != nil){
  229 + self.webControllerUpdateCurrentUrlBlock!(self.currentUrl)
  230 + }
  231 +
224 232 }
225 233  
226 234 if navigationAction.navigationType == .other{
... ...
metaCode/Classes/Main/HomePage/Controller/WebController/CNWebViewController.swift
... ... @@ -87,7 +87,10 @@ class CNWebViewController:CNLiveBaseViewController ,WKNavigationDelegate{
87 87 }
88 88 }
89 89 }
90   - webView.snp.makeConstraints { make in
  90 + self.webView.webControllerUpdateCurrentUrlBlock = { [weak self] currentUrlStr in
  91 + self!.currentUrl = currentUrlStr
  92 + }
  93 + self.webView.snp.makeConstraints { make in
91 94 make.top.equalTo(get_system_nav_height())
92 95 make.left.right.bottom.equalToSuperview()
93 96 }
... ...
metaCode/Supporting Files/Base.lproj/LaunchScreen.storyboard
1 1 <?xml version="1.0" encoding="UTF-8"?>
2   -<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="22155" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
  2 +<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="22155" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
3 3 <device id="retina6_12" orientation="portrait" appearance="light"/>
4 4 <dependencies>
5 5 <deployment identifier="iOS"/>
... ...