Commit 72870f22 authored by pete谢兆麟's avatar pete谢兆麟

服务中心逻辑 发送邮箱bug处理

parent 47a93777
......@@ -238,6 +238,8 @@
049A48A82B49417300D0C641 /* YHAboutUsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 049A48A72B49417300D0C641 /* YHAboutUsViewController.swift */; };
049A48AA2B49536000D0C641 /* YHAboutUsAdvantageCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 049A48A92B49536000D0C641 /* YHAboutUsAdvantageCell.swift */; };
049AC4C62BC3E55300F857F4 /* YHServiceSectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 049AC4C52BC3E55300F857F4 /* YHServiceSectionView.swift */; };
049AC4C82BC513AB00F857F4 /* YHOrderListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 049AC4C72BC513AB00F857F4 /* YHOrderListView.swift */; };
049AC4CA2BC5141600F857F4 /* YHServerNoOrderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 049AC4C92BC5141600F857F4 /* YHServerNoOrderView.swift */; };
04A271232BABFF3200652B1B /* YHCertificateUploadTypeCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04A271222BABFF3200652B1B /* YHCertificateUploadTypeCell.swift */; };
04A271252BAC33BB00652B1B /* YHFilePreviewTool.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04A271242BAC33BB00652B1B /* YHFilePreviewTool.swift */; };
04A671592B9F18C800C1FB91 /* YHCertificateUploadSheetView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04A671582B9F18C800C1FB91 /* YHCertificateUploadSheetView.swift */; };
......@@ -670,6 +672,8 @@
049A48A72B49417300D0C641 /* YHAboutUsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAboutUsViewController.swift; sourceTree = "<group>"; };
049A48A92B49536000D0C641 /* YHAboutUsAdvantageCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAboutUsAdvantageCell.swift; sourceTree = "<group>"; };
049AC4C52BC3E55300F857F4 /* YHServiceSectionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHServiceSectionView.swift; sourceTree = "<group>"; };
049AC4C72BC513AB00F857F4 /* YHOrderListView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHOrderListView.swift; sourceTree = "<group>"; };
049AC4C92BC5141600F857F4 /* YHServerNoOrderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHServerNoOrderView.swift; sourceTree = "<group>"; };
04A271222BABFF3200652B1B /* YHCertificateUploadTypeCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCertificateUploadTypeCell.swift; sourceTree = "<group>"; };
04A271242BAC33BB00652B1B /* YHFilePreviewTool.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFilePreviewTool.swift; sourceTree = "<group>"; };
04A671582B9F18C800C1FB91 /* YHCertificateUploadSheetView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHCertificateUploadSheetView.swift; sourceTree = "<group>"; };
......@@ -2081,6 +2085,8 @@
044414062BC3C54B00784A14 /* YHHomeCollectionViewCell.swift */,
044414082BC3CE8500784A14 /* YHHomeCollectionLayout.swift */,
04CC2EEF2BC3DDB2000305DD /* YHServiceBannerView.swift */,
049AC4C72BC513AB00F857F4 /* YHOrderListView.swift */,
049AC4C92BC5141600F857F4 /* YHServerNoOrderView.swift */,
);
path = V;
sourceTree = "<group>";
......@@ -2479,6 +2485,7 @@
044413FB2BC27E6F00784A14 /* YHHomeWebBottomButton.swift in Sources */,
045EEEB32B9F171A0022A143 /* YHWorkFileSyncTableViewCell.swift in Sources */,
045EEEF12B9F171A0022A143 /* YHChildInfoContainerVC.swift in Sources */,
049AC4C82BC513AB00F857F4 /* YHOrderListView.swift in Sources */,
045EEF0B2B9F171A0022A143 /* YHBasicInfoFillViewController.swift in Sources */,
A582B2452BBA4CF9009D098C /* YHHKPlanDocModel.swift in Sources */,
045EEF142B9F171A0022A143 /* YHItemModel.swift in Sources */,
......@@ -2627,6 +2634,7 @@
A5ACE9552B4564F7002C94D2 /* YHTabBarViewController.swift in Sources */,
045EEF0A2B9F171A0022A143 /* YHBasicInfoSessionModel.swift in Sources */,
045EEF022B9F171A0022A143 /* YHFormItemDegreeInfoCell.swift in Sources */,
049AC4CA2BC5141600F857F4 /* YHServerNoOrderView.swift in Sources */,
045EEEF72B9F171A0022A143 /* YHFormItemAddCell.swift in Sources */,
045EEEC82B9F171A0022A143 /* YHOtherSelecteItemView.swift in Sources */,
A5C5B3122B57B47D00A7C5D1 /* YHDavidCell0.swift in Sources */,
......
......@@ -34,12 +34,10 @@ class YHServerHKLifeViewController: YHBaseViewController {
override func viewDidLoad() {
super.viewDidLoad()
setupUI()
handleRightUI()
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
handleRightUI()
loadData()
}
}
......@@ -56,7 +54,6 @@ extension YHServerHKLifeViewController {
} else {
YHHUD.flash(message: error?.errorMsg ?? "请求出错")
}
self.handleRightUI()
}
}
......@@ -82,13 +79,6 @@ extension YHServerHKLifeViewController {
}
homeTableView.delegate = self
homeTableView.dataSource = self
self.homeTableView.isHidden = true
NotificationCenter.default.addObserver(self, selector: #selector(loginSuccess), name: YhConstant.YhNotification.didLoginSuccessNotifiction, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(logoutSuccess), name: YhConstant.YhNotification.didLogoutSuccessNotifiction, object: nil)
}
}
......@@ -135,32 +125,6 @@ extension YHServerHKLifeViewController : UITableViewDelegate,UITableViewDataSour
}
}
extension YHServerHKLifeViewController {
@objc func loginSuccess() {
printLog("登录成功,进行相应的 UI刷新操作")
loadData()
}
@objc func logoutSuccess() {
handleRightUI()
}
private func handleRightUI() {
if YHLoginManager.shared.isLogin() == false {
homeTableView.isHidden = true
} else {
if serviceCenterMainReqVM.arrContactList.isEmpty {
homeTableView.isHidden = true
} else {
homeTableView.isHidden = false
}
}
homeTableView.reloadData()
}
}
extension YHServerHKLifeViewController: JXSegmentedListContainerViewListDelegate {
func listView() -> UIView {
return view
......
......@@ -13,37 +13,8 @@ class YHServiceListViewController: YHBaseViewController {
private let serviceCenterMainReqVM : YHServiceCenterMainViewModel = YHServiceCenterMainViewModel()
private let loginTipsView : YHLoginTipsView = {
let view = YHLoginTipsView()
view.viewType = 0
view.isHidden = true
return view
}()
private let noDataView : YHLoginTipsView = {
let view = YHLoginTipsView()
view.viewType = 1
view.isHidden = true
return view
}()
private func loginOp() {
let vc = UINavigationController(rootVC: YHPhoneLoginViewController())
vc.modalPresentationStyle = .custom
self.navigationController?.present(vc, animated: true)
}
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.estimatedRowHeight = 81.0
tableView.register(YHContractCell.self,forCellReuseIdentifier: YHContractCell.cellReuseIdentifier)
return tableView
}()
var orderListView: YHOrderListView!
var normalView: YHServerNoOrderView!
override func viewDidLoad() {
super.viewDidLoad()
......@@ -62,6 +33,7 @@ extension YHServiceListViewController {
func loadData() {
if YHLoginManager.shared.isLogin() == false {
self.handleRightUI()
return
}
......@@ -79,131 +51,44 @@ extension YHServiceListViewController {
gk_navBarAlpha = 0
gk_navigationBar.isHidden = true
loginTipsView.clickLoginBtnCallBackBlock = {
self.loginOp()
}
view.addSubview(loginTipsView)
loginTipsView.snp.makeConstraints { make in
make.centerX.equalToSuperview()
make.centerY.equalToSuperview()
make.width.equalTo(KScreenWidth)
}
view.addSubview(noDataView)
noDataView.snp.makeConstraints { make in
make.centerX.equalToSuperview()
make.centerY.equalToSuperview()
make.width.equalTo(KScreenWidth)
}
view.addSubview(homeTableView)
homeTableView.snp.makeConstraints { make in
orderListView = {
let view = YHOrderListView()
return view
}()
view.addSubview(orderListView)
orderListView.snp.makeConstraints { make in
make.top.left.right.equalToSuperview()
make.bottom.equalToSuperview().offset(-k_Height_TabBar)
}
homeTableView.delegate = self
homeTableView.dataSource = self
self.homeTableView.isHidden = true
self.noDataView.isHidden = false
NotificationCenter.default.addObserver(self, selector: #selector(loginSuccess), name: YhConstant.YhNotification.didLoginSuccessNotifiction, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(logoutSuccess), name: YhConstant.YhNotification.didLogoutSuccessNotifiction, object: nil)
}
}
// MARK: - UITableViewDelegate 和 UITableViewDataSource
extension YHServiceListViewController : 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]
normalView = {
let view = YHServerNoOrderView()
return view
}()
view.addSubview(normalView)
normalView.snp.makeConstraints { make in
make.top.left.right.equalToSuperview()
make.bottom.equalToSuperview().offset(-k_Height_TabBar)
}
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 YHServiceListViewController {
@objc func loginSuccess() {
printLog("登录成功,进行相应的 UI刷新操作")
loadData()
}
@objc func logoutSuccess() {
handleRightUI()
}
private func handleRightUI() {
if YHLoginManager.shared.isLogin() == false {
loginTipsView.isHidden = false
noDataView.isHidden = true
homeTableView.isHidden = true
normalView.isHidden = false
orderListView.isHidden = true
} else {
loginTipsView.isHidden = true
if serviceCenterMainReqVM.arrContactList.isEmpty {
homeTableView.isHidden = true
noDataView.isHidden = false
normalView.isHidden = false
orderListView.isHidden = true
} else {
homeTableView.isHidden = false
noDataView.isHidden = true
normalView.isHidden = true
orderListView.isHidden = false
orderListView.dataSource = serviceCenterMainReqVM.arrContactList
}
}
homeTableView.reloadData()
}
}
......@@ -211,4 +96,8 @@ extension YHServiceListViewController: JXSegmentedListContainerViewListDelegate
func listView() -> UIView {
return view
}
func listWillAppear() {
loadData()
}
}
......@@ -248,7 +248,7 @@ class YHMyDocumentsDetailViewController: YHBaseViewController {
//发送接口
if let orderID = UserDefaults.standard.value(forKey: "orderIdForPreview") {
YHHUD.show(.progress(message: "发送中..."))
let params = ["order_id":orderID,"ids":[self.id],"email":text]
let params = ["order_id":orderID,"ids":[self.viewModel.mainModel?.writing_document.doc_sign.id ?? 0],"email":text]
self.viewModel?.sendEmailForDocs(params, callBackBlock: { success, error in
YHHUD.hide()
if success {
......
//
// YHOrderListView.swift
// galaxy
//
// Created by EDY on 2024/4/9.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHOrderListView: UIView {
var dataSource: [YHContactItemModel] = [] {
didSet {
self.homeTableView.reloadData()
}
}
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.estimatedRowHeight = 81.0
tableView.register(YHContractCell.self,forCellReuseIdentifier: YHContractCell.cellReuseIdentifier)
return tableView
}()
override init(frame: CGRect) {
super.init(frame: frame)
setupUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func setupUI() {
addSubview(homeTableView)
homeTableView.snp.makeConstraints { make in
make.top.left.right.equalToSuperview()
make.bottom.equalToSuperview()
}
homeTableView.delegate = self
homeTableView.dataSource = self
}
}
extension YHOrderListView : UITableViewDelegate,UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
return self.dataSource.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.dataSource.count {
cell0.dataModel = self.dataSource[indexPath.section]
}
return cell0
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
tableView.deselectRow(at: indexPath, animated: true)
printLog("点击了 tableView Cell \(indexPath.section)")
//获取订单号
let orderId = dataSource[indexPath.section].id
UserDefaults.standard.set(orderId, forKey: "orderIdForPreview")
UserDefaults.standard.synchronize()
let vc = YHServiceCenterSecondViewController()
vc.orderId = orderId
vc.mobile = dataSource[indexPath.section].mobile
UIViewController.current?.navigationController?.pushViewController(vc)
}
}
//
// YHServerNoOrderView.swift
// galaxy
//
// Created by EDY on 2024/4/9.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHServerNoOrderView: UIView {
var tableHeadView: YHServerTableHeadView!
var tableFootView: YHServiceTableFootView!
var sectionView: YHServiceSectionView!
var homeTableView: UITableView = {
let tableView = UITableView(frame: .zero, style: .plain)
if #available(iOS 15.0, *) {
tableView.sectionHeaderTopPadding = 0
}
tableView.backgroundColor = .clear
tableView.separatorStyle = .none
tableView.showsHorizontalScrollIndicator = false
tableView.showsVerticalScrollIndicator = false
tableView.rowHeight = UITableView.automaticDimension
tableView.estimatedRowHeight = 81.0
tableView.register(YHServerHKLifeViewCell.self,forCellReuseIdentifier: YHServerHKLifeViewCell.cellReuseIdentifier)
return tableView
}()
override init(frame: CGRect) {
super.init(frame: frame)
setupUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func setupUI() {
sectionView = {
let view = YHServiceSectionView()
return view
}()
tableHeadView = YHServerTableHeadView()
tableHeadView.frame = CGRect(x: 0, y: 0, width: KScreenWidth, height: 365)
// tableFootView = YHServiceTableFootView()
// tableFootView.frame = CGRect(x: 0, y: 0, width: KScreenWidth, height: KScreenHeight)
addSubview(homeTableView)
homeTableView.tableHeaderView = tableHeadView
homeTableView.tableFooterView = tableFootView
homeTableView.snp.makeConstraints { make in
make.top.left.right.equalToSuperview()
make.bottom.equalToSuperview()
}
homeTableView.delegate = self
homeTableView.dataSource = self
}
}
// MARK: - UITableViewDelegate 和 UITableViewDataSource
extension YHServerNoOrderView : UITableViewDelegate,UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
return 1
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 1
}
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
return 48
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
return sectionView
}
func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
return 0.01
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
return UIView()
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return KScreenHeight
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell0 = tableView.dequeueReusableCell(withClass: YHServerHKLifeViewCell.self)
cell0.selectionStyle = .none
return cell0
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
}
}
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