提交 328c6c03 authored 作者: 逄仁秀's avatar 逄仁秀

1

上级 061ef03c
......@@ -71,6 +71,6 @@ SPEC CHECKSUMS:
SDWebImage: b9a731e1d6307f44ca703b3976d18c24ca561e84
SnapKit: fe8a619752f3f27075cc9a90244d75c6c3f27e2a
PODFILE CHECKSUM: 2c02dcc29a9ee1c95e1075175ad5362ae5816532
PODFILE CHECKSUM: 205e606a62a452f94dd99783a0ca58690ab983aa
COCOAPODS: 1.11.3
......@@ -71,6 +71,6 @@ SPEC CHECKSUMS:
SDWebImage: b9a731e1d6307f44ca703b3976d18c24ca561e84
SnapKit: fe8a619752f3f27075cc9a90244d75c6c3f27e2a
PODFILE CHECKSUM: 2c02dcc29a9ee1c95e1075175ad5362ae5816532
PODFILE CHECKSUM: 205e606a62a452f94dd99783a0ca58690ab983aa
COCOAPODS: 1.11.3
......@@ -2,23 +2,23 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleIdentifier</key>
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>0.1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>NSPrincipalClass</key>
<string></string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>0.1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>
......@@ -23,7 +23,7 @@
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
buildConfiguration = "Release"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
......@@ -92,10 +92,10 @@
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
buildConfiguration = "Release">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
buildConfiguration = "Debug"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
......@@ -24,6 +24,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
let vc = storyBoard.instantiateInitialViewController()
window?.rootViewController = vc
Bugly.start(withAppId: "24c27e69cc")
// let provider = MoyaProvider<MyService>()
// provider.request(.getDomain) { result in
......
......@@ -36,6 +36,14 @@ class MainWebViewController: KJBaseViewController, WKNavigationDelegate {
}
decisionHandler(.allow)
}
func webView(_ webView: WKWebView, didCommit navigation: WKNavigation!) {
self.titleL.text = webView.title
}
func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
self.titleL.text = webView.title
}
/*
// MARK: - Navigation
......
......@@ -88,12 +88,36 @@ class KJHomeViewController: KJBaseViewController {
// 普通的网络请求
func getData() {
// 构建URL
let url:URL = URL(string: "https://www.danamudah.fun/kopisusu_server/user/get_home_service")!
let url:URL = URL(string: "https://www.danamudah.fun/kopisusu_server/user/get_banner")!
// 发送HTTP请求的的session对象
let session = URLSession.shared
// 构建请求request
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.setValue("id", forHTTPHeaderField: "language")
request.setValue("1.0.0", forHTTPHeaderField: "version")
request.setValue("IOS", forHTTPHeaderField: "device-type")
request.setValue("1.2", forHTTPHeaderField: "api-version")
request.setValue("EasyPay", forHTTPHeaderField: "app-name")
request.setValue("AppStore", forHTTPHeaderField: "place")
let str = DeviceManager.getDeviceModel()
var param = ["type": "1"]
if str.contains("iPad") == true {
param["device"] = "2"
} else if str.contains("iPhone") == true {
param["device"] = "1"
} else {
param["device"] = "2"
}
var jsonData = NSData()
do {
jsonData = try JSONSerialization.data(withJSONObject: param, options: .prettyPrinted) as NSData
} catch {
print(error.localizedDescription)
}
request.httpBody = jsonData as! Data
request.setValue(UserDefaults.standard.string(forKey: "token") ?? "", forHTTPHeaderField: "Token")
// 发一个post请求
let task = session.dataTask(with: request as URLRequest) {(
......@@ -290,6 +314,9 @@ extension KJHomeViewController: UICollectionViewDelegate, UICollectionViewDataSo
vc.index = 3
vc.titleText = "E-Money"
navigationController?.pushViewController(vc, animated: true)
} else if self.banner[index]?.url == "app://help" {
let vc = KJAboutViewController()
navigationController?.pushViewController(vc, animated: true)
} else {
// 构建URL
let hud = MBProgressHUD.showAdded(to: self.view, animated: true)
......@@ -350,7 +377,15 @@ extension KJHomeViewController: UICollectionViewDelegate, UICollectionViewDataSo
string = (self.banner[index]?.url ?? "") + "?adid=" + (Adjust.adid() ?? "") + "&device_tx_id="
}
let txid = (dict["ret"] as! NSDictionary)["tx_id"] as! String
let url = string + txid + "#?token=" + (UserDefaults.standard.string(forKey: "token") ?? "")
var url = string
let titleStr = self.banner[index]?.title ?? ""
if titleStr == "mudah" {
url = string + txid + "#?token=" + (UserDefaults.standard.string(forKey: "token") ?? "")
} else if titleStr == "kopisusu" {
url = string + txid + "#?token=" + (UserDefaults.standard.string(forKey: "kopi_token") ?? "")
} else {
url = string + txid
}
vc.url = url
self.navigationController?.pushViewController(vc, animated: true)
}
......
......@@ -14,5 +14,6 @@ class KJBannerModel: HandyJSON {
var need_login: String?
var type: String?
var url: String?
var title: String?
required init() {}
}
......@@ -24,8 +24,8 @@
<view clipsSubviews="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Jt4-FN-Beo">
<rect key="frame" x="15" y="113" width="363" height="90"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="充值金额" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ls1-wk-m4n">
<rect key="frame" x="15" y="15.000000000000002" width="65.333333333333329" height="22.666666666666671"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="jumlah isi ulang" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ls1-wk-m4n">
<rect key="frame" x="14.999999999999993" y="15.000000000000002" width="111.33333333333331" height="22.666666666666671"/>
<constraints>
<constraint firstAttribute="height" constant="22.5" id="H9O-Nw-l75"/>
</constraints>
......
......@@ -10,17 +10,17 @@ import UIKit
class KJZFCodeViewController: KJBaseViewController {
var toCharge: Bool = false
@IBOutlet weak var firstTF: UITextField!
@IBOutlet weak var firstTF: MyTextField!
@IBOutlet weak var secondTF: UITextField!
@IBOutlet weak var secondTF: MyTextField!
@IBOutlet weak var thirdTF: UITextField!
@IBOutlet weak var thirdTF: MyTextField!
@IBOutlet weak var forthTF: UITextField!
@IBOutlet weak var forthTF: MyTextField!
@IBOutlet weak var fifthTF: UITextField!
@IBOutlet weak var fifthTF: MyTextField!
@IBOutlet weak var sixthTF: UITextField!
@IBOutlet weak var sixthTF: MyTextField!
@IBOutlet weak var sureBtn: UIButton!
......@@ -35,6 +35,13 @@ class KJZFCodeViewController: KJBaseViewController {
forthTF.delegate = self
fifthTF.delegate = self
sixthTF.delegate = self
firstTF.myDelegate = self
secondTF.myDelegate = self
thirdTF.myDelegate = self
forthTF.myDelegate = self
fifthTF.myDelegate = self
sixthTF.myDelegate = self
}
@IBAction func sureAction(_ sender: Any) {
......@@ -111,7 +118,7 @@ class KJZFCodeViewController: KJBaseViewController {
}
extension KJZFCodeViewController: UITextFieldDelegate {
extension KJZFCodeViewController: UITextFieldDelegate, MyTextFieldDelegate {
func textFieldDidChangeSelection(_ textField: UITextField) {
if textField == firstTF {
if textField.text?.count ?? 0 >= 1 {
......@@ -139,4 +146,25 @@ extension KJZFCodeViewController: UITextFieldDelegate {
}
}
}
func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool {
if textField.text?.count ?? 0 >= 1 && string.count >= 1 {
return false
}
return true
}
func textFieldDidDelete(textfield: UITextField) {
if textfield == secondTF {
firstTF.becomeFirstResponder()
} else if textfield == thirdTF {
secondTF.becomeFirstResponder()
} else if textfield == forthTF {
thirdTF.becomeFirstResponder()
} else if textfield == fifthTF {
forthTF.becomeFirstResponder()
} else if textfield == sixthTF {
fifthTF.becomeFirstResponder()
}
}
}
......@@ -7,3 +7,7 @@
#import <SDCycleScrollView.h>
#import "DeviceManager.h"
#import <Bugly/Bugly.h>
......@@ -88,10 +88,10 @@ class KJLoginPhoneViewController: KJBaseViewController {
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.setValue("id", forHTTPHeaderField: "language")
request.setValue("1.0", forHTTPHeaderField: "version")
request.setValue("1.0.0", forHTTPHeaderField: "version")
request.setValue("IOS", forHTTPHeaderField: "device-type")
request.setValue("1.2", forHTTPHeaderField: "api-version")
request.setValue("danamudah", forHTTPHeaderField: "app-name")
request.setValue("EasyPay", forHTTPHeaderField: "app-name")
request.setValue("AppStore", forHTTPHeaderField: "place")
var param = ["phone": "62" + (textfield.text ?? "")]
var jsonData = NSData()
......@@ -150,10 +150,10 @@ class KJLoginPhoneViewController: KJBaseViewController {
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.setValue("id", forHTTPHeaderField: "language")
request.setValue("1.0", forHTTPHeaderField: "version")
request.setValue("1.0.0", forHTTPHeaderField: "version")
request.setValue("IOS", forHTTPHeaderField: "device-type")
request.setValue("1.2", forHTTPHeaderField: "api-version")
request.setValue("danamudah", forHTTPHeaderField: "app-name")
request.setValue("EasyPay", forHTTPHeaderField: "app-name")
request.setValue("AppStore", forHTTPHeaderField: "place")
var param = ["phone": "62" + (textfield.text ?? ""), "valid_code": pwd]
var jsonData = NSData()
......@@ -178,6 +178,7 @@ class KJLoginPhoneViewController: KJBaseViewController {
if (dict.allKeys as NSArray).contains("success") == true {
DispatchQueue.main.async {
UserDefaults.standard.set((dict["ret"] as! NSDictionary)["token"], forKey: "token")
UserDefaults.standard.set((dict["ret"] as! NSDictionary)["kopi_token"], forKey: "kopi_token")
UserDefaults.standard.set(self.textfield.text, forKey: "phone")
self.navigationController?.popViewController(animated: true)
}
......
//
// Bugly.h
//
// Version: 2.6(0)
//
// Copyright (c) 2017年 Tencent. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "BuglyConfig.h"
#import "BuglyLog.h"
BLY_START_NONNULL
@interface Bugly : NSObject
/**
* 初始化Bugly,使用默认BuglyConfigs
*
* @param appId 注册Bugly分配的应用唯一标识
*/
+ (void)startWithAppId:(NSString * BLY_NULLABLE)appId;
/**
* 使用指定配置初始化Bugly
*
* @param appId 注册Bugly分配的应用唯一标识
* @param config 传入配置的 BuglyConfig
*/
+ (void)startWithAppId:(NSString * BLY_NULLABLE)appId
config:(BuglyConfig * BLY_NULLABLE)config;
/**
* 使用指定配置初始化Bugly
*
* @param appId 注册Bugly分配的应用唯一标识
* @param development 是否开发设备
* @param config 传入配置的 BuglyConfig
*/
+ (void)startWithAppId:(NSString * BLY_NULLABLE)appId
developmentDevice:(BOOL)development
config:(BuglyConfig * BLY_NULLABLE)config;
/**
* 设置用户标识
*
* @param userId 用户标识
*/
+ (void)setUserIdentifier:(NSString *)userId;
/**
* 更新版本信息
*
* @param version 应用版本信息
*/
+ (void)updateAppVersion:(NSString *)version;
/**
* 设置关键数据,随崩溃信息上报
*
* @param value KEY
* @param key VALUE
*/
+ (void)setUserValue:(NSString *)value
forKey:(NSString *)key;
/**
* 获取USER ID
*
* @return USER ID
*/
+ (NSString *)buglyUserIdentifier;
/**
* 获取关键数据
*
* @return 关键数据
*/
+ (NSDictionary * BLY_NULLABLE)allUserValues;
/**
* 设置标签
*
* @param tag 标签ID,可在网站生成
*/
+ (void)setTag:(NSUInteger)tag;
/**
* 获取当前设置标签
*
* @return 当前标签ID
*/
+ (NSUInteger)currentTag;
/**
* 获取设备ID
*
* @return 设备ID
*/
+ (NSString *)buglyDeviceId;
/**
* 上报自定义Objective-C异常
*
* @param exception 异常信息
*/
+ (void)reportException:(NSException *)exception;
/**
* 上报错误
*
* @param error 错误信息
*/
+ (void)reportError:(NSError *)error;
/**
* @brief 上报自定义错误
*
* @param category 类型(Cocoa=3,CSharp=4,JS=5,Lua=6)
* @param aName 名称
* @param aReason 错误原因
* @param aStackArray 堆栈
* @param info 附加数据
* @param terminate 上报后是否退出应用进程
*/
+ (void)reportExceptionWithCategory:(NSUInteger)category
name:(NSString *)aName
reason:(NSString *)aReason
callStack:(NSArray *)aStackArray
extraInfo:(NSDictionary *)info
terminateApp:(BOOL)terminate;
/**
* SDK 版本信息
*
* @return SDK版本号
*/
+ (NSString *)sdkVersion;
/**
* APP 版本信息
*
* @return SDK版本号
*/
+ (NSString *)appVersion;
/**
* App 是否发生了连续闪退
* 如果 启动SDK 且 5秒内 闪退,且次数达到 3次 则判定为连续闪退
*
* @return 是否连续闪退
*/
+ (BOOL)isAppCrashedOnStartUpExceedTheLimit;
/**
* 关闭bugly监控
*/
+ (void)closeCrashReport;
BLY_END_NONNULL
@end
//
// BuglyConfig.h
// Bugly
//
// Copyright (c) 2016年 Tencent. All rights reserved.
//
#pragma once
#define BLY_UNAVAILABLE(x) __attribute__((unavailable(x)))
#if __has_feature(nullability)
#define BLY_NONNULL __nonnull
#define BLY_NULLABLE __nullable
#define BLY_START_NONNULL _Pragma("clang assume_nonnull begin")
#define BLY_END_NONNULL _Pragma("clang assume_nonnull end")
#else
#define BLY_NONNULL
#define BLY_NULLABLE
#define BLY_START_NONNULL
#define BLY_END_NONNULL
#endif
#import <Foundation/Foundation.h>
#import "BuglyLog.h"
BLY_START_NONNULL
@protocol BuglyDelegate <NSObject>
@optional
/**
* 发生异常时回调
*
* @param exception 异常信息
*
* @return 返回需上报记录,随异常上报一起上报
*/
- (NSString * BLY_NULLABLE)attachmentForException:(NSException * BLY_NULLABLE)exception;
/**
* 发生sigkill时回调
*
* @param exception 异常信息
*
* @return 返回需上报记录,随sigkill异常上报一起上报,返回值由app开发者决定
*/
- (NSString * BLY_NULLABLE)attachmentForSigkill;
/**
* 策略激活时回调
*
* @param tacticInfo
*
* @return app是否弹框展示
*/
- (BOOL) h5AlertForTactic:(NSDictionary *)tacticInfo;
@end
@interface BuglyConfig : NSObject
/**
* SDK Debug信息开关, 默认关闭
*/
@property (nonatomic, assign) BOOL debugMode;
/**
* 设置自定义渠道标识
*/
@property (nonatomic, copy) NSString *channel;
/**
* 设置自定义版本号
*/
@property (nonatomic, copy) NSString *version;
/**
* 设置自定义设备唯一标识
*/
@property (nonatomic, copy) NSString *deviceIdentifier;
/**
* 卡顿监控开关,默认关闭
*/
@property (nonatomic) BOOL blockMonitorEnable;
/**
* 卡顿监控判断间隔,单位为秒
*/
@property (nonatomic) NSTimeInterval blockMonitorTimeout;
/**
* 设置 App Groups Id (如有使用 Bugly iOS Extension SDK,请设置该值)
*/
@property (nonatomic, copy) NSString *applicationGroupIdentifier;
/**
* 进程内还原开关,默认开启
*/
@property (nonatomic) BOOL symbolicateInProcessEnable;
/**
* 非正常退出事件记录开关,默认关闭
*/
@property (nonatomic) BOOL unexpectedTerminatingDetectionEnable;
/**
* 页面信息记录开关,默认开启
*/
@property (nonatomic) BOOL viewControllerTrackingEnable;
/**
* Bugly Delegate
*/
@property (nonatomic, assign) id<BuglyDelegate> delegate;
/**
* 控制自定义日志上报,默认值为BuglyLogLevelSilent,即关闭日志记录功能。
* 如果设置为BuglyLogLevelWarn,则在崩溃时会上报Warn、Error接口打印的日志
*/
@property (nonatomic, assign) BuglyLogLevel reportLogLevel;
/**
* 崩溃数据过滤器,如果崩溃堆栈的模块名包含过滤器中设置的关键字,则崩溃数据不会进行上报
* 例如,过滤崩溃堆栈中包含搜狗输入法的数据,可以添加过滤器关键字SogouInputIPhone.dylib等
*/
@property (nonatomic, copy) NSArray *excludeModuleFilter;
/**
* 控制台日志上报开关,默认开启
*/
@property (nonatomic, assign) BOOL consolelogEnable;
/**
* 崩溃退出超时,如果监听到崩溃后,App一直没有退出,则到达超时时间后会自动abort进程退出
* 默认值 5s, 单位 秒
* 当赋值为0时,则不会自动abort进程退出
*/
@property (nonatomic, assign) NSUInteger crashAbortTimeout;
/**
* 设置自定义联网、crash上报域名
*/
@property (nonatomic, copy) NSString *crashServerUrl;
@end
BLY_END_NONNULL
//
// BuglyLog.h
// Bugly
//
// Copyright (c) 2017年 Tencent. All rights reserved.
//
#import <Foundation/Foundation.h>
// Log level for Bugly Log
typedef NS_ENUM(NSUInteger, BuglyLogLevel) {
BuglyLogLevelSilent = 0,
BuglyLogLevelError = 1,
BuglyLogLevelWarn = 2,
BuglyLogLevelInfo = 3,
BuglyLogLevelDebug = 4,
BuglyLogLevelVerbose = 5,
};
#pragma mark -
OBJC_EXTERN void BLYLog(BuglyLogLevel level, NSString *format, ...) NS_FORMAT_FUNCTION(2, 3);
OBJC_EXTERN void BLYLogv(BuglyLogLevel level, NSString *format, va_list args) NS_FORMAT_FUNCTION(2, 0);
#pragma mark -
#define BUGLY_LOG_MACRO(_level, fmt, ...) [BuglyLog level:_level tag:nil log:fmt, ##__VA_ARGS__]
#define BLYLogError(fmt, ...) BUGLY_LOG_MACRO(BuglyLogLevelError, fmt, ##__VA_ARGS__)
#define BLYLogWarn(fmt, ...) BUGLY_LOG_MACRO(BuglyLogLevelWarn, fmt, ##__VA_ARGS__)
#define BLYLogInfo(fmt, ...) BUGLY_LOG_MACRO(BuglyLogLevelInfo, fmt, ##__VA_ARGS__)
#define BLYLogDebug(fmt, ...) BUGLY_LOG_MACRO(BuglyLogLevelDebug, fmt, ##__VA_ARGS__)
#define BLYLogVerbose(fmt, ...) BUGLY_LOG_MACRO(BuglyLogLevelVerbose, fmt, ##__VA_ARGS__)
#pragma mark - Interface
@interface BuglyLog : NSObject
/**
* @brief 初始化日志模块
*
* @param level 设置默认日志级别,默认BLYLogLevelSilent
*
* @param printConsole 是否打印到控制台,默认NO
*/
+ (void)initLogger:(BuglyLogLevel) level consolePrint:(BOOL)printConsole;
/**
* @brief 打印BLYLogLevelInfo日志
*
* @param format 日志内容 总日志大小限制为:字符串长度30k,条数200
*/
+ (void)log:(NSString *)format, ... NS_FORMAT_FUNCTION(1, 2);
/**
* @brief 打印日志
*
* @param level 日志级别
* @param message 日志内容 总日志大小限制为:字符串长度30k,条数200
*/
+ (void)level:(BuglyLogLevel) level logs:(NSString *)message;
/**
* @brief 打印日志
*
* @param level 日志级别
* @param format 日志内容 总日志大小限制为:字符串长度30k,条数200
*/
+ (void)level:(BuglyLogLevel) level log:(NSString *)format, ... NS_FORMAT_FUNCTION(2, 3);
/**
* @brief 打印日志
*
* @param level 日志级别
* @param tag 日志模块分类
* @param format 日志内容 总日志大小限制为:字符串长度30k,条数200
*/
+ (void)level:(BuglyLogLevel) level tag:(NSString *) tag log:(NSString *)format, ... NS_FORMAT_FUNCTION(3, 4);
@end
framework module Bugly {
umbrella header "Bugly.h"
export *
module * { export * }
link framework "Foundation"
link framework "Security"
link framework "SystemConfiguration"
link "c++"
link "z"
}
......@@ -15,4 +15,5 @@ target 'iOS-2kj' do
pod 'SnapKit'
pod 'MBProgressHUD'
pod 'MCToast'
# pod 'Bugly'
end
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论