Commit d331adc0 authored by Steven杜宇's avatar Steven杜宇

// vip

parent d53b8802
......@@ -13,23 +13,23 @@ class YHVipLevelRightViewController: YHBaseViewController, UITableViewDataSource
let titleListTag = 9527
let valueListTag = 9528
var arr:[YHVipLevelRightInfoModel] = [
YHVipLevelRightInfoModel(type: .baseRightSection, title: "基础权益", text1: "5项", text2: "5项", text3: "5项", text4: "5项"),
YHVipLevelRightInfoModel(type: .text, title: "专属顾问", text1: "4小时*5天专人", text2: "8小时*5天专人", text3: "4小时*5天专人", text4: "8小时*5天专人"),
var arr:[[YHVipLevelRightInfoModel]] = [
[YHVipLevelRightInfoModel(type: .text, title: "专属顾问", text1: "4小时*5天专人", text2: "8小时*5天专人", text3: "4小时*5天专人", text4: "8小时*5天专人"),
YHVipLevelRightInfoModel(type: .own, title: "专属积分消费", level1: 1, level2: 1, level3: 1, level4: 1),
YHVipLevelRightInfoModel(type: .own, title: "精品下午茶", level1: 1, level2: 1, level3: 1, level4: 1),
YHVipLevelRightInfoModel(type: .own, title: "线下沙龙", level1: 1, level2: 1, level3: 1, level4: 1),
YHVipLevelRightInfoModel(type: .own, title: "上门解答咨询", level1: 1, level2: 1, level3: 1, level4: 1),
YHVipLevelRightInfoModel(type: .own, title: "上门解答咨询", level1: 1, level2: 1, level3: 1, level4: 1)],
YHVipLevelRightInfoModel(type: .hightRightSection, title: "高端权益", text1: "0项", text2: "2项", text3: "3项", text4: "8项"),
YHVipLevelRightInfoModel(type: .own, title: "高端早教盒子", level1: 0, level2: 1, level3: 1, level4: 1),
[YHVipLevelRightInfoModel(type: .own, title: "高端早教盒子", level1: 0, level2: 1, level3: 1, level4: 1),
YHVipLevelRightInfoModel(type: .own, title: "会客体验中心", level1: 0, level2: 1, level3: 1, level4: 1),
YHVipLevelRightInfoModel(type: .own, title: "中港车接送服务", level1: 0, level2: 0, level3: 1, level4: 1),
YHVipLevelRightInfoModel(type: .own, title: "香港用车服务", level1: 0, level2: 0, level3: 0, level4: 1),
YHVipLevelRightInfoModel(type: .own, title: "国际驾照续期", level1: 0, level2: 0, level3: 0, level4: 1),
YHVipLevelRightInfoModel(type: .own, title: "香港择校规划", level1: 0, level2: 0, level3: 0, level4: 1),
YHVipLevelRightInfoModel(type: .own, title: "品牌策划方案 ", level1: 0, level2: 0, level3: 0, level4: 1),
YHVipLevelRightInfoModel(type: .own, title: " 高端私董会", level1: 0, level2: 0, level3: 0, level4: 1),
YHVipLevelRightInfoModel(type: .own, title: " 高端私董会", level1: 0, level2: 0, level3: 0, level4: 1)],
]
lazy var tableView1: UITableView = {
......@@ -74,6 +74,9 @@ class YHVipLevelRightViewController: YHBaseViewController, UITableViewDataSource
override func viewDidLoad() {
super.viewDidLoad()
gk_navTitle = "我的等级权益".local
view.backgroundColor = .white
view.addSubview(tableView1)
view.addSubview(scrollView)
scrollView.addSubview(tableView2)
......@@ -103,19 +106,25 @@ extension YHVipLevelRightViewController {
if tableView.tag == titleListTag {
let cell = tableView.dequeueReusableCell(withIdentifier: YHVipLevelRightTitleCell.cellReuseIdentifier, for: indexPath) as! YHVipLevelRightTitleCell
if 0 <= indexPath.row, indexPath.row < arr.count {
let model = arr[indexPath.row]
if 0 <= indexPath.section, indexPath.section < arr.count {
let a = arr[indexPath.section]
if 0 <= indexPath.row, indexPath.row < a.count {
let model = a[indexPath.row]
cell.updateModel(model)
cell.backgroundColor = indexPath.row%2 == 0 ? .init(hex: 0xF8F9FB) : .white
}
cell.backgroundColor = indexPath.row%2 == 1 ? .init(hex: 0xF8F9FB) : .white
}
return cell
}
let cell = tableView.dequeueReusableCell(withIdentifier: YHVipLevelRightInfoCell.cellReuseIdentifier, for: indexPath) as! YHVipLevelRightInfoCell
if 0 <= indexPath.row, indexPath.row < arr.count {
let model = arr[indexPath.row]
if 0 <= indexPath.section, indexPath.section < arr.count {
let a = arr[indexPath.section]
if 0 <= indexPath.row, indexPath.row < a.count {
let model = a[indexPath.row]
cell.updateModel(model)
cell.backgroundColor = indexPath.row%2 == 0 ? .init(hex: 0xF8F9FB) : .white
cell.backgroundColor = indexPath.row%2 == 1 ? .init(hex: 0xF8F9FB) : .white
}
}
return cell
}
......@@ -125,11 +134,19 @@ extension YHVipLevelRightViewController {
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if 0 <= section, section < arr.count {
let a = arr[section]
return a.count
}
return 0
}
func numberOfSections(in tableView: UITableView) -> Int {
return arr.count
}
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
return 0.01
return 44
}
func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
......@@ -137,7 +154,21 @@ extension YHVipLevelRightViewController {
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
return UIView()
let model = section == 0 ? YHVipLevelRightInfoModel(type: .baseRightSection, title: "基础权益", text1: "5项", text2: "5项", text3: "5项", text4: "5项") : YHVipLevelRightInfoModel(type: .hightRightSection, title: "高端权益", text1: "0项", text2: "2项", text3: "3项", text4: "8项")
let bgColor: UIColor = section == 0 ? .init(hex: 0xEBF0F9) : .init(hex: 0xFDF4E8)
if tableView.tag == titleListTag {
let cell = YHVipLevelRightTitleCell(style: .default, reuseIdentifier: YHVipLevelRightTitleCell.cellReuseIdentifier)
cell.updateModel(model)
cell.backgroundColor = bgColor
return cell
}
let cell = YHVipLevelRightInfoCell(style: .default, reuseIdentifier: YHVipLevelRightInfoCell.cellReuseIdentifier)
cell.updateModel(model)
cell.backgroundColor = bgColor
return cell
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
......
......@@ -51,7 +51,7 @@ class YHVipLevelRightInfoView: UIView {
self.addSubview(lineView)
lineView.snp.makeConstraints { make in
make.left.top.right.equalToSuperview()
make.left.top.bottom.equalToSuperview()
make.width.equalTo(0.5)
}
......
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