Ver código fonte

回调方法添加参数

jsonwang 3 anos atrás
pai
commit
43cd499053

+ 5 - 4
BFFramework/Classes/Stuckpoint/View/PQSpeedSettingView.swift

@@ -91,7 +91,7 @@ class PQSpeedSettingView: UIView {
     }
 
     // 点击回调 maxSpeed,minSpeed 同时为0 说明点击的是自定义速度
-    public var selectSpeedCallBack: ((_ maxSpeed: Float, _ minSpeed: Float,_ selectIndex:Int,_ isSettingPlayer:Bool) -> Void)?
+    public var selectSpeedCallBack: ((_ maxSpeed: Float, _ minSpeed: Float,_ selectIndex:Int,_ isSettingPlayer:Bool,_ isCancle:Bool) -> Void)?
 
     override init(frame: CGRect) {
         super.init(frame: frame)
@@ -106,7 +106,7 @@ class PQSpeedSettingView: UIView {
     ///   - index: index: 第几位 从0 开始
     ///   - isSettingPlayer: 是否重启播放器
     ///   - setEnable: 设置不可用状态
-    func setSelectItem(index:Int,isSettingPlayer:Bool = true,setDisable:Bool = false) {
+    func setSelectItem(index:Int,isSettingPlayer:Bool = true,setDisable:Bool = false,isCancle:Bool = false) {
        BFLog(message: "setSelectItem is \(index)")
         //设置不可用状态
         if(setDisable){
@@ -135,9 +135,9 @@ class PQSpeedSettingView: UIView {
         if selectSpeedCallBack != nil {
             BFLog(message: "选择的速度为 max: \(lastSelectModel?.maxSpeed ?? 0.0) min: \(lastSelectModel?.minSpeed ?? 0.0)")
             if(lastSelectModel?.title == "自定义" || lastSelectModel?.title == "自定义\n快慢速"){
-                selectSpeedCallBack!(-1,-1,index,false)
+                selectSpeedCallBack!(-1,-1,index,false,isCancle)
             }else{
-                selectSpeedCallBack!(lastSelectModel?.maxSpeed ?? 0.0, lastSelectModel?.minSpeed ?? 0.0,index,isSettingPlayer)
+                selectSpeedCallBack!(lastSelectModel?.maxSpeed ?? 0.0, lastSelectModel?.minSpeed ?? 0.0,index,isSettingPlayer,isCancle)
             }
  
         }
@@ -164,6 +164,7 @@ extension PQSpeedSettingView: UICollectionViewDelegate, UICollectionViewDataSour
             return
         }
         setSelectItem(index: indexPath.row)
+        //下面只是统计
         if(viewType == 2){
             if(lastSelectModel?.title == "自定义"){
                 PQEventTrackViewModel.baseReportUpload(businessType: .bt_buttonClick, objectType: .ot_shanyinApp_musicVideoPreview_selectRatio, pageSource: .sp_stuck_previewSyncedUp, extParams:nil, remindmsg: "")