Commit 4bc22a28 authored by Steven杜宇's avatar Steven杜宇

Merge branch 'develop' of http://gitlab.galaxy-immi.com/mobile-group/galaxy-iOS into develop

parents 23d8066e a2e36b0f
...@@ -4946,7 +4946,7 @@ ...@@ -4946,7 +4946,7 @@
CODE_SIGN_ENTITLEMENTS = galaxy/galaxyTestEnv.entitlements; CODE_SIGN_ENTITLEMENTS = galaxy/galaxyTestEnv.entitlements;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1; CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = RXHYW88XR7; DEVELOPMENT_TEAM = RXHYW88XR7;
ENABLE_USER_SCRIPT_SANDBOXING = NO; ENABLE_USER_SCRIPT_SANDBOXING = NO;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
...@@ -5087,7 +5087,7 @@ ...@@ -5087,7 +5087,7 @@
CODE_SIGN_ENTITLEMENTS = galaxy/galaxy.entitlements; CODE_SIGN_ENTITLEMENTS = galaxy/galaxy.entitlements;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1; CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = RXHYW88XR7; DEVELOPMENT_TEAM = RXHYW88XR7;
ENABLE_USER_SCRIPT_SANDBOXING = NO; ENABLE_USER_SCRIPT_SANDBOXING = NO;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
...@@ -5291,7 +5291,7 @@ ...@@ -5291,7 +5291,7 @@
CODE_SIGN_ENTITLEMENTS = galaxy/galaxyDebug.entitlements; CODE_SIGN_ENTITLEMENTS = galaxy/galaxyDebug.entitlements;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1; CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = RXHYW88XR7; DEVELOPMENT_TEAM = RXHYW88XR7;
ENABLE_USER_SCRIPT_SANDBOXING = NO; ENABLE_USER_SCRIPT_SANDBOXING = NO;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
...@@ -5337,7 +5337,7 @@ ...@@ -5337,7 +5337,7 @@
CODE_SIGN_ENTITLEMENTS = galaxy/galaxy.entitlements; CODE_SIGN_ENTITLEMENTS = galaxy/galaxy.entitlements;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1; CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = RXHYW88XR7; DEVELOPMENT_TEAM = RXHYW88XR7;
ENABLE_USER_SCRIPT_SANDBOXING = NO; ENABLE_USER_SCRIPT_SANDBOXING = NO;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
......
...@@ -254,16 +254,19 @@ extension YHServiceCenterMainViewController { ...@@ -254,16 +254,19 @@ extension YHServiceCenterMainViewController {
} }
@objc func pushOrderView() { @objc func pushOrderView() {
// let vc = YHOrderDetailViewController() let vc = YHOrderDetailViewController()
// vc.model = oldModel vc.model = oldModel
// vc.backDate = { [weak self] model in vc.backDate = { [weak self] model in
// guard let self = self else { return } guard let self = self else { return }
// self.model = model self.model = model
// } }
// self.navigationController?.pushViewController(vc) self.navigationController?.pushViewController(vc)
let vc = YHAddAdoptersViewController()
vc.orderId = orderId
navigationController?.pushViewController(vc)
// let vc = YHAddAdoptersViewController()
// vc.orderId = orderId
// navigationController?.pushViewController(vc) //for test pete
} }
} }
......
...@@ -484,6 +484,14 @@ private extension YHSelectApplicantGroupCell { ...@@ -484,6 +484,14 @@ private extension YHSelectApplicantGroupCell {
guard let self = self else { return } guard let self = self else { return }
//1.判断选择的日期是否不在今天之前
if !dateLessGreatToday(date: dateStr) {
YHHUD.flash(message: "不能选择今天之前的日期")
return
}
//2.
if let model = dataModel?.model { if let model = dataModel?.model {
if !showHKHolidayWarmTips(startDateStr: dateStr,endDateStr:nil) { if !showHKHolidayWarmTips(startDateStr: dateStr,endDateStr:nil) {
model.detailDateStr = dateStr model.detailDateStr = dateStr
...@@ -494,6 +502,36 @@ private extension YHSelectApplicantGroupCell { ...@@ -494,6 +502,36 @@ private extension YHSelectApplicantGroupCell {
} }
} }
func dateLessGreatToday(date : String) -> Bool {
if date.count == "2022.02.02".count {
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "yyyy-MM-dd"
// 假设我们有两个日期
if let date1 = dateFormatter.date(from: date) {
let today = Date()
// 使用Calendar比较两个日期
let calendar = Calendar(identifier: .chinese)
let comparisonResult = calendar.compare(today, to: date1, toGranularity: .day)
switch comparisonResult {
case .orderedAscending:
return true
case .orderedDescending:
print("第一个日期在第二个日期之后")
return false
case .orderedSame:
return true
}
}
}
return false
}
// 选择时间段 // 选择时间段
func selectDurationTime() { func selectDurationTime() {
let view = YHRangeDatePickerSheetView.sheetView() let view = YHRangeDatePickerSheetView.sheetView()
......
...@@ -17,12 +17,23 @@ enum UploadCertificateDetailType : Int { ...@@ -17,12 +17,23 @@ enum UploadCertificateDetailType : Int {
class YHUploadCertificateDetailVC: YHBaseViewController { class YHUploadCertificateDetailVC: YHBaseViewController {
lazy var viewModel: YHUploadCertificateViewModel = {
let vm = YHUploadCertificateViewModel()
return vm
}()
var dataModel : YHUploadCertificateModel = YHUploadCertificateModel() {
didSet {
}
}
var detailType : UploadCertificateDetailType = .SmallWhiteNote
var canEditFlag : Bool = true //已上传状态也可以重新传
lazy var uploadImageVM: YHBaseViewModel = { lazy var uploadImageVM: YHBaseViewModel = {
let vm = YHBaseViewModel() let vm = YHBaseViewModel()
return vm return vm
}() }()
var detailType : UploadCertificateDetailType = .SmallWhiteNote
lazy var topImgView: UIImageView = { lazy var topImgView: UIImageView = {
let view = UIImageView(image: UIImage(named: "xbt_tips")) // 343 90 let view = UIImageView(image: UIImage(named: "xbt_tips")) // 343 90
view.layer.cornerRadius = kCornerRadius6 view.layer.cornerRadius = kCornerRadius6
...@@ -30,7 +41,6 @@ class YHUploadCertificateDetailVC: YHBaseViewController { ...@@ -30,7 +41,6 @@ class YHUploadCertificateDetailVC: YHBaseViewController {
return view return view
}() }()
lazy var whiteContentView: UIView = { lazy var whiteContentView: UIView = {
let view = UIView() let view = UIView()
view.backgroundColor = .white view.backgroundColor = .white
...@@ -110,6 +120,11 @@ class YHUploadCertificateDetailVC: YHBaseViewController { ...@@ -110,6 +120,11 @@ class YHUploadCertificateDetailVC: YHBaseViewController {
}() }()
private var startDateStr : String = ""
private var endDateStr : String = ""
private var uploadImageUrl : String = ""
lazy var lineView2 : UIView = { lazy var lineView2 : UIView = {
let view = UIView() let view = UIView()
view.backgroundColor = .separatorColor view.backgroundColor = .separatorColor
...@@ -121,18 +136,166 @@ class YHUploadCertificateDetailVC: YHBaseViewController { ...@@ -121,18 +136,166 @@ class YHUploadCertificateDetailVC: YHBaseViewController {
return view return view
}() }()
lazy var bottomView : YHFileListBottomView = {
let view = YHFileListBottomView()
view.updateBtnTitle(title: "确认,保存")
view.block = { tag in
self.submitInfo()
}
return view
}()
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
setupUI() setupUI()
loadData()
} }
} }
// MARK: - 私有方法
private extension YHUploadCertificateDetailVC { private extension YHUploadCertificateDetailVC {
func isAllInfoOK() -> Bool {
if uploadImageUrl.isEmpty {
var txt = ""
if detailType == .SmallWhiteNote {
txt = "上传小白条"
} else {
txt = "上传香港身份证"
}
YHHUD.flash(message: txt)
return false
}
if detailType == .SmallWhiteNote {
if startDateStr.isEmpty {
YHHUD.flash(message: "选择入境日期")
return false
}
if endDateStr.isEmpty {
YHHUD.flash(message: "选择逗留截止日期")
return false
}
//检验先后 startDateStr < endDateStr
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "yyyy-MM-dd"
// 假设我们有两个日期
if let date1 = dateFormatter.date(from: startDateStr),let date2 = dateFormatter.date(from: endDateStr) {
// 使用Calendar比较两个日期
let calendar = Calendar.current
// 比较结果
let isDate1Earlier = calendar.compare(date1, to: date2, toGranularity: .day) == .orderedAscending
// let isDate2Earlier = calendar.compare(date1, to: date2, toGranularity: .day) == .orderedDescending
if isDate1Earlier {
print("date1 在 date2 之前")
} else {
YHHUD.flash(message: "逗留截止日期必须晚于入境日期")
return false
}
// else if isDate2Earlier {
// print("date2 在 date1 之前")
// } else {
// print("两个日期相同")
// }
}
}
return true
}
func submitInfo() {
if isAllInfoOK() {
if detailType == .SmallWhiteNote {
submitSmallWhiteBarInfo()
} else {
submitHKIDCarInfo()
}
}
}
func submitSmallWhiteBarInfo() {
let params : [String : Any] = [
"small_white_note_url":uploadImageUrl,
"small_white_note_validity_start":startDateStr,
"small_white_note_validity_end":endDateStr,
"user_id": dataModel.user_id,
"order_id":dataModel.order_id,
"user_type":dataModel.user_type,
]
viewModel.submitSmallWhiteBar(params) { success, error in
if success {
YHHUD.flash(message: "保存成功")
} else {
let msg = error?.errorMsg ?? "保存失败,请重试"
YHHUD.flash(message: msg)
}
}
}
func submitHKIDCarInfo() {
let params : [String : Any] = [
"idcard_url":uploadImageUrl,
"user_id": dataModel.user_id,
"order_id":dataModel.order_id,
"user_type":dataModel.user_type,
]
viewModel.submitSmallWhiteBar(params) { success, error in
if success {
YHHUD.flash(message: "保存成功")
} else {
let msg = error?.errorMsg ?? "保存失败,请重试"
YHHUD.flash(message: msg)
}
}
}
@objc func tapItem(gestureRecognizer:UITapGestureRecognizer) {
var title = ""
var defaultDate = ""
if gestureRecognizer.view == startDateItem {
title = "选择入境日期"
defaultDate = startDateStr
} else {
title = "选择逗留截止日期"
defaultDate = endDateStr
}
YHDatePickView.show(type: .yyyymmdd, title:title, lastIsTaday: false, currentDay: defaultDate) { [weak self] dateStr in
guard let self = self else { return }
if gestureRecognizer.view == startDateItem {
startDateStr = dateStr
startDateItem.updateDate(date: dateStr)
} else {
endDateStr = dateStr
endDateItem.updateDate(date: dateStr)
}
}
}
@objc func clickDelImageBtn() { @objc func clickDelImageBtn() {
cardButton.setContent("card_upload", "点击上传") cardButton.setContent("card_upload", "点击上传")
cardButton.setBackgroundImage(UIImage(named: "service_cn_card_front"), for: .normal) cardButton.setBackgroundImage(UIImage(named: "service_cn_card_front"), for: .normal)
delImageButton.isHidden = true delImageButton.isHidden = true
self.uploadImageUrl = ""
} }
@objc func tapExampleMudel() { @objc func tapExampleMudel() {
...@@ -146,39 +309,76 @@ private extension YHUploadCertificateDetailVC { ...@@ -146,39 +309,76 @@ private extension YHUploadCertificateDetailVC {
} }
@objc func clickCardButton() { @objc func clickCardButton() {
YHImagePickerView.show() {[weak self] image in
guard let self = self else { return } if uploadImageUrl.isEmpty {
self.cardButton.setContent("card_loading", "上传中") //选择图片
self.cardButton.startRotationAnimation() YHImagePickerView.show() {[weak self] image in
self.uploadImageVM.uploadImage(image) {[weak self] success, error in guard let self = self else { return }
self.cardButton.setContent("card_loading", "上传中")
self.cardButton.startRotationAnimation()
self.uploadImageVM.uploadImage(image) {[weak self] success, error in
guard let self = self else { return }
self.cardButton.stopRotationAnimation()
self.cardButton.setContent("", "")
self.delImageButton.isHidden = false
guard let url = success else { return }
print(url)
self.uploadImageUrl = url
self.cardButton.setBackgroundImage(image, for: .normal)
self.cardButton.isHidden = false
}
}
} else {
showBigImage()
}
}
func showBigImage() {
if !self.uploadImageUrl.isEmpty {
let vc = YHImageViewController()
vc.imgString = self.uploadImageUrl
UIViewController.current?.navigationController?.pushViewController(vc)
}
}
func loadData() {
let params = [
"cert_type": (detailType == .SmallWhiteNote) ? 1 : 2, //证件类型 1-小白条 2-身份证
"user_id": dataModel.user_id,
"order_id":dataModel.order_id,
"user_type":dataModel.user_type,
] as [String : Any]
viewModel.getCertificateDetailInfo(params) { success, error in
if success {
self.updateUI()
}
}
}
//获取数据后进行更新
func updateUI() {
if let url = viewModel.certificateDetail?.image_url,!url.isYHEmpty() {
uploadImageUrl = url
self.viewModel.getPublicImageUrl(url) {[weak self] success, error in
guard let self = self else { return } guard let self = self else { return }
self.cardButton.stopRotationAnimation()
self.cardButton.setContent("", "")
self.delImageButton.isHidden = false
guard let url = success else { return } guard let url = success else { return }
// self.viewModel.updateModel(self.type, isFront: true, url: url) self.cardButton.kf.setBackgroundImage(with: URL(string: url), for: .normal, completionHandler: { _ in
print(url) self.delImageButton.isHidden = false
self.cardButton.setBackgroundImage(image, for: .normal) })
self.cardButton.isHidden = false self.cardButton.setContent("", "")
// self.viewModel.getPublicImageUrl(url) {[weak self] success, error in
// guard let self = self else { return }
// guard let url = success else { return }
//
// if self.type == .identity {
// self.viewModel.requestCnIDCardMessage(url, isBack: 0) {[weak self] success, error in
// guard self != nil else { return }
// }
// } else {
// self.viewModel.requestHkIDCardMessage(url, isBack: 0) {[weak self] success, error in
// guard self != nil else { return }
// }
// }
// }
} }
} }
if detailType == .SmallWhiteNote {
startDateStr = viewModel.certificateDetail?.start_time ?? ""
endDateStr = viewModel.certificateDetail?.end_time ?? ""
startDateItem.updateDate(date: startDateStr)
endDateItem.updateDate(date: endDateStr)
}
} }
func setupUI() { func setupUI() {
...@@ -225,11 +425,6 @@ private extension YHUploadCertificateDetailVC { ...@@ -225,11 +425,6 @@ private extension YHUploadCertificateDetailVC {
} }
} }
titleTextView.attributed.text = """
\("*", .foreground(UIColor.failColor), .font(UIFont.PFSC_M(ofSize: 17)))\(" 张三的第一次赴港激活小白条 ", .foreground(UIColor.mainTextColor), .font(UIFont.PFSC_M(ofSize: 17)))\(.view(customLabel, .original(.center)))
"""
whiteContentView.addSubview(titleTextView) whiteContentView.addSubview(titleTextView)
titleTextView.snp.makeConstraints { make in titleTextView.snp.makeConstraints { make in
...@@ -257,15 +452,11 @@ private extension YHUploadCertificateDetailVC { ...@@ -257,15 +452,11 @@ private extension YHUploadCertificateDetailVC {
if detailType == .SmallWhiteNote { if detailType == .SmallWhiteNote {
whiteContentView.addSubview(cardButton)
cardButton.snp.makeConstraints { make in titleTextView.attributed.text = """
make.left.equalToSuperview().offset(18) \("*", .foreground(UIColor.failColor), .font(UIFont.PFSC_M(ofSize: 17)))\(" \(dataModel.apply_name)的第一次赴港激活小白条 ", .foreground(UIColor.mainTextColor), .font(UIFont.PFSC_M(ofSize: 17)))\(.view(customLabel, .original(.center)))
make.top.equalTo(cardLabel.snp.bottom).offset(9) """
make.height.equalTo(99)
make.width.equalTo(160)
make.bottom.equalToSuperview().offset(-kMargin)
}
} else if detailType == .HongKongCard {
whiteContentView.addSubview(cardButton) whiteContentView.addSubview(cardButton)
cardButton.snp.makeConstraints { make in cardButton.snp.makeConstraints { make in
make.left.equalToSuperview().offset(18) make.left.equalToSuperview().offset(18)
...@@ -306,10 +497,32 @@ private extension YHUploadCertificateDetailVC { ...@@ -306,10 +497,32 @@ private extension YHUploadCertificateDetailVC {
} }
endDateItem.update(title: "逗留截止") endDateItem.update(title: "逗留截止")
let tap = UITapGestureRecognizer(target: self, action: #selector(tapItem(gestureRecognizer:)))
startDateItem.addGestureRecognizer(tap)
let tap2 = UITapGestureRecognizer(target: self, action: #selector(tapItem(gestureRecognizer:)))
endDateItem.addGestureRecognizer(tap2)
} else if detailType == .HongKongCard {
titleTextView.attributed.text = """
\("*", .foreground(UIColor.failColor), .font(UIFont.PFSC_M(ofSize: 17)))\(" \(dataModel.apply_name)的香港身份 ", .foreground(UIColor.mainTextColor), .font(UIFont.PFSC_M(ofSize: 17)))\(.view(customLabel, .original(.center)))
"""
whiteContentView.addSubview(cardButton)
cardButton.snp.makeConstraints { make in
make.left.equalToSuperview().offset(18)
make.top.equalTo(cardLabel.snp.bottom).offset(9)
make.height.equalTo(99)
make.width.equalTo(160)
make.bottom.equalToSuperview().offset(-kMargin)
}
} }
//可编辑
whiteContentView.addSubview(delImageButton) whiteContentView.addSubview(delImageButton)
delImageButton.snp.makeConstraints { make in delImageButton.snp.makeConstraints { make in
make.centerX.equalTo(cardButton.snp.right) make.centerX.equalTo(cardButton.snp.right)
...@@ -318,5 +531,12 @@ private extension YHUploadCertificateDetailVC { ...@@ -318,5 +531,12 @@ private extension YHUploadCertificateDetailVC {
make.width.equalTo(21) make.width.equalTo(21)
} }
view.addSubview(bottomView)
bottomView.snp.makeConstraints { make in
make.left.equalToSuperview()
make.right.equalToSuperview()
make.bottom.equalToSuperview()
make.height.equalTo(YHFileListBottomView.viewH)
}
} }
} }
...@@ -9,8 +9,6 @@ ...@@ -9,8 +9,6 @@
import UIKit import UIKit
class YHUploadCertificateVC: YHBaseViewController { class YHUploadCertificateVC: YHBaseViewController {
var items: [String] = ["1", "1"]
lazy var viewModel: YHUploadCertificateViewModel = { lazy var viewModel: YHUploadCertificateViewModel = {
let vm = YHUploadCertificateViewModel() let vm = YHUploadCertificateViewModel()
...@@ -69,9 +67,6 @@ class YHUploadCertificateVC: YHBaseViewController { ...@@ -69,9 +67,6 @@ class YHUploadCertificateVC: YHBaseViewController {
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
setupUI() setupUI()
orderId = 150661 //for test hjl
loadData() loadData()
} }
} }
...@@ -149,48 +144,43 @@ extension YHUploadCertificateVC: UITableViewDelegate, UITableViewDataSource { ...@@ -149,48 +144,43 @@ extension YHUploadCertificateVC: UITableViewDelegate, UITableViewDataSource {
} }
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if 0 <= indexPath.section && indexPath.section < items.count { if indexPath.row == 0 {
if indexPath.row == 0 { let warningCell = tableView.dequeueReusableCell(withIdentifier: YHUploadCertificateTitleCell.cellReuseIdentifier, for: indexPath) as! YHUploadCertificateTitleCell
let warningCell = tableView.dequeueReusableCell(withIdentifier: YHUploadCertificateTitleCell.cellReuseIdentifier, for: indexPath) as! YHUploadCertificateTitleCell
var title = ""
var title = "" if indexPath.section == 0 {
if indexPath.section == 0 { title = "小白条"
title = "小白条"
} else {
title = "香港身份证"
}
warningCell.updateTitle(title)
return warningCell
} else { } else {
let approveCell = tableView.dequeueReusableCell(withIdentifier: YHUploadCertificateDetailCell.cellReuseIdentifier, for: indexPath) as! YHUploadCertificateDetailCell title = "香港身份证"
}
if let model = viewModel.uploadCertificateDataListModel { warningCell.updateTitle(title)
if indexPath.section == 0 { return warningCell
let tmp = model.small_whites[indexPath.row - 1] } else {
approveCell.dataModel = tmp let approveCell = tableView.dequeueReusableCell(withIdentifier: YHUploadCertificateDetailCell.cellReuseIdentifier, for: indexPath) as! YHUploadCertificateDetailCell
if indexPath.row == model.small_whites.count { if let model = viewModel.uploadCertificateDataListModel {
approveCell.isLastCell = true if indexPath.section == 0 {
} else { let tmp = model.small_whites[indexPath.row - 1]
approveCell.isLastCell = false approveCell.dataModel = tmp
}
} else if indexPath.section == 1 { if indexPath.row == model.small_whites.count {
let tmp = model.id_cards[indexPath.row - 1] approveCell.isLastCell = true
approveCell.dataModel = tmp } else {
approveCell.isLastCell = false
if indexPath.row == model.id_cards.count { }
approveCell.isLastCell = true } else if indexPath.section == 1 {
} else { let tmp = model.id_cards[indexPath.row - 1]
approveCell.isLastCell = false approveCell.dataModel = tmp
}
if indexPath.row == model.id_cards.count {
approveCell.isLastCell = true
} else {
approveCell.isLastCell = false
} }
} }
return approveCell
} }
return approveCell
} }
let approveCell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath)
return approveCell
} }
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
...@@ -201,14 +191,22 @@ extension YHUploadCertificateVC: UITableViewDelegate, UITableViewDataSource { ...@@ -201,14 +191,22 @@ extension YHUploadCertificateVC: UITableViewDelegate, UITableViewDataSource {
} }
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let vc = YHUploadCertificateDetailVC()
//
if 0 <= indexPath.section && indexPath.section < items.count { if let model = viewModel.uploadCertificateDataListModel {
var tmp : YHUploadCertificateModel?
if indexPath.section == 0 {
let vc = YHUploadCertificateDetailVC() tmp = model.small_whites[indexPath.row - 1]
vc.detailType = .SmallWhiteNote vc.detailType = .SmallWhiteNote
self.navigationController?.pushViewController(vc) } else if indexPath.section == 1 {
tmp = model.id_cards[indexPath.row - 1]
vc.detailType = .HongKongCard
}
if let tmp = tmp {
vc.dataModel = tmp
self.navigationController?.pushViewController(vc)
}
} }
} }
......
...@@ -99,5 +99,9 @@ extension YHUploadCertificateDateItem { ...@@ -99,5 +99,9 @@ extension YHUploadCertificateDateItem {
cardLabel.attributed.text = b cardLabel.attributed.text = b
} }
} }
func updateDate(date : String) {
dateTextField.text = date
}
} }
...@@ -130,9 +130,7 @@ private extension YHVisaPaymentVC { ...@@ -130,9 +130,7 @@ private extension YHVisaPaymentVC {
self.orderID = (id as? Int) ?? 0 self.orderID = (id as? Int) ?? 0
} }
} }
// orderID = 133874//for test hjl
view.addSubview(tableView) view.addSubview(tableView)
view.addSubview(bottomView) view.addSubview(bottomView)
bottomView.snp.makeConstraints { make in bottomView.snp.makeConstraints { make in
...@@ -155,6 +153,7 @@ private extension YHVisaPaymentVC { ...@@ -155,6 +153,7 @@ private extension YHVisaPaymentVC {
if self.viewModel.isAllMemberPay() { if self.viewModel.isAllMemberPay() {
//跳转 //跳转
let vc = YHUploadCertificateVC() let vc = YHUploadCertificateVC()
vc.orderId = orderID
self.navigationController?.push(vc, removeClass: YHVisaPaymentVC.self) self.navigationController?.push(vc, removeClass: YHVisaPaymentVC.self)
} else { } else {
postPaymentResult() postPaymentResult()
......
...@@ -39,6 +39,7 @@ private extension YHFileListBottomView { ...@@ -39,6 +39,7 @@ private extension YHFileListBottomView {
button.layer.cornerRadius = kCornerRadius3 button.layer.cornerRadius = kCornerRadius3
button.clipsToBounds = true button.clipsToBounds = true
button.addTarget(self, action: #selector(submit), for: .touchUpInside) button.addTarget(self, action: #selector(submit), for: .touchUpInside)
button.backgroundColor = UIColor.brandMainColor
return button return button
}() }()
addSubview(nextButton) addSubview(nextButton)
...@@ -49,14 +50,16 @@ private extension YHFileListBottomView { ...@@ -49,14 +50,16 @@ private extension YHFileListBottomView {
make.left.equalTo(kMargin) make.left.equalTo(kMargin)
} }
nextButton.layoutIfNeeded()
nextButton.addYinHeGradualLayer()
} }
@objc func save() {
block?(0)
}
@objc func submit() { @objc func submit() {
block?(1) block?(1)
} }
} }
extension YHFileListBottomView {
func updateBtnTitle(title : String) {
nextButton.setTitle(title, for: .normal)
}
}
...@@ -142,16 +142,6 @@ class YHMyViewController: YHBaseViewController, ConstraintRelatableTarget { ...@@ -142,16 +142,6 @@ class YHMyViewController: YHBaseViewController, ConstraintRelatableTarget {
vc.myDefaultNavItemIndex = 2 vc.myDefaultNavItemIndex = 2
self.navigationController?.pushViewController(vc) self.navigationController?.pushViewController(vc)
print("最近浏览") print("最近浏览")
// let view = YHRangeDatePickerSheetView.sheetView()
// view.block = { (startDate,endDate) in
// print("选择的日期是:")
// print(startDate)
// print(endDate)
// }
// view.show() //for test hjl
} }
return view return view
}() }()
...@@ -346,12 +336,12 @@ extension YHMyViewController : UITableViewDelegate, UITableViewDataSource { ...@@ -346,12 +336,12 @@ extension YHMyViewController : UITableViewDelegate, UITableViewDataSource {
return return
} }
if true { // if true {
let vc = YHCertificateAppointViewController() // let vc = YHCertificateAppointViewController()
vc.orderId = 151085 // vc.orderId = 151085
self.navigationController?.pushViewController(vc) // self.navigationController?.pushViewController(vc)
return // return
} // } //for test dy
let item: PersonalModuleItem = items[indexPath.row] let item: PersonalModuleItem = items[indexPath.row]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment