Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
self-support
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
李俊赕
self-support
Commits
54d3979d
Commit
54d3979d
authored
4 years ago
by
Damon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
同步保存图片
parent
bb5c7fc0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
30 deletions
+34
-30
preview.vue
src/components/photo/preview.vue
+34
-30
No files found.
src/components/photo/preview.vue
View file @
54d3979d
...
...
@@ -64,36 +64,40 @@
methods
:
{
// 保存照片到本地
async
saveTempToLocal
(
tempImagePath
)
{
//has_origin //是否保存原图
let
that
=
this
const
photo
=
getApp
().
globalData
.
photo
if
(
!
photo
.
tempPath
){
return
}
let
path
=
''
if
(
photo
.
tempPath
.
origin
&&
photo
.
waterSetting
.
hasOrigin
){
// 保存原图到本地
path
=
photo
.
tempPath
.
origin
let
result
=
await
this
.
saveLocal
(
path
)
if
(
result
){
uni
.
showToast
({
icon
:
'none'
,
title
:
'已将照片原图保存到本地相册'
})
return
new
Promise
(
async
(
resolve
,
reject
)
=>
{
//has_origin //是否保存原图
let
that
=
this
const
photo
=
getApp
().
globalData
.
photo
if
(
!
photo
.
tempPath
){
return
}
}
if
(
photo
.
tempPath
.
mixWater
){
// 保存水印处理图片到本地
path
=
photo
.
tempPath
.
mixWater
let
result1
=
await
this
.
saveLocal
(
path
)
if
(
result1
)
{
uni
.
showToast
({
icon
:
'none'
,
title
:
'已将水印图片保存到本地相册'
}
)
let
path
=
''
if
(
photo
.
tempPath
.
origin
&&
photo
.
waterSetting
.
hasOrigin
){
// 保存原图到本地
path
=
photo
.
tempPath
.
origin
let
result
=
await
this
.
saveLocal
(
path
)
if
(
result
){
uni
.
showToast
(
{
icon
:
'none'
,
title
:
'已将照片原图保存到本地相册'
})
}
}
}
if
(
photo
.
tempPath
.
mixWater
){
// 保存水印处理图片到本地
path
=
photo
.
tempPath
.
mixWater
console
.
log
(
"path"
,
path
)
let
result1
=
await
this
.
saveLocal
(
path
)
if
(
result1
){
uni
.
showToast
({
icon
:
'none'
,
title
:
'已将水印图片保存到本地相册'
})
resolve
()
}
}
})
},
saveLocal
(
path
){
return
new
Promise
((
resolve
,
reject
)
=>
{
...
...
@@ -128,13 +132,13 @@
//this.$emit('finish')
},
// 确认图片
continuePhoto
()
{
async
continuePhoto
()
{
const
photo
=
getApp
().
globalData
.
photo
let
self
=
this
uni
.
showLoading
({
title
:
'图片保存中…'
})
self
.
saveTempToLocal
()
await
self
.
saveTempToLocal
()
if
(
this
.
upload
)
{
self
.
confirmUpload
(
true
)
...
...
This diff is collapsed.
Click to expand it.
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