无故事王国
2023-10-09 0408b5d7b07077dc9f451a03a1a859038e4e5bf5
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
//
//  Def.swift
//  WanPai
//
//  Created by 杨锴 on 2023/6/7.
//
 
import Foundation
import UIKit
import JQTools
import SVProgressHUD
import QMUIKit
 
let SHAKEY = "BT7NPhA0f775uzcUuftWjCE1TYZlWmHZ"
let WechatUniversalLinks = "https://www.weparklife.com/"
let WeChatAPPID = "wx41d32f362ba0f911"
let WeChatSecrect = "cf0ebf950f5926a69041a0e2bbe20f3e"
let APPScheme = "weparklife"
let AMapKey = "a2aff8a000be5543e410555c548793b8"
let WeChatMinProgram = "gh_fea25aea0fc8" //
let WeChatMinProgramPath = "pages-sub/web/index"
 
let app = UIApplication.shared.delegate as! AppDelegate
 
let locationTool = JQ_LocationTool.instance()
 
var sceneDelegate:SceneDelegate? = {
    var uiScreen:UIScene?
    UIApplication.shared.connectedScenes.forEach { scenes in
        uiScreen = scenes
    }
    return (uiScreen?.delegate as? SceneDelegate)
}()
 
 
 
func LogSuccess(_ items:Any...,separator:String=" ",file:String=#file,function:String=#function,line:Int=#line){
#if DEBUG
    let file = (file as NSString).lastPathComponent.split(separator: ".").first!;
    print("✅✅✅ SUCCESS: \(file)  \(function) [Line: \(line)]: \(items)",separator);
#endif
}
 
func LogError(_ items:Any...,separator:String=" ",file:String=#file,function:String=#function,line:Int=#line){
#if DEBUG
    let file = (file as NSString).lastPathComponent.split(separator: ".").first!;
    print("❌❌❌ ERROR: \(file)  \(function) [Line: \(line)]: \(items)",separator);
#endif
}
 
func LogInfo(_ items:Any...,separator:String=" ",file:String=#file,function:String=#function,line:Int=#line){
#if DEBUG
    let file = (file as NSString).lastPathComponent.split(separator: ".").first!;
    print("⚠️⚠️⚠️INFO: \(file)  \(function) [Line: \(line)]: \(items)",separator);
#endif
}
 
    //提示框
func alert(msg: String) {
    hiddenHUD()
    SVProgressHUD.showInfo(withStatus: msg)
}
 
func alertError(msg:String){
    hiddenHUD()
    SVProgressHUD.setMinimumDismissTimeInterval(1.5)
    SVProgressHUD.showError(withStatus: msg)
}
 
func alertSuccess(msg:String){
    hiddenHUD()
    SVProgressHUD.showSuccess(withStatus: msg)
}
 
func showHUD(_ text:String? = nil){
    SVProgressHUD.setContainerView(sceneDelegate?.window)
    SVProgressHUD.show(withStatus: text)
}
 
func hiddenHUD(_ delay:TimeInterval? = nil){
    if delay != nil{
        SVProgressHUD.dismiss(withDelay: delay!)
    }else{
        SVProgressHUD.dismiss()
    }
}
 
extension UIButton {
    func localGradientColor(cornerRadius:Double,bounds:CGRect? = nil){
        self.layer.sublayers?.removeAll(where: {$0 is CAGradientLayer})
        self.jq_gradientColor(colorArr: [UIColor(hexStr: "#FD8802").cgColor,UIColor(hexStr: "#FD8802").cgColor], cornerRadius: cornerRadius, startPoint: CGPoint(x: 0, y: 0), endPoint: CGPoint(x: 0, y: 1), bounds: bounds)
    }
}