Commit 163f57e5 authored by David黄金龙's avatar David黄金龙

母语的 提示

parent 2edd8250
......@@ -157,6 +157,7 @@ extension YHOtherLanguageSelecteView {
//对应的选项 view
let optionView = YHSingleOptionalItemsView()
optionView.arrCompare = dataModel
optionView.dataModel = item
mutilHoldView.addSubview(optionView)
optionView.snp.makeConstraints { make in
......@@ -204,6 +205,8 @@ extension YHOtherLanguageSelecteView {
let optionView = arrLanguageOptions[index]
optionView.needCheckFlag = needCheckFlag
optionView.arrCompare = dataModel
optionView.dataModel = item
if index == 0 {
......
......@@ -33,7 +33,6 @@ class YHOtherMultipleChoiceItemView: UIView {
}
}
private lazy var titleLabel: UILabel = {
let label = UILabel()
label.textColor = .mainTextColor
......
......@@ -85,6 +85,8 @@ class YHSingleOptionalItemsView: UIView {
}
}
var arrCompare : [LanguageDetailModel] = []
private var arrHoldView : [YHOtherSingleChoiceItemView] = []
......@@ -291,6 +293,34 @@ private extension YHSingleOptionalItemsView {
}
let clickIndex = gestureRecognizer.view?.tag
if clickIndex == 0 {
//判断母语
if !model.options.isEmpty {
let item = model.options[0]
if !item.select {
//判断其他 语言是不是选了 母语
var hasSelected : Bool = false
for (_,item) in arrCompare.enumerated() {
if item.id != model.id {
for (_,tt) in item.options.enumerated() {
if tt.id == 1 {
if tt.select {
hasSelected = true
}
}
}
}
}
if hasSelected {
YHHUD.flash(message: "只能选择一种语言为母语")
return
}
}
}
}
for (index,item) in model.options.enumerated() {
if clickIndex == index {
if !item.select {
......
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