Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
take_order
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
和慭琛
take_order
Commits
1741eb39
Commit
1741eb39
authored
Jan 04, 2021
by
李俊赕
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
拒绝权限问题
parent
cf477d5d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
60 additions
and
4 deletions
+60
-4
try.vue
take-order/pages/photo/try.vue
+60
-4
No files found.
take-order/pages/photo/try.vue
View file @
1741eb39
...
@@ -17,6 +17,8 @@
...
@@ -17,6 +17,8 @@
<!--cover-image class='flashIcon' :src='icon_light_on_white' @click="flashClick()">
</cover-image-->
<!--cover-image class='flashIcon' :src='icon_light_on_white' @click="flashClick()">
</cover-image-->
</cover-view>
</cover-view>
<button
@
click=
"openSetting"
>
打开设置页
</button>
<button
open-type=
"openSetting"
@
opensetting=
"callback"
>
打开设置页1111
</button>
<canvas
v-show=
'showImage'
canvas-id=
"canvas"
:style=
"
{'width':canvasWidth+'px','height': canvasHeight + 'px'}">
</canvas>
<canvas
v-show=
'showImage'
canvas-id=
"canvas"
:style=
"
{'width':canvasWidth+'px','height': canvasHeight + 'px'}">
</canvas>
</view>
</view>
...
@@ -53,6 +55,7 @@
...
@@ -53,6 +55,7 @@
canvasWidth
:
0
,
canvasWidth
:
0
,
canvasHeight
:
0
,
canvasHeight
:
0
,
restuleImage
:
''
,
restuleImage
:
''
,
authSetting
:[]
}
}
},
},
onLoad
(
e
)
{
onLoad
(
e
)
{
...
@@ -67,6 +70,15 @@
...
@@ -67,6 +70,15 @@
})
})
//this.address = ''
//this.address = ''
},
},
onShow
(){
// uni.authorize({
// scope: 'scope.writePhotosAlbum',
// success() {
// console.log('userLocation')
// // uni.getLocation()
// }
// })
},
methods
:
{
methods
:
{
goPage
(){
goPage
(){
// 进入图片预览页
// 进入图片预览页
...
@@ -126,9 +138,24 @@
...
@@ -126,9 +138,24 @@
})
})
},
},
callback
(
res
){
console
.
log
(
res
,
'res-callback'
)
},
openSetting
(){
wx
.
openSetting
({
success
(
res
)
{
console
.
log
(
res
.
authSetting
,
'openSetting'
)
// res.authSetting = {
// "scope.userInfo": true,
// "scope.userLocation": true
// }
}
})
return
},
//第一步: 拍照
//第一步: 拍照
takePhoto
()
{
takePhoto
()
{
let
that
=
this
let
that
=
this
this
.
ctx
.
takePhoto
({
this
.
ctx
.
takePhoto
({
quality
:
'high'
,
quality
:
'high'
,
...
@@ -251,12 +278,41 @@
...
@@ -251,12 +278,41 @@
},
},
fail
()
{
fail
()
{
// console.log('保存本地相册 失败')
// console.log('保存本地相册 失败')
let
txt
=
'保存本地相册失败'
uni
.
getSetting
({
success
(
res
)
{
let
authSetting
=
res
.
authSetting
if
(
!
authSetting
[
'scope.writePhotosAlbum'
]){
txt
=
'请打开相册权限'
}
uni
.
showToast
({
uni
.
showToast
({
icon
:
'none'
,
icon
:
'none'
,
title
:
'保存本地相册失败'
title
:
txt
})
})
}
}
})
})
// wx.openSetting({
// success (res) {
// console.log(res.authSetting,'openSetting')
// // res.authSetting = {
// // "scope.userInfo": true,
// // "scope.userLocation": true
// // }
// }
// })
// uni.authorize({
// scope: 'scope.writePhotosAlbum',
// success() {
// console.log('userLocation')
// uni.openSetting({
// success(res) {
// console.log(res,'openSetting')
// }
// });
// }
// })
}
})
},
},
//获取当前时间
//获取当前时间
...
...
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