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
d56ffa8c
Commit
d56ffa8c
authored
Jan 04, 2021
by
和慭琛
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
再次授权相关问题
第二轮提测版本
parent
ff1b16d6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
218 additions
and
14 deletions
+218
-14
detail.vue
take-order/pages/photo/detail.vue
+1
-1
product.vue
take-order/pages/photo/product.vue
+0
-2
try.vue
take-order/pages/photo/try.vue
+217
-11
No files found.
take-order/pages/photo/detail.vue
View file @
d56ffa8c
...
...
@@ -7,7 +7,7 @@
<u-swiper
@
click=
"imageClick"
@
change=
"changeSwipter"
img-mode=
"
scaleTo
Fill"
img-mode=
"
aspect
Fill"
bg-color=
"#333333"
:height=
"600"
:list=
"swiperList"
:autoplay=
"false"
...
...
take-order/pages/photo/product.vue
View file @
d56ffa8c
...
...
@@ -22,8 +22,6 @@
onLoad
(
e
)
{
this
.
getProductList
()
},
methods
:
{
...
...
take-order/pages/photo/try.vue
View file @
d56ffa8c
<
template
>
<view
class=
"blackBackColor"
>
<camera
device-position=
"back"
flash=
"off"
style=
'width:100%; height:100vh;'
>
<camera
device-position=
"back"
flash=
"off"
style=
'width:100%; height:100vh;'
@
error=
"cameraRefuse"
>
<cover-view
class=
"locationView"
>
<cover-view
class=
"locationText u-m-l-20 u-m-t-30"
>
经度:
{{
longitude
}}
</cover-view>
<cover-view
class=
"locationText u-m-l-20 u-m-t-10"
>
维度:
{{
latitude
}}
</cover-view>
...
...
@@ -17,8 +17,8 @@
<!--cover-image class='flashIcon' :src='icon_light_on_white' @click="flashClick()">
</cover-image-->
</cover-view>
<
button
@
click=
"openSetting"
>
打开设置页
</button
>
<
button
open-type=
"openSetting"
@
opensetting=
"callback"
>
打开设置页1111
</button
>
<
!--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>
</view>
...
...
@@ -153,9 +153,74 @@
that
.
longitude
=
res
.
longitude
that
.
latitude
=
res
.
latitude
that
.
baiduLocation
()
},
fail
()
{
that
.
showLocationAuthModal
()
}
});
},
//定位 再次授权弹窗
showLocationAuthModal
:
function
(){
let
that
=
this
uni
.
showModal
({
content
:
'拒绝授权将无法定位当前位置,是否去设置打开?'
,
confirmText
:
"确认"
,
cancelText
:
'取消'
,
success
(
res
)
{
if
(
res
.
confirm
){
that
.
openLocationSetting
()
}
if
(
res
.
cancel
){
uni
.
navigateBack
({
})
}
},
fail
()
{
console
.
log
(
''
)
}
})
},
//定位设置界面
openLocationSetting
()
{
let
that
=
this
wx
.
openSetting
({
success
(
res
)
{
console
.
log
(
res
,
'openSetting.res'
)
console
.
log
(
res
.
authSetting
,
'openSetting.res.authSetting'
)
console
.
log
(
res
.
authSetting
[
'scope.camera'
],
'openSetting.res.authSetting.scope.camera'
)
console
.
log
(
res
.
authSetting
[
'scope.userInfo'
],
'openSetting.res.authSetting.scope.userInfo'
)
if
(
res
.
authSetting
[
'scope.userInfo'
]
&&
res
.
authSetting
[
'scope.userInfo'
]
==
true
){
console
.
log
(
'33333location reload page'
)
that
.
reloadPage
()
}
else
{
that
.
showLocationAuthModal
()
console
.
log
(
'444444'
)
}
}
})
},
//刷新当前页
reloadPage
:
function
(){
uni
.
redirectTo
({
url
:
'/pages/photo/try'
});
},
//获取 水印 本地缓存路径
getMarkPath
:
function
()
{
...
...
@@ -176,18 +241,68 @@
callback
(
res
)
{
console
.
log
(
res
,
'res-callback'
)
},
openSetting
()
{
//相机设置界面
openCameraSetting
()
{
let
that
=
this
wx
.
openSetting
({
success
(
res
)
{
console
.
log
(
res
.
authSetting
,
'openSetting'
)
// res.authSetting = {
// "scope.userInfo": true,
// "scope.userLocation": true
// }
console
.
log
(
res
,
'openSetting.res'
)
console
.
log
(
res
.
authSetting
,
'openSetting.res.authSetting'
)
console
.
log
(
res
.
authSetting
[
'scope.camera'
],
'openSetting.res.authSetting.scope.camera'
)
console
.
log
(
res
.
authSetting
[
'scope.userInfo'
],
'openSetting.res.authSetting.scope.userInfo'
)
if
(
res
.
authSetting
[
'scope.camera'
]
&&
res
.
authSetting
[
'scope.camera'
]
==
true
){
console
.
log
(
'11111camera reload page'
)
that
.
reloadPage
()
}
else
{
that
.
showCameraAuthModal
()
console
.
log
(
'222222'
)
}
}
})
return
},
//相机 再次授权弹窗
showCameraAuthModal
:
function
(){
let
that
=
this
uni
.
showModal
({
content
:
'拒绝授权将无法拍照,是否去设置打开?'
,
confirmText
:
"确认"
,
cancelText
:
'取消'
,
success
(
res
)
{
if
(
res
.
confirm
){
that
.
openCameraSetting
()
}
if
(
res
.
cancel
){
uni
.
navigateBack
({
})
}
},
fail
()
{
console
.
log
(
''
)
}
})
},
//相机拒绝授权
cameraRefuse
:
function
(){
console
.
log
(
'相机拒绝授权'
)
this
.
showCameraAuthModal
()
},
//第一步: 拍照
takePhoto
()
{
...
...
@@ -312,12 +427,39 @@
})
let
timer
=
setTimeout
(()
=>
{
that
.
goBack
()
},
20
00
)
},
15
00
)
},
fail
()
{
// console.log('保存本地相册 失败')
///*
uni
.
showToast
({
icon
:
'none'
,
title
:
'保存本地相册失败'
})
uni
.
setStorage
({
key
:
'photo_tempPath'
,
data
:
tempImagePath
,
success
:
function
()
{
console
.
log
(
'tempImagePath save success'
);
let
timer
=
setTimeout
(()
=>
{
that
.
showAlbumAuthModal
()
},
1500
)
}
});
//*/
/*
let txt = '保存本地相册失败'
uni.getSetting({
success(res) {
let authSetting = res.authSetting
...
...
@@ -330,6 +472,7 @@
})
}
})
*/
// wx.openSetting({
// success (res) {
// console.log(res.authSetting,'openSetting')
...
...
@@ -353,6 +496,69 @@
}
})
},
//相册 再次授权弹窗
showAlbumAuthModal
:
function
(){
let
that
=
this
uni
.
showModal
({
content
:
'拒绝授权照片将无法保存到本地相册,是否去设置打开?'
,
confirmText
:
"确认"
,
cancelText
:
'取消'
,
success
(
res
)
{
if
(
res
.
confirm
){
that
.
openAlbumSetting
()
}
if
(
res
.
cancel
){
uni
.
navigateBack
({
})
}
},
fail
()
{
console
.
log
(
''
)
}
})
},
//相机设置界面
openAlbumSetting
()
{
let
that
=
this
wx
.
openSetting
({
success
(
res
)
{
console
.
log
(
res
,
'openSetting.res'
)
console
.
log
(
res
.
authSetting
,
'openSetting.res.authSetting'
)
console
.
log
(
res
.
authSetting
[
'scope.writePhotosAlbum'
],
'openSetting.res.authSetting.scope.writePhotosAlbum'
)
if
(
res
.
authSetting
[
'scope.writePhotosAlbum'
]
&&
res
.
authSetting
[
'scope.writePhotosAlbum'
]
==
true
){
console
.
log
(
'11111camera reload page'
)
uni
.
getStorage
({
key
:
'photo_tempPath'
,
success
:
function
(
res
)
{
that
.
saveToLocal
(
res
.
data
)
}
})
//that.reloadPage()
}
else
{
that
.
showAlbumAuthModal
()
console
.
log
(
'222222'
)
}
}
})
},
//获取当前时间
getTime
:
function
()
{
...
...
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