Commit 8875f252 authored by lujunye's avatar lujunye

待调试融云

parent 7522d8a9
......@@ -512,6 +512,7 @@
E02DDD942450106C00ABB707 /* PuTongJieTiCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = PuTongJieTiCell.xib; sourceTree = "<group>"; };
E02DDD9724501A5B00ABB707 /* DelGuiGeCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DelGuiGeCell.swift; sourceTree = "<group>"; };
E02DDD9824501A5B00ABB707 /* DelGuiGeCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = DelGuiGeCell.xib; sourceTree = "<group>"; };
E02F43C1246A91C1000ECFB1 /* GeliBusinessPlatform.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = GeliBusinessPlatform.entitlements; sourceTree = "<group>"; };
E02FD9EA2455627300E10E27 /* ChuKuViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChuKuViewController.swift; sourceTree = "<group>"; };
E02FD9EB2455627300E10E27 /* ChuKuViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ChuKuViewController.xib; sourceTree = "<group>"; };
E02FD9EF2455705F00E10E27 /* ChuRuKuJiLuCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChuRuKuJiLuCell.swift; sourceTree = "<group>"; };
......@@ -1086,6 +1087,7 @@
E00D85DD244561FD00F5F816 /* GeliBusinessPlatform */ = {
isa = PBXGroup;
children = (
E02F43C1246A91C1000ECFB1 /* GeliBusinessPlatform.entitlements */,
E088CC882446FFA1000DAA8A /* Other */,
E01C26B32446AEF800ADCC70 /* DEMO */,
E09B03B32445B19400211A51 /* Interface */,
......@@ -1765,9 +1767,9 @@
E0F97B062451620B001BD600 /* ProductDetailViewController.swift */,
E0F97B072451620B001BD600 /* ProductDetailViewController.xib */,
E0647ABF2468E30B008C5A34 /* EditProductViewController.swift */,
E0647AC02468E30B008C5A34 /* EditProductViewController.xib */,
E0F1BE4A24692F07003015B2 /* EditProductImgCell.swift */,
E0F1BE4B24692F07003015B2 /* EditProductImgCell.xib */,
E0647AC02468E30B008C5A34 /* EditProductViewController.xib */,
E0F1BE4624692379003015B2 /* ItemCell.swift */,
E0F1BE4724692379003015B2 /* ItemCell.xib */,
);
......@@ -3002,6 +3004,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = GeliBusinessPlatform/GeliBusinessPlatform.entitlements;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_ASSET_PATHS = "\"GeliBusinessPlatform/Preview Content\"";
DEVELOPMENT_TEAM = K48346UACH;
......@@ -3022,6 +3025,7 @@
);
PRODUCT_BUNDLE_IDENTIFIER = GeliBusinessPlatform.GeliBusinessPlatform;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
"SWIFT_OBJC_BRIDGING_HEADER[arch=*]" = "$(SRCROOT)/GeliBusinessPlatform/Define/Bridge_Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
......@@ -3035,6 +3039,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = GeliBusinessPlatform/GeliBusinessPlatform.entitlements;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_ASSET_PATHS = "\"GeliBusinessPlatform/Preview Content\"";
DEVELOPMENT_TEAM = K48346UACH;
......@@ -3055,6 +3060,7 @@
);
PRODUCT_BUNDLE_IDENTIFIER = GeliBusinessPlatform.GeliBusinessPlatform;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
......
......@@ -7,31 +7,98 @@
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
import RongIMKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate,RCConnectionStatusChangeDelegate,RCIMClientReceiveMessageDelegate,UNUserNotificationCenterDelegate {
func onReceived(_ message: RCMessage!, left nLeft: Int32, object: Any!) {
print("message == ",message.content)
}
func onConnectionStatusChanged(_ status: RCConnectionStatus) {
print("changed == ",status.rawValue)
}
func onReceived(_ message: RCMessage!, left nLeft: Int32, object: Any!, offline: Bool, hasPackage: Bool) {
print("onReceived == ",message.content)
}
var RY_App_Key = "3argexb63sxae"
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
RCIM.shared()?.initWithAppKey(RY_App_Key)
registerNotification(application)
RCIMClient.shared()?.connect(withToken: "SMJo9B9AUTIHHcHCuZq8soPnFqzfPZJIh7xoVOlRtu8=@ta3m.cn.rongnav.com;ta3m.cn.rongcfg.com", success: { (userId) in
print("userid = \(userId)")
}, error: { (status) in
print("status = \(status)")
}, tokenIncorrect: {
print("错误")
})
RCIMClient.shared()?.setRCConnectionStatusChangeDelegate(self)
RCIMClient.shared()?.setReceiveMessageDelegate(self, object: nil)
return true
}
func application(_ application: UIApplication, didRegister notificationSettings: UIUserNotificationSettings) {
application.registerForRemoteNotifications()
}
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
let nsdataStr = NSData(data: deviceToken)
let datastr = nsdataStr.description.replacingOccurrences(of: "<", with: "").replacingOccurrences(of: ">", with: "").replacingOccurrences(of: " ", with: "")
print("deviceToken:\(datastr)")
RCIMClient.shared()?.setDeviceToken(datastr)
}
func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) {
//TODO: 注册失败后的结果, 可以在这里记录失败结果, 以后再伺机弹框给用户打开通知
print("错误=== ",error)
}
// MARK: UISceneSession Lifecycle
func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
// Called when a new scene session is being created.
// Use this method to select a configuration to create the new scene with.
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
}
func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
// Called when the user discards a scene session.
// If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
// Use this method to release any resources that were specific to the discarded scenes, as they will not return.
}
}
extension AppDelegate{
func registerNotification(_ application: UIApplication) {
if #available(iOS 10.0, *) {
let center = UNUserNotificationCenter.current()
center.delegate = self
center.requestAuthorization(options: [.alert, .sound, .badge]) { (granted: Bool, error: Error?) in
DispatchQueue.main.async {
if granted { application.registerForRemoteNotifications() }
}
}
} else {
let settings = UIUserNotificationSettings(types: [.alert, .sound, .badge], categories: nil)
application.registerForRemoteNotifications()
application.registerUserNotificationSettings(settings)
}
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>aps-environment</key>
<string>development</string>
</dict>
</plist>
......@@ -61,6 +61,7 @@
<key>UIBackgroundModes</key>
<array>
<string>location</string>
<string>remote-notification</string>
</array>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
......
......@@ -10,7 +10,7 @@ import UIKit
import IQKeyboardManagerSwift
@objc protocol GLAlertSelectViewDelegate {
@objc optional func GLAlertSelectViewClick(selectNum:Int,view:UIView)
@objc optional func GLAlertSelectViewClick(selectNum:NSString,view:UIView)
@objc optional func GLAlertMoreSelectViewClick(sender:NSArray,view:UIView)
@objc optional func GLAlertSelectViewClose(sender:UIButton)
......@@ -23,17 +23,10 @@ class GLAlertSelectView: UIView,UITableViewDelegate,UITableViewDataSource,TitleA
var contentView:UIView!
var delegate:GLAlertSelectViewDelegate?
var inputTextTF:UITextField?
var isMultipleSelect:Bool?
var selectArray:NSMutableArray?
var selectNum:Int = 99
var selectNum:String? = ""
var dataArr = Array<String>(){
didSet{
if isMultipleSelect == true {
selectArray = NSMutableArray(capacity: 10)
for _ in 0 ..< dataArr.count {
selectArray?.add("99")
}
}
var tbvH = CGFloat(dataArr.count * 49)
if tbvH > fullScreenHeight*0.6 {
tbvH = fullScreenHeight*0.6
......@@ -142,21 +135,30 @@ class GLAlertSelectView: UIView,UITableViewDelegate,UITableViewDataSource,TitleA
cell.delegate = self
cell.tag = indexPath.row
cell.nameLbl.text = dataArr[indexPath.row]
return cell
}
let cell = tableView.dequeueReusableCell(withIdentifier: "selectTbvCell") as! TitleAndSelectCell
cell.titleLbl.text = dataArr[indexPath.row]
cell.delegate = self
cell.tag = indexPath.row
for item in selectArray! {
let row = "\(item)" as! NSString
if row.integerValue == indexPath.row {
cell.titleLbl.textColor = UIColor(named: "蓝色字体颜色")
cell.selectBtn.isSelected = true
}
}
return cell
}
@IBAction func submitClick(_ sender: Any) {
if (titleLbl.text?.contains("库位"))! {
}else{
if isMultipleSelect == false {
delegate?.GLAlertSelectViewClick?(selectNum: selectNum,view: self)
if selectNum!.count > 0 {
delegate?.GLAlertSelectViewClick?(selectNum: selectNum as! NSString,view: self)
}else{
delegate?.GLAlertMoreSelectViewClick?(sender: selectArray!,view:self)
}
}
......@@ -164,17 +166,16 @@ class GLAlertSelectView: UIView,UITableViewDelegate,UITableViewDataSource,TitleA
//MARK: - 自定义CELL DELEGATE
//普通
func TitleAndSelectCellClick(content: UIButton, cell: TitleAndSelectCell) {
if isMultipleSelect == false {
if selectNum!.count > 0 {
for item in selectTbv.visibleCells {
let cel = item as! TitleAndSelectCell
cel.selectBtn.isSelected = false
if cell == cel {
cell.selectBtn.isSelected = true
selectNum = cell.tag
selectNum = "\(cell.tag)"
}
}
}else{
cell.titleLbl.textColor = UIColor(named: "")
if cell.selectBtn.isSelected == true {
cell.selectBtn.isSelected = false
......@@ -185,7 +186,6 @@ class GLAlertSelectView: UIView,UITableViewDelegate,UITableViewDataSource,TitleA
cell.selectBtn.isSelected = true
selectArray!.replaceObject(at: cell.tag, with: cell.tag)
}
// delegate?.GLAlertMoreSelectViewClick?(sender: selectArray!, cell: cell)
}
}
//库位
......
......@@ -22,7 +22,7 @@
<constraint firstAttribute="height" constant="52" id="jMA-bb-CP8"/>
<constraint firstAttribute="width" constant="78" id="zxB-d3-CDh"/>
</constraints>
<state key="normal" image="xinzeng "/>
<state key="normal" image="xinzeng"/>
<connections>
<action selector="btnClick:" destination="KGk-i7-Jjw" eventType="touchUpInside" id="f2z-zc-fd6"/>
</connections>
......@@ -41,6 +41,6 @@
</tableViewCell>
</objects>
<resources>
<image name="xinzeng " width="78" height="51.5"/>
<image name="xinzeng" width="78" height="51.5"/>
</resources>
</document>
......@@ -7,9 +7,20 @@
//
import UIKit
@objc protocol ShangPinGguiGeCellDelegate {
@objc optional func ShangPinGguiGeCellEditAction(cell:ShangPinGguiGeCell)
}
class ShangPinGguiGeCell: UITableViewCell {
var delegate:ShangPinGguiGeCellDelegate?
@IBAction func editAction(_ sender: Any) {
delegate?.ShangPinGguiGeCellEditAction?(cell: self)
}
// var itemIdx:Int?
@IBOutlet weak var tempLbl: UILabel!
@IBOutlet weak var weightLbl: UILabel!
@IBOutlet weak var guiGeLbl: UILabel!
@IBOutlet weak var danWeiLbl: UILabel!
@IBOutlet weak var sellPriceLbl: UILabel!
override func awakeFromNib() {
super.awakeFromNib()
selectionStyle = .none
......
......@@ -85,6 +85,9 @@
<state key="normal" title="编辑规格">
<color key="titleColor" name="蓝色字体颜色"/>
</state>
<connections>
<action selector="editAction:" destination="KGk-i7-Jjw" eventType="touchUpInside" id="NUZ-aA-T5Q"/>
</connections>
</button>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="K2a-dA-ghw">
<rect key="frame" x="187" y="14.5" width="1" height="20"/>
......@@ -145,6 +148,13 @@
</constraints>
</tableViewCellContentView>
<viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
<connections>
<outlet property="danWeiLbl" destination="oOy-dE-JIB" id="Dw6-Zt-80o"/>
<outlet property="guiGeLbl" destination="GPm-DS-HCD" id="ePF-lx-scy"/>
<outlet property="sellPriceLbl" destination="Mw0-dB-6KQ" id="ofk-s2-w0v"/>
<outlet property="tempLbl" destination="bIm-PK-kvk" id="QrY-UP-WZk"/>
<outlet property="weightLbl" destination="EeX-7S-sb3" id="bkH-WA-6Wt"/>
</connections>
<point key="canvasLocation" x="131.15942028985509" y="121.875"/>
</tableViewCell>
</objects>
......
......@@ -9,6 +9,7 @@
import UIKit
@objc protocol TitleAndSwitchCellDelegate {
@objc optional func switchClick(content:UISwitch,cell:TitleAndSwitchCell)
}
class TitleAndSwitchCell: UITableViewCell {
var delegate:TitleAndSwitchCellDelegate?
......
......@@ -10,6 +10,8 @@ import UIKit
class DaiKeXiaDanGouWuViewController: BaseViewController,UITableViewDataSource,UITableViewDelegate,DaiKeXiaDanFooterViewDelegate,TitleAndBtnCellDelegate,GLAlertSelectViewDelegate{
var orderType = "99" //订单类型
var glSelectView:GLAlertSelectView? = nil
var holderArr = ["未支付","未付款","自提","暂不出库","0","0"]
let p3Arr = ["支付状态","支付方式","提货方式","出货状态","运费","其他费用"]
......@@ -114,6 +116,7 @@ class DaiKeXiaDanGouWuViewController: BaseViewController,UITableViewDataSource,U
}
return 49
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
switch indexPath.section {
case 0:
......@@ -123,7 +126,8 @@ class DaiKeXiaDanGouWuViewController: BaseViewController,UITableViewDataSource,U
}else{
if glSelectView == nil {
let view = GLAlertSelectView(frame: self.view.bounds)
view.isMultipleSelect = false//是否多选
// view.isMultipleSelect = false//是否多选
view.selectNum = orderType
view.delegate = self
view.titleLbl.text = "请选择订单类型"
view.dataArr = ["普通订单","预售下单"]
......@@ -138,27 +142,33 @@ class DaiKeXiaDanGouWuViewController: BaseViewController,UITableViewDataSource,U
break
}
}
var zhiFuType = "99"
var zhiFuWay = "99"
var tiHuoWay = "99"
var chuHuoWay = "99"
func btnClick(content: String, cell: TitleAndBtnCell) {
if glSelectView == nil {
let view = GLAlertSelectView(frame: self.view.bounds)
view.isMultipleSelect = false//是否多选
// view.isMultipleSelect = false//是否多选
view.delegate = self
switch cell.tag {
case 0://支付状态
view.selectNum = zhiFuType
view.titleLbl.text = "请选择\(p3Arr[cell.tag])"
view.dataArr = ["预售","普通","期货","团购"]
break
case 1://支付方式
view.selectNum = zhiFuWay
view.titleLbl.text = "请选择\(p3Arr[cell.tag])"
view.dataArr = ["预售","普通","期货","团购"]
break
case 2://提货方式
view.selectNum = tiHuoWay
view.titleLbl.text = "请选择\(p3Arr[cell.tag])"
view.dataArr = ["预售","普通","期货","团购"]
break
default://出货状态
view.selectNum = chuHuoWay
view.titleLbl.text = "请选择\(p3Arr[cell.tag])"
view.dataArr = ["预售","普通","期货","团购"]
break
......@@ -168,7 +178,7 @@ class DaiKeXiaDanGouWuViewController: BaseViewController,UITableViewDataSource,U
glSelectView = view
}
}
func GLAlertSelectViewClick(selectNum: Int, view: UIView) {
func GLAlertSelectViewClick(selectNum: NSString, view: UIView) {
print("单选",selectNum)
glSelectView?.removeFromSuperview()
glSelectView = nil
......
......@@ -11,10 +11,10 @@ import UIKit
class EditProductViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource,UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout{
var layout = UICollectionViewFlowLayout()
var isEdit:Bool = false
var selectIdx:IndexPath = IndexPath(item: 0, section: 0)
var layout = UICollectionViewFlowLayout()
@IBOutlet weak var listView: UITableView!
@IBOutlet weak var btmView: UIView!
override func viewDidLoad() {
......@@ -136,7 +136,7 @@ class EditProductViewController: BaseViewController,UITableViewDelegate,UITableV
}
let collectionView = UICollectionView(frame: CGRect(x: 0, y: 0, width: 0, height: 0), collectionViewLayout: layout)
collectionView.backgroundColor = UIColor.red
collectionView.backgroundColor = UIColor.white
collectionView.delegate = self
collectionView.dataSource = self
view.addSubview(collectionView)
......@@ -174,7 +174,7 @@ class EditProductViewController: BaseViewController,UITableViewDelegate,UITableV
return 0
}
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return 4
return 3
}
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
......
......@@ -10,8 +10,10 @@ import UIKit
import LGButton
import Photos
class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource,CommendCellDelegate,TitleAndBtnCellDelegate,GLAlertSelectViewDelegate,GoodsClassViewControllerDelegate,PinPaiListViewControllerDelegate,AddImgCellDelegate,AddGuiGeCellDelegate{
class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource,CommendCellDelegate,TitleAndBtnCellDelegate,GLAlertSelectViewDelegate,GoodsClassViewControllerDelegate,PinPaiListViewControllerDelegate,AddImgCellDelegate,AddGuiGeCellDelegate,CreatNewSpecsViewControllerDelegate,ShangPinGguiGeCellDelegate,UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout,TitleAndSwitchCellDelegate{
var selectIdx:IndexPath?
var layout = UICollectionViewFlowLayout()
var glSelectView:GLAlertSelectView?
let titleArr = ["商品信息","商品图片","商品规格","预售设置","其它信息","商品详情"]
let spxxArr = ["商品名称","商品类型","商品分类","品牌","起卖数量","是否清真","是否询价"]
......@@ -32,7 +34,7 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
var cellHeight = 18.5
var contentStr:String = ""
var guiGeArr:Array<Any> = []//根据规格资料数量控制右上角新增按钮是否显示
var guiGeArr:NSMutableArray = []//根据规格资料数量控制右上角新增按钮是否显示
//
@IBOutlet weak var lgBtnLbl: UILabel!
@IBOutlet weak var btmView: UIView!
......@@ -74,6 +76,7 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
listTbv.register(UINib(nibName: "AddGuiGeCell", bundle: nil), forCellReuseIdentifier: "AddGuiGe")
listTbv.register(UINib(nibName: "CommendCell", bundle: nil), forCellReuseIdentifier: "Commend")
listTbv.register(UINib(nibName: "YuShouWeiKuanFaHuoCell", bundle: nil), forCellReuseIdentifier: "YuShouWeiKuanFaHuoCell")
listTbv.register(UINib(nibName: "ShangPinGguiGeCell", bundle: nil), forCellReuseIdentifier: "ShangPinGguiGeCell")
// Do any additional setup after loading the view.
}
//MARK: - cell delegate
......@@ -104,6 +107,7 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
}
if indexPath.row > 4{
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndSwitch") as! TitleAndSwitchCell
cell.delegate = self
cell.namelbl.text = spxxArr[indexPath.row]
return cell
}
......@@ -129,14 +133,35 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
cell.addBtn.tag = indexPath.row
return cell
case 2:
if guiGeArr.count > 0 {
let cell = tableView.dequeueReusableCell(withIdentifier: "ShangPinGguiGeCell") as! ShangPinGguiGeCell
cell.delegate = self
var dict:NSDictionary!
if selectIdx != nil{
dict = guiGeArr[selectIdx!.item] as! NSDictionary
}else{
dict = guiGeArr.firstObject as! NSDictionary
}
print(selectIdx?.item)
cell.tempLbl.text = "冷藏:\(String(describing: dict["wenDu"]!))℃"
cell.weightLbl.text = "重量(kg):\(String(describing: dict["weight"]!))kg"
cell.guiGeLbl.text = "规格:\(String(describing: dict["guiGe"]!))kg/件"
cell.danWeiLbl.text = "单位:\(String(describing: dict["danWei"]!))"
cell.sellPriceLbl.text = "售价:¥\(dict["price"]!)"
// cell.itemIdx = dict["itemIdx"] as! Int
return cell
}
let cell = tableView.dequeueReusableCell(withIdentifier: "AddGuiGe") as! AddGuiGeCell
cell.imgBtn.addTarget(self, action: #selector(addGuiGe), for: .touchUpInside)
cell.imgBtn.setImage(UIImage(named: "xinzeng"), for: .normal)
return cell
case 3:
if indexPath.row == 0 {
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndSwitch") as! TitleAndSwitchCell
cell.namelbl.text = ysszArr[indexPath.row]
cell.delegate = self
return cell
}
if indexPath.row == 3 {
......@@ -190,7 +215,11 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
switch indexPath.section {
case 0: return 49
case 1:return 148.5
case 2:return 123.5
case 2:
if guiGeArr.count > 0 {
return 146
}
return 123.5
case 3:
if isYuShouShangPin == false {
return 0.01
......@@ -224,7 +253,7 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
btn.setTitle(" 新增", for: .normal)
btn.titleLabel?.font = UIFont.systemFont(ofSize: 13)
btn.setTitleColor(UIColor(named: "蓝色字体颜色"), for: .normal)
btn.setImage(UIImage(named: "编组"), for: .normal)
btn.setImage(UIImage(named: "jiahaoXG"), for: .normal)
view.addSubview(btn)
btn.sizeToFit()
btn.snp.makeConstraints { (make) in
......@@ -234,12 +263,31 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
make.width.equalTo(btn.frame.size.width)
}
let btn2 = UIButton()
btn2.backgroundColor = UIColor.black
view.addSubview(btn2)
btn2.snp.makeConstraints { (make) in
make.top.right.bottom.equalTo(0)
make.width.equalTo(80)
}
btn2.addTarget(self, action: #selector(addGuiGe), for: .touchUpInside)
if guiGeArr.count > 1 {
view.frame = CGRect(x: 0, y: 0, width: fullScreenWidth, height: 80)
let collectionView = UICollectionView(frame: CGRect(x: 0, y: 0, width: 0, height: 0), collectionViewLayout: layout)
collectionView.backgroundColor = UIColor.white
collectionView.delegate = self
collectionView.dataSource = self
view.addSubview(collectionView)
collectionView.snp.makeConstraints { (make) in
make.bottom.left.right.equalTo(0)
make.height.equalTo(41)
}
collectionView.showsHorizontalScrollIndicator = false
collectionView.isPagingEnabled = true
layout.itemSize = CGSize(width: fullScreenWidth*0.5, height: 41)
layout.scrollDirection = .horizontal
collectionView.collectionViewLayout = layout
collectionView.register(UINib(nibName: "ItemCell", bundle: nil), forCellWithReuseIdentifier: "ItemCell")
collectionView.selectItem(at:selectIdx, animated: false, scrollPosition: .left)
}
}
return view
}
......@@ -249,6 +297,11 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
return 0.001
}
}
if section == 2 {
if guiGeArr.count > 1 {
return 80
}
}
return 39
}
//footer
......@@ -277,14 +330,21 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
override func backAction() {
self.navigationController?.popViewController(animated: true)
}
var itemTypeArr = NSMutableArray()
//MARK: -- 选择填或跳转
func btnClick(content: String, cell: TitleAndBtnCell) { if cell.nameLbl.text == "商品类型" {
if glSelectView == nil {
let view = GLAlertSelectView(frame: self.view.bounds)
view.isMultipleSelect = true
view.titleLbl.text = "请选择商品类型"
view.delegate = self
view.dataArr = ["预售","普通","期货","团购","预售","普通","期货","团购","预售","普通","期货","团购","预售","普通","期货","团购"]
view.dataArr = ["预售","普通","期货","团购"]
if itemTypeArr.count == 0 {
for _ in view.dataArr {
itemTypeArr.add("99")
}
}
view.selectArray = itemTypeArr
self.view.addSubview(view)
glSelectView = view
}
......@@ -329,16 +389,24 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
}
func GLAlertSelectViewClick(selectNum: Int, view: UIView) {
func GLAlertSelectViewClick(selectNum: NSString, view: UIView) {
print("单选",selectNum)
glSelectView?.removeFromSuperview()
glSelectView = nil
}
var isYuShou:Bool = false
func GLAlertMoreSelectViewClick(sender: NSArray, view:UIView) {
print("多选",sender)
itemTypeArr = sender as! NSMutableArray
let str = "\(sender.firstObject)" as! NSString
if str.integerValue != 99 {
isYuShou = true
}else{
isYuShou = false
}
glSelectView?.removeFromSuperview()
glSelectView = nil
listTbv.reloadData()
}
func GLAlertSelectViewClose(sender: UIButton) {
glSelectView?.removeFromSuperview()
......@@ -389,7 +457,40 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
}
}
}
func ShangPinGguiGeCellEditAction(cell: ShangPinGguiGeCell) {
let vc = CreatNewSpecsViewController()
vc.barTitle = "编辑规格"
vc.datasArr = guiGeArr
vc.isYuShouSetting = isYuShou
let dataDict:NSDictionary!
if selectIdx?.item != nil {
dataDict = guiGeArr[selectIdx!.item] as! NSDictionary
}else{
dataDict = guiGeArr.firstObject as! NSDictionary
}
vc.price = dataDict["price"] as! String
vc.guiGe = dataDict["guiGe"] as! String
vc.weight = dataDict["weight"] as! String
vc.wenDu = dataDict["wenDu"] as! String
vc.danWei = dataDict["danWei"] as! String
let arr = dataDict["jieTiArr"] as! NSMutableArray
let arr2 = dataDict["specalArr"] as! NSMutableArray
vc.specalArr = arr2
vc.jieTiArr = arr
if selectIdx == nil {
vc.selectIdx = IndexPath(item: 0, section: 0)
}else{
vc.selectIdx = selectIdx
}
print(vc.selectIdx?.item)
vc.delegate = self
self.navigationController?.pushViewController(vc, animated: true)
}
func CreatNewSpecsViewControllerDeleteAction() {
print("删除数据")
}
func AddGuiGeCellClick(cell: AddGuiGeCell) {
//
print("商品详情添加图片")
......@@ -397,9 +498,51 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
@objc func addGuiGe(){
print("新增规格")
let vc = CreatNewSpecsViewController()
vc.barTitle = "新增规格"
vc.delegate = self
vc.isYuShouSetting = isYuShou
vc.datasArr = guiGeArr
self.navigationController?.pushViewController(vc, animated: true)
}
@objc func addImageAction(sender:UIButton){
print(sender.tag)
}
func CreatNewSpecsViewControllerSaveAction(datas: NSMutableArray) {
guiGeArr = datas
listTbv.reloadData()
}
//MARK: - COLLECTIONVIEW DELEGATE
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat {
return 0
}
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return guiGeArr.count
}
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "ItemCell", for: indexPath)
as! ItemCell
cell.tag = indexPath.row
if selectIdx == nil {
selectIdx = IndexPath(item: 0, section: 0)
}
if indexPath == selectIdx {
cell.nameLbl.textColor = UIColor(named: "蓝色字体颜色")
cell.lineView.isHidden = false
}else{
cell.nameLbl.textColor = UIColor(named: "标题字颜色")
cell.lineView.isHidden = true
}
return cell
}
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
selectIdx = indexPath
//刷新cell
print("selectItem",selectIdx?.item)
listTbv.reloadData()
collectionView.reloadData()
}
}
......@@ -8,43 +8,123 @@
import UIKit
import LGButton
class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource,TitleAndTFCellDelegate,TitleAndBtnCellDelegate,TitleAndSwitchCellDelegate,TitleAndSwitchHeaderViewDelegate,NewCreateHeaderDelegate,NewCreateFooterDelegate,YuShouCellDelegate,GLAlertSelectViewDelegate{
@objc protocol CreatNewSpecsViewControllerDelegate {
@objc optional func CreatNewSpecsViewControllerSaveAction(datas:NSMutableArray)
@objc optional func CreatNewSpecsViewControllerDeleteAction()
}
class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource,TitleAndTFCellDelegate,TitleAndBtnCellDelegate,TitleAndSwitchCellDelegate,TitleAndSwitchHeaderViewDelegate,NewCreateHeaderDelegate,NewCreateFooterDelegate,YuShouCellDelegate,GLAlertSelectViewDelegate,PuTongJieTiCellDelegate,UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout{
var layout = UICollectionViewFlowLayout()
var delegate:CreatNewSpecsViewControllerDelegate?
var collectView:UICollectionView?
var datasArr:NSMutableArray = []
var dataDict:NSDictionary?
let titleArray = ["售价:","规格:","重量:","温藏:","单位:"]
let pliceHolderArr = ["请输入商品售价","请输入商品规格","请输入商品重量","请选择商品温藏","请选择商品单位"]
@IBOutlet weak var bottomBtn: LGButton!
@IBOutlet weak var listTbv: UITableView!
var isYuShouSetting: Bool = false
var selectIdx:IndexPath?
var isYuShouSetting: Bool = false{
willSet{
isYuShouSetting = newValue
}
}//打开预售
var isJieTiJiaSetting: Bool = false
var selectYuShou:Bool = false//是否选择设置预售价格
var isSelectNonYuShou:Bool = true //跳转前确定是否能选择预售
//规格
var normalArr:NSArray = []//普通
var specalArr:NSArray = []//预售
//选择页面
var selectView:GLAlertSelectView? = nil
var selectListArr:Array<String> = ["a","b","c"]
//测试数据
var addNormal = 0
var addSpecal = 0
var price = ""{
willSet{
price = newValue
}
}
var guiGe = ""{
willSet{
guiGe = newValue
}
}
var weight = ""{
willSet{
weight = newValue
}
}
var wenDu = ""{
willSet{
wenDu = newValue
}
}
var danWei = ""{
willSet{
danWei = newValue
}
}//规格
var specalArr:NSMutableArray = []{
willSet{
specalArr.removeAllObjects()
specalArr = newValue
}
}//预售
var jieTiArr:NSMutableArray = []{
willSet{
jieTiArr.removeAllObjects()
jieTiArr = newValue
}
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
print("item == ",selectIdx?.item)
collectView?.selectItem(at:selectIdx, animated: false, scrollPosition: .bottom)
}
@IBOutlet weak var topBarView: UIView!
@IBOutlet weak var topBarViewH: NSLayoutConstraint!
var barTitle:String?
override func viewDidLoad() {
super.viewDidLoad()
navbar.title = "新增规格"
navbar.title = barTitle
self.view.addSubview(navbar)
listTbv.snp.makeConstraints { (make) in
make.top.equalTo(NavCGRect.height)
make.left.right.equalTo(0)
make.bottom.equalTo(bottomBtn.snp_top)
if datasArr.count > 1 && barTitle!.contains("编辑") == true {//展示topbar
SetTopFrame(view: topBarView, height: 41)
if collectView == nil {
let collectionView = UICollectionView(frame: CGRect(x: 0, y: 0, width: 0, height: 0), collectionViewLayout: layout)
collectionView.backgroundColor = UIColor.white
collectionView.delegate = self
collectionView.dataSource = self
topBarView.addSubview(collectionView)
collectionView.snp.makeConstraints { (make) in
make.bottom.left.right.equalTo(0)
make.height.equalTo(41)
}
collectionView.showsHorizontalScrollIndicator = false
collectionView.isPagingEnabled = true
var w:CGFloat = 0
if datasArr.count < 5 {
w = fullScreenWidth/CGFloat(datasArr.count)
}else{
w = fullScreenWidth * 0.2
}
layout.itemSize = CGSize(width: w, height: 41)
layout.scrollDirection = .horizontal
collectionView.collectionViewLayout = layout
collectionView.register(UINib(nibName: "ItemCell", bundle: nil), forCellWithReuseIdentifier: "ItemCell")
collectView = collectionView
}
}else{
SetTopFrame(view: topBarView, height: 0)
topBarViewH.constant = 0
}
listTbv?.register(UINib(nibName: "TitleAndTFCell", bundle: nil), forCellReuseIdentifier: "TitleAndTF")
listTbv?.register(UINib(nibName: "TitleAndBtnCell", bundle: nil), forCellReuseIdentifier: "TitleAndBtn")
listTbv?.register(UINib(nibName: "TitleAndSwitchCell", bundle: nil), forCellReuseIdentifier: "TitleAndSwitch")
......@@ -54,15 +134,53 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
}
@IBAction func saveAction(_ sender: Any) {
print("save")
// if price.count == 0 {
// return
// }
// if guiGe.count == 0 {
// return
// }
// if weight.count == 0 {
// return
// }
// if wenDu.count == 0 {
// return
// }
// if danWei.count == 0 {
// return
// }
// for item in jieTiArr {
// let str = item as! String
// let arr = str.components(separatedBy: "_")
// for letter in arr {
// if letter.count == 0 {//提示阶梯数据未完整
// return
// }
// }
// }
let dict = NSMutableDictionary()
dict["price"] = price
dict["guiGe"] = guiGe
dict["weight"] = weight
dict["wenDu"] = wenDu
dict["danWei"] = danWei
dict["jieTiArr"] = jieTiArr
dict["specalArr"] = specalArr
dict["itemIdx"] = datasArr.count
if barTitle?.contains("编辑") == true {
print("abc == ",selectIdx?.item)
datasArr.replaceObject(at: selectIdx!.item, with: dict)
}else{
datasArr.add(dict)
}
delegate?.CreatNewSpecsViewControllerSaveAction?(datas: datasArr)
self.navigationController?.popViewController(animated: true)
}
//MARK: - cell delegate
func numberOfSections(in tableView: UITableView) -> Int {
if (navbar.title?.contains("编辑"))! {
return 4
}else{
......@@ -76,24 +194,18 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
}
if section == 2 {
if selectYuShou {//预售
if normalArr.count == 0{
return addNormal
}else{
return normalArr.count
}
return specalArr.count
}else{//非预售
if specalArr.count == 0 {
return addSpecal
}else{
return specalArr.count
}
return jieTiArr.count
}
}
return 1
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if indexPath.section == 0 {
if indexPath.row < 3 {
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndTF") as! TitleAndTFCell
......@@ -101,6 +213,20 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
cell.tag = indexPath.row
let str = NSAttributedString(string: pliceHolderArr[indexPath.row], attributes: [NSAttributedString.Key.foregroundColor:UIColor(named: "灰色字体颜色")])
cell.textTF.attributedPlaceholder = str
if datasArr.count > 0 {
switch indexPath.row {
case 0:
cell.textTF.text = price
break
case 1:
cell.textTF.text = guiGe
break
default:
cell.textTF.text = weight
break
}
}
cell.delegate = self
return cell
}else{
......@@ -109,6 +235,29 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
cell.delegate = self
cell.nameLbl.text = titleArray[indexPath.row]
cell.contentLbl.text = pliceHolderArr[indexPath.row]
if indexPath.row == 3 {
if tempSelect != "99" {
cell.contentLbl.text = selectListArr[tempSelect.integerValue]
}
}
if indexPath.row == 4 {
if itemDanWeiSelect != "99" {
cell.contentLbl.text = selectListArr[itemDanWeiSelect.integerValue]
}
}
if datasArr.count > 0 {
switch indexPath.row {
case 3:
cell.contentLbl.text = wenDu
break
case 4:
cell.contentLbl.text = danWei
break
default:
break
}
}
return cell
}
}
......@@ -122,14 +271,14 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
cell.namelbl.text = "预售设置"
cell.infoSw.isOn = isYuShouSetting
cell.tag = 5
if isSelectNonYuShou {
if isYuShouSetting == false{
cell.namelbl.alpha = 0.45
cell.isUserInteractionEnabled = false
}
}
if indexPath.section == 1 {
if isYuShouSetting {
if isYuShouSetting == true {
let cell = tableView.dequeueReusableCell(withIdentifier: "YuShou") as! YuShouCell
cell.tag = indexPath.row
cell.infoSw.isOn = isYuShouSetting
......@@ -137,9 +286,26 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
return cell
}
}
if indexPath.section == 2 {
let cell = tableView.dequeueReusableCell(withIdentifier: "PuTongJieTi") as! PuTongJieTiCell
cell.delegate = self
cell.titleLbl.text = "\(indexPath.row+1).数量≥"
cell.tag = indexPath.row
cell.countTF.text = ""
cell.priceTF.text = ""
var item:NSString = ""
if selectYuShou {
item = specalArr[indexPath.row] as! NSString
}else{
item = jieTiArr[indexPath.row] as! NSString
}
if item != "" {
let arr = item.components(separatedBy: "_")
cell.priceTF.text = arr[0]
cell.countTF.text = arr[1]
}
return cell
}
if indexPath.section == 3 {
......@@ -149,6 +315,12 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
return cell
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if indexPath.section == 3 {
delegate?.CreatNewSpecsViewControllerDeleteAction?()
}
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
if indexPath.section == 1 {
if isYuShouSetting {
......@@ -176,11 +348,13 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
if isJieTiJiaSetting == false{
return view
}
if isYuShouSetting {
let view = TitleAndSwitchHeaderView(frame: CGRect(x: 0, y: 0, width: fullScreenWidth, height: 90))
view.delegate = self
view.selectYuShou = selectYuShou
view.infoSW.isOn = isJieTiJiaSetting
view.infoSW.isOn = isYuShouSetting
return view
}
return view
......@@ -221,51 +395,80 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
}
//MARK: - NEW CELL DELEGATE
func textFieldContent(content: String, cell: TitleAndTFCell) {
switch cell.tag {
case 0:
price = content
break
case 1:
guiGe = content
break
default:
weight = content
break
}
}
func GLAlertSelectViewClose(sender: UIButton) {
print("关闭")
func GLAlertSelectViewClick(selectNum: NSString, view: UIView) {
if view.tag == 3 {
tempSelect = selectNum
wenDu = selectListArr[selectNum.integerValue]
}else{
itemDanWeiSelect = selectNum
danWei = selectListArr[selectNum.integerValue]
}
let cell = listTbv.cellForRow(at: IndexPath(row: view.tag, section: 0)) as! TitleAndBtnCell
cell.contentLbl.text = selectListArr[selectNum.integerValue]
selectView?.removeFromSuperview()
selectView = nil
}
func GLAlertSelectViewClick(sender: Int, view:UIView) {
print(sender)
func GLAlertSelectViewClose(sender: UIButton) {
print("关闭")
selectView?.removeFromSuperview()
selectView = nil
}
// var tempSelectArr = NSMutableArray()
var tempSelect:NSString = "99"
var itemDanWeiSelect:NSString = "99"
func btnClick(content: String, cell: TitleAndBtnCell) {
if cell.tag == 3 {
if selectView == nil {
let view = GLAlertSelectView(frame: self.view.bounds)
view.tag = cell.tag
view.titleLbl.text = "请选择商品温藏"
view.delegate = self
view.dataArr = selectListArr
view.selectNum = tempSelect as String //单选
self.view.addSubview(view)
selectView = view
}
}else{
if selectView == nil {
let view = GLAlertSelectView(frame: self.view.bounds)
view.tag = cell.tag
view.titleLbl.text = "请选择商品单位"
view.delegate = self
view.dataArr = selectListArr
view.selectNum = itemDanWeiSelect as String
view.dataArr = selectListArr
self.view.addSubview(view)
selectView = view
}
}
}
func switchStatus(sender: UISwitch) {
isJieTiJiaSetting = sender.isOn
listTbv.reloadData()
}
func switchClick(content: UISwitch, cell: TitleAndSwitchCell) {
if cell.tag == 5{
isYuShouSetting = content.isOn
let idxPath = IndexPath(row: 0, section: 1)
if isYuShouSetting && isJieTiJiaSetting {
listTbv.reloadData()
}else{
listTbv.reloadRows(at: [idxPath], with: .none)
......@@ -274,15 +477,16 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
}
func newCreateSwitchStatus(sender: UISwitch) {
//打开switch
isJieTiJiaSetting = sender.isOn
listTbv.reloadData()
}
func footerClickAction() {
if selectYuShou {//预售
addNormal += 1
specalArr.add("")
}else{//非预售
addSpecal += 1
jieTiArr.add("")
}
listTbv.reloadData()
}
......@@ -290,21 +494,53 @@ class CreatNewSpecsViewController: BaseViewController,UITableViewDelegate,UITabl
isYuShouSetting = sender.isOn
listTbv.reloadData()
}
func PuTongJieTiDelAction(sender: UIButton) {
jieTiArr.removeObject(at: sender.tag)
print(jieTiArr)
listTbv.reloadData()
}
func PuTongJieTiContent(price: String, count: String, cell: PuTongJieTiCell) {
if selectYuShou {
specalArr.replaceObject(at: cell.tag, with: "\(price)_\(count)")
}else{
jieTiArr.replaceObject(at: cell.tag, with: "\(price)_\(count)")
}
}
func selectYuShou(sender: UIButton) {
if sender.tag == 0 {
selectYuShou = false
addNormal = normalArr.count
}else{
selectYuShou = true
addSpecal = specalArr.count
}
listTbv.reloadData()
}
//MARK: - COLLECTIONVIEW DELEGATE
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat {
return 0
}
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return datasArr.count
}
//MARK: - 选择页面
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "ItemCell", for: indexPath)
as! ItemCell
cell.tag = indexPath.row
if indexPath == selectIdx {
cell.nameLbl.textColor = UIColor(named: "蓝色字体颜色")
cell.lineView.isHidden = false
}else{
cell.nameLbl.textColor = UIColor(named: "标题字颜色")
cell.lineView.isHidden = true
}
return cell
}
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
selectIdx = indexPath
//刷新cell
collectionView.reloadData()
}
}
......@@ -12,6 +12,8 @@
<connections>
<outlet property="bottomBtn" destination="dGJ-ea-Bx5" id="VIT-dc-ndT"/>
<outlet property="listTbv" destination="bSh-mx-Kzg" id="xwd-1s-qv3"/>
<outlet property="topBarView" destination="58G-5f-0zb" id="HDH-SB-fbX"/>
<outlet property="topBarViewH" destination="Ye0-LU-7fR" id="twP-bS-cfD"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
</connections>
</placeholder>
......@@ -64,32 +66,45 @@
</userDefinedRuntimeAttributes>
</view>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="grouped" separatorStyle="none" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="18" sectionFooterHeight="18" translatesAutoresizingMaskIntoConstraints="NO" id="bSh-mx-Kzg">
<rect key="frame" x="0.0" y="44" width="414" height="769"/>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<rect key="frame" x="0.0" y="85" width="414" height="728"/>
<color key="backgroundColor" name="app底色"/>
<connections>
<outlet property="dataSource" destination="-1" id="Qbd-QF-oNN"/>
<outlet property="delegate" destination="-1" id="Ogi-cZ-Pq2"/>
</connections>
</tableView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="58G-5f-0zb">
<rect key="frame" x="0.0" y="44" width="414" height="41"/>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<constraints>
<constraint firstAttribute="height" constant="41" id="Ye0-LU-7fR"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="bSh-mx-Kzg" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="0fJ-Bh-Hih"/>
<constraint firstItem="bSh-mx-Kzg" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" id="1sc-Tr-aDe"/>
<constraint firstItem="bSh-mx-Kzg" firstAttribute="top" secondItem="58G-5f-0zb" secondAttribute="bottom" id="0nZ-9Z-pB5"/>
<constraint firstAttribute="trailing" secondItem="8JZ-TM-4Gj" secondAttribute="trailing" id="5nJ-hq-GzC"/>
<constraint firstItem="dGJ-ea-Bx5" firstAttribute="top" secondItem="bSh-mx-Kzg" secondAttribute="bottom" id="Ijr-6F-Wc6"/>
<constraint firstItem="58G-5f-0zb" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="Ugd-D3-SaD"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="dGJ-ea-Bx5" secondAttribute="trailing" id="UjZ-PD-0IP"/>
<constraint firstItem="8JZ-TM-4Gj" firstAttribute="top" secondItem="dGJ-ea-Bx5" secondAttribute="bottom" id="Wcn-RI-W8x"/>
<constraint firstItem="bSh-mx-Kzg" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="cMo-sP-4qP"/>
<constraint firstItem="58G-5f-0zb" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" id="gRq-Fw-2ah"/>
<constraint firstItem="dGJ-ea-Bx5" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="jYa-O4-JEm"/>
<constraint firstItem="dGJ-ea-Bx5" firstAttribute="top" secondItem="bSh-mx-Kzg" secondAttribute="bottom" id="mTs-nP-5KO"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="58G-5f-0zb" secondAttribute="trailing" id="mzN-8N-ZCY"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="bottom" secondItem="dGJ-ea-Bx5" secondAttribute="bottom" id="oYF-GV-YdD"/>
<constraint firstItem="8JZ-TM-4Gj" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="vF1-xh-KYL"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="bSh-mx-Kzg" secondAttribute="trailing" id="zb7-xi-DTh"/>
<constraint firstItem="bSh-mx-Kzg" firstAttribute="trailing" secondItem="fnl-2z-Ty3" secondAttribute="trailing" id="zF5-sH-eFq"/>
</constraints>
<viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/>
<point key="canvasLocation" x="131.8840579710145" y="129.91071428571428"/>
</view>
</objects>
<resources>
<namedColor name="app底色">
<color red="0.94509803921568625" green="0.94509803921568625" blue="0.94509803921568625" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="按钮渐变色上">
<color red="0.3880000114440918" green="0.62400001287460327" blue="0.90200001001358032" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
......
......@@ -12,6 +12,8 @@ class DelGuiGeCell: UITableViewCell {
override func awakeFromNib() {
super.awakeFromNib()
self.selectionStyle = .none
// Initialization code
}
......
......@@ -9,22 +9,32 @@
import UIKit
@objc protocol PuTongJieTiCellDelegate {
@objc optional func PuTongJieTiDelAction(sender:UIButton)
@objc optional func PuTongJieTiContent(price:String,count:String,cell:PuTongJieTiCell)
}
class PuTongJieTiCell: UITableViewCell {
var delegate:PuTongJieTiCellDelegate?
@IBAction func delAction(_ sender: UIButton) {
delegate?.PuTongJieTiDelAction?(sender: sender)
}
@IBOutlet weak var priceTF: NSLayoutConstraint!
@IBOutlet weak var priceTF: UITextField!
@IBOutlet weak var countTF: UITextField!
@IBOutlet weak var titleLbl: UILabel!
override func awakeFromNib() {
super.awakeFromNib()
selectionStyle = .none
priceTF.addTarget(self, action: #selector(textChange(textF:)), for: .editingChanged)
countTF.addTarget(self, action: #selector(textChange(textF:)), for: .editingChanged)
priceTF.tag = 0
countTF.tag = 1
// Initialization code
}
@objc func textChange(textF:UITextField){
delegate?.PuTongJieTiContent?(price: priceTF.text!, count: countTF.text!, cell: self)
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
......
......@@ -118,7 +118,7 @@
<viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
<connections>
<outlet property="countTF" destination="DMW-oR-f6E" id="SSR-pc-LuB"/>
<outlet property="priceTF" destination="jiQ-Wh-UYo" id="mL5-Wd-vuG"/>
<outlet property="priceTF" destination="GZ7-X2-hIF" id="oZI-xp-ed5"/>
<outlet property="titleLbl" destination="dEb-Pr-hmY" id="B1t-aG-1n8"/>
</connections>
<point key="canvasLocation" x="131.15942028985509" y="112.5"/>
......
......@@ -38,6 +38,7 @@
<constraint firstAttribute="width" constant="47" id="XbV-B6-6sH"/>
<constraint firstAttribute="height" constant="31" id="xe0-nb-ftK"/>
</constraints>
<color key="onTintColor" name="蓝色字体颜色"/>
</switch>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="预售价:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="gDh-Mx-qdQ">
<rect key="frame" x="16" y="55" width="54" height="16"/>
......@@ -160,5 +161,8 @@
<namedColor name="灰色分界线">
<color red="0.92941176470588238" green="0.92941176470588238" blue="0.92941176470588238" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="蓝色字体颜色">
<color red="0.27799999713897705" green="0.56099998950958252" blue="0.88999998569488525" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
</resources>
</document>
......@@ -23,7 +23,7 @@
<color key="textColor" name="蓝色字体颜色"/>
<nil key="highlightedColor"/>
</label>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="编组" translatesAutoresizingMaskIntoConstraints="NO" id="Iq6-om-UWg">
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="jiahaoXG" translatesAutoresizingMaskIntoConstraints="NO" id="Iq6-om-UWg">
<rect key="frame" x="139" y="19.5" width="10" height="10"/>
<constraints>
<constraint firstAttribute="width" constant="10" id="AuL-mP-jHY"/>
......@@ -53,9 +53,9 @@
</view>
</objects>
<resources>
<image name="编组" width="10" height="10.5"/>
<image name="jiahaoXG" width="12.5" height="12.5"/>
<namedColor name="蓝色字体颜色">
<color red="0.27843137254901962" green="0.5607843137254902" blue="0.8901960784313725" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.27799999713897705" green="0.56099998950958252" blue="0.88999998569488525" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
</resources>
</document>
......@@ -72,13 +72,13 @@
<color red="0.94509803921568625" green="0.94509803921568625" blue="0.94509803921568625" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="标题字颜色">
<color red="0.1803921568627451" green="0.1803921568627451" blue="0.1803921568627451" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.18000000715255737" green="0.18000000715255737" blue="0.18000000715255737" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="灰色分界线">
<color red="0.92941176470588238" green="0.92941176470588238" blue="0.92941176470588238" 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"/>
<color red="0.27799999713897705" green="0.56099998950958252" blue="0.88999998569488525" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
</resources>
</document>
......@@ -108,16 +108,16 @@
<color red="0.94509803921568625" green="0.94509803921568625" blue="0.94509803921568625" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="按钮渐变色下,字体颜色">
<color red="0.27450980392156865" green="0.5607843137254902" blue="0.88627450980392153" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.27843137254901962" green="0.5607843137254902" blue="0.8901960784313725" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="标题字颜色">
<color red="0.1803921568627451" green="0.1803921568627451" blue="0.1803921568627451" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="灰色字体颜色">
<color red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" 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"/>
<color red="0.27799999713897705" green="0.56099998950958252" blue="0.88999998569488525" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
</resources>
</document>
......@@ -22,7 +22,7 @@ class XinCaiGouViewController: BaseViewController,UITableViewDelegate,UITableVie
var isEdit:Bool?
//测试数据
var data:NSDictionary? = nil
var gouWuType = "99" //购物类型
override func viewDidLoad() {
super.viewDidLoad()
......@@ -194,7 +194,8 @@ class XinCaiGouViewController: BaseViewController,UITableViewDelegate,UITableVie
if indexPath.row == 5 {
if glSelectView == nil {
let view = GLAlertSelectView(frame: self.view.bounds)
view.isMultipleSelect = false//是否多选
// view.isMultipleSelect = false//是否多选
view.selectNum = gouWuType
view.delegate = self
view.titleLbl.text = "请选择购物类型"
view.dataArr = ["普通订单","预售下单"]
......@@ -250,7 +251,7 @@ class XinCaiGouViewController: BaseViewController,UITableViewDelegate,UITableVie
print("AddGuiGeCellClick")
}
func GLAlertSelectViewClick(selectNum: Int, view: UIView) {
func GLAlertSelectViewClick(selectNum: NSString, view: UIView) {
print("单选",selectNum)
glSelectView?.removeFromSuperview()
glSelectView = nil
......
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