Commit 17b7bec2 authored by lujunye's avatar lujunye

代客下单购物逻辑补充

parent 4341ff50
......@@ -198,6 +198,8 @@
E0A409D524640B8300CFF109 /* DZGLViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = E0A409D324640B8300CFF109 /* DZGLViewController.xib */; };
E0A7548A244A8F0F00A84B67 /* CheckWareHourseViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0A75488244A8F0F00A84B67 /* CheckWareHourseViewController.swift */; };
E0A7548B244A8F0F00A84B67 /* CheckWareHourseViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = E0A75489244A8F0F00A84B67 /* CheckWareHourseViewController.xib */; };
E0B5307E247266F400FFCC15 /* DKXDAdrCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0B5307C247266F400FFCC15 /* DKXDAdrCell.swift */; };
E0B5307F247266F400FFCC15 /* DKXDAdrCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = E0B5307D247266F400FFCC15 /* DKXDAdrCell.xib */; };
E0B6036E244D376900A56B38 /* KuWeiCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0B6036C244D376900A56B38 /* KuWeiCell.swift */; };
E0B6036F244D376900A56B38 /* KuWeiCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = E0B6036D244D376900A56B38 /* KuWeiCell.xib */; };
E0B9461E24566B3100FBEC9A /* TitleAndTFAndBtnCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0B9461C24566B3100FBEC9A /* TitleAndTFAndBtnCell.swift */; };
......@@ -672,6 +674,8 @@
E0A409D324640B8300CFF109 /* DZGLViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = DZGLViewController.xib; sourceTree = "<group>"; };
E0A75488244A8F0F00A84B67 /* CheckWareHourseViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CheckWareHourseViewController.swift; sourceTree = "<group>"; };
E0A75489244A8F0F00A84B67 /* CheckWareHourseViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CheckWareHourseViewController.xib; sourceTree = "<group>"; };
E0B5307C247266F400FFCC15 /* DKXDAdrCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DKXDAdrCell.swift; sourceTree = "<group>"; };
E0B5307D247266F400FFCC15 /* DKXDAdrCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = DKXDAdrCell.xib; sourceTree = "<group>"; };
E0B6036C244D376900A56B38 /* KuWeiCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KuWeiCell.swift; sourceTree = "<group>"; };
E0B6036D244D376900A56B38 /* KuWeiCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = KuWeiCell.xib; sourceTree = "<group>"; };
E0B9461C24566B3100FBEC9A /* TitleAndTFAndBtnCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TitleAndTFAndBtnCell.swift; sourceTree = "<group>"; };
......@@ -1872,6 +1876,8 @@
E0E341E9246E95EE0060AC20 /* PingLunCell.xib */,
E0228BAE246FDA9A005812FA /* TitleAndLblCell.swift */,
E0228BAF246FDA9A005812FA /* TitleAndLblCell.xib */,
E0B5307C247266F400FFCC15 /* DKXDAdrCell.swift */,
E0B5307D247266F400FFCC15 /* DKXDAdrCell.xib */,
);
path = Cell;
sourceTree = "<group>";
......@@ -2430,6 +2436,7 @@
E09B03B72445B85A00211A51 /* LoginViewController.xib in Resources */,
F96E9D61246657B500B5B94A /* HGImage.storyboard in Resources */,
E09F4C9E2452BEBB00BE033D /* JiPaiFangShiViewController.xib in Resources */,
E0B5307F247266F400FFCC15 /* DKXDAdrCell.xib in Resources */,
E0A409D12464041200CFF109 /* ThirdCell.xib in Resources */,
E09B03C12445B96500211A51 /* FgPassViewController.xib in Resources */,
E06524EE2458008900CA22E2 /* RuKuViewController.xib in Resources */,
......@@ -2659,6 +2666,7 @@
E0228BB0246FDA9A005812FA /* TitleAndLblCell.swift in Sources */,
F950FDA92451613500C40530 /* GetMobileModel.swift in Sources */,
F94A314724624E9500FEC38E /* GetGelipayInfoModel.swift in Sources */,
E0B5307E247266F400FFCC15 /* DKXDAdrCell.swift in Sources */,
E0B94623245671E100FBEC9A /* DaiKeXiaDanGouWuViewController.swift in Sources */,
E0A320C52456D01300AF321C /* DaiKeXiaDanFooterView.swift in Sources */,
E0336DD5244EC40000380BE9 /* CreatNewSpecsViewController.swift in Sources */,
......
//
// DKXDAdrCell.swift
// GeliBusinessPlatform
//
// Created by junye lu on 2020/5/18.
// Copyright © 2020 junye lu. All rights reserved.
//
import UIKit
class DKXDAdrCell: UITableViewCell {
@IBOutlet weak var adrLbl: UILabel!
@IBOutlet weak var contentLbl: UILabel!
@IBOutlet weak var nameLbl: UILabel!
@IBOutlet weak var status1: UILabel!
@IBOutlet weak var status2: 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.
......@@ -9,7 +9,6 @@
import UIKit
@objc protocol XuanZeShangPinCellDelegate {
@objc optional func XuanZeShangPinCellBtnClick(index:IndexPath)
@objc optional func XuanZeShangPinCellBtnADClick(sender:UIButton)
}
class XuanZeShangPinCell: UITableViewCell {
@IBOutlet weak var iconImg: UIImageView!
......@@ -22,7 +21,14 @@ class XuanZeShangPinCell: UITableViewCell {
delegate?.XuanZeShangPinCellBtnClick!(index:idx!)
}
@IBAction func addOrDelAction(_ sender: UIButton) {
delegate?.XuanZeShangPinCellBtnADClick?(sender: sender)
let str = countTF.text as! NSString
if sender.tag == 0 {//加
countTF.text = "\(str.integerValue + 1)"
}else {
if str.integerValue > 0 {
countTF.text = "\(str.integerValue - 1)"
}
}
}
@IBOutlet weak var priceTF: UITextField!
@IBOutlet weak var countTF: UITextField!
......
......@@ -7,9 +7,11 @@
//
import UIKit
protocol DaiKeXiaDanGouWuCellDelegate {
func DaiKeXiaDanGouWuCellDelAction(cell:DaiKeXiaDanGouWuCell)
}
class DaiKeXiaDanGouWuCell: UITableViewCell {
var delegate:DaiKeXiaDanGouWuCellDelegate?
@IBOutlet weak var changeBtn: UIButton!
@IBOutlet weak var btmLIneWidth: NSLayoutConstraint!
@IBOutlet weak var detailLbl2: UILabel!
......@@ -20,6 +22,7 @@ class DaiKeXiaDanGouWuCell: UITableViewCell {
@IBOutlet weak var detailLbl: UILabel!
@IBOutlet weak var titleLbl: UILabel!
@IBAction func delAction(_ sender: Any) {
delegate?.DaiKeXiaDanGouWuCellDelAction(cell: self)
}
@IBOutlet weak var imgView: UIImageView!
override func awakeFromNib() {
......
......@@ -52,7 +52,7 @@
</attributedString>
<nil key="highlightedColor"/>
</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">
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" 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" name="app底色"/>
<connections>
......
......@@ -8,18 +8,36 @@
import UIKit
protocol XuanZeShangPinViewControllerDelegate {
func XuanZeShangPinViewControllerSubmitAction(datas:Array<Any>)
func XuanZeShangPinViewControllerYuShou(YuShouData:String)
}
class XuanZeShangPinViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource,XuanZeShangPinCellDelegate,UISearchBarDelegate,SearchBarViewDelegate{
var searchV : SearchBarView? = nil
var delegate:XuanZeShangPinViewControllerDelegate?
//XuanZeShangPinCell
@IBAction func submitAction(_ sender: Any) {
print("submit")
if isYuShou {
delegate?.XuanZeShangPinViewControllerYuShou(YuShouData: "abc")
}else{
delegate?.XuanZeShangPinViewControllerSubmitAction(datas: selectIdxArr)
}
self.navigationController?.popViewController(animated: true)
}
var idx:IndexPath?
@IBOutlet weak var btmLbl: UILabel!
@IBOutlet weak var listView: UITableView!
@IBOutlet weak var topView: UIView!
var idx:IndexPath?
//是否预售
var isYuShou = false
var datas:Array<Any> = []//数据
var selectIdxArr:Array<IndexPath> = []
override func viewDidLoad() {
super.viewDidLoad()
navbar.title = "选择商品"
......@@ -62,14 +80,27 @@ class XuanZeShangPinViewController: BaseViewController,UITableViewDelegate,UITab
let cell = tableView.dequeueReusableCell(withIdentifier: "XuanZeShangPinCell") as! XuanZeShangPinCell
cell.delegate = self
cell.idx = indexPath
if idx == indexPath {
cell.selectBtn.isSelected = true
cell.btmView.isHidden = false
cell.btmViewHeight.constant = 89
}else{
if isYuShou {//预售
if idx == indexPath {
cell.selectBtn.isSelected = true
cell.btmView.isHidden = false
cell.btmViewHeight.constant = 89
}else{
cell.selectBtn.isSelected = false
cell.btmView.isHidden = true
cell.btmViewHeight.constant = 0
}
}else{//非预售
cell.selectBtn.isSelected = false
cell.btmView.isHidden = true
cell.btmViewHeight.constant = 0
for idx in selectIdxArr {
if idx == indexPath{
cell.selectBtn.isSelected = true
cell.btmView.isHidden = false
cell.btmViewHeight.constant = 89
}
}
}
return cell
}
......@@ -79,28 +110,26 @@ class XuanZeShangPinViewController: BaseViewController,UITableViewDelegate,UITab
return 210
}
}
for idx in selectIdxArr {
if indexPath == idx {
return 210
}
}
return 120
}
//MARK: - SELF DELEGATE
func XuanZeShangPinCellBtnADClick(sender: UIButton) {
if sender.tag == 0 {//加
}else{//减
}
}
func XuanZeShangPinCellBtnClick(index:IndexPath) {
idx = index
for item in listView.visibleCells {
let cel = item as! XuanZeShangPinCell
cel.selectBtn.isSelected = false
cel.btmView.isHidden = true
cel.btmViewHeight.constant = 0
if cel.idx == index {
cel.selectBtn.isSelected = true
cel.btmView.isHidden = false
cel.btmViewHeight.constant = 89
if isYuShou{
idx = index
}else{
if selectIdxArr.contains(index) {
let idx = selectIdxArr.index(of: index)
selectIdxArr.remove(at: idx!)
}else{
selectIdxArr.append(index)
}
}
listView.reloadData()
......
......@@ -8,19 +8,38 @@
import UIKit
import SwipeCellKit
import LGButton
protocol DZGLViewControllerDelegate {
func DZGLViewControllerSelect(data:String)
}
class DZGLViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource,SwipeTableViewCellDelegate{
var delegate:DZGLViewControllerDelegate?
var isSelectMotion = false
var selectIdx:IndexPath?
@IBOutlet weak var btmLbl: UILabel!
@IBOutlet weak var listView: UITableView!
@IBOutlet weak var btmBtn: LGButton!
@IBAction func btmClick(_ sender: Any) {
delegate?.DZGLViewControllerSelect(data: "abc")
self.navigationController?.popViewController(animated: true)
}
@IBOutlet weak var btmLblHeight: NSLayoutConstraint!
override func viewDidLoad() {
super.viewDidLoad()
navbar.title = "地址管理"
navbar.rightTitle = "新增"
self.view.addSubview(navbar)
listView.separatorStyle = .none
SetTopFrame(view: listView, height: fullScreenHeight-NavCGRect.height)
SetTopFrameView(view: listView, btmView: btmLbl)
listView.register(UINib(nibName: "DiZhiGuanLiCell", bundle: nil), forCellReuseIdentifier: "DiZhiGuanLiCell")
btmLbl.isHidden = !isSelectMotion
btmBtn.isHidden = !isSelectMotion
if isSelectMotion {
btmLblHeight.constant = 49
}else{
btmLblHeight.constant = 0
}
// Do any additional setup after loading the view.
}
......@@ -40,13 +59,28 @@ class DZGLViewController: BaseViewController,UITableViewDelegate,UITableViewData
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "DiZhiGuanLiCell") as! DiZhiGuanLiCell
cell.delegate = self
if isSelectMotion == false {
cell.btnH.constant = 0
cell.xValue.constant = 0
}else{
if indexPath == selectIdx {
cell.btn.isSelected = true
}
}
return cell
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
print(indexPath.row)
let vc = XinZengDiZhiViewController()
vc.navTitle = "编辑地址"
self.navigationController?.pushViewController(vc, animated: true)
if isSelectMotion == false {
let vc = XinZengDiZhiViewController()
vc.navTitle = "编辑地址"
self.navigationController?.pushViewController(vc, animated: true)
}else{
selectIdx = indexPath
listView.reloadData()
}
}
......
......@@ -3,12 +3,16 @@
<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="DZGLViewController" customModule="GeliBusinessPlatform" customModuleProvider="target">
<connections>
<outlet property="btmBtn" destination="cAI-JO-Qdu" id="Ld9-CG-TRT"/>
<outlet property="btmLbl" destination="Ypv-HH-qxb" id="Qod-Sc-gU9"/>
<outlet property="btmLblHeight" destination="5VM-BT-t21" id="Drd-88-AM5"/>
<outlet property="listView" destination="PT0-ms-ns9" id="I4E-LU-xmE"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
</connections>
......@@ -19,23 +23,73 @@
<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="PT0-ms-ns9">
<rect key="frame" x="0.0" y="44" width="414" height="818"/>
<rect key="frame" x="0.0" y="44" width="414" height="769"/>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<connections>
<outlet property="dataSource" destination="-1" id="S9q-iF-ucu"/>
<outlet property="delegate" destination="-1" id="GCo-1t-z5P"/>
</connections>
</tableView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="cAI-JO-Qdu" customClass="LGButton" customModule="LGButton">
<rect key="frame" x="0.0" y="813" width="414" height="83"/>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="color" keyPath="gradientStartColor">
<color key="value" name="按钮渐变色上"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="gradientEndColor">
<color key="value" name="按钮渐变色下,字体颜色"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="boolean" keyPath="gradientHorizontal" value="YES"/>
</userDefinedRuntimeAttributes>
<connections>
<action selector="btmClick:" destination="-1" eventType="touchUpInside" id="U6X-Oa-JAd"/>
</connections>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" usesAttributedText="YES" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Ypv-HH-qxb">
<rect key="frame" x="0.0" y="813" width="414" height="49"/>
<constraints>
<constraint firstAttribute="height" constant="49" id="5VM-BT-t21"/>
</constraints>
<attributedString key="attributedText">
<fragment content="确定">
<attributes>
<color key="NSColor" name="白色背景色"/>
<font key="NSFont" size="17" name="PingFangSC-Medium"/>
<paragraphStyle key="NSParagraphStyle" alignment="center" lineBreakMode="wordWrapping" baseWritingDirection="natural" tighteningFactorForTruncation="0.0"/>
</attributes>
</fragment>
</attributedString>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="PT0-ms-ns9" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="CdY-4j-SHV"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="PT0-ms-ns9" secondAttribute="trailing" id="ZJi-7I-Sxa"/>
<constraint firstItem="PT0-ms-ns9" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" id="gk5-jK-11s"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="bottom" secondItem="PT0-ms-ns9" secondAttribute="bottom" id="ix1-ZR-9a5"/>
<constraint firstAttribute="bottom" secondItem="cAI-JO-Qdu" secondAttribute="bottom" id="1MD-9W-7eX"/>
<constraint firstItem="cAI-JO-Qdu" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="2al-2v-3lI"/>
<constraint firstItem="cAI-JO-Qdu" firstAttribute="top" secondItem="Ypv-HH-qxb" secondAttribute="top" id="GhW-XG-N4K"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="Ypv-HH-qxb" secondAttribute="trailing" id="PaP-SV-iSE"/>
<constraint firstItem="PT0-ms-ns9" firstAttribute="trailing" secondItem="fnl-2z-Ty3" secondAttribute="trailing" id="V5G-53-sAf"/>
<constraint firstItem="PT0-ms-ns9" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" id="Zy4-E7-jKS"/>
<constraint firstItem="Ypv-HH-qxb" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="a42-al-5WD"/>
<constraint firstItem="PT0-ms-ns9" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="aAW-Lb-vlo"/>
<constraint firstItem="cAI-JO-Qdu" firstAttribute="top" secondItem="PT0-ms-ns9" secondAttribute="bottom" id="euL-DJ-Xbf"/>
<constraint firstAttribute="trailing" secondItem="cAI-JO-Qdu" secondAttribute="trailing" id="fGl-8X-Oxx"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="bottom" secondItem="Ypv-HH-qxb" secondAttribute="bottom" id="z9r-c2-Am0"/>
</constraints>
<viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/>
<point key="canvasLocation" x="133" y="132"/>
<point key="canvasLocation" x="131.8840579710145" y="131.91964285714286"/>
</view>
</objects>
<resources>
<namedColor name="按钮渐变色上">
<color red="0.3880000114440918" green="0.62400001287460327" blue="0.90200001001358032" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="按钮渐变色下,字体颜色">
<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"/>
</namedColor>
</resources>
</document>
......@@ -11,11 +11,14 @@ import SwipeCellKit
class DiZhiGuanLiCell: SwipeTableViewCell {
@IBOutlet weak var btn: UIButton!
@IBOutlet weak var adrLbl: UILabel!
@IBOutlet weak var yellowLbl: UILabel!
@IBOutlet weak var blueLbl: UILabel!
@IBOutlet weak var phoneLbl: UILabel!
@IBOutlet weak var nameLbl: UILabel!
@IBOutlet weak var btnH: NSLayoutConstraint!
@IBOutlet weak var xValue: NSLayoutConstraint!
override func awakeFromNib() {
super.awakeFromNib()
self.selectionStyle = .none
......
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