//
|
// MineCustomerServiceVC.swift
|
// OKProject
|
//
|
// Created by alvin_y on 2020/6/17.
|
// Copyright © 2020 yangwang. All rights reserved.
|
//
|
|
import UIKit
|
|
/// 客服
|
class MineCustomerServiceVC: YYTableViewController {
|
|
/// 数据源
|
private let dataSource = ["在线客服","联系客服"]
|
|
override func viewDidLoad() {
|
super.viewDidLoad()
|
|
// Do any additional setup after loading the view.
|
}
|
|
//MARK: - UI
|
override func setupViews() {
|
super.setupViews()
|
navigationItem.title = "客服"
|
tableView.delegate = self
|
tableView.dataSource = self
|
tableView.tableFooterView = UIView()
|
tableView.register(UITableViewCell.self, forCellReuseIdentifier: "item")
|
tableView.separatorColor = UIColor.color(light: UIColor.color(hexString: "#F6F6F6"), dark: UIColor.color(hexString: "#F6F6F6"))
|
}
|
}
|
// MARK: - UITableViewDelegate
|
extension MineCustomerServiceVC:UITableViewDelegate{
|
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
|
return 50
|
}
|
|
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
|
tableView.deselectRow(at: indexPath, animated: true)
|
switch dataSource[indexPath.row] {
|
case "在线客服":
|
let vc = MineOnlineCustomerServiceVC()
|
self.yy_push(vc: vc)
|
break
|
case "联系客服":
|
let vc = MineContactCustomerServiceVC()
|
self.yy_push(vc: vc)
|
break
|
default:
|
break
|
}
|
}
|
}
|
|
// MARK: - UITableViewDelegate
|
extension MineCustomerServiceVC:UITableViewDataSource{
|
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
|
return dataSource.count
|
}
|
|
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
|
let cell = tableView.dequeueReusableCell(withIdentifier: "item", for: indexPath)
|
cell.textLabel?.text = dataSource[indexPath.row]
|
cell.textLabel?.font = Medium(font: 14)
|
cell.textLabel?.textColor = UIColor.color(light: UIColor.color(hexString: "#333333"), dark: UIColor.color(hexString: "#333333"))
|
cell.separatorInset = UIEdgeInsets(top: 0, left: 14, bottom: 0, right: 14)
|
cell.accessoryType = .disclosureIndicator
|
return cell
|
}
|
}
|