Commit 6a9ab706 authored by lujunye's avatar lujunye

规格新增条形码

parent 7a3499b3
<?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="16097.2" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="17701" 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>
<deployment identifier="iOS"/> <deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17703"/>
<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"/>
......
...@@ -11,6 +11,20 @@ protocol ShangPinGguiGeCellDelegate { ...@@ -11,6 +11,20 @@ protocol ShangPinGguiGeCellDelegate {
func ShangPinGguiGeCellEditAction(cell:ShangPinGguiGeCell) func ShangPinGguiGeCellEditAction(cell:ShangPinGguiGeCell)
} }
class ShangPinGguiGeCell: UITableViewCell { class ShangPinGguiGeCell: UITableViewCell {
var isCheck = false{
didSet{
if isCheck {
top_view.isHidden = false
code_lbl.isHidden = false
top_view_h.constant = 49
}else{
top_view_h.constant = 0
}
}
}
@IBOutlet weak var code_lbl: UILabel!
@IBOutlet weak var top_view_h: NSLayoutConstraint!
@IBOutlet weak var top_view: UIView!
var delegate:ShangPinGguiGeCellDelegate? var delegate:ShangPinGguiGeCellDelegate?
@IBAction func editAction(_ sender: Any) { @IBAction func editAction(_ sender: Any) {
delegate?.ShangPinGguiGeCellEditAction(cell: self) delegate?.ShangPinGguiGeCellEditAction(cell: self)
......
...@@ -77,8 +77,8 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo ...@@ -77,8 +77,8 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
} }
var titleArr = ["商品信息","商品图片","商品规格","预售设置","其它信息","商品详情"] var titleArr = ["商品信息","商品图片","商品规格","预售设置","其它信息","商品详情"]
let spxxArr = ["商品名称","商品类型","商品分类","品牌","起卖数量","是否清真","是否询价"] let spxxArr = ["商品名称","商品类型","商品分类","品牌","可售库存","起卖数量","是否清真","是否询价"]
var tishixxArr = ["请输入商品名称","请选择商品类型","请选择商品分类","请选择品牌","请输入起卖数量"] var tishixxArr = ["请输入商品名称","请选择商品类型","请选择商品分类","请选择品牌","查看库存","请输入起卖数量"]
var tishixxArr1 = ["请输入关键字","请输入物流费用","请选择国家","热销","请选择运输方式"] var tishixxArr1 = ["请输入关键字","请输入物流费用","请选择国家","热销","请选择运输方式"]
let sptpArr = ["商品封面图(限一张)","商品主图(限五张)"] let sptpArr = ["商品封面图(限一张)","商品主图(限五张)"]
let qtxxArr = ["关键字","物流费用","国家","商品状态","运输方式"] let qtxxArr = ["关键字","物流费用","国家","商品状态","运输方式"]
...@@ -735,7 +735,7 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo ...@@ -735,7 +735,7 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
switch indexPath.section { switch indexPath.section {
case 0: case 0:
if indexPath.row == 0 || indexPath.row == 4 { if indexPath.row == 0 || indexPath.row == 5 {
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndTF") as! TitleAndTFCell let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndTF") as! TitleAndTFCell
cell.textTF.delegate = self cell.textTF.delegate = self
cell.nameLbl.text = spxxArr[indexPath.row] cell.nameLbl.text = spxxArr[indexPath.row]
...@@ -758,7 +758,7 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo ...@@ -758,7 +758,7 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
cell.delegate = self cell.delegate = self
return cell return cell
} }
if indexPath.row > 4{ if indexPath.row > 5{
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndSwitch") as! TitleAndSwitchCell let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndSwitch") as! TitleAndSwitchCell
cell.infoSw.isUserInteractionEnabled = isAllEditing cell.infoSw.isUserInteractionEnabled = isAllEditing
cell.namelbl.text = spxxArr[indexPath.row] cell.namelbl.text = spxxArr[indexPath.row]
...@@ -824,6 +824,7 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo ...@@ -824,6 +824,7 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
case 2: case 2:
if guiGeArr.count > 0 { if guiGeArr.count > 0 {
let cell = tableView.dequeueReusableCell(withIdentifier: "ShangPinGguiGeCell") as! ShangPinGguiGeCell let cell = tableView.dequeueReusableCell(withIdentifier: "ShangPinGguiGeCell") as! ShangPinGguiGeCell
cell.isCheck = true
cell.delegate = self cell.delegate = self
if isAllEditing { if isAllEditing {
cell.btn.setTitle("编辑规格", for: .normal) cell.btn.setTitle("编辑规格", for: .normal)
...@@ -838,7 +839,10 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo ...@@ -838,7 +839,10 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
dict = guiGeArr.first dict = guiGeArr.first
} }
cell.code_lbl.text = "商品条码:未记录"
if dict.code_number.count > 0 {
cell.code_lbl.text = "商品条码:\(dict.code_number)"
}
cell.tempLbl.text = "温藏:未记录" cell.tempLbl.text = "温藏:未记录"
if dict.wenDu.count > 0 { if dict.wenDu.count > 0 {
cell.tempLbl.text = "温藏:\(dict.wenDu)" cell.tempLbl.text = "温藏:\(dict.wenDu)"
...@@ -960,7 +964,9 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo ...@@ -960,7 +964,9 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
} }
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if indexPath.row == 4 {
print("abc")
}
} }
//MARK: - 底部广告软文跳转 && 编辑 //MARK: - 底部广告软文跳转 && 编辑
@objc func editHtml(){ @objc func editHtml(){
...@@ -1496,7 +1502,7 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo ...@@ -1496,7 +1502,7 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
} }
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
switch section { switch section {
case 0: return 7 case 0: return 8
case 1:return 2 case 1:return 2
case 2:return 1 case 2:return 1
case 3: case 3:
...@@ -1640,7 +1646,7 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo ...@@ -1640,7 +1646,7 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
case 1:return 148.5 case 1:return 148.5
case 2: case 2:
if guiGeArr.count > 0 { if guiGeArr.count > 0 {
return 146 return 199
} }
return 123.5 return 123.5
case 3: case 3:
...@@ -1702,8 +1708,8 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo ...@@ -1702,8 +1708,8 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
let pArr = item.price.components(separatedBy: ",") let pArr = item.price.components(separatedBy: ",")
pData = pArr.joined(separator: "") pData = pArr.joined(separator: "")
// let arr = item.price.components(separatedBy: ",") // let arr = item.price.components(separatedBy: ",")
// pData = arr.joined(separator: "") // pData = arr.joined(separator: "")
}else{ }else{
pData = item.price pData = item.price
......
...@@ -407,6 +407,7 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl ...@@ -407,6 +407,7 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
case 2: case 2:
if guiGeArr.count > 0 { if guiGeArr.count > 0 {
let cell = tableView.dequeueReusableCell(withIdentifier: "ShangPinGguiGeCell") as! ShangPinGguiGeCell let cell = tableView.dequeueReusableCell(withIdentifier: "ShangPinGguiGeCell") as! ShangPinGguiGeCell
cell.isCheck = true
cell.delegate = self cell.delegate = self
var dict:GuiGeModel! var dict:GuiGeModel!
if selectIdx != nil{ if selectIdx != nil{
...@@ -416,6 +417,10 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl ...@@ -416,6 +417,10 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
dict = guiGeArr.first dict = guiGeArr.first
} }
cell.code_lbl.text = "商品条码:未记录"
if dict.code_number.count > 0 {
cell.code_lbl.text = "商品条码:\(dict.code_number)"
}
cell.tempLbl.text = "温藏:未记录" cell.tempLbl.text = "温藏:未记录"
if dict.wenDu.count > 0 { if dict.wenDu.count > 0 {
cell.tempLbl.text = "温藏:\(dict.wenDu)" cell.tempLbl.text = "温藏:\(dict.wenDu)"
...@@ -1196,7 +1201,7 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl ...@@ -1196,7 +1201,7 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
case 1:return 148.5 case 1:return 148.5
case 2: case 2:
if guiGeArr.count > 0 { if guiGeArr.count > 0 {
return 146 return 199
} }
return 123.5 return 123.5
case 3: case 3:
......
...@@ -36,8 +36,8 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl ...@@ -36,8 +36,8 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
var datasArr:Array<GuiGeModel> = [] var datasArr:Array<GuiGeModel> = []
var dataModel = GuiGeModel() var dataModel = GuiGeModel()
var firstTimeSetting = true var firstTimeSetting = true
let titleArray = ["售价:","规格:","重量(kg):","温藏:","单位:","原价:","起售数量:"] let titleArray = ["售价:","规格:","重量(kg):","温藏:","单位:","原价:","起售数量:","商品编码:"]
let pliceHolderArr = ["请输入商品售价","请输入商品规格","请输入商品重量","常温","请选择商品单位","请输入商品原价","请输入起售数量"] let pliceHolderArr = ["请输入商品售价","请输入商品规格","请输入商品重量","常温","请选择商品单位","请输入商品原价","请输入起售数量","请输入商品编码"]
@IBOutlet weak var btmLbl: UILabel! @IBOutlet weak var btmLbl: UILabel!
@IBOutlet weak var bottomBtn: LGButton! @IBOutlet weak var bottomBtn: LGButton!
@IBOutlet weak var listTbv: UITableView! @IBOutlet weak var listTbv: UITableView!
...@@ -62,7 +62,7 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl ...@@ -62,7 +62,7 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
var weight = "" var weight = ""
var wenDu = "常温" var wenDu = "常温"
var danWei = "" var danWei = ""
var code_number = ""
var originalPrice = "" var originalPrice = ""
var originNumberSku = "" var originNumberSku = ""
...@@ -209,6 +209,7 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl ...@@ -209,6 +209,7 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
} }
} }
if isYuShouSetting {
if DJBiLi.count == 0 { if DJBiLi.count == 0 {
HUD.flash(.label("默认定金范围(1~20%)"), delay: 1.2) HUD.flash(.label("默认定金范围(1~20%)"), delay: 1.2)
DJBiLi = "20" DJBiLi = "20"
...@@ -217,13 +218,18 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl ...@@ -217,13 +218,18 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
cell.inputTF3.text = "20" cell.inputTF3.text = "20"
return return
} }
}
if code_number.count == 0 {
HUD.flash(.label("请输入商品编码"), delay: 1.2)
return
}
dataModel.originalPrice = originalPrice dataModel.originalPrice = originalPrice
dataModel.originNumberSku = originNumberSku dataModel.originNumberSku = originNumberSku
dataModel.price = price dataModel.price = price
dataModel.guiGe = guiGe dataModel.guiGe = guiGe
dataModel.weight = weight dataModel.weight = weight
dataModel.code_number = code_number
dataModel.wenDu = wenDu dataModel.wenDu = wenDu
dataModel.danWei = danWei dataModel.danWei = danWei
dataModel.isYsJieTiOpen = isYsJieTiOpen dataModel.isYsJieTiOpen = isYsJieTiOpen
...@@ -300,6 +306,7 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl ...@@ -300,6 +306,7 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
} }
break break
default: default:
code_number = textField.text!
break break
} }
} }
...@@ -352,7 +359,7 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl ...@@ -352,7 +359,7 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
//keyboardType //keyboardType
cell.textTF.returnKeyType = .done cell.textTF.returnKeyType = .done
cell.textTF.delegate = self cell.textTF.delegate = self
if indexPath.row == 0 || indexPath.row == 2 || indexPath.row == 5 || indexPath.row == 6{ if indexPath.row == 0 || indexPath.row == 2 || indexPath.row == 5 || indexPath.row == 6 || indexPath.row == 7{
cell.textTF.keyboardType = .decimalPad cell.textTF.keyboardType = .decimalPad
} }
let str = NSAttributedString(string: pliceHolderArr[indexPath.row], attributes: [NSAttributedString.Key.foregroundColor:UIColor(named: "灰色字体颜色")]) let str = NSAttributedString(string: pliceHolderArr[indexPath.row], attributes: [NSAttributedString.Key.foregroundColor:UIColor(named: "灰色字体颜色")])
...@@ -371,9 +378,15 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl ...@@ -371,9 +378,15 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
case 6: case 6:
cell.textTF.text = originNumberSku cell.textTF.text = originNumberSku
break break
default: case 2:
cell.textTF.text = weight cell.textTF.text = weight
break break
default:
cell.textTF.text = code_number
if code_number.count == 0 && barTitle?.contains("查看") == true{
cell.textTF.text = "未记录"
}
break
} }
} }
...@@ -791,6 +804,7 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl ...@@ -791,6 +804,7 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
price = dataDict.price price = dataDict.price
guiGe = dataDict.guiGe guiGe = dataDict.guiGe
weight = dataDict.weight weight = dataDict.weight
code_number = dataDict.code_number
wenDu = dataDict.wenDu wenDu = dataDict.wenDu
danWei = dataDict.danWei danWei = dataDict.danWei
yuShouPrice = dataDict.yuShouPrice yuShouPrice = dataDict.yuShouPrice
......
...@@ -17,6 +17,8 @@ class GuiGeModel: NSObject { ...@@ -17,6 +17,8 @@ class GuiGeModel: NSObject {
var guiGe : String = "" var guiGe : String = ""
///重量 ///重量
var weight : String = "" var weight : String = ""
///条形码
var code_number : String = ""
///温度 ///温度
var wenDu : String = "" var wenDu : String = ""
///单位 ///单位
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
<color key="textColor" name="标题字颜色"/> <color key="textColor" name="标题字颜色"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="请输入预售价格" textAlignment="right" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="COH-zY-OUo"> <textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="请输入预售价格" textAlignment="right" minimumFontSize="17" clearButtonMode="whileEditing" translatesAutoresizingMaskIntoConstraints="NO" id="COH-zY-OUo">
<rect key="frame" x="85" y="46" width="220" height="34"/> <rect key="frame" x="85" y="46" width="220" height="34"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="34" id="iAs-XY-QMJ"/> <constraint firstAttribute="height" constant="34" id="iAs-XY-QMJ"/>
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
<color key="textColor" name="标题字颜色"/> <color key="textColor" name="标题字颜色"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<textField opaque="NO" tag="1" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="请输入预售库存" textAlignment="right" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="Qb7-aM-usa"> <textField opaque="NO" tag="1" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="请输入预售库存" textAlignment="right" minimumFontSize="17" clearButtonMode="whileEditing" translatesAutoresizingMaskIntoConstraints="NO" id="Qb7-aM-usa">
<rect key="frame" x="101" y="89" width="204" height="34"/> <rect key="frame" x="101" y="89" width="204" height="34"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="34" id="JmO-9y-uwH"/> <constraint firstAttribute="height" constant="34" id="JmO-9y-uwH"/>
...@@ -103,7 +103,7 @@ ...@@ -103,7 +103,7 @@
<color key="textColor" name="标题字颜色"/> <color key="textColor" name="标题字颜色"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<textField opaque="NO" tag="2" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="请输入预售定金比例" textAlignment="right" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="mht-f5-qwh"> <textField opaque="NO" tag="2" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="请输入预售定金比例" textAlignment="right" minimumFontSize="17" clearButtonMode="whileEditing" translatesAutoresizingMaskIntoConstraints="NO" id="mht-f5-qwh">
<rect key="frame" x="121" y="140" width="184" height="34"/> <rect key="frame" x="121" y="140" width="184" height="34"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="34" id="57U-zx-suF"/> <constraint firstAttribute="height" constant="34" id="57U-zx-suF"/>
......
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