小程序分享朋友圈

 自定义分享朋友圈wxml代码

<van-action-sheet bind:close="onClose" bind:cancel="onClose" cancel-text="取消" title="分享页面"
        show="{{ showShare }}">
        <view class="shareBox">
            <button open-type="share" class="share_box">
                <!-- <van-icon name="friends" size="30" color="#07c160" /> -->
                <text class="iconfont icon-weixin"></text>
                <view class="share-title">
                    微信好友
                </view>
            </button>
            <button bind:tap="shareToPoster" class="share_box"> 
                <!-- <van-icon name="photo" size="30" color="#c79f5d" /> -->
                <text class="iconfont icon-pengyouquan"></text>
                <view class="share-title">
                    朋友圈
                </view>
            </button>
        </view>
    </van-action-sheet>
    <van-dialog closeOnClickOverlay use-slot bind:confirm="saveImage" theme="round-button" confirmButtonText="保存图片到相册" 
        show="{{ isShowShareDialog }}">
       
  <image src="/static/images/share_img.jpg" class="share-image"></image>
  <canvasdrawer painting="{{painting}}" class="canvasdrawer" bind:getImage="eventGetImage"/>



    </van-dialog>

分享海报

  shareToPoster(){
    // this.loadShare()
    var that=this
    that.setData({
      isShowShareDialog:true
    })
  },
  saveImage(e){
    console.log("保存图片")
    wx.saveImageToPhotosAlbum({
      filePath: "/static/images/share_img.jpg",
      success(res) {
          wx.showToast({
              title: '保存图片成功',
              icon: 'success',
              duration: 2000
          })
      }
  })
  },

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值