Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
store-assistant
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit e1dec8d0
authored
Oct 28, 2022
by
杨北旺
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
优化授权
1 parent
20ea01e7
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
12 deletions
components/sharePopup/sharePopup.js
pages/tab/index/components/activeBox/activeBox.js
pages/tab/index/index.js
pages/tab/index/index.wxml
components/sharePopup/sharePopup.js
View file @
e1dec8d
...
@@ -170,8 +170,11 @@ Component({
...
@@ -170,8 +170,11 @@ Component({
wx
.
$api
.
showToast
(
'保存成功'
)
wx
.
$api
.
showToast
(
'保存成功'
)
},
},
fail
(
err
)
{
fail
(
err
)
{
const
auth
=
_this
.
selectComponent
(
'#auth'
)
if
(
err
.
errMsg
==
'saveImageToPhotosAlbum:fail auth deny'
){
auth
.
check
()
_this
.
triggerEvent
(
'showAuth'
,
true
)
}
// const auth = _this.selectComponent('#auth')
// auth.check()
}
}
}
}
)
)
...
...
pages/tab/index/components/activeBox/activeBox.js
View file @
e1dec8d
...
@@ -140,11 +140,6 @@ Component({
...
@@ -140,11 +140,6 @@ Component({
// 分享活动(复制链接)
// 分享活动(复制链接)
copyActivityUrl
(
e
)
{
copyActivityUrl
(
e
)
{
wx
.
getSetting
({
success
:
(
res
)
=>
{
if
(
res
.
authSetting
[
'scope.writePhotosAlbum'
]
===
false
){
this
.
triggerEvent
(
'showAuth'
,
true
)
}
else
{
let
{
item
}
=
e
.
currentTarget
.
dataset
let
{
item
}
=
e
.
currentTarget
.
dataset
let
thisPage
=
wx
.
$router
.
getPageInstance
()
let
thisPage
=
wx
.
$router
.
getPageInstance
()
wx
.
$api
.
showLoading
()
wx
.
$api
.
showLoading
()
...
@@ -181,9 +176,6 @@ Component({
...
@@ -181,9 +176,6 @@ Component({
},
},
})
})
})
})
}
}
})
},
},
...
...
pages/tab/index/index.js
View file @
e1dec8d
...
@@ -217,6 +217,9 @@ Page({
...
@@ -217,6 +217,9 @@ Page({
*/
*/
onShareAppMessage
:
function
()
{
onShareAppMessage
:
function
()
{
},
},
authFail
(){
},
toShowAuth
(){
toShowAuth
(){
this
.
setData
({
this
.
setData
({
showAuth
:
true
showAuth
:
true
...
...
pages/tab/index/index.wxml
View file @
e1dec8d
...
@@ -39,11 +39,13 @@
...
@@ -39,11 +39,13 @@
<!-- 预约安装弹窗 -->
<!-- 预约安装弹窗 -->
<install-popup show="{{showPopup}}" data="{{installItem}}" bind:hidePopup="hidePopup"></install-popup>
<install-popup show="{{showPopup}}" data="{{installItem}}" bind:hidePopup="hidePopup"></install-popup>
<!-- 分享活动弹窗 -->
<!-- 分享活动弹窗 -->
<share-popup data="{{sharePopupData}}"></share-popup>
<share-popup
bind:showAuth="toShowAuth"
data="{{sharePopupData}}"></share-popup>
<!-- <van-popup show="{{ showSharePopup }}" round bind:close="onClose">
<!-- <van-popup show="{{ showSharePopup }}" round bind:close="onClose">
<image style="width: 352rpx; height: 352rpx;" src="{{imagePath}}"></image>
<image style="width: 352rpx; height: 352rpx;" src="{{imagePath}}"></image>
</van-popup> -->
</van-popup> -->
</view>
</view>
</block>
</block>
<authorize scopeType="writePhotosAlbum" bindfail="authFail" show="{{showAuth}}" id="auth"></authorize>
<block wx:if="{{showAuth}}">
<authorize title="下载前需要获取您的‘添加到相册’权限,是否打开授权设置?" scopeType="writePhotosAlbum" buttonType="openSetting" bindfail="authFail" show="{{showAuth}}" id="auth"></authorize>
</block>
Write
Preview
Markdown
is supported
Attach a file
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 post a comment