Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
business-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 4cb39b56
authored
Nov 07, 2022
by
luyt
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
feat:添加下载权限判断
1 parent
aa504631
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
6 deletions
pages/checkProduct/checkProduct.js
pages/checkProduct/checkProduct.wxml
pages/checkProduct/checkProduct.js
View file @
4cb39b5
...
@@ -52,7 +52,9 @@ Page({
...
@@ -52,7 +52,9 @@ Page({
isAuthphone
:
true
,
//授权昵称弹窗显示,更多按钮显示
isAuthphone
:
true
,
//授权昵称弹窗显示,更多按钮显示
// 视频播放地址
// 视频播放地址
videoSrc
:
''
,
videoSrc
:
''
,
videoTitle
:
''
videoTitle
:
''
,
//下载海报授权
showAuth
:
false
,
},
},
observers
:
{
observers
:
{
actNum
:
function
(
actNum
)
{
actNum
:
function
(
actNum
)
{
...
@@ -200,10 +202,18 @@ Page({
...
@@ -200,10 +202,18 @@ Page({
content: '生成并下载页面为海报',
content: '生成并下载页面为海报',
success: async res => {
success: async res => {
if (res.confirm) {
if (res.confirm) {
// let hasAuth = await _this.toSetting()
wx.getSetting({
// if(hasAuth){
success: (res)=> {
_this.download()
if(res.authSetting['scope.writePhotosAlbum']===false){
// }
_this.setData({
showAuth: true
})
}else{
_this.download()
}
}
})
}
}
},
},
confirmText:'下载',
confirmText:'下载',
...
@@ -365,6 +375,16 @@ Page({
...
@@ -365,6 +375,16 @@ Page({
}
}
})
})
},
},
authFail
(){
wx
.
showToast
({
title
:
"下载海报前需要您授权'添加到相册'权限"
,
icon
:
"none"
,
duration
:
2500
,
});
},
authSuccess
(){
this
.
download
()
},
// //模态框关闭
// //模态框关闭
// modelClose() {
// modelClose() {
// this.triggerEvent("modelclose", false);
// this.triggerEvent("modelclose", false);
...
...
pages/checkProduct/checkProduct.wxml
View file @
4cb39b5
...
@@ -57,4 +57,8 @@
...
@@ -57,4 +57,8 @@
<!-- !hasUserInfo && !isShow -->
<!-- !hasUserInfo && !isShow -->
<view wx:if="{{!hasUserInfo && isShare && isAuthphone}}" class="user-profile" bindtap="getUserProfile"></view>
<view wx:if="{{!hasUserInfo && isShare && isAuthphone}}" class="user-profile" bindtap="getUserProfile"></view>
<!-- 全屏视频组件 -->
<!-- 全屏视频组件 -->
<FullscreenVideo id="videocomp1" src="{{videoSrc}}" title="{{videoTitle}}"></FullscreenVideo>
\ No newline at end of file
\ No newline at end of file
<FullscreenVideo id="videocomp1" src="{{videoSrc}}" title="{{videoTitle}}"></FullscreenVideo>
<!-- 下载授权 -->
<block wx:if="{{showAuth}}">
<authorize title="下载前需要获取您的‘添加到相册’权限,是否打开授权设置?" scopeType="writePhotosAlbum" buttonType="openSetting" bindfail="authFail" bindsuccess="authSuccess" show="{{showAuth}}"></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