Commit cc69d710 authored by 刘俊宏's avatar 刘俊宏

代客下单完成

parent 768f0820
......@@ -10,6 +10,7 @@ import UIKit
class DKXDAdrCell: UITableViewCell {
@IBOutlet weak var contentLblRightOffset: NSLayoutConstraint!
@IBOutlet weak var adrLbl: UILabel!
@IBOutlet weak var contentLbl: UILabel!
@IBOutlet weak var nameLbl: UILabel!
......
<?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">
<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">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15704"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
<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"/>
......@@ -23,7 +23,7 @@
<color key="textColor" name="标题字颜色"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="收" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="QvD-ve-9Fp">
<label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="收" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="QvD-ve-9Fp">
<rect key="frame" x="325" y="14" width="18" height="18"/>
<constraints>
<constraint firstAttribute="width" constant="18" id="K4r-yw-iY5"/>
......@@ -51,7 +51,7 @@
<constraint firstAttribute="width" constant="7" id="rEc-Do-HBZ"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="寄" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="r5M-d4-Eze">
<label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="寄" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="r5M-d4-Eze">
<rect key="frame" x="297" y="14" width="18" height="18"/>
<constraints>
<constraint firstAttribute="width" constant="18" id="0h9-G0-bSR"/>
......@@ -73,7 +73,7 @@
</userDefinedRuntimeAttributes>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="内容" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="dVC-Xx-6Hy">
<rect key="frame" x="260" y="15" width="27" height="16"/>
<rect key="frame" x="315" y="15" width="27" height="16"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="textColor" name="标题字颜色"/>
<nil key="highlightedColor"/>
......@@ -93,7 +93,7 @@
</view>
</subviews>
<constraints>
<constraint firstItem="r5M-d4-Eze" firstAttribute="leading" secondItem="dVC-Xx-6Hy" secondAttribute="trailing" constant="10" id="22v-tZ-ib5"/>
<constraint firstItem="r5M-d4-Eze" firstAttribute="leading" secondItem="dVC-Xx-6Hy" secondAttribute="trailing" constant="-45" id="22v-tZ-ib5"/>
<constraint firstItem="5kw-XG-gZD" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="15" id="9VS-AY-U3V"/>
<constraint firstItem="dVC-Xx-6Hy" firstAttribute="centerY" secondItem="5kw-XG-gZD" secondAttribute="centerY" id="D7X-Vs-1Cy"/>
<constraint firstItem="VnT-fQ-1Wc" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="15" id="Edw-XO-oDA"/>
......@@ -114,6 +114,7 @@
<connections>
<outlet property="adrLbl" destination="hiB-wE-OIe" id="FK3-AL-t6u"/>
<outlet property="contentLbl" destination="dVC-Xx-6Hy" id="gtL-Pj-o6B"/>
<outlet property="contentLblRightOffset" destination="22v-tZ-ib5" id="GHU-md-LZu"/>
<outlet property="nameLbl" destination="5kw-XG-gZD" id="UV4-nX-ceM"/>
<outlet property="status1" destination="QvD-ve-9Fp" id="vJC-ZC-Cxd"/>
<outlet property="status2" destination="r5M-d4-Eze" id="yE5-x7-b6e"/>
......
......@@ -9,12 +9,14 @@
import UIKit
@objc protocol XuanZeShangPinCellDelegate {
@objc optional func XuanZeShangPinCellBtnClick(index:IndexPath)
@objc optional func XuanZeShangPinCellTextChange(index:IndexPath)
@objc optional func XuanZeShangPinCellTextChange(index:IndexPath,sender:XuanZeShangPinCell)
}
class XuanZeShangPinCell: UITableViewCell {
class XuanZeShangPinCell: UITableViewCell{
var imgUrlPath:String?
var sku_id:Int?
var model:GetGoodsInfoDataModel?
var maxNum :Int? = 0
@IBOutlet weak var iconImg: UIImageView!
@IBOutlet weak var priceLbl: UILabel!
@IBOutlet weak var yuShouImg: UIImageView!
......@@ -27,10 +29,20 @@ class XuanZeShangPinCell: UITableViewCell {
@IBAction func addOrDelAction(_ sender: UIButton) {
let str = countTF.text as! NSString
if sender.tag == 0 {//加
countTF.text = "\(str.integerValue + 1)"
if maxNum! > 0 {
if (str.integerValue + 1) > maxNum! {
let maxStr = StringByInt(number: maxNum!)
HUD.flash(.label("不可超过最大数量" + maxStr),delay: 1.2)
countTF.text = StringByInt(number: maxNum!)
}else{
countTF.text = "\(str.integerValue + 1)"
}
}else{
countTF.text = "\(str.integerValue + 1)"
}
}else {
if str.integerValue > 0 {
countTF.text = "\(str.integerValue - 1)"
if str.integerValue > 1 {
countTF.text = "\(str.integerValue - 1)"
}
}
}
......@@ -50,14 +62,27 @@ class XuanZeShangPinCell: UITableViewCell {
self.selectionStyle = .none
priceTF.addTarget(self, action: #selector(textChange(sender:)), for: .allEditingEvents)
countTF.addTarget(self, action: #selector(textChange(sender:)), for: .allEditingEvents)
// Initialization code
}
@objc func textChange(sender:UITextField){
delegate?.XuanZeShangPinCellTextChange?(index: idx!)
let num = sender.text as! NSString
let maxStr = StringByInt(number: maxNum!)
if sender == countTF{
if num.integerValue > maxNum! {
HUD.flash(.label("不可超过最大数量" + maxStr),delay: 1.2)
countTF.text = maxStr
}
}
delegate?.XuanZeShangPinCellTextChange?(index: idx!,sender:self)
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
......
......@@ -10,7 +10,7 @@ import UIKit
import IQKeyboardManagerSwift
class DaiKeXiaDanGouWuViewController: BaseViewController,UITableViewDataSource,UITableViewDelegate,DaiKeXiaDanFooterViewDelegate,TitleAndBtnCellDelegate,GLAlertSelectViewDelegate,DZGLViewControllerDelegate,XuanZeShangPinViewControllerDelegate,DaiKeXiaDanGouWuCellDelegate,GuanLianKehuVCDelegate,XiuGaiYuShouJiaViewControllerDelegate,TitleAndTFCellDelegate{
let ddTypeArr = ["普通订单","预售下单"]
let zfTypeArr = ["未付款","欠款","月结","已付款"]
let zfWayArr = ["未支付","现金","转账(私)","转账(公)","转账(微信)","转账(支付宝)"]
......@@ -63,7 +63,7 @@ class DaiKeXiaDanGouWuViewController: BaseViewController,UITableViewDataSource,U
}
print(logistics_price)
print(other_price)
if logistics_price.count > 0 {
if !isPurnNumber(str: logistics_price) {
HUD.flash(.label("请填写正确的运费价格"), delay: 1.2)
......@@ -85,21 +85,21 @@ class DaiKeXiaDanGouWuViewController: BaseViewController,UITableViewDataSource,U
}
let UserToken = UserDefaults.standard.value(forKey: "user_token")
let order = ["user_token":UserToken as Any,
"is_adsale":is_adsale as Any,
"goods_info":goods_info as Any,
"order_info":order_info as Any] as [String : Any]
"is_adsale":is_adsale as Any,
"goods_info":goods_info as Any,
"order_info":order_info as Any] as [String : Any]
print(order)
// HUD.flash(.progress)
// addOrder(order, success: { (data) in
// let dataM = data as! UpDataModel
// if dataM.code == 1 {
// HUD.flash(.label("提交成功"), delay: 1.2)
// }else{
// HUD.hide()
// }
// }) { (error) in
//
// }
// HUD.flash(.progress)
// addOrder(order, success: { (data) in
// let dataM = data as! UpDataModel
// if dataM.code == 1 {
// HUD.flash(.label("提交成功"), delay: 1.2)
// }else{
// HUD.hide()
// }
// }) { (error) in
//
// }
}
override func viewDidLoad() {
......@@ -159,11 +159,11 @@ class DaiKeXiaDanGouWuViewController: BaseViewController,UITableViewDataSource,U
cell.diLbl.isHidden = false
cell.diLbl.text = "定金:¥" + djTFstr
cell.totalPriceLbl.text = "尾款:¥" + wkTFstr
}else {
cell.totalPriceLbl.text = \(priceStr.floatValue * countStr.floatValue)"
cell.diLbl.isHidden = true
}
return cell
......@@ -208,7 +208,7 @@ class DaiKeXiaDanGouWuViewController: BaseViewController,UITableViewDataSource,U
let cell = tableView.dequeueReusableCell(withIdentifier: "DKXDAdrCell") as! DKXDAdrCell
cell.nameLbl.text = p3Arr[indexPath.row]
cell.contentLbl.text = (adrData?.consignee)! + " " + (adrData?.mobile)!
cell.adrLbl.text = adrData?.addr_cn
cell.tag = indexPath.row
return cell
......@@ -230,7 +230,7 @@ class DaiKeXiaDanGouWuViewController: BaseViewController,UITableViewDataSource,U
cell.textTF.returnKeyType = .done
cell.textTF.layer.borderColor = UIColor(named: "灰色字体颜色")?.cgColor
cell.textTF.placeholder = "请输入费用"
cell.textTF.keyboardType = .numbersAndPunctuation
cell.textTF.keyboardType = .decimalPad
cell.textTF.textColor = UIColor(named: "蓝色字体颜色")
if indexPath.row == 5 {
cell.textTF.placeholder = "请输入运费"
......@@ -291,6 +291,13 @@ class DaiKeXiaDanGouWuViewController: BaseViewController,UITableViewDataSource,U
view.selectNum = dj_payStatus
view.tempNum = view.selectNum
view.titleLbl.text = "请选择\(p2Arr[indexPath.row])"
if orderType == 1 {
if dj_payWay == 0{
view.deSelectArr = [1,2,3]
}else{
view.deSelectArr = [0,1,2]
}
}
view.dataArr = zfTypeArr
}
self.view.addSubview(view)
......@@ -300,6 +307,10 @@ class DaiKeXiaDanGouWuViewController: BaseViewController,UITableViewDataSource,U
case 3:
if indexPath.row == 3 || indexPath.row > 4{
if indexPath.row == 3 {
if cusModel == nil {
HUD.flash(.label("请先关联客户"),delay: 1.2)
return
}
let vc = DZGLViewController()
vc.cus_id = cusModel?.cus_id
vc.isSelectMotion = true
......@@ -331,6 +342,13 @@ class DaiKeXiaDanGouWuViewController: BaseViewController,UITableViewDataSource,U
view.selectNum = zhiFuStatus
view.tempNum = view.selectNum
view.titleLbl.text = "请选择\(p3Arr[indexPath.row])"
if orderType == 1 {
if zhiFuWay == 0{
view.deSelectArr = [1,2,3]
}else{
view.deSelectArr = [0,1,2]
}
}
view.dataArr = zfTypeArr
break
......@@ -363,7 +381,7 @@ class DaiKeXiaDanGouWuViewController: BaseViewController,UITableViewDataSource,U
//MARK: - 跳转修改价格
var djTFstr:String = "";
var wkTFstr:String = "";
@objc func jumpToEditPrice(){
if orderType == 1 {//预售
let vc = XiuGaiYuShouJiaViewController()
......@@ -677,37 +695,37 @@ class DaiKeXiaDanGouWuViewController: BaseViewController,UITableViewDataSource,U
let countStr = cell.countTF.text! as NSString
let subtoal = priceStr.floatValue * countStr.floatValue
let goods = ["goods_name":cell.cellModel?.goods_name as Any, //商品名称
"dj_amount":djTFstr as Any,// 定金金额【预售订单才传
"wk_amount":wkTFstr as Any,//尾款金额【预售订单才传】
"sku_attr":cell.cellModel?.sku_attr as Any,//规格
"adsale_inventory":cell.cellModel?.adsale_inventory as Any,//库存【预售订单才传】
"number":cell.countTF.text as Any,//购买数量
"unit":cell.cellModel?.unit as Any,//单位
"price":cell.cellModel?.price as Any,//价格
"r_price":cell.priceTF.text as Any,//售价
"is_gift":0,//是否搭赠,1是0非,现版本固定0
"subtotal":subtoal,//总价
"goods_id":cell.cellModel?.goods_id as Any,//商品ID
"sku_id":cell.cellModel?.sku_id as Any] as [String : Any]
"dj_amount":djTFstr as Any,// 定金金额【预售订单才传
"wk_amount":wkTFstr as Any,//尾款金额【预售订单才传】
"sku_attr":cell.cellModel?.sku_attr as Any,//规格
"adsale_inventory":cell.cellModel?.adsale_inventory as Any,//库存【预售订单才传】
"number":cell.countTF.text as Any,//购买数量
"unit":cell.cellModel?.unit as Any,//单位
"price":cell.cellModel?.price as Any,//价格
"r_price":cell.priceTF.text as Any,//售价
"is_gift":0,//是否搭赠,1是0非,现版本固定0
"subtotal":subtoal,//总价
"goods_id":cell.cellModel?.goods_id as Any,//商品ID
"sku_id":cell.cellModel?.sku_id as Any] as [String : Any]
goodsArr.append(goods)
}
}else{
cellDataArr.forEach { (cell) in
let priceStr = cell.priceTF.text! as NSString
let countStr = cell.countTF.text! as NSString
let subtoal = priceStr.floatValue * countStr.floatValue
let goods = ["goods_name":cell.cellModel?.goods_name as Any,
"sku_attr":cell.cellModel?.sku_attr as Any,
"inventory":cell.cellModel?.inventory as Any,//库存【普通订单才传】
"number":cell.countTF.text as Any,
"unit":cell.cellModel?.unit as Any,
"price":cell.cellModel?.price as Any,
"r_price":cell.priceTF.text as Any,
"is_gift":0,
"subtotal":subtoal,
"goods_id":cell.cellModel?.goods_id as Any,
"sku_id":cell.cellModel?.sku_id as Any] as [String : Any]
"number":cell.countTF.text as Any,
"unit":cell.cellModel?.unit as Any,
"price":cell.cellModel?.price as Any,
"r_price":cell.priceTF.text as Any,
"is_gift":0,
"subtotal":subtoal,
"goods_id":cell.cellModel?.goods_id as Any,
"sku_id":cell.cellModel?.sku_id as Any] as [String : Any]
goodsArr.append(goods)
}
......@@ -717,7 +735,7 @@ class DaiKeXiaDanGouWuViewController: BaseViewController,UITableViewDataSource,U
}
//MARK:--处理提交数据OrderInfo
func getOrderInfo() -> String {
var orderInfo:String = ""
var payType = 0
if zhiFuWay == 0 {
......@@ -748,38 +766,38 @@ class DaiKeXiaDanGouWuViewController: BaseViewController,UITableViewDataSource,U
caddrId = adrData?.caddr_id! as! Int
}
}
if orderType == 1 {
var djpayType = 0
if dj_payWay == 0 {
djpayType = dj_payWay
}else if dj_payWay == 1 {
djpayType = 7
}else{
djpayType = dj_payWay + 7
}
var djpayStatus = 0
if dj_payStatus == 2 {
djpayStatus = 10 //月结
}else if dj_payStatus == 3 {
djpayStatus = 2 //已付款
}else{
djpayStatus = dj_payStatus
}
if dj_payWay == 0 {
djpayType = dj_payWay
}else if dj_payWay == 1 {
djpayType = 7
}else{
djpayType = dj_payWay + 7
}
var djpayStatus = 0
if dj_payStatus == 2 {
djpayStatus = 10 //月结
}else if dj_payStatus == 3 {
djpayStatus = 2 //已付款
}else{
djpayStatus = dj_payStatus
}
let dic = ["cus_id":cusModel?.cus_id as Any, //客户ID
"dj_pay_type":djpayType as Any,//支付类型,0未支付7现金9转账(私)10转账(公)11转账(微信)12转账(支付宝)
"dj_pay_status":djpayStatus as Any,//支付状态,0未付款;1欠款;2已付款10月结
"wk_pay_type":payType as Any,
"wk_pay_status":payStatus as Any,
"need_check":0,//付款是否需要审核 1是 0否
"s_status":(chuHuoWay + 1) as Any,//是否出库 1 暂不出库 2直接出库
"shipping_type":shipping_type as Any, //提货方式 1派送 2自提
"caddr_id":caddrId as Any,//客户地址id,无地址填0,一定要根据客户获取这个地址ID
"logistics_price":logistics_price as Any,//运费
"other_price":other_price as Any] as [String : Any]
"dj_pay_type":djpayType as Any,//支付类型,0未支付7现金9转账(私)10转账(公)11转账(微信)12转账(支付宝)
"dj_pay_status":djpayStatus as Any,//支付状态,0未付款;1欠款;2已付款10月结
"wk_pay_type":payType as Any,
"wk_pay_status":payStatus as Any,
"need_check":0,//付款是否需要审核 1是 0否
"s_status":(chuHuoWay + 1) as Any,//是否出库 1 暂不出库 2直接出库
"shipping_type":shipping_type as Any, //提货方式 1派送 2自提
"caddr_id":caddrId as Any,//客户地址id,无地址填0,一定要根据客户获取这个地址ID
"logistics_price":logistics_price as Any,//运费
"other_price":other_price as Any] as [String : Any]
orderInfo = dictChangeString(sender: dic)
}else{
......@@ -794,7 +812,7 @@ class DaiKeXiaDanGouWuViewController: BaseViewController,UITableViewDataSource,U
"other_price":other_price as Any] as [String : Any]
orderInfo = dictChangeString(sender: dic)
}
return orderInfo
}
//MARK:--运费 & 其他费用
......
......@@ -23,6 +23,14 @@ class XuanZeShangPinViewController: BaseViewController,UITableViewDelegate,UITab
//XuanZeShangPinCell
@IBAction func submitAction(_ sender: Any) {
print("submit")
for item in inputData{
if item.priceTF.text!.count == 0 {
HUD.flash(.label("请输入商品单价"),delay: 1.2)
return
}
}
if barTitle == "修改价格"{
delegate?.XuanZeShangPinViewControllerEdit(inputData:inputData)
}else{
......@@ -47,6 +55,8 @@ class XuanZeShangPinViewController: BaseViewController,UITableViewDelegate,UITab
var selectArr:Array<GetGoodsInfoDataModel> = []
var selectIdxArr:Array<IndexPath> = []
var inputData:Array<XuanZeShangPinCell> = []
var isSearch:Bool = false
var seacrchArr:Array<GetGoodsInfoDataModel> = [] //搜索数据
override func viewDidLoad() {
super.viewDidLoad()
navbar.title = barTitle
......@@ -90,8 +100,8 @@ class XuanZeShangPinViewController: BaseViewController,UITableViewDelegate,UITab
make.height.equalTo(30)
}
searchV = searchBr
searchBr.placeholderStr = "请输入品牌名称/商品编码"
searchBr.cornerRadius = 30*0.5
searchBr.placeholderStr = "请输入商品名称"
searchBr.cornerRadius = 35/2.0
searchBr.delegate = self
searchBr.delegateL = self
......@@ -99,12 +109,44 @@ class XuanZeShangPinViewController: BaseViewController,UITableViewDelegate,UITab
}
func clearSearchAction() {
print("清楚搜索文字")
isSearch = false
listView.reloadData()
}
func searchBarSearchButtonClicked(_ searchBar: UISearchBar) {
print("点击搜索进行--")
isSearch = true
getSearch(sender: searchBar.text!)
listView.reloadData()
searchBar.resignFirstResponder()
}
func getSearch(sender:String) {
seacrchArr.removeAll()
datas.forEach { (md) in
if md.goods_name!.contains(sender) {
seacrchArr.append(md)
}
}
}
//MARK: - textfield编辑结束
func textFieldDidEndEditing(_ textField: UITextField) {
let idx = IndexPath(row: textField.tag, section: 0)
let cell = listView.cellForRow(at: idx) as! XuanZeShangPinCell
let num = textField.text as! NSString
if textField == cell.countTF {
if num.integerValue < 1 {
HUD.flash(.label("数量不得低于1"),delay: 1.2)
cell.countTF.text = "1"
}
}
if textField == cell.priceTF {
if num.floatValue <= 0 {
HUD.flash(.label("请输入商品单价"),delay: 1.2)
}
}
}
func textFieldShouldReturn(_ textField: UITextField) -> Bool {
textField.resignFirstResponder()
if barTitle == "修改价格"{
......@@ -176,7 +218,7 @@ class XuanZeShangPinViewController: BaseViewController,UITableViewDelegate,UITab
cell.priceTF.keyboardType = .decimalPad
cell.priceTF.returnKeyType = .done
cell.countTF.returnKeyType = .done
if barTitle == "修改价格"{
let cell1 = inputData[indexPath.row]
cell.sku_id = cell1.sku_id
......@@ -207,7 +249,16 @@ class XuanZeShangPinViewController: BaseViewController,UITableViewDelegate,UITab
cell.priceTF.text = model.price!
if isYuShou {//预售
if idx == indexPath {
cell.maxNum = model.adsale_inventory
var isSelectByData = false
selectArr.forEach { (md) in
if md.sku_id == model.sku_id {
isSelectByData = true
}
}
if isSelectByData {
cell.selectBtn.isSelected = true
cell.btmView.isHidden = false
cell.btmViewHeight.constant = 89
......@@ -217,27 +268,36 @@ class XuanZeShangPinViewController: BaseViewController,UITableViewDelegate,UITab
cell.btmViewHeight.constant = 0
}
}else{//非预售
cell.maxNum = model.inventory
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
}
var isSelectByData = false
selectArr.forEach { (md) in
if md.sku_id == model.sku_id {
isSelectByData = true
}
}
if isSelectByData {
cell.selectBtn.isSelected = true
cell.btmView.isHidden = false
cell.btmViewHeight.constant = 89
}
}
}
return cell
}
func XuanZeShangPinCellTextChange(index: IndexPath) {
let cell = listView.cellForRow(at: index) as! XuanZeShangPinCell
func XuanZeShangPinCellTextChange(index: IndexPath,sender:XuanZeShangPinCell) {
for i in 0 ..< inputData.count{
let item = inputData[i]
if cell.sku_id == item.sku_id{
inputData.insert(cell, at: i)
if sender.sku_id == item.sku_id{
inputData.insert(sender, at: i)
inputData.remove(at: i+1)
}
}
......@@ -266,11 +326,21 @@ class XuanZeShangPinViewController: BaseViewController,UITableViewDelegate,UITab
func XuanZeShangPinCellBtnClick(index:IndexPath) {
let cell = listView.cellForRow(at: index) as! XuanZeShangPinCell
if isYuShou{//预售
let model = datas[index.row]
if model.adsale_inventory == 0 {
HUD.flash(.label("库存为0,无法下单"),delay: 1.2)
return
}
idx = index
inputData.removeAll()
inputData.append(cell)
}else{//非预售
let data = datas[index.row]
if data.inventory == 0 {
HUD.flash(.label("库存为0,无法下单"),delay: 1.2)
return
}
let idx = selectArr.firstIndex { (model) -> Bool in
return (data.sku_id == model.sku_id)
}
......@@ -296,8 +366,12 @@ class XuanZeShangPinViewController: BaseViewController,UITableViewDelegate,UITab
if barTitle == "修改价格"{
return inputData.count
}
if isSearch {
return seacrchArr.count
}
return datas.count
}
}
......@@ -34,7 +34,7 @@ class GYSListViewController: BaseViewController,UITableViewDataSource,UITableVie
}
searchV = searchBr
searchBr.placeholderStr = "供应商名称/联系人/电话号码"
searchBr.cornerRadius = 30*0.5
searchBr.cornerRadius = 35/2.0
searchBr.delegate = self
searchBr.delegateL = self
......
......@@ -667,7 +667,7 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
break
case "物流费用":
cell.textTF.text = wuLiuPrice
cell.textTF.keyboardType = .numbersAndPunctuation
cell.textTF.keyboardType = .decimalPad
break
default:
break
......
......@@ -419,7 +419,7 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
break
case "物流费用":
cell.textTF.text = wuLiuPrice
cell.textTF.keyboardType = .numbersAndPunctuation
cell.textTF.keyboardType = .decimalPad
break
default:
break
......
......@@ -244,7 +244,7 @@ class SJMapViewController: UIViewController,AMapLocationManagerDelegate,MAMapVie
}
searchV = searchBr
searchBr.placeholderStr = "搜索地点"
searchBr.cornerRadius = 30*0.5
searchBr.cornerRadius = 35/2.0
searchBr.delegate = self
searchBr.delegateL = self
}
......
......@@ -29,7 +29,7 @@ class DZGLViewController: BaseViewController,UITableViewDelegate,UITableViewData
override func viewDidLoad() {
super.viewDidLoad()
navbar.title = "地址管理"
navbar.rightTitle = "新增"
// navbar.rightTitle = "新增"
self.view.addSubview(navbar)
HUD.flash(.progress)
......
<?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">
<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">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15704"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
<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"/>
......@@ -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="DiZhiGuanLiCell" customModule="GeliBusinessPlatform" customModuleProvider="target">
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="KGk-i7-Jjw" customClass="DiZhiGuanLiCell" customModule="TestClass" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="375" height="79"/>
<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">
......@@ -30,7 +30,7 @@
<color key="textColor" name="标题字颜色"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="寄" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="jf6-0X-5eB">
<label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="寄" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="jf6-0X-5eB">
<rect key="frame" x="189" y="15.5" width="18" height="18"/>
<constraints>
<constraint firstAttribute="width" constant="18" id="KUq-24-4Xw"/>
......@@ -51,7 +51,7 @@
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="收" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="mWp-V0-KaZ">
<label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="收" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="mWp-V0-KaZ">
<rect key="frame" x="217" y="15.5" width="18" height="18"/>
<constraints>
<constraint firstAttribute="width" constant="18" id="Yz5-IC-luF"/>
......
......@@ -34,7 +34,7 @@ class BingDingKeHuViewController: BaseViewController,UITableViewDelegate,UITable
}
searchV = searchBr
searchBr.placeholderStr = "客户名称/联系人/电话号码"
searchBr.cornerRadius = 30*0.5
searchBr.cornerRadius = 35/2.0
searchBr.delegate = self
searchBr.delegateL = self
......
......@@ -46,7 +46,7 @@ class KeHuListViewController: BaseViewController,UITableViewDelegate,UITableView
}
searchV = searchBr
searchBr.placeholderStr = "客户名称/联系人/电话号码"
searchBr.cornerRadius = 30*0.5
searchBr.cornerRadius = 35/2.0
searchBr.delegate = self
searchBr.delegateL = self
......
......@@ -39,7 +39,7 @@ class YingFuZKListViewController: BaseViewController,UISearchBarDelegate,SearchB
}
searchV = searchBr
searchBr.placeholderStr = "请输入品牌名称/商品编码"
searchBr.cornerRadius = 30*0.5
searchBr.cornerRadius = 35/2.0
searchBr.delegate = self
searchBr.delegateL = self
......
......@@ -31,7 +31,7 @@ class PuTongJieTiCell: UITableViewCell,UITextFieldDelegate {
priceTF.tag = 0
countTF.tag = 1
countTF.keyboardType = .numberPad
priceTF.keyboardType = .numbersAndPunctuation
priceTF.keyboardType = .decimalPad
priceTF.returnKeyType = .done
priceTF.delegate = self
// Initialization code
......
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