| | |
| | | private var tableView:UITableView! |
| | | private var addressManageType:AddressManageType! |
| | | private var viewModel = AddressManageViewModel() |
| | | private var clouse:((AddressModel)->Void)? |
| | | |
| | | required init(type:AddressManageType) { |
| | | super.init(nibName: nil, bundle: nil) |
| | |
| | | viewModel.configure(tableView) |
| | | viewModel.beginRefresh() |
| | | } |
| | | |
| | | |
| | | override func setUI() { |
| | | super.setUI() |
| | |
| | | vc.title = "地址管理" |
| | | JQ_currentViewController().jq_push(vc: vc) |
| | | } |
| | | |
| | | func chooseAddress(_ clouse:@escaping(AddressModel)->Void){ |
| | | self.clouse = clouse |
| | | } |
| | | } |
| | | |
| | | extension AddressManageVC:UITableViewDelegate{ |
| | | |
| | | func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { |
| | | if addressManageType == .choose{ |
| | | let model = viewModel.dataSource.value[indexPath.row] |
| | | clouse?(model) |
| | | self.navigationController?.popViewController() |
| | | } |
| | | } |
| | | } |
| | | |
| | | extension AddressManageVC:UITableViewDataSource{ |