|
@@ -33,10 +33,13 @@ class DealSelectSymbolViewController: BaseViewController {
|
|
return arr
|
|
return arr
|
|
}()
|
|
}()
|
|
|
|
|
|
- lazy var hotList: [ProductHotListModel] = { // 热门搜索
|
|
|
|
- let arr = [ProductHotListModel]()
|
|
|
|
- return arr
|
|
|
|
- }()
|
|
|
|
|
|
+ lazy var hotList: [ProductHotListModel] = [] {
|
|
|
|
+ didSet {
|
|
|
|
+ if hotList.count > 5 {
|
|
|
|
+ hotList = Array(hotList.prefix(5))
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
var symbol_string: [String] = []
|
|
var symbol_string: [String] = []
|
|
|
|
|
|
@@ -78,7 +81,7 @@ class DealSelectSymbolViewController: BaseViewController {
|
|
tableView.separatorInset = UIEdgeInsets(top: 0, left: 18, bottom: 0, right: 18)
|
|
tableView.separatorInset = UIEdgeInsets(top: 0, left: 18, bottom: 0, right: 18)
|
|
tableView.delegate = self
|
|
tableView.delegate = self
|
|
tableView.dataSource = self
|
|
tableView.dataSource = self
|
|
- tableView.backgroundColor = .clear
|
|
|
|
|
|
+ tableView.backgroundColor = .white
|
|
tableView.tableHeaderView = UIView()
|
|
tableView.tableHeaderView = UIView()
|
|
tableView.tableFooterView = UIView()
|
|
tableView.tableFooterView = UIView()
|
|
tableView.showsHorizontalScrollIndicator = false
|
|
tableView.showsHorizontalScrollIndicator = false
|
|
@@ -86,6 +89,7 @@ class DealSelectSymbolViewController: BaseViewController {
|
|
tableView.register(UINib(nibName: "MSHotCell", bundle: nil), forCellReuseIdentifier: "MSHotCell")
|
|
tableView.register(UINib(nibName: "MSHotCell", bundle: nil), forCellReuseIdentifier: "MSHotCell")
|
|
tableView.register(JDSearchListCell.self, forCellReuseIdentifier: JDSearchListCell.description())
|
|
tableView.register(JDSearchListCell.self, forCellReuseIdentifier: JDSearchListCell.description())
|
|
tableView.contentInsetAdjustmentBehavior = .never
|
|
tableView.contentInsetAdjustmentBehavior = .never
|
|
|
|
+ tableView.keyboardDismissMode = .onDrag
|
|
tableView.mj_header = MJRefreshHeader(refreshingBlock: { [weak self] in
|
|
tableView.mj_header = MJRefreshHeader(refreshingBlock: { [weak self] in
|
|
self?.requestSymbolList(isUp: false)
|
|
self?.requestSymbolList(isUp: false)
|
|
})
|
|
})
|
|
@@ -366,10 +370,14 @@ extension DealSelectSymbolViewController: UITableViewDelegate, UITableViewDataSo
|
|
|
|
|
|
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
|
|
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
|
|
if self.isSearch {
|
|
if self.isSearch {
|
|
|
|
+ tableView.separatorStyle = .singleLine
|
|
|
|
+
|
|
let cell = tableView.dequeueReusableCell(withIdentifier: JDSearchListCell.description()) as! JDSearchListCell
|
|
let cell = tableView.dequeueReusableCell(withIdentifier: JDSearchListCell.description()) as! JDSearchListCell
|
|
cell.updateDealSelectCellWith(model: self.symbolList[indexPath.row])
|
|
cell.updateDealSelectCellWith(model: self.symbolList[indexPath.row])
|
|
return cell
|
|
return cell
|
|
} else {
|
|
} else {
|
|
|
|
+ tableView.separatorStyle = .none
|
|
|
|
+
|
|
let cell: MSHotCell = tableView.dequeueReusableCell(withIdentifier: "MSHotCell") as! MSHotCell
|
|
let cell: MSHotCell = tableView.dequeueReusableCell(withIdentifier: "MSHotCell") as! MSHotCell
|
|
cell.market = self.market
|
|
cell.market = self.market
|
|
cell.updateCellWith(list: [self.hotList])
|
|
cell.updateCellWith(list: [self.hotList])
|
|
@@ -385,7 +393,7 @@ extension DealSelectSymbolViewController: UITableViewDelegate, UITableViewDataSo
|
|
if self.isSearch {
|
|
if self.isSearch {
|
|
return 60
|
|
return 60
|
|
}
|
|
}
|
|
- return 40 + 60 + 5*40
|
|
|
|
|
|
+ return 40 + 60 + 5 * 40
|
|
}
|
|
}
|
|
|
|
|
|
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
|
|
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
|
|
@@ -394,13 +402,13 @@ extension DealSelectSymbolViewController: UITableViewDelegate, UITableViewDataSo
|
|
}
|
|
}
|
|
|
|
|
|
let view = UIView()
|
|
let view = UIView()
|
|
- view.backgroundColor = _color("#F6FAFE&#F6FAFE")
|
|
|
|
|
|
+ view.backgroundColor = .white
|
|
return view
|
|
return view
|
|
}
|
|
}
|
|
|
|
|
|
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
|
|
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
|
|
let view = UIView()
|
|
let view = UIView()
|
|
- view.backgroundColor = _color("#F6FAFE&#F6FAFE")
|
|
|
|
|
|
+ view.backgroundColor = .white
|
|
return view
|
|
return view
|
|
}
|
|
}
|
|
|
|
|