Commit 4fca4d46 authored by pete谢兆麟's avatar pete谢兆麟

我的明片等入口添加

parent b38e217f
......@@ -61,6 +61,8 @@
044D0C022C216AAF00C5CF5E /* YHInformationAuthorizeViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044D0C012C216AAF00C5CF5E /* YHInformationAuthorizeViewModel.swift */; };
044D0C042C2180B700C5CF5E /* YHInformationAuthorizationStepTwoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044D0C032C2180B700C5CF5E /* YHInformationAuthorizationStepTwoViewController.swift */; };
044D0C062C22736F00C5CF5E /* YHSetExplainView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044D0C052C22736F00C5CF5E /* YHSetExplainView.swift */; };
044D0C0D2C22876A00C5CF5E /* YHEditBaseUserInfoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044D0C0C2C22876A00C5CF5E /* YHEditBaseUserInfoViewController.swift */; };
044D0C0F2C2287C500C5CF5E /* YHEditViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044D0C0E2C2287C500C5CF5E /* YHEditViewModel.swift */; };
045EEE792B9F171A0022A143 /* YHPreviewViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045EED9A2B9F171A0022A143 /* YHPreviewViewModel.swift */; };
045EEE7A2B9F171A0022A143 /* YHPreviewForOtherInfoModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045EED9C2B9F171A0022A143 /* YHPreviewForOtherInfoModel.swift */; };
045EEE7B2B9F171A0022A143 /* YHPersonInfoCellModel2.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045EED9D2B9F171A0022A143 /* YHPersonInfoCellModel2.swift */; };
......@@ -579,6 +581,8 @@
044D0C012C216AAF00C5CF5E /* YHInformationAuthorizeViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHInformationAuthorizeViewModel.swift; sourceTree = "<group>"; };
044D0C032C2180B700C5CF5E /* YHInformationAuthorizationStepTwoViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHInformationAuthorizationStepTwoViewController.swift; sourceTree = "<group>"; };
044D0C052C22736F00C5CF5E /* YHSetExplainView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSetExplainView.swift; sourceTree = "<group>"; };
044D0C0C2C22876A00C5CF5E /* YHEditBaseUserInfoViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHEditBaseUserInfoViewController.swift; sourceTree = "<group>"; };
044D0C0E2C2287C500C5CF5E /* YHEditViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHEditViewModel.swift; sourceTree = "<group>"; };
045EED9A2B9F171A0022A143 /* YHPreviewViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHPreviewViewModel.swift; sourceTree = "<group>"; };
045EED9C2B9F171A0022A143 /* YHPreviewForOtherInfoModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHPreviewForOtherInfoModel.swift; sourceTree = "<group>"; };
045EED9D2B9F171A0022A143 /* YHPersonInfoCellModel2.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHPersonInfoCellModel2.swift; sourceTree = "<group>"; };
......@@ -1205,6 +1209,47 @@
path = C;
sourceTree = "<group>";
};
044D0C072C22874600C5CF5E /* MyCard(我的名片) */ = {
isa = PBXGroup;
children = (
044D0C082C22874600C5CF5E /* VM */,
044D0C092C22874600C5CF5E /* M */,
044D0C0A2C22874600C5CF5E /* C */,
044D0C0B2C22874600C5CF5E /* V */,
);
path = "MyCard(我的名片)";
sourceTree = "<group>";
};
044D0C082C22874600C5CF5E /* VM */ = {
isa = PBXGroup;
children = (
044D0C0E2C2287C500C5CF5E /* YHEditViewModel.swift */,
);
path = VM;
sourceTree = "<group>";
};
044D0C092C22874600C5CF5E /* M */ = {
isa = PBXGroup;
children = (
);
path = M;
sourceTree = "<group>";
};
044D0C0A2C22874600C5CF5E /* C */ = {
isa = PBXGroup;
children = (
044D0C0C2C22876A00C5CF5E /* YHEditBaseUserInfoViewController.swift */,
);
path = C;
sourceTree = "<group>";
};
044D0C0B2C22874600C5CF5E /* V */ = {
isa = PBXGroup;
children = (
);
path = V;
sourceTree = "<group>";
};
045EED972B9F171A0022A143 /* ServiceProcess(我的信息流程) */ = {
isa = PBXGroup;
children = (
......@@ -2398,6 +2443,7 @@
A5ACE8E72B4564F7002C94D2 /* Mine(我的) */ = {
isa = PBXGroup;
children = (
044D0C072C22874600C5CF5E /* MyCard(我的名片) */,
0414BDB02BCCC09000225367 /* Model */,
048B2A4B2BC7DACF00A93BF0 /* ViewModel */,
A5ACE8EB2B4564F7002C94D2 /* V */,
......@@ -3233,6 +3279,7 @@
04174D792BCD5B74000BA46D /* YHMessageSessionCell.swift in Sources */,
045EEEA62B9F171A0022A143 /* YHCompanySelectViewController.swift in Sources */,
0425E6462BA9678E00A5E763 /* YHSchemeHeadTotalScoreView.swift in Sources */,
044D0C0F2C2287C500C5CF5E /* YHEditViewModel.swift in Sources */,
045EEEA92B9F171A0022A143 /* YHWorkExperienceListViewController.swift in Sources */,
04A7BD132BA42F4200BD35A2 /* YHMyDocumentsDetailViewController.swift in Sources */,
04A671622BA058DE00C1FB91 /* YHCertificateEditSheetView.swift in Sources */,
......@@ -3292,6 +3339,7 @@
049A48A82B49417300D0C641 /* YHAboutUsViewController.swift in Sources */,
047619E92BA9867100F45358 /* YHCountryHotView.swift in Sources */,
041390692C1081FA0098CB8A /* YHFileListEmptyView.swift in Sources */,
044D0C0D2C22876A00C5CF5E /* YHEditBaseUserInfoViewController.swift in Sources */,
045EEEF82B9F171A0022A143 /* YHFormItemOnlyDoubleChoiceCell.swift in Sources */,
0480976D2BA158A1000B9DCA /* YHCertificateListVC.swift in Sources */,
045EEE8B2B9F171A0022A143 /* YHPreviewMainApplicantInfoViewController.swift in Sources */,
......
......@@ -95,7 +95,11 @@ extension YHMyNameCardViewController: UITableViewDelegate, UITableViewDataSource
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: YHMyNameCardAvatarInfoCell.cellReuseIdentifier, for: indexPath) as! YHMyNameCardAvatarInfoCell
cell.editBlock = { [weak self] in
guard let self = self else { return }
let vc = YHEditBaseUserInfoViewController()
self.navigationController?.pushViewController(vc)
}
if indexPath.section == 1 {
let cell = tableView.dequeueReusableCell(withIdentifier: YHMyIntroductionCell.cellReuseIdentifier, for: indexPath) as! YHMyIntroductionCell
......
......@@ -10,10 +10,12 @@ import UIKit
enum YHUserInformationID: Int {
case id1 = 0 // 真实姓名
case id2 = 1 // 所在地
case id2 = 1 // 所在地
case id3 = 2 // 毕业院校
case id4 = 3 // 所属行业
case id5 = 4 // 职位
case id6 = 5 // 所在地
case id7 = 6 // 星座
}
struct YHUserInformationModel {
......@@ -40,9 +42,11 @@ class YHMainUserInformationModel: YHBaseModel {
var headUrl: String = ""
var username: String = ""
var area: [String] = []
var country: String = ""
var school: String = ""
var industry: String = ""
var position: String = ""
var constellation: String = ""
}
class YHMainUserInformationSetModel: YHBaseModel {
......
......@@ -120,19 +120,6 @@ class YHMyInformationItemCell: UITableViewCell {
nextStepImageView.isHidden = true
centerButton.isHidden = true
} else {
if let type = dataSource.type {
switch type {
case .normal: break
case .address: break
case .time: break
case .image: break
case .id: break
case .country: break
case .sex: break
case .marry: break
}
}
nextStepImageView.isHidden = false
centerButton.isHidden = false
messageTextField.snp.remakeConstraints { make in
......@@ -173,9 +160,27 @@ class YHMyInformationItemCell: UITableViewCell {
block(self.dataSource ?? YHUserInformationModel())
}
}
case .country: break
case .country:
let vc = YHSelectCountryViewController()
vc.backLocationStringController = { (country) in
self.dataSource?.message = country
self.updateAllViews()
if let block = self.block {
block(self.dataSource ?? YHUserInformationModel())
}
}
UIViewController.current?.navigationController?.pushViewController(vc)
case .sex: break
case .marry: break
case .constellation:
YHOtherPickerView.show(type: .constellation, selectTitle: self.dataSource?.message ?? "") { item in
print(item)
self.dataSource?.message = item.title
self.updateAllViews()
if let block = self.block {
block(self.dataSource ?? YHUserInformationModel())
}
}
}
}
......
......@@ -9,7 +9,8 @@
import UIKit
class YHMyNameCardAvatarInfoCell: UITableViewCell {
typealias EditBlock = () -> ()
var editBlock: EditBlock?
static let cellReuseIdentifier = "YHMyNameCardAvatarInfoCell"
let headWidth = 74.0
......@@ -43,6 +44,7 @@ class YHMyNameCardAvatarInfoCell: UITableViewCell {
lazy var editBtn:UIButton = {
let btn = UIButton()
btn.setImage(UIImage(named: "people_card_edit"), for: .normal)
btn.addTarget(self, action: #selector(edit), for: .touchUpInside)
btn.YH_clickEdgeInsets = UIEdgeInsets(top: 20, left: 20, bottom: 20, right: 20)
return btn
}()
......@@ -168,4 +170,9 @@ class YHMyNameCardAvatarInfoCell: UITableViewCell {
}
}
@objc func edit() {
if let block = editBlock {
block()
}
}
}
......@@ -17,6 +17,7 @@ class YHInformationAuthorizeViewModel: YHBaseViewModel {
func getBaseDataSource() -> [YHUserInformationModel] {
let item1 = YHUserInformationModel(id: .id1, title: "真实姓名", isUserKeyBoard: true, prompts: "请输入您的真实姓名", message: mainModel.username)
let item2 = YHUserInformationModel(id: .id6, title: "所在地", isUserKeyBoard: false, prompts: "请选择您的所在地", message: mainModel.country, type: .country, value: mainModel.area)
var string = ""
let array = mainModel.area
for item in array {
......@@ -26,11 +27,14 @@ class YHInformationAuthorizeViewModel: YHBaseViewModel {
string = string + item
}
}
let item2 = YHUserInformationModel(id: .id2, title: "所在地", isUserKeyBoard: false, prompts: "请选择您的所在地", message: string, type: .address, value: mainModel.area)
let item3 = YHUserInformationModel(id: .id3, title: "毕业院校", isUserKeyBoard: true, prompts: "请输入您的毕业院校", message: mainModel.school)
let item4 = YHUserInformationModel(id: .id4, title: "所属行业", isUserKeyBoard: false, prompts: "请选择您的所属行业", message: mainModel.industry, type: .id)
let item5 = YHUserInformationModel(id: .id5, title: "职位", isUserKeyBoard: true, prompts: "请输入您的职位", message: mainModel.position)
return [item1, item2, item3, item4, item5]
let item3 = YHUserInformationModel(id: .id2, title: "所在地-省市", isUserKeyBoard: false, prompts: "请选择您的所在地", message: string, type: .address, value: mainModel.area)
let item4 = YHUserInformationModel(id: .id3, title: "毕业院校", isUserKeyBoard: true, prompts: "请输入您的毕业院校", message: mainModel.school)
let item5 = YHUserInformationModel(id: .id4, title: "所属行业", isUserKeyBoard: false, prompts: "请选择您的所属行业", message: mainModel.industry, type: .id)
let item6 = YHUserInformationModel(id: .id5, title: "职位", isUserKeyBoard: true, prompts: "请输入您的职位", message: mainModel.position)
if mainModel.country.contains("中国") {
return [item1, item2, item3, item4, item5, item6]
}
return [item1, item2, item4, item5, item6]
}
func updateModel(_ item: YHUserInformationModel) {
......@@ -46,6 +50,10 @@ class YHInformationAuthorizeViewModel: YHBaseViewModel {
mainModel.industry = item.message ?? ""
case .id5:
mainModel.position = item.message ?? ""
case .id6:
mainModel.country = item.message ?? ""
default:
break
}
}
......
......@@ -17,6 +17,7 @@ enum YHItemSelectType: Int {
case country = 5
case sex = 6
case marry = 7
case constellation = 8
}
enum YHItemID: Int {
......
......@@ -213,10 +213,6 @@ class YHItemView: UIView {
} else {
if let type = dataSource.type {
switch type {
case .normal: break
case .address: break
case .time: break
case .image: break
case .id:
if dataSource.message == "0" || dataSource.message == "11" {
messageTextField.text = ""
......@@ -227,7 +223,6 @@ class YHItemView: UIView {
messageTextField.text = item["title"]
}
}
case .country: break
case .sex:
if dataSource.message == "0" {
messageTextField.text = ""
......@@ -248,6 +243,7 @@ class YHItemView: UIView {
messageTextField.text = item["title"]
}
}
default: break
}
}
nextStepImageView.isHidden = false
......@@ -509,6 +505,7 @@ class YHItemView: UIView {
block(self.dataSource ?? YHItemModel())
}
}
default: break
}
}
......
......@@ -242,6 +242,8 @@ class YHOtherPickerView: UIView {
return "选择性别"
case .marry:
return "选择婚姻状况"
case .constellation:
return "选择星座"
default:
return "请选择"
}
......@@ -269,7 +271,7 @@ extension YHOtherPickerView: UIPickerViewDelegate, UIPickerViewDataSource {
func pickerView(_ pickerView: UIPickerView, rowHeightForComponent component: Int) -> CGFloat {
switch type {
case .nature,.certificate,.structure,.level,.prove,.idType,.sex,.marry:
case .nature,.certificate,.structure,.level,.prove,.idType,.sex,.marry,.constellation:
return 50
default:
return 70
......@@ -279,7 +281,7 @@ extension YHOtherPickerView: UIPickerViewDelegate, UIPickerViewDataSource {
func pickerView(_ pickerView: UIPickerView, viewForRow row: Int, forComponent component: Int, reusing view: UIView?) -> UIView {
switch type {
case .nature,.certificate,.structure,.level,.prove,.idType,.sex,.marry:
case .nature,.certificate,.structure,.level,.prove,.idType,.sex,.marry,.constellation:
let label = UILabel()
label.textColor = UIColor.mainTextColor
label.font = UIFont.PFSC_M(ofSize: 14)
......@@ -413,6 +415,14 @@ extension YHOtherPickerView {
arrData.append(model)
}
title = getTitle(type: type)
case .constellation:
let arr = YHConstantArrayData.arrDegreeConstellation
arrData.removeAll()
arr.forEach { item in
let model = YHOtherPickerViewItemData(title: item["title"] ?? "-", subTitle: "", index: item["id"] ?? "-")
arrData.append(model)
}
title = getTitle(type: type)
default:
return
}
......
......@@ -13,9 +13,10 @@ import SafariServices
enum YHPersonalModuleItemType: Int {
case none = 0
case myCard
case myMessage
case myProgress
case myActivity
case scoreCenter
case recommend
case myPoster
......@@ -75,10 +76,12 @@ class YHMyViewController: YHBaseViewController, ConstraintRelatableTarget {
lazy var items: [PersonalModuleItem] = {
var arrData = [
PersonalModuleItem(icon: "mine_item_card", title: "我的名片".local, type:.myCard),
PersonalModuleItem(icon: "mine_item_msg", title: "我的消息".local, type:.myMessage),
PersonalModuleItem(icon: "mine_item_scoreCenter", title: "积分中心".local, type:.scoreCenter),
PersonalModuleItem(icon: "mine_item_code", title: "我的测评码".local, type:.myTestCode),
PersonalModuleItem(icon: "mine_item_appoint", title: "预约银河湾".local, type:.appointGalaxyBay)
PersonalModuleItem(icon: "mine_item_appoint", title: "预约银河湾".local, type:.appointGalaxyBay),
PersonalModuleItem(icon: "mine_item_activity", title: "我的活动".local, type:.myActivity)
]
return arrData
}()
......@@ -283,11 +286,12 @@ extension YHMyViewController : UITableViewDelegate, UITableViewDataSource {
let item: PersonalModuleItem = items[indexPath.row]
switch item.type {
case .myCard://我的名片
let vc = YHMyNameCardViewController()
self.navigationController?.pushViewController(vc)
case .myMessage://我的消息
printLog("我的消息")
// let vc = YHMessageListVC()
// self.navigationController?.pushViewController(vc)
let vc = YHUserInfoSettingViewController()
let vc = YHMessageListVC()
self.navigationController?.pushViewController(vc)
case .scoreCenter:////积分中心
printLog("积分中心")
......@@ -319,6 +323,8 @@ extension YHMyViewController : UITableViewDelegate, UITableViewDataSource {
vc.vcTitle = "预约银河湾"
vc.url = "https://upload.cdn.galaxy-immi.com/sell/product/images/page-1686138671996.png"
self.navigationController?.pushViewController(vc)
case .myActivity:
printLog("我的活动")
default:
printLog("不需要响应")
}
......
//
// YHEditBaseUserInfoViewController.swift
// galaxy
//
// Created by EDY on 2024/6/19.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHEditBaseUserInfoViewController: YHBaseViewController {
var photoImageView: UIImageView!
var photoButton: UIButton!
var changeButton: UIButton!
var nextButton: UIButton!
var tableView: UITableView!
var promptView: YHFailPromptView!
var items: [YHUserInformationModel] = []
var viewModel: YHEditViewModel = YHEditViewModel()
override func viewDidLoad() {
super.viewDidLoad()
setView()
getData()
}
func getData() {
items = viewModel.getBaseDataSource()
tableView.reloadData()
}
func setView() {
gk_navTitle = "设置"
view.backgroundColor = .white
photoImageView = {
let imageView = UIImageView()
imageView.image = UIImage(named: "user_photo_default")
imageView.contentMode = .scaleAspectFill
imageView.isUserInteractionEnabled = true
imageView.layer.cornerRadius = 46.5
imageView.layer.masksToBounds = true
return imageView
}()
view.addSubview(photoImageView)
photoImageView.snp.makeConstraints { make in
make.centerX.equalToSuperview()
make.top.equalTo(k_Height_NavigationtBarAndStatuBar + 60)
make.height.width.equalTo(93)
}
photoButton = {
let button = UIButton(type: .custom)
button.setImage(UIImage(named: "user_take_photo"), for: .normal)
button.addTarget(self, action: #selector(takePhoto), for: .touchUpInside)
return button
}()
view.addSubview(photoButton)
photoButton.snp.makeConstraints { make in
make.bottom.equalTo(photoImageView.snp.bottom)
make.right.equalTo(photoImageView.snp.right)
make.width.height.equalTo(28)
}
changeButton = {
let button = UIButton(type: .custom)
button.setImage(UIImage(named: "user_change_photo"), for: .normal)
button.addTarget(self, action: #selector(changeHead), for: .touchUpInside)
return button
}()
view.addSubview(changeButton)
changeButton.snp.makeConstraints { make in
make.centerX.equalToSuperview()
make.top.equalTo(photoImageView.snp.bottom).offset(20)
make.width.equalTo(68.5)
make.height.equalTo(20)
}
nextButton = {
let button = UIButton(type: .custom)
button.backgroundColor = UIColor.brandMainColor
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 16)
button.contentHorizontalAlignment = .center
button.setTitle("保存", for: .normal)
button.setTitleColor( UIColor(hex:0xffffff), for: .normal)
button.layer.cornerRadius = kCornerRadius3
button.addTarget(self, action: #selector(nextStep), for: .touchUpInside)
return button
}()
view.addSubview(nextButton)
nextButton.snp.makeConstraints { make in
make.left.equalTo(16)
make.right.equalTo(-16)
make.bottom.equalTo(-8 - k_Height_safeAreaInsetsBottom())
make.height.equalTo(48)
}
tableView = {
let tableView = UITableView(frame:.zero, style:.grouped)
if #available(iOS 11.0, *) {
tableView.contentInsetAdjustmentBehavior = .never
}
tableView.backgroundColor = .white
tableView.separatorStyle = .none
tableView.delegate = self
tableView.dataSource = self
tableView.register(cellWithClass: YHMyInformationItemCell.self)
return tableView
}()
view.addSubview(tableView)
tableView.snp.makeConstraints { make in
make.top.equalTo(changeButton.snp.bottom).offset(24)
make.bottom.equalTo(-k_Height_safeAreaInsetsBottom() - 64 - 36)
make.left.right.equalTo(view)
}
}
@objc func takePhoto() {
view.endEditing(true)
YHImagePickerView.show() {[weak self] image in
guard let self = self else { return }
self.photoImageView.image = image
}
}
@objc func changeHead() {
}
@objc func nextStep() {
self.navigationController?.popViewController(animated: true)
}
}
extension YHEditBaseUserInfoViewController: UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return items.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withClass: YHMyInformationItemCell.self)
cell.dataSource = items[indexPath.row]
cell.block = { [weak self] model in
guard let self = self else { return }
self.viewModel.updateModel(model)
if model.id != .id1 {
self.getData()
}
}
return cell
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 61.0
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let view = UIView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: 0.01))
return view
}
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
return 0.01
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
return UIView()
}
func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
return 0.01
}
}
//
// YHEditViewModel.swift
// galaxy
//
// Created by EDY on 2024/6/19.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHEditViewModel: YHBaseViewModel {
var mainModel: YHMainUserInformationModel = YHMainUserInformationModel()
override init() {
super.init()
}
func getBaseDataSource() -> [YHUserInformationModel] {
let item1 = YHUserInformationModel(id: .id1, title: "真实姓名", isUserKeyBoard: true, prompts: "请输入您的真实姓名", message: mainModel.username)
let item2 = YHUserInformationModel(id: .id6, title: "所在地", isUserKeyBoard: false, prompts: "请选择您的所在地", message: mainModel.country, type: .country, value: mainModel.area)
var string = ""
let array = mainModel.area
for item in array {
if string.count != 0 {
string = string + "/" + item
} else {
string = string + item
}
}
let item3 = YHUserInformationModel(id: .id2, title: "所在地-省市", isUserKeyBoard: false, prompts: "请选择您的所在地", message: string, type: .address, value: mainModel.area)
let item4 = YHUserInformationModel(id: .id7, title: "星座", isUserKeyBoard: false, prompts: "请选择您的星座", message: mainModel.constellation, type: .constellation)
if mainModel.country.contains("中国") {
return [item1, item2, item3, item4]
}
return [item1, item2, item4]
}
func updateModel(_ item: YHUserInformationModel) {
guard let type = item.id else { return }
switch type {
case .id1:
mainModel.username = item.message ?? ""
case .id2:
mainModel.area = item.value ?? []
case .id6:
mainModel.country = item.message ?? ""
case .id7:
mainModel.constellation = item.message ?? ""
default:
break
}
}
}
......@@ -35,6 +35,8 @@ enum YHOtherPickerViewType: Int {
case degree
//学位地址
case degreeAddress
//星座
case constellation
}
......@@ -368,6 +370,56 @@ class YHConstantArrayData {
[ "id": "2", "title": "国外(颁发)" ],
]
static let arrDegreeConstellation = [
[
"id":"1",
"title" : "水瓶座",
],
[
"id" : "2",
"title" : "双鱼座",
],
[
"id" : "3",
"title" : "白羊座",
],
[
"id":"4",
"title" : "金牛座",
],
[
"id" : "5",
"title" : "双子座",
],
[
"id" : "6",
"title" : "巨蟹座",
],
[
"id": "7",
"title" : "狮子座",
],
[
"id" : "8",
"title" : "处女座",
],
[
"id" : "9",
"title" : "天秤座",
],
[
"id": "10",
"title" : "天蝎座",
],
[
"id" : "11",
"title" : "射手座",
],
[
"id" : "12",
"title" : "摩羯座",
],
]
//通过 id 获取 title
static func getShowNameBy(indexStr:String,type : YHOtherPickerViewType) -> String {
if indexStr.isEmpty {
......@@ -389,6 +441,8 @@ class YHConstantArrayData {
arrData = YHConstantArrayData.arrDegree
case .degreeAddress:
arrData = YHConstantArrayData.arrDegreeAddress
case .constellation:
arrData = YHConstantArrayData.arrDegreeConstellation
default:
arrData = [[:]]
}
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "mine_item_activity@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "mine_item_activity@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "mine_item_card@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "mine_item_card@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
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