|
@@ -11,8 +11,7 @@ import Alamofire
|
|
|
import Foundation
|
|
|
import KeychainAccess
|
|
|
import Kingfisher
|
|
|
-//import KingfisherWebP
|
|
|
-//import NXFramework_Swift
|
|
|
+import KingfisherWebP
|
|
|
import Photos
|
|
|
import RealmSwift
|
|
|
import Toast_Swift
|
|
@@ -99,17 +98,17 @@ public func cIPHONE_X() -> Bool {
|
|
|
/// - url: 网络url
|
|
|
/// - mainView: 需要加载的视图
|
|
|
public func netImage(url: String, mainView: Any, placeholder: UIImage = UIImage(named: "placehold_image")!) {
|
|
|
-// if mainView is UIImageView {
|
|
|
-// (mainView as! UIImageView).kf.setImage(with: URL(string: url), placeholder: placeholder, options: url.suffix(5) == ".webp" ? [.processor(WebPProcessor.default), .cacheSerializer(WebPSerializer.default)] : nil, progressBlock: { _, _ in
|
|
|
-//
|
|
|
-// }) { _, _, _, _ in
|
|
|
-// }
|
|
|
-// } else if mainView is UIButton {
|
|
|
-// (mainView as! UIButton).kf.setImage(with: URL(string: url), for: .normal, placeholder: placeholder, options: url.suffix(5) == ".webp" ? [.processor(WebPProcessor.default), .cacheSerializer(WebPSerializer.default)] : nil, progressBlock: { _, _ in
|
|
|
-//
|
|
|
-// }) { _, _, _, _ in
|
|
|
-// }
|
|
|
-// }
|
|
|
+ if mainView is UIImageView {
|
|
|
+ (mainView as! UIImageView).kf.setImage(with: URL(string: url), placeholder: placeholder, options: url.suffix(5) == ".webp" ? [.processor(WebPProcessor.default), .cacheSerializer(WebPSerializer.default)] : nil, progressBlock: { _, _ in
|
|
|
+
|
|
|
+ }) { _, _, _, _ in
|
|
|
+ }
|
|
|
+ } else if mainView is UIButton {
|
|
|
+ (mainView as! UIButton).kf.setImage(with: URL(string: url), for: .normal, placeholder: placeholder, options: url.suffix(5) == ".webp" ? [.processor(WebPProcessor.default), .cacheSerializer(WebPSerializer.default)] : nil, progressBlock: { _, _ in
|
|
|
+
|
|
|
+ }) { _, _, _, _ in
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/** 获取Kingfisher缓存的图片的data */
|
|
@@ -150,8 +149,8 @@ public func commonParams() -> [String: Any] {
|
|
|
"versionCode": versionCode,
|
|
|
"system": systemName + " " + systemVersion,
|
|
|
"systemVersion": systemName + " " + systemVersion,
|
|
|
- "appType": "13",
|
|
|
- "appId": "1509463838",
|
|
|
+ "appType": "15",
|
|
|
+ "appId": "1570572849",
|
|
|
"machineCode": getMachineCode(),
|
|
|
"networkType": networkStatus(),
|
|
|
"ipAddress": ipAddress(),
|