├── ZXYWebView.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist └── xcuserdata │ └── zhangxiaoyang.xcuserdatad │ └── xcschemes │ └── xcschememanagement.plist ├── ZXYWebView ├── AppDelegate.swift ├── Assets.xcassets │ ├── AccentColor.colorset │ │ └── Contents.json │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── Contents.json ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Info.plist ├── SceneDelegate.swift ├── ViewController.swift └── WKWebView │ ├── ZXYLocalWebViewController.swift │ ├── ZXYWebEntity.swift │ ├── ZXYWebNavigationBar.swift │ ├── ZXYWebView.swift │ ├── ZXYWebViewController.swift │ ├── ZXYWebViewHandle.swift │ ├── ZXYWebViewPool.swift │ └── newsHtmlFiles │ ├── Introduction.html │ ├── banner.html │ ├── dealerNews.html │ ├── ibPolicy.html │ ├── img │ ├── finger_down.png │ ├── finger_up.png │ ├── gold_stars.png │ ├── gray_stars.png │ ├── left_arrow.png │ ├── parse.png │ ├── play1.png │ ├── play2.png │ └── triangle.png │ ├── industryNews.html │ ├── scripts │ ├── broker │ │ ├── dealerNews.js │ │ ├── ibPolicy.js │ │ └── introduction.js │ ├── news │ │ ├── banner.js │ │ └── industryNews.js │ └── public │ │ ├── Compatible.min.js │ │ ├── ScreenAdaptation.js │ │ ├── layer.js │ │ ├── mui.min.js │ │ ├── mui.previewimage.js │ │ ├── mui.zoom.js │ │ └── public.js │ └── styles │ ├── ShareHeader.css │ ├── introduction.css │ ├── mui.min.css │ ├── newsDetails.css │ ├── previewImage.css │ └── public.css ├── ZXYWebViewTests ├── Info.plist └── ZXYWebViewTests.swift └── ZXYWebViewUITests ├── Info.plist └── ZXYWebViewUITests.swift /ZXYWebView.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | D8A72BE3257FADCD00D8F796 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8A72BE2257FADCD00D8F796 /* AppDelegate.swift */; }; 11 | D8A72BE5257FADCD00D8F796 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8A72BE4257FADCD00D8F796 /* SceneDelegate.swift */; }; 12 | D8A72BE7257FADCD00D8F796 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8A72BE6257FADCD00D8F796 /* ViewController.swift */; }; 13 | D8A72BEA257FADCD00D8F796 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D8A72BE8257FADCD00D8F796 /* Main.storyboard */; }; 14 | D8A72BEC257FADCD00D8F796 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D8A72BEB257FADCD00D8F796 /* Assets.xcassets */; }; 15 | D8A72BEF257FADCD00D8F796 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D8A72BED257FADCD00D8F796 /* LaunchScreen.storyboard */; }; 16 | D8A72BFA257FADCD00D8F796 /* ZXYWebViewTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8A72BF9257FADCD00D8F796 /* ZXYWebViewTests.swift */; }; 17 | D8A72C05257FADCE00D8F796 /* ZXYWebViewUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8A72C04257FADCE00D8F796 /* ZXYWebViewUITests.swift */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXContainerItemProxy section */ 21 | D8A72BF6257FADCD00D8F796 /* PBXContainerItemProxy */ = { 22 | isa = PBXContainerItemProxy; 23 | containerPortal = D8A72BD7257FADCC00D8F796 /* Project object */; 24 | proxyType = 1; 25 | remoteGlobalIDString = D8A72BDE257FADCD00D8F796; 26 | remoteInfo = ZXYWebView; 27 | }; 28 | D8A72C01257FADCE00D8F796 /* PBXContainerItemProxy */ = { 29 | isa = PBXContainerItemProxy; 30 | containerPortal = D8A72BD7257FADCC00D8F796 /* Project object */; 31 | proxyType = 1; 32 | remoteGlobalIDString = D8A72BDE257FADCD00D8F796; 33 | remoteInfo = ZXYWebView; 34 | }; 35 | /* End PBXContainerItemProxy section */ 36 | 37 | /* Begin PBXFileReference section */ 38 | D8A72BDF257FADCD00D8F796 /* ZXYWebView.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ZXYWebView.app; sourceTree = BUILT_PRODUCTS_DIR; }; 39 | D8A72BE2257FADCD00D8F796 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 40 | D8A72BE4257FADCD00D8F796 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; 41 | D8A72BE6257FADCD00D8F796 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 42 | D8A72BE9257FADCD00D8F796 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 43 | D8A72BEB257FADCD00D8F796 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 44 | D8A72BEE257FADCD00D8F796 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 45 | D8A72BF0257FADCD00D8F796 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 46 | D8A72BF5257FADCD00D8F796 /* ZXYWebViewTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ZXYWebViewTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 47 | D8A72BF9257FADCD00D8F796 /* ZXYWebViewTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ZXYWebViewTests.swift; sourceTree = ""; }; 48 | D8A72BFB257FADCD00D8F796 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 49 | D8A72C00257FADCE00D8F796 /* ZXYWebViewUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ZXYWebViewUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 50 | D8A72C04257FADCE00D8F796 /* ZXYWebViewUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ZXYWebViewUITests.swift; sourceTree = ""; }; 51 | D8A72C06257FADCE00D8F796 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 52 | /* End PBXFileReference section */ 53 | 54 | /* Begin PBXFrameworksBuildPhase section */ 55 | D8A72BDC257FADCD00D8F796 /* Frameworks */ = { 56 | isa = PBXFrameworksBuildPhase; 57 | buildActionMask = 2147483647; 58 | files = ( 59 | ); 60 | runOnlyForDeploymentPostprocessing = 0; 61 | }; 62 | D8A72BF2257FADCD00D8F796 /* Frameworks */ = { 63 | isa = PBXFrameworksBuildPhase; 64 | buildActionMask = 2147483647; 65 | files = ( 66 | ); 67 | runOnlyForDeploymentPostprocessing = 0; 68 | }; 69 | D8A72BFD257FADCE00D8F796 /* Frameworks */ = { 70 | isa = PBXFrameworksBuildPhase; 71 | buildActionMask = 2147483647; 72 | files = ( 73 | ); 74 | runOnlyForDeploymentPostprocessing = 0; 75 | }; 76 | /* End PBXFrameworksBuildPhase section */ 77 | 78 | /* Begin PBXGroup section */ 79 | D8A72BD6257FADCC00D8F796 = { 80 | isa = PBXGroup; 81 | children = ( 82 | D8A72BE1257FADCD00D8F796 /* ZXYWebView */, 83 | D8A72BF8257FADCD00D8F796 /* ZXYWebViewTests */, 84 | D8A72C03257FADCE00D8F796 /* ZXYWebViewUITests */, 85 | D8A72BE0257FADCD00D8F796 /* Products */, 86 | ); 87 | sourceTree = ""; 88 | }; 89 | D8A72BE0257FADCD00D8F796 /* Products */ = { 90 | isa = PBXGroup; 91 | children = ( 92 | D8A72BDF257FADCD00D8F796 /* ZXYWebView.app */, 93 | D8A72BF5257FADCD00D8F796 /* ZXYWebViewTests.xctest */, 94 | D8A72C00257FADCE00D8F796 /* ZXYWebViewUITests.xctest */, 95 | ); 96 | name = Products; 97 | sourceTree = ""; 98 | }; 99 | D8A72BE1257FADCD00D8F796 /* ZXYWebView */ = { 100 | isa = PBXGroup; 101 | children = ( 102 | D8A72BE2257FADCD00D8F796 /* AppDelegate.swift */, 103 | D8A72BE4257FADCD00D8F796 /* SceneDelegate.swift */, 104 | D8A72BE6257FADCD00D8F796 /* ViewController.swift */, 105 | D8A72BE8257FADCD00D8F796 /* Main.storyboard */, 106 | D8A72BEB257FADCD00D8F796 /* Assets.xcassets */, 107 | D8A72BED257FADCD00D8F796 /* LaunchScreen.storyboard */, 108 | D8A72BF0257FADCD00D8F796 /* Info.plist */, 109 | ); 110 | path = ZXYWebView; 111 | sourceTree = ""; 112 | }; 113 | D8A72BF8257FADCD00D8F796 /* ZXYWebViewTests */ = { 114 | isa = PBXGroup; 115 | children = ( 116 | D8A72BF9257FADCD00D8F796 /* ZXYWebViewTests.swift */, 117 | D8A72BFB257FADCD00D8F796 /* Info.plist */, 118 | ); 119 | path = ZXYWebViewTests; 120 | sourceTree = ""; 121 | }; 122 | D8A72C03257FADCE00D8F796 /* ZXYWebViewUITests */ = { 123 | isa = PBXGroup; 124 | children = ( 125 | D8A72C04257FADCE00D8F796 /* ZXYWebViewUITests.swift */, 126 | D8A72C06257FADCE00D8F796 /* Info.plist */, 127 | ); 128 | path = ZXYWebViewUITests; 129 | sourceTree = ""; 130 | }; 131 | /* End PBXGroup section */ 132 | 133 | /* Begin PBXNativeTarget section */ 134 | D8A72BDE257FADCD00D8F796 /* ZXYWebView */ = { 135 | isa = PBXNativeTarget; 136 | buildConfigurationList = D8A72C09257FADCE00D8F796 /* Build configuration list for PBXNativeTarget "ZXYWebView" */; 137 | buildPhases = ( 138 | D8A72BDB257FADCD00D8F796 /* Sources */, 139 | D8A72BDC257FADCD00D8F796 /* Frameworks */, 140 | D8A72BDD257FADCD00D8F796 /* Resources */, 141 | ); 142 | buildRules = ( 143 | ); 144 | dependencies = ( 145 | ); 146 | name = ZXYWebView; 147 | productName = ZXYWebView; 148 | productReference = D8A72BDF257FADCD00D8F796 /* ZXYWebView.app */; 149 | productType = "com.apple.product-type.application"; 150 | }; 151 | D8A72BF4257FADCD00D8F796 /* ZXYWebViewTests */ = { 152 | isa = PBXNativeTarget; 153 | buildConfigurationList = D8A72C0C257FADCE00D8F796 /* Build configuration list for PBXNativeTarget "ZXYWebViewTests" */; 154 | buildPhases = ( 155 | D8A72BF1257FADCD00D8F796 /* Sources */, 156 | D8A72BF2257FADCD00D8F796 /* Frameworks */, 157 | D8A72BF3257FADCD00D8F796 /* Resources */, 158 | ); 159 | buildRules = ( 160 | ); 161 | dependencies = ( 162 | D8A72BF7257FADCD00D8F796 /* PBXTargetDependency */, 163 | ); 164 | name = ZXYWebViewTests; 165 | productName = ZXYWebViewTests; 166 | productReference = D8A72BF5257FADCD00D8F796 /* ZXYWebViewTests.xctest */; 167 | productType = "com.apple.product-type.bundle.unit-test"; 168 | }; 169 | D8A72BFF257FADCE00D8F796 /* ZXYWebViewUITests */ = { 170 | isa = PBXNativeTarget; 171 | buildConfigurationList = D8A72C0F257FADCE00D8F796 /* Build configuration list for PBXNativeTarget "ZXYWebViewUITests" */; 172 | buildPhases = ( 173 | D8A72BFC257FADCE00D8F796 /* Sources */, 174 | D8A72BFD257FADCE00D8F796 /* Frameworks */, 175 | D8A72BFE257FADCE00D8F796 /* Resources */, 176 | ); 177 | buildRules = ( 178 | ); 179 | dependencies = ( 180 | D8A72C02257FADCE00D8F796 /* PBXTargetDependency */, 181 | ); 182 | name = ZXYWebViewUITests; 183 | productName = ZXYWebViewUITests; 184 | productReference = D8A72C00257FADCE00D8F796 /* ZXYWebViewUITests.xctest */; 185 | productType = "com.apple.product-type.bundle.ui-testing"; 186 | }; 187 | /* End PBXNativeTarget section */ 188 | 189 | /* Begin PBXProject section */ 190 | D8A72BD7257FADCC00D8F796 /* Project object */ = { 191 | isa = PBXProject; 192 | attributes = { 193 | LastSwiftUpdateCheck = 1220; 194 | LastUpgradeCheck = 1220; 195 | TargetAttributes = { 196 | D8A72BDE257FADCD00D8F796 = { 197 | CreatedOnToolsVersion = 12.2; 198 | }; 199 | D8A72BF4257FADCD00D8F796 = { 200 | CreatedOnToolsVersion = 12.2; 201 | TestTargetID = D8A72BDE257FADCD00D8F796; 202 | }; 203 | D8A72BFF257FADCE00D8F796 = { 204 | CreatedOnToolsVersion = 12.2; 205 | TestTargetID = D8A72BDE257FADCD00D8F796; 206 | }; 207 | }; 208 | }; 209 | buildConfigurationList = D8A72BDA257FADCC00D8F796 /* Build configuration list for PBXProject "ZXYWebView" */; 210 | compatibilityVersion = "Xcode 9.3"; 211 | developmentRegion = en; 212 | hasScannedForEncodings = 0; 213 | knownRegions = ( 214 | en, 215 | Base, 216 | ); 217 | mainGroup = D8A72BD6257FADCC00D8F796; 218 | productRefGroup = D8A72BE0257FADCD00D8F796 /* Products */; 219 | projectDirPath = ""; 220 | projectRoot = ""; 221 | targets = ( 222 | D8A72BDE257FADCD00D8F796 /* ZXYWebView */, 223 | D8A72BF4257FADCD00D8F796 /* ZXYWebViewTests */, 224 | D8A72BFF257FADCE00D8F796 /* ZXYWebViewUITests */, 225 | ); 226 | }; 227 | /* End PBXProject section */ 228 | 229 | /* Begin PBXResourcesBuildPhase section */ 230 | D8A72BDD257FADCD00D8F796 /* Resources */ = { 231 | isa = PBXResourcesBuildPhase; 232 | buildActionMask = 2147483647; 233 | files = ( 234 | D8A72BEF257FADCD00D8F796 /* LaunchScreen.storyboard in Resources */, 235 | D8A72BEC257FADCD00D8F796 /* Assets.xcassets in Resources */, 236 | D8A72BEA257FADCD00D8F796 /* Main.storyboard in Resources */, 237 | ); 238 | runOnlyForDeploymentPostprocessing = 0; 239 | }; 240 | D8A72BF3257FADCD00D8F796 /* Resources */ = { 241 | isa = PBXResourcesBuildPhase; 242 | buildActionMask = 2147483647; 243 | files = ( 244 | ); 245 | runOnlyForDeploymentPostprocessing = 0; 246 | }; 247 | D8A72BFE257FADCE00D8F796 /* Resources */ = { 248 | isa = PBXResourcesBuildPhase; 249 | buildActionMask = 2147483647; 250 | files = ( 251 | ); 252 | runOnlyForDeploymentPostprocessing = 0; 253 | }; 254 | /* End PBXResourcesBuildPhase section */ 255 | 256 | /* Begin PBXSourcesBuildPhase section */ 257 | D8A72BDB257FADCD00D8F796 /* Sources */ = { 258 | isa = PBXSourcesBuildPhase; 259 | buildActionMask = 2147483647; 260 | files = ( 261 | D8A72BE7257FADCD00D8F796 /* ViewController.swift in Sources */, 262 | D8A72BE3257FADCD00D8F796 /* AppDelegate.swift in Sources */, 263 | D8A72BE5257FADCD00D8F796 /* SceneDelegate.swift in Sources */, 264 | ); 265 | runOnlyForDeploymentPostprocessing = 0; 266 | }; 267 | D8A72BF1257FADCD00D8F796 /* Sources */ = { 268 | isa = PBXSourcesBuildPhase; 269 | buildActionMask = 2147483647; 270 | files = ( 271 | D8A72BFA257FADCD00D8F796 /* ZXYWebViewTests.swift in Sources */, 272 | ); 273 | runOnlyForDeploymentPostprocessing = 0; 274 | }; 275 | D8A72BFC257FADCE00D8F796 /* Sources */ = { 276 | isa = PBXSourcesBuildPhase; 277 | buildActionMask = 2147483647; 278 | files = ( 279 | D8A72C05257FADCE00D8F796 /* ZXYWebViewUITests.swift in Sources */, 280 | ); 281 | runOnlyForDeploymentPostprocessing = 0; 282 | }; 283 | /* End PBXSourcesBuildPhase section */ 284 | 285 | /* Begin PBXTargetDependency section */ 286 | D8A72BF7257FADCD00D8F796 /* PBXTargetDependency */ = { 287 | isa = PBXTargetDependency; 288 | target = D8A72BDE257FADCD00D8F796 /* ZXYWebView */; 289 | targetProxy = D8A72BF6257FADCD00D8F796 /* PBXContainerItemProxy */; 290 | }; 291 | D8A72C02257FADCE00D8F796 /* PBXTargetDependency */ = { 292 | isa = PBXTargetDependency; 293 | target = D8A72BDE257FADCD00D8F796 /* ZXYWebView */; 294 | targetProxy = D8A72C01257FADCE00D8F796 /* PBXContainerItemProxy */; 295 | }; 296 | /* End PBXTargetDependency section */ 297 | 298 | /* Begin PBXVariantGroup section */ 299 | D8A72BE8257FADCD00D8F796 /* Main.storyboard */ = { 300 | isa = PBXVariantGroup; 301 | children = ( 302 | D8A72BE9257FADCD00D8F796 /* Base */, 303 | ); 304 | name = Main.storyboard; 305 | sourceTree = ""; 306 | }; 307 | D8A72BED257FADCD00D8F796 /* LaunchScreen.storyboard */ = { 308 | isa = PBXVariantGroup; 309 | children = ( 310 | D8A72BEE257FADCD00D8F796 /* Base */, 311 | ); 312 | name = LaunchScreen.storyboard; 313 | sourceTree = ""; 314 | }; 315 | /* End PBXVariantGroup section */ 316 | 317 | /* Begin XCBuildConfiguration section */ 318 | D8A72C07257FADCE00D8F796 /* Debug */ = { 319 | isa = XCBuildConfiguration; 320 | buildSettings = { 321 | ALWAYS_SEARCH_USER_PATHS = NO; 322 | CLANG_ANALYZER_NONNULL = YES; 323 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 324 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 325 | CLANG_CXX_LIBRARY = "libc++"; 326 | CLANG_ENABLE_MODULES = YES; 327 | CLANG_ENABLE_OBJC_ARC = YES; 328 | CLANG_ENABLE_OBJC_WEAK = YES; 329 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 330 | CLANG_WARN_BOOL_CONVERSION = YES; 331 | CLANG_WARN_COMMA = YES; 332 | CLANG_WARN_CONSTANT_CONVERSION = YES; 333 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 334 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 335 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 336 | CLANG_WARN_EMPTY_BODY = YES; 337 | CLANG_WARN_ENUM_CONVERSION = YES; 338 | CLANG_WARN_INFINITE_RECURSION = YES; 339 | CLANG_WARN_INT_CONVERSION = YES; 340 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 341 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 342 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 343 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 344 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 345 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 346 | CLANG_WARN_STRICT_PROTOTYPES = YES; 347 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 348 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 349 | CLANG_WARN_UNREACHABLE_CODE = YES; 350 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 351 | COPY_PHASE_STRIP = NO; 352 | DEBUG_INFORMATION_FORMAT = dwarf; 353 | ENABLE_STRICT_OBJC_MSGSEND = YES; 354 | ENABLE_TESTABILITY = YES; 355 | GCC_C_LANGUAGE_STANDARD = gnu11; 356 | GCC_DYNAMIC_NO_PIC = NO; 357 | GCC_NO_COMMON_BLOCKS = YES; 358 | GCC_OPTIMIZATION_LEVEL = 0; 359 | GCC_PREPROCESSOR_DEFINITIONS = ( 360 | "DEBUG=1", 361 | "$(inherited)", 362 | ); 363 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 364 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 365 | GCC_WARN_UNDECLARED_SELECTOR = YES; 366 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 367 | GCC_WARN_UNUSED_FUNCTION = YES; 368 | GCC_WARN_UNUSED_VARIABLE = YES; 369 | IPHONEOS_DEPLOYMENT_TARGET = 14.2; 370 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 371 | MTL_FAST_MATH = YES; 372 | ONLY_ACTIVE_ARCH = YES; 373 | SDKROOT = iphoneos; 374 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 375 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 376 | }; 377 | name = Debug; 378 | }; 379 | D8A72C08257FADCE00D8F796 /* Release */ = { 380 | isa = XCBuildConfiguration; 381 | buildSettings = { 382 | ALWAYS_SEARCH_USER_PATHS = NO; 383 | CLANG_ANALYZER_NONNULL = YES; 384 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 385 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 386 | CLANG_CXX_LIBRARY = "libc++"; 387 | CLANG_ENABLE_MODULES = YES; 388 | CLANG_ENABLE_OBJC_ARC = YES; 389 | CLANG_ENABLE_OBJC_WEAK = YES; 390 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 391 | CLANG_WARN_BOOL_CONVERSION = YES; 392 | CLANG_WARN_COMMA = YES; 393 | CLANG_WARN_CONSTANT_CONVERSION = YES; 394 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 395 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 396 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 397 | CLANG_WARN_EMPTY_BODY = YES; 398 | CLANG_WARN_ENUM_CONVERSION = YES; 399 | CLANG_WARN_INFINITE_RECURSION = YES; 400 | CLANG_WARN_INT_CONVERSION = YES; 401 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 402 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 403 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 404 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 405 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 406 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 407 | CLANG_WARN_STRICT_PROTOTYPES = YES; 408 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 409 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 410 | CLANG_WARN_UNREACHABLE_CODE = YES; 411 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 412 | COPY_PHASE_STRIP = NO; 413 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 414 | ENABLE_NS_ASSERTIONS = NO; 415 | ENABLE_STRICT_OBJC_MSGSEND = YES; 416 | GCC_C_LANGUAGE_STANDARD = gnu11; 417 | GCC_NO_COMMON_BLOCKS = YES; 418 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 419 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 420 | GCC_WARN_UNDECLARED_SELECTOR = YES; 421 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 422 | GCC_WARN_UNUSED_FUNCTION = YES; 423 | GCC_WARN_UNUSED_VARIABLE = YES; 424 | IPHONEOS_DEPLOYMENT_TARGET = 14.2; 425 | MTL_ENABLE_DEBUG_INFO = NO; 426 | MTL_FAST_MATH = YES; 427 | SDKROOT = iphoneos; 428 | SWIFT_COMPILATION_MODE = wholemodule; 429 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 430 | VALIDATE_PRODUCT = YES; 431 | }; 432 | name = Release; 433 | }; 434 | D8A72C0A257FADCE00D8F796 /* Debug */ = { 435 | isa = XCBuildConfiguration; 436 | buildSettings = { 437 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 438 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 439 | CODE_SIGN_STYLE = Automatic; 440 | INFOPLIST_FILE = ZXYWebView/Info.plist; 441 | LD_RUNPATH_SEARCH_PATHS = ( 442 | "$(inherited)", 443 | "@executable_path/Frameworks", 444 | ); 445 | PRODUCT_BUNDLE_IDENTIFIER = zxy.ZXYWebView; 446 | PRODUCT_NAME = "$(TARGET_NAME)"; 447 | SWIFT_VERSION = 5.0; 448 | TARGETED_DEVICE_FAMILY = "1,2"; 449 | }; 450 | name = Debug; 451 | }; 452 | D8A72C0B257FADCE00D8F796 /* Release */ = { 453 | isa = XCBuildConfiguration; 454 | buildSettings = { 455 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 456 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 457 | CODE_SIGN_STYLE = Automatic; 458 | INFOPLIST_FILE = ZXYWebView/Info.plist; 459 | LD_RUNPATH_SEARCH_PATHS = ( 460 | "$(inherited)", 461 | "@executable_path/Frameworks", 462 | ); 463 | PRODUCT_BUNDLE_IDENTIFIER = zxy.ZXYWebView; 464 | PRODUCT_NAME = "$(TARGET_NAME)"; 465 | SWIFT_VERSION = 5.0; 466 | TARGETED_DEVICE_FAMILY = "1,2"; 467 | }; 468 | name = Release; 469 | }; 470 | D8A72C0D257FADCE00D8F796 /* Debug */ = { 471 | isa = XCBuildConfiguration; 472 | buildSettings = { 473 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 474 | BUNDLE_LOADER = "$(TEST_HOST)"; 475 | CODE_SIGN_STYLE = Automatic; 476 | INFOPLIST_FILE = ZXYWebViewTests/Info.plist; 477 | IPHONEOS_DEPLOYMENT_TARGET = 14.2; 478 | LD_RUNPATH_SEARCH_PATHS = ( 479 | "$(inherited)", 480 | "@executable_path/Frameworks", 481 | "@loader_path/Frameworks", 482 | ); 483 | PRODUCT_BUNDLE_IDENTIFIER = zxy.ZXYWebViewTests; 484 | PRODUCT_NAME = "$(TARGET_NAME)"; 485 | SWIFT_VERSION = 5.0; 486 | TARGETED_DEVICE_FAMILY = "1,2"; 487 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ZXYWebView.app/ZXYWebView"; 488 | }; 489 | name = Debug; 490 | }; 491 | D8A72C0E257FADCE00D8F796 /* Release */ = { 492 | isa = XCBuildConfiguration; 493 | buildSettings = { 494 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 495 | BUNDLE_LOADER = "$(TEST_HOST)"; 496 | CODE_SIGN_STYLE = Automatic; 497 | INFOPLIST_FILE = ZXYWebViewTests/Info.plist; 498 | IPHONEOS_DEPLOYMENT_TARGET = 14.2; 499 | LD_RUNPATH_SEARCH_PATHS = ( 500 | "$(inherited)", 501 | "@executable_path/Frameworks", 502 | "@loader_path/Frameworks", 503 | ); 504 | PRODUCT_BUNDLE_IDENTIFIER = zxy.ZXYWebViewTests; 505 | PRODUCT_NAME = "$(TARGET_NAME)"; 506 | SWIFT_VERSION = 5.0; 507 | TARGETED_DEVICE_FAMILY = "1,2"; 508 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ZXYWebView.app/ZXYWebView"; 509 | }; 510 | name = Release; 511 | }; 512 | D8A72C10257FADCE00D8F796 /* Debug */ = { 513 | isa = XCBuildConfiguration; 514 | buildSettings = { 515 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 516 | CODE_SIGN_STYLE = Automatic; 517 | INFOPLIST_FILE = ZXYWebViewUITests/Info.plist; 518 | LD_RUNPATH_SEARCH_PATHS = ( 519 | "$(inherited)", 520 | "@executable_path/Frameworks", 521 | "@loader_path/Frameworks", 522 | ); 523 | PRODUCT_BUNDLE_IDENTIFIER = zxy.ZXYWebViewUITests; 524 | PRODUCT_NAME = "$(TARGET_NAME)"; 525 | SWIFT_VERSION = 5.0; 526 | TARGETED_DEVICE_FAMILY = "1,2"; 527 | TEST_TARGET_NAME = ZXYWebView; 528 | }; 529 | name = Debug; 530 | }; 531 | D8A72C11257FADCE00D8F796 /* Release */ = { 532 | isa = XCBuildConfiguration; 533 | buildSettings = { 534 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 535 | CODE_SIGN_STYLE = Automatic; 536 | INFOPLIST_FILE = ZXYWebViewUITests/Info.plist; 537 | LD_RUNPATH_SEARCH_PATHS = ( 538 | "$(inherited)", 539 | "@executable_path/Frameworks", 540 | "@loader_path/Frameworks", 541 | ); 542 | PRODUCT_BUNDLE_IDENTIFIER = zxy.ZXYWebViewUITests; 543 | PRODUCT_NAME = "$(TARGET_NAME)"; 544 | SWIFT_VERSION = 5.0; 545 | TARGETED_DEVICE_FAMILY = "1,2"; 546 | TEST_TARGET_NAME = ZXYWebView; 547 | }; 548 | name = Release; 549 | }; 550 | /* End XCBuildConfiguration section */ 551 | 552 | /* Begin XCConfigurationList section */ 553 | D8A72BDA257FADCC00D8F796 /* Build configuration list for PBXProject "ZXYWebView" */ = { 554 | isa = XCConfigurationList; 555 | buildConfigurations = ( 556 | D8A72C07257FADCE00D8F796 /* Debug */, 557 | D8A72C08257FADCE00D8F796 /* Release */, 558 | ); 559 | defaultConfigurationIsVisible = 0; 560 | defaultConfigurationName = Release; 561 | }; 562 | D8A72C09257FADCE00D8F796 /* Build configuration list for PBXNativeTarget "ZXYWebView" */ = { 563 | isa = XCConfigurationList; 564 | buildConfigurations = ( 565 | D8A72C0A257FADCE00D8F796 /* Debug */, 566 | D8A72C0B257FADCE00D8F796 /* Release */, 567 | ); 568 | defaultConfigurationIsVisible = 0; 569 | defaultConfigurationName = Release; 570 | }; 571 | D8A72C0C257FADCE00D8F796 /* Build configuration list for PBXNativeTarget "ZXYWebViewTests" */ = { 572 | isa = XCConfigurationList; 573 | buildConfigurations = ( 574 | D8A72C0D257FADCE00D8F796 /* Debug */, 575 | D8A72C0E257FADCE00D8F796 /* Release */, 576 | ); 577 | defaultConfigurationIsVisible = 0; 578 | defaultConfigurationName = Release; 579 | }; 580 | D8A72C0F257FADCE00D8F796 /* Build configuration list for PBXNativeTarget "ZXYWebViewUITests" */ = { 581 | isa = XCConfigurationList; 582 | buildConfigurations = ( 583 | D8A72C10257FADCE00D8F796 /* Debug */, 584 | D8A72C11257FADCE00D8F796 /* Release */, 585 | ); 586 | defaultConfigurationIsVisible = 0; 587 | defaultConfigurationName = Release; 588 | }; 589 | /* End XCConfigurationList section */ 590 | }; 591 | rootObject = D8A72BD7257FADCC00D8F796 /* Project object */; 592 | } 593 | -------------------------------------------------------------------------------- /ZXYWebView.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ZXYWebView.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ZXYWebView.xcodeproj/xcuserdata/zhangxiaoyang.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | ZXYWebView.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /ZXYWebView/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // ZXYWebView 4 | // 5 | // Created by 张小杨 on 2020/12/8. 6 | // 7 | 8 | import UIKit 9 | 10 | @main 11 | class AppDelegate: UIResponder, UIApplicationDelegate { 12 | 13 | 14 | 15 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 16 | // Override point for customization after application launch. 17 | return true 18 | } 19 | 20 | // MARK: UISceneSession Lifecycle 21 | 22 | func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { 23 | // Called when a new scene session is being created. 24 | // Use this method to select a configuration to create the new scene with. 25 | return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) 26 | } 27 | 28 | func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { 29 | // Called when the user discards a scene session. 30 | // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. 31 | // Use this method to release any resources that were specific to the discarded scenes, as they will not return. 32 | } 33 | 34 | 35 | } 36 | 37 | -------------------------------------------------------------------------------- /ZXYWebView/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ZXYWebView/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "scale" : "2x", 6 | "size" : "20x20" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "scale" : "3x", 11 | "size" : "20x20" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "scale" : "2x", 16 | "size" : "29x29" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "scale" : "3x", 21 | "size" : "29x29" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "scale" : "2x", 26 | "size" : "40x40" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "scale" : "3x", 31 | "size" : "40x40" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "scale" : "2x", 36 | "size" : "60x60" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "scale" : "3x", 41 | "size" : "60x60" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "scale" : "1x", 46 | "size" : "20x20" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "scale" : "2x", 51 | "size" : "20x20" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "scale" : "1x", 56 | "size" : "29x29" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "scale" : "2x", 61 | "size" : "29x29" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "scale" : "1x", 66 | "size" : "40x40" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "scale" : "2x", 71 | "size" : "40x40" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "scale" : "1x", 76 | "size" : "76x76" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "scale" : "2x", 81 | "size" : "76x76" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "scale" : "2x", 86 | "size" : "83.5x83.5" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "scale" : "1x", 91 | "size" : "1024x1024" 92 | } 93 | ], 94 | "info" : { 95 | "author" : "xcode", 96 | "version" : 1 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /ZXYWebView/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /ZXYWebView/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /ZXYWebView/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /ZXYWebView/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UIApplicationSceneManifest 24 | 25 | UIApplicationSupportsMultipleScenes 26 | 27 | UISceneConfigurations 28 | 29 | UIWindowSceneSessionRoleApplication 30 | 31 | 32 | UISceneConfigurationName 33 | Default Configuration 34 | UISceneDelegateClassName 35 | $(PRODUCT_MODULE_NAME).SceneDelegate 36 | UISceneStoryboardFile 37 | Main 38 | 39 | 40 | 41 | 42 | UIApplicationSupportsIndirectInputEvents 43 | 44 | UILaunchStoryboardName 45 | LaunchScreen 46 | UIMainStoryboardFile 47 | Main 48 | UIRequiredDeviceCapabilities 49 | 50 | armv7 51 | 52 | UISupportedInterfaceOrientations 53 | 54 | UIInterfaceOrientationPortrait 55 | UIInterfaceOrientationLandscapeLeft 56 | UIInterfaceOrientationLandscapeRight 57 | 58 | UISupportedInterfaceOrientations~ipad 59 | 60 | UIInterfaceOrientationPortrait 61 | UIInterfaceOrientationPortraitUpsideDown 62 | UIInterfaceOrientationLandscapeLeft 63 | UIInterfaceOrientationLandscapeRight 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /ZXYWebView/SceneDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SceneDelegate.swift 3 | // ZXYWebView 4 | // 5 | // Created by 张小杨 on 2020/12/8. 6 | // 7 | 8 | import UIKit 9 | 10 | class SceneDelegate: UIResponder, UIWindowSceneDelegate { 11 | 12 | var window: UIWindow? 13 | 14 | 15 | func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { 16 | // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. 17 | // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. 18 | // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). 19 | guard let _ = (scene as? UIWindowScene) else { return } 20 | } 21 | 22 | func sceneDidDisconnect(_ scene: UIScene) { 23 | // Called as the scene is being released by the system. 24 | // This occurs shortly after the scene enters the background, or when its session is discarded. 25 | // Release any resources associated with this scene that can be re-created the next time the scene connects. 26 | // The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead). 27 | } 28 | 29 | func sceneDidBecomeActive(_ scene: UIScene) { 30 | // Called when the scene has moved from an inactive state to an active state. 31 | // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. 32 | } 33 | 34 | func sceneWillResignActive(_ scene: UIScene) { 35 | // Called when the scene will move from an active state to an inactive state. 36 | // This may occur due to temporary interruptions (ex. an incoming phone call). 37 | } 38 | 39 | func sceneWillEnterForeground(_ scene: UIScene) { 40 | // Called as the scene transitions from the background to the foreground. 41 | // Use this method to undo the changes made on entering the background. 42 | } 43 | 44 | func sceneDidEnterBackground(_ scene: UIScene) { 45 | // Called as the scene transitions from the foreground to the background. 46 | // Use this method to save data, release shared resources, and store enough scene-specific state information 47 | // to restore the scene back to its current state. 48 | } 49 | 50 | 51 | } 52 | 53 | -------------------------------------------------------------------------------- /ZXYWebView/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // ZXYWebView 4 | // 5 | // Created by 张小杨 on 2020/12/8. 6 | // 7 | 8 | import UIKit 9 | 10 | class ViewController: UIViewController { 11 | 12 | override func viewDidLoad() { 13 | super.viewDidLoad() 14 | // Do any additional setup after loading the view. 15 | } 16 | 17 | 18 | } 19 | 20 | -------------------------------------------------------------------------------- /ZXYWebView/WKWebView/ZXYLocalWebViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ZXYLocalWebViewController.swift 3 | // ZXYWKWebView 4 | // 5 | // Created by 张小杨 on 2020/12/6. 6 | // 7 | 8 | import UIKit 9 | import WebKit 10 | 11 | public class ZXYLocalWebViewController: ZXYWebViewController { 12 | 13 | var dataId: Int = 0 14 | #warning("枚举类型,代表消息的类型,根据枚举类型去加载相应的js,css,html等") 15 | var newsType: NewsTypeEnum = .unknown 16 | var shareURL: String? 17 | var isShowBroker: Bool = true 18 | var newsJson: String = "" 19 | var noticesEntity: NewsNoticesEntity? 20 | 21 | override public func viewDidLoad() { 22 | super.viewDidLoad() 23 | self.setNavBar() 24 | 25 | loadNewsWebFiles() 26 | loadNewsJson() 27 | 28 | } 29 | 30 | public func set(dataId: Int, type: NewsTypeEnum, isShowBroker: Bool = false, shareURL: String? = nil) { 31 | self.dataId = dataId 32 | self.newsType = type 33 | self.isShowBroker = isShowBroker 34 | self.shareURL = shareURL 35 | } 36 | 37 | func setNavBar() { 38 | self.navBar.removeFromSuperview() 39 | self.bl_naviBarHidden = false 40 | self.isHideTitle = true 41 | self.title = newsType.name 42 | 43 | } 44 | 45 | @objc private func onClickShareItem() { 46 | var shareURL: String? 47 | switch newsType { 48 | 49 | case .IBPolicy: 50 | #warning("使用自己的请求连接") 51 | shareURL = ZXYApi.h5.brokerIBPolicyShareURL(id: dataId) 52 | self.showShareView(shareURL: shareURL, isBannerOrTopic: false) 53 | 54 | case .bannerDetail: 55 | shareURL = self.shareURL 56 | self.showShareView(shareURL: shareURL, isBannerOrTopic: true) 57 | 58 | case .topic: 59 | shareURL = ZXYApi.h5.topicShareAddress(dataId) 60 | self.showShareView(shareURL: shareURL, isBannerOrTopic: true) 61 | 62 | default: 63 | break 64 | } 65 | 66 | 67 | } 68 | 69 | func showShareView(shareURL: String?, isBannerOrTopic: Bool) { 70 | guard let newsEntity = self.noticesEntity else {return} 71 | 72 | 73 | } 74 | 75 | func loadNewsWebFiles() { 76 | let bundle = Bundle(for: ZXYLocalWebViewController.self) 77 | var htmlName: String? 78 | switch newsType { 79 | case .dealerComments, .dealerActivity, .dealerAnnouncement: 80 | htmlName = "dealerNews" 81 | 82 | default: 83 | htmlName = "industryNews" 84 | } 85 | guard let path = bundle.path(forResource: htmlName, ofType: "html") else { 86 | return 87 | } 88 | 89 | DispatchQueue.global().async { 90 | guard let htmlString = try? String(contentsOfFile: path, encoding: String.Encoding.utf8) else { 91 | return 92 | } 93 | DispatchQueue.main.async { 94 | let baseURL = URL(fileURLWithPath: path, isDirectory: false) 95 | self.webView?.loadHTMLString(htmlString, baseURL: baseURL) 96 | } 97 | } 98 | } 99 | 100 | public override func loadNewsJSMethod() { 101 | super.loadNewsJSMethod() 102 | let traderInfoCard = self.isShowBroker ? 1 : 0 103 | #warning("相应的调用JS方法") 104 | self.callJSMethod(name: "loadNewsJson(\(newsJson), \(traderInfoCard))") 105 | } 106 | } 107 | 108 | extension ZXYLocalWebViewController { 109 | 110 | func loadNewsJson() { 111 | let request = BLRequestEntity() 112 | 113 | switch newsType { 114 | #warning("使用自己的请求连接") 115 | case .brokerIntroduction: 116 | request.api = ZXYApi.broker.BrokerIntroductionApi 117 | request.params = ["brokerId": dataId, "type": 1, "contentType": 1] 118 | 119 | default: 120 | request.api = ZXYApi.home.HomeNewsDetailApi 121 | request.params = ["id": dataId] 122 | } 123 | 124 | ZXYHttpManager.shared.get(request: request, success: { (response) in 125 | guard response.code == HttpRequestResult.success, let newsData = response.bodyMessage, !newsData.isEmpty else { 126 | self.view.addPlaceholder(type: .noData) 127 | return 128 | } 129 | 130 | self.view.removePlaceholder() 131 | switch self.newsType { 132 | case .coolForeignCurrency: 133 | self.noticesEntity = NewsNoticesEntity.deserialize(from: newsData, designatedPath: "NewsDetail") 134 | 135 | case .IBPolicy, .bannerDetail, .brokerIntroduction,.topic: 136 | self.noticesEntity = NewsNoticesEntity.deserialize(from: newsData) 137 | 138 | default: 139 | self.noticesEntity = NewsNoticesEntity.deserialize(from: newsData, designatedPath: "Notices") 140 | } 141 | 142 | self.newsJson = newsData 143 | if self.isFinished { 144 | let traderInfoCard = self.isShowBroker ? 1 : 0 145 | self.callJSMethod(name: "loadNewsJson(\(newsData), \(traderInfoCard), \(self.isShowSourceRegulator))") 146 | } 147 | 148 | }, failure: { (error) in 149 | self.showToast(message: error) 150 | self.view.addPlaceholder(type: .webviewLoadFail, handler: {[weak self] in 151 | self?.loadNewsJson() 152 | }) 153 | }, completed: { 154 | 155 | }) 156 | } 157 | } 158 | 159 | 160 | class NewsNoticesEntity: ZXYBaseEntity { 161 | var id: Int = 0 162 | var newsId: Int = 0 163 | var noticeId: Int = 0 164 | var category: Int = 0 165 | var brokerId: Int = 0 166 | var title: String? 167 | var TitleImg: String? 168 | var titleImgR: String? 169 | var titleImgS: String? 170 | var summary: String? 171 | } 172 | -------------------------------------------------------------------------------- /ZXYWebView/WKWebView/ZXYWebEntity.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ZXYWebEntity.swift 3 | // ZXYWKWebView 4 | // 5 | // Created by 张小杨 on 2020/12/6. 6 | // 7 | 8 | /// 导航栏按钮类型 9 | /// 10 | /// - share: 分享 11 | /// - link: 链接 12 | /// - goback: 返回 13 | /// - collection: 收藏 14 | /// - select: 下拉列表 15 | 16 | open class ZXYBaseEntity: NSObject, HandyJSON { 17 | required public override init() {} 18 | } 19 | 20 | public enum WebHeaderBtnTypeEnum: Int, HandyJSONEnum{ 21 | case share = 1 22 | case link = 2 23 | case goback = 3 24 | case collection = 4 25 | case select = 5 26 | } 27 | 28 | public class WebHeaderDataEntity: ZXYBaseEntity{ 29 | var backgroundColor: String = "#FFFFFF" // 背景颜色 30 | var title: WebNavTitleEntity? // 标题 31 | var leftIcon, rightIcon: [WebNavButtonEntity]? // 左右两边按钮数组 32 | required init() {} 33 | } 34 | 35 | // MARK: - 标题 36 | public class WebNavTitleEntity: ZXYBaseEntity{ 37 | var content: String = "" 38 | var color: String = "" 39 | var isTwoLine: Bool = false // 是否是两行文字 40 | 41 | required init() {} 42 | } 43 | 44 | // MARK: - 按钮 45 | public class WebNavButtonEntity: ZXYBaseEntity{ 46 | 47 | var type: WebHeaderBtnTypeEnum = .share 48 | var goback: WebNavButtonTypeGobackEntity? 49 | var share: WebNavButtonTypeShareEntity? 50 | var link: WebNavButtonTypeLinkEntity? 51 | var select: WebNavButtonTypeSelectEntity? 52 | 53 | var realTypeModel: WebNavButtonTypeBaseEntity? { 54 | switch type { 55 | case .goback: 56 | return goback 57 | case .share: 58 | return share 59 | case .link: 60 | return link 61 | case .select: 62 | return select 63 | case .collection: 64 | return nil 65 | } 66 | } 67 | 68 | var content: String { 69 | return realTypeModel?.content ?? "" 70 | } 71 | var icon: String { 72 | return realTypeModel?.icon ?? "" 73 | } 74 | var color: String { 75 | return realTypeModel?.color ?? "" 76 | } 77 | 78 | required init() {} 79 | } 80 | 81 | // MARK: - 按钮各个type基类,包含按钮外观 82 | public class WebNavButtonTypeBaseEntity: ZXYBaseEntity{ 83 | var content: String = "" 84 | var icon: String = "" 85 | var color: String = "" 86 | } 87 | 88 | 89 | // MARK: - 按钮,返回类型 90 | public class WebNavButtonTypeGobackEntity: WebNavButtonTypeBaseEntity{ 91 | 92 | } 93 | 94 | // MARK: - 按钮,分享类型 95 | public class WebNavButtonTypeShareEntity: WebNavButtonTypeBaseEntity{ 96 | 97 | var shareModel: WebNavButtonTypeShareShareModel? 98 | 99 | required init() {} 100 | } 101 | // 分享模型 102 | public class WebNavButtonTypeShareShareModel: ZXYBaseEntity{ 103 | 104 | var type: WebShareModelTypeEnum = .link 105 | var title: String = "" 106 | var content: String = "" 107 | var imgURL: String = "" 108 | var shareURL: String = "" 109 | 110 | required init() {} 111 | } 112 | 113 | // MARK: - 分享的类型 114 | public enum WebShareModelTypeEnum: Int, HandyJSONEnum{ 115 | case img = 1 // 分享图片 116 | case link = 2 // 分享链接 117 | } 118 | 119 | // MARK: - 按钮,链接类型 120 | public class WebNavButtonTypeLinkEntity: WebNavButtonTypeBaseEntity{ 121 | 122 | var href: String = "" 123 | required init() {} 124 | } 125 | 126 | // MARK: - 按钮,下拉列表类型 127 | public class WebNavButtonTypeSelectEntity: WebNavButtonTypeBaseEntity{ 128 | 129 | var itemBackground: String = "" // 列表的背景颜色 130 | var itemSelection: String = "" // 列表选中背景颜色 131 | var itemColor: String = "" // 列表子元素的文字颜色 132 | var defaultId: String = "" 133 | var item: [WebNavSelectItemModel]? 134 | required init() {} 135 | } 136 | 137 | // MARK: - 下拉列表项 138 | public class WebNavSelectItemModel: ZXYBaseEntity{ 139 | 140 | var content: String = "" 141 | var icon: String = "" 142 | var method: String = "" // 回调的方法 143 | var id: String = "" // 子元素的id 回调方法里面传回 144 | required init() {} 145 | } 146 | 147 | // MARK: - 按钮,收藏类型 148 | public class WebNavButtonTypeCollectionEntity: WebNavButtonTypeBaseEntity{ 149 | 150 | } 151 | -------------------------------------------------------------------------------- /ZXYWebView/WKWebView/ZXYWebNavigationBar.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ZXYWebNavigationBar.swift 3 | // ZXYWKWebView 4 | // 5 | // Created by 张小杨 on 2020/12/6. 6 | // 7 | 8 | import UIKit 9 | 10 | class ZXYWebNavigationBar: UIView { 11 | 12 | fileprivate var currentEntity: WebHeaderDataEntity? 13 | var btnClickHandle: ((WebNavButtonEntity)->())? 14 | 15 | lazy var titleLabel: UILabel = { 16 | let label = UILabel() 17 | label.font = UIFont.boldSystemFont(ofSize: 18) 18 | label.textColor = UIColor.black 19 | label.textAlignment = .center 20 | return label 21 | }() 22 | 23 | lazy var contentView: UIView = { 24 | let view = UIView() 25 | view.backgroundColor = UIColor.clear 26 | return view 27 | }() 28 | 29 | lazy var backButton: ZXYWebNavButton = { 30 | let btn = ZXYWebNavButton() 31 | // btn.setImage(R.image.assistant_imageBroswerBack(), for: .normal) 32 | btn.addTarget(self, action: #selector(onBackButtonClick), for: .touchUpInside) 33 | btn.backgroundColor = UIColor.white 34 | return btn 35 | }() 36 | 37 | override init(frame: CGRect) { 38 | super.init(frame: frame) 39 | self.setupSubviews() 40 | } 41 | 42 | required init?(coder aDecoder: NSCoder) { 43 | fatalError("init(coder:) has not been implemented") 44 | } 45 | 46 | private func setupSubviews() { // 47 | self.backgroundColor = UIColor.white 48 | #warning("使用SnipKit第三方") 49 | self.addSubview(contentView) 50 | contentView.snp.makeConstraints { (make) in 51 | make.left.right.bottom.equalToSuperview() 52 | make.top.equalToSuperview().offset(kSafeAreaTopInset) 53 | } 54 | contentView.addSubview(titleLabel) 55 | titleLabel.snp.makeConstraints{ (make) in 56 | make.edges.equalToSuperview() 57 | } 58 | contentView.addSubview(backButton) 59 | backButton.snp.makeConstraints { (make) in 60 | make.left.equalToSuperview().offset(20) 61 | make.height.equalTo(20) 62 | make.centerY.equalToSuperview() 63 | } 64 | } 65 | } 66 | 67 | 68 | // MARK: - interface 69 | extension ZXYWebNavigationBar { 70 | 71 | func updateContent(with navEntity: WebHeaderDataEntity, isHideTitle: Bool = false) { 72 | 73 | currentEntity = navEntity 74 | 75 | // ------------- 背景颜色 ---------------- // 76 | if let backgroundColor = UIColor.hexColor(hexString: navEntity.backgroundColor) { 77 | self.backgroundColor = backgroundColor 78 | } else { 79 | self.backgroundColor = UIColor.white 80 | } 81 | 82 | // ---------------- 标题 ----------------- // 83 | // let isTwoLine = titleEntity.isTwoLine 84 | if let titleEntity = navEntity.title { 85 | if isHideTitle {return} 86 | self.titleLabel.text = titleEntity.content 87 | if let titleColor = UIColor.hexColor(hexString: titleEntity.color) { 88 | self.titleLabel.textColor = titleColor 89 | } 90 | } 91 | 92 | // ------------- 左按钮 ---------------- // 93 | for subView in contentView.subviews { 94 | if let btn = subView as? UIButton { 95 | btn.removeFromSuperview() 96 | } 97 | } 98 | 99 | if let leftBtns = navEntity.leftIcon { 100 | 101 | var leftView: UIView = self 102 | for (index, leftEntity) in leftBtns.enumerated() { 103 | let btn = ZXYWebNavButton() 104 | btn.setTitle(leftEntity.content, for: .normal) 105 | btn.sd_setImage(with: URL(string: leftEntity.icon), for: .normal, placeholderImage: R.image.assistant_imageBroswerBack()) 106 | btn.imageEdgeInsets = UIEdgeInsets(top: 12, left: 0, bottom: 12, right: 0) 107 | contentView.addSubview(btn) 108 | let isOnlyIcon = (leftEntity.content.count <= 0 && leftEntity.icon.count > 0) 109 | 110 | if isOnlyIcon { 111 | btn.contentHorizontalAlignment = .center 112 | } else { 113 | btn.contentHorizontalAlignment = .left 114 | } 115 | 116 | if index == 0 { 117 | btn.snp.makeConstraints { (make) in 118 | if isOnlyIcon { 119 | make.width.equalTo(44) 120 | } 121 | make.left.equalTo(leftView).offset(10) 122 | make.height.equalTo(44) 123 | make.centerY.equalToSuperview() 124 | } 125 | }else { 126 | btn.snp.makeConstraints { (make) in 127 | if isOnlyIcon { 128 | make.width.equalTo(44) 129 | } 130 | make.left.equalTo(leftView.snp.right).offset(10) 131 | make.height.equalTo(44) 132 | make.centerY.equalToSuperview() 133 | } 134 | } 135 | leftView = btn 136 | btn.entity = leftEntity 137 | btn.addTarget(self, action: #selector(btnClick(_:)), for: .touchUpInside) 138 | } 139 | } 140 | 141 | // ------------- 右按钮 ---------------- // 142 | if let rightBtns = navEntity.rightIcon { 143 | var rightView: UIView = self 144 | for (index, rightEntity) in rightBtns.enumerated() { 145 | let btn = ZXYWebNavButton() 146 | btn.setTitle(rightEntity.content, for: .normal) 147 | if rightEntity.type == .share { 148 | btn.setImage(R.image.assistant_H5_shareIcon(), for: .normal) 149 | }else { 150 | btn.sd_setImage(with: URL(string: rightEntity.icon), for: .normal, completed: nil) 151 | } 152 | contentView.addSubview(btn) 153 | let isOnlyIcon = (rightEntity.content.count <= 0 && rightEntity.icon.count > 0) 154 | if isOnlyIcon { 155 | btn.contentHorizontalAlignment = .center 156 | } else { 157 | btn.contentHorizontalAlignment = .right 158 | } 159 | if index == 0{ 160 | btn.snp.makeConstraints { (make) in 161 | if isOnlyIcon { 162 | make.width.equalTo(44) 163 | } 164 | make.right.equalTo(rightView).offset(-10) 165 | make.height.equalTo(44) 166 | make.centerY.equalToSuperview() 167 | } 168 | }else { 169 | btn.snp.makeConstraints { (make) in 170 | if isOnlyIcon { 171 | make.width.equalTo(44) 172 | } 173 | make.right.equalTo(rightView.snp.left).offset(-10) 174 | 175 | make.height.equalTo(44) 176 | make.centerY.equalToSuperview() 177 | } 178 | } 179 | rightView = btn 180 | btn.entity = rightEntity 181 | btn.addTarget(self, action: #selector(btnClick(_:)), for: .touchUpInside) 182 | } 183 | } 184 | } 185 | } 186 | 187 | 188 | // MARK: - action 189 | extension ZXYWebNavigationBar { 190 | 191 | @objc func btnClick(_ sender: ZXYWebNavButton) { 192 | guard let entity = sender.entity else { 193 | return 194 | } 195 | btnClickHandle?(entity) 196 | } 197 | 198 | @objc func onBackButtonClick() { 199 | let entity = WebNavButtonEntity() 200 | entity.type = .goback 201 | btnClickHandle?(entity) 202 | } 203 | } 204 | 205 | 206 | class ZXYWebNavButton: UIButton { 207 | var entity: WebNavButtonEntity? 208 | 209 | override init(frame: CGRect) { 210 | super.init(frame: frame) 211 | self.titleLabel?.font = UIFont.boldSystemFont(ofSize: 16) 212 | self.setTitleColor(UIColor.black, for: .normal) 213 | self.imageView?.contentMode = .scaleAspectFit 214 | } 215 | 216 | required init?(coder aDecoder: NSCoder) { 217 | fatalError("init(coder:) has not been implemented") 218 | } 219 | 220 | override public func point(inside point: CGPoint, with event: UIEvent?) -> Bool { 221 | let sizeXY:CGFloat = -10 222 | let clickArea = bounds.insetBy(dx: sizeXY, dy: sizeXY) 223 | return clickArea.contains(point) 224 | } 225 | } 226 | -------------------------------------------------------------------------------- /ZXYWebView/WKWebView/ZXYWebView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ZXYWebView.swift 3 | // ZXYWKWebView 4 | // 5 | // Created by 张小杨 on 2020/12/6. 6 | // 7 | 8 | import UIKit 9 | import WebKit 10 | 11 | protocol ZXYWebViewProtocol: class { 12 | func clearAllWebCache() 13 | } 14 | 15 | public class ZXYWebView: WKWebView { 16 | weak var holderObject: AnyObject? 17 | 18 | static func defaultConfiguration() -> WKWebViewConfiguration { 19 | let config = WKWebViewConfiguration() 20 | config.preferences = WKPreferences() 21 | config.preferences.javaScriptEnabled = true 22 | config.preferences.javaScriptCanOpenWindowsAutomatically = true 23 | config.userContentController = WKUserContentController() 24 | 25 | return config 26 | } 27 | 28 | deinit { 29 | //清除UserScript 30 | configuration.userContentController.removeAllUserScripts() 31 | //停止加载 32 | stopLoading() 33 | uiDelegate = nil 34 | navigationDelegate = nil 35 | // 持有者置为nil 36 | holderObject = nil 37 | print("WKWebView析构") 38 | } 39 | 40 | } 41 | 42 | 43 | extension ZXYWebView: ZXYWebViewProtocol { 44 | 45 | func clearAllWebCache() { 46 | let dataTypes = [WKWebsiteDataTypeMemoryCache, WKWebsiteDataTypeCookies, WKWebsiteDataTypeSessionStorage, WKWebsiteDataTypeOfflineWebApplicationCache, WKWebsiteDataTypeOfflineWebApplicationCache, WKWebsiteDataTypeCookies, WKWebsiteDataTypeLocalStorage, WKWebsiteDataTypeIndexedDBDatabases, WKWebsiteDataTypeWebSQLDatabases] 47 | let websiteDataTypes = Set(dataTypes) 48 | let dateFrom = Date(timeIntervalSince1970: 0) 49 | 50 | WKWebsiteDataStore.default().removeData(ofTypes: websiteDataTypes, modifiedSince: dateFrom) { 51 | } 52 | } 53 | } 54 | 55 | 56 | // MARK: ZXYWebViewPoolProtocol 57 | extension ZXYWebView: ZXYWebViewPoolProtocol { 58 | 59 | /// 即将被复用 60 | func webviewWillLeavePool() { 61 | 62 | } 63 | 64 | /// 被回收 65 | func webviewWillEnterPool() { 66 | holderObject = nil 67 | scrollView.delegate = nil 68 | stopLoading() 69 | NSObject.cancelPreviousPerformRequests(withTarget: self) 70 | navigationDelegate = nil 71 | uiDelegate = nil 72 | // 删除历史记录 73 | let selStr = "_re" + "mov" + "eA" + "llIt" + "ems" 74 | let sel = Selector(selStr) 75 | if self.backForwardList.responds(to: sel) { 76 | self.backForwardList.perform(sel) 77 | } 78 | #warning("使用自定义的移除占位图") 79 | // self.removePlaceholder() 80 | loadHTMLString("", baseURL: nil) 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /ZXYWebView/WKWebView/ZXYWebViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ZXYWebViewController.swift 3 | // ZXYWKWebView 4 | // 5 | // Created by 张小杨 on 2020/12/6. 6 | // 7 | 8 | import UIKit 9 | import WebKit 10 | 11 | public class ZXYWebViewController: UIViewController { 12 | 13 | /// 网页加载完回调 14 | public var webViewDidLoadHandle:(()->Void)? 15 | 16 | // 是否显示进度条 17 | public var showProgress: Bool = false 18 | // 进度条颜色 19 | public var progressColor: UIColor = UIColor.black 20 | /// 超时时间 21 | public var timeoutInternal: TimeInterval = 15 22 | /// 是否加载中 23 | var isLoading: Bool { 24 | return webView?.isLoading ?? false 25 | } 26 | 27 | // 客户端外部设置的title,优先级最高,有设置则忽略H5设置的标题 28 | fileprivate var nativeTitle: String? 29 | 30 | var navBarHidden: Bool = false 31 | /// 是否加载完成 32 | var isFinished: Bool = false 33 | 34 | /// 是否隐藏标题 35 | public var isHideTitle: Bool = false 36 | 37 | /// 是否显示骨架动画 38 | public var isShowFrameworkLoading: Bool = true 39 | 40 | fileprivate var marginTop: CGFloat = 0 41 | 42 | fileprivate var request: URLRequest? 43 | 44 | var webView: ZXYWebView? 45 | #warning("使用自己项目的占位View") 46 | fileprivate var errorView: ZXYPlaceholderView? 47 | 48 | lazy var progressView: UIProgressView = { 49 | let progressV = UIProgressView() 50 | progressV.isHidden = true 51 | return progressV 52 | }() 53 | 54 | lazy var navBar: ZXYWebNavigationBar = { 55 | let bar = ZXYWebNavigationBar() 56 | bar.btnClickHandle = { [weak self] (entity) in 57 | self?.onNavBarButtonClick(entity: entity) 58 | } 59 | return bar 60 | }() 61 | 62 | /// 是否使用系统的导航栏显示客户端定义的标题,当外部有设置nativeTitle且不隐藏导航栏时为true 63 | fileprivate var useNativeNavigationBarTitle: Bool { 64 | return (nativeTitle != nil && navBarHidden == false) 65 | } 66 | 67 | /// 初始化web控制器with url 68 | /// - Parameter url: url 69 | /// - Parameter nativeTitle: 客户端外部设置的title,优先级最高,有设置则忽略H5设置的标题 70 | convenience public init(with url: URL, nativeTitle: String? = nil) { 71 | let request = URLRequest(url: url) 72 | self.init(with: request, nativeTitle: nativeTitle) 73 | } 74 | 75 | /// 初始化web控制器with url字符串 76 | /// - Parameter urlString: urlString 字符串 77 | /// - Parameter nativeTitle: 客户端外部设置的title,优先级最高,有设置则忽略H5设置的标题 78 | convenience public init(with urlString: String, nativeTitle: String? = nil) { 79 | if let url = URL(string: urlString) { 80 | self.init(with: url, nativeTitle: nativeTitle) 81 | } else { 82 | self.init() 83 | } 84 | } 85 | 86 | /// 初始化web控制器with request 87 | /// - Parameter request: request 88 | /// - Parameter nativeTitle: 客户端外部设置的title,优先级最高,有设置则忽略H5设置的标题 89 | convenience public init(with request: URLRequest, nativeTitle: String? = nil) { 90 | self.init() 91 | self.request = request 92 | self.nativeTitle = nativeTitle 93 | } 94 | 95 | override public func viewDidLoad() { 96 | super.viewDidLoad() 97 | self.setupBaseData() 98 | 99 | if useNativeNavigationBarTitle { 100 | self.title = nativeTitle 101 | } else { 102 | // 隐藏系统的导航栏,设置自定义的由H5控制的导航栏 103 | self.setupNavgationBar() 104 | } 105 | self.setupSubviews() 106 | self.setupObservers() 107 | if useNativeNavigationBarTitle == false { 108 | // 把自定义导航栏置顶 109 | self.view.bringSubviewToFront(navBar) 110 | } 111 | self.view.bringSubviewToFront(progressView) 112 | 113 | if var request = request { 114 | if isShowFrameworkLoading { 115 | } 116 | request.timeoutInterval = timeoutInternal 117 | webView?.load(request) 118 | } 119 | 120 | } 121 | 122 | public override func viewWillAppear(_ animated: Bool) { 123 | super.viewWillAppear(animated) 124 | self.addScriptMessageHandler() 125 | // 可能白屏 126 | if webView?.title == nil { 127 | webView?.reload() 128 | } 129 | } 130 | 131 | public override func viewWillDisappear(_ animated: Bool) { 132 | super.viewWillDisappear(animated) 133 | self.removeScriptMessageHandler() 134 | } 135 | 136 | /// 调用 JS 方法 137 | /// 138 | /// - Parameter name: 方法名 139 | public func callJSMethod(name: String) { 140 | if !isFinished {return} 141 | self.webView?.evaluateJavaScript(name, completionHandler: { (_, error) in 142 | if error != nil { 143 | // self.showErrorHUD(message: "操作失败", image: #imageLiteral(resourceName: "MBHUD_Error")) 144 | } 145 | }) 146 | } 147 | 148 | open func loadNewsJSMethod() { 149 | 150 | } 151 | 152 | deinit { 153 | if showProgress { 154 | webView?.removeObserver(self, forKeyPath: "estimatedProgress") 155 | } 156 | webView?.removeObserver(self, forKeyPath: "title") 157 | ZXYWebViewPool.shared.tryCompactWeakHolders() 158 | } 159 | } 160 | 161 | // MARK: - Assistant 162 | fileprivate extension ZXYWebViewController { 163 | 164 | func setupBaseData() { 165 | 166 | navBarHidden = self.bl_naviBarHidden 167 | if navBarHidden == true { 168 | self.marginTop = kSafeAreaTopInset 169 | } else { 170 | self.marginTop = kNavigationBarHeight 171 | } 172 | 173 | if useNativeNavigationBarTitle == false { 174 | navBar.isHidden = navBarHidden 175 | } 176 | } 177 | 178 | func setupNavgationBar() { 179 | 180 | self.bl_naviBarHidden = true 181 | view.addSubview(navBar) 182 | navBar.backgroundColor = UIColor.white 183 | navBar.frame = CGRect(x: 0, y: 0, width: self.view.bounds.size.width, height: kNavigationBarHeight) 184 | } 185 | 186 | func setupSubviews() { 187 | self.view.backgroundColor = .white 188 | self.setupWebview() 189 | 190 | self.progressView.frame = CGRect(x: 0, y: marginTop, width: webView!.frame.size.width, height: 3) 191 | self.progressView.trackTintColor = UIColor.white 192 | self.progressView.progressTintColor = UIColor.black 193 | self.view.addSubview(progressView) 194 | progressView.isHidden = !showProgress 195 | } 196 | 197 | func setupWebview() { 198 | 199 | webView = ZXYWebViewPool.shared.getReusedWebView(forHolder: self) 200 | self.view.addSubview(webView!) 201 | #warning("使用SnipKit") 202 | 203 | webView?.snp.remakeConstraints({ (make) in 204 | make.top.equalToSuperview().offset(marginTop) 205 | make.left.right.equalToSuperview() 206 | make.height.equalTo(kScreenHeight - marginTop) 207 | }) 208 | 209 | if #available(iOS 11.0, *) { 210 | webView!.scrollView.contentInsetAdjustmentBehavior = .never 211 | }else { 212 | self.automaticallyAdjustsScrollViewInsets = false 213 | } 214 | webView!.scrollView.contentInset = UIEdgeInsets(top: 0, left: 0, bottom: kSafeAreaBottomInset, right: 0) 215 | webView!.scrollView.showsVerticalScrollIndicator = true 216 | webView!.scrollView.showsHorizontalScrollIndicator = false 217 | webView!.scrollView.maximumZoomScale = 1 218 | webView!.scrollView.bouncesZoom = false 219 | // 手势交互 220 | webView!.allowsBackForwardNavigationGestures = true 221 | webView!.navigationDelegate = self 222 | webView!.uiDelegate = self 223 | 224 | } 225 | 226 | func setupObservers() { 227 | if showProgress == true { 228 | webView!.addObserver(self, forKeyPath: "estimatedProgress", options: .new, context: nil) 229 | } 230 | webView!.addObserver(self, forKeyPath: "title", options: .new, context: nil) 231 | } 232 | 233 | func addScriptMessageHandler() { 234 | webView?.configuration.userContentController.add(self, name: WebScriptMessage.close) 235 | webView?.configuration.userContentController.add(self, name: WebScriptMessage.exit) 236 | webView?.configuration.userContentController.add(self, name: WebScriptMessage.authLogin) 237 | webView?.configuration.userContentController.add(self, name: WebScriptMessage.reload) 238 | if !useNativeNavigationBarTitle { 239 | webView?.configuration.userContentController.add(self, name: WebScriptMessage.headData) 240 | } 241 | webView?.configuration.userContentController.add(self, name: WebScriptMessage.brokerDetail) 242 | } 243 | 244 | func removeScriptMessageHandler() { 245 | webView?.configuration.userContentController.removeScriptMessageHandler(forName: WebScriptMessage.close) 246 | webView?.configuration.userContentController.removeScriptMessageHandler(forName: WebScriptMessage.exit) 247 | webView?.configuration.userContentController.removeScriptMessageHandler(forName: WebScriptMessage.authLogin) 248 | webView?.configuration.userContentController.removeScriptMessageHandler(forName: WebScriptMessage.reload) 249 | if !useNativeNavigationBarTitle { 250 | webView?.configuration.userContentController.removeScriptMessageHandler(forName: WebScriptMessage.headData) 251 | } 252 | webView?.configuration.userContentController.removeScriptMessageHandler(forName: WebScriptMessage.brokerDetail) 253 | 254 | 255 | } 256 | } 257 | 258 | // MARK: - Actions * Observers 259 | extension ZXYWebViewController { 260 | 261 | override public func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) { 262 | 263 | if keyPath == "estimatedProgress"{ 264 | progressView.isHidden = false 265 | progressView.alpha = 1 266 | // 设置进度 267 | let loadProgress = Float(webView?.estimatedProgress ?? 0) 268 | progressView.setProgress(loadProgress, animated: true) 269 | if loadProgress >= 1.0 { 270 | UIView.animate(withDuration: 0.25, delay: 0.3, options: UIView.AnimationOptions.curveLinear, animations: { 271 | self.progressView.alpha = 0 272 | }) { (result) in 273 | self.progressView.setProgress(0.0, animated: false) 274 | self.progressView.isHidden = true 275 | } 276 | } 277 | } else if keyPath == "title" { 278 | if isHideTitle || useNativeNavigationBarTitle { return } 279 | self.title = webView?.title 280 | } 281 | } 282 | } 283 | 284 | 285 | // MARK: - WKNavigationDelegate 286 | extension ZXYWebViewController: WKNavigationDelegate { 287 | 288 | // 开始请求,是否跳转 289 | public func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -> Void) { 290 | 291 | decisionHandler(.allow) 292 | } 293 | 294 | // 开始加载 295 | public func webView(_ webView: WKWebView, didStartProvisionalNavigation navigation: WKNavigation!) { 296 | errorView?.removeFromSuperview() 297 | if useNativeNavigationBarTitle == false { 298 | navBar.isHidden = navBarHidden 299 | } 300 | } 301 | 302 | // 收到响应头,决定是否跳转 303 | public func webView(_ webView: WKWebView, decidePolicyFor navigationResponse: WKNavigationResponse, decisionHandler: @escaping (WKNavigationResponsePolicy) -> Void) { 304 | decisionHandler(.allow) 305 | } 306 | 307 | // 加载完成 308 | public func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) { 309 | self.isFinished = true 310 | self.webViewDidLoadHandle?() 311 | self.loadNewsJSMethod() 312 | if isShowFrameworkLoading { 313 | } 314 | } 315 | 316 | // 加载失败 317 | public func webView(_ webView: WKWebView, didFailProvisionalNavigation navigation: WKNavigation!, withError error: Error) { 318 | progressView.isHidden = true 319 | var errorUrl: URL? = self.request?.url 320 | if webView.url == nil { 321 | let nsError = error as NSError 322 | let userInfo = nsError.userInfo 323 | if let failingUrlStr = userInfo["NSErrorFailingURLStringKey"] as? String, let failingUrl = URL(string: failingUrlStr) { 324 | errorUrl = failingUrl 325 | } 326 | } 327 | 328 | #warning("占位图的展示") 329 | 330 | if navBar.isHidden == true { 331 | navBar.isHidden = false 332 | } 333 | } 334 | 335 | // 跳转失败 336 | public func webView(_ webView: WKWebView, didFail navigation: WKNavigation!, withError error: Error) { 337 | 338 | } 339 | 340 | // 重定向 341 | public func webView(_ webView: WKWebView, didReceiveServerRedirectForProvisionalNavigation navigation: WKNavigation!) { 342 | 343 | } 344 | 345 | // 打开新窗口委托 346 | public func webView(_ webView: WKWebView, createWebViewWith configuration: WKWebViewConfiguration, for navigationAction: WKNavigationAction, windowFeatures: WKWindowFeatures) -> WKWebView? { 347 | if navigationAction.targetFrame?.isMainFrame == nil { 348 | webView.load(navigationAction.request) 349 | } 350 | return nil 351 | } 352 | 353 | // 白屏 354 | public func webViewWebContentProcessDidTerminate(_ webView: WKWebView) { 355 | webView.reload() 356 | } 357 | 358 | } 359 | 360 | 361 | // MARK: - WKUIDelegate 362 | extension ZXYWebViewController: WKUIDelegate { 363 | 364 | public func webView(_ webView: WKWebView, runJavaScriptAlertPanelWithMessage message: String, initiatedByFrame frame: WKFrameInfo, completionHandler: @escaping () -> Void) { 365 | 366 | } 367 | 368 | public func webView(_ webView: WKWebView, runJavaScriptConfirmPanelWithMessage message: String, initiatedByFrame frame: WKFrameInfo, completionHandler: @escaping (Bool) -> Void) { 369 | 370 | } 371 | 372 | public func webView(_ webView: WKWebView, runJavaScriptTextInputPanelWithPrompt prompt: String, defaultText: String?, initiatedByFrame frame: WKFrameInfo, completionHandler: @escaping (String?) -> Void) { 373 | 374 | } 375 | } 376 | 377 | 378 | extension ZXYWebViewController: WKScriptMessageHandler { 379 | 380 | public func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage) { 381 | 382 | let name = message.name 383 | 384 | if name == WebScriptMessage.close || name == WebScriptMessage.exit { 385 | // 关闭 386 | WebScriptHandle.closeWebView(bodyMessage: message.body) 387 | 388 | }else if name == WebScriptMessage.reload { 389 | // 重新加载 390 | self.load(bodyMessage: message.body) 391 | 392 | }else if name == WebScriptMessage.headData { 393 | // 设置导航栏 394 | self.setupNavigationBar(message: message.body) 395 | 396 | } 397 | 398 | } 399 | } 400 | 401 | // MARK: - Actions 402 | extension ZXYWebViewController { 403 | 404 | func onNavBarButtonClick(entity: WebNavButtonEntity) { 405 | 406 | } 407 | } 408 | 409 | // MARK: - interface 410 | public extension ZXYWebViewController { 411 | 412 | func reload(_ url: URL?) { 413 | self.showFrameworkLoading(offsetY: kNavigationBarHeight) 414 | guard url == nil else { 415 | if let url = url { 416 | let request = URLRequest(url: url) 417 | webView?.load(request) 418 | } 419 | return 420 | } 421 | webView?.reload() 422 | } 423 | 424 | func goBack() { 425 | if webView?.canGoBack == true { 426 | webView?.goBack() 427 | } 428 | } 429 | 430 | func goForward() { 431 | if webView?.canGoForward == true { 432 | webView?.goForward() 433 | } 434 | } 435 | 436 | func load(bodyMessage: Any) { 437 | guard let urlStr = bodyMessage as? String, let url = URL(string: urlStr) else { 438 | return 439 | } 440 | let request = URLRequest(url: url) 441 | webView?.load(request) 442 | } 443 | } 444 | 445 | // MARK: - header setup 446 | fileprivate extension ZXYWebViewController { 447 | 448 | func setupNavigationBar(message: Any) { 449 | 450 | guard var bodyStr = message as? String else { 451 | return 452 | } 453 | bodyStr = bodyStr.replacingOccurrences(of: "\n", with: "") 454 | #warning("使用HandyJSON,换成自己的解析库") 455 | if let navEntity = WebHeaderDataEntity.deserialize(from: bodyStr) { 456 | self.view.bringSubviewToFront(navBar) 457 | navBar.isHidden = false 458 | navBar.updateContent(with: navEntity, isHideTitle: isHideTitle) 459 | } 460 | } 461 | 462 | 463 | } 464 | -------------------------------------------------------------------------------- /ZXYWebView/WKWebView/ZXYWebViewHandle.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ZXYWebViewHandle.swift 3 | // ZXYWKWebView 4 | // 5 | // Created by 张小杨 on 2020/12/6. 6 | // 7 | 8 | import UIKit 9 | 10 | class WebImageEntity: ZXYBaseEntity {//换成自己的第三方解析,本人用的是HandyJson 11 | var index: Int = -1 12 | var imageArray: [String] = [] 13 | } 14 | 15 | class WebVideoEntity: ZXYBaseEntity { 16 | var videoUrl: String = "" 17 | var videoDuration: Float = 0.0 18 | } 19 | 20 | 21 | struct WebScriptMessage { 22 | static let close = "clickClose" // 关闭 23 | static let exit = "exitPage" // 退出 24 | static let authLogin = "authLoginSuccess" // 授权登录 25 | static let reload = "clickDownload" // 加载数据 26 | static let headData = "HeaderData" // 导航栏信息数据 27 | static let brokerDetail = "openDealerDetailsPage" // 交易商详情 28 | 29 | } 30 | 31 | class WebScriptHandle: NSObject { 32 | 33 | /// 关闭 34 | static func closeWebView(bodyMessage: Any) { 35 | // UIViewController.current()?.navigationController?.popViewController(animated: true) 36 | } 37 | 38 | /// 新闻图片浏览 39 | static func newsImageBrowse(_ bodyMessage: Any) { 40 | guard let message = bodyMessage as? String else {return} 41 | } 42 | // if let newsImageEntity = WebImageEntity.deserialize(from: message), !newsImageEntity.imageArray.isEmpty { 43 | // let imageBrowse = ZXYImageBrowseView() 44 | // let toolBar = ZXYImageBrowserToolBar(leftBtnImage: R.image.assistant_back_white(), indexTextColor: UIColor.white, rightBtnTitle: nil, rightBtnImage: nil) 45 | // toolBar.backgroundColor = UIColor.init(white: 0, alpha: 0.7) 46 | // imageBrowse.show(imageURLs: newsImageEntity.imageArray , index: newsImageEntity.index, sourceView: nil, toolBar: toolBar) 47 | // toolBar.onClickLeftBtnHandle = { [weak imageBrowse] in 48 | // imageBrowse?.hide() 49 | // } 50 | } 51 | -------------------------------------------------------------------------------- /ZXYWebView/WKWebView/ZXYWebViewPool.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ZXYWebViewPool.swift 3 | // ZXYWKWebView 4 | // 5 | // Created by 张小杨 on 2020/12/6. 6 | // 7 | 8 | import UIKit 9 | 10 | 11 | protocol ZXYWebViewPoolProtocol: class { 12 | func webviewWillLeavePool() 13 | func webviewWillEnterPool() 14 | } 15 | 16 | 17 | public class ZXYWebViewPool: NSObject { 18 | 19 | // 当前有被页面持有的webview 20 | fileprivate var visiableWebViewSet = Set() 21 | // 回收池中的webview 22 | fileprivate var reusableWebViewSet = Set() 23 | 24 | fileprivate let lock = DispatchSemaphore(value: 1) 25 | 26 | public static let shared = ZXYWebViewPool() 27 | 28 | public override init() { 29 | super.init() 30 | // 监听内存警告,清除复用池 31 | NotificationCenter.default.addObserver(self, 32 | selector: #selector(didReceiveMemoryWarningNotification), 33 | name: UIApplication.didReceiveMemoryWarningNotification, 34 | object: nil) 35 | // 监听首页初始化完成 36 | NotificationCenter.default.addObserver(self, 37 | selector: #selector(mainControllerInit), 38 | name: NSNotification.Name(kMainControllerInitSuccessNotiKey), 39 | object: nil) 40 | } 41 | 42 | deinit { 43 | // 清除set 44 | } 45 | } 46 | 47 | 48 | // MARK: Observers 49 | extension ZXYWebViewPool { 50 | 51 | @objc func mainControllerInit() { 52 | DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 0.25) { 53 | self.prepareReuseWebView() 54 | } 55 | } 56 | 57 | @objc fileprivate func didReceiveMemoryWarningNotification() { 58 | lock.wait() 59 | reusableWebViewSet.removeAll() 60 | lock.signal() 61 | } 62 | } 63 | 64 | 65 | // MARK: Assistant 66 | extension ZXYWebViewPool { 67 | 68 | /// 使用中的webView持有者已销毁,则放回可复用池中 69 | func tryCompactWeakHolders() { 70 | lock.wait() 71 | let shouldReusedWebViewSet = visiableWebViewSet.filter{ $0.holderObject == nil } 72 | for webView in shouldReusedWebViewSet { 73 | webView.webviewWillEnterPool() 74 | visiableWebViewSet.remove(webView) 75 | reusableWebViewSet.insert(webView) 76 | } 77 | lock.signal() 78 | } 79 | 80 | /// 预备一个空的webview 81 | func prepareReuseWebView() { 82 | guard reusableWebViewSet.count <= 0 else { return } 83 | let webview = ZXYWebView(frame: CGRect.zero, configuration: ZXYWebView.defaultConfiguration()) 84 | self.reusableWebViewSet.insert(webview) 85 | } 86 | } 87 | 88 | 89 | // MARK: 复用池管理 90 | public extension ZXYWebViewPool { 91 | 92 | /// 获取可复用的webView 93 | func getReusedWebView(forHolder holder: AnyObject?) -> ZXYWebView { 94 | assert(holder != nil, "ZXYWebView holder不能为nil") 95 | guard let holder = holder else { 96 | return ZXYWebView(frame: CGRect.zero, configuration: ZXYWebView.defaultConfiguration()) 97 | } 98 | 99 | tryCompactWeakHolders() 100 | let webView: ZXYWebView 101 | lock.wait() 102 | if reusableWebViewSet.count > 0 { 103 | // 缓存池中有 104 | webView = reusableWebViewSet.randomElement()! 105 | reusableWebViewSet.remove(webView) 106 | visiableWebViewSet.insert(webView) 107 | // 出回收池前初始化 108 | webView.webviewWillLeavePool() 109 | } else { 110 | // 缓存池没有,创建新的 111 | webView = ZXYWebView(frame: CGRect.zero, configuration: ZXYWebView.defaultConfiguration()) 112 | visiableWebViewSet.insert(webView) 113 | } 114 | 115 | webView.holderObject = holder 116 | lock.signal() 117 | 118 | return webView 119 | } 120 | 121 | /// 回收可复用的webView到复用池中 122 | func recycleReusedWebView(_ webView: ZXYWebView?) { 123 | guard let webView = webView else { return } 124 | lock.wait() 125 | // 存在于当前使用中,则回收 126 | if visiableWebViewSet.contains(webView) { 127 | // 进入回收池前清理 128 | webView.webviewWillEnterPool() 129 | visiableWebViewSet.remove(webView) 130 | reusableWebViewSet.insert(webView) 131 | } 132 | lock.signal() 133 | } 134 | 135 | /// 移除并销毁所有复用池的webView 136 | func clearAllReusableWebViews() { 137 | lock.wait() 138 | for webview in reusableWebViewSet { 139 | webview.webviewWillEnterPool() 140 | } 141 | reusableWebViewSet.removeAll() 142 | lock.signal() 143 | } 144 | } 145 | -------------------------------------------------------------------------------- /ZXYWebView/WKWebView/newsHtmlFiles/Introduction.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 交易商平台简介 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 |
22 |
23 | 24 |

