Commit ad955c1e authored by lmj_521aiau@163.com's avatar lmj_521aiau@163.com

log

parent 803e6511
......@@ -23,10 +23,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
}, failure: {
})
// SHUserAccountManager.shared.logCollection(with: .appStart)
MobClick.event("app_start")
SHUserAccountManager.shared.logCollection(with: .appStart)
SHUserAccountManager.shared.getNovelInfo { (json) in
}
// SHUserAccountManager.shared.getNovelInfo { (json) in
// }
self.window = UIWindow(frame: UIScreen.main.bounds)
......
......@@ -40,9 +40,10 @@ class SHBaseViewController: UIViewController {
self.navigationController?.popViewController(animated: true)
}
@objc public func goGoods(){
@objc public func goGoods(_ type:String){
let goodsVC = UIStoryboard.init(name: "Goods", bundle: nil).instantiateViewController(withIdentifier: "SHGoodsViewController") as! SHGoodsViewController
goodsVC.logValue = type
let nav = SHBaseNavigationController(rootViewController: goodsVC)
nav.modalPresentationStyle = .fullScreen
self.present(nav, animated: true, completion: nil)
......
......@@ -72,7 +72,7 @@
</constraints>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="3天免费试用,之后¥498/年,随时取消" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="bYQ-iK-LKQ">
<rect key="frame" x="63.333333333333329" y="139" width="248.66666666666669" height="17"/>
<rect key="frame" x="63.333333333333329" y="125.66666666666663" width="248.66666666666669" height="17"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
......@@ -142,7 +142,7 @@
<constraint firstItem="zdZ-po-8RK" firstAttribute="leading" secondItem="7CA-md-1C7" secondAttribute="leading" id="AbC-E6-8RL"/>
<constraint firstItem="97G-xL-vUR" firstAttribute="centerY" secondItem="zdZ-po-8RK" secondAttribute="centerY" id="FHh-jS-ozY"/>
<constraint firstItem="zdZ-po-8RK" firstAttribute="top" secondItem="8CH-Xu-Rvt" secondAttribute="top" id="Ire-xb-j6d"/>
<constraint firstItem="bYQ-iK-LKQ" firstAttribute="centerY" secondItem="paw-ud-pJv" secondAttribute="centerY" multiplier="1.1" id="LrC-6k-V4B"/>
<constraint firstItem="bYQ-iK-LKQ" firstAttribute="centerY" secondItem="paw-ud-pJv" secondAttribute="centerY" id="LrC-6k-V4B"/>
<constraint firstItem="7CA-md-1C7" firstAttribute="centerY" secondItem="paw-ud-pJv" secondAttribute="centerY" multiplier="0.5" id="P8S-Vw-F5z"/>
<constraint firstItem="8CH-Xu-Rvt" firstAttribute="centerX" secondItem="bYQ-iK-LKQ" secondAttribute="centerX" id="PaG-1z-1ya"/>
<constraint firstItem="97G-xL-vUR" firstAttribute="trailing" secondItem="7CA-md-1C7" secondAttribute="trailing" id="TPF-52-ghN"/>
......
......@@ -14,14 +14,23 @@ class SHGoodsViewController: SHBaseViewController {
@IBOutlet weak var yearStoreBtn: UIButton!
@IBOutlet weak var yearStoreBtnBgView: UIView!
@objc public var logValue: String?
let startTime: CFTimeInterval = CACurrentMediaTime()
private var pruducts: [SHAPProductModel] = []
override func viewDidLoad() {
super.viewDidLoad()
setupUI()
getDataSource()
if SHUserAccountManager.shared.isMember == true {
MBProgressHUD.showSuccess("您已成为会员", to: self.view)
}
MobClick.event("pay_page_show", label: logValue)
let params = ["event": "guazinovel", "action": "pay_page_show", "value": logValue]
CMNetworkManager.shared.postLogRequest(withPath: .logCollection, parameters: params as [String : Any]) { (json, error) in
}
}
override func viewWillAppear(_ animated: Bool) {
......@@ -36,8 +45,8 @@ class SHGoodsViewController: SHBaseViewController {
yearStoreBtnBgView.layer.cornerRadius = yearStoreBtnBgView.frame.size.height/2
yearStoreBtn.layer.cornerRadius = yearStoreBtn.frame.size.height/2
// yearStoreBtn.setTitle(SHUserAccountManager.shared.autoButtonText, for: .normal)
// yearStoreLab.text = SHUserAccountManager.shared.threeDayText
yearStoreBtn.setTitle(SHUserAccountManager.shared.autoButtonText, for: .normal)
yearStoreLab.text = SHUserAccountManager.shared.threeDayText
let animation = CABasicAnimation.init()
animation.duration = 0.66
......@@ -64,6 +73,20 @@ class SHGoodsViewController: SHBaseViewController {
}
@objc @IBAction func cancelBtnClick(_ sender: UIButton){
MobClick.event("pay_payment_close_click", label: logValue)
var params = ["event": "guazinovel", "action": "pay_payment_close_click", "value": logValue]
CMNetworkManager.shared.postLogRequest(withPath: .logCollection, parameters: params as [String : Any]) { (json, error) in
}
let endTime = CACurrentMediaTime()
let time = String(format: "%.3f", endTime - startTime)
MobClick.event("pay_page_stay", label: (logValue ?? "")+","+time)
params = ["event": "guazinovel", "action": "pay_page_stay", "value": (logValue ?? "")+","+time]
CMNetworkManager.shared.postLogRequest(withPath: .logCollection, parameters: params as [String : Any]) { (json, error) in
}
self.navigationController?.dismiss(animated: true, completion: nil)
}
......@@ -71,7 +94,16 @@ class SHGoodsViewController: SHBaseViewController {
let productId = pruducts.filter({ $0.productId.contains("year") }).first?.productId ?? "com.ShorthandMaster.www.subscription.yearly"
MobClick.event("pay_year_vip_click", label: logValue)
let params = ["event": "guazinovel", "action": "pay_year_vip_click", "value": logValue]
CMNetworkManager.shared.postLogRequest(withPath: .logCollection, parameters: params as [String : Any]) { (json, error) in
}
SHStoreManager.purchaseWithProductId(productId: productId, inView: self.view, success: {
MobClick.event("pay_year_success", label: self.logValue)
let params = ["event": "guazinovel", "action": "pay_year_success", "value": self.logValue]
CMNetworkManager.shared.postLogRequest(withPath: .logCollection, parameters: params as [String : Any]) { (json, error) in
}
SHUserAccountManager.shared.getUserInfo({ (model) in
self.dismiss(animated: true, completion: nil)
......@@ -80,6 +112,10 @@ class SHGoodsViewController: SHBaseViewController {
})
}, faliure: { errString in
MobClick.event("pay_year_fail", label: (self.logValue ?? "")+":"+errString)
let params = ["event": "guazinovel", "action": "pay_year_fail", "value": (self.logValue ?? "")+":"+errString]
CMNetworkManager.shared.postLogRequest(withPath: .logCollection, parameters: params as [String : Any]) { (json, error) in
}
})
}
......@@ -87,8 +123,8 @@ class SHGoodsViewController: SHBaseViewController {
switch sender.tag {
case 100:
let webVc = SHWebViewController()
webVc.title = "使用条款"
webVc.url = SHUserAccountManager.shared.h5_url["user"].stringValue
webVc.title = "隐私政策"
webVc.url = SHUserAccountManager.shared.h5_url["privacy"].stringValue
self.navigationController?.pushViewController(webVc, animated: true)
break
case 101:
......@@ -99,11 +135,17 @@ class SHGoodsViewController: SHBaseViewController {
self.navigationController?.dismiss(animated: true, completion: nil)
})
}, toView: self.view)
MobClick.event("pay_restore_click", label: logValue)
let params = ["event": "guazinovel", "action": "pay_restore_click", "value": logValue]
CMNetworkManager.shared.postLogRequest(withPath: .logCollection, parameters: params as [String : Any]) { (json, error) in
}
break
case 102:
let webVc = SHWebViewController()
webVc.title = "隐私政策"
webVc.url = SHUserAccountManager.shared.h5_url["privacy"].stringValue
webVc.title = "使用条款"
webVc.url = SHUserAccountManager.shared.h5_url["user"].stringValue
self.navigationController?.pushViewController(webVc, animated: true)
break
default:
......
......@@ -20,6 +20,11 @@
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>App需要您开启定位权限,命名您的文件名称</string>
<key>NSLocationAlwaysUsageDescription</key>
......@@ -57,5 +62,7 @@
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIUserInterfaceStyle</key>
<string>Light</string>
</dict>
</plist>
......@@ -24,6 +24,8 @@ typedef void(^finishBlock)(void);
+ (void)alertControllerWithTitle:(NSString *)tilte message:(NSString *)message view:(UIView *)currentView cancelTitle:(NSString *)cancelTitle cancelBlock:(cancelBlock)cancelBlock confirm:(NSString *)confirmTitle confirmBlock:(confirmBlock)confirmBlock finishBlock:(finishBlock)finishBlock;
+ (void)alertControllerWithTitle:(NSString *)tilte message:(NSString *)message cancelTitle:(NSString *)cancelTitle cancelBlock:(cancelBlock)cancelBlock confirm:(NSString *)confirmTitle confirmTitleColor:(UIColor *)color confirmBlock:(confirmBlock)confirmBlock finishBlock:(finishBlock)finishBlock;
+ (void)alertControllerWithTitle:(NSString *)tilte message:(NSString *)message alignment:(NSTextAlignment)alignment cancelTitle:(NSString *)cancelTitle cancelBlock:(cancelBlock)cancelBlock confirm:(NSString *)confirmTitle confirmBlock:(confirmBlock)confirmBlock finishBlock:(finishBlock)finishBlock;
//- (void)alertControllerWithPhoto:(NSString *)imageStr finishBlock:(finishBlock)finishBlock;
......
......@@ -56,15 +56,20 @@
+ (void)alertControllerWithTitle:(NSString *)tilte message:(NSString *)message view:(UIView *)currentView cancelTitle:(NSString *)cancelTitle cancelBlock:(cancelBlock)cancelBlock confirm:(NSString *)confirmTitle confirmBlock:(confirmBlock)confirmBlock finishBlock:(finishBlock)finishBlock{
[AlertControllerTool alertControllerWithTitle:tilte message:message view:currentView alignment:NSTextAlignmentCenter cancelTitle:cancelTitle cancelBlock:cancelBlock confirm:confirmTitle confirmBlock:confirmBlock finishBlock:finishBlock];
[AlertControllerTool alertControllerWithTitle:tilte message:message view:currentView alignment:NSTextAlignmentCenter cancelTitle:cancelTitle cancelBlock:cancelBlock confirmTitle:confirmTitle confirmTitleColor:nil confirmBlock:confirmBlock finishBlock:finishBlock];
}
+ (void)alertControllerWithTitle:(NSString *)tilte message:(NSString *)message alignment:(NSTextAlignment)alignment cancelTitle:(NSString *)cancelTitle cancelBlock:(cancelBlock)cancelBlock confirm:(NSString *)confirmTitle confirmBlock:(confirmBlock)confirmBlock finishBlock:(finishBlock)finishBlock{
[AlertControllerTool alertControllerWithTitle:tilte message:message view:nil alignment:alignment cancelTitle:cancelTitle cancelBlock:cancelBlock confirm:confirmTitle confirmBlock:confirmBlock finishBlock:finishBlock];
[AlertControllerTool alertControllerWithTitle:tilte message:message view:nil alignment:alignment cancelTitle:cancelTitle cancelBlock:cancelBlock confirmTitle:confirmTitle confirmTitleColor:nil confirmBlock:confirmBlock finishBlock:finishBlock];
}
+ (void)alertControllerWithTitle:(NSString *)tilte message:(NSString *)message view:(UIView *)currentView alignment:(NSTextAlignment)alignment cancelTitle:(NSString *)cancelTitle cancelBlock:(cancelBlock)cancelBlock confirm:(NSString *)confirmTitle confirmBlock:(confirmBlock)confirmBlock finishBlock:(finishBlock)finishBlock{
+ (void)alertControllerWithTitle:(NSString *)tilte message:(NSString *)message cancelTitle:(NSString *)cancelTitle cancelBlock:(cancelBlock)cancelBlock confirm:(NSString *)confirmTitle confirmTitleColor:(UIColor *)color confirmBlock:(confirmBlock)confirmBlock finishBlock:(finishBlock)finishBlock{
[AlertControllerTool alertControllerWithTitle:tilte message:message view:nil alignment:NSTextAlignmentCenter cancelTitle:cancelTitle cancelBlock:cancelBlock confirmTitle:confirmTitle confirmTitleColor:color confirmBlock:confirmBlock finishBlock:finishBlock];
}
+ (void)alertControllerWithTitle:(NSString *)tilte message:(NSString *)message view:(UIView *)currentView alignment:(NSTextAlignment)alignment cancelTitle:(NSString *)cancelTitle cancelBlock:(cancelBlock)cancelBlock confirmTitle:(NSString *)confirmTitle confirmTitleColor:(UIColor *)color confirmBlock:(confirmBlock)confirmBlock finishBlock:(finishBlock)finishBlock{
dispatch_async(dispatch_get_global_queue(0, 0), ^{
dispatch_sync(dispatch_get_main_queue(), ^{
......@@ -83,6 +88,9 @@
confirmBlock(nil);
}
}];
if (color) {
[confirm setValue:color forKey:@"titleTextColor"];
}
//修改按钮文字颜色
// if ([cancel valueForKey:@"titleTextColor"]) {
// [cancel setValue:kColorWithRGB(85,141,251) forKey:@"titleTextColor"];
......
......@@ -28,8 +28,9 @@ class SHRecordListViewController: SHBaseViewController {
let leftImage = UIImage.init(named: "record_nav_user")?.withRenderingMode(.alwaysOriginal)
self.navigationItem.leftBarButtonItem = UIBarButtonItem.init(image: leftImage, style: .plain, target: self, action: #selector(userCilck))
setupUI()
// preposeMember()
preposeMember()
MobClick.event("tab_imp")
SHUserAccountManager.shared.logCollection(with: .tabImp)
/*
SHCloudManager.shared.cheakAccountStatus { (result) in
......@@ -99,48 +100,54 @@ class SHRecordListViewController: SHBaseViewController {
func removeModel(_ indexPath: IndexPath){
var list = CRUserDefaults.recordList
AlertControllerTool.alertController(withTitle: "提示", message: "确定要删除录音文件吗?", cancelTitle: "取消", cancel: {
}, confirm: "删除", confirmTitleColor: UIColor.red, confirmBlock: { message in
var list = CRUserDefaults.recordList
let deleteModel = dataSources[indexPath.row]
let deleteModel = self.dataSources[indexPath.row]
for (index, dic) in list!.enumerated(){
if dic["pathFile"] as! String == deleteModel.pathFile{
// var subDic = dic
// subDic["delete"] = true
// subDic["deleteDate"] = Date.init()
// list![index] = subDic
list!.remove(at: index)
break
}
}
CRUserDefaults.recordList = list
let keyValueStore = NSUbiquitousKeyValueStore.default
list = keyValueStore.object(forKey: "list") as? [Dictionary<String, Any>]
if var list = list {
for (index, dic) in list.enumerated(){
for (index, dic) in list!.enumerated(){
if dic["pathFile"] as! String == deleteModel.pathFile{
// var subDic = dic
// subDic["delete"] = true
// subDic["deleteDate"] = Date.init()
// list[index] = subDic
list.remove(at: index)
// var subDic = dic
// subDic["delete"] = true
// subDic["deleteDate"] = Date.init()
// list![index] = subDic
list!.remove(at: index)
break
}
}
keyValueStore.set(list, forKey: "list")
keyValueStore.synchronize()
}
dataSources.remove(at: indexPath.row)
self.tableView?.beginUpdates()
self.tableView?.deleteRows(at: [indexPath], with: .left)
self.tableView?.endUpdates()
DispatchQueue.main.asyncAfter(deadline: .now() + .milliseconds(333)) {
self.prepareDateSource()
}
CRUserDefaults.recordList = list
let keyValueStore = NSUbiquitousKeyValueStore.default
list = keyValueStore.object(forKey: "list") as? [Dictionary<String, Any>]
if var list = list {
for (index, dic) in list.enumerated(){
if dic["pathFile"] as! String == deleteModel.pathFile{
// var subDic = dic
// subDic["delete"] = true
// subDic["deleteDate"] = Date.init()
// list[index] = subDic
list.remove(at: index)
break
}
}
keyValueStore.set(list, forKey: "list")
keyValueStore.synchronize()
}
self.dataSources.remove(at: indexPath.row)
self.tableView?.beginUpdates()
self.tableView?.deleteRows(at: [indexPath], with: .left)
self.tableView?.endUpdates()
DispatchQueue.main.asyncAfter(deadline: .now() + .milliseconds(333)) {
self.prepareDateSource()
}
}, finish: nil)
// let range: Range = model.pathFile.range(of: "/record.wav")!
// let location: Int = model.pathFile.distance(from: model.pathFile.startIndex, to: range.lowerBound)
......@@ -165,38 +172,28 @@ class SHRecordListViewController: SHBaseViewController {
@objc func userCilck(){
// if SHUserAccountManager.shared.isMember == false {
self.goGoods()
MobClick.event("home_pop")
let params = ["event": "guazinovel", "action": "", "value": "home_pop"]
CMNetworkManager.shared.postLogRequest(withPath: .logCollection, parameters: params) { (json, error) in
}
self.goGoods("home_pop")
// }
}
@objc func preposeMember(){
if SHUserAccountManager.shared.isMember == false {
self.goGoods()
MobClick.event("home_pay")
let params = ["event": "guazinovel", "action": "", "value": "home_pay"]
CMNetworkManager.shared.postLogRequest(withPath: .logCollection, parameters: params) { (json, error) in
SHUserAccountManager.shared.getNovelInfo { (json) in
if SHUserAccountManager.shared.isMember == false && SHUserAccountManager.shared.isStartFront == true{
self.goGoods("home_pay")
}
}
}
@IBAction func goRecord(){
if dataSources.count > 1{
if dataSources.count > 0{
if SHUserAccountManager.shared.isMember == false{
self.goGoods()
self.goGoods("home_record")
return
}
}
MobClick.event("home_record")
let params = ["event": "guazinovel", "action": "", "value": "home_record"]
CMNetworkManager.shared.postLogRequest(withPath: .logCollection, parameters: params) { (json, error) in
}
let record = UIStoryboard.init(name: "Record", bundle: nil).instantiateViewController(withIdentifier: "SHRecordViewController") as! SHRecordViewController
self.navigationController?.pushViewController(record, animated: true)
}
......
......@@ -8,7 +8,7 @@
import UIKit
import AVFoundation
import Speech
//import Speech
import PDFGenerator
class SHRecordShowViewController: SHBaseViewController {
......@@ -17,6 +17,7 @@ class SHRecordShowViewController: SHBaseViewController {
private var playerTimeCount = 0
private var playerTimer: SHTimer?
/*
// 创建语音识别器,指定语音识别的语言环境 locale ,将来会转化为什么语言,这里是使用的当前区域,那肯定就是简体汉语啦
// private let speechRecognizer = SFSpeechRecognizer(locale: Locale.autoupdatingCurrent)
private let speechRecognizer = SFSpeechRecognizer(locale: Locale(identifier: "zh-CN"))
......@@ -24,7 +25,7 @@ class SHRecordShowViewController: SHBaseViewController {
private var recognitionRequest: SFSpeechURLRecognitionRequest?
// 语音识别任务,可监控识别进度。通过他可以取消或终止当前的语音识别任务
private var recognitionTask: SFSpeechRecognitionTask?
*/
@IBOutlet var recordTextView: UITextView?
@IBOutlet var bottomBgView: UIView!
......@@ -51,20 +52,20 @@ class SHRecordShowViewController: SHBaseViewController {
override func viewDidLoad() {
super.viewDidLoad()
AVAudioSession.sharedInstance().requestRecordPermission { (allowed) in
if !allowed {
return
}
}
let session:AVAudioSession = AVAudioSession.sharedInstance()
do {
try session.setCategory(AVAudioSession.Category.playAndRecord, options: .defaultToSpeaker)
}catch{
print("session config failed")
}
do { try AVAudioSession.sharedInstance().setActive(true) }
catch { print("session active failed") }
// AVAudioSession.sharedInstance().requestRecordPermission { (allowed) in
// if !allowed {
// return
// }
// }
// let session:AVAudioSession = AVAudioSession.sharedInstance()
// do {
// try session.setCategory(AVAudioSession.Category.playAndRecord, options: .defaultToSpeaker)
// }catch{
// print("session config failed")
// }
//
// do { try AVAudioSession.sharedInstance().setActive(true) }
// catch { print("session active failed") }
setupUI()
play()
......@@ -84,6 +85,7 @@ class SHRecordShowViewController: SHBaseViewController {
confirmCilck()
}
/*
func prepareRecognition(){
let documentsFile = (NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true).first)!.appending(model!.pathFile)
......@@ -112,7 +114,8 @@ class SHRecordShowViewController: SHBaseViewController {
// self.recordTextView?.attributedText = self.textView_text(self.model!.txt)
}
})
}
}
*/
override func setupUI(){
......@@ -158,20 +161,20 @@ class SHRecordShowViewController: SHBaseViewController {
self.model!.rename = rename
self.setNavTitle(self.model!.rename)
var list = CRUserDefaults.recordList
for (index, dic) in list!.enumerated(){
if dic["pathFile"] as! String == self.model!.pathFile{
var subDic = dic
subDic["rename"] = rename
list![index] = subDic
break
if var list = CRUserDefaults.recordList {
for (index, dic) in list.enumerated(){
if dic["pathFile"] as! String == self.model!.pathFile{
var subDic = dic
subDic["rename"] = rename
list[index] = subDic
break
}
}
CRUserDefaults.recordList = list
}
CRUserDefaults.recordList = list
let keyValueStore = NSUbiquitousKeyValueStore.default
list = keyValueStore.object(forKey: "list") as? [Dictionary<String, Any>]
let list = keyValueStore.object(forKey: "list") as? [Dictionary<String, Any>]
if var list = list {
for (index, dic) in list.enumerated(){
......@@ -266,12 +269,12 @@ class SHRecordShowViewController: SHBaseViewController {
}
@objc func confirmCilck(){
recognitionTask?.cancel()
// recognitionTask?.cancel()
// if player?.isPlaying == false{
recordTextView?.attributedText = self.textView_text(model!.txt)
// }
recognitionTask = nil
recognitionRequest = nil
// recognitionTask = nil
// recognitionRequest = nil
}
@IBAction func playBtn(_ sender:UIButton){
......@@ -289,6 +292,12 @@ class SHRecordShowViewController: SHBaseViewController {
}
@objc fileprivate func generatePDF() {
if SHUserAccountManager.shared.isMember == false{
self.goGoods("draft_trans_pdf")
return
}
do {
let range: Range = model!.pathFile.range(of: "/record.mp3")!
let location: Int = model!.pathFile.distance(from: model!.pathFile.startIndex, to: range.lowerBound)
......@@ -314,10 +323,6 @@ class SHRecordShowViewController: SHBaseViewController {
activityVC.completionWithItemsHandler = {
activity, success, items, errot in
// result
MobClick.event("draft_trans_pdf")
let params = ["event": "guazinovel", "action": "", "value": "draft_trans_pdf"]
CMNetworkManager.shared.postLogRequest(withPath: .logCollection, parameters: params) { (json, error) in
}
}
present(activityVC, animated: true, completion: nil)
......
......@@ -214,7 +214,7 @@ class SHRecordViewController: SHBaseViewController{
if self.recognitionTaskText.count == 0 {
self.recordTextView.attributedText = self.textView_text(self.currentTxt ?? "")
}else{
self.recordTextView.attributedText = self.textView_text(self.recognitionTaskText.first! + "\n" + (self.currentTxt ?? ""))
self.recordTextView.attributedText = self.textView_text(self.recognitionTaskText.first!)
}
}
......@@ -265,11 +265,7 @@ class SHRecordViewController: SHBaseViewController{
let alert = SHMemberUpgradeAlertView.init()
self.view.window?.addSubview(alert)
alert.callBack = {
MobClick.event("record_upgrade")
let params = ["event": "guazinovel", "action": "", "value": "record_upgrade"]
CMNetworkManager.shared.postLogRequest(withPath: .logCollection, parameters: params) { (json, error) in
}
self.goGoods()
self.goGoods("record_upgrade")
}
}
......@@ -638,6 +634,12 @@ extension SHRecordViewController{
}
private func generatePDF() {
if SHUserAccountManager.shared.isMember == false{
self.goGoods("dialog_record_success_trans_pdf")
return
}
do {
let range: Range = currentModel!.pathFile.range(of: "/record.mp3")!
let location: Int = currentModel!.pathFile.distance(from: currentModel!.pathFile.startIndex, to: range.lowerBound)
......@@ -663,11 +665,6 @@ extension SHRecordViewController{
activityVC.completionWithItemsHandler = {
activity, success, items, errot in
// result
MobClick.event("dialog_record_success_trans_pdf")
let params = ["event": "guazinovel", "action": "", "value": "dialog_record_success_trans_pdf"]
CMNetworkManager.shared.postLogRequest(withPath: .logCollection, parameters: params) { (json, error) in
}
}
present(activityVC, animated: true, completion: nil)
......
......@@ -34,7 +34,7 @@ import SwiftyJSON
@objc var isMember: Bool {
return true
// return true
let dateFormatter = DateFormatter()
dateFormatter.locale = Locale(identifier: "en_CN")
......
......@@ -17,13 +17,13 @@ enum CMLogCollecAction: String {
}
struct CMAPIManager {
#if DEBUG
static let baseUrl = "https://feedapitest.zhangxinhulian.com"
static let reportUrl = "http://reporttest.zhangxinhulian.com"
#else
static let baseUrl = "https://feedapi.seedsnovel.com"
static let reportUrl = "http://report.seedsnovel.com"
#endif
// #if DEBUG
// static let baseUrl = "https://feedapitest.zhangxinhulian.com"
// static let reportUrl = "http://reporttest.zhangxinhulian.com"
// #else
static let baseUrl = "http://feedapi.endpointcontent.com"
static let reportUrl = "http://report.endpointcontent.com"
// #endif
}
enum CMURLPath {
......
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