Commit d5201b65 authored by lujunye's avatar lujunye

暗示法发送到发顺丰1112221212

parent 088b29d8
......@@ -75,20 +75,22 @@ class NewCKVc: BaseViewController,UITableViewDelegate,UITableViewDataSource,CKNo
printData(idx: printIdx)
}
var wkWebView:WKWebView?
func printData(idx:Int){
let model = printData[idx]["goods_data"] as! GetGoodBatchDataModel
//测试
let urlStr = "http://z.gelifood.com/static/url/label.html?goods_name=\(printData[idx]["goods_name"] as! String)&spec_str=\(printData[idx]["spec_str"] as! String)&batch_sn=\(model.batch_sn!)&batch_id=\(model.batch_id!)&iscs=1"
// let urlStr = "http://z.gelifood.com/static/url/label.html?goods_name=\(printData[idx]["goods_name"] as! String)&spec_str=\(printData[idx]["spec_str"] as! String)&batch_sn=\(model.batch_sn!)&batch_id=\(model.batch_id!)&iscs=1"
//online
// let urlStr = "http://zx.gelifood.com/static/url/label.html?goods_name=\(printData[idx]["goods_name"] as! String)&spec_str=\(printData[idx]["spec_str"] as! String)&batch_sn=\(model.batch_sn!)&batch_id=\(model.batch_id!)&iscs=0"
print("url == ",urlStr)
let urlStr = "http://zx.gelifood.com/static/url/label.html?goods_name=\(printData[idx]["goods_name"] as! String)&spec_str=\(printData[idx]["spec_str"] as! String)&batch_sn=\(model.batch_sn!)&batch_id=\(model.batch_id!)&iscs=0"
let urlString = urlStr.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)!
let url = URL(string: urlString)
if wkWebView == nil {
wkWebView = WKWebView()
}
let request = URLRequest.init(url: url!, cachePolicy: .reloadRevalidatingCacheData, timeoutInterval: 10)
wkWebView.navigationDelegate = self
wkWebView.load(request)
wkWebView.bounds = CGRect(x: 0, y: 0, width: 230, height: 230*0.75)
wkWebView!.navigationDelegate = self
wkWebView!.load(request)
wkWebView!.bounds = CGRect(x: 0, y: 0, width: 230, height: 230*0.75)
}
let UserToken = UserDefaults.standard.value(forKey: "user_token")
......@@ -245,7 +247,7 @@ class NewCKVc: BaseViewController,UITableViewDelegate,UITableViewDataSource,CKNo
var goodsInfoArr:Array<Any> = []
@IBOutlet weak var gm_view: UIView!
let wkWebView = WKWebView()
//
// 页面加载完成之后调用
func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!){
print("页面加载完成...")
......@@ -267,9 +269,10 @@ class NewCKVc: BaseViewController,UITableViewDelegate,UITableViewDataSource,CKNo
cell.progress.progress = Float(part)/Float(total)
if Float(part)/Float(total) == 1 {
printIdx += 1
if printIdx != printData.count - 1 {
if printIdx <= printData.count - 1 {
printData(idx: printIdx)
print_list.reloadData()
webView.removeFromSuperview()
}else{
printIdx = 0
title_Lbl.removeFromSuperview()
......@@ -460,8 +463,8 @@ class NewCKVc: BaseViewController,UITableViewDelegate,UITableViewDataSource,CKNo
cell.btn.setTitle("取消打印", for: .normal)
cell.btn.setTitleColor(UIColor(named: "#F57575"), for: .normal)
cell.btn.isUserInteractionEnabled = true
}else{
// cell.progress.progress = 1
cell.status_lbl.isHidden = true
cell.btn.setTitle("正在打印", for: .normal)
cell.btn.isUserInteractionEnabled = false
......
......@@ -48,7 +48,7 @@
<color key="textColor" name="标题字颜色"/>
<nil key="highlightedColor"/>
</label>
<progressView opaque="NO" contentMode="scaleToFill" verticalHuggingPriority="750" progress="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="ivI-eU-vNC">
<progressView opaque="NO" contentMode="scaleToFill" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ivI-eU-vNC">
<rect key="frame" x="51" y="37" width="189" height="4"/>
<color key="backgroundColor" red="0.81568627450980391" green="0.90588235294117647" blue="0.98431372549019602" alpha="1" colorSpace="calibratedRGB"/>
<color key="tintColor" red="0.27843137254901962" green="0.5607843137254902" blue="0.8901960784313725" alpha="1" colorSpace="calibratedRGB"/>
......
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