正在加载

25 |
26 |
27 |
28 |
29 | 30 |

这里空空如也

31 |
32 |
33 | 34 | 35 | -------------------------------------------------------------------------------- /ZXYWebView/WKWebView/newsHtmlFiles/banner.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 官方正文 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 | 28 |
29 |
30 | 31 |

正在加载

32 |
33 |
34 | 35 |
36 |
37 | 38 |

这里空空如也

39 |
40 |
41 |
42 | 43 | 44 | -------------------------------------------------------------------------------- /ZXYWebView/WKWebView/newsHtmlFiles/dealerNews.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Page Title 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 |
22 |
23 |
24 |
25 | 26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 | 34 |

这里空空如也

35 |
36 |
37 |
38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /ZXYWebView/WKWebView/newsHtmlFiles/ibPolicy.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 交易商平台简介 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 | 31 |

正在加载

32 |
33 |
34 |
35 |
36 | 37 |

这里空空如也

38 |
39 |
40 |
41 | 42 | 43 | -------------------------------------------------------------------------------- /ZXYWebView/WKWebView/newsHtmlFiles/img/finger_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zxy1829760/ZXYWebView/95a7fffdf3609cdd6a59f7ddb36d30787f36ed89/ZXYWebView/WKWebView/newsHtmlFiles/img/finger_down.png -------------------------------------------------------------------------------- /ZXYWebView/WKWebView/newsHtmlFiles/img/finger_up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zxy1829760/ZXYWebView/95a7fffdf3609cdd6a59f7ddb36d30787f36ed89/ZXYWebView/WKWebView/newsHtmlFiles/img/finger_up.png -------------------------------------------------------------------------------- /ZXYWebView/WKWebView/newsHtmlFiles/img/gold_stars.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zxy1829760/ZXYWebView/95a7fffdf3609cdd6a59f7ddb36d30787f36ed89/ZXYWebView/WKWebView/newsHtmlFiles/img/gold_stars.png -------------------------------------------------------------------------------- /ZXYWebView/WKWebView/newsHtmlFiles/img/gray_stars.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zxy1829760/ZXYWebView/95a7fffdf3609cdd6a59f7ddb36d30787f36ed89/ZXYWebView/WKWebView/newsHtmlFiles/img/gray_stars.png -------------------------------------------------------------------------------- /ZXYWebView/WKWebView/newsHtmlFiles/img/left_arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zxy1829760/ZXYWebView/95a7fffdf3609cdd6a59f7ddb36d30787f36ed89/ZXYWebView/WKWebView/newsHtmlFiles/img/left_arrow.png -------------------------------------------------------------------------------- /ZXYWebView/WKWebView/newsHtmlFiles/img/parse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zxy1829760/ZXYWebView/95a7fffdf3609cdd6a59f7ddb36d30787f36ed89/ZXYWebView/WKWebView/newsHtmlFiles/img/parse.png -------------------------------------------------------------------------------- /ZXYWebView/WKWebView/newsHtmlFiles/img/play1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zxy1829760/ZXYWebView/95a7fffdf3609cdd6a59f7ddb36d30787f36ed89/ZXYWebView/WKWebView/newsHtmlFiles/img/play1.png -------------------------------------------------------------------------------- /ZXYWebView/WKWebView/newsHtmlFiles/img/play2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zxy1829760/ZXYWebView/95a7fffdf3609cdd6a59f7ddb36d30787f36ed89/ZXYWebView/WKWebView/newsHtmlFiles/img/play2.png -------------------------------------------------------------------------------- /ZXYWebView/WKWebView/newsHtmlFiles/img/triangle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zxy1829760/ZXYWebView/95a7fffdf3609cdd6a59f7ddb36d30787f36ed89/ZXYWebView/WKWebView/newsHtmlFiles/img/triangle.png -------------------------------------------------------------------------------- /ZXYWebView/WKWebView/newsHtmlFiles/industryNews.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 行业新闻 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 |
23 |
24 |
25 |
26 | 27 | 28 |
29 |
30 | 31 |
32 |
33 |
34 |
35 | 36 | 37 |
38 |
39 | 40 |

