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 {
return
}
model.type = 1 //for test hjl
if model.type == 1 {
//正式弹窗
......@@ -181,7 +182,6 @@ extension YHHomeHoldViewPageViewController {
let vc = YHOfficialApprovalResultVC()
vc.showGuildViewFlag = true
self.navigationController?.pushViewController(vc)
}
}
} else if model.type == 2 {
......
......@@ -36,6 +36,10 @@ class YHOrderTipsItemView: UIView {
} else if msg.type == YHMessageType.infoSubmit.rawValue {
return "资料递交"
} else if msg.type == YHMessageType.identityApproved.rawValue {
return "身份获批"
} else {
return "--"
}
......
......@@ -224,8 +224,9 @@ extension YHServiceOrderListView : UITableViewDelegate,UITableViewDataSource {
navigationController?.pushViewController(vc)
} else if model.type == 13 { //原则批已获批~
principleViewModel.requestIsSendMail(orderId: orderID) { isSend in
YHHUD.show(.progress(message:"加载中"))
self.principleViewModel.requestIsSendMail(orderId: orderID) { isSend in
YHHUD.hide()
if isSend {
// 已发送邮件
let vc = YHPrincipleApprovedMailViewController()
......
......@@ -206,6 +206,9 @@ extension YHPrincipleUploadListVC {
let agree = YHPrincipleRequestModel()
agree.id = agreementModel.id
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
files.append(agree)
......@@ -214,6 +217,9 @@ extension YHPrincipleUploadListVC {
let opinion = YHPrincipleRequestModel()
opinion.id = opinionModel.id
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
files.append(opinion)
......@@ -223,6 +229,9 @@ extension YHPrincipleUploadListVC {
let other = YHPrincipleRequestModel()
other.id = otherModel.id
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
files.append(other)
......
......@@ -187,13 +187,6 @@ extension YHPrincipleWaitResultViewController: UITableViewDelegate, UITableViewD
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 {
return UITableView.automaticDimension
}
......
......@@ -12,6 +12,7 @@ class YHPrinciplePhotoCollectCell: UICollectionViewCell {
static let cellReuseIdentifier = "YHPrinciplePhotoCollectCell"
var clickBlock: (()->())?
lazy var imgView: UIImageView = {
let imgView = UIImageView()
imgView.layer.cornerRadius = 3.0
......@@ -67,6 +68,9 @@ class YHPrinciplePhotoCollectCell: UICollectionViewCell {
self.addSubview(imgView)
self.addSubview(titleLabel)
let tap = UITapGestureRecognizer(target: self, action: #selector(didPhotoClicked))
self.contentView.addGestureRecognizer(tap)
imgView.snp.makeConstraints { make in
make.left.right.top.equalToSuperview()
make.height.equalTo(80.0)
......@@ -78,6 +82,10 @@ class YHPrinciplePhotoCollectCell: UICollectionViewCell {
make.height.equalTo(18.0)
}
}
@objc func didPhotoClicked() {
clickBlock?()
}
}
......
......@@ -216,11 +216,18 @@ extension YHPrinciplePhotoListCell: UICollectionViewDelegateFlowLayout, UICollec
if 0 <= indexPath.item, indexPath.item < items.count {
let model = items[indexPath.item]
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
}
private func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) {
print("index is \(indexPath.row)")
}
}
......@@ -36,6 +36,8 @@ class YHPrincipleProfileItemView: UIView {
lazy var titleLabel: UILabel = {
let label = UILabel()
label.font = UIFont.PFSC_R(ofSize: 14)
label.numberOfLines = 0
label.lineBreakMode = .byCharWrapping
label.textColor = UIColor.mainTextColor(alpha: 0.7)
label.textAlignment = .left
return label
......@@ -202,6 +204,7 @@ class YHPrincipleProfileListCell: UITableViewCell {
var lastItemView: UIView = listTitleLabel
for (index, item) in items.enumerated() {
let itemView = YHPrincipleProfileItemView(frame: .zero)
let viewHeight = self.getHeight(text: item.name, font: itemView.titleLabel.font, width: KScreenWidth-118.0)
itemView.updateModel(item)
if model.type == .entry {
itemView.btnClick = {
......@@ -224,7 +227,7 @@ class YHPrincipleProfileListCell: UITableViewCell {
whiteView.addSubview(itemView)
itemView.snp.makeConstraints { make in
make.left.right.equalTo(0)
make.height.equalTo(YHPrincipleProfileItemView.viewH)
make.height.equalTo(viewHeight)
make.top.equalTo(lastItemView.snp.bottom).offset(16.0)
if index == items.count-1 {
make.bottom.equalTo(-16.0)
......@@ -289,4 +292,16 @@ class YHPrincipleProfileListCell: UITableViewCell {
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 {
return model
}()
let principleViewModel: YHPrincleViewModel = YHPrincleViewModel()
lazy var navBar: YHCustomNavigationBar = {
let bar = YHCustomNavigationBar.navBar()
bar.backgroundColor = .white
......@@ -265,6 +268,10 @@ extension YHMessageDetailListVC: UITableViewDelegate, UITableViewDataSource {
}
self.navigationController?.popToRootViewController(animated: false)
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 {
let model = YHMsgViewModel()
return model
}()
private let serviceCenterViewModel : YHServiceCenterMainViewModel = YHServiceCenterMainViewModel()
var isNotifyEnabled = false
lazy var tableView: UITableView = {
......@@ -149,6 +152,10 @@ class YHMessageListVC: YHBaseViewController {
if !YHLoginManager.shared.isLogin() {
return
}
self.requestOrderStatus {
isHidden in
self.viewModel.getUnreadMsgList {
[weak self] success, error in
guard let self = self else { return }
......@@ -178,18 +185,56 @@ class YHMessageListVC: YHBaseViewController {
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()
}
}
}
func requestOrderStatus(callback:((_ isHidden: Bool)->())?) {
// 先获取订单列表
self.serviceCenterViewModel.getContactList {
[weak self] success, error in
guard let self = self else { return }
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)
}
}
}
func markAllMsgsRead() {
YHHUD.show(.progress(message: "清除中..."))
......
......@@ -16,6 +16,7 @@ enum YHMessageType: Int {
case draft = 3 // 文书定稿
case fileSign = 4 // 文件签字
case infoSubmit = 5 // 资料递交
case identityApproved = 6 // 身份获批
}
class YHMessageInfoModel: SmartCodable {
......@@ -50,6 +51,9 @@ class YHMessageInfoModel: SmartCodable {
} else if type == YHMessageType.infoSubmit.rawValue {
return "资料递交"
} else if type == YHMessageType.identityApproved.rawValue {
return "身份获批"
}
return ""
}
......@@ -61,6 +65,7 @@ class YHMsgListModel: SmartCodable {
var draft: YHMessageInfoModel = YHMessageInfoModel()
var signature: YHMessageInfoModel = YHMessageInfoModel()
var dataSubmission: YHMessageInfoModel = YHMessageInfoModel()
var approval: YHMessageInfoModel = YHMessageInfoModel()
required init() {
self.information.type = YHMessageType.infoFill.rawValue
......@@ -68,6 +73,7 @@ class YHMsgListModel: SmartCodable {
self.draft.type = YHMessageType.draft.rawValue
self.signature.type = YHMessageType.fileSign.rawValue
self.dataSubmission.type = YHMessageType.infoSubmit.rawValue
self.approval.type = YHMessageType.identityApproved.rawValue
}
enum CodingKeys: String, CodingKey {
......
......@@ -56,6 +56,9 @@ class YHDetailMessageCell: UITableViewCell {
if !model.url.isEmpty {
bottomBtn.setTitle("去签字".local, for: .normal)
}
} else if type == YHMessageType.identityApproved.rawValue {
bottomBtn.setTitle("去查看".local, for: .normal)
}
}
......
......@@ -48,6 +48,9 @@ class YHMessageSessionCell: UITableViewCell {
} else if model.type == YHMessageType.infoSubmit.rawValue {
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
......
......@@ -37,6 +37,8 @@ class YHMsgViewModel: NSObject {
self.msgList.draft.type = YHMessageType.draft.rawValue
self.msgList.signature.type = YHMessageType.fileSign.rawValue
self.msgList.dataSubmission.type = YHMessageType.infoSubmit.rawValue
self.msgList.approval.type = YHMessageType.identityApproved.rawValue
callBackBlock(true, nil)
} 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