Commit 658d1d4d authored by David黄金龙's avatar David黄金龙

处理问题 列表

parent f86128bf
This diff is collapsed.
...@@ -444,7 +444,8 @@ extension YHInformationPerfectListVC : UITableViewDelegate,UITableViewDataSource ...@@ -444,7 +444,8 @@ extension YHInformationPerfectListVC : UITableViewDelegate,UITableViewDataSource
let vc = YHOtherInfoFillViewController() let vc = YHOtherInfoFillViewController()
vc.orderId = orderId vc.orderId = orderId
navigationController?.pushViewController(vc) navigationController?.pushViewController(vc)
} else { }
else {
} }
} }
......
...@@ -174,7 +174,7 @@ extension YHServiceCenterSecondViewController : UITableViewDelegate,UITableViewD ...@@ -174,7 +174,7 @@ extension YHServiceCenterSecondViewController : UITableViewDelegate,UITableViewD
vc.orderId = orderId vc.orderId = orderId
navigationController?.pushViewController(vc) navigationController?.pushViewController(vc)
} else if model.type == 2 { } else if model.type == 2 {
let vc = YHMineCertificateEntryVC() let vc = YHMineCertificateEntryViewController()
navigationController?.pushViewController(vc) navigationController?.pushViewController(vc)
} else if model.type == 3 { } else if model.type == 3 {
...@@ -190,7 +190,11 @@ extension YHServiceCenterSecondViewController : UITableViewDelegate,UITableViewD ...@@ -190,7 +190,11 @@ extension YHServiceCenterSecondViewController : UITableViewDelegate,UITableViewD
let vc = YHMySignatureListViewController() let vc = YHMySignatureListViewController()
vc.orderId = orderId ?? 0 vc.orderId = orderId ?? 0
navigationController?.pushViewController(vc) navigationController?.pushViewController(vc)
} else { } else if model.type == 6 {
let vc = YHMineSchemeViewController()
navigationController?.pushViewController(vc)
}
else {
} }
} }
......
...@@ -27,6 +27,14 @@ class YHContactMainItemStatusModel { ...@@ -27,6 +27,14 @@ class YHContactMainItemStatusModel {
} else if type == 5 { } else if type == 5 {
iconName = "service_center_sfsq_wdpf_icon" iconName = "service_center_sfsq_wdpf_icon"
itemName = "我的签字" itemName = "我的签字"
} else if type == 6 {
iconName = "service_center_sfsq_wdpf_icon"
itemName = "我的方案"
} else {
iconName = "service_center_sfsq_wdpf_icon"
itemName = "--"
} }
} }
} }
......
//
// YHFileListVC.swift
// galaxy
//
// Created by davidhuangA on 2024/3/17.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
/*
文件清单
*/
class YHFileListViewController: YHBaseViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
}
...@@ -11,7 +11,7 @@ import UIKit ...@@ -11,7 +11,7 @@ import UIKit
我的证件 主入口页 我的证件 主入口页
*/ */
class YHMineCertificateEntryVC: YHBaseViewController { class YHMineCertificateEntryViewController: YHBaseViewController {
private let certificateReqVM : YHCertificateViewModel = YHCertificateViewModel() private let certificateReqVM : YHCertificateViewModel = YHCertificateViewModel()
...@@ -48,7 +48,7 @@ class YHMineCertificateEntryVC: YHBaseViewController { ...@@ -48,7 +48,7 @@ class YHMineCertificateEntryVC: YHBaseViewController {
} }
} }
extension YHMineCertificateEntryVC { extension YHMineCertificateEntryViewController {
func loadData() { func loadData() {
if let orderID = UserDefaults.standard.value(forKey: "orderIdForPreview") { if let orderID = UserDefaults.standard.value(forKey: "orderIdForPreview") {
let param = ["order_id":orderID,"node":"1","state":"1"] let param = ["order_id":orderID,"node":"1","state":"1"]
...@@ -97,11 +97,25 @@ extension YHMineCertificateEntryVC { ...@@ -97,11 +97,25 @@ extension YHMineCertificateEntryVC {
homeTableView.delegate = self homeTableView.delegate = self
homeTableView.dataSource = self homeTableView.dataSource = self
bottomView.block = { flag in
if flag == 0 {
//问题答疑
let vc = YHQuestionAndAnswerViewController()
self.navigationController?.pushViewController(vc)
} else {
//生成清单
}
}
} }
} }
// MARK: - UITableViewDelegate 和 UITableViewDataSource // MARK: - UITableViewDelegate 和 UITableViewDataSource
extension YHMineCertificateEntryVC : UITableViewDelegate,UITableViewDataSource { extension YHMineCertificateEntryViewController : UITableViewDelegate,UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int { func numberOfSections(in tableView: UITableView) -> Int {
// guard let model = certificateReqVM.certificateEntryModel else { return 0 } // guard let model = certificateReqVM.certificateEntryModel else { return 0 }
// return model.category_data.count // return model.category_data.count
......
//
// YHMineSchemeVC.swift
// galaxy
//
// Created by davidhuangA on 2024/3/17.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
/*
我的方案
*/
class YHMineSchemeViewController: YHBaseViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destination.
// Pass the selected object to the new view controller.
}
*/
}
//
// YHQuestionAndAnswerViewController.swift
// galaxy
//
// Created by davidhuangA on 2024/3/17.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
/*
问题答疑列表
*/
class YHQuestionAndAnswerViewController: YHBaseViewController {
private let certificateReqVM : YHCertificateViewModel = YHCertificateViewModel()
private lazy var topBkg : UIView = {
let imagV = UIImageView()
imagV.image = UIImage(named: "service_center_head_bkg")
imagV.contentMode = .scaleAspectFill
return imagV
}()
var homeTableView: UITableView = {
let tableView = UITableView(frame: .zero, style: .grouped)
tableView.backgroundColor = .clear
tableView.separatorStyle = .none
tableView.showsHorizontalScrollIndicator = false
tableView.showsVerticalScrollIndicator = false
tableView.rowHeight = UITableView.automaticDimension
tableView.register(YHQuestionAndAnswerCell.self,forCellReuseIdentifier: YHQuestionAndAnswerCell.cellReuseIdentifier)
return tableView
}()
override func viewDidLoad() {
super.viewDidLoad()
setupUI()
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
loadData()
}
}
extension YHQuestionAndAnswerViewController {
func loadData() {
if let orderID = UserDefaults.standard.value(forKey: "orderIdForPreview") {
let param = ["order_id":orderID,"node":"1","state":"1"]
certificateReqVM.getQuestionAndAnserList(params: param) { success, error in
if success == true {
} else {
YHHUD.flash(message: error?.errorMsg ?? "请求出错")
}
self.homeTableView.reloadData()
}
} else {
printLog("error : orderID 为空")
}
}
func setupUI() {
gk_navTitle = "问题答疑"
gk_navBarAlpha = 1.0
view.addSubview(homeTableView)
homeTableView.snp.makeConstraints { make in
make.edges.equalTo(0)
}
homeTableView.delegate = self
homeTableView.dataSource = self
}
}
// MARK: - UITableViewDelegate 和 UITableViewDataSource
extension YHQuestionAndAnswerViewController : UITableViewDelegate,UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
return certificateReqVM.arrQuestionAndAnswer.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 UITableView.automaticDimension
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell0 = tableView.dequeueReusableCell(withClass: YHQuestionAndAnswerCell.self)
cell0.selectionStyle = .none
if indexPath.row < certificateReqVM.arrQuestionAndAnswer.count {
cell0.dataModel = certificateReqVM.arrQuestionAndAnswer[indexPath.row]
}
return cell0
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
tableView.deselectRow(at: indexPath, animated: true)
printLog("点击了 tableView Cell \(indexPath.section)")
}
}
//
// YHQuestionAndAnswerModel.swift
// galaxy
//
// Created by davidhuangA on 2024/3/17.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import SmartCodable
class YHQuestionAndAnswerModel: SmartCodable {
var index : Int = 0 //通过
var question : String = ""
var answer : String = ""
required init() {
}
}
//
// YHQuestionAndAnswerCell.swift
// galaxy
//
// Created by davidhuangA on 2024/3/17.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHQuestionAndAnswerCell: UITableViewCell {
static let cellReuseIdentifier = "YHQuestionAndAnswerCell"
var dataModel : YHQuestionAndAnswerModel? {
didSet {
updateUI()
}
}
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
selectionStyle = .none
setupUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
lazy var contractNameLable = {
let lable = UILabel()
lable.textColor = UIColor.mainTextColor
lable.font = UIFont.PFSC_M(ofSize: 16)
lable.text = "--"
lable.numberOfLines = 0
lable.lineBreakMode = .byCharWrapping
return lable
}()
lazy var contractIdLable = {
let lable = UILabel()
lable.textColor = UIColor.labelTextColor2
lable.font = UIFont.PFSC_R(ofSize: 14)
lable.text = "--"
lable.numberOfLines = 0
lable.lineBreakMode = .byCharWrapping
return lable
}()
}
extension YHQuestionAndAnswerCell {
func updateUI() {
guard let dataModel = dataModel else { return }
contractNameLable.text = dataModel.question
contractIdLable.text = dataModel.answer
}
func setupUI() {
let holdView = UIView()
holdView.backgroundColor = .white
holdView.layer.cornerRadius = kCornerRadius6
holdView.clipsToBounds = true
backgroundColor = .clear
contentView.backgroundColor = .clear
contentView.addSubview(holdView)
holdView.snp.makeConstraints { make in
make.top.bottom.equalToSuperview()
make.left.equalTo(kMargin)
make.right.equalTo(-kMargin)
}
holdView.addSubview(contractNameLable)
contractNameLable.snp.makeConstraints { make in
make.top.equalToSuperview().offset(kMargin)
make.left.equalToSuperview().offset(44)
make.right.equalTo(-kMargin)
}
let nextImgV = UIImageView()
nextImgV.image = UIImage(named: "my_cer_question_icon")
nextImgV.contentMode = .scaleAspectFill
holdView.addSubview(nextImgV)
nextImgV.snp.makeConstraints { make in
make.top.equalTo(contractNameLable.snp.top)
make.left.equalTo(kMargin)
make.width.height.equalTo(21)
}
holdView.addSubview(contractIdLable)
contractIdLable.snp.makeConstraints { make in
make.top.equalTo(contractNameLable.snp.bottom).offset(12)
make.right.equalTo(-kMargin)
make.left.equalTo(kMargin)
make.height.greaterThanOrEqualTo(20)
make.bottom.equalTo(-kMargin)
}
}
}
...@@ -7,12 +7,46 @@ ...@@ -7,12 +7,46 @@
// //
import UIKit import UIKit
import SmartCodable
class YHCertificateViewModel: YHBaseViewModel { class YHCertificateViewModel: YHBaseViewModel {
var certificateEntryModel : YHCertificateEntryModel? var certificateEntryModel : YHCertificateEntryModel?
}
var arrQuestionAndAnswer : [YHQuestionAndAnswerModel?] = []
extension YHCertificateViewModel {
//获取问答列表
func getQuestionAndAnserList( params:[String : Any],callBackBlock:@escaping (_ success: Bool,_ error:YHErrorModel?)->()) {
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Certificate.questionAndAnswerApi
let _ = YHNetRequest.getRequest(url: strUrl,params: params) { [weak self] json, code in
//1. json字符串 转 对象
guard let self = self else { return }
printLog("model 是 ==> \(json)")
if json.code == 200 {
let dic = json.data
guard let resultModel = [YHQuestionAndAnswerModel].deserialize(array: dic as? [Any]) else {
let err = YHErrorModel(errorCode: YHErrorCode.dictParseError.rawValue, errorMsg: YHErrorCode.dictParseError.description())
callBackBlock(false,err)
return
}
self.arrQuestionAndAnswer = resultModel
callBackBlock(true,nil)
} else {
let err = YHErrorModel(errorCode: Int32(json.code), errorMsg: json.msg.isEmpty ? "" : json.msg)
callBackBlock(false,err)
}
} failBlock: { err in
callBackBlock(false,err)
}
}
//我的证件 状态数据统计 //我的证件 状态数据统计
func getCertificateStatisticData( params:[String : Any],callBackBlock:@escaping (_ success: Bool,_ error:YHErrorModel?)->()) { func getCertificateStatisticData( params:[String : Any],callBackBlock:@escaping (_ success: Bool,_ error:YHErrorModel?)->()) {
......
...@@ -164,12 +164,23 @@ extension YHServiceCenterMainViewModel { ...@@ -164,12 +164,23 @@ extension YHServiceCenterMainViewModel {
arrContactStausItmes.append(model4) arrContactStausItmes.append(model4)
} }
if resultModel.my_signature { if resultModel.my_signature {
//我的签字
let model5 = YHContactMainItemStatusModel() let model5 = YHContactMainItemStatusModel()
model5.type = 5 model5.type = 5
model5.isFinished = true model5.isFinished = true
arrContactStausItmes.append(model5) arrContactStausItmes.append(model5)
} }
if resultModel.scheme_position_switch == 1 {
//我的方案
let model5 = YHContactMainItemStatusModel()
model5.type = 6
model5.isFinished = true
arrContactStausItmes.append(model5)
}
} else { } else {
let model = YHContactMainItemStatusModel() let model = YHContactMainItemStatusModel()
......
...@@ -188,5 +188,8 @@ class YHAllApiName { ...@@ -188,5 +188,8 @@ class YHAllApiName {
struct Certificate { struct Certificate {
// 我的证件-状态数量统计 // 我的证件-状态数量统计
static let statisticApi = "infoflow/certificate/statistic" static let statisticApi = "infoflow/certificate/statistic"
//获取问答列表
static let questionAndAnswerApi = "infoflow/answer-question/getAnswerQuestion"
} }
} }
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "icon-问题@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "icon-问题@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