Commit 62d31008 authored by lujunye's avatar lujunye

分销订单溯源显示完善

parent 1b4e56e8
...@@ -13,6 +13,7 @@ protocol DaiKeXiaDanGouWuCellDelegate { ...@@ -13,6 +13,7 @@ protocol DaiKeXiaDanGouWuCellDelegate {
func DaiKeXiaDanGouWuCell_check(cell:DaiKeXiaDanGouWuCell) func DaiKeXiaDanGouWuCell_check(cell:DaiKeXiaDanGouWuCell)
} }
class DaiKeXiaDanGouWuCell: UITableViewCell,UITextViewDelegate { class DaiKeXiaDanGouWuCell: UITableViewCell,UITextViewDelegate {
@IBOutlet weak var bottom_margin: NSLayoutConstraint!
@IBOutlet weak var dj_wk_view: UIView! @IBOutlet weak var dj_wk_view: UIView!
@IBOutlet weak var dj_wk_top: NSLayoutConstraint! @IBOutlet weak var dj_wk_top: NSLayoutConstraint!
@IBOutlet weak var btm_line: UIView! @IBOutlet weak var btm_line: UIView!
...@@ -20,6 +21,7 @@ class DaiKeXiaDanGouWuCell: UITableViewCell,UITextViewDelegate { ...@@ -20,6 +21,7 @@ class DaiKeXiaDanGouWuCell: UITableViewCell,UITextViewDelegate {
@IBOutlet weak var check_button: UIButton! @IBOutlet weak var check_button: UIButton!
var isFx = false var isFx = false
@IBOutlet weak var botton_height: NSLayoutConstraint!
var delegate:DaiKeXiaDanGouWuCellDelegate? var delegate:DaiKeXiaDanGouWuCellDelegate?
@IBOutlet weak var bz_lbl: UILabel! @IBOutlet weak var bz_lbl: UILabel!
@IBOutlet weak var changeBtn: UIButton! @IBOutlet weak var changeBtn: UIButton!
...@@ -38,11 +40,12 @@ class DaiKeXiaDanGouWuCell: UITableViewCell,UITextViewDelegate { ...@@ -38,11 +40,12 @@ class DaiKeXiaDanGouWuCell: UITableViewCell,UITextViewDelegate {
@IBOutlet weak var dj_wk_height: NSLayoutConstraint! @IBOutlet weak var dj_wk_height: NSLayoutConstraint!
@IBOutlet weak var ding_jin_lbl: UILabel! @IBOutlet weak var ding_jin_lbl: UILabel!
@IBOutlet weak var wei_kuan_lbl: UILabel! @IBOutlet weak var wei_kuan_lbl: UILabel!
override func layoutSubviews() { override func layoutSubviews() {
super.layoutSubviews() super.layoutSubviews()
if isFx{ if isFx{
check_button.isHidden = false bottom_margin.constant = 36
arrow_img.isHidden = false
bz_lbl.isHidden = true bz_lbl.isHidden = true
holder_lbl.isHidden = true holder_lbl.isHidden = true
content_tv.isHidden = true content_tv.isHidden = true
......
...@@ -156,6 +156,9 @@ ...@@ -156,6 +156,9 @@
</label> </label>
<button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="DvI-Hk-ZNE"> <button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="DvI-Hk-ZNE">
<rect key="frame" x="244" y="86" width="78" height="31"/> <rect key="frame" x="244" y="86" width="78" height="31"/>
<constraints>
<constraint firstAttribute="height" constant="31" id="tH7-Qz-qRx"/>
</constraints>
<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="查看溯源信息"> <state key="normal" title="查看溯源信息">
<color key="titleColor" name="#F57575"/> <color key="titleColor" name="#F57575"/>
...@@ -268,6 +271,8 @@ ...@@ -268,6 +271,8 @@
<viewLayoutGuide key="safeArea" id="njF-e1-oar"/> <viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
<connections> <connections>
<outlet property="arrow_img" destination="2p2-7L-Hi7" id="iJ8-Mg-yL3"/> <outlet property="arrow_img" destination="2p2-7L-Hi7" id="iJ8-Mg-yL3"/>
<outlet property="bottom_margin" destination="0h4-hS-U5y" id="BtA-52-6DM"/>
<outlet property="botton_height" destination="5Ig-Ek-Czg" id="2aJ-UD-gPB"/>
<outlet property="btmLIneWidth" destination="qMJ-nI-cSg" id="dsM-yO-8bv"/> <outlet property="btmLIneWidth" destination="qMJ-nI-cSg" id="dsM-yO-8bv"/>
<outlet property="btm_line" destination="oAm-E1-HwQ" id="vp2-Uf-gI6"/> <outlet property="btm_line" destination="oAm-E1-HwQ" id="vp2-Uf-gI6"/>
<outlet property="bz_lbl" destination="ykh-Oc-5e6" id="1JL-Gh-kqG"/> <outlet property="bz_lbl" destination="ykh-Oc-5e6" id="1JL-Gh-kqG"/>
......
...@@ -40,13 +40,15 @@ class RetailManageDetailViewController: BaseViewController ,UITableViewDelegate, ...@@ -40,13 +40,15 @@ class RetailManageDetailViewController: BaseViewController ,UITableViewDelegate,
//查溯源 //查溯源
print("check S_Y") print("check S_Y")
if (dataMdoel?.order_goods!.count)! > 0 { if (dataMdoel?.order_goods!.count)! > 0 {
let target = dataMdoel?.order_goods![cell.tag]
if (target?.goods_source!.count)! > 0 {
let vc = S_Y_View(frame: self.view.bounds) let vc = S_Y_View(frame: self.view.bounds)
vc.delegate = self vc.delegate = self
let target = dataMdoel?.order_goods![cell.tag]
vc.data = target?.goods_source vc.data = target?.goods_source
self.view.addSubview(vc) self.view.addSubview(vc)
} }
} }
}
let goodsTitleArr = ["商品合计"] let goodsTitleArr = ["商品合计"]
...@@ -146,15 +148,24 @@ class RetailManageDetailViewController: BaseViewController ,UITableViewDelegate, ...@@ -146,15 +148,24 @@ class RetailManageDetailViewController: BaseViewController ,UITableViewDelegate,
}else{ }else{
cell.detailLbl.text = "规格:-" cell.detailLbl.text = "规格:-"
} }
cell.dan_jia_lbl.text = "单价:" + (rowModel?.goods_price)!
cell.count_lbl.text = "数量:" + StringByInt(number: (rowModel?.cart_number!)!)
cell.yong_jin_lbl.text = "佣金:¥" + (rowModel?.commission_val)!
let s_p = rowModel?.goods_price as! NSString let s_p = rowModel?.goods_price as! NSString
let p_count = Float((rowModel?.cart_number)!) * s_p.floatValue let p_count = Float((rowModel?.cart_number)!) * s_p.floatValue
cell.xiao_ji_lbl.text = "小计:" + String(format: "%.2f", p_count)
cell.count_lbl.text = "单价:" + (rowModel?.goods_price)!
cell.yong_jin_lbl.text = "小计:" + String(format: "%.2f", p_count)
cell.dan_jia_lbl.text = "佣金:¥" + (rowModel?.commission_val)!
cell.xiao_ji_lbl.text = "数量:" + StringByInt(number: (rowModel?.cart_number!)!)
cell.delegate = self cell.delegate = self
cell.tag = indexPath.row cell.tag = indexPath.row
cell.arrow_img.isHidden = true
cell.check_button.isHidden = true
if (rowModel?.goods_source!.count)! > 0 {
cell.arrow_img.isHidden = false
cell.check_button.isHidden = false
}
return cell return cell
case 2: case 2:
cell.nameLbl.text = goodsTitleArr[indexPath.row] cell.nameLbl.text = goodsTitleArr[indexPath.row]
...@@ -250,7 +261,7 @@ class RetailManageDetailViewController: BaseViewController ,UITableViewDelegate, ...@@ -250,7 +261,7 @@ class RetailManageDetailViewController: BaseViewController ,UITableViewDelegate,
} }
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
if indexPath.section == 1 { if indexPath.section == 1 {
return 300 return 220
} }
return 49 return 49
} }
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews> <subviews>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" style="grouped" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="18" sectionFooterHeight="18" translatesAutoresizingMaskIntoConstraints="NO" id="tYc-sK-fji"> <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" style="grouped" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="18" sectionFooterHeight="18" translatesAutoresizingMaskIntoConstraints="NO" id="tYc-sK-fji">
<rect key="frame" x="0.0" y="44" width="414" height="818"/> <rect key="frame" x="0.0" y="44" width="414" height="852"/>
<color key="backgroundColor" name="app底色"/> <color key="backgroundColor" name="app底色"/>
<connections> <connections>
<outlet property="dataSource" destination="-1" id="Dsh-hL-pEX"/> <outlet property="dataSource" destination="-1" id="Dsh-hL-pEX"/>
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
<viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/> <viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/> <color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints> <constraints>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="bottom" secondItem="tYc-sK-fji" secondAttribute="bottom" id="Vgw-Vv-CZV"/> <constraint firstAttribute="bottom" secondItem="tYc-sK-fji" secondAttribute="bottom" id="Vgw-Vv-CZV"/>
<constraint firstItem="tYc-sK-fji" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="X0H-Pm-zR2"/> <constraint firstItem="tYc-sK-fji" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="X0H-Pm-zR2"/>
<constraint firstItem="tYc-sK-fji" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" id="bO3-PG-SRW"/> <constraint firstItem="tYc-sK-fji" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" id="bO3-PG-SRW"/>
<constraint firstAttribute="trailing" secondItem="tYc-sK-fji" secondAttribute="trailing" id="tby-ZM-jOk"/> <constraint firstAttribute="trailing" secondItem="tYc-sK-fji" secondAttribute="trailing" id="tby-ZM-jOk"/>
......
...@@ -155,6 +155,7 @@ class RetailManageViewController: BaseViewController,UITableViewDelegate,UITable ...@@ -155,6 +155,7 @@ class RetailManageViewController: BaseViewController,UITableViewDelegate,UITable
let vc = RetailManageDetailViewController() let vc = RetailManageDetailViewController()
let goodArrModel = self.dataArr[indexPath.section] let goodArrModel = self.dataArr[indexPath.section]
vc.orderId = goodArrModel.order_id vc.orderId = goodArrModel.order_id
// vc.orderId = 12746
self.navigationController?.pushViewController(vc, animated: true) self.navigationController?.pushViewController(vc, animated: true)
} }
......
...@@ -12,7 +12,6 @@ class S_P_K_C_Report_Cell: UITableViewCell { ...@@ -12,7 +12,6 @@ class S_P_K_C_Report_Cell: UITableViewCell {
override func awakeFromNib() { override func awakeFromNib() {
super.awakeFromNib() super.awakeFromNib()
// Initialization code
self.selectionStyle = .none self.selectionStyle = .none
} }
@IBOutlet weak var img_view: UIImageView! @IBOutlet weak var img_view: UIImageView!
......
...@@ -43,8 +43,6 @@ class S_Y_View_Cell: UITableViewCell { ...@@ -43,8 +43,6 @@ class S_Y_View_Cell: UITableViewCell {
override func awakeFromNib() { override func awakeFromNib() {
super.awakeFromNib() super.awakeFromNib()
self.selectionStyle = .none self.selectionStyle = .none
// Initialization code
} }
override func setSelected(_ selected: Bool, animated: Bool) { override func setSelected(_ selected: Bool, animated: Bool) {
......
...@@ -705,8 +705,8 @@ class OrderListVC: BaseViewController, UITableViewDelegate, UITableViewDataSourc ...@@ -705,8 +705,8 @@ class OrderListVC: BaseViewController, UITableViewDelegate, UITableViewDataSourc
let rowModel = self.dataArr[indexPath.row] let rowModel = self.dataArr[indexPath.row]
let vc = OrderDViewController() let vc = OrderDViewController()
vc.delegate = self vc.delegate = self
// vc.orderId = rowModel.order_id! vc.orderId = rowModel.order_id!
vc.orderId = 12746 // vc.orderId = 12746
vc.order_type = rowModel.order_type vc.order_type = rowModel.order_type
vc.lmIdx = orderStatus vc.lmIdx = orderStatus
self.navigationController?.pushViewController(vc, animated: true) self.navigationController?.pushViewController(vc, animated: true)
......
...@@ -59,13 +59,15 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa ...@@ -59,13 +59,15 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
print("溯源") print("溯源")
print("check S_Y") print("check S_Y")
if (dataMdoel?.order_goods!.count)! > 0 { if (dataMdoel?.order_goods!.count)! > 0 {
let target = dataMdoel?.order_goods![cell.tag]
if (target?.goods_source!.count)! > 0 {
let vc = S_Y_View(frame: self.view.bounds) let vc = S_Y_View(frame: self.view.bounds)
vc.delegate = self vc.delegate = self
let target = dataMdoel?.order_goods![cell.tag]
vc.data = target?.goods_source vc.data = target?.goods_source
self.view.addSubview(vc) self.view.addSubview(vc)
} }
} }
}
...@@ -501,10 +503,20 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa ...@@ -501,10 +503,20 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
cell.btm_line.isHidden = true cell.btm_line.isHidden = true
} }
} }
cell.check_button.isHidden = false // cell.check_button.isHidden = false
cell.imgView?.sd_setImage(with: URL(string: SERVERCE_ImageHost + (rowModel?.goods_thumb)!)) cell.imgView?.sd_setImage(with: URL(string: SERVERCE_ImageHost + (rowModel?.goods_thumb)!))
cell.content_tv.text = rowModel?.remark cell.content_tv.text = rowModel?.remark
cell.titleLbl.text = rowModel?.goods_name cell.titleLbl.text = rowModel?.goods_name
cell.arrow_img.isHidden = true
cell.check_button.isHidden = true
cell.botton_height.constant = 10
if (rowModel?.goods_source!.count)! > 0 {
cell.arrow_img.isHidden = false
cell.check_button.isHidden = false
cell.botton_height.constant = 40
}
if rowModel?.goods_attr != nil { if rowModel?.goods_attr != nil {
cell.detailLbl.text = "规格:" + (rowModel?.goods_attr)! cell.detailLbl.text = "规格:" + (rowModel?.goods_attr)!
}else{ }else{
...@@ -1223,10 +1235,18 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa ...@@ -1223,10 +1235,18 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
switch indexPath.section { switch indexPath.section {
case 1://商品展示heightrow case 1://商品展示heightrow
let target = dataMdoel?.order_goods![indexPath.row]
if isYuShou { if isYuShou {
if (target?.goods_source!.count)! > 0 {
return 340 return 340
} }
return 310
}
if (target?.goods_source!.count)! > 0 {
return 300 return 300
}
return 270
case 4://发票信息heightrow case 4://发票信息heightrow
if segmentIndex == 0 { if segmentIndex == 0 {
return 180 return 180
......
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