Commit a64525dd by Olzhas Aldabergenov

fixes

parent 124a1c3e
{ {
"DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "8C8D20BEB1D39A3810EA64426626AEAC4A6D4E9B", "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "5DF1EA6381DC40CE02B4EA5633CD220EAAC76936",
"DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : { "DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : {
}, },
"DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : { "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : {
"EA320F6FA9588ABC7C644742C268D060B5B8C40A" : 9223372036854775807, "EA320F6FA9588ABC7C644742C268D060B5B8C40A" : 9223372036854775807,
"CD1557C3AE966BEDF3490D85F9712687801B146C" : 9223372036854775807, "CD1557C3AE966BEDF3490D85F9712687801B146C" : 9223372036854775807,
"5DF1EA6381DC40CE02B4EA5633CD220EAAC76936" : 9223372036854775807,
"8C8D20BEB1D39A3810EA64426626AEAC4A6D4E9B" : 9223372036854775807 "8C8D20BEB1D39A3810EA64426626AEAC4A6D4E9B" : 9223372036854775807
}, },
"DVTSourceControlWorkspaceBlueprintIdentifierKey" : "443F5A42-E7E6-443D-8FC0-423FE8159820", "DVTSourceControlWorkspaceBlueprintIdentifierKey" : "443F5A42-E7E6-443D-8FC0-423FE8159820",
"DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : { "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : {
"EA320F6FA9588ABC7C644742C268D060B5B8C40A" : "KT\/", "EA320F6FA9588ABC7C644742C268D060B5B8C40A" : "KT\/",
"CD1557C3AE966BEDF3490D85F9712687801B146C" : "KT\/XCGLogger\/", "CD1557C3AE966BEDF3490D85F9712687801B146C" : "KT\/XCGLogger\/",
"5DF1EA6381DC40CE02B4EA5633CD220EAAC76936" : "kt-ios\/",
"8C8D20BEB1D39A3810EA64426626AEAC4A6D4E9B" : "KT2017\/" "8C8D20BEB1D39A3810EA64426626AEAC4A6D4E9B" : "KT2017\/"
}, },
"DVTSourceControlWorkspaceBlueprintNameKey" : "kt", "DVTSourceControlWorkspaceBlueprintNameKey" : "kt",
...@@ -19,6 +21,11 @@ ...@@ -19,6 +21,11 @@
"DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "kt.xcworkspace", "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "kt.xcworkspace",
"DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [ "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [
{ {
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "http:\/\/gitlab.arta.kz\/neox\/kt-ios.git",
"DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git",
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "5DF1EA6381DC40CE02B4EA5633CD220EAAC76936"
},
{
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/gitlab.com\/Sofrano\/KT2017.git", "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/gitlab.com\/Sofrano\/KT2017.git",
"DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git",
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "8C8D20BEB1D39A3810EA64426626AEAC4A6D4E9B" "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "8C8D20BEB1D39A3810EA64426626AEAC4A6D4E9B"
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "190" startingLineNumber = "190"
endingLineNumber = "190" endingLineNumber = "190"
landmarkName = "megalineInfoAction(_:event:)" landmarkName = "megalineInfoAction(sender:event:)"
landmarkType = "7"> landmarkType = "7">
</BreakpointContent> </BreakpointContent>
</BreakpointProxy> </BreakpointProxy>
...@@ -161,5 +161,69 @@ ...@@ -161,5 +161,69 @@
landmarkType = "3"> landmarkType = "3">
</BreakpointContent> </BreakpointContent>
</BreakpointProxy> </BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "kt/ViewControllers/Cabinet/Login/LoginViewController.swift"
timestampString = "529493159.41857"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "579"
endingLineNumber = "579"
landmarkName = "applicationWillResignActive()"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "kt/ViewControllers/Cabinet/Login/LoginViewController.swift"
timestampString = "529493159.41857"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "579"
endingLineNumber = "579"
landmarkName = "applicationWillResignActive()"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "kt/ViewControllers/Cabinet/Login/LoginViewController.swift"
timestampString = "529493159.41857"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "549"
endingLineNumber = "549"
landmarkName = "showHelpAlert()"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "kt/ViewControllers/Cabinet/Login/LoginViewController.swift"
timestampString = "529493159.41857"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "554"
endingLineNumber = "554"
landmarkName = "showHelpAlert()"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints> </Breakpoints>
</Bucket> </Bucket>
...@@ -44,12 +44,15 @@ extension Facade { ...@@ -44,12 +44,15 @@ extension Facade {
onError(error: error.localizedDescription) onError(error: error.localizedDescription)
} else { } else {
Router.globalLog.debug(resp) Router.globalLog.debug(resp)
if json["msg"].string == "ok" {
onSuccess() onSuccess()
} else {
Router.globalLog.error("connectWifi error") // if json["msg"].string == "ok" {
onError(error: LS("error")) // onSuccess()
} // } else {
// Router.globalLog.error("connectWifi error")
// onError(error: LS("error"))
// }
} }
}) })
} }
...@@ -64,12 +67,15 @@ extension Facade { ...@@ -64,12 +67,15 @@ extension Facade {
onError(error: error.localizedDescription) onError(error: error.localizedDescription)
} else { } else {
Router.globalLog.debug(resp) Router.globalLog.debug(resp)
if json["msg"].string == "ok" {
onSuccess() onSuccess()
} else {
Router.globalLog.error(json["error"].stringValue) // if json["msg"].string == "ok" {
onError(error: json["error"].string == nil ? LS("error") : json["error"].stringValue) // onSuccess()
} // } else {
// Router.globalLog.error(json["error"].stringValue)
// onError(error: json["error"].string == nil ? LS("error") : json["error"].stringValue)
// }
} }
}) })
} }
......
...@@ -9,14 +9,17 @@ ...@@ -9,14 +9,17 @@
import Foundation import Foundation
class CallbackRegion : NSObject { class CallbackRegion : NSObject {
var id: String? var id: String?
var name: String? var name: String?
var regionType: String? var regionType: String?
var guid_server_id : String?
init(json: JSON) { init(json: JSON) {
self.id = json["id"].stringValue self.id = json["id"].stringValue
self.name = json["name"].stringValue self.name = json["name"].stringValue
self.regionType = json["region_type"].stringValue self.regionType = json["region_type"].stringValue
self.guid_server_id = json["guid_server_id"].stringValue
} }
init(name:String, id: String) { init(name:String, id: String) {
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
import Foundation import Foundation
class WifiOffer: WifiBaseOrder { class WifiOffer: WifiBaseOrder {
var tariffId: Int? var tariffId: Int?
var offerKz: String? var offerKz: String?
var offerRu: String? var offerRu: String?
......
...@@ -54,15 +54,17 @@ struct MegalineIdNet { ...@@ -54,15 +54,17 @@ struct MegalineIdNet {
let name: String let name: String
let device: String let device: String
let linkID: String
static func decode(json: [String : AnyObject]) -> MegalineIdNet? { static func decode(json: [String : AnyObject]) -> MegalineIdNet? {
guard guard
let name = json["PACKET_TYPE_NAME"] as? String, let name = json["PACKET_TYPE_NAME"] as? String,
let device = (json["DEVICE"] as? String) let device = (json["DEVICE"] as? String),
let linkID = (json["LINK_TYPE_ID"] as? String)
else { return nil } else { return nil }
return MegalineIdNet(name: name, device: device) return MegalineIdNet(name: name, device: device, linkID: linkID)
} }
// "LINK_TYPE_ID" : "810943065", // "LINK_TYPE_ID" : "810943065",
// "LIMIT_INFO" : "-1500(0)", // "LIMIT_INFO" : "-1500(0)",
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"images" : [ "images" : [
{ {
"idiom" : "universal", "idiom" : "universal",
"filename" : "promo_1.png", "filename" : "1onboarding_profile.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"images" : [ "images" : [
{ {
"idiom" : "universal", "idiom" : "universal",
"filename" : "promo_2.png", "filename" : "2onboarding_service.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"images" : [ "images" : [
{ {
"idiom" : "universal", "idiom" : "universal",
"filename" : "promo_1.png", "filename" : "3onboarding_payment.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
......
{
"images" : [
{
"idiom" : "universal",
"filename" : "ic_visibility_off.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "ic_visibility_off_2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "ic_visibility_off_3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "ic_visibility.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "ic_visibility_2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "ic_visibility_3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
...@@ -114,14 +114,14 @@ ...@@ -114,14 +114,14 @@
"software_rent.title" = "Аренда ПО"; "software_rent.title" = "Аренда ПО";
// promo // promo
"promo.title_0" = "Личный кабинет"; "promo.title_0" = "Добро пожаловать";
"promo.title_1" = "Спецпредложения"; "promo.title_1" = "Добро пожаловать";
"promo.title_2" = "Подключенные услуги"; "promo.title_2" = "Добро пожаловать";
"promo.title_3" = "promo title 4"; "promo.title_3" = "promo title 4";
"promo.description_0" = "Доступ в личный кабинет абонента с мобильного телефона. Просмотр текущего баланса и счетов"; "promo.description_0" = "Теперь Вам доступен личный кабинет с мобильного телефона. Авторизируйтесь и просмотрите данные своего профиля";
"promo.description_1" = "Мы составили несколько специальных предложений для вас!"; "promo.description_1" = "Просмотрите список подключенных услуг. Настройте или подключайте новые";
"promo.description_2" = "Посмотрите список текущих услуг, настройте или подключите новые"; "promo.description_2" = "Просмотрите текущий баланс на оплату и историю счетов. Оплатите услуги онлайн без комиссии";
"promo.description_3" = "promo description 4"; "promo.description_3" = "promo description 4";
// service_callback // service_callback
...@@ -463,7 +463,7 @@ ...@@ -463,7 +463,7 @@
"login.error.incorrect_login_or_password" = "Неверный логин или пароль"; "login.error.incorrect_login_or_password" = "Неверный логин или пароль";
"login.text_field.your_email.placeholder" = "Ваш e-mail"; "login.text_field.your_email.placeholder" = "Ваш e-mail";
"login.text_field.your_guid_number.placeholder" = "Номер вашего лицевого счета"; "login.text_field.your_guid_number.placeholder" = "Номер вашего лицевого счета";
"login.text_field.your_phone_number.placeholder" = "Ваш абонентский номер"; "login.text_field.your_phone_number.placeholder" = "Ваш абонентский номер (без +7)";
// Registration // Registration
......
...@@ -22,6 +22,7 @@ class KeyboardedViewController : UIViewController, UITextViewDelegate { ...@@ -22,6 +22,7 @@ class KeyboardedViewController : UIViewController, UITextViewDelegate {
override func viewWillDisappear(animated: Bool) { override func viewWillDisappear(animated: Bool) {
super.viewWillDisappear(animated) super.viewWillDisappear(animated)
self.view.endEditing(true) self.view.endEditing(true)
print("viewWillDisappear")
} }
func hideKeyboard(sender: AnyObject?) { func hideKeyboard(sender: AnyObject?) {
......
...@@ -71,6 +71,7 @@ class BotViewController: UIViewController { ...@@ -71,6 +71,7 @@ class BotViewController: UIViewController {
func textFieldShouldReturn(textField: UITextField) -> Bool { func textFieldShouldReturn(textField: UITextField) -> Bool {
textField.resignFirstResponder() textField.resignFirstResponder()
self.tableView.scrollToBottom(true)
return true return true
} }
...@@ -118,10 +119,10 @@ class BotViewController: UIViewController { ...@@ -118,10 +119,10 @@ class BotViewController: UIViewController {
if botResult.count != 0 { if botResult.count != 0 {
self.messagesList.append(botResult) self.messagesList.append(botResult)
self.tableView.reloadData() self.tableView.reloadData()
self.tableView.scrollToBottom(true)
} else { } else {
self.addMessage("Извините, по вашему запросу ничего не нашлось", type: 0) self.addMessage("Извините, по вашему запросу ничего не нашлось", type: 0)
} }
self.tableView.scrollToBottom(true)
}) { (error) in }) { (error) in
AlertViewUtil.showErrorAlert(error, vc: self) AlertViewUtil.showErrorAlert(error, vc: self)
} }
...@@ -136,10 +137,12 @@ class BotViewController: UIViewController { ...@@ -136,10 +137,12 @@ class BotViewController: UIViewController {
if botResult.count != 0 { if botResult.count != 0 {
self.messagesList.append(botResult) self.messagesList.append(botResult)
self.tableView.reloadData() self.tableView.reloadData()
self.tableView.scrollToBottom(true)
} else { } else {
self.addMessage("Извините, по вашему запросу ничего не нашлось", type: 0) self.addMessage("Извините, по вашему запросу ничего не нашлось", type: 0)
} }
self.messageField.text = ""
self.view.endEditing(true)
self.tableView.scrollToBottom(true)
}) { (error) in }) { (error) in
AlertViewUtil.showErrorAlert(error, vc: self) AlertViewUtil.showErrorAlert(error, vc: self)
} }
......
...@@ -221,6 +221,7 @@ extension AccountServicesViewController { ...@@ -221,6 +221,7 @@ extension AccountServicesViewController {
let device = Device() let device = Device()
device.device = self.accountServices?.megalineIdNets[index].device device.device = self.accountServices?.megalineIdNets[index].device
device.linkId = self.accountServices?.megalineIdNets[index].linkID
let vc = self.storyboard!.instantiateViewControllerWithIdentifier("PublicWifiViewController") as! PublicWifiViewController let vc = self.storyboard!.instantiateViewControllerWithIdentifier("PublicWifiViewController") as! PublicWifiViewController
vc.device = device vc.device = device
......
...@@ -20,9 +20,7 @@ class FeedViewController: ViewControllerWithMenu { ...@@ -20,9 +20,7 @@ class FeedViewController: ViewControllerWithMenu {
self.navigationItem.title = "Главная" self.navigationItem.title = "Главная"
SpinneredAlert.show(self) refreshBalance()
AbonentInfoManager.sharedInstance.updateUserInfo()
tableView.estimatedRowHeight = 44.0; tableView.estimatedRowHeight = 44.0;
tableView.rowHeight = UITableViewAutomaticDimension; tableView.rowHeight = UITableViewAutomaticDimension;
...@@ -30,6 +28,11 @@ class FeedViewController: ViewControllerWithMenu { ...@@ -30,6 +28,11 @@ class FeedViewController: ViewControllerWithMenu {
} }
func refreshBalance() {
SpinneredAlert.show(self)
AbonentInfoManager.sharedInstance.updateUserInfo()
}
override func viewWillAppear(animated: Bool) { override func viewWillAppear(animated: Bool) {
super.viewWillAppear(animated) super.viewWillAppear(animated)
configureBlueNavbar() configureBlueNavbar()
......
...@@ -17,6 +17,9 @@ class LKSettingsViewController: ViewControllerWithCustomTitle, UITableViewDelega ...@@ -17,6 +17,9 @@ class LKSettingsViewController: ViewControllerWithCustomTitle, UITableViewDelega
var rightBarButtonItem: UIBarButtonItem? var rightBarButtonItem: UIBarButtonItem?
var params: [String: AnyObject] = [String: AnyObject]() var params: [String: AnyObject] = [String: AnyObject]()
private let menuIcon = UIImage(named: "menu_icon")
private let menuButton: UIButton
override func viewWillAppear(animated: Bool) { override func viewWillAppear(animated: Bool) {
super.viewWillAppear(animated) super.viewWillAppear(animated)
titleLabel = UILabel(frame: CGRect(x: 0, y: 0, width: 150, height: 36)) titleLabel = UILabel(frame: CGRect(x: 0, y: 0, width: 150, height: 36))
...@@ -27,11 +30,51 @@ class LKSettingsViewController: ViewControllerWithCustomTitle, UITableViewDelega ...@@ -27,11 +30,51 @@ class LKSettingsViewController: ViewControllerWithCustomTitle, UITableViewDelega
self.navigationItem.titleView = titleLabel self.navigationItem.titleView = titleLabel
} }
required init?(coder aDecoder: NSCoder) {
menuButton = UIButton(frame: CGRect(origin: CGPoint(x: 0, y: 0), size: menuIcon!.size))
super.init(coder: aDecoder)
}
override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?) {
menuButton = UIButton(frame: CGRect(origin: CGPoint(x: 0, y: 0), size: menuIcon!.size))
super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
}
func addMenuBarButton() {
menuButton.setImage(menuIcon, forState: .Normal)
menuButton.setImage(UIImage(named: "menu_icon_highlighted"), forState: .Highlighted)
menuButton.addTarget(self, action: #selector(LKSettingsViewController.menuButton_TouchUpInside(_:)), forControlEvents: UIControlEvents.TouchUpInside)
self.navigationItem.leftBarButtonItem = UIBarButtonItem(customView: menuButton)
if UIDevice.currentDevice().userInterfaceIdiom == .Pad {
menuButton.enabled = !UIApplication.sharedApplication().statusBarOrientation.isLandscape
menuButton.hidden = UIApplication.sharedApplication().statusBarOrientation.isLandscape
}
if UIApplication.sharedApplication().statusBarOrientation.isLandscape {
menuButton.enabled = false
menuButton.hidden = true
} else {
menuButton.enabled = true
menuButton.hidden = false
}
}
func menuButton_TouchUpInside(sender: UIButton) {
if let rvc = self.navigationController!.parentViewController! as? RootVC {
rvc.openLeftSideViewControllerAnimated(true, completion: nil)
} else if let rvc = self.navigationController!.parentViewController! as? MainViewController {
let vc = rvc.parentViewController! as! RootVC
vc.openLeftSideViewControllerAnimated(true, completion: nil)
}
}
// MARK: View life cycle // MARK: View life cycle
override func viewDidLoad() { override func viewDidLoad() {
navigationBarTitle = §"menu.settings" navigationBarTitle = §"menu.settings"
PKNotification.loading(true) PKNotification.loading(true)
addMenuBarButton()
NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(LKSettingsViewController.requestSettings), NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(LKSettingsViewController.requestSettings),
name: AbonentInfoManager.NotificationNames.Update, object: AbonentInfoManager.sharedInstance) name: AbonentInfoManager.NotificationNames.Update, object: AbonentInfoManager.sharedInstance)
...@@ -255,26 +298,26 @@ class LKSettingsViewController: ViewControllerWithCustomTitle, UITableViewDelega ...@@ -255,26 +298,26 @@ class LKSettingsViewController: ViewControllerWithCustomTitle, UITableViewDelega
apiField: "", apiField: "",
available: false) available: false)
], ],
/*[ // [
NumberField( // NumberField(
text: (§"settings.count_password_change").uppercaseString, // text: (§"settings.count_password_change").uppercaseString,
title: "settings.count_password_change", // title: "settings.count_password_change",
placeholder: "7", // placeholder: "7",
apiField: "in_max_pswd_change_attempt", // apiField: "in_max_pswd_change_attempt",
numberValues: [3,5,7,10]), // numberValues: [3,5,7,10]),
NumberField( // NumberField(
text: (§"settings.count_lk_login_before_change_password").uppercaseString, // text: (§"settings.count_lk_login_before_change_password").uppercaseString,
title: "settings.count_lk_login_before_change_password", // title: "settings.count_lk_login_before_change_password",
placeholder: "60", // placeholder: "60",
apiField: "in_max_logon_count", // apiField: "in_max_logon_count",
numberValues: [10,20,30,40,50,60]), // numberValues: [10,20,30,40,50,60]),
NumberField( // NumberField(
text: (§"settings.count_unactiv_period").uppercaseString, // text: (§"settings.count_unactiv_period").uppercaseString,
title: "settings.count_unactiv_period", // title: "settings.count_unactiv_period",
placeholder: "15", // placeholder: "15",
apiField: "out_idle_timeout", // apiField: "out_idle_timeout",
numberValues: [15,20,30,60]), // numberValues: [15,20,30,60]),
],*/ // ],
[], [],
[ [
SwitchField( SwitchField(
......
...@@ -24,8 +24,8 @@ class FirstStepOfRegistrationVC : StepViewController, UIPickerViewDataSource { ...@@ -24,8 +24,8 @@ class FirstStepOfRegistrationVC : StepViewController, UIPickerViewDataSource {
@IBOutlet weak var codeTextField: UITextField! @IBOutlet weak var codeTextField: UITextField!
@IBOutlet weak var getCodeButton: UILabel! @IBOutlet weak var getCodeButton: UILabel!
private var serverItems : [ServerItem] = [] private var serverItems : [CallbackRegion] = []
private var serverItem: ServerItem! private var serverItem: CallbackRegion!
private var serverNames: [String] = [] private var serverNames: [String] = []
private var gradePicker: UIPickerView! private var gradePicker: UIPickerView!
...@@ -92,7 +92,20 @@ class FirstStepOfRegistrationVC : StepViewController, UIPickerViewDataSource { ...@@ -92,7 +92,20 @@ class FirstStepOfRegistrationVC : StepViewController, UIPickerViewDataSource {
} }
private func sendRequestGetServerListId() { private func sendRequestGetServerListId() {
Facade.sharedInstance().getListServerId({ (serverItems) in // Facade.sharedInstance().getListServerId({ (serverItems) in
// AbonentForRegister.sharedInstance().inServerId = serverItems[0].id!
// self.serverItems = serverItems
// self.serverItem = serverItems[0]
// self.serverNames = self.serverItems.map({$0.name ?? ""})
// self.regionTextField.inputView = self.gradePicker
// self.regionTextField.text = self.serverNames[0]
// }, onError: { (error) in
// print(error)
// }) {
//
// }
Facade.sharedInstance().getOfferRegions({ (serverItems) in
AbonentForRegister.sharedInstance().inServerId = serverItems[0].id! AbonentForRegister.sharedInstance().inServerId = serverItems[0].id!
self.serverItems = serverItems self.serverItems = serverItems
self.serverItem = serverItems[0] self.serverItem = serverItems[0]
......
...@@ -91,12 +91,15 @@ class StepViewController : ScrolledViewController, UIAlertViewDelegate, UIPicker ...@@ -91,12 +91,15 @@ class StepViewController : ScrolledViewController, UIAlertViewDelegate, UIPicker
self.cityButton.addTarget(self, action: #selector(StepViewController.cityButton_touchUpInside(_:)), forControlEvents: .TouchUpInside) self.cityButton.addTarget(self, action: #selector(StepViewController.cityButton_touchUpInside(_:)), forControlEvents: .TouchUpInside)
self.cityButton.sizeToFit() self.cityButton.sizeToFit()
alertVC.textFields[1].tag = 101
customAlertVC.addView(self.cityButton) customAlertVC.addView(self.cityButton)
customAlertVC.addButtonHandlers({ (button) -> Void in customAlertVC.addButtonHandlers({ (button) -> Void in
}, rightButtonHandler: { (button) -> Void in }, rightButtonHandler: { (button) -> Void in
let fioTitle = alertVC.textFields[0].text let fioTitle = alertVC.textFields[0].text
let phoneNumberTitle = alertVC.textFields[1].text let phoneNumberTitle = alertVC.textFields[1].text
if fioTitle == "" || phoneNumberTitle == "" || self.selectedRegion == nil { if fioTitle == "" || phoneNumberTitle == "" || self.selectedRegion == nil {
AlertViewUtil.showIncorrectAlert() AlertViewUtil.showIncorrectAlert()
} else if containsLetters(phoneNumberTitle!) || phoneNumberTitle?.characters.count != 10 { } else if containsLetters(phoneNumberTitle!) || phoneNumberTitle?.characters.count != 10 {
...@@ -105,6 +108,7 @@ class StepViewController : ScrolledViewController, UIAlertViewDelegate, UIPicker ...@@ -105,6 +108,7 @@ class StepViewController : ScrolledViewController, UIAlertViewDelegate, UIPicker
let params:[String: AnyObject] = ["region": self.selectedRegion!.id!, let params:[String: AnyObject] = ["region": self.selectedRegion!.id!,
"phone": phoneNumberTitle!, "phone": phoneNumberTitle!,
"type": 1, "type": 1,
"form_type": 1,
"name": fioTitle!, "name": fioTitle!,
"region_type": self.selectedRegion!.regionType! "region_type": self.selectedRegion!.regionType!
] ]
......
...@@ -40,7 +40,7 @@ class PaymentsHistoryViewController: UIViewController, UITableViewDataSource, UI ...@@ -40,7 +40,7 @@ class PaymentsHistoryViewController: UIViewController, UITableViewDataSource, UI
} }
@IBAction func pdfButton_click(sender: UIButton) { @IBAction func pdfButton_click(sender: UIButton) {
var urlString = "http://telecom.kz/api/get_year_history.pdf?token=\(Facade.accessToken!)&client_id=\(Facade.clientId!)" var urlString = "http://telecom.kz/api/get_year_history?token=\(Facade.accessToken!)&client_id=\(Facade.clientId!)"
let vc = KTWebViewController(url: urlString) let vc = KTWebViewController(url: urlString)
vc.title = LS("publishedCashes_pdfViewer_title") vc.title = LS("publishedCashes_pdfViewer_title")
vc.showCloseButton() vc.showCloseButton()
......
...@@ -128,7 +128,7 @@ class PublishedCashesViewController: UIViewController, UITableViewDataSource, UI ...@@ -128,7 +128,7 @@ class PublishedCashesViewController: UIViewController, UITableViewDataSource, UI
let accountId = String(Facade.accountId!) let accountId = String(Facade.accountId!)
let serverId = String(Facade.serverId!) let serverId = String(Facade.serverId!)
let periodId = String(self.periods[currentPeriodIndex!].period!) let periodId = String(self.periods[currentPeriodIndex!].period!)
let urlString = "http://telecom.kz/api/get_bill_history.pdf?token=\(Facade.accessToken!)&client_id=\(Facade.clientId!)&period_id=\(periodId)&abonent_id=\(accountId)&server_id=\(serverId)" let urlString = "http://telecom.kz/api/get_bill_history?token=\(Facade.accessToken!)&client_id=\(Facade.clientId!)&period_id=\(periodId)&abonent_id=\(accountId)&server_id=\(serverId)"
let vc = KTWebViewController(url: urlString) let vc = KTWebViewController(url: urlString)
vc.title = LS("publishedCashes_pdfViewer_title") vc.title = LS("publishedCashes_pdfViewer_title")
vc.showCloseButton() vc.showCloseButton()
...@@ -151,8 +151,8 @@ class PublishedCashesViewController: UIViewController, UITableViewDataSource, UI ...@@ -151,8 +151,8 @@ class PublishedCashesViewController: UIViewController, UITableViewDataSource, UI
self.loading(true) self.loading(true)
Facade.sharedInstance().getBillList(params, onSuccess: { (bills) in Facade.sharedInstance().getBillList(params, onSuccess: { (bills) in
if !bills.isEmpty { if !bills.isEmpty {
self.currentBill = bills[0] self.currentBill = bills[bills.count - 1]
self.periodIdsBills[self.periods[self.currentPeriodIndex!].periodId!] = bills[0] self.periodIdsBills[self.periods[self.currentPeriodIndex!].periodId!] = bills[bills.count - 1]
} }
}, onError: { (error) in }, onError: { (error) in
self.currentBill = nil self.currentBill = nil
......
...@@ -10,6 +10,7 @@ import Foundation ...@@ -10,6 +10,7 @@ import Foundation
import UIKit import UIKit
class PublicWifiViewController : UIViewController, UITableViewDataSource, UITableViewDelegate { class PublicWifiViewController : UIViewController, UITableViewDataSource, UITableViewDelegate {
@IBOutlet var tableView: UITableView! @IBOutlet var tableView: UITableView!
let orderCellIdentifier = "orderCell" let orderCellIdentifier = "orderCell"
var wifiOrders: [WifiBaseOrder] = [] var wifiOrders: [WifiBaseOrder] = []
...@@ -64,7 +65,6 @@ extension PublicWifiViewController { ...@@ -64,7 +65,6 @@ extension PublicWifiViewController {
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier(orderCellIdentifier, forIndexPath: indexPath) as! PublicWifiOrderCell let cell = tableView.dequeueReusableCellWithIdentifier(orderCellIdentifier, forIndexPath: indexPath) as! PublicWifiOrderCell
cell.fillCell(wifiOrders[indexPath.row], vc: self) cell.fillCell(wifiOrders[indexPath.row], vc: self)
//cell.selectionStyle = .None
return cell return cell
} }
......
...@@ -73,17 +73,15 @@ class GetCodeViewController: KeyboardedViewController { ...@@ -73,17 +73,15 @@ class GetCodeViewController: KeyboardedViewController {
AbonentForRegister.sharedInstance().inIin = iinField.text! AbonentForRegister.sharedInstance().inIin = iinField.text!
AbonentForRegister.sharedInstance().inPhone = phoneField.text! AbonentForRegister.sharedInstance().inPhone = phoneField.text!
print(AbonentForRegister.sharedInstance().inServerId) let params: [String : String] = [
print(AbonentForRegister.sharedInstance().inAbonentId) "server_id" : AbonentForRegister.sharedInstance().inServerId,
print(AbonentForRegister.sharedInstance().inIin)
print(AbonentForRegister.sharedInstance().inEmail)
print(AbonentForRegister.sharedInstance().inPhone)
let params: [String : AnyObject] = ["server_id" : AbonentForRegister.sharedInstance().inServerId,
"abonent_id" : AbonentForRegister.sharedInstance().inAbonentId, "abonent_id" : AbonentForRegister.sharedInstance().inAbonentId,
"iin" : AbonentForRegister.sharedInstance().inIin, "iin" : AbonentForRegister.sharedInstance().inIin,
"email" : AbonentForRegister.sharedInstance().inEmail, "email" : AbonentForRegister.sharedInstance().inEmail,
"phone" : AbonentForRegister.sharedInstance().inPhone] "phone" : AbonentForRegister.sharedInstance().inPhone
]
print(params)
PKNotification.loading(true) PKNotification.loading(true)
......
...@@ -29,7 +29,7 @@ class MenuTableController: UIViewController, UITableViewDataSource, UITableViewD ...@@ -29,7 +29,7 @@ class MenuTableController: UIViewController, UITableViewDataSource, UITableViewD
"ic_vpn_key", "ic_vpn_key",
"ic_wifi", "ic_wifi",
"ic_help_black", "ic_help_black",
"ic_help_black", "ic_settings",
"ic_exit_to_app" "ic_exit_to_app"
] ]
......
...@@ -10,6 +10,7 @@ import Foundation ...@@ -10,6 +10,7 @@ import Foundation
import UIKit import UIKit
class PromoViewController: UIViewController, UIScrollViewDelegate { class PromoViewController: UIViewController, UIScrollViewDelegate {
@IBOutlet weak var scrollView: UIScrollView! @IBOutlet weak var scrollView: UIScrollView!
@IBOutlet weak var bottomScrollView: UIScrollView! @IBOutlet weak var bottomScrollView: UIScrollView!
@IBOutlet weak var imageView: UIImageView! @IBOutlet weak var imageView: UIImageView!
......
...@@ -26,8 +26,8 @@ class CallbackViewController: KeyboardedViewController, UIPickerViewDataSource, ...@@ -26,8 +26,8 @@ class CallbackViewController: KeyboardedViewController, UIPickerViewDataSource,
@IBOutlet weak var emailField: UITextField! @IBOutlet weak var emailField: UITextField!
@IBOutlet weak var regionField: UITextField! @IBOutlet weak var regionField: UITextField!
private var serverItems : [ServerItem] = [] private var serverItems : [CallbackRegion] = []
private var serverItem: ServerItem! private var serverItem: CallbackRegion!
private var serverNames: [String] = [] private var serverNames: [String] = []
private var gradePicker: UIPickerView! private var gradePicker: UIPickerView!
...@@ -54,7 +54,30 @@ class CallbackViewController: KeyboardedViewController, UIPickerViewDataSource, ...@@ -54,7 +54,30 @@ class CallbackViewController: KeyboardedViewController, UIPickerViewDataSource,
phoneField.tag = 101 phoneField.tag = 101
Facade.sharedInstance().getListServerId({ (serverItems) in // Facade.sharedInstance().getListServerId({ (serverItems) in
//
// self.serverItems = serverItems
// self.serverItem = serverItems[0]
// self.serverNames = self.serverItems.map({$0.name ?? ""})
// self.regionField.inputView = self.gradePicker
// self.regionField.text = self.serverNames[0]
//
// let serverID : Int = Facade.serverId!
//
// for serverModel in self.serverItems {
// if Int(serverModel.id!)! == serverID {
// self.serverItem = serverModel
// self.regionField.text = serverModel.name
// }
// }
//
// }, onError: { (error) in
// print(error)
// }) {
//
// }
Facade.sharedInstance().getOfferRegions({ (serverItems) in
self.serverItems = serverItems self.serverItems = serverItems
self.serverItem = serverItems[0] self.serverItem = serverItems[0]
...@@ -62,6 +85,17 @@ class CallbackViewController: KeyboardedViewController, UIPickerViewDataSource, ...@@ -62,6 +85,17 @@ class CallbackViewController: KeyboardedViewController, UIPickerViewDataSource,
self.regionField.inputView = self.gradePicker self.regionField.inputView = self.gradePicker
self.regionField.text = self.serverNames[0] self.regionField.text = self.serverNames[0]
let serverID : Int = Facade.serverId!
print("serverID = \(serverID)")
for serverModel in self.serverItems {
if Int(serverModel.guid_server_id!)! == serverID {
self.serverItem = serverModel
self.regionField.text = serverModel.name
}
}
}, onError: { (error) in }, onError: { (error) in
print(error) print(error)
}) { }) {
......
...@@ -38,17 +38,18 @@ class ServiceItemScrollViewController: UIViewController, UITableViewDataSource, ...@@ -38,17 +38,18 @@ class ServiceItemScrollViewController: UIViewController, UITableViewDataSource,
@IBOutlet weak var webViewWrapperView: UIView! @IBOutlet weak var webViewWrapperView: UIView!
var heightForRow: [Int: CGFloat] = [Int: CGFloat]() var heightForRow: [Int: CGFloat] = [Int: CGFloat]()
@IBAction func callBackConnect(sender: AnyObject) {
@IBAction func connectButton(sender: AnyObject) {
let vc = self.storyboard!.instantiateViewControllerWithIdentifier("CallbackViewController") as! CallbackViewController let vc = self.storyboard!.instantiateViewControllerWithIdentifier("CallbackViewController") as! CallbackViewController
vc.service_id = serviceItem?.id vc.service_id = serviceItem?.id
vc.type = 0 vc.type = 1 // заказ услуги
self.navigationController?.pushViewController(vc, animated: true) self.navigationController?.pushViewController(vc, animated: true)
} }
@IBAction func btnConnect(sender: AnyObject) { @IBAction func callBackButton(sender: AnyObject) {
let vc = self.storyboard!.instantiateViewControllerWithIdentifier("CallbackViewController") as! CallbackViewController let vc = self.storyboard!.instantiateViewControllerWithIdentifier("CallbackViewController") as! CallbackViewController
vc.service_id = serviceItem?.id vc.service_id = serviceItem?.id
vc.type = 1 vc.type = 0 // обратный звонок
self.navigationController?.pushViewController(vc, animated: true) self.navigationController?.pushViewController(vc, animated: true)
} }
......
...@@ -46,7 +46,8 @@ class SettingsViewController : ViewControllerWithMenu, UITableViewDataSource, UI ...@@ -46,7 +46,8 @@ class SettingsViewController : ViewControllerWithMenu, UITableViewDataSource, UI
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
switch section { switch section {
case 0: case 0:
return 3 // return 3
return 0
case 1: case 1:
return cities.count return cities.count
default: default:
......
...@@ -31,8 +31,12 @@ class PublicWifiOrderCell: UITableViewCell { ...@@ -31,8 +31,12 @@ class PublicWifiOrderCell: UITableViewCell {
"client_id": Facade.clientId!, "client_id": Facade.clientId!,
"server_id": Facade.serverId!, "server_id": Facade.serverId!,
"abonent_id": Facade.accountId!, "abonent_id": Facade.accountId!,
"device": self.vc!.device!.device! "device": self.vc!.device!.device!,
"link_id" : self.vc!.device!.linkId!
] as [String: AnyObject] ] as [String: AnyObject]
print("params = \(params)")
self.parentViewController!.processRequest(true) self.parentViewController!.processRequest(true)
switch self.wifiBaseOrder!.wifiOrderType! { switch self.wifiBaseOrder!.wifiOrderType! {
case .offer: case .offer:
...@@ -46,7 +50,6 @@ class PublicWifiOrderCell: UITableViewCell { ...@@ -46,7 +50,6 @@ class PublicWifiOrderCell: UITableViewCell {
}) })
break break
case .order: case .order:
params["link_id"] = (self.wifiBaseOrder as! WifiOfferOrder).id!
Facade.sharedInstance().disconnectWifi(params, onSuccess: { Facade.sharedInstance().disconnectWifi(params, onSuccess: {
self.vc!.requestPublicWifi() self.vc!.requestPublicWifi()
}, onError: { (error) in }, onError: { (error) in
......
...@@ -23,6 +23,15 @@ class FeedPackagesCell: UITableViewCell, UICollectionViewDataSource, UICollectio ...@@ -23,6 +23,15 @@ class FeedPackagesCell: UITableViewCell, UICollectionViewDataSource, UICollectio
requestDynamicMenu() requestDynamicMenu()
} }
@IBAction func packagesPressed(sender: AnyObject) {
let centerViewController = navController!.storyboard!.instantiateViewControllerWithIdentifier("ServiceMainViewController")
let vc = self.navController?.parentViewController
let rootVc = vc?.parentViewController
if let pvc = rootVc as? RootVC {
pvc.presentCenterViewController(centerViewController, animated: true)
}
}
func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return feed.count return feed.count
} }
...@@ -54,4 +63,3 @@ class FeedPackagesCell: UITableViewCell, UICollectionViewDataSource, UICollectio ...@@ -54,4 +63,3 @@ class FeedPackagesCell: UITableViewCell, UICollectionViewDataSource, UICollectio
} }
} }
} }
...@@ -13,13 +13,26 @@ class FeedPaymentCell: UITableViewCell { ...@@ -13,13 +13,26 @@ class FeedPaymentCell: UITableViewCell {
@IBOutlet weak var lastPay: UILabel! @IBOutlet weak var lastPay: UILabel!
@IBOutlet weak var balance: UILabel! @IBOutlet weak var balance: UILabel!
@IBOutlet weak var payButton: BlueButton! @IBOutlet weak var payButton: BlueButton!
@IBOutlet weak var refreshButton: UIImageView!
var navController : UINavigationController? var navController : UINavigationController?
override func awakeFromNib() { override func awakeFromNib() {
super.awakeFromNib() super.awakeFromNib()
NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(FeedPaymentCell.updateLabels), name: AbonentInfoManager.NotificationNames.Update, object: AbonentInfoManager.sharedInstance) NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(FeedPaymentCell.updateLabels), name: AbonentInfoManager.NotificationNames.Update, object: AbonentInfoManager.sharedInstance)
NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(FeedPaymentCell.showError(_:)), name: AbonentInfoManager.NotificationNames.Error, object: AbonentInfoManager.sharedInstance) NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(FeedPaymentCell.showError(_:)), name: AbonentInfoManager.NotificationNames.Error, object: AbonentInfoManager.sharedInstance)
let tapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(FeedPaymentCell.imageTapped(_:)))
refreshButton.userInteractionEnabled = true
refreshButton.addGestureRecognizer(tapGestureRecognizer)
}
func imageTapped(tapGestureRecognizer: UITapGestureRecognizer) {
SpinneredAlert.show(self.navController!)
AbonentInfoManager.sharedInstance.updateUserInfo()
} }
func updateLabels() { func updateLabels() {
......
...@@ -17,7 +17,7 @@ class CircleButton: UIView { ...@@ -17,7 +17,7 @@ class CircleButton: UIView {
} }
func updateCornerRadius() { func updateCornerRadius() {
layer.cornerRadius = 60 layer.cornerRadius = 50
layer.masksToBounds = true layer.masksToBounds = true
} }
......
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