Commit 9dae81c0 authored by Steven杜宇's avatar Steven杜宇

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

parents 07838037 2e0e4b0b
This diff is collapsed.
//
// YHHomeKingKongBlockModel.swift
// galaxy
//
// Created by davidhuangA on 2024/4/8.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHHomeKingKongBlockModel {
var type : String
var iconName : String
var title : String
init(type: String, iconName: String, title: String) {
self.type = type
self.iconName = iconName
self.title = title
}
}
......@@ -65,6 +65,6 @@ private extension YHHomeHeadView {
make.left.right.equalToSuperview()
make.height.equalTo(YHHomeKingKongBlockView.viewH)
}
homeKingKongBlock.backgroundColor = .purple
// homeKingKongBlock.backgroundColor = .purple
}
}
//
// YHHomeKingKongBlockItem.swift
// galaxy
//
// Created by davidhuangA on 2024/4/8.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHHomeKingKongBlockItem: UIView {
override init(frame: CGRect) {
super.init(frame: frame)
initView()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
lazy var iconV: UIImageView = {
let imageV = UIImageView()
imageV.contentMode = .scaleAspectFill
return imageV
}()
lazy var subtitleLable:UILabel = {
let label = UILabel()
label.text = "去香港"
label.textColor = UIColor(hex: 0x94A3B8, alpha: 1.0)
label.font = UIFont.PFSC_M(ofSize: 12)
label.lineBreakMode = .byTruncatingMiddle
label.textAlignment = .center
// label.minimumScaleFactor = 0.5
return label
}()
var dataModel : YHHomeKingKongBlockModel? {
didSet {
updateUI()
}
}
}
private extension YHHomeKingKongBlockItem {
func initView() {
backgroundColor = UIColor(hex: 0xF8FAFB, alpha: 1.0)
addSubview(iconV)
iconV.snp.makeConstraints { make in
make.centerX.equalToSuperview()
make.width.height.equalTo(31)
make.top.equalTo(10)
}
addSubview(subtitleLable)
subtitleLable.snp.makeConstraints { make in
make.centerX.equalToSuperview()
make.left.equalTo(4)
make.right.equalTo(-4)
make.height.equalTo(18)
make.bottom.equalTo(-8)
}
}
func updateUI() {
guard let dataModel = dataModel else { return }
iconV.image = UIImage(named: dataModel.iconName)
subtitleLable.text = dataModel.title
}
}
......@@ -10,7 +10,7 @@ import UIKit
class YHHomeKingKongBlockView: UIView {
static let viewH : CGFloat = 71.0
static let viewH : CGFloat = (KScreenWidth - 20 * 2 - 16 * 3) / 4.0
override init(frame: CGRect) {
super.init(frame: frame)
......@@ -20,10 +20,30 @@ class YHHomeKingKongBlockView: UIView {
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
var arrData : [YHHomeKingKongBlockModel] = [
YHHomeKingKongBlockModel(type: "1", iconName: "kingkong_sffl", title: "身份福利"),
YHHomeKingKongBlockModel(type: "2", iconName: "kingkong_blgl", title: "办理攻略"),
YHHomeKingKongBlockModel(type: "3", iconName: "kingkong_khxs", title: "客户心声"),
YHHomeKingKongBlockModel(type: "4", iconName: "kingkong_xgbs", title: "香港办事"),
]
}
private extension YHHomeKingKongBlockView {
func initView() {
let gap : CGFloat = 16.0
var offsetX : CGFloat = 0.0
for (_,item) in arrData.enumerated() {
let view = YHHomeKingKongBlockItem()
view.dataModel = item
addSubview(view)
view.snp.makeConstraints { make in
make.top.equalToSuperview()
make.left.equalTo(offsetX)
make.width.height.equalTo(YHHomeKingKongBlockView.viewH)
}
offsetX = offsetX + YHHomeKingKongBlockView.viewH + gap
}
}
}
......@@ -14,9 +14,10 @@ class YHServerHKLifeViewController: YHBaseViewController {
private let serviceCenterMainReqVM : YHServiceCenterMainViewModel = YHServiceCenterMainViewModel()
var tableHeadView: YHServerTableHeadView!
var tableFootView: YHServiceTableFootView!
var sectionView: YHServiceSectionView!
var homeTableView: UITableView = {
let tableView = UITableView(frame: .zero, style: .grouped)
let tableView = UITableView(frame: .zero, style: .plain)
tableView.backgroundColor = .clear
tableView.separatorStyle = .none
tableView.showsHorizontalScrollIndicator = false
......@@ -60,10 +61,15 @@ extension YHServerHKLifeViewController {
gk_navBarAlpha = 0
gk_navigationBar.isHidden = true
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 - k_Height_safeAreaInsetsTop() - 48 - k_Height_TabBar)
tableFootView.frame = CGRect(x: 0, y: 0, width: KScreenWidth, height: KScreenHeight)
view.addSubview(homeTableView)
homeTableView.tableHeaderView = tableHeadView
homeTableView.tableFooterView = tableFootView
......@@ -95,12 +101,11 @@ extension YHServerHKLifeViewController : UITableViewDelegate,UITableViewDataSour
}
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
return kMargin
return 48
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let view = UIView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: kMargin))
return view
return sectionView
}
func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
......@@ -113,33 +118,16 @@ extension YHServerHKLifeViewController : UITableViewDelegate,UITableViewDataSour
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 81
return 0.1
}
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]
}
let cell0 = UITableViewCell()
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)
}
}
......
......@@ -290,7 +290,9 @@ class YHMyDocumentsDetailViewController: YHBaseViewController {
func showSureAlert() {
YHCommonAlertView.show("", "请确认是否已完成编辑并提交", "取消", "确认") {[weak self] in
guard let self = self else { return }
YHHUD.show(.progress(message: ""))
self.viewModel.requestDocumentSubmit("\(self.id)") {[weak self] success, error in
YHHUD.hide()
guard let self = self else { return }
if success {
YHHUD.flash(message: "提交成功")
......
......@@ -159,27 +159,21 @@ class YHDocListCell: UITableViewCell {
var color : UIColor = .brandMainColor
let status = dataSource.status
if status == 1 {
if status == 2 {
statusTxt = "待确认"
color = UIColor.brandMainColor
} else if status == 2 {
statusTxt = "待签章"
color = UIColor.brandMainColor
} else if status == 3 {
statusTxt = "已驳回"
color = UIColor.failColor
statusTxt = "核对中"
color = UIColor.warnColor
} else if status == 4 {
statusTxt = "核对中"
color = UIColor.warnColor
} else if status == 5 {
statusTxt = "已签章"
color = UIColor.successColor
statusTxt = "已驳回"
color = UIColor.failColor
} else if status == 6 {
statusTxt = "已定稿"
color = UIColor.labelTextColor2
} else if status == 7 {
statusTxt = "已完成"
color = UIColor.labelTextColor2
} else {
statusTxt = "--"
color = UIColor.failColor
......@@ -230,7 +224,6 @@ class YHDocListCell: UITableViewCell {
}
statusLabel.text = statusTxt
statusLabel.textColor = color
}
}
......
......@@ -9,8 +9,8 @@
import UIKit
class YHServerTableHeadView: UIView {
var search: UIView!
var bannarView: UIView!
var search: YHHomeSearchView!
var bannarView: YHServiceBannerView!
var titleLabel: UILabel!
var dataSource: YHScemeHeadModel? {
......@@ -30,7 +30,7 @@ class YHServerTableHeadView: UIView {
func setUpView() {
search = {
let view = UIView()
let view = YHHomeSearchView()
return view
}()
addSubview(search)
......@@ -42,8 +42,7 @@ class YHServerTableHeadView: UIView {
}
bannarView = {
let view = UIView()
view.backgroundColor = .white
let view = YHServiceBannerView()
return view
}()
addSubview(bannarView)
......
//
// YHServiceBannerView.swift
// galaxy
//
// Created by EDY on 2024/4/8.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import FSPagerView
class YHServiceBannerView: UIView {
// 位置、大小、图片、文本
fileprivate var dataArr: [YHBannerModel] = [YHBannerModel(),YHBannerModel(),YHBannerModel(),YHBannerModel(),YHBannerModel()]
override init(frame: CGRect) {
super.init(frame: frame)
initView()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
private lazy var bannerView: FSPagerView = {
let view = FSPagerView()
view.delegate = self
view.dataSource = self
view.automaticSlidingInterval = 3
view.register(FSPagerViewCell.self, forCellWithReuseIdentifier: "cell")
view.itemSize = FSPagerView.automaticSize
view.interitemSpacing = 10
return view
}()
lazy var pageControl: FSPageControl = {
let view = FSPageControl()
return view
}()
}
private extension YHServiceBannerView {
func initView() {
addSubview(bannerView)
bannerView.snp.makeConstraints { make in
make.top.left.right.bottom.equalToSuperview()
}
bannerView.addSubview(pageControl)
pageControl.snp.makeConstraints { make in
make.left.bottom.right.equalToSuperview()
make.height.equalTo(25)
}
setupPageControl()
bannerView.reloadData()
}
func setupPageControl() {
self.pageControl.numberOfPages = self.dataArr.count
self.pageControl.contentHorizontalAlignment = .center
self.pageControl.contentInsets = UIEdgeInsets(top: 0, left: 12, bottom: 10, right: 12)
let normalImage = UIImage(color: UIColor(hex: 0xff0000, alpha: 1.0), size: CGSize(width: 5, height: 5))
let selectImage = UIImage(color: .white, size: CGSize(width: 8, height: 5))
self.pageControl.setImage(normalImage, for: .normal)
self.pageControl.setImage(selectImage, for: .selected)
self.pageControl.interitemSpacing = 3
}
}
extension YHServiceBannerView: FSPagerViewDataSource, FSPagerViewDelegate {
public func numberOfItems(in pagerView: FSPagerView) -> Int {
return self.dataArr.count
}
public func pagerView(_ pagerView: FSPagerView, cellForItemAt index: Int) -> FSPagerViewCell {
let cell = pagerView.dequeueReusableCell(withReuseIdentifier: "cell", at: index)
let image = UIImage(named: "default_placeholder_image")?.bs_scaled(toWidth: UIDevice.kScreenW - 16*2, opaque: false)
cell.imageView?.image = image
if index < dataArr.count {
let model = dataArr[index]
if let url = URL(string: model.img_url) {
cell.imageView?.kf.setImage(with: url)
}
cell.textLabel?.text = model.title
}
cell.imageView?.contentMode = .scaleAspectFill
cell.backgroundColor = .contentBkgColor
cell.contentView.layer.shadowColor = UIColor.clear.cgColor
return cell
}
// MARK: - FSPagerView Delegate
func pagerView(_ pagerView: FSPagerView, didSelectItemAt index: Int) {
pagerView.deselectItem(at: index, animated: true)
pagerView.scrollToItem(at: index, animated: true)
if index >= dataArr.count {
return
}
let model = dataArr[index]
switch model.link_type {
case 10: //跳转H5
// let vc = BsWebViewController()
// vc.urlString = model.link_url
// UIViewController.navTopViewController?.navigationController?.pushViewController(vc, animated: true)
break
case 20: //跳转原生页面
if let vc = UIViewController.classFromString(model.link_url) {
UIViewController.navTopViewController?.navigationController?.pushViewController(vc, animated: true)
}
break
default:
break
}
}
func pagerViewWillEndDragging(_ pagerView: FSPagerView, targetIndex: Int) {
self.pageControl.currentPage = targetIndex
}
func pagerViewDidEndScrollAnimation(_ pagerView: FSPagerView) {
self.pageControl.currentPage = pagerView.currentIndex
}
}
//
// YHServiceSectionView.swift
// galaxy
//
// Created by EDY on 2024/4/8.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHServiceSectionView: UIView {
var items: [String] = []
lazy var myCollectView = {
// 设置布局方向
let flowLayout = UICollectionViewFlowLayout()
flowLayout.itemSize = CGSize(width: 75, height: 32)
flowLayout.minimumInteritemSpacing = 12.0
flowLayout.minimumLineSpacing = 12.0
flowLayout.scrollDirection = .horizontal
let collectinoView = UICollectionView(frame: .zero, collectionViewLayout: flowLayout)
collectinoView.backgroundColor = .white
collectinoView.contentInset = UIEdgeInsets(top: 10, left: 20, bottom: 0, right: 20)
collectinoView.register(YHServiceSectionCollectionViewCell.self, forCellWithReuseIdentifier:YHServiceSectionCollectionViewCell.cellReuseIdentifier)
collectinoView.delegate = self
collectinoView.dataSource = self
collectinoView.showsVerticalScrollIndicator = false
collectinoView.translatesAutoresizingMaskIntoConstraints = false
collectinoView.alwaysBounceVertical = true
return collectinoView
}()
var dataSource: YHScemeHeadModel? {
didSet {
updateAllViews()
}
}
override init(frame: CGRect) {
super.init(frame: frame)
backgroundColor = .white
setUpView()
self.items = ["优才","高才","留学","专才"]
self.myCollectView.reloadData()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func setUpView() {
backgroundColor = .white
addSubview(myCollectView)
myCollectView.snp.makeConstraints { make in
make.top.left.right.bottom.equalToSuperview()
}
// self.myCollectView.es.addInfiniteScrolling {
// self.loadFakeData()
// }
}
func updateAllViews() {
guard let model = dataSource else { return }
}
}
extension YHServiceSectionView: UICollectionViewDelegate, UICollectionViewDataSource {
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return items.count
}
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHServiceSectionCollectionViewCell.cellReuseIdentifier, for: indexPath) as! YHServiceSectionCollectionViewCell
cell.dataSource = items[indexPath.row]
return cell
}
private func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) {
print("index is \(indexPath.row)")
}
}
class YHServiceSectionCollectionViewCell: UICollectionViewCell {
static let cellReuseIdentifier = "YHServiceSectionCollectionViewCell"
var dataSource: String? {
didSet {
updataAllSubViews()
}
}
lazy var descripeLable:UILabel = {
let label = UILabel()
label.text = "赴港"
label.textColor = UIColor(hex: 0x94a3bb)
label.font = UIFont.PFSC_R(ofSize: 13)
label.textAlignment = .center
return label
}()
required init?(coder: NSCoder) {
super.init(coder: coder)
}
override init(frame: CGRect) {
super.init(frame: frame)
setupUI()
}
private func setupUI() {
contentView.backgroundColor = UIColor(hex: 0xf4f6fa)
contentView.clipsToBounds = true
contentView.layer.cornerRadius = 16
contentView.addSubview(descripeLable)
descripeLable.snp.makeConstraints { make in
make.top.left.right.bottom.equalToSuperview()
}
}
func updataAllSubViews() {
guard let dataSource = dataSource else { return }
descripeLable.text = dataSource
}
}
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Frame 1@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Frame 1@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Frame 1@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Frame 1@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Frame 1@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Frame 1@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Frame 1@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Frame 1@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