Commit 04ae3556 authored by lujunye's avatar lujunye

代客下单购物

parent 22f558e3
{
"info" : {
"version" : 1,
"author" : "xcode"
},
"colors" : [
{
"idiom" : "universal",
"color" : {
"color-space" : "srgb",
"components" : {
"red" : "0.600",
"alpha" : "1.000",
"blue" : "0.600",
"green" : "0.600"
}
}
}
]
}
\ No newline at end of file
{
"properties" : {
"localizable" : true
},
"info" : {
"version" : 1,
"author" : "xcode"
......
......@@ -37,14 +37,14 @@ class GLAlertSelectView: UIView,UITableViewDelegate,UITableViewDataSource,TitleA
let tbvH = CGFloat(dataArr.count * 49)*glscale
if (titleLbl.text?.contains("库位"))!{
UIView.animate(withDuration: 0.5) {
self.btmVHeight.constant = 195.5*glscale+tbvH
self.btmVHeight.constant = 146.5*glscale+tbvH
if self.btmVHeight.constant > fullScreenHeight*0.75 {
self.btmVHeight.constant = fullScreenHeight*0.75
}
}
}else{
UIView.animate(withDuration: 0.5) {
self.btmVHeight.constant = 100*glscale+tbvH
self.btmVHeight.constant = 51*glscale+tbvH
}
}
}
......@@ -121,7 +121,7 @@ class GLAlertSelectView: UIView,UITableViewDelegate,UITableViewDataSource,TitleA
btmVHeight.constant = 0
selectTbv.isScrollEnabled = true
inputDataView.addSubview(getInputView())
ipdVHeight.constant = 95.5
ipdVHeight.constant = 95.5*glscale
}
//MARK: - cell delegate
......@@ -300,7 +300,7 @@ class GLAlertSelectView: UIView,UITableViewDelegate,UITableViewDataSource,TitleA
if (inputTextTF?.text!.count)! > 0 {
dataArr.append(inputTextTF!.text!)
let tbvH = CGFloat(dataArr.count)*49.0*glscale
self.btmVHeight.constant = 195.5*glscale+tbvH
self.btmVHeight.constant = 146.5*glscale+tbvH
if self.btmVHeight.constant > fullScreenHeight*0.75 {
self.btmVHeight.constant = fullScreenHeight*0.75
}
......
......@@ -89,7 +89,7 @@
</objects>
<resources>
<namedColor name="按钮渐变色下,字体颜色">
<color red="0.27450980392156865" green="0.5607843137254902" blue="0.88627450980392153" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.27843137254901962" green="0.5607843137254902" blue="0.8901960784313725" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="灰色分界线">
<color red="0.92941176470588238" green="0.92941176470588238" blue="0.92941176470588238" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
......
......@@ -107,7 +107,7 @@
</objects>
<resources>
<image name="bianji" width="17" height="16.5"/>
<image name="shanchu" width="17" height="17.5"/>
<image name="shanchu" width="15" height="15"/>
<namedColor name="标题字颜色">
<color red="0.18000000715255737" green="0.18000000715255737" blue="0.18000000715255737" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
......
<?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"/>
<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="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
......
......@@ -211,9 +211,6 @@
<namedColor name="标题字颜色">
<color red="0.18000000715255737" green="0.18000000715255737" blue="0.18000000715255737" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="标题字颜色">
<color red="0.18000000715255737" green="0.18000000715255737" blue="0.18000000715255737" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="灰色字体颜色">
<color red="0.40000000596046448" green="0.40000000596046448" blue="0.40000000596046448" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
......
//
// DaiKeXiaDanFooterView.swift
// GeliBusinessPlatform
//
// Created by junye lu on 2020/4/27.
// Copyright © 2020 junye lu. All rights reserved.
//
import UIKit
@objc protocol DaiKeXiaDanFooterViewDelegate {
@objc optional func addAction()
}
class DaiKeXiaDanFooterView: UIView {
var contentView:UIView!
@IBOutlet weak var topView: UIView!
var delegate:DaiKeXiaDanFooterViewDelegate?
@IBAction func btnClick(_ sender: Any) {
delegate?.addAction!()
}
@IBOutlet weak var topViewHeight: NSLayoutConstraint!
@IBOutlet weak var priceLbl: UILabel!
@IBOutlet weak var countLbl: NSLayoutConstraint!
//初始化时将xib中的view添加进来
override init(frame: CGRect) {
super.init(frame: frame)
contentView = loadViewFromNib()
addSubview(contentView)
contentView.snp.makeConstraints { (make) in
make.left.top.right.bottom.equalToSuperview()
}
}
// /初始化时将xib中的view添加进来
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
contentView = loadViewFromNib()
addSubview(contentView)
contentView.snp.makeConstraints { (make) in
make.left.top.right.bottom.equalToSuperview()
}
}
//加载xib
func loadViewFromNib() -> UIView {
let className = type(of: self)
let bundle = Bundle(for: className)
let name = NSStringFromClass(className).components(separatedBy: ".").last
let nib = UINib(nibName: name!, bundle: bundle)
let view = nib.instantiate(withOwner: self, options: nil).first as! UIView
return view
}
}
......@@ -10,8 +10,17 @@ import UIKit
class DaiKeXiaDanGouWuCell: UITableViewCell {
@IBOutlet weak var totalPriceLbl: UILabel!
@IBOutlet weak var priceLbl: UILabel!
@IBOutlet weak var detailLbl: UILabel!
@IBOutlet weak var titleLbl: UILabel!
@IBAction func delAction(_ sender: Any) {
}
@IBOutlet weak var imgView: UIImageView!
override func awakeFromNib() {
super.awakeFromNib()
self.selectionStyle = .none
// Initialization code
}
......
......@@ -8,15 +8,148 @@
import UIKit
class DaiKeXiaDanGouWuViewController: BaseViewController {
class DaiKeXiaDanGouWuViewController: BaseViewController,UITableViewDataSource,UITableViewDelegate,DaiKeXiaDanFooterViewDelegate{
let p3Arr = ["支付状态","支付方式","提货方式","出货状态","运费","其他费用"]
var footerView:DaiKeXiaDanFooterView?
var itemArr = NSMutableArray()
@IBAction func submitAction(_ sender: Any) {
}
@IBOutlet weak var listView: UITableView!
@IBOutlet weak var btmView: UILabel!
override func viewDidLoad() {
super.viewDidLoad()
navbar.title = "代客下单"
self.view.addSubview(navbar)
//TitleAndBtnCell TitleAndTFCell
listView.snp.makeConstraints { (make) in
make.top.equalTo(NavCGRect.height)
make.left.right.equalTo(0)
make.bottom.equalTo(btmView.snp_top)
}
listView.separatorStyle = .none
listView.register(UINib(nibName: "TitleAndBtnCell", bundle: nil), forCellReuseIdentifier: "TitleAndBtnCell")
listView.register(UINib(nibName: "TitleAndTFCell", bundle: nil), forCellReuseIdentifier: "TitleAndTFCell")
listView.register(UINib(nibName: "DaiKeXiaDanGouWuCell", bundle: nil), forCellReuseIdentifier: "DaiKeXiaDanGouWuCell")
//TitleAndBtnCell TitleAndTFCell
// Do any additional setup after loading the view.
}
@objc func addProductAction(){
print("添加商品")
}
//MARK: - cell delegate
func addAction() {
itemArr.add("0")
UIView.performWithoutAnimation {
let set = NSIndexSet(index: 1)
listView.reloadSections(set as IndexSet, with: .none)
}
}
//footer
func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
if section == 1{
if itemArr.count == 0 {
return 142
}
return 220
}
return 10
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
if section == 1{//220 142
let view = DaiKeXiaDanFooterView(frame: CGRect(x: 0, y: 0, width: fullScreenWidth, height: 220))
view.topView.isHidden = false
if itemArr.count == 0 {
view.topView.isHidden = true
view.topViewHeight.constant = 0.01
}
view.delegate = self
footerView = view
return footerView
}
let view = UIView(frame: CGRect(x: 0, y: 0, width: fullScreenWidth, height: 10))
view.backgroundColor = UIColor(named: "app底色")
return view
}
//header
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
if section == 1 {
let view = UIView(frame: CGRect(x: 0, y: 0, width: fullScreenWidth, height: 39))
view.backgroundColor = UIColor.white
let lbl = UILabel()
lbl.text = "商品清单"
lbl.textColor = UIColor(named: "标题字颜色")
lbl.font = UIFont.boldSystemFont(ofSize: 15)
view.addSubview(lbl)
lbl.snp.makeConstraints { (make) in
make.bottom.right.equalTo(0)
make.left.equalTo(15)
}
return view
}
return UIView()
}
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
if section == 1 {
return 39
}
return 0.01
}
func numberOfSections(in tableView: UITableView) -> Int {
return 3
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
switch section {
case 0:return 2
case 1:return itemArr.count
default:return 6
}
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
if indexPath.section == 1 {
return 120
}
return 49
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
switch indexPath.section {
case 0:
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndBtnCell") as! TitleAndBtnCell
cell.nameLbl.text = "客户:"
if indexPath.row == 1 {
cell.nameLbl.text = "订单类型:"
}
return cell
case 1:
let cell = tableView.dequeueReusableCell(withIdentifier: "DaiKeXiaDanGouWuCell") as! DaiKeXiaDanGouWuCell
return cell
default:
if indexPath.row < 4 {
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndBtnCell") as! TitleAndBtnCell
cell.nameLbl.text = p3Arr[indexPath.row]
return cell
}
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndTFCell") as! TitleAndTFCell
cell.nameLbl.text = p3Arr[indexPath.row]
cell.textTF.snp.makeConstraints { (make) in
make.centerY.equalTo(cell.snp_centerY)
make.right.equalTo(-15)
make.width.equalTo(95)
make.height.equalTo(32)
}
cell.textTF.layer.cornerRadius = 3
cell.textTF.layer.masksToBounds = true
cell.textTF.layer.borderWidth = 1
cell.textTF.layer.borderColor = UIColor(named: "灰色字体颜色")?.cgColor
cell.textTF.placeholder = "请输入运费"
if indexPath.row == 5 {
cell.textTF.placeholder = "请输入费用"
}
cell.textTF.textAlignment = .center
return cell
}
}
}
......@@ -10,6 +10,8 @@
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="DaiKeXiaDanGouWuViewController" customModule="GeliBusinessPlatform" customModuleProvider="target">
<connections>
<outlet property="btmView" destination="Tww-Di-Bao" id="sc1-iw-raM"/>
<outlet property="listView" destination="7kx-vF-yfW" id="ICi-ue-tem"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
</connections>
</placeholder>
......@@ -30,6 +32,9 @@
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="boolean" keyPath="gradientHorizontal" value="YES"/>
</userDefinedRuntimeAttributes>
<connections>
<action selector="submitAction:" destination="-1" eventType="touchUpInside" id="Iyz-vs-RtO"/>
</connections>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" usesAttributedText="YES" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Tww-Di-Bao">
<rect key="frame" x="0.0" y="813" width="414" height="49"/>
......@@ -49,7 +54,7 @@
</label>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="7kx-vF-yfW">
<rect key="frame" x="0.0" y="44" width="414" height="769"/>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<color key="backgroundColor" name="app底色"/>
<connections>
<outlet property="dataSource" destination="-1" id="615-RE-zVt"/>
<outlet property="delegate" destination="-1" id="wfr-0B-yUN"/>
......@@ -75,11 +80,14 @@
</view>
</objects>
<resources>
<namedColor name="app底色">
<color red="0.94509803921568625" green="0.94509803921568625" blue="0.94509803921568625" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="按钮渐变色上">
<color red="0.3880000114440918" green="0.62400001287460327" blue="0.90200001001358032" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="按钮渐变色下,字体颜色">
<color red="0.27450980392156865" green="0.5607843137254902" blue="0.88627450980392153" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.27843137254901962" green="0.5607843137254902" blue="0.8901960784313725" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="白色背景色">
<color red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
......
......@@ -204,7 +204,7 @@
<color red="0.94509803921568625" green="0.94509803921568625" blue="0.94509803921568625" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="按钮渐变色下,字体颜色">
<color red="0.27450980392156865" green="0.5607843137254902" blue="0.88627450980392153" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.27843137254901962" green="0.5607843137254902" blue="0.8901960784313725" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="标题字颜色">
<color red="0.18000000715255737" green="0.18000000715255737" blue="0.18000000715255737" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
......
//
// WLGZCell.swift
// GeliBusinessPlatform
//
// Created by junye lu on 2020/4/27.
// Copyright © 2020 junye lu. All rights reserved.
//
import UIKit
class WLGZCell: UITableViewCell {
@IBOutlet weak var contentLbl: UILabel!
@IBOutlet weak var firstLbl: UILabel!
@IBOutlet weak var bottomLine: UIView!
@IBOutlet weak var topLine: UIView!
@IBOutlet weak var timeLbl: UILabel!
@IBOutlet weak var dateLbl: UILabel!
override func awakeFromNib() {
super.awakeFromNib()
self.selectionStyle = .none
// Initialization code
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
}
This diff is collapsed.
//
// WuLiuGenZongViewController.swift
// GeliBusinessPlatform
//
// Created by junye lu on 2020/4/27.
// Copyright © 2020 junye lu. All rights reserved.
//
import UIKit
class WuLiuGenZongViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource {
var dataArr:Array<Any>?
@IBOutlet weak var listView: UITableView!
override func viewDidLoad() {
super.viewDidLoad()
navbar.title = "物流跟踪"
self.view.addSubview(navbar)
listView.separatorStyle = .none
listView.snp.makeConstraints { (make) in
make.top.equalTo(NavCGRect.height)
make.left.right.bottom.equalTo(0)
}
listView.register(UINib(nibName: "WLGZCell", bundle: nil), forCellReuseIdentifier: "WLGZCell")
listView.register(UINib(nibName: "YunDanLieBiaoCell", bundle: nil), forCellReuseIdentifier: "YunDanLieBiaoCell")
}
//cell
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
if indexPath.section == 0 {
return 227
}
return 70
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int{
if section == 0 {
return 1
}
// return dataArr?.count
return 3
}
func numberOfSections(in tableView: UITableView) -> Int {
return 2
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if indexPath.section == 0 {
let cell = tableView.dequeueReusableCell(withIdentifier: "YunDanLieBiaoCell") as! YunDanLieBiaoCell
return cell
}
let cell = tableView.dequeueReusableCell(withIdentifier: "WLGZCell") as! WLGZCell
if indexPath.row == 0 {
cell.topLine.isHidden = true
cell.firstLbl.isHidden = false
}
// if indexPath.row == dataArr!.count-1 {
if indexPath.row == 2{
cell.bottomLine.isHidden = true
}
return cell
}
}
<?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">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15704"/>
<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"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="WuLiuGenZongViewController" customModule="GeliBusinessPlatform" customModuleProvider="target">
<connections>
<outlet property="listView" destination="Mtf-gn-QCm" id="BkK-qU-jvL"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="Mtf-gn-QCm">
<rect key="frame" x="0.0" y="44" width="414" height="818"/>
<color key="backgroundColor" name="app底色"/>
<connections>
<outlet property="dataSource" destination="-1" id="ohN-F9-Cls"/>
<outlet property="delegate" destination="-1" id="fJG-z8-rmC"/>
</connections>
</tableView>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="Mtf-gn-QCm" secondAttribute="trailing" id="W4A-3j-dBW"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="bottom" secondItem="Mtf-gn-QCm" secondAttribute="bottom" id="aQs-sa-ll5"/>
<constraint firstItem="Mtf-gn-QCm" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="jaA-DP-kjP"/>
<constraint firstItem="Mtf-gn-QCm" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" id="rST-z5-86K"/>
</constraints>
<viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/>
<point key="canvasLocation" x="132" y="122"/>
</view>
</objects>
<resources>
<namedColor name="app底色">
<color red="0.94509803921568625" green="0.94509803921568625" blue="0.94509803921568625" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
</resources>
</document>
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