Commit 461ebd45 authored by pete谢兆麟's avatar pete谢兆麟

Merge branch 'develop' of http://gitlab.galaxy-immi.com/mobile-group/galaxy-iOS into develop

parents 566cce69 7c588e0a
...@@ -148,6 +148,7 @@ extension YHHomeHoldViewPageViewController { ...@@ -148,6 +148,7 @@ extension YHHomeHoldViewPageViewController {
return return
} }
model.type = 1 //for test hjl
if model.type == 1 { if model.type == 1 {
//正式弹窗 //正式弹窗
...@@ -181,7 +182,6 @@ extension YHHomeHoldViewPageViewController { ...@@ -181,7 +182,6 @@ extension YHHomeHoldViewPageViewController {
let vc = YHOfficialApprovalResultVC() let vc = YHOfficialApprovalResultVC()
vc.showGuildViewFlag = true vc.showGuildViewFlag = true
self.navigationController?.pushViewController(vc) self.navigationController?.pushViewController(vc)
} }
} }
} else if model.type == 2 { } else if model.type == 2 {
......
...@@ -36,7 +36,11 @@ class YHOrderTipsItemView: UIView { ...@@ -36,7 +36,11 @@ class YHOrderTipsItemView: UIView {
} else if msg.type == YHMessageType.infoSubmit.rawValue { } else if msg.type == YHMessageType.infoSubmit.rawValue {
return "资料递交" return "资料递交"
} else {
} else if msg.type == YHMessageType.identityApproved.rawValue {
return "身份获批"
} else {
return "--" return "--"
} }
} }
......
...@@ -224,8 +224,9 @@ extension YHServiceOrderListView : UITableViewDelegate,UITableViewDataSource { ...@@ -224,8 +224,9 @@ extension YHServiceOrderListView : UITableViewDelegate,UITableViewDataSource {
navigationController?.pushViewController(vc) navigationController?.pushViewController(vc)
} else if model.type == 13 { //原则批已获批~ } else if model.type == 13 { //原则批已获批~
YHHUD.show(.progress(message:"加载中"))
principleViewModel.requestIsSendMail(orderId: orderID) { isSend in self.principleViewModel.requestIsSendMail(orderId: orderID) { isSend in
YHHUD.hide()
if isSend { if isSend {
// 已发送邮件 // 已发送邮件
let vc = YHPrincipleApprovedMailViewController() let vc = YHPrincipleApprovedMailViewController()
......
...@@ -206,6 +206,9 @@ extension YHPrincipleUploadListVC { ...@@ -206,6 +206,9 @@ extension YHPrincipleUploadListVC {
let agree = YHPrincipleRequestModel() let agree = YHPrincipleRequestModel()
agree.id = agreementModel.id agree.id = agreementModel.id
agree.check_status = agreementModel.check_status agree.check_status = agreementModel.check_status
if agree.check_status == YHPrincipleUploadStatus.rejected.rawValue { // 已驳回
agree.check_status = YHPrincipleUploadStatus.review.rawValue
}
agree.file_url = agreementModel.content_url agree.file_url = agreementModel.content_url
files.append(agree) files.append(agree)
...@@ -214,6 +217,9 @@ extension YHPrincipleUploadListVC { ...@@ -214,6 +217,9 @@ extension YHPrincipleUploadListVC {
let opinion = YHPrincipleRequestModel() let opinion = YHPrincipleRequestModel()
opinion.id = opinionModel.id opinion.id = opinionModel.id
opinion.check_status = opinionModel.check_status opinion.check_status = opinionModel.check_status
if opinion.check_status == YHPrincipleUploadStatus.rejected.rawValue { // 已驳回
opinion.check_status = YHPrincipleUploadStatus.review.rawValue
}
opinion.file_url = opinionModel.content_url opinion.file_url = opinionModel.content_url
files.append(opinion) files.append(opinion)
...@@ -223,6 +229,9 @@ extension YHPrincipleUploadListVC { ...@@ -223,6 +229,9 @@ extension YHPrincipleUploadListVC {
let other = YHPrincipleRequestModel() let other = YHPrincipleRequestModel()
other.id = otherModel.id other.id = otherModel.id
other.check_status = otherModel.check_status other.check_status = otherModel.check_status
if other.check_status == YHPrincipleUploadStatus.rejected.rawValue { // 已驳回
other.check_status = YHPrincipleUploadStatus.review.rawValue
}
other.file_url = otherModel.content_url other.file_url = otherModel.content_url
files.append(other) files.append(other)
......
...@@ -186,13 +186,6 @@ extension YHPrincipleWaitResultViewController: UITableViewDelegate, UITableViewD ...@@ -186,13 +186,6 @@ extension YHPrincipleWaitResultViewController: UITableViewDelegate, UITableViewD
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return UITableView.automaticDimension return UITableView.automaticDimension
} }
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if 0 <= indexPath.section && indexPath.section < items.count {
}
}
private func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> CGFloat { private func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> CGFloat {
return UITableView.automaticDimension return UITableView.automaticDimension
......
...@@ -12,6 +12,7 @@ class YHPrinciplePhotoCollectCell: UICollectionViewCell { ...@@ -12,6 +12,7 @@ class YHPrinciplePhotoCollectCell: UICollectionViewCell {
static let cellReuseIdentifier = "YHPrinciplePhotoCollectCell" static let cellReuseIdentifier = "YHPrinciplePhotoCollectCell"
var clickBlock: (()->())?
lazy var imgView: UIImageView = { lazy var imgView: UIImageView = {
let imgView = UIImageView() let imgView = UIImageView()
imgView.layer.cornerRadius = 3.0 imgView.layer.cornerRadius = 3.0
...@@ -67,6 +68,9 @@ class YHPrinciplePhotoCollectCell: UICollectionViewCell { ...@@ -67,6 +68,9 @@ class YHPrinciplePhotoCollectCell: UICollectionViewCell {
self.addSubview(imgView) self.addSubview(imgView)
self.addSubview(titleLabel) self.addSubview(titleLabel)
let tap = UITapGestureRecognizer(target: self, action: #selector(didPhotoClicked))
self.contentView.addGestureRecognizer(tap)
imgView.snp.makeConstraints { make in imgView.snp.makeConstraints { make in
make.left.right.top.equalToSuperview() make.left.right.top.equalToSuperview()
make.height.equalTo(80.0) make.height.equalTo(80.0)
...@@ -78,6 +82,10 @@ class YHPrinciplePhotoCollectCell: UICollectionViewCell { ...@@ -78,6 +82,10 @@ class YHPrinciplePhotoCollectCell: UICollectionViewCell {
make.height.equalTo(18.0) make.height.equalTo(18.0)
} }
} }
@objc func didPhotoClicked() {
clickBlock?()
}
} }
......
...@@ -216,11 +216,18 @@ extension YHPrinciplePhotoListCell: UICollectionViewDelegateFlowLayout, UICollec ...@@ -216,11 +216,18 @@ extension YHPrinciplePhotoListCell: UICollectionViewDelegateFlowLayout, UICollec
if 0 <= indexPath.item, indexPath.item < items.count { if 0 <= indexPath.item, indexPath.item < items.count {
let model = items[indexPath.item] let model = items[indexPath.item]
cell.updateModel(model) cell.updateModel(model)
cell.clickBlock = {
[weak self] in
guard let self = self else { return }
let model = items[indexPath.item]
var imgUrlArr:[String] = []
for item in items {
imgUrlArr.append(item.image)
}
YHPictureReviewManager.shared.showNetWorkPicturs(curIndex: indexPath.item, arrPicturs: imgUrlArr)
}
} }
return cell return cell
} }
private func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) {
print("index is \(indexPath.row)")
}
} }
...@@ -36,6 +36,8 @@ class YHPrincipleProfileItemView: UIView { ...@@ -36,6 +36,8 @@ class YHPrincipleProfileItemView: UIView {
lazy var titleLabel: UILabel = { lazy var titleLabel: UILabel = {
let label = UILabel() let label = UILabel()
label.font = UIFont.PFSC_R(ofSize: 14) label.font = UIFont.PFSC_R(ofSize: 14)
label.numberOfLines = 0
label.lineBreakMode = .byCharWrapping
label.textColor = UIColor.mainTextColor(alpha: 0.7) label.textColor = UIColor.mainTextColor(alpha: 0.7)
label.textAlignment = .left label.textAlignment = .left
return label return label
...@@ -202,6 +204,7 @@ class YHPrincipleProfileListCell: UITableViewCell { ...@@ -202,6 +204,7 @@ class YHPrincipleProfileListCell: UITableViewCell {
var lastItemView: UIView = listTitleLabel var lastItemView: UIView = listTitleLabel
for (index, item) in items.enumerated() { for (index, item) in items.enumerated() {
let itemView = YHPrincipleProfileItemView(frame: .zero) let itemView = YHPrincipleProfileItemView(frame: .zero)
let viewHeight = self.getHeight(text: item.name, font: itemView.titleLabel.font, width: KScreenWidth-118.0)
itemView.updateModel(item) itemView.updateModel(item)
if model.type == .entry { if model.type == .entry {
itemView.btnClick = { itemView.btnClick = {
...@@ -224,7 +227,7 @@ class YHPrincipleProfileListCell: UITableViewCell { ...@@ -224,7 +227,7 @@ class YHPrincipleProfileListCell: UITableViewCell {
whiteView.addSubview(itemView) whiteView.addSubview(itemView)
itemView.snp.makeConstraints { make in itemView.snp.makeConstraints { make in
make.left.right.equalTo(0) make.left.right.equalTo(0)
make.height.equalTo(YHPrincipleProfileItemView.viewH) make.height.equalTo(viewHeight)
make.top.equalTo(lastItemView.snp.bottom).offset(16.0) make.top.equalTo(lastItemView.snp.bottom).offset(16.0)
if index == items.count-1 { if index == items.count-1 {
make.bottom.equalTo(-16.0) make.bottom.equalTo(-16.0)
...@@ -289,4 +292,16 @@ class YHPrincipleProfileListCell: UITableViewCell { ...@@ -289,4 +292,16 @@ class YHPrincipleProfileListCell: UITableViewCell {
make.bottom.equalTo(-32) make.bottom.equalTo(-32)
} }
} }
func getHeight(text:String, font:UIFont, width:CGFloat)-> CGFloat {
let size = CGSize.init(width:width , height: CGFloat(MAXFLOAT))
let dic = [NSAttributedString.Key.font: font]
let strSize = text.boundingRect(with: size, options: [.usesLineFragmentOrigin], attributes: dic, context:nil).size
var height = CGSizeMake(strSize.width, ceil(strSize.height)).height
if height < 20.0 {
var height = 20
}
return ceil(height)
}
} }
...@@ -24,6 +24,9 @@ class YHMessageDetailListVC: YHBaseViewController { ...@@ -24,6 +24,9 @@ class YHMessageDetailListVC: YHBaseViewController {
return model return model
}() }()
let principleViewModel: YHPrincleViewModel = YHPrincleViewModel()
lazy var navBar: YHCustomNavigationBar = { lazy var navBar: YHCustomNavigationBar = {
let bar = YHCustomNavigationBar.navBar() let bar = YHCustomNavigationBar.navBar()
bar.backgroundColor = .white bar.backgroundColor = .white
...@@ -265,6 +268,10 @@ extension YHMessageDetailListVC: UITableViewDelegate, UITableViewDataSource { ...@@ -265,6 +268,10 @@ extension YHMessageDetailListVC: UITableViewDelegate, UITableViewDataSource {
} }
self.navigationController?.popToRootViewController(animated: false) self.navigationController?.popToRootViewController(animated: false)
goTabBarBy(tabType: .service) goTabBarBy(tabType: .service)
} else if self.type == YHMessageType.identityApproved.rawValue { // 身份获批
self.navigationController?.popToRootViewController(animated: false)
goTabBarBy(tabType: .service)
} }
} }
} }
......
...@@ -15,6 +15,9 @@ class YHMessageListVC: YHBaseViewController { ...@@ -15,6 +15,9 @@ class YHMessageListVC: YHBaseViewController {
let model = YHMsgViewModel() let model = YHMsgViewModel()
return model return model
}() }()
private let serviceCenterViewModel : YHServiceCenterMainViewModel = YHServiceCenterMainViewModel()
var isNotifyEnabled = false var isNotifyEnabled = false
lazy var tableView: UITableView = { lazy var tableView: UITableView = {
...@@ -149,47 +152,89 @@ class YHMessageListVC: YHBaseViewController { ...@@ -149,47 +152,89 @@ class YHMessageListVC: YHBaseViewController {
if !YHLoginManager.shared.isLogin() { if !YHLoginManager.shared.isLogin() {
return return
} }
self.viewModel.getUnreadMsgList {
[weak self] success, error in self.requestOrderStatus {
guard let self = self else { return } isHidden in
msgArr.removeAll()
self.viewModel.getUnreadMsgList {
[weak self] success, error in
guard let self = self else { return }
msgArr.removeAll()
if success { if success {
var hasUnreadMsg = false var hasUnreadMsg = false
// 资料填写 // 资料填写
if !self.viewModel.msgList.information.lastMessage.isEmpty { if !self.viewModel.msgList.information.lastMessage.isEmpty {
hasUnreadMsg = true hasUnreadMsg = true
} }
// 证件上传 // 证件上传
if !self.viewModel.msgList.certificate.lastMessage.isEmpty { if !self.viewModel.msgList.certificate.lastMessage.isEmpty {
hasUnreadMsg = true hasUnreadMsg = true
} }
// 文书定稿 // 文书定稿
if !self.viewModel.msgList.draft.lastMessage.isEmpty { if !self.viewModel.msgList.draft.lastMessage.isEmpty {
hasUnreadMsg = true hasUnreadMsg = true
} }
// 文件签字 // 文件签字
if !self.viewModel.msgList.signature.lastMessage.isEmpty { if !self.viewModel.msgList.signature.lastMessage.isEmpty {
hasUnreadMsg = true hasUnreadMsg = true
}
// 资料递交
if !self.viewModel.msgList.dataSubmission.lastMessage.isEmpty {
hasUnreadMsg = true
}
// 身份获批
if !self.viewModel.msgList.approval.lastMessage.isEmpty {
hasUnreadMsg = true
}
if hasUnreadMsg {
if !isHidden {
msgArr.append(self.viewModel.msgList.information)
msgArr.append(self.viewModel.msgList.certificate)
msgArr.append(self.viewModel.msgList.draft)
msgArr.append(self.viewModel.msgList.signature)
msgArr.append(self.viewModel.msgList.dataSubmission)
}
msgArr.append(self.viewModel.msgList.approval)
}
} }
emptyDataTipsView.isHidden = msgArr.count > 0
// 资料递交 self.tableView.reloadData()
if !self.viewModel.msgList.dataSubmission.lastMessage.isEmpty { }
hasUnreadMsg = true }
} }
if hasUnreadMsg { func requestOrderStatus(callback:((_ isHidden: Bool)->())?) {
msgArr.append(self.viewModel.msgList.information) // 先获取订单列表
msgArr.append(self.viewModel.msgList.certificate) self.serviceCenterViewModel.getContactList {
msgArr.append(self.viewModel.msgList.draft) [weak self] success, error in
msgArr.append(self.viewModel.msgList.signature) guard let self = self else { return }
msgArr.append(self.viewModel.msgList.dataSubmission) if success == true {
if let orderInfo = serviceCenterViewModel.arrContactList.first {
// 请求申请结果
self.serviceCenterViewModel.getStageInformation(params: ["orderId": orderInfo.id]) {
[weak self] success, error in
guard let self = self else { return }
if self.serviceCenterViewModel.personInfoModel.type == 2 { // 申请结果
callback?(true)
} else {
callback?(false)
}
}
} else {
callback?(false)
} }
} else {
callback?(false)
} }
emptyDataTipsView.isHidden = msgArr.count > 0
self.tableView.reloadData()
} }
} }
func markAllMsgsRead() { func markAllMsgsRead() {
YHHUD.show(.progress(message: "清除中...")) YHHUD.show(.progress(message: "清除中..."))
......
...@@ -16,6 +16,7 @@ enum YHMessageType: Int { ...@@ -16,6 +16,7 @@ enum YHMessageType: Int {
case draft = 3 // 文书定稿 case draft = 3 // 文书定稿
case fileSign = 4 // 文件签字 case fileSign = 4 // 文件签字
case infoSubmit = 5 // 资料递交 case infoSubmit = 5 // 资料递交
case identityApproved = 6 // 身份获批
} }
class YHMessageInfoModel: SmartCodable { class YHMessageInfoModel: SmartCodable {
...@@ -50,6 +51,9 @@ class YHMessageInfoModel: SmartCodable { ...@@ -50,6 +51,9 @@ class YHMessageInfoModel: SmartCodable {
} else if type == YHMessageType.infoSubmit.rawValue { } else if type == YHMessageType.infoSubmit.rawValue {
return "资料递交" return "资料递交"
} else if type == YHMessageType.identityApproved.rawValue {
return "身份获批"
} }
return "" return ""
} }
...@@ -61,6 +65,7 @@ class YHMsgListModel: SmartCodable { ...@@ -61,6 +65,7 @@ class YHMsgListModel: SmartCodable {
var draft: YHMessageInfoModel = YHMessageInfoModel() var draft: YHMessageInfoModel = YHMessageInfoModel()
var signature: YHMessageInfoModel = YHMessageInfoModel() var signature: YHMessageInfoModel = YHMessageInfoModel()
var dataSubmission: YHMessageInfoModel = YHMessageInfoModel() var dataSubmission: YHMessageInfoModel = YHMessageInfoModel()
var approval: YHMessageInfoModel = YHMessageInfoModel()
required init() { required init() {
self.information.type = YHMessageType.infoFill.rawValue self.information.type = YHMessageType.infoFill.rawValue
...@@ -68,6 +73,7 @@ class YHMsgListModel: SmartCodable { ...@@ -68,6 +73,7 @@ class YHMsgListModel: SmartCodable {
self.draft.type = YHMessageType.draft.rawValue self.draft.type = YHMessageType.draft.rawValue
self.signature.type = YHMessageType.fileSign.rawValue self.signature.type = YHMessageType.fileSign.rawValue
self.dataSubmission.type = YHMessageType.infoSubmit.rawValue self.dataSubmission.type = YHMessageType.infoSubmit.rawValue
self.approval.type = YHMessageType.identityApproved.rawValue
} }
enum CodingKeys: String, CodingKey { enum CodingKeys: String, CodingKey {
......
...@@ -56,6 +56,9 @@ class YHDetailMessageCell: UITableViewCell { ...@@ -56,6 +56,9 @@ class YHDetailMessageCell: UITableViewCell {
if !model.url.isEmpty { if !model.url.isEmpty {
bottomBtn.setTitle("去签字".local, for: .normal) bottomBtn.setTitle("去签字".local, for: .normal)
} }
} else if type == YHMessageType.identityApproved.rawValue {
bottomBtn.setTitle("去查看".local, for: .normal)
} }
} }
......
...@@ -48,6 +48,9 @@ class YHMessageSessionCell: UITableViewCell { ...@@ -48,6 +48,9 @@ class YHMessageSessionCell: UITableViewCell {
} else if model.type == YHMessageType.infoSubmit.rawValue { } else if model.type == YHMessageType.infoSubmit.rawValue {
self.iconImgView.image = UIImage(named: "msg_icon_info_submit") self.iconImgView.image = UIImage(named: "msg_icon_info_submit")
} else if model.type == YHMessageType.identityApproved.rawValue {
self.iconImgView.image = UIImage(named: "msg_icon_identity_approved")
} }
self.badgeLabel.isHidden = model.unreadCount <= 0 self.badgeLabel.isHidden = model.unreadCount <= 0
......
...@@ -37,6 +37,8 @@ class YHMsgViewModel: NSObject { ...@@ -37,6 +37,8 @@ class YHMsgViewModel: NSObject {
self.msgList.draft.type = YHMessageType.draft.rawValue self.msgList.draft.type = YHMessageType.draft.rawValue
self.msgList.signature.type = YHMessageType.fileSign.rawValue self.msgList.signature.type = YHMessageType.fileSign.rawValue
self.msgList.dataSubmission.type = YHMessageType.infoSubmit.rawValue self.msgList.dataSubmission.type = YHMessageType.infoSubmit.rawValue
self.msgList.approval.type = YHMessageType.identityApproved.rawValue
callBackBlock(true, nil) callBackBlock(true, nil)
} else { } else {
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Message_shenfenhuopi@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Message_shenfenhuopi@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