Commit 0f5edca0 authored by Steven杜宇's avatar Steven杜宇

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

parents e5d2acd7 4d2a5084
......@@ -2483,7 +2483,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 2;
CURRENT_PROJECT_VERSION = 3;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = RXHYW88XR7;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
......@@ -2525,7 +2525,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 2;
CURRENT_PROJECT_VERSION = 3;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = RXHYW88XR7;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
......
......@@ -20,12 +20,6 @@ class YHOtherPickerView: UIView {
var arrData : [YHOtherPickerViewItemData] = []
private var selectType:YHFormPickerViewSubType?
// private var selectTitle:String? {
// didSet {
// let type:YHFormPickerViewSubType = getSubType(selectTitle)
// selectType = type
// }
// }
private var selectBlock:((YHOtherPickerViewItemData)->Void)? //回调
private var userSelectedItem : YHOtherPickerViewItemData? //用户选择的item
......@@ -62,15 +56,33 @@ class YHOtherPickerView: UIView {
view.addSubview(cancelBtn)
view.addSubview(confirmBtn)
titleLabel.snp.makeConstraints { make in
make.edges.equalToSuperview()
make.top.equalTo(kMargin)
make.height.equalTo(24)
make.centerX.equalToSuperview()
}
cancelBtn.snp.makeConstraints { make in
make.left.top.bottom.equalToSuperview()
make.width.equalTo(60)
make.left.equalTo(kMargin)
make.width.height.equalTo(44)
make.centerY.equalTo(titleLabel.snp.centerY)
}
cancelBtn.titleLabel?.textAlignment = .left
confirmBtn.snp.makeConstraints { make in
make.right.top.bottom.equalToSuperview()
make.width.equalTo(60)
make.right.equalToSuperview().offset(-kMargin)
make.width.height.equalTo(44)
make.centerY.equalTo(titleLabel.snp.centerY)
}
confirmBtn.titleLabel?.textAlignment = .right
let line = UIView()
line.backgroundColor = .separatorColor
view.addSubview(line)
line.snp.makeConstraints { make in
make.left.equalTo(21)
make.right.equalTo(-21)
make.height.equalTo(1)
make.bottom.equalToSuperview()
}
return view
}()
......@@ -79,7 +91,7 @@ class YHOtherPickerView: UIView {
let label = UILabel()
label.textColor = UIColor.mainTextColor
label.textAlignment = .center
label.font = UIFont.PFSC_R(ofSize: 16)
label.font = UIFont.PFSC_M(ofSize: 17)
label.text = "请选择"
return label
}()
......@@ -87,7 +99,7 @@ class YHOtherPickerView: UIView {
lazy var cancelBtn: UIButton = {
let btn = UIButton()
btn.setTitle("取消".local, for: .normal)
btn.titleLabel?.font = UIFont.PFSC_R(ofSize: 14)
btn.titleLabel?.font = UIFont.PFSC_M(ofSize: 14)
btn.setTitleColor(UIColor.mainTextColor, for: .normal)
btn.addTarget(self, action: #selector(didClickCancelButton), for: .touchUpInside)
return btn
......@@ -96,8 +108,8 @@ class YHOtherPickerView: UIView {
lazy var confirmBtn: UIButton = {
let btn = UIButton()
btn.setTitle("确定".local, for: .normal)
btn.titleLabel?.font = UIFont.PFSC_R(ofSize: 14)
btn.setTitleColor(UIColor(hex: 0x4487F9), for: .normal)
btn.titleLabel?.font = UIFont.PFSC_M(ofSize: 14)
btn.setTitleColor(UIColor.brandMainColor, for: .normal)
btn.addTarget(self, action: #selector(didClickConfirmButton), for: .touchUpInside)
return btn
}()
......@@ -119,16 +131,12 @@ class YHOtherPickerView: UIView {
}
func show() {
// showSelectType(&selectType)
UIApplication.shared.yhKeyWindow()?.addSubview(self)
}
static func show(type:YHOtherPickerViewType, selectType:YHFormPickerViewSubType? = nil, callBack: @escaping ((YHOtherPickerViewItemData)->Void)) {
let picker = YHOtherPickerView(type: type)
// picker.selectType = selectType
picker.selectBlock = callBack
picker.show()
}
......@@ -138,8 +146,8 @@ class YHOtherPickerView: UIView {
func createUI() {
self.addSubview(blackMaskView)
self.addSubview(whiteContentView)
addSubview(blackMaskView)
addSubview(whiteContentView)
whiteContentView.addSubview(topView)
whiteContentView.addSubview(pickerView)
......@@ -162,7 +170,8 @@ class YHOtherPickerView: UIView {
whiteContentView.snp.makeConstraints { make in
make.left.right.bottom.equalToSuperview()
make.top.equalToSuperview().offset(KScreenHeight*2/3.0)
// make.top.equalToSuperview().offset(KScreenHeight*2/3.0)
make.height.equalTo(412)
}
topView.snp.makeConstraints { make in
......@@ -187,31 +196,6 @@ class YHOtherPickerView: UIView {
dismiss()
}
func showSelectType(_ selectType: inout YHFormPickerViewSubType?) {
// 处理从外部传入的选中第几行的参数
// 是否找到选中行数据
// var selectIndex:Int = -1
// if let selectType = selectType, let arr = dataDict[type], !arr.isEmpty {
// for (index, item) in arr.enumerated() {
// if selectType.index == item.type.index {
// selectIndex = index
// break
// }
// }
// }
//
// if selectIndex != -1 { // 找到了选择行
// pickerView.selectRow(selectIndex, inComponent: 0, animated: true)
// } else { // 未找到选中行数据则滚动至第一行
// if dataDict[type]?.isEmpty == true { return }
// if let arr = dataDict[type], !arr.isEmpty {
// let item = arr[0]
// selectType = item.type
// pickerView.selectRow(0, inComponent: 0, animated: true)
// }
// }
}
func getTitle(type: YHOtherPickerViewType)-> String {
switch type {
case .language:
......@@ -249,14 +233,6 @@ extension YHOtherPickerView: UIPickerViewDelegate, UIPickerViewDataSource {
return arrData.count
}
// func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? {
// if 0 <= row && row < arrData.count {
// let item :YHOtherPickerViewItemData = arrData[row]
// return item.title
// }
// return ""
// }
func pickerView(_ pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) {
if 0 <= row && row < arrData.count {
let item :YHOtherPickerViewItemData = arrData[row]
......
......@@ -43,6 +43,7 @@ class YHPreviewMainViewController: YHBaseViewController {
var myHeadView : UIView = {
let view = UIView(frame: CGRect(x: kMargin, y: 0, width: KScreenWidth - kMargin * 2, height: 131))
view.backgroundColor = .white
return view
}()
......
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