From c709faae38f4ed7ecd192b06b4654799557e6dac Mon Sep 17 00:00:00 2001 From: zjx Date: Mon, 21 Jul 2025 16:11:20 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9A=90=E8=97=8F=E5=88=86=E8=BE=A8=E7=8E=87?= =?UTF-8?q?=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../View/VPDetailPlayerControlView.swift | 39 ++++++++++++------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/Veloria/Class/Player/View/VPDetailPlayerControlView.swift b/Veloria/Class/Player/View/VPDetailPlayerControlView.swift index 8358a4d..b138a76 100644 --- a/Veloria/Class/Player/View/VPDetailPlayerControlView.swift +++ b/Veloria/Class/Player/View/VPDetailPlayerControlView.swift @@ -123,12 +123,13 @@ class VPDetailPlayerControlView: VPVideoPlayerControlView { config.background.backgroundColor = .color949494(alpha: 0.4) let button = UIButton(configuration: config) + button.isHidden = true button.layer.cornerRadius = 15 button.layer.masksToBounds = true button.configurationUpdateHandler = { [weak self] button in guard let self = self else { return } let revolution = VPVideoRevolutionManager.manager.revolution - button.configuration?.attributedTitle = AttributedString.createAttributedString(string: revolution.toString ?? "", color: .colorFFFFFF(), font: .fontRegular(ofSize: 13)) + button.configuration?.attributedTitle = AttributedString.createAttributedString(string: revolution.toString, color: .colorFFFFFF(), font: .fontRegular(ofSize: 13)) } button.addTarget(self, action: #selector(handleRevolutionButton), for: .touchUpInside) return button @@ -278,18 +279,6 @@ extension VPDetailPlayerControlView { make.right.equalToSuperview().offset(-10) } - revolutionButton.snp.makeConstraints { make in - make.height.top.equalTo(epBgView) - make.left.equalTo(epBgView.snp.right).offset(10) - } - - rateButton.snp.makeConstraints { make in - make.right.equalToSuperview().offset(-15) - make.left.equalTo(revolutionButton.snp.right).offset(10) - make.height.top.equalTo(epBgView) - make.width.equalTo(50) - } - timeLabel.snp.makeConstraints { make in make.left.equalToSuperview().offset(15) make.bottom.equalTo(epBgView.snp.top).offset(-16) @@ -298,6 +287,30 @@ extension VPDetailPlayerControlView { lockView.snp.makeConstraints { make in make.edges.equalToSuperview() } + + if VPLoginManager.manager.userInfo?.user_level == .ad { + + rateButton.snp.makeConstraints { make in + make.right.equalToSuperview().offset(-15) + make.left.equalTo(epBgView.snp.right).offset(10) + make.height.top.equalTo(epBgView) + make.width.equalTo(50) + } + + } else { + revolutionButton.isHidden = false + revolutionButton.snp.makeConstraints { make in + make.height.top.equalTo(epBgView) + make.left.equalTo(epBgView.snp.right).offset(10) + } + + rateButton.snp.makeConstraints { make in + make.right.equalToSuperview().offset(-15) + make.left.equalTo(revolutionButton.snp.right).offset(10) + make.height.top.equalTo(epBgView) + make.width.equalTo(50) + } + } } }