Commit 48cba11f authored by lujunye's avatar lujunye

打印调试基本完成

parent fa4dcb5d
......@@ -24,7 +24,7 @@ class WebViewController: BaseViewController {
}
var loadHTMLString:String? = ""
var urlStr:String? = ""
var urlStr:String! = ""
var isAddObserver = false
var titleStr = ""
......@@ -36,7 +36,9 @@ class WebViewController: BaseViewController {
wkWebView.loadHTMLString(loadHTMLString! + headerString, baseURL: nil)
}else {
let url = URL(string: urlStr!)
let urlString = urlStr.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)!
let url = URL(string: urlString)
let request = URLRequest.init(url: url!, cachePolicy: .reloadRevalidatingCacheData, timeoutInterval: 10)
wkWebView.load(request)
......
......@@ -26,7 +26,7 @@ class PrintListMgVc: BaseViewController, PagingViewControllerDelegate,UIPrintInt
]
printUrl(dic) { (data) in
let d = data as! printUrl_Model
self.web_vc.urlStr = d.data!
self.web_vc.urlStr = d.data
self.navigationController?.pushViewController(self.web_vc, animated: true)
} failture: { (err) in
......@@ -63,7 +63,8 @@ class PrintListMgVc: BaseViewController, PagingViewControllerDelegate,UIPrintInt
} failture: { (err) in
}
}else{//不二
}else{
let vc = viewControllers[selectIndex]
if vc.FM_str.count == 0 {
HUD.flash(.label("请输入汇款账户"), delay: 1.2)
......@@ -90,9 +91,9 @@ class PrintListMgVc: BaseViewController, PagingViewControllerDelegate,UIPrintInt
dic = ["user_token":UserToken as Any,
"order_id":order_id as Any,
"remittance_account":vc.FM_str as Any,
"province_id":vc.province_id as Any,
"city_id":vc.city_id as Any,
"district_id":vc.area_id as Any,
"province_id":vc.proDict["area_id"] as Any,
"city_id":vc.cityDict["area_id"] as Any,
"district_id":vc.areaDict["area_id"] as Any,
"mobile":vc.phone_str as Any,
"consignee":vc.consignee_str as Any,
"print_type":selectIndex as Any
......@@ -144,9 +145,15 @@ class PrintListMgVc: BaseViewController, PagingViewControllerDelegate,UIPrintInt
vc.cityIndex = (printData?.city_id)!
vc.areaIndex = (printData?.district_id)!
}
vc.FM_str = (printData?.remittance_account)!
vc.phone_str = (printData?.mobile)!
vc.consignee_str = (printData?.consignee)!
if printData?.remittance_account != nil {
vc.FM_str = (printData?.remittance_account)!
}
if printData?.mobile != nil {
vc.phone_str = (printData?.mobile)!
}
if printData?.consignee != nil {
vc.consignee_str = (printData?.consignee)!
}
}
}
......
......@@ -134,9 +134,9 @@ class PrintViewController: BaseViewController,UITableViewDelegate,UITableViewDat
var isChange = false
var province_id = ""
var city_id = ""
var area_id = ""
// var province_id = ""
// var city_id = ""
// var area_id = ""
@objc func adrSelectFinish(sender:UIButton){
......@@ -167,9 +167,7 @@ class PrintViewController: BaseViewController,UITableViewDelegate,UITableViewDat
isChange = false
}
province_id = proDict["area_id"]! as! String
city_id = cityDict["area_id"]! as! String
area_id = areaDict["area_id"]! as! String
var selectAdr = proName
if cityName.count > 0 {
......@@ -317,6 +315,7 @@ class PrintViewController: BaseViewController,UITableViewDelegate,UITableViewDat
}
}
}
proDict = addressArray[provinceIndex] as! Dictionary<String,Any>
// }
}
} catch let error as Error? {
......@@ -363,7 +362,9 @@ class PrintViewController: BaseViewController,UITableViewDelegate,UITableViewDat
get_location_id()
}
}
var proDict:Dictionary<String,Any> = Dictionary()
var cityDict:Dictionary<String,Any> = Dictionary()
var areaDict:Dictionary<String,Any> = Dictionary()
func get_location_id(){
let proDict = addressArray[provinceIndex] as! Dictionary<String,Any>
var cityDict:Dictionary<String,Any> = Dictionary()
......@@ -378,9 +379,7 @@ class PrintViewController: BaseViewController,UITableViewDelegate,UITableViewDat
}
}
province_id = proDict["area_id"]! as! String
city_id = cityDict["area_id"]! as! String
area_id = areaDict["area_id"]! as! String
}
//MARK:--VC 初始化
convenience init(title: String) {
......@@ -402,9 +401,9 @@ class PrintViewController: BaseViewController,UITableViewDelegate,UITableViewDat
let dic = ["user_token":UserToken as Any,
"order_id":order_id as Any,
"remittance_account":FM_str as Any,
"province_id":provinceIndex as Any,
"city_id":cityIndex as Any,
"district_id":areaIndex as Any,
"province_id":proDict["area_id"] as Any,
"city_id":cityDict["area_id"] as Any,
"district_id":areaDict["area_id"] as Any,
"mobile":phone_str as Any,
"consignee":consignee_str as Any,
"print_type":type as Any
......@@ -413,12 +412,11 @@ class PrintViewController: BaseViewController,UITableViewDelegate,UITableViewDat
printUrl(dic) { (data) in
let d = data as! printUrl_Model
self.web_vc.titleStr = "打印预览"
self.web_vc.urlStr = d.data
self.web_vc.urlStr = d.data!
self.navigationController?.pushViewController(self.web_vc, animated: true)
} failture: { (err) in
}
}
}
......
......@@ -1368,7 +1368,7 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
}
break
case "打印":
orderId = 12445
// orderId = 12445
printOrder(["user_token":UserToken as Any,"order_id":orderId as Any]) { [self] (data) in
let d = data as! printOrder_model
let vc = PrintListMgVc()
......
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