zoukankan      html  css  js  c++  java
  • 小程序 之生成海报与保存到本地

    一、效果图

     二、代码

    <button wx:if="{{is_authorize==false}}" open-type="openSetting" class="weui-btn mini-btn font-size16" style="margin-top: 0;background-color: #5DBF44;color: #fff;line-height:90rpx;100%;padding:0">保存名片海报后分享</button>
            <button wx:else bindtap="saveHaibao" class="weui-btn mini-btn font-size16" style="margin-top: 0;background-color: #5DBF44;color: #fff;line-height:90rpx;100%;padding:0">保存名片海报后分享</button>
    onShow:function (){
        wx.getSetting({
          success(res){
          console.log(res)
            _this.setData({
              is_authorize: res.authSetting['scope.writePhotosAlbum']
            })
          }
        })
    }
    saveHaibao(){
        wx.saveImageToPhotosAlbum({
          filePath: _this.data.url,
          success(res){
          console.log(res)
            if (res.errMsg == 'saveImageToPhotosAlbum:ok') {
                _this.showImage()
            }
          }
        })
    }
  • 相关阅读:
    Minimum Path Sum
    Unique Paths II
    Unique Paths
    Rotate List
    Permutation Sequence
    Merge Intervals
    Jump Game
    Group Anagrams
    Combination Sum II
    评分
  • 原文地址:https://www.cnblogs.com/yang-2018/p/12855356.html
Copyright © 2011-2022 走看看