Commit 1b4e56e8 authored by lujunye's avatar lujunye

修改溯源新样式完成

parent 6d6a7d7d
...@@ -236,6 +236,8 @@ ...@@ -236,6 +236,8 @@
E08A7AE124652E2C00F934F2 /* BingDingKeHuViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = E08A7ADF24652E2C00F934F2 /* BingDingKeHuViewController.xib */; }; E08A7AE124652E2C00F934F2 /* BingDingKeHuViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = E08A7ADF24652E2C00F934F2 /* BingDingKeHuViewController.xib */; };
E08B0674244A98B2001D2E01 /* WareHouseSpCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = E08B0672244A98B2001D2E01 /* WareHouseSpCell.swift */; }; E08B0674244A98B2001D2E01 /* WareHouseSpCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = E08B0672244A98B2001D2E01 /* WareHouseSpCell.swift */; };
E08B0675244A98B2001D2E01 /* WareHouseSpCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = E08B0673244A98B2001D2E01 /* WareHouseSpCell.xib */; }; E08B0675244A98B2001D2E01 /* WareHouseSpCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = E08B0673244A98B2001D2E01 /* WareHouseSpCell.xib */; };
E09330E125E3626F007A346A /* S_Y_View_Cell.swift in Sources */ = {isa = PBXBuildFile; fileRef = E09330DF25E3626F007A346A /* S_Y_View_Cell.swift */; };
E09330E225E3626F007A346A /* S_Y_View_Cell.xib in Resources */ = {isa = PBXBuildFile; fileRef = E09330E025E3626F007A346A /* S_Y_View_Cell.xib */; };
E095C42624874BDA00922571 /* CKNonGmCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = E095C42424874BDA00922571 /* CKNonGmCell.swift */; }; E095C42624874BDA00922571 /* CKNonGmCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = E095C42424874BDA00922571 /* CKNonGmCell.swift */; };
E095C42724874BDA00922571 /* CKNonGmCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = E095C42524874BDA00922571 /* CKNonGmCell.xib */; }; E095C42724874BDA00922571 /* CKNonGmCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = E095C42524874BDA00922571 /* CKNonGmCell.xib */; };
E095C42A24874E6100922571 /* CKGmCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = E095C42824874E6100922571 /* CKGmCell.swift */; }; E095C42A24874E6100922571 /* CKGmCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = E095C42824874E6100922571 /* CKGmCell.swift */; };
...@@ -963,6 +965,8 @@ ...@@ -963,6 +965,8 @@
E08A7ADF24652E2C00F934F2 /* BingDingKeHuViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = BingDingKeHuViewController.xib; sourceTree = "<group>"; }; E08A7ADF24652E2C00F934F2 /* BingDingKeHuViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = BingDingKeHuViewController.xib; sourceTree = "<group>"; };
E08B0672244A98B2001D2E01 /* WareHouseSpCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WareHouseSpCell.swift; sourceTree = "<group>"; }; E08B0672244A98B2001D2E01 /* WareHouseSpCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WareHouseSpCell.swift; sourceTree = "<group>"; };
E08B0673244A98B2001D2E01 /* WareHouseSpCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = WareHouseSpCell.xib; sourceTree = "<group>"; }; E08B0673244A98B2001D2E01 /* WareHouseSpCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = WareHouseSpCell.xib; sourceTree = "<group>"; };
E09330DF25E3626F007A346A /* S_Y_View_Cell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = S_Y_View_Cell.swift; sourceTree = "<group>"; };
E09330E025E3626F007A346A /* S_Y_View_Cell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = S_Y_View_Cell.xib; sourceTree = "<group>"; };
E095C42424874BDA00922571 /* CKNonGmCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CKNonGmCell.swift; sourceTree = "<group>"; }; E095C42424874BDA00922571 /* CKNonGmCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CKNonGmCell.swift; sourceTree = "<group>"; };
E095C42524874BDA00922571 /* CKNonGmCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CKNonGmCell.xib; sourceTree = "<group>"; }; E095C42524874BDA00922571 /* CKNonGmCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CKNonGmCell.xib; sourceTree = "<group>"; };
E095C42824874E6100922571 /* CKGmCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CKGmCell.swift; sourceTree = "<group>"; }; E095C42824874E6100922571 /* CKGmCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CKGmCell.swift; sourceTree = "<group>"; };
...@@ -2648,6 +2652,8 @@ ...@@ -2648,6 +2652,8 @@
E0974D5D25C12E8D00E3C86B /* two_title_cell.xib */, E0974D5D25C12E8D00E3C86B /* two_title_cell.xib */,
E0974D6325C12FAA00E3C86B /* scv_cell.swift */, E0974D6325C12FAA00E3C86B /* scv_cell.swift */,
E0974D6425C12FAA00E3C86B /* scv_cell.xib */, E0974D6425C12FAA00E3C86B /* scv_cell.xib */,
E09330DF25E3626F007A346A /* S_Y_View_Cell.swift */,
E09330E025E3626F007A346A /* S_Y_View_Cell.xib */,
); );
path = cell; path = cell;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -3641,6 +3647,7 @@ ...@@ -3641,6 +3647,7 @@
E01E5472254FABFD00A2620C /* GYS_FX_ProductCellTableViewCell.xib in Resources */, E01E5472254FABFD00A2620C /* GYS_FX_ProductCellTableViewCell.xib in Resources */,
F9023F63244999F500DD5A63 /* WarehoseMangementCell.xib in Resources */, F9023F63244999F500DD5A63 /* WarehoseMangementCell.xib in Resources */,
E051EBD824A1F0ED00892DA9 /* CGDCell.xib in Resources */, E051EBD824A1F0ED00892DA9 /* CGDCell.xib in Resources */,
E09330E225E3626F007A346A /* S_Y_View_Cell.xib in Resources */,
E01E5485254FD34C00A2620C /* GYS_GuanLi_Cell.xib in Resources */, E01E5485254FD34C00A2620C /* GYS_GuanLi_Cell.xib in Resources */,
E077DC6B25512E94000B0DA5 /* FX_Product_GuanLiVC.xib in Resources */, E077DC6B25512E94000B0DA5 /* FX_Product_GuanLiVC.xib in Resources */,
F96E48A024CA7930000AB8D4 /* WaybillDetailViewController.xib in Resources */, F96E48A024CA7930000AB8D4 /* WaybillDetailViewController.xib in Resources */,
...@@ -4055,6 +4062,7 @@ ...@@ -4055,6 +4062,7 @@
E0BE8A9C245A9E5900E80134 /* YingFuZhangKuanXQCell.swift in Sources */, E0BE8A9C245A9E5900E80134 /* YingFuZhangKuanXQCell.swift in Sources */,
F956D59D246A2D9C003FF510 /* LMNTextStorage.m in Sources */, F956D59D246A2D9C003FF510 /* LMNTextStorage.m in Sources */,
E02C882A2456B4BA00925766 /* WLGZCell.swift in Sources */, E02C882A2456B4BA00925766 /* WLGZCell.swift in Sources */,
E09330E125E3626F007A346A /* S_Y_View_Cell.swift in Sources */,
F950FDE824518CD800C40530 /* TimeSelectView.swift in Sources */, F950FDE824518CD800C40530 /* TimeSelectView.swift in Sources */,
F933F6C72452C68B00189561 /* PKHUDWideBaseView.swift in Sources */, F933F6C72452C68B00189561 /* PKHUDWideBaseView.swift in Sources */,
F9A0E1DF246D1B1E00D7F26F /* GetGoodsInfoModel.swift in Sources */, F9A0E1DF246D1B1E00D7F26F /* GetGoodsInfoModel.swift in Sources */,
......
...@@ -319,7 +319,7 @@ class OrderDetailGoodsModel: Mappable { ...@@ -319,7 +319,7 @@ class OrderDetailGoodsModel: Mappable {
var is_edit : Int? = 0 //订单商品是否有修改,1是0非--前端自主添加的字段 var is_edit : Int? = 0 //订单商品是否有修改,1是0非--前端自主添加的字段
var commission_val:String? //这个商品的总佣金 var commission_val:String? //这个商品的总佣金
var remark:String?//商品备注 var remark:String?//商品备注
var goods_source:OrderDetailGoodsSourceModel?//溯源信息 var goods_source:Array<OrderDetailGoodsSourceModel>?//溯源信息
required init?( map: Map) { required init?( map: Map) {
} }
......
...@@ -637,7 +637,7 @@ class CRKXiangQVC: BaseViewController,UITableViewDelegate,UITableViewDataSource, ...@@ -637,7 +637,7 @@ class CRKXiangQVC: BaseViewController,UITableViewDelegate,UITableViewDataSource,
if model.ven_name != nil { if model.ven_name != nil {
cell.gys_lbl.text = "供应商:" + "\(model.ven_name!)" cell.gys_lbl.text = "供应商:" + "\(model.ven_name!)"
} }
return cell return cell
} }
let cell = tableView.dequeueReusableCell(withIdentifier: "NewCKCell") as! NewCKCell let cell = tableView.dequeueReusableCell(withIdentifier: "NewCKCell") as! NewCKCell
......
...@@ -9,19 +9,16 @@ ...@@ -9,19 +9,16 @@
import UIKit import UIKit
class RetailManageDetailViewController: BaseViewController ,UITableViewDelegate,UITableViewDataSource, DaiKeXiaDanGouWuCellDelegate, S_Y_View_Delegate{ class RetailManageDetailViewController: BaseViewController ,UITableViewDelegate,UITableViewDataSource, DaiKeXiaDanGouWuCellDelegate, S_Y_View_Delegate{
func S_Y_View_Check_Detail(view: S_Y_View) { func S_Y_View_Check_Detail(data: OrderDetailGoodsSourceModel) {
print("查看溯源") print("查看溯源")
if view.data == nil {
return
}
let browser = JXPhotoBrowser() let browser = JXPhotoBrowser()
browser.numberOfItems = { browser.numberOfItems = {
(view.data?.report_picture!.count)! (data.report_picture!.count)
} }
browser.pageIndex = 0 browser.pageIndex = 0
browser.reloadCellAtIndex = { context in browser.reloadCellAtIndex = { context in
let browserCell = context.cell as? JXPhotoBrowserImageCell let browserCell = context.cell as? JXPhotoBrowserImageCell
let url = URL(string:SERVERCE_ImageHost + (view.data?.report_picture![context.index])!) let url = URL(string:SERVERCE_ImageHost + (data.report_picture![context.index]))
browserCell?.imageView.sd_setImage(with: url, placeholderImage: nil, options: [], completed: { (_, _, _, _) in browserCell?.imageView.sd_setImage(with: url, placeholderImage: nil, options: [], completed: { (_, _, _, _) in
browserCell?.setNeedsLayout() browserCell?.setNeedsLayout()
}) })
...@@ -29,7 +26,7 @@ class RetailManageDetailViewController: BaseViewController ,UITableViewDelegate, ...@@ -29,7 +26,7 @@ class RetailManageDetailViewController: BaseViewController ,UITableViewDelegate,
browser.show() browser.show()
} }
func DaiKeXiaDanGouWuCellDelAction(cell: DaiKeXiaDanGouWuCell) { func DaiKeXiaDanGouWuCellDelAction(cell: DaiKeXiaDanGouWuCell) {
//此处无用 //此处无用
...@@ -42,16 +39,16 @@ class RetailManageDetailViewController: BaseViewController ,UITableViewDelegate, ...@@ -42,16 +39,16 @@ class RetailManageDetailViewController: BaseViewController ,UITableViewDelegate,
func DaiKeXiaDanGouWuCell_check(cell: DaiKeXiaDanGouWuCell) { func DaiKeXiaDanGouWuCell_check(cell: DaiKeXiaDanGouWuCell) {
//查溯源 //查溯源
print("check S_Y") print("check S_Y")
let vc = S_Y_View(frame: self.view.bounds)
vc.delegate = self
if (dataMdoel?.order_goods!.count)! > 0 { if (dataMdoel?.order_goods!.count)! > 0 {
let vc = S_Y_View(frame: self.view.bounds)
vc.delegate = self
let target = dataMdoel?.order_goods![cell.tag] 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 = ["商品合计"]
let fenxiaoTitleArr = ["分销角色","结算方式","佣金方式","佣金结算时间","佣金分销结算"] let fenxiaoTitleArr = ["分销角色","结算方式","佣金方式","佣金结算时间","佣金分销结算"]
let orderTitleArr = ["订单编号","下单时间","订单来源","支付方式","支付状态","买家留言","订单备注"] let orderTitleArr = ["订单编号","下单时间","订单来源","支付方式","支付状态","买家留言","订单备注"]
...@@ -98,7 +95,7 @@ class RetailManageDetailViewController: BaseViewController ,UITableViewDelegate, ...@@ -98,7 +95,7 @@ class RetailManageDetailViewController: BaseViewController ,UITableViewDelegate,
self.listView.isHidden = true self.listView.isHidden = true
} }
} }
} }
func numberOfSections(in tableView: UITableView) -> Int { func numberOfSections(in tableView: UITableView) -> Int {
if self.dataMdoel == nil { if self.dataMdoel == nil {
...@@ -126,7 +123,7 @@ class RetailManageDetailViewController: BaseViewController ,UITableViewDelegate, ...@@ -126,7 +123,7 @@ class RetailManageDetailViewController: BaseViewController ,UITableViewDelegate,
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndTFCell") as! TitleAndTFCell let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndTFCell") as! TitleAndTFCell
cell.textTF.isUserInteractionEnabled = false cell.textTF.isUserInteractionEnabled = false
switch indexPath.section { switch indexPath.section {
case 0: case 0:
let cell = tableView.dequeueReusableCell(withIdentifier: "GLKHCell") as! GLKHCell let cell = tableView.dequeueReusableCell(withIdentifier: "GLKHCell") as! GLKHCell
...@@ -145,7 +142,7 @@ class RetailManageDetailViewController: BaseViewController ,UITableViewDelegate, ...@@ -145,7 +142,7 @@ class RetailManageDetailViewController: BaseViewController ,UITableViewDelegate,
cell.imgView?.sd_setImage(with: URL(string: SERVERCE_ImageHost + (rowModel?.goods_thumb)!)) cell.imgView?.sd_setImage(with: URL(string: SERVERCE_ImageHost + (rowModel?.goods_thumb)!))
if rowModel?.goods_attr != nil { if rowModel?.goods_attr != nil {
cell.detailLbl.text = "规格:" + (rowModel?.goods_attr)! cell.detailLbl.text = "规格:" + (rowModel?.goods_attr)!
}else{ }else{
cell.detailLbl.text = "规格:-" cell.detailLbl.text = "规格:-"
} }
...@@ -162,7 +159,7 @@ class RetailManageDetailViewController: BaseViewController ,UITableViewDelegate, ...@@ -162,7 +159,7 @@ class RetailManageDetailViewController: BaseViewController ,UITableViewDelegate,
case 2: case 2:
cell.nameLbl.text = goodsTitleArr[indexPath.row] cell.nameLbl.text = goodsTitleArr[indexPath.row]
cell.textTF.text = "¥" + (self.dataMdoel?.order_res!.goods_amount)! cell.textTF.text = "¥" + (self.dataMdoel?.order_res!.goods_amount)!
case 3: case 3:
switch indexPath.row { switch indexPath.row {
case 0: case 0:
...@@ -178,10 +175,10 @@ class RetailManageDetailViewController: BaseViewController ,UITableViewDelegate, ...@@ -178,10 +175,10 @@ class RetailManageDetailViewController: BaseViewController ,UITableViewDelegate,
case 1: case 1:
if self.dataMdoel?.dbt_info?.dbt_type == 1 { if self.dataMdoel?.dbt_info?.dbt_type == 1 {
cell.textTF.text = "人工结算" cell.textTF.text = "人工结算"
}else if self.dataMdoel?.dbt_info?.dbt_type == 2{ }else if self.dataMdoel?.dbt_info?.dbt_type == 2{
cell.textTF.text = "自动结算" cell.textTF.text = "自动结算"
}else{ }else{
cell.textTF.text = "-" cell.textTF.text = "-"
} }
...@@ -189,10 +186,10 @@ class RetailManageDetailViewController: BaseViewController ,UITableViewDelegate, ...@@ -189,10 +186,10 @@ class RetailManageDetailViewController: BaseViewController ,UITableViewDelegate,
if self.dataMdoel?.dbt_info?.commission_type != nil{ if self.dataMdoel?.dbt_info?.commission_type != nil{
if (self.dataMdoel?.dbt_info?.commission_type!.count)! > 0{ if (self.dataMdoel?.dbt_info?.commission_type!.count)! > 0{
cell.textTF.text = self.dataMdoel?.dbt_info?.commission_type cell.textTF.text = self.dataMdoel?.dbt_info?.commission_type
}else{ }else{
cell.textTF.text = "-" cell.textTF.text = "-"
} }
}else{ }else{
cell.textTF.text = "-" cell.textTF.text = "-"
...@@ -201,15 +198,15 @@ class RetailManageDetailViewController: BaseViewController ,UITableViewDelegate, ...@@ -201,15 +198,15 @@ class RetailManageDetailViewController: BaseViewController ,UITableViewDelegate,
if self.dataMdoel?.dbt_info?.commission_time != nil{ if self.dataMdoel?.dbt_info?.commission_time != nil{
if (self.dataMdoel?.dbt_info?.commission_time!.count)! > 0{ if (self.dataMdoel?.dbt_info?.commission_time!.count)! > 0{
cell.textTF.text = self.dataMdoel?.dbt_info?.commission_time cell.textTF.text = self.dataMdoel?.dbt_info?.commission_time
}else{ }else{
cell.textTF.text = "-" cell.textTF.text = "-"
} }
}else{ }else{
cell.textTF.text = "-" cell.textTF.text = "-"
} }
case 4: case 4:
cell.textTF.text = "¥" + (self.dataMdoel?.order_res!.sum_commission_val)! cell.textTF.text = "¥" + (self.dataMdoel?.order_res!.sum_commission_val)!
default: default:
...@@ -217,7 +214,7 @@ class RetailManageDetailViewController: BaseViewController ,UITableViewDelegate, ...@@ -217,7 +214,7 @@ class RetailManageDetailViewController: BaseViewController ,UITableViewDelegate,
break break
} }
cell.nameLbl.text = fenxiaoTitleArr[indexPath.row] cell.nameLbl.text = fenxiaoTitleArr[indexPath.row]
case 4: case 4:
cell.nameLbl.text = orderTitleArr[indexPath.row] cell.nameLbl.text = orderTitleArr[indexPath.row]
switch indexPath.row { switch indexPath.row {
...@@ -245,7 +242,7 @@ class RetailManageDetailViewController: BaseViewController ,UITableViewDelegate, ...@@ -245,7 +242,7 @@ class RetailManageDetailViewController: BaseViewController ,UITableViewDelegate,
cell.textTF.text = "" cell.textTF.text = ""
break break
} }
default: default:
break break
} }
...@@ -260,7 +257,7 @@ class RetailManageDetailViewController: BaseViewController ,UITableViewDelegate, ...@@ -260,7 +257,7 @@ class RetailManageDetailViewController: BaseViewController ,UITableViewDelegate,
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat { func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
if section == 3 || section == 4 { if section == 3 || section == 4 {
return 39 return 39
} }
return 0.5 return 0.5
} }
...@@ -282,7 +279,7 @@ class RetailManageDetailViewController: BaseViewController ,UITableViewDelegate, ...@@ -282,7 +279,7 @@ class RetailManageDetailViewController: BaseViewController ,UITableViewDelegate,
view.addSubview(view1) view.addSubview(view1)
return view return view
default: default:
break break
} }
...@@ -308,6 +305,6 @@ class RetailManageDetailViewController: BaseViewController ,UITableViewDelegate, ...@@ -308,6 +305,6 @@ class RetailManageDetailViewController: BaseViewController ,UITableViewDelegate,
return 10 return 10
} }
return 0.5 return 0.5
} }
} }
...@@ -8,36 +8,47 @@ ...@@ -8,36 +8,47 @@
import UIKit import UIKit
protocol S_Y_View_Delegate { protocol S_Y_View_Delegate {
func S_Y_View_Check_Detail(view:S_Y_View) func S_Y_View_Check_Detail(data:OrderDetailGoodsSourceModel)
} }
class S_Y_View: UIView { class S_Y_View: UIView ,UITableViewDelegate,UITableViewDataSource,S_Y_View_Cell_delegate{
var contentView:UIView! func S_Y_View_Cell_btn_click(cell: S_Y_View_Cell) {
var delegate:S_Y_View_Delegate? if cell.data == nil {
var data:OrderDetailGoodsSourceModel? { return
}
delegate?.S_Y_View_Check_Detail(data: cell.data!)
}
var data:Array<OrderDetailGoodsSourceModel>? {
didSet{ didSet{
if data != nil { if data != nil {
bao_zhi_qi_lbl.text = data?.valid_date if data!.count > 1 {
sheng_chan_ri_qi_lbl.text = data?.production_data viewHiehgt.constant = 425
chan_di_lbl.text = data?.product_origin }
ru_ku_time_lbl.text = data?.add_time listView.reloadData()
pi_ci_number_lbl.text = StringByInt(number:(data?.batch_id)!)
gys_name_lbl.text = data?.ven_name
check_img.sd_setImage(with:URL(string:SERVERCE_ImageHost + ((data?.report_picture?.first)!)!))
} }
} }
} }
@IBOutlet weak var bao_zhi_qi_lbl: UILabel! func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
@IBOutlet weak var sheng_chan_ri_qi_lbl: UILabel! return data!.count
@IBOutlet weak var chan_di_lbl: UILabel! }
@IBOutlet weak var ru_ku_time_lbl: UILabel!
@IBOutlet weak var pi_ci_number_lbl: UILabel! func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
@IBOutlet weak var gys_name_lbl: UILabel! return 309
@IBAction func check_detail(_ sender: UIButton) { }
delegate?.S_Y_View_Check_Detail(view:self)
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "S_Y_View_Cell") as! S_Y_View_Cell
cell.tag = indexPath.row
cell.data = data![indexPath.row]
cell.delegate = self
return cell
} }
@IBOutlet weak var check_img: UIImageView! @IBOutlet weak var viewHiehgt: NSLayoutConstraint!
var contentView:UIView!
var delegate:S_Y_View_Delegate?
@IBOutlet weak var listView: UITableView!
@IBAction func close_action(_ sender: UIButton) { @IBAction func close_action(_ sender: UIButton) {
self.removeFromSuperview() self.removeFromSuperview()
} }
...@@ -49,12 +60,8 @@ class S_Y_View: UIView { ...@@ -49,12 +60,8 @@ class S_Y_View: UIView {
contentView.snp.makeConstraints { (make) in contentView.snp.makeConstraints { (make) in
make.left.top.right.bottom.equalToSuperview() make.left.top.right.bottom.equalToSuperview()
} }
bao_zhi_qi_lbl.text = "-" listView.register(UINib(nibName: "S_Y_View_Cell", bundle: nil), forCellReuseIdentifier: "S_Y_View_Cell")
sheng_chan_ri_qi_lbl.text = "-" listView.separatorStyle = .none
chan_di_lbl.text = "-"
ru_ku_time_lbl.text = "-"
pi_ci_number_lbl.text = "-"
gys_name_lbl.text = "-"
} }
// /初始化时将xib中的view添加进来 // /初始化时将xib中的view添加进来
required init?(coder aDecoder: NSCoder) { required init?(coder aDecoder: NSCoder) {
...@@ -64,12 +71,14 @@ class S_Y_View: UIView { ...@@ -64,12 +71,14 @@ class S_Y_View: UIView {
contentView.snp.makeConstraints { (make) in contentView.snp.makeConstraints { (make) in
make.left.top.right.bottom.equalToSuperview() make.left.top.right.bottom.equalToSuperview()
} }
bao_zhi_qi_lbl.text = "-" listView.register(UINib(nibName: "S_Y_View_Cell", bundle: nil), forCellReuseIdentifier: "S_Y_View_Cell")
sheng_chan_ri_qi_lbl.text = "-" listView.separatorStyle = .none
chan_di_lbl.text = "-" // bao_zhi_qi_lbl.text = "-"
ru_ku_time_lbl.text = "-" // sheng_chan_ri_qi_lbl.text = "-"
pi_ci_number_lbl.text = "-" // chan_di_lbl.text = "-"
gys_name_lbl.text = "-" // ru_ku_time_lbl.text = "-"
// pi_ci_number_lbl.text = "-"
// gys_name_lbl.text = "-"
} }
//加载xib //加载xib
func loadViewFromNib() -> UIView { func loadViewFromNib() -> UIView {
......
//
// S_Y_View_Cell.swift
// GeliBusinessPlatform
//
// Created by junye lu on 2021/2/22.
// Copyright © 2021 junye lu. All rights reserved.
//
import UIKit
protocol S_Y_View_Cell_delegate {
func S_Y_View_Cell_btn_click(cell:S_Y_View_Cell)
}
class S_Y_View_Cell: UITableViewCell {
@IBOutlet weak var gys_name_lbl: UILabel!
@IBOutlet weak var pi_ci_number_lbl: UILabel!
@IBOutlet weak var ru_ku_time_lbl: UILabel!
@IBOutlet weak var chan_di_lbl: UILabel!
@IBOutlet weak var sheng_chan_ri_qi_lbl: UILabel!
@IBOutlet weak var img_btn: UIButton!
@IBOutlet weak var img: UIImageView!
@IBOutlet weak var bao_zhi_qi_lbl: UILabel!
var delegate:S_Y_View_Cell_delegate?
@IBAction func img_btn_click(_ sender: UIButton) {
delegate?.S_Y_View_Cell_btn_click(cell: self)
}
var data:OrderDetailGoodsSourceModel? {
didSet{
if data != nil {
bao_zhi_qi_lbl.text = data?.valid_date
sheng_chan_ri_qi_lbl.text = data?.production_data
chan_di_lbl.text = data?.product_origin
ru_ku_time_lbl.text = data?.add_time
pi_ci_number_lbl.text = StringByInt(number:(data?.batch_id)!)
gys_name_lbl.text = data?.ven_name
img.sd_setImage(with: URL(string:SERVERCE_ImageHost + ((data?.report_picture?.first)!)!))
}
}
}
override func awakeFromNib() {
super.awakeFromNib()
self.selectionStyle = .none
// Initialization code
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
}
...@@ -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 = 12637 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)
......
...@@ -26,19 +26,17 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa ...@@ -26,19 +26,17 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
} }
} }
} }
func S_Y_View_Check_Detail(view: S_Y_View) { func S_Y_View_Check_Detail(data: OrderDetailGoodsSourceModel) {
print("查看溯源") print("查看溯源")
if view.data == nil {
return
}
let browser = JXPhotoBrowser() let browser = JXPhotoBrowser()
browser.numberOfItems = { browser.numberOfItems = {
(view.data?.report_picture!.count)! (data.report_picture!.count)
} }
browser.pageIndex = 0 browser.pageIndex = 0
browser.reloadCellAtIndex = { context in browser.reloadCellAtIndex = { context in
let browserCell = context.cell as? JXPhotoBrowserImageCell let browserCell = context.cell as? JXPhotoBrowserImageCell
let url = URL(string:SERVERCE_ImageHost + (view.data?.report_picture![context.index])!) let url = URL(string:SERVERCE_ImageHost + (data.report_picture![context.index]))
browserCell?.imageView.sd_setImage(with: url, placeholderImage: nil, options: [], completed: { (_, _, _, _) in browserCell?.imageView.sd_setImage(with: url, placeholderImage: nil, options: [], completed: { (_, _, _, _) in
browserCell?.setNeedsLayout() browserCell?.setNeedsLayout()
}) })
...@@ -47,7 +45,7 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa ...@@ -47,7 +45,7 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
} }
func DaiKeXiaDanGouWuCellDelAction(cell: DaiKeXiaDanGouWuCell) { func DaiKeXiaDanGouWuCellDelAction(cell: DaiKeXiaDanGouWuCell) {
//此处无用 //此处无用
...@@ -60,13 +58,13 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa ...@@ -60,13 +58,13 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
func DaiKeXiaDanGouWuCell_check(cell: DaiKeXiaDanGouWuCell) { func DaiKeXiaDanGouWuCell_check(cell: DaiKeXiaDanGouWuCell) {
print("溯源") print("溯源")
print("check S_Y") print("check S_Y")
let vc = S_Y_View(frame: self.view.bounds)
vc.delegate = self
if (dataMdoel?.order_goods!.count)! > 0 { if (dataMdoel?.order_goods!.count)! > 0 {
let vc = S_Y_View(frame: self.view.bounds)
vc.delegate = self
let target = dataMdoel?.order_goods![cell.tag] 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)
} }
......
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