正在加载

41 |
42 |
43 | 44 |
45 |
46 | 47 |

这里空空如也

48 |
49 |
50 |
51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /ZXYWebView/WKWebView/newsHtmlFiles/scripts/public/Compatible.min.js: -------------------------------------------------------------------------------- 1 | function ShowImgCode(e){$("#"+e).attr("src","/CheckImage.aspx?t="+(new Date).getTime()+10*Math.random())}function ShowImgCodTwo(e){$("#"+e).attr("src","/pages/imgvcode.aspx?t="+(new Date).getTime()+10*Math.random())}function getImgVCodeVal(e){var t;if($(e).length>0){var t=$(e).val();t=t.length>0?"0,"+t:""}else t="1,";return t}function CheckImgCode(e){var t=!1;return e.length<1?t=!1:$.ajax({type:"POST",async:!1,url:"/Pages/CheckImgCode.aspx",dataType:"text",data:{vcode:""+e},success:function(e){"1"==e&&(t=!0)},error:function(){}}),t}function inputsd(e){$(e).siblings().hide()}function inputsr(e){$(e).val().length<=0&&$(e).siblings().show()}function submittingpleasewait(e,t){var n="
"+e+"
",t=$(t.target);if(!t.is("input[type=button]"))return!1;if(""==e)$(".loadingzhong").remove();else{var i=t.attr("id"),a=$("#"+i),o=a.height()+2;t.after(n);var r=a.css("border-top-width").replace("px",""),s=a.css("border-bottom-width").replace("px",""),c=a.css("margin-bottom").replace("px",""),g=parseInt(o)+parseInt(r)+parseInt(s)+parseInt(c);$(".loadingzhong").css({width:"100%",height:"50px",top:-g,"z-index":"9999","background-color":"white","vertical-align":"middle","text-align":"center"})}}function getCookieUser(){var e=getCookie("USER_LOGIN");return"null"==e||null==e||"undefined"==e?null:null!=e?decodeURIComponent(e):null}function setUser(){var e=JSON.parse(getCookie("USER_LOGIN")),t=JSON.parse(getCookie("USERLOGINFX110"));return null!=e&&null!=t&&e.Uid!=t.Uid&&$.ajax({type:"POST",async:!1,url:"/Account/LoginShare",dataType:"json",data:"",success:function(){e=getCookie("USERLOGINFX110")},error:function(){}}),e}function getImageList(){for(var e,t,n,i,a=(new Array("",""),$(".placeId_img").find(".Imgms")),o=[],r=0;r=0?(n=e[2],t=e[1]):(n=e[1],t=e[2]),i=a.eq(r).find(".miaoshunr").val(),"图片描述..."==i&&(i=""),o.push({Small:t,Middle:t,Big:n,Description:i});return a.length<=0?"":JSON.stringify(o)}$(function(){$("#txtCheckCode,#txtCheck").focus(function(){$(this).siblings("a").length<=0?$(this).after(''):ShowImgCode("imgVcode")})}); -------------------------------------------------------------------------------- /ZXYWebView/WKWebView/newsHtmlFiles/scripts/public/ScreenAdaptation.js: -------------------------------------------------------------------------------- 1 | !function (win, option) { 2 | var count = 0, 3 | designWidth = option.designWidth, 4 | designHeight = option.designHeight || 0, 5 | designFontSize = option.designFontSize || 10, 6 | callback = option.callback || null, 7 | root = document.documentElement, 8 | body = document.body, 9 | rootWidth, newSize, t, self; 10 | 11 | //返回root元素字体计算结果 12 | function _getNewFontSize() { 13 | if (window.orientation == 180 || window.orientation == 0) { 14 | designWidth = option.designWidth; 15 | designHeight = option.designHeight || 0; 16 | } 17 | else if (window.orientation == 90 || window.orientation == -90) { 18 | designWidth = option.designHeight; 19 | designHeight = option.designWidth; 20 | } 21 | var scale = designHeight !== 0 ? Math.min(win.innerWidth / designWidth, win.innerHeight / designHeight) : win.innerWidth / designWidth; 22 | return parseInt(scale * 10000 * designFontSize) / 10000; 23 | } 24 | !function () { 25 | rootWidth = root.getBoundingClientRect().width; 26 | self = self ? self : arguments.callee; 27 | function Init() { 28 | // alert(win.innerWidth + ":" + win.innerHeight); 29 | if (win.innerWidth == 0 || win.innerHeight == 0) { 30 | setTimeout(function () { Init() }, 200); 31 | } else { 32 | //如果此时屏幕宽度不准确,就尝试再次获取分辨率,只尝试20次,否则使用win.innerWidth计算 33 | if (rootWidth !== win.innerWidth && count < 20) { 34 | win.setTimeout(function () { 35 | count++; 36 | self(); 37 | }, 0); 38 | } else { 39 | newSize = _getNewFontSize(); 40 | //如果css已经兼容当前分辨率就不管了 41 | if (newSize + 'px' !== getComputedStyle(root)['font-size']) { 42 | root.style.fontSize = newSize + "px"; 43 | return callback && callback(newSize); 44 | }; 45 | }; 46 | } 47 | } 48 | Init(); 49 | }(); 50 | //横竖屏切换的时候改变fontSize,根据需要选择使用 51 | win.addEventListener("onorientationchange" in window ? "orientationchange" : "resize", function () { 52 | clearTimeout(t); 53 | t = setTimeout(function () { 54 | self(); 55 | }, 200); 56 | }, false); 57 | }(window, { 58 | designWidth: 320, 59 | designHeight: 568, 60 | designFontSize: 8 61 | }); -------------------------------------------------------------------------------- /ZXYWebView/WKWebView/newsHtmlFiles/scripts/public/layer.js: -------------------------------------------------------------------------------- 1 | /*! layer-v2.4 弹层组件 License LGPL http://layer.layui.com/ By 贤心 */ 2 | ; 3 | ! 4 | function (a, b) { 5 | "use strict"; 6 | var c, d, e = { 7 | getPath: function () { 8 | var a = document.scripts, 9 | b = a[a.length - 1], 10 | c = b.src; 11 | if (!b.getAttribute("merge")) return c.substring(0, c.lastIndexOf("/") + 1) 12 | }(), 13 | enter: function (a) { 14 | 13 === a.keyCode && a.preventDefault() 15 | }, 16 | config: {}, 17 | end: {}, 18 | btn: ["确定", "取消"], 19 | type: ["dialog", "page", "iframe", "loading", "tips"] 20 | }, 21 | f = { 22 | v: "2.4", 23 | ie6: !!a.ActiveXObject && !a.XMLHttpRequest, 24 | index: 0, 25 | path: e.getPath, 26 | config: function (a, b) { 27 | var d = 0; 28 | return a = a || {}, f.cache = e.config = c.extend(e.config, a), f.path = e.config.path || f.path, "string" == typeof a.extend && (a.extend = [a.extend]), f.use("skin/layer.css", a.extend && a.extend.length > 0 ? 29 | function g() { 30 | var c = a.extend; 31 | f.use(c[c[d] ? d : d - 1], d < c.length ? 32 | function () { 33 | return ++d, g 34 | }() : b) 35 | }() : b), this 36 | }, 37 | use: function (a, b, d) { 38 | var e = c("head")[0], 39 | a = a.replace(/\s/g, ""), 40 | g = /\.css$/.test(a), 41 | h = document.createElement(g ? "link" : "script"), 42 | i = "layui_layer_" + a.replace(/\.|\//g, ""); 43 | return f.path ? (g && (h.rel = "stylesheet"), h[g ? "href" : "src"] = /^http:\/\//.test(a) ? a : f.path + a, h.id = i, c("#" + i)[0] || e.appendChild(h), function j() { 44 | (g ? 1989 === parseInt(c("#" + i).css("width")) : f[d || i]) ? 45 | function () { 46 | b && b(); 47 | try { 48 | g || e.removeChild(h) 49 | } catch (a) { } 50 | }() : setTimeout(j, 100) 51 | }(), this) : void 0 52 | }, 53 | ready: function (a, b) { 54 | var d = "function" == typeof a; 55 | return d && (b = a), f.config(c.extend(e.config, function () { 56 | return d ? {} : { 57 | path: a 58 | } 59 | }()), b), this 60 | }, 61 | alert: function (a, b, d) { 62 | var e = "function" == typeof b; 63 | return e && (d = b), f.open(c.extend({ 64 | content: a, 65 | yes: d 66 | }, e ? {} : b)) 67 | }, 68 | confirm: function (a, b, d, g) { 69 | var h = "function" == typeof b; 70 | return h && (g = d, d = b), f.open(c.extend({ 71 | content: a, 72 | btn: e.btn, 73 | yes: d, 74 | btn2: g 75 | }, h ? {} : b)) 76 | }, 77 | msg: function (a, d, g) { 78 | var i = "function" == typeof d, 79 | j = e.config.skin, 80 | k = (j ? j + " " + j + "-msg" : "") || "layui-layer-msg", 81 | l = h.anim.length - 1; 82 | return i && (g = d), f.open(c.extend({ 83 | content: a, 84 | time: 3e3, 85 | shade: !1, 86 | skin: k, 87 | title: !1, 88 | closeBtn: !1, 89 | btn: !1, 90 | end: g 91 | }, i && !e.config.skin ? { 92 | skin: k + " layui-layer-hui", 93 | shift: l 94 | } : function () { 95 | return d = d || {}, (-1 === d.icon || d.icon === b && !e.config.skin) && (d.skin = k + " " + (d.skin || "layui-layer-hui")), d 96 | }())) 97 | }, 98 | load: function (a, b) { 99 | return f.open(c.extend({ 100 | type: 3, 101 | icon: a || 0, 102 | shade: .01 103 | }, b)) 104 | }, 105 | tips: function (a, b, d) { 106 | return f.open(c.extend({ 107 | type: 4, 108 | content: [a, b], 109 | closeBtn: !1, 110 | time: 3e3, 111 | shade: !1, 112 | fix: !1, 113 | maxWidth: 210 114 | }, d)) 115 | } 116 | }, 117 | g = function (a) { 118 | var b = this; 119 | b.index = ++f.index, b.config = c.extend({}, b.config, e.config, a), b.creat() 120 | }; 121 | g.pt = g.prototype; 122 | var h = ["layui-layer", ".layui-layer-title", ".layui-layer-main", ".layui-layer-dialog", "layui-layer-iframe", "layui-layer-content", "layui-layer-btn", "layui-layer-close"]; 123 | h.anim = ["layer-anim", "layer-anim-01", "layer-anim-02", "layer-anim-03", "layer-anim-04", "layer-anim-05", "layer-anim-06"], g.pt.config = { 124 | type: 0, 125 | shade: .3, 126 | fix: !0, 127 | move: h[1], 128 | title: "信息", 129 | offset: "auto", 130 | area: "auto", 131 | closeBtn: 1, 132 | time: 0, 133 | zIndex: 19891014, 134 | maxWidth: 360, 135 | shift: 0, 136 | icon: -1, 137 | scrollbar: !0, 138 | tips: 2 139 | }, g.pt.vessel = function (a, b) { 140 | var c = this, 141 | d = c.index, 142 | f = c.config, 143 | g = f.zIndex + d, 144 | i = "object" == typeof f.title, 145 | j = f.maxmin && (1 === f.type || 2 === f.type), 146 | k = f.title ? '
' + (i ? f.title[0] : f.title) + "
" : ""; 147 | return f.zIndex = g, b([f.shade ? '
' : "", '
' + (a && 2 != f.type ? "" : k) + '
' + (0 == f.type && -1 !== f.icon ? '' : "") + (1 == f.type && a ? "" : f.content || "") + '
' + 148 | function () { 149 | var a = j ? '' : ""; 150 | return f.closeBtn && (a += ''), a 151 | }() + "" + (f.btn ? 152 | function () { 153 | var a = ""; 154 | "string" == typeof f.btn && (f.btn = [f.btn]); 155 | for (var b = 0, c = f.btn.length; c > b; b++) a += '' + f.btn[b] + ""; 156 | return '
' + a + "
" 157 | }() : "") + "
"], k), c 158 | }, g.pt.creat = function () { 159 | var a = this, 160 | b = a.config, 161 | g = a.index, 162 | i = b.content, 163 | j = "object" == typeof i; 164 | if (!c("#" + b.id)[0]) { 165 | switch ("string" == typeof b.area && (b.area = "auto" === b.area ? ["", ""] : [b.area, ""]), b.type) { 166 | case 0: 167 | b.btn = "btn" in b ? b.btn : e.btn[0], f.closeAll("dialog"); 168 | break; 169 | case 2: 170 | var i = b.content = j ? b.content : [b.content || "http://layer.layui.com", "auto"]; 171 | b.content = ''; 172 | break; 173 | case 3: 174 | b.title = !1, b.closeBtn = !1, -1 === b.icon && 0 === b.icon, f.closeAll("loading"); 175 | break; 176 | case 4: 177 | j || (b.content = [b.content, "body"]), b.follow = b.content[1], b.content = b.content[0] + '', b.title = !1, b.tips = "object" == typeof b.tips ? b.tips : [b.tips, !0], b.tipsMore || f.closeAll("tips") 178 | } 179 | a.vessel(j, function (d, e) { 180 | c("body").append(d[0]), j ? 181 | function () { 182 | 2 == b.type || 4 == b.type ? 183 | function () { 184 | c("body").append(d[1]) 185 | }() : function () { 186 | i.parents("." + h[0])[0] || (i.show().addClass("layui-layer-wrap").wrap(d[1]), c("#" + h[0] + g).find("." + h[5]).before(e)) 187 | }() 188 | }() : c("body").append(d[1]), a.layero = c("#" + h[0] + g), b.scrollbar || h.html.css("overflow", "hidden").attr("layer-full", g) 189 | }).auto(g), 2 == b.type && f.ie6 && a.layero.find("iframe").attr("src", i[0]), c(document).off("keydown", e.enter).on("keydown", e.enter), a.layero.on("keydown", function (a) { 190 | c(document).off("keydown", e.enter) 191 | }), 4 == b.type ? a.tips() : a.offset(), b.fix && d.on("resize", function () { 192 | a.offset(), (/^\d+%$/.test(b.area[0]) || /^\d+%$/.test(b.area[1])) && a.auto(g), 4 == b.type && a.tips() 193 | }), b.time <= 0 || setTimeout(function () { 194 | f.close(a.index) 195 | }, b.time), a.move().callback(), h.anim[b.shift] && a.layero.addClass(h.anim[b.shift]) 196 | } 197 | }, g.pt.auto = function (a) { 198 | function b(a) { 199 | a = g.find(a), a.height(i[1] - j - k - 2 * (0 | parseFloat(a.css("padding")))) 200 | } 201 | var e = this, 202 | f = e.config, 203 | g = c("#" + h[0] + a); 204 | "" === f.area[0] && f.maxWidth > 0 && (/MSIE 7/.test(navigator.userAgent) && f.btn && g.width(g.innerWidth()), g.outerWidth() > f.maxWidth && g.width(f.maxWidth)); 205 | var i = [g.innerWidth(), g.innerHeight()], 206 | j = g.find(h[1]).outerHeight() || 0, 207 | k = g.find("." + h[6]).outerHeight() || 0; 208 | switch (f.type) { 209 | case 2: 210 | b("iframe"); 211 | break; 212 | default: 213 | "" === f.area[1] ? f.fix && i[1] >= d.height() && (i[1] = d.height(), b("." + h[5])) : b("." + h[5]) 214 | } 215 | return e 216 | }, g.pt.offset = function () { 217 | var a = this, 218 | b = a.config, 219 | c = a.layero, 220 | e = [c.outerWidth(), c.outerHeight()], 221 | f = "object" == typeof b.offset; 222 | a.offsetTop = (d.height() - e[1]) / 2, a.offsetLeft = (d.width() - e[0]) / 2, f ? (a.offsetTop = b.offset[0], a.offsetLeft = b.offset[1] || a.offsetLeft) : "auto" !== b.offset && (a.offsetTop = b.offset, "rb" === b.offset && (a.offsetTop = d.height() - e[1], a.offsetLeft = d.width() - e[0])), b.fix || (a.offsetTop = /%$/.test(a.offsetTop) ? d.height() * parseFloat(a.offsetTop) / 100 : parseFloat(a.offsetTop), a.offsetLeft = /%$/.test(a.offsetLeft) ? d.width() * parseFloat(a.offsetLeft) / 100 : parseFloat(a.offsetLeft), a.offsetTop += d.scrollTop(), a.offsetLeft += d.scrollLeft()), c.css({ 223 | top: a.offsetTop, 224 | left: a.offsetLeft 225 | }) 226 | }, g.pt.tips = function () { 227 | var a = this, 228 | b = a.config, 229 | e = a.layero, 230 | f = [e.outerWidth(), e.outerHeight()], 231 | g = c(b.follow); 232 | g[0] || (g = c("body")); 233 | var i = { 234 | width: g.outerWidth(), 235 | height: g.outerHeight(), 236 | top: g.offset().top, 237 | left: g.offset().left 238 | }, 239 | j = e.find(".layui-layer-TipsG"), 240 | k = b.tips[0]; 241 | b.tips[1] || j.remove(), i.autoLeft = function () { 242 | i.left + f[0] - d.width() > 0 ? (i.tipLeft = i.left + i.width - f[0], j.css({ 243 | right: 12, 244 | left: "auto" 245 | })) : i.tipLeft = i.left 246 | }, i.where = [function () { 247 | i.autoLeft(), i.tipTop = i.top - f[1] - 10, j.removeClass("layui-layer-TipsB").addClass("layui-layer-TipsT").css("border-right-color", b.tips[1]) 248 | }, function () { 249 | i.tipLeft = i.left + i.width + 10, i.tipTop = i.top, j.removeClass("layui-layer-TipsL").addClass("layui-layer-TipsR").css("border-bottom-color", b.tips[1]) 250 | }, function () { 251 | i.autoLeft(), i.tipTop = i.top + i.height + 10, j.removeClass("layui-layer-TipsT").addClass("layui-layer-TipsB").css("border-right-color", b.tips[1]) 252 | }, function () { 253 | i.tipLeft = i.left - f[0] - 10, i.tipTop = i.top, j.removeClass("layui-layer-TipsR").addClass("layui-layer-TipsL").css("border-bottom-color", b.tips[1]) 254 | }], i.where[k - 1](), 1 === k ? i.top - (d.scrollTop() + f[1] + 16) < 0 && i.where[2]() : 2 === k ? d.width() - (i.left + i.width + f[0] + 16) > 0 || i.where[3]() : 3 === k ? i.top - d.scrollTop() + i.height + f[1] + 16 - d.height() > 0 && i.where[0]() : 4 === k && f[0] + 16 - i.left > 0 && i.where[1](), e.find("." + h[5]).css({ 255 | "background-color": b.tips[1], 256 | "padding-right": b.closeBtn ? "30px" : "" 257 | }), e.css({ 258 | left: i.tipLeft - (b.fix ? d.scrollLeft() : 0), 259 | top: i.tipTop - (b.fix ? d.scrollTop() : 0) 260 | }) 261 | }, g.pt.move = function () { 262 | var a = this, 263 | b = a.config, 264 | e = { 265 | setY: 0, 266 | moveLayer: function () { 267 | var a = e.layero, 268 | b = parseInt(a.css("margin-left")), 269 | c = parseInt(e.move.css("left")); 270 | 0 === b || (c -= b), "fixed" !== a.css("position") && (c -= a.parent().offset().left, e.setY = 0), a.css({ 271 | left: c, 272 | top: parseInt(e.move.css("top")) - e.setY 273 | }) 274 | } 275 | }, 276 | f = a.layero.find(b.move); 277 | return b.move && f.attr("move", "ok"), f.css({ 278 | cursor: b.move ? "move" : "auto" 279 | }), c(b.move).on("mousedown", function (a) { 280 | if (a.preventDefault(), "ok" === c(this).attr("move")) { 281 | e.ismove = !0, e.layero = c(this).parents("." + h[0]); 282 | var f = e.layero.offset().left, 283 | g = e.layero.offset().top, 284 | i = e.layero.outerWidth() - 6, 285 | j = e.layero.outerHeight() - 6; 286 | c("#layui-layer-moves")[0] || c("body").append('
'), e.move = c("#layui-layer-moves"), b.moveType && e.move.css({ 287 | visibility: "hidden" 288 | }), e.moveX = a.pageX - e.move.position().left, e.moveY = a.pageY - e.move.position().top, "fixed" !== e.layero.css("position") || (e.setY = d.scrollTop()) 289 | } 290 | }), c(document).mousemove(function (a) { 291 | if (e.ismove) { 292 | var c = a.pageX - e.moveX, 293 | f = a.pageY - e.moveY; 294 | if (a.preventDefault(), !b.moveOut) { 295 | e.setY = d.scrollTop(); 296 | var g = d.width() - e.move.outerWidth(), 297 | h = e.setY; 298 | 0 > c && (c = 0), c > g && (c = g), h > f && (f = h), f > d.height() - e.move.outerHeight() + e.setY && (f = d.height() - e.move.outerHeight() + e.setY) 299 | } 300 | e.move.css({ 301 | left: c, 302 | top: f 303 | }), b.moveType && e.moveLayer(), c = f = g = h = null 304 | } 305 | }).mouseup(function () { 306 | try { 307 | e.ismove && (e.moveLayer(), e.move.remove(), b.moveEnd && b.moveEnd()), e.ismove = !1 308 | } catch (a) { 309 | e.ismove = !1 310 | } 311 | }), a 312 | }, g.pt.callback = function () { 313 | function a() { 314 | var a = g.cancel && g.cancel(b.index, d); 315 | a === !1 || f.close(b.index) 316 | } 317 | var b = this, 318 | d = b.layero, 319 | g = b.config; 320 | b.openLayer(), g.success && (2 == g.type ? d.find("iframe").on("load", function () { 321 | g.success(d, b.index) 322 | }) : g.success(d, b.index)), f.ie6 && b.IE6(d), d.find("." + h[6]).children("a").on("click", function () { 323 | var a = c(this).index(); 324 | if (0 === a) g.yes ? g.yes(b.index, d) : g.btn1 ? g.btn1(b.index, d) : f.close(b.index); 325 | else { 326 | var e = g["btn" + (a + 1)] && g["btn" + (a + 1)](b.index, d); 327 | e === !1 || f.close(b.index) 328 | } 329 | }), d.find("." + h[7]).on("click", a), g.shadeClose && c("#layui-layer-shade" + b.index).on("click", function () { 330 | f.close(b.index) 331 | }), d.find(".layui-layer-min").on("click", function () { 332 | var a = g.min && g.min(d); 333 | a === !1 || f.min(b.index, g) 334 | }), d.find(".layui-layer-max").on("click", function () { 335 | c(this).hasClass("layui-layer-maxmin") ? (f.restore(b.index), g.restore && g.restore(d)) : (f.full(b.index, g), setTimeout(function () { 336 | g.full && g.full(d) 337 | }, 100)) 338 | }), g.end && (e.end[b.index] = g.end) 339 | }, e.reselect = function () { 340 | c.each(c("select"), function (a, b) { 341 | var d = c(this); 342 | d.parents("." + h[0])[0] || 1 == d.attr("layer") && c("." + h[0]).length < 1 && d.removeAttr("layer").show(), d = null 343 | }) 344 | }, g.pt.IE6 = function (a) { 345 | function b() { 346 | a.css({ 347 | top: f + (e.config.fix ? d.scrollTop() : 0) 348 | }) 349 | } 350 | var e = this, 351 | f = a.offset().top; 352 | b(), d.scroll(b), c("select").each(function (a, b) { 353 | var d = c(this); 354 | d.parents("." + h[0])[0] || "none" === d.css("display") || d.attr({ 355 | layer: "1" 356 | }).hide(), d = null 357 | }) 358 | }, g.pt.openLayer = function () { 359 | var a = this; 360 | f.zIndex = a.config.zIndex, f.setTop = function (a) { 361 | var b = function () { 362 | f.zIndex++, a.css("z-index", f.zIndex + 1) 363 | }; 364 | return f.zIndex = parseInt(a[0].style.zIndex), a.on("mousedown", b), f.zIndex 365 | } 366 | }, e.record = function (a) { 367 | var b = [a.width(), a.height(), a.position().top, a.position().left + parseFloat(a.css("margin-left"))]; 368 | a.find(".layui-layer-max").addClass("layui-layer-maxmin"), a.attr({ 369 | area: b 370 | }) 371 | }, e.rescollbar = function (a) { 372 | h.html.attr("layer-full") == a && (h.html[0].style.removeProperty ? h.html[0].style.removeProperty("overflow") : h.html[0].style.removeAttribute("overflow"), h.html.removeAttr("layer-full")) 373 | }, a.layer = f, f.getChildFrame = function (a, b) { 374 | return b = b || c("." + h[4]).attr("times"), c("#" + h[0] + b).find("iframe").contents().find(a) 375 | }, f.getFrameIndex = function (a) { 376 | return c("#" + a).parents("." + h[4]).attr("times") 377 | }, f.iframeAuto = function (a) { 378 | if (a) { 379 | var b = f.getChildFrame("html", a).outerHeight(), 380 | d = c("#" + h[0] + a), 381 | e = d.find(h[1]).outerHeight() || 0, 382 | g = d.find("." + h[6]).outerHeight() || 0; 383 | d.css({ 384 | height: b + e + g 385 | }), d.find("iframe").css({ 386 | height: b 387 | }) 388 | } 389 | }, f.iframeSrc = function (a, b) { 390 | c("#" + h[0] + a).find("iframe").attr("src", b) 391 | }, f.style = function (a, b) { 392 | var d = c("#" + h[0] + a), 393 | f = d.attr("type"), 394 | g = d.find(h[1]).outerHeight() || 0, 395 | i = d.find("." + h[6]).outerHeight() || 0; 396 | (f === e.type[1] || f === e.type[2]) && (d.css(b), f === e.type[2] && d.find("iframe").css({ 397 | height: parseFloat(b.height) - g - i 398 | })) 399 | }, f.min = function (a, b) { 400 | var d = c("#" + h[0] + a), 401 | g = d.find(h[1]).outerHeight() || 0; 402 | e.record(d), f.style(a, { 403 | width: 180, 404 | height: g, 405 | overflow: "hidden" 406 | }), d.find(".layui-layer-min").hide(), "page" === d.attr("type") && d.find(h[4]).hide(), e.rescollbar(a) 407 | }, f.restore = function (a) { 408 | var b = c("#" + h[0] + a), 409 | d = b.attr("area").split(","); 410 | b.attr("type"); 411 | f.style(a, { 412 | width: parseFloat(d[0]), 413 | height: parseFloat(d[1]), 414 | top: parseFloat(d[2]), 415 | left: parseFloat(d[3]), 416 | overflow: "visible" 417 | }), b.find(".layui-layer-max").removeClass("layui-layer-maxmin"), b.find(".layui-layer-min").show(), "page" === b.attr("type") && b.find(h[4]).show(), e.rescollbar(a) 418 | }, f.full = function (a) { 419 | var b, g = c("#" + h[0] + a); 420 | e.record(g), h.html.attr("layer-full") || h.html.css("overflow", "hidden").attr("layer-full", a), clearTimeout(b), b = setTimeout(function () { 421 | var b = "fixed" === g.css("position"); 422 | f.style(a, { 423 | top: b ? 0 : d.scrollTop(), 424 | left: b ? 0 : d.scrollLeft(), 425 | width: d.width(), 426 | height: d.height() 427 | }), g.find(".layui-layer-min").hide() 428 | }, 100) 429 | }, f.title = function (a, b) { 430 | var d = c("#" + h[0] + (b || f.index)).find(h[1]); 431 | d.html(a) 432 | }, f.close = function (a) { 433 | var b = c("#" + h[0] + a), 434 | d = b.attr("type"); 435 | if (b[0]) { 436 | if (d === e.type[1] && "object" === b.attr("conType")) { 437 | b.children(":not(." + h[5] + ")").remove(); 438 | for (var g = 0; 2 > g; g++) b.find(".layui-layer-wrap").unwrap().hide() 439 | } else { 440 | if (d === e.type[2]) try { 441 | var i = c("#" + h[4] + a)[0]; 442 | i.contentWindow.document.write(""), i.contentWindow.close(), b.find("." + h[5])[0].removeChild(i) 443 | } catch (j) { } 444 | b[0].innerHTML = "", b.remove() 445 | } 446 | c("#layui-layer-moves, #layui-layer-shade" + a).remove(), f.ie6 && e.reselect(), e.rescollbar(a), c(document).off("keydown", e.enter), "function" == typeof e.end[a] && e.end[a](), delete e.end[a] 447 | } 448 | }, f.closeAll = function (a) { 449 | c.each(c("." + h[0]), function () { 450 | var b = c(this), 451 | d = a ? b.attr("type") === a : 1; 452 | d && f.close(b.attr("times")), d = null 453 | }) 454 | }; 455 | var i = f.cache || {}, 456 | j = function (a) { 457 | return i.skin ? " " + i.skin + " " + i.skin + "-" + a : "" 458 | }; 459 | f.prompt = function (a, b) { 460 | a = a || {}, "function" == typeof a && (b = a); 461 | var d, e = 2 == a.formType ? '" : function () { 462 | return '' 463 | }(); 464 | return f.open(c.extend({ 465 | btn: ["确定", "取消"], 466 | content: e, 467 | skin: "layui-layer-prompt" + j("prompt"), 468 | success: function (a) { 469 | d = a.find(".layui-layer-input"), d.focus() 470 | }, 471 | yes: function (c) { 472 | var e = d.val(); 473 | "" === e ? d.focus() : e.length > (a.maxlength || 500) ? f.tips("最多输入" + (a.maxlength || 500) + "个字数", d, { 474 | tips: 1 475 | }) : b && b(e, c, d) 476 | } 477 | }, a)) 478 | }, f.tab = function (a) { 479 | a = a || {}; 480 | var b = a.tab || {}; 481 | return f.open(c.extend({ 482 | type: 1, 483 | skin: "layui-layer-tab" + j("tab"), 484 | title: function () { 485 | var a = b.length, 486 | c = 1, 487 | d = ""; 488 | if (a > 0) for (d = '' + b[0].title + ""; a > c; c++) d += "" + b[c].title + ""; 489 | return d 490 | }(), 491 | content: '
    ' + 492 | function () { 493 | var a = b.length, 494 | c = 1, 495 | d = ""; 496 | if (a > 0) for (d = '
  • ' + (b[0].content || "no content") + "
  • "; a > c; c++) d += '
  • ' + (b[c].content || "no content") + "
  • "; 497 | return d 498 | }() + "
", 499 | success: function (b) { 500 | var d = b.find(".layui-layer-title").children(), 501 | e = b.find(".layui-layer-tabmain").children(); 502 | d.on("mousedown", function (b) { 503 | b.stopPropagation ? b.stopPropagation() : b.cancelBubble = !0; 504 | var d = c(this), 505 | f = d.index(); 506 | d.addClass("layui-layer-tabnow").siblings().removeClass("layui-layer-tabnow"), e.eq(f).show().siblings().hide(), "function" == typeof a.change && a.change(f) 507 | }) 508 | } 509 | }, a)) 510 | }, f.photos = function (b, d, e) { 511 | function g(a, b, c) { 512 | var d = new Image; 513 | return d.src = a, d.complete ? b(d) : (d.onload = function () { 514 | d.onload = null, b(d) 515 | }, void (d.onerror = function (a) { 516 | d.onerror = null, c(a) 517 | })) 518 | } 519 | var h = {}; 520 | if (b = b || {}, b.photos) { 521 | var i = b.photos.constructor === Object, 522 | k = i ? b.photos : {}, 523 | l = k.data || [], 524 | m = k.start || 0; 525 | if (h.imgIndex = (0 | m) + 1, b.img = b.img || "img", i) { 526 | if (0 === l.length) return f.msg("没有图片") 527 | } else { 528 | var n = c(b.photos), 529 | o = function () { 530 | l = [], n.find(b.img).each(function (a) { 531 | var b = c(this); 532 | b.attr("layer-index", a), l.push({ 533 | alt: b.attr("alt"), 534 | pid: b.attr("layer-pid"), 535 | src: b.attr("layer-src") || b.attr("src"), 536 | thumb: b.attr("src") 537 | }) 538 | }) 539 | }; 540 | if (o(), 0 === l.length) return; 541 | if (d || n.on("click", b.img, function () { 542 | var a = c(this), 543 | d = a.attr("layer-index"); 544 | f.photos(c.extend(b, { 545 | photos: { 546 | start: d, 547 | data: l, 548 | tab: b.tab 549 | }, 550 | full: b.full 551 | }), !0), o() 552 | }), !d) return 553 | } 554 | h.imgprev = function (a) { 555 | h.imgIndex--, h.imgIndex < 1 && (h.imgIndex = l.length), h.tabimg(a) 556 | }, h.imgnext = function (a, b) { 557 | h.imgIndex++, h.imgIndex > l.length && (h.imgIndex = 1, b) || h.tabimg(a) 558 | }, h.keyup = function (a) { 559 | if (!h.end) { 560 | var b = a.keyCode; 561 | a.preventDefault(), 37 === b ? h.imgprev(!0) : 39 === b ? h.imgnext(!0) : 27 === b && f.close(h.index) 562 | } 563 | }, h.tabimg = function (a) { 564 | l.length <= 1 || (k.start = h.imgIndex - 1, f.close(h.index), f.photos(b, !0, a)) 565 | }, h.event = function () { 566 | h.bigimg.hover(function () { 567 | h.imgsee.show() 568 | }, function () { 569 | h.imgsee.hide() 570 | }), h.bigimg.find(".layui-layer-imgprev").on("click", function (a) { 571 | a.preventDefault(), h.imgprev() 572 | }), h.bigimg.find(".layui-layer-imgnext").on("click", function (a) { 573 | a.preventDefault(), h.imgnext() 574 | }), c(document).on("keyup", h.keyup) 575 | }, h.loadi = f.load(1, { 576 | shade: "shade" in b ? !1 : .9, 577 | scrollbar: !1 578 | }), g(l[m].src, function (d) { 579 | f.close(h.loadi), h.index = f.open(c.extend({ 580 | type: 1, 581 | area: function () { 582 | var e = [d.width, d.height], 583 | f = [c(a).width() - 50, c(a).height() - 50]; 584 | return !b.full && e[0] > f[0] && (e[0] = f[0], e[1] = e[0] * d.height / d.width), [e[0] + "px", e[1] + "px"] 585 | }(), 586 | title: !1, 587 | shade: .9, 588 | shadeClose: !0, 589 | closeBtn: !1, 590 | move: ".layui-layer-phimg img", 591 | moveType: 1, 592 | scrollbar: !1, 593 | moveOut: !0, 594 | shift: 5 * Math.random() | 0, 595 | skin: "layui-layer-photos" + j("photos"), 596 | content: '
' + (l[m].alt ||
' + (l.length > 1 ? '' : "") + '
' + (l[m].alt || "") + "" + h.imgIndex + "/" + l.length + "
", 597 | success: function (a, c) { 598 | h.bigimg = a.find(".layui-layer-phimg"), h.imgsee = a.find(".layui-layer-imguide,.layui-layer-imgbar"), h.event(a), b.tab && b.tab(l[m], a) 599 | }, 600 | end: function () { 601 | h.end = !0, c(document).off("keyup", h.keyup) 602 | } 603 | }, b)) 604 | }, function () { 605 | f.close(h.loadi), f.msg("当前图片地址异常
是否继续查看下一张?", { 606 | time: 3e4, 607 | btn: ["下一张", "不看了"], 608 | yes: function () { 609 | l.length > 1 && h.imgnext(!0, !0) 610 | } 611 | }) 612 | }) 613 | } 614 | }, e.run = function () { 615 | c = jQuery, d = c(a), h.html = c("html"), f.open = function (a) { 616 | var b = new g(a); 617 | return b.index 618 | } 619 | }, "function" == typeof define ? define(function () { 620 | return e.run(), f 621 | }) : function () { 622 | e.run(), f.use("skin/layer.css") 623 | }() 624 | }(window); -------------------------------------------------------------------------------- /ZXYWebView/WKWebView/newsHtmlFiles/scripts/public/mui.previewimage.js: -------------------------------------------------------------------------------- 1 | (function($, window) { 2 | 3 | var template = '
{{header}}
'; 4 | var itemTemplate = '
'; 5 | var defaultGroupName = '__DEFAULT'; 6 | var div = document.createElement('div'); 7 | var imgId = 0; 8 | var PreviewImage = function(options) { 9 | this.options = $.extend(true, { 10 | id: '__MUI_PREVIEWIMAGE', 11 | zoom: true, 12 | header: '', 13 | footer: '' 14 | }, options || {}); 15 | this.init(); 16 | this.initEvent(); 17 | }; 18 | var proto = PreviewImage.prototype; 19 | proto.init = function() { 20 | var options = this.options; 21 | var el = document.getElementById(this.options.id); 22 | if (!el) { 23 | div.innerHTML = template.replace(/\{\{id\}\}/g, this.options.id).replace('{{header}}', options.header).replace('{{footer}}', options.footer); 24 | document.body.appendChild(div.firstElementChild); 25 | el = document.getElementById(this.options.id); 26 | } 27 | 28 | this.element = el; 29 | this.scroller = this.element.querySelector($.classSelector('.slider-group')); 30 | this.indicator = this.element.querySelector($.classSelector('.preview-indicator')); 31 | this.loader = this.element.querySelector($.classSelector('.preview-loading')); 32 | if (options.footer) { 33 | this.element.querySelector($.classSelector('.preview-footer')).classList.remove($.className('hidden')); 34 | } 35 | this.addImages(); 36 | }; 37 | proto.initEvent = function() { 38 | var self = this; 39 | $(document.body).on('tap', 'img[data-preview-src]', function() { 40 | self.open(this); 41 | return false; 42 | }); 43 | var laterClose = null; 44 | var laterCloseEvent = function() { 45 | !laterClose && (laterClose = $.later(function() { 46 | self.loader.removeEventListener('tap', laterCloseEvent); 47 | self.scroller.removeEventListener('tap', laterCloseEvent); 48 | self.close(); 49 | }, 300)); 50 | }; 51 | this.scroller.addEventListener('doubletap', function() { 52 | if (laterClose) { 53 | laterClose.cancel(); 54 | laterClose = null; 55 | } 56 | }); 57 | this.element.addEventListener('webkitAnimationEnd', function() { 58 | if (self.element.classList.contains($.className('preview-out'))) { //close 59 | self.element.style.display = 'none'; 60 | self.element.classList.remove($.className('preview-out')); 61 | self.element.classList.remove($.className('preview-in')); 62 | laterClose = null; 63 | } else { //open 64 | self.loader.addEventListener('tap', laterCloseEvent); 65 | self.scroller.addEventListener('tap', laterCloseEvent); 66 | } 67 | }); 68 | this.element.addEventListener('slide', function(e) { 69 | if (self.options.zoom) { 70 | var lastZoomerEl = self.element.querySelector('.mui-zoom-wrapper:nth-child(' + (self.lastIndex + 1) + ')'); 71 | if (lastZoomerEl) { 72 | $(lastZoomerEl).zoom().setZoom(1); 73 | } 74 | } 75 | var slideNumber = e.detail.slideNumber; 76 | self.lastIndex = slideNumber; 77 | self.indicator && (self.indicator.innerText = (slideNumber + 1) + '/' + self.currentGroup.length); 78 | self._loadItem(slideNumber); 79 | 80 | }); 81 | }; 82 | proto.addImages = function(group, index) { 83 | this.groups = {}; 84 | var imgs = []; 85 | if (group) { 86 | if (group === defaultGroupName) { 87 | imgs = document.querySelectorAll("img[data-preview-src]:not([data-preview-group])"); 88 | } else { 89 | imgs = document.querySelectorAll("img[data-preview-src][data-preview-group='" + group + "']"); 90 | } 91 | } else { 92 | imgs = document.querySelectorAll("img[data-preview-src]"); 93 | } 94 | if (imgs.length) { 95 | for (var i = 0, len = imgs.length; i < len; i++) { 96 | this.addImage(imgs[i]); 97 | } 98 | } 99 | }; 100 | proto.addImage = function(img) { 101 | var group = img.getAttribute('data-preview-group'); 102 | group = group || defaultGroupName; 103 | if (!this.groups[group]) { 104 | this.groups[group] = []; 105 | } 106 | var src = img.getAttribute('src'); 107 | if (img.__mui_img_data && img.__mui_img_data.src === src) { //已缓存且图片未变化 108 | this.groups[group].push(img.__mui_img_data); 109 | } else { 110 | var lazyload = img.getAttribute('data-preview-src'); 111 | if (!lazyload) { 112 | lazyload = src; 113 | } 114 | var imgObj = { 115 | src: src, 116 | lazyload: src === lazyload ? '' : lazyload, 117 | loaded: src === lazyload ? true : false, 118 | sWidth: 0, 119 | sHeight: 0, 120 | sTop: 0, 121 | sLeft: 0, 122 | sScale: 1, 123 | el: img 124 | }; 125 | this.groups[group].push(imgObj); 126 | img.__mui_img_data = imgObj; 127 | } 128 | }; 129 | 130 | 131 | proto.empty = function() { 132 | this.scroller.innerHTML = ''; 133 | }; 134 | proto._initImgData = function(itemData, imgEl) { 135 | if (!itemData.sWidth) { 136 | var img = itemData.el; 137 | itemData.sWidth = img.offsetWidth; 138 | itemData.sHeight = img.offsetHeight; 139 | var offset = $.offset(img); 140 | itemData.sTop = offset.top; 141 | itemData.sLeft = offset.left; 142 | itemData.sScale = Math.max(itemData.sWidth / window.innerWidth, itemData.sHeight / window.innerHeight); 143 | } 144 | imgEl.style.webkitTransform = 'translate3d(0,0,0) scale(' + itemData.sScale + ')'; 145 | }; 146 | 147 | proto._getScale = function(from, to) { 148 | var scaleX = from.width / to.width; 149 | var scaleY = from.height / to.height; 150 | var scale = 1; 151 | if (scaleX <= scaleY) { 152 | scale = from.height / (to.height * scaleX); 153 | } else { 154 | scale = from.width / (to.width * scaleY); 155 | } 156 | return scale; 157 | }; 158 | proto._imgTransitionEnd = function(e) { 159 | var img = e.target; 160 | img.classList.remove($.className('transitioning')); 161 | img.removeEventListener('webkitTransitionEnd', this._imgTransitionEnd.bind(this)); 162 | }; 163 | proto._loadItem = function(index, isOpening) { //TODO 暂时仅支持img 164 | var itemEl = this.scroller.querySelector($.classSelector('.slider-item:nth-child(' + (index + 1) + ')')); 165 | var itemData = this.currentGroup[index]; 166 | var imgEl = itemEl.querySelector('img'); 167 | this._initImgData(itemData, imgEl); 168 | if (isOpening) { 169 | var posi = this._getPosition(itemData); 170 | imgEl.style.webkitTransitionDuration = '0ms'; 171 | imgEl.style.webkitTransform = 'translate3d(' + posi.x + 'px,' + posi.y + 'px,0) scale(' + itemData.sScale + ')'; 172 | imgEl.offsetHeight; 173 | } 174 | if (!itemData.loaded && imgEl.getAttribute('data-preview-lazyload')) { 175 | var self = this; 176 | self.loader.classList.add($.className('active')); 177 | //移动位置动画 178 | imgEl.style.webkitTransitionDuration = '0.5s'; 179 | imgEl.addEventListener('webkitTransitionEnd', self._imgTransitionEnd.bind(self)); 180 | imgEl.style.webkitTransform = 'translate3d(0,0,0) scale(' + itemData.sScale + ')'; 181 | this.loadImage(imgEl, function() { 182 | itemData.loaded = true; 183 | imgEl.src = itemData.lazyload; 184 | self._initZoom(itemEl, this.width, this.height); 185 | imgEl.classList.add($.className('transitioning')); 186 | imgEl.addEventListener('webkitTransitionEnd', self._imgTransitionEnd.bind(self)); 187 | imgEl.setAttribute('style', ''); 188 | imgEl.offsetHeight; 189 | self.loader.classList.remove($.className('active')); 190 | }); 191 | } else { 192 | itemData.lazyload && (imgEl.src = itemData.lazyload); 193 | this._initZoom(itemEl, imgEl.width, imgEl.height); 194 | imgEl.classList.add($.className('transitioning')); 195 | imgEl.addEventListener('webkitTransitionEnd', this._imgTransitionEnd.bind(this)); 196 | imgEl.setAttribute('style', ''); 197 | imgEl.offsetHeight; 198 | } 199 | this._preloadItem(index + 1); 200 | this._preloadItem(index - 1); 201 | }; 202 | proto._preloadItem = function(index) { 203 | var itemEl = this.scroller.querySelector($.classSelector('.slider-item:nth-child(' + (index + 1) + ')')); 204 | if (itemEl) { 205 | var itemData = this.currentGroup[index]; 206 | if (!itemData.sWidth) { 207 | var imgEl = itemEl.querySelector('img'); 208 | this._initImgData(itemData, imgEl); 209 | } 210 | } 211 | }; 212 | proto._initZoom = function(zoomWrapperEl, zoomerWidth, zoomerHeight) { 213 | if (!this.options.zoom) { 214 | return; 215 | } 216 | if (zoomWrapperEl.getAttribute('data-zoomer')) { 217 | return; 218 | } 219 | var zoomEl = zoomWrapperEl.querySelector($.classSelector('.zoom')); 220 | if (zoomEl.tagName === 'IMG') { 221 | var self = this; 222 | var maxZoom = self._getScale({ 223 | width: zoomWrapperEl.offsetWidth, 224 | height: zoomWrapperEl.offsetHeight 225 | }, { 226 | width: zoomerWidth, 227 | height: zoomerHeight 228 | }); 229 | $(zoomWrapperEl).zoom({ 230 | maxZoom: Math.max(maxZoom, 1) 231 | }); 232 | } else { 233 | $(zoomWrapperEl).zoom(); 234 | } 235 | }; 236 | proto.loadImage = function(imgEl, callback) { 237 | var onReady = function() { 238 | callback && callback.call(this); 239 | }; 240 | var img = new Image(); 241 | img.onload = onReady; 242 | img.onerror = onReady; 243 | img.src = imgEl.getAttribute('data-preview-lazyload'); 244 | }; 245 | proto.getRangeByIndex = function(index, length) { 246 | return { 247 | from: 0, 248 | to: length - 1 249 | }; 250 | // var from = Math.max(index - 1, 0); 251 | // var to = Math.min(index + 1, length); 252 | // if (index === length - 1) { 253 | // from = Math.max(length - 3, 0); 254 | // to = length - 1; 255 | // } 256 | // if (index === 0) { 257 | // from = 0; 258 | // to = Math.min(2, length - 1); 259 | // } 260 | // return { 261 | // from: from, 262 | // to: to 263 | // }; 264 | }; 265 | 266 | proto._getPosition = function(itemData) { 267 | var sLeft = itemData.sLeft - window.pageXOffset; 268 | var sTop = itemData.sTop - window.pageYOffset; 269 | var left = (window.innerWidth - itemData.sWidth) / 2; 270 | var top = (window.innerHeight - itemData.sHeight) / 2; 271 | return { 272 | left: sLeft, 273 | top: sTop, 274 | x: sLeft - left, 275 | y: sTop - top 276 | }; 277 | }; 278 | proto.refresh = function(index, groupArray) { 279 | this.currentGroup = groupArray; 280 | //重新生成slider 281 | var length = groupArray.length; 282 | var itemHtml = []; 283 | var currentRange = this.getRangeByIndex(index, length); 284 | var from = currentRange.from; 285 | var to = currentRange.to + 1; 286 | var currentIndex = index; 287 | var className = ''; 288 | var itemStr = ''; 289 | var wWidth = window.innerWidth; 290 | var wHeight = window.innerHeight; 291 | for (var i = 0; from < to; from++, i++) { 292 | var itemData = groupArray[from]; 293 | var style = ''; 294 | if (itemData.sWidth) { 295 | style = '-webkit-transform:translate3d(0,0,0) scale(' + itemData.sScale + ');transform:translate3d(0,0,0) scale(' + itemData.sScale + ')'; 296 | } 297 | itemStr = itemTemplate.replace('{{src}}', itemData.src).replace('{{lazyload}}', itemData.lazyload).replace('{{style}}', style); 298 | if (from === index) { 299 | currentIndex = i; 300 | className = $.className('active'); 301 | } else { 302 | className = ''; 303 | } 304 | itemHtml.push(itemStr.replace('{{className}}', className)); 305 | } 306 | this.scroller.innerHTML = itemHtml.join(''); 307 | this.element.style.display = 'block'; 308 | this.element.classList.add($.className('preview-in')); 309 | this.lastIndex = currentIndex; 310 | this.element.offsetHeight; 311 | $(this.element).slider().gotoItem(currentIndex, 0); 312 | this.indicator && (this.indicator.innerText = (currentIndex + 1) + '/' + this.currentGroup.length); 313 | this._loadItem(currentIndex, true); 314 | }; 315 | proto.openByGroup = function(index, group) { 316 | index = Math.min(Math.max(0, index), this.groups[group].length - 1); 317 | this.refresh(index, this.groups[group]); 318 | }; 319 | proto.open = function(index, group) { 320 | if (this.isShown()) { 321 | return; 322 | } 323 | if (typeof index === "number") { 324 | group = group || defaultGroupName; 325 | this.addImages(group, index); //刷新当前group 326 | this.openByGroup(index, group); 327 | } else { 328 | group = index.getAttribute('data-preview-group'); 329 | group = group || defaultGroupName; 330 | this.addImages(group, index); //刷新当前group 331 | this.openByGroup(this.groups[group].indexOf(index.__mui_img_data), group); 332 | } 333 | }; 334 | proto.close = function(index, group) { 335 | if (!this.isShown()) { 336 | return; 337 | } 338 | this.element.classList.remove($.className('preview-in')); 339 | this.element.classList.add($.className('preview-out')); 340 | var itemEl = this.scroller.querySelector($.classSelector('.slider-item:nth-child(' + (this.lastIndex + 1) + ')')); 341 | var imgEl = itemEl.querySelector('img'); 342 | if (imgEl) { 343 | imgEl.classList.add($.className('transitioning')); 344 | var itemData = this.currentGroup[this.lastIndex]; 345 | var posi = this._getPosition(itemData); 346 | var sLeft = posi.left; 347 | var sTop = posi.top; 348 | if (sTop > window.innerHeight || sLeft > window.innerWidth || sTop < 0 || sLeft < 0) { //out viewport 349 | imgEl.style.opacity = 0; 350 | imgEl.style.webkitTransitionDuration = '0.5s'; 351 | imgEl.style.webkitTransform = 'scale(' + itemData.sScale + ')'; 352 | } else { 353 | if (this.options.zoom) { 354 | $(imgEl.parentNode.parentNode).zoom().toggleZoom(0); 355 | } 356 | imgEl.style.webkitTransitionDuration = '0.5s'; 357 | imgEl.style.webkitTransform = 'translate3d(' + posi.x + 'px,' + posi.y + 'px,0) scale(' + itemData.sScale + ')'; 358 | } 359 | } 360 | var zoomers = this.element.querySelectorAll($.classSelector('.zoom-wrapper')); 361 | for (var i = 0, len = zoomers.length; i < len; i++) { 362 | $(zoomers[i]).zoom().destroy(); 363 | } 364 | $(this.element).slider().destroy(); 365 | // this.empty(); 366 | }; 367 | proto.isShown = function() { 368 | return this.element.classList.contains($.className('preview-in')); 369 | }; 370 | 371 | var previewImageApi = null; 372 | $.previewImage = function(options) { 373 | if (!previewImageApi) { 374 | previewImageApi = new PreviewImage(options); 375 | } 376 | return previewImageApi; 377 | }; 378 | $.getPreviewImage = function() { 379 | return previewImageApi; 380 | } 381 | 382 | })(mui, window); -------------------------------------------------------------------------------- /ZXYWebView/WKWebView/newsHtmlFiles/scripts/public/mui.zoom.js: -------------------------------------------------------------------------------- 1 | (function($, window) { 2 | var CLASS_ZOOM = $.className('zoom'); 3 | var CLASS_ZOOM_SCROLLER = $.className('zoom-scroller'); 4 | 5 | var SELECTOR_ZOOM = '.' + CLASS_ZOOM; 6 | var SELECTOR_ZOOM_SCROLLER = '.' + CLASS_ZOOM_SCROLLER; 7 | 8 | var EVENT_PINCH_START = 'pinchstart'; 9 | var EVENT_PINCH = 'pinch'; 10 | var EVENT_PINCH_END = 'pinchend'; 11 | if ('ongesturestart' in window) { 12 | EVENT_PINCH_START = 'gesturestart'; 13 | EVENT_PINCH = 'gesturechange'; 14 | EVENT_PINCH_END = 'gestureend'; 15 | } 16 | $.Zoom = function(element, options) { 17 | var zoom = this; 18 | 19 | zoom.options = $.extend($.Zoom.defaults, options); 20 | 21 | zoom.wrapper = zoom.element = element; 22 | zoom.scroller = element.querySelector(SELECTOR_ZOOM_SCROLLER); 23 | zoom.scrollerStyle = zoom.scroller && zoom.scroller.style; 24 | 25 | zoom.zoomer = element.querySelector(SELECTOR_ZOOM); 26 | zoom.zoomerStyle = zoom.zoomer && zoom.zoomer.style; 27 | 28 | zoom.init = function() { 29 | //自动启用 30 | $.options.gestureConfig.pinch = true; 31 | $.options.gestureConfig.doubletap = true; 32 | zoom.initEvents(); 33 | }; 34 | 35 | zoom.initEvents = function(detach) { 36 | var action = detach ? 'removeEventListener' : 'addEventListener'; 37 | var target = zoom.scroller; 38 | 39 | target[action](EVENT_PINCH_START, zoom.onPinchstart); 40 | target[action](EVENT_PINCH, zoom.onPinch); 41 | target[action](EVENT_PINCH_END, zoom.onPinchend); 42 | 43 | target[action]($.EVENT_START, zoom.onTouchstart); 44 | target[action]($.EVENT_MOVE, zoom.onTouchMove); 45 | target[action]($.EVENT_CANCEL, zoom.onTouchEnd); 46 | target[action]($.EVENT_END, zoom.onTouchEnd); 47 | 48 | target[action]('drag', zoom.dragEvent); 49 | target[action]('doubletap', zoom.doubleTapEvent); 50 | }; 51 | zoom.dragEvent = function(e) { 52 | if (imageIsMoved || isGesturing) { 53 | e.stopPropagation(); 54 | } 55 | }; 56 | zoom.doubleTapEvent = function(e) { 57 | zoom.toggleZoom(e.detail.center); 58 | }; 59 | zoom.transition = function(style, time) { 60 | time = time || 0; 61 | style['webkitTransitionDuration'] = time + 'ms'; 62 | return zoom; 63 | }; 64 | zoom.translate = function(style, x, y) { 65 | x = x || 0; 66 | y = y || 0; 67 | style['webkitTransform'] = 'translate3d(' + x + 'px,' + y + 'px,0px)'; 68 | return zoom; 69 | }; 70 | zoom.scale = function(style, scale) { 71 | scale = scale || 1; 72 | style['webkitTransform'] = 'translate3d(0,0,0) scale(' + scale + ')'; 73 | return zoom; 74 | }; 75 | zoom.scrollerTransition = function(time) { 76 | return zoom.transition(zoom.scrollerStyle, time); 77 | }; 78 | zoom.scrollerTransform = function(x, y) { 79 | return zoom.translate(zoom.scrollerStyle, x, y); 80 | }; 81 | zoom.zoomerTransition = function(time) { 82 | return zoom.transition(zoom.zoomerStyle, time); 83 | }; 84 | zoom.zoomerTransform = function(scale) { 85 | return zoom.scale(zoom.zoomerStyle, scale); 86 | }; 87 | 88 | // Gestures 89 | var scale = 1, 90 | currentScale = 1, 91 | isScaling = false, 92 | isGesturing = false; 93 | zoom.onPinchstart = function(e) { 94 | isGesturing = true; 95 | }; 96 | zoom.onPinch = function(e) { 97 | if (!isScaling) { 98 | zoom.zoomerTransition(0); 99 | isScaling = true; 100 | } 101 | scale = (e.detail ? e.detail.scale : e.scale) * currentScale; 102 | if (scale > zoom.options.maxZoom) { 103 | scale = zoom.options.maxZoom - 1 + Math.pow((scale - zoom.options.maxZoom + 1), 0.5); 104 | } 105 | if (scale < zoom.options.minZoom) { 106 | scale = zoom.options.minZoom + 1 - Math.pow((zoom.options.minZoom - scale + 1), 0.5); 107 | } 108 | zoom.zoomerTransform(scale); 109 | }; 110 | zoom.onPinchend = function(e) { 111 | scale = Math.max(Math.min(scale, zoom.options.maxZoom), zoom.options.minZoom); 112 | zoom.zoomerTransition(zoom.options.speed).zoomerTransform(scale); 113 | currentScale = scale; 114 | isScaling = false; 115 | }; 116 | zoom.setZoom = function(newScale) { 117 | scale = currentScale = newScale; 118 | zoom.scrollerTransition(zoom.options.speed).scrollerTransform(0, 0); 119 | zoom.zoomerTransition(zoom.options.speed).zoomerTransform(scale); 120 | }; 121 | zoom.toggleZoom = function(position, speed) { 122 | if (typeof position === 'number') { 123 | speed = position; 124 | position = undefined; 125 | } 126 | speed = typeof speed === 'undefined' ? zoom.options.speed : speed; 127 | if (scale && scale !== 1) { 128 | scale = currentScale = 1; 129 | zoom.scrollerTransition(speed).scrollerTransform(0, 0); 130 | } else { 131 | scale = currentScale = zoom.options.maxZoom; 132 | if (position) { 133 | var offset = $.offset(zoom.zoomer); 134 | var top = offset.top; 135 | var left = offset.left; 136 | var offsetX = (position.x - left) * scale; 137 | var offsetY = (position.y - top) * scale; 138 | this._cal(); 139 | if (offsetX >= imageMaxX && offsetX <= (imageMaxX + wrapperWidth)) { //center 140 | offsetX = imageMaxX - offsetX + wrapperWidth / 2; 141 | } else if (offsetX < imageMaxX) { //left 142 | offsetX = imageMaxX - offsetX + wrapperWidth / 2; 143 | } else if (offsetX > (imageMaxX + wrapperWidth)) { //right 144 | offsetX = imageMaxX + wrapperWidth - offsetX - wrapperWidth / 2; 145 | } 146 | if (offsetY >= imageMaxY && offsetY <= (imageMaxY + wrapperHeight)) { //middle 147 | offsetY = imageMaxY - offsetY + wrapperHeight / 2; 148 | } else if (offsetY < imageMaxY) { //top 149 | offsetY = imageMaxY - offsetY + wrapperHeight / 2; 150 | } else if (offsetY > (imageMaxY + wrapperHeight)) { //bottom 151 | offsetY = imageMaxY + wrapperHeight - offsetY - wrapperHeight / 2; 152 | } 153 | offsetX = Math.min(Math.max(offsetX, imageMinX), imageMaxX); 154 | offsetY = Math.min(Math.max(offsetY, imageMinY), imageMaxY); 155 | zoom.scrollerTransition(speed).scrollerTransform(offsetX, offsetY); 156 | } else { 157 | zoom.scrollerTransition(speed).scrollerTransform(0, 0); 158 | } 159 | } 160 | zoom.zoomerTransition(speed).zoomerTransform(scale); 161 | }; 162 | 163 | zoom._cal = function() { 164 | wrapperWidth = zoom.wrapper.offsetWidth; 165 | wrapperHeight = zoom.wrapper.offsetHeight; 166 | imageWidth = zoom.zoomer.offsetWidth; 167 | imageHeight = zoom.zoomer.offsetHeight; 168 | var scaledWidth = imageWidth * scale; 169 | var scaledHeight = imageHeight * scale; 170 | imageMinX = Math.min((wrapperWidth / 2 - scaledWidth / 2), 0); 171 | imageMaxX = -imageMinX; 172 | imageMinY = Math.min((wrapperHeight / 2 - scaledHeight / 2), 0); 173 | imageMaxY = -imageMinY; 174 | }; 175 | 176 | var wrapperWidth, wrapperHeight, imageIsTouched, imageIsMoved, imageCurrentX, imageCurrentY, imageMinX, imageMinY, imageMaxX, imageMaxY, imageWidth, imageHeight, imageTouchesStart = {}, 177 | imageTouchesCurrent = {}, 178 | imageStartX, imageStartY, velocityPrevPositionX, velocityPrevTime, velocityX, velocityPrevPositionY, velocityY; 179 | 180 | zoom.onTouchstart = function(e) { 181 | e.preventDefault(); 182 | imageIsTouched = true; 183 | imageTouchesStart.x = e.type === $.EVENT_START ? e.targetTouches[0].pageX : e.pageX; 184 | imageTouchesStart.y = e.type === $.EVENT_START ? e.targetTouches[0].pageY : e.pageY; 185 | }; 186 | zoom.onTouchMove = function(e) { 187 | e.preventDefault(); 188 | if (!imageIsTouched) return; 189 | if (!imageIsMoved) { 190 | wrapperWidth = zoom.wrapper.offsetWidth; 191 | wrapperHeight = zoom.wrapper.offsetHeight; 192 | imageWidth = zoom.zoomer.offsetWidth; 193 | imageHeight = zoom.zoomer.offsetHeight; 194 | var translate = $.parseTranslateMatrix($.getStyles(zoom.scroller, 'webkitTransform')); 195 | imageStartX = translate.x || 0; 196 | imageStartY = translate.y || 0; 197 | zoom.scrollerTransition(0); 198 | } 199 | var scaledWidth = imageWidth * scale; 200 | var scaledHeight = imageHeight * scale; 201 | 202 | if (scaledWidth < wrapperWidth && scaledHeight < wrapperHeight) return; 203 | 204 | imageMinX = Math.min((wrapperWidth / 2 - scaledWidth / 2), 0); 205 | imageMaxX = -imageMinX; 206 | imageMinY = Math.min((wrapperHeight / 2 - scaledHeight / 2), 0); 207 | imageMaxY = -imageMinY; 208 | 209 | imageTouchesCurrent.x = e.type === $.EVENT_MOVE ? e.targetTouches[0].pageX : e.pageX; 210 | imageTouchesCurrent.y = e.type === $.EVENT_MOVE ? e.targetTouches[0].pageY : e.pageY; 211 | 212 | if (!imageIsMoved && !isScaling) { 213 | // if (Math.abs(imageTouchesCurrent.y - imageTouchesStart.y) < Math.abs(imageTouchesCurrent.x - imageTouchesStart.x)) { 214 | //TODO 此处需要优化,当遇到长图,需要上下滚动时,下列判断会导致滚动不流畅 215 | if ( 216 | (Math.floor(imageMinX) === Math.floor(imageStartX) && imageTouchesCurrent.x < imageTouchesStart.x) || 217 | (Math.floor(imageMaxX) === Math.floor(imageStartX) && imageTouchesCurrent.x > imageTouchesStart.x) 218 | ) { 219 | imageIsTouched = false; 220 | return; 221 | } 222 | // } 223 | } 224 | imageIsMoved = true; 225 | imageCurrentX = imageTouchesCurrent.x - imageTouchesStart.x + imageStartX; 226 | imageCurrentY = imageTouchesCurrent.y - imageTouchesStart.y + imageStartY; 227 | 228 | if (imageCurrentX < imageMinX) { 229 | imageCurrentX = imageMinX + 1 - Math.pow((imageMinX - imageCurrentX + 1), 0.8); 230 | } 231 | if (imageCurrentX > imageMaxX) { 232 | imageCurrentX = imageMaxX - 1 + Math.pow((imageCurrentX - imageMaxX + 1), 0.8); 233 | } 234 | 235 | if (imageCurrentY < imageMinY) { 236 | imageCurrentY = imageMinY + 1 - Math.pow((imageMinY - imageCurrentY + 1), 0.8); 237 | } 238 | if (imageCurrentY > imageMaxY) { 239 | imageCurrentY = imageMaxY - 1 + Math.pow((imageCurrentY - imageMaxY + 1), 0.8); 240 | } 241 | 242 | //Velocity 243 | if (!velocityPrevPositionX) velocityPrevPositionX = imageTouchesCurrent.x; 244 | if (!velocityPrevPositionY) velocityPrevPositionY = imageTouchesCurrent.y; 245 | if (!velocityPrevTime) velocityPrevTime = $.now(); 246 | velocityX = (imageTouchesCurrent.x - velocityPrevPositionX) / ($.now() - velocityPrevTime) / 2; 247 | velocityY = (imageTouchesCurrent.y - velocityPrevPositionY) / ($.now() - velocityPrevTime) / 2; 248 | if (Math.abs(imageTouchesCurrent.x - velocityPrevPositionX) < 2) velocityX = 0; 249 | if (Math.abs(imageTouchesCurrent.y - velocityPrevPositionY) < 2) velocityY = 0; 250 | velocityPrevPositionX = imageTouchesCurrent.x; 251 | velocityPrevPositionY = imageTouchesCurrent.y; 252 | velocityPrevTime = $.now(); 253 | 254 | zoom.scrollerTransform(imageCurrentX, imageCurrentY); 255 | }; 256 | zoom.onTouchEnd = function(e) { 257 | if (!e.touches.length) { 258 | isGesturing = false; 259 | } 260 | if (!imageIsTouched || !imageIsMoved) { 261 | imageIsTouched = false; 262 | imageIsMoved = false; 263 | return; 264 | } 265 | imageIsTouched = false; 266 | imageIsMoved = false; 267 | var momentumDurationX = 300; 268 | var momentumDurationY = 300; 269 | var momentumDistanceX = velocityX * momentumDurationX; 270 | var newPositionX = imageCurrentX + momentumDistanceX; 271 | var momentumDistanceY = velocityY * momentumDurationY; 272 | var newPositionY = imageCurrentY + momentumDistanceY; 273 | 274 | if (velocityX !== 0) momentumDurationX = Math.abs((newPositionX - imageCurrentX) / velocityX); 275 | if (velocityY !== 0) momentumDurationY = Math.abs((newPositionY - imageCurrentY) / velocityY); 276 | var momentumDuration = Math.max(momentumDurationX, momentumDurationY); 277 | 278 | imageCurrentX = newPositionX; 279 | imageCurrentY = newPositionY; 280 | 281 | var scaledWidth = imageWidth * scale; 282 | var scaledHeight = imageHeight * scale; 283 | imageMinX = Math.min((wrapperWidth / 2 - scaledWidth / 2), 0); 284 | imageMaxX = -imageMinX; 285 | imageMinY = Math.min((wrapperHeight / 2 - scaledHeight / 2), 0); 286 | imageMaxY = -imageMinY; 287 | imageCurrentX = Math.max(Math.min(imageCurrentX, imageMaxX), imageMinX); 288 | imageCurrentY = Math.max(Math.min(imageCurrentY, imageMaxY), imageMinY); 289 | 290 | zoom.scrollerTransition(momentumDuration).scrollerTransform(imageCurrentX, imageCurrentY); 291 | }; 292 | zoom.destroy = function() { 293 | zoom.initEvents(true); //detach 294 | delete $.data[zoom.wrapper.getAttribute('data-zoomer')]; 295 | zoom.wrapper.setAttribute('data-zoomer', ''); 296 | } 297 | zoom.init(); 298 | return zoom; 299 | }; 300 | $.Zoom.defaults = { 301 | speed: 300, 302 | maxZoom: 3, 303 | minZoom: 1, 304 | }; 305 | $.fn.zoom = function(options) { 306 | var zoomApis = []; 307 | this.each(function() { 308 | var zoomApi = null; 309 | var self = this; 310 | var id = self.getAttribute('data-zoomer'); 311 | if (!id) { 312 | id = ++$.uuid; 313 | $.data[id] = zoomApi = new $.Zoom(self, options); 314 | self.setAttribute('data-zoomer', id); 315 | } else { 316 | zoomApi = $.data[id]; 317 | } 318 | zoomApis.push(zoomApi); 319 | }); 320 | return zoomApis.length === 1 ? zoomApis[0] : zoomApis; 321 | }; 322 | })(mui, window); -------------------------------------------------------------------------------- /ZXYWebView/WKWebView/newsHtmlFiles/scripts/public/public.js: -------------------------------------------------------------------------------- 1 | //获取链接后附加的参数(n=>参数名) 2 | function GetQueryString(n) { 3 | var e = new RegExp("(^|&)" + n + "=([^&]*)(&|$)"), 4 | r = window.location.search.substr(1).match(e); return null != r ? decodeURI(r[2]) : null; 5 | } -------------------------------------------------------------------------------- /ZXYWebView/WKWebView/newsHtmlFiles/styles/ShareHeader.css: -------------------------------------------------------------------------------- 1 | .load_notify{width:100%;height:52px;position:fixed;top:0;left:0;z-index:20;background-color:#fff;box-sizing:border-box;padding:6px 20px 6px 14px;display:flex;display:-webkit-flex;-webkit-justify-content:space-between;justify-content:space-between;box-shadow:0 1px 6px 0 rgba(0,0,0,.1)}.load_notify .hcc_logo_box{display:flex;display:-webkit-flex}.load_notify .hcc_logo_box .hcc_logo{width:40px;height:40px;margin-right:4px}.load_notify .hcc_logo_box .hcc_logo img{width:100%}.load_notify .hcc_logo_box .hcc_desc_box{text-align:left}.load_notify .hcc_logo_box .hcc_desc_box .hcc_name{font-size:16px;line-height:22px;color:#333;font-weight:600;text-align:left}.load_notify .hcc_logo_box .hcc_desc_box .hcc_slogan{font-size:12px;line-height:18px;color:#999;text-align:left}.load_notify .open_btn{width:78px;height:32px;background-color:#00bebe;text-align:center;color:#fff;font-size:14px;line-height:32px;border-radius:8px;position:absolute;right:20px;top:50%;transform:translate(-50%)} -------------------------------------------------------------------------------- /ZXYWebView/WKWebView/newsHtmlFiles/styles/introduction.css: -------------------------------------------------------------------------------- 1 | body,div,h1,h2,h3,p{margin:0;padding:0}body{background-color:#fff}*{touch-action:pan-y;word-break:break-word}.title{display:none}.about_box{width:100%;box-sizing:border-box!important;-moz-box-sizing:border-box!important;-webkit-box-sizing:border-box!important;-o-box-sizing:border-box!important;-ms-box-sizing:border-box!important;padding:20px 20px 40px;font-family:PingFangSC}.about_box p{font-size:14px;line-height:1.5;text-align:justify;color:#333}.introduction_box{width:100%;box-sizing:border-box!important;-moz-box-sizing:border-box!important;-webkit-box-sizing:border-box!important;-o-box-sizing:border-box!important;-ms-box-sizing:border-box!important;padding:0 20px;font-family:PingFangSC;padding-bottom:28px}.introduction_box h2{font-size:24px;line-height:36px;text-align:left;padding:12px 0;color:#333;font-weight:600}.introduction_box p{font-size:18px;line-height:30px;text-indent:0;text-align:justify;color:#333;margin-bottom:30px}.introduction_box p:nth-last-of-type(1){margin-bottom:0}.data_loading,.empty_data,.removed,.server_error{width:100%;height:100%;position:fixed;top:0;left:0;z-index:20;display:none;background-color:#fff}.data_loading .node_chunk,.empty_data .node_chunk,.removed .node_chunk,.server_error .node_chunk{position:relative;top:22%}.data_loading .node_chunk.loading,.empty_data .node_chunk.loading,.removed .node_chunk.loading,.server_error .node_chunk.loading{width:110px;height:110px;background-color:rgba(0,0,0,0.88);padding:22px 0;margin:0 auto;position:relative;top:30%}.data_loading .node_chunk.loading span,.empty_data .node_chunk.loading span,.removed .node_chunk.loading span,.server_error .node_chunk.loading span{display:block;width:36px;height:36px;border-radius:50%;border:2px solid #fff;box-sizing:border-box;position:absolute;left:50%;margin-left:-18px}.data_loading .node_chunk.loading p,.empty_data .node_chunk.loading p,.removed .node_chunk.loading p,.server_error .node_chunk.loading p{font-size:16px;line-height:24px;color:#fff;text-align:center;margin-top:5px;position:absolute;bottom:20px}.data_loading .node_chunk img,.empty_data .node_chunk img,.removed .node_chunk img,.server_error .node_chunk img{width:240px;height:240px;display:block;margin:0 auto}.data_loading .node_chunk p,.empty_data .node_chunk p,.removed .node_chunk p,.server_error .node_chunk p{width:100%;text-align:center;font-size:14px;line-height:1.5;color:#999;margin-top:8px}.data_loading .node_chunk .refresh_btn,.empty_data .node_chunk .refresh_btn,.removed .node_chunk .refresh_btn,.server_error .node_chunk .refresh_btn{width:160px;height:48px;margin:0 auto;margin-top:8px;background-color:#00bebe;text-align:center;border-radius:4px;font-size:18px;line-height:48px;color:#fff} -------------------------------------------------------------------------------- /ZXYWebView/WKWebView/newsHtmlFiles/styles/newsDetails.css: -------------------------------------------------------------------------------- 1 | body,div,h1,h2,h3,p{margin:0;padding:0}body{background-color:#fff;font-family:PingFangSC}title{text-align:center}*{touch-action:pan-y}.mui-zoom-scroller{overflow:hidden}.clearFix:after{content:"";height:0;display:block;visibility:hidden;clear:both}.comment_right_text{width:100%;border-bottom:1px solid #e5e5e5}.comment_right_text .text_content{width:100%;margin-top:5px;font-size:16px;line-height:1.5;text-indent:0;text-align:justify;color:#333;margin-bottom:12px}.comment_right_text .text_content p{font-size:16px;line-height:1.5;text-indent:0;text-align:justify;color:#333}.comment_right_text .text_content.two_line{text-overflow:ellipsis;overflow:hidden;-webkit-line-clamp:2;display:-webkit-box;-webkit-box-orient:vertical;height:48px}.comment_right_text .imgs_content{width:100%;position:relative;margin-top:12px}.comment_right_text .imgs_content .imgs_list{display:flex;display:-webkit-flex;-webkit-justify-content:space-between;justify-content:space-between}.comment_right_text .imgs_content .imgs_list .square_box{width:32%;float:left;box-sizing:border-box;padding:8px 8px 0 0;overflow:hidden;position:relative;display:none;margin-bottom:6px;margin-left:1%}.comment_right_text .imgs_content .imgs_list .square_box:nth-of-type(1),.comment_right_text .imgs_content .imgs_list .square_box:nth-of-type(2),.comment_right_text .imgs_content .imgs_list .square_box:nth-of-type(3){display:block}.comment_right_text .imgs_content .imgs_list .square_box .img_box{padding-bottom:100%;width:100%;height:0;background-size:cover;background-position:center}.comment_right_text .imgs_content .imgs_list .square_box .img_box img{min-width:100%;height:100%;position:absolute;top:0;left:0;z-index:1;opacity:0}.comment_right_text .imgs_content .imgs_num_note{display:block;padding:0 5px;height:18px;position:absolute;bottom:0;right:11px;color:#fff;background-color:rgba(0,0,0,0.3);z-index:2;font-size:12px;line-height:1.5;border-top-left-radius:4px}.main_box{width:100%;min-height:100%;background-color:#fff;font-family:PingFangSC;padding-top:50px;margin-bottom:10px}.main_box .load_btn{position:fixed;left:50%;margin-left:-65px;bottom:36px;width:130px;height:44px;background-color:#00bebe;color:#fff;box-shadow:0 3px 10px 0 rgba(0,0,0,0.24);border-radius:8px;font-size:16px;font-family:PingFangSC;font-weight:600;line-height:44px;text-align:center;z-index:2}.main_box .main_content{width:100%;box-sizing:border-box;padding:20px}.main_box .main_content .main_top{width:100%}.main_box .main_content .main_top .new_title p{font-size:24px;line-height:34px;font-weight:600;color:#303030}.main_box .main_content .main_top .news_attach{width:100%;text-align:left;height:44px;box-sizing:border-box;padding:12px 0}.main_box .main_content .main_top .news_attach .clk-num{float:right;color:#999;font-size:12px;min-width:108px;text-align:right}.main_box .main_content .main_top .news_attach .complaint_platform_time{text-align:left}.main_box .main_content .main_top .news_attach .complaint_platform_time span{font-size:12px;line-height:18px;color:#999}.main_box .main_content .main_top .news_attach .news_platform_logo{width:16px;height:16px;display:inline-block;vertical-align:middle;margin-right:4px}.main_box .main_content .main_top .news_attach .new_platform_name,.main_box .main_content .main_top .news_attach .publish_time{font-size:12px;line-height:18px;color:#909090}.main_box .main_content .dealer_content{width:100%;margin-top:28px}.main_box .main_content .dealer_content .dealer_box{width:100%;display:flex;display:-webkit-flex;box-sizing:border-box;padding:16px 20px 16px 12px;box-shadow:0 0 10px rgba(0,0,0,0.12);-moz-border-radius:4px!important;-webkit-border-radius:4px!important;border-radius:4px!important}.main_box .main_content .dealer_content .dealer_box .dealer_logo_box{width:90px;height:63px;position:relative;border:.5px solid #e5e5e5;background-color:#fff;background-size:cover;background-position:center;background-repeat:no-repeat;border-radius:5px}.main_box .main_content .dealer_content .dealer_box .dealer_logo_box img{width:100%;vertical-align:middle;height:100%}.main_box .main_content .dealer_content .dealer_box .dealer_logo_box p{width:auto;height:16px;display:block;position:absolute;top:-2px;left:-2px;font-size:10px;line-height:16px;color:#fff;text-align:center;padding:0 5px;background-color:#2cc084;border-top-left-radius:4px;border-bottom-right-radius:4px;border-bottom-left-radius:4px;background-color:#f4704b;max-width:88px}.main_box .main_content .dealer_content .dealer_box .dealer_logo_box p em{text-overflow:ellipsis;max-width:88px;white-space:nowrap;overflow:hidden;display:inline-block}.main_box .main_content .dealer_content .dealer_box .dealer_logo_box p:after{content:"";position:absolute;top:0;right:-2px;width:0;height:0;border-bottom:2px solid #1b5a41;border-right:2px solid transparent}.main_box .main_content .dealer_content .dealer_box .dealer_logo_box p.status1,.main_box .main_content .dealer_content .dealer_box .dealer_logo_box p.status8{background-color:#2cc084} 2 | .main_box .main_content .dealer_content .dealer_box .dealer_logo_box p.status14,.main_box .main_content .dealer_content .dealer_box .dealer_logo_box p.status18,.main_box .main_content .dealer_content .dealer_box .dealer_logo_box p.status2,.main_box .main_content .dealer_content .dealer_box .dealer_logo_box p.status5,.main_box .main_content .dealer_content .dealer_box .dealer_logo_box p.status6,.main_box .main_content .dealer_content .dealer_box .dealer_logo_box p.status7{background-color:#f4704b}.main_box .main_content .dealer_content .dealer_box .dealer_logo_box p.status0,.main_box .main_content .dealer_content .dealer_box .dealer_logo_box p.status16,.main_box .main_content .dealer_content .dealer_box .dealer_logo_box p.status17,.main_box .main_content .dealer_content .dealer_box .dealer_logo_box p.status19,.main_box .main_content .dealer_content .dealer_box .dealer_logo_box p.status20,.main_box .main_content .dealer_content .dealer_box .dealer_logo_box p.status21,.main_box .main_content .dealer_content .dealer_box .dealer_logo_box p.status22,.main_box .main_content .dealer_content .dealer_box .dealer_logo_box p.status3,.main_box .main_content .dealer_content .dealer_box .dealer_logo_box p.status4,.main_box .main_content .dealer_content .dealer_box .dealer_logo_box p.status15{background-color:#939dac}.main_box .main_content .dealer_content .dealer_box .dealer_desc_box{margin-left:12px;width:calc(100% - 104px)}.main_box .main_content .dealer_content .dealer_box .dealer_desc_box .dealer_main .left_info{float:left}.main_box .main_content .dealer_content .dealer_box .dealer_desc_box .dealer_main .rank-score{float:right;width:36px;height:34px;border-radius:4px;border:solid .5px rgba(254,116,82,0.6);text-align:center;overflow:hidden}.main_box .main_content .dealer_content .dealer_box .dealer_desc_box .dealer_main .rankings{font-size:12px;color:#fff;background-color:#fe7452;line-height:18px}.main_box .main_content .dealer_content .dealer_box .dealer_desc_box .dealer_main .rank{font-size:10px;color:#fff;background-color:#fe7452;line-height:18px}.main_box .main_content .dealer_content .dealer_box .dealer_desc_box .dealer_main .score{font-size:8px;color:rgba(254,116,82,0.8);line-height:15px}.main_box .main_content .dealer_content .dealer_box .dealer_desc_box .dealer_rank .attention{display:inline-block;font-size:11px;color:#666;font-weight:500}.main_box .main_content .dealer_content .dealer_box .dealer_desc_box .dealer_name{font-size:16px;line-height:1.5;color:#333;font-weight:600;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;max-width:145px}.main_box .main_content .dealer_content .dealer_box .dealer_desc_box .dealer_rank{font-size:10px;color:#333}.main_box .main_content .dealer_content .dealer_box .dealer_desc_box .dealer_rank .rank-score{margin:9px 0;border:.5px solid #00bebe;border-radius:6px 0 6px 0;display:inline-block;line-height:17px}.main_box .main_content .dealer_content .dealer_box .dealer_desc_box .dealer_rank .rank-score .ranking{margin-left:8px;color:#fe794b;background-image:url("gray_stars.png");background-repeat:no-repeat;display:inline-block;width:80px;height:18px;position:relative;top:4px}.main_box .main_content .dealer_content .dealer_box .dealer_desc_box .dealer_rank .rank-score .ranking em{display:inline-block;background-image:url("gold_stars.png");background-repeat:no-repeat;width:80px;height:18px}.main_box .main_content .dealer_content .dealer_box .dealer_desc_box .dealer_rank .rank-score .score{text-align:center;display:inline-block;width:38px;color:#00bebe;position:relative;top:-1px}.main_box .main_content .dealer_content .dealer_box .dealer_desc_box .dealer_rank .rank-score .rankings{display:inline-block;width:35px;height:100%;color:#fff;text-align:center;background-color:#00bebe;font-weight:900;border-radius:4px 0 0 0;font-size:12px}.main_box .main_content .dealer_content .dealer_box .dealer_desc_box .dealer_rank .rank-score .rank{display:inline-block;width:50px;height:20px;color:#fff;text-align:center;background-color:#00bebe;font-weight:600}.main_box .main_content .dealer_content .dealer_box .dealer_desc_box .dealer_rank .regulatory{color:#003457;border:.5px solid #003457;line-height:16px;display:inline-block;width:44px;text-align:center;border-radius:6px 0 6px 0;font-weight:500;position:relative;top:-1px;margin-right:6px}.main_box .main_content .dealer_content .dealer_box .dealer_desc_box .dealer_rank .regulatory img{width:8px;vertical-align:middle}.main_box .main_content .dealer_content .dealer_box .dealer_desc_box .dealer_rank .ranking{margin-left:8px;color:#fe794b;background-image:url("gray_stars.png");background-repeat:no-repeat;display:inline-block;width:80px;height:18px;position:relative;top:4px}.main_box .main_content .dealer_content .dealer_box .dealer_desc_box .dealer_rank .ranking em{display:inline-block;background-image:url("gold_stars.png");background-repeat:no-repeat;width:80px;height:18px} 3 | .main_box .main_content .dealer_content .dealer_box .dealer_desc_box .dealer_rank .scroe{background-color:#00bebe;display:inline-block;width:50px;text-align:center;padding:0;color:#fff;font-weight:600;letter-spacing:.2px}.main_box .main_content .dealer_content .dealer_box .dealer_desc_box .dealer_rank .rankings{display:inline-block;width:50px;height:18px;color:#00bebe;text-align:center}.main_box .main_content .dealer_content .dealer_box .dealer_desc_box .dealer_more{font-size:12px;line-height:1.5;color:#999;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.main_box .main_content .dealer_content .dealer_box.no_dealer_data .dealer_logo_box{background-color:#f5f5f5}.main_box .main_content .dealer_content .dealer_box.no_dealer_data .dealer_logo_box img{display:none}.main_box .main_content .dealer_content .dealer_box.no_dealer_data .dealer_desc_box .dealer_rank .ranking{color:#333;margin-left:0}.main_box .main_content .news_content{width:100%;margin-top:28px}.main_box .main_content .news_content .title_img{width:100%;margin-bottom:28px}.main_box .main_content .news_content .title_img img{width:100%}.main_box .main_content .news_content .content_text{font-size:18px;line-height:30px;color:#333;text-align:justify;font-family:PingFangSC}.main_box .main_content .news_content .content_text p{font-size:18px;line-height:30px;color:#333;text-align:justify;font-family:PingFangSC;margin-bottom:20px}.main_box .main_content .news_content .content_text video{width:100%}.main_box .main_content .news_content .content_text .video-box{width:100%;position:relative}.main_box .main_content .news_content .content_text .video-box .layer{width:100%;height:100%;position:absolute;top:0;background-color:#f7f7f7;z-index:2;background-position:center center;background-repeat:no-repeat;background-size:contain}.main_box .main_content .news_content .content_text .video-box .play-btn{width:60px;position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);z-index:3}.main_box .main_content .news_content .content_text section{margin-bottom:20px}.main_box .main_content .news_content .content_text img{width:100%}.main_box .main_content .news_content .content_imgs{width:100%;margin-top:28px}.main_box .main_content .news_content .content_imgs .square_box{width:33%;float:left;box-sizing:border-box;border-right:7px solid #fff;border-bottom:7px solid #fff;overflow:hidden;position:relative}.main_box .main_content .news_content .content_imgs .square_box .img_box{padding-bottom:100%;width:100%;height:0;background-size:cover;background-position:center;background-repeat:no-repeat}.main_box .main_content .news_content .content_imgs .square_box .img_box img{min-width:100%;height:100%;position:absolute;top:0;left:0;z-index:1;opacity:0}.main_box .main_content .news_content .content_imgs:after{content:"";height:0;display:block;visibility:hidden;clear:both}.main_box .main_content .news_content img{transition:opacity ease-in .3s}.main_box .main_content .koubei_score{width:100%;position:relative}.main_box .main_content .koubei_score .score_avatar{width:40px;height:40px;border-radius:50%;overflow:hidden;position:absolute;top:16px;left:0;top:0}.main_box .main_content .koubei_score .score_avatar img{width:100%;height:100%}.main_box .main_content .koubei_score .socre_content{box-sizing:border-box;padding-left:52px}.main_box .main_content .koubei_score .socre_content .content_top p{font-size:14px;line-height:20px;font-weight:400}.main_box .main_content .koubei_score .socre_content .content_top p.score_name{color:#999}.main_box .main_content .koubei_score .socre_content .content_top p.score_main{color:#666}.main_box .main_content .koubei_score .socre_content .content_top p.score_main span{font-weight:600;color:#333}.main_box .main_content .koubei_score .socre_content .content_top p.score_main em{color:#00bebe;font-weight:600;font-style:normal}.main_box .main_content .koubei_score .socre_content .audio_box{margin:8px 0 12px 0}.main_box .main_content .koubei_score .socre_content .audio_box .audio_set{width:100%;height:56px;background-color:#ededed;border-radius:4px;border-top-left-radius:0;position:relative;box-sizing:border-box;margin:8px 0 12px 0;padding:8px 16px 5px 12px}.main_box .main_content .koubei_score .socre_content .audio_box .audio_set:before{content:"";width:4px;height:7px;position:absolute;top:0;left:-4px;background-image:url("triangle.png");background-size:cover;background-position:center;background-repeat:no-repeat}.main_box .main_content .koubei_score .socre_content .audio_box .audio_set .play_btn{width:32px;height:32px;float:left;background-image:url("");background-size:cover;background-position:center;background-repeat:no-repeat;position:relative;top:4px}.main_box .main_content .koubei_score .socre_content .audio_box .audio_set .text_progress{width:calc(100% - 44px);height:100%;float:right}.main_box .main_content .koubei_score .socre_content .audio_box .audio_set .text_progress p{font-size:14px;line-height:20px;color:rgba(51,51,51,0.7);font-weight:600;text-align:left;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;margin-bottom:4px} 4 | .main_box .main_content .koubei_score .socre_content .audio_box .audio_set .text_progress .progress{width:100%;height:18px;position:relative}.main_box .main_content .koubei_score .socre_content .audio_box .audio_set .text_progress .progress.noText{top:10px}.main_box .main_content .koubei_score .socre_content .audio_box .audio_set .text_progress .progress .audio_progress{width:calc(100% - 28px);height:2px;float:left;border-radius:1.5px;background-color:rgba(102,102,102,0.2);position:relative;top:8px}.main_box .main_content .koubei_score .socre_content .audio_box .audio_set .text_progress .progress .audio_progress em{width:6px;height:6px;background-color:#666;border-radius:50%;position:absolute;top:-2px;left:0}.main_box .main_content .koubei_score .socre_content .audio_box .audio_set .text_progress .progress .audio_progress span{width:0;height:100%;background-color:#666;border-radius:1.5px;position:absolute;top:0;left:0}.main_box .main_content .koubei_score .socre_content .audio_box .audio_set .text_progress .progress .audio_time{font-size:12px;line-height:1.5;color:#333;font-weight:400;float:right}.main_box .main_content .koubei_score .socre_content .audio_box .audio_set.played .play_btn{background-image:url("play2.png")}.main_box .main_content .koubei_score .socre_content .audio_box .audio_set.playing .play_btn{background-image:url("parse.png")}.main_box .main_content .koubei_score .socre_content .content_text{margin-top:8px;font-size:16px;line-height:24px;color:#333;font-weight:400;margin-bottom:12px}.main_box .main_content .koubei_score .socre_content .content_imgs_videos{width:100%;margin:8px 0 12px}.main_box .main_content .koubei_score .socre_content .content_imgs_videos:after{content:"";height:0;display:block;visibility:hidden;clear:both}.main_box .main_content .koubei_score .socre_content .content_imgs_videos .square_box{width:30%;float:left;box-sizing:border-box;overflow:hidden;position:relative;margin-right:8px;margin-top:8px}.main_box .main_content .koubei_score .socre_content .content_imgs_videos .square_box:nth-of-type(1),.main_box .main_content .koubei_score .socre_content .content_imgs_videos .square_box:nth-of-type(2),.main_box .main_content .koubei_score .socre_content .content_imgs_videos .square_box:nth-of-type(3){margin-top:0}.main_box .main_content .koubei_score .socre_content .content_imgs_videos .square_box:nth-of-type(3n){margin-right:0}.main_box .main_content .koubei_score .socre_content .content_imgs_videos .square_box .img_box{padding-bottom:100%;width:100%;height:0;background-size:cover;background-position:center;background-repeat:no-repeat}.main_box .main_content .koubei_score .socre_content .content_imgs_videos .square_box .img_box img{min-width:100%;height:100%;position:absolute;top:0;left:0;z-index:1;opacity:0}.main_box .main_content .koubei_score .socre_content .content_imgs_videos .square_box.video .img_box{position:relative}.main_box .main_content .koubei_score .socre_content .content_imgs_videos .square_box.video .img_box .play_btn{width:40px;min-width:40px;height:40px;position:absolute;top:30%;left:50%;margin-left:-20px;opacity:1}.main_box .main_content .koubei_score .socre_content .content_good_bad_list{margin-top:12px}.main_box .main_content .koubei_score .socre_content .content_good_bad_list .list{position:relative;box-sizing:border-box;padding-left:24px}.main_box .main_content .koubei_score .socre_content .content_good_bad_list .list:after{content:"";height:0;display:block;visibility:hidden;clear:both}.main_box .main_content .koubei_score .socre_content .content_good_bad_list .list .item{width:auto;height:18px;box-sizing:border-box;border:1px solid #999;padding:0 5px;font-size:12px;color:#999;line-height:16px;font-weight:400;float:left;margin-right:5px;margin-bottom:5px}.main_box .main_content .koubei_score .socre_content .content_good_bad_list .list:before{content:"";display:block;width:16px;height:16px;position:absolute;top:2px;left:0;background-size:cover;background-position:center;background-repeat:no-repeat}.main_box .main_content .koubei_score .socre_content .content_good_bad_list .list.good_list:before{background-image:url("finger_up.png")}.main_box .main_content .koubei_score .socre_content .content_good_bad_list .list.bad_list:before{background-image:url("finger_down.png")}.main_box .main_content .koubei_score .socre_content .content_time_count{width:100%;height:18px;margin-top:15px}.main_box .main_content .koubei_score .socre_content .content_time_count:after{content:"";height:0;display:block;visibility:hidden;clear:both}.main_box .main_content .koubei_score .socre_content .content_time_count .publish_time{float:left;font-size:12px;line-height:1.5;color:#999;font-weight:400}.main_box .main_content .koubei_score .socre_content .content_time_count .comments_count,.main_box .main_content .koubei_score .socre_content .content_time_count .good_count{float:right;height:100%;font-size:12px;line-height:1.5;color:#666;font-weight:400} 5 | .main_box .main_content .koubei_score .socre_content .content_time_count .comments_count img,.main_box .main_content .koubei_score .socre_content .content_time_count .good_count img{width:16px;height:16px;margin-right:4px;vertical-align:text-top}.main_box .main_content .koubei_score .socre_content .content_time_count .comments_count{margin-right:24px}.main_box .share_box{width:100%;margin-top:40px;box-sizing:border-box;padding:0 20px}.main_box .share_box .share_btn{width:100%;height:44px;background-color:#00bebe;border-radius:2px}.main_box .share_box .share_btn a{display:block;width:100%;height:100%;color:#fff;text-decoration:none;font-size:16px;text-align:center;line-height:44px;font-weight:600}.main_box .more_content{width:100%;border-top:10px solid #f5f5f5;padding:0 20px;background-color:#fff}.main_box .more_content h2{font-size:18px;font-weight:600;line-height:1.5;padding-top:20px;text-align:left}.main_box .more_content .more_list{width:100%;margin-top:13px}.main_box .more_content .more_list .list_item{box-sizing:border-box;padding:16px 0 15px 0;border-bottom:1px solid #e5e5e5}.main_box .more_content .more_list .list_item a{display:block;width:100%;position:relative;box-sizing:border-box}.main_box .more_content .more_list .list_item a:after{content:"";height:0;display:block;visibility:hidden;clear:both}.main_box .more_content .more_list .list_item a .left_text{width:calc(100% - 104px - 12px);float:left}.main_box .more_content .more_list .list_item a .left_text p{font-size:16px;line-height:24px;color:#333;text-align:left;text-overflow:ellipsis;overflow:hidden;-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box}.main_box .more_content .more_list .list_item a .left_text span{font-size:12px;line-height:16px;text-align:left;color:#999;position:absolute;bottom:0;left:0}.main_box .more_content .more_list .list_item a .left_text.no_img{width:100%}.main_box .more_content .more_list .list_item a .left_text.no_img span{position:relative;display:block;margin-top:14px}.main_box .more_content .more_list .list_item a .right_img{float:right;max-width:104px;max-height:78px;overflow:hidden;margin-left:12px}.main_box .more_content .more_list .list_item a .right_img img{width:104px;height:78px}.main_box .reply_comment{width:100%;border-top:8px solid #f5f5f5}.main_box .reply_comment #comments_box{margin-bottom:80px}.main_box .reply_comment .chunk_box{width:100%;box-sizing:border-box;padding:0 20px;color:#333}.main_box .reply_comment .chunk_box h2{font-size:18px;font-weight:600;line-height:1.5;color:#333;text-align:left;padding:20px 0 13px 0}.main_box .reply_comment .chunk_box.reply_box .reply_content .reply_list .reply_item{width:100%;box-sizing:border-box;padding-top:16px;padding-left:52px;position:relative}.main_box .reply_comment .chunk_box.reply_box .reply_content .reply_list .reply_item .avatar{width:40px;height:40px;border-radius:50%;overflow:hidden;position:absolute;top:16px;left:0}.main_box .reply_comment .chunk_box.reply_box .reply_content .reply_list .reply_item .avatar img{width:100%;height:100%}.main_box .reply_comment .chunk_box.reply_box .reply_content .reply_list .reply_item .textarea{width:100%;border-bottom:1px solid #e5e5e5}.main_box .reply_comment .chunk_box.reply_box .reply_content .reply_list .reply_item .textarea .text_content{width:100%;margin-top:5px;font-size:16px;line-height:1.5;text-indent:0;text-align:justify;color:#333;margin-bottom:12px}.main_box .reply_comment .chunk_box.reply_box .reply_content .reply_list .reply_item .textarea .text_content p{font-size:16px;line-height:1.5;text-indent:0;text-align:justify;color:#333}.main_box .reply_comment .chunk_box.reply_box .reply_content .reply_list .reply_item .textarea .text_content.two_line{text-overflow:ellipsis;overflow:hidden;-webkit-line-clamp:2;display:-webkit-box;-webkit-box-orient:vertical;height:48px}.main_box .reply_comment .chunk_box.reply_box .reply_content .reply_list .reply_item .textarea .imgs_content{width:100%;position:relative;margin-top:12px}.main_box .reply_comment .chunk_box.reply_box .reply_content .reply_list .reply_item .textarea .imgs_content .imgs_list{display:flex;display:-webkit-flex;-webkit-justify-content:space-between;justify-content:space-between}.main_box .reply_comment .chunk_box.reply_box .reply_content .reply_list .reply_item .textarea .imgs_content .imgs_list .square_box{width:32%;float:left;box-sizing:border-box;padding:8px 8px 0 0;overflow:hidden;position:relative;display:none;margin-bottom:6px;margin-left:1%}.main_box .reply_comment .chunk_box.reply_box .reply_content .reply_list .reply_item .textarea .imgs_content .imgs_list .square_box:nth-of-type(1),.main_box .reply_comment .chunk_box.reply_box .reply_content .reply_list .reply_item .textarea .imgs_content .imgs_list .square_box:nth-of-type(2),.main_box .reply_comment .chunk_box.reply_box .reply_content .reply_list .reply_item .textarea .imgs_content .imgs_list .square_box:nth-of-type(3){display:block}.main_box .reply_comment .chunk_box.reply_box .reply_content .reply_list .reply_item .textarea .imgs_content .imgs_list .square_box .img_box{padding-bottom:100%;width:100%;height:0;background-size:cover;background-position:center} 6 | .main_box .reply_comment .chunk_box.reply_box .reply_content .reply_list .reply_item .textarea .imgs_content .imgs_list .square_box .img_box img{min-width:100%;height:100%;position:absolute;top:0;left:0;z-index:1;opacity:0}.main_box .reply_comment .chunk_box.reply_box .reply_content .reply_list .reply_item .textarea .imgs_content .imgs_num_note{display:block;padding:0 5px;height:18px;position:absolute;bottom:0;right:11px;color:#fff;background-color:rgba(0,0,0,0.3);z-index:2;font-size:12px;line-height:1.5;border-top-left-radius:4px}.main_box .reply_comment .chunk_box.reply_box .reply_content .reply_list .reply_item .textarea .name_time{display:flex;display:-webkit-flex;-webkit-justify-content:space-between;justify-content:space-between;width:100%;height:28px}.main_box .reply_comment .chunk_box.reply_box .reply_content .reply_list .reply_item .textarea .name_time .name{font-size:14px;line-height:28px;color:#00bebe;font-weight:600}.main_box .reply_comment .chunk_box.reply_box .reply_content .reply_list .reply_item .textarea .name_time .time{font-size:12px;line-height:28px;color:#999}.main_box .reply_comment .chunk_box.reply_box .reply_content .reply_list .reply_item .textarea .show_all,.main_box .reply_comment .chunk_box.reply_box .reply_content .reply_list .reply_item .textarea .show_apart{width:32px;height:24px;margin-bottom:12px;font-size:16px;color:#134098;line-height:1.5}.main_box .reply_comment .chunk_box.reply_box .reply_content .reply_list .reply_item .textarea .show_apart{display:none}.main_box .reply_comment .chunk_box.reply_box .reply_content .more_reply{width:100%;height:44px;margin:0 auto;margin-top:40px;background-color:#00bebe;font-size:16px;line-height:44px;font-weight:600;text-align:center;color:#fff;border-radius:8px;margin:28px auto}.main_box .reply_comment .chunk_box.comments_box .comment_content .comment_list .comment_item{width:100%;box-sizing:border-box;padding-top:16px;padding-left:52px;position:relative}.main_box .reply_comment .chunk_box.comments_box .comment_content .comment_list .comment_item .avatar{width:40px;height:40px;border-radius:50%;overflow:hidden;position:absolute;top:16px;left:0}.main_box .reply_comment .chunk_box.comments_box .comment_content .comment_list .comment_item .avatar img{width:100%;height:100%}.main_box .reply_comment .chunk_box.comments_box .comment_content .comment_list .comment_item .textarea{width:100%;border-bottom:1px solid #e5e5e5}.main_box .reply_comment .chunk_box.comments_box .comment_content .comment_list .comment_item .textarea .name_time{display:flex;display:-webkit-flex;-webkit-justify-content:space-between;justify-content:space-between;width:100%;height:28px}.main_box .reply_comment .chunk_box.comments_box .comment_content .comment_list .comment_item .textarea .name_time .name{font-size:14px;line-height:28px;font-weight:400;color:#999}.main_box .reply_comment .chunk_box.comments_box .comment_content .comment_list .comment_item .textarea .text_content{width:100%;margin-top:5px;font-size:16px;line-height:1.5;text-indent:0;text-align:justify;color:#333;margin-bottom:12px}.main_box .reply_comment .chunk_box.comments_box .comment_content .comment_list .comment_item .textarea .text_content p{font-size:16px;line-height:1.5;text-indent:0;text-align:justify;color:#333}.main_box .reply_comment .chunk_box.comments_box .comment_content .comment_list .comment_item .textarea .text_content.two_line{text-overflow:ellipsis;overflow:hidden;-webkit-line-clamp:2;display:-webkit-box;-webkit-box-orient:vertical;height:48px}.main_box .reply_comment .chunk_box.comments_box .comment_content .comment_list .comment_item .textarea .imgs_content{width:100%;position:relative;margin-top:12px}.main_box .reply_comment .chunk_box.comments_box .comment_content .comment_list .comment_item .textarea .imgs_content .imgs_list{display:flex;display:-webkit-flex;-webkit-justify-content:space-between;justify-content:space-between}.main_box .reply_comment .chunk_box.comments_box .comment_content .comment_list .comment_item .textarea .imgs_content .imgs_list .square_box{width:32%;float:left;box-sizing:border-box;padding:8px 8px 0 0;overflow:hidden;position:relative;display:none;margin-bottom:6px;margin-left:1%}.main_box .reply_comment .chunk_box.comments_box .comment_content .comment_list .comment_item .textarea .imgs_content .imgs_list .square_box:nth-of-type(1),.main_box .reply_comment .chunk_box.comments_box .comment_content .comment_list .comment_item .textarea .imgs_content .imgs_list .square_box:nth-of-type(2),.main_box .reply_comment .chunk_box.comments_box .comment_content .comment_list .comment_item .textarea .imgs_content .imgs_list .square_box:nth-of-type(3){display:block}.main_box .reply_comment .chunk_box.comments_box .comment_content .comment_list .comment_item .textarea .imgs_content .imgs_list .square_box .img_box{padding-bottom:100%;width:100%;height:0;background-size:cover;background-position:center}.main_box .reply_comment .chunk_box.comments_box .comment_content .comment_list .comment_item .textarea .imgs_content .imgs_list .square_box .img_box img{min-width:100%;height:100%;position:absolute;top:0;left:0;z-index:1;opacity:0} 7 | .main_box .reply_comment .chunk_box.comments_box .comment_content .comment_list .comment_item .textarea .imgs_content .imgs_num_note{display:block;padding:0 5px;height:18px;position:absolute;bottom:0;right:11px;color:#fff;background-color:rgba(0,0,0,0.3);z-index:2;font-size:12px;line-height:1.5;border-top-left-radius:4px}.main_box .reply_comment .chunk_box.comments_box .comment_content .comment_list .comment_item .textarea .time_reply_count{width:100%;height:18px;display:flex;display:-webkit-flex;-webkit-justify-content:space-between;justify-content:space-between;margin:13px 0 13px 0}.main_box .reply_comment .chunk_box.comments_box .comment_content .comment_list .comment_item .textarea .time_reply_count .time{font-size:12px;line-height:1.5;color:#999}.main_box .reply_comment .chunk_box.comments_box .comment_content .comment_list .comment_item .textarea .time_reply_count .reply_count img{width:16px;height:16px;margin-right:8px;vertical-align:middle}.main_box .reply_comment .chunk_box.comments_box .comment_content .comment_list .comment_item .textarea .time_reply_count .reply_count span{font-size:12px;line-height:1.5;color:#999}.main_box .reply_comment .chunk_box.comments_box .comment_content .comment_list .comment_item .uer_reply_list{width:100%;box-sizing:border-box}.main_box .reply_comment .chunk_box.comments_box .comment_content .comment_list .comment_item .uer_reply_list .uer_reply_item{position:relative;padding-left:36px;padding-top:16px}.main_box .reply_comment .chunk_box.comments_box .comment_content .comment_list .comment_item .uer_reply_list .uer_reply_item .avatar{width:28px;height:28px;border-radius:50%;overflow:hidden;position:absolute;top:16px;left:0}.main_box .reply_comment .chunk_box.comments_box .comment_content .comment_list .comment_item .uer_reply_list .uer_reply_item .avatar img{width:100%;height:100%}.main_box .reply_comment .chunk_box.comments_box .comment_content .comment_list .comment_item .uer_reply_list .uer_reply_item .textarea{width:100%;border-bottom:1px solid #e5e5e5}.main_box .reply_comment .chunk_box.comments_box .comment_content .comment_list .comment_item .uer_reply_list .uer_reply_item .textarea .text_content{width:100%;margin-top:5px;font-size:16px;line-height:1.5;text-indent:0;text-align:justify;color:#333;margin-bottom:12px}.main_box .reply_comment .chunk_box.comments_box .comment_content .comment_list .comment_item .uer_reply_list .uer_reply_item .textarea .text_content p{font-size:16px;line-height:1.5;text-indent:0;text-align:justify;color:#333}.main_box .reply_comment .chunk_box.comments_box .comment_content .comment_list .comment_item .uer_reply_list .uer_reply_item .textarea .text_content.two_line{text-overflow:ellipsis;overflow:hidden;-webkit-line-clamp:2;display:-webkit-box;-webkit-box-orient:vertical;height:48px}.main_box .reply_comment .chunk_box.comments_box .comment_content .comment_list .comment_item .uer_reply_list .uer_reply_item .textarea .imgs_content{width:100%;position:relative;margin-top:12px}.main_box .reply_comment .chunk_box.comments_box .comment_content .comment_list .comment_item .uer_reply_list .uer_reply_item .textarea .imgs_content .imgs_list{display:flex;display:-webkit-flex;-webkit-justify-content:space-between;justify-content:space-between}.main_box .reply_comment .chunk_box.comments_box .comment_content .comment_list .comment_item .uer_reply_list .uer_reply_item .textarea .imgs_content .imgs_list .square_box{width:32%;float:left;box-sizing:border-box;padding:8px 8px 0 0;overflow:hidden;position:relative;display:none;margin-bottom:6px;margin-left:1%}.main_box .reply_comment .chunk_box.comments_box .comment_content .comment_list .comment_item .uer_reply_list .uer_reply_item .textarea .imgs_content .imgs_list .square_box:nth-of-type(1),.main_box .reply_comment .chunk_box.comments_box .comment_content .comment_list .comment_item .uer_reply_list .uer_reply_item .textarea .imgs_content .imgs_list .square_box:nth-of-type(2),.main_box .reply_comment .chunk_box.comments_box .comment_content .comment_list .comment_item .uer_reply_list .uer_reply_item .textarea .imgs_content .imgs_list .square_box:nth-of-type(3){display:block}.main_box .reply_comment .chunk_box.comments_box .comment_content .comment_list .comment_item .uer_reply_list .uer_reply_item .textarea .imgs_content .imgs_list .square_box .img_box{padding-bottom:100%;width:100%;height:0;background-size:cover;background-position:center}.main_box .reply_comment .chunk_box.comments_box .comment_content .comment_list .comment_item .uer_reply_list .uer_reply_item .textarea .imgs_content .imgs_list .square_box .img_box img{min-width:100%;height:100%;position:absolute;top:0;left:0;z-index:1;opacity:0}.main_box .reply_comment .chunk_box.comments_box .comment_content .comment_list .comment_item .uer_reply_list .uer_reply_item .textarea .imgs_content .imgs_num_note{display:block;padding:0 5px;height:18px;position:absolute;bottom:0;right:11px;color:#fff;background-color:rgba(0,0,0,0.3);z-index:2;font-size:12px;line-height:1.5;border-top-left-radius:4px} 8 | .main_box .reply_comment .chunk_box.comments_box .comment_content .comment_list .comment_item .uer_reply_list .uer_reply_item .textarea .name_time{display:flex;display:-webkit-flex;-webkit-justify-content:space-between;justify-content:space-between;width:100%;height:28px}.main_box .reply_comment .chunk_box.comments_box .comment_content .comment_list .comment_item .uer_reply_list .uer_reply_item .textarea .name_time .name{font-size:14px;line-height:28px;font-weight:400;color:#999;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.main_box .reply_comment .chunk_box.comments_box .comment_content .comment_list .comment_item .uer_reply_list .uer_reply_item .textarea .text_content{margin-top:0}.main_box .reply_comment .chunk_box.comments_box .comment_content .more_comment{width:100%;height:44px;margin:0 auto;margin-top:40px;background-color:#00bebe;font-size:16px;line-height:44px;font-weight:600;text-align:center;color:#fff;border-radius:8px}.main_box .reply_comment .chunk_box.comments_box .comment_content .open{background-color:#fff;border:1px solid #00bebe;color:#00bebe}.main_box .reply_comment .chunk_box.comments_box .no_more{width:100%}.main_box .reply_comment .chunk_box.comments_box .no_more img{width:180px;display:block;margin:0 auto}.main_box .reply_comment .chunk_box.comments_box .no_more p{font-size:16px;line-height:1.5;color:#999;text-align:center}.main_box .reply_comment .publish_box{width:100%;height:56px;background-color:#fff;box-sizing:border-box;padding:8px 20px;position:fixed;bottom:0;z-index:8}.main_box .reply_comment .publish_box p{width:100%;height:100%;border-radius:4px;background-color:#f2f2f2;box-sizing:border-box;padding-left:12px;font-size:14px;line-height:40px;color:#999}.main_box .reply_comment.koubei_comment{border:0}.main_box .reply_comment.koubei_comment .comments_box{border-top:8px solid #f5f5f5}.main_box .reply_comment.koubei_comment .comments_box .comment_content .comment_list .comment_item .textarea .name_time{position:relative}.main_box .reply_comment.koubei_comment .comments_box .comment_content .comment_list .comment_item .textarea .name_time img{display:block;width:20px;height:20px;position:absolute;top:4px;right:0}.main_box .reply_comment.koubei_comment .comments_box .comment_content .comment_list .comment_item .textarea .audio_box{margin:8px 0 12px 0;display:inline-block}.main_box .reply_comment.koubei_comment .comments_box .comment_content .comment_list .comment_item .textarea .audio_box .audio_set{height:44px;background-color:#ededed;border-radius:4px;border-top-left-radius:0;position:relative;box-sizing:border-box;padding:0 16px 0 12px}.main_box .reply_comment.koubei_comment .comments_box .comment_content .comment_list .comment_item .textarea .audio_box .audio_set:after{content:"";height:0;display:block;visibility:hidden;clear:both}.main_box .reply_comment.koubei_comment .comments_box .comment_content .comment_list .comment_item .textarea .audio_box .audio_set:before{content:"";width:4px;height:7px;position:absolute;top:0;left:-4px;background-image:url("triangle.png");background-size:cover;background-position:center;background-repeat:no-repeat}.main_box .reply_comment.koubei_comment .comments_box .comment_content .comment_list .comment_item .textarea .audio_box .audio_set .play_btn{width:32px;height:32px;float:left;background-image:url("play1.png");background-size:cover;background-position:center;background-repeat:no-repeat;position:relative;top:6px;margin-right:12px}.main_box .reply_comment.koubei_comment .comments_box .comment_content .comment_list .comment_item .textarea .audio_box .audio_set .text_progress{height:100%;float:left}.main_box .reply_comment.koubei_comment .comments_box .comment_content .comment_list .comment_item .textarea .audio_box .audio_set .text_progress p{font-size:14px;line-height:20px;color:rgba(51,51,51,0.7);font-weight:600;text-align:left;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;margin-bottom:4px}.main_box .reply_comment.koubei_comment .comments_box .comment_content .comment_list .comment_item .textarea .audio_box .audio_set .text_progress .progress{width:100%;height:18px;position:relative}.main_box .reply_comment.koubei_comment .comments_box .comment_content .comment_list .comment_item .textarea .audio_box .audio_set .text_progress .progress.noText{top:13px}.main_box .reply_comment.koubei_comment .comments_box .comment_content .comment_list .comment_item .textarea .audio_box .audio_set .text_progress .progress .audio_progress{width:auto;height:2px;float:left;border-radius:1.5px;background-color:rgba(102,102,102,0.2);position:relative;top:8px}.main_box .reply_comment.koubei_comment .comments_box .comment_content .comment_list .comment_item .textarea .audio_box .audio_set .text_progress .progress .audio_progress em{width:6px;height:6px;background-color:#666;border-radius:50%;position:absolute;top:-2px;left:0} 9 | .main_box .reply_comment.koubei_comment .comments_box .comment_content .comment_list .comment_item .textarea .audio_box .audio_set .text_progress .progress .audio_progress span{width:0;height:100%;background-color:#666;border-radius:1.5px;position:absolute;top:0;left:0}.main_box .reply_comment.koubei_comment .comments_box .comment_content .comment_list .comment_item .textarea .audio_box .audio_set .text_progress .progress .audio_progress.long_time{width:98px}.main_box .reply_comment.koubei_comment .comments_box .comment_content .comment_list .comment_item .textarea .audio_box .audio_set .text_progress .progress .audio_progress.middle_time{width:70px}.main_box .reply_comment.koubei_comment .comments_box .comment_content .comment_list .comment_item .textarea .audio_box .audio_set .text_progress .progress .audio_progress.less_time{width:50px}.main_box .reply_comment.koubei_comment .comments_box .comment_content .comment_list .comment_item .textarea .audio_box .audio_set .text_progress .progress .audio_time{font-size:12px;line-height:1.5;color:#333;font-weight:400;float:left}.main_box .reply_comment.koubei_comment .comments_box .comment_content .comment_list .comment_item .textarea .audio_box .audio_set.played .play_btn{background-image:url("play2.png")}.main_box .reply_comment.koubei_comment .comments_box .comment_content .comment_list .comment_item .textarea .audio_box .audio_set.playing .play_btn{background-image:url("parse.png")}.main_box .reply_comment.koubei_comment .comments_box .comment_content .comment_list .comment_item .textarea .time_reply_count{display:block}.main_box .reply_comment.koubei_comment .comments_box .comment_content .comment_list .comment_item .textarea .time_reply_count:after{content:"";height:0;display:block;visibility:hidden;clear:both}.main_box .reply_comment.koubei_comment .comments_box .comment_content .comment_list .comment_item .textarea .time_reply_count .time{float:left}.main_box .reply_comment.koubei_comment .comments_box .comment_content .comment_list .comment_item .textarea .time_reply_count .counts{float:right;color:#666;font-size:12px;line-height:1.5}.main_box .reply_comment.koubei_comment .comments_box .comment_content .comment_list .comment_item .textarea .time_reply_count .counts img{width:16px;height:16px;margin-right:4px;vertical-align:text-top}.main_box .reply_comment.koubei_comment .comments_box .comment_content .comment_list .comment_item .textarea .time_reply_count .counts.comments_count{margin-right:24px}.main_box .reply_comment.koubei_comment .comments_box .comment_content .comment_list .comment_item .uer_reply_list .uer_reply_item .all_reply_count{width:100%;height:44px;box-sizing:border-box;border-bottom:1px solid #e5e5e5;font-size:14px;line-height:42px;text-align:left}.main_box .reply_comment.koubei_comment .comments_box .comment_content .more_comment{margin:28px 0;border:1px solid #00bebe}.main_box .reply_comment.koubei_comment .comments_box .no_more p{font-size:14px;line-height:20px}.main_box .reply_comment.koubei_comment .comments_box .no_more p span{color:#00bebe;text-decoration:underline}.main_box .reply_comment.koubei_comment .comments_box.other_comment .comment_content .more_comment{margin-top:40px;background-color:#00bebe}.main_box .reply_comment.koubei_comment .publish_box{position:relative;margin-top:80px}.main_box .reply_comment.koubei_comment .publish_box:after{content:"";height:0;display:block;visibility:hidden;clear:both}.main_box .reply_comment.koubei_comment .publish_box img{width:24px;height:24px;display:block;position:absolute;top:16px;left:20px}.main_box .reply_comment.koubei_comment .publish_box p{float:right;width:calc(100% - 30px);border-radius:8px}.video_show{width:100%;height:100%;position:fixed;top:0;left:0;z-index:21;background-color:rgba(0,0,0,0.7);display:none}.video_show .video_back{width:100%;height:44px;background-image:linear-gradient(to bottom,#000,transparent);position:absolute;top:0;left:0;z-index:21}.video_show .video_back:after{content:"";height:0;display:block;visibility:hidden;clear:both}.video_show .video_back .back_btn{width:44px;height:44px;float:left;position:relative;left:10px}.video_show .video_back .back_btn span{display:block;width:16px;height:16px;position:absolute;top:12px;left:16px;background-image:url("left_arrow.png");background-size:cover;background-position:center}.video_show video{width:100%;height:100%}.video_show .play_controll{width:80px;height:80px;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.mask{width:100%;height:100%;position:fixed;top:0;left:0;background-color:rgba(0,0,0,0.7);z-index:20;display:none}.mask img{width:60%;display:block;position:absolute;top:10px;right:25px}.data_loading,.empty_data,.removed,.server_error{width:100%;height:100%;position:fixed;top:0;left:0;z-index:20;display:none;background-color:#fff} 10 | .data_loading .node_chunk,.empty_data .node_chunk,.removed .node_chunk,.server_error .node_chunk{position:relative;top:22%}.data_loading .node_chunk.loading,.empty_data .node_chunk.loading,.removed .node_chunk.loading,.server_error .node_chunk.loading{width:110px;height:110px;background-color:rgba(0,0,0,0.88);padding:22px 0;margin:0 auto;position:relative;top:30%}.data_loading .node_chunk.loading span,.empty_data .node_chunk.loading span,.removed .node_chunk.loading span,.server_error .node_chunk.loading span{display:block;width:36px;height:36px;border-radius:50%;border:2px solid #fff;box-sizing:border-box;position:absolute;left:50%;margin-left:-18px}.data_loading .node_chunk.loading p,.empty_data .node_chunk.loading p,.removed .node_chunk.loading p,.server_error .node_chunk.loading p{font-size:16px;line-height:24px;color:#fff;text-align:center;margin-top:5px;position:absolute;bottom:20px}.data_loading .node_chunk img,.empty_data .node_chunk img,.removed .node_chunk img,.server_error .node_chunk img{width:240px;height:240px;display:block;margin:0 auto}.data_loading .node_chunk p,.empty_data .node_chunk p,.removed .node_chunk p,.server_error .node_chunk p{width:100%;text-align:center;font-size:14px;line-height:1.5;color:#999;margin-top:8px}.data_loading .node_chunk .refresh_btn,.empty_data .node_chunk .refresh_btn,.removed .node_chunk .refresh_btn,.server_error .node_chunk .refresh_btn{width:160px;height:48px;margin:0 auto;margin-top:8px;background-color:#00bebe;text-align:center;border-radius:4px;font-size:18px;line-height:48px;color:#fff}.details_main .main_box{padding-top:0}.news_text{line-height:30px;font-size:18px;color:#303030}.news_text p{line-height:30px;font-size:18px;color:#303030;margin-bottom:20px;text-align:justify}.news_text section{margin-bottom:20px}img:not([src]),img[src=""]{opacity:.2} -------------------------------------------------------------------------------- /ZXYWebView/WKWebView/newsHtmlFiles/styles/previewImage.css: -------------------------------------------------------------------------------- 1 | .mui-preview-image.mui-fullscreen{position:fixed;z-index:20;background-color:#000}.mui-preview-footer,.mui-preview-header{position:absolute;width:100%;left:0;z-index:10}.mui-preview-header{height:44px;top:0}.mui-preview-footer{height:50px;bottom:0}.mui-preview-header .mui-preview-indicator{display:block;line-height:25px;color:#fff;text-align:center;margin:15px auto 4px;width:70px;background-color:rgba(0,0,0,.4);border-radius:12px;font-size:16px}.mui-preview-image{display:none;-webkit-animation-duration:.5s;animation-duration:.5s;-webkit-animation-fill-mode:both;animation-fill-mode:both}.mui-preview-image.mui-preview-in{-webkit-animation-name:fadeIn;animation-name:fadeIn}.mui-preview-image.mui-preview-out{background:0;-webkit-animation-name:fadeOut;animation-name:fadeOut}.mui-preview-image.mui-preview-out .mui-preview-footer,.mui-preview-image.mui-preview-out .mui-preview-header{display:none}.mui-zoom-scroller{position:absolute;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;left:0;right:0;bottom:0;top:0;width:100%;height:100%;margin:0;-webkit-backface-visibility:hidden}.mui-zoom{-webkit-transform-style:preserve-3d;transform-style:preserve-3d}.mui-slider .mui-slider-group .mui-slider-item img{width:auto;height:auto;max-width:100%;max-height:100%}.mui-android-4-1 .mui-slider .mui-slider-group .mui-slider-item img{width:100%}.mui-android-4-1 .mui-slider.mui-preview-image .mui-slider-group .mui-slider-item{display:inline-table}.mui-android-4-1 .mui-slider.mui-preview-image .mui-zoom-scroller img{display:table-cell;vertical-align:middle}.mui-preview-loading{position:absolute;width:100%;height:100%;top:0;left:0;display:none}.mui-preview-loading.mui-active{display:block}.mui-preview-loading .mui-spinner-white{position:absolute;top:50%;left:50%;margin-left:-25px;margin-top:-25px;height:50px;width:50px}.mui-preview-image img.mui-transitioning{-webkit-transition:-webkit-transform .5s ease,opacity .5s ease;transition:transform .5s ease,opacity .5s ease}@-webkit-keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes fadeOut{0%{opacity:1}100%{opacity:0}}@keyframes fadeOut{0%{opacity:1}100%{opacity:0}}p img{max-width:100%;height:auto}.mui-slider-img-content{position:absolute;bottom:10px;left:10px;right:10px;color:#fff;text-align:center;line-height:21px} -------------------------------------------------------------------------------- /ZXYWebView/WKWebView/newsHtmlFiles/styles/public.css: -------------------------------------------------------------------------------- 1 | html *{outline:0;-webkit-text-size-adjust:none;-webkit-tap-highlight-color:rgba(0,0,0,0);font-family:'微软雅黑',sans-serif,'宋体',Arial}body{margin:0;width:100%;font-family:PingFangSC,'微软雅黑',sans-serif,'宋体',Arial;font-size:14px;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}*{word-wrap:break-word;font-style:normal}dd,dl,dt,h1,h2,h3,h4,h5,h6,img,li,p,table,td,th,ul{margin:0;padding:0;border:0;font-weight:400}h1{font-size:20px}h2{font-size:18px}h3{font-size:16px}h4{font-size:13px}input,textarea{margin:0;padding:0;resize:none;outline:0;border:0}li,ul{list-style-type:none}em{font-style:normal}a:active,a:hover,a:link,a:visited{text-decoration:none}.ms-controller,[ms-controller]{visibility:hidden;display:none}img[data-viewer]{cursor:pointer}.adlktouming{position:relative}.divScroll{background-color:#ddd;position:absolute;opacity:.5;filter:alpha(opacity=50);z-index:100;top:0}.divScroll div{background-color:#2d9fd8;position:absolute;left:0;top:0;border-radius:3px}.D_B_H1{background:#00b5e9;-moz-border-radius:3px!important;-webkit-border-radius:3px!important;border-radius:3px!important;color:#fff!important;text-align:center}.D_B_H1:hover{background:#01a4d3}.D_B_H2{background:#fff;border:1px solid #01a4d3;color:#01a4d3;-moz-border-radius:3px!important;-webkit-border-radius:3px!important;border-radius:3px!important}.D_B_H2:hover{background:#01a4d3;color:#fff}.DTitle{height:40px;line-height:40px;padding:0 10px}.DTitle h2{float:left}.DTitle p{width:55px;float:right;font-size:13px;text-align:right}.D_B_O{background:#bbb;color:#fff}@font-face{font-family:iconfont;src:url(//at.alicdn.com/t/font_190493_sg0t744x81h.eot);src:url(//at.alicdn.com/t/font_190493_sg0t744x81h.eot?#iefix) format('embedded-opentype'),url(//at.alicdn.com/t/font_190493_sg0t744x81h.woff) format('woff'),url(//at.alicdn.com/t/font_190493_sg0t744x81h.ttf) format('truetype'),url(//at.alicdn.com/t/font_190493_sg0t744x81h.svg#iconfont) format('svg')}.clearfix{*zoom:1}.clearfix:after,.clearfix:before{display:table;line-height:0;content:""}.clearfix:after{clear:both}.adshow img{display:block!important}@-moz-document url-prefix(){.adshow img{display:contents}}.adms{display:none!important;position:absolute!important;left:0!important;bottom:0!important;width:30px!important;height:17px!important;border:none!important;z-index:666;display:block!important}.iconfont{font-family:iconfont!important;font-size:16px;font-style:normal;-webkit-font-smoothing:antialiased;-webkit-text-stroke-width:.2px;-moz-osx-font-smoothing:grayscale}.bgbg{background:rgba(0,0,0,.8)!important;color:#fff;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#7f000000,endColorstr=#7f000000);-moz-border-radius:5px!important;-webkit-border-radius:5px!important;border-radius:5px!important}.codeBg{background:#fff!important}::-ms-clear{display:none}::-ms-reveal{display:none} -------------------------------------------------------------------------------- /ZXYWebViewTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /ZXYWebViewTests/ZXYWebViewTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ZXYWebViewTests.swift 3 | // ZXYWebViewTests 4 | // 5 | // Created by 张小杨 on 2020/12/8. 6 | // 7 | 8 | import XCTest 9 | @testable import ZXYWebView 10 | 11 | class ZXYWebViewTests: XCTestCase { 12 | 13 | override func setUpWithError() throws { 14 | // Put setup code here. This method is called before the invocation of each test method in the class. 15 | } 16 | 17 | override func tearDownWithError() throws { 18 | // Put teardown code here. This method is called after the invocation of each test method in the class. 19 | } 20 | 21 | func testExample() throws { 22 | // This is an example of a functional test case. 23 | // Use XCTAssert and related functions to verify your tests produce the correct results. 24 | } 25 | 26 | func testPerformanceExample() throws { 27 | // This is an example of a performance test case. 28 | self.measure { 29 | // Put the code you want to measure the time of here. 30 | } 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /ZXYWebViewUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /ZXYWebViewUITests/ZXYWebViewUITests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ZXYWebViewUITests.swift 3 | // ZXYWebViewUITests 4 | // 5 | // Created by 张小杨 on 2020/12/8. 6 | // 7 | 8 | import XCTest 9 | 10 | class ZXYWebViewUITests: XCTestCase { 11 | 12 | override func setUpWithError() throws { 13 | // Put setup code here. This method is called before the invocation of each test method in the class. 14 | 15 | // In UI tests it is usually best to stop immediately when a failure occurs. 16 | continueAfterFailure = false 17 | 18 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 19 | } 20 | 21 | override func tearDownWithError() throws { 22 | // Put teardown code here. This method is called after the invocation of each test method in the class. 23 | } 24 | 25 | func testExample() throws { 26 | // UI tests must launch the application that they test. 27 | let app = XCUIApplication() 28 | app.launch() 29 | 30 | // Use recording to get started writing UI tests. 31 | // Use XCTAssert and related functions to verify your tests produce the correct results. 32 | } 33 | 34 | func testLaunchPerformance() throws { 35 | if #available(macOS 10.15, iOS 13.0, tvOS 13.0, *) { 36 | // This measures how long it takes to launch your application. 37 | measure(metrics: [XCTApplicationLaunchMetric()]) { 38 | XCUIApplication().launch() 39 | } 40 | } 41 | } 42 | } 43 | --------------------------------------------------------------------------------