Commit dfc6263b authored by Steven杜宇's avatar Steven杜宇

// 赴港

parent 4bc22a28
......@@ -47,9 +47,7 @@ class YHCertificateAppointViewController: YHBaseViewController {
var reservationToHK: Int = 0 // 0没有预约 1已经预約
// 申请人是否统一赴港激活签证 本地记录的开关
var isAllMembersGo: Bool = true // 默认一起去
var semaphore = DispatchSemaphore(value: 1)
lazy var tableView: UITableView = {
let tableView = UITableView(frame:.zero, style:.grouped)
tableView.estimatedSectionHeaderHeight = 0.01
......@@ -833,41 +831,37 @@ extension YHCertificateAppointViewController {
// 请求抢号成功后的反馈回执文件私链URL组对应的公链组
func requestSuccessScriptUrls() {
printLog("XYZ0")
if self.successList.count <= 0 {
return
}
self.semaphore = DispatchSemaphore(value: 1)
let semaphore = DispatchSemaphore(value: 1)
DispatchQueue.global().async {
for model in self.successList {
var publicUrls:[String] = []
for privateUrl in model.receipts {
for (index, privateUrl) in model.receipts.enumerated() {
// 信号-1 如果信号<0 则阻塞等待
self.semaphore.wait()
semaphore.wait()
self.viewModel.getPublicImageUrl(privateUrl) { success, error in
printLog("success: \n\(success)")
if let publicUrl = success {
printLog("ABC: success")
publicUrls.append(publicUrl)
} else {
// 私链转公链失败 只有在点击对应的回执图片的时候再次请求公链
printLog("ABC: failed")
publicUrls.append("")
}
// 释放信号+1
self.semaphore.signal()
semaphore.signal()
}
}
self.semaphore.wait()
semaphore.wait()
model.publicReceipts = publicUrls
self.semaphore.signal()
semaphore.signal()
}
DispatchQueue.main.async {
self.tableView.reloadData()
self.semaphore.wait()
}
}
}
......
......@@ -336,12 +336,13 @@ extension YHMyViewController : UITableViewDelegate, UITableViewDataSource {
return
}
// if true {
// let vc = YHCertificateAppointViewController()
// vc.orderId = 151085
// self.navigationController?.pushViewController(vc)
// return
// } //for test dy
if true {
let vc = YHCertificateAppointViewController()
vc.orderId = 151296
// 151296
self.navigationController?.pushViewController(vc)
return
} //for test dy
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