Commit abdbbb47 authored by lujunye's avatar lujunye

补充分销产品逻辑

parent 17b05726
...@@ -75,22 +75,33 @@ class DistributorSettingAlertView: UIView { ...@@ -75,22 +75,33 @@ class DistributorSettingAlertView: UIView {
} }
@IBAction func sureAction(_ sender: UIButton) { @IBAction func sureAction(_ sender: UIButton) {
if canYuBtn.isSelected {
if (payTF.text?.count == 0 || moneyTx.text?.count == 0){
HUD.flash(.label("请输入数据~"), delay: 1.2)
return
}
}
//确定 //确定
var operation_type = 1 var operation_type = 1
if nonCanYuBtn.isSelected { if nonCanYuBtn.isSelected {
operation_type = 2 operation_type = 2
} }
var commission_type = 2 var commission_type = 1
var commission_per = "" var commission_per = ""
var commission_val = "" var commission_val = ""
if payJueBtn.isSelected { if payJueBtn.isSelected {
commission_type = 1 commission_type = 2
commission_val = payTF.text! commission_val = payTF.text!
if (commission_val as! NSString).floatValue > (moneyTx.text as! NSString).floatValue{
HUD.flash(.label("佣金大于分销价~"), delay: 1.2)
payTF.text! = ""
return
}
}else{ }else{
commission_per = payTF.text! commission_per = payTF.text!
} }
delegate?.DistributorSettingAlertViewSubmitAction(tag: self.tag, operation_type: operation_type, dbt_price: moneyTx.text!, commission_type: commission_type, commission_per: commission_per, commission_val: commission_val,view:self) delegate?.DistributorSettingAlertViewSubmitAction(tag: self.tag, operation_type: operation_type, dbt_price: moneyTx.text!, commission_type: commission_type, commission_per: commission_per, commission_val: commission_val,view:self)
} }
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
<action selector="nonCanyuAction:" destination="-1" eventType="touchUpInside" id="YDM-1c-mCK"/> <action selector="nonCanyuAction:" destination="-1" eventType="touchUpInside" id="YDM-1c-mCK"/>
</connections> </connections>
</button> </button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="f2v-Db-np2"> <button opaque="NO" contentMode="scaleToFill" selected="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="f2v-Db-np2">
<rect key="frame" x="86" y="15" width="54" height="19"/> <rect key="frame" x="86" y="15" width="54" height="19"/>
<fontDescription key="fontDescription" name="PingFangSC-Regular" family="PingFang SC" pointSize="13"/> <fontDescription key="fontDescription" name="PingFangSC-Regular" family="PingFang SC" pointSize="13"/>
<state key="normal" title=" 参与" image="yuxuan"> <state key="normal" title=" 参与" image="yuxuan">
......
...@@ -17,6 +17,7 @@ class FX_Product_GuanLiVC: BaseViewController,UITableViewDelegate,UITableViewDat ...@@ -17,6 +17,7 @@ class FX_Product_GuanLiVC: BaseViewController,UITableViewDelegate,UITableViewDat
self.view.addSubview(vc) 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) { func DistributorSettingAlertViewSubmitAction(tag: Int, operation_type: Int, dbt_price: String, commission_type: Int, commission_per: String, commission_val: String,view:DistributorSettingAlertView) {
HUD.flash(.progress)
if is_Edit { if is_Edit {
var sku_id = "" var sku_id = ""
for i in 0 ..< selectItem.count { for i in 0 ..< selectItem.count {
...@@ -43,6 +44,7 @@ class FX_Product_GuanLiVC: BaseViewController,UITableViewDelegate,UITableViewDat ...@@ -43,6 +44,7 @@ class FX_Product_GuanLiVC: BaseViewController,UITableViewDelegate,UITableViewDat
self.edit_bottom_view_H.constant = 49 self.edit_bottom_view_H.constant = 49
self.selectItem.removeAll() self.selectItem.removeAll()
self.home_list_tbv.mj_header?.beginRefreshing() self.home_list_tbv.mj_header?.beginRefreshing()
HUD.hide()
} failture: { (err) in } failture: { (err) in
} }
...@@ -60,6 +62,7 @@ class FX_Product_GuanLiVC: BaseViewController,UITableViewDelegate,UITableViewDat ...@@ -60,6 +62,7 @@ class FX_Product_GuanLiVC: BaseViewController,UITableViewDelegate,UITableViewDat
HUD.flash(.label("设置成功~"), delay: 1.2) HUD.flash(.label("设置成功~"), delay: 1.2)
view.removeFromSuperview() view.removeFromSuperview()
self.home_list_tbv.mj_header?.beginRefreshing() self.home_list_tbv.mj_header?.beginRefreshing()
HUD.hide()
} failture: { (err) in } failture: { (err) in
} }
} }
......
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