Commit 59c46a9b authored by David黄金龙's avatar David黄金龙

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

* 'develop' of http://gitlab.galaxy-immi.com/mobile-group/galaxy-iOS:
  // 我的证件
  电话号码限制
  //  删除测试代码
  // 公链转私链
  // UI走查
parents 0a9ec1b0 19606c11
......@@ -224,7 +224,12 @@ extension YHCertificateUploadContentListVC: UITableViewDelegate, UITableViewData
}
} else if editType == .preview { // 预览
// 预览 contentItem
print(contentItem.url)
self.viewModel.getPublicImageUrl(contentItem.url) { success, error in
if let success = success {
self.previewFileTool.openXLSXRemoteFile(urlString: success)
}
}
}
}.show()
}
......@@ -544,6 +549,7 @@ extension YHCertificateUploadContentListVC {
msg = errorMsg
}
YHHUD.flash(message: msg)
YHCertificateUploadFailTipsView.tipsView().show()
}
} else {
......
......@@ -160,7 +160,7 @@ class YHNameExtra: SmartCodable {
enum CodingKeys: String, CodingKey {
case applicant = "applicant"
case userName = "userName"
case userName = "user_name"
case organization = "organization"
}
......
......@@ -32,6 +32,29 @@ enum YHCertificateUploadType: Int {
class YHCertificateUploadSheetView: UIView {
static let sheetView = YHCertificateUploadSheetView(frame:UIScreen.main.bounds)
func calculateHeight() -> CGFloat {
guard let templateInfo = templateInfo else { return 0.0}
// 注意事项文字高度
var descHeight = templateInfo.description.boundingRect(with: CGSize(width:KScreenWidth-40.0 , height:.greatestFiniteMagnitude),
options: .usesLineFragmentOrigin,
attributes: [.font : UIFont.PFSC_R(ofSize:14)],
context: nil).size.height
descHeight = ceil(descHeight)+20
// 所有模版高度之和
let templatesHeight = 82.0 * Double(templateArr.count)
// 底部四个操作行高度之和
let actionsHeight = 52.0 * 4.0
let tableViewHeight = descHeight+templatesHeight+actionsHeight
// 白色View总高度
var totalHeight = 53.0+20.0+tableViewHeight+k_Height_safeAreaInsetsBottom()
if totalHeight > KScreenHeight {
totalHeight = 458
}
return totalHeight
}
var templateInfo: YHTemplateInfo? {
didSet {
......@@ -44,6 +67,12 @@ class YHCertificateUploadSheetView: UIView {
templateArr.append(templateInfo.guideFilePath[0])
}
}
let totalHeight = calculateHeight()
whiteContentView.snp.updateConstraints { make in
make.height.equalTo(totalHeight)
}
self.setNeedsLayout()
self.layoutIfNeeded()
self.tableView.reloadData()
}
}
......@@ -195,7 +224,7 @@ class YHCertificateUploadSheetView: UIView {
whiteContentView.snp.makeConstraints { make in
make.left.right.bottom.equalToSuperview()
make.top.equalToSuperview().offset(355)
make.height.equalTo(458.0)
}
topView.snp.makeConstraints { make in
make.top.left.right.equalToSuperview()
......
......@@ -75,6 +75,10 @@ class YHCertificateUploadItemView: UIView {
if item.type == .cancel {
titleLabel.textColor = UIColor(hexString:"#909090")
titleLabel.font = UIFont.PFSC_R(ofSize: 14)
} else {
titleLabel.textColor = UIColor.mainTextColor
titleLabel.font = UIFont.PFSC_M(ofSize: 14)
}
titleLabel.snp.remakeConstraints { make in
......
......@@ -259,13 +259,14 @@ class YHCertificateViewModel: YHBaseViewModel {
if operation == "add" {
if success {
YHHUD.flash(message: "添加成功")
YHHUD.flash(message: "上传成功")
} else {
var msg = "添加失败"
var msg = "上传失败"
if let errorMsg = error?.errorMsg, !errorMsg.isEmpty {
msg = errorMsg
}
YHHUD.flash(message:msg)
YHCertificateUploadFailTipsView.tipsView().show()
}
callBack?()
return
......
......@@ -38,7 +38,6 @@ class YHChildPrimaryInfoVC: YHBaseViewController, YHFamilyMemberProtol {
tableView.register(YHFormItemEnterDetailCell.self, forCellReuseIdentifier: YHFormItemEnterDetailCell.cellReuseIdentifier)
tableView.register(YHFormItemTitleCell.self, forCellReuseIdentifier: YHFormItemTitleCell.cellReuseIdentifier)
tableView.register(YHFormItemAddCell.self, forCellReuseIdentifier: YHFormItemAddCell.cellReuseIdentifier)
tableView.register(YHFormItemQuestionsCell.self, forCellReuseIdentifier: YHFormItemQuestionsCell.cellReuseIdentifier)
tableView.register(YHFormItemSelectSheetCell.self, forCellReuseIdentifier: YHFormItemSelectSheetCell.cellReuseIdentifier)
return tableView
......@@ -165,14 +164,12 @@ class YHChildPrimaryInfoVC: YHBaseViewController, YHFamilyMemberProtol {
}
if detailItem.type == .isAccompanyToHK
|| detailItem.type == .isHandleHKPassPort
|| detailItem.type == .ownCustody
|| detailItem.type == .isLiveTother
|| detailItem.type == .isLiveOverSeasMore1Year
{
return .twoChoice
}
if detailItem.type == .ownCustody
|| detailItem.type == .isLiveTother
|| detailItem.type == .isLiveOverSeasMore1Year{
return .question
}
}
return .defaultType
}
......@@ -251,6 +248,17 @@ extension YHChildPrimaryInfoVC : UITableViewDelegate, UITableViewDataSource {
} else if detailItem.type == .isHandleHKPassPort { // 是否办理港澳通行证
self.child?.setNeedHandleHKPassPort(option)
} else if detailItem.type == .isLiveTother { // 是否与主申请人同住
self.child?.setLiveTother(option)
if option {
self.child?.address.clearAddress()
}
} else if detailItem.type == .isLiveOverSeasMore1Year { // 是否在海外居住满1年及以上
self.child?.setOverSearsOver1Year(option)
} else if detailItem.type == .ownCustody { // 抚养权
self.child?.setOwnCustody(option)
}
self.loadInfo()
save()
......@@ -299,46 +307,8 @@ extension YHChildPrimaryInfoVC : UITableViewDelegate, UITableViewDataSource {
}
}
return cell
} else if cellType == .question {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemQuestionsCell.cellReuseIdentifier, for: indexPath) as! YHFormItemQuestionsCell
cell.isMust = detailItem.isNeed
cell.title = detailItem.getTitle()
var select = false
if let value = detailItem.value {
select = Bool(value)!
}
let answers = [YHFormChoiceItem(title: "是".local, isSelect: select),YHFormChoiceItem(title: "否".local, isSelect: !select)]
cell.answerArr = answers
cell.answerBlock = {
[weak self] (arr, selectIndex) in
let selectItem:YHFormChoiceItem = arr[selectIndex]
let option = (selectItem.title == "是".local ? true : false)
guard let self = self else { return }
if detailItem.type == .isLiveTother { // 是否与主申请人同住
self.child?.setLiveTother(option)
if option {
self.child?.address.clearAddress()
}
} else if detailItem.type == .isLiveOverSeasMore1Year { // 是否在海外居住满1年及以上
self.child?.setOverSearsOver1Year(option)
} else if detailItem.type == .ownCustody { // 抚养权
self.child?.setOwnCustody(option)
}
self.loadInfo()
save()
}
return cell
}
}
return createDefaultCell(indexPath)
}
......
......@@ -38,7 +38,6 @@ class YHSpousePrimaryInfoVC: YHBaseViewController, YHFamilyMemberProtol {
tableView.register(YHFormItemDoubleChoiceCell.self, forCellReuseIdentifier: YHFormItemDoubleChoiceCell.cellReuseIdentifier)
tableView.register(YHFormItemInputTextCell.self, forCellReuseIdentifier: YHFormItemInputTextCell.cellReuseIdentifier)
tableView.register(YHFormItemSelectSheetCell.self, forCellReuseIdentifier: YHFormItemSelectSheetCell.cellReuseIdentifier)
tableView.register(YHFormItemQuestionsCell.self, forCellReuseIdentifier: YHFormItemQuestionsCell.cellReuseIdentifier)
tableView.register(YHFormItemTitleCell.self, forCellReuseIdentifier: YHFormItemTitleCell.cellReuseIdentifier)
tableView.register(YHFormItemAddCell.self, forCellReuseIdentifier: YHFormItemAddCell.cellReuseIdentifier)
return tableView
......@@ -168,7 +167,7 @@ extension YHSpousePrimaryInfoVC : UITableViewDelegate, UITableViewDataSource {
let detailItem = item as! YHFormDetailItem
// 是否随行到香港 / 是否办理港澳通行证 / // 是否与主申请人同住 均用双项按钮cell
if detailItem.type == .isAccompanyToHK || detailItem.type == .isHandleHKPassPort || detailItem.type == .isLiveTother {
if detailItem.type == .isAccompanyToHK || detailItem.type == .isHandleHKPassPort || detailItem.type == .isLiveTother || detailItem.type == .isLiveOverSeasMore1Year {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemDoubleChoiceCell.cellReuseIdentifier, for: indexPath) as! YHFormItemDoubleChoiceCell
cell.isMust = detailItem.isNeed
......@@ -212,32 +211,7 @@ extension YHSpousePrimaryInfoVC : UITableViewDelegate, UITableViewDataSource {
} else if detailItem.type == .isLiveOverSeasMore1Year { // 是否在海外居住满1年及以上
self.spouse?.setOverSearsOver1Year(option)
self.loadInfo()
}
save()
}
return cell
}
if detailItem.type == .isLiveOverSeasMore1Year {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemQuestionsCell.cellReuseIdentifier, for: indexPath) as! YHFormItemQuestionsCell
cell.isMust = detailItem.isNeed
cell.title = detailItem.getTitle()
cell.setTips(detailItem.tips, isShow: isNeedShowError && detailItem.isShowTips)
var select = false
if let value = detailItem.value {
select = Bool(value)!
}
let answers = [YHFormChoiceItem(title: "是".local, isSelect: select),YHFormChoiceItem(title: "否".local, isSelect: !select)]
cell.answerArr = answers
cell.answerBlock = {
[weak self] (arr, selectIndex) in
guard let self = self else { return }
let selectItem:YHFormChoiceItem = arr[selectIndex]
let option = (selectItem.title == "是".local ? true : false)
if detailItem.type == .isLiveOverSeasMore1Year { // 是否在海外居住满1年及以上
} else if detailItem.type == .isLiveOverSeasMore1Year { // 是否在海外居住满1年及以上
self.spouse?.setOverSearsOver1Year(option)
self.loadInfo()
}
......@@ -245,7 +219,7 @@ extension YHSpousePrimaryInfoVC : UITableViewDelegate, UITableViewDataSource {
}
return cell
}
if detailItem.type == .nationOrArea || detailItem.type == .liveCity {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemSelectSheetCell.cellReuseIdentifier, for: indexPath) as! YHFormItemSelectSheetCell
......
......@@ -21,6 +21,7 @@ class YHCompanyViewModel: YHBaseViewModel {
let params = ["company_name":key,"page_size":20,"current_page":1] as [String : Any]
let _ = YHNetRequest.getRequest(url: strUrl,params: params) { [weak self] json, code in
// let _ = YHNetRequest.getRequest(url: strUrl) { [weak self] json, code in
//1. json字符串 转 对象
guard self != nil else { return }
if json.code == 200 {
......
......@@ -61,6 +61,7 @@ class YHPhoneMessageView: UIView {
text.textAlignment = .left
text.keyboardType = .phonePad
text.clearButtonMode = .always
text.delegate = self
text.addTarget(self, action: #selector(textFeildChange), for: .allEvents)
return text
}()
......@@ -84,3 +85,17 @@ class YHPhoneMessageView: UIView {
}
}
}
extension YHPhoneMessageView: UITextFieldDelegate {
func textFieldDidEndEditing(_ textField: UITextField) {
}
func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool {
var newText = (textField.text! as NSString).replacingCharacters(in: range, with: string)
if newText.count > 11 {
return false
}
return true
}
}
......@@ -207,19 +207,16 @@ extension YHMyViewController : UITableViewDelegate, UITableViewDataSource {
} else {
YHHUD.flash(message: "已登录: 功能完善中...")
}
return
let item: PersonalModuleItem = items[indexPath.row];
// 预览文件预研 杜宇todo
if item.title == "我的消息" {
YHHUD.flash(message: "预览image")
self.openXLSXRemoteFile(urlString: "https://upload-cdn.galaxy-immi.com/crm/production/1620280305822.jpg")
} else if item.title == "我的进度" {
YHHUD.flash(message: "预览pdf")
self.openXLSXRemoteFile(urlString: "https://upload-cdn.galaxy-immi.com/crm/production/1620271660487.pdf")
} else if item.title == "积分中心" {
YHHUD.flash(message: "预览xlsx")
self.openXLSXRemoteFile(urlString: "https://test-cdn.galaxy-immi.com/4001001/8979989729091623170120240321152216.xlsx?Expires=1711007546&OSSAccessKeyId=LTAI5tNFvK2xGRrBeJ2z8R2j&Signature=UfM6tRcws5ObN4rp/3ZESEWbM2E%3D&v=1711005746")
} else if item.title == "推荐有理" {
} else if item.title == "我的海报" {
......
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