Commit 444ebbb5 authored by lujunye's avatar lujunye

选择商品

parent a641d996
......@@ -15,6 +15,10 @@
E00D85EB244561FE00F5F816 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = E00D85E9244561FE00F5F816 /* LaunchScreen.storyboard */; };
E00D85F6244561FE00F5F816 /* GeliBusinessPlatformTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E00D85F5244561FE00F5F816 /* GeliBusinessPlatformTests.swift */; };
E00D8601244561FE00F5F816 /* GeliBusinessPlatformUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E00D8600244561FE00F5F816 /* GeliBusinessPlatformUITests.swift */; };
E00E48BE2457BAC700F16545 /* XuanZeShangPinCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = E00E48BC2457BAC700F16545 /* XuanZeShangPinCell.swift */; };
E00E48BF2457BAC700F16545 /* XuanZeShangPinCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = E00E48BD2457BAC700F16545 /* XuanZeShangPinCell.xib */; };
E00E48C22457C0D600F16545 /* XuanZeShangPinViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E00E48C02457C0D600F16545 /* XuanZeShangPinViewController.swift */; };
E00E48C32457C0D600F16545 /* XuanZeShangPinViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = E00E48C12457C0D600F16545 /* XuanZeShangPinViewController.xib */; };
E01C26B12446989700ADCC70 /* Interface_Z.plist in Resources */ = {isa = PBXBuildFile; fileRef = E01C26B02446989700ADCC70 /* Interface_Z.plist */; };
E01C26B62446AF3100ADCC70 /* DemoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E01C26B42446AF3100ADCC70 /* DemoViewController.swift */; };
E01C26B72446AF3100ADCC70 /* DemoViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = E01C26B52446AF3100ADCC70 /* DemoViewController.xib */; };
......@@ -279,6 +283,10 @@
E00D85FC244561FE00F5F816 /* GeliBusinessPlatformUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = GeliBusinessPlatformUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
E00D8600244561FE00F5F816 /* GeliBusinessPlatformUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GeliBusinessPlatformUITests.swift; sourceTree = "<group>"; };
E00D8602244561FE00F5F816 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
E00E48BC2457BAC700F16545 /* XuanZeShangPinCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XuanZeShangPinCell.swift; sourceTree = "<group>"; };
E00E48BD2457BAC700F16545 /* XuanZeShangPinCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = XuanZeShangPinCell.xib; sourceTree = "<group>"; };
E00E48C02457C0D600F16545 /* XuanZeShangPinViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XuanZeShangPinViewController.swift; sourceTree = "<group>"; };
E00E48C12457C0D600F16545 /* XuanZeShangPinViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = XuanZeShangPinViewController.xib; sourceTree = "<group>"; };
E01C26B02446989700ADCC70 /* Interface_Z.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Interface_Z.plist; sourceTree = "<group>"; };
E01C26B42446AF3100ADCC70 /* DemoViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DemoViewController.swift; sourceTree = "<group>"; };
E01C26B52446AF3100ADCC70 /* DemoViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = DemoViewController.xib; sourceTree = "<group>"; };
......@@ -1010,6 +1018,8 @@
E0B946262456775000FBEC9A /* DaiKeXiaDanGouWuCell.xib */,
E0A320C42456D01300AF321C /* DaiKeXiaDanFooterView.swift */,
E0A320C62456D01D00AF321C /* DaiKeXiaDanFooterView.xib */,
E00E48C02457C0D600F16545 /* XuanZeShangPinViewController.swift */,
E00E48C12457C0D600F16545 /* XuanZeShangPinViewController.xib */,
);
path = "代客下单(购物)";
sourceTree = "<group>";
......@@ -1168,6 +1178,8 @@
E0B9461D24566B3100FBEC9A /* TitleAndTFAndBtnCell.xib */,
E0B946292456AABE00FBEC9A /* YuShouWeiKuanFaHuoCell.swift */,
E0B9462A2456AABE00FBEC9A /* YuShouWeiKuanFaHuoCell.xib */,
E00E48BC2457BAC700F16545 /* XuanZeShangPinCell.swift */,
E00E48BD2457BAC700F16545 /* XuanZeShangPinCell.xib */,
);
path = Cell;
sourceTree = "<group>";
......@@ -1518,6 +1530,7 @@
E0C4F4BA244EEA7C00CC7E2F /* JiaTiJiaCell.xib in Resources */,
F9023F6E2449A9B100DD5A63 /* TitleAndTFCell.xib in Resources */,
E042F7392452766100CDFA12 /* AdressSelectCell.xib in Resources */,
E00E48C32457C0D600F16545 /* XuanZeShangPinViewController.xib in Resources */,
F9023F6A2449A50900DD5A63 /* TitleContentCell.xib in Resources */,
E0516F782448003D00E373CE /* PayViewController.xib in Resources */,
E02FD9ED2455627300E10E27 /* ChuKuViewController.xib in Resources */,
......@@ -1549,6 +1562,7 @@
E02DDD8B244FE17400ABB707 /* NewCreateFooter.xib in Resources */,
F95A9EEE24558E3D00867849 /* ChangeGoodsPriceVC.xib in Resources */,
E0DDCB19244AE2AC00DF54C7 /* XiuGaiYuShouJiaViewController.xib in Resources */,
E00E48BF2457BAC700F16545 /* XuanZeShangPinCell.xib in Resources */,
E09F4CA32452D18800BE033D /* ZengZhiServicesViewController.xib in Resources */,
F95D9CA524493E840080D6E3 /* ShopInfoViewController.xib in Resources */,
F961D26F245015D6007FBE70 /* SelectContentView.xib in Resources */,
......@@ -1768,6 +1782,7 @@
E0D4165F24482AAF008DCAB4 /* AccountViewController.swift in Sources */,
F950FDB32451820D00C40530 /* TitleAndSelCalendarView.swift in Sources */,
F95A9EED24558E3D00867849 /* ChangeGoodsPriceVC.swift in Sources */,
E00E48BE2457BAC700F16545 /* XuanZeShangPinCell.swift in Sources */,
E042F734245274F200CDFA12 /* YunDanLieBiaoCell.swift in Sources */,
E01C26B62446AF3100ADCC70 /* DemoViewController.swift in Sources */,
F933F6C32452C68B00189561 /* FrameView.swift in Sources */,
......@@ -1781,6 +1796,7 @@
E0D46C5624503EC50087B564 /* TitleAndSelectCell.swift in Sources */,
E0F97B022451228A001BD600 /* GLAlertSelectView.swift in Sources */,
F95567AB2453E40B009674AB /* OrderListViewController.swift in Sources */,
E00E48C22457C0D600F16545 /* XuanZeShangPinViewController.swift in Sources */,
E042F730245272FF00CDFA12 /* XiaYunDanViewController.swift in Sources */,
E09B03A72445B04E00211A51 /* BaseViewController.swift in Sources */,
E02DDD9924501A5B00ABB707 /* DelGuiGeCell.swift in Sources */,
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "jiahao@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "jiahao@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "jianhao@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "jianhao@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
......@@ -35,11 +35,12 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate, UITabBarControllerDeleg
}
//MARK:--loginVC
func addLoginVc (isAgain:Bool){
let vc = LoginViewController()
vc.delegate = self
let contentView = vc
// let vc = LoginViewController()
// vc.delegate = self
// let contentView = vc
let vc = XuanZeShangPinViewController()
let contentView = vc
if let windowScene = sceneC as? UIWindowScene {
if isAgain {
......
//
// XuanZeShangPinCell.swift
// GeliBusinessPlatform
//
// Created by junye lu on 2020/4/28.
// Copyright © 2020 junye lu. All rights reserved.
//
import UIKit
@objc protocol XuanZeShangPinCellDelegate {
@objc optional func XuanZeShangPinCellBtnClick(index:IndexPath)
@objc optional func XuanZeShangPinCellBtnADClick(sender:UIButton)
}
class XuanZeShangPinCell: UITableViewCell {
var delegate:XuanZeShangPinCellDelegate?
var idx:IndexPath?
@IBAction func btnClickAction(_ sender: Any) {
delegate?.XuanZeShangPinCellBtnClick!(index:idx!)
}
@IBAction func addOrDelAction(_ sender: UIButton) {
delegate?.XuanZeShangPinCellBtnADClick?(sender: sender)
}
@IBOutlet weak var priceTF: UITextField!
@IBOutlet weak var countTF: UITextField!
@IBOutlet weak var detailLbl2: UILabel!
@IBOutlet weak var detailLbl: UILabel!
@IBOutlet weak var nameLbl: UILabel!
@IBOutlet weak var selectBtn: UIButton!
@IBOutlet weak var btmView: UIView!
@IBOutlet weak var btmViewHeight: NSLayoutConstraint!
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.
......@@ -143,6 +143,7 @@ class DaiKeXiaDanGouWuViewController: BaseViewController,UITableViewDataSource,U
cell.textTF.layer.borderWidth = 1
cell.textTF.layer.borderColor = UIColor(named: "灰色字体颜色")?.cgColor
cell.textTF.placeholder = "请输入运费"
cell.textTF.textColor = UIColor(named: "蓝色字体颜色")
if indexPath.row == 5 {
cell.textTF.placeholder = "请输入费用"
}
......
//
// XuanZeShangPinViewController.swift
// GeliBusinessPlatform
//
// Created by junye lu on 2020/4/28.
// Copyright © 2020 junye lu. All rights reserved.
//
import UIKit
class XuanZeShangPinViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource,XuanZeShangPinCellDelegate{
//XuanZeShangPinCell
@IBAction func submitAction(_ sender: Any) {
}
var idx:IndexPath?
@IBOutlet weak var btmLbl: UILabel!
@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.equalTo(0)
make.bottom.equalTo(btmLbl.snp_top)
}
listView.register(UINib(nibName: "XuanZeShangPinCell", bundle: nil), forCellReuseIdentifier: "XuanZeShangPinCell")
}
//MARK: - cell delegate
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 8
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
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{
cell.selectBtn.isSelected = false
cell.btmView.isHidden = true
cell.btmViewHeight.constant = 0
}
return cell
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
if idx != nil {
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
}
}
listView.reloadData()
}
}
<?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="XuanZeShangPinViewController" customModule="GeliBusinessPlatform" customModuleProvider="target">
<connections>
<outlet property="btmLbl" destination="5Kt-Ig-zbb" id="fUx-No-8SV"/>
<outlet property="listView" destination="YuT-X7-ecw" id="wKf-Ej-i9r"/>
<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>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="IB6-lV-KWZ" 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="submitAction:" destination="-1" eventType="touchUpInside" id="Xwq-8w-4fK"/>
</connections>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="确定" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="5Kt-Ig-zbb">
<rect key="frame" x="0.0" y="813" width="414" height="49"/>
<constraints>
<constraint firstAttribute="height" constant="49" id="MHS-iR-lJv"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" name="白色背景色"/>
<nil key="highlightedColor"/>
</label>
<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="YuT-X7-ecw">
<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="pf9-cD-hFe"/>
<outlet property="delegate" destination="-1" id="kFX-d5-Tz7"/>
</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="YuT-X7-ecw" secondAttribute="trailing" id="9Rc-E2-u9s"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="5Kt-Ig-zbb" secondAttribute="trailing" id="9nZ-Ef-l1a"/>
<constraint firstItem="IB6-lV-KWZ" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="BdU-A8-HfN"/>
<constraint firstItem="IB6-lV-KWZ" firstAttribute="top" secondItem="5Kt-Ig-zbb" secondAttribute="top" id="Bw1-yn-w9z"/>
<constraint firstItem="YuT-X7-ecw" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="LVQ-qR-vHK"/>
<constraint firstItem="5Kt-Ig-zbb" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="Zxi-kb-DhB"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="bottom" secondItem="5Kt-Ig-zbb" secondAttribute="bottom" id="aeg-df-E1I"/>
<constraint firstItem="IB6-lV-KWZ" firstAttribute="top" secondItem="YuT-X7-ecw" secondAttribute="bottom" id="uUk-FK-syJ"/>
<constraint firstAttribute="trailing" secondItem="IB6-lV-KWZ" secondAttribute="trailing" id="v8D-Yo-QxM"/>
<constraint firstAttribute="bottom" secondItem="IB6-lV-KWZ" secondAttribute="bottom" id="w8M-CY-ifc"/>
<constraint firstItem="YuT-X7-ecw" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" id="xFN-or-L0x"/>
</constraints>
<viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/>
<point key="canvasLocation" x="131.8840579710145" y="121.875"/>
</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>
......@@ -33,7 +33,7 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
var isYuShouShangPin:Bool?
@objc func bottomBtnClick(sender:UIButton){
print(sender.tag)
print(sender.titleLabel?.text)
}
override func viewDidLoad() {
super.viewDidLoad()
......@@ -45,6 +45,8 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
for i in 0 ..< btmTitleArr.count{
let btn = UIButton(frame: CGRect(x: CGFloat(i) * w, y: 0, width: w, height: btmView.bounds.size.height))
btn.tag = i
btn.setTitle(btmTitleArr[i], for: .normal)
btn.titleLabel?.textColor = UIColor.clear
btn.addTarget(self, action: #selector(bottomBtnClick(sender:)), for: .touchUpInside)
let lbl = UILabel(frame: CGRect(x: CGFloat(i) * w, y: 0, width: w, height: 49*glscale))
lbl.textAlignment = .center
......
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