Commit 0404c99e authored by lujunye's avatar lujunye

37

parent 04563a8b
......@@ -12,6 +12,7 @@ import WebKit
class WebViewController: BaseViewController {
// wkWebView
lazy var wkWebView = WKWebView()
var isPay = false
// 进度条
lazy var progressView = UIProgressView()
override func viewDidLoad() {
......@@ -36,12 +37,17 @@ class WebViewController: BaseViewController {
wkWebView.loadHTMLString(loadHTMLString! + headerString, baseURL: nil)
}else {
if isPay {
let url = URL(string: urlStr)
let request = URLRequest.init(url: url!, cachePolicy: .reloadRevalidatingCacheData, timeoutInterval: 10)
wkWebView.load(request)
}else{
let urlString = urlStr.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)!
let url = URL(string: urlString)
let request = URLRequest.init(url: url!, cachePolicy: .reloadRevalidatingCacheData, timeoutInterval: 10)
wkWebView.load(request)
}
}
isAddObserver = true
wkWebView.navigationDelegate = self
......
......@@ -11,6 +11,7 @@ import UIKit
@objc optional func textFieldContent(content:String,cell:TitleAndTFCell)
}
class TitleAndTFCell: UITableViewCell {
@IBOutlet weak var content_lbl: UILabel!
@IBOutlet weak var star_lbl: UILabel!
@IBOutlet weak var line: UIView!
var delegate:TitleAndTFCellDelegate?
......@@ -28,6 +29,7 @@ class TitleAndTFCell: UITableViewCell {
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
......
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="17701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="18122" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17703"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="18093"/>
<capability name="Named colors" minToolsVersion="9.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
......@@ -46,11 +46,21 @@
<color key="textColor" name="按钮背景颜色"/>
<nil key="highlightedColor"/>
</label>
<label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="right" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ocB-s3-gMk">
<rect key="frame" x="70" y="5" width="290" height="39"/>
<fontDescription key="fontDescription" name="PingFangSC-Regular" family="PingFang SC" pointSize="13"/>
<color key="textColor" name="标题字颜色"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstItem="ocB-s3-gMk" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="5" id="0Vy-ax-qjC"/>
<constraint firstAttribute="trailing" secondItem="ocB-s3-gMk" secondAttribute="trailing" constant="15" id="8cs-7X-Bjm"/>
<constraint firstAttribute="trailing" secondItem="Q6V-I9-aNd" secondAttribute="trailing" constant="15" id="91e-XA-Iqf"/>
<constraint firstAttribute="trailing" secondItem="zvz-cN-gmt" secondAttribute="trailing" id="91g-iJ-e2S"/>
<constraint firstItem="Q6V-I9-aNd" firstAttribute="leading" secondItem="6wI-Bk-Hnz" secondAttribute="trailing" priority="750" constant="15" id="HNr-U6-OGL"/>
<constraint firstItem="ocB-s3-gMk" firstAttribute="leading" secondItem="6wI-Bk-Hnz" secondAttribute="trailing" constant="15" id="KYA-y9-yiN"/>
<constraint firstItem="zvz-cN-gmt" firstAttribute="top" secondItem="ocB-s3-gMk" secondAttribute="bottom" constant="5" id="M2S-Zv-nIA"/>
<constraint firstItem="zvz-cN-gmt" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="15" id="Mua-VI-kn3"/>
<constraint firstItem="6wI-Bk-Hnz" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="15" id="NXV-5U-lIO"/>
<constraint firstItem="6wI-Bk-Hnz" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="aLi-6W-mr9"/>
......@@ -62,6 +72,7 @@
</tableViewCellContentView>
<viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
<connections>
<outlet property="content_lbl" destination="ocB-s3-gMk" id="Zui-H8-dT5"/>
<outlet property="line" destination="zvz-cN-gmt" id="zWg-kq-cW7"/>
<outlet property="nameLbl" destination="6wI-Bk-Hnz" id="W9P-gn-wOa"/>
<outlet property="star_lbl" destination="9LH-Vg-GzM" id="2ex-gJ-Umt"/>
......
......@@ -887,10 +887,14 @@ class NewRKVc: BaseViewController ,UITableViewDelegate,UITableViewDataSource, Ne
if data.createDayStr != nil {
cell.timeLbl.text = data.createDayStr
}
let report_sn = report_sn_arr[indexPath.row]
print("abc == ",report_sn_arr,indexPath.row)
if report_sn_arr.count > 0 {
let report_sn = report_sn_arr[indexPath.row]
if report_sn.count != 0 {
cell.btn_title_lbl.text = "查看"
}
}
cell.gys_name_lbl.text = "请选择供应商"
cell.gys_arrow.isHidden = false
cell.gys_right_margin.constant = 10
......
......@@ -94,7 +94,7 @@ class PayViewController: BaseViewController ,GeliAlertViewDelegate{
let dataM = data as! LocationGeliPayModel
let vc = WebViewController()
vc.urlStr = dataM.data?.url
print("vcURL = ",vc.urlStr)
vc.isPay = true
self.navigationController?.pushViewController(vc, animated: true)
}) { (error) in
......
......@@ -688,7 +688,6 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
break
default:
break
}
if indexPath.row == yuShouTitleArr.count - 1 {
......@@ -729,6 +728,8 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
cell.nameLbl.text = nonYuShouPart3Arr[indexPath.row]
cell.line.isHidden = false
cell.textTF.text = "-"
cell.textTF.isHidden = false
cell.content_lbl.isHidden = true
if self.dataMdoel?.receiving != nil {
switch indexPath.row {
case 0:
......@@ -736,7 +737,10 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
case 1:
cell.textTF.text = self.dataMdoel?.receiving?.mobile
case 2:
cell.textTF.text = self.dataMdoel?.receiving?.addr_str
cell.textTF.isHidden = true
cell.content_lbl.isHidden = false
cell.content_lbl.text = self.dataMdoel?.receiving?.addr_str
// cell.content_lbl.text = "广东省深圳市南山区粤海街道测试地址广东省深圳市南山区粤海街道测试地址广东省深圳市南山区粤海街道测试地址"
default: break
}
......@@ -1350,6 +1354,12 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
}
return 10
}
// func tableView(_ tableView: UITableView, estimatedHeightForRowAt indexPath: IndexPath) -> CGFloat {
//
// return 49
// }
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
switch indexPath.section {
case 1://商品展示heightrow
......@@ -1373,7 +1383,15 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
}
}
case 3:
if indexPath.row == 2 {
let h = getTextHeigh(textStr: (self.dataMdoel?.receiving?.addr_str)!, font: UIFont.systemFont(ofSize: 13), width: ScreenWidth - 70) + 20
if h < 49 {
return 49
}
return h
}
case 4://发票信息heightrow
if segmentIndex == 0 {
......@@ -1385,7 +1403,20 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
}
return 49
}
func getTextHeigh(textStr :  String, font : UIFont, width : CGFloat)  -> CGFloat{
        let normalText : NSString = textStr as NSString
        let size = CGSize(width: width, height:1000)   //CGSizeMake(width,1000)
        let dic = NSDictionary(object: font, forKey : kCTFontAttributeName as! NSCopying)
                let stringSize = normalText.boundingRect(with: size, options: .usesLineFragmentOrigin, attributes: dic as? [NSAttributedString.Key:Any], context:nil).size
        return  stringSize.height
    }
//MARK: - header delegate
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
......
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