Commit 3c9718bc authored by Steven杜宇's avatar Steven杜宇

// 方案

parent 6c4a72de
...@@ -1223,6 +1223,7 @@ ...@@ -1223,6 +1223,7 @@
04D8FF5D2D925EA900703C75 /* YHPlanViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04D8FF5C2D925EA900703C75 /* YHPlanViewController.swift */; }; 04D8FF5D2D925EA900703C75 /* YHPlanViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04D8FF5C2D925EA900703C75 /* YHPlanViewController.swift */; };
04D8FF5F2D93945100703C75 /* YHPlanAnalyzeInfoCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04D8FF5E2D93945100703C75 /* YHPlanAnalyzeInfoCell.swift */; }; 04D8FF5F2D93945100703C75 /* YHPlanAnalyzeInfoCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04D8FF5E2D93945100703C75 /* YHPlanAnalyzeInfoCell.swift */; };
04D8FF612D939D2400703C75 /* YHPlanScoreCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04D8FF602D939D2400703C75 /* YHPlanScoreCell.swift */; }; 04D8FF612D939D2400703C75 /* YHPlanScoreCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04D8FF602D939D2400703C75 /* YHPlanScoreCell.swift */; };
04D8FF632D93A98200703C75 /* YHPlanProductListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04D8FF622D93A98200703C75 /* YHPlanProductListView.swift */; };
04E4CF3E2D5C6D32004D4013 /* YHCountryMessageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E4CF3D2D5C6D32004D4013 /* YHCountryMessageView.swift */; }; 04E4CF3E2D5C6D32004D4013 /* YHCountryMessageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E4CF3D2D5C6D32004D4013 /* YHCountryMessageView.swift */; };
04E4CF402D5C83AE004D4013 /* YHSelectPhoneCountryViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E4CF3F2D5C83AE004D4013 /* YHSelectPhoneCountryViewController.swift */; }; 04E4CF402D5C83AE004D4013 /* YHSelectPhoneCountryViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E4CF3F2D5C83AE004D4013 /* YHSelectPhoneCountryViewController.swift */; };
04E507D62D6EE856005F758B /* YHUserLevelAlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E507D52D6EE856005F758B /* YHUserLevelAlertView.swift */; }; 04E507D62D6EE856005F758B /* YHUserLevelAlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E507D52D6EE856005F758B /* YHUserLevelAlertView.swift */; };
...@@ -2485,6 +2486,7 @@ ...@@ -2485,6 +2486,7 @@
04D8FF5C2D925EA900703C75 /* YHPlanViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPlanViewController.swift; sourceTree = "<group>"; }; 04D8FF5C2D925EA900703C75 /* YHPlanViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPlanViewController.swift; sourceTree = "<group>"; };
04D8FF5E2D93945100703C75 /* YHPlanAnalyzeInfoCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPlanAnalyzeInfoCell.swift; sourceTree = "<group>"; }; 04D8FF5E2D93945100703C75 /* YHPlanAnalyzeInfoCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPlanAnalyzeInfoCell.swift; sourceTree = "<group>"; };
04D8FF602D939D2400703C75 /* YHPlanScoreCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPlanScoreCell.swift; sourceTree = "<group>"; }; 04D8FF602D939D2400703C75 /* YHPlanScoreCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPlanScoreCell.swift; sourceTree = "<group>"; };
04D8FF622D93A98200703C75 /* YHPlanProductListView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPlanProductListView.swift; sourceTree = "<group>"; };
04E4CF3D2D5C6D32004D4013 /* YHCountryMessageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCountryMessageView.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>"; }; 04E4CF3F2D5C83AE004D4013 /* YHSelectPhoneCountryViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSelectPhoneCountryViewController.swift; sourceTree = "<group>"; };
04E507D52D6EE856005F758B /* YHUserLevelAlertView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHUserLevelAlertView.swift; sourceTree = "<group>"; }; 04E507D52D6EE856005F758B /* YHUserLevelAlertView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHUserLevelAlertView.swift; sourceTree = "<group>"; };
...@@ -6630,6 +6632,7 @@ ...@@ -6630,6 +6632,7 @@
04D8FF562D925A0800703C75 /* YHPlanScoreChart.swift */, 04D8FF562D925A0800703C75 /* YHPlanScoreChart.swift */,
04D8FF5E2D93945100703C75 /* YHPlanAnalyzeInfoCell.swift */, 04D8FF5E2D93945100703C75 /* YHPlanAnalyzeInfoCell.swift */,
04D8FF602D939D2400703C75 /* YHPlanScoreCell.swift */, 04D8FF602D939D2400703C75 /* YHPlanScoreCell.swift */,
04D8FF622D93A98200703C75 /* YHPlanProductListView.swift */,
); );
path = V; path = V;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -7123,6 +7126,7 @@ ...@@ -7123,6 +7126,7 @@
045C102F2D12CA5F00BD2DC0 /* YHFormItemInputTextCell.swift in Sources */, 045C102F2D12CA5F00BD2DC0 /* YHFormItemInputTextCell.swift in Sources */,
04307BAE2D1FFEA200ED8E8D /* YHLiveAppointmentViewController.swift in Sources */, 04307BAE2D1FFEA200ED8E8D /* YHLiveAppointmentViewController.swift in Sources */,
045C10302D12CA5F00BD2DC0 /* YHFamilyInfoWarmTipsView.swift in Sources */, 045C10302D12CA5F00BD2DC0 /* YHFamilyInfoWarmTipsView.swift in Sources */,
04D8FF632D93A98200703C75 /* YHPlanProductListView.swift in Sources */,
045C10312D12CA5F00BD2DC0 /* YHSpouseInfoContainerVC.swift in Sources */, 045C10312D12CA5F00BD2DC0 /* YHSpouseInfoContainerVC.swift in Sources */,
045C10322D12CA5F00BD2DC0 /* YHRecommendTextMessageCell.swift in Sources */, 045C10322D12CA5F00BD2DC0 /* YHRecommendTextMessageCell.swift in Sources */,
045C10332D12CA5F00BD2DC0 /* YHBasicInfoFillModel.swift in Sources */, 045C10332D12CA5F00BD2DC0 /* YHBasicInfoFillModel.swift in Sources */,
......
...@@ -60,10 +60,15 @@ extension YHPlanViewController: UITableViewDelegate, UITableViewDataSource { ...@@ -60,10 +60,15 @@ extension YHPlanViewController: UITableViewDelegate, UITableViewDataSource {
let defaultCell = tableView.dequeueReusableCell(withIdentifier: "UITableViewCell", for: indexPath) let defaultCell = tableView.dequeueReusableCell(withIdentifier: "UITableViewCell", for: indexPath)
if 0 <= indexPath.section && indexPath.section < self.infoArr.count { if 0 <= indexPath.section && indexPath.section < self.infoArr.count {
if indexPath.section == 0 { if indexPath.section == 0 {
let cell1 = tableView.dequeueReusableCell(withIdentifier: YHPlanScoreCell.cellReuseIdentifier, for: indexPath) guard let cell1 = tableView.dequeueReusableCell(withIdentifier: YHPlanScoreCell.cellReuseIdentifier, for: indexPath) as? YHPlanScoreCell else {
return UITableViewCell()
}
return cell1 return cell1
} else { } else {
let cell2 = tableView.dequeueReusableCell(withIdentifier: YHPlanAnalyzeInfoCell.cellReuseIdentifier, for: indexPath) guard let cell2 = tableView.dequeueReusableCell(withIdentifier: YHPlanAnalyzeInfoCell.cellReuseIdentifier, for: indexPath) as? YHPlanAnalyzeInfoCell else {
return UITableViewCell()
}
cell2.products = []
return cell2 return cell2
} }
} }
......
...@@ -45,15 +45,15 @@ class YHPlanAnalyzeInfoView: UIView { ...@@ -45,15 +45,15 @@ class YHPlanAnalyzeInfoView: UIView {
self.addSubview(descLabel) self.addSubview(descLabel)
titleLabel.snp.makeConstraints { make in titleLabel.snp.makeConstraints { make in
make.left.equalTo(16) make.left.equalTo(0)
make.right.equalTo(-16) make.right.equalTo(-0)
make.top.equalTo(0) make.top.equalTo(0)
make.height.equalTo(20) make.height.equalTo(20)
} }
descLabel.snp.makeConstraints { make in descLabel.snp.makeConstraints { make in
make.left.equalTo(16) make.left.equalTo(0)
make.right.equalTo(-16) make.right.equalTo(-0)
make.top.equalTo(titleLabel.snp.bottom).offset(4) make.top.equalTo(titleLabel.snp.bottom).offset(4)
make.bottom.equalToSuperview() make.bottom.equalToSuperview()
} }
...@@ -64,6 +64,25 @@ class YHPlanAnalyzeInfoCell: UITableViewCell { ...@@ -64,6 +64,25 @@ class YHPlanAnalyzeInfoCell: UITableViewCell {
static let cellReuseIdentifier = "YHPlanAnalyzeInfoCell" static let cellReuseIdentifier = "YHPlanAnalyzeInfoCell"
var products: [String] = [] {
didSet {
let isShowList = products.count > 0
productListView.isHidden = !isShowList
productListView.snp.remakeConstraints { make in
make.left.equalTo(16)
make.top.equalTo(suggestVeiw.snp.bottom).offset(isShowList ? 16 : 0)
if !isShowList {
make.height.equalTo(0)
}
make.right.equalTo(-16)
make.bottom.equalTo(-16)
}
productListView.products = products
self.setNeedsLayout()
self.layoutIfNeeded()
}
}
lazy var whiteContentView: UIView = { lazy var whiteContentView: UIView = {
let v = UIView() let v = UIView()
v.backgroundColor = .white v.backgroundColor = .white
...@@ -86,7 +105,7 @@ class YHPlanAnalyzeInfoCell: UITableViewCell { ...@@ -86,7 +105,7 @@ class YHPlanAnalyzeInfoCell: UITableViewCell {
lable.textAlignment = .right lable.textAlignment = .right
lable.font = UIFont.PFSC_M(ofSize: 15) lable.font = UIFont.PFSC_M(ofSize: 15)
let aa: ASAttributedString = .init("3.0", .font(UIFont(name: "DINAlternate-Bold", size: 24)!), .foreground(UIColor.mainTextColor)) let aa: ASAttributedString = .init("3.0", .font(UIFont(name: "DINAlternate-Bold", size: 24)!), .foreground(UIColor.mainTextColor))
let bb: ASAttributedString = .init("/5.0", .font(UIFont(name: "DINAlternate-Bold", size: 14)!), .foreground(UIColor.mainTextColor)) let bb: ASAttributedString = .init("/5.0", .font(UIFont(name: "DINAlternate-Bold", size: 14)!), .foreground(UIColor.init(hex: 0x8993A2)))
lable.attributed.text = aa+bb lable.attributed.text = aa+bb
return lable return lable
}() }()
...@@ -116,6 +135,12 @@ class YHPlanAnalyzeInfoCell: UITableViewCell { ...@@ -116,6 +135,12 @@ class YHPlanAnalyzeInfoCell: UITableViewCell {
return v return v
}() }()
lazy var productListView: YHPlanProductListView = {
let v = YHPlanProductListView(frame: .zero)
v.isHidden = true
return v
}()
required init?(coder: NSCoder) { required init?(coder: NSCoder) {
super.init(coder: coder) super.init(coder: coder)
} }
...@@ -136,6 +161,7 @@ class YHPlanAnalyzeInfoCell: UITableViewCell { ...@@ -136,6 +161,7 @@ class YHPlanAnalyzeInfoCell: UITableViewCell {
whiteContentView.addSubview(currentStateVeiw) whiteContentView.addSubview(currentStateVeiw)
whiteContentView.addSubview(requireVeiw) whiteContentView.addSubview(requireVeiw)
whiteContentView.addSubview(suggestVeiw) whiteContentView.addSubview(suggestVeiw)
whiteContentView.addSubview(productListView)
whiteContentView.snp.makeConstraints { make in whiteContentView.snp.makeConstraints { make in
make.left.equalTo(16) make.left.equalTo(16)
...@@ -179,8 +205,14 @@ class YHPlanAnalyzeInfoCell: UITableViewCell { ...@@ -179,8 +205,14 @@ class YHPlanAnalyzeInfoCell: UITableViewCell {
make.left.equalTo(16) make.left.equalTo(16)
make.top.equalTo(requireVeiw.snp.bottom).offset(16) make.top.equalTo(requireVeiw.snp.bottom).offset(16)
make.right.equalTo(-16) make.right.equalTo(-16)
}
productListView.snp.makeConstraints { make in
make.left.equalTo(16)
make.top.equalTo(suggestVeiw.snp.bottom).offset(0)
make.height.equalTo(0)
make.right.equalTo(-16)
make.bottom.equalTo(-16) make.bottom.equalTo(-16)
} }
} }
} }
//
// YHPlanProductListView.swift
// galaxy
//
// Created by Dufet on 2025/3/26.
// Copyright © 2025 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHPlanProductItemView: UIView {
lazy var iconImgV: UIImageView = {
let v = UIImageView()
v.backgroundColor = .red
return v
}()
lazy var titleLabel: UILabel = {
let lable = UILabel()
lable.textColor = UIColor.mainTextColor
lable.textAlignment = .left
lable.font = UIFont.PFSC_M(ofSize: 15)
lable.text = "XXXXXXXX"
return lable
}()
lazy var descLabel: UILabel = {
let lable = UILabel()
lable.textColor = UIColor.init(hex: 0x8993A2)
lable.textAlignment = .left
lable.font = UIFont.PFSC_R(ofSize: 12)
lable.numberOfLines = 0
lable.text = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
return lable
}()
lazy var rightArrowIcon: UIImageView = {
let imageView = UIImageView(image: UIImage(named: "form_right_arrow"))
return imageView
}()
override init(frame: CGRect) {
super.init(frame: frame)
createUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func createUI() {
backgroundColor = .init(hex: 0xF8F9FB)
self.addSubview(iconImgV)
self.addSubview(titleLabel)
self.addSubview(descLabel)
self.addSubview(rightArrowIcon)
iconImgV.snp.makeConstraints { make in
make.left.top.bottom.equalToSuperview()
make.width.equalTo(iconImgV.snp.height)
}
titleLabel.snp.makeConstraints { make in
make.left.equalTo(iconImgV.snp.right).offset(8)
make.top.equalTo(8)
make.height.equalTo(22)
make.right.equalTo(rightArrowIcon.snp.left).offset(-8)
}
descLabel.snp.makeConstraints { make in
make.left.equalTo(iconImgV.snp.right).offset(8)
make.top.equalTo(titleLabel.snp.bottom).offset(2)
make.height.equalTo(18)
make.right.equalTo(rightArrowIcon.snp.left).offset(-8)
}
rightArrowIcon.snp.makeConstraints { make in
make.width.height.equalTo(16)
make.centerY.equalToSuperview()
make.right.equalTo(-8)
}
}
}
class YHPlanProductListView: UIView {
var products: [String] = [] {
didSet {
listView.removeSubviews()
var lastItemView: YHPlanProductItemView?
for (index, item) in products.enumerated() {
let v = YHPlanProductItemView(frame: .zero)
listView.addSubview(v)
v.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.height.equalTo(58.0)
if let last = lastItemView {
make.top.equalTo(last.snp.bottom).offset(8)
} else {
make.top.equalToSuperview()
}
if index == products.count-1 {
make.bottom.equalToSuperview()
}
}
lastItemView = v
}
self.setNeedsLayout()
self.layoutIfNeeded()
}
}
lazy var titleLabel: UILabel = {
let lable = UILabel()
lable.textColor = UIColor.init(hex: 0xAE6C32)
lable.textAlignment = .left
lable.font = UIFont.PFSC_M(ofSize: 15)
lable.text = "增购以下产品可提升生活联系"
return lable
}()
lazy var listView: UIView = {
let v = UIView()
return v
}()
override init(frame: CGRect) {
super.init(frame: frame)
createUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func createUI() {
backgroundColor = .clear
self.addSubview(titleLabel)
self.addSubview(listView)
titleLabel.snp.makeConstraints { make in
make.left.right.top.equalToSuperview()
make.height.equalTo(18)
}
listView.snp.makeConstraints { make in
make.top.equalTo(titleLabel.snp.bottom).offset(8)
make.left.right.bottom.equalToSuperview()
}
}
}
...@@ -27,12 +27,13 @@ class YHPlanScoreCell: UITableViewCell { ...@@ -27,12 +27,13 @@ class YHPlanScoreCell: UITableViewCell {
} }
func setupUI() { func setupUI() {
selectionStyle = .none
backgroundColor = .clear backgroundColor = .clear
contentView.backgroundColor = .clear contentView.backgroundColor = .clear
self.contentView.addSubview(scoreView) self.contentView.addSubview(scoreView)
scoreView.snp.makeConstraints { make in scoreView.snp.makeConstraints { make in
make.edges.equalToSuperview() make.edges.equalToSuperview()
make.height.equalTo(442)
} }
scoreView.chartView.updateScores([5.0, 5.0, 5.0, 5.0]) scoreView.chartView.updateScores([5.0, 5.0, 5.0, 5.0])
} }
......
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