Commit b8404593 authored by lujunye's avatar lujunye

编辑状态下,不显示所有跟编辑相关的UI

parent 11658a08
......@@ -90,8 +90,6 @@ class AddImgCell: UITableViewCell {
img.layer.masksToBounds = true
scrollView!.addSubview(img)
let imgStr = arr[i]
print(SERVERCE_ImageHost + imgStr)
img.sd_setImage(with: URL(string: SERVERCE_ImageHost + imgStr))
img.isUserInteractionEnabled = true
img.snp.makeConstraints { (make) in
......@@ -99,45 +97,48 @@ class AddImgCell: UITableViewCell {
make.width.height.equalTo(90)
make.left.equalTo(105*i)
}
let changeBtn = UIButton()
changeBtn.tag = i
changeBtn.backgroundColor = UIColor(named: "标题字颜色")
changeBtn.alpha = 0.5
changeBtn.addTarget(self, action: #selector(changeAction(sender:)), for: .touchUpInside)
img.addSubview(changeBtn)
changeBtn.snp.makeConstraints { (make) in
make.top.bottom.right.left.equalTo(0)
}
let ti = UILabel()
ti.text = "替 换"
ti.textColor = UIColor.white
ti.textAlignment = .center
ti.font = UIFont.systemFont(ofSize: 15)
img.addSubview(ti)
ti.snp.makeConstraints { (make) in
make.top.bottom.right.left.equalTo(0)
}
let delImg = UIImageView()
img.addSubview(delImg)
delImg.image = UIImage(named: "shanchuDel")
delImg.snp.makeConstraints { (make) in
make.top.equalTo(img.snp_top).offset(-6)
make.right.equalTo(img.snp_right).offset(6)
make.width.height.equalTo(15)
}
delImg.isHidden = !isEdit!
let delBtn = UIButton()
delBtn.isUserInteractionEnabled = isEdit!
scrollView!.addSubview(delBtn)
delBtn.tag = i
delBtn.snp.makeConstraints { (make) in
make.centerX.equalTo(delImg.snp_centerX)
make.centerY.equalTo(delImg.snp_centerY)
make.width.height.equalTo(25)
if isAllEditing {
let changeBtn = UIButton()
changeBtn.tag = i
changeBtn.backgroundColor = UIColor(named: "标题字颜色")
changeBtn.alpha = 0.5
changeBtn.addTarget(self, action: #selector(changeAction(sender:)), for: .touchUpInside)
img.addSubview(changeBtn)
changeBtn.snp.makeConstraints { (make) in
make.top.bottom.right.left.equalTo(0)
}
let ti = UILabel()
ti.text = "替 换"
ti.textColor = UIColor.white
ti.textAlignment = .center
ti.font = UIFont.systemFont(ofSize: 15)
img.addSubview(ti)
ti.snp.makeConstraints { (make) in
make.top.bottom.right.left.equalTo(0)
}
let delImg = UIImageView()
img.addSubview(delImg)
delImg.image = UIImage(named: "shanchuDel")
delImg.snp.makeConstraints { (make) in
make.top.equalTo(img.snp_top).offset(-6)
make.right.equalTo(img.snp_right).offset(6)
make.width.height.equalTo(15)
}
delImg.isHidden = !isEdit!
let delBtn = UIButton()
delBtn.isUserInteractionEnabled = isEdit!
scrollView!.addSubview(delBtn)
delBtn.tag = i
delBtn.snp.makeConstraints { (make) in
make.centerX.equalTo(delImg.snp_centerX)
make.centerY.equalTo(delImg.snp_centerY)
make.width.height.equalTo(25)
}
delBtn.addTarget(self, action: #selector(delAction(sender:)), for: .touchUpInside)
}
delBtn.addTarget(self, action: #selector(delAction(sender:)), for: .touchUpInside)
}
}
@objc func changeAction(sender:UIButton){
......
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16097" 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="16087"/>
<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"/>
......@@ -25,6 +25,7 @@
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" verticalHuggingPriority="251" text="内容" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="7nL-vu-Tdl">
<rect key="frame" x="42" y="0.0" width="246" height="44"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="textColor" name="灰色字体颜色"/>
<nil key="highlightedColor"/>
......
......@@ -10,7 +10,7 @@
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="KGk-i7-Jjw" customClass="TitleAndTFCell" customModule="GeliBusinessPlatform" customModuleProvider="target">
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="KGk-i7-Jjw" customClass="TitleAndTFCell" customModule="TestClass" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="375" height="50"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
......
......@@ -129,7 +129,7 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
HUD.flash(.label("请选择商品类型"), delay: 1.2)
return
}
print("selectGoodsClassModel == ",selectGoodsClassModel.cat_id)
if selectGoodsClassModel.cat_id == nil {
HUD.flash(.label("请选择商品分类"), delay: 1.2)
return
......@@ -185,6 +185,7 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
return
}
//MARK:---新增商品接口
let UserToken = UserDefaults.standard.value(forKey: "user_token")
......@@ -626,6 +627,11 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
cell.nameLbl.text = spxxArr[indexPath.row]
cell.contentLbl.text = tishixxArr[indexPath.row] as! String
cell.tag = indexPath.row
if isAllEditing == false {
cell.contentRight.constant = 15
}else{
cell.contentRight.constant = 32
}
cell.delegate = self
return cell
case 1:
......@@ -757,7 +763,6 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
cell.imgBtn.setImage(UIImage(named: "tjxq"), for: .normal)
cell.btmH.constant = 25
cell.delegate = self
return cell
}
}
......@@ -1401,11 +1406,15 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
}
case 4:return 49
default:
if goodsDesc.count > 0 {
if goodsDesc.count > 0 {//有内容
return 250
}else{//无内容
if isAllEditing {//非编辑
return 0.001
}else{//编辑
return 98
}
}
return 98
}
}
func YuShouWeiKuanFaHuoCellString(str: String) {
......
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