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
a01e99a2
Commit
a01e99a2
authored
Apr 08, 2025
by
Steven杜宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
// pdf 名字
parent
b8009176
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
+11
-4
YHPlanShareViewController.swift
...lasses/Modules/Plan(方案)/C/YHPlanShareViewController.swift
+11
-4
No files found.
galaxy/galaxy/Classes/Modules/Plan(方案)/C/YHPlanShareViewController.swift
View file @
a01e99a2
...
...
@@ -136,8 +136,8 @@ class YHPlanShareViewController: YHBaseViewController {
}
else
if
type
==
.
pdf
{
if
let
sourceUrl
=
URL
(
string
:
pdfDownloadUrl
)
{
let
lastComponent
=
sourceUrl
.
lastPathComponent
let
destinationURL
=
self
.
planDocumentFileUrl
.
appendingPathComponent
(
lastComponent
)
let
fileName
=
getPDFFileName
()
let
destinationURL
=
self
.
planDocumentFileUrl
.
appendingPathComponent
(
fileName
)
if
eventType
==
.
wechat
{
if
FileManager
.
default
.
fileExists
(
atPath
:
destinationURL
.
path
)
{
let
fileName
=
destinationURL
.
lastPathComponent
...
...
@@ -264,13 +264,20 @@ class YHPlanShareViewController: YHBaseViewController {
task
.
resume
()
}
func
getPDFFileName
()
->
String
{
let
dateFormatter
=
DateFormatter
()
dateFormatter
.
dateFormat
=
"yyyy-MM-dd"
// HH:mm:ss
let
dateString
=
dateFormatter
.
string
(
from
:
Date
())
return
"香港续签至永居方案"
+
dateString
+
".pdf"
}
func
savePDF
(
sourceUrl
:
URL
,
locationUrl
:
URL
,
isShowLoading
:
Bool
)
{
let
fileManager
=
FileManager
.
default
// 保存文件到 plan 目录
let
lastComponent
=
sourceUrl
.
lastPathComponent
let
destinationURL
=
self
.
planDocumentFileUrl
.
appendingPathComponent
(
lastComponent
)
let
fileName
=
getPDFFileName
()
let
destinationURL
=
self
.
planDocumentFileUrl
.
appendingPathComponent
(
fileName
)
do
{
// 如果文件已存在,先移除
if
fileManager
.
fileExists
(
atPath
:
destinationURL
.
path
)
{
...
...
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