Commit cd1bdede authored by lujunye's avatar lujunye

修复已知bug

parent b1b8dbd2
......@@ -6,6 +6,17 @@
// Created by geli on 2018/6/22.
// Copyright © 2018年 geli. All rights reserved.
//
////融云账号&融云密码
////18924107259
////81338860geLI
////
////苹果账号&密码
////notice@gelifood.com
////81338860^geLi
////极光密码
////GeliFood
////81338860geLI
////
import UIKit
import ESTabBarController_swift
......@@ -253,17 +264,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate,loginDelegate, UITabBarCon
v3.tabBarItem = ESTabBarItem.init(ExampleBouncesContentView(), title: "工作中心", image: UIImage(named: "tab_btn_gongzuo_nor"), selectedImage: UIImage(named: "tab_btn_gongzuo_hig"))
v4.tabBarItem = ESTabBarItem.init(ExampleBouncesContentView(), title: "仓库管理", image: UIImage(named: "tab_btn_cangku_nor"), selectedImage: UIImage(named: "tab_btn_cangku_hig"))
v5.tabBarItem = ESTabBarItem.init(ExampleBouncesContentView(), title: "个人中心", image: UIImage(named: "tab_btn_geren_nor"), selectedImage: UIImage(named: "tab_btn_geren_hig"))
// Create the SwiftUI view that provides the window contents.
tabBarController.viewControllers = [v1, v2, v3, v4, v5]
tabBarController.selectedIndex = 2
let contentView = tabBarController
// if let windowScene = sceneC as? UIWindowScene {
if isAgain {
let transtition = CATransition()
......@@ -293,14 +299,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate,loginDelegate, UITabBarCon
//添加通知,才加载数据
print(viewController)
}
}
////
//// AppDelegate.swift
//// GeliBusinessPlatform
......@@ -308,17 +309,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate,loginDelegate, UITabBarCon
//// Created by junye lu on 2020/4/14.
//// Copyright © 2020 junye lu. All rights reserved.
////
////融云账号&融云密码
////18924107259
////81338860geLI
////
////苹果账号&密码
////notice@gelifood.com
////81338860^geLi
////极光密码
////GeliFood
////81338860geLI
////
//import UIKit
////import RongIMKit
//
......
......@@ -83,28 +83,25 @@ class AddImgCell: UITableViewCell {
addBtn.isHidden = true
}
scrollView?.contentSize = CGSize(width: arr.count*105, height: 0)
if isAllEditing {
scrollView?.frame = CGRect(x: 15, y: CGFloat(y), width: CGFloat(arr.count)*105, height:h)
addBtnX.constant = (scrollView?.frame.maxX)!
}else{
scrollView?.frame = CGRect(x: 15, y: CGFloat(y), width: fullScreenWidth-30,height:h)
}
}else if arr.count == 5 {
addBtn.isHidden = true
if isAllEditing {
scrollView?.contentSize = CGSize(width: arr.count*105, height: 0)
scrollView?.frame = CGRect(x: 15, y: CGFloat(y), width: fullScreenWidth-30, height:h)
}else{
scrollView?.frame = CGRect(x: 15, y: CGFloat(y), width: fullScreenWidth-30,height:h)
}
}else{
if isAllEditing {
scrollView?.frame = CGRect(x: 15, y: CGFloat(y), width: fullScreenWidth-130, height:h)
addBtnX.constant = fullScreenWidth-105
}else{
scrollView?.frame = CGRect(x: 15, y: CGFloat(y), width: fullScreenWidth-30,height:h)
let w = 90 * CGFloat(arr.count) + (CGFloat(arr.count-1)) * 15
var sw = w
if w > (fullScreenWidth - 30){
sw = fullScreenWidth - 30
}
scrollView?.frame = CGRect(x: 15, y: CGFloat(y), width: sw,height:h)
}
scrollView?.contentSize = CGSize(width: arr.count*105, height: 0)
}
......
......@@ -7,16 +7,16 @@
//
import UIKit
@objc protocol GuanLianKeHuCellDelegate {
@objc optional func btnSelect(sender:UIButton,cell:GuanLianKeHuCell)
}
//@objc protocol GuanLianKeHuCellDelegate {
// @objc optional func btnSelect(sender:UIButton,cell:GuanLianKeHuCell)
//}
class GuanLianKeHuCell: UITableViewCell {
@IBAction func btnClick(_ sender: UIButton) {
delegate?.btnSelect?(sender: sender,cell:self)
// delegate?.btnSelect?(sender: sender,cell:self)
}
@IBOutlet weak var imgBtn: UIButton!
var delegate:GuanLianKeHuCellDelegate?
// var delegate:GuanLianKeHuCellDelegate?
@IBOutlet weak var detailLbl: UILabel!
@IBOutlet weak var companyLbl: UILabel!
@IBOutlet weak var personLbl: UILabel!
......@@ -31,7 +31,7 @@ class GuanLianKeHuCell: UITableViewCell {
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
......
......@@ -177,7 +177,7 @@ class DaiKeXiaDanGouWuViewController: BaseViewController,UITableViewDataSource,U
cell.titleLbl.text = cellData.goods_name
cell.detailLbl.text = "\(cellData.spec_str!)/\(cellData.unit!)"
cell.detailLbl2.text = "¥" + cellData.target_Price! + "x\(cellData.target_Count!)"
let priceStr = cellData.target_Price as! NSString
let priceStr = cellData.target_Price?.replacingOccurrences(of: "", with: ",") as! NSString
let totalP = priceStr.floatValue * Float(cellData.target_Count!)
cell.totalPriceLbl.text = "\(totalP)"
......@@ -421,7 +421,7 @@ class DaiKeXiaDanGouWuViewController: BaseViewController,UITableViewDataSource,U
vc.djTFstr = djTFstr
vc.wkTFstr = wkTFstr
let item = cellDataArr[0];
let price = item.target_Price as! NSString
let price = item.target_Price?.replacingOccurrences(of: "", with: ",") as! NSString
let tp = price.floatValue * Float(item.target_Count!)
vc.totalPrice = tp
vc.delegate = self
......@@ -578,7 +578,7 @@ class DaiKeXiaDanGouWuViewController: BaseViewController,UITableViewDataSource,U
var pArr:Array<CGFloat> = []
var totalC:Int = 0
for item in cellDataArr{
let price = item.target_Price as! NSString
let price = item.target_Price?.replacingOccurrences(of: "", with: ",") as! NSString
let tp = price.floatValue * Float(item.target_Count!)
pArr.append(CGFloat(tp))
totalC = totalC + item.target_Count!
......
......@@ -30,15 +30,29 @@ class XuanZeShangPinViewController: BaseViewController,UITableViewDelegate,UITab
// }
// }
if barTitle == "修改价格"{
let item = selectArr.first
print(item?.target_Count)
delegate?.XuanZeShangPinViewControllerEdit(selectArr:selectArr)
if barTitle == "修改价格"
{
if selectArr.count != 0 {
delegate?.XuanZeShangPinViewControllerEdit(selectArr:selectArr)
}else{
HUD.flash(.label("请选择商品"), delay: 1.2)
return
}
}else{
if isYuShou {
delegate?.XuanZeShangPinViewControllerYuShou(YuShouData: selectArr)
if selectArr.count != 0 {
delegate?.XuanZeShangPinViewControllerYuShou(YuShouData: selectArr)
}else{
HUD.flash(.label("请选择商品"), delay: 1.2)
return
}
}else{
delegate?.XuanZeShangPinViewControllerSubmitAction(selectArr: selectArr)
if selectArr.count != 0 {
delegate?.XuanZeShangPinViewControllerSubmitAction(selectArr: selectArr)
}else{
HUD.flash(.label("请选择商品"), delay: 1.2)
return
}
}
}
self.navigationController?.popViewController(animated: true)
......
......@@ -20,6 +20,7 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
var delegate:EPViewControllerDelegate?
@IBOutlet weak var btmColor: UIView!
@IBOutlet weak var btmBtnViewH: NSLayoutConstraint!
@IBOutlet weak var listTbv: UITableView!
......@@ -124,10 +125,12 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
let btn = UIButton(frame: CGRect(x: 0 , y: 1, width:fullScreenWidth, height: 49))
self.btmBtnBGView.addSubview(btn)
btn.setTitle(self.editActionArr[i], for: .normal)
btn.setTitleColor(UIColor(named: "蓝色字体颜色"), for: .normal)
btn.titleLabel?.font = UIFont.boldSystemFont(ofSize: 13)
btn.setTitleColor(UIColor.white, for: .normal)
btn.backgroundColor = UIColor(named: "蓝色字体颜色")
btn.titleLabel?.font = UIFont.boldSystemFont(ofSize: 17)
btn.addTarget(self, action: #selector(self.btmBtnClick(sender:)), for: .touchUpInside)
}
self.btmColor.backgroundColor = UIColor(named: "蓝色字体颜色")
}) { (error) in
}
......@@ -235,7 +238,7 @@ class EPViewController: BaseViewController,UITableViewDelegate,UITableViewDataSo
view.removeFromSuperview()
}
self.setBtmBtnUi()
self.btmColor.backgroundColor = UIColor.white
self.isAllEditing = false
self.listTbv.reloadData()
self.delegate?.EPViewControllerFinishEdit()
......
......@@ -2,6 +2,7 @@
<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>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
<capability name="Named colors" minToolsVersion="9.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
......@@ -12,6 +13,7 @@
<connections>
<outlet property="btmBtnBGView" destination="H2x-8q-Enj" id="zfZ-07-szf"/>
<outlet property="btmBtnViewH" destination="zvU-A1-Wlq" id="gZn-F8-1hh"/>
<outlet property="btmColor" destination="8BW-ln-Nxl" id="NaS-vQ-Loi"/>
<outlet property="listTbv" destination="pjO-Zv-8Xp" id="K9d-qK-6Qg"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
</connections>
......
......@@ -13,11 +13,11 @@ import LGButton
protocol GuanLianKehuVCDelegate {
func GuanLianKehuSelect(keHuData:CusListAllDataModel)
}
class GuanLianKehuVC: BaseViewController , UITableViewDelegate, UITableViewDataSource,GuanLianKeHuCellDelegate,GeliAlertViewDelegate{
class GuanLianKehuVC: BaseViewController , UITableViewDelegate, UITableViewDataSource,GeliAlertViewDelegate{
var delegate:GuanLianKehuVCDelegate?
@IBOutlet weak var btnLblH: NSLayoutConstraint!
@IBOutlet weak var btn: LGButton!
var selectIdx:Int? = nil//暂代关联客户数据
......@@ -25,30 +25,36 @@ class GuanLianKehuVC: BaseViewController , UITableViewDelegate, UITableViewDataS
@IBAction func submitAction(_ sender: LGButton) {
print("确定")
if order_id == 0 {
//MARK:--代客下单流程的关联客服
self.delegate?.GuanLianKehuSelect(keHuData: self.dataArr[self.selectIdx!])
self.navigationController?.popViewController(animated: true)
if selectIdx != nil {
self.delegate?.GuanLianKehuSelect(keHuData: self.dataArr[self.selectIdx!])
self.navigationController?.popViewController(animated: true)
}else{
HUD.flash(.label("请选择关联客户"), delay: 1.2)
}
return
}
if selectIdx != nil{
HUD.flash(.progress)
let model = self.dataArr[self.selectIdx!]
let UserToken = UserDefaults.standard.value(forKey: "user_token")
bindCus(["cus_id":model.cus_id as Any,"user_token":UserToken as Any,"order_id":order_id as Any], success: { (data) in
let dataM = data as! UpDataModel
if dataM.code == 1 {
self.delegate?.GuanLianKehuSelect(keHuData: self.dataArr[self.selectIdx!])
self.navigationController?.popViewController(animated: true)
}
}) { (error) in
}
}else{
HUD.flash(.label("请选择关联客户"), delay: 1.2)
}
......@@ -79,7 +85,7 @@ class GuanLianKehuVC: BaseViewController , UITableViewDelegate, UITableViewDataS
if self.dataArr.count == 0 {
self.btn.isHidden = true
self.btnLblH.constant = 0
let alertView = GeliAlertView(frame: self.view.window!.bounds)
alertView.delegate = self;
alertView.tishiLbl.text = ""
......@@ -100,7 +106,7 @@ class GuanLianKehuVC: BaseViewController , UITableViewDelegate, UITableViewDataS
//MARK: - alertView delegate
func sureGeliAlertViewAction(sender: UIButton) {
let url:URL?=URL.init(string: "https://cms.gelifood.com/market/")
UIApplication.shared.open(url!, options: [:], completionHandler: nil)
UIApplication.shared.open(url!, options: [:], completionHandler: nil)
}
var tableV :UITableView!
......@@ -135,8 +141,11 @@ class GuanLianKehuVC: BaseViewController , UITableViewDelegate, UITableViewDataS
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "GuanLianKeHuCell") as! GuanLianKeHuCell
cell.delegate = self
cell.tag = indexPath.row
cell.imgBtn.isSelected = false
let rowModel = self.dataArr[indexPath.row]
cell.senderLbl.text = rowModel.cus_name
......@@ -161,28 +170,22 @@ class GuanLianKehuVC: BaseViewController , UITableViewDelegate, UITableViewDataS
cell.imgBtn.isSelected = true
selectIdx = indexPath.row
}
}else{
if selectIdx == indexPath.row {
cell.imgBtn.isSelected = true
}
}
return cell
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
print(indexPath)
selectIdx = indexPath.row
tableV.reloadData()
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 100*glscale
}
//MARK: - GuanLianKeHuCell delegate
func btnSelect(sender: UIButton,cell:GuanLianKeHuCell) {
let cells = tableV.visibleCells
for cel in cells {
let c = cel as! GuanLianKeHuCell
c.imgBtn.isSelected = false
if c == cell {
c.imgBtn.isSelected = true
selectIdx = c.tag
}
}
}
}
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