From 529f3c6b775dc75869f978f7403ac50c5343b4e4 Mon Sep 17 00:00:00 2001 From: 杨锴 <841720330@qq.com> Date: 星期五, 08 十一月 2024 21:34:06 +0800 Subject: [PATCH] fix bug --- XQMuse/Root/Course/VC/CourseDetialOfflineVC.swift | 23 ++++++++++++++++++++--- 1 files changed, 20 insertions(+), 3 deletions(-) diff --git a/XQMuse/Root/Course/VC/CourseDetialOfflineVC.swift b/XQMuse/Root/Course/VC/CourseDetialOfflineVC.swift index d569c77..3952aec 100644 --- a/XQMuse/Root/Course/VC/CourseDetialOfflineVC.swift +++ b/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) -- Gitblit v1.7.1