Commit fd0d4f4f by Anand.suthar

fixes

parent 701c438c
......@@ -8,6 +8,7 @@
/* Begin PBXBuildFile section */
4ACEC34DA9643FC51768972C /* Pods_Bhagyashree.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 282A58176C30609705E92EDC /* Pods_Bhagyashree.framework */; };
B01A09C32135284A002C64B5 /* HTTPConnect.swift in Sources */ = {isa = PBXBuildFile; fileRef = B01A09C22135284A002C64B5 /* HTTPConnect.swift */; };
B01B217720EF878A002AC8D5 /* UserExt.swift in Sources */ = {isa = PBXBuildFile; fileRef = B01B217620EF878A002AC8D5 /* UserExt.swift */; };
B01B217C20EF87E9002AC8D5 /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = B01B217B20EF87E9002AC8D5 /* User.swift */; };
B024385120B52EF5007D12AE /* Fengshui.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B024385020B52EF5007D12AE /* Fengshui.xcassets */; };
......@@ -536,6 +537,7 @@
282A58176C30609705E92EDC /* Pods_Bhagyashree.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Bhagyashree.framework; sourceTree = BUILT_PRODUCTS_DIR; };
748A45C133F59B5FE7C608D1 /* Pods-Bhagyashree.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Bhagyashree.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Bhagyashree/Pods-Bhagyashree.debug.xcconfig"; sourceTree = "<group>"; };
7A24BF177C4191DF34CBDA0F /* Pods-Bhagyashree.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Bhagyashree.release.xcconfig"; path = "Pods/Target Support Files/Pods-Bhagyashree/Pods-Bhagyashree.release.xcconfig"; sourceTree = "<group>"; };
B01A09C22135284A002C64B5 /* HTTPConnect.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HTTPConnect.swift; sourceTree = "<group>"; };
B01B217620EF878A002AC8D5 /* UserExt.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserExt.swift; sourceTree = "<group>"; };
B01B217B20EF87E9002AC8D5 /* User.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = User.swift; sourceTree = "<group>"; };
B024385020B52EF5007D12AE /* Fengshui.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Fengshui.xcassets; sourceTree = "<group>"; };
......@@ -1273,6 +1275,7 @@
children = (
B09212B220B805A200798423 /* API.swift */,
B09212B420B805B100798423 /* HTTP.swift */,
B01A09C22135284A002C64B5 /* HTTPConnect.swift */,
);
path = HTTP;
sourceTree = "<group>";
......@@ -2522,6 +2525,7 @@
EC04CDFC2052CD7D00B425BB /* ChromaShadeSlider.swift in Sources */,
EC04CFBB2052CF2A00B425BB /* CHIPageControlPuya.swift in Sources */,
B0BC1BEA20F0E56200944FD3 /* Enquiry.swift in Sources */,
B01A09C32135284A002C64B5 /* HTTPConnect.swift in Sources */,
B0B5717B212BFEC700593801 /* OnsiteFengshuiViewController.swift in Sources */,
EC04CDEF2052CD6E00B425BB /* SellerInvoiceShippingDownloadController.swift in Sources */,
B09212AC20B8055E00798423 /* DB.swift in Sources */,
......@@ -2829,15 +2833,15 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Bhagyashree/Bhagyashree.entitlements;
CODE_SIGN_IDENTITY = "iPhone Distribution";
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
DEVELOPMENT_TEAM = S5AR757G56;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = Bhagyashree/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.gdi.yuanzhongsiu-seller";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "a5e812ba-74cb-472e-adf1-da31e8ca0c05";
PROVISIONING_PROFILE_SPECIFIER = FengShui_Seller_AdHok;
PROVISIONING_PROFILE = "";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OBJC_BRIDGING_HEADER = "Bhagyashree/MARKET PLACE/Seller Create Credit Memo/Bhagyashree-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.0;
......@@ -2853,15 +2857,15 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Bhagyashree/Bhagyashree.entitlements;
CODE_SIGN_IDENTITY = "iPhone Distribution";
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
DEVELOPMENT_TEAM = S5AR757G56;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = Bhagyashree/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.gdi.yuanzhongsiu-seller";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "a5e812ba-74cb-472e-adf1-da31e8ca0c05";
PROVISIONING_PROFILE_SPECIFIER = FengShui_Seller_AdHok;
PROVISIONING_PROFILE = "";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OBJC_BRIDGING_HEADER = "Bhagyashree/MARKET PLACE/Seller Create Credit Memo/Bhagyashree-Bridging-Header.h";
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = "1,2";
......
......@@ -6,22 +6,6 @@
<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"
......@@ -73,13 +57,13 @@
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Bhagyashree/Sunarc/Controller/Appointment/ServiceDetailViewController.swift"
timestampString = "556895749.937322"
filePath = "Bhagyashree/Sunarc/Other/HTTP/HTTPConnect.swift"
timestampString = "557140791.911939"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "43"
endingLineNumber = "43"
landmarkName = "viewWillAppear(_:)"
startingLineNumber = "120"
endingLineNumber = "120"
landmarkName = "tmpp(keyValueDict:keyValueFile:contentType:)"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
......@@ -89,13 +73,13 @@
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Bhagyashree/Sunarc/Controller/Appointment/ServiceDetailViewController.swift"
timestampString = "556895749.937796"
filePath = "Bhagyashree/Sunarc/Other/HTTP/HTTPConnect.swift"
timestampString = "557140792.927889"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "56"
endingLineNumber = "56"
landmarkName = "viewWillAppear(_:)"
startingLineNumber = "123"
endingLineNumber = "123"
landmarkName = "tmpp(keyValueDict:keyValueFile:contentType:)"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
......
......@@ -15,7 +15,8 @@ var DEFAULT_WEBSITE_ID = "1"
var BASE_DOMAIN = "http://54.251.144.17"
var BASE_DOMAIN = "http://18.136.9.203" // test
//var BASE_DOMAIN = "http://54.251.144.17" // dev
//var BASE_DOMAIN = "http://13.251.93.24"
var HOST_NAME = BASE_DOMAIN+"/index.php/"
......
......@@ -53,6 +53,9 @@ class ServiceDetailViewController: UIViewController {
if let orderId = self.orderId {
self.appointment.detailOfComlpeted(orderId: orderId, success: {
self.serviceStatus = .completed
self.btnStartMeeting.isHidden = true
self.btnEditResult.isHidden = true
self.tblServiceDetail.reloadData()
}, failure: { (errorMessage) in
if errorMessage.count > 0 {
......
......@@ -22,8 +22,6 @@ 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,9 +42,7 @@ extension Appointment {
"id": User.customerId,
]
HTTP().connectionWithRequestObject(api: API.COMPLETED_SERVICE, parameters: parameters, method: .post, indicator: true, success: { (response) in
print(response)
HTTPConnect.connectWithRequestObject(api: API.COMPLETED_SERVICE, parameters: parameters, method: "POST", contentType: "application/json", indicator: true, success: { (response) in
if let validJSON = response as? [[String: Any]] {
......@@ -60,6 +56,7 @@ extension Appointment {
failure("Incorrect data format")
}
}) { (errorMessage) in
failure(errorMessage)
}
......
//
// HTTPConnect.swift
// Bhagyashree
//
// Created by SunarcMAC on 28/08/18.
// Copyright © 2018 Sunarc. All rights reserved.
//
import Foundation
import SVProgressHUD
class HTTPConnect {
class func connectWithRequestObject(api: String, parameters: Any?, method: String, contentType: String, indicator: Bool, success: @escaping (_ json: Any) -> (), failure: @escaping (_ errorMessage: String) -> ()) -> Void {
if indicator == true {
SVProgressHUD.show()
}
let headers = [
"authkey": UserDefaults.standard.value(forKey: "authKey") as! String,
"content-type": contentType
]
var postData: Data?
if let parameters = parameters {
postData = try! JSONSerialization.data(withJSONObject: parameters, options: [])
}
print(HOST_NAME+API.UPDATE_RESULT)
print(parameters ?? "No parameters")
print(headers)
let request = NSMutableURLRequest(url: NSURL(string: HOST_NAME+api)! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = method
request.allHTTPHeaderFields = headers
request.httpBody = postData
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
DispatchQueue.main.async {
SVProgressHUD.dismiss()
if (error != nil) {
failure(error!.localizedDescription)
} else {
do {
let json = try JSONSerialization.jsonObject(with: data!, options: .mutableContainers)
success(json)
} catch let myJSONError {
failure(myJSONError.localizedDescription)
}
}
}
})
dataTask.resume()
}
func tmpp(keyValueDict: [String: Any]?, keyValueFile: [String: Any]?, contentType: String) {
let headers = [
"authkey": UserDefaults.standard.value(forKey: "authKey") as! String,
"content-type": contentType
]
let boundary = "----WebKitFormBoundary7MA4YWxkTrZu0gW"
var body = ""
// 1. Add key values dict
if let keyValueDict_ = keyValueDict {
for (key, value) in keyValueDict_ {
body += "--\(boundary)\r\n"
body += "Content-Disposition:form-data; name=\"\(key)\""
body += "\r\n\r\n\(value)"
}
}
// 2. Add files
if let keyValueFile_ = keyValueFile {
for (key, value) in keyValueFile_ {
if let fileLocalPath = value as? String {
let fileContent = try! String(contentsOfFile: fileLocalPath, encoding: String.Encoding.utf8)
body += "--\(boundary)\r\n"
body += "Content-Disposition:form-data; name=\"\(key)\""
body += "; filename=\"fileName\"\r\n"
body += "Content-Type: \(contentType)\r\n\r\n"
body += fileContent
}
}
}
let request = NSMutableURLRequest(url: NSURL(string: "http://13.228.97.103/index.php/mobikulhttp/checkout/addToCart")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = body.data(using: .utf8)
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error!)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse!)
}
})
dataTask.resume()
}
}
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