Commit 9589b1b9 authored by David黄金龙's avatar David黄金龙

1、日志输出

2、首页添加相应资源
parent fc65b59e
......@@ -287,9 +287,9 @@
A5ACE8D72B4564F7002C94D2 /* Classes */ = {
isa = PBXGroup;
children = (
A5ACE91B2B4564F7002C94D2 /* Modules */,
A5ACE91E2B4564F7002C94D2 /* Base */,
A5ACE8EE2B4564F7002C94D2 /* Tools */,
A5ACE91B2B4564F7002C94D2 /* Modules */,
);
path = Classes;
sourceTree = "<group>";
......
......@@ -107,10 +107,6 @@ extension AppDelegate {
}
YHNetworkStatusManager.shared.listenNetWorkStatus()
}
//1.设置主窗口
......
......@@ -37,7 +37,9 @@ class YHBaseViewController: UIViewController {
}
deinit {
#if DEBUG
print(#function)
// print(type(of: self))
// print("执行了方法:",terminator: "\t")
printLog(#function)
#endif
}
}
......
......@@ -17,6 +17,13 @@ class YHHomeViewController: YHBaseViewController {
return YHHomePageViewModel()
}()
lazy var headBkgImagV: UIImageView = {
let imagV = UIImageView()
imagV.image = UIImage(named: "home_head_bkg")
imagV.contentMode = .scaleAspectFill
return imagV
}()
override func viewDidLoad() {
super.viewDidLoad()
......@@ -52,8 +59,18 @@ class YHHomeViewController: YHBaseViewController {
}
private func initView()->Void {
navigationItem.title = "首页"
navigationItem.title = ""
view.backgroundColor = UIColor(hex:0xE9E9E9)
view.addSubview(headBkgImagV)
headBkgImagV.snp.makeConstraints { make in
make.top.left.right.equalToSuperview()
make.height.equalTo(307)
}
}
}
......@@ -30,7 +30,7 @@ extension YHHomePageViewModel {
return
}
self.subject.onNext(YHHomeCofigMode())
print("model 是 ==>",model)
printLog("model 是 ==> \(model)")
} failBlock: { err in
print(err)
}
......
......@@ -18,7 +18,7 @@ extension String {
}
return [String:Any]()
}
/// JSONString转换为数组
func toArray() -> Array<Any>? {
guard let jsonData:Data = data(using: .utf8) else { return nil }
......@@ -187,14 +187,3 @@ extension String {
}
}
/// 打印
///
/// - Parameters:
/// - message: 打印内容
/// - file: 所在文件
/// - method: 所在方法
/// - line: 所在行
public func printLog<T>(_ message: T, file: String = #file, method: String = #function, line: Int = #line) {
print("\n[文件]:\((file as NSString).lastPathComponent) [所在行]:\(line),[方法名称]:\(method),[具体信息]:\(message)")
}
......@@ -12,14 +12,20 @@ import UIKit
let APP_NAME = Bundle.main.infoDictionary!["CFBundleName"] as! String
func YHLOG<T>(message:T,file:String = #file,funcName:String = #function,lineName:Int = #line){
//这个DEBUG 是一个debug时候的一个flag需要自己去xcode设置项设置。
/// 打印
///
/// - Parameters:
/// - message: 打印内容
/// - file: 所在文件
/// - method: 所在方法
/// - line: 所在行
public func printLog<T>(_ message: T, file: String = #file, method: String = #function, line: Int = #line) {
#if DEBUG
let flieName = (file as NSString).lastPathComponent
print("\(APP_NAME)/\(flieName)/\(funcName)/\(lineName):\(message)")
print("\n开始一段日志输出=========>\n[文件]:\((file as NSString).lastPathComponent)\n[所在行]:\(line)\n[方法名称]:\(method)\n[打印信息]:\(message)\n结束该段日志输出<=========\n\n\n")
#endif
}
///屏幕宽度
let KScreenWidth = UIScreen.main.bounds.size.width
///屏幕高度
......@@ -137,60 +143,60 @@ func isIphoneX() -> Bool {
class YhConstant {
// MARK: - URL 相关
struct URL {
// MARK: - 帮助与反馈
static let userQAUrl = YHBaseUrlManager.shared.h5URL() + "landing/index.html#/pages/my/index"
// MARK: - 优眠用户注销条款
static let userUnregisterURL = "https://www.baidu.com"
// MARK: - 隐私政策
static let privacyURL = YHBaseUrlManager.shared.h5URL() + "landing/index.html#/subpages/personal/pages/protocol/index?classify=privacy"
// MARK: - 用户协议
static let userProtocalURL = YHBaseUrlManager.shared.h5URL() + "landing/index.html#/subpages/personal/pages/protocol/index?classify=agreement"
// MARK: - 付费咨询服务协议
static let payProtocalURL = "https://www.baidu.com"
// MARK: - 官网地址
static let officialWebsite = "https://www.sumian.com"
// MARK: - 量表入口
static let liangBiaoEntryWebsite = YHBaseUrlManager.shared.h5URL() + "landing/index.html#/pages/medicineCenter/index"
// MARK: - 通用链接,可以在 Safari 等 web 环境打开 APP,目前主要是提供给微信APP调用
static let universal_link = "https://sdapi.sumian.com/sleepdoctor/"
static let wx_universal_link = universal_link + "wx-sign-in/"
// MARK: - 医学中心
static let medical_center_url = YHBaseUrlManager.shared.h5URL() + "landing/index.html#/pages/medicineCenter/index"
// MARK: - 文章详情
static let article_detail_url = YHBaseUrlManager.shared.h5URL() + "landing/index.html#/subpages/platform/pages/articledetail/index?immerse=1"
}
// MARK: - 阿里云 手机号一键登录 秘钥信息
static let kAliOnePressPhoneLoginKey = "pjYDHIVE1Q4qu7QJNI8MaxfvqJQvn5j+Az8xHRlnctj+kUAGf2Hin6ONsTFu1yjCwWPvhmw5NlhFo5DuP1SabykuX1Dz/xl4aDDLQQ5oijBNqRtwmwFAHl/exvfLk6zndWdv3Hi+DUL6gRwAj2UWj1rNXAMP2YSlisC0NSrFFFpiKyHAd2dM2OpIiGh9lkGeihU5iOjv/IycVMW6l2Sx9QqcrKiAX44aPMp0/uS5+y0xYwy/CjV6bvpacHNstxtVFd2Vgi7p454="
// MARK: - 登录信息
static let KLoginedInfoKey = "KLoginedInfoKey"
// MARK: - 上次登录成功后的 手机号码
static let KLastLoginedSuccessPhoneKey = "KLastLoginedSuccessPhoneKey"
// MARK: - 登录用户 详情信息
static let kDetailInfo = "kDetailInfo"
}
extension YhConstant {
......@@ -199,52 +205,52 @@ extension YhConstant {
static let appKey = "wx57b2a7469d15ff8f"
static let AppSecret = "e0a351290c66c05f85c54a31b213c1aa"
}
struct UM {
static let appKey = "5a77b807a40fa30f0300008b"
}
// MARK: - 支付宝
struct Alipay {
static let scheme = "com.usleep.health.alipay"
}
// MARK: - 通知相关 名称
class BsNotification {
public static let didCancelTaskNotification = Notification.Name(rawValue: "org.alamofire.notification.name.request.didCancelTask")
//用户详细信息更改成功
public static let didUpdateUserDetailInfoSuccessNotifiction = Notification.Name(rawValue: "com.usleep.health.updateUserDetailInfo.success")
//登录成功
public static let didLoginSuccessNotifiction = Notification.Name(rawValue: "com.usleep.health.login.success")
//退出成功
public static let didLoginoutSuccessNotifiction = Notification.Name(rawValue: "com.usleep.health.loginout.success")
//token 过期
public static let tokenInvalidateNotifiction = Notification.Name(rawValue: "com.usleep.health.token.invalidate")
//用户注册 在完成登录、修改密码后需要 填写标签
public static let needSelectTagsNotification = Notification.Name(rawValue: "com.usleep.health.selecte.tags")
//跳转安睡主页
public static let goAnSleepNotification = Notification.Name(rawValue: "com.usleep.health.go.An.sleep")
//跳转填写量表列表界面
public static let goFillScaleNotification = Notification.Name(rawValue: "com.usleep.health.go.Fill.Scale")
//支付结果回调
public static let payResultNotification = Notification.Name(rawValue: "com.usleep.health.pay.result")
//隐藏tabBar
public static let tabBarHideNotification = Notification.Name(rawValue: "com.usleep.health.tabBar.hide")
//显示tabBar
public static let tabBarShowNotification = Notification.Name(rawValue: "com.usleep.health.tabBar.show")
......
......@@ -106,7 +106,7 @@ class YHNetRequest: NSObject {
httpRequest?.responseString(completionHandler: { string in
#if DEBUG
print("\n网络请求已返回 string=\(string)")
printLog("\n网络请求已返回 string=\(string)")
#endif
self.completeHandle(string: string)
})
......@@ -207,12 +207,12 @@ class YHNetRequest: NSObject {
extension YHNetRequest {
class func getRequest(url:String, params:[String:Any] = [:], successBlock: SuccessHandlerType!, failBlock: FailureHandlerType!) -> Request? {
YHLOG(message:"\n发起请求的URL是===> url = \(url)")
printLog("\n发起请求的URL是===> url = \(url)")
return YHNetRequest().url(url).requestType(.get).success(successBlock).failed(failBlock).startRequest()
}
class func postRequest(url:String, params:[String:Any] = [:], successBlock: SuccessHandlerType!, failBlock: FailureHandlerType!) -> Request? {
YHLOG(message:"\n发起请求的URL是===> url = \(url)")
printLog("\n发起请求的URL是===> url = \(url)")
return YHNetRequest().url(url).requestType(.post).success(successBlock).failed(failBlock).startRequest()
}
}
......
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "Rectangle 8235.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Rectangle 8235@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Rectangle 8235@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment