1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- //
- // ProfitDetailViewController.swift
- // xingchuangke
- //
- // Created by Virgil on 2019/7/16.
- // Copyright © 2019 Virgil. All rights reserved.
- //
- import UIKit
- class ProfitDetailViewController: BaseViewController, UITableViewDataSource, UITableViewDelegate {
- @IBOutlet weak var tableView: UITableView!
- var id = ""
- let arrTitle = ["单号", "描述", "类型", "操作金额", "时间", "备注"]
- var arrContent = ["", "", "收入", "", "", "详情"]
- override func viewDidLoad() {
- super.viewDidLoad()
- self.title = "收益详情"
- initNavLeftBackButton()
- tableView.register(UINib(nibName: "ProfitDetailTableViewCell", bundle: nil), forCellReuseIdentifier: "ProfitDetailTableViewCell")
- tableView.delegate = self
- tableView.dataSource = self
- tableView.separatorStyle = .none
- tableView.showsVerticalScrollIndicator = false
- tableView.estimatedRowHeight = 100
- loadData()
- }
- // MARK: =============加载数据===============
- func loadData() {
- let url = RequestURL.creditScoreDetail
- let params = NSMutableDictionary()
- params.setValue(id, forKey: "id")
- loadDataInfo(url: url, params: params, tag: 1001)
- }
- override func returnData(tag: Int) {
- if tag == 1001 {
- arrContent[0] = getString(key: "no")
- arrContent[1] = getString(key: "name")
- arrContent[3] = "+\(getDoubleValue(key: "wallet_amount", defaultValue: 0.00))"
- arrContent[4] = getString(key: "createtime")
- 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 arrTitle.count //self.arrData.count;
- }
- func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
- return 50
- }
- func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
- let cell = tableView.dequeueReusableCell(withIdentifier: "ProfitDetailTableViewCell", for: indexPath as IndexPath) as! ProfitDetailTableViewCell
- //cell.lblTitle.text = getString(indexPath.row, key: "Name")
- cell.lblName.text = arrTitle[indexPath.row]
- cell.lblContent.text = arrContent[indexPath.row]
- return cell
- }
- func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
- // let view = UIViewController()
- // view.oneGoId = self.arrData[indexPath.row]["ItemId"] as! Int
- // self.navigationController?.pushViewController(view, animated: true)
- }
- override func viewWillAppear(_ animated: Bool) {
- super.viewWillAppear(animated)
- }
- override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
- super.init(nibName: "ProfitDetailViewController", bundle: nil)
- }
- required init?(coder aDecoder: NSCoder) {
- fatalError("init(coder:) has not been implemented")
- }
- }
|