You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
97 lines
3.0 KiB
97 lines
3.0 KiB
1 year ago
|
//
|
||
1 year ago
|
// PaymentCodeViewControllers.swift
|
||
1 year ago
|
// Lookfit
|
||
|
//
|
||
|
// Created by ecell on 2022/8/25.
|
||
|
// Copyright © 2022 Sheldon. All rights reserved.
|
||
|
//
|
||
|
|
||
|
import UIKit
|
||
|
import AVFoundation
|
||
|
|
||
1 year ago
|
class PaymentCodeViewControllers: ViewController {
|
||
1 year ago
|
|
||
|
var payArr:[String] = [MultiLanguageKey.aliPayCode.localized,
|
||
|
MultiLanguageKey.weChatPayCode.localized,
|
||
|
MultiLanguageKey.payPalCode.localized]
|
||
|
var imgArr:[String] = ["aliPayCode_cell_icon",
|
||
|
"icon_wechat",
|
||
|
"paypalCode_cell_icon",
|
||
|
]
|
||
|
var tableView:UITableView?
|
||
|
|
||
|
override func loadView() {
|
||
|
super.loadView()
|
||
|
}
|
||
|
override func makeUI() {
|
||
|
super.makeUI()
|
||
|
|
||
|
|
||
|
}
|
||
|
|
||
|
override func viewDidLoad() {
|
||
|
super.viewDidLoad()
|
||
|
|
||
|
let label:UILabel = UILabel(frame: CGRect(x: 25, y: 15, width: view.frame.size.width, height: 18))
|
||
|
label.textColor = kHexColor(0x2A2A2A)
|
||
|
label.font = SystemSemiboldFont(16)
|
||
|
label.text = "收款".localized
|
||
|
self.view.addSubview(label);
|
||
|
|
||
|
//创建表视图
|
||
|
self.tableView = UITableView(frame: CGRect(x: 0, y: 48, width: Int(view.frame.size.width), height: 50*payArr.count), style:UITableView.Style.plain)
|
||
|
self.tableView!.delegate = self
|
||
|
self.tableView!.dataSource = self
|
||
|
self.tableView!.rowHeight = 50
|
||
|
self.tableView?.isScrollEnabled = false
|
||
|
self.tableView!.register(UITableViewCell.self, forCellReuseIdentifier: "SwiftCell")
|
||
|
//设置允许单元格多选
|
||
|
self.view.addSubview(self.tableView!)
|
||
|
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
1 year ago
|
extension PaymentCodeViewControllers: UITableViewDelegate {
|
||
1 year ago
|
// 选中
|
||
|
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
|
||
1 year ago
|
let viewModel = UpdataQRCodeImgViewModels()
|
||
1 year ago
|
viewModel.titleName = self.payArr[indexPath.row]
|
||
|
viewModel.payType = indexPath.row + 1
|
||
|
viewModel.viewType = "QB"
|
||
|
self.navigator.show(segue: .upDataQRCodeImg(ViewModel: viewModel), sender: self)
|
||
|
|
||
|
}
|
||
|
}
|
||
|
|
||
1 year ago
|
extension PaymentCodeViewControllers: UITableViewDataSource {
|
||
1 year ago
|
|
||
|
func numberOfSections(in tableView: UITableView) -> Int {
|
||
|
|
||
|
return 1
|
||
|
|
||
|
}
|
||
|
|
||
|
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
|
||
|
|
||
|
return payArr.count
|
||
|
|
||
|
}
|
||
|
|
||
|
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
|
||
|
|
||
|
let identify:String = "SwiftCell"
|
||
|
let cell = tableView.dequeueReusableCell(withIdentifier: identify, for: indexPath)
|
||
|
cell.selectionStyle = UITableViewCell.SelectionStyle.none
|
||
|
cell.textLabel?.text = self.payArr[indexPath.row]
|
||
|
cell.imageView?.image = UIImage(named: self.imgArr[indexPath.row])
|
||
|
cell.accessoryType = UITableViewCell.AccessoryType.disclosureIndicator
|
||
|
return cell
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
|