Commit 7b435ffb authored by Steven杜宇's avatar Steven杜宇

// UI走查

parent bae10749
......@@ -1264,6 +1264,7 @@
04D8FF792D97BDBD00703C75 /* YHPlanShareViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04D8FF782D97BDBD00703C75 /* YHPlanShareViewController.swift */; };
04D8FF7B2D97C29E00703C75 /* YHPlanShareView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04D8FF7A2D97C29E00703C75 /* YHPlanShareView.swift */; };
04D8FFB02D9A3CF200703C75 /* YHPlanShareImageCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04D8FFAF2D9A3CF200703C75 /* YHPlanShareImageCell.swift */; };
04D8FFB22DA5007A00703C75 /* YHPictureBrowserViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04D8FFB12DA5007A00703C75 /* YHPictureBrowserViewController.swift */; };
04E4CF3E2D5C6D32004D4013 /* YHCountryMessageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E4CF3D2D5C6D32004D4013 /* YHCountryMessageView.swift */; };
04E4CF402D5C83AE004D4013 /* YHSelectPhoneCountryViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E4CF3F2D5C83AE004D4013 /* YHSelectPhoneCountryViewController.swift */; };
04E507D62D6EE856005F758B /* YHUserLevelAlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E507D52D6EE856005F758B /* YHUserLevelAlertView.swift */; };
......@@ -2570,6 +2571,7 @@
04D8FF782D97BDBD00703C75 /* YHPlanShareViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPlanShareViewController.swift; sourceTree = "<group>"; };
04D8FF7A2D97C29E00703C75 /* YHPlanShareView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPlanShareView.swift; sourceTree = "<group>"; };
04D8FFAF2D9A3CF200703C75 /* YHPlanShareImageCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPlanShareImageCell.swift; sourceTree = "<group>"; };
04D8FFB12DA5007A00703C75 /* YHPictureBrowserViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPictureBrowserViewController.swift; sourceTree = "<group>"; };
04E4CF3D2D5C6D32004D4013 /* YHCountryMessageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCountryMessageView.swift; sourceTree = "<group>"; };
04E4CF3F2D5C83AE004D4013 /* YHSelectPhoneCountryViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSelectPhoneCountryViewController.swift; sourceTree = "<group>"; };
04E507D52D6EE856005F758B /* YHUserLevelAlertView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHUserLevelAlertView.swift; sourceTree = "<group>"; };
......@@ -5982,6 +5984,7 @@
children = (
045C0EFE2D12CA5E00BD2DC0 /* YHLongtapPictureSheetView.swift */,
045C0EFF2D12CA5E00BD2DC0 /* YHPictureReviewManager.swift */,
04D8FFB12DA5007A00703C75 /* YHPictureBrowserViewController.swift */,
);
path = "PictureReview(图片预览)";
sourceTree = "<group>";
......@@ -7497,6 +7500,7 @@
045C10C92D12CA5F00BD2DC0 /* YHResignUploadTravelCardListModel.swift in Sources */,
045C10CA2D12CA5F00BD2DC0 /* YHDocListBottomView.swift in Sources */,
045C10CB2D12CA5F00BD2DC0 /* YHPreviewInfoCertificatePictureItemView.swift in Sources */,
04D8FFB22DA5007A00703C75 /* YHPictureBrowserViewController.swift in Sources */,
045C10CC2D12CA5F00BD2DC0 /* YHAIChatBannerItemCell.swift in Sources */,
045C10CD2D12CA5F00BD2DC0 /* YHLoginPrivacyView.swift in Sources */,
045C10CE2D12CA5F00BD2DC0 /* YHPrincipleUploadListVC.swift in Sources */,
......
//
// YHPictureBrowserViewController.swift
// galaxy
//
// Created by Dufet on 2025/4/8.
// Copyright © 2025 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import JXPhotoBrowser
import Photos
import PhotosUI
class YHPictureBrowserViewController: JXPhotoBrowser {
var getImgUrlBlock: ((Int) -> (String))?
lazy var navBar: UIView = {
let v = UIView()
let backBtn = UIButton()
backBtn.setImage(UIImage(named: "nav_back_white"), for: .normal)
backBtn.addTarget(self, action: #selector(didBackBtnClicked), for: .touchUpInside)
v.addSubview(backBtn)
let saveBtn = UIButton()
let img = UIImage(named: "photo_brower_save")
let templateImage = img?.withRenderingMode(.alwaysTemplate)
saveBtn.setImage(templateImage, for: .normal)
saveBtn.imageView?.tintColor = .white
saveBtn.addTarget(self, action: #selector(didSaveBtnClicked), for: .touchUpInside)
v.addSubview(saveBtn)
backBtn.snp.makeConstraints { make in
make.width.height.equalTo(44)
make.left.equalToSuperview()
make.bottom.equalToSuperview()
}
saveBtn.snp.makeConstraints { make in
make.width.height.equalTo(44)
make.right.equalToSuperview()
make.bottom.equalToSuperview()
}
return v
}()
@objc func didBackBtnClicked() {
dismiss()
}
@objc func didSaveBtnClicked() {
let index = self.browserView.pageIndex
if let block = self.getImgUrlBlock {
let url = block(self.pageIndex)
saveLocalPictureSyn(url)
}
}
override func viewDidLoad() {
super.viewDidLoad()
view.addSubview(navBar)
navBar.snp.makeConstraints { make in
make.left.right.top.equalToSuperview()
make.height.equalTo(k_Height_NavigationtBarAndStatuBar)
}
}
func saveLocalPictureSyn(_ picUrl: String) {
let imageView = UIImageView()
imageView.kf.setImage(with: URL(string: picUrl)) { result in
switch result {
case .success(let value):
self.saveImage(value.image)
case .failure:
YHHUD.flash(message: "保存失败")
}
}
}
func saveImage(_ image: UIImage) {
// 确保应用有权访问相册
PHPhotoLibrary.requestAuthorization { status in
if status == .authorized {
// 保存图片到相册
DispatchQueue.main.async {
UIImageWriteToSavedPhotosAlbum(image, nil, nil, nil)
YHHUD.flash(message: "保存成功")
}
} else {
DispatchQueue.main.async {
YHHUD.flash(message: "保存失败,请检查系统权限")
}
}
}
}
}
......@@ -30,7 +30,7 @@ extension YHPictureReviewManager {
self.curIndex = curIndex
self.arrPics = arrPicturs
let browser = JXPhotoBrowser()
let browser = YHPictureBrowserViewController()
browser.numberOfItems = {
self.arrPics.count
}
......@@ -54,6 +54,14 @@ extension YHPictureReviewManager {
}
}
browser.getImgUrlBlock = { [weak self] index in
guard let self = self else { return "" }
if 0 <= index, index < self.arrPics.count {
return self.arrPics[index]
}
return ""
}
// 数字样式的页码指示器
browser.pageIndicator = JXPhotoBrowserNumberPageIndicator()
browser.pageIndex = self.curIndex
......
......@@ -43,16 +43,19 @@ class YHPlanPolicyDetailViewController: YHBaseViewController {
}()
lazy var collectionView: UICollectionView = {
let layout = UICollectionViewFlowLayout()
layout.minimumInteritemSpacing = 0.0
layout.minimumLineSpacing = 0.0
layout.scrollDirection = .horizontal
let collectView = UICollectionView(frame: CGRect(x: 0, y: k_Height_NavigationtBarAndStatuBar+24.0, width: KScreenWidth, height: 520), collectionViewLayout: layout)
collectView.backgroundColor = .clear
collectView.delegate = self
collectView.dataSource = self
collectView.register(YHPlanShareImageCell.self, forCellWithReuseIdentifier: YHPlanShareImageCell.cellReuseIdentifier)
collectView.isPagingEnabled = true
collectView.showsHorizontalScrollIndicator = false
return collectView
}()
......@@ -204,7 +207,9 @@ extension YHPlanPolicyDetailViewController: UICollectionViewDelegate, UICollecti
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
if 0 <= indexPath.item && indexPath.item < imgs.count {
// let text = topicArr[indexPath.item]
let model = imgs[indexPath.item]
YHPictureReviewManager.shared.showNetWorkPicturs(curIndex: 0, arrPicturs: [model.model.image_poster])
}
}
}
......
......@@ -11,6 +11,15 @@ import AttributedString
class YHPlanAnalyzeInfoView: UIView {
var desc: String = "" {
didSet {
if desc.isEmpty {
descLabel.text = "——"
} else {
descLabel.text = desc
}
}
}
lazy var titleLabel: UILabel = {
let lable = UILabel()
lable.textColor = UIColor.mainTextColor
......@@ -88,9 +97,9 @@ class YHPlanAnalyzeInfoCell: UITableViewCell {
let bb: ASAttributedString = .init("/5.0", .font(UIFont(name: "DINAlternate-Bold", size: 14)!), .foreground(UIColor.init(hex: 0x8993A2)))
scoreLabel.attributed.text = aa+bb
currentStateVeiw.descLabel.text = model.current_state
requireVeiw.descLabel.text = model.hong_kong_policy
suggestVeiw.descLabel.text = model.suggest
currentStateVeiw.desc = model.current_state
requireVeiw.desc = model.hong_kong_policy
suggestVeiw.desc = model.suggest
products = model.solution_plan
}
......
......@@ -69,7 +69,7 @@ class YHPlanPolicyCarouselView: UIView {
pageControl.numberOfPages = 0
pageControl.currentPage = 0
pageControl.dotColor = .init(hex: 0xD5DAE1)
pageControl.selectedDotColor = .brandMainColor
pageControl.selectedDotColor = .mainTextColor
return pageControl
}()
......
......@@ -17,9 +17,9 @@ class YHPlanProductItemView: UIView {
titleLabel.text = product.title
descLabel.text = product.description
if let url = URL(string: product.img_url) {
iconImgV.sd_setImage(with: url, placeholderImage: UIImage(named: "global_default_image"))
iconImgV.sd_setImage(with: url, placeholderImage: UIImage(named: "plan_product_default"))
} else {
iconImgV.image = UIImage(named: "global_default_image")
iconImgV.image = UIImage(named: "plan_product_default")
}
}
}
......@@ -141,7 +141,7 @@ class YHPlanProductListView: UIView {
let lable = UILabel()
lable.textColor = UIColor.init(hex: 0xAE6C32)
lable.textAlignment = .left
lable.font = UIFont.PFSC_M(ofSize: 15)
lable.font = UIFont.PFSC_M(ofSize: 13)
lable.text = "增购以下产品可提升生活联系"
return lable
}()
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "下保存图片@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "下保存图片@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"template-rendering-intent" : "template"
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "缺省图@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "缺省图@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