Commit 93f7ff45 authored by lujunye's avatar lujunye

数据nil逻辑补充

parent eab137d7
......@@ -11,6 +11,7 @@ protocol GYS_FX_ProductCellDelegate {
func GYS_FX_ProductCellTableViewCellSelect(idx:Int)
func GYS_FX_ProductCellTableViewCellBtnAction(idx:Int)
}
class GYS_FX_ProductCellTableViewCell: UITableViewCell {
@IBOutlet weak var color_lbl: UILabel!
......
......@@ -281,8 +281,16 @@ class GYS_FX_Product_VC: BaseViewController,UITableViewDelegate,UITableViewDataS
cell.delegate = self
let model = datas[indexPath.row]
cell.title_Lbl.text = model.goods_name
cell.sell_total_Lbl.text = StringByInt(number: model.dbt_sale!)
cell.store_lbl.text = StringByInt(number: model.inventory!)
if model.dbt_sale != nil {
cell.sell_total_Lbl.text = "销量: " + StringByInt(number: model.dbt_sale!)
}else{
cell.sell_total_Lbl.text = "销量: -"
}
if model.inventory != nil {
cell.store_lbl.text = "库存: " + StringByInt(number: model.inventory!)
}else{
cell.store_lbl.text = "库存: -"
}
if model.commission_type == 1 {
cell.FX_Percent_Lbl.text = StringByInt(number: model.commission_per!) + "%"
cell.FX_Percent_Lbl.isHidden = false
......
......@@ -194,8 +194,14 @@ class GYS_FX_SearchViewController: BaseViewController,UITableViewDelegate,UITabl
cell.delegate = self
cell.tag = indexPath.row
cell.title_Lbl.text = model.goods_name
cell.sell_total_Lbl.text = StringByInt(number: model.dbt_sale!)
cell.store_lbl.text = StringByInt(number: model.inventory!)
cell.sell_total_Lbl.text = "销量: -"
if model.dbt_sale != nil {
cell.sell_total_Lbl.text = "销量: " + StringByInt(number: model.dbt_sale!)
}
cell.store_lbl.text = "库存: -"
if model.inventory != nil {
cell.store_lbl.text = "库存: " + StringByInt(number: model.inventory!)
}
if model.commission_type == 1 {
cell.FX_Percent_Lbl.text = StringByInt(number: model.commission_per!) + "%"
cell.FX_Percent_Lbl.isHidden = false
......
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