123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- //
- // HelpListViewController.swift
- // xingchuangke
- //
- // Created by Virgil on 2019/4/16.
- // Copyright © 2019 Virgil. All rights reserved.
- //
- import UIKit
- class ApplyCardHelpListViewController: BaseViewController, UITableViewDataSource, UITableViewDelegate {
- @IBOutlet weak var tableView: UITableView!
- override func viewDidLoad() {
- super.viewDidLoad()
- initNavLeftBackButton()
- self.title = "常见问题"
- tableView.register(UINib(nibName: "HelpListTableViewCell", bundle: nil), forCellReuseIdentifier: "HelpListTableViewCell")
- tableView.delegate = self
- tableView.dataSource = self
- tableView.separatorStyle = .none
- tableView.showsVerticalScrollIndicator = false
- tableView.estimatedRowHeight = 100
- tableView.mj_header = MJRefreshNormalHeader(refreshingBlock: {[weak self] in
- self!.currentPage = 1
- self!.loadData()
- })
- tableView.mj_header?.lastUpdatedTimeKey = "ShowTableViewCell"
- tableView.mj_footer = MJRefreshBackNormalFooter(refreshingBlock: {[weak self] in
- self!.currentPage += 1
- self!.loadData()
- })
- tableView.mj_header?.beginRefreshing()
- // Do any additional setup after loading the view.
- }
- //btnAddTarget(view: self.view, selector: #selector(self.btnMenuClick))
- @IBAction func btnMenuClick(_ sender: AnyObject) {
- switch (sender as! UIButton).tag {
- case 1001: // 在线客服
- break
- case 1002: // 电话客服
- if CommonUntils.getIsSimulator() {
- SVProgressHUD.showError(withStatus: "模拟器环境下不能拨打电话")
- } else {
- if CommonValue.getDefaultValueForKey(key: "customer_phone") != "" {
- CommonUntils.callPhone(phone: CommonValue.getDefaultValueForKey(key: "customer_phone"))
- }
- }
- break
- case 1003: //
- break
- case 1004: //
- break
- case 1005: //
- break
- case 1006: //
- break
- default:
- break
- }
- }
- // MARK: =============加载数据===============
- func loadData() {
- let url = RequestURL.helpPageList
- let params = NSMutableDictionary()
- loadDataList(url: url, params: params, tableView: self.tableView, tag: 1001)
- }
- override func returnData(tag: Int) {
- if tag == 1001 {
- tableView.reloadData()
- }
- }
- override func returnError(tag: Int, type: String) {
- }
- // MARK: TABLEVLEW 实现
- func numberOfSections(in tableView: UITableView) -> Int {
- return 1
- }
- func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
- return self.arrData.count
- }
- func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
- let cell = tableView.dequeueReusableCell(withIdentifier: "HelpListTableViewCell", for: indexPath as IndexPath) as! HelpListTableViewCell
- cell.lblTitle.text = getString(current: indexPath.row, key: "title")
- cell.lblTitle.setTextLineSpace(lineSpace: 4)
- return cell
- }
- func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
- let view = CommonWebViewViewController()
- view.strTitle = "详情"//getString(current: indexPath.row, key: "title");
- view.url = getString(current: indexPath.row, key: "webUrl")
- toViewController(viewController: view)
- }
- override func viewWillAppear(_ animated: Bool) {
- super.viewWillAppear(animated)
- }
- override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
- super.init(nibName: "ApplyCardHelpListViewController", bundle: nil)
- }
- required init?(coder aDecoder: NSCoder) {
- fatalError("init(coder:) has not been implemented")
- }
- }
|