membershipExceptions = (
"/Localized: Channel/DeepChords/DeepChords.storyboard",
Channel/DeepChords/Channel/Config/CCConfig.swift,
+ Channel/DeepChords/Channel/UI/BleScanHeaderView.swift,
+ Channel/DeepChords/Channel/UI/CustomButton.swift,
Channel/DeepChords/DeepChords.plist,
Channel/DeepChords/DeepChords.xcassets,
Channel/PLAYBOY/Channel/Config/CCBleManager.swift,
Channel/PLAYBOY/Channel/Config/CCConfig.swift,
Channel/PLAYBOY/Channel/Config/CCDevice.swift,
Channel/PLAYBOY/Channel/Config/CCPage.swift,
+ Channel/PLAYBOY/Channel/UI/BleScanHeaderView.swift,
+ Channel/PLAYBOY/Channel/UI/CustomButton.swift,
Channel/PLAYBOY/Channel/UI/PbLoginVC.swift,
Channel/PLAYBOY/Channel/UI/PbModeVC.swift,
Channel/PLAYBOY/Channel/UI/PbTabBC.swift,
isa = PBXFileSystemSynchronizedBuildFileExceptionSet;
membershipExceptions = (
Channel/DeepChords/DeepChords.plist,
+ Channel/PaXa/Config/BleScanHeaderView.swift,
Channel/PaXa/Config/CCConfig.swift,
+ Channel/PaXa/Config/CustomButton.swift,
Channel/PaXa/PaXa.plist,
Channel/PaXa/PaXa.storyboard,
Channel/PaXa/PaXa.xcassets,
Channel/PLAYBOY/Channel/Config/CCConfig.swift,
Channel/PLAYBOY/Channel/Config/CCDevice.swift,
Channel/PLAYBOY/Channel/Config/CCPage.swift,
+ Channel/PLAYBOY/Channel/UI/BleScanHeaderView.swift,
+ Channel/PLAYBOY/Channel/UI/CustomButton.swift,
Channel/PLAYBOY/Channel/UI/PbLoginVC.swift,
Channel/PLAYBOY/Channel/UI/PbModeVC.swift,
Channel/PLAYBOY/Channel/UI/PbTabBC.swift,
Channel/DeepChords/Channel/Config/CCConfig.swift,
Channel/DeepChords/Channel/Config/CCDevice.swift,
Channel/DeepChords/Channel/Config/CCPage.swift,
+ Channel/DeepChords/Channel/UI/BleScanHeaderView.swift,
+ Channel/DeepChords/Channel/UI/CustomButton.swift,
Channel/DeepChords/Channel/UI/JoyAiFunctionVC.swift,
Channel/DeepChords/Channel/UI/JoyAiFunctionView.swift,
Channel/DeepChords/Channel/UI/JoyCallingRecordVC.swift,
Channel/DeepChords/Sdk/JoyRecord.swift,
Channel/DeepChords/Sdk/JoySdkManager.swift,
Channel/DeepChords/Sdk/JoyTcty.swift,
+ Channel/PaXa/Config/BleScanHeaderView.swift,
Channel/PaXa/Config/CCConfig.swift,
+ Channel/PaXa/Config/CustomButton.swift,
Channel/PaXa/PaXa.plist,
Channel/PaXa/PaXa.storyboard,
Channel/PaXa/PaXa.xcassets,
CODE_SIGN_ENTITLEMENTS = ShenYin/Channel/PLAYBOY/PLAYBOY.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
- CURRENT_PROJECT_VERSION = 202603311815;
+ CURRENT_PROJECT_VERSION = 202604081115;
DEVELOPMENT_TEAM = JKLJ58J33Q;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
LIBRARY_SEARCH_PATHS = "$(inherited)";
- MARKETING_VERSION = 0.0.2;
+ MARKETING_VERSION = 0.02;
PRODUCT_BUNDLE_IDENTIFIER = com.ios.playboy;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
CODE_SIGN_ENTITLEMENTS = ShenYin/Channel/PLAYBOY/PLAYBOY.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
- CURRENT_PROJECT_VERSION = 202603311815;
+ CURRENT_PROJECT_VERSION = 202604081115;
DEVELOPMENT_TEAM = JKLJ58J33Q;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
LIBRARY_SEARCH_PATHS = "$(inherited)";
- MARKETING_VERSION = 0.0.2;
+ MARKETING_VERSION = 0.02;
PRODUCT_BUNDLE_IDENTIFIER = com.ios.playboy;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
static let serviceLogo = "logo_2"
static let userInfoList:[UserInfoCellType] = [.avatar,.nickName,.gender,.birthday,.height,.weight,.hobbies,.uid,.area]
static let preferredStatusBarStyle: UIStatusBarStyle = .darkContent
+
+ static let currentDeviceSize = CGSize(width: 168, height: 138)
}
extension YLColor: ColorRGBProviderProtocol {
public var rgbValue: Int {
--- /dev/null
+//
+// BleScanHeaderView.swift
+// ShenYin
+//
+// Created by liangshi on 2026/4/8.
+//
+
+import DGActivityIndicatorView
+
+class BleScanHeaderView: BaseView {
+ let rippleView = DGActivityIndicatorView(type: .triplePulse,tintColor: UIColor.color(.theme),size: 250)!
+ var radarImageView = UIImageView()
+ override func setupViews() {
+
+ addSubviews([rippleView,radarImageView])
+ rippleView.startAnimating()
+
+ radarImageView.do { v in
+ v.image = UIImage(named: "device_logo")
+ }
+ radarImageView.snp.makeConstraints { make in
+ make.width.equalTo(58)
+ make.height.equalTo(46)
+ make.center.equalToSuperview()
+ }
+ rippleView.snp.makeConstraints { make in
+ make.size.equalTo(250)
+ make.center.equalToSuperview()
+ }
+
+ }
+
+}
+
+
--- /dev/null
+//
+// CustomButton.swift
+// ShenYin
+//
+// Created by liangshi on 2026/4/7.
+//
+
+import UIKit
+
+enum CustomButtonStyle:Int{
+ case theme1
+ case theme2
+ case theme3
+ case theme4
+ case custom
+ case sport
+}
+
+class CustomButton: UIButton {
+ func set(title:String,font:UIFont = .bold(14),style:CustomButtonStyle = .theme1, target: Any?, action: Selector) {
+ setTitle(title, for: .normal)
+ addTarget(target, action: action, for: .touchUpInside)
+ layer.cornerRadius = 12
+ layer.masksToBounds = true
+ titleLabel?.font = font
+
+ if style == .theme1 {
+ setTitleColor(.white, for: .normal)
+ backgroundColor = .color(.theme)
+ }
+ else if style == .theme4 {
+ setTitleColor(.hexString("#FF4E4E"), for: .normal)
+ backgroundColor = UIColor.hexString("#FF4E4E")
+ setTitleColor(.white, for: .normal)
+ titleLabel?.font = .bold(14)
+ }
+ else if style == .theme3 {
+ layer.cornerRadius = 12
+ setTitleColor(.color(.level1), for: .normal)
+ backgroundColor = .color(.cellBg)
+ titleLabel?.font = .regular(14)
+ }
+ else if style == .sport {
+ setTitleColor(.white, for: .normal)
+ backgroundColor = .color(.sport)
+ }
+ else{
+ setTitleColor(.color(.theme), for: .normal)
+ backgroundColor = .clear
+ layer.borderWidth = 1.4
+ layer.borderColor = UIColor.color(.theme).cgColor
+ }
+
+ }
+
+}
static let serviceLogo = "logo_4"
static let userInfoList:[UserInfoCellType] = [.avatar,.nickName,.gender,.uid,.area]
static let preferredStatusBarStyle: UIStatusBarStyle = .lightContent
+ static let currentDeviceSize = CGSize(width: 168, height: 138)
}
extension YLColor: ColorRGBProviderProtocol {
--- /dev/null
+
+class BleScanHeaderView: BaseView {
+ var radarImageView = UIImageView()
+ override func setupViews() {
+
+ addSubviews([radarImageView])
+
+ radarImageView.do { v in
+ v.image = UIImage(named: "radar_icon")
+ //
+ let animation = CABasicAnimation.init(keyPath: "transform.rotation.z")
+ animation.beginTime = 0.0
+ animation.fromValue = 0.0
+ animation.toValue = 2*Double.pi
+ animation.duration = 2
+ animation.repeatCount = MAXFLOAT
+ v.layer.add(animation, forKey: "radar.transform.rotation.x")
+ }
+ radarImageView.snp.makeConstraints { make in
+ make.size.equalTo(200)
+ make.center.equalToSuperview()
+ }
+ }
+
+}
--- /dev/null
+//
+// CustomButton.swift
+// ShenYin
+//
+// Created by liangshi on 2026/4/7.
+//
+
+import UIKit
+
+enum CustomButtonStyle:Int{
+ case theme1
+ case theme2
+ case theme3
+ case theme4
+ case custom
+ case sport
+}
+
+class CustomButton: UIButton {
+ func set(title:String,font:UIFont = .bold(14),style:CustomButtonStyle = .theme1, target: Any?, action: Selector) {
+ setTitle(title, for: .normal)
+ addTarget(target, action: action, for: .touchUpInside)
+ layer.cornerRadius = 23
+ layer.masksToBounds = true
+ titleLabel?.font = font
+
+ if style == .theme1 {
+ setTitleColor(.rgb(0x121212), for: .normal)
+ backgroundColor = .white
+ }
+ else if style == .theme4 {
+ setTitleColor(.hexString("#FF4E4E"), for: .normal)
+ backgroundColor = UIColor.hexString("#FF4E4E")
+ setTitleColor(.white, for: .normal)
+ titleLabel?.font = .bold(14)
+ }
+ else if style == .theme3 {
+ layer.cornerRadius = 12
+ setTitleColor(.color(.level1), for: .normal)
+ backgroundColor = .color(.cellBg)
+ titleLabel?.font = .regular(14)
+ }
+ else if style == .sport {
+ setTitleColor(.white, for: .normal)
+ backgroundColor = .color(.sport)
+ }
+ else{
+ setTitleColor(.white, for: .normal)
+ backgroundColor = .clear
+ layer.borderWidth = 1.4
+ layer.borderColor = UIColor.color(.level1).cgColor
+ }
+ }
+}
--- /dev/null
+//
+// Untitled.swift
+// ShenYin
+//
+// Created by liangshi on 2026/4/8.
+//
+import DGActivityIndicatorView
+class BleScanHeaderView: BaseView {
+ let rippleView = DGActivityIndicatorView(type: .triplePulse,tintColor: UIColor.color(.theme),size: 250)!
+ var radarImageView = UIImageView()
+ override func setupViews() {
+
+ addSubviews([rippleView,radarImageView])
+ rippleView.startAnimating()
+
+ radarImageView.do { v in
+ v.image = UIImage(named: "device_logo")
+ }
+ radarImageView.snp.makeConstraints { make in
+ make.width.equalTo(74)
+ make.height.equalTo(16)
+ make.center.equalToSuperview()
+ }
+ rippleView.snp.makeConstraints { make in
+ make.size.equalTo(250)
+ make.center.equalToSuperview()
+ }
+ }
+
+}
static let serviceLogo = "logo_2"
static let userInfoList:[UserInfoCellType] = [.avatar,.nickName,.gender,.birthday,.height,.weight,.hobbies,.uid,.area]
static let preferredStatusBarStyle: UIStatusBarStyle = .darkContent
+
+ static let currentDeviceSize = CGSize(width: 168, height: 138)
}
+
+
+
extension YLColor: ColorRGBProviderProtocol {
public var rgbValue: Int {
switch self {
--- /dev/null
+//
+// CustomButton.swift
+// ShenYin
+//
+// Created by liangshi on 2026/4/7.
+//
+
+import UIKit
+
+enum CustomButtonStyle:Int{
+ case theme1
+ case theme2
+ case theme3
+ case theme4
+ case custom
+ case sport
+}
+
+class CustomButton: UIButton {
+ func set(title:String,font:UIFont = .bold(14),style:CustomButtonStyle = .theme1, target: Any?, action: Selector) {
+ setTitle(title, for: .normal)
+ addTarget(target, action: action, for: .touchUpInside)
+ layer.cornerRadius = 12
+ layer.masksToBounds = true
+ titleLabel?.font = font
+
+ if style == .theme1 {
+ setTitleColor(.white, for: .normal)
+ backgroundColor = .color(.theme)
+ }
+ else if style == .theme4 {
+ setTitleColor(.hexString("#FF4E4E"), for: .normal)
+ backgroundColor = UIColor.hexString("#FF4E4E")
+ setTitleColor(.white, for: .normal)
+ titleLabel?.font = .bold(14)
+ }
+ else if style == .theme3 {
+ layer.cornerRadius = 12
+ setTitleColor(.color(.level1), for: .normal)
+ backgroundColor = .color(.cellBg)
+ titleLabel?.font = .regular(14)
+ }
+ else if style == .sport {
+ setTitleColor(.white, for: .normal)
+ backgroundColor = .color(.sport)
+ }
+ else{
+ setTitleColor(.color(.theme), for: .normal)
+ backgroundColor = .clear
+ layer.borderWidth = 1.4
+ layer.borderColor = UIColor.color(.theme).cgColor
+ }
+ }
+
+}
<string>audio</string>
</array>
<key>UIDesignRequiresCompatibility</key>
- <true/>
+ <false/>
</dict>
</plist>
{
"images" : [
{
- "filename" : "server_qr.png",
+ "filename" : "Frame 2543.png",
"idiom" : "universal",
"scale" : "1x"
},
"scale" : "1x"
},
{
- "filename" : "中英互译@2x.png",
+ "filename" : "Slice 340@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
- "filename" : "中英互译@3x.png",
+ "filename" : "Slice 340@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
"scale" : "1x"
},
{
- "filename" : "对话翻译@2x.png",
+ "filename" : "Slice 343@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
- "filename" : "对话翻译@3x.png",
+ "filename" : "Slice 343@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
"scale" : "1x"
},
{
- "filename" : "同传听译@2x.png",
+ "filename" : "Slice 347@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
- "filename" : "同传听译@3x.png",
+ "filename" : "Slice 347@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
"scale" : "1x"
},
{
- "filename" : "Frame@2x(9).png",
+ "filename" : "Slice 374@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
- "filename" : "Frame@3x(8).png",
+ "filename" : "Slice 374@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
"scale" : "1x"
},
{
- "filename" : "Frame@2x(2).png",
+ "filename" : "Slice 373@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
- "filename" : "Frame@3x(3).png",
+ "filename" : "Slice 373@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
"scale" : "1x"
},
{
- "filename" : "Frame@2x(6).png",
+ "filename" : "Slice 369@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
- "filename" : "Frame@3x(7).png",
+ "filename" : "Slice 369@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
"scale" : "1x"
},
{
- "filename" : "Frame@2x.png",
+ "filename" : "Slice 371@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
- "filename" : "Frame@3x.png",
+ "filename" : "Slice 371@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
"scale" : "1x"
},
{
- "filename" : "设置_1@2x.png",
+ "filename" : "Slice 372@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
- "filename" : "设置_1@3x.png",
+ "filename" : "Slice 372@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
"scale" : "1x"
},
{
- "filename" : "Frame@2x(4).png",
+ "filename" : "Slice 370@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
- "filename" : "Frame@3x(5).png",
+ "filename" : "Slice 370@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
"scale" : "1x"
},
{
- "filename" : "天气_多云_1@2x.png",
+ "filename" : "Slice 368@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
- "filename" : "天气_多云_1@3x.png",
+ "filename" : "Slice 368@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
"scale" : "1x"
},
{
- "filename" : "Frame 2250-1 1.png",
+ "filename" : "Slice 305@2x 1.png",
"idiom" : "universal",
"scale" : "2x"
},
{
- "filename" : "Frame 2250-1.png",
+ "filename" : "Slice 305@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
"scale" : "1x"
},
{
- "filename" : "Frame 2251.png",
+ "filename" : "Slice 304@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
- "filename" : "Frame 2250.png",
+ "filename" : "Slice 304@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
"scale" : "1x"
},
{
- "filename" : "Frame 2249-1.png",
+ "filename" : "Slice 307@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
- "filename" : "Frame 2249-1 1.png",
+ "filename" : "Slice 307@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
"scale" : "1x"
},
{
- "filename" : "Frame 2250.png",
+ "filename" : "Slice 306@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
- "filename" : "Frame 2249.png",
+ "filename" : "Slice 306@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
"scale" : "1x"
},
{
- "filename" : "Frame 2251-1 1.png",
+ "filename" : "Slice 309@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
- "filename" : "Frame 2251-1.png",
+ "filename" : "Slice 309@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
"scale" : "1x"
},
{
- "filename" : "Frame 2251.png",
+ "filename" : "Slice 308@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
- "filename" : "Frame 2252.png",
+ "filename" : "Slice 308@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
"scale" : "1x"
},
{
- "filename" : "Frame 2252-1 1.png",
+ "filename" : "Slice 311@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
- "filename" : "Frame 2252-1.png",
+ "filename" : "Slice 311@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
"scale" : "1x"
},
{
- "filename" : "Frame 2253.png",
+ "filename" : "Slice 310@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
- "filename" : "Frame 2252.png",
+ "filename" : "Slice 310@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
"scale" : "1x"
},
{
- "filename" : "Frame 2253.png",
+ "filename" : "Slice 313@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
- "filename" : "Frame 2253 (1).png",
+ "filename" : "Slice 313@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
"scale" : "1x"
},
{
- "filename" : "Frame 2254.png",
+ "filename" : "Slice 312@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
- "filename" : "Frame 2253.png",
+ "filename" : "Slice 312@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
//
//#import "SVProgressHUD+YLAdd.h"
-#import "YLTimerButton.h"
+//#import "YLTimerButton.h"
#import "PcmSound.h"
#import <zlib.h>
#import "JLBleAssistManager.h"
+++ /dev/null
-//
-// YLTimerButton.h
-// YLProject
-//
-// Created by Mac01 on 2018/3/24.
-// Copyright © 2018年 Mac01. All rights reserved.
-//
-
-#import <UIKit/UIKit.h>
-@interface YLTimerButton : UIButton
-@property(nonatomic, strong) UILabel *label;
-@property(nonatomic, assign) NSInteger maxCount;
-
-- (void)start;
-@end
+++ /dev/null
-//
-// YLTimerButton.m
-// YLProject
-//
-// Created by Mac01 on 2018/3/24.
-// Copyright © 2018年 Mac01. All rights reserved.
-//
-
-#import "YLTimerButton.h"
-
-
-@interface YLTimerButton ()
-
-@property(nonatomic, assign) NSInteger second;
-@property(nonatomic, strong) NSTimer *timer;
-@property(nonatomic, strong) NSDate *lastTime;
-@end
-
-@implementation YLTimerButton
-
-- (instancetype)initWithFrame:(CGRect)frame{
- if (self = [super initWithFrame:frame]) {
- self.maxCount = 60;
-
- [self setTitle:@"" forState:UIControlStateNormal];
- self.titleLabel.font = [UIFont systemFontOfSize:14];
-
- self.layer.cornerRadius = 5;
- self.layer.masksToBounds = YES;
-
- self.label = [[UILabel alloc]initWithFrame:self.bounds];
- self.label.text = @"点击获取";
- self.label.font = [UIFont systemFontOfSize:14];
- self.label.textColor = [UIColor blueColor];
- self.label.textAlignment = NSTextAlignmentCenter;
- self.label.backgroundColor = [UIColor clearColor];
- [self addSubview:self.label];
-
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(enterBackground) name:UIApplicationDidEnterBackgroundNotification object:nil];
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(becomeActive) name:UIApplicationDidBecomeActiveNotification object:nil];
- }
- return self;
-}
-
--(void)layoutSubviews{
- [super layoutSubviews];
- self.label.frame = self.bounds;
-// self.backgroundColor = [UIColor redColor];
-}
-
-- (void)start {
- self.enabled = NO;
- self.second = self.maxCount;
- self.label.textColor = [UIColor colorWithRed:67/255.0f green:155/255.0f blue:255/255.0f alpha:1.0f];
- self.label.text = [NSString stringWithFormat:@"%ldS",self.second];
- self.timer = [NSTimer scheduledTimerWithTimeInterval:1
- target:self
- selector:@selector(count)
- userInfo:nil
- repeats:YES];
-}
-
-- (void)stop {
- self.enabled = YES;
- self.label.text = @"发送验证码";
- self.label.textColor = [UIColor colorWithRed:67/255.0f green:155/255.0f blue:255/255.0f alpha:1.0f];
- if ([self.timer isValid]) {
- [self.timer invalidate];
- }
-}
-
-- (void)count {
- self.second--;
- if (self.second < 0) {
- self.second = 0;
- }
-
- self.label.text = [NSString stringWithFormat:@"%ldS", (long)self.second];
- if (self.second == 0) {
- [self stop];
- }
-}
-
-
-#pragma mark - notification
-- (void)enterBackground{
- if ([self.timer isValid]) {
- [self.timer invalidate];
- self.lastTime = [NSDate date];
- }
- else{
- self.lastTime = nil;
- }
-}
-
-- (void)becomeActive{
- if (self.lastTime == nil) {
- return;
- }
- NSInteger count = [self.lastTime timeIntervalSinceNow];
- self.second -= ABS(count);
- if (self.second > 0) {
- self.timer = [NSTimer scheduledTimerWithTimeInterval:1
- target:self
- selector:@selector(count)
- userInfo:nil
- repeats:YES];
- }
- else{
- [self count];
- }
-}
-@end
-
--- /dev/null
+//
+// YL.swift
+// ShenYin
+//
+// Created by liangshi on 2026/4/8.
+//
+
+import UIKit
+
+class YLTimerButton: UIButton {
+ // 公开属性
+ private let label = UILabel()
+ var maxCount: Int = 60
+ var color:UIColor = .blue{
+ didSet{
+ label.textColor = color
+ }
+ }
+
+ // 私有属性
+ private var second: Int = 0
+ private var timer: Timer?
+ private var lastTime: Date?
+
+ override init(frame: CGRect) {
+ super.init(frame: frame)
+ setupUI()
+ addNotifications()
+ }
+
+ required init?(coder: NSCoder) {
+ super.init(coder: coder)
+ setupUI()
+ addNotifications()
+ }
+
+ // 初始化UI
+ private func setupUI() {
+ // 按钮基础配置
+ setTitle("", for:.normal)
+ titleLabel?.font = UIFont.systemFont(ofSize: 14)
+ layer.cornerRadius = 5
+ layer.masksToBounds = true
+
+ // 配置label
+ label.frame = bounds
+ label.text = "点击获取".l10n
+ label.font = UIFont.systemFont(ofSize: 14)
+ label.textColor = color
+ label.textAlignment = .center
+ label.backgroundColor = .clear
+ addSubview(label)
+ }
+
+ // 添加通知监听
+ private func addNotifications() {
+ NotificationCenter.default.addObserver(
+ self,
+ selector: #selector(enterBackground),
+ name: UIApplication.didEnterBackgroundNotification,
+ object: nil
+ )
+ NotificationCenter.default.addObserver(
+ self,
+ selector: #selector(becomeActive),
+ name: UIApplication.didBecomeActiveNotification,
+ object: nil
+ )
+ }
+
+ // 布局子视图
+ override func layoutSubviews() {
+ super.layoutSubviews()
+ label.frame = bounds
+ }
+
+ // 开始倒计时
+ func start() {
+ isEnabled = false
+ second = maxCount
+ label.textColor = .lightGray
+ label.text = "\(second)S"
+
+ // 启动定时器
+ timer?.invalidate()
+ timer = Timer.scheduledTimer(
+ timeInterval: 1,
+ target: self,
+ selector: #selector(count),
+ userInfo: nil,
+ repeats: true
+ )
+ }
+
+ // 停止倒计时
+ func stop() {
+ isEnabled = true
+ label.text = "发送验证码".l10n
+ label.textColor = color
+ timer?.invalidate()
+ timer = nil
+ }
+
+ // 倒计时逻辑
+ @objc private func count() {
+ second -= 1
+ if second < 0 {
+ second = 0
+ }
+ label.text = "\(second)S"
+
+ if second == 0 {
+ stop()
+ }
+ }
+
+ // 应用进入后台
+ @objc private func enterBackground() {
+ if timer?.isValid == true {
+ timer?.invalidate()
+ lastTime = Date()
+ } else {
+ lastTime = nil
+ }
+ }
+
+ // 应用回到前台
+ @objc private func becomeActive() {
+ guard let lastTime = lastTime else { return }
+
+ let interval = Int(lastTime.timeIntervalSinceNow)
+ second -= abs(interval)
+
+ if second > 0 {
+ timer = Timer.scheduledTimer(
+ timeInterval: 1,
+ target: self,
+ selector: #selector(count),
+ userInfo: nil,
+ repeats: true
+ )
+ } else {
+ count()
+ }
+ }
+
+ // 释放资源
+ deinit {
+ NotificationCenter.default.removeObserver(self)
+ timer?.invalidate()
+ }
+}
}
override func setupLayout() {
- if CCConfig.appType == .deepchords {
- imageView.snp.makeConstraints { make in
- make.width.equalTo(168)
- make.height.equalTo(138)
- make.centerX.equalToSuperview()
- make.top.equalToSuperview().inset(20)
- make.bottom.equalToSuperview().inset(20)
- }
- }
- else{
- imageView.snp.makeConstraints { make in
- make.width.equalTo(220)
- make.height.equalTo(120)
- make.centerX.equalToSuperview()
- make.top.equalToSuperview().inset(20)
- make.bottom.equalToSuperview().inset(20)
- }
+ imageView.snp.makeConstraints { make in
+ make.size.equalTo(CCConfig.currentDeviceSize)
+ make.centerX.equalToSuperview()
+ make.top.equalToSuperview().inset(20)
+ make.bottom.equalToSuperview().inset(20)
}
connetedView.snp.makeConstraints { make in
make.edges.equalToSuperview()
//
import UIKit
-import DGActivityIndicatorView
+
enum BleScanState{
case scan
case has
}
-class BleScanHeaderView: BaseView {
- let rippleView = DGActivityIndicatorView(type: .triplePulse,tintColor: UIColor.color(.theme),size: 250)!
- var radarImageView = UIImageView()
- override func setupViews() {
-
- if CCConfig.appType == .playboy {
- addSubviews([radarImageView])
-
- radarImageView.do { v in
- v.image = UIImage(named: "radar_icon")
- //
- let animation = CABasicAnimation.init(keyPath: "transform.rotation.z")
- animation.beginTime = 0.0
- animation.fromValue = 0.0
- animation.toValue = 2*Double.pi
- animation.duration = 2
- animation.repeatCount = MAXFLOAT
- v.layer.add(animation, forKey: "radar.transform.rotation.x")
- }
- radarImageView.snp.makeConstraints { make in
- make.size.equalTo(200)
- make.center.equalToSuperview()
- }
- }
- else if CCConfig.appType == .deepchords{
- addSubviews([rippleView,radarImageView])
- rippleView.startAnimating()
-
- radarImageView.do { v in
- v.image = UIImage(named: "device_logo")
- }
- radarImageView.snp.makeConstraints { make in
- make.width.equalTo(58)
- make.height.equalTo(46)
- make.center.equalToSuperview()
- }
- rippleView.snp.makeConstraints { make in
- make.size.equalTo(250)
- make.center.equalToSuperview()
- }
- }
- else if CCConfig.appType == .paxa{
- addSubviews([rippleView,radarImageView])
- rippleView.startAnimating()
-
- radarImageView.do { v in
- v.image = UIImage(named: "device_logo")
- }
- radarImageView.snp.makeConstraints { make in
- make.width.equalTo(74)
- make.height.equalTo(16)
- make.center.equalToSuperview()
- }
- rippleView.snp.makeConstraints { make in
- make.size.equalTo(250)
- make.center.equalToSuperview()
- }
- }
- }
-}
class ScanStateCell: BaseTableViewCell {
let titleLabel = UILabel()
}
override func setupLayout(){
- logoImg.snp.makeConstraints { make in
- if CCConfig.appType == .playboy{
+ if CCConfig.appType == .playboy{
+ logoImg.snp.makeConstraints { make in
make.width.equalTo(62)
make.height.equalTo(80)
make.top.equalTo(kNavBtm)
make.centerX.equalToSuperview()
}
- else{
-
+ bgView.snp.makeConstraints { make in
+ make.left.right.equalToSuperview()
+ make.top.equalToSuperview().inset(180)
+ make.bottom.equalToSuperview()
+ }
+ }
+ else{
+ logoImg.snp.makeConstraints { make in
make.left.equalToSuperview().inset(28)
make.top.equalTo(kNavBtm + 20)
make.centerX.equalToSuperview()
}
+ bgView.snp.makeConstraints { make in
+ make.left.right.equalToSuperview()
+ make.top.equalToSuperview().inset(214)
+ make.bottom.equalToSuperview()
+ }
}
- bgView.snp.makeConstraints { make in
- make.left.right.equalToSuperview()
- make.top.equalToSuperview().inset(CCConfig.appType == .playboy ? 180:214)
- make.bottom.equalToSuperview()
- }
+
titleLabel.snp.makeConstraints { make in
make.top.equalToSuperview().offset(34)
}
override func setupLayout(){
- logoImg.snp.makeConstraints { make in
- if CCConfig.appType == .playboy{
+ if CCConfig.appType == .playboy{
+ logoImg.snp.makeConstraints { make in
make.width.equalTo(62)
make.height.equalTo(80)
- make.top.equalTo(kNavBtm )
+ make.top.equalTo(kNavBtm)
make.centerX.equalToSuperview()
}
- else{
+ bgView.snp.makeConstraints { make in
+ make.left.right.equalToSuperview()
+ make.top.equalToSuperview().inset(180)
+ make.bottom.equalToSuperview()
+ }
+ }
+ else{
+ logoImg.snp.makeConstraints { make in
make.left.equalToSuperview().inset(28)
make.top.equalTo(kNavBtm + 20)
make.centerX.equalToSuperview()
}
- }
- bgView.snp.makeConstraints { make in
- make.left.right.equalToSuperview()
- make.top.equalToSuperview().inset(CCConfig.appType == .playboy ? 180:214)
- make.bottom.equalToSuperview()
+ bgView.snp.makeConstraints { make in
+ make.left.right.equalToSuperview()
+ make.top.equalToSuperview().inset(214)
+ make.bottom.equalToSuperview()
+ }
}
titleLabel.snp.makeConstraints { make in
}
override func setupLayout(){
- logoImg.snp.makeConstraints { make in
- if CCConfig.appType == .playboy{
+ if CCConfig.appType == .playboy{
+ logoImg.snp.makeConstraints { make in
make.width.equalTo(62)
make.height.equalTo(80)
make.top.equalTo(kNavBtm)
make.centerX.equalToSuperview()
}
- else{
+ bgView.snp.makeConstraints { make in
+ make.left.right.equalToSuperview()
+ make.top.equalToSuperview().inset(180)
+ make.bottom.equalToSuperview()
+ }
+ }
+ else{
+ logoImg.snp.makeConstraints { make in
make.left.equalToSuperview().inset(28)
make.top.equalTo(kNavBtm + 20)
make.centerX.equalToSuperview()
}
- }
- bgView.snp.makeConstraints { make in
- make.left.right.equalToSuperview()
- make.top.equalToSuperview().inset(CCConfig.appType == .playboy ? 180:214)
- make.bottom.equalToSuperview()
+ bgView.snp.makeConstraints { make in
+ make.left.right.equalToSuperview()
+ make.top.equalToSuperview().inset(214)
+ make.bottom.equalToSuperview()
+ }
}
titleLabel.snp.makeConstraints { make in
}
codeButton.do { (v) in
v.maxCount = 60
- v.label.textColor = .color(.theme)
+ v.color = .color(.theme)
v.backgroundColor = .clear
v.addLine(height: 22)
- v.label.text = "点击获取".l10n
}
inputBgView.backgroundColor = .color(.inputBg)
+++ /dev/null
-//
-// CustomButton.swift
-// ShenYin
-//
-// Created by liangshi on 2025/7/30.
-//
-
-import UIKit
-
-enum CustomButtonStyle:Int{
- case theme1
- case theme2
- case theme3
- case theme4
- case custom
- case sport
-}
-
-class CustomButton: UIButton {
- func set(title:String,font:UIFont = .bold(14),style:CustomButtonStyle = .theme1, target: Any?, action: Selector) {
- if CCConfig.appType == .deepchords{
- setTitle(title, for: .normal)
- addTarget(target, action: action, for: .touchUpInside)
- layer.cornerRadius = 12
- layer.masksToBounds = true
- titleLabel?.font = font
-
- if style == .theme1 {
- setTitleColor(.white, for: .normal)
- backgroundColor = .color(.theme)
- }
- else if style == .theme4 {
- setTitleColor(.hexString("#FF4E4E"), for: .normal)
- backgroundColor = UIColor.hexString("#FF4E4E")
- setTitleColor(.white, for: .normal)
- titleLabel?.font = .bold(14)
- }
- else if style == .theme3 {
- layer.cornerRadius = 12
- setTitleColor(.color(.level1), for: .normal)
- backgroundColor = .color(.cellBg)
- titleLabel?.font = .regular(14)
- }
- else if style == .sport {
- setTitleColor(.white, for: .normal)
- backgroundColor = .color(.sport)
- }
- else{
- setTitleColor(.color(.theme), for: .normal)
- backgroundColor = .clear
- layer.borderWidth = 1.4
- layer.borderColor = UIColor.color(.theme).cgColor
- }
- }
- else if CCConfig.appType == .paxa{
- setTitle(title, for: .normal)
- addTarget(target, action: action, for: .touchUpInside)
- layer.cornerRadius = 12
- layer.masksToBounds = true
- titleLabel?.font = font
-
- if style == .theme1 {
- setTitleColor(.white, for: .normal)
- backgroundColor = .color(.theme)
- }
- else if style == .theme4 {
- setTitleColor(.hexString("#FF4E4E"), for: .normal)
- backgroundColor = UIColor.hexString("#FF4E4E")
- setTitleColor(.white, for: .normal)
- titleLabel?.font = .bold(14)
- }
- else if style == .theme3 {
- layer.cornerRadius = 12
- setTitleColor(.color(.level1), for: .normal)
- backgroundColor = .color(.cellBg)
- titleLabel?.font = .regular(14)
- }
- else if style == .sport {
- setTitleColor(.white, for: .normal)
- backgroundColor = .color(.sport)
- }
- else{
- setTitleColor(.color(.theme), for: .normal)
- backgroundColor = .clear
- layer.borderWidth = 1.4
- layer.borderColor = UIColor.color(.theme).cgColor
- }
- }
- else{
- setTitle(title, for: .normal)
- addTarget(target, action: action, for: .touchUpInside)
- layer.cornerRadius = 23
- layer.masksToBounds = true
- titleLabel?.font = font
-
- if style == .theme1 {
- setTitleColor(.rgb(0x121212), for: .normal)
- backgroundColor = .white
- }
- else if style == .theme4 {
- setTitleColor(.hexString("#FF4E4E"), for: .normal)
- backgroundColor = UIColor.hexString("#FF4E4E")
- setTitleColor(.white, for: .normal)
- titleLabel?.font = .bold(14)
- }
- else if style == .theme3 {
- layer.cornerRadius = 12
- setTitleColor(.color(.level1), for: .normal)
- backgroundColor = .color(.cellBg)
- titleLabel?.font = .regular(14)
- }
- else if style == .sport {
- setTitleColor(.white, for: .normal)
- backgroundColor = .color(.sport)
- }
- else{
- setTitleColor(.white, for: .normal)
- backgroundColor = .clear
- layer.borderWidth = 1.4
- layer.borderColor = UIColor.color(.level1).cgColor
- }
- }
- }
-
-}
v.numberOfLines = 0
}
actionbtn.do { v in
- if CCConfig.appType == .deepchords{
+ if CCConfig.appType == .deepchords || CCConfig.appType == .paxa{
v.backgroundColor = .color(.theme)
v.setTitleColor(.white, for: .normal)
}