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
b849eb9c
Commit
b849eb9c
authored
May 26, 2020
by
lujunye
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
计算webView高度
parent
699e8138
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
15 deletions
+37
-15
GeliBusinessPlatform.xcworkspace/xcuserdata/junyelu.xcuserdatad/UserInterfaceState.xcuserstate
...erdata/junyelu.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
GeliBusinessPlatform/SceneDelegate.swift
GeliBusinessPlatform/SceneDelegate.swift
+1
-1
GeliBusinessPlatform/View/Cell/AddGuiGeCell.swift
GeliBusinessPlatform/View/Cell/AddGuiGeCell.swift
+17
-7
GeliBusinessPlatform/ViewController/商品详情/EPViewController.swift
...sinessPlatform/ViewController/商品详情/EPViewController.swift
+8
-3
GeliBusinessPlatform/ViewController/商品详情/ProductDetailViewController.swift
...orm/ViewController/商品详情/ProductDetailViewController.swift
+11
-4
No files found.
GeliBusinessPlatform.xcworkspace/xcuserdata/junyelu.xcuserdatad/UserInterfaceState.xcuserstate
View file @
b849eb9c
No preview for this file type
GeliBusinessPlatform/SceneDelegate.swift
View file @
b849eb9c
...
...
@@ -95,7 +95,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate, UITabBarControllerDeleg
tabBarController
.
viewControllers
=
[
v1
,
v2
,
v3
,
v4
,
v5
]
tabBarController
.
selectedIndex
=
2
//
tabBarController.selectedIndex = 2
...
...
GeliBusinessPlatform/View/Cell/AddGuiGeCell.swift
View file @
b849eb9c
...
...
@@ -11,8 +11,9 @@ import WebKit
@objc
protocol
AddGuiGeCellDelegate
{
@objc
optional
func
AddGuiGeCellClick
(
cell
:
AddGuiGeCell
)
@objc
optional
func
AddGuiGeCellWebViewHeight
(
height
:
CGFloat
)
}
class
AddGuiGeCell
:
UITableViewCell
{
class
AddGuiGeCell
:
UITableViewCell
,
WKNavigationDelegate
{
var
delegate
:
AddGuiGeCellDelegate
?
@IBOutlet
weak
var
btmH
:
NSLayoutConstraint
!
@IBAction
func
btnClick
(
_
sender
:
Any
)
{
...
...
@@ -28,7 +29,7 @@ class AddGuiGeCell: UITableViewCell {
override
func
awakeFromNib
()
{
super
.
awakeFromNib
()
selectionStyle
=
.
none
webView
.
navigationDelegate
=
self
// Initialization code
}
...
...
@@ -37,5 +38,14 @@ class AddGuiGeCell: UITableViewCell {
// Configure the view for the selected state
}
func
webView
(
_
webView
:
WKWebView
,
didFinish
navigation
:
WKNavigation
!
)
{
webView
.
scrollView
.
isScrollEnabled
=
false
webView
.
evaluateJavaScript
(
"document.body.scrollHeight"
)
{
(
result
,
error
)
in
let
h
=
result
as!
CGFloat
print
(
"webH = "
,
h
)
self
.
delegate
?
.
AddGuiGeCellWebViewHeight
?(
height
:
h
)
}
}
}
GeliBusinessPlatform/ViewController/商品详情/EPViewController.swift
View file @
b849eb9c
...
...
@@ -66,7 +66,7 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
var
yunShuTypeArr
=
[
"冷链"
,
"常温"
,
"热链"
]
var
countryArr
=
[
"中国"
]
var
layout
=
UICollectionViewFlowLayout
()
var
webH
:
CGFloat
=
0
var
glSelectView
:
GLAlertSelectView
?
var
selectIdx
:
IndexPath
?
=
IndexPath
(
item
:
0
,
section
:
0
)
//多规格状态下点击collectionCell的row记录
...
...
@@ -1490,7 +1490,7 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
case
4
:
return
49
default
:
if
goodsDesc
.
count
>
0
{
//有内容
return
250
return
webH
}
else
{
//无内容
if
isAllEditing
{
//非编辑
return
0.001
...
...
@@ -1777,7 +1777,12 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
return
dataChangeString
(
sender
:
data4
)
}
func
AddGuiGeCellWebViewHeight
(
height
:
CGFloat
)
{
if
webH
==
0
{
webH
=
height
listTbv
.
reloadData
()
}
}
var
goodsDesc
=
""
func
getHTMLByVc
(
_
model
:
String
!
)
{
...
...
GeliBusinessPlatform/ViewController/商品详情/ProductDetailViewController.swift
View file @
b849eb9c
...
...
@@ -11,6 +11,7 @@ import LGButton
import
Photos
import
IQKeyboardManagerSwift
import
Dollar
import
WebKit
protocol
ProductDetailViewControllerDelegate
{
func
reloadDataByProductDetailViewController
()
...
...
@@ -58,7 +59,7 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
var
selectIdx
:
IndexPath
?
=
IndexPath
(
item
:
0
,
section
:
0
)
//多规格状态下点击collectionCell的row记录
var
isYuShouShangPin
:
Bool
?
//是否为预售商品
var
webH
:
CGFloat
=
0
var
itemTypeArr
:
Array
<
Int
>
?
=
[]
//多选
var
shangPinStatus
:
Int
?
=
0
//商品状态
var
yunShuType
:
Int
?
=
0
//运输类型
...
...
@@ -456,7 +457,9 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
cell
.
delegate
=
self
cell
.
imgBtn
.
tag
=
indexPath
.
row
if
goodsDesc
.
count
>
0
{
cell
.
webView
.
isHidden
=
false
let
headerString
:
String
=
"<header><meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no'><style>img{max-width:100%}</style></header>"
let
goodsDescHmtl
=
"<html>"
+
goodsDesc
+
"</html>"
...
...
@@ -1089,9 +1092,7 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
case
4
:
return
49
default
:
if
goodsDesc
.
count
>
0
{
return
450*
glscale
return
webH
}
return
98
...
...
@@ -1255,6 +1256,12 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
}
func
AddGuiGeCellWebViewHeight
(
height
:
CGFloat
)
{
if
webH
==
0
{
webH
=
height
listTbv
.
reloadData
()
}
}
//MARK:---商品详情回调的数据
var
goodsDesc
=
""
func
getHTMLByVc
(
_
model
:
String
!
)
{
...
...
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