|
@@ -42,8 +42,8 @@ class BFVoiceSettingView: UIView {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- // 操作回调
|
|
|
|
- public var voiceSettingCallBack: ((_ actionType: VoiceSettingActionType, _ selectVoice: PQVoiceModel?) -> Void)?
|
|
|
|
|
|
+ // 操作回调 isSame 是否点击的是同一个人,进行状态切换使用
|
|
|
|
+ public var voiceSettingCallBack: ((_ actionType: VoiceSettingActionType, _ selectVoice: PQVoiceModel?,_ isSame:Bool ) -> Void)?
|
|
|
|
|
|
// 当前选择的分类
|
|
// 当前选择的分类
|
|
var curretnCategory: BFVoiceCategoryModel?
|
|
var curretnCategory: BFVoiceCategoryModel?
|
|
@@ -211,7 +211,7 @@ class BFVoiceSettingView: UIView {
|
|
@objc func cancelAction() {
|
|
@objc func cancelAction() {
|
|
hidden()
|
|
hidden()
|
|
if voiceSettingCallBack != nil {
|
|
if voiceSettingCallBack != nil {
|
|
- voiceSettingCallBack!(.voiceSettingActionCancel, selectVoice)
|
|
|
|
|
|
+ voiceSettingCallBack!(.voiceSettingActionCancel, selectVoice,false)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -219,7 +219,7 @@ class BFVoiceSettingView: UIView {
|
|
@objc func okBtnAction() {
|
|
@objc func okBtnAction() {
|
|
hidden()
|
|
hidden()
|
|
if voiceSettingCallBack != nil {
|
|
if voiceSettingCallBack != nil {
|
|
- voiceSettingCallBack!(.VoiceSettingActionConfirm, selectVoice)
|
|
|
|
|
|
+ voiceSettingCallBack!(.VoiceSettingActionConfirm, selectVoice,false)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -239,7 +239,7 @@ class BFVoiceSettingView: UIView {
|
|
}
|
|
}
|
|
|
|
|
|
if voiceSettingCallBack != nil {
|
|
if voiceSettingCallBack != nil {
|
|
- voiceSettingCallBack!(.voiceSettingActionDelete, selectVoice)
|
|
|
|
|
|
+ voiceSettingCallBack!(.voiceSettingActionDelete, selectVoice,false)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -295,15 +295,20 @@ extension BFVoiceSettingView: UICollectionViewDelegate, UICollectionViewDataSour
|
|
|
|
|
|
voicesCollectView.reloadData()
|
|
voicesCollectView.reloadData()
|
|
} else {
|
|
} else {
|
|
|
|
+ //是否点击的是同一个人
|
|
|
|
+ let isSame = selectVoice == voices[curretnCategory?.cateName ?? ""]?[indexPath.item] ? true : false
|
|
|
|
+
|
|
selectVoice?.voiceStatue = .isNormal
|
|
selectVoice?.voiceStatue = .isNormal
|
|
selectVoice = voices[curretnCategory?.cateName ?? ""]?[indexPath.item]
|
|
selectVoice = voices[curretnCategory?.cateName ?? ""]?[indexPath.item]
|
|
selectVoice?.voiceStatue = .isSelected
|
|
selectVoice?.voiceStatue = .isSelected
|
|
deleteBtn.isSelected = true
|
|
deleteBtn.isSelected = true
|
|
voicesCollectView.reloadData()
|
|
voicesCollectView.reloadData()
|
|
-
|
|
|
|
|
|
+
|
|
if voiceSettingCallBack != nil {
|
|
if voiceSettingCallBack != nil {
|
|
- voiceSettingCallBack!(.VoiceSettingActionSelected, selectVoice)
|
|
|
|
|
|
+ voiceSettingCallBack!(.VoiceSettingActionSelected, selectVoice,isSame)
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|