Commit 9b7ae4d6 authored by pete谢兆麟's avatar pete谢兆麟

Merge branch 'develop' of http://gitlab.galaxy-immi.com/mobile-group/galaxy-iOS into develop

parents f5eb3d19 88a40150
......@@ -1193,6 +1193,7 @@
04AFEF452D5DDCCB0007A011 /* YHMyFunctionGroup2Cell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04AFEF442D5DDCCB0007A011 /* YHMyFunctionGroup2Cell.swift */; };
04AFEF492D5DDE180007A011 /* YHMyFunctionGroupItem2Cell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04AFEF482D5DDE180007A011 /* YHMyFunctionGroupItem2Cell.swift */; };
04AFEF4B2D5DF3710007A011 /* YHMyUserInfoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04AFEF4A2D5DF3710007A011 /* YHMyUserInfoView.swift */; };
04AFEF4D2D5EEF860007A011 /* YHUserVipInfoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04AFEF4C2D5EEF860007A011 /* YHUserVipInfoView.swift */; };
04E4CF3E2D5C6D32004D4013 /* YHCountryMessageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E4CF3D2D5C6D32004D4013 /* YHCountryMessageView.swift */; };
04E4CF402D5C83AE004D4013 /* YHSelectPhoneCountryViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E4CF3F2D5C83AE004D4013 /* YHSelectPhoneCountryViewController.swift */; };
04EA376D2BEA06EF00DBAF64 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 04EA376C2BEA06EF00DBAF64 /* WebKit.framework */; };
......@@ -2424,6 +2425,7 @@
04AFEF442D5DDCCB0007A011 /* YHMyFunctionGroup2Cell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMyFunctionGroup2Cell.swift; sourceTree = "<group>"; };
04AFEF482D5DDE180007A011 /* YHMyFunctionGroupItem2Cell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMyFunctionGroupItem2Cell.swift; sourceTree = "<group>"; };
04AFEF4A2D5DF3710007A011 /* YHMyUserInfoView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMyUserInfoView.swift; sourceTree = "<group>"; };
04AFEF4C2D5EEF860007A011 /* YHUserVipInfoView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHUserVipInfoView.swift; sourceTree = "<group>"; };
04E4CF3D2D5C6D32004D4013 /* YHCountryMessageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCountryMessageView.swift; sourceTree = "<group>"; };
04E4CF3F2D5C83AE004D4013 /* YHSelectPhoneCountryViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSelectPhoneCountryViewController.swift; sourceTree = "<group>"; };
04EA376C2BEA06EF00DBAF64 /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = System/Library/Frameworks/WebKit.framework; sourceTree = SDKROOT; };
......@@ -5781,6 +5783,7 @@
045C0EF82D12CA5E00BD2DC0 /* YHPersonalCenterCell.swift */,
045C0EF92D12CA5E00BD2DC0 /* YHUserInfoHeaderView.swift */,
04AFEF4A2D5DF3710007A011 /* YHMyUserInfoView.swift */,
04AFEF4C2D5EEF860007A011 /* YHUserVipInfoView.swift */,
);
path = V;
sourceTree = "<group>";
......@@ -7239,6 +7242,7 @@
045C11282D12CA5F00BD2DC0 /* YHH5WebViewVC.swift in Sources */,
045C11292D12CA5F00BD2DC0 /* YHAIMessageModel.swift in Sources */,
045C112A2D12CA5F00BD2DC0 /* YHBasicInfoFillBottomView.swift in Sources */,
04AFEF4D2D5EEF860007A011 /* YHUserVipInfoView.swift in Sources */,
045C112B2D12CA5F00BD2DC0 /* YHResignUploadDocListProgressModel.swift in Sources */,
045C112C2D12CA5F00BD2DC0 /* YHPersonalCenterCell.swift in Sources */,
045C112D2D12CA5F00BD2DC0 /* YHPrincipleApprovedWaitSubmitVC.swift in Sources */,
......@@ -8060,7 +8064,7 @@
CODE_SIGN_ENTITLEMENTS = galaxy/galaxyTestEnv.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = RXHYW88XR7;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
FRAMEWORK_SEARCH_PATHS = (
......@@ -8206,7 +8210,7 @@
CODE_SIGN_ENTITLEMENTS = galaxy/galaxy.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = RXHYW88XR7;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
FRAMEWORK_SEARCH_PATHS = (
......@@ -8414,7 +8418,7 @@
CODE_SIGN_ENTITLEMENTS = galaxy/galaxyDebug.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = RXHYW88XR7;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
FRAMEWORK_SEARCH_PATHS = (
......@@ -8462,7 +8466,7 @@
CODE_SIGN_ENTITLEMENTS = galaxy/galaxy.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = RXHYW88XR7;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
FRAMEWORK_SEARCH_PATHS = (
......
......@@ -213,7 +213,7 @@ class YHCodeSueecssViewController: YHBaseViewController {
//苹果登录逻辑
var params = self.appleLoginParams
params["sms_code"] = code
params["mobile"] = phone
params["mobile"] = XXTEA.encryptString(toBase64String: phone, stringKey: "galaxyapps") ?? phone
params["mobile_area_code"] = "+" + self.country.code
printLog("Apple login parmas: \(params)")
YHHUD.show(.progress(message: ""))
......
......@@ -18,6 +18,7 @@ enum YHPersonalModuleItemType: Int {
case myProgress
case myActivity
case scoreCenter
case inviteFriends
case recommend
case myPoster
case myTestCode
......
......@@ -12,6 +12,9 @@ class YHMyFunctionGroup2Cell: UITableViewCell {
static let cellReuseIdentifier = "YHMyFunctionGroup2Cell"
static let itemHeight = 74.0
var clickItem:((PersonalModuleItem)->())?
func updateGroup(_ group: YHFunctionGroupInfo) {
groupArr = group.arr
}
......@@ -105,7 +108,11 @@ extension YHMyFunctionGroup2Cell: UICollectionViewDelegate, UICollectionViewData
}
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
if 0 <= indexPath.item && indexPath.item < groupArr.count {
let item: PersonalModuleItem = groupArr[indexPath.item]
if let click = clickItem {
click(item)
}
}
}
}
......@@ -14,6 +14,7 @@ class YHMyFunctionGroupItemCell: UICollectionViewCell {
func updateItem(_ item : PersonalModuleItem) {
titleLabel.text = item.title
redPointView.isHidden = !item.isShowRedPoint
if let icon = item.icon, !icon.isEmpty {
iconImgView.image = UIImage(named:icon)
} else {
......@@ -34,6 +35,15 @@ class YHMyFunctionGroupItemCell: UICollectionViewCell {
return v
}()
private lazy var redPointView: UIView = {
let view = UIView()
view.layer.cornerRadius = 2.5
view.clipsToBounds = true
view.backgroundColor = .failColor
view.isHidden = true
return view
}()
required init?(coder: NSCoder) {
super.init(coder: coder)
}
......@@ -46,6 +56,8 @@ class YHMyFunctionGroupItemCell: UICollectionViewCell {
func setupUI() {
self.contentView.addSubview(titleLabel)
self.contentView.addSubview(iconImgView)
self.contentView.addSubview(redPointView)
iconImgView.snp.makeConstraints { make in
make.top.equalTo(20)
......@@ -53,6 +65,12 @@ class YHMyFunctionGroupItemCell: UICollectionViewCell {
make.centerX.equalToSuperview()
}
redPointView.snp.makeConstraints { make in
make.width.height.equalTo(5)
make.top.equalTo(iconImgView)
make.left.equalTo(iconImgView.snp.right).offset(0)
}
titleLabel.snp.makeConstraints { make in
make.top.equalTo(iconImgView.snp.bottom).offset(8)
make.height.equalTo(18)
......
......@@ -12,6 +12,8 @@ class YHMySectionGroupCell: UITableViewCell {
static let cellReuseIdentifier = "YHMySectionGroupCell"
var clickItem:((PersonalModuleItem)->())?
func updateGroup(_ group: YHFunctionGroupInfo) {
titleLabel.text = group.title
groupArr = group.arr
......@@ -134,7 +136,11 @@ extension YHMySectionGroupCell: UICollectionViewDelegate, UICollectionViewDataSo
}
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
if 0 <= indexPath.item && indexPath.item < groupArr.count {
let item: PersonalModuleItem = groupArr[indexPath.item]
if let click = clickItem {
click(item)
}
}
}
}
......@@ -19,6 +19,7 @@ class YHMyUserInfoView: UIView {
var likeClick:(()->Void)?
var collectClick:(()->Void)?
var recentScanClick:(()->Void)?
var enterClick:(()->Void)?
lazy var contentView: UIView = {
let view = UIView()
......@@ -36,7 +37,7 @@ class YHMyUserInfoView: UIView {
return imgView
}()
private lazy var userNameLabel:UILabel = {
lazy var userNameLabel:UILabel = {
let label = UILabel()
label.text = "登录/注册".local
label.textColor = .mainTextColor
......@@ -99,12 +100,24 @@ class YHMyUserInfoView: UIView {
return line
}()
lazy var vipImgView: UIImageView = {
let imgV = UIImageView()
imgV.image = UIImage(named: "mine_vip_1")
return imgV
}()
lazy var arrowImgView: UIImageView = {
let imgV = UIImageView()
imgV.image = UIImage(named: "form_right_arrow")
return imgV
}()
lazy var enterBtn: UIButton = {
let btn = UIButton()
btn.addTarget(self, action: #selector(enterBtnClicked), for: .touchUpInside)
return btn
}()
override init(frame: CGRect) {
super.init(frame: frame)
self.clipsToBounds = true
......@@ -125,6 +138,7 @@ class YHMyUserInfoView: UIView {
self.addSubview(contentView)
contentView.addSubview(avarImgView)
contentView.addSubview(userNameLabel)
contentView.addSubview(vipImgView)
contentView.addSubview(likeLabel)
contentView.addSubview(collectLabel)
......@@ -133,6 +147,7 @@ class YHMyUserInfoView: UIView {
contentView.addSubview(line2View)
contentView.addSubview(arrowImgView)
contentView.addSubview(enterBtn)
contentView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
......@@ -150,10 +165,17 @@ class YHMyUserInfoView: UIView {
userNameLabel.snp.makeConstraints { make in
make.left.equalTo(avarImgView.snp.right).offset(16)
make.top.equalTo(avarImgView)
make.right.equalTo(arrowImgView.snp.left)
make.height.equalTo(29.0)
}
vipImgView.snp.makeConstraints { make in
make.width.equalTo(43)
make.height.equalTo(16)
make.centerY.equalTo(userNameLabel)
make.left.equalTo(userNameLabel.snp.right).offset(8)
make.right.lessThanOrEqualTo(arrowImgView.snp.left).offset(0)
}
likeLabel.snp.makeConstraints { make in
make.left.equalTo(userNameLabel)
make.right.equalTo(line1View.snp.left).offset(-12)
......@@ -196,16 +218,37 @@ class YHMyUserInfoView: UIView {
make.right.equalTo(0)
}
enterBtn.snp.makeConstraints { make in
make.right.top.bottom.equalToSuperview()
make.width.equalTo(enterBtn.snp.height)
}
update(count: 0, label: likeLabel)
update(count: 0, label: collectLabel)
update(count: 0, label: scanLabel)
}
@objc func enterBtnClicked() {
enterClick?()
}
func updateAvatar() {
let headImgName = YHLoginManager.shared.isLogin() ? "people_head_default" : "mine_head_logout"
avarImgView.image = UIImage(named: headImgName)
}
func updateLikeCollectCount(_ model: YHCollectionModel) {
update(count: model.myLikeCount, label: likeLabel)
update(count: model.myCollectCount, label: collectLabel)
update(count: model.myViewCount, label: scanLabel)
}
func update(count: Int, label: UILabel) {
var text = ""
var count = "\(count) "
var countStr = count < 10000 ? String(count) : String(format: "%.1fw", Double(count/1000)/10.0)
if label.tag == Self.likeTag {
text = "点赞"
......@@ -215,13 +258,12 @@ class YHMyUserInfoView: UIView {
} else if label.tag == Self.scanTag {
text = "最近浏览"
}
let attrStr = NSMutableAttributedString(string: "")
let countAttrStr = NSAttributedString(
string: count,
string: countStr,
attributes: [NSAttributedString.Key.foregroundColor: UIColor.mainTextColor,
NSAttributedString.Key.font: UIFont(name: "DINAlternate-Bold", size: 14)!])
let titleAttrStr = NSAttributedString(
......
//
// YHUserVipInfoView.swift
// galaxy
//
// Created by Dufet on 2025/2/14.
// Copyright © 2025 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHUserVipFunctionInfoView: UIView {
var title: String = "" {
didSet {
titleLabel.text = title
}
}
var desc: String = "" {
didSet {
descLabel.text = desc
}
}
lazy var titleLabel: UILabel = {
let label = UILabel()
label.textColor = .white
label.textAlignment = .left
label.font = UIFont.PFSC_R(ofSize: 12)
return label
}()
lazy var descLabel: UILabel = {
let label = UILabel()
label.textColor = UIColor(hex: 0xFFFFFF, alpha: 0.6)
label.textAlignment = .left
label.font = UIFont.PFSC_R(ofSize: 10)
return label
}()
lazy var lineView: UIView = {
let view = UIView()
view.backgroundColor = UIColor(hex: 0xFFFFFF, alpha: 0.16)
return view
}()
override init(frame: CGRect) {
super.init(frame: frame)
self.clipsToBounds = true
createUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
private func createUI() {
self.addSubview(lineView)
self.addSubview(titleLabel)
self.addSubview(descLabel)
lineView.snp.makeConstraints { make in
make.width.equalTo(1)
make.height.equalTo(33)
make.left.equalTo(0)
make.centerY.equalToSuperview()
}
titleLabel.snp.makeConstraints { make in
make.left.equalTo(16)
make.right.equalTo(-5)
make.top.equalTo(12)
make.height.equalTo(17)
}
descLabel.snp.makeConstraints { make in
make.left.equalTo(16)
make.right.equalTo(-5)
make.top.equalTo(titleLabel.snp.bottom).offset(2)
make.height.equalTo(14)
}
}
}
class YHUserVipInfoView: UIView {
lazy var bgImgView: UIImageView = {
let imgV = UIImageView()
imgV.image = UIImage(named: "mine_member_bg_vip_1")
return imgV
}()
lazy var titleLabel: UILabel = {
let label = UILabel()
label.text = "大众会员"
label.textColor = .white
label.textAlignment = .left
label.font = UIFont.PFSC_B(ofSize: 17)
return label
}()
lazy var growValueLabel: UILabel = {
let label = UILabel()
label.textAlignment = .left
return label
}()
lazy var function1View: YHUserVipFunctionInfoView = {
let v = YHUserVipFunctionInfoView(frame: .zero)
v.lineView.isHidden = true
v.title = "舒适出行"
v.desc = "深港专车服务"
return v
}()
lazy var function2View: YHUserVipFunctionInfoView = {
let v = YHUserVipFunctionInfoView(frame: .zero)
v.title = "奢华会客"
v.desc = "北上深港体验中心"
return v
}()
lazy var function3View: YHUserVipFunctionInfoView = {
let v = YHUserVipFunctionInfoView(frame: .zero)
v.title = "高端私董会"
v.desc = "打造高端人脉圈子"
return v
}()
lazy var rightBtn: UIButton = {
let btn = UIButton()
btn.backgroundColor = .init(hex:0x323849)
btn.titleLabel?.font = .PFSC_M(ofSize:10)
btn.setTitle("更多权益", for: .normal)
btn.setTitleColor(.white, for: .normal)
btn.layer.cornerRadius = 15.0
return btn
}()
override init(frame: CGRect) {
super.init(frame: frame)
self.clipsToBounds = true
createUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
private func createUI() {
self.addSubview(bgImgView)
self.addSubview(titleLabel)
self.addSubview(growValueLabel)
self.addSubview(rightBtn)
self.addSubview(function1View)
self.addSubview(function2View)
self.addSubview(function3View)
bgImgView.snp.makeConstraints { make in
make.edges.equalToSuperview()
}
titleLabel.snp.makeConstraints { make in
make.bottom.equalTo(self.snp.centerY).offset(-16)
make.left.equalTo(16)
make.height.equalTo(24)
make.width.equalTo(68)
}
growValueLabel.snp.makeConstraints { make in
make.centerY.equalTo(titleLabel)
make.left.equalTo(titleLabel.snp.right).offset(4)
make.height.equalTo(17)
make.right.equalTo(rightBtn.snp.left).offset(-16)
}
rightBtn.snp.makeConstraints { make in
make.height.equalTo(30)
make.width.equalTo(72)
make.centerY.equalTo(titleLabel)
make.right.equalTo(-16)
}
function1View.snp.makeConstraints { make in
make.left.equalTo(0)
make.top.equalTo(self.snp.centerY)
make.bottom.equalTo(0)
make.width.equalTo(function2View)
}
function2View.snp.makeConstraints { make in
make.left.equalTo(function1View.snp.right)
make.top.equalTo(function1View)
make.bottom.equalTo(0)
make.width.equalTo(function3View)
}
function3View.snp.makeConstraints { make in
make.left.equalTo(function2View.snp.right)
make.right.equalTo(0)
make.top.equalTo(function1View)
make.bottom.equalTo(0)
}
self.update(growValue: 0)
}
func update(growValue: Int) {
let text = "当前成长值"
let count = " \(growValue)"
let attrStr = NSMutableAttributedString(string: "")
let countAttrStr = NSAttributedString(
string: count,
attributes: [NSAttributedString.Key.foregroundColor: UIColor(hex: 0xFFFFFF, alpha: 0.6),
NSAttributedString.Key.font: UIFont(name: "DINAlternate-Bold", size: 13)!])
let titleAttrStr = NSAttributedString(
string: text,
attributes: [NSAttributedString.Key.foregroundColor: UIColor(hex: 0xFFFFFF, alpha: 0.6),
NSAttributedString.Key.font: UIFont.PFSC_R(ofSize: 12)])
attrStr.append(titleAttrStr)
attrStr.append(countAttrStr)
growValueLabel.attributedText = attrStr
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Group 2033197226@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Group 2033197226@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Group 2033197225@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Group 2033197225@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Group 2033197211@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Group 2033197211@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Group 2033197212@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Group 2033197212@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment