Commit e92882a0 by Olzhas Aldabergenov

bug fixes

parent 67e7b8ba
......@@ -95,7 +95,6 @@
3E6969B31FA2097200032D95 /* ServiceDetailsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E6969B21FA2097200032D95 /* ServiceDetailsViewController.swift */; };
3E7A5B371FD95F4C0040F7A6 /* UITextField+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E7A5B361FD95F4C0040F7A6 /* UITextField+Extensions.swift */; };
3E8D31161FB1AA3500A650D2 /* VIPCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E8D31151FB1AA3500A650D2 /* VIPCell.swift */; };
3EA73F081FAAE6620009731F /* ServiceCalculatorViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EA73F071FAAE6620009731F /* ServiceCalculatorViewController.swift */; };
3EA7F6BA1F00D1A1003F6CBF /* MainViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EA7F6B91F00D1A1003F6CBF /* MainViewController.swift */; };
3EA7F6C51F021C9D003F6CBF /* FeedViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EA7F6C41F021C9D003F6CBF /* FeedViewController.swift */; };
3EA7F6C71F0227E1003F6CBF /* FeedItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EA7F6C61F0227E1003F6CBF /* FeedItem.swift */; };
......@@ -652,7 +651,6 @@
3E6969B21FA2097200032D95 /* ServiceDetailsViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ServiceDetailsViewController.swift; sourceTree = "<group>"; };
3E7A5B361FD95F4C0040F7A6 /* UITextField+Extensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UITextField+Extensions.swift"; sourceTree = "<group>"; };
3E8D31151FB1AA3500A650D2 /* VIPCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VIPCell.swift; sourceTree = "<group>"; };
3EA73F071FAAE6620009731F /* ServiceCalculatorViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ServiceCalculatorViewController.swift; sourceTree = "<group>"; };
3EA7F6B91F00D1A1003F6CBF /* MainViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MainViewController.swift; sourceTree = "<group>"; };
3EA7F6C41F021C9D003F6CBF /* FeedViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FeedViewController.swift; sourceTree = "<group>"; };
3EA7F6C61F0227E1003F6CBF /* FeedItem.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FeedItem.swift; sourceTree = "<group>"; };
......@@ -1265,7 +1263,6 @@
3EA7F6EB1F04FDCB003F6CBF /* ServiceMainCell.swift */,
3EAFC48F1F7916A500BB07AD /* CallbackViewController.swift */,
3E6969B21FA2097200032D95 /* ServiceDetailsViewController.swift */,
3EA73F071FAAE6620009731F /* ServiceCalculatorViewController.swift */,
3EC107C41FB019A600EB2188 /* ServiceVIPTableViewController.swift */,
);
path = Service;
......@@ -2697,7 +2694,6 @@
9843762A1DC4AAEA00FBF2B3 /* UIView+Util.swift in Sources */,
984A73881CEC76D0005C26F6 /* UITableViewCell+PresentingViewController.swift in Sources */,
3EB108581F15F428000EAE88 /* BotViewController.swift in Sources */,
3EA73F081FAAE6620009731F /* ServiceCalculatorViewController.swift in Sources */,
3EA7F6F01F074BF9003F6CBF /* AccountServices.swift in Sources */,
3EAFC4771F6A926A00BB07AD /* MainKnowedgeViewController.swift in Sources */,
987457B01CFDDA3800BB32C6 /* OfferFormTitleCell.swift in Sources */,
......
......@@ -25,22 +25,6 @@
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "kt/ViewControllers/Cabinet/AccountServicesViewController.swift"
timestampString = "528871513.42196"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "190"
endingLineNumber = "190"
landmarkName = "megalineInfoAction(sender:event:)"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "kt/ViewControllers/Service/CallbackViewController.swift"
timestampString = "528032989.334432"
startingColumnNumber = "9223372036854775807"
......@@ -138,14 +122,46 @@
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "kt/ViewControllers/Service/ServiceVIPTableViewController.swift"
timestampString = "534249690.799642"
timestampString = "534767021.314772"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "305"
endingLineNumber = "305"
startingLineNumber = "314"
endingLineNumber = "314"
landmarkName = "updateTotal()"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "kt/ViewControllers/Cabinet/cashAndPayments/PaymentsHistoryViewController.swift"
timestampString = "534837511.617012"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "147"
endingLineNumber = "147"
landmarkName = "numberOfSections(in:)"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "kt/ViewControllers/Cabinet/cashAndPayments/PaymentsHistoryViewController.swift"
timestampString = "534837511.617012"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "142"
endingLineNumber = "142"
landmarkName = "tableView(_:numberOfRowsInSection:)"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>
......@@ -17,11 +17,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0.2</string>
<string>1.0.3</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>80</string>
<string>81</string>
<key>Fabric</key>
<dict>
<key>APIKey</key>
......
......@@ -58,6 +58,27 @@ class AccountServicesViewController: ViewControllerWithMenu {
extension AccountServicesViewController {
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
switch indexPath.section {
case Sections.Phones:
break
case Sections.Altel:
self.altel4GActionAction(indexPath.row)
break
case Sections.Megaline:
self.megalineInfoActionAction(indexPath.row)
break
case Sections.idTvOnline:
//self.altel4GActionAction(indexPath.row)
break
default:
break
}
defer { tableView.deselectRowAtIndexPath(indexPath, animated: true)}
}
......@@ -175,9 +196,11 @@ extension AccountServicesViewController {
}
func megalineInfoAction(sender: UIButton, event: AnyObject) {
let index = sender.tag
megalineInfoActionAction(index)
}
private func megalineInfoActionAction(index: Int) {
let actionSheet = UIAlertController(title: nil, message: nil, preferredStyle: .ActionSheet)
actionSheet.popoverPresentationController?.permittedArrowDirections = UIPopoverArrowDirection.init(rawValue: 0)
......@@ -237,6 +260,10 @@ extension AccountServicesViewController {
let index = sender.tag
}
private func IDTVOnlineActionAction(index: Int) {
let actionSheet = UIAlertController(title: nil, message: nil, preferredStyle: .ActionSheet)
actionSheet.popoverPresentationController?.permittedArrowDirections = UIPopoverArrowDirection.init(rawValue: 0)
......@@ -258,9 +285,11 @@ extension AccountServicesViewController {
}
func altel4gAction(sender: UIButton, event: AnyObject) {
let index = sender.tag
self.altel4GActionAction(index)
}
private func altel4GActionAction(index: Int) {
let actionSheet = UIAlertController(title: nil, message: nil, preferredStyle: .ActionSheet)
actionSheet.popoverPresentationController?.permittedArrowDirections = UIPopoverArrowDirection.init(rawValue: 0)
......
......@@ -217,7 +217,7 @@ class LoginViewController: ScrolledViewController, UIViewControllerTransitioning
isPhoneMode = true
}
func forgetPasswordSend(params: [String: AnyObject]) {
func forgetPasswordSend(params: [String: AnyObject], alert: CustomAlertViewController) {
Facade.sharedInstance().forgetPassword(params, onError: { error -> Void in
AlertViewUtil.showErrorAlert(message: error)
PKNotification.loading(false)
......@@ -225,6 +225,7 @@ class LoginViewController: ScrolledViewController, UIViewControllerTransitioning
let message = String(format: LS("login.recovery.successfully_sent"), email)
AlertViewUtil.showIncorrectAlert(message)
PKNotification.loading(false)
alert.close()
})
}
......@@ -293,9 +294,8 @@ class LoginViewController: ScrolledViewController, UIViewControllerTransitioning
"type": recoverType,
"data": self.getDataFromTextField(textField)
] as [String: AnyObject]
self.forgetPasswordSend(params)
self.forgetPasswordSend(params, alert: customAlertVC)
}
alertVC.close()
NSTimer.scheduledTimerWithTimeInterval(3.0, target: self, selector: Selector("hideShowedAlert"), userInfo: nil, repeats: false)
}
})
......@@ -606,7 +606,7 @@ class LoginViewController: ScrolledViewController, UIViewControllerTransitioning
"data": data
] as [String: AnyObject]
print("params \(params)")
self.forgetPasswordSend(params)
self.forgetPasswordSend(params, alert: customAlertVC)
}
})
})
......@@ -653,8 +653,8 @@ class LoginViewController: ScrolledViewController, UIViewControllerTransitioning
phoneHint.hidden = false
self.view.endEditing(true)
_loginTextField.text = "+7 727 817-7224"//"7172682610" // ntcnjdsq 7278177224
_passwordTextField.text = "123456789"//"NewPassword1"
_loginTextField.text = "+7 "//"+7 727 817-7224"//"7172682610" // ntcnjdsq 7278177224
_passwordTextField.text = ""//"123456789"//"NewPassword1"
}
func loginSwitchLoginSelected() {
......
......@@ -116,6 +116,7 @@ class StepViewController : ScrolledViewController, UIAlertViewDelegate, UIPicker
PKNotification.loading(true)
Facade.sharedInstance().callbackSend(params, onSuccess: { (msg) in
AlertViewUtil.showAlert(msg)
customAlertVC.close()
}, onError: { (error) in
AlertViewUtil.showAlert(error)
}, onFinish: {
......
......@@ -102,6 +102,8 @@ class PaymentsHistoryViewController: UIViewController, UITableViewDataSource, UI
return tableView.dequeueReusableCellWithIdentifier("pdfCell", forIndexPath: indexPath)
}
}
// UITableViewDataSource
......@@ -122,7 +124,42 @@ extension PaymentsHistoryViewController {
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
var i = getNumberOfRows()
return i == 0 ? 0 : i + 1
if (i != 0) {
i = i+1
tableView.separatorStyle = .SingleLine
tableView.backgroundView = nil
}
else {
let noDataLabel: UILabel = UILabel(frame: CGRect(x: 0, y: 0, width: tableView.bounds.size.width, height: tableView.bounds.size.height))
noDataLabel.text = LS("no_data")
noDataLabel.textColor = UIColor.blackColor()
noDataLabel.textAlignment = NSTextAlignment.Center
tableView.backgroundView = noDataLabel
tableView.separatorStyle = UITableViewCellSeparatorStyle.None
}
return i///i == 0 ? 0 : i + 1
}
func numberOfSections(in tableView: UITableView) -> Int {
var numOfSections: Int = 0
if getNumberOfRows() != 0
{
tableView.separatorStyle = .SingleLine
numOfSections = 1
tableView.backgroundView = nil
}
else
{
let noDataLabel: UILabel = UILabel(frame: CGRect(x: 0, y: 0, width: tableView.bounds.size.width, height: tableView.bounds.size.height))
noDataLabel.text = LS("no_data")
noDataLabel.textColor = UIColor.blackColor()
noDataLabel.textAlignment = NSTextAlignment.Center
tableView.backgroundView = noDataLabel
tableView.separatorStyle = UITableViewCellSeparatorStyle.None
}
return numOfSections
}
}
......
......@@ -8,7 +8,7 @@
import Foundation
class UICreateFastPayViewController : UIViewController, UITableViewDelegate, UITableViewDataSource,
class UICreateFastPayViewController : KeyboardedViewController, UITableViewDelegate, UITableViewDataSource,
UIPickerViewDelegate, UIPickerViewDataSource {
//MARK: - IBOutlets
......@@ -40,7 +40,9 @@ class UICreateFastPayViewController : UIViewController, UITableViewDelegate, UIT
override func viewDidLoad() {
super.viewDidLoad()
createCells()
self.regionPicker.delegate = self
self.regionPicker.dataSource = self
......@@ -69,8 +71,10 @@ class UICreateFastPayViewController : UIViewController, UITableViewDelegate, UIT
loadAccountView()
}
}
}
@IBAction func onItemSelected(sender: UISegmentedControl) {
tableView.reloadData()
if ( toggle.selectedSegmentIndex == 0 ) {
......@@ -352,8 +356,6 @@ class UICreateFastPayViewController : UIViewController, UITableViewDelegate, UIT
}
}
func getGuidWithoutDash(input: String ) -> String {
var guid = input
if let range = guid.rangeOfString("-") {
......@@ -397,6 +399,7 @@ extension UICreateFastPayViewController {
return cellsAccount.count
}
}
}
//MARK: UITableViewDelegate
......
//
// ServiceCalculatorViewController.swift
// kt
//
// Created by neox on 02.11.17.
// Copyright © 2017 SimpleCode. All rights reserved.
//
import Foundation
import UIKit
class ServiceCalculatorViewController: UIViewController, UITableViewDelegate, UITableViewDataSource {
var serviceItem : ServiceItem?
@IBOutlet weak var scrollView: UIScrollView!
@IBOutlet weak var serviceImage: UIImageView!
@IBOutlet weak var servicePriceView: UILabel!
@IBOutlet weak var serviceNameView: UILabel!
@IBOutlet weak var labelWhatIsNew: UILabel!
@IBOutlet weak var labelSafeInternet: UILabel!
@IBOutlet weak var labelFastInternet: UILabel!
@IBOutlet weak var labelKaspersky: UILabel!
@IBOutlet weak var labelParentControl: UILabel!
@IBOutlet weak var labelPremiumTV: UILabel!
@IBOutlet weak var labelPremiumTV1: UILabel!
@IBOutlet weak var labelPremiumTV2: UILabel!
@IBOutlet weak var labelPremiumTV3: UILabel!
@IBOutlet weak var labelPremiumTV4: UILabel!
@IBOutlet weak var labelServiceOptions: UILabel!
@IBOutlet weak var tableViewServiceOption: UITableView!
var tableData = ["Almaty", "Aqtau", "Astana", "Atyrau"]
override func loadView() {
super.loadView()
self.title = serviceItem?.name
self.scrollView.hidden = true
requestService()
}
override func viewDidLoad() {
super.viewDidLoad()
self.tableViewServiceOption.dataSource = self
self.tableViewServiceOption.delegate = self
}
func load() {
self.scrollView.hidden = false
ImageLoader.sharedLoader.imageForUrl((self.serviceItem?.image.absoluteString)!) { (image, url) in
if ( image != nil ) {
self.serviceImage.image = image?.imageWithRenderingMode(.AlwaysOriginal)
} else {
self.serviceImage.backgroundColor = UIColor.lightGrayColor()
}
}
//
self.serviceNameView.text = self.serviceItem?.seoTitle?.uppercaseString
self.servicePriceView.text = (self.serviceItem?.rates[0].price)!// + " " + LS("service_price_per_month_unit")
self.labelWhatIsNew.text = LS("service_what_is_in_package")
self.labelSafeInternet.text = LS("service_safe_internet").uppercaseString
self.labelFastInternet.text = LS("service_fast_internet")
self.labelKaspersky.text = LS("service_kaspersky")
self.labelParentControl.text = LS("service_parent_control")
self.labelPremiumTV.text = LS("service_premium_tv")
self.labelPremiumTV1.text = LS("service_premium_tv_1")
self.labelPremiumTV2.text = LS("service_premium_tv_2")
self.labelPremiumTV3.text = LS("service_premium_tv_3")
self.labelPremiumTV4.text = LS("service_premium_tv_4")
self.labelServiceOptions.text = ""
}
func requestService() {
let params: [String: AnyObject] = ["service_id": (serviceItem?.id)!, "type": "landing" ]
Facade.sharedInstance().getLanding(params, onSuccess: { (serviceItem) in
self.serviceItem = serviceItem
self.load()
}, onError: { (error) in
print(error)
}, onFinish: {
})
}
@IBAction func buttonAddClicked(sender: UIButtonRoundedBlue) {
}
@IBAction func buttonCallbackClicked(sender: UIButtonRoundedGray) {
}
}
extension ServiceCalculatorViewController {
func numberOfSectionsInTableView(tableView: UITableView) -> Int {
return 1//servicesList.count
}
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return self.tableData.count
}
// func tableView(tableView: UITableView, didDeselectRowAtIndexPath indexPath: NSIndexPath) {
// if let cell = tableView.cellForRowAtIndexPath(indexPath) {
// cell.accessoryType = .None
// }
// }
// func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
// if let cell = tableView.cellForRowAtIndexPath(indexPath) {
// cell.accessoryType = .Checkmark
//
// }
// }
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("cellServiceOption", forIndexPath: indexPath) as UITableViewCell
let text = tableData[indexPath.row]
cell.textLabel?.text = text
return cell
}
}
......@@ -40,7 +40,8 @@ class ServiceVIPTableViewController : UIViewController, UITableViewDataSource, U
var serviceTotal = ""
var optionRussianPhone = false
var optionTVPackageNastroiKino = false
//var optionTVPackageNastroiKino = false
var optionTVPackageIndex = 0
@IBAction func connectButton(sender: UIButtonRoundedBlue) {
let vc = self.storyboard!.instantiateViewControllerWithIdentifier("CallbackViewController") as! CallbackViewController
......@@ -273,7 +274,7 @@ extension ServiceVIPTableViewController {
totalPrice = 0
serviceTotal = ""
for index in 0...numberOfRows()-1 {
if ( index == 5 && selection[index] && optionTVPackageNastroiKino && selection[1] ) {
if ( index == 5 && selection[index] && optionTVPackageIndex == 2 && selection[1] ) {
// skip
print("nastroi kino - true")
}
......@@ -281,6 +282,14 @@ extension ServiceVIPTableViewController {
// skip
print("russian phone - true")
}
else if ( index == 8 && selection[index] && selection[1] && optionTVPackageIndex == 1 ) {
// skip
print("hd base")
}
else if ( index == 9 && selection[index] && selection[1] && optionTVPackageIndex == 0 ) {
// skip
print("id tv online")
}
else if ( selection[4] && 5 <= index && index <= 9 && (selection[5] || selection[6] || selection[7] || selection[8] || selection[9] )) {
// if vip max is selected, then skip additionals
print("vip max - true")
......@@ -352,11 +361,16 @@ extension ServiceVIPTableViewController {
updateTotal()
}
func setBoolOptionTVPackageNastroiKino(bool: Bool) {
optionTVPackageNastroiKino = bool
func setOptionTVPackage(index: Int) {
optionTVPackageIndex = index
updateTotal()
}
// func setBoolOptionTVPackageNastroiKino(bool: Bool) {
// optionTVPackageNastroiKino = bool
// updateTotal()
// }
func decrementAmount(index: Int) {
amounts[index] = amounts[index] - 1
}
......
......@@ -92,6 +92,7 @@ extension WiFiTableViewController: UITableViewDataSource {
}
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
print(indexPath.row)
let cell = tableView.dequeueReusableCellWithIdentifier(cellIdentifier, forIndexPath: indexPath) as UITableViewCell
cell.textLabel?.text = wifiPoints?[indexPath.row].title
// cell.titleLabel.text = wifiPoints?[indexPath.row].title
......
......@@ -52,11 +52,14 @@ class VIPTVCell : UITableViewCell {
func radioButtonClick(sender: DLRadioButton) {
if ( sender == optionButton1 ) {
vc.setBoolOptionTVPackageNastroiKino(false)
vc.setOptionTVPackage(0)
// vc.setBoolOptionTVPackageNastroiKino(false)
} else if ( sender == optionButton2 ) {
vc.setBoolOptionTVPackageNastroiKino(false)
vc.setOptionTVPackage(1)
// vc.setBoolOptionTVPackageNastroiKino(false)
} else if ( sender == optionButton3 ) {
vc.setBoolOptionTVPackageNastroiKino(true)
vc.setOptionTVPackage(2)
// vc.setBoolOptionTVPackageNastroiKino(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