杨锴
2024-11-08 529f3c6b775dc75869f978f7403ac50c5343b4e4
XQMuse/Root/Course/VC/CourseDetialOfflineVC.swift
@@ -53,6 +53,7 @@
    }
    override func setUI() {
        view_video.isHidden = true
        scrollView.delegate = self
        collect_bitem = UIBarButtonItem(image: UIImage(named: "btn_collect"), style: .plain, target: self, action: #selector(collectionAction))
        collect_bitem.tintColor = .white
@@ -72,7 +73,7 @@
        customerBtn.addTarget(self, action: #selector(showCustomerAction), for: .touchUpInside)
        view.addSubview(customerBtn)
        customerBtn.snp.makeConstraints { make in
            make.right.equalToSuperview()
            make.right.equalToSuperview().offset(20)
            make.centerY.equalToSuperview()
        }
    }
@@ -110,12 +111,23 @@
                weakSelf.img_cusomter.sd_setImage(with: URL(string: m.wxQrCode))
                if m.detailUrl.jq_isVideo{
                    weakSelf.videoView = VideoView(url: m.detailUrl.jq_urlEncoded(),autoPlay: false, placeHoderImageUrl: m.coverUrl.jq_urlEncoded(), delegate: self!)
                    weakSelf.videoView = VideoView(url: m.detailUrl.jq_urlEncoded(),autoPlay: false,needFirstImage: true, delegate: self!)
//                    weakSelf.videoView!.player.play()
                    weakSelf.view_video.isHidden = false
                    weakSelf.view_video.addSubview(weakSelf.videoView!)
                    weakSelf.videoView!.snp.makeConstraints { make in
                        make.edges.equalToSuperview()
                    }
                }else{
                    weakSelf.scrollView.contentInset = UIEdgeInsets(top: JQ_NavBarHeight, left: 0, bottom: 0, right: 0)
                    weakSelf.navigationController?.navigationBar.standardAppearance.backgroundColor = .white
                    weakSelf.navigationController?.navigationBar.titleTextAttributes = [.foregroundColor:Def_NavFontColor,.font:Def_NavFont]
                    weakSelf.barStyle = .darkContent
                    weakSelf.setNeedsStatusBarAppearanceUpdate()
                    weakSelf.collect_bitem.tintColor = .black
                    weakSelf.share_bitem.tintColor = .black
                    weakSelf.scrollView.contentInsetAdjustmentBehavior = .always
                    (weakSelf.navigationItem.leftBarButtonItem?.customView as? UIButton)?.setImage(UIImage(named: "btn_back")?.withTintColor(.black), for: .normal)
                }
            }
        }).disposed(by: disposeBag)
@@ -160,9 +172,14 @@
    func scrollViewDidScroll(_ scrollView: UIScrollView) {
        let v = min(scrollView.contentOffset.y / JQ_NavBarHeight, 1)
        var v = min(scrollView.contentOffset.y / JQ_NavBarHeight, 1)
        if view_video.isHidden{v = 1.0;return}
        navigationController?.navigationBar.standardAppearance.backgroundColor = .white.withAlphaComponent(v)
        print("--->\(v)")
        if v > 0{
            (navigationItem.leftBarButtonItem?.customView as? UIButton)?.setImage(UIImage(named: "btn_back")?.withTintColor(.black.withAlphaComponent(v)), for: .normal)