Commit 308e0f9a authored by pete谢兆麟's avatar pete谢兆麟

UI问题修复

parent 2c34284e
...@@ -1172,6 +1172,8 @@ ...@@ -1172,6 +1172,8 @@
0497C7532D9BD21500A3E32A /* YHMakePlanViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0497C7522D9BD21500A3E32A /* YHMakePlanViewModel.swift */; }; 0497C7532D9BD21500A3E32A /* YHMakePlanViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0497C7522D9BD21500A3E32A /* YHMakePlanViewModel.swift */; };
0497C7552D9BD36700A3E32A /* YHMakePlanModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0497C7542D9BD36700A3E32A /* YHMakePlanModel.swift */; }; 0497C7552D9BD36700A3E32A /* YHMakePlanModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0497C7542D9BD36700A3E32A /* YHMakePlanModel.swift */; };
0497C7572D9D437B00A3E32A /* YHMakePlanScoreModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0497C7562D9D437B00A3E32A /* YHMakePlanScoreModel.swift */; }; 0497C7572D9D437B00A3E32A /* YHMakePlanScoreModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0497C7562D9D437B00A3E32A /* YHMakePlanScoreModel.swift */; };
0497C7592DA4CFF000A3E32A /* D-DIN-PRO-500-Medium.otf in Resources */ = {isa = PBXBuildFile; fileRef = 0497C7582DA4CFEF00A3E32A /* D-DIN-PRO-500-Medium.otf */; };
0497C75B2DA4CFFA00A3E32A /* D-DIN-PRO-700-Bold.otf in Resources */ = {isa = PBXBuildFile; fileRef = 0497C75A2DA4CFFA00A3E32A /* D-DIN-PRO-700-Bold.otf */; };
04A750D02D925FD400974E5F /* YHCustomerInformationQuestionnaireVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04A750CF2D925FD400974E5F /* YHCustomerInformationQuestionnaireVC.swift */; }; 04A750D02D925FD400974E5F /* YHCustomerInformationQuestionnaireVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04A750CF2D925FD400974E5F /* YHCustomerInformationQuestionnaireVC.swift */; };
04A750D22D93ABCE00974E5F /* YHSurveyTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04A750D12D93ABCE00974E5F /* YHSurveyTableViewCell.swift */; }; 04A750D22D93ABCE00974E5F /* YHSurveyTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04A750D12D93ABCE00974E5F /* YHSurveyTableViewCell.swift */; };
04A750D42D93DFED00974E5F /* YHSurveyQuestionType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04A750D32D93DFED00974E5F /* YHSurveyQuestionType.swift */; }; 04A750D42D93DFED00974E5F /* YHSurveyQuestionType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04A750D32D93DFED00974E5F /* YHSurveyQuestionType.swift */; };
...@@ -2477,6 +2479,9 @@ ...@@ -2477,6 +2479,9 @@
0497C7522D9BD21500A3E32A /* YHMakePlanViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMakePlanViewModel.swift; sourceTree = "<group>"; }; 0497C7522D9BD21500A3E32A /* YHMakePlanViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMakePlanViewModel.swift; sourceTree = "<group>"; };
0497C7542D9BD36700A3E32A /* YHMakePlanModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMakePlanModel.swift; sourceTree = "<group>"; }; 0497C7542D9BD36700A3E32A /* YHMakePlanModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMakePlanModel.swift; sourceTree = "<group>"; };
0497C7562D9D437B00A3E32A /* YHMakePlanScoreModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMakePlanScoreModel.swift; sourceTree = "<group>"; }; 0497C7562D9D437B00A3E32A /* YHMakePlanScoreModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMakePlanScoreModel.swift; sourceTree = "<group>"; };
0497C7582DA4CFEF00A3E32A /* D-DIN-PRO-500-Medium.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "D-DIN-PRO-500-Medium.otf"; sourceTree = "<group>"; };
0497C75A2DA4CFFA00A3E32A /* D-DIN-PRO-700-Bold.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "D-DIN-PRO-700-Bold.otf"; sourceTree = "<group>"; };
0497C75C2DA4EE0600A3E32A /* D-DIN-PRO-500-Medium.otf */ = {isa = PBXFileReference; lastKnownFileType = file; name = "D-DIN-PRO-500-Medium.otf"; path = "galaxy/Res/Font/D-DIN-PRO-500-Medium.otf"; sourceTree = "<group>"; };
04A750CF2D925FD400974E5F /* YHCustomerInformationQuestionnaireVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCustomerInformationQuestionnaireVC.swift; sourceTree = "<group>"; }; 04A750CF2D925FD400974E5F /* YHCustomerInformationQuestionnaireVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCustomerInformationQuestionnaireVC.swift; sourceTree = "<group>"; };
04A750D12D93ABCE00974E5F /* YHSurveyTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSurveyTableViewCell.swift; sourceTree = "<group>"; }; 04A750D12D93ABCE00974E5F /* YHSurveyTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSurveyTableViewCell.swift; sourceTree = "<group>"; };
04A750D32D93DFED00974E5F /* YHSurveyQuestionType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSurveyQuestionType.swift; sourceTree = "<group>"; }; 04A750D32D93DFED00974E5F /* YHSurveyQuestionType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSurveyQuestionType.swift; sourceTree = "<group>"; };
...@@ -6203,7 +6208,9 @@ ...@@ -6203,7 +6208,9 @@
045C0F4C2D12CA5E00BD2DC0 /* Font */ = { 045C0F4C2D12CA5E00BD2DC0 /* Font */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
0497C7582DA4CFEF00A3E32A /* D-DIN-PRO-500-Medium.otf */,
045C0F492D12CA5E00BD2DC0 /* AlibabaPuHuiTi-Bold.ttf */, 045C0F492D12CA5E00BD2DC0 /* AlibabaPuHuiTi-Bold.ttf */,
0497C75A2DA4CFFA00A3E32A /* D-DIN-PRO-700-Bold.otf */,
045C0F4A2D12CA5E00BD2DC0 /* AlimamaShuHeiTi-Bold.ttf */, 045C0F4A2D12CA5E00BD2DC0 /* AlimamaShuHeiTi-Bold.ttf */,
045C0F4B2D12CA5E00BD2DC0 /* DIN Alternate Bold.ttf */, 045C0F4B2D12CA5E00BD2DC0 /* DIN Alternate Bold.ttf */,
); );
...@@ -6861,6 +6868,7 @@ ...@@ -6861,6 +6868,7 @@
A5573EC52B317BFF00D98EC0 = { A5573EC52B317BFF00D98EC0 = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
0497C75C2DA4EE0600A3E32A /* D-DIN-PRO-500-Medium.otf */,
04FA8B2D2C084C7E00ABE43F /* ATAuthSDK.bundle */, 04FA8B2D2C084C7E00ABE43F /* ATAuthSDK.bundle */,
045C0F7E2D12CA5E00BD2DC0 /* galaxy */, 045C0F7E2D12CA5E00BD2DC0 /* galaxy */,
A5573EE72B317C0100D98EC0 /* galaxyTests */, A5573EE72B317C0100D98EC0 /* galaxyTests */,
...@@ -7011,10 +7019,12 @@ ...@@ -7011,10 +7019,12 @@
isa = PBXResourcesBuildPhase; isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
0497C7592DA4CFF000A3E32A /* D-DIN-PRO-500-Medium.otf in Resources */,
04AE201A2D12D10200891D24 /* ATAuthSDK.bundle in Resources */, 04AE201A2D12D10200891D24 /* ATAuthSDK.bundle in Resources */,
045C0F7F2D12CA5F00BD2DC0 /* submit_page_scroll.gif in Resources */, 045C0F7F2D12CA5F00BD2DC0 /* submit_page_scroll.gif in Resources */,
045C0F802D12CA5F00BD2DC0 /* Localizable.xcstrings in Resources */, 045C0F802D12CA5F00BD2DC0 /* Localizable.xcstrings in Resources */,
045C0F812D12CA5F00BD2DC0 /* img_0.png in Resources */, 045C0F812D12CA5F00BD2DC0 /* img_0.png in Resources */,
0497C75B2DA4CFFA00A3E32A /* D-DIN-PRO-700-Bold.otf in Resources */,
045C0F822D12CA5F00BD2DC0 /* people_launch.json in Resources */, 045C0F822D12CA5F00BD2DC0 /* people_launch.json in Resources */,
045C0F832D12CA5F00BD2DC0 /* loginBkg.mov in Resources */, 045C0F832D12CA5F00BD2DC0 /* loginBkg.mov in Resources */,
045C0F842D12CA5F00BD2DC0 /* live.json in Resources */, 045C0F842D12CA5F00BD2DC0 /* live.json in Resources */,
......
...@@ -87,8 +87,10 @@ class YHMakePlanViewController: YHBaseViewController { ...@@ -87,8 +87,10 @@ class YHMakePlanViewController: YHBaseViewController {
func updataPrice() { func updataPrice() {
let totalPrice = viewModel.makePlanModel.calculateTotalPrice() let totalPrice = viewModel.makePlanModel.calculateTotalPrice()
priceView.configure(price: totalPrice, actionText: "去办理") { priceView.configure(price: totalPrice, actionText: "去办理") {
YHMakePlanPriceAlertView.show(dataSource: self.viewModel.makePlanModel) { _ in if totalPrice.double() ?? 0 > 0 {
self.addShopCard() YHMakePlanPriceAlertView.show(dataSource: self.viewModel.makePlanModel) { _ in
self.addShopCard()
}
} }
} nextHandler: { } nextHandler: {
self.addShopCard() self.addShopCard()
......
...@@ -41,8 +41,8 @@ class YHMakePlanBottomView: UIView { ...@@ -41,8 +41,8 @@ class YHMakePlanBottomView: UIView {
var price: String = "" { var price: String = "" {
didSet { didSet {
let a: ASAttributedString = .init("¥", .font(UIFont.PFSC_M(ofSize: 20)), .foreground(UIColor.mainTextColor)) let a: ASAttributedString = .init("¥", .font(UIFont(name: "D-DIN-PRO-Bold", size: 20) ?? UIFont()), .foreground(UIColor.mainTextColor))
let b: ASAttributedString = .init("\(price)", .font(UIFont.PFSC_M(ofSize: 28)), .foreground(UIColor.mainTextColor)) let b: ASAttributedString = .init("\(price.formattedPrice())", .font(UIFont(name: "D-DIN-PRO-Bold", size: 28) ?? UIFont()), .foreground(UIColor.mainTextColor))
priceLabel.attributed.text = a + b priceLabel.attributed.text = a + b
} }
} }
...@@ -90,6 +90,8 @@ class YHMakePlanBottomView: UIView { ...@@ -90,6 +90,8 @@ class YHMakePlanBottomView: UIView {
make.width.equalTo(120) make.width.equalTo(120)
make.height.equalTo(46) make.height.equalTo(46)
} }
priceButton.YH_clickEdgeInsets = UIEdgeInsets(top: 10, left: 100, bottom: 10, right: 10)
} }
// MARK: - Action // MARK: - Action
......
...@@ -15,7 +15,7 @@ class YHMakePlanCardView: UIView { ...@@ -15,7 +15,7 @@ class YHMakePlanCardView: UIView {
// MARK: - UI Elements // MARK: - UI Elements
var data: YHMakePlanMainModel? var data: YHMakePlanMainModel?
private lazy var containerView: UIButton = { lazy var containerView: UIButton = {
let view = UIButton() let view = UIButton()
view.backgroundColor = .white view.backgroundColor = .white
view.addTarget(self, action: #selector(gotoDetail), for: .touchUpInside) view.addTarget(self, action: #selector(gotoDetail), for: .touchUpInside)
...@@ -45,7 +45,7 @@ class YHMakePlanCardView: UIView { ...@@ -45,7 +45,7 @@ class YHMakePlanCardView: UIView {
}() }()
private lazy var storeButton: YHImageTextButton = { private lazy var storeButton: YHImageTextButton = {
let button = YHImageTextButton(title: "星企航(7年)", image: UIImage(named: "make_plan_down")) let button = YHImageTextButton(title: "星企航(7年)", image: UIImage(named: "make_plan_left"))
button.layer.cornerRadius = 2 button.layer.cornerRadius = 2
button.backgroundColor = UIColor(hex: 0xf5f6f8) button.backgroundColor = UIColor(hex: 0xf5f6f8)
button.addTarget(self, action: #selector(selectAction), for: .touchUpInside) button.addTarget(self, action: #selector(selectAction), for: .touchUpInside)
...@@ -54,8 +54,8 @@ class YHMakePlanCardView: UIView { ...@@ -54,8 +54,8 @@ class YHMakePlanCardView: UIView {
private lazy var priceTagView: UILabel = { private lazy var priceTagView: UILabel = {
let label = UILabel() let label = UILabel()
let a: ASAttributedString = .init("¥", .font(UIFont.PFSC_M(ofSize: 14)), .foreground(UIColor.mainTextColor)) let a: ASAttributedString = .init("¥", .font(UIFont(name: "D-DIN-PRO-Bold", size: 14) ?? UIFont()), .foreground(UIColor.mainTextColor))
let b: ASAttributedString = .init("58999.00", .font(UIFont.PFSC_M(ofSize: 20)), .foreground(UIColor.mainTextColor)) let b: ASAttributedString = .init("58999.00", .font(UIFont(name: "D-DIN-PRO-Bold", size: 20) ?? UIFont()), .foreground(UIColor.mainTextColor))
label.attributed.text = a + b label.attributed.text = a + b
return label return label
}() }()
...@@ -152,8 +152,10 @@ class YHMakePlanCardView: UIView { ...@@ -152,8 +152,10 @@ class YHMakePlanCardView: UIView {
index = i index = i
} }
} }
let subModel = data?.sub_product[index] if count > 0 {
id = subModel?.product_id ?? 0 let subModel = data?.sub_product[index]
id = subModel?.product_id ?? 0
}
} }
var url = YHBaseUrlManager.shared.curH5URL() + "superAppBridge.html#/goods/sales-detail" + "?id=\(id)" + "&source=renewal_customize&hidelive=1" var url = YHBaseUrlManager.shared.curH5URL() + "superAppBridge.html#/goods/sales-detail" + "?id=\(id)" + "&source=renewal_customize&hidelive=1"
...@@ -209,8 +211,10 @@ class YHMakePlanCardView: UIView { ...@@ -209,8 +211,10 @@ class YHMakePlanCardView: UIView {
index = i index = i
} }
} }
let subModel = data?.sub_product[index] if count > 0 {
product = subModel?.product_id ?? 0 let subModel = data?.sub_product[index]
product = subModel?.product_id ?? 0
}
} }
self.actionHandler?(product) self.actionHandler?(product)
} }
...@@ -220,7 +224,7 @@ class YHMakePlanCardView: UIView { ...@@ -220,7 +224,7 @@ class YHMakePlanCardView: UIView {
self.data = data self.data = data
titleLabel.text = data.product_name titleLabel.text = data.product_name
subtitleLabel.text = data.product_desc subtitleLabel.text = data.product_desc
priceTagView.text = data.price var price = data.price
if data.price == "" { if data.price == "" {
storeButton.isHidden = false storeButton.isHidden = false
let count = self.data?.sub_product.count ?? 0 let count = self.data?.sub_product.count ?? 0
...@@ -231,12 +235,19 @@ class YHMakePlanCardView: UIView { ...@@ -231,12 +235,19 @@ class YHMakePlanCardView: UIView {
index = i index = i
} }
} }
let subModel = data.sub_product[index] if count > 0 {
priceTagView.text = subModel.price let subModel = data.sub_product[index]
storeButton.setTitle(subModel.product_name, for: .normal) price = subModel.price
storeButton.setTitle(subModel.product_name, for: .normal)
}
} else { } else {
storeButton.isHidden = true storeButton.isHidden = true
} }
let a: ASAttributedString = .init("¥", .font(UIFont(name: "D-DIN-PRO-Bold", size: 14) ?? UIFont()), .foreground(UIColor.mainTextColor))
let b: ASAttributedString = .init("\(price.formattedPrice())", .font(UIFont(name: "D-DIN-PRO-Bold", size: 20) ?? UIFont()), .foreground(UIColor.mainTextColor))
priceTagView.attributed.text = a + b
if let url = URL(string: data.cover_img) { if let url = URL(string: data.cover_img) {
companyImageView.kf.setImage(with: url, placeholder: UIImage(named: "global_default_image")) companyImageView.kf.setImage(with: url, placeholder: UIImage(named: "global_default_image"))
} }
...@@ -253,7 +264,9 @@ class YHMakePlanCardView: UIView { ...@@ -253,7 +264,9 @@ class YHMakePlanCardView: UIView {
func configureSub(with data: YHMakePlanSubModel) { func configureSub(with data: YHMakePlanSubModel) {
titleLabel.text = data.product_name titleLabel.text = data.product_name
subtitleLabel.text = data.product_desc subtitleLabel.text = data.product_desc
priceTagView.text = \(data.price)" let a: ASAttributedString = .init("¥", .font(UIFont(name: "D-DIN-PRO-Bold", size: 14) ?? UIFont()), .foreground(UIColor.mainTextColor))
let b: ASAttributedString = .init("\(data.price.formattedPrice())", .font(UIFont(name: "D-DIN-PRO-Bold", size: 20) ?? UIFont()), .foreground(UIColor.mainTextColor))
priceTagView.attributed.text = a + b
selectButton.isHidden = true selectButton.isHidden = true
storeButton.isHidden = true storeButton.isHidden = true
if let url = URL(string: data.cover_img) { if let url = URL(string: data.cover_img) {
...@@ -335,3 +348,21 @@ class YHImageTextButton: UIButton { ...@@ -335,3 +348,21 @@ class YHImageTextButton: UIButton {
setNeedsLayout() setNeedsLayout()
} }
} }
extension String {
func formattedPrice() -> String {
// 检查是否包含小数点
guard let number = Double(self) else { return self }
// 2. 检查小数点后两位是否为 0
let isInteger = (number * 100).truncatingRemainder(dividingBy: 100) == 0
// 3. 使用 NumberFormatter 控制显示格式
let formatter = NumberFormatter()
formatter.numberStyle = .decimal
formatter.minimumFractionDigits = isInteger ? 0 : 2 // 整数部分不显示小数,否则保留 2 位
formatter.maximumFractionDigits = 2
return formatter.string(from: NSNumber(value: number)) ?? self
}
}
...@@ -38,6 +38,7 @@ class YHMakePlanCell: UITableViewCell { ...@@ -38,6 +38,7 @@ class YHMakePlanCell: UITableViewCell {
let view = UIView() let view = UIView()
view.backgroundColor = .white view.backgroundColor = .white
view.layer.cornerRadius = kCornerRadius6 view.layer.cornerRadius = kCornerRadius6
view.layer.masksToBounds = true
return view return view
}() }()
contentView.addSubview(centerView) contentView.addSubview(centerView)
......
...@@ -50,7 +50,11 @@ class YHMakePlanCusttomHeadView: UIView { ...@@ -50,7 +50,11 @@ class YHMakePlanCusttomHeadView: UIView {
tabs.enumerated().forEach { index, title in tabs.enumerated().forEach { index, title in
let button = UIButton(type: .system) let button = UIButton(type: .system)
button.setTitle(title, for: .normal) button.setTitle(title, for: .normal)
button.titleLabel?.font = UIFont.systemFont(ofSize: 14) if index == 0 {
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 16)
} else {
button.titleLabel?.font = UIFont.PFSC_R(ofSize: 16)
}
button.setTitleColor(index == 0 ? UIColor.mainTextColor: UIColor(hex: 0x6a7586), for: .normal) button.setTitleColor(index == 0 ? UIColor.mainTextColor: UIColor(hex: 0x6a7586), for: .normal)
button.tag = index button.tag = index
button.addTarget(self, action: #selector(tabTapped(_:)), for: .touchUpInside) button.addTarget(self, action: #selector(tabTapped(_:)), for: .touchUpInside)
...@@ -84,6 +88,8 @@ class YHMakePlanCusttomHeadView: UIView { ...@@ -84,6 +88,8 @@ class YHMakePlanCusttomHeadView: UIView {
// Update colors // Update colors
buttons[selectedIndex].setTitleColor(UIColor(hex: 0x6a7586), for: .normal) buttons[selectedIndex].setTitleColor(UIColor(hex: 0x6a7586), for: .normal)
buttons[selectedIndex].titleLabel?.font = UIFont.PFSC_R(ofSize: 16)
buttons[newIndex].titleLabel?.font = UIFont.PFSC_M(ofSize: 16)
buttons[newIndex].setTitleColor(UIColor.mainTextColor, for: .normal) buttons[newIndex].setTitleColor(UIColor.mainTextColor, for: .normal)
// Animate underline // Animate underline
...@@ -107,6 +113,8 @@ class YHMakePlanCusttomHeadView: UIView { ...@@ -107,6 +113,8 @@ class YHMakePlanCusttomHeadView: UIView {
// Update colors // Update colors
buttons[selectedIndex].setTitleColor(UIColor(hex: 0x6a7586), for: .normal) buttons[selectedIndex].setTitleColor(UIColor(hex: 0x6a7586), for: .normal)
buttons[selectedIndex].titleLabel?.font = UIFont.PFSC_R(ofSize: 16)
buttons[newIndex].titleLabel?.font = UIFont.PFSC_M(ofSize: 16)
buttons[newIndex].setTitleColor(UIColor.mainTextColor, for: .normal) buttons[newIndex].setTitleColor(UIColor.mainTextColor, for: .normal)
// Animate underline // Animate underline
......
...@@ -33,6 +33,7 @@ class YHMakePlanHeadView: UIView { ...@@ -33,6 +33,7 @@ class YHMakePlanHeadView: UIView {
lazy var custtomView: YHMakePlanCusttomHeadView = { lazy var custtomView: YHMakePlanCusttomHeadView = {
let view = YHMakePlanCusttomHeadView() let view = YHMakePlanCusttomHeadView()
view.backgroundColor = .clear
view.block = { tag in view.block = { tag in
self.block?(tag) self.block?(tag)
} }
......
...@@ -75,7 +75,7 @@ class YHMakePlanPriceAlertView: UIView { ...@@ -75,7 +75,7 @@ class YHMakePlanPriceAlertView: UIView {
centerView = { centerView = {
let view = UIView() let view = UIView()
view.backgroundColor = .white view.backgroundColor = .white
view.layer.cornerRadius = kCornerRadius3 view.layer.cornerRadius = kCornerRadius6
return view return view
}() }()
addSubview(centerView) addSubview(centerView)
...@@ -205,10 +205,33 @@ extension YHMakePlanPriceAlertView: UITableViewDelegate, UITableViewDataSource { ...@@ -205,10 +205,33 @@ extension YHMakePlanPriceAlertView: UITableViewDelegate, UITableViewDataSource {
data = dataSource.invest data = dataSource.invest
} }
cell.dataSource = data cell.dataSource = data
let filteredModel = data.filteredByCartStatus()
if filteredModel.count == 0 {
cell.isHidden = true
} else {
cell.isHidden = false
}
if indexPath.row == 3 {
cell.lineView.isHidden = true
}
return cell return cell
} }
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
var data: [YHMakePlanMainModel] = []
if indexPath.row == 0 {
data = dataSource.basic
} else if indexPath.row == 1 {
data = dataSource.work
} else if indexPath.row == 2 {
data = dataSource.live
} else if indexPath.row == 3 {
data = dataSource.invest
}
let filteredModel = data.filteredByCartStatus()
if filteredModel.count == 0 {
return 0
}
return UITableView.automaticDimension return UITableView.automaticDimension
} }
...@@ -242,6 +265,7 @@ class YHMakePlanLabelCell: UITableViewCell { ...@@ -242,6 +265,7 @@ class YHMakePlanLabelCell: UITableViewCell {
var titleLabel: UILabel! var titleLabel: UILabel!
var mainItemView: UIView! var mainItemView: UIView!
var country: String = "" var country: String = ""
var lineView: UIView!
var dataSource: [YHMakePlanMainModel]? { var dataSource: [YHMakePlanMainModel]? {
didSet { didSet {
updateAllViews() updateAllViews()
...@@ -278,7 +302,7 @@ class YHMakePlanLabelCell: UITableViewCell { ...@@ -278,7 +302,7 @@ class YHMakePlanLabelCell: UITableViewCell {
titleLabel = { titleLabel = {
let label = UILabel() let label = UILabel()
label.font = UIFont.PFSC_M(ofSize: 14) label.font = UIFont.PFSC_R(ofSize: 14)
label.textColor = UIColor(hex: 0x8993a2) label.textColor = UIColor(hex: 0x8993a2)
label.text = "价格明细" label.text = "价格明细"
return label return label
...@@ -305,7 +329,7 @@ class YHMakePlanLabelCell: UITableViewCell { ...@@ -305,7 +329,7 @@ class YHMakePlanLabelCell: UITableViewCell {
make.right.equalTo(-18) make.right.equalTo(-18)
} }
let lineView = { lineView = {
let view = UIView() let view = UIView()
view.backgroundColor = UIColor.separatorColor view.backgroundColor = UIColor.separatorColor
return view return view
...@@ -339,7 +363,7 @@ class YHMakePlanLabelCell: UITableViewCell { ...@@ -339,7 +363,7 @@ class YHMakePlanLabelCell: UITableViewCell {
valueLabel.font = UIFont.PFSC_M(ofSize: 14) valueLabel.font = UIFont.PFSC_M(ofSize: 14)
valueLabel.textColor = UIColor.mainTextColor valueLabel.textColor = UIColor.mainTextColor
valueLabel.textAlignment = .right valueLabel.textAlignment = .right
valueLabel.text = "¥" + price valueLabel.text = "¥" + price.formattedPrice()
mainItemView.addSubview(valueLabel) mainItemView.addSubview(valueLabel)
titleLabel.snp.makeConstraints { make in titleLabel.snp.makeConstraints { make in
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
// //
import UIKit import UIKit
import AttributedString
class YHMakePlanSelectAlertView: UIView { class YHMakePlanSelectAlertView: UIView {
typealias Block = (Int) -> Void typealias Block = (Int) -> Void
...@@ -35,10 +36,12 @@ class YHMakePlanSelectAlertView: UIView { ...@@ -35,10 +36,12 @@ class YHMakePlanSelectAlertView: UIView {
tableView.separatorStyle = .none tableView.separatorStyle = .none
tableView.delegate = self tableView.delegate = self
tableView.dataSource = self tableView.dataSource = self
let view = UIView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: 44)) let view = UIView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: 20))
let label = UILabel() let label = UILabel()
label.text = "产品类型" label.text = "产品类型"
label.frame = CGRect(x: 20, y: 24, width: KScreenWidth, height: 20) label.textColor = UIColor(hex: 0x8993a2)
label.font = UIFont.PFSC_M(ofSize: 15)
label.frame = CGRect(x: 20, y: 0, width: KScreenWidth, height: 20)
view.addSubview(label) view.addSubview(label)
tableView.tableHeaderView = view tableView.tableHeaderView = view
tableView.register(cellWithClass: YHMakePlanCardCell.self) tableView.register(cellWithClass: YHMakePlanCardCell.self)
...@@ -140,7 +143,7 @@ class YHMakePlanSelectAlertView: UIView { ...@@ -140,7 +143,7 @@ class YHMakePlanSelectAlertView: UIView {
hasSelectLabel = { hasSelectLabel = {
let label = UILabel() let label = UILabel()
label.font = UIFont.PFSC_M(ofSize: 15) label.font = UIFont.PFSC_M(ofSize: 15)
label.textColor = UIColor.mainTextColor label.textColor = UIColor(hex: 0x8993a2)
label.text = "已选产品" label.text = "已选产品"
return label return label
}() }()
...@@ -154,12 +157,13 @@ class YHMakePlanSelectAlertView: UIView { ...@@ -154,12 +157,13 @@ class YHMakePlanSelectAlertView: UIView {
cardView = { cardView = {
let label = YHMakePlanCardView() let label = YHMakePlanCardView()
label.containerView.backgroundColor = .clear
return label return label
}() }()
centerView.addSubview(cardView) centerView.addSubview(cardView)
cardView.snp.makeConstraints { make in cardView.snp.makeConstraints { make in
make.left.right.equalToSuperview() make.left.right.equalToSuperview()
make.top.equalTo(92) make.bottom.equalTo(bottomLineView.snp.top).offset(-6.5)
make.height.equalTo(121) make.height.equalTo(121)
} }
...@@ -183,7 +187,7 @@ class YHMakePlanSelectAlertView: UIView { ...@@ -183,7 +187,7 @@ class YHMakePlanSelectAlertView: UIView {
centerView.addSubview(tableView) centerView.addSubview(tableView)
tableView.snp.makeConstraints { make in tableView.snp.makeConstraints { make in
make.left.right.equalToSuperview() make.left.right.equalToSuperview()
make.top.equalTo(215) make.top.equalTo(bottomLineView.snp.bottom).offset(24)
make.bottom.equalTo(-96) make.bottom.equalTo(-96)
} }
} }
...@@ -195,7 +199,9 @@ class YHMakePlanSelectAlertView: UIView { ...@@ -195,7 +199,9 @@ class YHMakePlanSelectAlertView: UIView {
selectIndex = i selectIndex = i
} }
} }
cardView.configureSub(with: data.sub_product[selectIndex]) if data.sub_product.count > 0 {
cardView.configureSub(with: data.sub_product[selectIndex])
}
tableView.reloadData() tableView.reloadData()
} }
...@@ -300,7 +306,7 @@ class YHMakePlanCardCell: UITableViewCell { ...@@ -300,7 +306,7 @@ class YHMakePlanCardCell: UITableViewCell {
private let titleLabel: UILabel = { private let titleLabel: UILabel = {
let label = UILabel() let label = UILabel()
label.text = "星企航6年服务" label.text = "星企航6年服务"
label.font = UIFont.PFSC_R(ofSize: 14) label.font = UIFont.PFSC_M(ofSize: 14)
label.textColor = .mainTextColor label.textColor = .mainTextColor
return label return label
}() }()
...@@ -365,11 +371,13 @@ class YHMakePlanCardCell: UITableViewCell { ...@@ -365,11 +371,13 @@ class YHMakePlanCardCell: UITableViewCell {
// MARK: - Configuration // MARK: - Configuration
func configure(with service: YHMakePlanSubModel) { func configure(with service: YHMakePlanSubModel) {
titleLabel.text = service.product_name titleLabel.text = service.product_name
priceLabel.text = service.price priceLabel.text = "¥" + service.price.formattedPrice()
if service.is_add_cart { if service.is_add_cart {
containerView.layer.borderWidth = 1 containerView.layer.borderWidth = 1
containerView.layer.borderColor = UIColor.mainTextColor.cgColor
} else { } else {
containerView.layer.borderWidth = 0 containerView.layer.borderWidth = 1
containerView.layer.borderColor = UIColor(hex: 0xe9ecf0).cgColor
} }
if let url = URL(string: service.cover_img) { if let url = URL(string: service.cover_img) {
bgImageView.kf.setImage(with: url, placeholder: UIImage(named: "global_default_image")) bgImageView.kf.setImage(with: url, placeholder: UIImage(named: "global_default_image"))
......
...@@ -42,7 +42,7 @@ class YHMakePlanShareAlertView: UIView { ...@@ -42,7 +42,7 @@ class YHMakePlanShareAlertView: UIView {
centerView = { centerView = {
let view = UIView() let view = UIView()
view.backgroundColor = .white view.backgroundColor = .white
view.layer.cornerRadius = kCornerRadius3 view.layer.cornerRadius = kCornerRadius6
return view return view
}() }()
addSubview(centerView) addSubview(centerView)
...@@ -71,6 +71,7 @@ class YHMakePlanShareAlertView: UIView { ...@@ -71,6 +71,7 @@ class YHMakePlanShareAlertView: UIView {
leftButton = { leftButton = {
let button = YHShareButton() let button = YHShareButton()
button.setContent("invitation_with_gifts_share_center", "微信好友") button.setContent("invitation_with_gifts_share_center", "微信好友")
button.bottomTitleLabel.font = UIFont.PFSC_R(ofSize: 13)
button.addTarget(self, action: #selector(peopleClick), for: .touchUpInside) button.addTarget(self, action: #selector(peopleClick), for: .touchUpInside)
return button return button
}() }()
...@@ -85,6 +86,7 @@ class YHMakePlanShareAlertView: UIView { ...@@ -85,6 +86,7 @@ class YHMakePlanShareAlertView: UIView {
rightButton = { rightButton = {
let button = YHShareButton() let button = YHShareButton()
button.setContent("invitation_with_gifts_share_link", "复制链接") button.setContent("invitation_with_gifts_share_link", "复制链接")
button.bottomTitleLabel.font = UIFont.PFSC_R(ofSize: 13)
button.addTarget(self, action: #selector(wxClick), for: .touchUpInside) button.addTarget(self, action: #selector(wxClick), for: .touchUpInside)
return button return button
}() }()
...@@ -100,6 +102,7 @@ class YHMakePlanShareAlertView: UIView { ...@@ -100,6 +102,7 @@ class YHMakePlanShareAlertView: UIView {
@objc func wxClick() { @objc func wxClick() {
if let url = URL(string: url) { if let url = URL(string: url) {
UIPasteboard.general.url = url UIPasteboard.general.url = url
YHHUD.flash(message: "复制成功")
} }
} }
......
...@@ -20,7 +20,7 @@ class YHMakePlanStateHeadView: UIView { ...@@ -20,7 +20,7 @@ class YHMakePlanStateHeadView: UIView {
private let yearsLabel: UILabel = { private let yearsLabel: UILabel = {
let label = UILabel() let label = UILabel()
label.text = "5" label.text = "5"
label.font = UIFont.PFSC_M(ofSize: 32) label.font = UIFont(name: "D-DIN-PRO-Bold", size: 32)
label.textColor = .mainTextColor label.textColor = .mainTextColor
label.textAlignment = .center label.textAlignment = .center
return label return label
...@@ -29,7 +29,7 @@ class YHMakePlanStateHeadView: UIView { ...@@ -29,7 +29,7 @@ class YHMakePlanStateHeadView: UIView {
private let yearsDescriptionLabel: UILabel = { private let yearsDescriptionLabel: UILabel = {
let label = UILabel() let label = UILabel()
label.text = "预计可续期(年)" label.text = "预计可续期(年)"
label.font = UIFont.PFSC_M(ofSize: 14) label.font = UIFont.PFSC_R(ofSize: 14)
label.textColor = UIColor(hex: 0x8893a2) label.textColor = UIColor(hex: 0x8893a2)
label.textAlignment = .center label.textAlignment = .center
return label return label
...@@ -38,7 +38,7 @@ class YHMakePlanStateHeadView: UIView { ...@@ -38,7 +38,7 @@ class YHMakePlanStateHeadView: UIView {
private let percentageLabel: UILabel = { private let percentageLabel: UILabel = {
let label = UILabel() let label = UILabel()
label.text = "90%" label.text = "90%"
label.font = UIFont.PFSC_M(ofSize: 32) label.font = UIFont(name: "D-DIN-PRO-Bold", size: 32)
label.textColor = .mainTextColor label.textColor = .mainTextColor
label.textAlignment = .center label.textAlignment = .center
return label return label
...@@ -47,7 +47,7 @@ class YHMakePlanStateHeadView: UIView { ...@@ -47,7 +47,7 @@ class YHMakePlanStateHeadView: UIView {
private let progressDescriptionLabel: UILabel = { private let progressDescriptionLabel: UILabel = {
let label = UILabel() let label = UILabel()
label.text = "续签综合通过率" label.text = "续签综合通过率"
label.font = UIFont.PFSC_M(ofSize: 14) label.font = UIFont.PFSC_R(ofSize: 14)
label.textColor = UIColor(hex: 0x8893a2) label.textColor = UIColor(hex: 0x8893a2)
label.textAlignment = .center label.textAlignment = .center
return label return label
......
...@@ -16,10 +16,10 @@ class YHMakePlanTopView: UIView { ...@@ -16,10 +16,10 @@ class YHMakePlanTopView: UIView {
didSet { didSet {
let year = dataSource?.year ?? 0 let year = dataSource?.year ?? 0
let rate = dataSource?.pass_rate ?? "" let rate = dataSource?.pass_rate ?? ""
let a: ASAttributedString = .init("预计可续期(年) ", .font(UIFont.PFSC_M(ofSize: 14)), .foreground(UIColor(hex: 0x6a7586))) let a: ASAttributedString = .init("预计可续期(年) ", .font(UIFont.PFSC_R(ofSize: 14)), .foreground(UIColor(hex: 0x6a7586)))
let b: ASAttributedString = .init("\(year)", .font(UIFont.PFSC_M(ofSize: 24)), .foreground(UIColor.mainTextColor)) let b: ASAttributedString = .init("\(year)", .font(UIFont.PFSC_M(ofSize: 24)), .foreground(UIColor.mainTextColor))
yearsLabel.attributed.text = a + b yearsLabel.attributed.text = a + b
let aa: ASAttributedString = .init("续签综合通过率 ", .font(UIFont.PFSC_M(ofSize: 14)), .foreground(UIColor(hex: 0x6a7586))) let aa: ASAttributedString = .init("续签综合通过率 ", .font(UIFont.PFSC_R(ofSize: 14)), .foreground(UIColor(hex: 0x6a7586)))
let bb: ASAttributedString = .init("\(rate)", .font(UIFont.PFSC_M(ofSize: 24)), .foreground(UIColor.mainTextColor)) let bb: ASAttributedString = .init("\(rate)", .font(UIFont.PFSC_M(ofSize: 24)), .foreground(UIColor.mainTextColor))
// let c: ASAttributedString = .init("%", .font(UIFont.PFSC_M(ofSize: 16)), .foreground(UIColor.mainTextColor)) // let c: ASAttributedString = .init("%", .font(UIFont.PFSC_M(ofSize: 16)), .foreground(UIColor.mainTextColor))
percentageLabel.attributed.text = aa + bb percentageLabel.attributed.text = aa + bb
...@@ -28,18 +28,11 @@ class YHMakePlanTopView: UIView { ...@@ -28,18 +28,11 @@ class YHMakePlanTopView: UIView {
private let yearsLabel: UILabel = { private let yearsLabel: UILabel = {
let label = UILabel() let label = UILabel()
let a: ASAttributedString = .init("预计可续期(年) ", .font(UIFont.PFSC_M(ofSize: 14)), .foreground(UIColor(hex: 0x6a7586)))
let b: ASAttributedString = .init("5", .font(UIFont.PFSC_M(ofSize: 24)), .foreground(UIColor.mainTextColor))
label.attributed.text = a + b
return label return label
}() }()
private let percentageLabel: UILabel = { private let percentageLabel: UILabel = {
let label = UILabel() let label = UILabel()
let a: ASAttributedString = .init("续签综合通过率 ", .font(UIFont.PFSC_M(ofSize: 14)), .foreground(UIColor(hex: 0x6a7586)))
let b: ASAttributedString = .init("90", .font(UIFont.PFSC_M(ofSize: 24)), .foreground(UIColor.mainTextColor))
let c: ASAttributedString = .init("%", .font(UIFont.PFSC_M(ofSize: 16)), .foreground(UIColor.mainTextColor))
label.attributed.text = a + b + c
return label return label
}() }()
...@@ -75,7 +68,7 @@ class YHMakePlanTopView: UIView { ...@@ -75,7 +68,7 @@ class YHMakePlanTopView: UIView {
bgView.snp.makeConstraints { make in bgView.snp.makeConstraints { make in
make.left.equalTo(18) make.left.equalTo(18)
make.right.equalTo(-35) make.right.equalTo(-18)
make.height.equalTo(42) make.height.equalTo(42)
make.top.equalTo(9) make.top.equalTo(9)
} }
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "make_plan_left@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "make_plan_left@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
...@@ -118,6 +118,8 @@ ...@@ -118,6 +118,8 @@
<string>DIN Alternate Bold</string> <string>DIN Alternate Bold</string>
<string>AlimamaShuHeiTi-Bold.ttf</string> <string>AlimamaShuHeiTi-Bold.ttf</string>
<string>AlibabaPuHuiTi-Bold.ttf</string> <string>AlibabaPuHuiTi-Bold.ttf</string>
<string>D-DIN-PRO-500-Medium.otf</string>
<string>D-DIN-PRO-700-Bold.otf</string>
</array> </array>
<key>UIBackgroundModes</key> <key>UIBackgroundModes</key>
<array> <array>
......
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