123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- import $toast from "../utils/tool/toast";
- export default {
- data:function () {
- return {
- authorize:false, // 用户是否授权
- }
- },
- methods:{
- openSetting(){
- this.buttonAuthorize = true;
- },
- openPoster(){
- this.$refs.poster && this.$refs.poster.open();
- }
- },
- onShow(){
- if (this.buttonAuthorize) {
- this.buttonAuthorize = false;
- // 获取授权
- uni.authorize({
- scope:'scope.writePhotosAlbum',
- success: (res) =>{
- this.authorize= true;
- },
- fail:() => {
- this.authorize= false;
- }
- });
- }
- },
- created(){
- this.buttonAuthorize = true;
- }
- }
|