Commit 451b2b7f authored by pete谢兆麟's avatar pete谢兆麟

服务中心首页

parent c38b34f0
...@@ -246,6 +246,7 @@ ...@@ -246,6 +246,7 @@
048787D32BCE6B7D0036E221 /* YHServiceOrderAlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 048787D22BCE6B7D0036E221 /* YHServiceOrderAlertView.swift */; }; 048787D32BCE6B7D0036E221 /* YHServiceOrderAlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 048787D22BCE6B7D0036E221 /* YHServiceOrderAlertView.swift */; };
048787D52BCE880B0036E221 /* YHServiceOrderListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 048787D42BCE880B0036E221 /* YHServiceOrderListViewController.swift */; }; 048787D52BCE880B0036E221 /* YHServiceOrderListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 048787D42BCE880B0036E221 /* YHServiceOrderListViewController.swift */; };
048787D72BCE96F50036E221 /* YHServiceOrderProgressTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 048787D62BCE96F50036E221 /* YHServiceOrderProgressTableViewCell.swift */; }; 048787D72BCE96F50036E221 /* YHServiceOrderProgressTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 048787D62BCE96F50036E221 /* YHServiceOrderProgressTableViewCell.swift */; };
048787D92BCF68530036E221 /* YHProgressView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 048787D82BCF68530036E221 /* YHProgressView.swift */; };
048B2A442BC7901900A93BF0 /* YHHomeWebViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 048B2A432BC7901900A93BF0 /* YHHomeWebViewModel.swift */; }; 048B2A442BC7901900A93BF0 /* YHHomeWebViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 048B2A432BC7901900A93BF0 /* YHHomeWebViewModel.swift */; };
048B2A462BC7912400A93BF0 /* YHWebModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 048B2A452BC7912400A93BF0 /* YHWebModel.swift */; }; 048B2A462BC7912400A93BF0 /* YHWebModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 048B2A452BC7912400A93BF0 /* YHWebModel.swift */; };
048B2A482BC7CE4800A93BF0 /* YHFourKingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 048B2A472BC7CE4800A93BF0 /* YHFourKingViewController.swift */; }; 048B2A482BC7CE4800A93BF0 /* YHFourKingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 048B2A472BC7CE4800A93BF0 /* YHFourKingViewController.swift */; };
...@@ -694,6 +695,7 @@ ...@@ -694,6 +695,7 @@
048787D22BCE6B7D0036E221 /* YHServiceOrderAlertView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHServiceOrderAlertView.swift; sourceTree = "<group>"; }; 048787D22BCE6B7D0036E221 /* YHServiceOrderAlertView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHServiceOrderAlertView.swift; sourceTree = "<group>"; };
048787D42BCE880B0036E221 /* YHServiceOrderListViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHServiceOrderListViewController.swift; sourceTree = "<group>"; }; 048787D42BCE880B0036E221 /* YHServiceOrderListViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHServiceOrderListViewController.swift; sourceTree = "<group>"; };
048787D62BCE96F50036E221 /* YHServiceOrderProgressTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHServiceOrderProgressTableViewCell.swift; sourceTree = "<group>"; }; 048787D62BCE96F50036E221 /* YHServiceOrderProgressTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHServiceOrderProgressTableViewCell.swift; sourceTree = "<group>"; };
048787D82BCF68530036E221 /* YHProgressView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHProgressView.swift; sourceTree = "<group>"; };
048B2A432BC7901900A93BF0 /* YHHomeWebViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHHomeWebViewModel.swift; sourceTree = "<group>"; }; 048B2A432BC7901900A93BF0 /* YHHomeWebViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHHomeWebViewModel.swift; sourceTree = "<group>"; };
048B2A452BC7912400A93BF0 /* YHWebModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHWebModel.swift; sourceTree = "<group>"; }; 048B2A452BC7912400A93BF0 /* YHWebModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHWebModel.swift; sourceTree = "<group>"; };
048B2A472BC7CE4800A93BF0 /* YHFourKingViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFourKingViewController.swift; sourceTree = "<group>"; }; 048B2A472BC7CE4800A93BF0 /* YHFourKingViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFourKingViewController.swift; sourceTree = "<group>"; };
...@@ -2136,6 +2138,7 @@ ...@@ -2136,6 +2138,7 @@
049AC4C92BC5141600F857F4 /* YHServerNoOrderView.swift */, 049AC4C92BC5141600F857F4 /* YHServerNoOrderView.swift */,
048787D02BCE61B20036E221 /* YHServiceNoOrderView.swift */, 048787D02BCE61B20036E221 /* YHServiceNoOrderView.swift */,
048787D62BCE96F50036E221 /* YHServiceOrderProgressTableViewCell.swift */, 048787D62BCE96F50036E221 /* YHServiceOrderProgressTableViewCell.swift */,
048787D82BCF68530036E221 /* YHProgressView.swift */,
); );
path = V; path = V;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -2715,6 +2718,7 @@ ...@@ -2715,6 +2718,7 @@
045EEED12B9F171A0022A143 /* YHScorePersonInfoCell.swift in Sources */, 045EEED12B9F171A0022A143 /* YHScorePersonInfoCell.swift in Sources */,
044CF8D42BB6BCF700008CE8 /* YHSignatureUploadTableViewCell.swift in Sources */, 044CF8D42BB6BCF700008CE8 /* YHSignatureUploadTableViewCell.swift in Sources */,
045EEF0D2B9F171A0022A143 /* YHBasicInfoFillCell.swift in Sources */, 045EEF0D2B9F171A0022A143 /* YHBasicInfoFillCell.swift in Sources */,
048787D92BCF68530036E221 /* YHProgressView.swift in Sources */,
048B2A462BC7912400A93BF0 /* YHWebModel.swift in Sources */, 048B2A462BC7912400A93BF0 /* YHWebModel.swift in Sources */,
045EEEEC2B9F171A0022A143 /* YHBrotherInfoVC.swift in Sources */, 045EEEEC2B9F171A0022A143 /* YHBrotherInfoVC.swift in Sources */,
0477E17A2BA41C7E00436346 /* YHCertificateModel.swift in Sources */, 0477E17A2BA41C7E00436346 /* YHCertificateModel.swift in Sources */,
......
...@@ -31,10 +31,10 @@ class YHServiceCenterMainViewController: YHBaseViewController { ...@@ -31,10 +31,10 @@ class YHServiceCenterMainViewController: YHBaseViewController {
return view return view
}() }()
let arrItemTitles = ["全部(6)","进行中(2)", "待开始(4)", "已完成(0)"] var arrItemTitles = ["全部","进行中", "待开始", "已完成"]
var arrItemVCs : [YHServiceOrderListView] = [] var arrItemVCs : [YHServiceOrderListView] = []
var segmentedView : JXSegmentedView = JXSegmentedView(frame: CGRect(x: 0, y: k_Height_safeAreaInsetsTop(), width: KScreenWidth, height: 48)) var segmentedView : JXSegmentedView = JXSegmentedView(frame: CGRect(x: 0, y: k_Height_safeAreaInsetsTop(), width: KScreenWidth, height: 48))
lazy var segmentedDataSource: JXSegmentedBaseDataSource = { lazy var segmentedDataSource: JXSegmentedTitleDataSource = {
let dataSource = JXSegmentedTitleDataSource() let dataSource = JXSegmentedTitleDataSource()
dataSource.isTitleColorGradientEnabled = true dataSource.isTitleColorGradientEnabled = true
dataSource.titles = arrItemTitles dataSource.titles = arrItemTitles
...@@ -130,71 +130,11 @@ extension YHServiceCenterMainViewController { ...@@ -130,71 +130,11 @@ extension YHServiceCenterMainViewController {
override func viewDidLayoutSubviews() { override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews() super.viewDidLayoutSubviews()
segmentedView.frame = CGRect(x: 0, y: k_Height_safeAreaInsetsTop() + 98, width: view.bounds.size.width, height: 48) segmentedView.frame = CGRect(x: 4, y: k_Height_safeAreaInsetsTop() + 98, width: view.bounds.size.width - 8, height: 48)
listContainerView.frame = CGRect(x: 0, y: k_Height_safeAreaInsetsTop() + 48 + 98, width: view.bounds.size.width, height: view.bounds.size.height - 48 - k_Height_safeAreaInsetsTop() - 98 - k_Height_TabBar) listContainerView.frame = CGRect(x: 0, y: k_Height_safeAreaInsetsTop() + 48 + 98, width: view.bounds.size.width, height: view.bounds.size.height - 48 - k_Height_safeAreaInsetsTop() - 98 - k_Height_TabBar)
} }
} }
//// MARK: - UITableViewDelegate 和 UITableViewDataSource
//extension YHServiceCenterMainViewController : UITableViewDelegate,UITableViewDataSource {
// func numberOfSections(in tableView: UITableView) -> Int {
// return self.serviceCenterMainReqVM.arrContactList.count
// }
//
// func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
//
// return 1
// }
//
// func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
// return kMargin
// }
//
// func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
// let view = UIView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: kMargin))
// return view
// }
//
// func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
// return 0
// }
//
// func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
// return UIView()
// }
//
//
// func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
// return 81
// }
//
// func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
// let cell0 = tableView.dequeueReusableCell(withClass: YHContractCell.self)
// cell0.selectionStyle = .none
//
// if indexPath.section < self.serviceCenterMainReqVM.arrContactList.count {
// cell0.dataModel = self.serviceCenterMainReqVM.arrContactList[indexPath.section]
// }
// return cell0
// }
//
// func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
// tableView.deselectRow(at: indexPath, animated: true)
// printLog("点击了 tableView Cell \(indexPath.section)")
//
//
// //获取订单号
// let orderId = serviceCenterMainReqVM.arrContactList[indexPath.section].id
// UserDefaults.standard.set(orderId, forKey: "orderIdForPreview")
// UserDefaults.standard.synchronize()
//
// let vc = YHServiceCenterSecondViewController()
// vc.orderId = orderId
// vc.mobile = serviceCenterMainReqVM.arrContactList[indexPath.section].mobile
// self.navigationController?.pushViewController(vc)
// }
//}
extension YHServiceCenterMainViewController: JXSegmentedViewDelegate { extension YHServiceCenterMainViewController: JXSegmentedViewDelegate {
func segmentedView(_ segmentedView: JXSegmentedView, didSelectedItemAt index: Int) { func segmentedView(_ segmentedView: JXSegmentedView, didSelectedItemAt index: Int) {
// NotificationCenter.default.post(name: Notification.Name(rawValue: "scrollViewDidEndDragging"), object: nil) // NotificationCenter.default.post(name: Notification.Name(rawValue: "scrollViewDidEndDragging"), object: nil)
...@@ -294,6 +234,25 @@ extension YHServiceCenterMainViewController { ...@@ -294,6 +234,25 @@ extension YHServiceCenterMainViewController {
let vc = YHServiceOrderListView() let vc = YHServiceOrderListView()
vc.type = i vc.type = i
vc.orderID = orderId vc.orderID = orderId
vc.loadData()
vc.block = {[weak self] type, count in
guard let self = self else {
return
}
if type == 0 {
arrItemTitles[0] = "全部(\(count))"
} else if type == 1 {
arrItemTitles[1] = "进行中(\(count))"
} else if type == 2 {
arrItemTitles[2] = "待开始(\(count))"
} else if type == 3 {
arrItemTitles[3] = "已完成(\(count))"
}
self.updata()
}
arrItemVCs.append(vc) arrItemVCs.append(vc)
} }
...@@ -319,5 +278,12 @@ extension YHServiceCenterMainViewController { ...@@ -319,5 +278,12 @@ extension YHServiceCenterMainViewController {
segmentedView.backgroundColor = UIColor(red: 0.95, green: 0.95, blue: 0.95, alpha: 1) segmentedView.backgroundColor = UIColor(red: 0.95, green: 0.95, blue: 0.95, alpha: 1)
} }
func updata(){
DispatchQueue.main.async {
self.segmentedDataSource.titles = self.arrItemTitles
self.segmentedView.reloadData()
}
}
} }
...@@ -11,7 +11,8 @@ import JXSegmentedView ...@@ -11,7 +11,8 @@ import JXSegmentedView
class YHServiceOrderListView: YHBaseViewController { class YHServiceOrderListView: YHBaseViewController {
private let viewModel : YHServiceCenterMainViewModel = YHServiceCenterMainViewModel() private let viewModel : YHServiceCenterMainViewModel = YHServiceCenterMainViewModel()
typealias Block = (Int,Int) -> ()
var block: Block?
var orderID: Int = 0 var orderID: Int = 0
var type: Int = 0 var type: Int = 0
var homeTableView: UITableView! var homeTableView: UITableView!
...@@ -19,11 +20,12 @@ class YHServiceOrderListView: YHBaseViewController { ...@@ -19,11 +20,12 @@ class YHServiceOrderListView: YHBaseViewController {
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
setupUI() setupUI()
loadData()
} }
override func viewWillAppear(_ animated: Bool) { override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated) super.viewWillAppear(animated)
loadData() // loadData()
} }
} }
...@@ -31,7 +33,12 @@ extension YHServiceOrderListView { ...@@ -31,7 +33,12 @@ extension YHServiceOrderListView {
func loadData() { func loadData() {
viewModel.getServiceCenterProgressList(orderID, type) {[weak self] success, error in viewModel.getServiceCenterProgressList(orderID, type) {[weak self] success, error in
guard let self = self else { return } guard let self = self else { return }
self.homeTableView.reloadData() if (self.homeTableView != nil) {
self.homeTableView.reloadData()
}
if let block = self.block {
block(type, self.viewModel.arrDataForSeviceCenterProgress.count)
}
} }
} }
...@@ -123,7 +130,7 @@ extension YHServiceOrderListView: JXSegmentedListContainerViewListDelegate { ...@@ -123,7 +130,7 @@ extension YHServiceOrderListView: JXSegmentedListContainerViewListDelegate {
return view return view
} }
func listWillAppear() { // func listWillAppear() {
loadData() // loadData()
} // }
} }
//
// YHProgressView.swift
// galaxy
//
// Created by EDY on 2024/4/17.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHProgressView: UIView {
private let progressLayer = CAShapeLayer()
override init(frame: CGRect) {
super.init(frame: frame)
configure()
}
required init?(coder: NSCoder) {
super.init(coder: coder)
configure()
}
func changeColor(_ color: UIColor) {
progressLayer.strokeColor = color.cgColor // 设置进度条颜色
}
private func configure() {
// 创建底部圆形路径
let center = CGPoint(x: bounds.midX, y: bounds.midY)
let lineWidth: CGFloat = 3 // 圆环路径宽度
let radius = (min(bounds.width, bounds.height) - lineWidth) / 2 // 圆的半径
let startAngle = -CGFloat.pi / 2 // 起始角度
let endAngle = 1.5 * CGFloat.pi // 终点角度
// 创建进度条圆形路径
let progressPath = UIBezierPath(arcCenter: center,
radius: radius,
startAngle: startAngle,
endAngle: endAngle,
clockwise: true)
// 配置进度条CAShapeLayer
progressLayer.path = progressPath.cgPath
progressLayer.strokeColor = UIColor(hex: 0x00BF60).cgColor // 进度条颜色
progressLayer.fillColor = UIColor.clear.cgColor
progressLayer.lineWidth = lineWidth // 进度条宽度
progressLayer.lineCap = .round
// 设置初始进度
progressLayer.strokeEnd = 0
layer.addSublayer(progressLayer)
}
func setProgress(_ progress: Float, animated: Bool) {
let animation = CABasicAnimation(keyPath: "strokeEnd")
animation.fromValue = progressLayer.strokeEnd
animation.toValue = progress
animation.duration = animated ? 1.0 : 0
progressLayer.strokeEnd = CGFloat(progress)
progressLayer.add(animation, forKey: "progressAnimation")
}
}
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
// //
import UIKit import UIKit
import AttributedString
class YHServiceOrderProgressTableViewCell: UITableViewCell { class YHServiceOrderProgressTableViewCell: UITableViewCell {
var titleLabel: UILabel! var titleLabel: UILabel!
...@@ -14,7 +15,7 @@ class YHServiceOrderProgressTableViewCell: UITableViewCell { ...@@ -14,7 +15,7 @@ class YHServiceOrderProgressTableViewCell: UITableViewCell {
var buttonLabel: UILabel! var buttonLabel: UILabel!
var progressImageView: UIImageView! var progressImageView: UIImageView!
var progressLabel: UILabel! var progressLabel: UILabel!
var progress: UIView! var progress: YHProgressView!
var dataModel : YHServiceCenterProgressModel? { var dataModel : YHServiceCenterProgressModel? {
didSet { didSet {
updateUI() updateUI()
...@@ -47,39 +48,133 @@ extension YHServiceOrderProgressTableViewCell { ...@@ -47,39 +48,133 @@ extension YHServiceOrderProgressTableViewCell {
func updateUI() { func updateUI() {
guard let model = dataModel else { return } guard let model = dataModel else { return }
messageLabel.text = "您还有" + "\(model.num)" + "份信息待填写哦~" messageLabel.text = "您还有" + "\(model.num)" + "份信息待填写哦~"
// 1 证件 2 信息完善 3 我的评分 4 我的方案 5 我的签字 6我的文书
if model.type == 1 {
titleLabel.text = "我的证件"
}
if model.type == 2 {
titleLabel.text = "我的信息"
}
if model.type == 3 {
titleLabel.text = "我的评分"
}
if model.type == 4 {
titleLabel.text = "我的方案"
}
if model.type == 5 {
titleLabel.text = "我的签字"
}
if model.type == 6 {
titleLabel.text = "我的文书"
}
// 0未知 1待开始 2进行中 3 已完成 // 0未知 1待开始 2进行中 3 已完成
if model.status == 1 { if model.status == 1 {
titleLabel.textColor = UIColor(hex: 0x121a26)
messageLabel.textColor = UIColor(hex: 0x94a3b8)
buttonLabel.text = "待开始" buttonLabel.text = "待开始"
buttonLabel.backgroundColor = UIColor(hex: 0xb8babe)
progressImageView.image = UIImage(named: "service_progress_normal")
// 1 证件 2 信息完善 3 我的评分 4 我的方案 5 我的签字 6我的文书
if model.type == 1 {
titleLabel.text = "我的证件"
messageLabel.text = "您的证件还没生成哦~"
}
if model.type == 2 {
titleLabel.text = "我的信息"
}
if model.type == 3 {
titleLabel.text = "我的评分"
messageLabel.text = "您的评分报告还没生成哦~"
}
if model.type == 4 {
titleLabel.text = "我的方案"
messageLabel.text = "您的专属方案还没生成哦~"
}
if model.type == 5 {
titleLabel.text = "我的签字"
messageLabel.text = "您的文件还没签字哦~"
}
if model.type == 6 {
titleLabel.text = "我的文书"
messageLabel.text = "您的文书还没确认哦~"
}
let b: ASAttributedString = .init(NSAttributedString(string: "\(model.percentage)"), .font(UIFont.PFSC_M(ofSize: 21)),.foreground(UIColor(hex: 0xb8babe)))
let bb: ASAttributedString = .init("%", .font(UIFont.PFSC_M(ofSize: 10)),.foreground(UIColor(hex: 0x121a26).withAlphaComponent(0.3)))
progressLabel.attributed.text = b + bb
} }
if model.status == 2 { if model.status == 2 {
titleLabel.textColor = UIColor.mainTextColor
buttonLabel.text = "进行中" buttonLabel.text = "进行中"
buttonLabel.backgroundColor = UIColor.brandMainColor
progressImageView.image = UIImage(named: "service_progress_start")
// 1 证件 2 信息完善 3 我的评分 4 我的方案 5 我的签字 6我的文书
if model.type == 1 {
titleLabel.text = "我的证件"
// messageLabel.text = "恭喜您,证件已全部上传完~"
buttonLabel.text = "去上传"
let a: ASAttributedString = .init("您还有", .font(UIFont.PFSC_M(ofSize: 13)),.foreground(UIColor(hex: 0x94a3b8)))
let aa: ASAttributedString = .init(NSAttributedString(string: "\(model.num)份"), .font(UIFont.PFSC_M(ofSize: 13)),.foreground(UIColor.brandMainColor))
let aaa: ASAttributedString = .init("证件待上传哦~", .font(UIFont.PFSC_M(ofSize: 13)),.foreground(UIColor(hex: 0x94a3b8)))
messageLabel.attributed.text = a + aa + aaa
}
if model.type == 2 {
titleLabel.text = "我的信息"
buttonLabel.text = "去填写"
let a: ASAttributedString = .init("您还有", .font(UIFont.PFSC_M(ofSize: 13)),.foreground(UIColor(hex: 0x94a3b8)))
let aa: ASAttributedString = .init(NSAttributedString(string: "\(model.num)份"), .font(UIFont.PFSC_M(ofSize: 13)),.foreground(UIColor.brandMainColor))
let aaa: ASAttributedString = .init("信息待填写哦~", .font(UIFont.PFSC_M(ofSize: 13)),.foreground(UIColor(hex: 0x94a3b8)))
messageLabel.attributed.text = a + aa + aaa
}
if model.type == 3 {
titleLabel.text = "我的评分"
messageLabel.text = "后端出问题会显示"
}
if model.type == 4 {
titleLabel.text = "我的方案"
messageLabel.text = "后端出问题会显示"
}
if model.type == 5 {
titleLabel.text = "我的签字"
buttonLabel.text = "去签字"
let a: ASAttributedString = .init("您还有", .font(UIFont.PFSC_M(ofSize: 13)),.foreground(UIColor(hex: 0x94a3b8)))
let aa: ASAttributedString = .init(NSAttributedString(string: "\(model.num)份"), .font(UIFont.PFSC_M(ofSize: 13)),.foreground(UIColor.brandMainColor))
let aaa: ASAttributedString = .init("文件待签字哦~", .font(UIFont.PFSC_M(ofSize: 13)),.foreground(UIColor(hex: 0x94a3b8)))
messageLabel.attributed.text = a + aa + aaa
}
if model.type == 6 {
titleLabel.text = "我的文书"
buttonLabel.text = "去确认"
let a: ASAttributedString = .init("您还有", .font(UIFont.PFSC_M(ofSize: 13)),.foreground(UIColor(hex: 0x94a3b8)))
let aa: ASAttributedString = .init(NSAttributedString(string: "\(model.num)份"), .font(UIFont.PFSC_M(ofSize: 13)),.foreground(UIColor.brandMainColor))
let aaa: ASAttributedString = .init("文书待确认哦~", .font(UIFont.PFSC_M(ofSize: 13)),.foreground(UIColor(hex: 0x94a3b8)))
messageLabel.attributed.text = a + aa + aaa
}
let b: ASAttributedString = .init(NSAttributedString(string: "\(model.percentage)"), .font(UIFont.PFSC_M(ofSize: 21)),.foreground(UIColor(hex: 0x121a26)))
let bb: ASAttributedString = .init("%", .font(UIFont.PFSC_M(ofSize: 10)),.foreground(UIColor(hex: 0x121a26).withAlphaComponent(0.3)))
progressLabel.attributed.text = b + bb
} }
if model.status == 3 { if model.status == 3 {
buttonLabel.text = "已完成" titleLabel.textColor = UIColor.mainTextColor
messageLabel.textColor = UIColor(hex: 0x94a3b8)
buttonLabel.text = "去查看"
progress.changeColor(UIColor(hex: 0x55cba0))
buttonLabel.backgroundColor = UIColor(hex: 0x55cba0)
progressImageView.image = UIImage(named: "service_progress_end")
// 1 证件 2 信息完善 3 我的评分 4 我的方案 5 我的签字 6我的文书
if model.type == 1 {
titleLabel.text = "我的证件"
messageLabel.text = "恭喜您,证件已全部上传完~"
}
if model.type == 2 {
titleLabel.text = "我的信息"
messageLabel.text = "恭喜您,信息已全部填写完~"
}
if model.type == 3 {
titleLabel.text = "我的评分"
messageLabel.text = "恭喜您,评分报告已生成~"
}
if model.type == 4 {
titleLabel.text = "我的方案"
messageLabel.text = "恭喜您,专属方案已生成~"
}
if model.type == 5 {
titleLabel.text = "我的签字"
messageLabel.text = "恭喜您,文件已全部签字完~"
}
if model.type == 6 {
titleLabel.text = "我的文书"
messageLabel.text = "恭喜您,文件已全部确认完~"
}
let b: ASAttributedString = .init(NSAttributedString(string: "\(model.percentage)"), .font(UIFont.PFSC_M(ofSize: 21)),.foreground(UIColor(hex: 0x121a26)))
let bb: ASAttributedString = .init("%", .font(UIFont.PFSC_M(ofSize: 10)),.foreground(UIColor(hex: 0x121a26).withAlphaComponent(0.3)))
progressLabel.attributed.text = b + bb
}
if model.percentage == 0 {
progress.setProgress(0, animated: false)
} else {
progress.setProgress(Float(CGFloat(model.percentage))/100.0, animated: false)
} }
progressLabel.text = "\(model.percentage)"
// contractNameLable.text = dataModel?.productName ?? "-" + " - " + (dataModel?.username ?? "-")
// let str = "合同编号:" + (dataModel?.orderSn ?? "-")
// contractIdLable.text = str
} }
func setupUI() { func setupUI() {
...@@ -130,6 +225,8 @@ extension YHServiceOrderProgressTableViewCell { ...@@ -130,6 +225,8 @@ extension YHServiceOrderProgressTableViewCell {
label.textColor = .white label.textColor = .white
label.backgroundColor = UIColor.brandMainColor label.backgroundColor = UIColor.brandMainColor
label.layer.cornerRadius = kCornerRadius4 label.layer.cornerRadius = kCornerRadius4
label.masksToBounds = true
label.textAlignment = .center
return label return label
}() }()
holdView.addSubview(buttonLabel) holdView.addSubview(buttonLabel)
...@@ -154,6 +251,7 @@ extension YHServiceOrderProgressTableViewCell { ...@@ -154,6 +251,7 @@ extension YHServiceOrderProgressTableViewCell {
progressLabel = { progressLabel = {
let label = UILabel() let label = UILabel()
label.textAlignment = .center
// label.font = UIFont.PFSC_M(ofSize: 13) // label.font = UIFont.PFSC_M(ofSize: 13)
// label.textColor = UIColor.mainTextColor // label.textColor = UIColor.mainTextColor
return label return label
...@@ -161,8 +259,20 @@ extension YHServiceOrderProgressTableViewCell { ...@@ -161,8 +259,20 @@ extension YHServiceOrderProgressTableViewCell {
holdView.addSubview(progressLabel) holdView.addSubview(progressLabel)
progressLabel.snp.makeConstraints { make in progressLabel.snp.makeConstraints { make in
make.center.equalTo(progressImageView.snp.center) make.center.equalTo(progressImageView.snp.center)
make.width.equalTo(36) make.width.equalTo(60)
make.height.equalTo(29) make.height.equalTo(29)
} }
progress = {
let view = YHProgressView(frame: CGRect(x: 0, y: 0, width: 80, height: 80))
return view
}()
holdView.addSubview(progress)
progress.snp.makeConstraints { make in
make.top.equalTo(24)
make.right.equalTo(-32)
make.height.equalTo(80)
make.width.equalTo(80)
}
} }
} }
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "service_progress_end@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "service_progress_end@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "service_progress_normal@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "service_progress_normal@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "service_progress_start@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "service_progress_start@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