Commit 602a742d by 杨北旺

修改首页相册授权

1 parent 6b03a114
......@@ -45,4 +45,4 @@
<canvas style="width:355px;height:370px; margin:0 auto;" canvas-id="mycanvas" />
</view>
</view>
<authorize scopeType="writePhotosAlbum" bindfail="authFail" show="{{showAuth}}" id="auth"></authorize>
<!-- <authorize scopeType="writePhotosAlbum" bindfail="authFail" show="{{showAuth}}" id="auth"></authorize> -->
......@@ -140,42 +140,52 @@ Component({
// 分享活动(复制链接)
copyActivityUrl(e) {
let { item } = e.currentTarget.dataset
let thisPage = wx.$router.getPageInstance()
wx.$api.showLoading()
ActivityApi.getActivityPosters({id: item.id}).then(res => {
// var code= QR.createQrCodeImg(res.activityUrl);
// /*code是指图片base64格式数据*/
// //声明文件系统
// const fs = wx.getFileSystemManager();
// //随机定义路径名称
// var times = new Date().getTime();
// var codeimg = wx.env.USER_DATA_PATH + '/' + times + '.png';
// //将base64图片写入
// fs.writeFile({
// filePath: codeimg,
// data: code.slice(22),
// encoding: 'base64',
// success: () => {
// thisPage.setData({
// sharePopupData: {
// imagePath: codeimg,
// activityName: res.activityName,
// address: res.activityAddressDetailName,
// posterImg: res.posterImg,
// showSharePopup: true
// },
// })
// }
// });
thisPage.setData({
sharePopupData: {
posterImg: res,
activityName: item.activityName,
showSharePopup: true
},
})
wx.getSetting({
success: (res)=> {
if(res.authSetting['scope.writePhotosAlbum']===false){
this.triggerEvent('showAuth',true)
}else{
let { item } = e.currentTarget.dataset
let thisPage = wx.$router.getPageInstance()
wx.$api.showLoading()
ActivityApi.getActivityPosters({id: item.id}).then(res => {
// var code= QR.createQrCodeImg(res.activityUrl);
// /*code是指图片base64格式数据*/
// //声明文件系统
// const fs = wx.getFileSystemManager();
// //随机定义路径名称
// var times = new Date().getTime();
// var codeimg = wx.env.USER_DATA_PATH + '/' + times + '.png';
// //将base64图片写入
// fs.writeFile({
// filePath: codeimg,
// data: code.slice(22),
// encoding: 'base64',
// success: () => {
// thisPage.setData({
// sharePopupData: {
// imagePath: codeimg,
// activityName: res.activityName,
// address: res.activityAddressDetailName,
// posterImg: res.posterImg,
// showSharePopup: true
// },
// })
// }
// });
thisPage.setData({
sharePopupData: {
posterImg: res,
activityName: item.activityName,
showSharePopup: true
},
})
})
}
}
})
},
// 活动详情
goToDetail(e) {
......
......@@ -216,5 +216,10 @@ Page({
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
toShowAuth(){
this.setData({
showAuth:true
})
}
})
......@@ -23,7 +23,7 @@
<!-- 活动中 -->
<scroll-view scroll-y class="content" refresher-enabled bindrefresherrefresh="activityRefresh" bindscrolltolower="scrollonReachBottom" bindscroll="scrollIng" data-type="{{1}}" refresher-triggered="{{activeTrigger}}" hidden="{{tabIndex != 0}}">
<block>
<active-box activeList="{{activeList}}" nothing="{{nothing}}" activeDateIndex="{{activeDateIndex}}"></active-box>
<active-box bind:showAuth="toShowAuth" activeList="{{activeList}}" nothing="{{nothing}}" activeDateIndex="{{activeDateIndex}}"></active-box>
</block>
</scroll-view>
<!-- 活动诊断 -->
......@@ -45,3 +45,5 @@
</van-popup> -->
</view>
</block>
<authorize scopeType="writePhotosAlbum" bindfail="authFail" show="{{showAuth}}" id="auth"></authorize>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!