From: liangzhenying <867174124@qq.com> Date: Tue, 10 Feb 2026 11:36:20 +0000 (+0800) Subject: 团队UI修改 X-Git-Tag: 1.0.4~5 X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=b0b33add06e9cf725c38a577a458819b1e218dbc;p=mirrors%2FShenYin.git 团队UI修改 --- diff --git a/ShenYin/ShenYin.xcodeproj/project.pbxproj b/ShenYin/ShenYin.xcodeproj/project.pbxproj index 1a812d7..e97f589 100644 --- a/ShenYin/ShenYin.xcodeproj/project.pbxproj +++ b/ShenYin/ShenYin.xcodeproj/project.pbxproj @@ -306,6 +306,7 @@ UI/common/pop/CustomPicker2.swift, UI/common/pop/CustomPicker3.swift, UI/common/pop/CustomPicker4.swift, + UI/common/pop/GroupDesPopView.swift, UI/common/pop/LanguagePicker/LanguagePickerTitle.swift, UI/common/pop/LanguagePicker/LanguagePickerView.swift, UI/common/pop/LanguagePicker/LanguageSelectItem.swift, diff --git a/ShenYin/ShenYin/Assets.xcassets/sport/group_des.imageset/Contents.json b/ShenYin/ShenYin/Assets.xcassets/sport/group_des.imageset/Contents.json new file mode 100644 index 0000000..1bb0f15 --- /dev/null +++ b/ShenYin/ShenYin/Assets.xcassets/sport/group_des.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Slice 208@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Slice 208@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ShenYin/ShenYin/Assets.xcassets/sport/group_des.imageset/Slice 208@2x.png b/ShenYin/ShenYin/Assets.xcassets/sport/group_des.imageset/Slice 208@2x.png new file mode 100644 index 0000000..fa6d74a Binary files /dev/null and b/ShenYin/ShenYin/Assets.xcassets/sport/group_des.imageset/Slice 208@2x.png differ diff --git a/ShenYin/ShenYin/Assets.xcassets/sport/group_des.imageset/Slice 208@3x.png b/ShenYin/ShenYin/Assets.xcassets/sport/group_des.imageset/Slice 208@3x.png new file mode 100644 index 0000000..a228c71 Binary files /dev/null and b/ShenYin/ShenYin/Assets.xcassets/sport/group_des.imageset/Slice 208@3x.png differ diff --git a/ShenYin/ShenYin/Assets.xcassets/sport/help.imageset/Contents.json b/ShenYin/ShenYin/Assets.xcassets/sport/help.imageset/Contents.json new file mode 100644 index 0000000..ba40d8a --- /dev/null +++ b/ShenYin/ShenYin/Assets.xcassets/sport/help.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Slice 59@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Slice 59@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ShenYin/ShenYin/Assets.xcassets/sport/help.imageset/Slice 59@2x.png b/ShenYin/ShenYin/Assets.xcassets/sport/help.imageset/Slice 59@2x.png new file mode 100644 index 0000000..3162e5a Binary files /dev/null and b/ShenYin/ShenYin/Assets.xcassets/sport/help.imageset/Slice 59@2x.png differ diff --git a/ShenYin/ShenYin/Assets.xcassets/sport/help.imageset/Slice 59@3x.png b/ShenYin/ShenYin/Assets.xcassets/sport/help.imageset/Slice 59@3x.png new file mode 100644 index 0000000..f2e17d8 Binary files /dev/null and b/ShenYin/ShenYin/Assets.xcassets/sport/help.imageset/Slice 59@3x.png differ diff --git a/ShenYin/ShenYin/Assets.xcassets/sport/role_des.imageset/Contents.json b/ShenYin/ShenYin/Assets.xcassets/sport/role_des.imageset/Contents.json new file mode 100644 index 0000000..0e82aa8 --- /dev/null +++ b/ShenYin/ShenYin/Assets.xcassets/sport/role_des.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Slice 223@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Slice 223@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ShenYin/ShenYin/Assets.xcassets/sport/role_des.imageset/Slice 223@2x.png b/ShenYin/ShenYin/Assets.xcassets/sport/role_des.imageset/Slice 223@2x.png new file mode 100644 index 0000000..20597d8 Binary files /dev/null and b/ShenYin/ShenYin/Assets.xcassets/sport/role_des.imageset/Slice 223@2x.png differ diff --git a/ShenYin/ShenYin/Assets.xcassets/sport/role_des.imageset/Slice 223@3x.png b/ShenYin/ShenYin/Assets.xcassets/sport/role_des.imageset/Slice 223@3x.png new file mode 100644 index 0000000..44259cd Binary files /dev/null and b/ShenYin/ShenYin/Assets.xcassets/sport/role_des.imageset/Slice 223@3x.png differ diff --git a/ShenYin/ShenYin/UI/Sport/Sport/Group/Create/CreateGroupVC.swift b/ShenYin/ShenYin/UI/Sport/Sport/Group/Create/CreateGroupVC.swift index d381349..512beca 100644 --- a/ShenYin/ShenYin/UI/Sport/Sport/Group/Create/CreateGroupVC.swift +++ b/ShenYin/ShenYin/UI/Sport/Sport/Group/Create/CreateGroupVC.swift @@ -20,6 +20,8 @@ class CreateGroupVC: BaseVC{ override func setupViews() { navBar.do { v in v.title = "创建团队".l10n + v.rightView.setImage(UIImage(named: "help_icon"), for: .normal) + v.rightView.isHidden = false } view.addSubviews([headerView,nameView,typeView,desView,lightView,verifyView,okBtn]) nameView.do { v in @@ -90,6 +92,10 @@ class CreateGroupVC: BaseVC{ make.height.equalTo(46) } } + override func navRightViewTapped() { + let tip = GroupDesPopView() + tip.show() + } @objc func typeAction(){ let vc = GroupTypeVC() vc.didSelected = {[weak self] value in diff --git a/ShenYin/ShenYin/UI/Sport/Sport/Group/MyGroup/MyGroupVC.swift b/ShenYin/ShenYin/UI/Sport/Sport/Group/MyGroup/MyGroupVC.swift index 7b3f120..4b34e04 100644 --- a/ShenYin/ShenYin/UI/Sport/Sport/Group/MyGroup/MyGroupVC.swift +++ b/ShenYin/ShenYin/UI/Sport/Sport/Group/MyGroup/MyGroupVC.swift @@ -62,6 +62,9 @@ class MyGroupVC: BaseVC { } } override func setupViews(){ + navBar.do { v in + v.title = "我的团队" + } view.addSubview(segmentedView) view.addSubview(listContainerView) diff --git a/ShenYin/ShenYin/UI/Sport/Sport/Group/Other/GroupRoleVC.swift b/ShenYin/ShenYin/UI/Sport/Sport/Group/Other/GroupRoleVC.swift index d3b91e0..7661102 100644 --- a/ShenYin/ShenYin/UI/Sport/Sport/Group/Other/GroupRoleVC.swift +++ b/ShenYin/ShenYin/UI/Sport/Sport/Group/Other/GroupRoleVC.swift @@ -44,27 +44,27 @@ enum GroupRoleType:String,HandyJSONEnum{ var color:UIColor{ switch self { case .none: - return .red + return .rgb(0xD9D9D9) case .pfs: - return .red + return .rgb(0xFF9232) case .lpz: - return .red + return .rgb(0x7C2CED) case .gpz: - return .red + return .rgb(0x21B7F8) case .ccs: - return .red + return .rgb(0xFF583B) case .psy: - return .red + return .rgb(0x4252FF) case .bjy: - return .red + return .rgb(0x13D598) case .qns: - return .red + return .rgb(0xF1BF18) case .lqz: - return .red + return .rgb(0x7C2CED) case .gqz: - return .red + return .rgb(0xF1BF18) case .pps: - return .red + return .rgb(0xF1BF18) } } @@ -83,7 +83,12 @@ class GroupRoleVC: BaseVC{ // Do any additional setup after loading the view. } override func setupViews() { - self.navBar.title = "团队类型".l10n + navBar.do { v in + v.title = "团队类型".l10n + v.rightView.setImage(UIImage(named: "help_icon"), for: .normal) + v.rightView.isHidden = false + } + tableView.do { v in v.backgroundColor = .color(.bgColor) v.delegate = self @@ -91,7 +96,7 @@ class GroupRoleVC: BaseVC{ v.rowHeight = 52 v.separatorStyle = .none v.contentInset = UIEdgeInsets(top: 10, left: 0, bottom: 0, right: 0) - v.register(SelectCell.self, forCellReuseIdentifier: SelectCell.reuseID) + v.register(RoleCell.self, forCellReuseIdentifier: RoleCell.reuseID) } view.addSubviews([tableView,btn]) @@ -113,6 +118,16 @@ class GroupRoleVC: BaseVC{ didSelected?(currentType) self.navigationController?.popViewController(animated: true) } + override func navRightViewTapped() { + let tip = GroupDesPopView() + tip.titleLabel.text = "团队角色说明".l10n + tip.titleLabel1.text = "团队角色是什么?".l10n + tip.desLabel2.text = "团队运动中各角色是分工明确、协同发力的核心单元,通过精准配合最大化团队运动效果;".l10n + tip.titleLabel2.text = "团队角色说明".l10n + tip.desLabel2.text = "破风手:以 “挡风减阻” 为核心,为后方队友节省体能;\n领骑者:把控整体节奏,稳定配速避免失衡;\n跟骑者:借助风阻优势储备体力,为关键阶段蓄力;\n冲刺手:聚焦终点前爆发,锁定最终成绩;\n配速员:作为 “节奏标杆”,助力队友校准目标; \n补给员:保障物资供应,维持运动续航; \n全能手:灵活补位,适配破风、带速等多元需求。".l10n + tip.tipsIcon.image = UIImage(named: "role_des") + tip.show() + } } extension GroupRoleVC:UITableViewDelegate,UITableViewDataSource { @@ -121,8 +136,9 @@ extension GroupRoleVC:UITableViewDelegate,UITableViewDataSource { } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { - let cell = SelectCell.cell(withTableView: tableView, indexPath: indexPath) + let cell = RoleCell.cell(withTableView: tableView, indexPath: indexPath) cell.titleLabel.text = list[indexPath.row].name + cell.type.backgroundColor = list[indexPath.row].color let rect = CGRect(x: 0, y: 0, width: kScreenWid - 36, height: 52) if indexPath.row == 0 { cell.bgView.yc.setCorners(withRoundedRect: rect, roundingCorners: [.topLeft,.topRight], cornerRadii: CGSize(width: 8, height: 8)) @@ -142,3 +158,74 @@ extension GroupRoleVC:UITableViewDelegate,UITableViewDataSource { tableView.reloadData() } } +class RoleCell: BaseTableViewCell { + let bgView = UIView() + let type = UIView() + let titleLabel = UILabel() + let selectedIcon = UIImageView() + let line = UIView() + + + override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { + super.init(style: style, reuseIdentifier: reuseIdentifier) + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + override func setupViews() { + contentView.addSubview(bgView) + bgView.addSubviews([type,titleLabel,selectedIcon,line]) + + backgroundColor = .color(.bgColor) + contentView.backgroundColor = .clear + selectionStyle = .none + bgView.do { v in + v.backgroundColor = .color(.cellBg) + } + type.do { v in + v.yc.setCornerRadius(3) + v.backgroundColor = .red + } + titleLabel.do { (v) in + v.textColor = .color(.first) + v.font = .bold(14) + v.textAlignment = .left + } + + selectedIcon.image = UIImage(named: "cell_selected") + line.do { v in + v.backgroundColor = .color(.separateLine) + } + } + + override func setupLayout() { + bgView.snp.makeConstraints { (m) in + m.left.right.equalToSuperview().inset(18) + m.top.equalToSuperview() + m.bottom.equalToSuperview() + } + type.snp.makeConstraints { make in + make.left.equalToSuperview().inset(16) + make.centerY.equalToSuperview() + make.width.equalTo(6) + make.height.equalTo(16) + } + selectedIcon.snp.makeConstraints { (m) in + m.width.equalTo(21) + m.height.equalTo(16) + m.right.equalToSuperview().inset(22) + m.centerY.equalToSuperview() + } + titleLabel.snp.makeConstraints { (m) in + m.centerY.equalToSuperview() + m.left.equalToSuperview().offset(32) + m.height.equalToSuperview() + } + line.snp.makeConstraints { make in + make.left.right.equalToSuperview().inset(18) + make.bottom.equalToSuperview() + make.height.equalTo(0.4) + } + } +} diff --git a/ShenYin/ShenYin/UI/Sport/Sport/Light/LightSetVC.swift b/ShenYin/ShenYin/UI/Sport/Sport/Light/LightSetVC.swift index dd68c5d..aa4eaee 100644 --- a/ShenYin/ShenYin/UI/Sport/Sport/Light/LightSetVC.swift +++ b/ShenYin/ShenYin/UI/Sport/Sport/Light/LightSetVC.swift @@ -19,6 +19,9 @@ class LightSetVC: BaseVC{ // Do any additional setup after loading the view. } + open override var preferredStatusBarStyle: UIStatusBarStyle { + return .lightContent + } override func setupViews() { navBar.do { v in v.title = "灯带设置".l10n diff --git a/ShenYin/ShenYin/UI/Sport/Sport/Ready/Navbar.swift b/ShenYin/ShenYin/UI/Sport/Sport/Ready/Navbar.swift index fb4f36d..5b0aa0c 100644 --- a/ShenYin/ShenYin/UI/Sport/Sport/Ready/Navbar.swift +++ b/ShenYin/ShenYin/UI/Sport/Sport/Ready/Navbar.swift @@ -87,7 +87,6 @@ extension ReadyVC{ v.textColor = .color(.first) v.font = .bold(16) } - backgroundColor = .white } override func setupLayout() { diff --git a/ShenYin/ShenYin/UI/Sport/Sport/Set/SportSetCell.swift b/ShenYin/ShenYin/UI/Sport/Sport/Set/SportSetCell.swift index d0bd882..ce6aeb3 100644 --- a/ShenYin/ShenYin/UI/Sport/Sport/Set/SportSetCell.swift +++ b/ShenYin/ShenYin/UI/Sport/Sport/Set/SportSetCell.swift @@ -247,6 +247,8 @@ class SportSetCell: BaseTableViewCell { } @objc func tapAction(){ switch type { + case .light: + App.shared.goToPage(LightSetVC()) case .lcReportRate: lcReportAction() break diff --git a/ShenYin/ShenYin/UI/Sport/Sport/Set/SportSetVC.swift b/ShenYin/ShenYin/UI/Sport/Sport/Set/SportSetVC.swift index fa88a06..4347064 100644 --- a/ShenYin/ShenYin/UI/Sport/Sport/Set/SportSetVC.swift +++ b/ShenYin/ShenYin/UI/Sport/Sport/Set/SportSetVC.swift @@ -97,13 +97,15 @@ extension SportSetVC:UITableViewDelegate,UITableViewDataSource { return cell } - func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { - let data = list[indexPath.section][indexPath.row] - switch data { - default: - break - } - } +// func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { +// let data = list[indexPath.section][indexPath.row] +// switch data { +// case .light: +// +// default: +// break +// } +// } } extension SportSetVC:SportSetCellDelegate { func sportSetCellSwitchAction(cell:SportSetCell){ diff --git a/ShenYin/ShenYin/UI/Sport/Sport/Target/SportTargetVC.swift b/ShenYin/ShenYin/UI/Sport/Sport/Target/SportTargetVC.swift index f0cd5cc..79dcfa0 100644 --- a/ShenYin/ShenYin/UI/Sport/Sport/Target/SportTargetVC.swift +++ b/ShenYin/ShenYin/UI/Sport/Sport/Target/SportTargetVC.swift @@ -91,7 +91,7 @@ class SportTargetVC: BaseVC { v.dataSource = segmentedDataSource v.listContainer = listContainerView } - okBtn.set(title: "确认".l10n,style: .sport, target: self, action: #selector(okAction)) + okBtn.set(title: "确定".l10n,style: .sport, target: self, action: #selector(okAction)) } @objc func okAction(){ self.navigationController?.popViewController(animated: true) diff --git a/ShenYin/ShenYin/UI/common/pop/GroupDesPopView.swift b/ShenYin/ShenYin/UI/common/pop/GroupDesPopView.swift new file mode 100644 index 0000000..437d5c4 --- /dev/null +++ b/ShenYin/ShenYin/UI/common/pop/GroupDesPopView.swift @@ -0,0 +1,136 @@ +// +// GroupDesPopView.swift +// ShenYin +// +// Created by liangshi on 2026/2/10. +// + +import UIKit + + +class GroupDesPopView: BasePresentView { + let titleLabel = UILabel() + let scorllView = UIScrollView() + let titleLabel1 = UILabel() + let titleLabel2 = UILabel() + let tipsIcon = UIImageView() + let desLabel1 = UILabel() + let desLabel2 = UILabel() + + + init() { + let h = 700.0 + super.init(contentHeight:h) + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + override func setupSubView() { + super.setupSubView() + + contentView.addSubviews([titleLabel,scorllView]) + scorllView.addSubviews([titleLabel1,desLabel1,tipsIcon,titleLabel2,desLabel2]) + + } + override func setupLayout() { + super.setupLayout() + titleLabel.snp.makeConstraints { (m) in + m.top.equalToSuperview().inset(29) + m.left.right.equalToSuperview().inset(18) + } + + + scorllView.snp.makeConstraints { make in + make.width.equalTo(kScreenWid) + make.height.equalTo(610) + make.left.equalToSuperview().inset(0) + make.top.equalToSuperview().inset(90) + } + titleLabel1.snp.makeConstraints { (m) in + m.top.equalToSuperview() + m.left.equalToSuperview().inset(18) + m.width.equalTo(kScreenWid - 36) + } + desLabel1.snp.makeConstraints { (m) in + m.top.equalTo(titleLabel1.snp.bottom).offset(16) + m.left.equalToSuperview().inset(18) + m.width.equalTo(kScreenWid - 36) + } + tipsIcon.snp.makeConstraints { make in + make.left.equalTo(titleLabel1) + make.top.equalTo(desLabel1.snp.bottom).offset(24) + make.width.equalTo(339.fitR) + make.height.equalTo(205.fitR) + } + + titleLabel2.snp.makeConstraints { (m) in + m.top.equalTo(tipsIcon.snp.bottom).offset(20) + m.left.equalToSuperview().inset(18) + m.width.equalTo(kScreenWid - 36) + } + desLabel2.snp.makeConstraints { (m) in + m.top.equalTo(titleLabel2.snp.bottom).offset(16) + m.left.equalToSuperview().inset(18) + m.width.equalTo(kScreenWid - 36) + m.bottom.equalToSuperview().inset(20) + } + + } + + override func setupStyle() { + super.setupStyle() + contentView.backgroundColor = .white + scorllView.do { v in + v.backgroundColor = .clear + } + titleLabel.do { (v) in + v.textColor = .color(.first) + v.font = .semiBold(24) + v.textAlignment = .left + v.text = "团队玩法说明".l10n + } + titleLabel1.do { (v) in + v.textColor = .color(.first) + v.font = .medium(16) + v.textAlignment = .left + v.text = "运动团队是什么?".l10n + } + desLabel1.do { v in + let text = "运动团队是由具备共同运动目标、互补技能的个体组成的集体,成员通过协作配合参与体育项目,追求竞技成绩、团队荣誉或共同健身目标;".l10n + let attributedString = NSMutableAttributedString(string: text) + let paragraphStyle = NSMutableParagraphStyle() + paragraphStyle.lineSpacing = 8 + attributedString.addAttribute(NSAttributedString.Key.paragraphStyle, value: paragraphStyle, range: NSRange(location: 0, length: text.count)) + v.attributedText = attributedString + + v.textColor = .color(.secondary) + v.font = .medium(14) + v.textAlignment = .left + v.numberOfLines = 0 + } + tipsIcon.do { v in + v.image = UIImage(named: "group_des") + } + titleLabel2.do { (v) in + v.textColor = .color(.first) + v.font = .medium(16) + v.textAlignment = .left + v.text = "团队玩法有什么?".l10n + } + desLabel2.do { v in + let text = "多人在线同步运动时,可实时查看队友的位置与运动数据,随时掌握彼此状态; 在选定时段内,系统会针对不同运动数据指标(如配速、距离等),生成对应的排名; 可自主选择团队内的功能角色,基于角色定位与队友分工协作,提升团队运动效率与配合度。".l10n + let attributedString = NSMutableAttributedString(string: text) + let paragraphStyle = NSMutableParagraphStyle() + paragraphStyle.lineSpacing = 8 + attributedString.addAttribute(NSAttributedString.Key.paragraphStyle, value: paragraphStyle, range: NSRange(location: 0, length: text.count)) + v.attributedText = attributedString + + v.textColor = .color(.secondary) + v.font = .medium(14) + v.textAlignment = .left + v.numberOfLines = 0 + } + } +}