Commit 264334fc authored by lujunye's avatar lujunye

新增金额显示

parent 1f6d63a5
...@@ -12,6 +12,7 @@ protocol DistributorSettingAlertViewDelegate { ...@@ -12,6 +12,7 @@ protocol DistributorSettingAlertViewDelegate {
} }
class DistributorSettingAlertView: UIView { class DistributorSettingAlertView: UIView {
@IBOutlet weak var percent_price_lbl: UILabel!
var temp_commission_per = "" var temp_commission_per = ""
var temp_commission_val = "" var temp_commission_val = ""
var temp_commission_type = 1 var temp_commission_type = 1
...@@ -46,6 +47,11 @@ class DistributorSettingAlertView: UIView { ...@@ -46,6 +47,11 @@ class DistributorSettingAlertView: UIView {
payNumTypelbl.text = "%" payNumTypelbl.text = "%"
payTF.text = StringByInt(number: (data?.commission_per)!) payTF.text = StringByInt(number: (data?.commission_per)!)
temp_commission_per = StringByInt(number: (data?.commission_per)!) temp_commission_per = StringByInt(number: (data?.commission_per)!)
let price = data?.dbt_price as! NSString
let percent = temp_commission_per as! NSString
let c_price = price.floatValue * 0.01 * percent.floatValue
percent_price_lbl.text = "(" + String(format: "%.2f", c_price) + "元)"
percent_price_lbl.isHidden = false
}else{ }else{
payBiBtn .setImage(UIImage.init(named: "daixuan"), for: .normal) payBiBtn .setImage(UIImage.init(named: "daixuan"), for: .normal)
payJueBtn .setImage(UIImage.init(named: "yuxuan"), for: .normal) payJueBtn .setImage(UIImage.init(named: "yuxuan"), for: .normal)
...@@ -54,6 +60,7 @@ class DistributorSettingAlertView: UIView { ...@@ -54,6 +60,7 @@ class DistributorSettingAlertView: UIView {
payNumTypelbl.text = "元" payNumTypelbl.text = "元"
payTF.text = data?.commission_val payTF.text = data?.commission_val
temp_commission_val = (data?.commission_val)! temp_commission_val = (data?.commission_val)!
percent_price_lbl.isHidden = true
} }
} }
...@@ -68,11 +75,13 @@ class DistributorSettingAlertView: UIView { ...@@ -68,11 +75,13 @@ class DistributorSettingAlertView: UIView {
nonCanYuBtn .setImage(UIImage.init(named: "daixuan"), for: .normal) nonCanYuBtn .setImage(UIImage.init(named: "daixuan"), for: .normal)
canYuBtn.isSelected = true canYuBtn.isSelected = true
nonCanYuBtn.isSelected = false nonCanYuBtn.isSelected = false
percent_price_lbl.isHidden = false
contentVheight.constant = 300 contentVheight.constant = 300
if is_all_select_mode { if is_all_select_mode {
cover_view.isHidden = false cover_view.isHidden = false
} }
} }
@IBOutlet weak var nonCanYuBtn: UIButton! @IBOutlet weak var nonCanYuBtn: UIButton!
...@@ -82,6 +91,7 @@ class DistributorSettingAlertView: UIView { ...@@ -82,6 +91,7 @@ class DistributorSettingAlertView: UIView {
nonCanYuBtn .setImage(UIImage.init(named: "yuxuan"), for: .normal) nonCanYuBtn .setImage(UIImage.init(named: "yuxuan"), for: .normal)
contentVheight.constant = 150 contentVheight.constant = 150
canYuBtn.isSelected = false canYuBtn.isSelected = false
percent_price_lbl.isHidden = true
nonCanYuBtn.isSelected = true nonCanYuBtn.isSelected = true
cover_view.isHidden = true cover_view.isHidden = true
} }
...@@ -104,6 +114,8 @@ class DistributorSettingAlertView: UIView { ...@@ -104,6 +114,8 @@ class DistributorSettingAlertView: UIView {
payTF.placeholder = "请输入比例" payTF.placeholder = "请输入比例"
temp_commission_type = 1 temp_commission_type = 1
payTF.text = temp_commission_per payTF.text = temp_commission_per
percent_price_lbl.isHidden = false
} }
@IBAction func payJueAction(_ sender: UIButton) { @IBAction func payJueAction(_ sender: UIButton) {
//绝对值 //绝对值
...@@ -115,13 +127,26 @@ class DistributorSettingAlertView: UIView { ...@@ -115,13 +127,26 @@ class DistributorSettingAlertView: UIView {
payTF.placeholder = "请输入数值" payTF.placeholder = "请输入数值"
temp_commission_type = 2 temp_commission_type = 2
payTF.text = temp_commission_val payTF.text = temp_commission_val
percent_price_lbl.isHidden = true
} }
@objc func textChange(textField:UITextField){ @objc func textChange(textField:UITextField){
if temp_commission_type == 1 { if textField == moneyTx {
temp_commission_per = textField.text! let price = textField.text as! NSString
let percent = temp_commission_per as! NSString
let c_price = price.floatValue * 0.01 * percent.floatValue
percent_price_lbl.text = "(" + String(format: "%.2f", c_price) + "元)"
}else{ }else{
temp_commission_val = textField.text! if temp_commission_type == 1 {
temp_commission_per = textField.text!
let price = data?.dbt_price as! NSString
let percent = temp_commission_per as! NSString
let c_price = price.floatValue * 0.01 * percent.floatValue
percent_price_lbl.text = "(" + String(format: "%.2f", c_price) + "元)"
}else{
temp_commission_val = textField.text!
}
} }
} }
...@@ -193,7 +218,7 @@ class DistributorSettingAlertView: UIView { ...@@ -193,7 +218,7 @@ class DistributorSettingAlertView: UIView {
payTF.placeholder = "请输入比例" payTF.placeholder = "请输入比例"
} }
} }
//初始化时将xib中的view添加进来 //初始化时将xib中的view添加进来
override init(frame: CGRect) { override init(frame: CGRect) {
super.init(frame: frame) super.init(frame: frame)
...@@ -203,8 +228,9 @@ class DistributorSettingAlertView: UIView { ...@@ -203,8 +228,9 @@ class DistributorSettingAlertView: UIView {
make.left.top.right.bottom.equalToSuperview() make.left.top.right.bottom.equalToSuperview()
} }
payTF.addTarget(self, action: #selector(textChange(textField:)), for: .editingChanged) payTF.addTarget(self, action: #selector(textChange(textField:)), for: .editingChanged)
moneyTx.addTarget(self, action: #selector(textChange(textField:)), for: .editingChanged)
} }
// /初始化时将xib中的view添加进来 // /初始化时将xib中的view添加进来
required init?(coder aDecoder: NSCoder) { required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder) super.init(coder: aDecoder)
...@@ -214,6 +240,7 @@ class DistributorSettingAlertView: UIView { ...@@ -214,6 +240,7 @@ class DistributorSettingAlertView: UIView {
make.left.top.right.bottom.equalToSuperview() make.left.top.right.bottom.equalToSuperview()
} }
payTF.addTarget(self, action: #selector(textChange(textField:)), for: .editingChanged) payTF.addTarget(self, action: #selector(textChange(textField:)), for: .editingChanged)
moneyTx.addTarget(self, action: #selector(textChange(textField:)), for: .editingChanged)
} }
//加载xib //加载xib
func loadViewFromNib() -> UIView { func loadViewFromNib() -> UIView {
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
<outlet property="payJueBtn" destination="puW-3j-GZy" id="tKT-TY-Eje"/> <outlet property="payJueBtn" destination="puW-3j-GZy" id="tKT-TY-Eje"/>
<outlet property="payNumTypelbl" destination="acM-Ba-Vki" id="zmV-zH-M0d"/> <outlet property="payNumTypelbl" destination="acM-Ba-Vki" id="zmV-zH-M0d"/>
<outlet property="payTF" destination="Ysc-L7-nMy" id="En1-Zp-I2f"/> <outlet property="payTF" destination="Ysc-L7-nMy" id="En1-Zp-I2f"/>
<outlet property="percent_price_lbl" destination="oXq-yW-4YF" id="yoP-x7-g7s"/>
</connections> </connections>
</placeholder> </placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
...@@ -63,7 +64,7 @@ ...@@ -63,7 +64,7 @@
<color key="textColor" name="标题字颜色"/> <color key="textColor" name="标题字颜色"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="分销价格:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="jKn-y5-ixC"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="252" verticalHuggingPriority="251" text="分销价格:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="jKn-y5-ixC">
<rect key="frame" x="15" y="68" width="56" height="19"/> <rect key="frame" x="15" y="68" width="56" height="19"/>
<fontDescription key="fontDescription" name="PingFangSC-Regular" family="PingFang SC" pointSize="13"/> <fontDescription key="fontDescription" name="PingFangSC-Regular" family="PingFang SC" pointSize="13"/>
<color key="textColor" name="标题字颜色"/> <color key="textColor" name="标题字颜色"/>
...@@ -151,6 +152,15 @@ ...@@ -151,6 +152,15 @@
</userDefinedRuntimeAttribute> </userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes> </userDefinedRuntimeAttributes>
</view> </view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="oXq-yW-4YF">
<rect key="frame" x="209" y="173" width="71" height="15"/>
<constraints>
<constraint firstAttribute="height" constant="15" id="mfZ-eM-ZTX"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="textColor" name="密码错误字体颜色"/>
<nil key="highlightedColor"/>
</label>
</subviews> </subviews>
<color key="backgroundColor" name="白色背景色"/> <color key="backgroundColor" name="白色背景色"/>
<constraints> <constraints>
...@@ -176,9 +186,12 @@ ...@@ -176,9 +186,12 @@
<constraint firstAttribute="trailing" secondItem="QMk-dx-2zr" secondAttribute="trailing" constant="10" id="ecH-CC-gfR"/> <constraint firstAttribute="trailing" secondItem="QMk-dx-2zr" secondAttribute="trailing" constant="10" id="ecH-CC-gfR"/>
<constraint firstItem="f2v-Db-np2" firstAttribute="centerY" secondItem="9SL-t2-xg8" secondAttribute="centerY" id="f3X-gx-xEz"/> <constraint firstItem="f2v-Db-np2" firstAttribute="centerY" secondItem="9SL-t2-xg8" secondAttribute="centerY" id="f3X-gx-xEz"/>
<constraint firstItem="jKn-y5-ixC" firstAttribute="leading" secondItem="xBK-zg-doj" secondAttribute="leading" constant="15" id="nSW-iI-EmW"/> <constraint firstItem="jKn-y5-ixC" firstAttribute="leading" secondItem="xBK-zg-doj" secondAttribute="leading" constant="15" id="nSW-iI-EmW"/>
<constraint firstItem="oXq-yW-4YF" firstAttribute="leading" secondItem="acM-Ba-Vki" secondAttribute="trailing" constant="10" id="oRJ-fa-Wr0"/>
<constraint firstItem="QMk-dx-2zr" firstAttribute="centerY" secondItem="jKn-y5-ixC" secondAttribute="centerY" id="p6G-o9-C86"/> <constraint firstItem="QMk-dx-2zr" firstAttribute="centerY" secondItem="jKn-y5-ixC" secondAttribute="centerY" id="p6G-o9-C86"/>
<constraint firstAttribute="trailing" secondItem="oXq-yW-4YF" secondAttribute="trailing" constant="15" id="pBd-Ts-Ors"/>
<constraint firstItem="qLO-Gc-A3W" firstAttribute="centerY" secondItem="o0f-Uf-X61" secondAttribute="centerY" id="pxP-3E-XFK"/> <constraint firstItem="qLO-Gc-A3W" firstAttribute="centerY" secondItem="o0f-Uf-X61" secondAttribute="centerY" id="pxP-3E-XFK"/>
<constraint firstItem="f0i-Vm-UAy" firstAttribute="leading" secondItem="f2v-Db-np2" secondAttribute="trailing" constant="25" id="qvK-eL-hk6"/> <constraint firstItem="f0i-Vm-UAy" firstAttribute="leading" secondItem="f2v-Db-np2" secondAttribute="trailing" constant="25" id="qvK-eL-hk6"/>
<constraint firstItem="oXq-yW-4YF" firstAttribute="centerY" secondItem="acM-Ba-Vki" secondAttribute="centerY" id="xkP-1R-dMu"/>
</constraints> </constraints>
</view> </view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" usesAttributedText="YES" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="N4C-9w-dcG"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" usesAttributedText="YES" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="N4C-9w-dcG">
...@@ -312,6 +325,9 @@ ...@@ -312,6 +325,9 @@
<namedColor name="9A9A9A"> <namedColor name="9A9A9A">
<color red="0.60392156862745094" green="0.60392156862745094" blue="0.60392156862745094" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color red="0.60392156862745094" green="0.60392156862745094" blue="0.60392156862745094" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor> </namedColor>
<namedColor name="密码错误字体颜色">
<color red="0.88999998569488525" green="0.27799999713897705" blue="0.27799999713897705" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="提示视图背景色"> <namedColor name="提示视图背景色">
<color red="0.1803921568627451" green="0.1803921568627451" blue="0.1803921568627451" alpha="0.5" colorSpace="custom" customColorSpace="sRGB"/> <color red="0.1803921568627451" green="0.1803921568627451" blue="0.1803921568627451" alpha="0.5" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor> </namedColor>
......
...@@ -10,7 +10,6 @@ import UIKit ...@@ -10,7 +10,6 @@ import UIKit
class GYS_FX_Product_VC: BaseViewController,UITableViewDelegate,UITableViewDataSource,GYS_FX_ProductCellDelegate{ class GYS_FX_Product_VC: BaseViewController,UITableViewDelegate,UITableViewDataSource,GYS_FX_ProductCellDelegate{
func GYS_FX_ProductCellTableViewCellSelect(idx: Int) { func GYS_FX_ProductCellTableViewCellSelect(idx: Int) {
} }
func GYS_FX_ProductCellTableViewCellBtnAction(idx: Int) { func GYS_FX_ProductCellTableViewCellBtnAction(idx: Int) {
...@@ -29,9 +28,7 @@ class GYS_FX_Product_VC: BaseViewController,UITableViewDelegate,UITableViewDataS ...@@ -29,9 +28,7 @@ class GYS_FX_Product_VC: BaseViewController,UITableViewDelegate,UITableViewDataS
HUD.flash(.label(intro), delay: 1.2) HUD.flash(.label(intro), delay: 1.2)
self.home_list_tbv.mj_header?.beginRefreshing() self.home_list_tbv.mj_header?.beginRefreshing()
} failture: { (err) in } failture: { (err) in
} }
} }
@IBOutlet weak var center_select_btn: UIButton! @IBOutlet weak var center_select_btn: UIButton!
......
...@@ -71,16 +71,16 @@ class RetailManageViewController: BaseViewController,UISearchBarDelegate,SearchB ...@@ -71,16 +71,16 @@ class RetailManageViewController: BaseViewController,UISearchBarDelegate,SearchB
} }
} }
removeBlackBtnView() removeBlackBtnView()
} }
func searchBarSearchButtonClicked(_ searchBar: UISearchBar) { func searchBarSearchButtonClicked(_ searchBar: UISearchBar) {
print("点击搜索进行--") print("点击搜索进行--")
searchBar.resignFirstResponder() searchBar.resignFirstResponder()
keyword = searchBar.text! keyword = searchBar.text!
removeBlackBtnView() removeBlackBtnView()
listView.mj_header?.beginRefreshing() listView.mj_header?.beginRefreshing()
} }
func searchBarShouldBeginEditing(_ searchBar: UISearchBar) -> Bool { func searchBarShouldBeginEditing(_ searchBar: UISearchBar) -> Bool {
if showSelectV != nil { if showSelectV != nil {
showSelectV.removeFromSuperview() showSelectV.removeFromSuperview()
...@@ -181,14 +181,12 @@ class RetailManageViewController: BaseViewController,UISearchBarDelegate,SearchB ...@@ -181,14 +181,12 @@ class RetailManageViewController: BaseViewController,UISearchBarDelegate,SearchB
timeShowDownView.EndDate = Date(timeIntervalSince1970: time!) timeShowDownView.EndDate = Date(timeIntervalSince1970: time!)
timeShowDownView.setOld() timeShowDownView.setOld()
} }
} }
break break
default: break default: break
} }
} }
func colseAction(sender: Int) { func colseAction(sender: Int) {
if showSelectV != nil { if showSelectV != nil {
showSelectV.removeFromSuperview() showSelectV.removeFromSuperview()
...@@ -197,6 +195,7 @@ class RetailManageViewController: BaseViewController,UISearchBarDelegate,SearchB ...@@ -197,6 +195,7 @@ class RetailManageViewController: BaseViewController,UISearchBarDelegate,SearchB
timeShowDView.removeFromSuperview() timeShowDView.removeFromSuperview()
} }
} }
//MARK:--SelectContentViewDelegate //MARK:--SelectContentViewDelegate
func didselectCell(sender: Int) { func didselectCell(sender: Int) {
selectIndexArr[showSelectvIndex] = sender selectIndexArr[showSelectvIndex] = sender
......
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