Commit 718794e3 authored by lujunye's avatar lujunye

sadfasfdasdfsdfd

parent 8785e523
......@@ -71,7 +71,6 @@ class SelectContentView: UIView, UITableViewDelegate, UITableViewDataSource {
cell.titleLbl.textColor = UIColor.init(named: "标题字颜色")
}else{
cell.titleLbl.textColor = UIColor.init(named: "#999999")
}
return cell
}
......
......@@ -7,9 +7,17 @@
//
import UIKit
protocol FXSZ_View_Delegate {
func FXSZ_View_submitAction(tag:Int,price:String,commission:String,view:FXSZ_View)
}
class FXSZ_View: UIView {
var delegate:FXSZ_View_Delegate?
@IBAction func submit_action(_ sender: UIButton) {
delegate?.FXSZ_View_submitAction(tag: self.tag, price: FX_Price_Tf.text!, commission: commission_tf.text!,view:self)
self.close_alt_action(UIButton())
}
@IBOutlet weak var commission_tf: UITextField!
@IBOutlet weak var FX_Price_Tf: UITextField!
@IBAction func close_alt_action(_ sender: Any) {
self.removeFromSuperview()
}
......
......@@ -10,7 +10,12 @@
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="FXSZ_View" customModule="TestClass" customModuleProvider="target"/>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="FXSZ_View" customModule="TestClass" customModuleProvider="target">
<connections>
<outlet property="FX_Price_Tf" destination="hMS-x0-bGV" id="grI-SA-s4n"/>
<outlet property="commission_tf" destination="GVh-yF-SJ3" id="Lui-Ia-ZQs"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="iN0-l3-epB">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
......@@ -127,6 +132,9 @@
<state key="normal" title="确定">
<color key="titleColor" red="0.2784313725" green="0.56078431370000004" blue="0.89019607840000003" alpha="1" colorSpace="calibratedRGB"/>
</state>
<connections>
<action selector="submit_action:" destination="-1" eventType="touchUpInside" id="emU-8o-ZO5"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
......
......@@ -9,7 +9,56 @@
import UIKit
class FX_Product_GuanLiVC: BaseViewController,UITableViewDelegate,UITableViewDataSource, UISearchBarDelegate, SearchBarViewDelegate,SelectContentViewDelegate,HeaderSelectViewDelegate,DistributorSettingAlertViewDelegate, New_Fx_Cell_Delegate{
class FX_Product_GuanLiVC: BaseViewController,UITableViewDelegate,UITableViewDataSource, UISearchBarDelegate, SearchBarViewDelegate,SelectContentViewDelegate,HeaderSelectViewDelegate, New_Fx_Cell_Delegate, FXSZ_View_Delegate{
func FXSZ_View_submitAction(tag: Int, price: String, commission: String,view:FXSZ_View) {
HUD.flash(.progress, delay: 1.2)
if is_Edit {
var sku_id = ""
for i in 0 ..< selectItem.count {
let model = selectItem[i]
if i < selectItem.count-1{
sku_id += StringByInt(number: model) + ","
}else{
sku_id += StringByInt(number: model)
}
}
let dic = ["user_token":UserToken as Any,
"operation_type":1 as Any,
"sku_id":sku_id as Any,
"dbt_price":price as Any,
"commission_type":1 as Any,
"commission_per":0 as Any,
"commission_val":commission as Any]
supSetCommodity(dic) { (data) in
HUD.flash(.label("设置成功~"), delay: 1.2)
view.removeFromSuperview()
self.navbar.rightTitle = "编辑商品"
self.is_Edit = false
self.edit_bottom_view_H.constant = 0
self.selectItem.removeAll()
self.home_list_tbv.mj_header?.beginRefreshing()
HUD.hide()
} failture: { (err) in}
return
}
let model = datas[tag]
let dic = ["user_token":UserToken as Any,
"operation_type":1 as Any,
"sku_id":model.sku_id as Any,
"dbt_price":price as Any,
"commission_type":1 as Any,
"commission_per":0 as Any,
"commission_val":commission as Any]
supSetCommodity(dic) { (data) in
HUD.flash(.label("设置成功~"), delay: 1.2)
view.removeFromSuperview()
self.home_list_tbv.mj_header?.beginRefreshing()
HUD.hide()
} failture: { (err) in}
}
func New_Fx_Cell_btnSelect(idx: Int, cell: New_Fx_Cell) {
let model = datas[idx]
if selectItem.contains(model.sku_id!){
......@@ -32,7 +81,11 @@ class FX_Product_GuanLiVC: BaseViewController,UITableViewDelegate,UITableViewDat
break
default:
//分销设置
let data = datas[cell.tag]
let view = FXSZ_View(frame: self.view.bounds)
view.delegate = self
view.FX_Price_Tf.text = data.dbt_price
view.commission_tf.text = data.commission_val
self.view.addSubview(view)
break
}
......@@ -46,66 +99,15 @@ class FX_Product_GuanLiVC: BaseViewController,UITableViewDelegate,UITableViewDat
return
}
let vc = FXSZ_View(frame: self.view.bounds)
// let vc = DistributorSettingAlertView(frame: self.view.bounds)
// vc.delegate = self
//
vc.delegate = self
if selectItem.count > 1 {
vc.is_all_select_mode = is_Edit
}
self.view.addSubview(vc)
}
func DistributorSettingAlertViewSubmitAction(tag: Int, operation_type: Int, dbt_price: String, commission_type: Int, commission_per: String, commission_val: String,view:DistributorSettingAlertView) {
HUD.flash(.progress, delay: 1.2)
if is_Edit {
var sku_id = ""
for i in 0 ..< selectItem.count {
let model = selectItem[i]
if i < selectItem.count-1{
sku_id += StringByInt(number: model) + ","
}else{
sku_id += StringByInt(number: model)
}
}
let dic = ["user_token":UserToken as Any,
"operation_type":operation_type as Any,
"sku_id":sku_id as Any,
"dbt_price":dbt_price as Any,
"commission_type":1 as Any,
"commission_per":commission_per as Any,
"commission_val":commission_val as Any]
supSetCommodity(dic) { (data) in
HUD.flash(.label("设置成功~"), delay: 1.2)
view.removeFromSuperview()
self.navbar.rightTitle = "编辑商品"
self.is_Edit = false
self.edit_bottom_view_H.constant = 0
self.selectItem.removeAll()
self.home_list_tbv.mj_header?.beginRefreshing()
HUD.hide()
} failture: { (err) in}
return
}
let model = datas[tag]
let dic = ["user_token":UserToken as Any,
"operation_type":operation_type as Any,
"sku_id":model.sku_id as Any,
"dbt_price":dbt_price as Any,
"commission_type":commission_type as Any,
"commission_per":commission_per as Any,
"commission_val":commission_val as Any]
supSetCommodity(dic) { (data) in
HUD.flash(.label("设置成功~"), delay: 1.2)
view.removeFromSuperview()
self.home_list_tbv.mj_header?.beginRefreshing()
HUD.hide()
} failture: { (err) in}
}
// func new_GYS_FX_ProductCellTableViewCellBtnAction(idx: Int) {
// let vc = DistributorSettingAlertView(frame: self.view.bounds)
......@@ -371,46 +373,29 @@ class FX_Product_GuanLiVC: BaseViewController,UITableViewDelegate,UITableViewDat
cell.select_img.isHidden = true
}
// cell.old_price_line.isHidden = false
// cell.new_price_Lbl.isHidden = false
if model.dbt_price == nil {
// cell.old_price_line.isHidden = true
// cell.new_price_Lbl.text = ""
if model.dbt_price == nil && model.commission_val == nil {
cell.price.isHidden = true
}else{
// cell.new_price_Lbl.text = "¥" + model.dbt_price!
cell.price.isHidden = false
cell.price.text = "分销价: ¥\(model.dbt_price!) (固定提成: \(model.commission_val!))"
}
// cell.old_price_Lbl.text = "¥" + model.price!
if model.commission_type == 1{
// cell.FX_Percent_Lbl.isHidden = false
// cell.FX_Percent_Lbl.text = "分销(" + StringByInt(number: model.commission_per!) + "%)"
}else if model.commission_type == 2{
// cell.FX_Percent_Lbl.isHidden = false
// cell.FX_Percent_Lbl.text = "分销(" + model.commission_val! + "元)"
}else{
// cell.FX_Percent_Lbl.isHidden = true
}
// cell.title_Lbl.text = model.goods_name
// cell.sell_total_Lbl.text = "销量:-"
if model.dbt_sale != nil {
// cell.sell_total_Lbl.text = "销量:" + StringByInt(number: model.dbt_sale!)
}
// cell.store_lbl.text = "库存:-"
cell.spec.text = "单价: ¥" + model.price!
cell.name.text = model.goods_name
if model.inventory != nil {
// cell.store_lbl.text = "库存:" + StringByInt(number: model.inventory!)
cell.spec.text! += " " + "库存: \(model.inventory!)"
}else{
cell.spec.text! += " " + "库存: -"
}
if model.goods_thumb != nil {
cell.icon.sd_setImage(with:URL(string:SERVERCE_ImageHost + model.goods_thumb!), placeholderImage: nil,options:.allowInvalidSSLCertificates)
}
return cell
}
var selectItem:Array<Int> = []
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 145
}
......
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