Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
galaxy-iOS
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mobile-group
galaxy-iOS
Commits
ce9c4382
Commit
ce9c4382
authored
Mar 17, 2024
by
David黄金龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、修改版本号
2、处理按钮点击的bug 3、处理图片压缩的问题
parent
7b75a479
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
63 additions
and
67 deletions
+63
-67
project.pbxproj
galaxy/galaxy.xcodeproj/project.pbxproj
+4
-4
YHInformationFillTipsAlertView.swift
...igentService(服务中心)/V/YHInformationFillTipsAlertView.swift
+4
-2
UIImage+Extension.swift
...xy/galaxy/Classes/Tools/Extention/UIImage+Extension.swift
+55
-61
No files found.
galaxy/galaxy.xcodeproj/project.pbxproj
View file @
ce9c4382
...
...
@@ -2483,7 +2483,7 @@
CODE_SIGN_IDENTITY
=
"Apple Development"
;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]"
=
"iPhone Developer"
;
CODE_SIGN_STYLE
=
Manual
;
CURRENT_PROJECT_VERSION
=
3
;
CURRENT_PROJECT_VERSION
=
1
;
DEVELOPMENT_TEAM
=
""
;
"DEVELOPMENT_TEAM[sdk=iphoneos*]"
=
RXHYW88XR7
;
ENABLE_USER_SCRIPT_SANDBOXING
=
NO
;
...
...
@@ -2503,7 +2503,7 @@
"$(inherited)"
,
"@executable_path/Frameworks"
,
);
MARKETING_VERSION
=
0.
1.9
;
MARKETING_VERSION
=
0.
2.1
;
PRODUCT_BUNDLE_IDENTIFIER
=
com.intelligence.galaxy
;
PRODUCT_NAME
=
"$(TARGET_NAME)"
;
PROVISIONING_PROFILE_SPECIFIER
=
""
;
...
...
@@ -2525,7 +2525,7 @@
CODE_SIGN_IDENTITY
=
"Apple Development"
;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]"
=
"iPhone Developer"
;
CODE_SIGN_STYLE
=
Manual
;
CURRENT_PROJECT_VERSION
=
3
;
CURRENT_PROJECT_VERSION
=
1
;
DEVELOPMENT_TEAM
=
""
;
"DEVELOPMENT_TEAM[sdk=iphoneos*]"
=
RXHYW88XR7
;
ENABLE_USER_SCRIPT_SANDBOXING
=
NO
;
...
...
@@ -2545,7 +2545,7 @@
"$(inherited)"
,
"@executable_path/Frameworks"
,
);
MARKETING_VERSION
=
0.
1.9
;
MARKETING_VERSION
=
0.
2.1
;
PRODUCT_BUNDLE_IDENTIFIER
=
com.intelligence.galaxy
;
PRODUCT_NAME
=
"$(TARGET_NAME)"
;
PROVISIONING_PROFILE_SPECIFIER
=
""
;
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/V/YHInformationFillTipsAlertView.swift
View file @
ce9c4382
...
...
@@ -41,8 +41,8 @@ class YHInformationFillTipsAlertView: UIView {
let
tableView
=
UITableView
(
frame
:
.
zero
,
style
:
.
plain
)
tableView
.
backgroundColor
=
.
clear
tableView
.
separatorStyle
=
.
none
tableView
.
showsHorizontalScrollIndicator
=
tru
e
tableView
.
showsVerticalScrollIndicator
=
fals
e
tableView
.
showsHorizontalScrollIndicator
=
fals
e
tableView
.
showsVerticalScrollIndicator
=
tru
e
tableView
.
rowHeight
=
UITableView
.
automaticDimension
// tableView.estimatedRowHeight = 100
tableView
.
register
(
YHInformationFillTipsCell
.
self
,
forCellReuseIdentifier
:
YHInformationFillTipsCell
.
cellReuseIdentifier
)
...
...
@@ -121,6 +121,7 @@ class YHInformationFillTipsAlertView: UIView {
let
lable00
=
UILabel
(
text
:
"我确认我所提供的材料真实有效,并知悉其中内容。"
)
lable00
.
font
=
UIFont
.
PFSC_R
(
ofSize
:
12
)
lable00
.
textColor
=
UIColor
.
labelTextColor2
...
...
@@ -148,6 +149,7 @@ class YHInformationFillTipsAlertView: UIView {
make
.
height
.
width
.
equalTo
(
12
)
}
agreeButton
=
selectedBtn
agreeButton
.
YH_clickEdgeInsets
=
UIEdgeInsets
(
top
:
20
,
left
:
20
,
bottom
:
20
,
right
:
20
)
let
topView
=
UIView
()
...
...
galaxy/galaxy/Classes/Tools/Extention/UIImage+Extension.swift
View file @
ce9c4382
...
...
@@ -194,65 +194,59 @@ enum ImageCopmpressSize {
}
extension
UIImage
{
//我们的项目就定不大于200KB
// func compressImage()->Data{
// compressImage(size: .two)
//extension UIImage {
// func compressImage(size:ImageCopmpressSize) -> Data{
// switch size {
// case .one:
// return compressImage(maxLength: 1024*100)
// case .two:
// return compressImage(maxLength: 1024*200)
// case .three:
// return compressImage(maxLength: 1024*300)
// case .four:
// return compressImage(maxLength: 4 * 1024 * 1024)
// }
// }
func
compressImage
(
size
:
ImageCopmpressSize
)
->
Data
{
switch
size
{
case
.
one
:
return
compressImage
(
maxLength
:
1024*
100
)
case
.
two
:
return
compressImage
(
maxLength
:
1024*
200
)
case
.
three
:
return
compressImage
(
maxLength
:
1024*
300
)
case
.
four
:
return
compressImage
(
maxLength
:
3
*
1024
*
1024
)
}
}
// 图片压缩 byte
func
compressImage
(
maxLength
:
Int
)
->
Data
{
// let tempMaxLength: Int = maxLength / 8
let
tempMaxLength
:
Int
=
maxLength
var
compression
:
CGFloat
=
1
guard
var
data
=
self
.
jpegData
(
compressionQuality
:
compression
),
data
.
count
>
tempMaxLength
else
{
return
self
.
jpegData
(
compressionQuality
:
compression
)
!
}
// 压缩大小
var
max
:
CGFloat
=
1
var
min
:
CGFloat
=
0
for
_
in
0
..<
6
{
compression
=
(
max
+
min
)
/
2
data
=
self
.
jpegData
(
compressionQuality
:
compression
)
!
if
CGFloat
(
data
.
count
)
<
CGFloat
(
tempMaxLength
)
*
0.9
{
min
=
compression
}
else
if
data
.
count
>
tempMaxLength
{
max
=
compression
}
else
{
break
}
}
var
resultImage
:
UIImage
=
UIImage
(
data
:
data
)
!
if
data
.
count
<
tempMaxLength
{
return
data
}
// 压缩大小
var
lastDataLength
:
Int
=
0
while
data
.
count
>
tempMaxLength
&&
data
.
count
!=
lastDataLength
{
lastDataLength
=
data
.
count
let
ratio
:
CGFloat
=
CGFloat
(
tempMaxLength
)
/
CGFloat
(
data
.
count
)
print
(
"Ratio ="
,
ratio
)
let
size
:
CGSize
=
CGSize
(
width
:
Int
(
resultImage
.
size
.
width
*
sqrt
(
ratio
)),
height
:
Int
(
resultImage
.
size
.
height
*
sqrt
(
ratio
)))
UIGraphicsBeginImageContext
(
size
)
resultImage
.
draw
(
in
:
CGRect
(
x
:
0
,
y
:
0
,
width
:
size
.
width
,
height
:
size
.
height
))
resultImage
=
UIGraphicsGetImageFromCurrentImageContext
()
!
UIGraphicsEndImageContext
()
data
=
resultImage
.
jpegData
(
compressionQuality
:
compression
)
!
}
return
data
}
}
//
//
// // 图片压缩 byte
// func compressImage(maxLength: Int) -> Data {
// // let tempMaxLength: Int = maxLength / 8
// let tempMaxLength: Int = maxLength
// var compression: CGFloat = 1
// guard var data = self.jpegData(compressionQuality: compression), data.count > tempMaxLength else { return self.jpegData(compressionQuality: compression)! }
//
// // 压缩大小
// var max: CGFloat = 1
// var min: CGFloat = 0
// for _ in 0..<6 {
// compression = (max + min) / 2
// data = self.jpegData(compressionQuality: compression)!
// if CGFloat(data.count) < CGFloat(tempMaxLength) * 0.9 {
// min = compression
// } else if data.count > tempMaxLength {
// max = compression
// } else {
// break
// }
// }
// var resultImage: UIImage = UIImage(data: data)!
// if data.count < tempMaxLength { return data }
//
// // 压缩大小
// var lastDataLength: Int = 0
// while data.count > tempMaxLength && data.count != lastDataLength {
// lastDataLength = data.count
// let ratio: CGFloat = CGFloat(tempMaxLength) / CGFloat(data.count)
// print("Ratio =", ratio)
// let size: CGSize = CGSize(width: Int(resultImage.size.width * sqrt(ratio)),
// height: Int(resultImage.size.height * sqrt(ratio)))
// UIGraphicsBeginImageContext(size)
// resultImage.draw(in: CGRect(x: 0, y: 0, width: size.width, height: size.height))
// resultImage = UIGraphicsGetImageFromCurrentImageContext()!
// UIGraphicsEndImageContext()
// data = resultImage.jpegData(compressionQuality: compression)!
// }
// return data
// }
//}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment