Commit aac95166 by Anand.suthar

working on issue

parent 0aca0747
......@@ -9,76 +9,46 @@
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Bhagyashree/Sunarc/Controller/Me/CorporateCultureViewController.swift"
timestampString = "553786741.450217"
filePath = "Bhagyashree/Sunarc/Model/UpdateOrder.swift"
timestampString = "556626783.326553"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "54"
endingLineNumber = "54"
landmarkName = "updateOrder(to:orderId:success:failuer:)"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Bhagyashree/Sunarc/Model/Appointment/AppointmentExt.swift"
timestampString = "556626783.326643"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "25"
endingLineNumber = "25"
landmarkName = "getAppointmentDetails(incrementId:success:failure:)"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Bhagyashree/Sunarc/Controller/Appointment/ServiceDetailViewController.swift"
timestampString = "556629972.389267"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "22"
endingLineNumber = "22"
landmarkName = "unknown"
landmarkType = "0">
<Locations>
<Location
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "Bhagyashree.CorporateCultureViewController.slideshow.getter : Swift.ImplicitlyUnwrappedOptional&lt;ImageSlideshow.ImageSlideshow&gt;"
moduleName = "Bhagyashree"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/sunarcmac/Documents/Futurecommerce/Fengshui-Seller-iOS/Bhagyashree/Sunarc/Controller/Me/CorporateCultureViewController.swift"
timestampString = "556459275.434637"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "22"
endingLineNumber = "22"
offsetFromSymbolStart = "104">
</Location>
<Location
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "Bhagyashree.CorporateCultureViewController.slideshow.setter : Swift.ImplicitlyUnwrappedOptional&lt;ImageSlideshow.ImageSlideshow&gt;"
moduleName = "Bhagyashree"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/sunarcmac/Documents/Futurecommerce/Fengshui-Seller-iOS/Bhagyashree/Sunarc/Controller/Me/CorporateCultureViewController.swift"
timestampString = "556459275.438275"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "22"
endingLineNumber = "22"
offsetFromSymbolStart = "120">
</Location>
<Location
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "Bhagyashree.CorporateCultureViewController.init(nibName: Swift.Optional&lt;Swift.String&gt;, bundle: Swift.Optional&lt;__ObjC.Bundle&gt;) -&gt; Bhagyashree.CorporateCultureViewController"
moduleName = "Bhagyashree"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/sunarcmac/Documents/Futurecommerce/Fengshui-Seller-iOS/Bhagyashree/Sunarc/Controller/Me/CorporateCultureViewController.swift"
timestampString = "556459275.44317"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "22"
endingLineNumber = "22"
offsetFromSymbolStart = "424">
</Location>
<Location
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "Bhagyashree.CorporateCultureViewController.init(coder: __ObjC.NSCoder) -&gt; Swift.Optional&lt;Bhagyashree.CorporateCultureViewController&gt;"
moduleName = "Bhagyashree"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/sunarcmac/Documents/Futurecommerce/Fengshui-Seller-iOS/Bhagyashree/Sunarc/Controller/Me/CorporateCultureViewController.swift"
timestampString = "556459275.448035"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "22"
endingLineNumber = "22"
offsetFromSymbolStart = "380">
</Location>
</Locations>
startingLineNumber = "45"
endingLineNumber = "45"
landmarkName = "viewWillAppear(_:)"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
......@@ -87,13 +57,13 @@
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Bhagyashree/Sunarc/Controller/Appointment/ServicesListViewController.swift"
timestampString = "556442966.305923"
filePath = "Bhagyashree/Sunarc/Controller/Appointment/ServiceDetailViewController.swift"
timestampString = "556629972.390362"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "110"
endingLineNumber = "110"
landmarkName = "tableView(_:didSelectRowAt:)"
startingLineNumber = "42"
endingLineNumber = "42"
landmarkName = "viewWillAppear(_:)"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
......@@ -104,11 +74,11 @@
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Bhagyashree/Sunarc/Model/UpdateOrder.swift"
timestampString = "556463024.5798759"
timestampString = "556626783.326924"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "40"
endingLineNumber = "40"
startingLineNumber = "47"
endingLineNumber = "47"
landmarkName = "updateOrder(to:orderId:success:failuer:)"
landmarkType = "7">
</BreakpointContent>
......@@ -119,14 +89,30 @@
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Bhagyashree/Sunarc/Controller/Home/HomePageViewController.swift"
timestampString = "556463024.5799609"
filePath = "Bhagyashree/Sunarc/Model/UpdateOrder.swift"
timestampString = "556626783.326986"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "146"
endingLineNumber = "146"
landmarkName = "unknown"
landmarkType = "0">
startingLineNumber = "31"
endingLineNumber = "31"
landmarkName = "updateOrder(to:orderId:success:failuer:)"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Bhagyashree/Sunarc/Model/Appointment/AppointmentExt.swift"
timestampString = "556629862.15785"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "49"
endingLineNumber = "49"
landmarkName = "detailOfComlpeted(orderId:success:failure:)"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
......
{
"images" : [
{
"idiom" : "universal",
"filename" : "radioOff.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "radioOn.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
......@@ -13,8 +13,6 @@ import SwiftMessages
let defaults = UserDefaults.standard;
typealias ServiceResponse = (NSDictionary?, NSError?) -> Void
var queue = OperationQueue()
......
......@@ -99,11 +99,44 @@ extension CompletedServicesViewController: UITableViewDelegate, UITableViewDataS
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
tableView.deselectRow(at: indexPath, animated: true)
let serviceDetail = Utils.viewController(storyboardName: "Appointment", ofType: ServiceDetailViewController.self)
serviceDetail.serviceStatus = .completed
serviceDetail.incrementId = service.services[indexPath.row].incrementId
serviceDetail.orderId = service.services[indexPath.row].orderId
self.navigationController?.pushViewController(serviceDetail, animated: true)
let selectedService = service.services[indexPath.row]
if selectedService.serviceType == .BOOKING {
let appointmentdetails = Utils.viewController(storyboardName: "Appointment", ofType: ServiceDetailViewController.self)
appointmentdetails.serviceStatus = .tbc
appointmentdetails.incrementId = selectedService.incrementId
appointmentdetails.orderId = selectedService.orderId
self.navigationController?.pushViewController(appointmentdetails, animated: true)
} else if selectedService.serviceType == .FAQ {
if selectedService.status == .PROCESSING {
let chatViewController = Utils.viewController(storyboardName: "Home", ofType: OnlineEnquiryViewController.self)
if let orderId = selectedService.orderId {
chatViewController.orderId = orderId
self.navigationController?.pushViewController(chatViewController, animated: true)
}
} else {
let enquiryDetailsViewController = Utils.viewController(storyboardName: "Home", ofType: EnquiryDetailsViewController.self)
enquiryDetailsViewController.incrementId = selectedService.incrementId!
enquiryDetailsViewController.orderId = selectedService.orderId!
self.navigationController?.pushViewController(enquiryDetailsViewController, animated: true)
}
} else if selectedService.serviceType == .FORM{
if let form = Form.VC(with: selectedService.incrementId!, categoryType: selectedService.categoryType){
self.navigationController?.pushViewController(form, animated: true)
}
} else {
self.view.showToast("Unknown service", position: .bottom, popTime: 2.0, dismissOnTap: false)
}
// let serviceDetail = Utils.viewController(storyboardName: "Appointment", ofType: ServiceDetailViewController.self)
// serviceDetail.serviceStatus = .completed
// serviceDetail.incrementId = service.services[indexPath.row].incrementId
// serviceDetail.orderId = service.services[indexPath.row].orderId
// self.navigationController?.pushViewController(serviceDetail, animated: true)
}
......
......@@ -130,7 +130,7 @@ extension EditResultViewController: UITableViewDelegate, UITableViewDataSource {
case 3:
return 1
case 4:
return 1
return 0
case 5:
return audioRecordings.count
default:
......
......@@ -99,11 +99,45 @@ extension OnGoingServicesViewController: UITableViewDelegate, UITableViewDataSou
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
tableView.deselectRow(at: indexPath, animated: true)
let serviceDetail = Utils.viewController(storyboardName: "Appointment", ofType: ServiceDetailViewController.self)
serviceDetail.serviceStatus = .ongoing
serviceDetail.incrementId = service.services[indexPath.row].incrementId
serviceDetail.orderId = service.services[indexPath.row].orderId
self.navigationController?.pushViewController(serviceDetail, animated: true)
let selectedService = service.services[indexPath.row]
if selectedService.serviceType == .BOOKING {
let appointmentdetails = Utils.viewController(storyboardName: "Appointment", ofType: ServiceDetailViewController.self)
appointmentdetails.serviceStatus = .tbc
appointmentdetails.incrementId = selectedService.incrementId
appointmentdetails.orderId = selectedService.orderId
self.navigationController?.pushViewController(appointmentdetails, animated: true)
} else if selectedService.serviceType == .FAQ {
if selectedService.status == .PROCESSING {
let chatViewController = Utils.viewController(storyboardName: "Home", ofType: OnlineEnquiryViewController.self)
if let orderId = selectedService.orderId {
chatViewController.orderId = orderId
self.navigationController?.pushViewController(chatViewController, animated: true)
}
} else {
let enquiryDetailsViewController = Utils.viewController(storyboardName: "Home", ofType: EnquiryDetailsViewController.self)
enquiryDetailsViewController.incrementId = selectedService.incrementId!
enquiryDetailsViewController.orderId = selectedService.orderId!
self.navigationController?.pushViewController(enquiryDetailsViewController, animated: true)
}
} else if selectedService.serviceType == .FORM{
if let form = Form.VC(with: selectedService.incrementId!, categoryType: selectedService.categoryType){
self.navigationController?.pushViewController(form, animated: true)
}
} else {
self.view.showToast("Unknown service", position: .bottom, popTime: 2.0, dismissOnTap: false)
}
// let serviceDetail = Utils.viewController(storyboardName: "Appointment", ofType: ServiceDetailViewController.self)
// serviceDetail.serviceStatus = .ongoing
// serviceDetail.incrementId = service.services[indexPath.row].incrementId
// serviceDetail.orderId = service.services[indexPath.row].orderId
// self.navigationController?.pushViewController(serviceDetail, animated: true)
}
......
......@@ -13,6 +13,7 @@ enum ServiceStatus: Int {
case tbc
case ongoing
case completed
case uploadResult
}
class ServiceDetailViewController: UIViewController {
......@@ -28,44 +29,59 @@ class ServiceDetailViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
if let incrementId = incrementId {
appointment.getAppointmentDetails(incrementId: incrementId, success: {
print(self.appointment.orderStatus)
if self.appointment.orderStatus == "Service Upload Result" {
self.serviceStatus = .uploadResult
}
self.tblServiceDetail.reloadData()
if let orderId = self.orderId {
self.appointment.detailOfComlpeted(orderId: orderId, success: {
self.tblServiceDetail.reloadData()
}, failure: { (errorMessage) in
self.view.showToast(errorMessage, position: .bottom, popTime: 2.0, dismissOnTap: false)
if errorMessage.count > 0 {
self.view.showToast(errorMessage, position: .bottom, popTime: 2.0, dismissOnTap: false)
}
})
}
switch self.serviceStatus {
case .tbc:
self.btnStartMeeting.isHidden = false
self.btnEditResult.isHidden = true
case .ongoing:
self.btnStartMeeting.isHidden = true
self.btnEditResult.isHidden = false
case .completed: break
// do nothing
case .uploadResult:
self.btnStartMeeting.isHidden = true
self.btnEditResult.isHidden = false
}
}) { (errorMessage) in
self.view.showToast(errorMessage, position: .bottom, popTime: 2.0, dismissOnTap: false)
}
}
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
switch serviceStatus {
case .tbc:
btnStartMeeting.isHidden = false
case .ongoing:
btnEditResult.isHidden = false
case .completed: break
// do nothing
}
}
}
......@@ -76,11 +92,20 @@ extension ServiceDetailViewController {
}
@IBAction func startMeeting() {
let videoCallViewController = Utils.viewController(storyboardName: "Appointment", ofType: VideoCallingViewController.self)
if let orderId = orderId {
videoCallViewController.orderId = orderId
UpdateOrder.toOngoing(orderId: orderId!, success: {
let videoCallViewController = Utils.viewController(storyboardName: "Appointment", ofType: VideoCallingViewController.self)
if let orderId = self.orderId {
videoCallViewController.orderId = orderId
}
videoCallViewController.appointmentInfo = self.appointment
self.navigationController?.pushViewController(videoCallViewController, animated: true)
}) { (errorMessage) in
self.navigationController?.popToRootViewController(animated: true)
self.view.showToast(errorMessage, position: .bottom, popTime: 2.0, dismissOnTap: false)
}
self.navigationController?.pushViewController(videoCallViewController, animated: true)
}
@IBAction func editresult() {
......
......@@ -104,12 +104,47 @@ extension ServicesListViewController: UITableViewDelegate, UITableViewDataSource
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
tableView.deselectRow(at: indexPath, animated: true)
let servicedetailViewController = Utils.viewController(storyboardName: "Appointment", ofType: ServiceDetailViewController.self)
servicedetailViewController.serviceStatus = .ongoing
servicedetailViewController.incrementId = service.services[indexPath.row].incrementId
print(service.services[indexPath.row].orderId)
servicedetailViewController.orderId = service.services[indexPath.row].orderId
self.navigationController?.pushViewController(servicedetailViewController, animated: true)
let selectedService = service.services[indexPath.row]
if selectedService.serviceType == .BOOKING {
let appointmentdetails = Utils.viewController(storyboardName: "Appointment", ofType: ServiceDetailViewController.self)
appointmentdetails.serviceStatus = .tbc
appointmentdetails.incrementId = selectedService.incrementId
appointmentdetails.orderId = selectedService.orderId
self.navigationController?.pushViewController(appointmentdetails, animated: true)
} else if selectedService.serviceType == .FAQ {
if selectedService.status == .PROCESSING {
let chatViewController = Utils.viewController(storyboardName: "Home", ofType: OnlineEnquiryViewController.self)
if let orderId = selectedService.orderId {
chatViewController.orderId = orderId
self.navigationController?.pushViewController(chatViewController, animated: true)
}
} else {
let enquiryDetailsViewController = Utils.viewController(storyboardName: "Home", ofType: EnquiryDetailsViewController.self)
enquiryDetailsViewController.incrementId = selectedService.incrementId!
enquiryDetailsViewController.orderId = selectedService.orderId!
self.navigationController?.pushViewController(enquiryDetailsViewController, animated: true)
}
} else if selectedService.serviceType == .FORM{
if let form = Form.VC(with: selectedService.incrementId!, categoryType: selectedService.categoryType){
self.navigationController?.pushViewController(form, animated: true)
}
} else {
self.view.showToast("Unknown service", position: .bottom, popTime: 2.0, dismissOnTap: false)
}
// let servicedetailViewController = Utils.viewController(storyboardName: "Appointment", ofType: ServiceDetailViewController.self)
// servicedetailViewController.serviceStatus = .ongoing
// servicedetailViewController.incrementId = service.services[indexPath.row].incrementId
// servicedetailViewController.orderId = service.services[indexPath.row].orderId
// self.navigationController?.pushViewController(servicedetailViewController, animated: true)
}
}
......
......@@ -8,6 +8,7 @@
import UIKit
import AgoraRtcEngineKit
import Kingfisher
class VideoCallingViewController: UIViewController {
......@@ -20,6 +21,7 @@ class VideoCallingViewController: UIViewController {
var agoraKit: AgoraRtcEngineKit!
var orderId: String = "0"
var appointmentInfo: Appointment?
override func viewDidLoad() {
super.viewDidLoad()
......@@ -33,6 +35,15 @@ class VideoCallingViewController: UIViewController {
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
self.view.sendSubview(toBack: remoteVideo)
if let appointmentInfo = appointmentInfo {
lblCustomerName.text = appointmentInfo.customerName
if let profileImage = appointmentInfo.customerProfileImage {
let url = URL(string: profileImage)
imgAvtar.kf.setImage(with: url, placeholder: UIImage(named: "profile_icon"), options: [.transition(ImageTransition.fade(1)), .scaleFactor(1.0)], progressBlock: nil, completionHandler: nil)
}
}
}
}
......@@ -53,8 +64,9 @@ extension VideoCallingViewController {
let alert = UIAlertController(title: nil, message: "Is the service finished?", preferredStyle: .alert)
let yesAction = UIAlertAction(title: "Yes", style: .default) { (_) in
self.leaveChannel()
UpdateOrder.toOngoing(orderId: self.orderId, success: {
self.navigationController?.popToRootViewController(animated: true)
UpdateOrder.toServiceUpdloadResult(orderId: self.orderId, success: {
self.navigationController?.popViewController(animated: true)
}) { (errorMessage) in
self.navigationController?.popToRootViewController(animated: true)
self.view.showToast(errorMessage, position: .bottom, popTime: 2.0, dismissOnTap: false)
......
//
// AuspiciousDateContainer.swift
// ShangMarket
//
// Created by SunarcMAC on 13/08/18.
// Copyright © 2018 Sunarc. All rights reserved.
//
import UIKit
class AuspiciousDateContainer: BaseViewController {
@IBOutlet var groundbreakingDateSelection: UIView!
@IBOutlet var companyMovingDateSelection: UIView!
@IBOutlet var marriageDateSelection: UIView!
@IBOutlet var registrationDateSelection: UIView!
@IBOutlet var businessOpeningDateSelection: UIView!
@IBOutlet var bedSettingDateSelection: UIView!
@IBOutlet var houseMovingDateSelection: UIView!
@IBOutlet var godSettingDateSelection: UIView!
// var seller: Seller?
var service: String?
var categoryType: CategoryType = .Groundbreaking
var incrementId: String = ""
override func viewDidLoad() {
super.viewDidLoad()
}
@IBAction func back() {
self.navigationController?.popViewController(animated: true)
}
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
switch categoryType {
case .Groundbreaking:
groundbreakingDateSelection.isHidden = false
if segue.identifier == "GroundbreakingDateSelectionViewController" {
(segue.destination as! GroundbreakingDateSelectionViewController).incrementId = incrementId
// (segue.destination as! GroundbreakingDateSelectionViewController).service = service
}
case .MovingCompany:
companyMovingDateSelection.isHidden = false
if segue.identifier == "CompanyMovingDateSelectionViewController" {
(segue.destination as! CompanyMovingDateSelectionViewController).incrementId = incrementId
// (segue.destination as! CompanyMovingDateSelectionViewController).service = service
}
case .Marriage:
marriageDateSelection.isHidden = false
if segue.identifier == "MarriageDateSelectionViewController" {
(segue.destination as! MarriageDateSelectionViewController).incrementId = incrementId
// (segue.destination as! MarriageDateSelectionViewController).service = service
}
case .Registration:
registrationDateSelection.isHidden = false
if segue.identifier == "RegsirationDateSelectionViewController" {
(segue.destination as! RegsirationDateSelectionViewController).incrementId = incrementId
// (segue.destination as! RegsirationDateSelectionViewController).service = service
}
case .StartOpeningBusiness:
businessOpeningDateSelection.isHidden = false
if segue.identifier == "BusinessOpeningDateSelectionViewController" {
(segue.destination as! BusinessOpeningDateSelectionViewController).incrementId = incrementId
// (segue.destination as! BusinessOpeningDateSelectionViewController).service = service
}
case .BedSetting:
bedSettingDateSelection.isHidden = false
if segue.identifier == "BedSettingDateSelectionViewController" {
(segue.destination as! BedSettingDateSelectionViewController).incrementId = incrementId
// (segue.destination as! BedSettingDateSelectionViewController).service = service
}
case .MovingHouse:
houseMovingDateSelection.isHidden = false
if segue.identifier == "HouseMovingDateSelectionViewController" {
(segue.destination as! HouseMovingDateSelectionViewController).incrementId = incrementId
// (segue.destination as! HouseMovingDateSelectionViewController).service = service
}
case .GODSetting:
godSettingDateSelection.isHidden = false
if segue.identifier == "GodSettingDateSelectionViewController" {
(segue.destination as! GodSettingDateSelectionViewController).incrementId = incrementId
// (segue.destination as! GodSettingDateSelectionViewController).service = service
}
default:
print("Form not found")
}
}
}
//
// BedSettingDateSelectionViewController.swift
// ShangMarket
//
// Created by SunarcMAC on 14/08/18.
// Copyright © 2018 Sunarc. All rights reserved.
//
import UIKit
class BedSettingDateSelectionViewController: BaseViewController {
@IBOutlet var scroller: UIScrollView!
@IBOutlet var txtOwnerName: UITextField!
@IBOutlet var txtMembers: UITextView!
@IBOutlet var btnExpectedMonth: UIButton!
@IBOutlet var imgWeekDay: UIImageView!
@IBOutlet var imgWeekend: UIImageView!
@IBOutlet var txtRemarks: UITextView!
// var seller: Seller?
var service: String?
// var customOption = ServiceCustomOption()
var isWeekDay = false
var incrementId: String?
override func viewDidLoad() {
super.viewDidLoad()
guard let incrementId_ = incrementId else {
return
}
FormDetail.get(incrementId: incrementId_, success: { (customOptions) in
for option in customOptions {
if option.option == "Owner Name" {
self.txtOwnerName.text = option.value
} else if option.option == "Members" {
self.txtMembers.text = option.value
} else if option.option == "Expected Month" {
self.btnExpectedMonth.setTitle(option.value, for: .normal)
} else if option.option == "Expected Day" {
if option.value.lowercased() == "weekday" {
self.imgWeekDay.image = UIImage(named: "radioOn")
} else {
self.imgWeekend.image = UIImage(named: "radioOn")
}
} else if option.option == "Remarks" {
self.txtRemarks.text = option.value
}
}
}) { (errorMessage) in
print(errorMessage)
}
}
@IBAction func submit() {
}
}
//
// BusinessOpeningDateSelectionViewController.swift
// ShangMarket
//
// Created by SunarcMAC on 14/08/18.
// Copyright © 2018 Sunarc. All rights reserved.
//
import UIKit
class BusinessOpeningDateSelectionViewController: BaseViewController {
@IBOutlet var scroller: UIScrollView!
@IBOutlet var txtOwnerName: UITextField!
@IBOutlet var txtOwnerDOB: UITextField!
@IBOutlet var txtShareholders: UITextView!
@IBOutlet var txtNewAddress: UITextView!
@IBOutlet var btnExpectedMonth: UIButton!
@IBOutlet var imgWeekDay: UIImageView!
@IBOutlet var imgWeekend: UIImageView!
@IBOutlet var txtRemarks: UITextView!
var service: String?
var incrementId: String?
override func viewDidLoad() {
super.viewDidLoad()
guard let incrementId_ = incrementId else {
return
}
FormDetail.get(incrementId: incrementId_, success: { (customOptions) in
for option in customOptions {
if option.option == "Owner Name" {
self.txtOwnerName.text = option.value
} else if option.option == "Owner DOB" {
self.txtOwnerDOB.text = option.value
} else if option.option == "Shareholders" {
self.txtShareholders.text = option.value
} else if option.option == "New Address" {
self.txtNewAddress.text = option.value
} else if option.option == "Expected Month" {
self.btnExpectedMonth.setTitle(option.value, for: .normal)
} else if option.option == "Remarks" {
self.txtRemarks.text = option.value
}
}
}) { (errorMessage) in
print(errorMessage)
}
}
@IBAction func submit() {
}
}
//
// CompanyMovingDateSelectionViewController.swift
// ShangMarket
//
// Created by SunarcMAC on 14/08/18.
// Copyright © 2018 Sunarc. All rights reserved.
//
import UIKit
class CompanyMovingDateSelectionViewController: BaseViewController {
@IBOutlet var scroller: UIScrollView!
@IBOutlet var imgWeekDay: UIImageView!
@IBOutlet var imgWeekend: UIImageView!
@IBOutlet var txtOwnerName: UITextField!
@IBOutlet var txtDate: UITextField!
@IBOutlet var txtShareholders: UITextView!
@IBOutlet var txtNewAddress: UITextView!
@IBOutlet var btnMonth: UIButton!
@IBOutlet var txtRemarks: UITextView!
var incrementId: String?
var isWeekday = false
override func viewDidLoad() {
super.viewDidLoad()
guard let incrementId_ = incrementId else {
return
}
FormDetail.get(incrementId: incrementId_, success: { (customOptions) in
for option in customOptions {
if option.option == "Owner Name" {
self.txtOwnerName.text = option.value
} else if option.option == "Owner DOB" {
self.txtDate.text = option.value
} else if option.option == "Shareholders" {
self.txtShareholders.text = option.value
} else if option.option == "Expected Day" {
if option.value.lowercased() == "weekday" {
self.imgWeekDay.image = UIImage(named: "radioOn")
} else {
self.imgWeekend.image = UIImage(named: "radioOn")
}
} else if option.option == "Expected Month" {
self.btnMonth.setTitle(option.value, for: .normal)
} else if option.option == "New Address" {
self.txtNewAddress.text = option.value
} else if option.option == "Remarks" {
self.txtRemarks.text = option.value
}
}
}) { (errorMessage) in
print(errorMessage)
}
}
@IBAction func submit() {
}
}
//
// GodSettingDateSelectionViewController.swift
// ShangMarket
//
// Created by SunarcMAC on 14/08/18.
// Copyright © 2018 Sunarc. All rights reserved.
//
import UIKit
class GodSettingDateSelectionViewController: BaseViewController {
@IBOutlet var scroller: UIScrollView!
@IBOutlet var txtOwnerName: UITextField!
@IBOutlet var txtOwnerDOB: UITextField!
@IBOutlet var btnExpectedMonth: UIButton!
@IBOutlet var imgWeekDay: UIImageView!
@IBOutlet var imgWeekend: UIImageView!
@IBOutlet var txtRemarks: UITextView!
// var seller: Seller?
var service: String?
// var customOption = ServiceCustomOption()
var isWeekday = false
var incrementId: String?
override func viewDidLoad() {
super.viewDidLoad()
guard let incrementId_ = incrementId else {
return
}
FormDetail.get(incrementId: incrementId_, success: { (customOptions) in
for option in customOptions {
if option.option == "Owner Name" {
self.txtOwnerName.text = option.value
} else if option.option == "Owner B.O.D" {
self.txtOwnerDOB.text = option.value
} else if option.option == "Expected Month" {
self.btnExpectedMonth.setTitle(option.value, for: .normal)
} else if option.option == "Expected Day" {
if option.value.lowercased() == "weekday" {
self.imgWeekDay.image = UIImage(named: "radioOn")
} else {
self.imgWeekend.image = UIImage(named: "radioOn")
}
} else if option.option == "Remarks" {
self.txtRemarks.text = option.value
}
}
}) { (errorMessage) in
print(errorMessage)
}
}
@IBAction func submit() {
}
}
//
// GroundbreakingDateSelectionViewController.swift
// ShangMarket
//
// Created by SunarcMAC on 14/08/18.
// Copyright © 2018 Sunarc. All rights reserved.
//
import UIKit
class GroundbreakingDateSelectionViewController: BaseViewController {
@IBOutlet var scroller: UIScrollView!
@IBOutlet var imgWeekDay: UIImageView!
@IBOutlet var imgWeekend: UIImageView!
@IBOutlet var txtOwner: UITextField!
@IBOutlet var txtDate: UITextField!
@IBOutlet var btnMonth: UIButton!
@IBOutlet var txtAddress: UITextView!
@IBOutlet var txtRemarks: UITextView!
var incrementId: String?
override func viewDidLoad() {
super.viewDidLoad()
guard let incrementId_ = incrementId else {
return
}
FormDetail.get(incrementId: incrementId_, success: { (customOptions) in
for option in customOptions {
if option.option == "Owner Name" {
self.txtOwner.text = option.value
} else if option.option == "Address" {
self.txtAddress.text = option.value
} else if option.option == "Expected Month" {
self.btnMonth.setTitle(option.value, for: .normal)
} else if option.option == "Expected Days" {
if option.value.lowercased() == "weekday" {
self.imgWeekDay.image = UIImage(named: "radioOn")
} else {
self.imgWeekend.image = UIImage(named: "radioOn")
}
} else if option.option == "Remarks" {
self.txtRemarks.text = option.value
}
}
}) { (errorMessage) in
print(errorMessage)
}
}
@IBAction func submit() {
}
}
//
// HouseMovingDateSelectionViewController.swift
// ShangMarket
//
// Created by SunarcMAC on 14/08/18.
// Copyright © 2018 Sunarc. All rights reserved.
//
import UIKit
class HouseMovingDateSelectionViewController: BaseViewController {
@IBOutlet var scroller: UIScrollView!
@IBOutlet var txtOwnerName: UITextField!
@IBOutlet var txtMembers: UITextView!
@IBOutlet var txtNewAddress: UITextView!
@IBOutlet var btnExpectedMonth: UIButton!
@IBOutlet var imgWeekDay: UIImageView!
@IBOutlet var imgWeekend: UIImageView!
@IBOutlet var txtRemarks: UITextView!
// var seller: Seller?
var service: String?
// var customOption = ServiceCustomOption()
var isWeekDay = false
var incrementId: String?
override func viewDidLoad() {
super.viewDidLoad()
guard let incrementId_ = incrementId else {
return
}
FormDetail.get(incrementId: incrementId_, success: { (customOptions) in
for option in customOptions {
// if option.option == "Owner Name" {
// self.txtOwnerName.text = option.value
// } else if option.option == "Members" {
// self.txtMembers.text = option.value
// } else if option.option == "Expected Month" {
// self.btnExpectedMonth.setTitle(option.value, for: .normal)
// } else if option.option == "Expected Day" {
//
// if option.value.lowercased() == "weekday" {
// self.imgWeekDay.image = UIImage(named: "radioOn")
// } else {
// self.imgWeekend.image = UIImage(named: "radioOn")
// }
//
// } else if option.option == "Remarks" {
// self.txtRemarks.text = option.value
// }
//
}
}) { (errorMessage) in
print(errorMessage)
}
}
}
extension HouseMovingDateSelectionViewController {
@IBAction func weekdayWeekend(btn: UIButton) {
if btn.tag == 1 {
isWeekDay = true
imgWeekDay.image = UIImage(named: "radioOn")
imgWeekend.image = UIImage(named: "radioOff")
} else {
isWeekDay = false
imgWeekDay.image = UIImage(named: "radioOff")
imgWeekend.image = UIImage(named: "radioOn")
}
}
@IBAction func monthPicker() {
// let monthPicker = Utils.viewController(storyboardName: "HomePage", ofType: MonthPickerViewController.self)
// monthPicker.delegate = self
// self.present(monthPicker, animated: true, completion: nil)
//
// UIView.animate(withDuration: 0.25) {
// self.scroller.contentOffset = CGPoint(x: self.scroller.contentOffset.x, y: 100)
// }
}
@IBAction func submit() {
// if formValidation() == false {
// return
// }
//
// var paramsJSON = ""
// var params = [String: Any]()
// for option in customOption.options {
//
// switch option.title {
// case "Service Type":
// params["\(option.id!)"] = "Auspicious Date Selection"
// case "Service Title":
// params["\(option.id!)"] = "Moving (House)"
// // case "Owner Name":
// // params["\(option.id!)"] = txtOwner.text
// // case "Address":
// // params["\(option.id!)"] = txtAddress.text
// // case "Expected Month":
// // params["\(option.id!)"] = btnMonth.titleLabel?.text
// // case "Expected Days":
// // params["\(option.id!)"] = isWeekday == true ? "weekday" : "weekend"
// // case "Remarks":
// // params["\(option.id!)"] = txtRemarks.text
// default:
// params["\(option.id!)"] = ""
// }
//
// }
//
// do {
// let jsonData = try JSONSerialization.data(withJSONObject: params, options: .prettyPrinted)
// paramsJSON = NSString(data: jsonData, encoding: String.Encoding.utf8.rawValue)! as String
// } catch {
// print(error.localizedDescription)
// }
//
// let keyValueDict: [String: Any] = ["productId": self.seller!.entityId ?? "",
// "websiteId": "1",
// "qty": "1",
// "customerId": User.customerId,
// "storeId": UserSettings.storeId ?? "0",
// "params": paramsJSON
// ]
//
//
// let serviceConfirmationVC = Utils.viewController(storyboardName: "HomePage", ofType: ServiceConfirmationViewController.self)
// serviceConfirmationVC.keyValueDict = keyValueDict
// serviceConfirmationVC.sellerName = seller?.sellerName
// serviceConfirmationVC.service = service
// serviceConfirmationVC.termsAndConditions = customOption.sellerTerms
// self.navigationController?.pushViewController(serviceConfirmationVC, animated: true)
}
func formValidation() -> Bool{
if txtOwnerName.text?.count == 0 {
self.view.showToast("Please fill owner name", position: .bottom, popTime: 2.0, dismissOnTap: false)
return false
}
if txtMembers.text?.count == 0 {
self.view.showToast("Please fill members", position: .bottom, popTime: 2.0, dismissOnTap: false)
return false
}
if txtNewAddress.text?.count == 0 {
self.view.showToast("Please new address", position: .bottom, popTime: 2.0, dismissOnTap: false)
return false
}
if btnExpectedMonth.titleLabel?.text == "Month" {
self.view.showToast("Please select a month", position: .bottom, popTime: 2.0, dismissOnTap: false)
return false
}
if imgWeekDay.image == UIImage(named: "radioOff") && imgWeekend.image == UIImage(named: "radioOff") {
self.view.showToast("Please select a day", position: .bottom, popTime: 2.0, dismissOnTap: false)
return false
}
return true
}
}
extension HouseMovingDateSelectionViewController: UITextFieldDelegate {
func textFieldShouldReturn(_ textField: UITextField) -> Bool {
if textField == txtOwnerName {
txtMembers.becomeFirstResponder()
}
return true
}
}
//
// RegsirationDateSelectionViewController.swift
// ShangMarket
//
// Created by SunarcMAC on 14/08/18.
// Copyright © 2018 Sunarc. All rights reserved.
//
import UIKit
class RegsirationDateSelectionViewController: BaseViewController {
@IBOutlet var scroller: UIScrollView!
@IBOutlet var txtHusbandName: UITextField!
@IBOutlet var txtHusbandDOB: UITextField!
@IBOutlet var txtWifeName: UITextField!
@IBOutlet var txtWifeDOB: UITextField!
@IBOutlet var txtAddress: UITextView!
@IBOutlet var btnExpectedMonth: UIButton!
@IBOutlet var imgWeekDay: UIImageView!
@IBOutlet var imgWeekend: UIImageView!
@IBOutlet var txtRemarks: UITextView!
var service: String?
var isWeekDay = false
var incrementId: String?
override func viewDidLoad() {
super.viewDidLoad()
guard let incrementId_ = incrementId else {
return
}
FormDetail.get(incrementId: incrementId_, success: { (customOptions) in
for option in customOptions {
if option.option == "Husband's Name" {
self.txtHusbandName.text = option.value
} else if option.option == "Husband's DOB" {
self.txtHusbandDOB.text = option.value
} else if option.option == "Wife's Name" {
self.txtWifeName.text = option.value
} else if option.option == "Wife's DOB" {
self.txtWifeDOB.text = option.value
} else if option.option == "Address" {
self.txtAddress.text = option.value
} else if option.option == "Expected Month" {
self.btnExpectedMonth.setTitle(option.value, for: .normal)
} else if option.option == "Expected Days" {
if option.value.lowercased() == "weekday" {
self.imgWeekDay.image = UIImage(named: "radioOn")
} else {
self.imgWeekend.image = UIImage(named: "radioOn")
}
} else if option.option == "Remarks" {
self.txtRemarks.text = option.value
}
}
}) { (errorMessage) in
print(errorMessage)
}
}
}
extension RegsirationDateSelectionViewController {
@IBAction func submit() {
}
}
//
// FengshuiServiceContainerViewController.swift
// ShangMarket
//
// Created by SunarcMAC on 09/08/18.
// Copyright © 2018 Sunarc. All rights reserved.
//
import UIKit
class FengshuiServiceContainerViewController: UIViewController {
@IBOutlet var floorPlanView: UIView!
@IBOutlet var onsitePlanView: UIView!
// var seller: Seller?
var service: String?
var categoryType: CategoryType = .FloorPlanFengShuiGeomancy
var incrementId: String = ""
var formFor: String = "Floor Plan Feng Shui - Geomancy"
override func viewDidLoad() {
super.viewDidLoad()
switch categoryType {
case .FloorPlanFengShuiGeomancy:
fallthrough
case .FloorPlanFengShuiCorporateFengShui:
floorPlanView.isHidden = false
case .OnsiteServiceGeomancy:
fallthrough
case .OnsiteServiceCorporateFengShui:
onsitePlanView.isHidden = false
default:
print("Form not found")
}
}
@IBAction func back() {
self.navigationController?.popViewController(animated: true)
}
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if segue.identifier == "OnsiteFengshuiViewController" {
(segue.destination as! OnsiteFengshuiViewController).categoryType = categoryType
(segue.destination as! OnsiteFengshuiViewController).incrementId = incrementId
} else if segue.identifier == "FloorPlanFengshuiViewController" {
(segue.destination as! FloorPlanFengshuiViewController).categoryType = categoryType
(segue.destination as! FloorPlanFengshuiViewController).incrementId = incrementId
}
}
}
//
// FloorPlanFengshuiViewController.swift
// ShangMarket
//
// Created by SunarcMAC on 09/08/18.
// Copyright © 2018 Sunarc. All rights reserved.
//
import UIKit
import Kingfisher
enum PhotoFor: String {
case home
case bedroom
}
class FloorPlanFengshuiViewController: UIViewController {
var isGeomencyService = false
var photoFor:PhotoFor = .home
var categoryType: CategoryType = .OnsiteServiceGeomancy
var incrementId: String?
@IBOutlet var txtFullAddress: UITextView!
@IBOutlet var txtFamilyMembers: UITextView!
@IBOutlet var txtRemarks: UITextView!
@IBOutlet var imgGeomancy: UIImageView!
@IBOutlet var imgCorporateFengShui: UIImageView!
@IBOutlet var imgHouseFrontImageView: UIImageView!
@IBOutlet var imgBedRoomImageView: UIImageView!
override func viewDidLoad() {
super.viewDidLoad()
guard let incrementId_ = incrementId else {
return
}
FormDetail.get(incrementId: incrementId_, success: { (customOptions) in
for option in customOptions {
if option.option == "Full Address" {
self.txtFullAddress.text = option.value
} else if option.option == "Family Members" {
self.txtFamilyMembers.text = option.value
} else if option.option == "Remarks" {
self.txtRemarks.text = option.value
} else if option.option == "House - front entrance picture" {
let url = URL(string: option.value)
self.imgHouseFrontImageView.kf.setImage(with: url, placeholder: UIImage(named: "placeholder"), options: [.transition(ImageTransition.fade(1)), .scaleFactor(1.0)], progressBlock: nil, completionHandler: nil)
} else if option.option == "House - Bedroom picture" {
let url = URL(string: option.value)
self.imgBedRoomImageView.kf.setImage(with: url, placeholder: UIImage(named: "placeholder"), options: [.transition(ImageTransition.fade(1)), .scaleFactor(1.0)], progressBlock: nil, completionHandler: nil)
}
}
}) { (errorMessage) in
print(errorMessage)
}
}
@IBAction func submit() {
}
}
//
// OnlineFengshuiViewController.swift
// ShangMarket
//
// Created by SunarcMAC on 09/08/18.
// Copyright © 2018 Sunarc. All rights reserved.
//
import UIKit
class OnsiteFengshuiViewController: UIViewController {
var isGeomencyService = false
@IBOutlet var txtFullAddress: UITextView!
@IBOutlet var txtContactName: UITextField!
@IBOutlet var txtContactNumber: UITextField!
@IBOutlet var txtRemarks: UITextView!
@IBOutlet var imgGeomancy: UIImageView!
@IBOutlet var imgCorporateFengShui: UIImageView!
var categoryType: CategoryType = .OnsiteServiceGeomancy
var incrementId: String?
override func viewDidLoad() {
super.viewDidLoad()
guard let incrementId_ = incrementId else {
return
}
FormDetail.get(incrementId: incrementId_, success: { (customOptions) in
for option in customOptions {
if option.option == "Full Address" {
self.txtFullAddress.text = option.value
} else if option.option == "Contact Name" {
self.txtContactName.text = option.value
} else if option.option == "Contact Number" {
self.txtContactNumber.text = option.value
} else if option.option == "Remarks" {
self.txtRemarks.text = option.value
}
}
}) { (errorMessage) in
print(errorMessage)
}
}
@IBAction func submit() {
}
}
//
// FormFor.swift
// Bhagyashree
//
// Created by SunarcMAC on 21/08/18.
// Copyright © 2018 Sunarc. All rights reserved.
//
import Foundation
class Form {
class func VC(with incrementId: String, categoryType: CategoryType) -> UIViewController? {
switch categoryType {
case .FloorPlanFengShuiGeomancy:
fallthrough
case .FloorPlanFengShuiCorporateFengShui:
fallthrough
case .OnsiteServiceGeomancy:
fallthrough
case .OnsiteServiceCorporateFengShui:
let vc = Utils.viewController(storyboardName: "Forms", ofType: FengshuiServiceContainerViewController.self)
vc.incrementId = incrementId
vc.categoryType = categoryType
return vc
case .IndividualNamingServiceNamed:
fallthrough
case .IndividualNamingServiceReNamedChangeName:
fallthrough
case .CompanyNamingServiceNamed:
fallthrough
case .CompanyNamingServiceReNamedChangeName:
let vc = Utils.viewController(storyboardName: "Forms", ofType: ScienceOfNamingContainerViewController.self)
vc.incrementId = incrementId
vc.categoryType = categoryType
return vc
case .OnsiteServiceGeomancy:
fallthrough
case .OnsiteServiceCorporateFengShui:
fallthrough
case .Groundbreaking:
fallthrough
case .Registration:
fallthrough
case .MovingHouse:
fallthrough
case .MovingCompany:
fallthrough
case .StartOpeningBusiness:
fallthrough
case .Marriage:
fallthrough
case .GODSetting:
fallthrough
case .BedSetting:
let vc = Utils.viewController(storyboardName: "Forms", ofType: AuspiciousDateContainer.self)
vc.incrementId = incrementId
vc.categoryType = categoryType
return vc
default:
return nil
}
}
}
//
// IndividualNamingServiceViewController.swift
// ShangMarket
//
// Created by SunarcMAC on 13/08/18.
// Copyright © 2018 Sunarc. All rights reserved.
//
import UIKit
class CompanyNamingServiceViewController: BaseViewController {
@IBOutlet var txtCompanyName: UITextField!
@IBOutlet var txtBusinessScope: UITextView!
@IBOutlet var txtCharectorsNeedsToBeUsed: UITextField!
@IBOutlet var txtCharectorsDoNotWantToUse: UITextField!
@IBOutlet var txtCompanyMembers: UITextView!
@IBOutlet var txtRemarks: UITextView!
@IBOutlet var imgMale: UIImageView!
@IBOutlet var imgFemale: UIImageView!
@IBOutlet var scroller: UIScrollView!
var zodiacPickerFor = 0
// var seller: Seller?
var service: String?
// var customOption = ServiceCustomOption()
var incrementId: String?
var isMale = false
override func viewDidLoad() {
super.viewDidLoad()
guard let incrementId_ = incrementId else {
return
}
FormDetail.get(incrementId: incrementId_, success: { (customOptions) in
for option in customOptions {
if option.option == "Company Name " {
self.txtCompanyName.text = option.value
} else if option.option == "Business Scope" {
self.txtBusinessScope.text = option.value
} else if option.option == "Characters (needs to be used)" {
self.txtCharectorsNeedsToBeUsed.text = option.value
} else if option.option == "Characters (do not want to be used)" {
self.txtCharectorsDoNotWantToUse.text = option.value
} else if option.option == "Owner Gender" {
if option.value.lowercased() == "male" {
self.imgMale.image = UIImage(named: "radioOn")
} else {
self.imgFemale.image = UIImage(named: "radioOn")
}
} else if option.option == "Company Members" {
self.txtCompanyMembers.text = option.value
} else if option.option == "Remarks" {
self.txtRemarks.text = option.value
}
}
}) { (errorMessage) in
print(errorMessage)
}
}
@IBAction func submit() {
}
}
//
// IndividualNamingServiceViewController.swift
// ShangMarket
//
// Created by SunarcMAC on 13/08/18.
// Copyright © 2018 Sunarc. All rights reserved.
//
import UIKit
class CompanyReNamingServiceViewController: BaseViewController {
@IBOutlet var txtCompanyName: UITextField!
@IBOutlet var txtBusinessScope: UITextView!
@IBOutlet var txtCharectorsNeedsToBeUsed: UITextField!
@IBOutlet var txtCharectorsDoNotWantToUse: UITextField!
@IBOutlet var txtCompanyMembers: UITextView!
@IBOutlet var txtRemarks: UITextView!
@IBOutlet var txtOrignalCompanyName: UITextField!
@IBOutlet var imgMale: UIImageView!
@IBOutlet var imgFemale: UIImageView!
@IBOutlet var scroller: UIScrollView!
var zodiacPickerFor = 0
var incrementId: String?
override func viewDidLoad() {
super.viewDidLoad()
guard let incrementId_ = incrementId else {
return
}
FormDetail.get(incrementId: incrementId_, success: { (customOptions) in
for option in customOptions {
if option.option == "Original Company Name" {
self.txtOrignalCompanyName.text = option.value
} else if option.option == "Company Name " {
self.txtCompanyName.text = option.value
} else if option.option == "Business Scope" {
self.txtBusinessScope.text = option.value
} else if option.option == "Characters (needs to be used)" {
self.txtCharectorsNeedsToBeUsed.text = option.value
} else if option.option == "Characters (do not want to be used)" {
self.txtCharectorsDoNotWantToUse.text = option.value
} else if option.option == "Owner Gender" {
if option.value.lowercased() == "male" {
self.imgMale.image = UIImage(named: "radioOn")
} else {
self.imgFemale.image = UIImage(named: "radioOff")
}
} else if option.option == "Company Members" {
self.txtCompanyMembers.text = option.value
} else if option.option == "Remarks" {
self.txtRemarks.text = option.value
}
}
}) { (errorMessage) in
print(errorMessage)
}
}
@IBAction func submit() {
}
}
//
// IndividualNamingServiceViewController.swift
// ShangMarket
//
// Created by SunarcMAC on 13/08/18.
// Copyright © 2018 Sunarc. All rights reserved.
//
import UIKit
class IndividualNamingServiceViewController: BaseViewController {
@IBOutlet var txtBOD: UITextField!
@IBOutlet var txtDialectgroup: UITextField!
@IBOutlet var txtFatherName: UITextField!
@IBOutlet var btnFatherZodiac: UIButton!
@IBOutlet var txtMotherName: UITextField!
@IBOutlet var btnMotherZodiac: UIButton!
@IBOutlet var txtCharectorsNeedsToBeUsed: UITextField!
@IBOutlet var txtCharectorsDoNotWantToUse: UITextField!
@IBOutlet var txtGenealogyWord: UITextField!
@IBOutlet var txtFullnameOfOtherFamilyMembers: UITextView!
@IBOutlet var txtRemarks: UITextView!
@IBOutlet var imgMale: UIImageView!
@IBOutlet var imgFemale: UIImageView!
@IBOutlet var scroller: UIScrollView!
var zodiacPickerFor = 0
var incrementId: String?
// var seller: Seller?
var service: String?
// var customOption = ServiceCustomOption()
var isMale = false
override func viewDidLoad() {
super.viewDidLoad()
guard let incrementId_ = incrementId else {
return
}
FormDetail.get(incrementId: incrementId_, success: { (customOptions) in
for option in customOptions {
if option.option == "B.O.D" {
self.txtBOD.text = option.value
} else if option.option == "Gender" {
if option.value.lowercased() == "male" {
self.imgMale.image = UIImage(named: "radioOn")
} else {
self.imgFemale.image = UIImage(named: "radioOn")
}
} else if option.option == "Dialect Group" {
self.txtDialectgroup.text = option.value
} else if option.option == "Father Name" {
self.txtFatherName.text = option.value
} else if option.option == "Father Zodiac" {
self.btnFatherZodiac.setTitle(option.value, for: .normal)
} else if option.option == "Mother Name" {
self.txtMotherName.text = option.value
} else if option.option == "Mother Zodiac" {
self.btnMotherZodiac.setTitle(option.value, for: .normal)
} else if option.option == "Character Needs To Be Used" {
self.txtCharectorsNeedsToBeUsed.text = option.value
} else if option.option == "Character Do Not Want To Use" {
self.txtCharectorsDoNotWantToUse.text = option.value
} else if option.option == "Genealogy Word" {
self.txtGenealogyWord.text = option.value
} else if option.option == "Full Name of Other Family Members" {
self.txtFullnameOfOtherFamilyMembers.text = option.value
} else if option.option == "Remarks" {
self.txtRemarks.text = option.value
}
}
}) { (errorMessage) in
print(errorMessage)
}
}
@IBAction func submit() {
}
}
//
// IndividualNamingServiceViewController.swift
// ShangMarket
//
// Created by SunarcMAC on 13/08/18.
// Copyright © 2018 Sunarc. All rights reserved.
//
import UIKit
class IndividualReNamingServiceViewController: BaseViewController {
@IBOutlet var txtOrignalName: UITextField!
@IBOutlet var txtBOD: UITextField!
@IBOutlet var txtDialectgroup: UITextField!
@IBOutlet var txtFatherName: UITextField!
@IBOutlet var btnFatherZodiac: UIButton!
@IBOutlet var txtMotherName: UITextField!
@IBOutlet var btnMotherZodiac: UIButton!
@IBOutlet var txtCharectorsNeedsToBeUsed: UITextField!
@IBOutlet var txtCharectorsDoNotWantToUse: UITextField!
@IBOutlet var txtGenealogyWord: UITextField!
@IBOutlet var txtFullnameOfOtherFamilyMembers: UITextView!
@IBOutlet var txtRemarks: UITextView!
@IBOutlet var imgMale: UIImageView!
@IBOutlet var imgFemale: UIImageView!
@IBOutlet var scroller: UIScrollView!
var zodiacPickerFor = 0
var incrementId: String?
override func viewDidLoad() {
super.viewDidLoad()
guard let incrementId_ = incrementId else {
return
}
FormDetail.get(incrementId: incrementId_, success: { (customOptions) in
for option in customOptions {
if option.option == "B.O.D" {
self.txtBOD.text = option.value
} else if option.option == "Gender" {
if option.value.lowercased() == "male" {
self.imgMale.image = UIImage(named: "radioOn")
} else {
self.imgFemale.image = UIImage(named: "radioOff")
}
} else if option.option == "Dialect Group" {
self.txtDialectgroup.text = option.value
} else if option.option == "Father Name" {
self.txtFatherName.text = option.value
} else if option.option == "Father Zodiac" {
self.btnFatherZodiac.setTitle(option.value, for: .normal)
} else if option.option == "Mother Name" {
self.txtMotherName.text = option.value
} else if option.option == "Mother Zodiac" {
self.btnMotherZodiac.setTitle(option.value, for: .normal)
} else if option.option == "Character Needs To Be Used" {
self.txtCharectorsNeedsToBeUsed.text = option.value
} else if option.option == "Character Do Not Want To Use" {
self.txtCharectorsDoNotWantToUse.text = option.value
} else if option.option == "Genealogy Word" {
self.txtGenealogyWord.text = option.value
} else if option.option == "Full Name of Other Family Members" {
self.txtFullnameOfOtherFamilyMembers.text = option.value
} else if option.option == "Remarks" {
self.txtRemarks.text = option.value
}
}
}) { (errorMessage) in
print(errorMessage)
}
}
@IBAction func submit() {
}
}
//
// ScienceOfNamingContainerViewController.swift
// ShangMarket
//
// Created by SunarcMAC on 13/08/18.
// Copyright © 2018 Sunarc. All rights reserved.
//
import UIKit
class ScienceOfNamingContainerViewController: BaseViewController {
@IBOutlet var individualNamingServiceView: UIView!
@IBOutlet var individualReNamingServiceView: UIView!
@IBOutlet var companyNamingServiceView: UIView!
@IBOutlet var companyReNamingServiceView: UIView!
// var seller: Seller?
var service: String?
var categoryType: CategoryType = .IndividualNamingServiceNamed
var incrementId: String = ""
override func viewDidLoad() {
super.viewDidLoad()
}
@IBAction func back() {
self.navigationController?.popViewController(animated: true)
}
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
switch categoryType {
case .IndividualNamingServiceNamed:
individualNamingServiceView.isHidden = false
if segue.identifier == "IndividualNamingServiceViewController" {
(segue.destination as! IndividualNamingServiceViewController).incrementId = incrementId
}
case .IndividualNamingServiceReNamedChangeName:
individualReNamingServiceView.isHidden = false
if segue.identifier == "IndividualReNamingServiceViewController" {
(segue.destination as! IndividualReNamingServiceViewController).incrementId = incrementId
}
case .CompanyNamingServiceNamed:
companyNamingServiceView.isHidden = false
if segue.identifier == "CompanyNamingServiceViewController" {
(segue.destination as! CompanyNamingServiceViewController).incrementId = incrementId
}
case .CompanyNamingServiceReNamedChangeName:
companyReNamingServiceView.isHidden = false
if segue.identifier == "CompanyReNamingServiceViewController" {
(segue.destination as! CompanyReNamingServiceViewController).incrementId = incrementId
}
default:
print("Form not found")
}
}
}
......@@ -39,6 +39,7 @@ extension EnquiryDetailsViewController {
@IBAction func chatHistory() {
let chatViewController = Utils.viewController(storyboardName: "Home", ofType: OnlineEnquiryViewController.self)
chatViewController.orderId = orderId
chatViewController.isOrderCompleted = true
self.navigationController?.pushViewController(chatViewController, animated: true)
}
......
......@@ -121,7 +121,6 @@ extension HomePageViewController: UITableViewDelegate, UITableViewDataSource {
let order = dashboard.orders[indexPath.row-1]
if order.products.first?.serviceType == .BOOKING {
let appointmentdetails = Utils.viewController(storyboardName: "Appointment", ofType: ServiceDetailViewController.self)
appointmentdetails.serviceStatus = .tbc
......@@ -143,8 +142,15 @@ extension HomePageViewController: UITableViewDelegate, UITableViewDataSource {
self.navigationController?.pushViewController(enquiryDetailsViewController, animated: true)
}
} else if order.products.first?.serviceType == .FORM{
if let form = Form.VC(with: order.incrementId!, categoryType: order.products.first!.categoryType) {
self.navigationController?.pushViewController(form, animated: true)
}
} else {
// TO DO forms
self.view.showToast("Unknown service", position: .bottom, popTime: 2.0, dismissOnTap: false)
}
}
......@@ -228,6 +234,7 @@ class RecentServicesCell: UITableViewCell {
@IBOutlet var lblCustomerName: UILabel!
@IBOutlet var lblDate: UILabel!
@IBOutlet var lblPrice: UILabel!
@IBOutlet var imgStatus: UIImageView!
var recentOrder: Order? {
didSet {
......@@ -236,6 +243,26 @@ class RecentServicesCell: UITableViewCell {
self.lblCustomerName.text = recentOrder.customerDetail.name
self.lblDate.text = recentOrder.customerDetail.date
self.lblPrice.text = recentOrder.customerDetail.purchaseTotal
switch recentOrder.status {
case .CANCELED:
self.imgStatus.image = nil
case .CLOSED:
self.imgStatus.image = UIImage(named: "status-done")
case .COMPLETE:
self.imgStatus.image = UIImage(named: "status-done")
case .PENDING:
self.imgStatus.image = UIImage(named: "status-tbc")
case .PROCESSING:
self.imgStatus.image = UIImage(named: "tbc")
case .SERVICE_COMPLETE:
self.imgStatus.image = UIImage(named: "status-done")
case .SERVICE_ONGOING:
self.imgStatus.image = UIImage(named: "status-inprogress")
case .SERVICE_UPLOAD_RESULT:
self.imgStatus.image = UIImage(named: "status-inprogress")
}
}
}
}
......
......@@ -93,8 +93,10 @@ extension OngoingEnquiryViewController: UITableViewDataSource, UITableViewDelega
let url = URL(string: profileImage)
ongoinCell.imgCustomer.kf.setImage(with: url, placeholder: UIImage(named: "placeholder"), options: [.transition(ImageTransition.fade(1)), .scaleFactor(1.0)], progressBlock: nil, completionHandler: nil)
}
if let orderId = ongoingEnquiry.orderId {
ongoinCell.orderId = orderId
}
ongoinCell.getFireBaseData()
return ongoinCell
......@@ -118,6 +120,7 @@ class OngoingEnquiryCell: UITableViewCell {
@IBOutlet var lblTime: UILabel!
@IBOutlet var lblBadge: UILabel!
var orderId: String = ""
override func layoutSubviews() {
lblBadge.layer.cornerRadius = lblBadge.frame.size.height/2
......@@ -130,7 +133,7 @@ class OngoingEnquiryCell: UITableViewCell {
func getFireBaseData() {
let ref = Database.database().reference().child("20") // replace 20 with orderid
let ref = Database.database().reference().child(orderId) // replace 20 with orderid
ref.queryOrdered(byChild: "timestamp") .observe(DataEventType.value, with: { (snapshot) in
if let chatsJSON = snapshot.value as? [String: AnyObject] {
......
......@@ -16,11 +16,14 @@ class OnlineEnquiryViewController: UIViewController {
@IBOutlet var lblPlaceHolder: UILabel!
@IBOutlet weak var commentViewHeight: NSLayoutConstraint!
@IBOutlet var btnSend: UIButton!
@IBOutlet var btnEndService: UIView!
@IBOutlet var chatInputView: UIView!
var ref = Database.database().reference()
var chats = [Chat]()
var orderId: String = "0"
var isOrderCompleted = false
override func viewDidLoad() {
super.viewDidLoad()
......@@ -44,6 +47,11 @@ class OnlineEnquiryViewController: UIViewController {
}
})
if isOrderCompleted == true {
chatInputView.isHidden = true
btnEndService.isHidden = true
}
}
func makeAllMSGAsRead() {
......
......@@ -99,10 +99,46 @@ extension MyAllServiceOrderViewController: UITableViewDelegate, UITableViewDataS
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let serviceDetail = Utils.viewController(storyboardName: "Appointment", ofType: ServiceDetailViewController.self)
serviceDetail.serviceStatus = .tbc
serviceDetail.orderId = service.services[indexPath.row].orderId
self.navigationController?.pushViewController(serviceDetail, animated: true)
let selectedService = service.services[indexPath.row]
if selectedService.serviceType == .BOOKING {
let appointmentdetails = Utils.viewController(storyboardName: "Appointment", ofType: ServiceDetailViewController.self)
appointmentdetails.serviceStatus = .tbc
appointmentdetails.incrementId = selectedService.incrementId
appointmentdetails.orderId = selectedService.orderId
self.navigationController?.pushViewController(appointmentdetails, animated: true)
} else if selectedService.serviceType == .FAQ {
if selectedService.status == .PROCESSING {
let chatViewController = Utils.viewController(storyboardName: "Home", ofType: OnlineEnquiryViewController.self)
if let orderId = selectedService.orderId {
chatViewController.orderId = orderId
self.navigationController?.pushViewController(chatViewController, animated: true)
}
} else {
let enquiryDetailsViewController = Utils.viewController(storyboardName: "Home", ofType: EnquiryDetailsViewController.self)
enquiryDetailsViewController.incrementId = selectedService.incrementId!
enquiryDetailsViewController.orderId = selectedService.orderId!
self.navigationController?.pushViewController(enquiryDetailsViewController, animated: true)
}
} else if selectedService.serviceType == .FORM{
if let form = Form.VC(with: selectedService.incrementId!, categoryType: selectedService.categoryType) {
self.navigationController?.pushViewController(form, animated: true)
}
} else {
self.view.showToast("Unknown service", position: .bottom, popTime: 2.0, dismissOnTap: false)
}
// let serviceDetail = Utils.viewController(storyboardName: "Appointment", ofType: ServiceDetailViewController.self)
// serviceDetail.serviceStatus = .tbc
// serviceDetail.orderId = service.services[indexPath.row].orderId
// self.navigationController?.pushViewController(serviceDetail, animated: true)
}
}
......
......@@ -98,10 +98,43 @@ extension MyCompletedOrdersViewController: UITableViewDelegate, UITableViewDataS
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let serviceDetail = Utils.viewController(storyboardName: "Appointment", ofType: ServiceDetailViewController.self)
serviceDetail.serviceStatus = .completed
serviceDetail.orderId = service.services[indexPath.row].orderId
self.navigationController?.pushViewController(serviceDetail, animated: true)
let selectedService = service.services[indexPath.row]
if selectedService.serviceType == .BOOKING {
let appointmentdetails = Utils.viewController(storyboardName: "Appointment", ofType: ServiceDetailViewController.self)
appointmentdetails.serviceStatus = .tbc
appointmentdetails.incrementId = selectedService.incrementId
appointmentdetails.orderId = selectedService.orderId
self.navigationController?.pushViewController(appointmentdetails, animated: true)
} else if selectedService.serviceType == .FAQ {
if selectedService.status == .PROCESSING {
let chatViewController = Utils.viewController(storyboardName: "Home", ofType: OnlineEnquiryViewController.self)
if let orderId = selectedService.orderId {
chatViewController.orderId = orderId
self.navigationController?.pushViewController(chatViewController, animated: true)
}
} else {
let enquiryDetailsViewController = Utils.viewController(storyboardName: "Home", ofType: EnquiryDetailsViewController.self)
enquiryDetailsViewController.incrementId = selectedService.incrementId!
enquiryDetailsViewController.orderId = selectedService.orderId!
self.navigationController?.pushViewController(enquiryDetailsViewController, animated: true)
}
} else if selectedService.serviceType == .FORM{
if let form = Form.VC(with: selectedService.incrementId!, categoryType: selectedService.categoryType) {
self.navigationController?.pushViewController(form, animated: true)
}
} else {
self.view.showToast("Unknown service", position: .bottom, popTime: 2.0, dismissOnTap: false)
}
// let serviceDetail = Utils.viewController(storyboardName: "Appointment", ofType: ServiceDetailViewController.self)
// serviceDetail.serviceStatus = .completed
// serviceDetail.orderId = service.services[indexPath.row].orderId
// self.navigationController?.pushViewController(serviceDetail, animated: true)
}
}
......
......@@ -98,10 +98,44 @@ extension MyOngoingServiceOrderViewController: UITableViewDelegate, UITableViewD
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let serviceDetail = Utils.viewController(storyboardName: "Appointment", ofType: ServiceDetailViewController.self)
serviceDetail.serviceStatus = .ongoing
serviceDetail.orderId = service.services[indexPath.row].orderId
self.navigationController?.pushViewController(serviceDetail, animated: true)
let selectedService = service.services[indexPath.row]
if selectedService.serviceType == .BOOKING {
let appointmentdetails = Utils.viewController(storyboardName: "Appointment", ofType: ServiceDetailViewController.self)
appointmentdetails.serviceStatus = .tbc
appointmentdetails.incrementId = selectedService.incrementId
appointmentdetails.orderId = selectedService.orderId
self.navigationController?.pushViewController(appointmentdetails, animated: true)
} else if selectedService.serviceType == .FAQ {
if selectedService.status == .PROCESSING {
let chatViewController = Utils.viewController(storyboardName: "Home", ofType: OnlineEnquiryViewController.self)
if let orderId = selectedService.orderId {
chatViewController.orderId = orderId
self.navigationController?.pushViewController(chatViewController, animated: true)
}
} else {
let enquiryDetailsViewController = Utils.viewController(storyboardName: "Home", ofType: EnquiryDetailsViewController.self)
enquiryDetailsViewController.incrementId = selectedService.incrementId!
enquiryDetailsViewController.orderId = selectedService.orderId!
self.navigationController?.pushViewController(enquiryDetailsViewController, animated: true)
}
} else if selectedService.serviceType == .FORM{
if let form = Form.VC(with: selectedService.incrementId!, categoryType: selectedService.categoryType){
self.navigationController?.pushViewController(form, animated: true)
}
} else {
self.view.showToast("Unknown service", position: .bottom, popTime: 2.0, dismissOnTap: false)
}
// let serviceDetail = Utils.viewController(storyboardName: "Appointment", ofType: ServiceDetailViewController.self)
// serviceDetail.serviceStatus = .ongoing
// serviceDetail.orderId = service.services[indexPath.row].orderId
// self.navigationController?.pushViewController(serviceDetail, animated: true)
}
}
......
......@@ -98,10 +98,43 @@ extension MyUploadResultViewController: UITableViewDelegate, UITableViewDataSour
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let serviceDetail = Utils.viewController(storyboardName: "Appointment", ofType: ServiceDetailViewController.self)
serviceDetail.serviceStatus = .ongoing
serviceDetail.orderId = service.services[indexPath.row].orderId
self.navigationController?.pushViewController(serviceDetail, animated: true)
let selectedService = service.services[indexPath.row]
if selectedService.serviceType == .BOOKING {
let appointmentdetails = Utils.viewController(storyboardName: "Appointment", ofType: ServiceDetailViewController.self)
appointmentdetails.serviceStatus = .tbc
appointmentdetails.incrementId = selectedService.incrementId
appointmentdetails.orderId = selectedService.orderId
self.navigationController?.pushViewController(appointmentdetails, animated: true)
} else if selectedService.serviceType == .FAQ {
if selectedService.status == .PROCESSING {
let chatViewController = Utils.viewController(storyboardName: "Home", ofType: OnlineEnquiryViewController.self)
if let orderId = selectedService.orderId {
chatViewController.orderId = orderId
self.navigationController?.pushViewController(chatViewController, animated: true)
}
} else {
let enquiryDetailsViewController = Utils.viewController(storyboardName: "Home", ofType: EnquiryDetailsViewController.self)
enquiryDetailsViewController.incrementId = selectedService.incrementId!
enquiryDetailsViewController.orderId = selectedService.orderId!
self.navigationController?.pushViewController(enquiryDetailsViewController, animated: true)
}
} else if selectedService.serviceType == .FORM{
if let form = Form.VC(with: selectedService.incrementId!, categoryType: selectedService.categoryType){
self.navigationController?.pushViewController(form, animated: true)
}
} else {
self.view.showToast("Unknown service", position: .bottom, popTime: 2.0, dismissOnTap: false)
}
// let serviceDetail = Utils.viewController(storyboardName: "Appointment", ofType: ServiceDetailViewController.self)
// serviceDetail.serviceStatus = .ongoing
// serviceDetail.orderId = service.services[indexPath.row].orderId
// self.navigationController?.pushViewController(serviceDetail, animated: true)
}
}
......
......@@ -23,7 +23,7 @@ class Appointment {
var reviewMessage: String?
var rating: String?
var reviewDateTime: String?
var orderStatus: String?
var masterReply: String?
var images = ""
......@@ -42,7 +42,9 @@ class Appointment {
if let orderTotal = response["orderTotal"] as? String {
self.orderTotal = UserSettings.currency! + " " + orderTotal
}
if let orderStatus = response["orderStatus"] as? String {
self.orderStatus = orderStatus
}
if let itemList = response["itemList"] as? [[String: Any]] {
if itemList.count > 0 {
......@@ -106,7 +108,9 @@ class Appointment {
for audio in audios {
self.audio = self.audio + "," + audio
}
self.audio.removeLast()
if self.audio.count > 0 {
self.audio.removeLast()
}
}
if let products = json["products"] as? [[String: Any]] {
for productJSON in products {
......
......@@ -22,6 +22,8 @@ extension Appointment {
HTTP().connectionWithRequestObjectFormUrl(api: API.VIEW_ORDER, parameters: parameters, method: .post, indicator: true, success: { (response) in
print(response)
if let validJSON = response as? [String: Any] {
self.initWithJSON(json: validJSON)
success()
......@@ -44,12 +46,15 @@ extension Appointment {
HTTP().connectionWithRequestObject(api: API.COMPLETED_SERVICE, parameters: parameters, method: .post, indicator: true, success: { (response) in
print(response)
if let validJSON = response as? [[String: Any]] {
if let data = validJSON[0]["data"] as? [String: Any] {
self.initWithJSONForCompleted(json: data)
success()
} else {
failure("Incorrect data format")
failure("")
}
} else {
failure("Incorrect data format")
......
......@@ -7,6 +7,8 @@
//
import Foundation
import SVProgressHUD
class EditResult {
......@@ -37,33 +39,101 @@ class EditResult {
]
HTTP().connectionWithRequestObject(api: API.UPDATE_RESULT, parameters: parameters, method: .post, indicator: true, success: { (response) in
SVProgressHUD.show()
let headers = [
"authkey": UserDefaults.standard.value(forKey: "authKey") as! String,
"content-type": "application/json"
]
let postData = try! JSONSerialization.data(withJSONObject: parameters, options: [])
print(HOST_NAME+API.UPDATE_RESULT)
let request = NSMutableURLRequest(url: NSURL(string: HOST_NAME+API.UPDATE_RESULT)! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if let validResponse = response as? [[String: Any]] {
if validResponse.count > 0 {
if let apiStatus = validResponse[0]["api_status"] as? [String: Any] {
if let status = apiStatus["status"] as? Bool {
if status == true {
success()
DispatchQueue.main.async {
SVProgressHUD.dismiss()
if (error != nil) {
failure(error!.localizedDescription)
} else {
do {
let response = try JSONSerialization.jsonObject(with: data!, options: .mutableContainers)
if let validResponse = response as? [[String: Any]] {
if validResponse.count > 0 {
if let apiStatus = validResponse[0]["api_status"] as? [String: Any] {
if let status = apiStatus["status"] as? Bool {
if status == true {
success()
} else {
failure("Try again")
}
} else {
failure("Try again")
}
} else {
failure("Try again")
}
} else {
failure("Try again")
}
} else {
failure("Try again")
failure("Incorrect data format")
}
} else {
failure("Try again")
} catch let myJSONError {
failure(myJSONError.localizedDescription)
}
} else {
failure("Try again")
}
} else {
failure("Incorrect data format")
}
}) { (errorMessage) in
failure(errorMessage)
}
})
dataTask.resume()
// HTTP().connectionWithRequestObject(api: API.UPDATE_RESULT, parameters: parameters, method: .post, indicator: true, success: { (response) in
//
// print(response)
//
// if let validResponse = response as? [[String: Any]] {
// if validResponse.count > 0 {
// if let apiStatus = validResponse[0]["api_status"] as? [String: Any] {
// if let status = apiStatus["status"] as? Bool {
// if status == true {
// success()
// } else {
// failure("Try again")
// }
// } else {
// failure("Try again")
// }
// } else {
// failure("Try again")
// }
// } else {
// failure("Try again")
// }
// } else {
// failure("Incorrect data format")
// }
//
// }) { (errorMessage) in
// failure(errorMessage)
// }
}
......
//
// FormDetail.swift
// Bhagyashree
//
// Created by SunarcMAC on 21/08/18.
// Copyright © 2018 Sunarc. All rights reserved.
//
import Foundation
class FormDetail {
class func get(incrementId: String, success: @escaping (_ customOptions: [CustomOption]) -> Void, failure: @escaping (_ errorMessage: String) -> Void) {
let parameters: [String: Any] = ["customerId": User.customerId,
"storeId": UserDefaults.standard.value(forKey: "storeId") as! String,
"incrementId": incrementId
]
HTTP().connectionWithRequestObjectFormUrl(api: API.VIEW_ORDER, parameters: parameters, method: .post, indicator: true, success: { (response) in
if let validJSON = response as? [String: Any] {
if let itemList = validJSON["itemList"] as? [[String: Any]] {
if itemList.count > 0 {
if let customOptionsJSON = itemList[0]["customOption"] as? [[String: Any]] {
var options = [CustomOption]()
for customOptionJSON in customOptionsJSON {
let option = CustomOption(json: customOptionJSON)
options.append(option)
}
success(options)
return
}
}
}
failure("")
} else {
failure("Incorrect data format")
}
}) { (errorMessage) in
failure(errorMessage)
}
}
}
class CustomOption {
var option: String
var value: String
init(json: [String: Any]) {
self.option = json["label"] as! String
self.value = json["value"] as! String
}
}
......@@ -12,31 +12,143 @@ enum ServiceType: String {
case FAQ
case BOOKING
case FORM
case UNKNOWN
case MORE
}
enum CategoryType: String {
case OnlineFAQ = "Online FAQ"
case FortuneOfTheYear = "Fortune of the Year"
case VideoFortuneTelling = "Video Fortune Telling"
case OnlineFaceReading = "Online Face Reading"
case IndividualNamingServiceNamed = "Individual Naming Service - Named"
case IndividualNamingServiceReNamedChangeName = "Individual Naming Service - Re-Named/Change Name"
case CompanyNamingServiceNamed = "Company Naming Service - Named"
case CompanyNamingServiceReNamedChangeName = "Company Naming Service - Re-Named/Change Name"
case FloorPlanFengShuiGeomancy = "Floor Plan Feng Shui - Geomancy"
case FloorPlanFengShuiCorporateFengShui = "Floor Plan Feng Shui - Corporate Feng Shui"
case OnsiteServiceGeomancy = "Onsite Service - Geomancy"
case OnsiteServiceCorporateFengShui = "Onsite Service - Corporate Feng Shui"
case Groundbreaking = "Groundbreaking"
case Registration = "Registration"
case MovingHouse = "Moving (House)"
case MovingCompany = "Moving (Company)"
case StartOpeningBusiness = "Start / Opening Business"
case Marriage = "Marriage"
case GODSetting = "GOD Setting"
case BedSetting = "Bed Setting"
case MoreServices = "More Services"
case Unknown = "Unknown"
}
class Product {
var productId: String?
var name: String?
var qty: Int = 0
var serviceType = ServiceType.BOOKING
var serviceType = ServiceType.UNKNOWN
var categoryType = CategoryType.Unknown
func initWithJSON(json: Any) {
if let response = json as? [String: Any] {
self.productId = response["productId"] as? String
if let productName = response["name"] as? String {
self.name = response["name"] as? String
self.qty = response["qty"] as! Int
if let categoryType_ = response["category_type"] as? String {
self.categoryType = CategoryType(rawValue: categoryType_)!
self.name = productName
if productName == "Online FAQ Service" {
switch self.categoryType {
case .OnlineFAQ:
self.serviceType = .FAQ
} else if productName == "dff" {
case .FortuneOfTheYear:
fallthrough
case .VideoFortuneTelling:
fallthrough
case .OnlineFaceReading:
self.serviceType = .BOOKING
} else {
case .IndividualNamingServiceNamed:
fallthrough
case .IndividualNamingServiceReNamedChangeName:
fallthrough
case .CompanyNamingServiceNamed:
fallthrough
case .CompanyNamingServiceReNamedChangeName:
fallthrough
case .FloorPlanFengShuiGeomancy:
fallthrough
case .FloorPlanFengShuiCorporateFengShui:
fallthrough
case .OnsiteServiceGeomancy:
fallthrough
case .OnsiteServiceCorporateFengShui:
fallthrough
case .Groundbreaking:
fallthrough
case .Registration:
fallthrough
case .MovingHouse:
fallthrough
case .MovingCompany:
fallthrough
case .StartOpeningBusiness:
fallthrough
case .Marriage:
fallthrough
case .GODSetting:
fallthrough
case .BedSetting:
self.serviceType = .FORM
case .MoreServices:
self.serviceType = .MORE
case .Unknown:
self.serviceType = .UNKNOWN
}
}
self.qty = response["qty"] as! Int
}
}
}
......@@ -35,6 +35,9 @@ class Service {
var baseTotal: String?
var purchaseTotal: String?
var serviceType = ServiceType.UNKNOWN
var categoryType = CategoryType.Unknown
var currentPage = 1
var maxPageNo = 0
......@@ -52,6 +55,61 @@ class Service {
if let productInfo = productsInfo.first {
self.productName = productInfo["name"] as? String
self.productId = productInfo["productId"] as? String
if let categoryType_ = productInfo["category_type"] as? String {
self.categoryType = CategoryType(rawValue: categoryType_)!
switch self.categoryType {
case .OnlineFAQ:
self.serviceType = .FAQ
case .FortuneOfTheYear:
fallthrough
case .VideoFortuneTelling:
fallthrough
case .OnlineFaceReading:
self.serviceType = .BOOKING
case .IndividualNamingServiceNamed:
fallthrough
case .IndividualNamingServiceReNamedChangeName:
fallthrough
case .CompanyNamingServiceNamed:
fallthrough
case .CompanyNamingServiceReNamedChangeName:
fallthrough
case .FloorPlanFengShuiGeomancy:
fallthrough
case .FloorPlanFengShuiCorporateFengShui:
fallthrough
case .OnsiteServiceGeomancy:
fallthrough
case .OnsiteServiceCorporateFengShui:
fallthrough
case .Groundbreaking:
fallthrough
case .Registration:
fallthrough
case .MovingHouse:
fallthrough
case .MovingCompany:
fallthrough
case .StartOpeningBusiness:
fallthrough
case .Marriage:
fallthrough
case .GODSetting:
fallthrough
case .BedSetting:
self.serviceType = .FORM
case .MoreServices:
self.serviceType = .MORE
case .Unknown:
self.serviceType = .UNKNOWN
}
}
}
}
self.bookingFrom = json["Booking From"] as? String
......
......@@ -51,6 +51,8 @@ class UpdateOrder {
do {
let json = try JSONSerialization.jsonObject(with: data!, options: .mutableContainers)
print(json)
if let jsonData = json as? [[String: Any]] {
if jsonData.count > 0 {
guard let status = jsonData[0]["api_status"] as? [String: Any] else {
......@@ -100,5 +102,17 @@ class UpdateOrder {
class func toOngoing(orderId: String, success: @escaping () -> Void, failuer: @escaping (_ message: String) -> Void) {
UpdateOrder.updateOrder(to: "service_ongoing", orderId: orderId, success: success, failuer: failuer)
}
class func toServiceUpdloadResult(orderId: String, success: @escaping () -> Void, failuer: @escaping (_ message: String) -> Void) {
UpdateOrder.updateOrder(to: "service_upload_result", orderId: orderId, success: success, failuer: failuer)
}
}
//
// DrawView.swift
// SubClassedUIView
//
// Created by SunarcMAC on 15/05/18.
// Copyright © 2018 SunarcMAC. All rights reserved.
//
import UIKit
@IBDesignable
class DrawTextField: UITextField {
override init(frame: CGRect) {
super.init(frame: frame)
}
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}
@IBInspectable
public var cornerRadius: CGFloat = 2.0 {
didSet {
self.layer.cornerRadius = self.cornerRadius
}
}
@IBInspectable
public var borderColor: UIColor = .black {
didSet {
self.layer.borderColor = self.borderColor.cgColor
}
}
@IBInspectable
public var borderWidth: CGFloat = 1.0 {
didSet {
self.layer.borderWidth = self.borderWidth
}
}
@IBInspectable
public var innerFillColor: UIColor = .lightGray {
didSet {
self.layer.backgroundColor = innerFillColor.cgColor
}
}
}
//
// DrawView.swift
// SubClassedUIView
//
// Created by SunarcMAC on 15/05/18.
// Copyright © 2018 SunarcMAC. All rights reserved.
//
import UIKit
@IBDesignable
class DrawTextView: UITextView {
override init(frame: CGRect, textContainer: NSTextContainer?) {
super.init(frame: frame, textContainer: textContainer)
}
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}
@IBInspectable
public var cornerRadius: CGFloat = 2.0 {
didSet {
self.layer.cornerRadius = self.cornerRadius
}
}
@IBInspectable
public var borderColor: UIColor = .black {
didSet {
self.layer.borderColor = self.borderColor.cgColor
}
}
@IBInspectable
public var borderWidth: CGFloat = 1.0 {
didSet {
self.layer.borderWidth = self.borderWidth
}
}
@IBInspectable
public var innerFillColor: UIColor = .lightGray {
didSet {
self.layer.backgroundColor = innerFillColor.cgColor
}
}
}
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -481,6 +481,7 @@
</constraints>
</tableViewCellContentView>
<connections>
<outlet property="imgStatus" destination="fIE-rv-r8S" id="mwK-3V-1VU"/>
<outlet property="lblCustomerName" destination="GyN-64-95d" id="rTa-EL-MnF"/>
<outlet property="lblDate" destination="6J5-vc-rA9" id="Nmo-77-zv6"/>
<outlet property="lblPrice" destination="rVv-NG-rbd" id="eNx-zg-juI"/>
......@@ -1699,7 +1700,9 @@
</view>
<nil key="simulatedTopBarMetrics"/>
<connections>
<outlet property="btnEndService" destination="mid-Xd-gsS" id="cJp-hc-uu1"/>
<outlet property="btnSend" destination="aVM-iS-vM0" id="1zJ-Hw-hTF"/>
<outlet property="chatInputView" destination="Sld-01-3ke" id="TGV-X0-NxQ"/>
<outlet property="commentViewHeight" destination="zyR-Jh-Kpw" id="kQW-fA-yBh"/>
<outlet property="lblPlaceHolder" destination="MTH-Qs-B62" id="RFk-e4-kUU"/>
<outlet property="tblChat" destination="zMo-HV-qAx" id="x3N-0U-L6g"/>
......
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