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
b84a5923
Commit
b84a5923
authored
Jul 30, 2021
by
Damon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 相册授权提示
parent
951fbef2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
5 deletions
+32
-5
preview.vue
src/components/photo/preview.vue
+32
-5
No files found.
src/components/photo/preview.vue
View file @
b84a5923
...
...
@@ -72,17 +72,27 @@
return
}
let
path
=
''
let
pass
=
true
if
(
photo
.
tempPath
.
origin
&&
photo
?.
waterSetting
?.
hasOrigin
){
// 保存原图到本地
path
=
photo
.
tempPath
.
origin
this
.
saveLocal
(
path
).
then
(
res
=>
{
await
this
.
saveLocal
(
path
).
then
(
res
=>
{
uni
.
showToast
({
icon
:
'none'
,
title
:
'已将照片原图保存到本地相册'
})
})
}).
catch
(
e
=>
{
uni
.
showToast
({
icon
:
'none'
,
title
:
e
})
pass
=
false
that
.
$parent
.
goBack
()
})
}
// 如果用户不同意保存到相册
if
(
!
pass
)
return
if
(
photo
.
tempPath
.
mixWater
){
// 保存水印处理图片到本地
path
=
photo
.
tempPath
.
mixWater
...
...
@@ -97,7 +107,7 @@
icon
:
'none'
,
title
:
e
})
resolve
()
that
.
$parent
.
goBack
()
})
}
})
...
...
@@ -110,7 +120,24 @@
resolve
(
true
)
},
fail
(
e
)
{
reject
(
'保存失败'
)
uni
.
showModal
({
content
:
'拒绝授权将无法保存图片到本地,是否去设置打开?'
,
confirmText
:
"确认"
,
cancelText
:
'取消'
,
success
(
res
)
{
if
(
res
.
confirm
)
{
wx
.
openSetting
({
success
(
res
)
{
resolve
(
true
)
}
})
}
else
if
(
res
.
cancel
)
{
reject
(
'保存失败'
)
}
},
fail
()
{
}
})
}
})
})
...
...
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