Commit a55b3ec7 authored by lujunye's avatar lujunye

取消选图弹簧效果

parent 9f3a4b1f
...@@ -10,13 +10,18 @@ import UIKit ...@@ -10,13 +10,18 @@ import UIKit
import SwiftUI import SwiftUI
import ESTabBarController_swift import ESTabBarController_swift
class SceneDelegate: UIResponder, UIWindowSceneDelegate, UITabBarControllerDelegate, loginDelegate { class SceneDelegate: UIResponder, UIWindowSceneDelegate, UITabBarControllerDelegate, loginDelegate {
var window: UIWindow? var window: UIWindow?
var sceneC: UIScene? var sceneC: UIScene?
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
sceneC = scene sceneC = scene
let UserToken = UserDefaults.standard.value(forKey: "user_token") let UserToken = UserDefaults.standard.value(forKey: "user_token")
...@@ -37,12 +42,16 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate, UITabBarControllerDeleg ...@@ -37,12 +42,16 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate, UITabBarControllerDeleg
} }
//MARK:--loginVC //MARK:--loginVC
func addLoginVc (isAgain:Bool){ func addLoginVc (isAgain:Bool){
let vc = LoginViewController()
vc.delegate = self // let vc = LoginViewController()
// vc.delegate = self
// let contentView = vc
let vc = ProductDetailViewController()
let contentView = vc let contentView = vc
//
// let vc = YingFuZhangKuanXQViewController()
// let contentView = vc
if let windowScene = sceneC as? UIWindowScene { if let windowScene = sceneC as? UIWindowScene {
if isAgain { if isAgain {
...@@ -90,6 +99,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate, UITabBarControllerDeleg ...@@ -90,6 +99,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate, UITabBarControllerDeleg
tabBarController.viewControllers = [v1, v2, v3, v4, v5] tabBarController.viewControllers = [v1, v2, v3, v4, v5]
tabBarController.selectedIndex = 1 tabBarController.selectedIndex = 1
let contentView = tabBarController let contentView = tabBarController
if let windowScene = sceneC as? UIWindowScene { if let windowScene = sceneC as? UIWindowScene {
...@@ -111,11 +121,11 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate, UITabBarControllerDeleg ...@@ -111,11 +121,11 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate, UITabBarControllerDeleg
} }
//测试代码 //测试代码
// if let tabBarItem = v2.tabBarItem as? ESTabBarItem { // if let tabBarItem = v2.tabBarItem as? ESTabBarItem {
// DispatchQueue.main.asyncAfter(deadline: .now() + 2 ) { // DispatchQueue.main.asyncAfter(deadline: .now() + 2 ) {
// tabBarItem.badgeValue = "1" // tabBarItem.badgeValue = "1"
// } // }
// } // }
} }
func tabBarController(_ tabBarController: UITabBarController, didSelect viewController: UIViewController) { func tabBarController(_ tabBarController: UITabBarController, didSelect viewController: UIViewController) {
//添加通知,才加载数据 //添加通知,才加载数据
......
...@@ -64,6 +64,7 @@ class AddImgCell: UITableViewCell { ...@@ -64,6 +64,7 @@ class AddImgCell: UITableViewCell {
if isSingle == false { if isSingle == false {
addBtn.isHidden = false addBtn.isHidden = false
scrollView?.isHidden = false scrollView?.isHidden = false
scrollView?.bounces = false
if arr.count < 3 { if arr.count < 3 {
scrollView?.contentSize = CGSize(width: arr.count*105, height: 0) scrollView?.contentSize = CGSize(width: arr.count*105, height: 0)
scrollView?.frame = CGRect(x: 15, y: CGFloat(y), width: CGFloat(arr.count)*105, height:h) scrollView?.frame = CGRect(x: 15, y: CGFloat(y), width: CGFloat(arr.count)*105, height:h)
...@@ -71,7 +72,7 @@ class AddImgCell: UITableViewCell { ...@@ -71,7 +72,7 @@ class AddImgCell: UITableViewCell {
}else if arr.count == 5 { }else if arr.count == 5 {
addBtn.isHidden = true addBtn.isHidden = true
scrollView?.contentSize = CGSize(width: arr.count*105, height: 0) scrollView?.contentSize = CGSize(width: arr.count*105, height: 0)
scrollView?.frame = CGRect(x: 15, y: CGFloat(y), width: fullScreenWidth, height:h) scrollView?.frame = CGRect(x: 15, y: CGFloat(y), width: fullScreenWidth-30, height:h)
}else{ }else{
scrollView?.contentSize = CGSize(width: arr.count*105, height: 0) scrollView?.contentSize = CGSize(width: arr.count*105, height: 0)
scrollView?.frame = CGRect(x: 15, y: CGFloat(y), width: fullScreenWidth-130, height:h) scrollView?.frame = CGRect(x: 15, y: CGFloat(y), width: fullScreenWidth-130, height:h)
......
...@@ -9,40 +9,16 @@ ...@@ -9,40 +9,16 @@
import UIKit import UIKit
class ZengZhiServicesViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource,TitleAndSelectCellDelegate,UITextViewDelegate{ class ZengZhiServicesViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource,TitleAndSelectCellDelegate,UITextViewDelegate{
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 3
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 50
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndSelect") as! TitleAndSelectCell
cell.delegate = self
cell.tag = indexPath.row
cell.titleLbl.text = titleArr[indexPath.row]
let line = UIView()
line.backgroundColor = UIColor(named: "灰色分界线")
cell.contentView.addSubview(line)
line.snp.makeConstraints { (make) in
make.bottom.right.equalTo(0)
make.left.equalTo(15)
make.height.equalTo(1)
}
return cell
}
func TitleAndSelectCellClick(content: UIButton, cell: TitleAndSelectCell) {
print(cell.tag)
for item in listView.visibleCells { //MARK: - 数据汇总提交
let cel = item as! TitleAndSelectCell
cel.selectBtn.isSelected = false
if cel == cell {
cel.selectBtn.isSelected = true
}
}
}
@IBAction func submitAction(_ sender: Any) { @IBAction func submitAction(_ sender: Any) {
print("submit") print("submit")
print(selectIdx)//0 送货 1 清真 2 污染
print(fanHuanIdx)//0 无签单 1 纸质 2 电子
print(price)//报价金额
print(commend)//评论
} }
var titleArr = ["送货入仓","清真","易污染"] var titleArr = ["送货入仓","清真","易污染"]
...@@ -59,6 +35,10 @@ class ZengZhiServicesViewController: BaseViewController,UITableViewDelegate,UITa ...@@ -59,6 +35,10 @@ class ZengZhiServicesViewController: BaseViewController,UITableViewDelegate,UITa
@IBOutlet weak var holderLbl: UILabel! @IBOutlet weak var holderLbl: UILabel!
@IBOutlet weak var listView: UITableView! @IBOutlet weak var listView: UITableView!
var selectIdx:Int?
var fanHuanIdx:Int?
var price:String = ""
var commend:String = ""
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
navbar.title = "增值服务" navbar.title = "增值服务"
...@@ -73,15 +53,39 @@ class ZengZhiServicesViewController: BaseViewController,UITableViewDelegate,UITa ...@@ -73,15 +53,39 @@ class ZengZhiServicesViewController: BaseViewController,UITableViewDelegate,UITa
listView.separatorStyle = .none listView.separatorStyle = .none
listView.register(UINib(nibName: "TitleAndSelectCell", bundle: nil), forCellReuseIdentifier: "TitleAndSelect") listView.register(UINib(nibName: "TitleAndSelectCell", bundle: nil), forCellReuseIdentifier: "TitleAndSelect")
textView.delegate = self textView.delegate = self
textView.text = commend
inputTF.addTarget(self, action: #selector(textViewEdit(sender:)), for: .allEditingEvents) inputTF.addTarget(self, action: #selector(textViewEdit(sender:)), for: .allEditingEvents)
inputTF.text = price
nBtn.isSelected = true nBtn.isSelected = true
nBtn.backgroundColor = UIColor(named: "蓝色字体颜色") nBtn.backgroundColor = UIColor(named: "蓝色字体颜色")
nBtn.layer.borderWidth = 0 nBtn.layer.borderWidth = 0
// Do any additional setup after loading the view. // Do any additional setup after loading the view.
} }
//MARK: - CELL DELEGATE
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndSelect") as! TitleAndSelectCell
cell.delegate = self
cell.tag = indexPath.row
cell.titleLbl.text = titleArr[indexPath.row]
cell.selectBtn.isSelected = false
cell.selectBtn.isUserInteractionEnabled = false
if indexPath.row == selectIdx{
cell.selectBtn.isSelected = true
}
let line = UIView()
line.backgroundColor = UIColor(named: "灰色分界线")
cell.contentView.addSubview(line)
line.snp.makeConstraints { (make) in
make.bottom.right.equalTo(0)
make.left.equalTo(15)
make.height.equalTo(1)
}
return cell
}
func textViewDidChange(_ textView: UITextView) { func textViewDidChange(_ textView: UITextView) {
commend = textView.text
if textView.text.count != 0 { if textView.text.count != 0 {
textViewHolderLbl.isHidden = true textViewHolderLbl.isHidden = true
}else{ }else{
...@@ -97,15 +101,16 @@ class ZengZhiServicesViewController: BaseViewController,UITableViewDelegate,UITa ...@@ -97,15 +101,16 @@ class ZengZhiServicesViewController: BaseViewController,UITableViewDelegate,UITa
return true return true
} }
@objc func textViewEdit(sender:UITextField){
@objc func textViewEdit(sender:UITextView){ price = sender.text!
if sender.text.count > 0 { if price.count > 0 {
holderLbl.isHidden = true holderLbl.isHidden = true
}else{ }else{
holderLbl.isHidden = false holderLbl.isHidden = false
} }
} }
@IBAction func selectAction(_ sender: UIButton) { @IBAction func selectAction(_ sender: UIButton) {
fanHuanIdx = sender.tag
if sender == nBtn{ if sender == nBtn{
if nBtn.isSelected == true { if nBtn.isSelected == true {
nBtn.isSelected = false nBtn.isSelected = false
...@@ -160,6 +165,20 @@ class ZengZhiServicesViewController: BaseViewController,UITableViewDelegate,UITa ...@@ -160,6 +165,20 @@ class ZengZhiServicesViewController: BaseViewController,UITableViewDelegate,UITa
eBtn.layer.borderWidth = 0 eBtn.layer.borderWidth = 0
} }
} }
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 3
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 50
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if indexPath.section == 0 {
if indexPath.row < 3{
selectIdx = indexPath.row
listView.reloadData()
}
}
} }
} }
...@@ -9,15 +9,7 @@ ...@@ -9,15 +9,7 @@
import UIKit import UIKit
class JiPaiFangShiViewController: BaseViewController ,SendTimeSelectViewDeleagte{ class JiPaiFangShiViewController: BaseViewController ,SendTimeSelectViewDeleagte{
func SendTimeSelectViewSubmit(date: String) {
print(date)
sendTimeView?.removeFromSuperview()
sendTimeView = nil
}
func SendTimeSelectViewClose() {
sendTimeView?.removeFromSuperview()
sendTimeView = nil
}
var sendTimeView:SendTimeSelectView? var sendTimeView:SendTimeSelectView?
@IBAction func selectTimeAction(_ sender: UIButton) { @IBAction func selectTimeAction(_ sender: UIButton) {
if sendTimeView == nil { if sendTimeView == nil {
...@@ -69,6 +61,18 @@ class JiPaiFangShiViewController: BaseViewController ,SendTimeSelectViewDeleagte ...@@ -69,6 +61,18 @@ class JiPaiFangShiViewController: BaseViewController ,SendTimeSelectViewDeleagte
masklayer.path = maskPath.cgPath masklayer.path = maskPath.cgPath
sender.layer.mask = masklayer sender.layer.mask = masklayer
} }
func SendTimeSelectViewSubmit(date: String) {
timeLbl.text = date
sendTimeView?.removeFromSuperview()
sendTimeView = nil
}
func SendTimeSelectViewClose() {
sendTimeView?.removeFromSuperview()
sendTimeView = nil
}
@IBAction func sendAction(_ sender: UIButton) { @IBAction func sendAction(_ sender: UIButton) {
if sender == PLeftBtn { if sender == PLeftBtn {
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="15702" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="15702" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/> <device id="retina6_5" orientation="portrait" appearance="light"/>
<dependencies> <dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15704"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15704"/>
<capability name="Named colors" minToolsVersion="9.0"/> <capability name="Named colors" minToolsVersion="9.0"/>
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
<rect key="frame" x="0.0" y="0.0" width="414" height="50"/> <rect key="frame" x="0.0" y="0.0" width="414" height="50"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="50" id="579-R7-5y6"/> <constraint firstAttribute="height" constant="50" id="579-R7-5y6"/>
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="50" id="P5J-yc-NWK"/>
</constraints> </constraints>
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="15"/> <fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="15"/>
<color key="textColor" name="标题字颜色"/> <color key="textColor" name="标题字颜色"/>
...@@ -43,6 +44,7 @@ ...@@ -43,6 +44,7 @@
<rect key="frame" x="0.0" y="50" width="414" height="1"/> <rect key="frame" x="0.0" y="50" width="414" height="1"/>
<color key="backgroundColor" name="灰色分界线"/> <color key="backgroundColor" name="灰色分界线"/>
<constraints> <constraints>
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="1" id="4KY-Tb-OSY"/>
<constraint firstAttribute="height" constant="1" id="atF-8h-2ur"/> <constraint firstAttribute="height" constant="1" id="atF-8h-2ur"/>
</constraints> </constraints>
</view> </view>
...@@ -50,6 +52,7 @@ ...@@ -50,6 +52,7 @@
<rect key="frame" x="0.0" y="51" width="120" height="260"/> <rect key="frame" x="0.0" y="51" width="120" height="260"/>
<color key="backgroundColor" name="搜索框背景色"/> <color key="backgroundColor" name="搜索框背景色"/>
<constraints> <constraints>
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="120" id="2Gn-Sa-GdX"/>
<constraint firstAttribute="width" constant="120" id="5Zm-SS-f0u"/> <constraint firstAttribute="width" constant="120" id="5Zm-SS-f0u"/>
</constraints> </constraints>
<connections> <connections>
...@@ -68,28 +71,29 @@ ...@@ -68,28 +71,29 @@
</subviews> </subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/> <color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<constraints> <constraints>
<constraint firstAttribute="trailing" secondItem="JWY-Hf-Cvn" secondAttribute="trailing" id="0Vp-EF-sd0"/> <constraint firstAttribute="bottom" secondItem="JWY-Hf-Cvn" secondAttribute="bottom" id="1um-sf-Mwx"/>
<constraint firstItem="Qul-rX-gAx" firstAttribute="leading" secondItem="NDY-nX-rrQ" secondAttribute="leading" id="1fY-uR-k7D"/> <constraint firstItem="JWY-Hf-Cvn" firstAttribute="top" secondItem="Qul-rX-gAx" secondAttribute="bottom" id="5gI-ef-LeK"/>
<constraint firstItem="YFX-9l-JIo" firstAttribute="leading" secondItem="NDY-nX-rrQ" secondAttribute="leading" id="1yL-EO-dGc"/> <constraint firstAttribute="trailing" secondItem="YFX-9l-JIo" secondAttribute="trailing" id="6Ed-CX-uFg"/>
<constraint firstAttribute="bottom" secondItem="QvL-x6-Nh2" secondAttribute="bottom" id="5ZZ-Pc-nyE"/> <constraint firstItem="JWY-Hf-Cvn" firstAttribute="leading" secondItem="QvL-x6-Nh2" secondAttribute="trailing" id="7SA-Dd-xeC"/>
<constraint firstItem="YFX-9l-JIo" firstAttribute="top" secondItem="NDY-nX-rrQ" secondAttribute="top" id="BYR-3j-sGK"/>
<constraint firstAttribute="bottom" secondItem="QvL-x6-Nh2" secondAttribute="bottom" id="DQI-BM-FVh"/>
<constraint firstItem="Qul-rX-gAx" firstAttribute="top" secondItem="YFX-9l-JIo" secondAttribute="bottom" id="Jlg-y7-K0j"/> <constraint firstItem="Qul-rX-gAx" firstAttribute="top" secondItem="YFX-9l-JIo" secondAttribute="bottom" id="Jlg-y7-K0j"/>
<constraint firstItem="YFX-9l-JIo" firstAttribute="top" secondItem="NDY-nX-rrQ" secondAttribute="top" id="OG5-Zp-0Z5"/> <constraint firstItem="YFX-9l-JIo" firstAttribute="leading" secondItem="NDY-nX-rrQ" secondAttribute="leading" id="QJY-Fr-iuw"/>
<constraint firstAttribute="trailing" secondItem="YFX-9l-JIo" secondAttribute="trailing" id="PXm-8u-5eA"/> <constraint firstAttribute="height" constant="311" id="VB8-iU-Ezo"/>
<constraint firstAttribute="height" constant="311" id="ekl-CL-hHJ"/> <constraint firstAttribute="trailing" secondItem="JWY-Hf-Cvn" secondAttribute="trailing" id="YM2-du-wBf"/>
<constraint firstItem="JWY-Hf-Cvn" firstAttribute="top" secondItem="Qul-rX-gAx" secondAttribute="bottom" id="elT-0f-lRU"/> <constraint firstItem="JWY-Hf-Cvn" firstAttribute="top" secondItem="Qul-rX-gAx" secondAttribute="bottom" id="elT-0f-lRU"/>
<constraint firstAttribute="bottom" secondItem="JWY-Hf-Cvn" secondAttribute="bottom" id="gOn-Sv-tbI"/> <constraint firstItem="QvL-x6-Nh2" firstAttribute="leading" secondItem="NDY-nX-rrQ" secondAttribute="leading" id="jCH-zG-kuW"/>
<constraint firstItem="Qul-rX-gAx" firstAttribute="top" secondItem="YFX-9l-JIo" secondAttribute="bottom" id="jnj-FA-BQZ"/>
<constraint firstItem="QvL-x6-Nh2" firstAttribute="top" secondItem="Qul-rX-gAx" secondAttribute="bottom" id="lqy-ZZ-FHd"/> <constraint firstItem="QvL-x6-Nh2" firstAttribute="top" secondItem="Qul-rX-gAx" secondAttribute="bottom" id="lqy-ZZ-FHd"/>
<constraint firstItem="JWY-Hf-Cvn" firstAttribute="leading" secondItem="QvL-x6-Nh2" secondAttribute="trailing" id="mqL-fT-aH2"/> <constraint firstItem="JWY-Hf-Cvn" firstAttribute="leading" secondItem="QvL-x6-Nh2" secondAttribute="trailing" id="mqL-fT-aH2"/>
<constraint firstAttribute="trailing" secondItem="Qul-rX-gAx" secondAttribute="trailing" id="nbS-UW-E2K"/> <constraint firstItem="QvL-x6-Nh2" firstAttribute="top" secondItem="Qul-rX-gAx" secondAttribute="bottom" id="qSv-5V-CBy"/>
<constraint firstItem="QvL-x6-Nh2" firstAttribute="leading" secondItem="NDY-nX-rrQ" secondAttribute="leading" id="s7H-WP-h4P"/> <constraint firstAttribute="trailing" secondItem="Qul-rX-gAx" secondAttribute="trailing" id="sGq-mB-nZ0"/>
<constraint firstItem="Qul-rX-gAx" firstAttribute="leading" secondItem="NDY-nX-rrQ" secondAttribute="leading" id="vHb-om-CPV"/>
</constraints> </constraints>
</view> </view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="QPf-cc-IOc" customClass="LGButton" customModule="LGButton"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="QPf-cc-IOc" customClass="LGButton" customModule="LGButton">
<rect key="frame" x="0.0" y="813" width="414" height="83"/> <rect key="frame" x="0.0" y="813" width="414" height="83"/>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/> <color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<constraints>
<constraint firstAttribute="height" constant="83" id="QVy-lU-nMy"/>
</constraints>
<userDefinedRuntimeAttributes> <userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="color" keyPath="gradientStartColor"> <userDefinedRuntimeAttribute type="color" keyPath="gradientStartColor">
<color key="value" name="按钮渐变色上"/> <color key="value" name="按钮渐变色上"/>
...@@ -100,7 +104,7 @@ ...@@ -100,7 +104,7 @@
<userDefinedRuntimeAttribute type="boolean" keyPath="gradientHorizontal" value="YES"/> <userDefinedRuntimeAttribute type="boolean" keyPath="gradientHorizontal" value="YES"/>
</userDefinedRuntimeAttributes> </userDefinedRuntimeAttributes>
<connections> <connections>
<action selector="submitAction:" destination="-1" eventType="valueChanged" id="paV-fh-4L7"/> <action selector="submitAction:" destination="-1" eventType="touchUpInside" id="CHn-1k-uRE"/>
</connections> </connections>
</view> </view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" usesAttributedText="YES" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Dmy-0B-RQj"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" usesAttributedText="YES" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Dmy-0B-RQj">
...@@ -122,19 +126,20 @@ ...@@ -122,19 +126,20 @@
</subviews> </subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints> <constraints>
<constraint firstItem="QPf-cc-IOc" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="3J2-Fj-V8Q"/>
<constraint firstItem="Pzj-OB-7vE" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" constant="-60" id="6RX-jF-T34"/> <constraint firstItem="Pzj-OB-7vE" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" constant="-60" id="6RX-jF-T34"/>
<constraint firstItem="Dmy-0B-RQj" firstAttribute="bottom" secondItem="vUN-kp-3ea" secondAttribute="bottom" id="BTL-Ju-jwq"/> <constraint firstItem="Dmy-0B-RQj" firstAttribute="bottom" secondItem="vUN-kp-3ea" secondAttribute="bottom" id="BTL-Ju-jwq"/>
<constraint firstItem="QPf-cc-IOc" firstAttribute="top" secondItem="NDY-nX-rrQ" secondAttribute="bottom" id="E3f-Jz-7zg"/>
<constraint firstAttribute="bottom" secondItem="Pzj-OB-7vE" secondAttribute="bottom" constant="-60" id="FOI-0h-ESL"/> <constraint firstAttribute="bottom" secondItem="Pzj-OB-7vE" secondAttribute="bottom" constant="-60" id="FOI-0h-ESL"/>
<constraint firstItem="NDY-nX-rrQ" firstAttribute="trailing" secondItem="vUN-kp-3ea" secondAttribute="trailing" id="Guv-tx-SDN"/>
<constraint firstAttribute="bottom" secondItem="QPf-cc-IOc" secondAttribute="bottom" id="JHo-EP-scP"/>
<constraint firstItem="Pzj-OB-7vE" firstAttribute="trailing" secondItem="vUN-kp-3ea" secondAttribute="trailing" id="Pai-yb-WCE"/> <constraint firstItem="Pzj-OB-7vE" firstAttribute="trailing" secondItem="vUN-kp-3ea" secondAttribute="trailing" id="Pai-yb-WCE"/>
<constraint firstItem="Dmy-0B-RQj" firstAttribute="trailing" secondItem="vUN-kp-3ea" secondAttribute="trailing" id="UdG-mf-RzW"/> <constraint firstItem="Dmy-0B-RQj" firstAttribute="trailing" secondItem="vUN-kp-3ea" secondAttribute="trailing" id="UdG-mf-RzW"/>
<constraint firstItem="NDY-nX-rrQ" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" id="Vqx-6f-jh6"/>
<constraint firstItem="Pzj-OB-7vE" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" id="Yxv-2q-Qip"/> <constraint firstItem="Pzj-OB-7vE" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" id="Yxv-2q-Qip"/>
<constraint firstItem="NDY-nX-rrQ" firstAttribute="trailing" secondItem="vUN-kp-3ea" secondAttribute="trailing" id="fXf-NH-dbm"/> <constraint firstAttribute="trailing" secondItem="QPf-cc-IOc" secondAttribute="trailing" id="d2c-5I-oRh"/>
<constraint firstItem="Dmy-0B-RQj" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" id="mfD-mV-IdW"/> <constraint firstItem="Dmy-0B-RQj" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" id="mfD-mV-IdW"/>
<constraint firstItem="QPf-cc-IOc" firstAttribute="trailing" secondItem="vUN-kp-3ea" secondAttribute="trailing" id="qgh-vO-5VB"/> <constraint firstItem="QPf-cc-IOc" firstAttribute="top" secondItem="NDY-nX-rrQ" secondAttribute="bottom" id="rd0-MU-stN"/>
<constraint firstAttribute="bottom" secondItem="QPf-cc-IOc" secondAttribute="bottom" id="sCY-pY-Dcu"/> <constraint firstItem="QPf-cc-IOc" firstAttribute="top" secondItem="Dmy-0B-RQj" secondAttribute="top" id="wNf-pW-PJd"/>
<constraint firstItem="QPf-cc-IOc" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" id="uMi-Hd-vIt"/>
<constraint firstItem="NDY-nX-rrQ" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" id="wUR-i3-vDQ"/>
</constraints> </constraints>
<viewLayoutGuide key="safeArea" id="vUN-kp-3ea"/> <viewLayoutGuide key="safeArea" id="vUN-kp-3ea"/>
<point key="canvasLocation" x="131.8840579710145" y="121.875"/> <point key="canvasLocation" x="131.8840579710145" y="121.875"/>
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16096" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="15702" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/> <device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies> <dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16086"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15704"/>
<capability name="Named colors" minToolsVersion="9.0"/> <capability name="Named colors" minToolsVersion="9.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/> <capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
......
...@@ -8,13 +8,20 @@ ...@@ -8,13 +8,20 @@
import UIKit import UIKit
import LGButton import LGButton
import Photos
class XinZengPinPaiViewController: BaseViewController,UITableViewDataSource,UITableViewDelegate,TitleAndBtnCellDelegate { class XinZengPinPaiViewController: BaseViewController,UITableViewDataSource,UITableViewDelegate,TitleAndBtnCellDelegate,TitleAndTFCellDelegate,TilteAndTextViewCellDelegate{
let titleArr = ["品牌名称","品牌图标","站点地址","品牌描述"] let titleArr = ["品牌名称","品牌图标","站点地址","品牌描述"]
let holderArr = ["请输入品牌名称","0","请输入站点地址如:www.gelifood.com","0"] let holderArr = ["请输入品牌名称","0","请输入站点地址如:www.gelifood.com","0"]
@IBOutlet weak var btnTitleLbl: UILabel! @IBOutlet weak var btnTitleLbl: UILabel!
@IBOutlet weak var listView: UITableView! @IBOutlet weak var listView: UITableView!
var logoIcon:UIImage?//图片
var pinPaiName:String?//品牌名字
var pinPaiUrl:String?//品牌连接
var commend:String?//品牌描述
var navTitle:String? var navTitle:String?
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
...@@ -23,60 +30,106 @@ class XinZengPinPaiViewController: BaseViewController,UITableViewDataSource,UITa ...@@ -23,60 +30,106 @@ class XinZengPinPaiViewController: BaseViewController,UITableViewDataSource,UITa
navbar.rightTitle = "删除" navbar.rightTitle = "删除"
} }
self.view.addSubview(navbar) self.view.addSubview(navbar)
SetTopFrameView(view: listView, btmView: btnTitleLbl)
listView.snp.makeConstraints { (make) in
make.top.equalTo(NavCGRect.height)
make.left.right.equalTo(0)
make.height.equalTo(323.5*glscale)
}
listView.separatorStyle = .none listView.separatorStyle = .none
listView.isScrollEnabled = false
listView.register(UINib(nibName: "TitleAndTFCell", bundle: nil), forCellReuseIdentifier: "TitleAndTF") listView.register(UINib(nibName: "TitleAndTFCell", bundle: nil), forCellReuseIdentifier: "TitleAndTF")
listView.register(UINib(nibName: "TitleAndBtnCell", bundle: nil), forCellReuseIdentifier: "TitleAndBtn") listView.register(UINib(nibName: "TitleAndBtnCell", bundle: nil), forCellReuseIdentifier: "TitleAndBtn")
listView.register(UINib(nibName: "TilteAndTextViewCell", bundle: nil), forCellReuseIdentifier: "TilteAndTextView") listView.register(UINib(nibName: "TilteAndTextViewCell", bundle: nil), forCellReuseIdentifier: "TilteAndTextView")
// Do any additional setup after loading the view. // Do any additional setup after loading the view.
} }
//MARK: - 删除
func rightBtnClick() { func rightBtnClick() {
} }
//MARK: - 提交
@IBAction func btnAction(_ sender: Any) { @IBAction func btnAction(_ sender: Any) {
print("提交") print("提交")
print(pinPaiName)//名字
print(pinPaiUrl)//链接
print(commend)//描述
print(logoIcon)//图片
} }
//MARK: - cell delegate //MARK: - cell delegate
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
if indexPath.row == 3 {
return 173.5*glscale
}
return 49*glscale
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return titleArr.count
}
func btnClick(content: String, cell: TitleAndBtnCell) {
print(content)
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
switch indexPath.row { switch indexPath.row {
case 0,2: case 0,2:
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndTF") as! TitleAndTFCell let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndTF") as! TitleAndTFCell
cell.nameLbl.text = titleArr[indexPath.row] cell.nameLbl.text = titleArr[indexPath.row]
cell.textTF.placeholder = holderArr[indexPath.row] cell.textTF.placeholder = holderArr[indexPath.row]
cell.delegate = self
cell.tag = indexPath.row
switch indexPath.row {
case 0:
cell.textTF.text = pinPaiName
break
case 2:
cell.textTF.text = pinPaiUrl
break
default:
break
}
return cell return cell
case 1: case 1:
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndBtn") as! TitleAndBtnCell let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndBtn") as! TitleAndBtnCell
cell.nameLbl.text = titleArr[indexPath.row] cell.nameLbl.text = titleArr[indexPath.row]
cell.contentLbl.text = "上传图片" cell.contentLbl.text = "上传图片"
cell.delegate = self cell.delegate = self
if logoIcon != nil {
cell.imgView.image = logoIcon
cell.imgView.isHidden = false
cell.contentLbl.isHidden = true
}
return cell return cell
default: default:
let cell = tableView.dequeueReusableCell(withIdentifier: "TilteAndTextView") as! TilteAndTextViewCell let cell = tableView.dequeueReusableCell(withIdentifier: "TilteAndTextView") as! TilteAndTextViewCell
cell.titleLbl.text = titleArr[indexPath.row] cell.titleLbl.text = titleArr[indexPath.row]
cell.holderLbl.text = "简述品牌体征。" cell.holderLbl.text = "简述品牌体征。"
cell.textView.text = commend
cell.delegate = self
return cell return cell
} }
} }
func textFieldContent(content: String, cell: TitleAndTFCell) {
if cell.tag == 0 {
pinPaiName = content
}
pinPaiUrl = content
}
func TilteAndTextViewCellResponseStr(str: String, cell: TilteAndTextViewCell) {
commend = str
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
if indexPath.row == 3 {
return 173.5*glscale
}
if indexPath.row == 1 {
if logoIcon != nil {
return 100
}
}
return 49*glscale
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return titleArr.count
}
func btnClick(content: String, cell: TitleAndBtnCell) {
_ = self.presentHGImagePicker(maxSelected:1) { (assets) in
//结果处理
print("共选择了\(assets.count)张图片,分别如下:")
let option = PHImageRequestOptions()
option.isSynchronous = true
option.isNetworkAccessAllowed = true
for asset in assets {
PHImageManager.default().requestImage(for: asset, targetSize: PHImageManagerMaximumSize , contentMode: .default , options: option, resultHandler: { (image, _: [AnyHashable : Any]?) in
// print("上传图片==\(image)")
self.logoIcon = image
})
}
self.listView.reloadData()
}
}
} }
...@@ -21,15 +21,8 @@ ...@@ -21,15 +21,8 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews> <subviews>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="rtS-FJ-o0e"> <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="rtS-FJ-o0e">
<rect key="frame" x="0.0" y="44" width="414" height="323.5"/> <rect key="frame" x="0.0" y="44" width="414" height="769"/>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/> <color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<constraints>
<constraint firstAttribute="height" constant="323.5" id="Iz2-Nb-wK2">
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="isAdaptateScreen" value="YES"/>
</userDefinedRuntimeAttributes>
</constraint>
</constraints>
<connections> <connections>
<outlet property="dataSource" destination="-1" id="fvT-jc-s0a"/> <outlet property="dataSource" destination="-1" id="fvT-jc-s0a"/>
<outlet property="delegate" destination="-1" id="vyl-Yl-QqR"/> <outlet property="delegate" destination="-1" id="vyl-Yl-QqR"/>
...@@ -66,13 +59,14 @@ ...@@ -66,13 +59,14 @@
<constraint firstAttribute="bottom" secondItem="bjw-OI-1k0" secondAttribute="bottom" id="4Tc-15-KAu"/> <constraint firstAttribute="bottom" secondItem="bjw-OI-1k0" secondAttribute="bottom" id="4Tc-15-KAu"/>
<constraint firstItem="bjw-OI-1k0" firstAttribute="top" secondItem="Hmi-sA-ntB" secondAttribute="top" id="Hrg-kQ-aXC"/> <constraint firstItem="bjw-OI-1k0" firstAttribute="top" secondItem="Hmi-sA-ntB" secondAttribute="top" id="Hrg-kQ-aXC"/>
<constraint firstAttribute="trailing" secondItem="bjw-OI-1k0" secondAttribute="trailing" id="JOQ-es-5OE"/> <constraint firstAttribute="trailing" secondItem="bjw-OI-1k0" secondAttribute="trailing" id="JOQ-es-5OE"/>
<constraint firstItem="rtS-FJ-o0e" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" id="Mdp-wM-HJg"/> <constraint firstItem="rtS-FJ-o0e" firstAttribute="trailing" secondItem="fnl-2z-Ty3" secondAttribute="trailing" id="PEH-9j-tXD"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="rtS-FJ-o0e" secondAttribute="trailing" id="QSH-9B-9Y9"/> <constraint firstItem="rtS-FJ-o0e" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" id="Rkf-LH-f3e"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="Hmi-sA-ntB" secondAttribute="trailing" id="UaX-7R-TsW"/> <constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="Hmi-sA-ntB" secondAttribute="trailing" id="UaX-7R-TsW"/>
<constraint firstItem="rtS-FJ-o0e" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="crK-Dr-MCm"/>
<constraint firstItem="bjw-OI-1k0" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="eZX-P8-KwQ"/> <constraint firstItem="bjw-OI-1k0" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="eZX-P8-KwQ"/>
<constraint firstItem="Hmi-sA-ntB" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="qdx-UJ-DtF"/> <constraint firstItem="Hmi-sA-ntB" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="qdx-UJ-DtF"/>
<constraint firstItem="rtS-FJ-o0e" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="tg2-Os-l99"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="bottom" secondItem="Hmi-sA-ntB" secondAttribute="bottom" id="yeB-lK-67v"/> <constraint firstItem="fnl-2z-Ty3" firstAttribute="bottom" secondItem="Hmi-sA-ntB" secondAttribute="bottom" id="yeB-lK-67v"/>
<constraint firstItem="bjw-OI-1k0" firstAttribute="top" secondItem="rtS-FJ-o0e" secondAttribute="bottom" id="zj7-F2-9E2"/>
</constraints> </constraints>
<viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/> <viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/>
<point key="canvasLocation" x="131.8840579710145" y="121.875"/> <point key="canvasLocation" x="131.8840579710145" y="121.875"/>
......
...@@ -12,8 +12,8 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa ...@@ -12,8 +12,8 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
var orderId:Int? //订单编号 var orderId:Int? //订单编号
var isYuShou:Bool = false //是否预售 var isYuShou:Bool = false //是否预售
var dataArr:NSArray = ["a","b"] //订单产品数据 var dataArr:Array<Any> = ["a","b"] //订单产品数据
var btmBtnsTitleArr:NSArray = ["修改价格","打印","确认订单"]//底栏按钮数据 var btmBtnsTitleArr:Array<Any> = ["修改价格","打印","确认订单"]//底栏按钮数据
let yuShouTitleArr = ["定金:","尾款:","商品合计:","物流费用:","其它费用:"] let yuShouTitleArr = ["定金:","尾款:","商品合计:","物流费用:","其它费用:"]
let nonYuShouTitleArr = ["商品合计:","物流费用:","其它费用:"] let nonYuShouTitleArr = ["商品合计:","物流费用:","其它费用:"]
......
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