| | |
| | | } |
| | | |
| | | 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 |
| | |
| | | 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() |
| | | } |
| | | } |
| | |
| | | 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) |
| | |
| | | |
| | | 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) |
| | | |