Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
GeliBusinessPlatform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ljy
GeliBusinessPlatform
Commits
56a0ba03
Commit
56a0ba03
authored
Jan 20, 2021
by
lujunye
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
打印调试1
parent
822010b7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
24 deletions
+47
-24
GeliBusinessPlatform.xcworkspace/xcuserdata/junyelu.xcuserdatad/UserInterfaceState.xcuserstate
...erdata/junyelu.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
GeliBusinessPlatform/Other/Web/WebViewController.swift
GeliBusinessPlatform/Other/Web/WebViewController.swift
+22
-16
GeliBusinessPlatform/ViewController/工作中心/WorkCViewController.swift
...essPlatform/ViewController/工作中心/WorkCViewController.swift
+2
-2
GeliBusinessPlatform/ViewController/打印订单/PrintListMgVc.swift
GeliBusinessPlatform/ViewController/打印订单/PrintListMgVc.swift
+23
-6
No files found.
GeliBusinessPlatform.xcworkspace/xcuserdata/junyelu.xcuserdatad/UserInterfaceState.xcuserstate
View file @
56a0ba03
No preview for this file type
GeliBusinessPlatform/Other/Web/WebViewController.swift
View file @
56a0ba03
...
...
@@ -17,7 +17,7 @@ class WebViewController: BaseViewController {
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
navbar
.
title
=
""
navbar
.
title
=
titleStr
self
.
view
.
addSubview
(
navbar
)
initInterface
()
...
...
@@ -26,6 +26,8 @@ class WebViewController: BaseViewController {
var
loadHTMLString
:
String
?
=
""
var
urlStr
:
String
?
=
""
var
isAddObserver
=
false
var
titleStr
=
""
func
initInterface
()
->
()
{
if
urlStr
?
.
count
==
0
&&
loadHTMLString
?
.
count
!=
0
{
...
...
@@ -36,7 +38,7 @@ class WebViewController: BaseViewController {
}
else
{
let
url
=
URL
(
string
:
urlStr
!
)
let
request
=
URLRequest
.
init
(
url
:
url
!
,
cachePolicy
:
.
reloadRevalidatingCacheData
,
timeoutInterval
:
10
)
wkWebView
.
load
(
request
)
}
isAddObserver
=
true
...
...
@@ -57,14 +59,14 @@ class WebViewController: BaseViewController {
make
.
top
.
equalTo
(
navbar
.
snp
.
bottom
)
make
.
height
.
equalTo
(
2
)
}
}
deinit
{
print
(
"con is deinit"
)
if
isAddObserver
{
wkWebView
.
removeObserver
(
self
,
forKeyPath
:
"estimatedProgress"
)
}
}
}
}
extension
WebViewController
:
WKNavigationDelegate
{
...
...
@@ -73,32 +75,33 @@ extension WebViewController: WKNavigationDelegate
override
func
observeValue
(
forKeyPath
keyPath
:
String
?,
of
object
:
Any
?,
change
:
[
NSKeyValueChangeKey
:
Any
]?,
context
:
UnsafeMutableRawPointer
?)
{
print
(
"进度=
\(
self
.
wkWebView
.
estimatedProgress
)
"
)
progressView
.
setProgress
(
Float
(
self
.
wkWebView
.
estimatedProgress
),
animated
:
true
)
}
// 页面开始加载时调用
func
webView
(
_
webView
:
WKWebView
,
didStartProvisionalNavigation
navigation
:
WKNavigation
!
)
{
print
(
"开始加载..."
)
progressView
.
setProgress
(
Float
(
0.2
),
animated
:
true
)
// Log4jMessage(message: "开始加载...")
// Log4jMessage(message: "开始加载...")
}
// 当内容开始返回时调用
func
webView
(
_
webView
:
WKWebView
,
didCommit
navigation
:
WKNavigation
!
){
print
(
"当内容开始返回..."
)
progressView
.
setProgress
(
Float
(
0.7
),
animated
:
true
)
// Log4jMessage(message: "当内容开始返回...")
// Log4jMessage(message: "当内容开始返回...")
}
// 页面加载完成之后调用
func
webView
(
_
webView
:
WKWebView
,
didFinish
navigation
:
WKNavigation
!
){
// Log4jMessage(message: "页面加载完成...")
// Log4jMessage(message: "页面加载完成...")
print
(
"页面加载完成..."
)
/// 获取网页title
navbar
.
title
=
self
.
wkWebView
.
title
/// 获取网页title
if
titleStr
.
count
==
0
{
navbar
.
title
=
self
.
wkWebView
.
title
}
UIView
.
animate
(
withDuration
:
0.5
)
{
self
.
progressView
.
isHidden
=
true
}
...
...
@@ -106,9 +109,12 @@ extension WebViewController: WKNavigationDelegate
// 页面加载失败时调用
func
webView
(
_
webView
:
WKWebView
,
didFail
navigation
:
WKNavigation
!
,
withError
error
:
Error
){
// Log4jMessage(message: "页面加载失败...")
print
(
"页面加载失败..."
)
// Log4jMessage(message: "页面加载失败...")
print
(
"页面加载失败..."
,
error
)
let
err
=
error
as!
NSError
if
err
.
code
==
NSURLErrorCancelled
{
return
}
UIView
.
animate
(
withDuration
:
0.5
)
{
self
.
progressView
.
progress
=
0.0
self
.
progressView
.
isHidden
=
true
...
...
@@ -121,5 +127,5 @@ extension WebViewController: WKNavigationDelegate
alertView
.
addAction
(
okAction
)
self
.
present
(
alertView
,
animated
:
true
,
completion
:
nil
)
}
}
GeliBusinessPlatform/ViewController/工作中心/WorkCViewController.swift
View file @
56a0ba03
...
...
@@ -443,8 +443,8 @@ class WorkCViewController: BaseViewController, UITableViewDelegate, UITableViewD
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
return
case
53
:
//销售下单-代客下单
let
vc
=
DaiKeXiaDanGouWuViewController
()
//
let vc = PrintListMgVc()
//
let vc = DaiKeXiaDanGouWuViewController()
let
vc
=
PrintListMgVc
()
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
return
case
54
:
//扫码下单
...
...
GeliBusinessPlatform/ViewController/打印订单/PrintListMgVc.swift
View file @
56a0ba03
...
...
@@ -10,21 +10,38 @@ import UIKit
import
Parchment
import
LGButton
class
PrintListMgVc
:
BaseViewController
,
PagingViewControllerDelegate
{
class
PrintListMgVc
:
BaseViewController
,
PagingViewControllerDelegate
,
UIPrintInteractionControllerDelegate
{
let
web_vc
=
WebViewController
()
@IBAction
func
check_detail
(
_
sender
:
UIButton
)
{
print
(
"check_detail"
)
web_vc
.
titleStr
=
"打印预览"
web_vc
.
urlStr
=
"https://www.baidu.com"
self
.
navigationController
?
.
pushViewController
(
web_vc
,
animated
:
true
)
}
@IBAction
func
print_action
(
_
sender
:
LGButton
)
{
let
pc
=
UIPrintInteractionController
.
shared
// 打印任务相关信息
let
printInfo
=
UIPrintInfo
(
dictionary
:
nil
)
printInfo
.
outputType
=
UIPrintInfo
.
OutputType
.
general
printInfo
.
jobName
=
"my print Job"
pc
.
printInfo
=
printInfo
pc
.
delegate
=
self
if
userName
!=
"不二制油"
{
//普通
let
formatter
=
web_vc
.
wkWebView
.
viewPrintFormatter
()
pc
.
printFormatter
=
formatter
formatter
.
startPage
=
0
pc
.
present
(
animated
:
true
)
{
(
printer
,
result
,
err
)
in
print
(
result
)
}
}
else
{
//不二
let
vc
=
viewControllers
[
selectIndex
]
if
selectIndex
!=
0
{
print
(
vc
.
FM_str
,
vc
.
detail_adr_str
,
vc
.
phone_str
,
vc
.
contect_str
)
}
}
}
@IBOutlet
weak
var
contentV
:
UIView
!
...
...
@@ -81,7 +98,7 @@ class PrintListMgVc: BaseViewController, PagingViewControllerDelegate {
}
holder_img
.
isHidden
=
normal_type_btn
.
isHidden
// Do any additional setup after loading the view.
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment