//
|
// 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/app/"
|
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()
|
}
|
}
|