Commit 7c923ba8 authored by pete谢兆麟's avatar pete谢兆麟

Merge commit '4891bc19' into xiezhaolin

# Conflicts:
#	galaxy/galaxy/Classes/Tools/NetWork/YHNetRequest.swift
parents b62d4d75 4891bc19
......@@ -88,7 +88,7 @@ target 'galaxy' do
#富文本库
pod 'AttributedString','3.3.5'
#json转模型
pod 'HandyJSON', '~> 5.0.2'
pod 'HandyJSON', '5.0.2'
end
......
......@@ -737,13 +737,6 @@
path = C;
sourceTree = "<group>";
};
0468D43F2B61F6BD00CFB916 /* M */ = {
isa = PBXGroup;
children = (
);
path = M;
sourceTree = "<group>";
};
0468D4402B61F6C400CFB916 /* V */ = {
isa = PBXGroup;
children = (
......@@ -1277,21 +1270,12 @@
A5ACE8E72B4564F7002C94D2 /* Mine(我的) */ = {
isa = PBXGroup;
children = (
A5ACE8E82B4564F7002C94D2 /* M */,
0468D43F2B61F6BD00CFB916 /* M */,
A5ACE8EB2B4564F7002C94D2 /* V */,
A5ACE8E92B4564F7002C94D2 /* C */,
);
path = "Mine(我的)";
sourceTree = "<group>";
};
A5ACE8E82B4564F7002C94D2 /* M */ = {
isa = PBXGroup;
children = (
);
path = M;
sourceTree = "<group>";
};
A5ACE8E92B4564F7002C94D2 /* C */ = {
isa = PBXGroup;
children = (
......@@ -2168,7 +2152,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 3;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = RXHYW88XR7;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
......@@ -2188,7 +2172,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 0.1.1;
MARKETING_VERSION = 0.1.2;
PRODUCT_BUNDLE_IDENTIFIER = com.intelligence.galaxy;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
......@@ -2210,7 +2194,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 3;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = RXHYW88XR7;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
......@@ -2230,7 +2214,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 0.1.1;
MARKETING_VERSION = 0.1.2;
PRODUCT_BUNDLE_IDENTIFIER = com.intelligence.galaxy;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
......
......@@ -56,19 +56,12 @@ class YHServiceCenterMainViewController: YHBaseViewController {
override func viewDidLoad() {
super.viewDidLoad()
setupUI()
loadData()
handleRightUI()
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
if YHLoginManager.shared.isLogin() == false {
loginTipsView.isHidden = false
noDataView.isHidden = true
homeTableView.isHidden = true
} else {
loginTipsView.isHidden = true
}
handleRightUI()
loadData()
}
}
......@@ -80,23 +73,13 @@ extension YHServiceCenterMainViewController {
return
}
self.serviceCenterMainReqVM.getContactList { success, error in
serviceCenterMainReqVM.getContactList { success, error in
if success == true {
} else {
YHHUD.flash(message: error?.errorMsg ?? "请求出错")
}
if self.serviceCenterMainReqVM.arrContactList.isEmpty {
self.homeTableView.isHidden = true
self.noDataView.isHidden = false
} else {
self.homeTableView.isHidden = false
self.noDataView.isHidden = true
self.loginTipsView.isHidden = true
}
self.homeTableView.reloadData()
self.handleRightUI()
}
}
......@@ -211,8 +194,25 @@ extension YHServiceCenterMainViewController {
}
@objc func logoutSuccess() {
handleRightUI()
}
private func handleRightUI() {
if YHLoginManager.shared.isLogin() == false {
loginTipsView.isHidden = false
noDataView.isHidden = true
self.homeTableView.isHidden = true
homeTableView.isHidden = true
} else {
loginTipsView.isHidden = true
if serviceCenterMainReqVM.arrContactList.isEmpty {
homeTableView.isHidden = true
noDataView.isHidden = false
} else {
homeTableView.isHidden = false
noDataView.isHidden = true
}
}
homeTableView.reloadData()
}
}
......@@ -10,9 +10,11 @@ import UIKit
class YHCollegeSearchViewController: YHBaseViewController {
var orderId:Int = 0
var searchCollegeName:String?
var selectBlock:((String?)->Void)?
var colleges:[Any] = []
var colleges:[YHCollegeInfo] = []
let educationRequest:YHEducationRequestViewModel = YHEducationRequestViewModel()
lazy var searchBar: YHSearchBar = {
let bar = YHSearchBar.createBar()
......@@ -39,6 +41,7 @@ class YHCollegeSearchViewController: YHBaseViewController {
lazy var emptyDataTipsView:UIView = {
let view = UIView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: 124))
view.isHidden = true
let imgView = UIImageView(image: UIImage(named: "service_center_no_data"))
imgView.contentMode = .scaleAspectFill
......@@ -67,6 +70,9 @@ class YHCollegeSearchViewController: YHBaseViewController {
override func viewDidLoad() {
super.viewDidLoad()
createUI()
if searchCollegeName != nil {
searchCollege()
}
}
func createUI() {
......@@ -83,6 +89,8 @@ class YHCollegeSearchViewController: YHBaseViewController {
searchBar.textChange = {
[weak self] text in
guard let self = self else { return }
searchCollegeName = text
searchCollege()
}
searchBar.confirmBlock = {
[weak self] in
......@@ -105,6 +113,28 @@ class YHCollegeSearchViewController: YHBaseViewController {
make.left.right.bottom.equalToSuperview()
}
}
func searchCollege() {
let param:[String:Any] = ["order_id": orderId,
"name":searchCollegeName ?? "",
"page":1,
"page_size":15,
]
self.educationRequest.searchCollegeInfoList(params: param) {
[weak self] success, error in
guard let self = self else { return }
if success {
if let list = self.educationRequest.collegeList {
colleges = list
} else {
colleges = []
}
emptyDataTipsView.isHidden = colleges.count > 0
}
self.tableView.reloadData()
}
}
}
extension YHCollegeSearchViewController: UITableViewDelegate, UITableViewDataSource {
......@@ -114,19 +144,37 @@ extension YHCollegeSearchViewController: UITableViewDelegate, UITableViewDataSou
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 36.0
return UITableView.automaticDimension
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: YHCollegeNameCell.cellReuseIdentifier, for: indexPath) as! YHCollegeNameCell
cell.titleLabel.text = "XXXXXXXXX"
if indexPath.row < colleges.count {
let college:YHCollegeInfo = colleges[indexPath.row]
var name = ""
if !isEmptyString(college.zhName) {
name += college.zhName
}
if !isEmptyString(college.zhName) && !isEmptyString(college.enName) {
name += "/"
}
if !isEmptyString(college.enName) {
name += college.enName
}
cell.titleLabel.text = name
}
return cell
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if let selectBlock = selectBlock {
selectBlock("")
if indexPath.row < colleges.count {
let college:YHCollegeInfo = colleges[indexPath.row]
selectBlock(college.getCollegeName())
self.navigationController?.popViewController(animated: true)
}
}
}
}
......@@ -299,6 +299,7 @@ extension YHEducationDetailVC : UITableViewDelegate, UITableViewDataSource {
if detailItem.type == .universityFullName { // 选择大学名称
let vc = YHCollegeSearchViewController()
vc.orderId = self.orderId
vc.searchCollegeName = detailInfo.college
vc.selectBlock = {
[weak self] text in
......
......@@ -70,7 +70,7 @@ class YHEducationInfoListVC: YHBaseViewController {
bottomView.saveBlock = {
[weak self] in
guard let self = self else { return }
saveInfo()
saveInfo(isSubmit: false)
self.navigationController?.popViewController(animated: true)
}
......@@ -511,11 +511,11 @@ extension YHEducationInfoListVC {
}
// 保存
func saveInfo() {
func saveInfo(isSubmit:Bool) {
guard let educationInfo = educationInfo else { return }
let params:[String : Any] = [ "order_id": self.orderId,
"goNextFlow": 0,
"goNextFlow": isSubmit,
"isSpouseNameSame": educationInfo.isSpouseNameSame ?? false,
"isNameSame": educationInfo.isNameSame ?? false]
......@@ -524,6 +524,7 @@ extension YHEducationInfoListVC {
guard let self = self else { return }
if success {
requestEducationInfo()
self.navigationController?.popViewController()
}
}
}
......@@ -531,14 +532,13 @@ extension YHEducationInfoListVC {
func submitInfo() {
let isChecked = checkIntegrity()
isNeedShowError = !isChecked
self.tableView .reloadData()
if !isChecked {
YHHUD.flash(message: "资料还未填完")
return
}
saveInfo()
saveInfo(isSubmit: true)
}
// 检查填写信息完整性
......
......@@ -113,11 +113,13 @@ class YHQualificationDetailVC: YHBaseViewController {
let item02 = YHFormDetailItem(type: .conferTime)
item02.placeHolder = "请选择颁授年份".local
item02.tips = "请选择颁授年份".local
if detailInfo.issuingYear > 0 {
item02.value = String(detailInfo.issuingYear)
}
let item03 = YHFormDetailItem(type: .conferCountry)
item03.placeHolder = "请选择颁授国家/地区".local
item02.tips = "请选择颁授国家/地区".local
item03.tips = "请选择颁授国家/地区".local
item03.value = detailInfo.issuingAddr.country
let item04 = YHFormDetailItem(type: .conferCity)
......@@ -261,11 +263,11 @@ extension YHQualificationDetailVC : UITableViewDelegate, UITableViewDataSource {
let detailItem = item as! YHFormDetailItem
if detailItem.type == .qualificationCertificateName { // 资格证书名称
YHFormPickerView.show(type: .professionCertificate, selectType: .professionCertificate(.ACA)) {
[weak self] selectType in
YHSheetPickerView.show(type: .professionCertificate, selectTitle:detailInfo.certName) {
[weak self] selectItem in
guard let self = self else { return }
detailInfo.certName = selectType.title
detailInfo.certName = selectItem.title
loadInfo()
if detailId != 0 {
saveDetailInfo(isNeedPop: false, isShowToast: false)
......@@ -423,6 +425,7 @@ extension YHQualificationDetailVC {
YHHUD.flash(message: "资料还未填完")
return
}
saveDetailInfo(isNeedPop: true, isShowToast: true)
}
......
......@@ -162,5 +162,41 @@ class YHQualificationDetailInfo: SmartCodable {
}
}
class YHCollegeInfo: SmartCodable {
var id: Int = 0
var zhName: String = ""
var enName: String = ""
// 0-未知,1-中文主校,2-英文主校
var mainNameType: Int = 0
var schoolType: Int = 0
var assoProduct: [Int] = []
var color: String = ""
enum CodingKeys: String, CodingKey {
case id = "id"
case zhName = "zh_name"
case enName = "en_name"
case mainNameType = "main_name_type"
case schoolType = "school_type"
case assoProduct = "asso_product"
case color = "color"
}
func getCollegeName() -> String {
if mainNameType == 1 {
return zhName
} else if mainNameType == 2 {
return enName
}
return ""
}
required init() {
}
}
......@@ -15,6 +15,8 @@ class YHEducationRequestViewModel {
var educationDetailInfo: YHEducationDetailInfo?
// 专业详情信息
var qualificationDetailInfo: YHQualificationDetailInfo?
// 搜索学校数组
var collegeList: [YHCollegeInfo]?
// 请求学历和专业证书信息列表
func requestEducationInfoList(params:[String:Any], callBackBlock:@escaping (_ success: Bool,_ error:YHErrorModel?)->()) {
......@@ -215,5 +217,32 @@ class YHEducationRequestViewModel {
}
}
// 搜索学校
func searchCollegeInfoList(params:[String:Any], callBackBlock:@escaping (_ success: Bool,_ error:YHErrorModel?)->()) {
YHHUD.show(.progress(message: "数据加载中..."))
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Education.searchCollegeNameApi
let _ = YHNetRequest.getRequest(url: strUrl, params:params) {[weak self] json, code in
YHHUD.hide()
guard let self = self else { return }
printLog("model 是 ==> \(json)")
let dic = json.data as? [AnyHashable : Any]
guard let dic = dic, let list = dic["list"] as? [[String:Any]], let results = [YHCollegeInfo].deserialize(array: list) as? [YHCollegeInfo] else {
callBackBlock(false,nil)
return
}
collegeList = results
callBackBlock(true,nil)
} failBlock: { err in
callBackBlock(false,err)
}
}
}
......@@ -16,6 +16,7 @@ class YHCollegeNameCell: UITableViewCell {
let label = UILabel()
label.textColor = .mainTextColor
label.textAlignment = .left
label.numberOfLines = 0
label.font = UIFont.PFSC_B(ofSize: 14)
return label
}()
......@@ -37,7 +38,9 @@ class YHCollegeNameCell: UITableViewCell {
titleLabel.snp.makeConstraints { make in
make.left.equalToSuperview().offset(21)
make.right.equalToSuperview().offset(-21)
make.top.bottom.equalToSuperview()
make.top.equalToSuperview().offset(8)
make.bottom.equalToSuperview().offset(-8)
}
}
......
......@@ -62,17 +62,16 @@ class YHEducationInfoCell: UITableViewCell {
return imgView
}()
private lazy var bottomLine:UIView = {
private lazy var topLine:UIView = {
let view = UIView()
view.backgroundColor = .separatorColor
view.isHidden = true
return view
}()
// 是否展示底部分割线
var isShowBottomLine:Bool = false {
// 是否隐藏顶部分割线
var isHiddenTopLine:Bool = false {
didSet {
bottomLine.isHidden = !isShowBottomLine
topLine.isHidden = isHiddenTopLine
}
}
......@@ -99,8 +98,8 @@ class YHEducationInfoCell: UITableViewCell {
contentView.addSubview(subTitleLabel)
contentView.addSubview(timeLabel)
contentView.addSubview(arrowImgView)
contentView.addSubview(bottomLine)
contentView.addSubview(deleteButton)
contentView.addSubview(topLine)
titleLabel.setContentCompressionResistancePriority(.required, for: .horizontal)
......@@ -134,11 +133,11 @@ class YHEducationInfoCell: UITableViewCell {
make.right.equalToSuperview().offset(-horizonalGap)
}
bottomLine.snp.makeConstraints { make in
topLine.snp.makeConstraints { make in
make.left.equalToSuperview().offset(horizonalGap)
make.right.equalToSuperview().offset(-horizonalGap)
make.height.equalTo(1.0)
make.bottom.equalToSuperview()
make.top.equalToSuperview()
}
}
}
......@@ -254,6 +254,7 @@ class YHSheetPickerView: UIView {
YHSheetPickerViewItem(title:"CQF(国际数量金融工程认证)".local, index:10),
YHSheetPickerViewItem(title:"CIMA(管理会计师考试)".local, index:11),
YHSheetPickerViewItem(title:"The Associate Chartered Accountant(英国皇家特许会计师)".local, index:12),
YHSheetPickerViewItem(title:"FCA(Fellow Chartered Accountant)".local, index:13),
],
// 学位类型
......@@ -441,11 +442,20 @@ extension YHSheetPickerView: UIPickerViewDelegate, UIPickerViewDataSource {
}
}
func pickerView(_ pickerView: UIPickerView, widthForComponent component: Int) -> CGFloat {
return KScreenWidth - 16*2
}
func pickerView(_ pickerView: UIPickerView, rowHeightForComponent component: Int) -> CGFloat {
return 44
}
func pickerView(_ pickerView: UIPickerView, viewForRow row: Int, forComponent component: Int, reusing view: UIView?) -> UIView {
let label = UILabel()
label.textColor = UIColor.mainTextColor
label.textAlignment = .center
label.numberOfLines = 2
label.font = UIFont.PFSC_R(ofSize: 14)
label.text = ""
if let arr = dataSource[type] {
......
......@@ -67,6 +67,8 @@ extension YHServiceCenterMainViewModel {
guard let self = self else { return }
printLog("model 是 ==> \(json)")
arrContactList.removeAll()
if json.code == 200 {
let dic = json.data
guard let resultModel = YHContactItemHoldModel.deserialize(dict: dic as? [AnyHashable : Any]) else {
......
......@@ -51,37 +51,36 @@ class YHAllApiName {
// 删除家庭成员信息
static let familyMemberDeleteApi = "frontend/order/information/family/delete"
}
struct Education {
// 获取教育和专业资格列表
// static let getEducationAndQulificationInfoApi = "frontend/education/list"
static let getEducationAndQulificationInfoListApi = "infoflow/getEducationList"
// 获取学历详情信息
// static let getEducationDetailInfoApi = "frontend/education/detail"
static let getEducationDetailInfoApi = "infoflow/getEducationDetail"
// 保存学历信息
// static let saveEducationInfoApi = "frontend/education/save"
static let saveEducationInfoApi = "infoflow/saveEducationData"
// 删除学历
static let deleteEducationInfoApi = "frontend/education/del"
static let deleteEducationInfoApi = "infoflow/delEducationData"
// 保存所有信息
// static let saveAllEduAndQuaInfoApi = "frontend/education/save_all"
static let saveAllEduAndQuaInfoApi = "infoflow/submitEducert"
// 搜索大学名称
static let searchCollegeNameApi = "infoflow/getSchools"
}
struct Qualification {
// 获取学历详情信息
// static let getQualificationDetailInfoApi = "frontend/qualification/detail"
static let getQualificationDetailInfoApi = "infoflow/getQuaDetail"
// 删除专业
static let deleteQualificationInfoApi = "frontend/qualification/del"
static let deleteQualificationInfoApi = "infoflow/delQualification"
// 保存专业详情
// static let saveQualificationInfoApi = "frontend/qualification/save"
static let saveQualificationInfoApi = "infoflow/saveQualification"
}
......
......@@ -17,10 +17,8 @@ class YHBaseUrlManager {
// static let baseUrlTest : String = "https://test-api-gateway.galaxy-immi.com/" //智汇银河 - 微信小程序
static let baseUrlTest : String = "http://test.api.diymanager.galaxy-immi.com/" //APP 使用域名
//正式环境
static let baseUrlRelease : String = ""
static let baseUrlRelease : String = "http://test.api.diymanager.galaxy-immi.com/"
//h5开发环境
static let h5UrlDev : String = ""
......
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